diff --git a/CHANGELOG.md b/CHANGELOG.md index 03c985ba..3879e1d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [3.6.10] - 2025-09-16 + +### Added +- Claude Code statusline integration for real-time memory status +- MCP memory tools server providing compress, stats, search, and overview commands +- Concept documentation explaining memory compression and context loading + +### Fixed +- Corrected integration architecture to use hooks instead of MCP SDK + + ## [3.6.9] - 2025-09-14 ### Added diff --git a/dist/claude-mem.min.js b/dist/claude-mem.min.js index 02c3fd4c..b9c1df6a 100755 --- a/dist/claude-mem.min.js +++ b/dist/claude-mem.min.js @@ -1,18 +1,18 @@ #!/usr/bin/env node -import{createRequire as fw}from"node:module";var Kw=Object.create;var{getPrototypeOf:jw,defineProperty:s7,getOwnPropertyNames:Pw}=Object;var Yw=Object.prototype.hasOwnProperty;var Pq=(q,_,j)=>{j=q!=null?Kw(jw(q)):{};let K=_||!q||!q.__esModule?s7(j,"default",{value:q,enumerable:!0}):j;for(let Y of Pw(q))if(!Yw.call(K,Y))s7(K,Y,{get:()=>q[Y],enumerable:!0});return K};var _8=(q,_)=>()=>(_||q((_={exports:{}}).exports,_),_.exports);var EK=(q,_)=>{for(var j in _)s7(q,j,{get:_[j],enumerable:!0,configurable:!0,set:(K)=>_[j]=()=>K})};var f6=(q,_)=>()=>(q&&(_=q(q=0)),_);var h6=fw(import.meta.url);var RK=_8(($w)=>{class Q7 extends Error{constructor(q,_,j){super(j);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=_,this.exitCode=q,this.nestedError=void 0}}class e9 extends Q7{constructor(q){super(1,"commander.invalidArgument",q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}$w.CommanderError=Q7;$w.InvalidArgumentError=e9});var g3=_8((Ww)=>{var{InvalidArgumentError:zw}=RK();class F9{constructor(q,_){switch(this.description=_||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,q[0]){case"<":this.required=!0,this._name=q.slice(1,-1);break;case"[":this.required=!1,this._name=q.slice(1,-1);break;default:this.required=!0,this._name=q;break}if(this._name.length>3&&this._name.slice(-3)==="...")this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_concatValue(q,_){if(_===this.defaultValue||!Array.isArray(_))return[q];return _.concat(q)}default(q,_){return this.defaultValue=q,this.defaultValueDescription=_,this}argParser(q){return this.parseArg=q,this}choices(q){return this.argChoices=q.slice(),this.parseArg=(_,j)=>{if(!this.argChoices.includes(_))throw new zw(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(_,j);return _},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function vw(q){let _=q.name()+(q.variadic===!0?"...":"");return q.required?"<"+_+">":"["+_+"]"}Ww.Argument=F9;Ww.humanReadableArgName=vw});var q4=_8((Zw)=>{var{humanReadableArgName:Tw}=g3();class U9{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(q){this.helpWidth=this.helpWidth??q.helpWidth??80}visibleCommands(q){let _=q.commands.filter((K)=>!K._hidden),j=q._getHelpCommand();if(j&&!j._hidden)_.push(j);if(this.sortSubcommands)_.sort((K,Y)=>{return K.name().localeCompare(Y.name())});return _}compareOptions(q,_){let j=(K)=>{return K.short?K.short.replace(/^-/,""):K.long.replace(/^--/,"")};return j(q).localeCompare(j(_))}visibleOptions(q){let _=q.options.filter((K)=>!K.hidden),j=q._getHelpOption();if(j&&!j.hidden){let K=j.short&&q._findOption(j.short),Y=j.long&&q._findOption(j.long);if(!K&&!Y)_.push(j);else if(j.long&&!Y)_.push(q.createOption(j.long,j.description));else if(j.short&&!K)_.push(q.createOption(j.short,j.description))}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleGlobalOptions(q){if(!this.showGlobalOptions)return[];let _=[];for(let j=q.parent;j;j=j.parent){let K=j.options.filter((Y)=>!Y.hidden);_.push(...K)}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleArguments(q){if(q._argsDescription)q.registeredArguments.forEach((_)=>{_.description=_.description||q._argsDescription[_.name()]||""});if(q.registeredArguments.find((_)=>_.description))return q.registeredArguments;return[]}subcommandTerm(q){let _=q.registeredArguments.map((j)=>Tw(j)).join(" ");return q._name+(q._aliases[0]?"|"+q._aliases[0]:"")+(q.options.length?" [options]":"")+(_?" "+_:"")}optionTerm(q){return q.flags}argumentTerm(q){return q.name()}longestSubcommandTermLength(q,_){return _.visibleCommands(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleSubcommandTerm(_.subcommandTerm(K))))},0)}longestOptionTermLength(q,_){return _.visibleOptions(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleOptionTerm(_.optionTerm(K))))},0)}longestGlobalOptionTermLength(q,_){return _.visibleGlobalOptions(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleOptionTerm(_.optionTerm(K))))},0)}longestArgumentTermLength(q,_){return _.visibleArguments(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleArgumentTerm(_.argumentTerm(K))))},0)}commandUsage(q){let _=q._name;if(q._aliases[0])_=_+"|"+q._aliases[0];let j="";for(let K=q.parent;K;K=K.parent)j=K.name()+" "+j;return j+_+" "+q.usage()}commandDescription(q){return q.description()}subcommandDescription(q){return q.summary()||q.description()}optionDescription(q){let _=[];if(q.argChoices)_.push(`choices: ${q.argChoices.map((j)=>JSON.stringify(j)).join(", ")}`);if(q.defaultValue!==void 0){if(q.required||q.optional||q.isBoolean()&&typeof q.defaultValue==="boolean")_.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`)}if(q.presetArg!==void 0&&q.optional)_.push(`preset: ${JSON.stringify(q.presetArg)}`);if(q.envVar!==void 0)_.push(`env: ${q.envVar}`);if(_.length>0){let j=`(${_.join(", ")})`;if(q.description)return`${q.description} ${j}`;return j}return q.description}argumentDescription(q){let _=[];if(q.argChoices)_.push(`choices: ${q.argChoices.map((j)=>JSON.stringify(j)).join(", ")}`);if(q.defaultValue!==void 0)_.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`);if(_.length>0){let j=`(${_.join(", ")})`;if(q.description)return`${q.description} ${j}`;return j}return q.description}formatItemList(q,_,j){if(_.length===0)return[];return[j.styleTitle(q),..._,""]}groupItems(q,_,j){let K=new Map;return q.forEach((Y)=>{let f=j(Y);if(!K.has(f))K.set(f,[])}),_.forEach((Y)=>{let f=j(Y);if(!K.has(f))K.set(f,[]);K.get(f).push(Y)}),K}formatHelp(q,_){let j=_.padWidth(q,_),K=_.helpWidth??80;function Y(v,z){return _.formatItem(v,j,z,_)}let f=[`${_.styleTitle("Usage:")} ${_.styleUsage(_.commandUsage(q))}`,""],P=_.commandDescription(q);if(P.length>0)f=f.concat([_.boxWrap(_.styleCommandDescription(P),K),""]);let $=_.visibleArguments(q).map((v)=>{return Y(_.styleArgumentTerm(_.argumentTerm(v)),_.styleArgumentDescription(_.argumentDescription(v)))});if(f=f.concat(this.formatItemList("Arguments:",$,_)),this.groupItems(q.options,_.visibleOptions(q),(v)=>v.helpGroupHeading??"Options:").forEach((v,z)=>{let W=v.map((J)=>{return Y(_.styleOptionTerm(_.optionTerm(J)),_.styleOptionDescription(_.optionDescription(J)))});f=f.concat(this.formatItemList(z,W,_))}),_.showGlobalOptions){let v=_.visibleGlobalOptions(q).map((z)=>{return Y(_.styleOptionTerm(_.optionTerm(z)),_.styleOptionDescription(_.optionDescription(z)))});f=f.concat(this.formatItemList("Global Options:",v,_))}return this.groupItems(q.commands,_.visibleCommands(q),(v)=>v.helpGroup()||"Commands:").forEach((v,z)=>{let W=v.map((J)=>{return Y(_.styleSubcommandTerm(_.subcommandTerm(J)),_.styleSubcommandDescription(_.subcommandDescription(J)))});f=f.concat(this.formatItemList(z,W,_))}),f.join(` +import{createRequire as $w}from"node:module";var jw=Object.create;var{getPrototypeOf:Pw,defineProperty:s7,getOwnPropertyNames:Yw}=Object;var fw=Object.prototype.hasOwnProperty;var Pq=(q,_,j)=>{j=q!=null?jw(Pw(q)):{};let K=_||!q||!q.__esModule?s7(j,"default",{value:q,enumerable:!0}):j;for(let Y of Yw(q))if(!fw.call(K,Y))s7(K,Y,{get:()=>q[Y],enumerable:!0});return K};var _8=(q,_)=>()=>(_||q((_={exports:{}}).exports,_),_.exports);var EK=(q,_)=>{for(var j in _)s7(q,j,{get:_[j],enumerable:!0,configurable:!0,set:(K)=>_[j]=()=>K})};var f6=(q,_)=>()=>(q&&(_=q(q=0)),_);var h6=$w(import.meta.url);var RK=_8((ww)=>{class Q7 extends Error{constructor(q,_,j){super(j);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=_,this.exitCode=q,this.nestedError=void 0}}class e9 extends Q7{constructor(q){super(1,"commander.invalidArgument",q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}ww.CommanderError=Q7;ww.InvalidArgumentError=e9});var g3=_8((Hw)=>{var{InvalidArgumentError:vw}=RK();class F9{constructor(q,_){switch(this.description=_||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,q[0]){case"<":this.required=!0,this._name=q.slice(1,-1);break;case"[":this.required=!1,this._name=q.slice(1,-1);break;default:this.required=!0,this._name=q;break}if(this._name.length>3&&this._name.slice(-3)==="...")this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_concatValue(q,_){if(_===this.defaultValue||!Array.isArray(_))return[q];return _.concat(q)}default(q,_){return this.defaultValue=q,this.defaultValueDescription=_,this}argParser(q){return this.parseArg=q,this}choices(q){return this.argChoices=q.slice(),this.parseArg=(_,j)=>{if(!this.argChoices.includes(_))throw new vw(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(_,j);return _},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function Ww(q){let _=q.name()+(q.variadic===!0?"...":"");return q.required?"<"+_+">":"["+_+"]"}Hw.Argument=F9;Hw.humanReadableArgName=Ww});var q4=_8((kw)=>{var{humanReadableArgName:Zw}=g3();class U9{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(q){this.helpWidth=this.helpWidth??q.helpWidth??80}visibleCommands(q){let _=q.commands.filter((K)=>!K._hidden),j=q._getHelpCommand();if(j&&!j._hidden)_.push(j);if(this.sortSubcommands)_.sort((K,Y)=>{return K.name().localeCompare(Y.name())});return _}compareOptions(q,_){let j=(K)=>{return K.short?K.short.replace(/^-/,""):K.long.replace(/^--/,"")};return j(q).localeCompare(j(_))}visibleOptions(q){let _=q.options.filter((K)=>!K.hidden),j=q._getHelpOption();if(j&&!j.hidden){let K=j.short&&q._findOption(j.short),Y=j.long&&q._findOption(j.long);if(!K&&!Y)_.push(j);else if(j.long&&!Y)_.push(q.createOption(j.long,j.description));else if(j.short&&!K)_.push(q.createOption(j.short,j.description))}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleGlobalOptions(q){if(!this.showGlobalOptions)return[];let _=[];for(let j=q.parent;j;j=j.parent){let K=j.options.filter((Y)=>!Y.hidden);_.push(...K)}if(this.sortOptions)_.sort(this.compareOptions);return _}visibleArguments(q){if(q._argsDescription)q.registeredArguments.forEach((_)=>{_.description=_.description||q._argsDescription[_.name()]||""});if(q.registeredArguments.find((_)=>_.description))return q.registeredArguments;return[]}subcommandTerm(q){let _=q.registeredArguments.map((j)=>Zw(j)).join(" ");return q._name+(q._aliases[0]?"|"+q._aliases[0]:"")+(q.options.length?" [options]":"")+(_?" "+_:"")}optionTerm(q){return q.flags}argumentTerm(q){return q.name()}longestSubcommandTermLength(q,_){return _.visibleCommands(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleSubcommandTerm(_.subcommandTerm(K))))},0)}longestOptionTermLength(q,_){return _.visibleOptions(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleOptionTerm(_.optionTerm(K))))},0)}longestGlobalOptionTermLength(q,_){return _.visibleGlobalOptions(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleOptionTerm(_.optionTerm(K))))},0)}longestArgumentTermLength(q,_){return _.visibleArguments(q).reduce((j,K)=>{return Math.max(j,this.displayWidth(_.styleArgumentTerm(_.argumentTerm(K))))},0)}commandUsage(q){let _=q._name;if(q._aliases[0])_=_+"|"+q._aliases[0];let j="";for(let K=q.parent;K;K=K.parent)j=K.name()+" "+j;return j+_+" "+q.usage()}commandDescription(q){return q.description()}subcommandDescription(q){return q.summary()||q.description()}optionDescription(q){let _=[];if(q.argChoices)_.push(`choices: ${q.argChoices.map((j)=>JSON.stringify(j)).join(", ")}`);if(q.defaultValue!==void 0){if(q.required||q.optional||q.isBoolean()&&typeof q.defaultValue==="boolean")_.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`)}if(q.presetArg!==void 0&&q.optional)_.push(`preset: ${JSON.stringify(q.presetArg)}`);if(q.envVar!==void 0)_.push(`env: ${q.envVar}`);if(_.length>0){let j=`(${_.join(", ")})`;if(q.description)return`${q.description} ${j}`;return j}return q.description}argumentDescription(q){let _=[];if(q.argChoices)_.push(`choices: ${q.argChoices.map((j)=>JSON.stringify(j)).join(", ")}`);if(q.defaultValue!==void 0)_.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`);if(_.length>0){let j=`(${_.join(", ")})`;if(q.description)return`${q.description} ${j}`;return j}return q.description}formatItemList(q,_,j){if(_.length===0)return[];return[j.styleTitle(q),..._,""]}groupItems(q,_,j){let K=new Map;return q.forEach((Y)=>{let f=j(Y);if(!K.has(f))K.set(f,[])}),_.forEach((Y)=>{let f=j(Y);if(!K.has(f))K.set(f,[]);K.get(f).push(Y)}),K}formatHelp(q,_){let j=_.padWidth(q,_),K=_.helpWidth??80;function Y(v,z){return _.formatItem(v,j,z,_)}let f=[`${_.styleTitle("Usage:")} ${_.styleUsage(_.commandUsage(q))}`,""],P=_.commandDescription(q);if(P.length>0)f=f.concat([_.boxWrap(_.styleCommandDescription(P),K),""]);let $=_.visibleArguments(q).map((v)=>{return Y(_.styleArgumentTerm(_.argumentTerm(v)),_.styleArgumentDescription(_.argumentDescription(v)))});if(f=f.concat(this.formatItemList("Arguments:",$,_)),this.groupItems(q.options,_.visibleOptions(q),(v)=>v.helpGroupHeading??"Options:").forEach((v,z)=>{let W=v.map((J)=>{return Y(_.styleOptionTerm(_.optionTerm(J)),_.styleOptionDescription(_.optionDescription(J)))});f=f.concat(this.formatItemList(z,W,_))}),_.showGlobalOptions){let v=_.visibleGlobalOptions(q).map((z)=>{return Y(_.styleOptionTerm(_.optionTerm(z)),_.styleOptionDescription(_.optionDescription(z)))});f=f.concat(this.formatItemList("Global Options:",v,_))}return this.groupItems(q.commands,_.visibleCommands(q),(v)=>v.helpGroup()||"Commands:").forEach((v,z)=>{let W=v.map((J)=>{return Y(_.styleSubcommandTerm(_.subcommandTerm(J)),_.styleSubcommandDescription(_.subcommandDescription(J)))});f=f.concat(this.formatItemList(z,W,_))}),f.join(` `)}displayWidth(q){return s9(q).length}styleTitle(q){return q}styleUsage(q){return q.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_==="[command]")return this.styleSubcommandText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleCommandText(_)}).join(" ")}styleCommandDescription(q){return this.styleDescriptionText(q)}styleOptionDescription(q){return this.styleDescriptionText(q)}styleSubcommandDescription(q){return this.styleDescriptionText(q)}styleArgumentDescription(q){return this.styleDescriptionText(q)}styleDescriptionText(q){return q}styleOptionTerm(q){return this.styleOptionText(q)}styleSubcommandTerm(q){return q.split(" ").map((_)=>{if(_==="[options]")return this.styleOptionText(_);if(_[0]==="["||_[0]==="<")return this.styleArgumentText(_);return this.styleSubcommandText(_)}).join(" ")}styleArgumentTerm(q){return this.styleArgumentText(q)}styleOptionText(q){return q}styleArgumentText(q){return q}styleSubcommandText(q){return q}styleCommandText(q){return q}padWidth(q,_){return Math.max(_.longestOptionTermLength(q,_),_.longestGlobalOptionTermLength(q,_),_.longestSubcommandTermLength(q,_),_.longestArgumentTermLength(q,_))}preformatted(q){return/\n[^\S\r\n]/.test(q)}formatItem(q,_,j,K){let f=" ".repeat(2);if(!j)return f+q;let P=q.padEnd(_+q.length-K.displayWidth(q)),$=2,O=(this.helpWidth??80)-_-$-2,v;if(O{let P=f.match(K);if(P===null){Y.push("");return}let $=[P.shift()],w=this.displayWidth($[0]);P.forEach((O)=>{let v=this.displayWidth(O);if(w+v<=_){$.push(O),w+=v;return}Y.push($.join(""));let z=O.trimStart();$=[z],w=this.displayWidth(z)}),Y.push($.join(""))}),Y.join(` -`)}}function s9(q){let _=/\x1b\[\d*(;\d*)*m/g;return q.replace(_,"")}Zw.Help=U9;Zw.stripColor=s9});var _4=_8((uw)=>{var{InvalidArgumentError:Aw}=RK();class q5{constructor(q,_){this.flags=q,this.description=_||"",this.required=q.includes("<"),this.optional=q.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(q),this.mandatory=!1;let j=Gw(q);if(this.short=j.shortFlag,this.long=j.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(q,_){return this.defaultValue=q,this.defaultValueDescription=_,this}preset(q){return this.presetArg=q,this}conflicts(q){return this.conflictsWith=this.conflictsWith.concat(q),this}implies(q){let _=q;if(typeof q==="string")_={[q]:!0};return this.implied=Object.assign(this.implied||{},_),this}env(q){return this.envVar=q,this}argParser(q){return this.parseArg=q,this}makeOptionMandatory(q=!0){return this.mandatory=!!q,this}hideHelp(q=!0){return this.hidden=!!q,this}_concatValue(q,_){if(_===this.defaultValue||!Array.isArray(_))return[q];return _.concat(q)}choices(q){return this.argChoices=q.slice(),this.parseArg=(_,j)=>{if(!this.argChoices.includes(_))throw new Aw(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(_,j);return _},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return Q9(this.name().replace(/^no-/,""));return Q9(this.name())}helpGroup(q){return this.helpGroupHeading=q,this}is(q){return this.short===q||this.long===q}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class _5{constructor(q){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,q.forEach((_)=>{if(_.negate)this.negativeOptions.set(_.attributeName(),_);else this.positiveOptions.set(_.attributeName(),_)}),this.negativeOptions.forEach((_,j)=>{if(this.positiveOptions.has(j))this.dualOptions.add(j)})}valueFromOption(q,_){let j=_.attributeName();if(!this.dualOptions.has(j))return!0;let K=this.negativeOptions.get(j).presetArg,Y=K!==void 0?K:!1;return _.negate===(Y===q)}}function Q9(q){return q.split("-").reduce((_,j)=>{return _+j[0].toUpperCase()+j.slice(1)})}function Gw(q){let _,j,K=/^-[^-]$/,Y=/^--[^-]/,f=q.split(/[ |,]+/).concat("guard");if(K.test(f[0]))_=f.shift();if(Y.test(f[0]))j=f.shift();if(!_&&K.test(f[0]))_=f.shift();if(!_&&Y.test(f[0]))_=j,j=f.shift();if(f[0].startsWith("-")){let P=f[0],$=`option creation failed due to '${P}' in option flags '${q}'`;if(/^-[^-][^-]/.test(P))throw new Error(`${$} +`)}}function s9(q){let _=/\x1b\[\d*(;\d*)*m/g;return q.replace(_,"")}kw.Help=U9;kw.stripColor=s9});var _4=_8((hw)=>{var{InvalidArgumentError:Gw}=RK();class q5{constructor(q,_){this.flags=q,this.description=_||"",this.required=q.includes("<"),this.optional=q.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(q),this.mandatory=!1;let j=uw(q);if(this.short=j.shortFlag,this.long=j.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(q,_){return this.defaultValue=q,this.defaultValueDescription=_,this}preset(q){return this.presetArg=q,this}conflicts(q){return this.conflictsWith=this.conflictsWith.concat(q),this}implies(q){let _=q;if(typeof q==="string")_={[q]:!0};return this.implied=Object.assign(this.implied||{},_),this}env(q){return this.envVar=q,this}argParser(q){return this.parseArg=q,this}makeOptionMandatory(q=!0){return this.mandatory=!!q,this}hideHelp(q=!0){return this.hidden=!!q,this}_concatValue(q,_){if(_===this.defaultValue||!Array.isArray(_))return[q];return _.concat(q)}choices(q){return this.argChoices=q.slice(),this.parseArg=(_,j)=>{if(!this.argChoices.includes(_))throw new Gw(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(_,j);return _},this}name(){if(this.long)return this.long.replace(/^--/,"");return this.short.replace(/^-/,"")}attributeName(){if(this.negate)return Q9(this.name().replace(/^no-/,""));return Q9(this.name())}helpGroup(q){return this.helpGroupHeading=q,this}is(q){return this.short===q||this.long===q}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class _5{constructor(q){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,q.forEach((_)=>{if(_.negate)this.negativeOptions.set(_.attributeName(),_);else this.positiveOptions.set(_.attributeName(),_)}),this.negativeOptions.forEach((_,j)=>{if(this.positiveOptions.has(j))this.dualOptions.add(j)})}valueFromOption(q,_){let j=_.attributeName();if(!this.dualOptions.has(j))return!0;let K=this.negativeOptions.get(j).presetArg,Y=K!==void 0?K:!1;return _.negate===(Y===q)}}function Q9(q){return q.split("-").reduce((_,j)=>{return _+j[0].toUpperCase()+j.slice(1)})}function uw(q){let _,j,K=/^-[^-]$/,Y=/^--[^-]/,f=q.split(/[ |,]+/).concat("guard");if(K.test(f[0]))_=f.shift();if(Y.test(f[0]))j=f.shift();if(!_&&K.test(f[0]))_=f.shift();if(!_&&Y.test(f[0]))_=j,j=f.shift();if(f[0].startsWith("-")){let P=f[0],$=`option creation failed due to '${P}' in option flags '${q}'`;if(/^-[^-][^-]/.test(P))throw new Error(`${$} - a short flag is a single dash and a single character - either use a single dash and a single character (for a short flag) - or use a double dash for a long option (and can have two, like '--ws, --workspace')`);if(K.test(P))throw new Error(`${$} - too many short flags`);if(Y.test(P))throw new Error(`${$} - too many long flags`);throw new Error(`${$} -- unrecognised flag format`)}if(_===void 0&&j===void 0)throw new Error(`option creation failed due to no flags found in '${q}'.`);return{shortFlag:_,longFlag:j}}uw.Option=q5;uw.DualOptions=_5});var K5=_8((Mw)=>{function Cw(q,_){if(Math.abs(q.length-_.length)>3)return Math.max(q.length,_.length);let j=[];for(let K=0;K<=q.length;K++)j[K]=[K];for(let K=0;K<=_.length;K++)j[0][K]=K;for(let K=1;K<=_.length;K++)for(let Y=1;Y<=q.length;Y++){let f=1;if(q[Y-1]===_[K-1])f=0;else f=1;if(j[Y][K]=Math.min(j[Y-1][K]+1,j[Y][K-1]+1,j[Y-1][K-1]+f),Y>1&&K>1&&q[Y-1]===_[K-2]&&q[Y-2]===_[K-1])j[Y][K]=Math.min(j[Y][K],j[Y-2][K-2]+1)}return j[q.length][_.length]}function Vw(q,_){if(!_||_.length===0)return"";_=Array.from(new Set(_));let j=q.startsWith("--");if(j)q=q.slice(2),_=_.map((P)=>P.slice(2));let K=[],Y=3,f=0.4;if(_.forEach((P)=>{if(P.length<=1)return;let $=Cw(q,P),w=Math.max(q.length,P.length);if((w-$)/w>f){if($P.localeCompare($)),j)K=K.map((P)=>`--${P}`);if(K.length>1)return` +- unrecognised flag format`)}if(_===void 0&&j===void 0)throw new Error(`option creation failed due to no flags found in '${q}'.`);return{shortFlag:_,longFlag:j}}hw.Option=q5;hw.DualOptions=_5});var K5=_8((Nw)=>{function Vw(q,_){if(Math.abs(q.length-_.length)>3)return Math.max(q.length,_.length);let j=[];for(let K=0;K<=q.length;K++)j[K]=[K];for(let K=0;K<=_.length;K++)j[0][K]=K;for(let K=1;K<=_.length;K++)for(let Y=1;Y<=q.length;Y++){let f=1;if(q[Y-1]===_[K-1])f=0;else f=1;if(j[Y][K]=Math.min(j[Y-1][K]+1,j[Y][K-1]+1,j[Y-1][K-1]+f),Y>1&&K>1&&q[Y-1]===_[K-2]&&q[Y-2]===_[K-1])j[Y][K]=Math.min(j[Y][K],j[Y-2][K-2]+1)}return j[q.length][_.length]}function Mw(q,_){if(!_||_.length===0)return"";_=Array.from(new Set(_));let j=q.startsWith("--");if(j)q=q.slice(2),_=_.map((P)=>P.slice(2));let K=[],Y=3,f=0.4;if(_.forEach((P)=>{if(P.length<=1)return;let $=Vw(q,P),w=Math.max(q.length,P.length);if((w-$)/w>f){if($P.localeCompare($)),j)K=K.map((P)=>`--${P}`);if(K.length>1)return` (Did you mean one of ${K.join(", ")}?)`;if(K.length===1)return` -(Did you mean ${K[0]}?)`;return""}Mw.suggestSimilar=Vw});var f5=_8((gw)=>{var bw=h6("node:events").EventEmitter,K4=h6("node:child_process"),Eq=h6("node:path"),y3=h6("node:fs"),b8=h6("node:process"),{Argument:Sw,humanReadableArgName:Ew}=g3(),{CommanderError:j4}=RK(),{Help:Rw,stripColor:mw}=q4(),{Option:j5,DualOptions:Iw}=_4(),{suggestSimilar:P5}=K5();class Y4 extends bw{constructor(q){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=q||"",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:(_)=>b8.stdout.write(_),writeErr:(_)=>b8.stderr.write(_),outputError:(_,j)=>j(_),getOutHelpWidth:()=>b8.stdout.isTTY?b8.stdout.columns:void 0,getErrHelpWidth:()=>b8.stderr.isTTY?b8.stderr.columns:void 0,getOutHasColors:()=>P4()??(b8.stdout.isTTY&&b8.stdout.hasColors?.()),getErrHasColors:()=>P4()??(b8.stderr.isTTY&&b8.stderr.hasColors?.()),stripColor:(_)=>mw(_)},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(q){return this._outputConfiguration=q._outputConfiguration,this._helpOption=q._helpOption,this._helpCommand=q._helpCommand,this._helpConfiguration=q._helpConfiguration,this._exitCallback=q._exitCallback,this._storeOptionsAsProperties=q._storeOptionsAsProperties,this._combineFlagAndOptionalValue=q._combineFlagAndOptionalValue,this._allowExcessArguments=q._allowExcessArguments,this._enablePositionalOptions=q._enablePositionalOptions,this._showHelpAfterError=q._showHelpAfterError,this._showSuggestionAfterError=q._showSuggestionAfterError,this}_getCommandAndAncestors(){let q=[];for(let _=this;_;_=_.parent)q.push(_);return q}command(q,_,j){let K=_,Y=j;if(typeof K==="object"&&K!==null)Y=K,K=null;Y=Y||{};let[,f,P]=q.match(/([^ ]+) *(.*)/),$=this.createCommand(f);if(K)$.description(K),$._executableHandler=!0;if(Y.isDefault)this._defaultCommandName=$._name;if($._hidden=!!(Y.noHelp||Y.hidden),$._executableFile=Y.executableFile||null,P)$.arguments(P);if(this._registerCommand($),$.parent=this,$.copyInheritedSettings(this),K)return this;return $}createCommand(q){return new Y4(q)}createHelp(){return Object.assign(new Rw,this.configureHelp())}configureHelp(q){if(q===void 0)return this._helpConfiguration;return this._helpConfiguration=q,this}configureOutput(q){if(q===void 0)return this._outputConfiguration;return this._outputConfiguration=Object.assign({},this._outputConfiguration,q),this}showHelpAfterError(q=!0){if(typeof q!=="string")q=!!q;return this._showHelpAfterError=q,this}showSuggestionAfterError(q=!0){return this._showSuggestionAfterError=!!q,this}addCommand(q,_){if(!q._name)throw new Error(`Command passed to .addCommand() must have a name -- specify the name in Command constructor or using .name()`);if(_=_||{},_.isDefault)this._defaultCommandName=q._name;if(_.noHelp||_.hidden)q._hidden=!0;return this._registerCommand(q),q.parent=this,q._checkForBrokenPassThrough(),this}createArgument(q,_){return new Sw(q,_)}argument(q,_,j,K){let Y=this.createArgument(q,_);if(typeof j==="function")Y.default(K).argParser(j);else Y.default(j);return this.addArgument(Y),this}arguments(q){return q.trim().split(/ +/).forEach((_)=>{this.argument(_)}),this}addArgument(q){let _=this.registeredArguments.slice(-1)[0];if(_&&_.variadic)throw new Error(`only the last argument can be variadic '${_.name()}'`);if(q.required&&q.defaultValue!==void 0&&q.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${q.name()}'`);return this.registeredArguments.push(q),this}helpCommand(q,_){if(typeof q==="boolean"){if(this._addImplicitHelpCommand=q,q&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let j=q??"help [command]",[,K,Y]=j.match(/([^ ]+) *(.*)/),f=_??"display help for command",P=this.createCommand(K);if(P.helpOption(!1),Y)P.arguments(Y);if(f)P.description(f);if(this._addImplicitHelpCommand=!0,this._helpCommand=P,q||_)this._initCommandGroup(P);return this}addHelpCommand(q,_){if(typeof q!=="object")return this.helpCommand(q,_),this;return this._addImplicitHelpCommand=!0,this._helpCommand=q,this._initCommandGroup(q),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(q,_){let j=["preSubcommand","preAction","postAction"];if(!j.includes(q))throw new Error(`Unexpected value for event passed to hook : '${q}'. +(Did you mean ${K[0]}?)`;return""}Nw.suggestSimilar=Mw});var f5=_8((yw)=>{var Sw=h6("node:events").EventEmitter,K4=h6("node:child_process"),Eq=h6("node:path"),y3=h6("node:fs"),b8=h6("node:process"),{Argument:Ew,humanReadableArgName:Rw}=g3(),{CommanderError:j4}=RK(),{Help:mw,stripColor:Iw}=q4(),{Option:j5,DualOptions:gw}=_4(),{suggestSimilar:P5}=K5();class Y4 extends Sw{constructor(q){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=q||"",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:(_)=>b8.stdout.write(_),writeErr:(_)=>b8.stderr.write(_),outputError:(_,j)=>j(_),getOutHelpWidth:()=>b8.stdout.isTTY?b8.stdout.columns:void 0,getErrHelpWidth:()=>b8.stderr.isTTY?b8.stderr.columns:void 0,getOutHasColors:()=>P4()??(b8.stdout.isTTY&&b8.stdout.hasColors?.()),getErrHasColors:()=>P4()??(b8.stderr.isTTY&&b8.stderr.hasColors?.()),stripColor:(_)=>Iw(_)},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(q){return this._outputConfiguration=q._outputConfiguration,this._helpOption=q._helpOption,this._helpCommand=q._helpCommand,this._helpConfiguration=q._helpConfiguration,this._exitCallback=q._exitCallback,this._storeOptionsAsProperties=q._storeOptionsAsProperties,this._combineFlagAndOptionalValue=q._combineFlagAndOptionalValue,this._allowExcessArguments=q._allowExcessArguments,this._enablePositionalOptions=q._enablePositionalOptions,this._showHelpAfterError=q._showHelpAfterError,this._showSuggestionAfterError=q._showSuggestionAfterError,this}_getCommandAndAncestors(){let q=[];for(let _=this;_;_=_.parent)q.push(_);return q}command(q,_,j){let K=_,Y=j;if(typeof K==="object"&&K!==null)Y=K,K=null;Y=Y||{};let[,f,P]=q.match(/([^ ]+) *(.*)/),$=this.createCommand(f);if(K)$.description(K),$._executableHandler=!0;if(Y.isDefault)this._defaultCommandName=$._name;if($._hidden=!!(Y.noHelp||Y.hidden),$._executableFile=Y.executableFile||null,P)$.arguments(P);if(this._registerCommand($),$.parent=this,$.copyInheritedSettings(this),K)return this;return $}createCommand(q){return new Y4(q)}createHelp(){return Object.assign(new mw,this.configureHelp())}configureHelp(q){if(q===void 0)return this._helpConfiguration;return this._helpConfiguration=q,this}configureOutput(q){if(q===void 0)return this._outputConfiguration;return this._outputConfiguration=Object.assign({},this._outputConfiguration,q),this}showHelpAfterError(q=!0){if(typeof q!=="string")q=!!q;return this._showHelpAfterError=q,this}showSuggestionAfterError(q=!0){return this._showSuggestionAfterError=!!q,this}addCommand(q,_){if(!q._name)throw new Error(`Command passed to .addCommand() must have a name +- specify the name in Command constructor or using .name()`);if(_=_||{},_.isDefault)this._defaultCommandName=q._name;if(_.noHelp||_.hidden)q._hidden=!0;return this._registerCommand(q),q.parent=this,q._checkForBrokenPassThrough(),this}createArgument(q,_){return new Ew(q,_)}argument(q,_,j,K){let Y=this.createArgument(q,_);if(typeof j==="function")Y.default(K).argParser(j);else Y.default(j);return this.addArgument(Y),this}arguments(q){return q.trim().split(/ +/).forEach((_)=>{this.argument(_)}),this}addArgument(q){let _=this.registeredArguments.slice(-1)[0];if(_&&_.variadic)throw new Error(`only the last argument can be variadic '${_.name()}'`);if(q.required&&q.defaultValue!==void 0&&q.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${q.name()}'`);return this.registeredArguments.push(q),this}helpCommand(q,_){if(typeof q==="boolean"){if(this._addImplicitHelpCommand=q,q&&this._defaultCommandGroup)this._initCommandGroup(this._getHelpCommand());return this}let j=q??"help [command]",[,K,Y]=j.match(/([^ ]+) *(.*)/),f=_??"display help for command",P=this.createCommand(K);if(P.helpOption(!1),Y)P.arguments(Y);if(f)P.description(f);if(this._addImplicitHelpCommand=!0,this._helpCommand=P,q||_)this._initCommandGroup(P);return this}addHelpCommand(q,_){if(typeof q!=="object")return this.helpCommand(q,_),this;return this._addImplicitHelpCommand=!0,this._helpCommand=q,this._initCommandGroup(q),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(q,_){let j=["preSubcommand","preAction","postAction"];if(!j.includes(q))throw new Error(`Unexpected value for event passed to hook : '${q}'. Expecting one of '${j.join("', '")}'`);if(this._lifeCycleHooks[q])this._lifeCycleHooks[q].push(_);else this._lifeCycleHooks[q]=[_];return this}exitOverride(q){if(q)this._exitCallback=q;else this._exitCallback=(_)=>{if(_.code!=="commander.executeSubCommandAsync")throw _};return this}_exit(q,_,j){if(this._exitCallback)this._exitCallback(new j4(q,_,j));b8.exit(q)}action(q){let _=(j)=>{let K=this.registeredArguments.length,Y=j.slice(0,K);if(this._storeOptionsAsProperties)Y[K]=this;else Y[K]=this.opts();return Y.push(this),q.apply(this,Y)};return this._actionHandler=_,this}createOption(q,_){return new j5(q,_)}_callParseArg(q,_,j,K){try{return q.parseArg(_,j)}catch(Y){if(Y.code==="commander.invalidArgument"){let f=`${K} ${Y.message}`;this.error(f,{exitCode:Y.exitCode,code:Y.code})}throw Y}}_registerOption(q){let _=q.short&&this._findOption(q.short)||q.long&&this._findOption(q.long);if(_){let j=q.long&&this._findOption(q.long)?q.long:q.short;throw new Error(`Cannot add option '${q.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${j}' - already used by option '${_.flags}'`)}this._initOptionGroup(q),this.options.push(q)}_registerCommand(q){let _=(K)=>{return[K.name()].concat(K.aliases())},j=_(q).find((K)=>this._findCommand(K));if(j){let K=_(this._findCommand(j)).join("|"),Y=_(q).join("|");throw new Error(`cannot add command '${Y}' as already have command '${K}'`)}this._initCommandGroup(q),this.commands.push(q)}addOption(q){this._registerOption(q);let _=q.name(),j=q.attributeName();if(q.negate){let Y=q.long.replace(/^--no-/,"--");if(!this._findOption(Y))this.setOptionValueWithSource(j,q.defaultValue===void 0?!0:q.defaultValue,"default")}else if(q.defaultValue!==void 0)this.setOptionValueWithSource(j,q.defaultValue,"default");let K=(Y,f,P)=>{if(Y==null&&q.presetArg!==void 0)Y=q.presetArg;let $=this.getOptionValue(j);if(Y!==null&&q.parseArg)Y=this._callParseArg(q,Y,$,f);else if(Y!==null&&q.variadic)Y=q._concatValue(Y,$);if(Y==null)if(q.negate)Y=!1;else if(q.isBoolean()||q.optional)Y=!0;else Y="";this.setOptionValueWithSource(j,Y,P)};if(this.on("option:"+_,(Y)=>{let f=`error: option '${q.flags}' argument '${Y}' is invalid.`;K(Y,f,"cli")}),q.envVar)this.on("optionEnv:"+_,(Y)=>{let f=`error: option '${q.flags}' value '${Y}' from env '${q.envVar}' is invalid.`;K(Y,f,"env")});return this}_optionEx(q,_,j,K,Y){if(typeof _==="object"&&_ instanceof j5)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let f=this.createOption(_,j);if(f.makeOptionMandatory(!!q.mandatory),typeof K==="function")f.default(Y).argParser(K);else if(K instanceof RegExp){let P=K;K=($,w)=>{let O=P.exec($);return O?O[0]:w},f.default(Y).argParser(K)}else f.default(K);return this.addOption(f)}option(q,_,j,K){return this._optionEx({},q,_,j,K)}requiredOption(q,_,j,K){return this._optionEx({mandatory:!0},q,_,j,K)}combineFlagAndOptionalValue(q=!0){return this._combineFlagAndOptionalValue=!!q,this}allowUnknownOption(q=!0){return this._allowUnknownOption=!!q,this}allowExcessArguments(q=!0){return this._allowExcessArguments=!!q,this}enablePositionalOptions(q=!0){return this._enablePositionalOptions=!!q,this}passThroughOptions(q=!0){return this._passThroughOptions=!!q,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(q=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!q,this}getOptionValue(q){if(this._storeOptionsAsProperties)return this[q];return this._optionValues[q]}setOptionValue(q,_){return this.setOptionValueWithSource(q,_,void 0)}setOptionValueWithSource(q,_,j){if(this._storeOptionsAsProperties)this[q]=_;else this._optionValues[q]=_;return this._optionValueSources[q]=j,this}getOptionValueSource(q){return this._optionValueSources[q]}getOptionValueSourceWithGlobals(q){let _;return this._getCommandAndAncestors().forEach((j)=>{if(j.getOptionValueSource(q)!==void 0)_=j.getOptionValueSource(q)}),_}_prepareUserArgs(q,_){if(q!==void 0&&!Array.isArray(q))throw new Error("first parameter to parse must be array or undefined");if(_=_||{},q===void 0&&_.from===void 0){if(b8.versions?.electron)_.from="electron";let K=b8.execArgv??[];if(K.includes("-e")||K.includes("--eval")||K.includes("-p")||K.includes("--print"))_.from="eval"}if(q===void 0)q=b8.argv;this.rawArgs=q.slice();let j;switch(_.from){case void 0:case"node":this._scriptPath=q[1],j=q.slice(2);break;case"electron":if(b8.defaultApp)this._scriptPath=q[1],j=q.slice(2);else j=q.slice(1);break;case"user":j=q.slice(0);break;case"eval":j=q.slice(1);break;default:throw new Error(`unexpected parse option { from: '${_.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);return this._name=this._name||"program",j}parse(q,_){this._prepareForParse();let j=this._prepareUserArgs(q,_);return this._parseCommand([],j),this}async parseAsync(q,_){this._prepareForParse();let j=this._prepareUserArgs(q,_);return await this._parseCommand([],j),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 new Error(`Can not call parse again when storeOptionsAsProperties is true. - 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(q,_,j){if(y3.existsSync(q))return;let K=_?`searched for local subcommand relative to directory '${_}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",Y=`'${q}' does not exist @@ -21,32 +21,32 @@ Expecting one of '${j.join("', '")}'`);if(this._lifeCycleHooks[q])this._lifeCycl - ${K}`;throw new Error(Y)}_executeSubCommand(q,_){_=_.slice();let j=!1,K=[".js",".ts",".tsx",".mjs",".cjs"];function Y(O,v){let z=Eq.resolve(O,v);if(y3.existsSync(z))return z;if(K.includes(Eq.extname(v)))return;let W=K.find((J)=>y3.existsSync(`${z}${J}`));if(W)return`${z}${W}`;return}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let f=q._executableFile||`${this._name}-${q._name}`,P=this._executableDir||"";if(this._scriptPath){let O;try{O=y3.realpathSync(this._scriptPath)}catch{O=this._scriptPath}P=Eq.resolve(Eq.dirname(O),P)}if(P){let O=Y(P,f);if(!O&&!q._executableFile&&this._scriptPath){let v=Eq.basename(this._scriptPath,Eq.extname(this._scriptPath));if(v!==this._name)O=Y(P,`${v}-${q._name}`)}f=O||f}j=K.includes(Eq.extname(f));let $;if(b8.platform!=="win32")if(j)_.unshift(f),_=Y5(b8.execArgv).concat(_),$=K4.spawn(b8.argv[0],_,{stdio:"inherit"});else $=K4.spawn(f,_,{stdio:"inherit"});else this._checkForMissingExecutable(f,P,q._name),_.unshift(f),_=Y5(b8.execArgv).concat(_),$=K4.spawn(b8.execPath,_,{stdio:"inherit"});if(!$.killed)["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((v)=>{b8.on(v,()=>{if($.killed===!1&&$.exitCode===null)$.kill(v)})});let w=this._exitCallback;$.on("close",(O)=>{if(O=O??1,!w)b8.exit(O);else w(new j4(O,"commander.executeSubCommandAsync","(close)"))}),$.on("error",(O)=>{if(O.code==="ENOENT")this._checkForMissingExecutable(f,P,q._name);else if(O.code==="EACCES")throw new Error(`'${f}' not executable`);if(!w)b8.exit(1);else{let v=new j4(1,"commander.executeSubCommandAsync","(error)");v.nestedError=O,w(v)}}),this.runningCommand=$}_dispatchSubcommand(q,_,j){let K=this._findCommand(q);if(!K)this.help({error:!0});K._prepareForParse();let Y;return Y=this._chainOrCallSubCommandHook(Y,K,"preSubcommand"),Y=this._chainOrCall(Y,()=>{if(K._executableHandler)this._executeSubCommand(K,_.concat(j));else return K._parseCommand(_,j)}),Y}_dispatchHelpCommand(q){if(!q)this.help();let _=this._findCommand(q);if(_&&!_._executableHandler)_.help();return this._dispatchSubcommand(q,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){if(this.registeredArguments.forEach((q,_)=>{if(q.required&&this.args[_]==null)this.missingArgument(q.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 q=(j,K,Y)=>{let f=K;if(K!==null&&j.parseArg){let P=`error: command-argument value '${K}' is invalid for argument '${j.name()}'.`;f=this._callParseArg(j,K,Y,P)}return f};this._checkNumberOfArguments();let _=[];this.registeredArguments.forEach((j,K)=>{let Y=j.defaultValue;if(j.variadic){if(K{return q(j,P,f)},j.defaultValue)}else if(Y===void 0)Y=[]}else if(K_());return _()}_chainOrCallHooks(q,_){let j=q,K=[];if(this._getCommandAndAncestors().reverse().filter((Y)=>Y._lifeCycleHooks[_]!==void 0).forEach((Y)=>{Y._lifeCycleHooks[_].forEach((f)=>{K.push({hookedCommand:Y,callback:f})})}),_==="postAction")K.reverse();return K.forEach((Y)=>{j=this._chainOrCall(j,()=>{return Y.callback(Y.hookedCommand,this)})}),j}_chainOrCallSubCommandHook(q,_,j){let K=q;if(this._lifeCycleHooks[j]!==void 0)this._lifeCycleHooks[j].forEach((Y)=>{K=this._chainOrCall(K,()=>{return Y(this,_)})});return K}_parseCommand(q,_){let j=this.parseOptions(_);if(this._parseOptionsEnv(),this._parseOptionsImplied(),q=q.concat(j.operands),_=j.unknown,this.args=q.concat(_),q&&this._findCommand(q[0]))return this._dispatchSubcommand(q[0],q.slice(1),_);if(this._getHelpCommand()&&q[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(q[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(_),this._dispatchSubcommand(this._defaultCommandName,q,_);if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName)this.help({error:!0});this._outputHelpIfRequested(j.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let K=()=>{if(j.unknown.length>0)this.unknownOption(j.unknown[0])},Y=`command:${this.name()}`;if(this._actionHandler){K(),this._processArguments();let f;if(f=this._chainOrCallHooks(f,"preAction"),f=this._chainOrCall(f,()=>this._actionHandler(this.processedArgs)),this.parent)f=this._chainOrCall(f,()=>{this.parent.emit(Y,q,_)});return f=this._chainOrCallHooks(f,"postAction"),f}if(this.parent&&this.parent.listenerCount(Y))K(),this._processArguments(),this.parent.emit(Y,q,_);else if(q.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",q,_);if(this.listenerCount("command:*"))this.emit("command:*",q,_);else if(this.commands.length)this.unknownCommand();else K(),this._processArguments()}else if(this.commands.length)K(),this.help({error:!0});else K(),this._processArguments()}_findCommand(q){if(!q)return;return this.commands.find((_)=>_._name===q||_._aliases.includes(q))}_findOption(q){return this.options.find((_)=>_.is(q))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((q)=>{q.options.forEach((_)=>{if(_.mandatory&&q.getOptionValue(_.attributeName())===void 0)q.missingMandatoryOptionValue(_)})})}_checkForConflictingLocalOptions(){let q=this.options.filter((j)=>{let K=j.attributeName();if(this.getOptionValue(K)===void 0)return!1;return this.getOptionValueSource(K)!=="default"});q.filter((j)=>j.conflictsWith.length>0).forEach((j)=>{let K=q.find((Y)=>j.conflictsWith.includes(Y.attributeName()));if(K)this._conflictingOption(j,K)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((q)=>{q._checkForConflictingLocalOptions()})}parseOptions(q){let _=[],j=[],K=_,Y=q.slice();function f(w){return w.length>1&&w[0]==="-"}let P=(w)=>{if(!/^-\d*\.?\d+(e[+-]?\d+)?$/.test(w))return!1;return!this._getCommandAndAncestors().some((O)=>O.options.map((v)=>v.short).some((v)=>/^-\d$/.test(v)))},$=null;while(Y.length){let w=Y.shift();if(w==="--"){if(K===j)K.push(w);K.push(...Y);break}if($&&(!f(w)||P(w))){this.emit(`option:${$.name()}`,w);continue}if($=null,f(w)){let O=this._findOption(w);if(O){if(O.required){let v=Y.shift();if(v===void 0)this.optionMissingArgument(O);this.emit(`option:${O.name()}`,v)}else if(O.optional){let v=null;if(Y.length>0&&(!f(Y[0])||P(Y[0])))v=Y.shift();this.emit(`option:${O.name()}`,v)}else this.emit(`option:${O.name()}`);$=O.variadic?O:null;continue}}if(w.length>2&&w[0]==="-"&&w[1]!=="-"){let O=this._findOption(`-${w[1]}`);if(O){if(O.required||O.optional&&this._combineFlagAndOptionalValue)this.emit(`option:${O.name()}`,w.slice(2));else this.emit(`option:${O.name()}`),Y.unshift(`-${w.slice(2)}`);continue}}if(/^--[^=]+=/.test(w)){let O=w.indexOf("="),v=this._findOption(w.slice(0,O));if(v&&(v.required||v.optional)){this.emit(`option:${v.name()}`,w.slice(O+1));continue}}if(K===_&&f(w)&&!(this.commands.length===0&&P(w)))K=j;if((this._enablePositionalOptions||this._passThroughOptions)&&_.length===0&&j.length===0){if(this._findCommand(w)){if(_.push(w),Y.length>0)j.push(...Y);break}else if(this._getHelpCommand()&&w===this._getHelpCommand().name()){if(_.push(w),Y.length>0)_.push(...Y);break}else if(this._defaultCommandName){if(j.push(w),Y.length>0)j.push(...Y);break}}if(this._passThroughOptions){if(K.push(w),Y.length>0)K.push(...Y);break}K.push(w)}return{operands:_,unknown:j}}opts(){if(this._storeOptionsAsProperties){let q={},_=this.options.length;for(let j=0;j<_;j++){let K=this.options[j].attributeName();q[K]=K===this._versionOptionName?this._version:this[K]}return q}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((q,_)=>Object.assign(q,_.opts()),{})}error(q,_){if(this._outputConfiguration.outputError(`${q} `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError==="string")this._outputConfiguration.writeErr(`${this._showHelpAfterError} `);else if(this._showHelpAfterError)this._outputConfiguration.writeErr(` -`),this.outputHelp({error:!0});let j=_||{},K=j.exitCode||1,Y=j.code||"commander.error";this._exit(K,Y,q)}_parseOptionsEnv(){this.options.forEach((q)=>{if(q.envVar&&q.envVar in b8.env){let _=q.attributeName();if(this.getOptionValue(_)===void 0||["default","config","env"].includes(this.getOptionValueSource(_)))if(q.required||q.optional)this.emit(`optionEnv:${q.name()}`,b8.env[q.envVar]);else this.emit(`optionEnv:${q.name()}`)}})}_parseOptionsImplied(){let q=new Iw(this.options),_=(j)=>{return this.getOptionValue(j)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(j))};this.options.filter((j)=>j.implied!==void 0&&_(j.attributeName())&&q.valueFromOption(this.getOptionValue(j.attributeName()),j)).forEach((j)=>{Object.keys(j.implied).filter((K)=>!_(K)).forEach((K)=>{this.setOptionValueWithSource(K,j.implied[K],"implied")})})}missingArgument(q){let _=`error: missing required argument '${q}'`;this.error(_,{code:"commander.missingArgument"})}optionMissingArgument(q){let _=`error: option '${q.flags}' argument missing`;this.error(_,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(q){let _=`error: required option '${q.flags}' not specified`;this.error(_,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(q,_){let j=(f)=>{let P=f.attributeName(),$=this.getOptionValue(P),w=this.options.find((v)=>v.negate&&P===v.attributeName()),O=this.options.find((v)=>!v.negate&&P===v.attributeName());if(w&&(w.presetArg===void 0&&$===!1||w.presetArg!==void 0&&$===w.presetArg))return w;return O||f},K=(f)=>{let P=j(f),$=P.attributeName();if(this.getOptionValueSource($)==="env")return`environment variable '${P.envVar}'`;return`option '${P.flags}'`},Y=`error: ${K(q)} cannot be used with ${K(_)}`;this.error(Y,{code:"commander.conflictingOption"})}unknownOption(q){if(this._allowUnknownOption)return;let _="";if(q.startsWith("--")&&this._showSuggestionAfterError){let K=[],Y=this;do{let f=Y.createHelp().visibleOptions(Y).filter((P)=>P.long).map((P)=>P.long);K=K.concat(f),Y=Y.parent}while(Y&&!Y._enablePositionalOptions);_=P5(q,K)}let j=`error: unknown option '${q}'${_}`;this.error(j,{code:"commander.unknownOption"})}_excessArguments(q){if(this._allowExcessArguments)return;let _=this.registeredArguments.length,j=_===1?"":"s",Y=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${_} argument${j} but got ${q.length}.`;this.error(Y,{code:"commander.excessArguments"})}unknownCommand(){let q=this.args[0],_="";if(this._showSuggestionAfterError){let K=[];this.createHelp().visibleCommands(this).forEach((Y)=>{if(K.push(Y.name()),Y.alias())K.push(Y.alias())}),_=P5(q,K)}let j=`error: unknown command '${q}'${_}`;this.error(j,{code:"commander.unknownCommand"})}version(q,_,j){if(q===void 0)return this._version;this._version=q,_=_||"-V, --version",j=j||"output the version number";let K=this.createOption(_,j);return this._versionOptionName=K.attributeName(),this._registerOption(K),this.on("option:"+K.name(),()=>{this._outputConfiguration.writeOut(`${q} -`),this._exit(0,"commander.version",q)}),this}description(q,_){if(q===void 0&&_===void 0)return this._description;if(this._description=q,_)this._argsDescription=_;return this}summary(q){if(q===void 0)return this._summary;return this._summary=q,this}alias(q){if(q===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(q===_._name)throw new Error("Command alias can't be the same as its name");let j=this.parent?._findCommand(q);if(j){let K=[j.name()].concat(j.aliases()).join("|");throw new Error(`cannot add alias '${q}' to command '${this.name()}' as already have command '${K}'`)}return _._aliases.push(q),this}aliases(q){if(q===void 0)return this._aliases;return q.forEach((_)=>this.alias(_)),this}usage(q){if(q===void 0){if(this._usage)return this._usage;let _=this.registeredArguments.map((j)=>{return Ew(j)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?_:[]).join(" ")}return this._usage=q,this}name(q){if(q===void 0)return this._name;return this._name=q,this}helpGroup(q){if(q===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=q,this}commandsGroup(q){if(q===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=q,this}optionsGroup(q){if(q===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=q,this}_initOptionGroup(q){if(this._defaultOptionGroup&&!q.helpGroupHeading)q.helpGroup(this._defaultOptionGroup)}_initCommandGroup(q){if(this._defaultCommandGroup&&!q.helpGroup())q.helpGroup(this._defaultCommandGroup)}nameFromFilename(q){return this._name=Eq.basename(q,Eq.extname(q)),this}executableDir(q){if(q===void 0)return this._executableDir;return this._executableDir=q,this}helpInformation(q){let _=this.createHelp(),j=this._getOutputContext(q);_.prepareContext({error:j.error,helpWidth:j.helpWidth,outputHasColors:j.hasColors});let K=_.formatHelp(this,_);if(j.hasColors)return K;return this._outputConfiguration.stripColor(K)}_getOutputContext(q){q=q||{};let _=!!q.error,j,K,Y;if(_)j=(P)=>this._outputConfiguration.writeErr(P),K=this._outputConfiguration.getErrHasColors(),Y=this._outputConfiguration.getErrHelpWidth();else j=(P)=>this._outputConfiguration.writeOut(P),K=this._outputConfiguration.getOutHasColors(),Y=this._outputConfiguration.getOutHelpWidth();return{error:_,write:(P)=>{if(!K)P=this._outputConfiguration.stripColor(P);return j(P)},hasColors:K,helpWidth:Y}}outputHelp(q){let _;if(typeof q==="function")_=q,q=void 0;let j=this._getOutputContext(q),K={error:j.error,write:j.write,command:this};this._getCommandAndAncestors().reverse().forEach((f)=>f.emit("beforeAllHelp",K)),this.emit("beforeHelp",K);let Y=this.helpInformation({error:j.error});if(_){if(Y=_(Y),typeof Y!=="string"&&!Buffer.isBuffer(Y))throw new Error("outputHelp callback must return a string or a Buffer")}if(j.write(Y),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",K),this._getCommandAndAncestors().forEach((f)=>f.emit("afterAllHelp",K))}helpOption(q,_){if(typeof q==="boolean"){if(q){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(q??"-h, --help",_??"display help for command"),q||_)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(q){return this._helpOption=q,this._initOptionGroup(q),this}help(q){this.outputHelp(q);let _=Number(b8.exitCode??0);if(_===0&&q&&typeof q!=="function"&&q.error)_=1;this._exit(_,"commander.help","(outputHelp)")}addHelpText(q,_){let j=["beforeAll","before","after","afterAll"];if(!j.includes(q))throw new Error(`Unexpected value for position to addHelpText. +`),this.outputHelp({error:!0});let j=_||{},K=j.exitCode||1,Y=j.code||"commander.error";this._exit(K,Y,q)}_parseOptionsEnv(){this.options.forEach((q)=>{if(q.envVar&&q.envVar in b8.env){let _=q.attributeName();if(this.getOptionValue(_)===void 0||["default","config","env"].includes(this.getOptionValueSource(_)))if(q.required||q.optional)this.emit(`optionEnv:${q.name()}`,b8.env[q.envVar]);else this.emit(`optionEnv:${q.name()}`)}})}_parseOptionsImplied(){let q=new gw(this.options),_=(j)=>{return this.getOptionValue(j)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(j))};this.options.filter((j)=>j.implied!==void 0&&_(j.attributeName())&&q.valueFromOption(this.getOptionValue(j.attributeName()),j)).forEach((j)=>{Object.keys(j.implied).filter((K)=>!_(K)).forEach((K)=>{this.setOptionValueWithSource(K,j.implied[K],"implied")})})}missingArgument(q){let _=`error: missing required argument '${q}'`;this.error(_,{code:"commander.missingArgument"})}optionMissingArgument(q){let _=`error: option '${q.flags}' argument missing`;this.error(_,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(q){let _=`error: required option '${q.flags}' not specified`;this.error(_,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(q,_){let j=(f)=>{let P=f.attributeName(),$=this.getOptionValue(P),w=this.options.find((v)=>v.negate&&P===v.attributeName()),O=this.options.find((v)=>!v.negate&&P===v.attributeName());if(w&&(w.presetArg===void 0&&$===!1||w.presetArg!==void 0&&$===w.presetArg))return w;return O||f},K=(f)=>{let P=j(f),$=P.attributeName();if(this.getOptionValueSource($)==="env")return`environment variable '${P.envVar}'`;return`option '${P.flags}'`},Y=`error: ${K(q)} cannot be used with ${K(_)}`;this.error(Y,{code:"commander.conflictingOption"})}unknownOption(q){if(this._allowUnknownOption)return;let _="";if(q.startsWith("--")&&this._showSuggestionAfterError){let K=[],Y=this;do{let f=Y.createHelp().visibleOptions(Y).filter((P)=>P.long).map((P)=>P.long);K=K.concat(f),Y=Y.parent}while(Y&&!Y._enablePositionalOptions);_=P5(q,K)}let j=`error: unknown option '${q}'${_}`;this.error(j,{code:"commander.unknownOption"})}_excessArguments(q){if(this._allowExcessArguments)return;let _=this.registeredArguments.length,j=_===1?"":"s",Y=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${_} argument${j} but got ${q.length}.`;this.error(Y,{code:"commander.excessArguments"})}unknownCommand(){let q=this.args[0],_="";if(this._showSuggestionAfterError){let K=[];this.createHelp().visibleCommands(this).forEach((Y)=>{if(K.push(Y.name()),Y.alias())K.push(Y.alias())}),_=P5(q,K)}let j=`error: unknown command '${q}'${_}`;this.error(j,{code:"commander.unknownCommand"})}version(q,_,j){if(q===void 0)return this._version;this._version=q,_=_||"-V, --version",j=j||"output the version number";let K=this.createOption(_,j);return this._versionOptionName=K.attributeName(),this._registerOption(K),this.on("option:"+K.name(),()=>{this._outputConfiguration.writeOut(`${q} +`),this._exit(0,"commander.version",q)}),this}description(q,_){if(q===void 0&&_===void 0)return this._description;if(this._description=q,_)this._argsDescription=_;return this}summary(q){if(q===void 0)return this._summary;return this._summary=q,this}alias(q){if(q===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(q===_._name)throw new Error("Command alias can't be the same as its name");let j=this.parent?._findCommand(q);if(j){let K=[j.name()].concat(j.aliases()).join("|");throw new Error(`cannot add alias '${q}' to command '${this.name()}' as already have command '${K}'`)}return _._aliases.push(q),this}aliases(q){if(q===void 0)return this._aliases;return q.forEach((_)=>this.alias(_)),this}usage(q){if(q===void 0){if(this._usage)return this._usage;let _=this.registeredArguments.map((j)=>{return Rw(j)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?_:[]).join(" ")}return this._usage=q,this}name(q){if(q===void 0)return this._name;return this._name=q,this}helpGroup(q){if(q===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=q,this}commandsGroup(q){if(q===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=q,this}optionsGroup(q){if(q===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=q,this}_initOptionGroup(q){if(this._defaultOptionGroup&&!q.helpGroupHeading)q.helpGroup(this._defaultOptionGroup)}_initCommandGroup(q){if(this._defaultCommandGroup&&!q.helpGroup())q.helpGroup(this._defaultCommandGroup)}nameFromFilename(q){return this._name=Eq.basename(q,Eq.extname(q)),this}executableDir(q){if(q===void 0)return this._executableDir;return this._executableDir=q,this}helpInformation(q){let _=this.createHelp(),j=this._getOutputContext(q);_.prepareContext({error:j.error,helpWidth:j.helpWidth,outputHasColors:j.hasColors});let K=_.formatHelp(this,_);if(j.hasColors)return K;return this._outputConfiguration.stripColor(K)}_getOutputContext(q){q=q||{};let _=!!q.error,j,K,Y;if(_)j=(P)=>this._outputConfiguration.writeErr(P),K=this._outputConfiguration.getErrHasColors(),Y=this._outputConfiguration.getErrHelpWidth();else j=(P)=>this._outputConfiguration.writeOut(P),K=this._outputConfiguration.getOutHasColors(),Y=this._outputConfiguration.getOutHelpWidth();return{error:_,write:(P)=>{if(!K)P=this._outputConfiguration.stripColor(P);return j(P)},hasColors:K,helpWidth:Y}}outputHelp(q){let _;if(typeof q==="function")_=q,q=void 0;let j=this._getOutputContext(q),K={error:j.error,write:j.write,command:this};this._getCommandAndAncestors().reverse().forEach((f)=>f.emit("beforeAllHelp",K)),this.emit("beforeHelp",K);let Y=this.helpInformation({error:j.error});if(_){if(Y=_(Y),typeof Y!=="string"&&!Buffer.isBuffer(Y))throw new Error("outputHelp callback must return a string or a Buffer")}if(j.write(Y),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",K),this._getCommandAndAncestors().forEach((f)=>f.emit("afterAllHelp",K))}helpOption(q,_){if(typeof q==="boolean"){if(q){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(q??"-h, --help",_??"display help for command"),q||_)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(q){return this._helpOption=q,this._initOptionGroup(q),this}help(q){this.outputHelp(q);let _=Number(b8.exitCode??0);if(_===0&&q&&typeof q!=="function"&&q.error)_=1;this._exit(_,"commander.help","(outputHelp)")}addHelpText(q,_){let j=["beforeAll","before","after","afterAll"];if(!j.includes(q))throw new Error(`Unexpected value for position to addHelpText. Expecting one of '${j.join("', '")}'`);let K=`${q}Help`;return this.on(K,(Y)=>{let f;if(typeof _==="function")f=_({error:Y.error,command:Y.command});else f=_;if(f)Y.write(`${f} -`)}),this}_outputHelpIfRequested(q){let _=this._getHelpOption();if(_&&q.find((K)=>_.is(K)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Y5(q){return q.map((_)=>{if(!_.startsWith("--inspect"))return _;let j,K="127.0.0.1",Y="9229",f;if((f=_.match(/^(--inspect(-brk)?)$/))!==null)j=f[1];else if((f=_.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(j=f[1],/^\d+$/.test(f[3]))Y=f[3];else K=f[3];else if((f=_.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)j=f[1],K=f[3],Y=f[4];if(j&&Y!=="0")return`${j}=${K}:${parseInt(Y)+1}`;return _})}function P4(){if(b8.env.NO_COLOR||b8.env.FORCE_COLOR==="0"||b8.env.FORCE_COLOR==="false")return!1;if(b8.env.FORCE_COLOR||b8.env.CLICOLOR_FORCE!==void 0)return!0;return}gw.Command=Y4;gw.useColor=P4});var z5=_8((lw)=>{var{Argument:$5}=g3(),{Command:f4}=f5(),{CommanderError:pw,InvalidArgumentError:w5}=RK(),{Help:Lw}=q4(),{Option:O5}=_4();lw.program=new f4;lw.createCommand=(q)=>new f4(q);lw.createOption=(q,_)=>new O5(q,_);lw.createArgument=(q,_)=>new $5(q,_);lw.Command=f4;lw.Option=O5;lw.Argument=$5;lw.Help=Lw;lw.CommanderError=pw;lw.InvalidArgumentError=w5;lw.InvalidOptionArgumentError=w5});function w4(q){try{let _=q instanceof Date?q:new Date(q),K=new Date().getTime()-_.getTime(),Y=Math.floor(K/1000),f=Math.floor(Y/60),P=Math.floor(f/60),$=Math.floor(P/24),w=Math.floor($/7),O=Math.floor($/30);if(Y<60)return"Just now";else if(f<60)return f===1?"1 minute ago":`${f} minutes ago`;else if(P<24)return P===1?"1 hour ago":`${P} hours ago`;else if($===1)return"Yesterday";else if($<7)return`${$} days ago`;else if(w===1)return"1 week ago";else if(w<4)return`${w} weeks ago`;else if(O===1)return"1 month ago";else if(O<12)return`${O} months ago`;else{let v=Math.floor(O/12);return v===1?"1 year ago":`${v} years ago`}}catch(_){return"Recently"}}function u5(q){let _=["timestamp","created_at","date","time"];for(let j of _)if(q[j])try{let K=new Date(q[j]);if(!isNaN(K.getTime()))return K}catch{continue}return null}function y_(){let q=process.env.CLAUDE_MEM_WRAP_WIDTH;if(q){let _=parseInt(q,10);if(!Number.isNaN(_)&&_>40&&_<=200)return _}return 80}function KO(q,_){if(!q)return"";if(/^[\-=\u2014_\u2500\u2550]{5,}$/.test(q.trim()))return q;if(q.length<=_)return q;let j=q.match(/^\s*/),K=j?j[0]:"",Y=q.slice(K.length),f=Math.max(10,_-K.length),P=Y.split(/(\s+)/),$=[],w="",O=()=>{$.push(K+w.trimEnd()),w=""};for(let v of P){if(v==="")continue;if(!/\s/.test(v)&&v.length>f){if(w.trim().length>0)O();let z=0;while(z_)O();w+=v}if(w.trim().length>0||$.length===0)O();return $.join(` +`)}),this}_outputHelpIfRequested(q){let _=this._getHelpOption();if(_&&q.find((K)=>_.is(K)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}function Y5(q){return q.map((_)=>{if(!_.startsWith("--inspect"))return _;let j,K="127.0.0.1",Y="9229",f;if((f=_.match(/^(--inspect(-brk)?)$/))!==null)j=f[1];else if((f=_.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null)if(j=f[1],/^\d+$/.test(f[3]))Y=f[3];else K=f[3];else if((f=_.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null)j=f[1],K=f[3],Y=f[4];if(j&&Y!=="0")return`${j}=${K}:${parseInt(Y)+1}`;return _})}function P4(){if(b8.env.NO_COLOR||b8.env.FORCE_COLOR==="0"||b8.env.FORCE_COLOR==="false")return!1;if(b8.env.FORCE_COLOR||b8.env.CLICOLOR_FORCE!==void 0)return!0;return}yw.Command=Y4;yw.useColor=P4});var z5=_8((xw)=>{var{Argument:$5}=g3(),{Command:f4}=f5(),{CommanderError:Lw,InvalidArgumentError:w5}=RK(),{Help:lw}=q4(),{Option:O5}=_4();xw.program=new f4;xw.createCommand=(q)=>new f4(q);xw.createOption=(q,_)=>new O5(q,_);xw.createArgument=(q,_)=>new $5(q,_);xw.Command=f4;xw.Option=O5;xw.Argument=$5;xw.Help=lw;xw.CommanderError=Lw;xw.InvalidArgumentError=w5;xw.InvalidOptionArgumentError=w5});function w4(q){try{let _=q instanceof Date?q:new Date(q),K=new Date().getTime()-_.getTime(),Y=Math.floor(K/1000),f=Math.floor(Y/60),P=Math.floor(f/60),$=Math.floor(P/24),w=Math.floor($/7),O=Math.floor($/30);if(Y<60)return"Just now";else if(f<60)return f===1?"1 minute ago":`${f} minutes ago`;else if(P<24)return P===1?"1 hour ago":`${P} hours ago`;else if($===1)return"Yesterday";else if($<7)return`${$} days ago`;else if(w===1)return"1 week ago";else if(w<4)return`${w} weeks ago`;else if(O===1)return"1 month ago";else if(O<12)return`${O} months ago`;else{let v=Math.floor(O/12);return v===1?"1 year ago":`${v} years ago`}}catch(_){return"Recently"}}function u5(q){let _=["timestamp","created_at","date","time"];for(let j of _)if(q[j])try{let K=new Date(q[j]);if(!isNaN(K.getTime()))return K}catch{continue}return null}function y_(){let q=process.env.CLAUDE_MEM_WRAP_WIDTH;if(q){let _=parseInt(q,10);if(!Number.isNaN(_)&&_>40&&_<=200)return _}return 80}function jO(q,_){if(!q)return"";if(/^[\-=\u2014_\u2500\u2550]{5,}$/.test(q.trim()))return q;if(q.length<=_)return q;let j=q.match(/^\s*/),K=j?j[0]:"",Y=q.slice(K.length),f=Math.max(10,_-K.length),P=Y.split(/(\s+)/),$=[],w="",O=()=>{$.push(K+w.trimEnd()),w=""};for(let v of P){if(v==="")continue;if(!/\s/.test(v)&&v.length>f){if(w.trim().length>0)O();let z=0;while(z_)O();w+=v}if(w.trim().length>0||$.length===0)O();return $.join(` `)}function S6(q,_){if(!q)return"";return q.split(` -`).map((j)=>KO(j,_)).join(` +`).map((j)=>jO(j,_)).join(` `)}function d3(q="─",_=y_()){if(!q||q.length===0)q="-";return q.repeat(_).slice(0,_)}function h5(q){let _={searching:"\uD83D\uDD0D Searching previous memories...",loading:"\uD83D\uDCDA Loading relevant context...",formatting:"✨ Organizing memories for display...",compressing:"\uD83D\uDDDC️ Compressing session transcript...",archiving:"\uD83D\uDCE6 Archiving conversation..."},j=y_();return S6(_[q]||`⏳ ${q}...`,j)}function p3(q,_,j){let K=_!==void 0?` (${_} items)`:"",Y=j?` ${j}`:"",f=y_();return S6(`✅ ${q} completed successfully${K}${Y}`,f)}function d_(q,_,j){let K=j?` -\uD83D\uDCA1 ${j}`:"",Y=y_();return S6(`❌ ${q} encountered an issue: ${_}${K}`,Y)}function mK(q,..._){let j=jO[q](..._);return d_("Memory system",j.message,j.suggestion)}function D5(q){let _=typeof q==="string"?new Date(q):q,K=new Date().getTime()-_.getTime(),Y=Math.floor(K/60000),f=Math.floor(K/3600000),P=Math.floor(K/86400000);if(Y<1)return"just now";if(Y<60)return`${Y} minute${Y>1?"s":""} ago`;if(f<24)return`${f} hour${f>1?"s":""} ago`;if(P<7)return`${P} day${P>1?"s":""} ago`;return _.toLocaleDateString()}function C5(q,_){let{count:j,duration:K,details:Y}=_,f=K?` in ${K}ms`:"",P=Y?` - ${Y}`:"",$={compress:`Compressed ${j} conversation turns${f}${P}`,load:`Loaded ${j} relevant memories${f}${P}`,search:`Found ${j} matching memories${f}${P}`,archive:`Archived ${j} conversation segments${f}${P}`},w=y_();return S6(`\uD83D\uDCCA ${$[q]}`,w)}function PO(q,_=3,j){let K=q.filter((P)=>P.type==="overview");if(K.length===0)return[];let Y=K;if(j){if(Y=K.filter((P)=>P.project===j),Y.length===0)Y=K}return Y.slice(-_).map((P)=>{let $={content:P.content||"",sessionId:P.sessionId||P.session_id||"unknown"},w=u5(P);if(w)$.timestamp=w,$.timeAgo=w4(w);else $.timeAgo="Recently";return $})}function YO(q){if(q.length===0)return[];return q.filter((_)=>_.type==="memory").map((_)=>{let j={summary:_.text||"",sessionId:_.session_id||""};if(_.keywords)j.keywords=_.keywords;if(_.document_id&&!_.document_id.includes("Session:"))j.location=_.document_id;return j}).filter((_)=>_.summary.length>0)}function fO(q){let _=new Map;return q.forEach((j)=>{let K=j.sessionId;if(K){if(!_.has(K))_.set(K,[]);_.get(K).push(j)}}),Array.from(_.entries()).map(([j,K])=>{let Y=K.map((f,P)=>({...f,number:P+1}));return{sessionId:j,memories:Y}})}function $O(q){let _=new Map;return q.forEach((j)=>{let K=j.sessionId||"unknown";if(!_.has(K))_.set(K,[]);_.get(K).push(j)}),Array.from(_.entries()).map(([j,K])=>{let Y=K.map((P)=>P.timestamp).filter((P)=>P!==void 0).sort((P,$)=>P.getTime()-$.getTime()),f={sessionId:j,overviews:K};if(Y.length>0)f.earliestTimestamp=Y[0],f.timeAgo=w4(Y[0]);return f})}function V5(q){let{projectName:_,memoryCount:j,lastSessionTime:K,recentObjects:Y}=q,f=y_(),$=new Date().toLocaleString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",timeZoneName:"short"});console.log(""),console.log(S6(`\uD83D\uDCC5 ${$}`,f)),console.log(d3("─",f));let w=PO(Y,10,_),O=YO(Y),v=(z,W)=>{let J=z.includes(",")||z.includes(` -`)?z.split(/[\n,]+/):[z];for(let T of J){let H=T.trim();if(!H)continue;let X=H.toLowerCase();if(!W.has(X))W.set(X,H)}};if(O.length>0){let z=fO(O);console.log(""),console.log(""),console.log(S6("\uD83D\uDCDA Memories",f)),z.forEach((W)=>{console.log(d3("─",f)),console.log(""),console.log(S6(`\uD83D\uDD0D ${W.sessionId}`,f));let J=new Map;W.memories.forEach((H)=>{if(console.log(""),console.log(S6(`${H.number}. ${H.summary}`,f)),H.keywords)v(H.keywords,J)});let T=Array.from(J.values());if(T.length>0)console.log(""),console.log(S6(`\uD83C\uDFF7️ ${T.join(", ")}`,f));console.log("")})}if(w.length>0){let z=$O(w);z.sort((W,J)=>{let T=W.earliestTimestamp?.getTime()||0;return(J.earliestTimestamp?.getTime()||0)-T}),console.log(""),console.log(S6("\uD83E\uDDE0 Overviews",f)),console.log(d3("─",f)),z.forEach((W)=>{console.log(""),console.log(S6(`\uD83D\uDD0D ${W.sessionId}`,f)),W.overviews.forEach((J,T)=>{if(console.log(""),console.log(S6(`${T+1}. ${J.content}`,f)),console.log(""),J.timeAgo)console.log(S6(`\uD83D\uDCC5 ${J.timeAgo}`,f))}),console.log(""),console.log(d3("─",f))})}else if(O.length===0)console.log(S6(`\uD83E\uDDE0 No recent context found for ${_}`,f))}var jO;var O4=f6(()=>{jO={NO_MEMORIES:(q)=>({message:`No previous memories found for ${q}`,suggestion:"This appears to be your first session. Memories will be created as you work."}),CONNECTION_FAILED:()=>({message:"Could not connect to memory system",suggestion:"Try restarting Claude Code or check if the MCP server is properly configured."}),SEARCH_FAILED:(q)=>({message:`Search for "${q}" didn't return any results`,suggestion:"Try using different keywords or check if memories exist for this project."}),LOAD_TIMEOUT:()=>({message:"Memory loading timed out",suggestion:"The operation is taking longer than expected. You can continue without loaded context."})}});import{join as E5}from"path";import{fileURLToPath as tO}from"url";import{setMaxListeners as eO}from"events";import{spawn as UO}from"child_process";import{createInterface as sO}from"readline";import*as J8 from"fs";import{stat as QO}from"fs/promises";function x5(q=FO){let _=new AbortController;return eO(q,_.signal),_}function Kz(){return _z}class n5{options;child;childStdin;childStdout;ready=!1;abortController;exitError;exitListeners=[];processExitHandler;abortHandler;constructor(q){this.options=q,this.abortController=q.abortController||x5(),this.initialize()}initialize(){try{let{prompt:q,additionalDirectories:_=[],cwd:j,executable:K=this.isRunningWithBun()?"bun":"node",executableArgs:Y=[],extraArgs:f={},pathToClaudeCodeExecutable:P,env:$={...process.env},stderr:w,customSystemPrompt:O,appendSystemPrompt:v,maxTurns:z,model:W,fallbackModel:J,permissionMode:T,permissionPromptToolName:H,continueConversation:X,resume:A,allowedTools:G=[],disallowedTools:D=[],mcpServers:M,strictMcpConfig:I,canUseTool:N}=this.options,R=["--output-format","stream-json","--verbose"];if(O)R.push("--system-prompt",O);if(v)R.push("--append-system-prompt",v);if(z)R.push("--max-turns",z.toString());if(W)R.push("--model",W);if($.DEBUG)R.push("--debug-to-stderr");if(N){if(typeof q==="string")throw new Error("canUseTool callback requires --input-format stream-json. Please set prompt as an AsyncIterable.");if(H)throw new Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");R.push("--permission-prompt-tool","stdio")}else if(H)R.push("--permission-prompt-tool",H);if(X)R.push("--continue");if(A)R.push("--resume",A);if(G.length>0)R.push("--allowedTools",G.join(","));if(D.length>0)R.push("--disallowedTools",D.join(","));if(M&&Object.keys(M).length>0)R.push("--mcp-config",JSON.stringify({mcpServers:M}));if(I)R.push("--strict-mcp-config");if(T&&T!=="default")R.push("--permission-mode",T);if(J){if(W&&J===W)throw new Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");R.push("--fallback-model",J)}if(typeof q==="string")R.push("--print"),R.push("--",q.trim());else R.push("--input-format","stream-json");for(let p of _)R.push("--add-dir",p);for(let[p,c]of Object.entries(f))if(c===null)R.push(`--${p}`);else R.push(`--${p}`,c);if(!$.CLAUDE_CODE_ENTRYPOINT)$.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(!Kz().existsSync(P)){let p=R5(P)?`Claude Code native binary not found at ${P}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${P}. Is options.pathToClaudeCodeExecutable set?`;throw new ReferenceError(p)}let b=R5(P),d=b?P:K,y=b?R:[...Y,P,...R];this.logDebug(b?`Spawning Claude Code native binary: ${P} ${R.join(" ")}`:`Spawning Claude Code process: ${K} ${[...Y,P,...R].join(" ")}`);let V=$.DEBUG||w?"pipe":"ignore";if(this.child=UO(d,y,{cwd:j,stdio:["pipe","pipe",V],signal:this.abortController.signal,env:$}),this.childStdin=this.child.stdin,this.childStdout=this.child.stdout,typeof q==="string")this.childStdin.end(),this.childStdin=void 0;if($.DEBUG||w)this.child.stderr.on("data",(p)=>{if(this.logDebug(`Claude Code stderr: ${p.toString()}`),w)w(p.toString())});let S=()=>{if(this.child&&!this.child.killed)this.child.kill("SIGTERM")};this.processExitHandler=S,this.abortHandler=S,process.on("exit",this.processExitHandler),this.abortController.signal.addEventListener("abort",this.abortHandler),this.child.on("error",(p)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new L_("Claude Code process aborted by user");else this.exitError=new Error(`Failed to spawn Claude Code process: ${p.message}`),this.logDebug(this.exitError.message)}),this.child.on("close",(p,c)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new L_("Claude Code process aborted by user");else{let B=this.getProcessExitError(p,c);if(B)this.exitError=B,this.logDebug(B.message)}}),this.ready=!0}catch(q){throw this.ready=!1,q}}getProcessExitError(q,_){if(q!==0&&q!==null)return new Error(`Claude Code process exited with code ${q}`);else if(_)return new Error(`Claude Code process terminated by signal ${_}`);return}isRunningWithBun(){return process.versions.bun!==void 0||process.env.BUN_INSTALL!==void 0}logDebug(q){if(process.env.DEBUG)process.stderr.write(`${q} +\uD83D\uDCA1 ${j}`:"",Y=y_();return S6(`❌ ${q} encountered an issue: ${_}${K}`,Y)}function mK(q,..._){let j=PO[q](..._);return d_("Memory system",j.message,j.suggestion)}function D5(q){let _=typeof q==="string"?new Date(q):q,K=new Date().getTime()-_.getTime(),Y=Math.floor(K/60000),f=Math.floor(K/3600000),P=Math.floor(K/86400000);if(Y<1)return"just now";if(Y<60)return`${Y} minute${Y>1?"s":""} ago`;if(f<24)return`${f} hour${f>1?"s":""} ago`;if(P<7)return`${P} day${P>1?"s":""} ago`;return _.toLocaleDateString()}function C5(q,_){let{count:j,duration:K,details:Y}=_,f=K?` in ${K}ms`:"",P=Y?` - ${Y}`:"",$={compress:`Compressed ${j} conversation turns${f}${P}`,load:`Loaded ${j} relevant memories${f}${P}`,search:`Found ${j} matching memories${f}${P}`,archive:`Archived ${j} conversation segments${f}${P}`},w=y_();return S6(`\uD83D\uDCCA ${$[q]}`,w)}function YO(q,_=3,j){let K=q.filter((P)=>P.type==="overview");if(K.length===0)return[];let Y=K;if(j){if(Y=K.filter((P)=>P.project===j),Y.length===0)Y=K}return Y.slice(-_).map((P)=>{let $={content:P.content||"",sessionId:P.sessionId||P.session_id||"unknown"},w=u5(P);if(w)$.timestamp=w,$.timeAgo=w4(w);else $.timeAgo="Recently";return $})}function fO(q){if(q.length===0)return[];return q.filter((_)=>_.type==="memory").map((_)=>{let j={summary:_.text||"",sessionId:_.session_id||""};if(_.keywords)j.keywords=_.keywords;if(_.document_id&&!_.document_id.includes("Session:"))j.location=_.document_id;return j}).filter((_)=>_.summary.length>0)}function $O(q){let _=new Map;return q.forEach((j)=>{let K=j.sessionId;if(K){if(!_.has(K))_.set(K,[]);_.get(K).push(j)}}),Array.from(_.entries()).map(([j,K])=>{let Y=K.map((f,P)=>({...f,number:P+1}));return{sessionId:j,memories:Y}})}function wO(q){let _=new Map;return q.forEach((j)=>{let K=j.sessionId||"unknown";if(!_.has(K))_.set(K,[]);_.get(K).push(j)}),Array.from(_.entries()).map(([j,K])=>{let Y=K.map((P)=>P.timestamp).filter((P)=>P!==void 0).sort((P,$)=>P.getTime()-$.getTime()),f={sessionId:j,overviews:K};if(Y.length>0)f.earliestTimestamp=Y[0],f.timeAgo=w4(Y[0]);return f})}function V5(q){let{projectName:_,memoryCount:j,lastSessionTime:K,recentObjects:Y}=q,f=y_(),$=new Date().toLocaleString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",timeZoneName:"short"});console.log(""),console.log(S6(`\uD83D\uDCC5 ${$}`,f)),console.log(d3("─",f));let w=YO(Y,10,_);console.error(`[DEBUG] recentObjects has ${Y.length} items`),console.error(`[DEBUG] overviews extracted: ${w.length}`);let O=fO(Y),v=(z,W)=>{let J=z.includes(",")||z.includes(` +`)?z.split(/[\n,]+/):[z];for(let T of J){let H=T.trim();if(!H)continue;let X=H.toLowerCase();if(!W.has(X))W.set(X,H)}};if(O.length>0){let z=$O(O);console.log(""),console.log(""),console.log(S6("\uD83D\uDCDA Memories",f)),z.forEach((W)=>{console.log(d3("─",f)),console.log(""),console.log(S6(`\uD83D\uDD0D ${W.sessionId}`,f));let J=new Map;W.memories.forEach((H)=>{if(console.log(""),console.log(S6(`${H.number}. ${H.summary}`,f)),H.keywords)v(H.keywords,J)});let T=Array.from(J.values());if(T.length>0)console.log(""),console.log(S6(`\uD83C\uDFF7️ ${T.join(", ")}`,f));console.log("")})}if(w.length>0){let z=wO(w);z.sort((W,J)=>{let T=W.earliestTimestamp?.getTime()||0,H=J.earliestTimestamp?.getTime()||0;return T-H}),console.log(""),console.log(S6("\uD83E\uDDE0 Overviews",f)),console.log(d3("─",f)),z.forEach((W)=>{console.log(""),console.log(S6(`\uD83D\uDD0D ${W.sessionId}`,f)),W.overviews.forEach((J,T)=>{if(console.log(""),console.log(S6(`${T+1}. ${J.content}`,f)),console.log(""),J.timeAgo)console.log(S6(`\uD83D\uDCC5 ${J.timeAgo}`,f))}),console.log(""),console.log(d3("─",f))})}else if(O.length===0)console.log(S6(`\uD83E\uDDE0 No recent context found for ${_}`,f))}var PO;var O4=f6(()=>{PO={NO_MEMORIES:(q)=>({message:`No previous memories found for ${q}`,suggestion:"This appears to be your first session. Memories will be created as you work."}),CONNECTION_FAILED:()=>({message:"Could not connect to memory system",suggestion:"Try restarting Claude Code or check if the MCP server is properly configured."}),SEARCH_FAILED:(q)=>({message:`Search for "${q}" didn't return any results`,suggestion:"Try using different keywords or check if memories exist for this project."}),LOAD_TIMEOUT:()=>({message:"Memory loading timed out",suggestion:"The operation is taking longer than expected. You can continue without loaded context."})}});import{join as E5}from"path";import{fileURLToPath as eO}from"url";import{setMaxListeners as FO}from"events";import{spawn as sO}from"child_process";import{createInterface as QO}from"readline";import*as J8 from"fs";import{stat as qz}from"fs/promises";function x5(q=UO){let _=new AbortController;return FO(q,_.signal),_}function jz(){return Kz}class n5{options;child;childStdin;childStdout;ready=!1;abortController;exitError;exitListeners=[];processExitHandler;abortHandler;constructor(q){this.options=q,this.abortController=q.abortController||x5(),this.initialize()}initialize(){try{let{prompt:q,additionalDirectories:_=[],cwd:j,executable:K=this.isRunningWithBun()?"bun":"node",executableArgs:Y=[],extraArgs:f={},pathToClaudeCodeExecutable:P,env:$={...process.env},stderr:w,customSystemPrompt:O,appendSystemPrompt:v,maxTurns:z,model:W,fallbackModel:J,permissionMode:T,permissionPromptToolName:H,continueConversation:X,resume:A,allowedTools:G=[],disallowedTools:D=[],mcpServers:M,strictMcpConfig:I,canUseTool:N}=this.options,R=["--output-format","stream-json","--verbose"];if(O)R.push("--system-prompt",O);if(v)R.push("--append-system-prompt",v);if(z)R.push("--max-turns",z.toString());if(W)R.push("--model",W);if($.DEBUG)R.push("--debug-to-stderr");if(N){if(typeof q==="string")throw new Error("canUseTool callback requires --input-format stream-json. Please set prompt as an AsyncIterable.");if(H)throw new Error("canUseTool callback cannot be used with permissionPromptToolName. Please use one or the other.");R.push("--permission-prompt-tool","stdio")}else if(H)R.push("--permission-prompt-tool",H);if(X)R.push("--continue");if(A)R.push("--resume",A);if(G.length>0)R.push("--allowedTools",G.join(","));if(D.length>0)R.push("--disallowedTools",D.join(","));if(M&&Object.keys(M).length>0)R.push("--mcp-config",JSON.stringify({mcpServers:M}));if(I)R.push("--strict-mcp-config");if(T&&T!=="default")R.push("--permission-mode",T);if(J){if(W&&J===W)throw new Error("Fallback model cannot be the same as the main model. Please specify a different model for fallbackModel option.");R.push("--fallback-model",J)}if(typeof q==="string")R.push("--print"),R.push("--",q.trim());else R.push("--input-format","stream-json");for(let p of _)R.push("--add-dir",p);for(let[p,c]of Object.entries(f))if(c===null)R.push(`--${p}`);else R.push(`--${p}`,c);if(!$.CLAUDE_CODE_ENTRYPOINT)$.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(!jz().existsSync(P)){let p=R5(P)?`Claude Code native binary not found at ${P}. Please ensure Claude Code is installed via native installer or specify a valid path with options.pathToClaudeCodeExecutable.`:`Claude Code executable not found at ${P}. Is options.pathToClaudeCodeExecutable set?`;throw new ReferenceError(p)}let b=R5(P),d=b?P:K,y=b?R:[...Y,P,...R];this.logDebug(b?`Spawning Claude Code native binary: ${P} ${R.join(" ")}`:`Spawning Claude Code process: ${K} ${[...Y,P,...R].join(" ")}`);let V=$.DEBUG||w?"pipe":"ignore";if(this.child=sO(d,y,{cwd:j,stdio:["pipe","pipe",V],signal:this.abortController.signal,env:$}),this.childStdin=this.child.stdin,this.childStdout=this.child.stdout,typeof q==="string")this.childStdin.end(),this.childStdin=void 0;if($.DEBUG||w)this.child.stderr.on("data",(p)=>{if(this.logDebug(`Claude Code stderr: ${p.toString()}`),w)w(p.toString())});let S=()=>{if(this.child&&!this.child.killed)this.child.kill("SIGTERM")};this.processExitHandler=S,this.abortHandler=S,process.on("exit",this.processExitHandler),this.abortController.signal.addEventListener("abort",this.abortHandler),this.child.on("error",(p)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new L_("Claude Code process aborted by user");else this.exitError=new Error(`Failed to spawn Claude Code process: ${p.message}`),this.logDebug(this.exitError.message)}),this.child.on("close",(p,c)=>{if(this.ready=!1,this.abortController.signal.aborted)this.exitError=new L_("Claude Code process aborted by user");else{let B=this.getProcessExitError(p,c);if(B)this.exitError=B,this.logDebug(B.message)}}),this.ready=!0}catch(q){throw this.ready=!1,q}}getProcessExitError(q,_){if(q!==0&&q!==null)return new Error(`Claude Code process exited with code ${q}`);else if(_)return new Error(`Claude Code process terminated by signal ${_}`);return}isRunningWithBun(){return process.versions.bun!==void 0||process.env.BUN_INSTALL!==void 0}logDebug(q){if(process.env.DEBUG)process.stderr.write(`${q} `)}write(q){if(this.abortController.signal.aborted)throw new L_("Operation aborted");if(!this.ready||!this.childStdin)throw new Error("ProcessTransport is not ready for writing");if(this.child?.killed||this.child?.exitCode!==null)throw new Error("Cannot write to terminated process");if(this.exitError)throw new Error(`Cannot write to process that exited with error: ${this.exitError.message}`);if(process.env.DEBUG_SDK)process.stderr.write(`[ProcessTransport] Writing to stdin: ${q.substring(0,100)} -`);try{if(!this.childStdin.write(q)&&process.env.DEBUG_SDK)console.warn("[ProcessTransport] Write buffer full, data queued")}catch(_){throw this.ready=!1,new Error(`Failed to write to process stdin: ${_.message}`)}}close(){if(this.childStdin)this.childStdin.end(),this.childStdin=void 0;if(this.processExitHandler)process.off("exit",this.processExitHandler),this.processExitHandler=void 0;if(this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;for(let{handler:q}of this.exitListeners)this.child?.off("exit",q);if(this.exitListeners=[],this.child&&!this.child.killed)this.child.kill("SIGTERM"),setTimeout(()=>{if(this.child&&!this.child.killed)this.child.kill("SIGKILL")},5000);this.ready=!1}isReady(){return this.ready}async*readMessages(){if(!this.childStdout)throw new Error("ProcessTransport output stream not available");let q=sO({input:this.childStdout});try{for await(let _ of q)if(_.trim())yield JSON.parse(_);await this.waitForExit()}catch(_){throw _}finally{q.close()}}endInput(){if(this.childStdin)this.childStdin.end()}getInputStream(){return this.childStdin}onExit(q){if(!this.child)return()=>{};let _=(j,K)=>{let Y=this.getProcessExitError(j,K);q(Y)};return this.child.on("exit",_),this.exitListeners.push({callback:q,handler:_}),()=>{if(this.child)this.child.off("exit",_);let j=this.exitListeners.findIndex((K)=>K.handler===_);if(j!==-1)this.exitListeners.splice(j,1)}}async waitForExit(){if(!this.child){if(this.exitError)throw this.exitError;return}if(this.child.exitCode!==null||this.child.killed){if(this.exitError)throw this.exitError;return}return new Promise((q,_)=>{let j=(Y,f)=>{if(this.abortController.signal.aborted){_(new L_("Operation aborted"));return}let P=this.getProcessExitError(Y,f);if(P)_(P);else q()};this.child.once("exit",j);let K=(Y)=>{this.child.off("exit",j),_(Y)};this.child.once("error",K),this.child.once("exit",()=>{this.child.off("error",K)})})}}function R5(q){return![".js",".mjs",".tsx",".ts",".jsx"].some((j)=>q.endsWith(j))}class r5{sendMcpMessage;isClosed=!1;constructor(q){this.sendMcpMessage=q}onclose;onerror;onmessage;async start(){}async send(q){if(this.isClosed)throw new Error("Transport is closed");this.sendMcpMessage(q)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}function Yz(q){o5=q}function L3(){return o5}function F(q,_){let j=L3(),K=l3({issueData:_,data:q.data,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,j,j===n_?void 0:n_].filter((Y)=>!!Y)});q.common.issues.push(K)}class k6{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(q,_){let j=[];for(let K of _){if(K.status==="aborted")return v8;if(K.status==="dirty")q.dirty();j.push(K.value)}return{status:q.value,value:j}}static async mergeObjectAsync(q,_){let j=[];for(let K of _){let Y=await K.key,f=await K.value;j.push({key:Y,value:f})}return k6.mergeObjectSync(q,j)}static mergeObjectSync(q,_){let j={};for(let K of _){let{key:Y,value:f}=K;if(Y.status==="aborted")return v8;if(f.status==="aborted")return v8;if(Y.status==="dirty")q.dirty();if(f.status==="dirty")q.dirty();if(Y.value!=="__proto__"&&(typeof f.value!=="undefined"||K.alwaysSet))j[Y.value]=f.value}return{status:q.value,value:j}}}class wq{constructor(q,_,j,K){this._cachedPath=[],this.parent=q,this.data=_,this._path=j,this._key=K}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function Z8(q){if(!q)return{};let{errorMap:_,invalid_type_error:j,required_error:K,description:Y}=q;if(_&&(j||K))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(_)return{errorMap:_,description:Y};return{errorMap:(P,$)=>{let{message:w}=q;if(P.code==="invalid_enum_value")return{message:w??$.defaultError};if(typeof $.data==="undefined")return{message:w??K??$.defaultError};if(P.code!=="invalid_type")return{message:$.defaultError};return{message:w??j??$.defaultError}},description:Y}}class k8{get description(){return this._def.description}_getType(q){return mq(q.data)}_getOrReturnCtx(q,_){return _||{common:q.parent.common,data:q.data,parsedType:mq(q.data),schemaErrorMap:this._def.errorMap,path:q.path,parent:q.parent}}_processInputParams(q){return{status:new k6,ctx:{common:q.parent.common,data:q.data,parsedType:mq(q.data),schemaErrorMap:this._def.errorMap,path:q.path,parent:q.parent}}}_parseSync(q){let _=this._parse(q);if(IK(_))throw new Error("Synchronous parse encountered promise.");return _}_parseAsync(q){let _=this._parse(q);return Promise.resolve(_)}parse(q,_){let j=this.safeParse(q,_);if(j.success)return j.data;throw j.error}safeParse(q,_){let j={common:{issues:[],async:_?.async??!1,contextualErrorMap:_?.errorMap},path:_?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:mq(q)},K=this._parseSync({data:q,path:j.path,parent:j});return m5(j,K)}"~validate"(q){let _={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:mq(q)};if(!this["~standard"].async)try{let j=this._parseSync({data:q,path:[],parent:_});return $_(j)?{value:j.value}:{issues:_.common.issues}}catch(j){if(j?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;_.common={issues:[],async:!0}}return this._parseAsync({data:q,path:[],parent:_}).then((j)=>$_(j)?{value:j.value}:{issues:_.common.issues})}async parseAsync(q,_){let j=await this.safeParseAsync(q,_);if(j.success)return j.data;throw j.error}async safeParseAsync(q,_){let j={common:{issues:[],contextualErrorMap:_?.errorMap,async:!0},path:_?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:mq(q)},K=this._parse({data:q,path:j.path,parent:j}),Y=await(IK(K)?K:Promise.resolve(K));return m5(j,Y)}refine(q,_){let j=(K)=>{if(typeof _==="string"||typeof _==="undefined")return{message:_};else if(typeof _==="function")return _(K);else return _};return this._refinement((K,Y)=>{let f=q(K),P=()=>Y.addIssue({code:t.custom,...j(K)});if(typeof Promise!=="undefined"&&f instanceof Promise)return f.then(($)=>{if(!$)return P(),!1;else return!0});if(!f)return P(),!1;else return!0})}refinement(q,_){return this._refinement((j,K)=>{if(!q(j))return K.addIssue(typeof _==="function"?_(j,K):_),!1;else return!0})}_refinement(q){return new B6({schema:this,typeName:W8.ZodEffects,effect:{type:"refinement",refinement:q}})}superRefine(q){return this._refinement(q)}constructor(q){this.spa=this.safeParseAsync,this._def=q,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(_)=>this["~validate"](_)}}optional(){return $q.create(this,this._def)}nullable(){return Iq.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fq.create(this)}promise(){return v_.create(this,this._def)}or(q){return o_.create([this,q],this._def)}and(q){return a_.create(this,q,this._def)}transform(q){return new B6({...Z8(this._def),schema:this,typeName:W8.ZodEffects,effect:{type:"transform",transform:q}})}default(q){let _=typeof q==="function"?q:()=>q;return new F_({...Z8(this._def),innerType:this,defaultValue:_,typeName:W8.ZodDefault})}brand(){return new n3({typeName:W8.ZodBranded,type:this,...Z8(this._def)})}catch(q){let _=typeof q==="function"?q:()=>q;return new U_({...Z8(this._def),innerType:this,catchValue:_,typeName:W8.ZodCatch})}describe(q){return new this.constructor({...this._def,description:q})}pipe(q){return lK.create(this,q)}readonly(){return s_.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function B5(q){let _="[0-5]\\d";if(q.precision)_=`${_}\\.\\d{${q.precision}}`;else if(q.precision==null)_=`${_}(\\.\\d+)?`;let j=q.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${_})${j}`}function Dz(q){return new RegExp(`^${B5(q)}$`)}function t5(q){let _=`${a5}T${B5(q)}`,j=[];if(j.push(q.local?"Z?":"Z"),q.offset)j.push("([+-]\\d{2}:?\\d{2})");return _=`${_}(${j.join("|")})`,new RegExp(`^${_}$`)}function Cz(q,_){if((_==="v4"||!_)&&Zz.test(q))return!0;if((_==="v6"||!_)&&Xz.test(q))return!0;return!1}function Vz(q,_){if(!Wz.test(q))return!1;try{let[j]=q.split(".");if(!j)return!1;let K=j.replace(/-/g,"+").replace(/_/g,"/").padEnd(j.length+(4-j.length%4)%4,"="),Y=JSON.parse(atob(K));if(typeof Y!=="object"||Y===null)return!1;if("typ"in Y&&Y?.typ!=="JWT")return!1;if(!Y.alg)return!1;if(_&&Y.alg!==_)return!1;return!0}catch{return!1}}function Mz(q,_){if((_==="v4"||!_)&&kz.test(q))return!0;if((_==="v6"||!_)&&Az.test(q))return!0;return!1}function Nz(q,_){let j=(q.toString().split(".")[1]||"").length,K=(_.toString().split(".")[1]||"").length,Y=j>K?j:K,f=Number.parseInt(q.toFixed(Y).replace(".","")),P=Number.parseInt(_.toFixed(Y).replace(".",""));return f%P/10**Y}function p_(q){if(q instanceof i8){let _={};for(let j in q.shape){let K=q.shape[j];_[j]=$q.create(p_(K))}return new i8({...q._def,shape:()=>_})}else if(q instanceof fq)return new fq({...q._def,type:p_(q.element)});else if(q instanceof $q)return $q.create(p_(q.unwrap()));else if(q instanceof Iq)return Iq.create(p_(q.unwrap()));else if(q instanceof Aq)return Aq.create(q.items.map((_)=>p_(_)));else return q}function T4(q,_){let j=mq(q),K=mq(_);if(q===_)return{valid:!0,data:q};else if(j===s.object&&K===s.object){let Y=h8.objectKeys(_),f=h8.objectKeys(q).filter(($)=>Y.indexOf($)!==-1),P={...q,..._};for(let $ of f){let w=T4(q[$],_[$]);if(!w.valid)return{valid:!1};P[$]=w.data}return{valid:!0,data:P}}else if(j===s.array&&K===s.array){if(q.length!==_.length)return{valid:!1};let Y=[];for(let f=0;f{let f=q(K);if(f instanceof Promise)return f.then((P)=>{if(!P){let $=I5(_,K),w=$.fatal??j??!0;Y.addIssue({code:"custom",...$,fatal:w})}});if(!f){let P=I5(_,K),$=P.fatal??j??!0;Y.addIssue({code:"custom",...P,fatal:$})}return});return O_.create()}function XW(q){if(!q)return{};let{errorMap:_,invalid_type_error:j,required_error:K,description:Y}=q;if(_&&(j||K))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(_)return{errorMap:_,description:Y};return{errorMap:(P,$)=>{var w,O;let{message:v}=q;if(P.code==="invalid_enum_value")return{message:v!==null&&v!==void 0?v:$.defaultError};if(typeof $.data==="undefined")return{message:(w=v!==null&&v!==void 0?v:K)!==null&&w!==void 0?w:$.defaultError};if(P.code!=="invalid_type")return{message:$.defaultError};return{message:(O=v!==null&&v!==void 0?v:j)!==null&&O!==void 0?O:$.defaultError}},description:Y}}function gq({prompt:q,options:{abortController:_=x5(),additionalDirectories:j=[],allowedTools:K=[],appendSystemPrompt:Y,canUseTool:f,continue:P,customSystemPrompt:$,cwd:w,disallowedTools:O=[],env:v,executable:z=AW()?"bun":"node",executableArgs:W=[],extraArgs:J={},fallbackModel:T,hooks:H,maxTurns:X,mcpServers:A,model:G,pathToClaudeCodeExecutable:D,permissionMode:M="default",permissionPromptToolName:I,resume:N,stderr:R,strictMcpConfig:L}={}}){if(!v)v={...process.env};if(!v.CLAUDE_CODE_ENTRYPOINT)v.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(D===void 0){let p=tO(import.meta.url),c=E5(p,"..");D=E5(c,"cli.js")}let b={},d=new Map;if(A)for(let[p,c]of Object.entries(A))if(c.type==="sdk")d.set(p,c.instance),b[p]={type:"sdk",name:p};else b[p]=c;let y=typeof q!=="string",V=new n5({prompt:q,abortController:_,additionalDirectories:j,cwd:w,executable:z,executableArgs:W,extraArgs:J,pathToClaudeCodeExecutable:D,env:v,stderr:R,customSystemPrompt:$,appendSystemPrompt:Y,maxTurns:X,model:G,fallbackModel:T,permissionMode:M,permissionPromptToolName:I,continueConversation:P,resume:N,allowedTools:K,disallowedTools:O,mcpServers:A,strictMcpConfig:L,canUseTool:!!f,hooks:!!H}),S=new i5(V,y,f,H,_,d);if(typeof q!=="string")S.streamInput(q);return S}function AW(){return process.versions.bun!==void 0||process.env.BUN_INSTALL!==void 0}var wO,OO,v4,zO,vO,WO=(q,_,j)=>{j=q!=null?wO(OO(q)):{};let K=_||!q||!q.__esModule?v4(j,"default",{value:q,enumerable:!0}):j;for(let Y of zO(q))if(!vO.call(K,Y))v4(K,Y,{get:()=>q[Y],enumerable:!0});return K},T8=(q,_)=>()=>(_||q((_={exports:{}}).exports,_),_.exports),HO=(q,_)=>{for(var j in _)v4(q,j,{get:_[j],enumerable:!0,configurable:!0,set:(K)=>_[j]=()=>K})},JO,X4,TO,Q_,d5,ZO,A4,G4,p5,L5,kO,XO,AO,GO,uO,hO,DO,CO,VO,MO,NO,bO,SO,EO,M5,N5,b5,S5,RO,mO,IO,gO,yO,dO,pO,LO,lO,xO,nO,cO,rO,l5,iO,oO,aO,BO,FO=50,qz,_z,L_,c5,i5,k,h8,W4,s,mq=(q)=>{switch(typeof q){case"undefined":return s.undefined;case"string":return s.string;case"number":return Number.isNaN(q)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":if(Array.isArray(q))return s.array;if(q===null)return s.null;if(q.then&&typeof q.then==="function"&&q.catch&&typeof q.catch==="function")return s.promise;if(typeof Map!=="undefined"&&q instanceof Map)return s.map;if(typeof Set!=="undefined"&&q instanceof Set)return s.set;if(typeof Date!=="undefined"&&q instanceof Date)return s.date;return s.object;default:return s.unknown}},t,jz=(q)=>{return JSON.stringify(q,null,2).replace(/"([^"]+)":/g,"$1:")},y6,Pz=(q,_)=>{let j;switch(q.code){case t.invalid_type:if(q.received===s.undefined)j="Required";else j=`Expected ${q.expected}, received ${q.received}`;break;case t.invalid_literal:j=`Invalid literal value, expected ${JSON.stringify(q.expected,h8.jsonStringifyReplacer)}`;break;case t.unrecognized_keys:j=`Unrecognized key(s) in object: ${h8.joinValues(q.keys,", ")}`;break;case t.invalid_union:j="Invalid input";break;case t.invalid_union_discriminator:j=`Invalid discriminator value. Expected ${h8.joinValues(q.options)}`;break;case t.invalid_enum_value:j=`Invalid enum value. Expected ${h8.joinValues(q.options)}, received '${q.received}'`;break;case t.invalid_arguments:j="Invalid function arguments";break;case t.invalid_return_type:j="Invalid function return type";break;case t.invalid_date:j="Invalid date";break;case t.invalid_string:if(typeof q.validation==="object")if("includes"in q.validation){if(j=`Invalid input: must include "${q.validation.includes}"`,typeof q.validation.position==="number")j=`${j} at one or more positions greater than or equal to ${q.validation.position}`}else if("startsWith"in q.validation)j=`Invalid input: must start with "${q.validation.startsWith}"`;else if("endsWith"in q.validation)j=`Invalid input: must end with "${q.validation.endsWith}"`;else h8.assertNever(q.validation);else if(q.validation!=="regex")j=`Invalid ${q.validation}`;else j="Invalid";break;case t.too_small:if(q.type==="array")j=`Array must contain ${q.exact?"exactly":q.inclusive?"at least":"more than"} ${q.minimum} element(s)`;else if(q.type==="string")j=`String must contain ${q.exact?"exactly":q.inclusive?"at least":"over"} ${q.minimum} character(s)`;else if(q.type==="number")j=`Number must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${q.minimum}`;else if(q.type==="bigint")j=`Number must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${q.minimum}`;else if(q.type==="date")j=`Date must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(q.minimum))}`;else j="Invalid input";break;case t.too_big:if(q.type==="array")j=`Array must contain ${q.exact?"exactly":q.inclusive?"at most":"less than"} ${q.maximum} element(s)`;else if(q.type==="string")j=`String must contain ${q.exact?"exactly":q.inclusive?"at most":"under"} ${q.maximum} character(s)`;else if(q.type==="number")j=`Number must be ${q.exact?"exactly":q.inclusive?"less than or equal to":"less than"} ${q.maximum}`;else if(q.type==="bigint")j=`BigInt must be ${q.exact?"exactly":q.inclusive?"less than or equal to":"less than"} ${q.maximum}`;else if(q.type==="date")j=`Date must be ${q.exact?"exactly":q.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(q.maximum))}`;else j="Invalid input";break;case t.custom:j="Invalid input";break;case t.invalid_intersection_types:j="Intersection results could not be merged";break;case t.not_multiple_of:j=`Number must be a multiple of ${q.multipleOf}`;break;case t.not_finite:j="Number must be finite";break;default:j=_.defaultError,h8.assertNever(q)}return{message:j}},n_,o5,l3=(q)=>{let{data:_,path:j,errorMaps:K,issueData:Y}=q,f=[...j,...Y.path||[]],P={...Y,path:f};if(Y.message!==void 0)return{...Y,path:f,message:Y.message};let $="",w=K.filter((O)=>!!O).slice().reverse();for(let O of w)$=O(P,{data:_,defaultError:$}).message;return{...Y,path:f,message:$}},fz,v8,l_=(q)=>({status:"dirty",value:q}),D6=(q)=>({status:"valid",value:q}),H4=(q)=>q.status==="aborted",J4=(q)=>q.status==="dirty",$_=(q)=>q.status==="valid",IK=(q)=>typeof Promise!=="undefined"&&q instanceof Promise,f8,m5=(q,_)=>{if($_(_))return{success:!0,data:_.value};else{if(!q.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let j=new y6(q.common.issues);return this._error=j,this._error}}}},$z,wz,Oz,zz,vz,Wz,Hz,Jz,Tz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",z4,Zz,kz,Xz,Az,Gz,uz,a5="((\\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])))",hz,Yq,Bq,tq,c_,w_,gK,r_,i_,O_,aq,Xq,yK,fq,i8,o_,Rq=(q)=>{if(q instanceof B_)return Rq(q.schema);else if(q instanceof B6)return Rq(q.innerType());else if(q instanceof t_)return[q.value];else if(q instanceof eq)return q.options;else if(q instanceof e_)return h8.objectValues(q.enum);else if(q instanceof F_)return Rq(q._def.innerType);else if(q instanceof r_)return[void 0];else if(q instanceof i_)return[null];else if(q instanceof $q)return[void 0,...Rq(q.unwrap())];else if(q instanceof Iq)return[null,...Rq(q.unwrap())];else if(q instanceof n3)return Rq(q.unwrap());else if(q instanceof s_)return Rq(q.unwrap());else if(q instanceof U_)return Rq(q._def.innerType);else return[]},x3,a_,Aq,dK,pK,z_,x_,B_,t_,eq,e_,v_,B6,$q,Iq,F_,U_,LK,bz,n3,lK,s_,Sz,W8,Ez=(q,_={message:`Input not instance of ${q.name}`})=>F5((j)=>j instanceof q,_),U5,s5,Rz,mz,Q5,Iz,gz,yz,dz,pz,Lz,lz,xz,nz,cz,rz,iz,oz,az,Bz,tz,ez,Fz,Uz,sz,Qz,qv,_v,Kv,g5,jv,Pv,Yv,fv,$v=()=>U5().optional(),wv=()=>s5().optional(),Ov=()=>Q5().optional(),zv,vv,c3="2.0",q1,_1,Wv,t6,E6,xK,Gq,e6,r3,Hv,Jv,Tv,y5,Zv,OC,K1,j1,nK,P1,kv,Xv,Av,Gv,uv,Y1,hv,f1,i3,o3,$1,w1,u4,O1,z1,Dv,Cv,Vv,Mv,Nv,bv,Sv,Ev,Rv,mv,Iv,gv,yv,dv,pv,Lv,h4,D4,C4,lv,xv,v1,nv,cv,rv,iv,ov,av,Bv,W1,zC,tv,ev,H1,Fv,Uv,sv,Qv,qW,_W,KW,jW,PW,YW,fW,$W,wW,OW,zW,vW,WW,HW,JW,TW,ZW,kW,vC,WC,HC,JC,TC,ZC,kC,XC,AC,Z4,k4;var a3=f6(()=>{wO=Object.create,OO=Object.getPrototypeOf,v4=Object.defineProperty,zO=Object.getOwnPropertyNames,vO=Object.prototype.hasOwnProperty,JO=T8((q,_)=>{(function(j,K){typeof q==="object"&&typeof _!=="undefined"?K(q):typeof define==="function"&&define.amd?define(["exports"],K):K(j.URI=j.URI||{})})(q,function(j){function K(){for(var m=arguments.length,u=Array(m),g=0;g1){u[0]=u[0].slice(0,-1);var l=u.length-1;for(var n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=H-X,V=Math.floor,S=String.fromCharCode;function p(m){throw new RangeError(d[m])}function c(m,u){var g=[],l=m.length;while(l--)g[l]=u(m[l]);return g}function B(m,u){var g=m.split("@"),l="";if(g.length>1)l=g[0]+"@",m=g[1];m=m.replace(b,".");var n=m.split("."),U=c(n,u).join(".");return l+U}function e(m){var u=[],g=0,l=m.length;while(g=55296&&n<=56319&&g>1,u+=V(u/g);for(;u>y*A>>1;n+=H)u=V(u/y);return V(n+(y+1)*u/(u+G))},K8=function m(u){var g=[],l=u.length,n=0,U=I,X8=M,C8=u.lastIndexOf(N);if(C8<0)C8=0;for(var S8=0;S8=128)p("not-basic");g.push(u.charCodeAt(S8))}for(var q6=C8>0?C8+1:0;q6=l)p("invalid-input");var d8=q8(u.charCodeAt(q6++));if(d8>=H||d8>V((T-n)/c8))p("overflow");n+=d8*c8;var N8=_6<=X8?X:_6>=X8+A?A:_6-X8;if(d8V(T/r8))p("overflow");c8*=r8}var E8=g.length+1;if(X8=w8(n-u8,E8,u8==0),V(n/E8)>T-U)p("overflow");U+=V(n/E8),n%=E8,g.splice(n++,0,U)}return String.fromCodePoint.apply(String,g)},G8=function m(u){var g=[];u=e(u);var l=u.length,n=I,U=0,X8=M,C8=!0,S8=!1,q6=void 0;try{for(var u8=u[Symbol.iterator](),c8;!(C8=(c8=u8.next()).done);C8=!0){var _6=c8.value;if(_6<128)g.push(S(_6))}}catch(f_){S8=!0,q6=f_}finally{try{if(!C8&&u8.return)u8.return()}finally{if(S8)throw q6}}var d8=g.length,N8=d8;if(d8)g.push(N);while(N8=n&&g6V((T-U)/a6))p("overflow");U+=(r8-n)*a6,n=r8;var kq=!0,Y_=!1,Nq=void 0;try{for(var VK=u[Symbol.iterator](),R3;!(kq=(R3=VK.next()).done);kq=!0){var m3=R3.value;if(m3T)p("overflow");if(m3==n){var S_=U;for(var E_=H;;E_+=H){var bq=E_<=X8?X:E_>=X8+A?A:E_-X8;if(S_>6|192).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase();else g="%"+(u>>12|224).toString(16).toUpperCase()+"%"+(u>>6&63|128).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase();return g}function E(m){var u="",g=0,l=m.length;while(g=194&&n<224){if(l-g>=6){var U=parseInt(m.substr(g+4,2),16);u+=String.fromCharCode((n&31)<<6|U&63)}else u+=m.substr(g,6);g+=6}else if(n>=224){if(l-g>=9){var X8=parseInt(m.substr(g+4,2),16),C8=parseInt(m.substr(g+7,2),16);u+=String.fromCharCode((n&15)<<12|(X8&63)<<6|C8&63)}else u+=m.substr(g,9);g+=9}else u+=m.substr(g,3),g+=3}return u}function x(m,u){function g(l){var n=E(l);return!n.match(u.UNRESERVED)?l:n}if(m.scheme)m.scheme=String(m.scheme).replace(u.PCT_ENCODED,g).toLowerCase().replace(u.NOT_SCHEME,"");if(m.userinfo!==void 0)m.userinfo=String(m.userinfo).replace(u.PCT_ENCODED,g).replace(u.NOT_USERINFO,Z).replace(u.PCT_ENCODED,P);if(m.host!==void 0)m.host=String(m.host).replace(u.PCT_ENCODED,g).toLowerCase().replace(u.NOT_HOST,Z).replace(u.PCT_ENCODED,P);if(m.path!==void 0)m.path=String(m.path).replace(u.PCT_ENCODED,g).replace(m.scheme?u.NOT_PATH:u.NOT_PATH_NOSCHEME,Z).replace(u.PCT_ENCODED,P);if(m.query!==void 0)m.query=String(m.query).replace(u.PCT_ENCODED,g).replace(u.NOT_QUERY,Z).replace(u.PCT_ENCODED,P);if(m.fragment!==void 0)m.fragment=String(m.fragment).replace(u.PCT_ENCODED,g).replace(u.NOT_FRAGMENT,Z).replace(u.PCT_ENCODED,P);return m}function i(m){return m.replace(/^0*(.*)/,"$1")||"0"}function r(m,u){var g=m.match(u.IPV4ADDRESS)||[],l=W(g,2),n=l[1];if(n)return n.split(".").map(i).join(".");else return m}function a(m,u){var g=m.match(u.IPV6ADDRESS)||[],l=W(g,3),n=l[1],U=l[2];if(n){var X8=n.toLowerCase().split("::").reverse(),C8=W(X8,2),S8=C8[0],q6=C8[1],u8=q6?q6.split(":").map(i):[],c8=S8.split(":").map(i),_6=u.IPV4ADDRESS.test(c8[c8.length-1]),d8=_6?7:8,N8=c8.length-d8,r8=Array(d8);for(var E8=0;E81){var m8=r8.slice(0,I6.index),g6=r8.slice(I6.index+I6.length);o6=m8.join(":")+"::"+g6.join(":")}else o6=r8.join(":");if(U)o6+="%"+U;return o6}else return m}var P8=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,H8="".match(/(){0}/)[1]===void 0;function O8(m){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g={},l=u.iri!==!1?z:v;if(u.reference==="suffix")m=(u.scheme?u.scheme+":":"")+"//"+m;var n=m.match(P8);if(n){if(H8){if(g.scheme=n[1],g.userinfo=n[3],g.host=n[4],g.port=parseInt(n[5],10),g.path=n[6]||"",g.query=n[7],g.fragment=n[8],isNaN(g.port))g.port=n[5]}else if(g.scheme=n[1]||void 0,g.userinfo=m.indexOf("@")!==-1?n[3]:void 0,g.host=m.indexOf("//")!==-1?n[4]:void 0,g.port=parseInt(n[5],10),g.path=n[6]||"",g.query=m.indexOf("?")!==-1?n[7]:void 0,g.fragment=m.indexOf("#")!==-1?n[8]:void 0,isNaN(g.port))g.port=m.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0;if(g.host)g.host=a(r(g.host,l),l);if(g.scheme===void 0&&g.userinfo===void 0&&g.host===void 0&&g.port===void 0&&!g.path&&g.query===void 0)g.reference="same-document";else if(g.scheme===void 0)g.reference="relative";else if(g.fragment===void 0)g.reference="absolute";else g.reference="uri";if(u.reference&&u.reference!=="suffix"&&u.reference!==g.reference)g.error=g.error||"URI is not a "+u.reference+" reference.";var U=C[(u.scheme||g.scheme||"").toLowerCase()];if(!u.unicodeSupport&&(!U||!U.unicodeSupport)){if(g.host&&(u.domainHost||U&&U.domainHost))try{g.host=h.toASCII(g.host.replace(l.PCT_ENCODED,E).toLowerCase())}catch(X8){g.error=g.error||"Host's domain name can not be converted to ASCII via punycode: "+X8}x(g,v)}else x(g,l);if(U&&U.parse)U.parse(g,u)}else g.error=g.error||"URI can not be parsed.";return g}function A8(m,u){var g=u.iri!==!1?z:v,l=[];if(m.userinfo!==void 0)l.push(m.userinfo),l.push("@");if(m.host!==void 0)l.push(a(r(String(m.host),g),g).replace(g.IPV6ADDRESS,function(n,U,X8){return"["+U+(X8?"%25"+X8:"")+"]"}));if(typeof m.port==="number"||typeof m.port==="string")l.push(":"),l.push(String(m.port));return l.length?l.join(""):void 0}var g8=/^\.\.?\//,M8=/^\/\.(\/|$)/,v6=/^\/\.\.(\/|$)/,a8=/^\/?(?:.|\n)*?(?=\/|$)/;function u6(m){var u=[];while(m.length)if(m.match(g8))m=m.replace(g8,"");else if(m.match(M8))m=m.replace(M8,"/");else if(m.match(v6))m=m.replace(v6,"/"),u.pop();else if(m==="."||m==="..")m="";else{var g=m.match(a8);if(g){var l=g[0];m=m.slice(l.length),u.push(l)}else throw new Error("Unexpected dot segment condition")}return u.join("")}function y8(m){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=u.iri?z:v,l=[],n=C[(u.scheme||m.scheme||"").toLowerCase()];if(n&&n.serialize)n.serialize(m,u);if(m.host){if(g.IPV6ADDRESS.test(m.host));else if(u.domainHost||n&&n.domainHost)try{m.host=!u.iri?h.toASCII(m.host.replace(g.PCT_ENCODED,E).toLowerCase()):h.toUnicode(m.host)}catch(C8){m.error=m.error||"Host's domain name can not be converted to "+(!u.iri?"ASCII":"Unicode")+" via punycode: "+C8}}if(x(m,g),u.reference!=="suffix"&&m.scheme)l.push(m.scheme),l.push(":");var U=A8(m,u);if(U!==void 0){if(u.reference!=="suffix")l.push("//");if(l.push(U),m.path&&m.path.charAt(0)!=="/")l.push("/")}if(m.path!==void 0){var X8=m.path;if(!u.absolutePath&&(!n||!n.absolutePath))X8=u6(X8);if(U===void 0)X8=X8.replace(/^\/\//,"/%2F");l.push(X8)}if(m.query!==void 0)l.push("?"),l.push(m.query);if(m.fragment!==void 0)l.push("#"),l.push(m.fragment);return l.join("")}function Y6(m,u){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments[3],n={};if(!l)m=O8(y8(m,g),g),u=O8(y8(u,g),g);if(g=g||{},!g.tolerant&&u.scheme)n.scheme=u.scheme,n.userinfo=u.userinfo,n.host=u.host,n.port=u.port,n.path=u6(u.path||""),n.query=u.query;else{if(u.userinfo!==void 0||u.host!==void 0||u.port!==void 0)n.userinfo=u.userinfo,n.host=u.host,n.port=u.port,n.path=u6(u.path||""),n.query=u.query;else{if(!u.path)if(n.path=m.path,u.query!==void 0)n.query=u.query;else n.query=m.query;else{if(u.path.charAt(0)==="/")n.path=u6(u.path);else{if((m.userinfo!==void 0||m.host!==void 0||m.port!==void 0)&&!m.path)n.path="/"+u.path;else if(!m.path)n.path=u.path;else n.path=m.path.slice(0,m.path.lastIndexOf("/")+1)+u.path;n.path=u6(n.path)}n.query=u.query}n.userinfo=m.userinfo,n.host=m.host,n.port=m.port}n.scheme=m.scheme}return n.fragment=u.fragment,n}function i6(m,u,g){var l=w({scheme:"null"},g);return y8(Y6(O8(m,l),O8(u,l),l,!0),l)}function m6(m,u){if(typeof m==="string")m=y8(O8(m,u),u);else if(f(m)==="object")m=O8(y8(m,u),u);return m}function E3(m,u,g){if(typeof m==="string")m=y8(O8(m,g),g);else if(f(m)==="object")m=y8(m,g);if(typeof u==="string")u=y8(O8(u,g),g);else if(f(u)==="object")u=y8(u,g);return m===u}function t7(m,u){return m&&m.toString().replace(!u||!u.iri?v.ESCAPE:z.ESCAPE,Z)}function jq(m,u){return m&&m.toString().replace(!u||!u.iri?v.PCT_ENCODED:z.PCT_ENCODED,E)}var DK={scheme:"http",domainHost:!0,parse:function m(u,g){if(!u.host)u.error=u.error||"HTTP URIs must have a host.";return u},serialize:function m(u,g){var l=String(u.scheme).toLowerCase()==="https";if(u.port===(l?443:80)||u.port==="")u.port=void 0;if(!u.path)u.path="/";return u}},p9={scheme:"https",domainHost:DK.domainHost,parse:DK.parse,serialize:DK.serialize};function L9(m){return typeof m.secure==="boolean"?m.secure:String(m.scheme).toLowerCase()==="wss"}var CK={scheme:"ws",domainHost:!0,parse:function m(u,g){var l=u;return l.secure=L9(l),l.resourceName=(l.path||"/")+(l.query?"?"+l.query:""),l.path=void 0,l.query=void 0,l},serialize:function m(u,g){if(u.port===(L9(u)?443:80)||u.port==="")u.port=void 0;if(typeof u.secure==="boolean")u.scheme=u.secure?"wss":"ws",u.secure=void 0;if(u.resourceName){var l=u.resourceName.split("?"),n=W(l,2),U=n[0],X8=n[1];u.path=U&&U!=="/"?U:void 0,u.query=X8,u.resourceName=void 0}return u.fragment=void 0,u}},l9={scheme:"wss",domainHost:CK.domainHost,parse:CK.parse,serialize:CK.serialize},p$={},L$=!0,x9="[A-Za-z0-9\\-\\.\\_\\~"+(L$?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",Zq="[0-9A-Fa-f]",l$=Y(Y("%[EFef]"+Zq+"%"+Zq+Zq+"%"+Zq+Zq)+"|"+Y("%[89A-Fa-f]"+Zq+"%"+Zq+Zq)+"|"+Y("%"+Zq+Zq)),x$="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",n$="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",c$=K(n$,"[\\\"\\\\]"),r$="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",i$=new RegExp(x9,"g"),b_=new RegExp(l$,"g"),o$=new RegExp(K("[^]",x$,"[\\.]","[\\\"]",c$),"g"),n9=new RegExp(K("[^]",x9,r$),"g"),a$=n9;function e7(m){var u=E(m);return!u.match(i$)?m:u}var c9={scheme:"mailto",parse:function m(u,g){var l=u,n=l.to=l.path?l.path.split(","):[];if(l.path=void 0,l.query){var U=!1,X8={},C8=l.query.split("&");for(var S8=0,q6=C8.length;S8{_.exports=function j(K,Y){if(K===Y)return!0;if(K&&Y&&typeof K=="object"&&typeof Y=="object"){if(K.constructor!==Y.constructor)return!1;var f,P,$;if(Array.isArray(K)){if(f=K.length,f!=Y.length)return!1;for(P=f;P--!==0;)if(!j(K[P],Y[P]))return!1;return!0}if(K.constructor===RegExp)return K.source===Y.source&&K.flags===Y.flags;if(K.valueOf!==Object.prototype.valueOf)return K.valueOf()===Y.valueOf();if(K.toString!==Object.prototype.toString)return K.toString()===Y.toString();if($=Object.keys(K),f=$.length,f!==Object.keys(Y).length)return!1;for(P=f;P--!==0;)if(!Object.prototype.hasOwnProperty.call(Y,$[P]))return!1;for(P=f;P--!==0;){var w=$[P];if(!j(K[w],Y[w]))return!1}return!0}return K!==K&&Y!==Y}}),TO=T8((q,_)=>{_.exports=function j(K){var Y=0,f=K.length,P=0,$;while(P=55296&&$<=56319&&P{_.exports={copy:j,checkDataType:K,checkDataTypes:Y,coerceToTypes:P,toHash:$,getProperty:v,escapeQuotes:z,equal:X4(),ucs2length:TO(),varOccurences:W,varReplace:J,schemaHasRules:T,schemaHasRulesExcept:H,schemaUnknownRules:X,toQuotedString:A,getPathExpr:G,getPath:D,getData:N,unescapeFragment:L,unescapeJsonPointer:y,escapeFragment:b,escapeJsonPointer:d};function j(V,S){S=S||{};for(var p in V)S[p]=V[p];return S}function K(V,S,p,c){var B=c?" !== ":" === ",e=c?" || ":" && ",Y8=c?"!":"",q8=c?"":"!";switch(V){case"null":return S+B+"null";case"array":return Y8+"Array.isArray("+S+")";case"object":return"("+Y8+S+e+"typeof "+S+B+'"object"'+e+q8+"Array.isArray("+S+"))";case"integer":return"(typeof "+S+B+'"number"'+e+q8+"("+S+" % 1)"+e+S+B+S+(p?e+Y8+"isFinite("+S+")":"")+")";case"number":return"(typeof "+S+B+'"'+V+'"'+(p?e+Y8+"isFinite("+S+")":"")+")";default:return"typeof "+S+B+'"'+V+'"'}}function Y(V,S,p){switch(V.length){case 1:return K(V[0],S,p,!0);default:var c="",B=$(V);if(B.array&&B.object)c=B.null?"(":"(!"+S+" || ",c+="typeof "+S+' !== "object")',delete B.null,delete B.array,delete B.object;if(B.number)delete B.integer;for(var e in B)c+=(c?" && ":"")+K(e,S,p,!0);return c}}var f=$(["string","number","integer","boolean","null"]);function P(V,S){if(Array.isArray(S)){var p=[];for(var c=0;c=S)throw new Error("Cannot access property/index "+c+" levels up, current level is "+S);return p[S-c]}if(c>S)throw new Error("Cannot access data "+c+" levels up, current level is "+S);if(e="data"+(S-c||""),!B)return e}var q8=e,z8=B.split("/");for(var w8=0;w8{var j=Q_();_.exports=K;function K(Y){j.copy(Y,this)}}),ZO=T8((q,_)=>{var j=_.exports=function(f,P,$){if(typeof P=="function")$=P,P={};$=P.cb||$;var w=typeof $=="function"?$:$.pre||function(){},O=$.post||function(){};K(P,w,O,f,"",f)};j.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},j.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},j.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},j.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function K(f,P,$,w,O,v,z,W,J,T){if(w&&typeof w=="object"&&!Array.isArray(w)){P(w,O,v,z,W,J,T);for(var H in w){var X=w[H];if(Array.isArray(X)){if(H in j.arrayKeywords)for(var A=0;A{var j=JO(),K=X4(),Y=Q_(),f=d5(),P=ZO();_.exports=$,$.normalizeId=D,$.fullPath=X,$.url=M,$.ids=I,$.inlineRef=J,$.schema=w;function $(N,R,L){var b=this._refs[L];if(typeof b=="string")if(this._refs[b])b=this._refs[b];else return $.call(this,N,R,b);if(b=b||this._schemas[L],b instanceof f)return J(b.schema,this._opts.inlineRefs)?b.schema:b.validate||this._compile(b);var d=w.call(this,R,L),y,V,S;if(d)y=d.schema,R=d.root,S=d.baseId;if(y instanceof f)V=y.validate||N.call(this,y.schema,R,void 0,S);else if(y!==void 0)V=J(y,this._opts.inlineRefs)?y:N.call(this,y,R,void 0,S);return V}function w(N,R){var L=j.parse(R),b=A(L),d=X(this._getId(N.schema));if(Object.keys(N.schema).length===0||b!==d){var y=D(b),V=this._refs[y];if(typeof V=="string")return O.call(this,N,V,L);else if(V instanceof f){if(!V.validate)this._compile(V);N=V}else if(V=this._schemas[y],V instanceof f){if(!V.validate)this._compile(V);if(y==D(R))return{schema:V,root:N,baseId:d};N=V}else return;if(!N.schema)return;d=X(this._getId(N.schema))}return z.call(this,L,d,N.schema,N)}function O(N,R,L){var b=w.call(this,N,R);if(b){var{schema:d,baseId:y}=b;N=b.root;var V=this._getId(d);if(V)y=M(y,V);return z.call(this,L,y,d,N)}}var v=Y.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function z(N,R,L,b){if(N.fragment=N.fragment||"",N.fragment.slice(0,1)!="/")return;var d=N.fragment.split("/");for(var y=1;y{var j=A4();_.exports={Validation:f(K),MissingRef:f(Y)};function K(P){this.message="validation failed",this.errors=P,this.ajv=this.validation=!0}Y.message=function(P,$){return"can't resolve reference "+$+" from id "+P};function Y(P,$,w){this.message=w||Y.message(P,$),this.missingRef=j.url(P,$),this.missingSchema=j.normalizeId(j.fullPath(this.missingRef))}function f(P){return P.prototype=Object.create(Error.prototype),P.prototype.constructor=P,P}}),p5=T8((q,_)=>{_.exports=function(j,K){if(!K)K={};if(typeof K==="function")K={cmp:K};var Y=typeof K.cycles==="boolean"?K.cycles:!1,f=K.cmp&&function($){return function(w){return function(O,v){var z={key:O,value:w[O]},W={key:v,value:w[v]};return $(z,W)}}}(K.cmp),P=[];return function $(w){if(w&&w.toJSON&&typeof w.toJSON==="function")w=w.toJSON();if(w===void 0)return;if(typeof w=="number")return isFinite(w)?""+w:"null";if(typeof w!=="object")return JSON.stringify(w);var O,v;if(Array.isArray(w)){v="[";for(O=0;O{_.exports=function j(K,Y,f){var P="",$=K.schema.$async===!0,w=K.util.schemaHasRulesExcept(K.schema,K.RULES.all,"$ref"),O=K.self._getId(K.schema);if(K.opts.strictKeywords){var v=K.util.schemaUnknownRules(K.schema,K.RULES.keywords);if(v){var z="unknown keyword: "+v;if(K.opts.strictKeywords==="log")K.logger.warn(z);else throw new Error(z)}}if(K.isTop){if(P+=" var validate = ",$)K.async=!0,P+="async ";if(P+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",O&&(K.opts.sourceCode||K.opts.processCode))P+=" "+("/*# sourceURL="+O+" */")+" "}if(typeof K.schema=="boolean"||!(w||K.schema.$ref)){var Y="false schema",W=K.level,J=K.dataLevel,T=K.schema[Y],H=K.schemaPath+K.util.getProperty(Y),X=K.errSchemaPath+"/"+Y,R=!K.opts.allErrors,d,A="data"+(J||""),N="valid"+W;if(K.schema===!1){if(K.isTop)R=!0;else P+=" var "+N+" = false; ";var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(d||"false schema")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(X)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'boolean schema is false' ";if(K.opts.verbose)P+=" , schema: false , parentSchema: validate.schema"+K.schemaPath+" , data: "+A+" ";P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&R)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else if(K.isTop)if($)P+=" return data; ";else P+=" validate.errors = null; return true; ";else P+=" var "+N+" = true; ";if(K.isTop)P+=" }; return validate; ";return P}if(K.isTop){var M=K.isTop,W=K.level=0,J=K.dataLevel=0,A="data";if(K.rootId=K.resolve.fullPath(K.self._getId(K.root.schema)),K.baseId=K.baseId||K.rootId,delete K.isTop,K.dataPathArr=[""],K.schema.default!==void 0&&K.opts.useDefaults&&K.opts.strictDefaults){var I="default is ignored in the schema root";if(K.opts.strictDefaults==="log")K.logger.warn(I);else throw new Error(I)}P+=" var vErrors = null; ",P+=" var errors = 0; ",P+=" if (rootData === undefined) rootData = data; "}else{var{level:W,dataLevel:J}=K,A="data"+(J||"");if(O)K.baseId=K.resolve.url(K.baseId,O);if($&&!K.async)throw new Error("async schema in sync schema");P+=" var errs_"+W+" = errors;"}var N="valid"+W,R=!K.opts.allErrors,L="",b="",d,y=K.schema.type,V=Array.isArray(y);if(y&&K.opts.nullable&&K.schema.nullable===!0){if(V){if(y.indexOf("null")==-1)y=y.concat("null")}else if(y!="null")y=[y,"null"],V=!0}if(V&&y.length==1)y=y[0],V=!1;if(K.schema.$ref&&w){if(K.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+K.errSchemaPath+'" (see option extendRefs)');else if(K.opts.extendRefs!==!0)w=!1,K.logger.warn('$ref: keywords ignored in schema at path "'+K.errSchemaPath+'"')}if(K.schema.$comment&&K.opts.$comment)P+=" "+K.RULES.all.$comment.code(K,"$comment");if(y){if(K.opts.coerceTypes)var S=K.util.coerceToTypes(K.opts.coerceTypes,y);var p=K.RULES.types[y];if(S||V||p===!0||p&&!a8(p)){var H=K.schemaPath+".type",X=K.errSchemaPath+"/type",H=K.schemaPath+".type",X=K.errSchemaPath+"/type",c=V?"checkDataTypes":"checkDataType";if(P+=" if ("+K.util[c](y,A,K.opts.strictNumbers,!0)+") { ",S){var B="dataType"+W,e="coerced"+W;if(P+=" var "+B+" = typeof "+A+"; var "+e+" = undefined; ",K.opts.coerceTypes=="array")P+=" if ("+B+" == 'object' && Array.isArray("+A+") && "+A+".length == 1) { "+A+" = "+A+"[0]; "+B+" = typeof "+A+"; if ("+K.util.checkDataType(K.schema.type,A,K.opts.strictNumbers)+") "+e+" = "+A+"; } ";P+=" if ("+e+" !== undefined) ; ";var Y8=S;if(Y8){var q8,z8=-1,w8=Y8.length-1;while(z8{var j=A4(),K=Q_(),Y=G4(),f=p5(),P=L5(),$=K.ucs2length,w=X4(),O=Y.Validation;_.exports=v;function v(D,M,I,N){var R=this,L=this._opts,b=[void 0],d={},y=[],V={},S=[],p={},c=[];M=M||{schema:D,refVal:b,refs:d};var B=z.call(this,D,M,N),e=this._compilations[B.index];if(B.compiling)return e.callValidate=K8;var Y8=this._formats,q8=this.RULES;try{var z8=G8(D,M,I,N);e.validate=z8;var w8=e.callValidate;if(w8){if(w8.schema=z8.schema,w8.errors=null,w8.refs=z8.refs,w8.refVal=z8.refVal,w8.root=z8.root,w8.$async=z8.$async,L.sourceCode)w8.source=z8.source}return z8}finally{W.call(this,D,M,N)}function K8(){var r=e.validate,a=r.apply(this,arguments);return K8.errors=r.errors,a}function G8(r,a,P8,H8){var O8=!a||a&&a.schema==r;if(a.schema!=M.schema)return v.call(R,r,a,P8,H8);var A8=r.$async===!0,g8=P({isTop:!0,schema:r,isRoot:O8,baseId:H8,root:a,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:Y.MissingRef,RULES:q8,validate:P,util:K,resolve:j,resolveRef:o8,usePattern:E,useDefault:x,useCustomRule:i,opts:L,formats:Y8,logger:R.logger,self:R});if(g8=G(b,X)+G(y,T)+G(S,H)+G(c,A)+g8,L.processCode)g8=L.processCode(g8,r);var M8;try{var v6=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",g8);M8=v6(R,q8,Y8,M,b,S,c,w,$,O),b[0]=M8}catch(a8){throw R.logger.error("Error compiling schema, function code:",g8),a8}if(M8.schema=r,M8.errors=null,M8.refs=d,M8.refVal=b,M8.root=O8?M8:a,A8)M8.$async=!0;if(L.sourceCode===!0)M8.source={code:g8,patterns:y,defaults:S};return M8}function o8(r,a,P8){a=j.url(r,a);var H8=d[a],O8,A8;if(H8!==void 0)return O8=b[H8],A8="refVal["+H8+"]",Z(O8,A8);if(!P8&&M.refs){var g8=M.refs[a];if(g8!==void 0)return O8=M.refVal[g8],A8=F8(a,O8),Z(O8,A8)}A8=F8(a);var M8=j.call(R,G8,M,a);if(M8===void 0){var v6=I&&I[a];if(v6)M8=j.inlineRef(v6,L.inlineRefs)?v6:v.call(R,v6,M,I,r)}if(M8===void 0)h(a);else return C(a,M8),Z(M8,A8)}function F8(r,a){var P8=b.length;return b[P8]=a,d[r]=P8,"refVal"+P8}function h(r){delete d[r]}function C(r,a){var P8=d[r];b[P8]=a}function Z(r,a){return typeof r=="object"||typeof r=="boolean"?{code:a,schema:r,inline:!0}:{code:a,$async:r&&!!r.$async}}function E(r){var a=V[r];if(a===void 0)a=V[r]=y.length,y[a]=r;return"pattern"+a}function x(r){switch(typeof r){case"boolean":case"number":return""+r;case"string":return K.toQuotedString(r);case"object":if(r===null)return"null";var a=f(r),P8=p[a];if(P8===void 0)P8=p[a]=S.length,S[P8]=r;return"default"+P8}}function i(r,a,P8,H8){if(R._opts.validateSchema!==!1){var O8=r.definition.dependencies;if(O8&&!O8.every(function(i6){return Object.prototype.hasOwnProperty.call(P8,i6)}))throw new Error("parent schema must have all required keywords: "+O8.join(","));var A8=r.definition.validateSchema;if(A8){var g8=A8(a);if(!g8){var M8="keyword schema is invalid: "+R.errorsText(A8.errors);if(R._opts.validateSchema=="log")R.logger.error(M8);else throw new Error(M8)}}}var v6=r.definition.compile,a8=r.definition.inline,u6=r.definition.macro,y8;if(v6)y8=v6.call(R,a,P8,H8);else if(u6){if(y8=u6.call(R,a,P8,H8),L.validateSchema!==!1)R.validateSchema(y8,!0)}else if(a8)y8=a8.call(R,H8,r.keyword,a,P8);else if(y8=r.definition.validate,!y8)return;if(y8===void 0)throw new Error('custom keyword "'+r.keyword+'"failed to compile');var Y6=c.length;return c[Y6]=y8,{code:"customRule"+Y6,validate:y8}}}function z(D,M,I){var N=J.call(this,D,M,I);if(N>=0)return{index:N,compiling:!0};return N=this._compilations.length,this._compilations[N]={schema:D,root:M,baseId:I},{index:N,compiling:!1}}function W(D,M,I){var N=J.call(this,D,M,I);if(N>=0)this._compilations.splice(N,1)}function J(D,M,I){for(var N=0;N{var j=_.exports=function K(){this._cache={}};j.prototype.put=function K(Y,f){this._cache[Y]=f},j.prototype.get=function K(Y){return this._cache[Y]},j.prototype.del=function K(Y){delete this._cache[Y]},j.prototype.clear=function K(){this._cache={}}}),AO=T8((q,_)=>{var j=Q_(),K=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Y=[0,31,28,31,30,31,30,31,31,30,31,30,31],f=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,P=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,$=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,w=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,O=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,v=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,z=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,W=/^(?:\/(?:[^~/]|~0|~1)*)*$/,J=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,T=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;_.exports=H;function H(b){return b=b=="full"?"full":"fast",j.copy(H[b])}H.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":O,url:v,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:P,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:L,uuid:z,"json-pointer":W,"json-pointer-uri-fragment":J,"relative-json-pointer":T},H.full={date:A,time:G,"date-time":M,uri:N,"uri-reference":w,"uri-template":O,url:v,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:P,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:L,uuid:z,"json-pointer":W,"json-pointer-uri-fragment":J,"relative-json-pointer":T};function X(b){return b%4===0&&(b%100!==0||b%400===0)}function A(b){var d=b.match(K);if(!d)return!1;var y=+d[1],V=+d[2],S=+d[3];return V>=1&&V<=12&&S>=1&&S<=(V==2&&X(y)?29:Y[V])}function G(b,d){var y=b.match(f);if(!y)return!1;var V=y[1],S=y[2],p=y[3],c=y[5];return(V<=23&&S<=59&&p<=59||V==23&&S==59&&p==60)&&(!d||c)}var D=/t|\s/i;function M(b){var d=b.split(D);return d.length==2&&A(d[0])&&G(d[1],!0)}var I=/\/|:/;function N(b){return I.test(b)&&$.test(b)}var R=/[^\\]\\Z/;function L(b){if(R.test(b))return!1;try{return new RegExp(b),!0}catch(d){return!1}}}),GO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.errSchemaPath+"/"+Y,z=!K.opts.allErrors,W="data"+(w||""),J="valid"+$,T,H;if(O=="#"||O=="#/")if(K.isRoot)T=K.async,H="validate";else T=K.root.schema.$async===!0,H="root.refVal[0]";else{var X=K.resolveRef(K.baseId,O,K.isRoot);if(X===void 0){var A=K.MissingRefError.message(K.baseId,O);if(K.opts.missingRefs=="fail"){K.logger.error(A);var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(v)+" , params: { ref: '"+K.util.escapeQuotes(O)+"' } ",K.opts.messages!==!1)P+=" , message: 'can\\'t resolve reference "+K.util.escapeQuotes(O)+"' ";if(K.opts.verbose)P+=" , schema: "+K.util.toQuotedString(O)+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+W+" ";P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&z)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(z)P+=" if (false) { "}else if(K.opts.missingRefs=="ignore"){if(K.logger.warn(A),z)P+=" if (true) { "}else throw new K.MissingRefError(K.baseId,O,A)}else if(X.inline){var M=K.util.copy(K);M.level++;var I="valid"+M.level;M.schema=X.schema,M.schemaPath="",M.errSchemaPath=O;var N=K.validate(M).replace(/validate\.schema/g,X.code);if(P+=" "+N+" ",z)P+=" if ("+I+") { "}else T=X.$async===!0||K.async&&X.$async!==!1,H=X.code}if(H){var G=G||[];if(G.push(P),P="",K.opts.passContext)P+=" "+H+".call(this, ";else P+=" "+H+"( ";if(P+=" "+W+", (dataPath || '')",K.errorPath!='""')P+=" + "+K.errorPath;var R=w?"data"+(w-1||""):"parentData",L=w?K.dataPathArr[w]:"parentDataProperty";P+=" , "+R+" , "+L+", rootData) ";var b=P;if(P=G.pop(),T){if(!K.async)throw new Error("async schema referenced by sync schema");if(z)P+=" var "+J+"; ";if(P+=" try { await "+b+"; ",z)P+=" "+J+" = true; ";if(P+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",z)P+=" "+J+" = false; ";if(P+=" } ",z)P+=" if ("+J+") { "}else if(P+=" if (!"+b+") { if (vErrors === null) vErrors = "+H+".errors; else vErrors = vErrors.concat("+H+".errors); errors = vErrors.length; } ",z)P+=" else { "}return P}}),uO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.schema[Y],w=K.schemaPath+K.util.getProperty(Y),O=K.errSchemaPath+"/"+Y,v=!K.opts.allErrors,z=K.util.copy(K),W="";z.level++;var J="valid"+z.level,T=z.baseId,H=!0,X=$;if(X){var A,G=-1,D=X.length-1;while(G0||A===!1:K.util.schemaHasRules(A,K.RULES.all)){if(H=!1,z.schema=A,z.schemaPath=w+"["+G+"]",z.errSchemaPath=O+"/"+G,P+=" "+K.validate(z)+" ",z.baseId=T,v)P+=" if ("+J+") { ",W+="}"}}if(v)if(H)P+=" if (true) { ";else P+=" "+W.slice(0,-1)+" ";return P}}),hO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D=O.every(function(d){return K.opts.strictKeywords?typeof d=="object"&&Object.keys(d).length>0||d===!1:K.util.schemaHasRules(d,K.RULES.all)});if(D){var M=X.baseId;P+=" var "+H+" = errors; var "+T+" = false; ";var I=K.compositeRule;K.compositeRule=X.compositeRule=!0;var N=O;if(N){var R,L=-1,b=N.length-1;while(L{_.exports=function j(K,Y,f){var P=" ",$=K.schema[Y],w=K.errSchemaPath+"/"+Y,O=!K.opts.allErrors,v=K.util.toQuotedString($);if(K.opts.$comment===!0)P+=" console.log("+v+");";else if(typeof K.opts.$comment=="function")P+=" self._opts.$comment("+v+", "+K.util.toQuotedString(w)+", validate.root.schema);";return P}}),CO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H=K.opts.$data&&O&&O.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",X="schema"+$;else X=O;if(!H)P+=" var schema"+$+" = validate.schema"+v+";";P+="var "+T+" = equal("+J+", schema"+$+"); if (!"+T+") { ";var A=A||[];if(A.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'const' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { allowedValue: schema"+$+" } ",K.opts.messages!==!1)P+=" , message: 'should be equal to constant' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var G=P;if(P=A.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+G+"]); ";else P+=" validate.errors = ["+G+"]; return false; ";else P+=" var err = "+G+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" }",W)P+=" else { ";return P}}),VO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D="i"+$,M=X.dataLevel=K.dataLevel+1,I="data"+M,N=K.baseId,R=K.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:K.util.schemaHasRules(O,K.RULES.all);if(P+="var "+H+" = errors;var "+T+";",R){var L=K.compositeRule;K.compositeRule=X.compositeRule=!0,X.schema=O,X.schemaPath=v,X.errSchemaPath=z,P+=" var "+G+" = false; for (var "+D+" = 0; "+D+" < "+J+".length; "+D+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,D,K.opts.jsonPointers,!0);var b=J+"["+D+"]";X.dataPathArr[M]=D;var d=K.validate(X);if(X.baseId=N,K.util.varOccurences(d,I)<2)P+=" "+K.util.varReplace(d,I,b)+" ";else P+=" var "+I+" = "+b+"; "+d+" ";P+=" if ("+G+") break; } ",K.compositeRule=X.compositeRule=L,P+=" "+A+" if (!"+G+") {"}else P+=" if ("+J+".length == 0) {";var y=y||[];if(y.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should contain a valid item' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var V=P;if(P=y.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+V+"]); ";else P+=" validate.errors = ["+V+"]; return false; ";else P+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else { ",R)P+=" errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; } ";if(K.opts.allErrors)P+=" } ";return P}}),MO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="errs__"+$,H=K.util.copy(K),X="";H.level++;var A="valid"+H.level,G={},D={},M=K.opts.ownProperties;for(L in O){if(L=="__proto__")continue;var I=O[L],N=Array.isArray(I)?D:G;N[L]=I}P+="var "+T+" = errors;";var R=K.errorPath;P+="var missing"+$+";";for(var L in D)if(N=D[L],N.length){if(P+=" if ( "+J+K.util.getProperty(L)+" !== undefined ",M)P+=" && Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(L)+"') ";if(W){P+=" && ( ";var b=N;if(b){var d,y=-1,V=b.length-1;while(y0||I===!1:K.util.schemaHasRules(I,K.RULES.all)){if(P+=" "+A+" = true; if ( "+J+K.util.getProperty(L)+" !== undefined ",M)P+=" && Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(L)+"') ";if(P+=") { ",H.schema=I,H.schemaPath=v+K.util.getProperty(L),H.errSchemaPath=z+"/"+K.util.escapeFragment(L),P+=" "+K.validate(H)+" ",H.baseId=K8,P+=" } ",W)P+=" if ("+A+") { ",X+="}"}}if(W)P+=" "+X+" if ("+T+" == errors) {";return P}}),NO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H=K.opts.$data&&O&&O.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",X="schema"+$;else X=O;var A="i"+$,G="schema"+$;if(!H)P+=" var "+G+" = validate.schema"+v+";";if(P+="var "+T+";",H)P+=" if (schema"+$+" === undefined) "+T+" = true; else if (!Array.isArray(schema"+$+")) "+T+" = false; else {";if(P+=""+T+" = false;for (var "+A+"=0; "+A+"<"+G+".length; "+A+"++) if (equal("+J+", "+G+"["+A+"])) { "+T+" = true; break; }",H)P+=" } ";P+=" if (!"+T+") { ";var D=D||[];if(D.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { allowedValues: schema"+$+" } ",K.opts.messages!==!1)P+=" , message: 'should be equal to one of the allowed values' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var M=P;if(P=D.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+M+"]); ";else P+=" validate.errors = ["+M+"]; return false; ";else P+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" }",W)P+=" else { ";return P}}),bO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||"");if(K.opts.format===!1){if(W)P+=" if (true) { ";return P}var T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;var X=K.opts.unknownFormats,A=Array.isArray(X);if(T){var G="format"+$,D="isObject"+$,M="formatType"+$;if(P+=" var "+G+" = formats["+H+"]; var "+D+" = typeof "+G+" == 'object' && !("+G+" instanceof RegExp) && "+G+".validate; var "+M+" = "+D+" && "+G+".type || 'string'; if ("+D+") { ",K.async)P+=" var async"+$+" = "+G+".async; ";if(P+=" "+G+" = "+G+".validate; } if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'string') || ";if(P+=" (",X!="ignore"){if(P+=" ("+H+" && !"+G+" ",A)P+=" && self._opts.unknownFormats.indexOf("+H+") == -1 ";P+=") || "}if(P+=" ("+G+" && "+M+" == '"+f+"' && !(typeof "+G+" == 'function' ? ",K.async)P+=" (async"+$+" ? await "+G+"("+J+") : "+G+"("+J+")) ";else P+=" "+G+"("+J+") ";P+=" : "+G+".test("+J+"))))) {"}else{var G=K.formats[O];if(!G)if(X=="ignore"){if(K.logger.warn('unknown format "'+O+'" ignored in schema at path "'+K.errSchemaPath+'"'),W)P+=" if (true) { ";return P}else if(A&&X.indexOf(O)>=0){if(W)P+=" if (true) { ";return P}else throw new Error('unknown format "'+O+'" is used in schema at path "'+K.errSchemaPath+'"');var D=typeof G=="object"&&!(G instanceof RegExp)&&G.validate,M=D&&G.type||"string";if(D){var I=G.async===!0;G=G.validate}if(M!=f){if(W)P+=" if (true) { ";return P}if(I){if(!K.async)throw new Error("async format in sync schema");var N="formats"+K.util.getProperty(O)+".validate";P+=" if (!(await "+N+"("+J+"))) { "}else{P+=" if (! ";var N="formats"+K.util.getProperty(O);if(D)N+=".validate";if(typeof G=="function")P+=" "+N+"("+J+") ";else P+=" "+N+".test("+J+") ";P+=") { "}}var R=R||[];if(R.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'format' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { format: ",T)P+=""+H;else P+=""+K.util.toQuotedString(O);if(P+=" } ",K.opts.messages!==!1){if(P+=` , message: 'should match format "`,T)P+="' + "+H+" + '";else P+=""+K.util.escapeQuotes(O);P+=`"' `}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+K.util.toQuotedString(O);P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var L=P;if(P=R.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+L+"]); ";else P+=" validate.errors = ["+L+"]; return false; ";else P+=" var err = "+L+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { ";return P}}),SO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K);X.level++;var A="valid"+X.level,G=K.schema.then,D=K.schema.else,M=G!==void 0&&(K.opts.strictKeywords?typeof G=="object"&&Object.keys(G).length>0||G===!1:K.util.schemaHasRules(G,K.RULES.all)),I=D!==void 0&&(K.opts.strictKeywords?typeof D=="object"&&Object.keys(D).length>0||D===!1:K.util.schemaHasRules(D,K.RULES.all)),N=X.baseId;if(M||I){var R;X.createErrors=!1,X.schema=O,X.schemaPath=v,X.errSchemaPath=z,P+=" var "+H+" = errors; var "+T+" = true; ";var L=K.compositeRule;if(K.compositeRule=X.compositeRule=!0,P+=" "+K.validate(X)+" ",X.baseId=N,X.createErrors=!0,P+=" errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; } ",K.compositeRule=X.compositeRule=L,M){if(P+=" if ("+A+") { ",X.schema=K.schema.then,X.schemaPath=K.schemaPath+".then",X.errSchemaPath=K.errSchemaPath+"/then",P+=" "+K.validate(X)+" ",X.baseId=N,P+=" "+T+" = "+A+"; ",M&&I)R="ifClause"+$,P+=" var "+R+" = 'then'; ";else R="'then'";if(P+=" } ",I)P+=" else { "}else P+=" if (!"+A+") { ";if(I){if(X.schema=K.schema.else,X.schemaPath=K.schemaPath+".else",X.errSchemaPath=K.errSchemaPath+"/else",P+=" "+K.validate(X)+" ",X.baseId=N,P+=" "+T+" = "+A+"; ",M&&I)R="ifClause"+$,P+=" var "+R+" = 'else'; ";else R="'else'";P+=" } "}if(P+=" if (!"+T+") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'if' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { failingKeyword: "+R+" } ",K.opts.messages!==!1)P+=` , message: 'should match "' + `+R+` + '" schema' `;if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(P+=" } ",W)P+=" else { "}else if(W)P+=" if (true) { ";return P}}),EO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D="i"+$,M=X.dataLevel=K.dataLevel+1,I="data"+M,N=K.baseId;if(P+="var "+H+" = errors;var "+T+";",Array.isArray(O)){var R=K.schema.additionalItems;if(R===!1){P+=" "+T+" = "+J+".length <= "+O.length+"; ";var L=z;z=K.errSchemaPath+"/additionalItems",P+=" if (!"+T+") { ";var b=b||[];if(b.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+O.length+" } ",K.opts.messages!==!1)P+=" , message: 'should NOT have more than "+O.length+" items' ";if(K.opts.verbose)P+=" , schema: false , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var d=P;if(P=b.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+d+"]); ";else P+=" validate.errors = ["+d+"]; return false; ";else P+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",z=L,W)A+="}",P+=" else { "}var y=O;if(y){var V,S=-1,p=y.length-1;while(S0||V===!1:K.util.schemaHasRules(V,K.RULES.all)){P+=" "+G+" = true; if ("+J+".length > "+S+") { ";var c=J+"["+S+"]";X.schema=V,X.schemaPath=v+"["+S+"]",X.errSchemaPath=z+"/"+S,X.errorPath=K.util.getPathExpr(K.errorPath,S,K.opts.jsonPointers,!0),X.dataPathArr[M]=S;var B=K.validate(X);if(X.baseId=N,K.util.varOccurences(B,I)<2)P+=" "+K.util.varReplace(B,I,c)+" ";else P+=" var "+I+" = "+c+"; "+B+" ";if(P+=" } ",W)P+=" if ("+G+") { ",A+="}"}}if(typeof R=="object"&&(K.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:K.util.schemaHasRules(R,K.RULES.all))){X.schema=R,X.schemaPath=K.schemaPath+".additionalItems",X.errSchemaPath=K.errSchemaPath+"/additionalItems",P+=" "+G+" = true; if ("+J+".length > "+O.length+") { for (var "+D+" = "+O.length+"; "+D+" < "+J+".length; "+D+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,D,K.opts.jsonPointers,!0);var c=J+"["+D+"]";X.dataPathArr[M]=D;var B=K.validate(X);if(X.baseId=N,K.util.varOccurences(B,I)<2)P+=" "+K.util.varReplace(B,I,c)+" ";else P+=" var "+I+" = "+c+"; "+B+" ";if(W)P+=" if (!"+G+") break; ";if(P+=" } } ",W)P+=" if ("+G+") { ",A+="}"}}else if(K.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:K.util.schemaHasRules(O,K.RULES.all)){X.schema=O,X.schemaPath=v,X.errSchemaPath=z,P+=" for (var "+D+" = 0; "+D+" < "+J+".length; "+D+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,D,K.opts.jsonPointers,!0);var c=J+"["+D+"]";X.dataPathArr[M]=D;var B=K.validate(X);if(X.baseId=N,K.util.varOccurences(B,I)<2)P+=" "+K.util.varReplace(B,I,c)+" ";else P+=" var "+I+" = "+c+"; "+B+" ";if(W)P+=" if (!"+G+") break; ";P+=" }"}if(W)P+=" "+A+" if ("+H+" == errors) {";return P}}),M5=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,N,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;var X=Y=="maximum",A=X?"exclusiveMaximum":"exclusiveMinimum",G=K.schema[A],D=K.opts.$data&&G&&G.$data,M=X?"<":">",I=X?">":"<",N=void 0;if(!(T||typeof O=="number"||O===void 0))throw new Error(Y+" must be number");if(!(D||G===void 0||typeof G=="number"||typeof G=="boolean"))throw new Error(A+" must be number or boolean");if(D){var R=K.util.getData(G.$data,w,K.dataPathArr),L="exclusive"+$,b="exclType"+$,d="exclIsNumber"+$,y="op"+$,V="' + "+y+" + '";P+=" var schemaExcl"+$+" = "+R+"; ",R="schemaExcl"+$,P+=" var "+L+"; var "+b+" = typeof "+R+"; if ("+b+" != 'boolean' && "+b+" != 'undefined' && "+b+" != 'number') { ";var N=A,S=S||[];if(S.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(N||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: '"+A+" should be boolean' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var p=P;if(P=S.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+p+"]); ";else P+=" validate.errors = ["+p+"]; return false; ";else P+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";if(P+=" "+b+" == 'number' ? ( ("+L+" = "+H+" === undefined || "+R+" "+M+"= "+H+") ? "+J+" "+I+"= "+R+" : "+J+" "+I+" "+H+" ) : ( ("+L+" = "+R+" === true) ? "+J+" "+I+"= "+H+" : "+J+" "+I+" "+H+" ) || "+J+" !== "+J+") { var op"+$+" = "+L+" ? '"+M+"' : '"+M+"='; ",O===void 0)N=A,z=K.errSchemaPath+"/"+A,H=R,T=D}else{var d=typeof G=="number",V=M;if(d&&T){var y="'"+V+"'";if(P+=" if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" ( "+H+" === undefined || "+G+" "+M+"= "+H+" ? "+J+" "+I+"= "+G+" : "+J+" "+I+" "+H+" ) || "+J+" !== "+J+") { "}else{if(d&&O===void 0)L=!0,N=A,z=K.errSchemaPath+"/"+A,H=G,I+="=";else{if(d)H=Math[X?"min":"max"](G,O);if(G===(d?H:!0))L=!0,N=A,z=K.errSchemaPath+"/"+A,I+="=";else L=!1,V+="="}var y="'"+V+"'";if(P+=" if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" "+J+" "+I+" "+H+" || "+J+" !== "+J+") { "}}N=N||Y;var S=S||[];if(S.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(N||"_limit")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { comparison: "+y+", limit: "+H+", exclusive: "+L+" } ",K.opts.messages!==!1)if(P+=" , message: 'should be "+V+" ",T)P+="' + "+H;else P+=""+H+"'";if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var p=P;if(P=S.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+p+"]); ";else P+=" validate.errors = ["+p+"]; return false; ";else P+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { ";return P}}),N5=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,A,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;if(!(T||typeof O=="number"))throw new Error(Y+" must be number");var X=Y=="maxItems"?">":"<";if(P+="if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" "+J+".length "+X+" "+H+") { ";var A=Y,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitItems")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+H+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT have ",Y=="maxItems")P+="more";else P+="fewer";if(P+=" than ",T)P+="' + "+H+" + '";else P+=""+O;P+=" items' "}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),b5=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,A,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;if(!(T||typeof O=="number"))throw new Error(Y+" must be number");var X=Y=="maxLength"?">":"<";if(P+="if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";if(K.opts.unicode===!1)P+=" "+J+".length ";else P+=" ucs2length("+J+") ";P+=" "+X+" "+H+") { ";var A=Y,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitLength")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+H+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT be ",Y=="maxLength")P+="longer";else P+="shorter";if(P+=" than ",T)P+="' + "+H+" + '";else P+=""+O;P+=" characters' "}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),S5=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,A,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;if(!(T||typeof O=="number"))throw new Error(Y+" must be number");var X=Y=="maxProperties"?">":"<";if(P+="if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" Object.keys("+J+").length "+X+" "+H+") { ";var A=Y,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitProperties")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+H+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT have ",Y=="maxProperties")P+="more";else P+="fewer";if(P+=" than ",T)P+="' + "+H+" + '";else P+=""+O;P+=" properties' "}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),RO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;if(!(T||typeof O=="number"))throw new Error(Y+" must be number");if(P+="var division"+$+";if (",T)P+=" "+H+" !== undefined && ( typeof "+H+" != 'number' || ";if(P+=" (division"+$+" = "+J+" / "+H+", ",K.opts.multipleOfPrecision)P+=" Math.abs(Math.round(division"+$+") - division"+$+") > 1e-"+K.opts.multipleOfPrecision+" ";else P+=" division"+$+" !== parseInt(division"+$+") ";if(P+=" ) ",T)P+=" ) ";P+=" ) { ";var X=X||[];if(X.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { multipleOf: "+H+" } ",K.opts.messages!==!1)if(P+=" , message: 'should be multiple of ",T)P+="' + "+H;else P+=""+H+"'";if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var A=P;if(P=X.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+A+"]); ";else P+=" validate.errors = ["+A+"]; return false; ";else P+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),mO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="errs__"+$,H=K.util.copy(K);H.level++;var X="valid"+H.level;if(K.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:K.util.schemaHasRules(O,K.RULES.all)){H.schema=O,H.schemaPath=v,H.errSchemaPath=z,P+=" var "+T+" = errors; ";var A=K.compositeRule;K.compositeRule=H.compositeRule=!0,H.createErrors=!1;var G;if(H.opts.allErrors)G=H.opts.allErrors,H.opts.allErrors=!1;if(P+=" "+K.validate(H)+" ",H.createErrors=!0,G)H.opts.allErrors=G;K.compositeRule=H.compositeRule=A,P+=" if ("+X+") { ";var D=D||[];if(D.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'not' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should NOT be valid' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var M=P;if(P=D.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+M+"]); ";else P+=" validate.errors = ["+M+"]; return false; ";else P+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else { errors = "+T+"; if (vErrors !== null) { if ("+T+") vErrors.length = "+T+"; else vErrors = null; } ",K.opts.allErrors)P+=" } "}else{if(P+=" var err = ",K.createErrors!==!1){if(P+=" { keyword: 'not' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should NOT be valid' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",W)P+=" if (false) { "}return P}}),IO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D=X.baseId,M="prevValid"+$,I="passingSchemas"+$;P+="var "+H+" = errors , "+M+" = false , "+T+" = false , "+I+" = null; ";var N=K.compositeRule;K.compositeRule=X.compositeRule=!0;var R=O;if(R){var L,b=-1,d=R.length-1;while(b0||L===!1:K.util.schemaHasRules(L,K.RULES.all))X.schema=L,X.schemaPath=v+"["+b+"]",X.errSchemaPath=z+"/"+b,P+=" "+K.validate(X)+" ",X.baseId=D;else P+=" var "+G+" = true; ";if(b)P+=" if ("+G+" && "+M+") { "+T+" = false; "+I+" = ["+I+", "+b+"]; } else { ",A+="}";P+=" if ("+G+") { "+T+" = "+M+" = true; "+I+" = "+b+"; }"}}if(K.compositeRule=X.compositeRule=N,P+=""+A+"if (!"+T+") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { passingSchemas: "+I+" } ",K.opts.messages!==!1)P+=" , message: 'should match exactly one schema in oneOf' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(P+="} else { errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; }",K.opts.allErrors)P+=" } ";return P}}),gO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;var X=T?"(new RegExp("+H+"))":K.usePattern(O);if(P+="if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'string') || ";P+=" !"+X+".test("+J+") ) { ";var A=A||[];if(A.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { pattern: ",T)P+=""+H;else P+=""+K.util.toQuotedString(O);if(P+=" } ",K.opts.messages!==!1){if(P+=` , message: 'should match pattern "`,T)P+="' + "+H+" + '";else P+=""+K.util.escapeQuotes(O);P+=`"' `}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+K.util.toQuotedString(O);P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var G=P;if(P=A.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+G+"]); ";else P+=" validate.errors = ["+G+"]; return false; ";else P+=" var err = "+G+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),yO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="errs__"+$,H=K.util.copy(K),X="";H.level++;var A="valid"+H.level,G="key"+$,D="idx"+$,M=H.dataLevel=K.dataLevel+1,I="data"+M,N="dataProperties"+$,R=Object.keys(O||{}).filter(z8),L=K.schema.patternProperties||{},b=Object.keys(L).filter(z8),d=K.schema.additionalProperties,y=R.length||b.length,V=d===!1,S=typeof d=="object"&&Object.keys(d).length,p=K.opts.removeAdditional,c=V||S||p,B=K.opts.ownProperties,e=K.baseId,Y8=K.schema.required;if(Y8&&!(K.opts.$data&&Y8.$data)&&Y8.length8)P+=" || validate.schema"+v+".hasOwnProperty("+G+") ";else{var w8=R;if(w8){var K8,G8=-1,o8=w8.length-1;while(G80||a8===!1:K.util.schemaHasRules(a8,K.RULES.all)){var u6=K.util.getProperty(K8),H8=J+u6,y8=A8&&a8.default!==void 0;H.schema=a8,H.schemaPath=v+u6,H.errSchemaPath=z+"/"+K.util.escapeFragment(K8),H.errorPath=K.util.getPath(K.errorPath,K8,K.opts.jsonPointers),H.dataPathArr[M]=K.util.toQuotedString(K8);var O8=K.validate(H);if(H.baseId=e,K.util.varOccurences(O8,I)<2){O8=K.util.varReplace(O8,I,H8);var Y6=H8}else{var Y6=I;P+=" var "+I+" = "+H8+"; "}if(y8)P+=" "+O8+" ";else{if(q8&&q8[K8]){if(P+=" if ( "+Y6+" === undefined ",B)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(K8)+"') ";P+=") { "+A+" = false; ";var E=K.errorPath,i=z,i6=K.util.escapeQuotes(K8);if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPath(E,K8,K.opts.jsonPointers);z=K.errSchemaPath+"/required";var r=r||[];if(r.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+i6+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+i6+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var a=P;if(P=r.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+a+"]); ";else P+=" validate.errors = ["+a+"]; return false; ";else P+=" var err = "+a+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";z=i,K.errorPath=E,P+=" } else { "}else if(W){if(P+=" if ( "+Y6+" === undefined ",B)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(K8)+"') ";P+=") { "+A+" = true; } else { "}else{if(P+=" if ("+Y6+" !== undefined ",B)P+=" && Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(K8)+"') ";P+=" ) { "}P+=" "+O8+" } "}}if(W)P+=" if ("+A+") { ",X+="}"}}}if(b.length){var m6=b;if(m6){var h,E3=-1,t7=m6.length-1;while(E30||a8===!1:K.util.schemaHasRules(a8,K.RULES.all)){if(H.schema=a8,H.schemaPath=K.schemaPath+".patternProperties"+K.util.getProperty(h),H.errSchemaPath=K.errSchemaPath+"/patternProperties/"+K.util.escapeFragment(h),B)P+=" "+N+" = "+N+" || Object.keys("+J+"); for (var "+D+"=0; "+D+"<"+N+".length; "+D+"++) { var "+G+" = "+N+"["+D+"]; ";else P+=" for (var "+G+" in "+J+") { ";P+=" if ("+K.usePattern(h)+".test("+G+")) { ",H.errorPath=K.util.getPathExpr(K.errorPath,G,K.opts.jsonPointers);var H8=J+"["+G+"]";H.dataPathArr[M]=G;var O8=K.validate(H);if(H.baseId=e,K.util.varOccurences(O8,I)<2)P+=" "+K.util.varReplace(O8,I,H8)+" ";else P+=" var "+I+" = "+H8+"; "+O8+" ";if(W)P+=" if (!"+A+") break; ";if(P+=" } ",W)P+=" else "+A+" = true; ";if(P+=" } ",W)P+=" if ("+A+") { ",X+="}"}}}}if(W)P+=" "+X+" if ("+T+" == errors) {";return P}}),dO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="errs__"+$,H=K.util.copy(K),X="";H.level++;var A="valid"+H.level;if(P+="var "+T+" = errors;",K.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:K.util.schemaHasRules(O,K.RULES.all)){H.schema=O,H.schemaPath=v,H.errSchemaPath=z;var G="key"+$,D="idx"+$,M="i"+$,I="' + "+G+" + '",N=H.dataLevel=K.dataLevel+1,R="data"+N,L="dataProperties"+$,b=K.opts.ownProperties,d=K.baseId;if(b)P+=" var "+L+" = undefined; ";if(b)P+=" "+L+" = "+L+" || Object.keys("+J+"); for (var "+D+"=0; "+D+"<"+L+".length; "+D+"++) { var "+G+" = "+L+"["+D+"]; ";else P+=" for (var "+G+" in "+J+") { ";P+=" var startErrs"+$+" = errors; ";var y=G,V=K.compositeRule;K.compositeRule=H.compositeRule=!0;var S=K.validate(H);if(H.baseId=d,K.util.varOccurences(S,R)<2)P+=" "+K.util.varReplace(S,R,y)+" ";else P+=" var "+R+" = "+y+"; "+S+" ";if(K.compositeRule=H.compositeRule=V,P+=" if (!"+A+") { for (var "+M+"=startErrs"+$+"; "+M+"{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H=K.opts.$data&&O&&O.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",X="schema"+$;else X=O;var A="schema"+$;if(!H)if(O.length0||R===!1:K.util.schemaHasRules(R,K.RULES.all))))G[G.length]=M}}}else var G=O;if(H||G.length){var L=K.errorPath,b=H||G.length>=K.opts.loopRequired,d=K.opts.ownProperties;if(W)if(P+=" var missing"+$+"; ",b){if(!H)P+=" var "+A+" = validate.schema"+v+"; ";var y="i"+$,V="schema"+$+"["+y+"]",S="' + "+V+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPathExpr(L,V,K.opts.jsonPointers);if(P+=" var "+T+" = true; ",H)P+=" if (schema"+$+" === undefined) "+T+" = true; else if (!Array.isArray(schema"+$+")) "+T+" = false; else {";if(P+=" for (var "+y+" = 0; "+y+" < "+A+".length; "+y+"++) { "+T+" = "+J+"["+A+"["+y+"]] !== undefined ",d)P+=" && Object.prototype.hasOwnProperty.call("+J+", "+A+"["+y+"]) ";if(P+="; if (!"+T+") break; } ",H)P+=" } ";P+=" if (!"+T+") { ";var p=p||[];if(p.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+S+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+S+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var c=P;if(P=p.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+c+"]); ";else P+=" validate.errors = ["+c+"]; return false; ";else P+=" var err = "+c+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";P+=" } else { "}else{P+=" if ( ";var B=G;if(B){var e,y=-1,Y8=B.length-1;while(y{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H=K.opts.$data&&O&&O.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",X="schema"+$;else X=O;if((O||H)&&K.opts.uniqueItems!==!1){if(H)P+=" var "+T+"; if ("+X+" === false || "+X+" === undefined) "+T+" = true; else if (typeof "+X+" != 'boolean') "+T+" = false; else { ";P+=" var i = "+J+".length , "+T+" = true , j; if (i > 1) { ";var A=K.schema.items&&K.schema.items.type,G=Array.isArray(A);if(!A||A=="object"||A=="array"||G&&(A.indexOf("object")>=0||A.indexOf("array")>=0))P+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+J+"[i], "+J+"[j])) { "+T+" = false; break outer; } } } ";else{P+=" var itemIndices = {}, item; for (;i--;) { var item = "+J+"[i]; ";var D="checkDataType"+(G?"s":"");if(P+=" if ("+K.util[D](A,"item",K.opts.strictNumbers,!0)+") continue; ",G)P+=` if (typeof item == 'string') item = '"' + item; `;P+=" if (typeof itemIndices[item] == 'number') { "+T+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}if(P+=" } ",H)P+=" } ";P+=" if (!"+T+") { ";var M=M||[];if(M.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { i: i, j: j } ",K.opts.messages!==!1)P+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' ";if(K.opts.verbose){if(P+=" , schema: ",H)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var I=P;if(P=M.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+I+"]); ";else P+=" validate.errors = ["+I+"]; return false; ";else P+=" var err = "+I+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { "}else if(W)P+=" if (true) { ";return P}}),lO=T8((q,_)=>{_.exports={$ref:GO(),allOf:uO(),anyOf:hO(),$comment:DO(),const:CO(),contains:VO(),dependencies:MO(),enum:NO(),format:bO(),if:SO(),items:EO(),maximum:M5(),minimum:M5(),maxItems:N5(),minItems:N5(),maxLength:b5(),minLength:b5(),maxProperties:S5(),minProperties:S5(),multipleOf:RO(),not:mO(),oneOf:IO(),pattern:gO(),properties:yO(),propertyNames:dO(),required:pO(),uniqueItems:LO(),validate:L5()}}),xO=T8((q,_)=>{var j=lO(),K=Q_().toHash;_.exports=function Y(){var f=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],P=["type","$comment"],$=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],w=["number","integer","string","array","object","boolean","null"];return f.all=K(P),f.types=K(w),f.forEach(function(O){if(O.rules=O.rules.map(function(v){var z;if(typeof v=="object"){var W=Object.keys(v)[0];z=v[W],v=W,z.forEach(function(T){P.push(T),f.all[T]=!0})}P.push(v);var J=f.all[v]={keyword:v,code:j[v],implements:z};return J}),f.all.$comment={keyword:"$comment",code:j.$comment},O.type)f.types[O.type]=O}),f.keywords=K(P.concat($)),f.custom={},f}}),nO=T8((q,_)=>{var j=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];_.exports=function(K,Y){for(var f=0;f{var j=G4().MissingRef;_.exports=K;function K(Y,f,P){var $=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");if(typeof f=="function")P=f,f=void 0;var w=O(Y).then(function(){var z=$._addSchema(Y,void 0,f);return z.validate||v(z)});if(P)w.then(function(z){P(null,z)},P);return w;function O(z){var W=z.$schema;return W&&!$.getSchema(W)?K.call($,{$ref:W},!0):Promise.resolve()}function v(z){try{return $._compile(z)}catch(J){if(J instanceof j)return W(J);throw J}function W(J){var T=J.missingSchema;if(A(T))throw new Error("Schema "+T+" is loaded but "+J.missingRef+" cannot be resolved");var H=$._loadingSchemas[T];if(!H)H=$._loadingSchemas[T]=$._opts.loadSchema(T),H.then(X,X);return H.then(function(G){if(!A(T))return O(G).then(function(){if(!A(T))$.addSchema(G,T,void 0,f)})}).then(function(){return v(z)});function X(){delete $._loadingSchemas[T]}function A(G){return $._refs[G]||$._schemas[G]}}}}}),rO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J,T="data"+(w||""),H="valid"+$,X="errs__"+$,A=K.opts.$data&&O&&O.$data,G;if(A)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",G="schema"+$;else G=O;var D=this,M="definition"+$,I=D.definition,N="",R,L,b,d,y;if(A&&I.$data){y="keywordValidate"+$;var V=I.validateSchema;P+=" var "+M+" = RULES.custom['"+Y+"'].definition; var "+y+" = "+M+".validate;"}else{if(d=K.useCustomRule(D,O,K.schema,K),!d)return;G="validate.schema"+v,y=d.code,R=I.compile,L=I.inline,b=I.macro}var S=y+".errors",p="i"+$,c="ruleErr"+$,B=I.async;if(B&&!K.async)throw new Error("async keyword in sync schema");if(!(L||b))P+=""+S+" = null;";if(P+="var "+X+" = errors;var "+H+";",A&&I.$data){if(N+="}",P+=" if ("+G+" === undefined) { "+H+" = true; } else { ",V)N+="}",P+=" "+H+" = "+M+".validateSchema("+G+"); if ("+H+") { "}if(L)if(I.statements)P+=" "+d.validate+" ";else P+=" "+H+" = "+d.validate+"; ";else if(b){var e=K.util.copy(K),N="";e.level++;var Y8="valid"+e.level;e.schema=d.validate,e.schemaPath="";var q8=K.compositeRule;K.compositeRule=e.compositeRule=!0;var z8=K.validate(e).replace(/validate\.schema/g,y);K.compositeRule=e.compositeRule=q8,P+=" "+z8}else{var w8=w8||[];if(w8.push(P),P="",P+=" "+y+".call( ",K.opts.passContext)P+="this";else P+="self";if(R||I.schema===!1)P+=" , "+T+" ";else P+=" , "+G+" , "+T+" , validate.schema"+K.schemaPath+" ";if(P+=" , (dataPath || '')",K.errorPath!='""')P+=" + "+K.errorPath;var K8=w?"data"+(w-1||""):"parentData",G8=w?K.dataPathArr[w]:"parentDataProperty";P+=" , "+K8+" , "+G8+" , rootData ) ";var o8=P;if(P=w8.pop(),I.errors===!1){if(P+=" "+H+" = ",B)P+="await ";P+=""+o8+"; "}else if(B)S="customErrors"+$,P+=" var "+S+" = null; try { "+H+" = await "+o8+"; } catch (e) { "+H+" = false; if (e instanceof ValidationError) "+S+" = e.errors; else throw e; } ";else P+=" "+S+" = null; "+H+" = "+o8+"; "}if(I.modifying)P+=" if ("+K8+") "+T+" = "+K8+"["+G8+"];";if(P+=""+N,I.valid){if(W)P+=" if (true) { "}else{if(P+=" if ( ",I.valid===void 0)if(P+=" !",b)P+=""+Y8;else P+=""+H;else P+=" "+!I.valid+" ";P+=") { ",J=D.keyword;var w8=w8||[];w8.push(P),P="";var w8=w8||[];if(w8.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(J||"custom")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { keyword: '"+D.keyword+"' } ",K.opts.messages!==!1)P+=` , message: 'should pass "`+D.keyword+`" keyword validation' `;if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+T+" ";P+=" } "}else P+=" {} ";var F8=P;if(P=w8.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+F8+"]); ";else P+=" validate.errors = ["+F8+"]; return false; ";else P+=" var err = "+F8+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var h=P;if(P=w8.pop(),L)if(I.errors){if(I.errors!="full"){if(P+=" for (var "+p+"="+X+"; "+p+"{_.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),iO=T8((q,_)=>{var j=l5();_.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:j.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:j.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}}),oO=T8((q,_)=>{var j=/^[a-z_$][a-z0-9_$-]*$/i,K=rO(),Y=iO();_.exports={add:f,get:P,remove:$,validate:w};function f(O,v){var z=this.RULES;if(z.keywords[O])throw new Error("Keyword "+O+" is already defined");if(!j.test(O))throw new Error("Keyword "+O+" is not a valid identifier");if(v){this.validateKeyword(v,!0);var W=v.type;if(Array.isArray(W))for(var J=0;J{_.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),BO=T8((q,_)=>{var j=kO(),K=A4(),Y=XO(),f=d5(),P=p5(),$=AO(),w=xO(),O=nO(),v=Q_();_.exports=X,X.prototype.validate=A,X.prototype.compile=G,X.prototype.addSchema=D,X.prototype.addMetaSchema=M,X.prototype.validateSchema=I,X.prototype.getSchema=R,X.prototype.removeSchema=d,X.prototype.addFormat=q8,X.prototype.errorsText=Y8,X.prototype._addSchema=V,X.prototype._compile=S,X.prototype.compileAsync=cO();var z=oO();X.prototype.addKeyword=z.add,X.prototype.getKeyword=z.get,X.prototype.removeKeyword=z.remove,X.prototype.validateKeyword=z.validate;var W=G4();X.ValidationError=W.Validation,X.MissingRefError=W.MissingRef,X.$dataMetaSchema=O;var J="http://json-schema.org/draft-07/schema",T=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],H=["/properties"];function X(Z){if(!(this instanceof X))return new X(Z);if(Z=this._opts=v.copy(Z)||{},h(this),this._schemas={},this._refs={},this._fragments={},this._formats=$(Z.format),this._cache=Z.cache||new Y,this._loadingSchemas={},this._compilations=[],this.RULES=w(),this._getId=p(Z),Z.loopRequired=Z.loopRequired||1/0,Z.errorDataPath=="property")Z._errorDataPathProperty=!0;if(Z.serialize===void 0)Z.serialize=P;if(this._metaOpts=F8(this),Z.formats)K8(this);if(Z.keywords)G8(this);if(z8(this),typeof Z.meta=="object")this.addMetaSchema(Z.meta);if(Z.nullable)this.addKeyword("nullable",{metaSchema:{type:"boolean"}});w8(this)}function A(Z,E){var x;if(typeof Z=="string"){if(x=this.getSchema(Z),!x)throw new Error('no schema with key or ref "'+Z+'"')}else{var i=this._addSchema(Z);x=i.validate||this._compile(i)}var r=x(E);if(x.$async!==!0)this.errors=x.errors;return r}function G(Z,E){var x=this._addSchema(Z,void 0,E);return x.validate||this._compile(x)}function D(Z,E,x,i){if(Array.isArray(Z)){for(var r=0;r0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((q,_)=>{this.readResolve=q,this.readReject=_})}enqueue(q){if(this.readResolve){let _=this.readResolve;this.readResolve=void 0,this.readReject=void 0,_({done:!1,value:q})}else this.queue.push(q)}done(){if(this.isDone=!0,this.readResolve){let q=this.readResolve;this.readResolve=void 0,this.readReject=void 0,q({done:!0,value:void 0})}}error(q){if(this.hasError=q,this.readReject){let _=this.readReject;this.readResolve=void 0,this.readReject=void 0,_(q)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}};i5=class i5{transport;isStreamingMode;canUseTool;hooks;abortController;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new c5;intialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;pendingMcpResponses=new Map;constructor(q,_,j,K,Y,f=new Map){this.transport=q,this.isStreamingMode=_,this.canUseTool=j,this.hooks=K,this.abortController=Y;for(let[P,$]of f){let w=new r5((O)=>this.sendMcpServerMessageToCli(P,O));this.sdkMcpTransports.set(P,w),$.connect(w)}if(this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.isStreamingMode)this.intialization=this.initialize()}setError(q){this.inputStream.error(q)}cleanup(q){if(this.cleanupPerformed)return;this.cleanupPerformed=!0;try{if(this.transport.close(),this.pendingControlResponses.clear(),this.pendingMcpResponses.clear(),q)this.inputStream.error(q);else this.inputStream.done()}catch(_){}}next(...[q]){return this.sdkMessages.next(...[q])}return(q){return this.sdkMessages.return(q)}throw(q){return this.sdkMessages.throw(q)}[Symbol.asyncIterator](){return this.sdkMessages}[Symbol.asyncDispose](){return this.sdkMessages[Symbol.asyncDispose]()}async readMessages(){try{for await(let q of this.transport.readMessages()){if(q.type==="control_response"){let _=this.pendingControlResponses.get(q.response.request_id);if(_)_(q.response);continue}else if(q.type==="control_request"){this.handleControlRequest(q);continue}else if(q.type==="control_cancel_request"){this.handleControlCancelRequest(q);continue}this.inputStream.enqueue(q)}this.inputStream.done(),this.cleanup()}catch(q){this.inputStream.error(q),this.cleanup(q)}}async handleControlRequest(q){let _=new AbortController;this.cancelControllers.set(q.request_id,_);try{let j=await this.processControlRequest(q,_.signal),K={type:"control_response",response:{subtype:"success",request_id:q.request_id,response:j}};await Promise.resolve(this.transport.write(JSON.stringify(K)+` +`);try{if(!this.childStdin.write(q)&&process.env.DEBUG_SDK)console.warn("[ProcessTransport] Write buffer full, data queued")}catch(_){throw this.ready=!1,new Error(`Failed to write to process stdin: ${_.message}`)}}close(){if(this.childStdin)this.childStdin.end(),this.childStdin=void 0;if(this.processExitHandler)process.off("exit",this.processExitHandler),this.processExitHandler=void 0;if(this.abortHandler)this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0;for(let{handler:q}of this.exitListeners)this.child?.off("exit",q);if(this.exitListeners=[],this.child&&!this.child.killed)this.child.kill("SIGTERM"),setTimeout(()=>{if(this.child&&!this.child.killed)this.child.kill("SIGKILL")},5000);this.ready=!1}isReady(){return this.ready}async*readMessages(){if(!this.childStdout)throw new Error("ProcessTransport output stream not available");let q=QO({input:this.childStdout});try{for await(let _ of q)if(_.trim())yield JSON.parse(_);await this.waitForExit()}catch(_){throw _}finally{q.close()}}endInput(){if(this.childStdin)this.childStdin.end()}getInputStream(){return this.childStdin}onExit(q){if(!this.child)return()=>{};let _=(j,K)=>{let Y=this.getProcessExitError(j,K);q(Y)};return this.child.on("exit",_),this.exitListeners.push({callback:q,handler:_}),()=>{if(this.child)this.child.off("exit",_);let j=this.exitListeners.findIndex((K)=>K.handler===_);if(j!==-1)this.exitListeners.splice(j,1)}}async waitForExit(){if(!this.child){if(this.exitError)throw this.exitError;return}if(this.child.exitCode!==null||this.child.killed){if(this.exitError)throw this.exitError;return}return new Promise((q,_)=>{let j=(Y,f)=>{if(this.abortController.signal.aborted){_(new L_("Operation aborted"));return}let P=this.getProcessExitError(Y,f);if(P)_(P);else q()};this.child.once("exit",j);let K=(Y)=>{this.child.off("exit",j),_(Y)};this.child.once("error",K),this.child.once("exit",()=>{this.child.off("error",K)})})}}function R5(q){return![".js",".mjs",".tsx",".ts",".jsx"].some((j)=>q.endsWith(j))}class r5{sendMcpMessage;isClosed=!1;constructor(q){this.sendMcpMessage=q}onclose;onerror;onmessage;async start(){}async send(q){if(this.isClosed)throw new Error("Transport is closed");this.sendMcpMessage(q)}async close(){if(this.isClosed)return;this.isClosed=!0,this.onclose?.()}}function fz(q){o5=q}function L3(){return o5}function F(q,_){let j=L3(),K=l3({issueData:_,data:q.data,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,j,j===n_?void 0:n_].filter((Y)=>!!Y)});q.common.issues.push(K)}class k6{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(q,_){let j=[];for(let K of _){if(K.status==="aborted")return v8;if(K.status==="dirty")q.dirty();j.push(K.value)}return{status:q.value,value:j}}static async mergeObjectAsync(q,_){let j=[];for(let K of _){let Y=await K.key,f=await K.value;j.push({key:Y,value:f})}return k6.mergeObjectSync(q,j)}static mergeObjectSync(q,_){let j={};for(let K of _){let{key:Y,value:f}=K;if(Y.status==="aborted")return v8;if(f.status==="aborted")return v8;if(Y.status==="dirty")q.dirty();if(f.status==="dirty")q.dirty();if(Y.value!=="__proto__"&&(typeof f.value!=="undefined"||K.alwaysSet))j[Y.value]=f.value}return{status:q.value,value:j}}}class wq{constructor(q,_,j,K){this._cachedPath=[],this.parent=q,this.data=_,this._path=j,this._key=K}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function Z8(q){if(!q)return{};let{errorMap:_,invalid_type_error:j,required_error:K,description:Y}=q;if(_&&(j||K))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(_)return{errorMap:_,description:Y};return{errorMap:(P,$)=>{let{message:w}=q;if(P.code==="invalid_enum_value")return{message:w??$.defaultError};if(typeof $.data==="undefined")return{message:w??K??$.defaultError};if(P.code!=="invalid_type")return{message:$.defaultError};return{message:w??j??$.defaultError}},description:Y}}class k8{get description(){return this._def.description}_getType(q){return mq(q.data)}_getOrReturnCtx(q,_){return _||{common:q.parent.common,data:q.data,parsedType:mq(q.data),schemaErrorMap:this._def.errorMap,path:q.path,parent:q.parent}}_processInputParams(q){return{status:new k6,ctx:{common:q.parent.common,data:q.data,parsedType:mq(q.data),schemaErrorMap:this._def.errorMap,path:q.path,parent:q.parent}}}_parseSync(q){let _=this._parse(q);if(IK(_))throw new Error("Synchronous parse encountered promise.");return _}_parseAsync(q){let _=this._parse(q);return Promise.resolve(_)}parse(q,_){let j=this.safeParse(q,_);if(j.success)return j.data;throw j.error}safeParse(q,_){let j={common:{issues:[],async:_?.async??!1,contextualErrorMap:_?.errorMap},path:_?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:mq(q)},K=this._parseSync({data:q,path:j.path,parent:j});return m5(j,K)}"~validate"(q){let _={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:mq(q)};if(!this["~standard"].async)try{let j=this._parseSync({data:q,path:[],parent:_});return $_(j)?{value:j.value}:{issues:_.common.issues}}catch(j){if(j?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;_.common={issues:[],async:!0}}return this._parseAsync({data:q,path:[],parent:_}).then((j)=>$_(j)?{value:j.value}:{issues:_.common.issues})}async parseAsync(q,_){let j=await this.safeParseAsync(q,_);if(j.success)return j.data;throw j.error}async safeParseAsync(q,_){let j={common:{issues:[],contextualErrorMap:_?.errorMap,async:!0},path:_?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:mq(q)},K=this._parse({data:q,path:j.path,parent:j}),Y=await(IK(K)?K:Promise.resolve(K));return m5(j,Y)}refine(q,_){let j=(K)=>{if(typeof _==="string"||typeof _==="undefined")return{message:_};else if(typeof _==="function")return _(K);else return _};return this._refinement((K,Y)=>{let f=q(K),P=()=>Y.addIssue({code:t.custom,...j(K)});if(typeof Promise!=="undefined"&&f instanceof Promise)return f.then(($)=>{if(!$)return P(),!1;else return!0});if(!f)return P(),!1;else return!0})}refinement(q,_){return this._refinement((j,K)=>{if(!q(j))return K.addIssue(typeof _==="function"?_(j,K):_),!1;else return!0})}_refinement(q){return new B6({schema:this,typeName:W8.ZodEffects,effect:{type:"refinement",refinement:q}})}superRefine(q){return this._refinement(q)}constructor(q){this.spa=this.safeParseAsync,this._def=q,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(_)=>this["~validate"](_)}}optional(){return $q.create(this,this._def)}nullable(){return Iq.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fq.create(this)}promise(){return v_.create(this,this._def)}or(q){return o_.create([this,q],this._def)}and(q){return a_.create(this,q,this._def)}transform(q){return new B6({...Z8(this._def),schema:this,typeName:W8.ZodEffects,effect:{type:"transform",transform:q}})}default(q){let _=typeof q==="function"?q:()=>q;return new F_({...Z8(this._def),innerType:this,defaultValue:_,typeName:W8.ZodDefault})}brand(){return new n3({typeName:W8.ZodBranded,type:this,...Z8(this._def)})}catch(q){let _=typeof q==="function"?q:()=>q;return new U_({...Z8(this._def),innerType:this,catchValue:_,typeName:W8.ZodCatch})}describe(q){return new this.constructor({...this._def,description:q})}pipe(q){return lK.create(this,q)}readonly(){return s_.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function B5(q){let _="[0-5]\\d";if(q.precision)_=`${_}\\.\\d{${q.precision}}`;else if(q.precision==null)_=`${_}(\\.\\d+)?`;let j=q.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${_})${j}`}function Cz(q){return new RegExp(`^${B5(q)}$`)}function t5(q){let _=`${a5}T${B5(q)}`,j=[];if(j.push(q.local?"Z?":"Z"),q.offset)j.push("([+-]\\d{2}:?\\d{2})");return _=`${_}(${j.join("|")})`,new RegExp(`^${_}$`)}function Vz(q,_){if((_==="v4"||!_)&&kz.test(q))return!0;if((_==="v6"||!_)&&Az.test(q))return!0;return!1}function Mz(q,_){if(!Hz.test(q))return!1;try{let[j]=q.split(".");if(!j)return!1;let K=j.replace(/-/g,"+").replace(/_/g,"/").padEnd(j.length+(4-j.length%4)%4,"="),Y=JSON.parse(atob(K));if(typeof Y!=="object"||Y===null)return!1;if("typ"in Y&&Y?.typ!=="JWT")return!1;if(!Y.alg)return!1;if(_&&Y.alg!==_)return!1;return!0}catch{return!1}}function Nz(q,_){if((_==="v4"||!_)&&Xz.test(q))return!0;if((_==="v6"||!_)&&Gz.test(q))return!0;return!1}function bz(q,_){let j=(q.toString().split(".")[1]||"").length,K=(_.toString().split(".")[1]||"").length,Y=j>K?j:K,f=Number.parseInt(q.toFixed(Y).replace(".","")),P=Number.parseInt(_.toFixed(Y).replace(".",""));return f%P/10**Y}function p_(q){if(q instanceof i8){let _={};for(let j in q.shape){let K=q.shape[j];_[j]=$q.create(p_(K))}return new i8({...q._def,shape:()=>_})}else if(q instanceof fq)return new fq({...q._def,type:p_(q.element)});else if(q instanceof $q)return $q.create(p_(q.unwrap()));else if(q instanceof Iq)return Iq.create(p_(q.unwrap()));else if(q instanceof Aq)return Aq.create(q.items.map((_)=>p_(_)));else return q}function T4(q,_){let j=mq(q),K=mq(_);if(q===_)return{valid:!0,data:q};else if(j===s.object&&K===s.object){let Y=h8.objectKeys(_),f=h8.objectKeys(q).filter(($)=>Y.indexOf($)!==-1),P={...q,..._};for(let $ of f){let w=T4(q[$],_[$]);if(!w.valid)return{valid:!1};P[$]=w.data}return{valid:!0,data:P}}else if(j===s.array&&K===s.array){if(q.length!==_.length)return{valid:!1};let Y=[];for(let f=0;f{let f=q(K);if(f instanceof Promise)return f.then((P)=>{if(!P){let $=I5(_,K),w=$.fatal??j??!0;Y.addIssue({code:"custom",...$,fatal:w})}});if(!f){let P=I5(_,K),$=P.fatal??j??!0;Y.addIssue({code:"custom",...P,fatal:$})}return});return O_.create()}function AW(q){if(!q)return{};let{errorMap:_,invalid_type_error:j,required_error:K,description:Y}=q;if(_&&(j||K))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(_)return{errorMap:_,description:Y};return{errorMap:(P,$)=>{var w,O;let{message:v}=q;if(P.code==="invalid_enum_value")return{message:v!==null&&v!==void 0?v:$.defaultError};if(typeof $.data==="undefined")return{message:(w=v!==null&&v!==void 0?v:K)!==null&&w!==void 0?w:$.defaultError};if(P.code!=="invalid_type")return{message:$.defaultError};return{message:(O=v!==null&&v!==void 0?v:j)!==null&&O!==void 0?O:$.defaultError}},description:Y}}function gq({prompt:q,options:{abortController:_=x5(),additionalDirectories:j=[],allowedTools:K=[],appendSystemPrompt:Y,canUseTool:f,continue:P,customSystemPrompt:$,cwd:w,disallowedTools:O=[],env:v,executable:z=GW()?"bun":"node",executableArgs:W=[],extraArgs:J={},fallbackModel:T,hooks:H,maxTurns:X,mcpServers:A,model:G,pathToClaudeCodeExecutable:D,permissionMode:M="default",permissionPromptToolName:I,resume:N,stderr:R,strictMcpConfig:L}={}}){if(!v)v={...process.env};if(!v.CLAUDE_CODE_ENTRYPOINT)v.CLAUDE_CODE_ENTRYPOINT="sdk-ts";if(D===void 0){let p=eO(import.meta.url),c=E5(p,"..");D=E5(c,"cli.js")}let b={},d=new Map;if(A)for(let[p,c]of Object.entries(A))if(c.type==="sdk")d.set(p,c.instance),b[p]={type:"sdk",name:p};else b[p]=c;let y=typeof q!=="string",V=new n5({prompt:q,abortController:_,additionalDirectories:j,cwd:w,executable:z,executableArgs:W,extraArgs:J,pathToClaudeCodeExecutable:D,env:v,stderr:R,customSystemPrompt:$,appendSystemPrompt:Y,maxTurns:X,model:G,fallbackModel:T,permissionMode:M,permissionPromptToolName:I,continueConversation:P,resume:N,allowedTools:K,disallowedTools:O,mcpServers:A,strictMcpConfig:L,canUseTool:!!f,hooks:!!H}),S=new i5(V,y,f,H,_,d);if(typeof q!=="string")S.streamInput(q);return S}function GW(){return process.versions.bun!==void 0||process.env.BUN_INSTALL!==void 0}var OO,zO,v4,vO,WO,HO=(q,_,j)=>{j=q!=null?OO(zO(q)):{};let K=_||!q||!q.__esModule?v4(j,"default",{value:q,enumerable:!0}):j;for(let Y of vO(q))if(!WO.call(K,Y))v4(K,Y,{get:()=>q[Y],enumerable:!0});return K},T8=(q,_)=>()=>(_||q((_={exports:{}}).exports,_),_.exports),JO=(q,_)=>{for(var j in _)v4(q,j,{get:_[j],enumerable:!0,configurable:!0,set:(K)=>_[j]=()=>K})},TO,X4,ZO,Q_,d5,kO,A4,G4,p5,L5,XO,AO,GO,uO,hO,DO,CO,VO,MO,NO,bO,SO,EO,RO,M5,N5,b5,S5,mO,IO,gO,yO,dO,pO,LO,lO,xO,nO,cO,rO,iO,l5,oO,aO,BO,tO,UO=50,_z,Kz,L_,c5,i5,k,h8,W4,s,mq=(q)=>{switch(typeof q){case"undefined":return s.undefined;case"string":return s.string;case"number":return Number.isNaN(q)?s.nan:s.number;case"boolean":return s.boolean;case"function":return s.function;case"bigint":return s.bigint;case"symbol":return s.symbol;case"object":if(Array.isArray(q))return s.array;if(q===null)return s.null;if(q.then&&typeof q.then==="function"&&q.catch&&typeof q.catch==="function")return s.promise;if(typeof Map!=="undefined"&&q instanceof Map)return s.map;if(typeof Set!=="undefined"&&q instanceof Set)return s.set;if(typeof Date!=="undefined"&&q instanceof Date)return s.date;return s.object;default:return s.unknown}},t,Pz=(q)=>{return JSON.stringify(q,null,2).replace(/"([^"]+)":/g,"$1:")},y6,Yz=(q,_)=>{let j;switch(q.code){case t.invalid_type:if(q.received===s.undefined)j="Required";else j=`Expected ${q.expected}, received ${q.received}`;break;case t.invalid_literal:j=`Invalid literal value, expected ${JSON.stringify(q.expected,h8.jsonStringifyReplacer)}`;break;case t.unrecognized_keys:j=`Unrecognized key(s) in object: ${h8.joinValues(q.keys,", ")}`;break;case t.invalid_union:j="Invalid input";break;case t.invalid_union_discriminator:j=`Invalid discriminator value. Expected ${h8.joinValues(q.options)}`;break;case t.invalid_enum_value:j=`Invalid enum value. Expected ${h8.joinValues(q.options)}, received '${q.received}'`;break;case t.invalid_arguments:j="Invalid function arguments";break;case t.invalid_return_type:j="Invalid function return type";break;case t.invalid_date:j="Invalid date";break;case t.invalid_string:if(typeof q.validation==="object")if("includes"in q.validation){if(j=`Invalid input: must include "${q.validation.includes}"`,typeof q.validation.position==="number")j=`${j} at one or more positions greater than or equal to ${q.validation.position}`}else if("startsWith"in q.validation)j=`Invalid input: must start with "${q.validation.startsWith}"`;else if("endsWith"in q.validation)j=`Invalid input: must end with "${q.validation.endsWith}"`;else h8.assertNever(q.validation);else if(q.validation!=="regex")j=`Invalid ${q.validation}`;else j="Invalid";break;case t.too_small:if(q.type==="array")j=`Array must contain ${q.exact?"exactly":q.inclusive?"at least":"more than"} ${q.minimum} element(s)`;else if(q.type==="string")j=`String must contain ${q.exact?"exactly":q.inclusive?"at least":"over"} ${q.minimum} character(s)`;else if(q.type==="number")j=`Number must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${q.minimum}`;else if(q.type==="bigint")j=`Number must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${q.minimum}`;else if(q.type==="date")j=`Date must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(q.minimum))}`;else j="Invalid input";break;case t.too_big:if(q.type==="array")j=`Array must contain ${q.exact?"exactly":q.inclusive?"at most":"less than"} ${q.maximum} element(s)`;else if(q.type==="string")j=`String must contain ${q.exact?"exactly":q.inclusive?"at most":"under"} ${q.maximum} character(s)`;else if(q.type==="number")j=`Number must be ${q.exact?"exactly":q.inclusive?"less than or equal to":"less than"} ${q.maximum}`;else if(q.type==="bigint")j=`BigInt must be ${q.exact?"exactly":q.inclusive?"less than or equal to":"less than"} ${q.maximum}`;else if(q.type==="date")j=`Date must be ${q.exact?"exactly":q.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(q.maximum))}`;else j="Invalid input";break;case t.custom:j="Invalid input";break;case t.invalid_intersection_types:j="Intersection results could not be merged";break;case t.not_multiple_of:j=`Number must be a multiple of ${q.multipleOf}`;break;case t.not_finite:j="Number must be finite";break;default:j=_.defaultError,h8.assertNever(q)}return{message:j}},n_,o5,l3=(q)=>{let{data:_,path:j,errorMaps:K,issueData:Y}=q,f=[...j,...Y.path||[]],P={...Y,path:f};if(Y.message!==void 0)return{...Y,path:f,message:Y.message};let $="",w=K.filter((O)=>!!O).slice().reverse();for(let O of w)$=O(P,{data:_,defaultError:$}).message;return{...Y,path:f,message:$}},$z,v8,l_=(q)=>({status:"dirty",value:q}),D6=(q)=>({status:"valid",value:q}),H4=(q)=>q.status==="aborted",J4=(q)=>q.status==="dirty",$_=(q)=>q.status==="valid",IK=(q)=>typeof Promise!=="undefined"&&q instanceof Promise,f8,m5=(q,_)=>{if($_(_))return{success:!0,data:_.value};else{if(!q.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let j=new y6(q.common.issues);return this._error=j,this._error}}}},wz,Oz,zz,vz,Wz,Hz,Jz,Tz,Zz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",z4,kz,Xz,Az,Gz,uz,hz,a5="((\\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])))",Dz,Yq,Bq,tq,c_,w_,gK,r_,i_,O_,aq,Xq,yK,fq,i8,o_,Rq=(q)=>{if(q instanceof B_)return Rq(q.schema);else if(q instanceof B6)return Rq(q.innerType());else if(q instanceof t_)return[q.value];else if(q instanceof eq)return q.options;else if(q instanceof e_)return h8.objectValues(q.enum);else if(q instanceof F_)return Rq(q._def.innerType);else if(q instanceof r_)return[void 0];else if(q instanceof i_)return[null];else if(q instanceof $q)return[void 0,...Rq(q.unwrap())];else if(q instanceof Iq)return[null,...Rq(q.unwrap())];else if(q instanceof n3)return Rq(q.unwrap());else if(q instanceof s_)return Rq(q.unwrap());else if(q instanceof U_)return Rq(q._def.innerType);else return[]},x3,a_,Aq,dK,pK,z_,x_,B_,t_,eq,e_,v_,B6,$q,Iq,F_,U_,LK,Sz,n3,lK,s_,Ez,W8,Rz=(q,_={message:`Input not instance of ${q.name}`})=>F5((j)=>j instanceof q,_),U5,s5,mz,Iz,Q5,gz,yz,dz,pz,Lz,lz,xz,nz,cz,rz,iz,oz,az,Bz,tz,ez,Fz,Uz,sz,Qz,qv,_v,Kv,jv,g5,Pv,Yv,fv,$v,wv=()=>U5().optional(),Ov=()=>s5().optional(),zv=()=>Q5().optional(),vv,Wv,c3="2.0",q1,_1,Hv,t6,E6,xK,Gq,e6,r3,Jv,Tv,Zv,y5,kv,zC,K1,j1,nK,P1,Xv,Av,Gv,uv,hv,Y1,Dv,f1,i3,o3,$1,w1,u4,O1,z1,Cv,Vv,Mv,Nv,bv,Sv,Ev,Rv,mv,Iv,gv,yv,dv,pv,Lv,lv,h4,D4,C4,xv,nv,v1,cv,rv,iv,ov,av,Bv,tv,W1,vC,ev,Fv,H1,Uv,sv,Qv,qW,_W,KW,jW,PW,YW,fW,$W,wW,OW,zW,vW,WW,HW,JW,TW,ZW,kW,XW,WC,HC,JC,TC,ZC,kC,XC,AC,GC,Z4,k4;var a3=f6(()=>{OO=Object.create,zO=Object.getPrototypeOf,v4=Object.defineProperty,vO=Object.getOwnPropertyNames,WO=Object.prototype.hasOwnProperty,TO=T8((q,_)=>{(function(j,K){typeof q==="object"&&typeof _!=="undefined"?K(q):typeof define==="function"&&define.amd?define(["exports"],K):K(j.URI=j.URI||{})})(q,function(j){function K(){for(var m=arguments.length,u=Array(m),g=0;g1){u[0]=u[0].slice(0,-1);var l=u.length-1;for(var n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=H-X,V=Math.floor,S=String.fromCharCode;function p(m){throw new RangeError(d[m])}function c(m,u){var g=[],l=m.length;while(l--)g[l]=u(m[l]);return g}function B(m,u){var g=m.split("@"),l="";if(g.length>1)l=g[0]+"@",m=g[1];m=m.replace(b,".");var n=m.split("."),U=c(n,u).join(".");return l+U}function e(m){var u=[],g=0,l=m.length;while(g=55296&&n<=56319&&g>1,u+=V(u/g);for(;u>y*A>>1;n+=H)u=V(u/y);return V(n+(y+1)*u/(u+G))},K8=function m(u){var g=[],l=u.length,n=0,U=I,X8=M,C8=u.lastIndexOf(N);if(C8<0)C8=0;for(var S8=0;S8=128)p("not-basic");g.push(u.charCodeAt(S8))}for(var q6=C8>0?C8+1:0;q6=l)p("invalid-input");var d8=q8(u.charCodeAt(q6++));if(d8>=H||d8>V((T-n)/c8))p("overflow");n+=d8*c8;var N8=_6<=X8?X:_6>=X8+A?A:_6-X8;if(d8V(T/r8))p("overflow");c8*=r8}var E8=g.length+1;if(X8=w8(n-u8,E8,u8==0),V(n/E8)>T-U)p("overflow");U+=V(n/E8),n%=E8,g.splice(n++,0,U)}return String.fromCodePoint.apply(String,g)},G8=function m(u){var g=[];u=e(u);var l=u.length,n=I,U=0,X8=M,C8=!0,S8=!1,q6=void 0;try{for(var u8=u[Symbol.iterator](),c8;!(C8=(c8=u8.next()).done);C8=!0){var _6=c8.value;if(_6<128)g.push(S(_6))}}catch(f_){S8=!0,q6=f_}finally{try{if(!C8&&u8.return)u8.return()}finally{if(S8)throw q6}}var d8=g.length,N8=d8;if(d8)g.push(N);while(N8=n&&g6V((T-U)/a6))p("overflow");U+=(r8-n)*a6,n=r8;var kq=!0,Y_=!1,Nq=void 0;try{for(var VK=u[Symbol.iterator](),R3;!(kq=(R3=VK.next()).done);kq=!0){var m3=R3.value;if(m3T)p("overflow");if(m3==n){var S_=U;for(var E_=H;;E_+=H){var bq=E_<=X8?X:E_>=X8+A?A:E_-X8;if(S_>6|192).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase();else g="%"+(u>>12|224).toString(16).toUpperCase()+"%"+(u>>6&63|128).toString(16).toUpperCase()+"%"+(u&63|128).toString(16).toUpperCase();return g}function E(m){var u="",g=0,l=m.length;while(g=194&&n<224){if(l-g>=6){var U=parseInt(m.substr(g+4,2),16);u+=String.fromCharCode((n&31)<<6|U&63)}else u+=m.substr(g,6);g+=6}else if(n>=224){if(l-g>=9){var X8=parseInt(m.substr(g+4,2),16),C8=parseInt(m.substr(g+7,2),16);u+=String.fromCharCode((n&15)<<12|(X8&63)<<6|C8&63)}else u+=m.substr(g,9);g+=9}else u+=m.substr(g,3),g+=3}return u}function x(m,u){function g(l){var n=E(l);return!n.match(u.UNRESERVED)?l:n}if(m.scheme)m.scheme=String(m.scheme).replace(u.PCT_ENCODED,g).toLowerCase().replace(u.NOT_SCHEME,"");if(m.userinfo!==void 0)m.userinfo=String(m.userinfo).replace(u.PCT_ENCODED,g).replace(u.NOT_USERINFO,Z).replace(u.PCT_ENCODED,P);if(m.host!==void 0)m.host=String(m.host).replace(u.PCT_ENCODED,g).toLowerCase().replace(u.NOT_HOST,Z).replace(u.PCT_ENCODED,P);if(m.path!==void 0)m.path=String(m.path).replace(u.PCT_ENCODED,g).replace(m.scheme?u.NOT_PATH:u.NOT_PATH_NOSCHEME,Z).replace(u.PCT_ENCODED,P);if(m.query!==void 0)m.query=String(m.query).replace(u.PCT_ENCODED,g).replace(u.NOT_QUERY,Z).replace(u.PCT_ENCODED,P);if(m.fragment!==void 0)m.fragment=String(m.fragment).replace(u.PCT_ENCODED,g).replace(u.NOT_FRAGMENT,Z).replace(u.PCT_ENCODED,P);return m}function i(m){return m.replace(/^0*(.*)/,"$1")||"0"}function r(m,u){var g=m.match(u.IPV4ADDRESS)||[],l=W(g,2),n=l[1];if(n)return n.split(".").map(i).join(".");else return m}function a(m,u){var g=m.match(u.IPV6ADDRESS)||[],l=W(g,3),n=l[1],U=l[2];if(n){var X8=n.toLowerCase().split("::").reverse(),C8=W(X8,2),S8=C8[0],q6=C8[1],u8=q6?q6.split(":").map(i):[],c8=S8.split(":").map(i),_6=u.IPV4ADDRESS.test(c8[c8.length-1]),d8=_6?7:8,N8=c8.length-d8,r8=Array(d8);for(var E8=0;E81){var m8=r8.slice(0,I6.index),g6=r8.slice(I6.index+I6.length);o6=m8.join(":")+"::"+g6.join(":")}else o6=r8.join(":");if(U)o6+="%"+U;return o6}else return m}var P8=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,H8="".match(/(){0}/)[1]===void 0;function O8(m){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g={},l=u.iri!==!1?z:v;if(u.reference==="suffix")m=(u.scheme?u.scheme+":":"")+"//"+m;var n=m.match(P8);if(n){if(H8){if(g.scheme=n[1],g.userinfo=n[3],g.host=n[4],g.port=parseInt(n[5],10),g.path=n[6]||"",g.query=n[7],g.fragment=n[8],isNaN(g.port))g.port=n[5]}else if(g.scheme=n[1]||void 0,g.userinfo=m.indexOf("@")!==-1?n[3]:void 0,g.host=m.indexOf("//")!==-1?n[4]:void 0,g.port=parseInt(n[5],10),g.path=n[6]||"",g.query=m.indexOf("?")!==-1?n[7]:void 0,g.fragment=m.indexOf("#")!==-1?n[8]:void 0,isNaN(g.port))g.port=m.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0;if(g.host)g.host=a(r(g.host,l),l);if(g.scheme===void 0&&g.userinfo===void 0&&g.host===void 0&&g.port===void 0&&!g.path&&g.query===void 0)g.reference="same-document";else if(g.scheme===void 0)g.reference="relative";else if(g.fragment===void 0)g.reference="absolute";else g.reference="uri";if(u.reference&&u.reference!=="suffix"&&u.reference!==g.reference)g.error=g.error||"URI is not a "+u.reference+" reference.";var U=C[(u.scheme||g.scheme||"").toLowerCase()];if(!u.unicodeSupport&&(!U||!U.unicodeSupport)){if(g.host&&(u.domainHost||U&&U.domainHost))try{g.host=h.toASCII(g.host.replace(l.PCT_ENCODED,E).toLowerCase())}catch(X8){g.error=g.error||"Host's domain name can not be converted to ASCII via punycode: "+X8}x(g,v)}else x(g,l);if(U&&U.parse)U.parse(g,u)}else g.error=g.error||"URI can not be parsed.";return g}function A8(m,u){var g=u.iri!==!1?z:v,l=[];if(m.userinfo!==void 0)l.push(m.userinfo),l.push("@");if(m.host!==void 0)l.push(a(r(String(m.host),g),g).replace(g.IPV6ADDRESS,function(n,U,X8){return"["+U+(X8?"%25"+X8:"")+"]"}));if(typeof m.port==="number"||typeof m.port==="string")l.push(":"),l.push(String(m.port));return l.length?l.join(""):void 0}var g8=/^\.\.?\//,M8=/^\/\.(\/|$)/,v6=/^\/\.\.(\/|$)/,a8=/^\/?(?:.|\n)*?(?=\/|$)/;function u6(m){var u=[];while(m.length)if(m.match(g8))m=m.replace(g8,"");else if(m.match(M8))m=m.replace(M8,"/");else if(m.match(v6))m=m.replace(v6,"/"),u.pop();else if(m==="."||m==="..")m="";else{var g=m.match(a8);if(g){var l=g[0];m=m.slice(l.length),u.push(l)}else throw new Error("Unexpected dot segment condition")}return u.join("")}function y8(m){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=u.iri?z:v,l=[],n=C[(u.scheme||m.scheme||"").toLowerCase()];if(n&&n.serialize)n.serialize(m,u);if(m.host){if(g.IPV6ADDRESS.test(m.host));else if(u.domainHost||n&&n.domainHost)try{m.host=!u.iri?h.toASCII(m.host.replace(g.PCT_ENCODED,E).toLowerCase()):h.toUnicode(m.host)}catch(C8){m.error=m.error||"Host's domain name can not be converted to "+(!u.iri?"ASCII":"Unicode")+" via punycode: "+C8}}if(x(m,g),u.reference!=="suffix"&&m.scheme)l.push(m.scheme),l.push(":");var U=A8(m,u);if(U!==void 0){if(u.reference!=="suffix")l.push("//");if(l.push(U),m.path&&m.path.charAt(0)!=="/")l.push("/")}if(m.path!==void 0){var X8=m.path;if(!u.absolutePath&&(!n||!n.absolutePath))X8=u6(X8);if(U===void 0)X8=X8.replace(/^\/\//,"/%2F");l.push(X8)}if(m.query!==void 0)l.push("?"),l.push(m.query);if(m.fragment!==void 0)l.push("#"),l.push(m.fragment);return l.join("")}function Y6(m,u){var g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments[3],n={};if(!l)m=O8(y8(m,g),g),u=O8(y8(u,g),g);if(g=g||{},!g.tolerant&&u.scheme)n.scheme=u.scheme,n.userinfo=u.userinfo,n.host=u.host,n.port=u.port,n.path=u6(u.path||""),n.query=u.query;else{if(u.userinfo!==void 0||u.host!==void 0||u.port!==void 0)n.userinfo=u.userinfo,n.host=u.host,n.port=u.port,n.path=u6(u.path||""),n.query=u.query;else{if(!u.path)if(n.path=m.path,u.query!==void 0)n.query=u.query;else n.query=m.query;else{if(u.path.charAt(0)==="/")n.path=u6(u.path);else{if((m.userinfo!==void 0||m.host!==void 0||m.port!==void 0)&&!m.path)n.path="/"+u.path;else if(!m.path)n.path=u.path;else n.path=m.path.slice(0,m.path.lastIndexOf("/")+1)+u.path;n.path=u6(n.path)}n.query=u.query}n.userinfo=m.userinfo,n.host=m.host,n.port=m.port}n.scheme=m.scheme}return n.fragment=u.fragment,n}function i6(m,u,g){var l=w({scheme:"null"},g);return y8(Y6(O8(m,l),O8(u,l),l,!0),l)}function m6(m,u){if(typeof m==="string")m=y8(O8(m,u),u);else if(f(m)==="object")m=O8(y8(m,u),u);return m}function E3(m,u,g){if(typeof m==="string")m=y8(O8(m,g),g);else if(f(m)==="object")m=y8(m,g);if(typeof u==="string")u=y8(O8(u,g),g);else if(f(u)==="object")u=y8(u,g);return m===u}function t7(m,u){return m&&m.toString().replace(!u||!u.iri?v.ESCAPE:z.ESCAPE,Z)}function jq(m,u){return m&&m.toString().replace(!u||!u.iri?v.PCT_ENCODED:z.PCT_ENCODED,E)}var DK={scheme:"http",domainHost:!0,parse:function m(u,g){if(!u.host)u.error=u.error||"HTTP URIs must have a host.";return u},serialize:function m(u,g){var l=String(u.scheme).toLowerCase()==="https";if(u.port===(l?443:80)||u.port==="")u.port=void 0;if(!u.path)u.path="/";return u}},p9={scheme:"https",domainHost:DK.domainHost,parse:DK.parse,serialize:DK.serialize};function L9(m){return typeof m.secure==="boolean"?m.secure:String(m.scheme).toLowerCase()==="wss"}var CK={scheme:"ws",domainHost:!0,parse:function m(u,g){var l=u;return l.secure=L9(l),l.resourceName=(l.path||"/")+(l.query?"?"+l.query:""),l.path=void 0,l.query=void 0,l},serialize:function m(u,g){if(u.port===(L9(u)?443:80)||u.port==="")u.port=void 0;if(typeof u.secure==="boolean")u.scheme=u.secure?"wss":"ws",u.secure=void 0;if(u.resourceName){var l=u.resourceName.split("?"),n=W(l,2),U=n[0],X8=n[1];u.path=U&&U!=="/"?U:void 0,u.query=X8,u.resourceName=void 0}return u.fragment=void 0,u}},l9={scheme:"wss",domainHost:CK.domainHost,parse:CK.parse,serialize:CK.serialize},L$={},l$=!0,x9="[A-Za-z0-9\\-\\.\\_\\~"+(l$?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",Zq="[0-9A-Fa-f]",x$=Y(Y("%[EFef]"+Zq+"%"+Zq+Zq+"%"+Zq+Zq)+"|"+Y("%[89A-Fa-f]"+Zq+"%"+Zq+Zq)+"|"+Y("%"+Zq+Zq)),n$="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",c$="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",r$=K(c$,"[\\\"\\\\]"),i$="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",o$=new RegExp(x9,"g"),b_=new RegExp(x$,"g"),a$=new RegExp(K("[^]",n$,"[\\.]","[\\\"]",r$),"g"),n9=new RegExp(K("[^]",x9,i$),"g"),B$=n9;function e7(m){var u=E(m);return!u.match(o$)?m:u}var c9={scheme:"mailto",parse:function m(u,g){var l=u,n=l.to=l.path?l.path.split(","):[];if(l.path=void 0,l.query){var U=!1,X8={},C8=l.query.split("&");for(var S8=0,q6=C8.length;S8{_.exports=function j(K,Y){if(K===Y)return!0;if(K&&Y&&typeof K=="object"&&typeof Y=="object"){if(K.constructor!==Y.constructor)return!1;var f,P,$;if(Array.isArray(K)){if(f=K.length,f!=Y.length)return!1;for(P=f;P--!==0;)if(!j(K[P],Y[P]))return!1;return!0}if(K.constructor===RegExp)return K.source===Y.source&&K.flags===Y.flags;if(K.valueOf!==Object.prototype.valueOf)return K.valueOf()===Y.valueOf();if(K.toString!==Object.prototype.toString)return K.toString()===Y.toString();if($=Object.keys(K),f=$.length,f!==Object.keys(Y).length)return!1;for(P=f;P--!==0;)if(!Object.prototype.hasOwnProperty.call(Y,$[P]))return!1;for(P=f;P--!==0;){var w=$[P];if(!j(K[w],Y[w]))return!1}return!0}return K!==K&&Y!==Y}}),ZO=T8((q,_)=>{_.exports=function j(K){var Y=0,f=K.length,P=0,$;while(P=55296&&$<=56319&&P{_.exports={copy:j,checkDataType:K,checkDataTypes:Y,coerceToTypes:P,toHash:$,getProperty:v,escapeQuotes:z,equal:X4(),ucs2length:ZO(),varOccurences:W,varReplace:J,schemaHasRules:T,schemaHasRulesExcept:H,schemaUnknownRules:X,toQuotedString:A,getPathExpr:G,getPath:D,getData:N,unescapeFragment:L,unescapeJsonPointer:y,escapeFragment:b,escapeJsonPointer:d};function j(V,S){S=S||{};for(var p in V)S[p]=V[p];return S}function K(V,S,p,c){var B=c?" !== ":" === ",e=c?" || ":" && ",Y8=c?"!":"",q8=c?"":"!";switch(V){case"null":return S+B+"null";case"array":return Y8+"Array.isArray("+S+")";case"object":return"("+Y8+S+e+"typeof "+S+B+'"object"'+e+q8+"Array.isArray("+S+"))";case"integer":return"(typeof "+S+B+'"number"'+e+q8+"("+S+" % 1)"+e+S+B+S+(p?e+Y8+"isFinite("+S+")":"")+")";case"number":return"(typeof "+S+B+'"'+V+'"'+(p?e+Y8+"isFinite("+S+")":"")+")";default:return"typeof "+S+B+'"'+V+'"'}}function Y(V,S,p){switch(V.length){case 1:return K(V[0],S,p,!0);default:var c="",B=$(V);if(B.array&&B.object)c=B.null?"(":"(!"+S+" || ",c+="typeof "+S+' !== "object")',delete B.null,delete B.array,delete B.object;if(B.number)delete B.integer;for(var e in B)c+=(c?" && ":"")+K(e,S,p,!0);return c}}var f=$(["string","number","integer","boolean","null"]);function P(V,S){if(Array.isArray(S)){var p=[];for(var c=0;c=S)throw new Error("Cannot access property/index "+c+" levels up, current level is "+S);return p[S-c]}if(c>S)throw new Error("Cannot access data "+c+" levels up, current level is "+S);if(e="data"+(S-c||""),!B)return e}var q8=e,z8=B.split("/");for(var w8=0;w8{var j=Q_();_.exports=K;function K(Y){j.copy(Y,this)}}),kO=T8((q,_)=>{var j=_.exports=function(f,P,$){if(typeof P=="function")$=P,P={};$=P.cb||$;var w=typeof $=="function"?$:$.pre||function(){},O=$.post||function(){};K(P,w,O,f,"",f)};j.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},j.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},j.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},j.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function K(f,P,$,w,O,v,z,W,J,T){if(w&&typeof w=="object"&&!Array.isArray(w)){P(w,O,v,z,W,J,T);for(var H in w){var X=w[H];if(Array.isArray(X)){if(H in j.arrayKeywords)for(var A=0;A{var j=TO(),K=X4(),Y=Q_(),f=d5(),P=kO();_.exports=$,$.normalizeId=D,$.fullPath=X,$.url=M,$.ids=I,$.inlineRef=J,$.schema=w;function $(N,R,L){var b=this._refs[L];if(typeof b=="string")if(this._refs[b])b=this._refs[b];else return $.call(this,N,R,b);if(b=b||this._schemas[L],b instanceof f)return J(b.schema,this._opts.inlineRefs)?b.schema:b.validate||this._compile(b);var d=w.call(this,R,L),y,V,S;if(d)y=d.schema,R=d.root,S=d.baseId;if(y instanceof f)V=y.validate||N.call(this,y.schema,R,void 0,S);else if(y!==void 0)V=J(y,this._opts.inlineRefs)?y:N.call(this,y,R,void 0,S);return V}function w(N,R){var L=j.parse(R),b=A(L),d=X(this._getId(N.schema));if(Object.keys(N.schema).length===0||b!==d){var y=D(b),V=this._refs[y];if(typeof V=="string")return O.call(this,N,V,L);else if(V instanceof f){if(!V.validate)this._compile(V);N=V}else if(V=this._schemas[y],V instanceof f){if(!V.validate)this._compile(V);if(y==D(R))return{schema:V,root:N,baseId:d};N=V}else return;if(!N.schema)return;d=X(this._getId(N.schema))}return z.call(this,L,d,N.schema,N)}function O(N,R,L){var b=w.call(this,N,R);if(b){var{schema:d,baseId:y}=b;N=b.root;var V=this._getId(d);if(V)y=M(y,V);return z.call(this,L,y,d,N)}}var v=Y.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function z(N,R,L,b){if(N.fragment=N.fragment||"",N.fragment.slice(0,1)!="/")return;var d=N.fragment.split("/");for(var y=1;y{var j=A4();_.exports={Validation:f(K),MissingRef:f(Y)};function K(P){this.message="validation failed",this.errors=P,this.ajv=this.validation=!0}Y.message=function(P,$){return"can't resolve reference "+$+" from id "+P};function Y(P,$,w){this.message=w||Y.message(P,$),this.missingRef=j.url(P,$),this.missingSchema=j.normalizeId(j.fullPath(this.missingRef))}function f(P){return P.prototype=Object.create(Error.prototype),P.prototype.constructor=P,P}}),p5=T8((q,_)=>{_.exports=function(j,K){if(!K)K={};if(typeof K==="function")K={cmp:K};var Y=typeof K.cycles==="boolean"?K.cycles:!1,f=K.cmp&&function($){return function(w){return function(O,v){var z={key:O,value:w[O]},W={key:v,value:w[v]};return $(z,W)}}}(K.cmp),P=[];return function $(w){if(w&&w.toJSON&&typeof w.toJSON==="function")w=w.toJSON();if(w===void 0)return;if(typeof w=="number")return isFinite(w)?""+w:"null";if(typeof w!=="object")return JSON.stringify(w);var O,v;if(Array.isArray(w)){v="[";for(O=0;O{_.exports=function j(K,Y,f){var P="",$=K.schema.$async===!0,w=K.util.schemaHasRulesExcept(K.schema,K.RULES.all,"$ref"),O=K.self._getId(K.schema);if(K.opts.strictKeywords){var v=K.util.schemaUnknownRules(K.schema,K.RULES.keywords);if(v){var z="unknown keyword: "+v;if(K.opts.strictKeywords==="log")K.logger.warn(z);else throw new Error(z)}}if(K.isTop){if(P+=" var validate = ",$)K.async=!0,P+="async ";if(P+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",O&&(K.opts.sourceCode||K.opts.processCode))P+=" "+("/*# sourceURL="+O+" */")+" "}if(typeof K.schema=="boolean"||!(w||K.schema.$ref)){var Y="false schema",W=K.level,J=K.dataLevel,T=K.schema[Y],H=K.schemaPath+K.util.getProperty(Y),X=K.errSchemaPath+"/"+Y,R=!K.opts.allErrors,d,A="data"+(J||""),N="valid"+W;if(K.schema===!1){if(K.isTop)R=!0;else P+=" var "+N+" = false; ";var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(d||"false schema")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(X)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'boolean schema is false' ";if(K.opts.verbose)P+=" , schema: false , parentSchema: validate.schema"+K.schemaPath+" , data: "+A+" ";P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&R)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else if(K.isTop)if($)P+=" return data; ";else P+=" validate.errors = null; return true; ";else P+=" var "+N+" = true; ";if(K.isTop)P+=" }; return validate; ";return P}if(K.isTop){var M=K.isTop,W=K.level=0,J=K.dataLevel=0,A="data";if(K.rootId=K.resolve.fullPath(K.self._getId(K.root.schema)),K.baseId=K.baseId||K.rootId,delete K.isTop,K.dataPathArr=[""],K.schema.default!==void 0&&K.opts.useDefaults&&K.opts.strictDefaults){var I="default is ignored in the schema root";if(K.opts.strictDefaults==="log")K.logger.warn(I);else throw new Error(I)}P+=" var vErrors = null; ",P+=" var errors = 0; ",P+=" if (rootData === undefined) rootData = data; "}else{var{level:W,dataLevel:J}=K,A="data"+(J||"");if(O)K.baseId=K.resolve.url(K.baseId,O);if($&&!K.async)throw new Error("async schema in sync schema");P+=" var errs_"+W+" = errors;"}var N="valid"+W,R=!K.opts.allErrors,L="",b="",d,y=K.schema.type,V=Array.isArray(y);if(y&&K.opts.nullable&&K.schema.nullable===!0){if(V){if(y.indexOf("null")==-1)y=y.concat("null")}else if(y!="null")y=[y,"null"],V=!0}if(V&&y.length==1)y=y[0],V=!1;if(K.schema.$ref&&w){if(K.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+K.errSchemaPath+'" (see option extendRefs)');else if(K.opts.extendRefs!==!0)w=!1,K.logger.warn('$ref: keywords ignored in schema at path "'+K.errSchemaPath+'"')}if(K.schema.$comment&&K.opts.$comment)P+=" "+K.RULES.all.$comment.code(K,"$comment");if(y){if(K.opts.coerceTypes)var S=K.util.coerceToTypes(K.opts.coerceTypes,y);var p=K.RULES.types[y];if(S||V||p===!0||p&&!a8(p)){var H=K.schemaPath+".type",X=K.errSchemaPath+"/type",H=K.schemaPath+".type",X=K.errSchemaPath+"/type",c=V?"checkDataTypes":"checkDataType";if(P+=" if ("+K.util[c](y,A,K.opts.strictNumbers,!0)+") { ",S){var B="dataType"+W,e="coerced"+W;if(P+=" var "+B+" = typeof "+A+"; var "+e+" = undefined; ",K.opts.coerceTypes=="array")P+=" if ("+B+" == 'object' && Array.isArray("+A+") && "+A+".length == 1) { "+A+" = "+A+"[0]; "+B+" = typeof "+A+"; if ("+K.util.checkDataType(K.schema.type,A,K.opts.strictNumbers)+") "+e+" = "+A+"; } ";P+=" if ("+e+" !== undefined) ; ";var Y8=S;if(Y8){var q8,z8=-1,w8=Y8.length-1;while(z8{var j=A4(),K=Q_(),Y=G4(),f=p5(),P=L5(),$=K.ucs2length,w=X4(),O=Y.Validation;_.exports=v;function v(D,M,I,N){var R=this,L=this._opts,b=[void 0],d={},y=[],V={},S=[],p={},c=[];M=M||{schema:D,refVal:b,refs:d};var B=z.call(this,D,M,N),e=this._compilations[B.index];if(B.compiling)return e.callValidate=K8;var Y8=this._formats,q8=this.RULES;try{var z8=G8(D,M,I,N);e.validate=z8;var w8=e.callValidate;if(w8){if(w8.schema=z8.schema,w8.errors=null,w8.refs=z8.refs,w8.refVal=z8.refVal,w8.root=z8.root,w8.$async=z8.$async,L.sourceCode)w8.source=z8.source}return z8}finally{W.call(this,D,M,N)}function K8(){var r=e.validate,a=r.apply(this,arguments);return K8.errors=r.errors,a}function G8(r,a,P8,H8){var O8=!a||a&&a.schema==r;if(a.schema!=M.schema)return v.call(R,r,a,P8,H8);var A8=r.$async===!0,g8=P({isTop:!0,schema:r,isRoot:O8,baseId:H8,root:a,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:Y.MissingRef,RULES:q8,validate:P,util:K,resolve:j,resolveRef:o8,usePattern:E,useDefault:x,useCustomRule:i,opts:L,formats:Y8,logger:R.logger,self:R});if(g8=G(b,X)+G(y,T)+G(S,H)+G(c,A)+g8,L.processCode)g8=L.processCode(g8,r);var M8;try{var v6=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",g8);M8=v6(R,q8,Y8,M,b,S,c,w,$,O),b[0]=M8}catch(a8){throw R.logger.error("Error compiling schema, function code:",g8),a8}if(M8.schema=r,M8.errors=null,M8.refs=d,M8.refVal=b,M8.root=O8?M8:a,A8)M8.$async=!0;if(L.sourceCode===!0)M8.source={code:g8,patterns:y,defaults:S};return M8}function o8(r,a,P8){a=j.url(r,a);var H8=d[a],O8,A8;if(H8!==void 0)return O8=b[H8],A8="refVal["+H8+"]",Z(O8,A8);if(!P8&&M.refs){var g8=M.refs[a];if(g8!==void 0)return O8=M.refVal[g8],A8=F8(a,O8),Z(O8,A8)}A8=F8(a);var M8=j.call(R,G8,M,a);if(M8===void 0){var v6=I&&I[a];if(v6)M8=j.inlineRef(v6,L.inlineRefs)?v6:v.call(R,v6,M,I,r)}if(M8===void 0)h(a);else return C(a,M8),Z(M8,A8)}function F8(r,a){var P8=b.length;return b[P8]=a,d[r]=P8,"refVal"+P8}function h(r){delete d[r]}function C(r,a){var P8=d[r];b[P8]=a}function Z(r,a){return typeof r=="object"||typeof r=="boolean"?{code:a,schema:r,inline:!0}:{code:a,$async:r&&!!r.$async}}function E(r){var a=V[r];if(a===void 0)a=V[r]=y.length,y[a]=r;return"pattern"+a}function x(r){switch(typeof r){case"boolean":case"number":return""+r;case"string":return K.toQuotedString(r);case"object":if(r===null)return"null";var a=f(r),P8=p[a];if(P8===void 0)P8=p[a]=S.length,S[P8]=r;return"default"+P8}}function i(r,a,P8,H8){if(R._opts.validateSchema!==!1){var O8=r.definition.dependencies;if(O8&&!O8.every(function(i6){return Object.prototype.hasOwnProperty.call(P8,i6)}))throw new Error("parent schema must have all required keywords: "+O8.join(","));var A8=r.definition.validateSchema;if(A8){var g8=A8(a);if(!g8){var M8="keyword schema is invalid: "+R.errorsText(A8.errors);if(R._opts.validateSchema=="log")R.logger.error(M8);else throw new Error(M8)}}}var v6=r.definition.compile,a8=r.definition.inline,u6=r.definition.macro,y8;if(v6)y8=v6.call(R,a,P8,H8);else if(u6){if(y8=u6.call(R,a,P8,H8),L.validateSchema!==!1)R.validateSchema(y8,!0)}else if(a8)y8=a8.call(R,H8,r.keyword,a,P8);else if(y8=r.definition.validate,!y8)return;if(y8===void 0)throw new Error('custom keyword "'+r.keyword+'"failed to compile');var Y6=c.length;return c[Y6]=y8,{code:"customRule"+Y6,validate:y8}}}function z(D,M,I){var N=J.call(this,D,M,I);if(N>=0)return{index:N,compiling:!0};return N=this._compilations.length,this._compilations[N]={schema:D,root:M,baseId:I},{index:N,compiling:!1}}function W(D,M,I){var N=J.call(this,D,M,I);if(N>=0)this._compilations.splice(N,1)}function J(D,M,I){for(var N=0;N{var j=_.exports=function K(){this._cache={}};j.prototype.put=function K(Y,f){this._cache[Y]=f},j.prototype.get=function K(Y){return this._cache[Y]},j.prototype.del=function K(Y){delete this._cache[Y]},j.prototype.clear=function K(){this._cache={}}}),GO=T8((q,_)=>{var j=Q_(),K=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Y=[0,31,28,31,30,31,30,31,31,30,31,30,31],f=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,P=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,$=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,w=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,O=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,v=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,z=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,W=/^(?:\/(?:[^~/]|~0|~1)*)*$/,J=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,T=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;_.exports=H;function H(b){return b=b=="full"?"full":"fast",j.copy(H[b])}H.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":O,url:v,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:P,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:L,uuid:z,"json-pointer":W,"json-pointer-uri-fragment":J,"relative-json-pointer":T},H.full={date:A,time:G,"date-time":M,uri:N,"uri-reference":w,"uri-template":O,url:v,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:P,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:L,uuid:z,"json-pointer":W,"json-pointer-uri-fragment":J,"relative-json-pointer":T};function X(b){return b%4===0&&(b%100!==0||b%400===0)}function A(b){var d=b.match(K);if(!d)return!1;var y=+d[1],V=+d[2],S=+d[3];return V>=1&&V<=12&&S>=1&&S<=(V==2&&X(y)?29:Y[V])}function G(b,d){var y=b.match(f);if(!y)return!1;var V=y[1],S=y[2],p=y[3],c=y[5];return(V<=23&&S<=59&&p<=59||V==23&&S==59&&p==60)&&(!d||c)}var D=/t|\s/i;function M(b){var d=b.split(D);return d.length==2&&A(d[0])&&G(d[1],!0)}var I=/\/|:/;function N(b){return I.test(b)&&$.test(b)}var R=/[^\\]\\Z/;function L(b){if(R.test(b))return!1;try{return new RegExp(b),!0}catch(d){return!1}}}),uO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.errSchemaPath+"/"+Y,z=!K.opts.allErrors,W="data"+(w||""),J="valid"+$,T,H;if(O=="#"||O=="#/")if(K.isRoot)T=K.async,H="validate";else T=K.root.schema.$async===!0,H="root.refVal[0]";else{var X=K.resolveRef(K.baseId,O,K.isRoot);if(X===void 0){var A=K.MissingRefError.message(K.baseId,O);if(K.opts.missingRefs=="fail"){K.logger.error(A);var G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(v)+" , params: { ref: '"+K.util.escapeQuotes(O)+"' } ",K.opts.messages!==!1)P+=" , message: 'can\\'t resolve reference "+K.util.escapeQuotes(O)+"' ";if(K.opts.verbose)P+=" , schema: "+K.util.toQuotedString(O)+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+W+" ";P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&z)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(z)P+=" if (false) { "}else if(K.opts.missingRefs=="ignore"){if(K.logger.warn(A),z)P+=" if (true) { "}else throw new K.MissingRefError(K.baseId,O,A)}else if(X.inline){var M=K.util.copy(K);M.level++;var I="valid"+M.level;M.schema=X.schema,M.schemaPath="",M.errSchemaPath=O;var N=K.validate(M).replace(/validate\.schema/g,X.code);if(P+=" "+N+" ",z)P+=" if ("+I+") { "}else T=X.$async===!0||K.async&&X.$async!==!1,H=X.code}if(H){var G=G||[];if(G.push(P),P="",K.opts.passContext)P+=" "+H+".call(this, ";else P+=" "+H+"( ";if(P+=" "+W+", (dataPath || '')",K.errorPath!='""')P+=" + "+K.errorPath;var R=w?"data"+(w-1||""):"parentData",L=w?K.dataPathArr[w]:"parentDataProperty";P+=" , "+R+" , "+L+", rootData) ";var b=P;if(P=G.pop(),T){if(!K.async)throw new Error("async schema referenced by sync schema");if(z)P+=" var "+J+"; ";if(P+=" try { await "+b+"; ",z)P+=" "+J+" = true; ";if(P+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",z)P+=" "+J+" = false; ";if(P+=" } ",z)P+=" if ("+J+") { "}else if(P+=" if (!"+b+") { if (vErrors === null) vErrors = "+H+".errors; else vErrors = vErrors.concat("+H+".errors); errors = vErrors.length; } ",z)P+=" else { "}return P}}),hO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.schema[Y],w=K.schemaPath+K.util.getProperty(Y),O=K.errSchemaPath+"/"+Y,v=!K.opts.allErrors,z=K.util.copy(K),W="";z.level++;var J="valid"+z.level,T=z.baseId,H=!0,X=$;if(X){var A,G=-1,D=X.length-1;while(G0||A===!1:K.util.schemaHasRules(A,K.RULES.all)){if(H=!1,z.schema=A,z.schemaPath=w+"["+G+"]",z.errSchemaPath=O+"/"+G,P+=" "+K.validate(z)+" ",z.baseId=T,v)P+=" if ("+J+") { ",W+="}"}}if(v)if(H)P+=" if (true) { ";else P+=" "+W.slice(0,-1)+" ";return P}}),DO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D=O.every(function(d){return K.opts.strictKeywords?typeof d=="object"&&Object.keys(d).length>0||d===!1:K.util.schemaHasRules(d,K.RULES.all)});if(D){var M=X.baseId;P+=" var "+H+" = errors; var "+T+" = false; ";var I=K.compositeRule;K.compositeRule=X.compositeRule=!0;var N=O;if(N){var R,L=-1,b=N.length-1;while(L{_.exports=function j(K,Y,f){var P=" ",$=K.schema[Y],w=K.errSchemaPath+"/"+Y,O=!K.opts.allErrors,v=K.util.toQuotedString($);if(K.opts.$comment===!0)P+=" console.log("+v+");";else if(typeof K.opts.$comment=="function")P+=" self._opts.$comment("+v+", "+K.util.toQuotedString(w)+", validate.root.schema);";return P}}),VO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H=K.opts.$data&&O&&O.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",X="schema"+$;else X=O;if(!H)P+=" var schema"+$+" = validate.schema"+v+";";P+="var "+T+" = equal("+J+", schema"+$+"); if (!"+T+") { ";var A=A||[];if(A.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'const' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { allowedValue: schema"+$+" } ",K.opts.messages!==!1)P+=" , message: 'should be equal to constant' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var G=P;if(P=A.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+G+"]); ";else P+=" validate.errors = ["+G+"]; return false; ";else P+=" var err = "+G+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" }",W)P+=" else { ";return P}}),MO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D="i"+$,M=X.dataLevel=K.dataLevel+1,I="data"+M,N=K.baseId,R=K.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:K.util.schemaHasRules(O,K.RULES.all);if(P+="var "+H+" = errors;var "+T+";",R){var L=K.compositeRule;K.compositeRule=X.compositeRule=!0,X.schema=O,X.schemaPath=v,X.errSchemaPath=z,P+=" var "+G+" = false; for (var "+D+" = 0; "+D+" < "+J+".length; "+D+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,D,K.opts.jsonPointers,!0);var b=J+"["+D+"]";X.dataPathArr[M]=D;var d=K.validate(X);if(X.baseId=N,K.util.varOccurences(d,I)<2)P+=" "+K.util.varReplace(d,I,b)+" ";else P+=" var "+I+" = "+b+"; "+d+" ";P+=" if ("+G+") break; } ",K.compositeRule=X.compositeRule=L,P+=" "+A+" if (!"+G+") {"}else P+=" if ("+J+".length == 0) {";var y=y||[];if(y.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should contain a valid item' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var V=P;if(P=y.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+V+"]); ";else P+=" validate.errors = ["+V+"]; return false; ";else P+=" var err = "+V+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else { ",R)P+=" errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; } ";if(K.opts.allErrors)P+=" } ";return P}}),NO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="errs__"+$,H=K.util.copy(K),X="";H.level++;var A="valid"+H.level,G={},D={},M=K.opts.ownProperties;for(L in O){if(L=="__proto__")continue;var I=O[L],N=Array.isArray(I)?D:G;N[L]=I}P+="var "+T+" = errors;";var R=K.errorPath;P+="var missing"+$+";";for(var L in D)if(N=D[L],N.length){if(P+=" if ( "+J+K.util.getProperty(L)+" !== undefined ",M)P+=" && Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(L)+"') ";if(W){P+=" && ( ";var b=N;if(b){var d,y=-1,V=b.length-1;while(y0||I===!1:K.util.schemaHasRules(I,K.RULES.all)){if(P+=" "+A+" = true; if ( "+J+K.util.getProperty(L)+" !== undefined ",M)P+=" && Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(L)+"') ";if(P+=") { ",H.schema=I,H.schemaPath=v+K.util.getProperty(L),H.errSchemaPath=z+"/"+K.util.escapeFragment(L),P+=" "+K.validate(H)+" ",H.baseId=K8,P+=" } ",W)P+=" if ("+A+") { ",X+="}"}}if(W)P+=" "+X+" if ("+T+" == errors) {";return P}}),bO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H=K.opts.$data&&O&&O.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",X="schema"+$;else X=O;var A="i"+$,G="schema"+$;if(!H)P+=" var "+G+" = validate.schema"+v+";";if(P+="var "+T+";",H)P+=" if (schema"+$+" === undefined) "+T+" = true; else if (!Array.isArray(schema"+$+")) "+T+" = false; else {";if(P+=""+T+" = false;for (var "+A+"=0; "+A+"<"+G+".length; "+A+"++) if (equal("+J+", "+G+"["+A+"])) { "+T+" = true; break; }",H)P+=" } ";P+=" if (!"+T+") { ";var D=D||[];if(D.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { allowedValues: schema"+$+" } ",K.opts.messages!==!1)P+=" , message: 'should be equal to one of the allowed values' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var M=P;if(P=D.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+M+"]); ";else P+=" validate.errors = ["+M+"]; return false; ";else P+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" }",W)P+=" else { ";return P}}),SO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||"");if(K.opts.format===!1){if(W)P+=" if (true) { ";return P}var T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;var X=K.opts.unknownFormats,A=Array.isArray(X);if(T){var G="format"+$,D="isObject"+$,M="formatType"+$;if(P+=" var "+G+" = formats["+H+"]; var "+D+" = typeof "+G+" == 'object' && !("+G+" instanceof RegExp) && "+G+".validate; var "+M+" = "+D+" && "+G+".type || 'string'; if ("+D+") { ",K.async)P+=" var async"+$+" = "+G+".async; ";if(P+=" "+G+" = "+G+".validate; } if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'string') || ";if(P+=" (",X!="ignore"){if(P+=" ("+H+" && !"+G+" ",A)P+=" && self._opts.unknownFormats.indexOf("+H+") == -1 ";P+=") || "}if(P+=" ("+G+" && "+M+" == '"+f+"' && !(typeof "+G+" == 'function' ? ",K.async)P+=" (async"+$+" ? await "+G+"("+J+") : "+G+"("+J+")) ";else P+=" "+G+"("+J+") ";P+=" : "+G+".test("+J+"))))) {"}else{var G=K.formats[O];if(!G)if(X=="ignore"){if(K.logger.warn('unknown format "'+O+'" ignored in schema at path "'+K.errSchemaPath+'"'),W)P+=" if (true) { ";return P}else if(A&&X.indexOf(O)>=0){if(W)P+=" if (true) { ";return P}else throw new Error('unknown format "'+O+'" is used in schema at path "'+K.errSchemaPath+'"');var D=typeof G=="object"&&!(G instanceof RegExp)&&G.validate,M=D&&G.type||"string";if(D){var I=G.async===!0;G=G.validate}if(M!=f){if(W)P+=" if (true) { ";return P}if(I){if(!K.async)throw new Error("async format in sync schema");var N="formats"+K.util.getProperty(O)+".validate";P+=" if (!(await "+N+"("+J+"))) { "}else{P+=" if (! ";var N="formats"+K.util.getProperty(O);if(D)N+=".validate";if(typeof G=="function")P+=" "+N+"("+J+") ";else P+=" "+N+".test("+J+") ";P+=") { "}}var R=R||[];if(R.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'format' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { format: ",T)P+=""+H;else P+=""+K.util.toQuotedString(O);if(P+=" } ",K.opts.messages!==!1){if(P+=` , message: 'should match format "`,T)P+="' + "+H+" + '";else P+=""+K.util.escapeQuotes(O);P+=`"' `}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+K.util.toQuotedString(O);P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var L=P;if(P=R.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+L+"]); ";else P+=" validate.errors = ["+L+"]; return false; ";else P+=" var err = "+L+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { ";return P}}),EO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K);X.level++;var A="valid"+X.level,G=K.schema.then,D=K.schema.else,M=G!==void 0&&(K.opts.strictKeywords?typeof G=="object"&&Object.keys(G).length>0||G===!1:K.util.schemaHasRules(G,K.RULES.all)),I=D!==void 0&&(K.opts.strictKeywords?typeof D=="object"&&Object.keys(D).length>0||D===!1:K.util.schemaHasRules(D,K.RULES.all)),N=X.baseId;if(M||I){var R;X.createErrors=!1,X.schema=O,X.schemaPath=v,X.errSchemaPath=z,P+=" var "+H+" = errors; var "+T+" = true; ";var L=K.compositeRule;if(K.compositeRule=X.compositeRule=!0,P+=" "+K.validate(X)+" ",X.baseId=N,X.createErrors=!0,P+=" errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; } ",K.compositeRule=X.compositeRule=L,M){if(P+=" if ("+A+") { ",X.schema=K.schema.then,X.schemaPath=K.schemaPath+".then",X.errSchemaPath=K.errSchemaPath+"/then",P+=" "+K.validate(X)+" ",X.baseId=N,P+=" "+T+" = "+A+"; ",M&&I)R="ifClause"+$,P+=" var "+R+" = 'then'; ";else R="'then'";if(P+=" } ",I)P+=" else { "}else P+=" if (!"+A+") { ";if(I){if(X.schema=K.schema.else,X.schemaPath=K.schemaPath+".else",X.errSchemaPath=K.errSchemaPath+"/else",P+=" "+K.validate(X)+" ",X.baseId=N,P+=" "+T+" = "+A+"; ",M&&I)R="ifClause"+$,P+=" var "+R+" = 'else'; ";else R="'else'";P+=" } "}if(P+=" if (!"+T+") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'if' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { failingKeyword: "+R+" } ",K.opts.messages!==!1)P+=` , message: 'should match "' + `+R+` + '" schema' `;if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(P+=" } ",W)P+=" else { "}else if(W)P+=" if (true) { ";return P}}),RO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D="i"+$,M=X.dataLevel=K.dataLevel+1,I="data"+M,N=K.baseId;if(P+="var "+H+" = errors;var "+T+";",Array.isArray(O)){var R=K.schema.additionalItems;if(R===!1){P+=" "+T+" = "+J+".length <= "+O.length+"; ";var L=z;z=K.errSchemaPath+"/additionalItems",P+=" if (!"+T+") { ";var b=b||[];if(b.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+O.length+" } ",K.opts.messages!==!1)P+=" , message: 'should NOT have more than "+O.length+" items' ";if(K.opts.verbose)P+=" , schema: false , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var d=P;if(P=b.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+d+"]); ";else P+=" validate.errors = ["+d+"]; return false; ";else P+=" var err = "+d+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",z=L,W)A+="}",P+=" else { "}var y=O;if(y){var V,S=-1,p=y.length-1;while(S0||V===!1:K.util.schemaHasRules(V,K.RULES.all)){P+=" "+G+" = true; if ("+J+".length > "+S+") { ";var c=J+"["+S+"]";X.schema=V,X.schemaPath=v+"["+S+"]",X.errSchemaPath=z+"/"+S,X.errorPath=K.util.getPathExpr(K.errorPath,S,K.opts.jsonPointers,!0),X.dataPathArr[M]=S;var B=K.validate(X);if(X.baseId=N,K.util.varOccurences(B,I)<2)P+=" "+K.util.varReplace(B,I,c)+" ";else P+=" var "+I+" = "+c+"; "+B+" ";if(P+=" } ",W)P+=" if ("+G+") { ",A+="}"}}if(typeof R=="object"&&(K.opts.strictKeywords?typeof R=="object"&&Object.keys(R).length>0||R===!1:K.util.schemaHasRules(R,K.RULES.all))){X.schema=R,X.schemaPath=K.schemaPath+".additionalItems",X.errSchemaPath=K.errSchemaPath+"/additionalItems",P+=" "+G+" = true; if ("+J+".length > "+O.length+") { for (var "+D+" = "+O.length+"; "+D+" < "+J+".length; "+D+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,D,K.opts.jsonPointers,!0);var c=J+"["+D+"]";X.dataPathArr[M]=D;var B=K.validate(X);if(X.baseId=N,K.util.varOccurences(B,I)<2)P+=" "+K.util.varReplace(B,I,c)+" ";else P+=" var "+I+" = "+c+"; "+B+" ";if(W)P+=" if (!"+G+") break; ";if(P+=" } } ",W)P+=" if ("+G+") { ",A+="}"}}else if(K.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:K.util.schemaHasRules(O,K.RULES.all)){X.schema=O,X.schemaPath=v,X.errSchemaPath=z,P+=" for (var "+D+" = 0; "+D+" < "+J+".length; "+D+"++) { ",X.errorPath=K.util.getPathExpr(K.errorPath,D,K.opts.jsonPointers,!0);var c=J+"["+D+"]";X.dataPathArr[M]=D;var B=K.validate(X);if(X.baseId=N,K.util.varOccurences(B,I)<2)P+=" "+K.util.varReplace(B,I,c)+" ";else P+=" var "+I+" = "+c+"; "+B+" ";if(W)P+=" if (!"+G+") break; ";P+=" }"}if(W)P+=" "+A+" if ("+H+" == errors) {";return P}}),M5=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,N,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;var X=Y=="maximum",A=X?"exclusiveMaximum":"exclusiveMinimum",G=K.schema[A],D=K.opts.$data&&G&&G.$data,M=X?"<":">",I=X?">":"<",N=void 0;if(!(T||typeof O=="number"||O===void 0))throw new Error(Y+" must be number");if(!(D||G===void 0||typeof G=="number"||typeof G=="boolean"))throw new Error(A+" must be number or boolean");if(D){var R=K.util.getData(G.$data,w,K.dataPathArr),L="exclusive"+$,b="exclType"+$,d="exclIsNumber"+$,y="op"+$,V="' + "+y+" + '";P+=" var schemaExcl"+$+" = "+R+"; ",R="schemaExcl"+$,P+=" var "+L+"; var "+b+" = typeof "+R+"; if ("+b+" != 'boolean' && "+b+" != 'undefined' && "+b+" != 'number') { ";var N=A,S=S||[];if(S.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(N||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: '"+A+" should be boolean' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var p=P;if(P=S.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+p+"]); ";else P+=" validate.errors = ["+p+"]; return false; ";else P+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";if(P+=" "+b+" == 'number' ? ( ("+L+" = "+H+" === undefined || "+R+" "+M+"= "+H+") ? "+J+" "+I+"= "+R+" : "+J+" "+I+" "+H+" ) : ( ("+L+" = "+R+" === true) ? "+J+" "+I+"= "+H+" : "+J+" "+I+" "+H+" ) || "+J+" !== "+J+") { var op"+$+" = "+L+" ? '"+M+"' : '"+M+"='; ",O===void 0)N=A,z=K.errSchemaPath+"/"+A,H=R,T=D}else{var d=typeof G=="number",V=M;if(d&&T){var y="'"+V+"'";if(P+=" if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" ( "+H+" === undefined || "+G+" "+M+"= "+H+" ? "+J+" "+I+"= "+G+" : "+J+" "+I+" "+H+" ) || "+J+" !== "+J+") { "}else{if(d&&O===void 0)L=!0,N=A,z=K.errSchemaPath+"/"+A,H=G,I+="=";else{if(d)H=Math[X?"min":"max"](G,O);if(G===(d?H:!0))L=!0,N=A,z=K.errSchemaPath+"/"+A,I+="=";else L=!1,V+="="}var y="'"+V+"'";if(P+=" if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" "+J+" "+I+" "+H+" || "+J+" !== "+J+") { "}}N=N||Y;var S=S||[];if(S.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(N||"_limit")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { comparison: "+y+", limit: "+H+", exclusive: "+L+" } ",K.opts.messages!==!1)if(P+=" , message: 'should be "+V+" ",T)P+="' + "+H;else P+=""+H+"'";if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var p=P;if(P=S.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+p+"]); ";else P+=" validate.errors = ["+p+"]; return false; ";else P+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { ";return P}}),N5=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,A,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;if(!(T||typeof O=="number"))throw new Error(Y+" must be number");var X=Y=="maxItems"?">":"<";if(P+="if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" "+J+".length "+X+" "+H+") { ";var A=Y,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitItems")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+H+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT have ",Y=="maxItems")P+="more";else P+="fewer";if(P+=" than ",T)P+="' + "+H+" + '";else P+=""+O;P+=" items' "}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),b5=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,A,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;if(!(T||typeof O=="number"))throw new Error(Y+" must be number");var X=Y=="maxLength"?">":"<";if(P+="if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";if(K.opts.unicode===!1)P+=" "+J+".length ";else P+=" ucs2length("+J+") ";P+=" "+X+" "+H+") { ";var A=Y,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitLength")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+H+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT be ",Y=="maxLength")P+="longer";else P+="shorter";if(P+=" than ",T)P+="' + "+H+" + '";else P+=""+O;P+=" characters' "}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),S5=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,A,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;if(!(T||typeof O=="number"))throw new Error(Y+" must be number");var X=Y=="maxProperties"?">":"<";if(P+="if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'number') || ";P+=" Object.keys("+J+").length "+X+" "+H+") { ";var A=Y,G=G||[];if(G.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(A||"_limitProperties")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { limit: "+H+" } ",K.opts.messages!==!1){if(P+=" , message: 'should NOT have ",Y=="maxProperties")P+="more";else P+="fewer";if(P+=" than ",T)P+="' + "+H+" + '";else P+=""+O;P+=" properties' "}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var D=P;if(P=G.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+D+"]); ";else P+=" validate.errors = ["+D+"]; return false; ";else P+=" var err = "+D+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),mO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;if(!(T||typeof O=="number"))throw new Error(Y+" must be number");if(P+="var division"+$+";if (",T)P+=" "+H+" !== undefined && ( typeof "+H+" != 'number' || ";if(P+=" (division"+$+" = "+J+" / "+H+", ",K.opts.multipleOfPrecision)P+=" Math.abs(Math.round(division"+$+") - division"+$+") > 1e-"+K.opts.multipleOfPrecision+" ";else P+=" division"+$+" !== parseInt(division"+$+") ";if(P+=" ) ",T)P+=" ) ";P+=" ) { ";var X=X||[];if(X.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { multipleOf: "+H+" } ",K.opts.messages!==!1)if(P+=" , message: 'should be multiple of ",T)P+="' + "+H;else P+=""+H+"'";if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var A=P;if(P=X.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+A+"]); ";else P+=" validate.errors = ["+A+"]; return false; ";else P+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),IO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="errs__"+$,H=K.util.copy(K);H.level++;var X="valid"+H.level;if(K.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:K.util.schemaHasRules(O,K.RULES.all)){H.schema=O,H.schemaPath=v,H.errSchemaPath=z,P+=" var "+T+" = errors; ";var A=K.compositeRule;K.compositeRule=H.compositeRule=!0,H.createErrors=!1;var G;if(H.opts.allErrors)G=H.opts.allErrors,H.opts.allErrors=!1;if(P+=" "+K.validate(H)+" ",H.createErrors=!0,G)H.opts.allErrors=G;K.compositeRule=H.compositeRule=A,P+=" if ("+X+") { ";var D=D||[];if(D.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'not' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should NOT be valid' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var M=P;if(P=D.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+M+"]); ";else P+=" validate.errors = ["+M+"]; return false; ";else P+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } else { errors = "+T+"; if (vErrors !== null) { if ("+T+") vErrors.length = "+T+"; else vErrors = null; } ",K.opts.allErrors)P+=" } "}else{if(P+=" var err = ",K.createErrors!==!1){if(P+=" { keyword: 'not' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: {} ",K.opts.messages!==!1)P+=" , message: 'should NOT be valid' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",W)P+=" if (false) { "}return P}}),gO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H="errs__"+$,X=K.util.copy(K),A="";X.level++;var G="valid"+X.level,D=X.baseId,M="prevValid"+$,I="passingSchemas"+$;P+="var "+H+" = errors , "+M+" = false , "+T+" = false , "+I+" = null; ";var N=K.compositeRule;K.compositeRule=X.compositeRule=!0;var R=O;if(R){var L,b=-1,d=R.length-1;while(b0||L===!1:K.util.schemaHasRules(L,K.RULES.all))X.schema=L,X.schemaPath=v+"["+b+"]",X.errSchemaPath=z+"/"+b,P+=" "+K.validate(X)+" ",X.baseId=D;else P+=" var "+G+" = true; ";if(b)P+=" if ("+G+" && "+M+") { "+T+" = false; "+I+" = ["+I+", "+b+"]; } else { ",A+="}";P+=" if ("+G+") { "+T+" = "+M+" = true; "+I+" = "+b+"; }"}}if(K.compositeRule=X.compositeRule=N,P+=""+A+"if (!"+T+") { var err = ",K.createErrors!==!1){if(P+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { passingSchemas: "+I+" } ",K.opts.messages!==!1)P+=" , message: 'should match exactly one schema in oneOf' ";if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";if(P+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(vErrors); ";else P+=" validate.errors = vErrors; return false; ";if(P+="} else { errors = "+H+"; if (vErrors !== null) { if ("+H+") vErrors.length = "+H+"; else vErrors = null; }",K.opts.allErrors)P+=" } ";return P}}),yO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T=K.opts.$data&&O&&O.$data,H;if(T)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",H="schema"+$;else H=O;var X=T?"(new RegExp("+H+"))":K.usePattern(O);if(P+="if ( ",T)P+=" ("+H+" !== undefined && typeof "+H+" != 'string') || ";P+=" !"+X+".test("+J+") ) { ";var A=A||[];if(A.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { pattern: ",T)P+=""+H;else P+=""+K.util.toQuotedString(O);if(P+=" } ",K.opts.messages!==!1){if(P+=` , message: 'should match pattern "`,T)P+="' + "+H+" + '";else P+=""+K.util.escapeQuotes(O);P+=`"' `}if(K.opts.verbose){if(P+=" , schema: ",T)P+="validate.schema"+v;else P+=""+K.util.toQuotedString(O);P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var G=P;if(P=A.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+G+"]); ";else P+=" validate.errors = ["+G+"]; return false; ";else P+=" var err = "+G+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+="} ",W)P+=" else { ";return P}}),dO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="errs__"+$,H=K.util.copy(K),X="";H.level++;var A="valid"+H.level,G="key"+$,D="idx"+$,M=H.dataLevel=K.dataLevel+1,I="data"+M,N="dataProperties"+$,R=Object.keys(O||{}).filter(z8),L=K.schema.patternProperties||{},b=Object.keys(L).filter(z8),d=K.schema.additionalProperties,y=R.length||b.length,V=d===!1,S=typeof d=="object"&&Object.keys(d).length,p=K.opts.removeAdditional,c=V||S||p,B=K.opts.ownProperties,e=K.baseId,Y8=K.schema.required;if(Y8&&!(K.opts.$data&&Y8.$data)&&Y8.length8)P+=" || validate.schema"+v+".hasOwnProperty("+G+") ";else{var w8=R;if(w8){var K8,G8=-1,o8=w8.length-1;while(G80||a8===!1:K.util.schemaHasRules(a8,K.RULES.all)){var u6=K.util.getProperty(K8),H8=J+u6,y8=A8&&a8.default!==void 0;H.schema=a8,H.schemaPath=v+u6,H.errSchemaPath=z+"/"+K.util.escapeFragment(K8),H.errorPath=K.util.getPath(K.errorPath,K8,K.opts.jsonPointers),H.dataPathArr[M]=K.util.toQuotedString(K8);var O8=K.validate(H);if(H.baseId=e,K.util.varOccurences(O8,I)<2){O8=K.util.varReplace(O8,I,H8);var Y6=H8}else{var Y6=I;P+=" var "+I+" = "+H8+"; "}if(y8)P+=" "+O8+" ";else{if(q8&&q8[K8]){if(P+=" if ( "+Y6+" === undefined ",B)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(K8)+"') ";P+=") { "+A+" = false; ";var E=K.errorPath,i=z,i6=K.util.escapeQuotes(K8);if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPath(E,K8,K.opts.jsonPointers);z=K.errSchemaPath+"/required";var r=r||[];if(r.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+i6+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+i6+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var a=P;if(P=r.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+a+"]); ";else P+=" validate.errors = ["+a+"]; return false; ";else P+=" var err = "+a+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";z=i,K.errorPath=E,P+=" } else { "}else if(W){if(P+=" if ( "+Y6+" === undefined ",B)P+=" || ! Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(K8)+"') ";P+=") { "+A+" = true; } else { "}else{if(P+=" if ("+Y6+" !== undefined ",B)P+=" && Object.prototype.hasOwnProperty.call("+J+", '"+K.util.escapeQuotes(K8)+"') ";P+=" ) { "}P+=" "+O8+" } "}}if(W)P+=" if ("+A+") { ",X+="}"}}}if(b.length){var m6=b;if(m6){var h,E3=-1,t7=m6.length-1;while(E30||a8===!1:K.util.schemaHasRules(a8,K.RULES.all)){if(H.schema=a8,H.schemaPath=K.schemaPath+".patternProperties"+K.util.getProperty(h),H.errSchemaPath=K.errSchemaPath+"/patternProperties/"+K.util.escapeFragment(h),B)P+=" "+N+" = "+N+" || Object.keys("+J+"); for (var "+D+"=0; "+D+"<"+N+".length; "+D+"++) { var "+G+" = "+N+"["+D+"]; ";else P+=" for (var "+G+" in "+J+") { ";P+=" if ("+K.usePattern(h)+".test("+G+")) { ",H.errorPath=K.util.getPathExpr(K.errorPath,G,K.opts.jsonPointers);var H8=J+"["+G+"]";H.dataPathArr[M]=G;var O8=K.validate(H);if(H.baseId=e,K.util.varOccurences(O8,I)<2)P+=" "+K.util.varReplace(O8,I,H8)+" ";else P+=" var "+I+" = "+H8+"; "+O8+" ";if(W)P+=" if (!"+A+") break; ";if(P+=" } ",W)P+=" else "+A+" = true; ";if(P+=" } ",W)P+=" if ("+A+") { ",X+="}"}}}}if(W)P+=" "+X+" if ("+T+" == errors) {";return P}}),pO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="errs__"+$,H=K.util.copy(K),X="";H.level++;var A="valid"+H.level;if(P+="var "+T+" = errors;",K.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:K.util.schemaHasRules(O,K.RULES.all)){H.schema=O,H.schemaPath=v,H.errSchemaPath=z;var G="key"+$,D="idx"+$,M="i"+$,I="' + "+G+" + '",N=H.dataLevel=K.dataLevel+1,R="data"+N,L="dataProperties"+$,b=K.opts.ownProperties,d=K.baseId;if(b)P+=" var "+L+" = undefined; ";if(b)P+=" "+L+" = "+L+" || Object.keys("+J+"); for (var "+D+"=0; "+D+"<"+L+".length; "+D+"++) { var "+G+" = "+L+"["+D+"]; ";else P+=" for (var "+G+" in "+J+") { ";P+=" var startErrs"+$+" = errors; ";var y=G,V=K.compositeRule;K.compositeRule=H.compositeRule=!0;var S=K.validate(H);if(H.baseId=d,K.util.varOccurences(S,R)<2)P+=" "+K.util.varReplace(S,R,y)+" ";else P+=" var "+R+" = "+y+"; "+S+" ";if(K.compositeRule=H.compositeRule=V,P+=" if (!"+A+") { for (var "+M+"=startErrs"+$+"; "+M+"{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H=K.opts.$data&&O&&O.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",X="schema"+$;else X=O;var A="schema"+$;if(!H)if(O.length0||R===!1:K.util.schemaHasRules(R,K.RULES.all))))G[G.length]=M}}}else var G=O;if(H||G.length){var L=K.errorPath,b=H||G.length>=K.opts.loopRequired,d=K.opts.ownProperties;if(W)if(P+=" var missing"+$+"; ",b){if(!H)P+=" var "+A+" = validate.schema"+v+"; ";var y="i"+$,V="schema"+$+"["+y+"]",S="' + "+V+" + '";if(K.opts._errorDataPathProperty)K.errorPath=K.util.getPathExpr(L,V,K.opts.jsonPointers);if(P+=" var "+T+" = true; ",H)P+=" if (schema"+$+" === undefined) "+T+" = true; else if (!Array.isArray(schema"+$+")) "+T+" = false; else {";if(P+=" for (var "+y+" = 0; "+y+" < "+A+".length; "+y+"++) { "+T+" = "+J+"["+A+"["+y+"]] !== undefined ",d)P+=" && Object.prototype.hasOwnProperty.call("+J+", "+A+"["+y+"]) ";if(P+="; if (!"+T+") break; } ",H)P+=" } ";P+=" if (!"+T+") { ";var p=p||[];if(p.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'required' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { missingProperty: '"+S+"' } ",K.opts.messages!==!1){if(P+=" , message: '",K.opts._errorDataPathProperty)P+="is a required property";else P+="should have required property \\'"+S+"\\'";P+="' "}if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" ";P+=" } "}else P+=" {} ";var c=P;if(P=p.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+c+"]); ";else P+=" validate.errors = ["+c+"]; return false; ";else P+=" var err = "+c+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";P+=" } else { "}else{P+=" if ( ";var B=G;if(B){var e,y=-1,Y8=B.length-1;while(y{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J="data"+(w||""),T="valid"+$,H=K.opts.$data&&O&&O.$data,X;if(H)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",X="schema"+$;else X=O;if((O||H)&&K.opts.uniqueItems!==!1){if(H)P+=" var "+T+"; if ("+X+" === false || "+X+" === undefined) "+T+" = true; else if (typeof "+X+" != 'boolean') "+T+" = false; else { ";P+=" var i = "+J+".length , "+T+" = true , j; if (i > 1) { ";var A=K.schema.items&&K.schema.items.type,G=Array.isArray(A);if(!A||A=="object"||A=="array"||G&&(A.indexOf("object")>=0||A.indexOf("array")>=0))P+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+J+"[i], "+J+"[j])) { "+T+" = false; break outer; } } } ";else{P+=" var itemIndices = {}, item; for (;i--;) { var item = "+J+"[i]; ";var D="checkDataType"+(G?"s":"");if(P+=" if ("+K.util[D](A,"item",K.opts.strictNumbers,!0)+") continue; ",G)P+=` if (typeof item == 'string') item = '"' + item; `;P+=" if (typeof itemIndices[item] == 'number') { "+T+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}if(P+=" } ",H)P+=" } ";P+=" if (!"+T+") { ";var M=M||[];if(M.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { i: i, j: j } ",K.opts.messages!==!1)P+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' ";if(K.opts.verbose){if(P+=" , schema: ",H)P+="validate.schema"+v;else P+=""+O;P+=" , parentSchema: validate.schema"+K.schemaPath+" , data: "+J+" "}P+=" } "}else P+=" {} ";var I=P;if(P=M.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+I+"]); ";else P+=" validate.errors = ["+I+"]; return false; ";else P+=" var err = "+I+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";if(P+=" } ",W)P+=" else { "}else if(W)P+=" if (true) { ";return P}}),xO=T8((q,_)=>{_.exports={$ref:uO(),allOf:hO(),anyOf:DO(),$comment:CO(),const:VO(),contains:MO(),dependencies:NO(),enum:bO(),format:SO(),if:EO(),items:RO(),maximum:M5(),minimum:M5(),maxItems:N5(),minItems:N5(),maxLength:b5(),minLength:b5(),maxProperties:S5(),minProperties:S5(),multipleOf:mO(),not:IO(),oneOf:gO(),pattern:yO(),properties:dO(),propertyNames:pO(),required:LO(),uniqueItems:lO(),validate:L5()}}),nO=T8((q,_)=>{var j=xO(),K=Q_().toHash;_.exports=function Y(){var f=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],P=["type","$comment"],$=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],w=["number","integer","string","array","object","boolean","null"];return f.all=K(P),f.types=K(w),f.forEach(function(O){if(O.rules=O.rules.map(function(v){var z;if(typeof v=="object"){var W=Object.keys(v)[0];z=v[W],v=W,z.forEach(function(T){P.push(T),f.all[T]=!0})}P.push(v);var J=f.all[v]={keyword:v,code:j[v],implements:z};return J}),f.all.$comment={keyword:"$comment",code:j.$comment},O.type)f.types[O.type]=O}),f.keywords=K(P.concat($)),f.custom={},f}}),cO=T8((q,_)=>{var j=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];_.exports=function(K,Y){for(var f=0;f{var j=G4().MissingRef;_.exports=K;function K(Y,f,P){var $=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");if(typeof f=="function")P=f,f=void 0;var w=O(Y).then(function(){var z=$._addSchema(Y,void 0,f);return z.validate||v(z)});if(P)w.then(function(z){P(null,z)},P);return w;function O(z){var W=z.$schema;return W&&!$.getSchema(W)?K.call($,{$ref:W},!0):Promise.resolve()}function v(z){try{return $._compile(z)}catch(J){if(J instanceof j)return W(J);throw J}function W(J){var T=J.missingSchema;if(A(T))throw new Error("Schema "+T+" is loaded but "+J.missingRef+" cannot be resolved");var H=$._loadingSchemas[T];if(!H)H=$._loadingSchemas[T]=$._opts.loadSchema(T),H.then(X,X);return H.then(function(G){if(!A(T))return O(G).then(function(){if(!A(T))$.addSchema(G,T,void 0,f)})}).then(function(){return v(z)});function X(){delete $._loadingSchemas[T]}function A(G){return $._refs[G]||$._schemas[G]}}}}}),iO=T8((q,_)=>{_.exports=function j(K,Y,f){var P=" ",$=K.level,w=K.dataLevel,O=K.schema[Y],v=K.schemaPath+K.util.getProperty(Y),z=K.errSchemaPath+"/"+Y,W=!K.opts.allErrors,J,T="data"+(w||""),H="valid"+$,X="errs__"+$,A=K.opts.$data&&O&&O.$data,G;if(A)P+=" var schema"+$+" = "+K.util.getData(O.$data,w,K.dataPathArr)+"; ",G="schema"+$;else G=O;var D=this,M="definition"+$,I=D.definition,N="",R,L,b,d,y;if(A&&I.$data){y="keywordValidate"+$;var V=I.validateSchema;P+=" var "+M+" = RULES.custom['"+Y+"'].definition; var "+y+" = "+M+".validate;"}else{if(d=K.useCustomRule(D,O,K.schema,K),!d)return;G="validate.schema"+v,y=d.code,R=I.compile,L=I.inline,b=I.macro}var S=y+".errors",p="i"+$,c="ruleErr"+$,B=I.async;if(B&&!K.async)throw new Error("async keyword in sync schema");if(!(L||b))P+=""+S+" = null;";if(P+="var "+X+" = errors;var "+H+";",A&&I.$data){if(N+="}",P+=" if ("+G+" === undefined) { "+H+" = true; } else { ",V)N+="}",P+=" "+H+" = "+M+".validateSchema("+G+"); if ("+H+") { "}if(L)if(I.statements)P+=" "+d.validate+" ";else P+=" "+H+" = "+d.validate+"; ";else if(b){var e=K.util.copy(K),N="";e.level++;var Y8="valid"+e.level;e.schema=d.validate,e.schemaPath="";var q8=K.compositeRule;K.compositeRule=e.compositeRule=!0;var z8=K.validate(e).replace(/validate\.schema/g,y);K.compositeRule=e.compositeRule=q8,P+=" "+z8}else{var w8=w8||[];if(w8.push(P),P="",P+=" "+y+".call( ",K.opts.passContext)P+="this";else P+="self";if(R||I.schema===!1)P+=" , "+T+" ";else P+=" , "+G+" , "+T+" , validate.schema"+K.schemaPath+" ";if(P+=" , (dataPath || '')",K.errorPath!='""')P+=" + "+K.errorPath;var K8=w?"data"+(w-1||""):"parentData",G8=w?K.dataPathArr[w]:"parentDataProperty";P+=" , "+K8+" , "+G8+" , rootData ) ";var o8=P;if(P=w8.pop(),I.errors===!1){if(P+=" "+H+" = ",B)P+="await ";P+=""+o8+"; "}else if(B)S="customErrors"+$,P+=" var "+S+" = null; try { "+H+" = await "+o8+"; } catch (e) { "+H+" = false; if (e instanceof ValidationError) "+S+" = e.errors; else throw e; } ";else P+=" "+S+" = null; "+H+" = "+o8+"; "}if(I.modifying)P+=" if ("+K8+") "+T+" = "+K8+"["+G8+"];";if(P+=""+N,I.valid){if(W)P+=" if (true) { "}else{if(P+=" if ( ",I.valid===void 0)if(P+=" !",b)P+=""+Y8;else P+=""+H;else P+=" "+!I.valid+" ";P+=") { ",J=D.keyword;var w8=w8||[];w8.push(P),P="";var w8=w8||[];if(w8.push(P),P="",K.createErrors!==!1){if(P+=" { keyword: '"+(J||"custom")+"' , dataPath: (dataPath || '') + "+K.errorPath+" , schemaPath: "+K.util.toQuotedString(z)+" , params: { keyword: '"+D.keyword+"' } ",K.opts.messages!==!1)P+=` , message: 'should pass "`+D.keyword+`" keyword validation' `;if(K.opts.verbose)P+=" , schema: validate.schema"+v+" , parentSchema: validate.schema"+K.schemaPath+" , data: "+T+" ";P+=" } "}else P+=" {} ";var F8=P;if(P=w8.pop(),!K.compositeRule&&W)if(K.async)P+=" throw new ValidationError(["+F8+"]); ";else P+=" validate.errors = ["+F8+"]; return false; ";else P+=" var err = "+F8+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var h=P;if(P=w8.pop(),L)if(I.errors){if(I.errors!="full"){if(P+=" for (var "+p+"="+X+"; "+p+"{_.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),oO=T8((q,_)=>{var j=l5();_.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:j.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:j.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}}),aO=T8((q,_)=>{var j=/^[a-z_$][a-z0-9_$-]*$/i,K=iO(),Y=oO();_.exports={add:f,get:P,remove:$,validate:w};function f(O,v){var z=this.RULES;if(z.keywords[O])throw new Error("Keyword "+O+" is already defined");if(!j.test(O))throw new Error("Keyword "+O+" is not a valid identifier");if(v){this.validateKeyword(v,!0);var W=v.type;if(Array.isArray(W))for(var J=0;J{_.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),tO=T8((q,_)=>{var j=XO(),K=A4(),Y=AO(),f=d5(),P=p5(),$=GO(),w=nO(),O=cO(),v=Q_();_.exports=X,X.prototype.validate=A,X.prototype.compile=G,X.prototype.addSchema=D,X.prototype.addMetaSchema=M,X.prototype.validateSchema=I,X.prototype.getSchema=R,X.prototype.removeSchema=d,X.prototype.addFormat=q8,X.prototype.errorsText=Y8,X.prototype._addSchema=V,X.prototype._compile=S,X.prototype.compileAsync=rO();var z=aO();X.prototype.addKeyword=z.add,X.prototype.getKeyword=z.get,X.prototype.removeKeyword=z.remove,X.prototype.validateKeyword=z.validate;var W=G4();X.ValidationError=W.Validation,X.MissingRefError=W.MissingRef,X.$dataMetaSchema=O;var J="http://json-schema.org/draft-07/schema",T=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],H=["/properties"];function X(Z){if(!(this instanceof X))return new X(Z);if(Z=this._opts=v.copy(Z)||{},h(this),this._schemas={},this._refs={},this._fragments={},this._formats=$(Z.format),this._cache=Z.cache||new Y,this._loadingSchemas={},this._compilations=[],this.RULES=w(),this._getId=p(Z),Z.loopRequired=Z.loopRequired||1/0,Z.errorDataPath=="property")Z._errorDataPathProperty=!0;if(Z.serialize===void 0)Z.serialize=P;if(this._metaOpts=F8(this),Z.formats)K8(this);if(Z.keywords)G8(this);if(z8(this),typeof Z.meta=="object")this.addMetaSchema(Z.meta);if(Z.nullable)this.addKeyword("nullable",{metaSchema:{type:"boolean"}});w8(this)}function A(Z,E){var x;if(typeof Z=="string"){if(x=this.getSchema(Z),!x)throw new Error('no schema with key or ref "'+Z+'"')}else{var i=this._addSchema(Z);x=i.validate||this._compile(i)}var r=x(E);if(x.$async!==!0)this.errors=x.errors;return r}function G(Z,E){var x=this._addSchema(Z,void 0,E);return x.validate||this._compile(x)}function D(Z,E,x,i){if(Array.isArray(Z)){for(var r=0;r0)return Promise.resolve({done:!1,value:this.queue.shift()});if(this.isDone)return Promise.resolve({done:!0,value:void 0});if(this.hasError)return Promise.reject(this.hasError);return new Promise((q,_)=>{this.readResolve=q,this.readReject=_})}enqueue(q){if(this.readResolve){let _=this.readResolve;this.readResolve=void 0,this.readReject=void 0,_({done:!1,value:q})}else this.queue.push(q)}done(){if(this.isDone=!0,this.readResolve){let q=this.readResolve;this.readResolve=void 0,this.readReject=void 0,q({done:!0,value:void 0})}}error(q){if(this.hasError=q,this.readReject){let _=this.readReject;this.readResolve=void 0,this.readReject=void 0,_(q)}}return(){if(this.isDone=!0,this.returned)this.returned();return Promise.resolve({done:!0,value:void 0})}};i5=class i5{transport;isStreamingMode;canUseTool;hooks;abortController;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new c5;intialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;pendingMcpResponses=new Map;constructor(q,_,j,K,Y,f=new Map){this.transport=q,this.isStreamingMode=_,this.canUseTool=j,this.hooks=K,this.abortController=Y;for(let[P,$]of f){let w=new r5((O)=>this.sendMcpServerMessageToCli(P,O));this.sdkMcpTransports.set(P,w),$.connect(w)}if(this.sdkMessages=this.readSdkMessages(),this.readMessages(),this.isStreamingMode)this.intialization=this.initialize()}setError(q){this.inputStream.error(q)}cleanup(q){if(this.cleanupPerformed)return;this.cleanupPerformed=!0;try{if(this.transport.close(),this.pendingControlResponses.clear(),this.pendingMcpResponses.clear(),q)this.inputStream.error(q);else this.inputStream.done()}catch(_){}}next(...[q]){return this.sdkMessages.next(...[q])}return(q){return this.sdkMessages.return(q)}throw(q){return this.sdkMessages.throw(q)}[Symbol.asyncIterator](){return this.sdkMessages}[Symbol.asyncDispose](){return this.sdkMessages[Symbol.asyncDispose]()}async readMessages(){try{for await(let q of this.transport.readMessages()){if(q.type==="control_response"){let _=this.pendingControlResponses.get(q.response.request_id);if(_)_(q.response);continue}else if(q.type==="control_request"){this.handleControlRequest(q);continue}else if(q.type==="control_cancel_request"){this.handleControlCancelRequest(q);continue}this.inputStream.enqueue(q)}this.inputStream.done(),this.cleanup()}catch(q){this.inputStream.error(q),this.cleanup(q)}}async handleControlRequest(q){let _=new AbortController;this.cancelControllers.set(q.request_id,_);try{let j=await this.processControlRequest(q,_.signal),K={type:"control_response",response:{subtype:"success",request_id:q.request_id,response:j}};await Promise.resolve(this.transport.write(JSON.stringify(K)+` `))}catch(j){let K={type:"control_response",response:{subtype:"error",request_id:q.request_id,error:j.message||String(j)}};await Promise.resolve(this.transport.write(JSON.stringify(K)+` `))}finally{this.cancelControllers.delete(q.request_id)}}handleControlCancelRequest(q){let _=this.cancelControllers.get(q.request_id);if(_)_.abort(),this.cancelControllers.delete(q.request_id)}async processControlRequest(q,_){if(q.request.subtype==="can_use_tool"){if(!this.canUseTool)throw new Error("canUseTool callback is not provided.");return this.canUseTool(q.request.tool_name,q.request.input,{signal:_,suggestions:q.request.permission_suggestions})}else if(q.request.subtype==="hook_callback")return await this.handleHookCallbacks(q.request.callback_id,q.request.input,q.request.tool_use_id,_);else if(q.request.subtype==="mcp_message"){let j=q.request,K=this.sdkMcpTransports.get(j.server_name);if(!K)throw new Error(`SDK MCP server not found: ${j.server_name}`);if("method"in j.message&&"id"in j.message&&j.message.id!==null)return{mcp_response:await this.handleMcpControlRequest(j.server_name,j,K)};else{if(K.onmessage)K.onmessage(j.message);return{mcp_response:{jsonrpc:"2.0",result:{},id:0}}}}throw new Error("Unsupported control request subtype: "+q.request.subtype)}async*readSdkMessages(){for await(let q of this.inputStream)yield q}async initialize(){let q;if(this.hooks){q={};for(let[K,Y]of Object.entries(this.hooks))if(Y.length>0)q[K]=Y.map((f)=>{let P=[];for(let $ of f.hooks){let w=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(w,$),P.push(w)}return{matcher:f.matcher,hookCallbackIds:P}})}let _={subtype:"initialize",hooks:q};return(await this.request(_)).response}async interrupt(){if(!this.isStreamingMode)throw new Error("Interrupt requires --input-format stream-json");await this.request({subtype:"interrupt"})}async setPermissionMode(q){if(!this.isStreamingMode)throw new Error("setPermissionMode requires --input-format stream-json");await this.request({subtype:"set_permission_mode",mode:q})}request(q){let _=Math.random().toString(36).substring(2,15),j={request_id:_,type:"control_request",request:q};return new Promise((K,Y)=>{this.pendingControlResponses.set(_,(f)=>{if(f.subtype==="success")K(f);else Y(new Error(f.error))}),Promise.resolve(this.transport.write(JSON.stringify(j)+` `))})}async supportedCommands(){if(!this.isStreamingMode)throw new Error("supportedCommands requires --input-format stream-json");if(!this.intialization)throw new Error("supportedCommands requires transport with bidirectional communication");return(await this.intialization).commands}async streamInput(q){try{for await(let _ of q){if(this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(JSON.stringify(_)+` -`))}this.transport.endInput()}catch(_){if(!(_ instanceof L_))throw _}}handleHookCallbacks(q,_,j,K){let Y=this.hookCallbacks.get(q);if(!Y)throw new Error(`No hook callback found for ID: ${q}`);return Y(_,j,{signal:K})}sendMcpServerMessageToCli(q,_){if("id"in _&&_.id!==null&&_.id!==void 0){let j=`${q}:${_.id}`,K=this.pendingMcpResponses.get(j);if(K){K.resolve(_),this.pendingMcpResponses.delete(j);return}}throw new Error("No pending request found")}handleMcpControlRequest(q,_,j){let K="id"in _.message?_.message.id:null,Y=`${q}:${K}`;return new Promise((f,P)=>{let $=null,w=()=>{if($)clearTimeout($);this.pendingMcpResponses.delete(Y)},O=(z)=>{w(),f(z)},v=(z)=>{w(),P(z)};if(this.pendingMcpResponses.set(Y,{resolve:O,reject:v}),j.onmessage)j.onmessage(_.message);else{w(),P(new Error("No message handler registered"));return}$=setTimeout(()=>{if(this.pendingMcpResponses.has(Y))w(),P(new Error("Request timeout"))},30000)})}};k={};HO(k,{void:()=>xz,util:()=>h8,unknown:()=>Lz,union:()=>iz,undefined:()=>yz,tuple:()=>Bz,transformer:()=>g5,symbol:()=>gz,string:()=>U5,strictObject:()=>rz,setErrorMap:()=>Yz,set:()=>Fz,record:()=>tz,quotelessJson:()=>jz,promise:()=>Kv,preprocess:()=>Yv,pipeline:()=>fv,ostring:()=>$v,optional:()=>jv,onumber:()=>wv,oboolean:()=>Ov,objectUtil:()=>W4,object:()=>cz,number:()=>s5,nullable:()=>Pv,null:()=>dz,never:()=>lz,nativeEnum:()=>_v,nan:()=>Rz,map:()=>ez,makeIssue:()=>l3,literal:()=>Qz,lazy:()=>sz,late:()=>Sz,isValid:()=>$_,isDirty:()=>J4,isAsync:()=>IK,isAborted:()=>H4,intersection:()=>az,instanceof:()=>Ez,getParsedType:()=>mq,getErrorMap:()=>L3,function:()=>Uz,enum:()=>qv,effect:()=>g5,discriminatedUnion:()=>oz,defaultErrorMap:()=>n_,datetimeRegex:()=>t5,date:()=>Iz,custom:()=>F5,coerce:()=>zv,boolean:()=>Q5,bigint:()=>mz,array:()=>nz,any:()=>pz,addIssueToContext:()=>F,ZodVoid:()=>yK,ZodUnknown:()=>aq,ZodUnion:()=>o_,ZodUndefined:()=>r_,ZodType:()=>k8,ZodTuple:()=>Aq,ZodTransformer:()=>B6,ZodSymbol:()=>gK,ZodString:()=>Yq,ZodSet:()=>z_,ZodSchema:()=>k8,ZodRecord:()=>dK,ZodReadonly:()=>s_,ZodPromise:()=>v_,ZodPipeline:()=>lK,ZodParsedType:()=>s,ZodOptional:()=>$q,ZodObject:()=>i8,ZodNumber:()=>Bq,ZodNullable:()=>Iq,ZodNull:()=>i_,ZodNever:()=>Xq,ZodNativeEnum:()=>e_,ZodNaN:()=>LK,ZodMap:()=>pK,ZodLiteral:()=>t_,ZodLazy:()=>B_,ZodIssueCode:()=>t,ZodIntersection:()=>a_,ZodFunction:()=>x_,ZodFirstPartyTypeKind:()=>W8,ZodError:()=>y6,ZodEnum:()=>eq,ZodEffects:()=>B6,ZodDiscriminatedUnion:()=>x3,ZodDefault:()=>F_,ZodDate:()=>w_,ZodCatch:()=>U_,ZodBranded:()=>n3,ZodBoolean:()=>c_,ZodBigInt:()=>tq,ZodArray:()=>fq,ZodAny:()=>O_,Schema:()=>k8,ParseStatus:()=>k6,OK:()=>D6,NEVER:()=>vv,INVALID:()=>v8,EMPTY_PATH:()=>fz,DIRTY:()=>l_,BRAND:()=>bz});(function(q){q.assertEqual=(Y)=>{};function _(Y){}q.assertIs=_;function j(Y){throw new Error}q.assertNever=j,q.arrayToEnum=(Y)=>{let f={};for(let P of Y)f[P]=P;return f},q.getValidEnumValues=(Y)=>{let f=q.objectKeys(Y).filter(($)=>typeof Y[Y[$]]!=="number"),P={};for(let $ of f)P[$]=Y[$];return q.objectValues(P)},q.objectValues=(Y)=>{return q.objectKeys(Y).map(function(f){return Y[f]})},q.objectKeys=typeof Object.keys==="function"?(Y)=>Object.keys(Y):(Y)=>{let f=[];for(let P in Y)if(Object.prototype.hasOwnProperty.call(Y,P))f.push(P);return f},q.find=(Y,f)=>{for(let P of Y)if(f(P))return P;return},q.isInteger=typeof Number.isInteger==="function"?(Y)=>Number.isInteger(Y):(Y)=>typeof Y==="number"&&Number.isFinite(Y)&&Math.floor(Y)===Y;function K(Y,f=" | "){return Y.map((P)=>typeof P==="string"?`'${P}'`:P).join(f)}q.joinValues=K,q.jsonStringifyReplacer=(Y,f)=>{if(typeof f==="bigint")return f.toString();return f}})(h8||(h8={}));(function(q){q.mergeShapes=(_,j)=>{return{..._,...j}}})(W4||(W4={}));s=h8.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),t=h8.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);y6=class y6 extends Error{get errors(){return this.issues}constructor(q){super();this.issues=[],this.addIssue=(j)=>{this.issues=[...this.issues,j]},this.addIssues=(j=[])=>{this.issues=[...this.issues,...j]};let _=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,_);else this.__proto__=_;this.name="ZodError",this.issues=q}format(q){let _=q||function(Y){return Y.message},j={_errors:[]},K=(Y)=>{for(let f of Y.issues)if(f.code==="invalid_union")f.unionErrors.map(K);else if(f.code==="invalid_return_type")K(f.returnTypeError);else if(f.code==="invalid_arguments")K(f.argumentsError);else if(f.path.length===0)j._errors.push(_(f));else{let P=j,$=0;while($_.message){let _={},j=[];for(let K of this.issues)if(K.path.length>0){let Y=K.path[0];_[Y]=_[Y]||[],_[Y].push(q(K))}else j.push(q(K));return{formErrors:j,fieldErrors:_}}get formErrors(){return this.flatten()}};y6.create=(q)=>{return new y6(q)};n_=Pz,o5=n_;fz=[];v8=Object.freeze({status:"aborted"});(function(q){q.errToObj=(_)=>typeof _==="string"?{message:_}:_||{},q.toString=(_)=>typeof _==="string"?_:_?.message})(f8||(f8={}));$z=/^c[^\s-]{8,}$/i,wz=/^[0-9a-z]+$/,Oz=/^[0-9A-HJKMNP-TV-Z]{26}$/i,zz=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,vz=/^[a-z0-9_-]{21}$/i,Wz=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Hz=/^[-+]?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)?)??$/,Jz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Zz=/^(?:(?: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])$/,kz=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Xz=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Az=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Gz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,uz=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,hz=new RegExp(`^${a5}$`);Yq=class Yq extends k8{_parse(q){if(this._def.coerce)q.data=String(q.data);if(this._getType(q)!==s.string){let Y=this._getOrReturnCtx(q);return F(Y,{code:t.invalid_type,expected:s.string,received:Y.parsedType}),v8}let j=new k6,K=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(q.data.lengthY.value)K=this._getOrReturnCtx(q,K),F(K,{code:t.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),j.dirty()}else if(Y.kind==="length"){let f=q.data.length>Y.value,P=q.data.lengthq.test(K),{validation:_,code:t.invalid_string,...f8.errToObj(j)})}_addCheck(q){return new Yq({...this._def,checks:[...this._def.checks,q]})}email(q){return this._addCheck({kind:"email",...f8.errToObj(q)})}url(q){return this._addCheck({kind:"url",...f8.errToObj(q)})}emoji(q){return this._addCheck({kind:"emoji",...f8.errToObj(q)})}uuid(q){return this._addCheck({kind:"uuid",...f8.errToObj(q)})}nanoid(q){return this._addCheck({kind:"nanoid",...f8.errToObj(q)})}cuid(q){return this._addCheck({kind:"cuid",...f8.errToObj(q)})}cuid2(q){return this._addCheck({kind:"cuid2",...f8.errToObj(q)})}ulid(q){return this._addCheck({kind:"ulid",...f8.errToObj(q)})}base64(q){return this._addCheck({kind:"base64",...f8.errToObj(q)})}base64url(q){return this._addCheck({kind:"base64url",...f8.errToObj(q)})}jwt(q){return this._addCheck({kind:"jwt",...f8.errToObj(q)})}ip(q){return this._addCheck({kind:"ip",...f8.errToObj(q)})}cidr(q){return this._addCheck({kind:"cidr",...f8.errToObj(q)})}datetime(q){if(typeof q==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:q});return this._addCheck({kind:"datetime",precision:typeof q?.precision==="undefined"?null:q?.precision,offset:q?.offset??!1,local:q?.local??!1,...f8.errToObj(q?.message)})}date(q){return this._addCheck({kind:"date",message:q})}time(q){if(typeof q==="string")return this._addCheck({kind:"time",precision:null,message:q});return this._addCheck({kind:"time",precision:typeof q?.precision==="undefined"?null:q?.precision,...f8.errToObj(q?.message)})}duration(q){return this._addCheck({kind:"duration",...f8.errToObj(q)})}regex(q,_){return this._addCheck({kind:"regex",regex:q,...f8.errToObj(_)})}includes(q,_){return this._addCheck({kind:"includes",value:q,position:_?.position,...f8.errToObj(_?.message)})}startsWith(q,_){return this._addCheck({kind:"startsWith",value:q,...f8.errToObj(_)})}endsWith(q,_){return this._addCheck({kind:"endsWith",value:q,...f8.errToObj(_)})}min(q,_){return this._addCheck({kind:"min",value:q,...f8.errToObj(_)})}max(q,_){return this._addCheck({kind:"max",value:q,...f8.errToObj(_)})}length(q,_){return this._addCheck({kind:"length",value:q,...f8.errToObj(_)})}nonempty(q){return this.min(1,f8.errToObj(q))}trim(){return new Yq({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Yq({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Yq({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((q)=>q.kind==="datetime")}get isDate(){return!!this._def.checks.find((q)=>q.kind==="date")}get isTime(){return!!this._def.checks.find((q)=>q.kind==="time")}get isDuration(){return!!this._def.checks.find((q)=>q.kind==="duration")}get isEmail(){return!!this._def.checks.find((q)=>q.kind==="email")}get isURL(){return!!this._def.checks.find((q)=>q.kind==="url")}get isEmoji(){return!!this._def.checks.find((q)=>q.kind==="emoji")}get isUUID(){return!!this._def.checks.find((q)=>q.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((q)=>q.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((q)=>q.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((q)=>q.kind==="cuid2")}get isULID(){return!!this._def.checks.find((q)=>q.kind==="ulid")}get isIP(){return!!this._def.checks.find((q)=>q.kind==="ip")}get isCIDR(){return!!this._def.checks.find((q)=>q.kind==="cidr")}get isBase64(){return!!this._def.checks.find((q)=>q.kind==="base64")}get isBase64url(){return!!this._def.checks.find((q)=>q.kind==="base64url")}get minLength(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxLength(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value{return new Yq({checks:[],typeName:W8.ZodString,coerce:q?.coerce??!1,...Z8(q)})};Bq=class Bq extends k8{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(q){if(this._def.coerce)q.data=Number(q.data);if(this._getType(q)!==s.number){let Y=this._getOrReturnCtx(q);return F(Y,{code:t.invalid_type,expected:s.number,received:Y.parsedType}),v8}let j=void 0,K=new k6;for(let Y of this._def.checks)if(Y.kind==="int"){if(!h8.isInteger(q.data))j=this._getOrReturnCtx(q,j),F(j,{code:t.invalid_type,expected:"integer",received:"float",message:Y.message}),K.dirty()}else if(Y.kind==="min"){if(Y.inclusive?q.dataY.value:q.data>=Y.value)j=this._getOrReturnCtx(q,j),F(j,{code:t.too_big,maximum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),K.dirty()}else if(Y.kind==="multipleOf"){if(Nz(q.data,Y.value)!==0)j=this._getOrReturnCtx(q,j),F(j,{code:t.not_multiple_of,multipleOf:Y.value,message:Y.message}),K.dirty()}else if(Y.kind==="finite"){if(!Number.isFinite(q.data))j=this._getOrReturnCtx(q,j),F(j,{code:t.not_finite,message:Y.message}),K.dirty()}else h8.assertNever(Y);return{status:K.value,value:q.data}}gte(q,_){return this.setLimit("min",q,!0,f8.toString(_))}gt(q,_){return this.setLimit("min",q,!1,f8.toString(_))}lte(q,_){return this.setLimit("max",q,!0,f8.toString(_))}lt(q,_){return this.setLimit("max",q,!1,f8.toString(_))}setLimit(q,_,j,K){return new Bq({...this._def,checks:[...this._def.checks,{kind:q,value:_,inclusive:j,message:f8.toString(K)}]})}_addCheck(q){return new Bq({...this._def,checks:[...this._def.checks,q]})}int(q){return this._addCheck({kind:"int",message:f8.toString(q)})}positive(q){return this._addCheck({kind:"min",value:0,inclusive:!1,message:f8.toString(q)})}negative(q){return this._addCheck({kind:"max",value:0,inclusive:!1,message:f8.toString(q)})}nonpositive(q){return this._addCheck({kind:"max",value:0,inclusive:!0,message:f8.toString(q)})}nonnegative(q){return this._addCheck({kind:"min",value:0,inclusive:!0,message:f8.toString(q)})}multipleOf(q,_){return this._addCheck({kind:"multipleOf",value:q,message:f8.toString(_)})}finite(q){return this._addCheck({kind:"finite",message:f8.toString(q)})}safe(q){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:f8.toString(q)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:f8.toString(q)})}get minValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.valueq.kind==="int"||q.kind==="multipleOf"&&h8.isInteger(q.value))}get isFinite(){let q=null,_=null;for(let j of this._def.checks)if(j.kind==="finite"||j.kind==="int"||j.kind==="multipleOf")return!0;else if(j.kind==="min"){if(_===null||j.value>_)_=j.value}else if(j.kind==="max"){if(q===null||j.value{return new Bq({checks:[],typeName:W8.ZodNumber,coerce:q?.coerce||!1,...Z8(q)})};tq=class tq extends k8{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(q){if(this._def.coerce)try{q.data=BigInt(q.data)}catch{return this._getInvalidInput(q)}if(this._getType(q)!==s.bigint)return this._getInvalidInput(q);let j=void 0,K=new k6;for(let Y of this._def.checks)if(Y.kind==="min"){if(Y.inclusive?q.dataY.value:q.data>=Y.value)j=this._getOrReturnCtx(q,j),F(j,{code:t.too_big,type:"bigint",maximum:Y.value,inclusive:Y.inclusive,message:Y.message}),K.dirty()}else if(Y.kind==="multipleOf"){if(q.data%Y.value!==BigInt(0))j=this._getOrReturnCtx(q,j),F(j,{code:t.not_multiple_of,multipleOf:Y.value,message:Y.message}),K.dirty()}else h8.assertNever(Y);return{status:K.value,value:q.data}}_getInvalidInput(q){let _=this._getOrReturnCtx(q);return F(_,{code:t.invalid_type,expected:s.bigint,received:_.parsedType}),v8}gte(q,_){return this.setLimit("min",q,!0,f8.toString(_))}gt(q,_){return this.setLimit("min",q,!1,f8.toString(_))}lte(q,_){return this.setLimit("max",q,!0,f8.toString(_))}lt(q,_){return this.setLimit("max",q,!1,f8.toString(_))}setLimit(q,_,j,K){return new tq({...this._def,checks:[...this._def.checks,{kind:q,value:_,inclusive:j,message:f8.toString(K)}]})}_addCheck(q){return new tq({...this._def,checks:[...this._def.checks,q]})}positive(q){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:f8.toString(q)})}negative(q){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:f8.toString(q)})}nonpositive(q){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:f8.toString(q)})}nonnegative(q){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:f8.toString(q)})}multipleOf(q,_){return this._addCheck({kind:"multipleOf",value:q,message:f8.toString(_)})}get minValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value{return new tq({checks:[],typeName:W8.ZodBigInt,coerce:q?.coerce??!1,...Z8(q)})};c_=class c_ extends k8{_parse(q){if(this._def.coerce)q.data=Boolean(q.data);if(this._getType(q)!==s.boolean){let j=this._getOrReturnCtx(q);return F(j,{code:t.invalid_type,expected:s.boolean,received:j.parsedType}),v8}return D6(q.data)}};c_.create=(q)=>{return new c_({typeName:W8.ZodBoolean,coerce:q?.coerce||!1,...Z8(q)})};w_=class w_ extends k8{_parse(q){if(this._def.coerce)q.data=new Date(q.data);if(this._getType(q)!==s.date){let Y=this._getOrReturnCtx(q);return F(Y,{code:t.invalid_type,expected:s.date,received:Y.parsedType}),v8}if(Number.isNaN(q.data.getTime())){let Y=this._getOrReturnCtx(q);return F(Y,{code:t.invalid_date}),v8}let j=new k6,K=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(q.data.getTime()Y.value)K=this._getOrReturnCtx(q,K),F(K,{code:t.too_big,message:Y.message,inclusive:!0,exact:!1,maximum:Y.value,type:"date"}),j.dirty()}else h8.assertNever(Y);return{status:j.value,value:new Date(q.data.getTime())}}_addCheck(q){return new w_({...this._def,checks:[...this._def.checks,q]})}min(q,_){return this._addCheck({kind:"min",value:q.getTime(),message:f8.toString(_)})}max(q,_){return this._addCheck({kind:"max",value:q.getTime(),message:f8.toString(_)})}get minDate(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q!=null?new Date(q):null}get maxDate(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value{return new w_({checks:[],coerce:q?.coerce||!1,typeName:W8.ZodDate,...Z8(q)})};gK=class gK extends k8{_parse(q){if(this._getType(q)!==s.symbol){let j=this._getOrReturnCtx(q);return F(j,{code:t.invalid_type,expected:s.symbol,received:j.parsedType}),v8}return D6(q.data)}};gK.create=(q)=>{return new gK({typeName:W8.ZodSymbol,...Z8(q)})};r_=class r_ extends k8{_parse(q){if(this._getType(q)!==s.undefined){let j=this._getOrReturnCtx(q);return F(j,{code:t.invalid_type,expected:s.undefined,received:j.parsedType}),v8}return D6(q.data)}};r_.create=(q)=>{return new r_({typeName:W8.ZodUndefined,...Z8(q)})};i_=class i_ extends k8{_parse(q){if(this._getType(q)!==s.null){let j=this._getOrReturnCtx(q);return F(j,{code:t.invalid_type,expected:s.null,received:j.parsedType}),v8}return D6(q.data)}};i_.create=(q)=>{return new i_({typeName:W8.ZodNull,...Z8(q)})};O_=class O_ extends k8{constructor(){super(...arguments);this._any=!0}_parse(q){return D6(q.data)}};O_.create=(q)=>{return new O_({typeName:W8.ZodAny,...Z8(q)})};aq=class aq extends k8{constructor(){super(...arguments);this._unknown=!0}_parse(q){return D6(q.data)}};aq.create=(q)=>{return new aq({typeName:W8.ZodUnknown,...Z8(q)})};Xq=class Xq extends k8{_parse(q){let _=this._getOrReturnCtx(q);return F(_,{code:t.invalid_type,expected:s.never,received:_.parsedType}),v8}};Xq.create=(q)=>{return new Xq({typeName:W8.ZodNever,...Z8(q)})};yK=class yK extends k8{_parse(q){if(this._getType(q)!==s.undefined){let j=this._getOrReturnCtx(q);return F(j,{code:t.invalid_type,expected:s.void,received:j.parsedType}),v8}return D6(q.data)}};yK.create=(q)=>{return new yK({typeName:W8.ZodVoid,...Z8(q)})};fq=class fq extends k8{_parse(q){let{ctx:_,status:j}=this._processInputParams(q),K=this._def;if(_.parsedType!==s.array)return F(_,{code:t.invalid_type,expected:s.array,received:_.parsedType}),v8;if(K.exactLength!==null){let f=_.data.length>K.exactLength.value,P=_.data.lengthK.maxLength.value)F(_,{code:t.too_big,maximum:K.maxLength.value,type:"array",inclusive:!0,exact:!1,message:K.maxLength.message}),j.dirty()}if(_.common.async)return Promise.all([..._.data].map((f,P)=>{return K.type._parseAsync(new wq(_,f,_.path,P))})).then((f)=>{return k6.mergeArray(j,f)});let Y=[..._.data].map((f,P)=>{return K.type._parseSync(new wq(_,f,_.path,P))});return k6.mergeArray(j,Y)}get element(){return this._def.type}min(q,_){return new fq({...this._def,minLength:{value:q,message:f8.toString(_)}})}max(q,_){return new fq({...this._def,maxLength:{value:q,message:f8.toString(_)}})}length(q,_){return new fq({...this._def,exactLength:{value:q,message:f8.toString(_)}})}nonempty(q){return this.min(1,q)}};fq.create=(q,_)=>{return new fq({type:q,minLength:null,maxLength:null,exactLength:null,typeName:W8.ZodArray,...Z8(_)})};i8=class i8 extends k8{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let q=this._def.shape(),_=h8.objectKeys(q);return this._cached={shape:q,keys:_},this._cached}_parse(q){if(this._getType(q)!==s.object){let w=this._getOrReturnCtx(q);return F(w,{code:t.invalid_type,expected:s.object,received:w.parsedType}),v8}let{status:j,ctx:K}=this._processInputParams(q),{shape:Y,keys:f}=this._getCached(),P=[];if(!(this._def.catchall instanceof Xq&&this._def.unknownKeys==="strip")){for(let w in K.data)if(!f.includes(w))P.push(w)}let $=[];for(let w of f){let O=Y[w],v=K.data[w];$.push({key:{status:"valid",value:w},value:O._parse(new wq(K,v,K.path,w)),alwaysSet:w in K.data})}if(this._def.catchall instanceof Xq){let w=this._def.unknownKeys;if(w==="passthrough")for(let O of P)$.push({key:{status:"valid",value:O},value:{status:"valid",value:K.data[O]}});else if(w==="strict"){if(P.length>0)F(K,{code:t.unrecognized_keys,keys:P}),j.dirty()}else if(w==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let w=this._def.catchall;for(let O of P){let v=K.data[O];$.push({key:{status:"valid",value:O},value:w._parse(new wq(K,v,K.path,O)),alwaysSet:O in K.data})}}if(K.common.async)return Promise.resolve().then(async()=>{let w=[];for(let O of $){let v=await O.key,z=await O.value;w.push({key:v,value:z,alwaysSet:O.alwaysSet})}return w}).then((w)=>{return k6.mergeObjectSync(j,w)});else return k6.mergeObjectSync(j,$)}get shape(){return this._def.shape()}strict(q){return f8.errToObj,new i8({...this._def,unknownKeys:"strict",...q!==void 0?{errorMap:(_,j)=>{let K=this._def.errorMap?.(_,j).message??j.defaultError;if(_.code==="unrecognized_keys")return{message:f8.errToObj(q).message??K};return{message:K}}}:{}})}strip(){return new i8({...this._def,unknownKeys:"strip"})}passthrough(){return new i8({...this._def,unknownKeys:"passthrough"})}extend(q){return new i8({...this._def,shape:()=>({...this._def.shape(),...q})})}merge(q){return new i8({unknownKeys:q._def.unknownKeys,catchall:q._def.catchall,shape:()=>({...this._def.shape(),...q._def.shape()}),typeName:W8.ZodObject})}setKey(q,_){return this.augment({[q]:_})}catchall(q){return new i8({...this._def,catchall:q})}pick(q){let _={};for(let j of h8.objectKeys(q))if(q[j]&&this.shape[j])_[j]=this.shape[j];return new i8({...this._def,shape:()=>_})}omit(q){let _={};for(let j of h8.objectKeys(this.shape))if(!q[j])_[j]=this.shape[j];return new i8({...this._def,shape:()=>_})}deepPartial(){return p_(this)}partial(q){let _={};for(let j of h8.objectKeys(this.shape)){let K=this.shape[j];if(q&&!q[j])_[j]=K;else _[j]=K.optional()}return new i8({...this._def,shape:()=>_})}required(q){let _={};for(let j of h8.objectKeys(this.shape))if(q&&!q[j])_[j]=this.shape[j];else{let Y=this.shape[j];while(Y instanceof $q)Y=Y._def.innerType;_[j]=Y}return new i8({...this._def,shape:()=>_})}keyof(){return e5(h8.objectKeys(this.shape))}};i8.create=(q,_)=>{return new i8({shape:()=>q,unknownKeys:"strip",catchall:Xq.create(),typeName:W8.ZodObject,...Z8(_)})};i8.strictCreate=(q,_)=>{return new i8({shape:()=>q,unknownKeys:"strict",catchall:Xq.create(),typeName:W8.ZodObject,...Z8(_)})};i8.lazycreate=(q,_)=>{return new i8({shape:q,unknownKeys:"strip",catchall:Xq.create(),typeName:W8.ZodObject,...Z8(_)})};o_=class o_ extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=this._def.options;function K(Y){for(let P of Y)if(P.result.status==="valid")return P.result;for(let P of Y)if(P.result.status==="dirty")return _.common.issues.push(...P.ctx.common.issues),P.result;let f=Y.map((P)=>new y6(P.ctx.common.issues));return F(_,{code:t.invalid_union,unionErrors:f}),v8}if(_.common.async)return Promise.all(j.map(async(Y)=>{let f={..._,common:{..._.common,issues:[]},parent:null};return{result:await Y._parseAsync({data:_.data,path:_.path,parent:f}),ctx:f}})).then(K);else{let Y=void 0,f=[];for(let $ of j){let w={..._,common:{..._.common,issues:[]},parent:null},O=$._parseSync({data:_.data,path:_.path,parent:w});if(O.status==="valid")return O;else if(O.status==="dirty"&&!Y)Y={result:O,ctx:w};if(w.common.issues.length)f.push(w.common.issues)}if(Y)return _.common.issues.push(...Y.ctx.common.issues),Y.result;let P=f.map(($)=>new y6($));return F(_,{code:t.invalid_union,unionErrors:P}),v8}}get options(){return this._def.options}};o_.create=(q,_)=>{return new o_({options:q,typeName:W8.ZodUnion,...Z8(_)})};x3=class x3 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==s.object)return F(_,{code:t.invalid_type,expected:s.object,received:_.parsedType}),v8;let j=this.discriminator,K=_.data[j],Y=this.optionsMap.get(K);if(!Y)return F(_,{code:t.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[j]}),v8;if(_.common.async)return Y._parseAsync({data:_.data,path:_.path,parent:_});else return Y._parseSync({data:_.data,path:_.path,parent:_})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(q,_,j){let K=new Map;for(let Y of _){let f=Rq(Y.shape[q]);if(!f.length)throw new Error(`A discriminator value for key \`${q}\` could not be extracted from all schema options`);for(let P of f){if(K.has(P))throw new Error(`Discriminator property ${String(q)} has duplicate value ${String(P)}`);K.set(P,Y)}}return new x3({typeName:W8.ZodDiscriminatedUnion,discriminator:q,options:_,optionsMap:K,...Z8(j)})}};a_=class a_ extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q),K=(Y,f)=>{if(H4(Y)||H4(f))return v8;let P=T4(Y.value,f.value);if(!P.valid)return F(j,{code:t.invalid_intersection_types}),v8;if(J4(Y)||J4(f))_.dirty();return{status:_.value,value:P.data}};if(j.common.async)return Promise.all([this._def.left._parseAsync({data:j.data,path:j.path,parent:j}),this._def.right._parseAsync({data:j.data,path:j.path,parent:j})]).then(([Y,f])=>K(Y,f));else return K(this._def.left._parseSync({data:j.data,path:j.path,parent:j}),this._def.right._parseSync({data:j.data,path:j.path,parent:j}))}};a_.create=(q,_,j)=>{return new a_({left:q,right:_,typeName:W8.ZodIntersection,...Z8(j)})};Aq=class Aq extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==s.array)return F(j,{code:t.invalid_type,expected:s.array,received:j.parsedType}),v8;if(j.data.lengththis._def.items.length)F(j,{code:t.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_.dirty();let Y=[...j.data].map((f,P)=>{let $=this._def.items[P]||this._def.rest;if(!$)return null;return $._parse(new wq(j,f,j.path,P))}).filter((f)=>!!f);if(j.common.async)return Promise.all(Y).then((f)=>{return k6.mergeArray(_,f)});else return k6.mergeArray(_,Y)}get items(){return this._def.items}rest(q){return new Aq({...this._def,rest:q})}};Aq.create=(q,_)=>{if(!Array.isArray(q))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Aq({items:q,typeName:W8.ZodTuple,rest:null,...Z8(_)})};dK=class dK extends k8{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==s.object)return F(j,{code:t.invalid_type,expected:s.object,received:j.parsedType}),v8;let K=[],Y=this._def.keyType,f=this._def.valueType;for(let P in j.data)K.push({key:Y._parse(new wq(j,P,j.path,P)),value:f._parse(new wq(j,j.data[P],j.path,P)),alwaysSet:P in j.data});if(j.common.async)return k6.mergeObjectAsync(_,K);else return k6.mergeObjectSync(_,K)}get element(){return this._def.valueType}static create(q,_,j){if(_ instanceof k8)return new dK({keyType:q,valueType:_,typeName:W8.ZodRecord,...Z8(j)});return new dK({keyType:Yq.create(),valueType:q,typeName:W8.ZodRecord,...Z8(_)})}};pK=class pK extends k8{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==s.map)return F(j,{code:t.invalid_type,expected:s.map,received:j.parsedType}),v8;let K=this._def.keyType,Y=this._def.valueType,f=[...j.data.entries()].map(([P,$],w)=>{return{key:K._parse(new wq(j,P,j.path,[w,"key"])),value:Y._parse(new wq(j,$,j.path,[w,"value"]))}});if(j.common.async){let P=new Map;return Promise.resolve().then(async()=>{for(let $ of f){let w=await $.key,O=await $.value;if(w.status==="aborted"||O.status==="aborted")return v8;if(w.status==="dirty"||O.status==="dirty")_.dirty();P.set(w.value,O.value)}return{status:_.value,value:P}})}else{let P=new Map;for(let $ of f){let{key:w,value:O}=$;if(w.status==="aborted"||O.status==="aborted")return v8;if(w.status==="dirty"||O.status==="dirty")_.dirty();P.set(w.value,O.value)}return{status:_.value,value:P}}}};pK.create=(q,_,j)=>{return new pK({valueType:_,keyType:q,typeName:W8.ZodMap,...Z8(j)})};z_=class z_ extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==s.set)return F(j,{code:t.invalid_type,expected:s.set,received:j.parsedType}),v8;let K=this._def;if(K.minSize!==null){if(j.data.sizeK.maxSize.value)F(j,{code:t.too_big,maximum:K.maxSize.value,type:"set",inclusive:!0,exact:!1,message:K.maxSize.message}),_.dirty()}let Y=this._def.valueType;function f($){let w=new Set;for(let O of $){if(O.status==="aborted")return v8;if(O.status==="dirty")_.dirty();w.add(O.value)}return{status:_.value,value:w}}let P=[...j.data.values()].map(($,w)=>Y._parse(new wq(j,$,j.path,w)));if(j.common.async)return Promise.all(P).then(($)=>f($));else return f(P)}min(q,_){return new z_({...this._def,minSize:{value:q,message:f8.toString(_)}})}max(q,_){return new z_({...this._def,maxSize:{value:q,message:f8.toString(_)}})}size(q,_){return this.min(q,_).max(q,_)}nonempty(q){return this.min(1,q)}};z_.create=(q,_)=>{return new z_({valueType:q,minSize:null,maxSize:null,typeName:W8.ZodSet,...Z8(_)})};x_=class x_ extends k8{constructor(){super(...arguments);this.validate=this.implement}_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==s.function)return F(_,{code:t.invalid_type,expected:s.function,received:_.parsedType}),v8;function j(P,$){return l3({data:P,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,L3(),n_].filter((w)=>!!w),issueData:{code:t.invalid_arguments,argumentsError:$}})}function K(P,$){return l3({data:P,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,L3(),n_].filter((w)=>!!w),issueData:{code:t.invalid_return_type,returnTypeError:$}})}let Y={errorMap:_.common.contextualErrorMap},f=_.data;if(this._def.returns instanceof v_){let P=this;return D6(async function(...$){let w=new y6([]),O=await P._def.args.parseAsync($,Y).catch((W)=>{throw w.addIssue(j($,W)),w}),v=await Reflect.apply(f,this,O);return await P._def.returns._def.type.parseAsync(v,Y).catch((W)=>{throw w.addIssue(K(v,W)),w})})}else{let P=this;return D6(function(...$){let w=P._def.args.safeParse($,Y);if(!w.success)throw new y6([j($,w.error)]);let O=Reflect.apply(f,this,w.data),v=P._def.returns.safeParse(O,Y);if(!v.success)throw new y6([K(O,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...q){return new x_({...this._def,args:Aq.create(q).rest(aq.create())})}returns(q){return new x_({...this._def,returns:q})}implement(q){return this.parse(q)}strictImplement(q){return this.parse(q)}static create(q,_,j){return new x_({args:q?q:Aq.create([]).rest(aq.create()),returns:_||aq.create(),typeName:W8.ZodFunction,...Z8(j)})}};B_=class B_ extends k8{get schema(){return this._def.getter()}_parse(q){let{ctx:_}=this._processInputParams(q);return this._def.getter()._parse({data:_.data,path:_.path,parent:_})}};B_.create=(q,_)=>{return new B_({getter:q,typeName:W8.ZodLazy,...Z8(_)})};t_=class t_ extends k8{_parse(q){if(q.data!==this._def.value){let _=this._getOrReturnCtx(q);return F(_,{received:_.data,code:t.invalid_literal,expected:this._def.value}),v8}return{status:"valid",value:q.data}}get value(){return this._def.value}};t_.create=(q,_)=>{return new t_({value:q,typeName:W8.ZodLiteral,...Z8(_)})};eq=class eq extends k8{_parse(q){if(typeof q.data!=="string"){let _=this._getOrReturnCtx(q),j=this._def.values;return F(_,{expected:h8.joinValues(j),received:_.parsedType,code:t.invalid_type}),v8}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(q.data)){let _=this._getOrReturnCtx(q),j=this._def.values;return F(_,{received:_.data,code:t.invalid_enum_value,options:j}),v8}return D6(q.data)}get options(){return this._def.values}get enum(){let q={};for(let _ of this._def.values)q[_]=_;return q}get Values(){let q={};for(let _ of this._def.values)q[_]=_;return q}get Enum(){let q={};for(let _ of this._def.values)q[_]=_;return q}extract(q,_=this._def){return eq.create(q,{...this._def,..._})}exclude(q,_=this._def){return eq.create(this.options.filter((j)=>!q.includes(j)),{...this._def,..._})}};eq.create=e5;e_=class e_ extends k8{_parse(q){let _=h8.getValidEnumValues(this._def.values),j=this._getOrReturnCtx(q);if(j.parsedType!==s.string&&j.parsedType!==s.number){let K=h8.objectValues(_);return F(j,{expected:h8.joinValues(K),received:j.parsedType,code:t.invalid_type}),v8}if(!this._cache)this._cache=new Set(h8.getValidEnumValues(this._def.values));if(!this._cache.has(q.data)){let K=h8.objectValues(_);return F(j,{received:j.data,code:t.invalid_enum_value,options:K}),v8}return D6(q.data)}get enum(){return this._def.values}};e_.create=(q,_)=>{return new e_({values:q,typeName:W8.ZodNativeEnum,...Z8(_)})};v_=class v_ extends k8{unwrap(){return this._def.type}_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==s.promise&&_.common.async===!1)return F(_,{code:t.invalid_type,expected:s.promise,received:_.parsedType}),v8;let j=_.parsedType===s.promise?_.data:Promise.resolve(_.data);return D6(j.then((K)=>{return this._def.type.parseAsync(K,{path:_.path,errorMap:_.common.contextualErrorMap})}))}};v_.create=(q,_)=>{return new v_({type:q,typeName:W8.ZodPromise,...Z8(_)})};B6=class B6 extends k8{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===W8.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(q){let{status:_,ctx:j}=this._processInputParams(q),K=this._def.effect||null,Y={addIssue:(f)=>{if(F(j,f),f.fatal)_.abort();else _.dirty()},get path(){return j.path}};if(Y.addIssue=Y.addIssue.bind(Y),K.type==="preprocess"){let f=K.transform(j.data,Y);if(j.common.async)return Promise.resolve(f).then(async(P)=>{if(_.value==="aborted")return v8;let $=await this._def.schema._parseAsync({data:P,path:j.path,parent:j});if($.status==="aborted")return v8;if($.status==="dirty")return l_($.value);if(_.value==="dirty")return l_($.value);return $});else{if(_.value==="aborted")return v8;let P=this._def.schema._parseSync({data:f,path:j.path,parent:j});if(P.status==="aborted")return v8;if(P.status==="dirty")return l_(P.value);if(_.value==="dirty")return l_(P.value);return P}}if(K.type==="refinement"){let f=(P)=>{let $=K.refinement(P,Y);if(j.common.async)return Promise.resolve($);if($ instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return P};if(j.common.async===!1){let P=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});if(P.status==="aborted")return v8;if(P.status==="dirty")_.dirty();return f(P.value),{status:_.value,value:P.value}}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then((P)=>{if(P.status==="aborted")return v8;if(P.status==="dirty")_.dirty();return f(P.value).then(()=>{return{status:_.value,value:P.value}})})}if(K.type==="transform")if(j.common.async===!1){let f=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});if(!$_(f))return v8;let P=K.transform(f.value,Y);if(P instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:_.value,value:P}}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then((f)=>{if(!$_(f))return v8;return Promise.resolve(K.transform(f.value,Y)).then((P)=>({status:_.value,value:P}))});h8.assertNever(K)}};B6.create=(q,_,j)=>{return new B6({schema:q,typeName:W8.ZodEffects,effect:_,...Z8(j)})};B6.createWithPreprocess=(q,_,j)=>{return new B6({schema:_,effect:{type:"preprocess",transform:q},typeName:W8.ZodEffects,...Z8(j)})};$q=class $q extends k8{_parse(q){if(this._getType(q)===s.undefined)return D6(void 0);return this._def.innerType._parse(q)}unwrap(){return this._def.innerType}};$q.create=(q,_)=>{return new $q({innerType:q,typeName:W8.ZodOptional,...Z8(_)})};Iq=class Iq extends k8{_parse(q){if(this._getType(q)===s.null)return D6(null);return this._def.innerType._parse(q)}unwrap(){return this._def.innerType}};Iq.create=(q,_)=>{return new Iq({innerType:q,typeName:W8.ZodNullable,...Z8(_)})};F_=class F_ extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;if(_.parsedType===s.undefined)j=this._def.defaultValue();return this._def.innerType._parse({data:j,path:_.path,parent:_})}removeDefault(){return this._def.innerType}};F_.create=(q,_)=>{return new F_({innerType:q,typeName:W8.ZodDefault,defaultValue:typeof _.default==="function"?_.default:()=>_.default,...Z8(_)})};U_=class U_ extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j={..._,common:{..._.common,issues:[]}},K=this._def.innerType._parse({data:j.data,path:j.path,parent:{...j}});if(IK(K))return K.then((Y)=>{return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new y6(j.common.issues)},input:j.data})}});else return{status:"valid",value:K.status==="valid"?K.value:this._def.catchValue({get error(){return new y6(j.common.issues)},input:j.data})}}removeCatch(){return this._def.innerType}};U_.create=(q,_)=>{return new U_({innerType:q,typeName:W8.ZodCatch,catchValue:typeof _.catch==="function"?_.catch:()=>_.catch,...Z8(_)})};LK=class LK extends k8{_parse(q){if(this._getType(q)!==s.nan){let j=this._getOrReturnCtx(q);return F(j,{code:t.invalid_type,expected:s.nan,received:j.parsedType}),v8}return{status:"valid",value:q.data}}};LK.create=(q)=>{return new LK({typeName:W8.ZodNaN,...Z8(q)})};bz=Symbol("zod_brand");n3=class n3 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;return this._def.type._parse({data:j,path:_.path,parent:_})}unwrap(){return this._def.type}};lK=class lK extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.common.async)return(async()=>{let Y=await this._def.in._parseAsync({data:j.data,path:j.path,parent:j});if(Y.status==="aborted")return v8;if(Y.status==="dirty")return _.dirty(),l_(Y.value);else return this._def.out._parseAsync({data:Y.value,path:j.path,parent:j})})();else{let K=this._def.in._parseSync({data:j.data,path:j.path,parent:j});if(K.status==="aborted")return v8;if(K.status==="dirty")return _.dirty(),{status:"dirty",value:K.value};else return this._def.out._parseSync({data:K.value,path:j.path,parent:j})}}static create(q,_){return new lK({in:q,out:_,typeName:W8.ZodPipeline})}};s_=class s_ extends k8{_parse(q){let _=this._def.innerType._parse(q),j=(K)=>{if($_(K))K.value=Object.freeze(K.value);return K};return IK(_)?_.then((K)=>j(K)):j(_)}unwrap(){return this._def.innerType}};s_.create=(q,_)=>{return new s_({innerType:q,typeName:W8.ZodReadonly,...Z8(_)})};Sz={object:i8.lazycreate};(function(q){q.ZodString="ZodString",q.ZodNumber="ZodNumber",q.ZodNaN="ZodNaN",q.ZodBigInt="ZodBigInt",q.ZodBoolean="ZodBoolean",q.ZodDate="ZodDate",q.ZodSymbol="ZodSymbol",q.ZodUndefined="ZodUndefined",q.ZodNull="ZodNull",q.ZodAny="ZodAny",q.ZodUnknown="ZodUnknown",q.ZodNever="ZodNever",q.ZodVoid="ZodVoid",q.ZodArray="ZodArray",q.ZodObject="ZodObject",q.ZodUnion="ZodUnion",q.ZodDiscriminatedUnion="ZodDiscriminatedUnion",q.ZodIntersection="ZodIntersection",q.ZodTuple="ZodTuple",q.ZodRecord="ZodRecord",q.ZodMap="ZodMap",q.ZodSet="ZodSet",q.ZodFunction="ZodFunction",q.ZodLazy="ZodLazy",q.ZodLiteral="ZodLiteral",q.ZodEnum="ZodEnum",q.ZodEffects="ZodEffects",q.ZodNativeEnum="ZodNativeEnum",q.ZodOptional="ZodOptional",q.ZodNullable="ZodNullable",q.ZodDefault="ZodDefault",q.ZodCatch="ZodCatch",q.ZodPromise="ZodPromise",q.ZodBranded="ZodBranded",q.ZodPipeline="ZodPipeline",q.ZodReadonly="ZodReadonly"})(W8||(W8={}));U5=Yq.create,s5=Bq.create,Rz=LK.create,mz=tq.create,Q5=c_.create,Iz=w_.create,gz=gK.create,yz=r_.create,dz=i_.create,pz=O_.create,Lz=aq.create,lz=Xq.create,xz=yK.create,nz=fq.create,cz=i8.create,rz=i8.strictCreate,iz=o_.create,oz=x3.create,az=a_.create,Bz=Aq.create,tz=dK.create,ez=pK.create,Fz=z_.create,Uz=x_.create,sz=B_.create,Qz=t_.create,qv=eq.create,_v=e_.create,Kv=v_.create,g5=B6.create,jv=$q.create,Pv=Iq.create,Yv=B6.createWithPreprocess,fv=lK.create,zv={string:(q)=>Yq.create({...q,coerce:!0}),number:(q)=>Bq.create({...q,coerce:!0}),boolean:(q)=>c_.create({...q,coerce:!0}),bigint:(q)=>tq.create({...q,coerce:!0}),date:(q)=>w_.create({...q,coerce:!0})},vv=v8,q1=k.union([k.string(),k.number().int()]),_1=k.string(),Wv=k.object({progressToken:k.optional(q1)}).passthrough(),t6=k.object({_meta:k.optional(Wv)}).passthrough(),E6=k.object({method:k.string(),params:k.optional(t6)}),xK=k.object({_meta:k.optional(k.object({}).passthrough())}).passthrough(),Gq=k.object({method:k.string(),params:k.optional(xK)}),e6=k.object({_meta:k.optional(k.object({}).passthrough())}).passthrough(),r3=k.union([k.string(),k.number().int()]),Hv=k.object({jsonrpc:k.literal(c3),id:r3}).merge(E6).strict(),Jv=k.object({jsonrpc:k.literal(c3)}).merge(Gq).strict(),Tv=k.object({jsonrpc:k.literal(c3),id:r3,result:e6}).strict();(function(q){q[q.ConnectionClosed=-32000]="ConnectionClosed",q[q.RequestTimeout=-32001]="RequestTimeout",q[q.ParseError=-32700]="ParseError",q[q.InvalidRequest=-32600]="InvalidRequest",q[q.MethodNotFound=-32601]="MethodNotFound",q[q.InvalidParams=-32602]="InvalidParams",q[q.InternalError=-32603]="InternalError"})(y5||(y5={}));Zv=k.object({jsonrpc:k.literal(c3),id:r3,error:k.object({code:k.number().int(),message:k.string(),data:k.optional(k.unknown())})}).strict(),OC=k.union([Hv,Jv,Tv,Zv]),K1=e6.strict(),j1=Gq.extend({method:k.literal("notifications/cancelled"),params:xK.extend({requestId:r3,reason:k.string().optional()})}),nK=k.object({name:k.string(),title:k.optional(k.string())}).passthrough(),P1=nK.extend({version:k.string()}),kv=k.object({experimental:k.optional(k.object({}).passthrough()),sampling:k.optional(k.object({}).passthrough()),elicitation:k.optional(k.object({}).passthrough()),roots:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough())}).passthrough(),Xv=E6.extend({method:k.literal("initialize"),params:t6.extend({protocolVersion:k.string(),capabilities:kv,clientInfo:P1})}),Av=k.object({experimental:k.optional(k.object({}).passthrough()),logging:k.optional(k.object({}).passthrough()),completions:k.optional(k.object({}).passthrough()),prompts:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough()),resources:k.optional(k.object({subscribe:k.optional(k.boolean()),listChanged:k.optional(k.boolean())}).passthrough()),tools:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough())}).passthrough(),Gv=e6.extend({protocolVersion:k.string(),capabilities:Av,serverInfo:P1,instructions:k.optional(k.string())}),uv=Gq.extend({method:k.literal("notifications/initialized")}),Y1=E6.extend({method:k.literal("ping")}),hv=k.object({progress:k.number(),total:k.optional(k.number()),message:k.optional(k.string())}).passthrough(),f1=Gq.extend({method:k.literal("notifications/progress"),params:xK.merge(hv).extend({progressToken:q1})}),i3=E6.extend({params:t6.extend({cursor:k.optional(_1)}).optional()}),o3=e6.extend({nextCursor:k.optional(_1)}),$1=k.object({uri:k.string(),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}).passthrough(),w1=$1.extend({text:k.string()}),u4=k.string().refine((q)=>{try{return atob(q),!0}catch(_){return!1}},{message:"Invalid Base64 string"}),O1=$1.extend({blob:u4}),z1=nK.extend({uri:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}),Dv=nK.extend({uriTemplate:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}),Cv=i3.extend({method:k.literal("resources/list")}),Vv=o3.extend({resources:k.array(z1)}),Mv=i3.extend({method:k.literal("resources/templates/list")}),Nv=o3.extend({resourceTemplates:k.array(Dv)}),bv=E6.extend({method:k.literal("resources/read"),params:t6.extend({uri:k.string()})}),Sv=e6.extend({contents:k.array(k.union([w1,O1]))}),Ev=Gq.extend({method:k.literal("notifications/resources/list_changed")}),Rv=E6.extend({method:k.literal("resources/subscribe"),params:t6.extend({uri:k.string()})}),mv=E6.extend({method:k.literal("resources/unsubscribe"),params:t6.extend({uri:k.string()})}),Iv=Gq.extend({method:k.literal("notifications/resources/updated"),params:xK.extend({uri:k.string()})}),gv=k.object({name:k.string(),description:k.optional(k.string()),required:k.optional(k.boolean())}).passthrough(),yv=nK.extend({description:k.optional(k.string()),arguments:k.optional(k.array(gv)),_meta:k.optional(k.object({}).passthrough())}),dv=i3.extend({method:k.literal("prompts/list")}),pv=o3.extend({prompts:k.array(yv)}),Lv=E6.extend({method:k.literal("prompts/get"),params:t6.extend({name:k.string(),arguments:k.optional(k.record(k.string()))})}),h4=k.object({type:k.literal("text"),text:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),D4=k.object({type:k.literal("image"),data:u4,mimeType:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),C4=k.object({type:k.literal("audio"),data:u4,mimeType:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),lv=k.object({type:k.literal("resource"),resource:k.union([w1,O1]),_meta:k.optional(k.object({}).passthrough())}).passthrough(),xv=z1.extend({type:k.literal("resource_link")}),v1=k.union([h4,D4,C4,xv,lv]),nv=k.object({role:k.enum(["user","assistant"]),content:v1}).passthrough(),cv=e6.extend({description:k.optional(k.string()),messages:k.array(nv)}),rv=Gq.extend({method:k.literal("notifications/prompts/list_changed")}),iv=k.object({title:k.optional(k.string()),readOnlyHint:k.optional(k.boolean()),destructiveHint:k.optional(k.boolean()),idempotentHint:k.optional(k.boolean()),openWorldHint:k.optional(k.boolean())}).passthrough(),ov=nK.extend({description:k.optional(k.string()),inputSchema:k.object({type:k.literal("object"),properties:k.optional(k.object({}).passthrough()),required:k.optional(k.array(k.string()))}).passthrough(),outputSchema:k.optional(k.object({type:k.literal("object"),properties:k.optional(k.object({}).passthrough()),required:k.optional(k.array(k.string()))}).passthrough()),annotations:k.optional(iv),_meta:k.optional(k.object({}).passthrough())}),av=i3.extend({method:k.literal("tools/list")}),Bv=o3.extend({tools:k.array(ov)}),W1=e6.extend({content:k.array(v1).default([]),structuredContent:k.object({}).passthrough().optional(),isError:k.optional(k.boolean())}),zC=W1.or(e6.extend({toolResult:k.unknown()})),tv=E6.extend({method:k.literal("tools/call"),params:t6.extend({name:k.string(),arguments:k.optional(k.record(k.unknown()))})}),ev=Gq.extend({method:k.literal("notifications/tools/list_changed")}),H1=k.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),Fv=E6.extend({method:k.literal("logging/setLevel"),params:t6.extend({level:H1})}),Uv=Gq.extend({method:k.literal("notifications/message"),params:xK.extend({level:H1,logger:k.optional(k.string()),data:k.unknown()})}),sv=k.object({name:k.string().optional()}).passthrough(),Qv=k.object({hints:k.optional(k.array(sv)),costPriority:k.optional(k.number().min(0).max(1)),speedPriority:k.optional(k.number().min(0).max(1)),intelligencePriority:k.optional(k.number().min(0).max(1))}).passthrough(),qW=k.object({role:k.enum(["user","assistant"]),content:k.union([h4,D4,C4])}).passthrough(),_W=E6.extend({method:k.literal("sampling/createMessage"),params:t6.extend({messages:k.array(qW),systemPrompt:k.optional(k.string()),includeContext:k.optional(k.enum(["none","thisServer","allServers"])),temperature:k.optional(k.number()),maxTokens:k.number().int(),stopSequences:k.optional(k.array(k.string())),metadata:k.optional(k.object({}).passthrough()),modelPreferences:k.optional(Qv)})}),KW=e6.extend({model:k.string(),stopReason:k.optional(k.enum(["endTurn","stopSequence","maxTokens"]).or(k.string())),role:k.enum(["user","assistant"]),content:k.discriminatedUnion("type",[h4,D4,C4])}),jW=k.object({type:k.literal("boolean"),title:k.optional(k.string()),description:k.optional(k.string()),default:k.optional(k.boolean())}).passthrough(),PW=k.object({type:k.literal("string"),title:k.optional(k.string()),description:k.optional(k.string()),minLength:k.optional(k.number()),maxLength:k.optional(k.number()),format:k.optional(k.enum(["email","uri","date","date-time"]))}).passthrough(),YW=k.object({type:k.enum(["number","integer"]),title:k.optional(k.string()),description:k.optional(k.string()),minimum:k.optional(k.number()),maximum:k.optional(k.number())}).passthrough(),fW=k.object({type:k.literal("string"),title:k.optional(k.string()),description:k.optional(k.string()),enum:k.array(k.string()),enumNames:k.optional(k.array(k.string()))}).passthrough(),$W=k.union([jW,PW,YW,fW]),wW=E6.extend({method:k.literal("elicitation/create"),params:t6.extend({message:k.string(),requestedSchema:k.object({type:k.literal("object"),properties:k.record(k.string(),$W),required:k.optional(k.array(k.string()))}).passthrough()})}),OW=e6.extend({action:k.enum(["accept","decline","cancel"]),content:k.optional(k.record(k.string(),k.unknown()))}),zW=k.object({type:k.literal("ref/resource"),uri:k.string()}).passthrough(),vW=k.object({type:k.literal("ref/prompt"),name:k.string()}).passthrough(),WW=E6.extend({method:k.literal("completion/complete"),params:t6.extend({ref:k.union([vW,zW]),argument:k.object({name:k.string(),value:k.string()}).passthrough(),context:k.optional(k.object({arguments:k.optional(k.record(k.string(),k.string()))}))})}),HW=e6.extend({completion:k.object({values:k.array(k.string()).max(100),total:k.optional(k.number().int()),hasMore:k.optional(k.boolean())}).passthrough()}),JW=k.object({uri:k.string().startsWith("file://"),name:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}).passthrough(),TW=E6.extend({method:k.literal("roots/list")}),ZW=e6.extend({roots:k.array(JW)}),kW=Gq.extend({method:k.literal("notifications/roots/list_changed")}),vC=k.union([Y1,Xv,WW,Fv,Lv,dv,Cv,Mv,bv,Rv,mv,tv,av]),WC=k.union([j1,f1,uv,kW]),HC=k.union([K1,KW,OW,ZW]),JC=k.union([Y1,_W,wW,TW]),TC=k.union([j1,f1,Uv,Iv,Ev,ev,rv]),ZC=k.union([K1,Gv,HW,cv,pv,Vv,Nv,Sv,W1,Bv]),kC=WO(BO(),1),XC=Symbol("Let zodToJsonSchema decide on which parser to use"),AC=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");(function(q){q.Completable="McpCompletable"})(Z4||(Z4={}));k4=class k4 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;return this._def.type._parse({data:j,path:_.path,parent:_})}unwrap(){return this._def.type}};k4.create=(q,_)=>{return new k4({type:q,typeName:Z4.Completable,complete:_.complete,...XW(_)})}});var J1={};EK(J1,{version:()=>uW,type:()=>DW,scripts:()=>VW,repository:()=>SW,publishConfig:()=>mW,name:()=>GW,main:()=>CW,license:()=>bW,keywords:()=>MW,homepage:()=>EW,files:()=>pW,engines:()=>yW,devDependencies:()=>gW,description:()=>hW,dependencies:()=>IW,default:()=>LW,bugs:()=>RW,bin:()=>dW,author:()=>NW});var GW="claude-mem",uW="3.6.9",hW="Memory compression system for Claude Code - persist context across sessions",DW="module",CW="claude-mem",VW,MW,NW="Alex Newman",bW="SEE LICENSE IN LICENSE",SW,EW="https://github.com/thedotmack/claude-mem#readme",RW,mW,IW,gW,yW,dW,pW,LW;var T1=f6(()=>{VW={dev:"tsx src/bin/cli.ts","dev:install":"node dist/claude-mem.min.js install --force","dev:status":"node dist/claude-mem.min.js status","dev:compress":"node dist/claude-mem.min.js compress","dev:load":"node dist/claude-mem.min.js load-context","dev:uninstall":"node dist/claude-mem.min.js uninstall",build:"./scripts/build-minified.sh","test:watch":"npm test -- --watch",lint:"eslint 'src/**/*.ts' 'hooks/**/*.ts' 'test/**/*.ts'","lint:fix":"npm run lint -- --fix",format:"prettier --write 'src/**/*.ts' 'hooks/**/*.ts' 'test/**/*.ts'","build:npm":"./scripts/npm-publish.sh",publish:"./scripts/publish-with-changelog.sh","publish:latest":"./scripts/publish-with-changelog.sh bump","publish:github":"./scripts/github-publish.sh"},MW=["claude","claude-code","mcp","memory","compression","knowledge-graph","transcript","cli","typescript","bun"],SW={type:"git",url:"https://github.com/thedotmack/claude-mem.git"},RW={url:"https://github.com/thedotmack/claude-mem/issues"},mW={access:"public",registry:"https://registry.npmjs.org/"},IW={"@anthropic-ai/claude-code":"^1.0.88","@clack/prompts":"^0.11.0","@modelcontextprotocol/sdk":"^0.5.0",boxen:"^8.0.1",chalk:"^5.6.0",chromadb:"^3.0.14",commander:"^14.0.0",cors:"^2.8.5",express:"^5.1.0",glob:"^11.0.3","gradient-string":"^3.0.0",handlebars:"^4.7.8",http:"^0.0.1-security","oh-my-logo":"^0.3.2",open:"^10.2.0"},gW={"@types/chai":"^4.3.0","@types/handlebars":"^4.0.40","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0",chai:"^4.3.0",eslint:"^8.0.0",prettier:"^3.0.0","ts-node":"^10.0.0",tsx:"^4.20.5",typescript:"^5.0.0"},yW={node:">=18.0.0",bun:">=1.0.0"},dW={"claude-mem":"dist/claude-mem.min.js"},pW=["dist","hooks","commands","docs","src","CHANGELOG.md"],LW={name:GW,version:uW,description:hW,type:DW,main:CW,scripts:VW,keywords:MW,author:NW,license:bW,repository:SW,homepage:EW,bugs:RW,publishConfig:mW,dependencies:IW,devDependencies:gW,engines:yW,bin:dW,files:pW}});import{join as U8,dirname as B3,sep as lW}from"path";import{homedir as V4}from"os";import{existsSync as cK,statSync as xW}from"fs";import{execSync as nW}from"child_process";import{fileURLToPath as cW}from"url";class $8{static instance=null;_dataDirectory=null;_packageRoot=null;_claudeConfigDirectory=null;static getInstance(){if(!$8.instance)$8.instance=new $8;return $8.instance}getDataDirectory(){if(this._dataDirectory)return this._dataDirectory;return this._dataDirectory=process.env.CLAUDE_MEM_DATA_DIR||U8(V4(),".claude-mem"),this._dataDirectory}getArchivesDirectory(){return U8(this.getDataDirectory(),"archives")}getHooksDirectory(){return U8(this.getDataDirectory(),"hooks")}getLogsDirectory(){return U8(this.getDataDirectory(),"logs")}getIndexDirectory(){return this.getDataDirectory()}getIndexPath(){return U8(this.getIndexDirectory(),"claude-mem-index.jsonl")}getTrashDirectory(){return U8(this.getDataDirectory(),"trash")}getBackupsDirectory(){return U8(this.getDataDirectory(),"backups")}getChromaDirectory(){return U8(this.getDataDirectory(),"chroma")}getProjectArchiveDirectory(q){return U8(this.getArchivesDirectory(),q)}getUserSettingsPath(){return U8(this.getDataDirectory(),"settings.json")}getClaudeConfigDirectory(){if(this._claudeConfigDirectory)return this._claudeConfigDirectory;return this._claudeConfigDirectory=process.env.CLAUDE_CONFIG_DIR||U8(V4(),".claude"),this._claudeConfigDirectory}getClaudeSettingsPath(){return U8(this.getClaudeConfigDirectory(),"settings.json")}getClaudeCommandsDirectory(){return U8(this.getClaudeConfigDirectory(),"commands")}getClaudeMdPath(){return U8(this.getClaudeConfigDirectory(),"CLAUDE.md")}getMcpConfigPath(){return U8(V4(),".claude.json")}getProjectMcpConfigPath(){return U8(process.cwd(),".mcp.json")}getPackageRoot(){if(this._packageRoot)return this._packageRoot;try{let j=h6.resolve("/Users/alexnewman/Scripts/claude-mem-source/package.json");return this._packageRoot=B3(j),this._packageRoot}catch{}let q=cW(import.meta.url),_=B3(q);for(let j=0;j<10;j++){let K=U8(_,"package.json");if(cK(K))try{if(h6(K).name==="claude-mem")return this._packageRoot=_,this._packageRoot}catch{}let Y=B3(_);if(Y===_)break;_=Y}try{let j=nW("npm list -g claude-mem --json 2>/dev/null || npm list claude-mem --json 2>/dev/null",{encoding:"utf8"}),K=JSON.parse(j);if(K.dependencies?.["claude-mem"]?.resolved)return this._packageRoot=B3(K.dependencies["claude-mem"].resolved),this._packageRoot}catch{}throw new Error("Cannot locate claude-mem package root. Ensure claude-mem is properly installed.")}findPackageHooksDirectory(){let q=this.getPackageRoot(),_=U8(q,"hooks"),j=["pre-compact.js","session-start.js"];for(let K of j)if(!cK(U8(_,K)))throw new Error(`Package hooks directory missing required file: ${K}`);return _}findPackageCommandsDirectory(){let q=this.getPackageRoot(),_=U8(q,"commands"),j=["save.md"];for(let K of j)if(!cK(U8(_,K)))throw new Error(`Package commands directory missing required file: ${K}`);return _}ensureDirectory(q){if(!cK(q))h6("fs").mkdirSync(q,{recursive:!0})}ensureDirectories(q){q.forEach((_)=>this.ensureDirectory(_))}ensureAllDataDirectories(){this.ensureDirectories([this.getDataDirectory(),this.getArchivesDirectory(),this.getHooksDirectory(),this.getLogsDirectory(),this.getTrashDirectory(),this.getBackupsDirectory(),this.getChromaDirectory()])}ensureAllClaudeDirectories(){this.ensureDirectories([this.getClaudeConfigDirectory(),this.getClaudeCommandsDirectory()])}static extractProjectName(q){let _=q.split(lW),j=["src","lib","app","project","workspace"];for(let K=_.length-1;K>=0;K--)if(j.includes(_[K])&&K>0)return _[K-1];if(_.length>1)return _[_.length-2];return"unknown-project"}static getCurrentProjectName(){return h6("path").basename(process.cwd())}static createBackupFilename(q){let _=new Date().toISOString().replace(/[:.]/g,"-").replace("T","_").slice(0,19);return`${q}.backup.${_}`}static isPathAccessible(q){try{return cK(q)&&xW(q).isDirectory()}catch{return!1}}static getDataDirectory(){return $8.getInstance().getDataDirectory()}static getArchivesDirectory(){return $8.getInstance().getArchivesDirectory()}static getHooksDirectory(){return $8.getInstance().getHooksDirectory()}static getLogsDirectory(){return $8.getInstance().getLogsDirectory()}static getClaudeSettingsPath(){return $8.getInstance().getClaudeSettingsPath()}static getClaudeMdPath(){return $8.getInstance().getClaudeMdPath()}static findPackageHooksDirectory(){return $8.getInstance().findPackageHooksDirectory()}static findPackageCommandsDirectory(){return $8.getInstance().findPackageCommandsDirectory()}}var MC;var d6=f6(()=>{MC=$8.getInstance()});class yq{pathDiscovery;constructor(){this.pathDiscovery=$8.getInstance()}getConfigDir(){return this.pathDiscovery.getDataDirectory()}getIndexDir(){return this.pathDiscovery.getIndexDirectory()}getIndexPath(){return this.pathDiscovery.getIndexPath()}getArchiveDir(){return this.pathDiscovery.getArchivesDirectory()}getProjectArchiveDir(q){return this.pathDiscovery.getProjectArchiveDirectory(q)}getLogsDir(){return this.pathDiscovery.getLogsDirectory()}static ensureDirectory(q){$8.getInstance().ensureDirectory(q)}static ensureDirectories(q){$8.getInstance().ensureDirectories(q)}static extractProjectName(q){return $8.extractProjectName(q)}static getCurrentProjectPrefix(){return $8.getCurrentProjectName()}static getCurrentProjectName(){return $8.getCurrentProjectName()}}var M4=f6(()=>{d6()});var C6=_8((QW)=>{QW.__esModule=!0;QW.extend=Z1;QW.indexOf=BW;QW.escapeExpression=tW;QW.isEmpty=eW;QW.createFrame=FW;QW.blockParams=UW;QW.appendContextPath=sW;var rW={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},iW=/[&<>"'`=]/g,oW=/[&<>"'`=]/;function aW(q){return rW[q]}function Z1(q){for(var _=1;_{X1.__esModule=!0;var S4=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function E4(q,_){var j=_&&_.loc,K=void 0,Y=void 0,f=void 0,P=void 0;if(j)K=j.start.line,Y=j.end.line,f=j.start.column,P=j.end.column,q+=" - "+K+":"+f;var $=Error.prototype.constructor.call(this,q);for(var w=0;w{G1.__esModule=!0;var R4=C6();G1.default=function(q){q.registerHelper("blockHelperMissing",function(_,j){var{inverse:K,fn:Y}=j;if(_===!0)return Y(this);else if(_===!1||_==null)return K(this);else if(R4.isArray(_))if(_.length>0){if(j.ids)j.ids=[j.name];return q.helpers.each(_,j)}else return K(this);else{if(j.data&&j.ids){var f=R4.createFrame(j.data);f.contextPath=R4.appendContextPath(j.data.contextPath,j.name),j={data:f}}return Y(_,j)}})};u1.exports=G1.default});var V1=_8((D1,C1)=>{D1.__esModule=!0;function TH(q){return q&&q.__esModule?q:{default:q}}var rK=C6(),ZH=F6(),kH=TH(ZH);D1.default=function(q){q.registerHelper("each",function(_,j){if(!j)throw new kH.default("Must pass iterator to #each");var{fn:K,inverse:Y}=j,f=0,P="",$=void 0,w=void 0;if(j.data&&j.ids)w=rK.appendContextPath(j.data.contextPath,j.ids[0])+".";if(rK.isFunction(_))_=_.call(this);if(j.data)$=rK.createFrame(j.data);function O(T,H,X){if($){if($.key=T,$.index=H,$.first=H===0,$.last=!!X,w)$.contextPath=w+T}P=P+K(_[T],{data:$,blockParams:rK.blockParams([_[T],T],[w+T,null])})}if(_&&typeof _==="object")if(rK.isArray(_)){for(var v=_.length;f{M1.__esModule=!0;function GH(q){return q&&q.__esModule?q:{default:q}}var uH=F6(),hH=GH(uH);M1.default=function(q){q.registerHelper("helperMissing",function(){if(arguments.length===1)return;else throw new hH.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};N1.exports=M1.default});var I1=_8((R1,m1)=>{R1.__esModule=!0;function VH(q){return q&&q.__esModule?q:{default:q}}var S1=C6(),MH=F6(),E1=VH(MH);R1.default=function(q){q.registerHelper("if",function(_,j){if(arguments.length!=2)throw new E1.default("#if requires exactly one argument");if(S1.isFunction(_))_=_.call(this);if(!j.hash.includeZero&&!_||S1.isEmpty(_))return j.inverse(this);else return j.fn(this)}),q.registerHelper("unless",function(_,j){if(arguments.length!=2)throw new E1.default("#unless requires exactly one argument");return q.helpers.if.call(this,_,{fn:j.inverse,inverse:j.fn,hash:j.hash})})};m1.exports=R1.default});var d1=_8((g1,y1)=>{g1.__esModule=!0;g1.default=function(q){q.registerHelper("log",function(){var _=[void 0],j=arguments[arguments.length-1];for(var K=0;K{p1.__esModule=!0;p1.default=function(q){q.registerHelper("lookup",function(_,j,K){if(!_)return _;return K.lookupProperty(_,j)})};L1.exports=p1.default});var c1=_8((x1,n1)=>{x1.__esModule=!0;function IH(q){return q&&q.__esModule?q:{default:q}}var iK=C6(),gH=F6(),yH=IH(gH);x1.default=function(q){q.registerHelper("with",function(_,j){if(arguments.length!=2)throw new yH.default("#with requires exactly one argument");if(iK.isFunction(_))_=_.call(this);var K=j.fn;if(!iK.isEmpty(_)){var Y=j.data;if(j.data&&j.ids)Y=iK.createFrame(j.data),Y.contextPath=iK.appendContextPath(j.data.contextPath,j.ids[0]);return K(_,{data:Y,blockParams:iK.blockParams([_],[Y&&Y.contextPath])})}else return j.inverse(this)})};n1.exports=x1.default});var m4=_8((qJ)=>{qJ.__esModule=!0;qJ.registerDefaultHelpers=sH;qJ.moveHelperToHooks=QH;function W_(q){return q&&q.__esModule?q:{default:q}}var LH=h1(),lH=W_(LH),xH=V1(),nH=W_(xH),cH=b1(),rH=W_(cH),iH=I1(),oH=W_(iH),aH=d1(),BH=W_(aH),tH=l1(),eH=W_(tH),FH=c1(),UH=W_(FH);function sH(q){lH.default(q),nH.default(q),rH.default(q),oH.default(q),BH.default(q),eH.default(q),UH.default(q)}function QH(q,_,j){if(q.helpers[_]){if(q.hooks[_]=q.helpers[_],!j)delete q.helpers[_]}}});var o1=_8((r1,i1)=>{r1.__esModule=!0;var PJ=C6();r1.default=function(q){q.registerDecorator("inline",function(_,j,K,Y){var f=_;if(!j.partials)j.partials={},f=function(P,$){var w=K.partials;K.partials=PJ.extend({},w,j.partials);var O=_(P,$);return K.partials=w,O};return j.partials[Y.args[0]]=Y.fn,f})};i1.exports=r1.default});var a1=_8((vJ)=>{vJ.__esModule=!0;vJ.registerDefaultDecorators=zJ;function $J(q){return q&&q.__esModule?q:{default:q}}var wJ=o1(),OJ=$J(wJ);function zJ(q){OJ.default(q)}});var I4=_8((B1,t1)=>{B1.__esModule=!0;var JJ=C6(),qK={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function q(_){if(typeof _==="string"){var j=JJ.indexOf(qK.methodMap,_.toLowerCase());if(j>=0)_=j;else _=parseInt(_,10)}return _},log:function q(_){if(_=qK.lookupLevel(_),typeof console!=="undefined"&&qK.lookupLevel(qK.level)<=_){var j=qK.methodMap[_];if(!console[j])j="log";for(var K=arguments.length,Y=Array(K>1?K-1:0),f=1;f{AJ.__esModule=!0;AJ.createNewLookupObject=XJ;var kJ=C6();function XJ(){for(var q=arguments.length,_=Array(q),j=0;j{SJ.__esModule=!0;SJ.createProtoAccessControl=VJ;SJ.resultIsAllowed=MJ;SJ.resetLoggedProperties=bJ;function hJ(q){return q&&q.__esModule?q:{default:q}}var F1=e1(),DJ=I4(),CJ=hJ(DJ),t3=Object.create(null);function VJ(q){var _=Object.create(null);_.constructor=!1,_.__defineGetter__=!1,_.__defineSetter__=!1,_.__lookupGetter__=!1;var j=Object.create(null);return j.__proto__=!1,{properties:{whitelist:F1.createNewLookupObject(j,q.allowedProtoProperties),defaultValue:q.allowProtoPropertiesByDefault},methods:{whitelist:F1.createNewLookupObject(_,q.allowedProtoMethods),defaultValue:q.allowProtoMethodsByDefault}}}function MJ(q,_,j){if(typeof q==="function")return U1(_.methods,j);else return U1(_.properties,j)}function U1(q,_){if(q.whitelist[_]!==void 0)return q.whitelist[_]===!0;if(q.defaultValue!==void 0)return q.defaultValue;return NJ(_),!1}function NJ(q){if(t3[q]!==!0)t3[q]=!0,CJ.default.log("error",'Handlebars: Access has been denied to resolve the property "'+q+`" because it is not an "own property" of its parent. +`))}this.transport.endInput()}catch(_){if(!(_ instanceof L_))throw _}}handleHookCallbacks(q,_,j,K){let Y=this.hookCallbacks.get(q);if(!Y)throw new Error(`No hook callback found for ID: ${q}`);return Y(_,j,{signal:K})}sendMcpServerMessageToCli(q,_){if("id"in _&&_.id!==null&&_.id!==void 0){let j=`${q}:${_.id}`,K=this.pendingMcpResponses.get(j);if(K){K.resolve(_),this.pendingMcpResponses.delete(j);return}}throw new Error("No pending request found")}handleMcpControlRequest(q,_,j){let K="id"in _.message?_.message.id:null,Y=`${q}:${K}`;return new Promise((f,P)=>{let $=null,w=()=>{if($)clearTimeout($);this.pendingMcpResponses.delete(Y)},O=(z)=>{w(),f(z)},v=(z)=>{w(),P(z)};if(this.pendingMcpResponses.set(Y,{resolve:O,reject:v}),j.onmessage)j.onmessage(_.message);else{w(),P(new Error("No message handler registered"));return}$=setTimeout(()=>{if(this.pendingMcpResponses.has(Y))w(),P(new Error("Request timeout"))},30000)})}};k={};JO(k,{void:()=>nz,util:()=>h8,unknown:()=>lz,union:()=>oz,undefined:()=>dz,tuple:()=>tz,transformer:()=>g5,symbol:()=>yz,string:()=>U5,strictObject:()=>iz,setErrorMap:()=>fz,set:()=>Uz,record:()=>ez,quotelessJson:()=>Pz,promise:()=>jv,preprocess:()=>fv,pipeline:()=>$v,ostring:()=>wv,optional:()=>Pv,onumber:()=>Ov,oboolean:()=>zv,objectUtil:()=>W4,object:()=>rz,number:()=>s5,nullable:()=>Yv,null:()=>pz,never:()=>xz,nativeEnum:()=>Kv,nan:()=>mz,map:()=>Fz,makeIssue:()=>l3,literal:()=>qv,lazy:()=>Qz,late:()=>Ez,isValid:()=>$_,isDirty:()=>J4,isAsync:()=>IK,isAborted:()=>H4,intersection:()=>Bz,instanceof:()=>Rz,getParsedType:()=>mq,getErrorMap:()=>L3,function:()=>sz,enum:()=>_v,effect:()=>g5,discriminatedUnion:()=>az,defaultErrorMap:()=>n_,datetimeRegex:()=>t5,date:()=>gz,custom:()=>F5,coerce:()=>vv,boolean:()=>Q5,bigint:()=>Iz,array:()=>cz,any:()=>Lz,addIssueToContext:()=>F,ZodVoid:()=>yK,ZodUnknown:()=>aq,ZodUnion:()=>o_,ZodUndefined:()=>r_,ZodType:()=>k8,ZodTuple:()=>Aq,ZodTransformer:()=>B6,ZodSymbol:()=>gK,ZodString:()=>Yq,ZodSet:()=>z_,ZodSchema:()=>k8,ZodRecord:()=>dK,ZodReadonly:()=>s_,ZodPromise:()=>v_,ZodPipeline:()=>lK,ZodParsedType:()=>s,ZodOptional:()=>$q,ZodObject:()=>i8,ZodNumber:()=>Bq,ZodNullable:()=>Iq,ZodNull:()=>i_,ZodNever:()=>Xq,ZodNativeEnum:()=>e_,ZodNaN:()=>LK,ZodMap:()=>pK,ZodLiteral:()=>t_,ZodLazy:()=>B_,ZodIssueCode:()=>t,ZodIntersection:()=>a_,ZodFunction:()=>x_,ZodFirstPartyTypeKind:()=>W8,ZodError:()=>y6,ZodEnum:()=>eq,ZodEffects:()=>B6,ZodDiscriminatedUnion:()=>x3,ZodDefault:()=>F_,ZodDate:()=>w_,ZodCatch:()=>U_,ZodBranded:()=>n3,ZodBoolean:()=>c_,ZodBigInt:()=>tq,ZodArray:()=>fq,ZodAny:()=>O_,Schema:()=>k8,ParseStatus:()=>k6,OK:()=>D6,NEVER:()=>Wv,INVALID:()=>v8,EMPTY_PATH:()=>$z,DIRTY:()=>l_,BRAND:()=>Sz});(function(q){q.assertEqual=(Y)=>{};function _(Y){}q.assertIs=_;function j(Y){throw new Error}q.assertNever=j,q.arrayToEnum=(Y)=>{let f={};for(let P of Y)f[P]=P;return f},q.getValidEnumValues=(Y)=>{let f=q.objectKeys(Y).filter(($)=>typeof Y[Y[$]]!=="number"),P={};for(let $ of f)P[$]=Y[$];return q.objectValues(P)},q.objectValues=(Y)=>{return q.objectKeys(Y).map(function(f){return Y[f]})},q.objectKeys=typeof Object.keys==="function"?(Y)=>Object.keys(Y):(Y)=>{let f=[];for(let P in Y)if(Object.prototype.hasOwnProperty.call(Y,P))f.push(P);return f},q.find=(Y,f)=>{for(let P of Y)if(f(P))return P;return},q.isInteger=typeof Number.isInteger==="function"?(Y)=>Number.isInteger(Y):(Y)=>typeof Y==="number"&&Number.isFinite(Y)&&Math.floor(Y)===Y;function K(Y,f=" | "){return Y.map((P)=>typeof P==="string"?`'${P}'`:P).join(f)}q.joinValues=K,q.jsonStringifyReplacer=(Y,f)=>{if(typeof f==="bigint")return f.toString();return f}})(h8||(h8={}));(function(q){q.mergeShapes=(_,j)=>{return{..._,...j}}})(W4||(W4={}));s=h8.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),t=h8.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);y6=class y6 extends Error{get errors(){return this.issues}constructor(q){super();this.issues=[],this.addIssue=(j)=>{this.issues=[...this.issues,j]},this.addIssues=(j=[])=>{this.issues=[...this.issues,...j]};let _=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,_);else this.__proto__=_;this.name="ZodError",this.issues=q}format(q){let _=q||function(Y){return Y.message},j={_errors:[]},K=(Y)=>{for(let f of Y.issues)if(f.code==="invalid_union")f.unionErrors.map(K);else if(f.code==="invalid_return_type")K(f.returnTypeError);else if(f.code==="invalid_arguments")K(f.argumentsError);else if(f.path.length===0)j._errors.push(_(f));else{let P=j,$=0;while($_.message){let _={},j=[];for(let K of this.issues)if(K.path.length>0){let Y=K.path[0];_[Y]=_[Y]||[],_[Y].push(q(K))}else j.push(q(K));return{formErrors:j,fieldErrors:_}}get formErrors(){return this.flatten()}};y6.create=(q)=>{return new y6(q)};n_=Yz,o5=n_;$z=[];v8=Object.freeze({status:"aborted"});(function(q){q.errToObj=(_)=>typeof _==="string"?{message:_}:_||{},q.toString=(_)=>typeof _==="string"?_:_?.message})(f8||(f8={}));wz=/^c[^\s-]{8,}$/i,Oz=/^[0-9a-z]+$/,zz=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vz=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Wz=/^[a-z0-9_-]{21}$/i,Hz=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Jz=/^[-+]?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)?)??$/,Tz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kz=/^(?:(?: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])$/,Xz=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Az=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Gz=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,uz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,hz=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Dz=new RegExp(`^${a5}$`);Yq=class Yq extends k8{_parse(q){if(this._def.coerce)q.data=String(q.data);if(this._getType(q)!==s.string){let Y=this._getOrReturnCtx(q);return F(Y,{code:t.invalid_type,expected:s.string,received:Y.parsedType}),v8}let j=new k6,K=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(q.data.lengthY.value)K=this._getOrReturnCtx(q,K),F(K,{code:t.too_big,maximum:Y.value,type:"string",inclusive:!0,exact:!1,message:Y.message}),j.dirty()}else if(Y.kind==="length"){let f=q.data.length>Y.value,P=q.data.lengthq.test(K),{validation:_,code:t.invalid_string,...f8.errToObj(j)})}_addCheck(q){return new Yq({...this._def,checks:[...this._def.checks,q]})}email(q){return this._addCheck({kind:"email",...f8.errToObj(q)})}url(q){return this._addCheck({kind:"url",...f8.errToObj(q)})}emoji(q){return this._addCheck({kind:"emoji",...f8.errToObj(q)})}uuid(q){return this._addCheck({kind:"uuid",...f8.errToObj(q)})}nanoid(q){return this._addCheck({kind:"nanoid",...f8.errToObj(q)})}cuid(q){return this._addCheck({kind:"cuid",...f8.errToObj(q)})}cuid2(q){return this._addCheck({kind:"cuid2",...f8.errToObj(q)})}ulid(q){return this._addCheck({kind:"ulid",...f8.errToObj(q)})}base64(q){return this._addCheck({kind:"base64",...f8.errToObj(q)})}base64url(q){return this._addCheck({kind:"base64url",...f8.errToObj(q)})}jwt(q){return this._addCheck({kind:"jwt",...f8.errToObj(q)})}ip(q){return this._addCheck({kind:"ip",...f8.errToObj(q)})}cidr(q){return this._addCheck({kind:"cidr",...f8.errToObj(q)})}datetime(q){if(typeof q==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:q});return this._addCheck({kind:"datetime",precision:typeof q?.precision==="undefined"?null:q?.precision,offset:q?.offset??!1,local:q?.local??!1,...f8.errToObj(q?.message)})}date(q){return this._addCheck({kind:"date",message:q})}time(q){if(typeof q==="string")return this._addCheck({kind:"time",precision:null,message:q});return this._addCheck({kind:"time",precision:typeof q?.precision==="undefined"?null:q?.precision,...f8.errToObj(q?.message)})}duration(q){return this._addCheck({kind:"duration",...f8.errToObj(q)})}regex(q,_){return this._addCheck({kind:"regex",regex:q,...f8.errToObj(_)})}includes(q,_){return this._addCheck({kind:"includes",value:q,position:_?.position,...f8.errToObj(_?.message)})}startsWith(q,_){return this._addCheck({kind:"startsWith",value:q,...f8.errToObj(_)})}endsWith(q,_){return this._addCheck({kind:"endsWith",value:q,...f8.errToObj(_)})}min(q,_){return this._addCheck({kind:"min",value:q,...f8.errToObj(_)})}max(q,_){return this._addCheck({kind:"max",value:q,...f8.errToObj(_)})}length(q,_){return this._addCheck({kind:"length",value:q,...f8.errToObj(_)})}nonempty(q){return this.min(1,f8.errToObj(q))}trim(){return new Yq({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Yq({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Yq({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((q)=>q.kind==="datetime")}get isDate(){return!!this._def.checks.find((q)=>q.kind==="date")}get isTime(){return!!this._def.checks.find((q)=>q.kind==="time")}get isDuration(){return!!this._def.checks.find((q)=>q.kind==="duration")}get isEmail(){return!!this._def.checks.find((q)=>q.kind==="email")}get isURL(){return!!this._def.checks.find((q)=>q.kind==="url")}get isEmoji(){return!!this._def.checks.find((q)=>q.kind==="emoji")}get isUUID(){return!!this._def.checks.find((q)=>q.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((q)=>q.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((q)=>q.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((q)=>q.kind==="cuid2")}get isULID(){return!!this._def.checks.find((q)=>q.kind==="ulid")}get isIP(){return!!this._def.checks.find((q)=>q.kind==="ip")}get isCIDR(){return!!this._def.checks.find((q)=>q.kind==="cidr")}get isBase64(){return!!this._def.checks.find((q)=>q.kind==="base64")}get isBase64url(){return!!this._def.checks.find((q)=>q.kind==="base64url")}get minLength(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxLength(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value{return new Yq({checks:[],typeName:W8.ZodString,coerce:q?.coerce??!1,...Z8(q)})};Bq=class Bq extends k8{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(q){if(this._def.coerce)q.data=Number(q.data);if(this._getType(q)!==s.number){let Y=this._getOrReturnCtx(q);return F(Y,{code:t.invalid_type,expected:s.number,received:Y.parsedType}),v8}let j=void 0,K=new k6;for(let Y of this._def.checks)if(Y.kind==="int"){if(!h8.isInteger(q.data))j=this._getOrReturnCtx(q,j),F(j,{code:t.invalid_type,expected:"integer",received:"float",message:Y.message}),K.dirty()}else if(Y.kind==="min"){if(Y.inclusive?q.dataY.value:q.data>=Y.value)j=this._getOrReturnCtx(q,j),F(j,{code:t.too_big,maximum:Y.value,type:"number",inclusive:Y.inclusive,exact:!1,message:Y.message}),K.dirty()}else if(Y.kind==="multipleOf"){if(bz(q.data,Y.value)!==0)j=this._getOrReturnCtx(q,j),F(j,{code:t.not_multiple_of,multipleOf:Y.value,message:Y.message}),K.dirty()}else if(Y.kind==="finite"){if(!Number.isFinite(q.data))j=this._getOrReturnCtx(q,j),F(j,{code:t.not_finite,message:Y.message}),K.dirty()}else h8.assertNever(Y);return{status:K.value,value:q.data}}gte(q,_){return this.setLimit("min",q,!0,f8.toString(_))}gt(q,_){return this.setLimit("min",q,!1,f8.toString(_))}lte(q,_){return this.setLimit("max",q,!0,f8.toString(_))}lt(q,_){return this.setLimit("max",q,!1,f8.toString(_))}setLimit(q,_,j,K){return new Bq({...this._def,checks:[...this._def.checks,{kind:q,value:_,inclusive:j,message:f8.toString(K)}]})}_addCheck(q){return new Bq({...this._def,checks:[...this._def.checks,q]})}int(q){return this._addCheck({kind:"int",message:f8.toString(q)})}positive(q){return this._addCheck({kind:"min",value:0,inclusive:!1,message:f8.toString(q)})}negative(q){return this._addCheck({kind:"max",value:0,inclusive:!1,message:f8.toString(q)})}nonpositive(q){return this._addCheck({kind:"max",value:0,inclusive:!0,message:f8.toString(q)})}nonnegative(q){return this._addCheck({kind:"min",value:0,inclusive:!0,message:f8.toString(q)})}multipleOf(q,_){return this._addCheck({kind:"multipleOf",value:q,message:f8.toString(_)})}finite(q){return this._addCheck({kind:"finite",message:f8.toString(q)})}safe(q){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:f8.toString(q)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:f8.toString(q)})}get minValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.valueq.kind==="int"||q.kind==="multipleOf"&&h8.isInteger(q.value))}get isFinite(){let q=null,_=null;for(let j of this._def.checks)if(j.kind==="finite"||j.kind==="int"||j.kind==="multipleOf")return!0;else if(j.kind==="min"){if(_===null||j.value>_)_=j.value}else if(j.kind==="max"){if(q===null||j.value{return new Bq({checks:[],typeName:W8.ZodNumber,coerce:q?.coerce||!1,...Z8(q)})};tq=class tq extends k8{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(q){if(this._def.coerce)try{q.data=BigInt(q.data)}catch{return this._getInvalidInput(q)}if(this._getType(q)!==s.bigint)return this._getInvalidInput(q);let j=void 0,K=new k6;for(let Y of this._def.checks)if(Y.kind==="min"){if(Y.inclusive?q.dataY.value:q.data>=Y.value)j=this._getOrReturnCtx(q,j),F(j,{code:t.too_big,type:"bigint",maximum:Y.value,inclusive:Y.inclusive,message:Y.message}),K.dirty()}else if(Y.kind==="multipleOf"){if(q.data%Y.value!==BigInt(0))j=this._getOrReturnCtx(q,j),F(j,{code:t.not_multiple_of,multipleOf:Y.value,message:Y.message}),K.dirty()}else h8.assertNever(Y);return{status:K.value,value:q.data}}_getInvalidInput(q){let _=this._getOrReturnCtx(q);return F(_,{code:t.invalid_type,expected:s.bigint,received:_.parsedType}),v8}gte(q,_){return this.setLimit("min",q,!0,f8.toString(_))}gt(q,_){return this.setLimit("min",q,!1,f8.toString(_))}lte(q,_){return this.setLimit("max",q,!0,f8.toString(_))}lt(q,_){return this.setLimit("max",q,!1,f8.toString(_))}setLimit(q,_,j,K){return new tq({...this._def,checks:[...this._def.checks,{kind:q,value:_,inclusive:j,message:f8.toString(K)}]})}_addCheck(q){return new tq({...this._def,checks:[...this._def.checks,q]})}positive(q){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:f8.toString(q)})}negative(q){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:f8.toString(q)})}nonpositive(q){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:f8.toString(q)})}nonnegative(q){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:f8.toString(q)})}multipleOf(q,_){return this._addCheck({kind:"multipleOf",value:q,message:f8.toString(_)})}get minValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q}get maxValue(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value{return new tq({checks:[],typeName:W8.ZodBigInt,coerce:q?.coerce??!1,...Z8(q)})};c_=class c_ extends k8{_parse(q){if(this._def.coerce)q.data=Boolean(q.data);if(this._getType(q)!==s.boolean){let j=this._getOrReturnCtx(q);return F(j,{code:t.invalid_type,expected:s.boolean,received:j.parsedType}),v8}return D6(q.data)}};c_.create=(q)=>{return new c_({typeName:W8.ZodBoolean,coerce:q?.coerce||!1,...Z8(q)})};w_=class w_ extends k8{_parse(q){if(this._def.coerce)q.data=new Date(q.data);if(this._getType(q)!==s.date){let Y=this._getOrReturnCtx(q);return F(Y,{code:t.invalid_type,expected:s.date,received:Y.parsedType}),v8}if(Number.isNaN(q.data.getTime())){let Y=this._getOrReturnCtx(q);return F(Y,{code:t.invalid_date}),v8}let j=new k6,K=void 0;for(let Y of this._def.checks)if(Y.kind==="min"){if(q.data.getTime()Y.value)K=this._getOrReturnCtx(q,K),F(K,{code:t.too_big,message:Y.message,inclusive:!0,exact:!1,maximum:Y.value,type:"date"}),j.dirty()}else h8.assertNever(Y);return{status:j.value,value:new Date(q.data.getTime())}}_addCheck(q){return new w_({...this._def,checks:[...this._def.checks,q]})}min(q,_){return this._addCheck({kind:"min",value:q.getTime(),message:f8.toString(_)})}max(q,_){return this._addCheck({kind:"max",value:q.getTime(),message:f8.toString(_)})}get minDate(){let q=null;for(let _ of this._def.checks)if(_.kind==="min"){if(q===null||_.value>q)q=_.value}return q!=null?new Date(q):null}get maxDate(){let q=null;for(let _ of this._def.checks)if(_.kind==="max"){if(q===null||_.value{return new w_({checks:[],coerce:q?.coerce||!1,typeName:W8.ZodDate,...Z8(q)})};gK=class gK extends k8{_parse(q){if(this._getType(q)!==s.symbol){let j=this._getOrReturnCtx(q);return F(j,{code:t.invalid_type,expected:s.symbol,received:j.parsedType}),v8}return D6(q.data)}};gK.create=(q)=>{return new gK({typeName:W8.ZodSymbol,...Z8(q)})};r_=class r_ extends k8{_parse(q){if(this._getType(q)!==s.undefined){let j=this._getOrReturnCtx(q);return F(j,{code:t.invalid_type,expected:s.undefined,received:j.parsedType}),v8}return D6(q.data)}};r_.create=(q)=>{return new r_({typeName:W8.ZodUndefined,...Z8(q)})};i_=class i_ extends k8{_parse(q){if(this._getType(q)!==s.null){let j=this._getOrReturnCtx(q);return F(j,{code:t.invalid_type,expected:s.null,received:j.parsedType}),v8}return D6(q.data)}};i_.create=(q)=>{return new i_({typeName:W8.ZodNull,...Z8(q)})};O_=class O_ extends k8{constructor(){super(...arguments);this._any=!0}_parse(q){return D6(q.data)}};O_.create=(q)=>{return new O_({typeName:W8.ZodAny,...Z8(q)})};aq=class aq extends k8{constructor(){super(...arguments);this._unknown=!0}_parse(q){return D6(q.data)}};aq.create=(q)=>{return new aq({typeName:W8.ZodUnknown,...Z8(q)})};Xq=class Xq extends k8{_parse(q){let _=this._getOrReturnCtx(q);return F(_,{code:t.invalid_type,expected:s.never,received:_.parsedType}),v8}};Xq.create=(q)=>{return new Xq({typeName:W8.ZodNever,...Z8(q)})};yK=class yK extends k8{_parse(q){if(this._getType(q)!==s.undefined){let j=this._getOrReturnCtx(q);return F(j,{code:t.invalid_type,expected:s.void,received:j.parsedType}),v8}return D6(q.data)}};yK.create=(q)=>{return new yK({typeName:W8.ZodVoid,...Z8(q)})};fq=class fq extends k8{_parse(q){let{ctx:_,status:j}=this._processInputParams(q),K=this._def;if(_.parsedType!==s.array)return F(_,{code:t.invalid_type,expected:s.array,received:_.parsedType}),v8;if(K.exactLength!==null){let f=_.data.length>K.exactLength.value,P=_.data.lengthK.maxLength.value)F(_,{code:t.too_big,maximum:K.maxLength.value,type:"array",inclusive:!0,exact:!1,message:K.maxLength.message}),j.dirty()}if(_.common.async)return Promise.all([..._.data].map((f,P)=>{return K.type._parseAsync(new wq(_,f,_.path,P))})).then((f)=>{return k6.mergeArray(j,f)});let Y=[..._.data].map((f,P)=>{return K.type._parseSync(new wq(_,f,_.path,P))});return k6.mergeArray(j,Y)}get element(){return this._def.type}min(q,_){return new fq({...this._def,minLength:{value:q,message:f8.toString(_)}})}max(q,_){return new fq({...this._def,maxLength:{value:q,message:f8.toString(_)}})}length(q,_){return new fq({...this._def,exactLength:{value:q,message:f8.toString(_)}})}nonempty(q){return this.min(1,q)}};fq.create=(q,_)=>{return new fq({type:q,minLength:null,maxLength:null,exactLength:null,typeName:W8.ZodArray,...Z8(_)})};i8=class i8 extends k8{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let q=this._def.shape(),_=h8.objectKeys(q);return this._cached={shape:q,keys:_},this._cached}_parse(q){if(this._getType(q)!==s.object){let w=this._getOrReturnCtx(q);return F(w,{code:t.invalid_type,expected:s.object,received:w.parsedType}),v8}let{status:j,ctx:K}=this._processInputParams(q),{shape:Y,keys:f}=this._getCached(),P=[];if(!(this._def.catchall instanceof Xq&&this._def.unknownKeys==="strip")){for(let w in K.data)if(!f.includes(w))P.push(w)}let $=[];for(let w of f){let O=Y[w],v=K.data[w];$.push({key:{status:"valid",value:w},value:O._parse(new wq(K,v,K.path,w)),alwaysSet:w in K.data})}if(this._def.catchall instanceof Xq){let w=this._def.unknownKeys;if(w==="passthrough")for(let O of P)$.push({key:{status:"valid",value:O},value:{status:"valid",value:K.data[O]}});else if(w==="strict"){if(P.length>0)F(K,{code:t.unrecognized_keys,keys:P}),j.dirty()}else if(w==="strip");else throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let w=this._def.catchall;for(let O of P){let v=K.data[O];$.push({key:{status:"valid",value:O},value:w._parse(new wq(K,v,K.path,O)),alwaysSet:O in K.data})}}if(K.common.async)return Promise.resolve().then(async()=>{let w=[];for(let O of $){let v=await O.key,z=await O.value;w.push({key:v,value:z,alwaysSet:O.alwaysSet})}return w}).then((w)=>{return k6.mergeObjectSync(j,w)});else return k6.mergeObjectSync(j,$)}get shape(){return this._def.shape()}strict(q){return f8.errToObj,new i8({...this._def,unknownKeys:"strict",...q!==void 0?{errorMap:(_,j)=>{let K=this._def.errorMap?.(_,j).message??j.defaultError;if(_.code==="unrecognized_keys")return{message:f8.errToObj(q).message??K};return{message:K}}}:{}})}strip(){return new i8({...this._def,unknownKeys:"strip"})}passthrough(){return new i8({...this._def,unknownKeys:"passthrough"})}extend(q){return new i8({...this._def,shape:()=>({...this._def.shape(),...q})})}merge(q){return new i8({unknownKeys:q._def.unknownKeys,catchall:q._def.catchall,shape:()=>({...this._def.shape(),...q._def.shape()}),typeName:W8.ZodObject})}setKey(q,_){return this.augment({[q]:_})}catchall(q){return new i8({...this._def,catchall:q})}pick(q){let _={};for(let j of h8.objectKeys(q))if(q[j]&&this.shape[j])_[j]=this.shape[j];return new i8({...this._def,shape:()=>_})}omit(q){let _={};for(let j of h8.objectKeys(this.shape))if(!q[j])_[j]=this.shape[j];return new i8({...this._def,shape:()=>_})}deepPartial(){return p_(this)}partial(q){let _={};for(let j of h8.objectKeys(this.shape)){let K=this.shape[j];if(q&&!q[j])_[j]=K;else _[j]=K.optional()}return new i8({...this._def,shape:()=>_})}required(q){let _={};for(let j of h8.objectKeys(this.shape))if(q&&!q[j])_[j]=this.shape[j];else{let Y=this.shape[j];while(Y instanceof $q)Y=Y._def.innerType;_[j]=Y}return new i8({...this._def,shape:()=>_})}keyof(){return e5(h8.objectKeys(this.shape))}};i8.create=(q,_)=>{return new i8({shape:()=>q,unknownKeys:"strip",catchall:Xq.create(),typeName:W8.ZodObject,...Z8(_)})};i8.strictCreate=(q,_)=>{return new i8({shape:()=>q,unknownKeys:"strict",catchall:Xq.create(),typeName:W8.ZodObject,...Z8(_)})};i8.lazycreate=(q,_)=>{return new i8({shape:q,unknownKeys:"strip",catchall:Xq.create(),typeName:W8.ZodObject,...Z8(_)})};o_=class o_ extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=this._def.options;function K(Y){for(let P of Y)if(P.result.status==="valid")return P.result;for(let P of Y)if(P.result.status==="dirty")return _.common.issues.push(...P.ctx.common.issues),P.result;let f=Y.map((P)=>new y6(P.ctx.common.issues));return F(_,{code:t.invalid_union,unionErrors:f}),v8}if(_.common.async)return Promise.all(j.map(async(Y)=>{let f={..._,common:{..._.common,issues:[]},parent:null};return{result:await Y._parseAsync({data:_.data,path:_.path,parent:f}),ctx:f}})).then(K);else{let Y=void 0,f=[];for(let $ of j){let w={..._,common:{..._.common,issues:[]},parent:null},O=$._parseSync({data:_.data,path:_.path,parent:w});if(O.status==="valid")return O;else if(O.status==="dirty"&&!Y)Y={result:O,ctx:w};if(w.common.issues.length)f.push(w.common.issues)}if(Y)return _.common.issues.push(...Y.ctx.common.issues),Y.result;let P=f.map(($)=>new y6($));return F(_,{code:t.invalid_union,unionErrors:P}),v8}}get options(){return this._def.options}};o_.create=(q,_)=>{return new o_({options:q,typeName:W8.ZodUnion,...Z8(_)})};x3=class x3 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==s.object)return F(_,{code:t.invalid_type,expected:s.object,received:_.parsedType}),v8;let j=this.discriminator,K=_.data[j],Y=this.optionsMap.get(K);if(!Y)return F(_,{code:t.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[j]}),v8;if(_.common.async)return Y._parseAsync({data:_.data,path:_.path,parent:_});else return Y._parseSync({data:_.data,path:_.path,parent:_})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(q,_,j){let K=new Map;for(let Y of _){let f=Rq(Y.shape[q]);if(!f.length)throw new Error(`A discriminator value for key \`${q}\` could not be extracted from all schema options`);for(let P of f){if(K.has(P))throw new Error(`Discriminator property ${String(q)} has duplicate value ${String(P)}`);K.set(P,Y)}}return new x3({typeName:W8.ZodDiscriminatedUnion,discriminator:q,options:_,optionsMap:K,...Z8(j)})}};a_=class a_ extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q),K=(Y,f)=>{if(H4(Y)||H4(f))return v8;let P=T4(Y.value,f.value);if(!P.valid)return F(j,{code:t.invalid_intersection_types}),v8;if(J4(Y)||J4(f))_.dirty();return{status:_.value,value:P.data}};if(j.common.async)return Promise.all([this._def.left._parseAsync({data:j.data,path:j.path,parent:j}),this._def.right._parseAsync({data:j.data,path:j.path,parent:j})]).then(([Y,f])=>K(Y,f));else return K(this._def.left._parseSync({data:j.data,path:j.path,parent:j}),this._def.right._parseSync({data:j.data,path:j.path,parent:j}))}};a_.create=(q,_,j)=>{return new a_({left:q,right:_,typeName:W8.ZodIntersection,...Z8(j)})};Aq=class Aq extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==s.array)return F(j,{code:t.invalid_type,expected:s.array,received:j.parsedType}),v8;if(j.data.lengththis._def.items.length)F(j,{code:t.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_.dirty();let Y=[...j.data].map((f,P)=>{let $=this._def.items[P]||this._def.rest;if(!$)return null;return $._parse(new wq(j,f,j.path,P))}).filter((f)=>!!f);if(j.common.async)return Promise.all(Y).then((f)=>{return k6.mergeArray(_,f)});else return k6.mergeArray(_,Y)}get items(){return this._def.items}rest(q){return new Aq({...this._def,rest:q})}};Aq.create=(q,_)=>{if(!Array.isArray(q))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Aq({items:q,typeName:W8.ZodTuple,rest:null,...Z8(_)})};dK=class dK extends k8{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==s.object)return F(j,{code:t.invalid_type,expected:s.object,received:j.parsedType}),v8;let K=[],Y=this._def.keyType,f=this._def.valueType;for(let P in j.data)K.push({key:Y._parse(new wq(j,P,j.path,P)),value:f._parse(new wq(j,j.data[P],j.path,P)),alwaysSet:P in j.data});if(j.common.async)return k6.mergeObjectAsync(_,K);else return k6.mergeObjectSync(_,K)}get element(){return this._def.valueType}static create(q,_,j){if(_ instanceof k8)return new dK({keyType:q,valueType:_,typeName:W8.ZodRecord,...Z8(j)});return new dK({keyType:Yq.create(),valueType:q,typeName:W8.ZodRecord,...Z8(_)})}};pK=class pK extends k8{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==s.map)return F(j,{code:t.invalid_type,expected:s.map,received:j.parsedType}),v8;let K=this._def.keyType,Y=this._def.valueType,f=[...j.data.entries()].map(([P,$],w)=>{return{key:K._parse(new wq(j,P,j.path,[w,"key"])),value:Y._parse(new wq(j,$,j.path,[w,"value"]))}});if(j.common.async){let P=new Map;return Promise.resolve().then(async()=>{for(let $ of f){let w=await $.key,O=await $.value;if(w.status==="aborted"||O.status==="aborted")return v8;if(w.status==="dirty"||O.status==="dirty")_.dirty();P.set(w.value,O.value)}return{status:_.value,value:P}})}else{let P=new Map;for(let $ of f){let{key:w,value:O}=$;if(w.status==="aborted"||O.status==="aborted")return v8;if(w.status==="dirty"||O.status==="dirty")_.dirty();P.set(w.value,O.value)}return{status:_.value,value:P}}}};pK.create=(q,_,j)=>{return new pK({valueType:_,keyType:q,typeName:W8.ZodMap,...Z8(j)})};z_=class z_ extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.parsedType!==s.set)return F(j,{code:t.invalid_type,expected:s.set,received:j.parsedType}),v8;let K=this._def;if(K.minSize!==null){if(j.data.sizeK.maxSize.value)F(j,{code:t.too_big,maximum:K.maxSize.value,type:"set",inclusive:!0,exact:!1,message:K.maxSize.message}),_.dirty()}let Y=this._def.valueType;function f($){let w=new Set;for(let O of $){if(O.status==="aborted")return v8;if(O.status==="dirty")_.dirty();w.add(O.value)}return{status:_.value,value:w}}let P=[...j.data.values()].map(($,w)=>Y._parse(new wq(j,$,j.path,w)));if(j.common.async)return Promise.all(P).then(($)=>f($));else return f(P)}min(q,_){return new z_({...this._def,minSize:{value:q,message:f8.toString(_)}})}max(q,_){return new z_({...this._def,maxSize:{value:q,message:f8.toString(_)}})}size(q,_){return this.min(q,_).max(q,_)}nonempty(q){return this.min(1,q)}};z_.create=(q,_)=>{return new z_({valueType:q,minSize:null,maxSize:null,typeName:W8.ZodSet,...Z8(_)})};x_=class x_ extends k8{constructor(){super(...arguments);this.validate=this.implement}_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==s.function)return F(_,{code:t.invalid_type,expected:s.function,received:_.parsedType}),v8;function j(P,$){return l3({data:P,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,L3(),n_].filter((w)=>!!w),issueData:{code:t.invalid_arguments,argumentsError:$}})}function K(P,$){return l3({data:P,path:_.path,errorMaps:[_.common.contextualErrorMap,_.schemaErrorMap,L3(),n_].filter((w)=>!!w),issueData:{code:t.invalid_return_type,returnTypeError:$}})}let Y={errorMap:_.common.contextualErrorMap},f=_.data;if(this._def.returns instanceof v_){let P=this;return D6(async function(...$){let w=new y6([]),O=await P._def.args.parseAsync($,Y).catch((W)=>{throw w.addIssue(j($,W)),w}),v=await Reflect.apply(f,this,O);return await P._def.returns._def.type.parseAsync(v,Y).catch((W)=>{throw w.addIssue(K(v,W)),w})})}else{let P=this;return D6(function(...$){let w=P._def.args.safeParse($,Y);if(!w.success)throw new y6([j($,w.error)]);let O=Reflect.apply(f,this,w.data),v=P._def.returns.safeParse(O,Y);if(!v.success)throw new y6([K(O,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...q){return new x_({...this._def,args:Aq.create(q).rest(aq.create())})}returns(q){return new x_({...this._def,returns:q})}implement(q){return this.parse(q)}strictImplement(q){return this.parse(q)}static create(q,_,j){return new x_({args:q?q:Aq.create([]).rest(aq.create()),returns:_||aq.create(),typeName:W8.ZodFunction,...Z8(j)})}};B_=class B_ extends k8{get schema(){return this._def.getter()}_parse(q){let{ctx:_}=this._processInputParams(q);return this._def.getter()._parse({data:_.data,path:_.path,parent:_})}};B_.create=(q,_)=>{return new B_({getter:q,typeName:W8.ZodLazy,...Z8(_)})};t_=class t_ extends k8{_parse(q){if(q.data!==this._def.value){let _=this._getOrReturnCtx(q);return F(_,{received:_.data,code:t.invalid_literal,expected:this._def.value}),v8}return{status:"valid",value:q.data}}get value(){return this._def.value}};t_.create=(q,_)=>{return new t_({value:q,typeName:W8.ZodLiteral,...Z8(_)})};eq=class eq extends k8{_parse(q){if(typeof q.data!=="string"){let _=this._getOrReturnCtx(q),j=this._def.values;return F(_,{expected:h8.joinValues(j),received:_.parsedType,code:t.invalid_type}),v8}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(q.data)){let _=this._getOrReturnCtx(q),j=this._def.values;return F(_,{received:_.data,code:t.invalid_enum_value,options:j}),v8}return D6(q.data)}get options(){return this._def.values}get enum(){let q={};for(let _ of this._def.values)q[_]=_;return q}get Values(){let q={};for(let _ of this._def.values)q[_]=_;return q}get Enum(){let q={};for(let _ of this._def.values)q[_]=_;return q}extract(q,_=this._def){return eq.create(q,{...this._def,..._})}exclude(q,_=this._def){return eq.create(this.options.filter((j)=>!q.includes(j)),{...this._def,..._})}};eq.create=e5;e_=class e_ extends k8{_parse(q){let _=h8.getValidEnumValues(this._def.values),j=this._getOrReturnCtx(q);if(j.parsedType!==s.string&&j.parsedType!==s.number){let K=h8.objectValues(_);return F(j,{expected:h8.joinValues(K),received:j.parsedType,code:t.invalid_type}),v8}if(!this._cache)this._cache=new Set(h8.getValidEnumValues(this._def.values));if(!this._cache.has(q.data)){let K=h8.objectValues(_);return F(j,{received:j.data,code:t.invalid_enum_value,options:K}),v8}return D6(q.data)}get enum(){return this._def.values}};e_.create=(q,_)=>{return new e_({values:q,typeName:W8.ZodNativeEnum,...Z8(_)})};v_=class v_ extends k8{unwrap(){return this._def.type}_parse(q){let{ctx:_}=this._processInputParams(q);if(_.parsedType!==s.promise&&_.common.async===!1)return F(_,{code:t.invalid_type,expected:s.promise,received:_.parsedType}),v8;let j=_.parsedType===s.promise?_.data:Promise.resolve(_.data);return D6(j.then((K)=>{return this._def.type.parseAsync(K,{path:_.path,errorMap:_.common.contextualErrorMap})}))}};v_.create=(q,_)=>{return new v_({type:q,typeName:W8.ZodPromise,...Z8(_)})};B6=class B6 extends k8{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===W8.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(q){let{status:_,ctx:j}=this._processInputParams(q),K=this._def.effect||null,Y={addIssue:(f)=>{if(F(j,f),f.fatal)_.abort();else _.dirty()},get path(){return j.path}};if(Y.addIssue=Y.addIssue.bind(Y),K.type==="preprocess"){let f=K.transform(j.data,Y);if(j.common.async)return Promise.resolve(f).then(async(P)=>{if(_.value==="aborted")return v8;let $=await this._def.schema._parseAsync({data:P,path:j.path,parent:j});if($.status==="aborted")return v8;if($.status==="dirty")return l_($.value);if(_.value==="dirty")return l_($.value);return $});else{if(_.value==="aborted")return v8;let P=this._def.schema._parseSync({data:f,path:j.path,parent:j});if(P.status==="aborted")return v8;if(P.status==="dirty")return l_(P.value);if(_.value==="dirty")return l_(P.value);return P}}if(K.type==="refinement"){let f=(P)=>{let $=K.refinement(P,Y);if(j.common.async)return Promise.resolve($);if($ instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return P};if(j.common.async===!1){let P=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});if(P.status==="aborted")return v8;if(P.status==="dirty")_.dirty();return f(P.value),{status:_.value,value:P.value}}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then((P)=>{if(P.status==="aborted")return v8;if(P.status==="dirty")_.dirty();return f(P.value).then(()=>{return{status:_.value,value:P.value}})})}if(K.type==="transform")if(j.common.async===!1){let f=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});if(!$_(f))return v8;let P=K.transform(f.value,Y);if(P instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:_.value,value:P}}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then((f)=>{if(!$_(f))return v8;return Promise.resolve(K.transform(f.value,Y)).then((P)=>({status:_.value,value:P}))});h8.assertNever(K)}};B6.create=(q,_,j)=>{return new B6({schema:q,typeName:W8.ZodEffects,effect:_,...Z8(j)})};B6.createWithPreprocess=(q,_,j)=>{return new B6({schema:_,effect:{type:"preprocess",transform:q},typeName:W8.ZodEffects,...Z8(j)})};$q=class $q extends k8{_parse(q){if(this._getType(q)===s.undefined)return D6(void 0);return this._def.innerType._parse(q)}unwrap(){return this._def.innerType}};$q.create=(q,_)=>{return new $q({innerType:q,typeName:W8.ZodOptional,...Z8(_)})};Iq=class Iq extends k8{_parse(q){if(this._getType(q)===s.null)return D6(null);return this._def.innerType._parse(q)}unwrap(){return this._def.innerType}};Iq.create=(q,_)=>{return new Iq({innerType:q,typeName:W8.ZodNullable,...Z8(_)})};F_=class F_ extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;if(_.parsedType===s.undefined)j=this._def.defaultValue();return this._def.innerType._parse({data:j,path:_.path,parent:_})}removeDefault(){return this._def.innerType}};F_.create=(q,_)=>{return new F_({innerType:q,typeName:W8.ZodDefault,defaultValue:typeof _.default==="function"?_.default:()=>_.default,...Z8(_)})};U_=class U_ extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j={..._,common:{..._.common,issues:[]}},K=this._def.innerType._parse({data:j.data,path:j.path,parent:{...j}});if(IK(K))return K.then((Y)=>{return{status:"valid",value:Y.status==="valid"?Y.value:this._def.catchValue({get error(){return new y6(j.common.issues)},input:j.data})}});else return{status:"valid",value:K.status==="valid"?K.value:this._def.catchValue({get error(){return new y6(j.common.issues)},input:j.data})}}removeCatch(){return this._def.innerType}};U_.create=(q,_)=>{return new U_({innerType:q,typeName:W8.ZodCatch,catchValue:typeof _.catch==="function"?_.catch:()=>_.catch,...Z8(_)})};LK=class LK extends k8{_parse(q){if(this._getType(q)!==s.nan){let j=this._getOrReturnCtx(q);return F(j,{code:t.invalid_type,expected:s.nan,received:j.parsedType}),v8}return{status:"valid",value:q.data}}};LK.create=(q)=>{return new LK({typeName:W8.ZodNaN,...Z8(q)})};Sz=Symbol("zod_brand");n3=class n3 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;return this._def.type._parse({data:j,path:_.path,parent:_})}unwrap(){return this._def.type}};lK=class lK extends k8{_parse(q){let{status:_,ctx:j}=this._processInputParams(q);if(j.common.async)return(async()=>{let Y=await this._def.in._parseAsync({data:j.data,path:j.path,parent:j});if(Y.status==="aborted")return v8;if(Y.status==="dirty")return _.dirty(),l_(Y.value);else return this._def.out._parseAsync({data:Y.value,path:j.path,parent:j})})();else{let K=this._def.in._parseSync({data:j.data,path:j.path,parent:j});if(K.status==="aborted")return v8;if(K.status==="dirty")return _.dirty(),{status:"dirty",value:K.value};else return this._def.out._parseSync({data:K.value,path:j.path,parent:j})}}static create(q,_){return new lK({in:q,out:_,typeName:W8.ZodPipeline})}};s_=class s_ extends k8{_parse(q){let _=this._def.innerType._parse(q),j=(K)=>{if($_(K))K.value=Object.freeze(K.value);return K};return IK(_)?_.then((K)=>j(K)):j(_)}unwrap(){return this._def.innerType}};s_.create=(q,_)=>{return new s_({innerType:q,typeName:W8.ZodReadonly,...Z8(_)})};Ez={object:i8.lazycreate};(function(q){q.ZodString="ZodString",q.ZodNumber="ZodNumber",q.ZodNaN="ZodNaN",q.ZodBigInt="ZodBigInt",q.ZodBoolean="ZodBoolean",q.ZodDate="ZodDate",q.ZodSymbol="ZodSymbol",q.ZodUndefined="ZodUndefined",q.ZodNull="ZodNull",q.ZodAny="ZodAny",q.ZodUnknown="ZodUnknown",q.ZodNever="ZodNever",q.ZodVoid="ZodVoid",q.ZodArray="ZodArray",q.ZodObject="ZodObject",q.ZodUnion="ZodUnion",q.ZodDiscriminatedUnion="ZodDiscriminatedUnion",q.ZodIntersection="ZodIntersection",q.ZodTuple="ZodTuple",q.ZodRecord="ZodRecord",q.ZodMap="ZodMap",q.ZodSet="ZodSet",q.ZodFunction="ZodFunction",q.ZodLazy="ZodLazy",q.ZodLiteral="ZodLiteral",q.ZodEnum="ZodEnum",q.ZodEffects="ZodEffects",q.ZodNativeEnum="ZodNativeEnum",q.ZodOptional="ZodOptional",q.ZodNullable="ZodNullable",q.ZodDefault="ZodDefault",q.ZodCatch="ZodCatch",q.ZodPromise="ZodPromise",q.ZodBranded="ZodBranded",q.ZodPipeline="ZodPipeline",q.ZodReadonly="ZodReadonly"})(W8||(W8={}));U5=Yq.create,s5=Bq.create,mz=LK.create,Iz=tq.create,Q5=c_.create,gz=w_.create,yz=gK.create,dz=r_.create,pz=i_.create,Lz=O_.create,lz=aq.create,xz=Xq.create,nz=yK.create,cz=fq.create,rz=i8.create,iz=i8.strictCreate,oz=o_.create,az=x3.create,Bz=a_.create,tz=Aq.create,ez=dK.create,Fz=pK.create,Uz=z_.create,sz=x_.create,Qz=B_.create,qv=t_.create,_v=eq.create,Kv=e_.create,jv=v_.create,g5=B6.create,Pv=$q.create,Yv=Iq.create,fv=B6.createWithPreprocess,$v=lK.create,vv={string:(q)=>Yq.create({...q,coerce:!0}),number:(q)=>Bq.create({...q,coerce:!0}),boolean:(q)=>c_.create({...q,coerce:!0}),bigint:(q)=>tq.create({...q,coerce:!0}),date:(q)=>w_.create({...q,coerce:!0})},Wv=v8,q1=k.union([k.string(),k.number().int()]),_1=k.string(),Hv=k.object({progressToken:k.optional(q1)}).passthrough(),t6=k.object({_meta:k.optional(Hv)}).passthrough(),E6=k.object({method:k.string(),params:k.optional(t6)}),xK=k.object({_meta:k.optional(k.object({}).passthrough())}).passthrough(),Gq=k.object({method:k.string(),params:k.optional(xK)}),e6=k.object({_meta:k.optional(k.object({}).passthrough())}).passthrough(),r3=k.union([k.string(),k.number().int()]),Jv=k.object({jsonrpc:k.literal(c3),id:r3}).merge(E6).strict(),Tv=k.object({jsonrpc:k.literal(c3)}).merge(Gq).strict(),Zv=k.object({jsonrpc:k.literal(c3),id:r3,result:e6}).strict();(function(q){q[q.ConnectionClosed=-32000]="ConnectionClosed",q[q.RequestTimeout=-32001]="RequestTimeout",q[q.ParseError=-32700]="ParseError",q[q.InvalidRequest=-32600]="InvalidRequest",q[q.MethodNotFound=-32601]="MethodNotFound",q[q.InvalidParams=-32602]="InvalidParams",q[q.InternalError=-32603]="InternalError"})(y5||(y5={}));kv=k.object({jsonrpc:k.literal(c3),id:r3,error:k.object({code:k.number().int(),message:k.string(),data:k.optional(k.unknown())})}).strict(),zC=k.union([Jv,Tv,Zv,kv]),K1=e6.strict(),j1=Gq.extend({method:k.literal("notifications/cancelled"),params:xK.extend({requestId:r3,reason:k.string().optional()})}),nK=k.object({name:k.string(),title:k.optional(k.string())}).passthrough(),P1=nK.extend({version:k.string()}),Xv=k.object({experimental:k.optional(k.object({}).passthrough()),sampling:k.optional(k.object({}).passthrough()),elicitation:k.optional(k.object({}).passthrough()),roots:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough())}).passthrough(),Av=E6.extend({method:k.literal("initialize"),params:t6.extend({protocolVersion:k.string(),capabilities:Xv,clientInfo:P1})}),Gv=k.object({experimental:k.optional(k.object({}).passthrough()),logging:k.optional(k.object({}).passthrough()),completions:k.optional(k.object({}).passthrough()),prompts:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough()),resources:k.optional(k.object({subscribe:k.optional(k.boolean()),listChanged:k.optional(k.boolean())}).passthrough()),tools:k.optional(k.object({listChanged:k.optional(k.boolean())}).passthrough())}).passthrough(),uv=e6.extend({protocolVersion:k.string(),capabilities:Gv,serverInfo:P1,instructions:k.optional(k.string())}),hv=Gq.extend({method:k.literal("notifications/initialized")}),Y1=E6.extend({method:k.literal("ping")}),Dv=k.object({progress:k.number(),total:k.optional(k.number()),message:k.optional(k.string())}).passthrough(),f1=Gq.extend({method:k.literal("notifications/progress"),params:xK.merge(Dv).extend({progressToken:q1})}),i3=E6.extend({params:t6.extend({cursor:k.optional(_1)}).optional()}),o3=e6.extend({nextCursor:k.optional(_1)}),$1=k.object({uri:k.string(),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}).passthrough(),w1=$1.extend({text:k.string()}),u4=k.string().refine((q)=>{try{return atob(q),!0}catch(_){return!1}},{message:"Invalid Base64 string"}),O1=$1.extend({blob:u4}),z1=nK.extend({uri:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}),Cv=nK.extend({uriTemplate:k.string(),description:k.optional(k.string()),mimeType:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}),Vv=i3.extend({method:k.literal("resources/list")}),Mv=o3.extend({resources:k.array(z1)}),Nv=i3.extend({method:k.literal("resources/templates/list")}),bv=o3.extend({resourceTemplates:k.array(Cv)}),Sv=E6.extend({method:k.literal("resources/read"),params:t6.extend({uri:k.string()})}),Ev=e6.extend({contents:k.array(k.union([w1,O1]))}),Rv=Gq.extend({method:k.literal("notifications/resources/list_changed")}),mv=E6.extend({method:k.literal("resources/subscribe"),params:t6.extend({uri:k.string()})}),Iv=E6.extend({method:k.literal("resources/unsubscribe"),params:t6.extend({uri:k.string()})}),gv=Gq.extend({method:k.literal("notifications/resources/updated"),params:xK.extend({uri:k.string()})}),yv=k.object({name:k.string(),description:k.optional(k.string()),required:k.optional(k.boolean())}).passthrough(),dv=nK.extend({description:k.optional(k.string()),arguments:k.optional(k.array(yv)),_meta:k.optional(k.object({}).passthrough())}),pv=i3.extend({method:k.literal("prompts/list")}),Lv=o3.extend({prompts:k.array(dv)}),lv=E6.extend({method:k.literal("prompts/get"),params:t6.extend({name:k.string(),arguments:k.optional(k.record(k.string()))})}),h4=k.object({type:k.literal("text"),text:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),D4=k.object({type:k.literal("image"),data:u4,mimeType:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),C4=k.object({type:k.literal("audio"),data:u4,mimeType:k.string(),_meta:k.optional(k.object({}).passthrough())}).passthrough(),xv=k.object({type:k.literal("resource"),resource:k.union([w1,O1]),_meta:k.optional(k.object({}).passthrough())}).passthrough(),nv=z1.extend({type:k.literal("resource_link")}),v1=k.union([h4,D4,C4,nv,xv]),cv=k.object({role:k.enum(["user","assistant"]),content:v1}).passthrough(),rv=e6.extend({description:k.optional(k.string()),messages:k.array(cv)}),iv=Gq.extend({method:k.literal("notifications/prompts/list_changed")}),ov=k.object({title:k.optional(k.string()),readOnlyHint:k.optional(k.boolean()),destructiveHint:k.optional(k.boolean()),idempotentHint:k.optional(k.boolean()),openWorldHint:k.optional(k.boolean())}).passthrough(),av=nK.extend({description:k.optional(k.string()),inputSchema:k.object({type:k.literal("object"),properties:k.optional(k.object({}).passthrough()),required:k.optional(k.array(k.string()))}).passthrough(),outputSchema:k.optional(k.object({type:k.literal("object"),properties:k.optional(k.object({}).passthrough()),required:k.optional(k.array(k.string()))}).passthrough()),annotations:k.optional(ov),_meta:k.optional(k.object({}).passthrough())}),Bv=i3.extend({method:k.literal("tools/list")}),tv=o3.extend({tools:k.array(av)}),W1=e6.extend({content:k.array(v1).default([]),structuredContent:k.object({}).passthrough().optional(),isError:k.optional(k.boolean())}),vC=W1.or(e6.extend({toolResult:k.unknown()})),ev=E6.extend({method:k.literal("tools/call"),params:t6.extend({name:k.string(),arguments:k.optional(k.record(k.unknown()))})}),Fv=Gq.extend({method:k.literal("notifications/tools/list_changed")}),H1=k.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),Uv=E6.extend({method:k.literal("logging/setLevel"),params:t6.extend({level:H1})}),sv=Gq.extend({method:k.literal("notifications/message"),params:xK.extend({level:H1,logger:k.optional(k.string()),data:k.unknown()})}),Qv=k.object({name:k.string().optional()}).passthrough(),qW=k.object({hints:k.optional(k.array(Qv)),costPriority:k.optional(k.number().min(0).max(1)),speedPriority:k.optional(k.number().min(0).max(1)),intelligencePriority:k.optional(k.number().min(0).max(1))}).passthrough(),_W=k.object({role:k.enum(["user","assistant"]),content:k.union([h4,D4,C4])}).passthrough(),KW=E6.extend({method:k.literal("sampling/createMessage"),params:t6.extend({messages:k.array(_W),systemPrompt:k.optional(k.string()),includeContext:k.optional(k.enum(["none","thisServer","allServers"])),temperature:k.optional(k.number()),maxTokens:k.number().int(),stopSequences:k.optional(k.array(k.string())),metadata:k.optional(k.object({}).passthrough()),modelPreferences:k.optional(qW)})}),jW=e6.extend({model:k.string(),stopReason:k.optional(k.enum(["endTurn","stopSequence","maxTokens"]).or(k.string())),role:k.enum(["user","assistant"]),content:k.discriminatedUnion("type",[h4,D4,C4])}),PW=k.object({type:k.literal("boolean"),title:k.optional(k.string()),description:k.optional(k.string()),default:k.optional(k.boolean())}).passthrough(),YW=k.object({type:k.literal("string"),title:k.optional(k.string()),description:k.optional(k.string()),minLength:k.optional(k.number()),maxLength:k.optional(k.number()),format:k.optional(k.enum(["email","uri","date","date-time"]))}).passthrough(),fW=k.object({type:k.enum(["number","integer"]),title:k.optional(k.string()),description:k.optional(k.string()),minimum:k.optional(k.number()),maximum:k.optional(k.number())}).passthrough(),$W=k.object({type:k.literal("string"),title:k.optional(k.string()),description:k.optional(k.string()),enum:k.array(k.string()),enumNames:k.optional(k.array(k.string()))}).passthrough(),wW=k.union([PW,YW,fW,$W]),OW=E6.extend({method:k.literal("elicitation/create"),params:t6.extend({message:k.string(),requestedSchema:k.object({type:k.literal("object"),properties:k.record(k.string(),wW),required:k.optional(k.array(k.string()))}).passthrough()})}),zW=e6.extend({action:k.enum(["accept","decline","cancel"]),content:k.optional(k.record(k.string(),k.unknown()))}),vW=k.object({type:k.literal("ref/resource"),uri:k.string()}).passthrough(),WW=k.object({type:k.literal("ref/prompt"),name:k.string()}).passthrough(),HW=E6.extend({method:k.literal("completion/complete"),params:t6.extend({ref:k.union([WW,vW]),argument:k.object({name:k.string(),value:k.string()}).passthrough(),context:k.optional(k.object({arguments:k.optional(k.record(k.string(),k.string()))}))})}),JW=e6.extend({completion:k.object({values:k.array(k.string()).max(100),total:k.optional(k.number().int()),hasMore:k.optional(k.boolean())}).passthrough()}),TW=k.object({uri:k.string().startsWith("file://"),name:k.optional(k.string()),_meta:k.optional(k.object({}).passthrough())}).passthrough(),ZW=E6.extend({method:k.literal("roots/list")}),kW=e6.extend({roots:k.array(TW)}),XW=Gq.extend({method:k.literal("notifications/roots/list_changed")}),WC=k.union([Y1,Av,HW,Uv,lv,pv,Vv,Nv,Sv,mv,Iv,ev,Bv]),HC=k.union([j1,f1,hv,XW]),JC=k.union([K1,jW,zW,kW]),TC=k.union([Y1,KW,OW,ZW]),ZC=k.union([j1,f1,sv,gv,Rv,Fv,iv]),kC=k.union([K1,uv,JW,rv,Lv,Mv,bv,Ev,W1,tv]),XC=HO(tO(),1),AC=Symbol("Let zodToJsonSchema decide on which parser to use"),GC=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");(function(q){q.Completable="McpCompletable"})(Z4||(Z4={}));k4=class k4 extends k8{_parse(q){let{ctx:_}=this._processInputParams(q),j=_.data;return this._def.type._parse({data:j,path:_.path,parent:_})}unwrap(){return this._def.type}};k4.create=(q,_)=>{return new k4({type:q,typeName:Z4.Completable,complete:_.complete,...AW(_)})}});var J1={};EK(J1,{version:()=>hW,type:()=>CW,scripts:()=>MW,repository:()=>EW,publishConfig:()=>IW,name:()=>uW,main:()=>VW,license:()=>SW,keywords:()=>NW,homepage:()=>RW,files:()=>LW,engines:()=>dW,devDependencies:()=>yW,description:()=>DW,dependencies:()=>gW,default:()=>lW,bugs:()=>mW,bin:()=>pW,author:()=>bW});var uW="claude-mem",hW="3.6.10",DW="Memory compression system for Claude Code - persist context across sessions",CW="module",VW="claude-mem",MW,NW,bW="Alex Newman",SW="SEE LICENSE IN LICENSE",EW,RW="https://github.com/thedotmack/claude-mem#readme",mW,IW,gW,yW,dW,pW,LW,lW;var T1=f6(()=>{MW={dev:"tsx src/bin/cli.ts","dev:install":"node dist/claude-mem.min.js install --force","dev:status":"node dist/claude-mem.min.js status","dev:compress":"node dist/claude-mem.min.js compress","dev:load":"node dist/claude-mem.min.js load-context","dev:uninstall":"node dist/claude-mem.min.js uninstall",build:"./scripts/build-minified.sh","test:watch":"npm test -- --watch",lint:"eslint 'src/**/*.ts' 'hooks/**/*.ts' 'test/**/*.ts'","lint:fix":"npm run lint -- --fix",format:"prettier --write 'src/**/*.ts' 'hooks/**/*.ts' 'test/**/*.ts'","build:npm":"./scripts/npm-publish.sh",publish:"./scripts/publish-with-changelog.sh","publish:latest":"./scripts/publish-with-changelog.sh bump","publish:github":"./scripts/github-publish.sh"},NW=["claude","claude-code","mcp","memory","compression","knowledge-graph","transcript","cli","typescript","bun"],EW={type:"git",url:"https://github.com/thedotmack/claude-mem.git"},mW={url:"https://github.com/thedotmack/claude-mem/issues"},IW={access:"public",registry:"https://registry.npmjs.org/"},gW={"@anthropic-ai/claude-code":"^1.0.88","@clack/prompts":"^0.11.0","@modelcontextprotocol/sdk":"^0.5.0",boxen:"^8.0.1",chalk:"^5.6.0",chromadb:"^3.0.14",commander:"^14.0.0",cors:"^2.8.5",express:"^5.1.0",glob:"^11.0.3","gradient-string":"^3.0.0",handlebars:"^4.7.8",http:"^0.0.1-security","oh-my-logo":"^0.3.2",open:"^10.2.0"},yW={"@types/chai":"^4.3.0","@types/handlebars":"^4.0.40","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0",chai:"^4.3.0",eslint:"^8.0.0",prettier:"^3.0.0","ts-node":"^10.0.0",tsx:"^4.20.5",typescript:"^5.0.0"},dW={node:">=18.0.0",bun:">=1.0.0"},pW={"claude-mem":"dist/claude-mem.min.js"},LW=["dist","hooks","commands","docs","src","CHANGELOG.md"],lW={name:uW,version:hW,description:DW,type:CW,main:VW,scripts:MW,keywords:NW,author:bW,license:SW,repository:EW,homepage:RW,bugs:mW,publishConfig:IW,dependencies:gW,devDependencies:yW,engines:dW,bin:pW,files:LW}});import{join as U8,dirname as B3,sep as xW}from"path";import{homedir as V4}from"os";import{existsSync as cK,statSync as nW}from"fs";import{execSync as cW}from"child_process";import{fileURLToPath as rW}from"url";class $8{static instance=null;_dataDirectory=null;_packageRoot=null;_claudeConfigDirectory=null;static getInstance(){if(!$8.instance)$8.instance=new $8;return $8.instance}getDataDirectory(){if(this._dataDirectory)return this._dataDirectory;return this._dataDirectory=process.env.CLAUDE_MEM_DATA_DIR||U8(V4(),".claude-mem"),this._dataDirectory}getArchivesDirectory(){return U8(this.getDataDirectory(),"archives")}getHooksDirectory(){return U8(this.getDataDirectory(),"hooks")}getLogsDirectory(){return U8(this.getDataDirectory(),"logs")}getIndexDirectory(){return this.getDataDirectory()}getIndexPath(){return U8(this.getIndexDirectory(),"claude-mem-index.jsonl")}getTrashDirectory(){return U8(this.getDataDirectory(),"trash")}getBackupsDirectory(){return U8(this.getDataDirectory(),"backups")}getChromaDirectory(){return U8(this.getDataDirectory(),"chroma")}getProjectArchiveDirectory(q){return U8(this.getArchivesDirectory(),q)}getUserSettingsPath(){return U8(this.getDataDirectory(),"settings.json")}getClaudeConfigDirectory(){if(this._claudeConfigDirectory)return this._claudeConfigDirectory;return this._claudeConfigDirectory=process.env.CLAUDE_CONFIG_DIR||U8(V4(),".claude"),this._claudeConfigDirectory}getClaudeSettingsPath(){return U8(this.getClaudeConfigDirectory(),"settings.json")}getClaudeCommandsDirectory(){return U8(this.getClaudeConfigDirectory(),"commands")}getClaudeMdPath(){return U8(this.getClaudeConfigDirectory(),"CLAUDE.md")}getMcpConfigPath(){return U8(V4(),".claude.json")}getProjectMcpConfigPath(){return U8(process.cwd(),".mcp.json")}getPackageRoot(){if(this._packageRoot)return this._packageRoot;try{let j=h6.resolve("/Users/alexnewman/Scripts/claude-mem-source/package.json");return this._packageRoot=B3(j),this._packageRoot}catch{}let q=rW(import.meta.url),_=B3(q);for(let j=0;j<10;j++){let K=U8(_,"package.json");if(cK(K))try{if(h6(K).name==="claude-mem")return this._packageRoot=_,this._packageRoot}catch{}let Y=B3(_);if(Y===_)break;_=Y}try{let j=cW("npm list -g claude-mem --json 2>/dev/null || npm list claude-mem --json 2>/dev/null",{encoding:"utf8"}),K=JSON.parse(j);if(K.dependencies?.["claude-mem"]?.resolved)return this._packageRoot=B3(K.dependencies["claude-mem"].resolved),this._packageRoot}catch{}throw new Error("Cannot locate claude-mem package root. Ensure claude-mem is properly installed.")}findPackageHooksDirectory(){let q=this.getPackageRoot(),_=U8(q,"hooks"),j=["pre-compact.js","session-start.js"];for(let K of j)if(!cK(U8(_,K)))throw new Error(`Package hooks directory missing required file: ${K}`);return _}findPackageCommandsDirectory(){let q=this.getPackageRoot(),_=U8(q,"commands"),j=["save.md"];for(let K of j)if(!cK(U8(_,K)))throw new Error(`Package commands directory missing required file: ${K}`);return _}ensureDirectory(q){if(!cK(q))h6("fs").mkdirSync(q,{recursive:!0})}ensureDirectories(q){q.forEach((_)=>this.ensureDirectory(_))}ensureAllDataDirectories(){this.ensureDirectories([this.getDataDirectory(),this.getArchivesDirectory(),this.getHooksDirectory(),this.getLogsDirectory(),this.getTrashDirectory(),this.getBackupsDirectory(),this.getChromaDirectory()])}ensureAllClaudeDirectories(){this.ensureDirectories([this.getClaudeConfigDirectory(),this.getClaudeCommandsDirectory()])}static extractProjectName(q){let _=q.split(xW),j=["src","lib","app","project","workspace"];for(let K=_.length-1;K>=0;K--)if(j.includes(_[K])&&K>0)return _[K-1];if(_.length>1)return _[_.length-2];return"unknown-project"}static getCurrentProjectName(){return h6("path").basename(process.cwd())}static createBackupFilename(q){let _=new Date().toISOString().replace(/[:.]/g,"-").replace("T","_").slice(0,19);return`${q}.backup.${_}`}static isPathAccessible(q){try{return cK(q)&&nW(q).isDirectory()}catch{return!1}}static getDataDirectory(){return $8.getInstance().getDataDirectory()}static getArchivesDirectory(){return $8.getInstance().getArchivesDirectory()}static getHooksDirectory(){return $8.getInstance().getHooksDirectory()}static getLogsDirectory(){return $8.getInstance().getLogsDirectory()}static getClaudeSettingsPath(){return $8.getInstance().getClaudeSettingsPath()}static getClaudeMdPath(){return $8.getInstance().getClaudeMdPath()}static findPackageHooksDirectory(){return $8.getInstance().findPackageHooksDirectory()}static findPackageCommandsDirectory(){return $8.getInstance().findPackageCommandsDirectory()}}var NC;var d6=f6(()=>{NC=$8.getInstance()});class yq{pathDiscovery;constructor(){this.pathDiscovery=$8.getInstance()}getConfigDir(){return this.pathDiscovery.getDataDirectory()}getIndexDir(){return this.pathDiscovery.getIndexDirectory()}getIndexPath(){return this.pathDiscovery.getIndexPath()}getArchiveDir(){return this.pathDiscovery.getArchivesDirectory()}getProjectArchiveDir(q){return this.pathDiscovery.getProjectArchiveDirectory(q)}getLogsDir(){return this.pathDiscovery.getLogsDirectory()}static ensureDirectory(q){$8.getInstance().ensureDirectory(q)}static ensureDirectories(q){$8.getInstance().ensureDirectories(q)}static extractProjectName(q){return $8.extractProjectName(q)}static getCurrentProjectPrefix(){return $8.getCurrentProjectName()}static getCurrentProjectName(){return $8.getCurrentProjectName()}}var M4=f6(()=>{d6()});var C6=_8((qH)=>{qH.__esModule=!0;qH.extend=Z1;qH.indexOf=tW;qH.escapeExpression=eW;qH.isEmpty=FW;qH.createFrame=UW;qH.blockParams=sW;qH.appendContextPath=QW;var iW={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},oW=/[&<>"'`=]/g,aW=/[&<>"'`=]/;function BW(q){return iW[q]}function Z1(q){for(var _=1;_{X1.__esModule=!0;var S4=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function E4(q,_){var j=_&&_.loc,K=void 0,Y=void 0,f=void 0,P=void 0;if(j)K=j.start.line,Y=j.end.line,f=j.start.column,P=j.end.column,q+=" - "+K+":"+f;var $=Error.prototype.constructor.call(this,q);for(var w=0;w{G1.__esModule=!0;var R4=C6();G1.default=function(q){q.registerHelper("blockHelperMissing",function(_,j){var{inverse:K,fn:Y}=j;if(_===!0)return Y(this);else if(_===!1||_==null)return K(this);else if(R4.isArray(_))if(_.length>0){if(j.ids)j.ids=[j.name];return q.helpers.each(_,j)}else return K(this);else{if(j.data&&j.ids){var f=R4.createFrame(j.data);f.contextPath=R4.appendContextPath(j.data.contextPath,j.name),j={data:f}}return Y(_,j)}})};u1.exports=G1.default});var V1=_8((D1,C1)=>{D1.__esModule=!0;function ZH(q){return q&&q.__esModule?q:{default:q}}var rK=C6(),kH=F6(),XH=ZH(kH);D1.default=function(q){q.registerHelper("each",function(_,j){if(!j)throw new XH.default("Must pass iterator to #each");var{fn:K,inverse:Y}=j,f=0,P="",$=void 0,w=void 0;if(j.data&&j.ids)w=rK.appendContextPath(j.data.contextPath,j.ids[0])+".";if(rK.isFunction(_))_=_.call(this);if(j.data)$=rK.createFrame(j.data);function O(T,H,X){if($){if($.key=T,$.index=H,$.first=H===0,$.last=!!X,w)$.contextPath=w+T}P=P+K(_[T],{data:$,blockParams:rK.blockParams([_[T],T],[w+T,null])})}if(_&&typeof _==="object")if(rK.isArray(_)){for(var v=_.length;f{M1.__esModule=!0;function uH(q){return q&&q.__esModule?q:{default:q}}var hH=F6(),DH=uH(hH);M1.default=function(q){q.registerHelper("helperMissing",function(){if(arguments.length===1)return;else throw new DH.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})};N1.exports=M1.default});var I1=_8((R1,m1)=>{R1.__esModule=!0;function MH(q){return q&&q.__esModule?q:{default:q}}var S1=C6(),NH=F6(),E1=MH(NH);R1.default=function(q){q.registerHelper("if",function(_,j){if(arguments.length!=2)throw new E1.default("#if requires exactly one argument");if(S1.isFunction(_))_=_.call(this);if(!j.hash.includeZero&&!_||S1.isEmpty(_))return j.inverse(this);else return j.fn(this)}),q.registerHelper("unless",function(_,j){if(arguments.length!=2)throw new E1.default("#unless requires exactly one argument");return q.helpers.if.call(this,_,{fn:j.inverse,inverse:j.fn,hash:j.hash})})};m1.exports=R1.default});var d1=_8((g1,y1)=>{g1.__esModule=!0;g1.default=function(q){q.registerHelper("log",function(){var _=[void 0],j=arguments[arguments.length-1];for(var K=0;K{p1.__esModule=!0;p1.default=function(q){q.registerHelper("lookup",function(_,j,K){if(!_)return _;return K.lookupProperty(_,j)})};L1.exports=p1.default});var c1=_8((x1,n1)=>{x1.__esModule=!0;function gH(q){return q&&q.__esModule?q:{default:q}}var iK=C6(),yH=F6(),dH=gH(yH);x1.default=function(q){q.registerHelper("with",function(_,j){if(arguments.length!=2)throw new dH.default("#with requires exactly one argument");if(iK.isFunction(_))_=_.call(this);var K=j.fn;if(!iK.isEmpty(_)){var Y=j.data;if(j.data&&j.ids)Y=iK.createFrame(j.data),Y.contextPath=iK.appendContextPath(j.data.contextPath,j.ids[0]);return K(_,{data:Y,blockParams:iK.blockParams([_],[Y&&Y.contextPath])})}else return j.inverse(this)})};n1.exports=x1.default});var m4=_8((_J)=>{_J.__esModule=!0;_J.registerDefaultHelpers=QH;_J.moveHelperToHooks=qJ;function W_(q){return q&&q.__esModule?q:{default:q}}var lH=h1(),xH=W_(lH),nH=V1(),cH=W_(nH),rH=b1(),iH=W_(rH),oH=I1(),aH=W_(oH),BH=d1(),tH=W_(BH),eH=l1(),FH=W_(eH),UH=c1(),sH=W_(UH);function QH(q){xH.default(q),cH.default(q),iH.default(q),aH.default(q),tH.default(q),FH.default(q),sH.default(q)}function qJ(q,_,j){if(q.helpers[_]){if(q.hooks[_]=q.helpers[_],!j)delete q.helpers[_]}}});var o1=_8((r1,i1)=>{r1.__esModule=!0;var YJ=C6();r1.default=function(q){q.registerDecorator("inline",function(_,j,K,Y){var f=_;if(!j.partials)j.partials={},f=function(P,$){var w=K.partials;K.partials=YJ.extend({},w,j.partials);var O=_(P,$);return K.partials=w,O};return j.partials[Y.args[0]]=Y.fn,f})};i1.exports=r1.default});var a1=_8((WJ)=>{WJ.__esModule=!0;WJ.registerDefaultDecorators=vJ;function wJ(q){return q&&q.__esModule?q:{default:q}}var OJ=o1(),zJ=wJ(OJ);function vJ(q){zJ.default(q)}});var I4=_8((B1,t1)=>{B1.__esModule=!0;var TJ=C6(),qK={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function q(_){if(typeof _==="string"){var j=TJ.indexOf(qK.methodMap,_.toLowerCase());if(j>=0)_=j;else _=parseInt(_,10)}return _},log:function q(_){if(_=qK.lookupLevel(_),typeof console!=="undefined"&&qK.lookupLevel(qK.level)<=_){var j=qK.methodMap[_];if(!console[j])j="log";for(var K=arguments.length,Y=Array(K>1?K-1:0),f=1;f{GJ.__esModule=!0;GJ.createNewLookupObject=AJ;var XJ=C6();function AJ(){for(var q=arguments.length,_=Array(q),j=0;j{EJ.__esModule=!0;EJ.createProtoAccessControl=MJ;EJ.resultIsAllowed=NJ;EJ.resetLoggedProperties=SJ;function DJ(q){return q&&q.__esModule?q:{default:q}}var F1=e1(),CJ=I4(),VJ=DJ(CJ),t3=Object.create(null);function MJ(q){var _=Object.create(null);_.constructor=!1,_.__defineGetter__=!1,_.__defineSetter__=!1,_.__lookupGetter__=!1;var j=Object.create(null);return j.__proto__=!1,{properties:{whitelist:F1.createNewLookupObject(j,q.allowedProtoProperties),defaultValue:q.allowProtoPropertiesByDefault},methods:{whitelist:F1.createNewLookupObject(_,q.allowedProtoMethods),defaultValue:q.allowProtoMethodsByDefault}}}function NJ(q,_,j){if(typeof q==="function")return U1(_.methods,j);else return U1(_.properties,j)}function U1(q,_){if(q.whitelist[_]!==void 0)return q.whitelist[_]===!0;if(q.defaultValue!==void 0)return q.defaultValue;return bJ(_),!1}function bJ(q){if(t3[q]!==!0)t3[q]=!0,VJ.default.log("error",'Handlebars: Access has been denied to resolve the property "'+q+`" because it is not an "own property" of its parent. You can add a runtime option to disable the check or this warning: -See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`)}function bJ(){Object.keys(t3).forEach(function(q){delete t3[q]})}});var F3=_8((iJ)=>{iJ.__esModule=!0;iJ.HandlebarsEnvironment=p4;function s1(q){return q&&q.__esModule?q:{default:q}}var H_=C6(),gJ=F6(),y4=s1(gJ),yJ=m4(),dJ=a1(),pJ=I4(),e3=s1(pJ),LJ=g4(),lJ="4.7.8";iJ.VERSION=lJ;var xJ=8;iJ.COMPILER_REVISION=xJ;var nJ=7;iJ.LAST_COMPATIBLE_COMPILER_REVISION=nJ;var cJ={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};iJ.REVISION_CHANGES=cJ;var d4="[object Object]";function p4(q,_,j){this.helpers=q||{},this.partials=_||{},this.decorators=j||{},yJ.registerDefaultHelpers(this),dJ.registerDefaultDecorators(this)}p4.prototype={constructor:p4,logger:e3.default,log:e3.default.log,registerHelper:function q(_,j){if(H_.toString.call(_)===d4){if(j)throw new y4.default("Arg not supported with multiple helpers");H_.extend(this.helpers,_)}else this.helpers[_]=j},unregisterHelper:function q(_){delete this.helpers[_]},registerPartial:function q(_,j){if(H_.toString.call(_)===d4)H_.extend(this.partials,_);else{if(typeof j==="undefined")throw new y4.default('Attempting to register a partial called "'+_+'" as undefined');this.partials[_]=j}},unregisterPartial:function q(_){delete this.partials[_]},registerDecorator:function q(_,j){if(H_.toString.call(_)===d4){if(j)throw new y4.default("Arg not supported with multiple decorators");H_.extend(this.decorators,_)}else this.decorators[_]=j},unregisterDecorator:function q(_){delete this.decorators[_]},resetLoggedPropertyAccesses:function q(){LJ.resetLoggedProperties()}};var rJ=e3.default.log;iJ.log=rJ;iJ.createFrame=H_.createFrame;iJ.logger=e3.default});var _j=_8((Q1,qj)=>{Q1.__esModule=!0;function L4(q){this.string=q}L4.prototype.toString=L4.prototype.toHTML=function(){return""+this.string};Q1.default=L4;qj.exports=Q1.default});var Kj=_8((jT)=>{jT.__esModule=!0;jT.wrapHelper=KT;function KT(q,_){if(typeof q!=="function")return q;var j=function K(){var Y=arguments[arguments.length-1];return arguments[arguments.length-1]=_(Y),q.apply(this,arguments)};return j}});var $j=_8((XT)=>{XT.__esModule=!0;XT.checkRevision=vT;XT.template=WT;XT.wrapProgram=U3;XT.resolvePartial=HT;XT.invokePartial=JT;XT.noop=Yj;function fT(q){return q&&q.__esModule?q:{default:q}}function $T(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}var wT=C6(),dq=$T(wT),OT=F6(),pq=fT(OT),Lq=F3(),jj=m4(),zT=Kj(),Pj=g4();function vT(q){var _=q&&q[0]||1,j=Lq.COMPILER_REVISION;if(_>=Lq.LAST_COMPATIBLE_COMPILER_REVISION&&_<=Lq.COMPILER_REVISION)return;if(_{oJ.__esModule=!0;oJ.HandlebarsEnvironment=p4;function s1(q){return q&&q.__esModule?q:{default:q}}var H_=C6(),yJ=F6(),y4=s1(yJ),dJ=m4(),pJ=a1(),LJ=I4(),e3=s1(LJ),lJ=g4(),xJ="4.7.8";oJ.VERSION=xJ;var nJ=8;oJ.COMPILER_REVISION=nJ;var cJ=7;oJ.LAST_COMPATIBLE_COMPILER_REVISION=cJ;var rJ={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};oJ.REVISION_CHANGES=rJ;var d4="[object Object]";function p4(q,_,j){this.helpers=q||{},this.partials=_||{},this.decorators=j||{},dJ.registerDefaultHelpers(this),pJ.registerDefaultDecorators(this)}p4.prototype={constructor:p4,logger:e3.default,log:e3.default.log,registerHelper:function q(_,j){if(H_.toString.call(_)===d4){if(j)throw new y4.default("Arg not supported with multiple helpers");H_.extend(this.helpers,_)}else this.helpers[_]=j},unregisterHelper:function q(_){delete this.helpers[_]},registerPartial:function q(_,j){if(H_.toString.call(_)===d4)H_.extend(this.partials,_);else{if(typeof j==="undefined")throw new y4.default('Attempting to register a partial called "'+_+'" as undefined');this.partials[_]=j}},unregisterPartial:function q(_){delete this.partials[_]},registerDecorator:function q(_,j){if(H_.toString.call(_)===d4){if(j)throw new y4.default("Arg not supported with multiple decorators");H_.extend(this.decorators,_)}else this.decorators[_]=j},unregisterDecorator:function q(_){delete this.decorators[_]},resetLoggedPropertyAccesses:function q(){lJ.resetLoggedProperties()}};var iJ=e3.default.log;oJ.log=iJ;oJ.createFrame=H_.createFrame;oJ.logger=e3.default});var _j=_8((Q1,qj)=>{Q1.__esModule=!0;function L4(q){this.string=q}L4.prototype.toString=L4.prototype.toHTML=function(){return""+this.string};Q1.default=L4;qj.exports=Q1.default});var Kj=_8((PT)=>{PT.__esModule=!0;PT.wrapHelper=jT;function jT(q,_){if(typeof q!=="function")return q;var j=function K(){var Y=arguments[arguments.length-1];return arguments[arguments.length-1]=_(Y),q.apply(this,arguments)};return j}});var $j=_8((AT)=>{AT.__esModule=!0;AT.checkRevision=WT;AT.template=HT;AT.wrapProgram=U3;AT.resolvePartial=JT;AT.invokePartial=TT;AT.noop=Yj;function $T(q){return q&&q.__esModule?q:{default:q}}function wT(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}var OT=C6(),dq=wT(OT),zT=F6(),pq=$T(zT),Lq=F3(),jj=m4(),vT=Kj(),Pj=g4();function WT(q){var _=q&&q[0]||1,j=Lq.COMPILER_REVISION;if(_>=Lq.LAST_COMPATIBLE_COMPILER_REVISION&&_<=Lq.COMPILER_REVISION)return;if(_{wj.__esModule=!0;wj.default=function(q){(function(){if(typeof globalThis==="object")return;Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__})();var _=globalThis.Handlebars;q.noConflict=function(){if(globalThis.Handlebars===q)globalThis.Handlebars=_;return q}};Oj.exports=wj.default});var Tj=_8((Hj,Jj)=>{Hj.__esModule=!0;function n4(q){return q&&q.__esModule?q:{default:q}}function c4(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}var bT=F3(),zj=c4(bT),ST=_j(),ET=n4(ST),RT=F6(),mT=n4(RT),IT=C6(),x4=c4(IT),gT=$j(),vj=c4(gT),yT=l4(),dT=n4(yT);function Wj(){var q=new zj.HandlebarsEnvironment;return x4.extend(q,zj),q.SafeString=ET.default,q.Exception=mT.default,q.Utils=x4,q.escapeExpression=x4.escapeExpression,q.VM=vj,q.template=function(_){return vj.template(_,q)},q}var oK=Wj();oK.create=Wj;dT.default(oK);oK.default=oK;Hj.default=oK;Jj.exports=Hj.default});var r4=_8((kj,Xj)=>{kj.__esModule=!0;var Zj={helpers:{helperExpression:function q(_){return _.type==="SubExpression"||(_.type==="MustacheStatement"||_.type==="BlockStatement")&&!!(_.params&&_.params.length||_.hash)},scopedId:function q(_){return/^\.|this\b/.test(_.original)},simpleId:function q(_){return _.parts.length===1&&!Zj.helpers.scopedId(_)&&!_.depth}}};kj.default=Zj;Xj.exports=kj.default});var uj=_8((Aj,Gj)=>{Aj.__esModule=!0;var nT=function(){var q={trace:function K(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function K(Y,f,P,$,w,O,v){var z=O.length-1;switch(w){case 1:return O[z-1];case 2:this.$=$.prepareProgram(O[z]);break;case 3:this.$=O[z];break;case 4:this.$=O[z];break;case 5:this.$=O[z];break;case 6:this.$=O[z];break;case 7:this.$=O[z];break;case 8:this.$=O[z];break;case 9:this.$={type:"CommentStatement",value:$.stripComment(O[z]),strip:$.stripFlags(O[z],O[z]),loc:$.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:O[z],value:O[z],loc:$.locInfo(this._$)};break;case 11:this.$=$.prepareRawBlock(O[z-2],O[z-1],O[z],this._$);break;case 12:this.$={path:O[z-3],params:O[z-2],hash:O[z-1]};break;case 13:this.$=$.prepareBlock(O[z-3],O[z-2],O[z-1],O[z],!1,this._$);break;case 14:this.$=$.prepareBlock(O[z-3],O[z-2],O[z-1],O[z],!0,this._$);break;case 15:this.$={open:O[z-5],path:O[z-4],params:O[z-3],hash:O[z-2],blockParams:O[z-1],strip:$.stripFlags(O[z-5],O[z])};break;case 16:this.$={path:O[z-4],params:O[z-3],hash:O[z-2],blockParams:O[z-1],strip:$.stripFlags(O[z-5],O[z])};break;case 17:this.$={path:O[z-4],params:O[z-3],hash:O[z-2],blockParams:O[z-1],strip:$.stripFlags(O[z-5],O[z])};break;case 18:this.$={strip:$.stripFlags(O[z-1],O[z-1]),program:O[z]};break;case 19:var W=$.prepareBlock(O[z-2],O[z-1],O[z],O[z],!1,this._$),J=$.prepareProgram([W],O[z-1].loc);J.chained=!0,this.$={strip:O[z-2].strip,program:J,chain:!0};break;case 20:this.$=O[z];break;case 21:this.$={path:O[z-1],strip:$.stripFlags(O[z-2],O[z])};break;case 22:this.$=$.prepareMustache(O[z-3],O[z-2],O[z-1],O[z-4],$.stripFlags(O[z-4],O[z]),this._$);break;case 23:this.$=$.prepareMustache(O[z-3],O[z-2],O[z-1],O[z-4],$.stripFlags(O[z-4],O[z]),this._$);break;case 24:this.$={type:"PartialStatement",name:O[z-3],params:O[z-2],hash:O[z-1],indent:"",strip:$.stripFlags(O[z-4],O[z]),loc:$.locInfo(this._$)};break;case 25:this.$=$.preparePartialBlock(O[z-2],O[z-1],O[z],this._$);break;case 26:this.$={path:O[z-3],params:O[z-2],hash:O[z-1],strip:$.stripFlags(O[z-4],O[z])};break;case 27:this.$=O[z];break;case 28:this.$=O[z];break;case 29:this.$={type:"SubExpression",path:O[z-3],params:O[z-2],hash:O[z-1],loc:$.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:O[z],loc:$.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:$.id(O[z-2]),value:O[z],loc:$.locInfo(this._$)};break;case 32:this.$=$.id(O[z-1]);break;case 33:this.$=O[z];break;case 34:this.$=O[z];break;case 35:this.$={type:"StringLiteral",value:O[z],original:O[z],loc:$.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(O[z]),original:Number(O[z]),loc:$.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:O[z]==="true",original:O[z]==="true",loc:$.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:$.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:$.locInfo(this._$)};break;case 40:this.$=O[z];break;case 41:this.$=O[z];break;case 42:this.$=$.preparePath(!0,O[z],this._$);break;case 43:this.$=$.preparePath(!1,O[z],this._$);break;case 44:O[z-2].push({part:$.id(O[z]),original:O[z],separator:O[z-1]}),this.$=O[z-2];break;case 45:this.$=[{part:$.id(O[z]),original:O[z]}];break;case 46:this.$=[];break;case 47:O[z-1].push(O[z]);break;case 48:this.$=[];break;case 49:O[z-1].push(O[z]);break;case 50:this.$=[];break;case 51:O[z-1].push(O[z]);break;case 58:this.$=[];break;case 59:O[z-1].push(O[z]);break;case 64:this.$=[];break;case 65:O[z-1].push(O[z]);break;case 70:this.$=[];break;case 71:O[z-1].push(O[z]);break;case 78:this.$=[];break;case 79:O[z-1].push(O[z]);break;case 82:this.$=[];break;case 83:O[z-1].push(O[z]);break;case 86:this.$=[];break;case 87:O[z-1].push(O[z]);break;case 90:this.$=[];break;case 91:O[z-1].push(O[z]);break;case 94:this.$=[];break;case 95:O[z-1].push(O[z]);break;case 98:this.$=[O[z]];break;case 99:O[z-1].push(O[z]);break;case 100:this.$=[O[z]];break;case 101:O[z-1].push(O[z]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function K(Y,f){throw new Error(Y)},parse:function K(Y){var f=this,P=[0],$=[null],w=[],O=this.table,v="",z=0,W=0,J=0,T=2,H=1;if(this.lexer.setInput(Y),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined")this.lexer.yylloc={};var X=this.lexer.yylloc;w.push(X);var A=this.lexer.options&&this.lexer.options.ranges;if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function G(B){P.length=P.length-2*B,$.length=$.length-B,w.length=w.length-B}function D(){var B=f.lexer.lex()||1;if(typeof B!=="number")B=f.symbols_[B]||B;return B}var M,I,N,R,L,b,d={},y,V,S,p;while(!0){if(N=P[P.length-1],this.defaultActions[N])R=this.defaultActions[N];else{if(M===null||typeof M=="undefined")M=D();R=O[N]&&O[N][M]}if(typeof R==="undefined"||!R.length||!R[0]){var c="";if(!J){p=[];for(y in O[N])if(this.terminals_[y]&&y>2)p.push("'"+this.terminals_[y]+"'");if(this.lexer.showPosition)c="Parse error on line "+(z+1)+`: +`)}return v}else throw new pq.default("The partial "+w.name+" could not be compiled when running in runtime-only mode")}var Y={strict:function P($,w,O){if(!$||!(w in $))throw new pq.default('"'+w+'" not defined in '+$,{loc:O});return Y.lookupProperty($,w)},lookupProperty:function P($,w){var O=$[w];if(O==null)return O;if(Object.prototype.hasOwnProperty.call($,w))return O;if(Pj.resultIsAllowed(O,Y.protoAccessControl,w))return O;return},lookup:function P($,w){var O=$.length;for(var v=0;v{wj.__esModule=!0;wj.default=function(q){(function(){if(typeof globalThis==="object")return;Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__})();var _=globalThis.Handlebars;q.noConflict=function(){if(globalThis.Handlebars===q)globalThis.Handlebars=_;return q}};Oj.exports=wj.default});var Tj=_8((Hj,Jj)=>{Hj.__esModule=!0;function n4(q){return q&&q.__esModule?q:{default:q}}function c4(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}var ST=F3(),zj=c4(ST),ET=_j(),RT=n4(ET),mT=F6(),IT=n4(mT),gT=C6(),x4=c4(gT),yT=$j(),vj=c4(yT),dT=l4(),pT=n4(dT);function Wj(){var q=new zj.HandlebarsEnvironment;return x4.extend(q,zj),q.SafeString=RT.default,q.Exception=IT.default,q.Utils=x4,q.escapeExpression=x4.escapeExpression,q.VM=vj,q.template=function(_){return vj.template(_,q)},q}var oK=Wj();oK.create=Wj;pT.default(oK);oK.default=oK;Hj.default=oK;Jj.exports=Hj.default});var r4=_8((kj,Xj)=>{kj.__esModule=!0;var Zj={helpers:{helperExpression:function q(_){return _.type==="SubExpression"||(_.type==="MustacheStatement"||_.type==="BlockStatement")&&!!(_.params&&_.params.length||_.hash)},scopedId:function q(_){return/^\.|this\b/.test(_.original)},simpleId:function q(_){return _.parts.length===1&&!Zj.helpers.scopedId(_)&&!_.depth}}};kj.default=Zj;Xj.exports=kj.default});var uj=_8((Aj,Gj)=>{Aj.__esModule=!0;var cT=function(){var q={trace:function K(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function K(Y,f,P,$,w,O,v){var z=O.length-1;switch(w){case 1:return O[z-1];case 2:this.$=$.prepareProgram(O[z]);break;case 3:this.$=O[z];break;case 4:this.$=O[z];break;case 5:this.$=O[z];break;case 6:this.$=O[z];break;case 7:this.$=O[z];break;case 8:this.$=O[z];break;case 9:this.$={type:"CommentStatement",value:$.stripComment(O[z]),strip:$.stripFlags(O[z],O[z]),loc:$.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:O[z],value:O[z],loc:$.locInfo(this._$)};break;case 11:this.$=$.prepareRawBlock(O[z-2],O[z-1],O[z],this._$);break;case 12:this.$={path:O[z-3],params:O[z-2],hash:O[z-1]};break;case 13:this.$=$.prepareBlock(O[z-3],O[z-2],O[z-1],O[z],!1,this._$);break;case 14:this.$=$.prepareBlock(O[z-3],O[z-2],O[z-1],O[z],!0,this._$);break;case 15:this.$={open:O[z-5],path:O[z-4],params:O[z-3],hash:O[z-2],blockParams:O[z-1],strip:$.stripFlags(O[z-5],O[z])};break;case 16:this.$={path:O[z-4],params:O[z-3],hash:O[z-2],blockParams:O[z-1],strip:$.stripFlags(O[z-5],O[z])};break;case 17:this.$={path:O[z-4],params:O[z-3],hash:O[z-2],blockParams:O[z-1],strip:$.stripFlags(O[z-5],O[z])};break;case 18:this.$={strip:$.stripFlags(O[z-1],O[z-1]),program:O[z]};break;case 19:var W=$.prepareBlock(O[z-2],O[z-1],O[z],O[z],!1,this._$),J=$.prepareProgram([W],O[z-1].loc);J.chained=!0,this.$={strip:O[z-2].strip,program:J,chain:!0};break;case 20:this.$=O[z];break;case 21:this.$={path:O[z-1],strip:$.stripFlags(O[z-2],O[z])};break;case 22:this.$=$.prepareMustache(O[z-3],O[z-2],O[z-1],O[z-4],$.stripFlags(O[z-4],O[z]),this._$);break;case 23:this.$=$.prepareMustache(O[z-3],O[z-2],O[z-1],O[z-4],$.stripFlags(O[z-4],O[z]),this._$);break;case 24:this.$={type:"PartialStatement",name:O[z-3],params:O[z-2],hash:O[z-1],indent:"",strip:$.stripFlags(O[z-4],O[z]),loc:$.locInfo(this._$)};break;case 25:this.$=$.preparePartialBlock(O[z-2],O[z-1],O[z],this._$);break;case 26:this.$={path:O[z-3],params:O[z-2],hash:O[z-1],strip:$.stripFlags(O[z-4],O[z])};break;case 27:this.$=O[z];break;case 28:this.$=O[z];break;case 29:this.$={type:"SubExpression",path:O[z-3],params:O[z-2],hash:O[z-1],loc:$.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:O[z],loc:$.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:$.id(O[z-2]),value:O[z],loc:$.locInfo(this._$)};break;case 32:this.$=$.id(O[z-1]);break;case 33:this.$=O[z];break;case 34:this.$=O[z];break;case 35:this.$={type:"StringLiteral",value:O[z],original:O[z],loc:$.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(O[z]),original:Number(O[z]),loc:$.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:O[z]==="true",original:O[z]==="true",loc:$.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:$.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:$.locInfo(this._$)};break;case 40:this.$=O[z];break;case 41:this.$=O[z];break;case 42:this.$=$.preparePath(!0,O[z],this._$);break;case 43:this.$=$.preparePath(!1,O[z],this._$);break;case 44:O[z-2].push({part:$.id(O[z]),original:O[z],separator:O[z-1]}),this.$=O[z-2];break;case 45:this.$=[{part:$.id(O[z]),original:O[z]}];break;case 46:this.$=[];break;case 47:O[z-1].push(O[z]);break;case 48:this.$=[];break;case 49:O[z-1].push(O[z]);break;case 50:this.$=[];break;case 51:O[z-1].push(O[z]);break;case 58:this.$=[];break;case 59:O[z-1].push(O[z]);break;case 64:this.$=[];break;case 65:O[z-1].push(O[z]);break;case 70:this.$=[];break;case 71:O[z-1].push(O[z]);break;case 78:this.$=[];break;case 79:O[z-1].push(O[z]);break;case 82:this.$=[];break;case 83:O[z-1].push(O[z]);break;case 86:this.$=[];break;case 87:O[z-1].push(O[z]);break;case 90:this.$=[];break;case 91:O[z-1].push(O[z]);break;case 94:this.$=[];break;case 95:O[z-1].push(O[z]);break;case 98:this.$=[O[z]];break;case 99:O[z-1].push(O[z]);break;case 100:this.$=[O[z]];break;case 101:O[z-1].push(O[z]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function K(Y,f){throw new Error(Y)},parse:function K(Y){var f=this,P=[0],$=[null],w=[],O=this.table,v="",z=0,W=0,J=0,T=2,H=1;if(this.lexer.setInput(Y),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined")this.lexer.yylloc={};var X=this.lexer.yylloc;w.push(X);var A=this.lexer.options&&this.lexer.options.ranges;if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function G(B){P.length=P.length-2*B,$.length=$.length-B,w.length=w.length-B}function D(){var B=f.lexer.lex()||1;if(typeof B!=="number")B=f.symbols_[B]||B;return B}var M,I,N,R,L,b,d={},y,V,S,p;while(!0){if(N=P[P.length-1],this.defaultActions[N])R=this.defaultActions[N];else{if(M===null||typeof M=="undefined")M=D();R=O[N]&&O[N][M]}if(typeof R==="undefined"||!R.length||!R[0]){var c="";if(!J){p=[];for(y in O[N])if(this.terminals_[y]&&y>2)p.push("'"+this.terminals_[y]+"'");if(this.lexer.showPosition)c="Parse error on line "+(z+1)+`: `+this.lexer.showPosition()+` Expecting `+p.join(", ")+", got '"+(this.terminals_[M]||M)+"'";else c="Parse error on line "+(z+1)+": Unexpected "+(M==1?"end of input":"'"+(this.terminals_[M]||M)+"'");this.parseError(c,{text:this.lexer.match,token:this.terminals_[M]||M,line:this.lexer.yylineno,loc:X,expected:p})}}if(R[0]instanceof Array&&R.length>1)throw new Error("Parse Error: multiple actions possible at state: "+N+", token: "+M);switch(R[0]){case 1:if(P.push(M),$.push(this.lexer.yytext),w.push(this.lexer.yylloc),P.push(R[1]),M=null,!I){if(W=this.lexer.yyleng,v=this.lexer.yytext,z=this.lexer.yylineno,X=this.lexer.yylloc,J>0)J--}else M=I,I=null;break;case 2:if(V=this.productions_[R[1]][1],d.$=$[$.length-V],d._$={first_line:w[w.length-(V||1)].first_line,last_line:w[w.length-1].last_line,first_column:w[w.length-(V||1)].first_column,last_column:w[w.length-1].last_column},A)d._$.range=[w[w.length-(V||1)].range[0],w[w.length-1].range[1]];if(b=this.performAction.call(d,v,W,z,this.yy,R[1],$,w),typeof b!=="undefined")return b;if(V)P=P.slice(0,-1*V*2),$=$.slice(0,-1*V),w=w.slice(0,-1*V);P.push(this.productions_[R[1]][0]),$.push(d.$),w.push(d._$),S=O[P[P.length-2]][P[P.length-1]],P.push(S);break;case 3:return!0}}return!0}},_=function(){var K={EOF:1,parseError:function Y(f,P){if(this.yy.parser)this.yy.parser.parseError(f,P);else throw new Error(f)},setInput:function Y(f){if(this._input=f,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},input:function Y(){var f=this._input[0];this.yytext+=f,this.yyleng++,this.offset++,this.match+=f,this.matched+=f;var P=f.match(/(?:\r\n?|\n).*/g);if(P)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),f},unput:function Y(f){var P=f.length,$=f.split(/(?:\r\n?|\n)/g);this._input=f+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-P-1),this.offset-=P;var w=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),$.length-1)this.yylineno-=$.length-1;var O=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:$?($.length===w.length?this.yylloc.first_column:0)+w[w.length-$.length].length-$[0].length:this.yylloc.first_column-P},this.options.ranges)this.yylloc.range=[O[0],O[0]+this.yyleng-P];return this},more:function Y(){return this._more=!0,this},less:function Y(f){this.unput(this.match.slice(f))},pastInput:function Y(){var f=this.matched.substr(0,this.matched.length-this.match.length);return(f.length>20?"...":"")+f.substr(-20).replace(/\n/g,"")},upcomingInput:function Y(){var f=this.match;if(f.length<20)f+=this._input.substr(0,20-f.length);return(f.substr(0,20)+(f.length>20?"...":"")).replace(/\n/g,"")},showPosition:function Y(){var f=this.pastInput(),P=new Array(f.length+1).join("-");return f+this.upcomingInput()+` `+P+"^"},next:function Y(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var f,P,$,w,O,v;if(!this._more)this.yytext="",this.match="";var z=this._currentRules();for(var W=0;WP[0].length)){if(P=$,w=W,!this.options.flex)break}if(P){if(v=P[0].match(/(?:\r\n?|\n).*/g),v)this.yylineno+=v.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:v?v[v.length-1].length-v[v.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+P[0].length},this.yytext+=P[0],this.match+=P[0],this.matches=P,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._input=this._input.slice(P[0].length),this.matched+=P[0],f=this.performAction.call(this,this.yy,this,z[w],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(f)return f;else return}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. -`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function Y(){var f=this.next();if(typeof f!=="undefined")return f;else return this.lex()},begin:function Y(f){this.conditionStack.push(f)},popState:function Y(){return this.conditionStack.pop()},_currentRules:function Y(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function Y(){return this.conditionStack[this.conditionStack.length-2]},pushState:function Y(f){this.begin(f)}};return K.options={},K.performAction=function Y(f,P,$,w){function O(z,W){return P.yytext=P.yytext.substring(z,P.yyleng-W+z)}var v=w;switch($){case 0:if(P.yytext.slice(-2)==="\\\\")O(0,1),this.begin("mu");else if(P.yytext.slice(-1)==="\\")O(0,1),this.begin("emu");else this.begin("mu");if(P.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:if(this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw")return 15;else return O(5,9),"END_RAW_BLOCK";break;case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(P.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return P.yytext=O(1,2).replace(/\\"/g,'"'),80;break;case 32:return P.yytext=O(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return P.yytext=P.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},K.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],K.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},K}();q.lexer=_;function j(){this.yy={}}return j.prototype=q,q.Parser=j,new j}();Aj.default=nT;Gj.exports=Aj.default});var q7=_8((Cj,Vj)=>{Cj.__esModule=!0;function iT(q){return q&&q.__esModule?q:{default:q}}var oT=F6(),i4=iT(oT);function s3(){this.parents=[]}s3.prototype={constructor:s3,mutating:!1,acceptKey:function q(_,j){var K=this.accept(_[j]);if(this.mutating){if(K&&!s3.prototype[K.type])throw new i4.default('Unexpected node type "'+K.type+'" found when accepting '+j+" on "+_.type);_[j]=K}},acceptRequired:function q(_,j){if(this.acceptKey(_,j),!_[j])throw new i4.default(_.type+" requires "+j)},acceptArray:function q(_){for(var j=0,K=_.length;j{Mj.__esModule=!0;function tT(q){return q&&q.__esModule?q:{default:q}}var eT=q7(),FT=tT(eT);function uq(){var q=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=q}uq.prototype=new FT.default;uq.prototype.Program=function(q){var _=!this.options.ignoreStandalone,j=!this.isRootSeen;this.isRootSeen=!0;var K=q.body;for(var Y=0,f=K.length;Y{vZ.__esModule=!0;vZ.SourceLocation=_Z;vZ.id=KZ;vZ.stripFlags=jZ;vZ.stripComment=PZ;vZ.preparePath=YZ;vZ.prepareMustache=fZ;vZ.prepareRawBlock=$Z;vZ.prepareBlock=wZ;vZ.prepareProgram=OZ;vZ.preparePartialBlock=zZ;function QT(q){return q&&q.__esModule?q:{default:q}}var qZ=F6(),B4=QT(qZ);function t4(q,_){if(_=_.path?_.path.original:_,q.path.original!==_){var j={loc:q.path.loc};throw new B4.default(q.path.original+" doesn't match "+_,j)}}function _Z(q,_){this.source=q,this.start={line:_.first_line,column:_.first_column},this.end={line:_.last_line,column:_.last_column}}function KZ(q){if(/^\[.*\]$/.test(q))return q.substring(1,q.length-1);else return q}function jZ(q,_){return{open:q.charAt(2)==="~",close:_.charAt(_.length-3)==="~"}}function PZ(q){return q.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function YZ(q,_,j){j=this.locInfo(j);var K=q?"@":"",Y=[],f=0;for(var P=0,$=_.length;P<$;P++){var w=_[P].part,O=_[P].original!==w;if(K+=(_[P].separator||"")+w,!O&&(w===".."||w==="."||w==="this")){if(Y.length>0)throw new B4.default("Invalid path: "+K,{loc:j});else if(w==="..")f++}else Y.push(w)}return{type:"PathExpression",data:q,depth:f,parts:Y,original:K,loc:j}}function fZ(q,_,j,K,Y,f){var P=K.charAt(3)||K.charAt(2),$=P!=="{"&&P!=="&",w=/\*/.test(K);return{type:w?"Decorator":"MustacheStatement",path:q,params:_,hash:j,escaped:$,strip:Y,loc:this.locInfo(f)}}function $Z(q,_,j,K){t4(q,j),K=this.locInfo(K);var Y={type:"Program",body:_,strip:{},loc:K};return{type:"BlockStatement",path:q.path,params:q.params,hash:q.hash,program:Y,openStrip:{},inverseStrip:{},closeStrip:{},loc:K}}function wZ(q,_,j,K,Y,f){if(K&&K.path)t4(q,K);var P=/\*/.test(q.open);_.blockParams=q.blockParams;var $=void 0,w=void 0;if(j){if(P)throw new B4.default("Unexpected inverse block on decorator",j);if(j.chain)j.program.body[0].closeStrip=K.strip;w=j.strip,$=j.program}if(Y)Y=$,$=_,_=Y;return{type:P?"DecoratorBlock":"BlockStatement",path:q.path,params:q.params,hash:q.hash,program:_,inverse:$,openStrip:q.strip,inverseStrip:w,closeStrip:K&&K.strip,loc:this.locInfo(f)}}function OZ(q,_){if(!_&&q.length){var j=q[0].loc,K=q[q.length-1].loc;if(j&&K)_={source:j.source,start:{line:j.start.line,column:j.start.column},end:{line:K.end.line,column:K.end.column}}}return{type:"Program",body:q,strip:{},loc:_}}function zZ(q,_,j,K){return t4(q,j),{type:"PartialBlockStatement",name:q.path,params:q.params,hash:q.hash,program:_,openStrip:q.strip,closeStrip:j&&j.strip,loc:this.locInfo(K)}}});var mj=_8((RZ)=>{RZ.__esModule=!0;RZ.parseWithoutProcessing=Rj;RZ.parse=EZ;function DZ(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}function Ej(q){return q&&q.__esModule?q:{default:q}}var CZ=uj(),e4=Ej(CZ),VZ=bj(),MZ=Ej(VZ),NZ=Sj(),bZ=DZ(NZ),SZ=C6();RZ.parser=e4.default;var _7={};SZ.extend(_7,bZ);function Rj(q,_){if(q.type==="Program")return q;e4.default.yy=_7,_7.locInfo=function(K){return new _7.SourceLocation(_&&_.srcName,K)};var j=e4.default.parse(q);return j}function EZ(q,_){var j=Rj(q,_),K=new MZ.default(_);return K.accept(j)}});var dj=_8((nZ)=>{nZ.__esModule=!0;nZ.Compiler=F4;nZ.precompile=lZ;nZ.compile=xZ;function gj(q){return q&&q.__esModule?q:{default:q}}var dZ=F6(),BK=gj(dZ),tK=C6(),pZ=r4(),aK=gj(pZ),LZ=[].slice;function F4(){}F4.prototype={compiler:F4,equals:function q(_){var j=this.opcodes.length;if(_.opcodes.length!==j)return!1;for(var K=0;K1)throw new BK.default("Unsupported number of partial arguments: "+K.length,_);else if(!K.length)if(this.options.explicitPartialContext)this.opcode("pushLiteral","undefined");else K.push({type:"PathExpression",parts:[],depth:0});var Y=_.name.original,f=_.name.type==="SubExpression";if(f)this.accept(_.name);this.setupFullMustacheParams(_,j,void 0,!0);var P=_.indent||"";if(this.options.preventIndent&&P)this.opcode("appendContent",P),P="";this.opcode("invokePartial",f,Y,P),this.opcode("append")},PartialBlockStatement:function q(_){this.PartialStatement(_)},MustacheStatement:function q(_){if(this.SubExpression(_),_.escaped&&!this.options.noEscape)this.opcode("appendEscaped");else this.opcode("append")},Decorator:function q(_){this.DecoratorBlock(_)},ContentStatement:function q(_){if(_.value)this.opcode("appendContent",_.value)},CommentStatement:function q(){},SubExpression:function q(_){Ij(_);var j=this.classifySexpr(_);if(j==="simple")this.simpleSexpr(_);else if(j==="helper")this.helperSexpr(_);else this.ambiguousSexpr(_)},ambiguousSexpr:function q(_,j,K){var Y=_.path,f=Y.parts[0],P=j!=null||K!=null;this.opcode("getContext",Y.depth),this.opcode("pushProgram",j),this.opcode("pushProgram",K),Y.strict=!0,this.accept(Y),this.opcode("invokeAmbiguous",f,P)},simpleSexpr:function q(_){var j=_.path;j.strict=!0,this.accept(j),this.opcode("resolvePossibleLambda")},helperSexpr:function q(_,j,K){var Y=this.setupFullMustacheParams(_,j,K),f=_.path,P=f.parts[0];if(this.options.knownHelpers[P])this.opcode("invokeKnownHelper",Y.length,P);else if(this.options.knownHelpersOnly)throw new BK.default("You specified knownHelpersOnly, but used the unknown helper "+P,_);else f.strict=!0,f.falsy=!0,this.accept(f),this.opcode("invokeHelper",Y.length,f.original,aK.default.helpers.simpleId(f))},PathExpression:function q(_){this.addDepth(_.depth),this.opcode("getContext",_.depth);var j=_.parts[0],K=aK.default.helpers.scopedId(_),Y=!_.depth&&!K&&this.blockParamIndex(j);if(Y)this.opcode("lookupBlockParam",Y,_.parts);else if(!j)this.opcode("pushContext");else if(_.data)this.options.data=!0,this.opcode("lookupData",_.depth,_.parts,_.strict);else this.opcode("lookupOnContext",_.parts,_.falsy,_.strict,K)},StringLiteral:function q(_){this.opcode("pushString",_.value)},NumberLiteral:function q(_){this.opcode("pushLiteral",_.value)},BooleanLiteral:function q(_){this.opcode("pushLiteral",_.value)},UndefinedLiteral:function q(){this.opcode("pushLiteral","undefined")},NullLiteral:function q(){this.opcode("pushLiteral","null")},Hash:function q(_){var j=_.pairs,K=0,Y=j.length;this.opcode("pushHash");for(;K=0)return[j,f]}}};function lZ(q,_,j){if(q==null||typeof q!=="string"&&q.type!=="Program")throw new BK.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+q);if(_=_||{},!("data"in _))_.data=!0;if(_.compat)_.useDepths=!0;var K=j.parse(q,_),Y=new j.Compiler().compile(K,_);return new j.JavaScriptCompiler().compile(Y,_)}function xZ(q,_,j){if(_===void 0)_={};if(q==null||typeof q!=="string"&&q.type!=="Program")throw new BK.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+q);if(_=tK.extend({},_),!("data"in _))_.data=!0;if(_.compat)_.useDepths=!0;var K=void 0;function Y(){var P=j.parse(q,_),$=new j.Compiler().compile(P,_),w=new j.JavaScriptCompiler().compile($,_,void 0,!0);return j.template(w)}function f(P,$){if(!K)K=Y();return K.call(this,P,$)}return f._setup=function(P){if(!K)K=Y();return K._setup(P)},f._child=function(P,$,w,O){if(!K)K=Y();return K._child(P,$,w,O)},f}function yj(q,_){if(q===_)return!0;if(tK.isArray(q)&&tK.isArray(_)&&q.length===_.length){for(var j=0;j{var pj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");aZ.encode=function(q){if(0<=q&&q{var lj=Lj(),U4=5,xj=1<>1;return _?-j:j}UZ.encode=function q(_){var j="",K,Y=eZ(_);do{if(K=Y&nj,Y>>>=U4,Y>0)K|=cj;j+=lj.encode(K)}while(Y>0);return j};UZ.decode=function q(_,j,K){var Y=_.length,f=0,P=0,$,w;do{if(j>=Y)throw new Error("Expected more digits in base 64 VLQ value.");if(w=lj.decode(_.charCodeAt(j++)),w===-1)throw new Error("Invalid base64 digit: "+_.charAt(j-1));$=!!(w&cj),w&=nj,f=f+(w<{function qk(q,_,j){if(_ in q)return q[_];else if(arguments.length===3)return j;else throw new Error('"'+_+'" is a required argument.')}zk.getArg=qk;var rj=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,_k=/^data:.+\,.+$/;function eK(q){var _=q.match(rj);if(!_)return null;return{scheme:_[1],auth:_[2],host:_[3],port:_[4],path:_[5]}}zk.urlParse=eK;function _K(q){var _="";if(q.scheme)_+=q.scheme+":";if(_+="//",q.auth)_+=q.auth+"@";if(q.host)_+=q.host;if(q.port)_+=":"+q.port;if(q.path)_+=q.path;return _}zk.urlGenerate=_K;function Q4(q){var _=q,j=eK(q);if(j){if(!j.path)return q;_=j.path}var K=zk.isAbsolute(_),Y=_.split(/\/+/);for(var f,P=0,$=Y.length-1;$>=0;$--)if(f=Y[$],f===".")Y.splice($,1);else if(f==="..")P++;else if(P>0)if(f==="")Y.splice($+1,P),P=0;else Y.splice($,2),P--;if(_=Y.join("/"),_==="")_=K?"/":".";if(j)return j.path=_,_K(j);return _}zk.normalize=Q4;function ij(q,_){if(q==="")q=".";if(_==="")_=".";var j=eK(_),K=eK(q);if(K)q=K.path||"/";if(j&&!j.scheme){if(K)j.scheme=K.scheme;return _K(j)}if(j||_.match(_k))return _;if(K&&!K.host&&!K.path)return K.host=_,_K(K);var Y=_.charAt(0)==="/"?_:Q4(q.replace(/\/+$/,"")+"/"+_);if(K)return K.path=Y,_K(K);return Y}zk.join=ij;zk.isAbsolute=function(q){return q.charAt(0)==="/"||rj.test(q)};function Kk(q,_){if(q==="")q=".";q=q.replace(/\/$/,"");var j=0;while(_.indexOf(q+"/")!==0){var K=q.lastIndexOf("/");if(K<0)return _;if(q=q.slice(0,K),q.match(/^([^\/]+:\/)?\/*$/))return _;++j}return Array(j+1).join("../")+_.substr(q.length+1)}zk.relative=Kk;var oj=function(){var q=Object.create(null);return!("__proto__"in q)}();function aj(q){return q}function jk(q){if(Bj(q))return"$"+q;return q}zk.toSetString=oj?aj:jk;function Pk(q){if(Bj(q))return q.slice(1);return q}zk.fromSetString=oj?aj:Pk;function Bj(q){if(!q)return!1;var _=q.length;if(_<9)return!1;if(q.charCodeAt(_-1)!==95||q.charCodeAt(_-2)!==95||q.charCodeAt(_-3)!==111||q.charCodeAt(_-4)!==116||q.charCodeAt(_-5)!==111||q.charCodeAt(_-6)!==114||q.charCodeAt(_-7)!==112||q.charCodeAt(_-8)!==95||q.charCodeAt(_-9)!==95)return!1;for(var j=_-10;j>=0;j--)if(q.charCodeAt(j)!==36)return!1;return!0}function Yk(q,_,j){var K=KK(q.source,_.source);if(K!==0)return K;if(K=q.originalLine-_.originalLine,K!==0)return K;if(K=q.originalColumn-_.originalColumn,K!==0||j)return K;if(K=q.generatedColumn-_.generatedColumn,K!==0)return K;if(K=q.generatedLine-_.generatedLine,K!==0)return K;return KK(q.name,_.name)}zk.compareByOriginalPositions=Yk;function fk(q,_,j){var K=q.generatedLine-_.generatedLine;if(K!==0)return K;if(K=q.generatedColumn-_.generatedColumn,K!==0||j)return K;if(K=KK(q.source,_.source),K!==0)return K;if(K=q.originalLine-_.originalLine,K!==0)return K;if(K=q.originalColumn-_.originalColumn,K!==0)return K;return KK(q.name,_.name)}zk.compareByGeneratedPositionsDeflated=fk;function KK(q,_){if(q===_)return 0;if(q===null)return 1;if(_===null)return-1;if(q>_)return 1;return-1}function $k(q,_){var j=q.generatedLine-_.generatedLine;if(j!==0)return j;if(j=q.generatedColumn-_.generatedColumn,j!==0)return j;if(j=KK(q.source,_.source),j!==0)return j;if(j=q.originalLine-_.originalLine,j!==0)return j;if(j=q.originalColumn-_.originalColumn,j!==0)return j;return KK(q.name,_.name)}zk.compareByGeneratedPositionsInflated=$k;function wk(q){return JSON.parse(q.replace(/^\)]}'[^\n]*\n/,""))}zk.parseSourceMapInput=wk;function Ok(q,_,j){if(_=_||"",q){if(q[q.length-1]!=="/"&&_[0]!=="/")q+="/";_=q+_}if(j){var K=eK(j);if(!K)throw new Error("sourceMapURL could not be parsed");if(K.path){var Y=K.path.lastIndexOf("/");if(Y>=0)K.path=K.path.substring(0,Y+1)}_=ij(_K(K),_)}return Q4(_)}zk.computeSourceURL=Ok});var K2=_8((Vk)=>{var q2=jK(),_2=Object.prototype.hasOwnProperty,T_=typeof Map!=="undefined";function lq(){this._array=[],this._set=T_?new Map:Object.create(null)}lq.fromArray=function q(_,j){var K=new lq;for(var Y=0,f=_.length;Y=0)return j}else{var K=q2.toSetString(_);if(_2.call(this._set,K))return this._set[K]}throw new Error('"'+_+'" is not in the set.')};lq.prototype.at=function q(_){if(_>=0&&_{var tj=jK();function Nk(q,_){var j=q.generatedLine,K=_.generatedLine,Y=q.generatedColumn,f=_.generatedColumn;return K>j||K==j&&f>=Y||tj.compareByGeneratedPositionsInflated(q,_)<=0}function K7(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}K7.prototype.unsortedForEach=function q(_,j){this._array.forEach(_,j)};K7.prototype.add=function q(_){if(Nk(this._last,_))this._last=_,this._array.push(_);else this._sorted=!1,this._array.push(_)};K7.prototype.toArray=function q(){if(!this._sorted)this._array.sort(tj.compareByGeneratedPositionsInflated),this._sorted=!0;return this._array};bk.MappingList=K7});var j2=_8((Rk)=>{var FK=s4(),K6=jK(),j7=K2().ArraySet,Ek=ej().MappingList;function U6(q){if(!q)q={};this._file=K6.getArg(q,"file",null),this._sourceRoot=K6.getArg(q,"sourceRoot",null),this._skipValidation=K6.getArg(q,"skipValidation",!1),this._sources=new j7,this._names=new j7,this._mappings=new Ek,this._sourcesContents=null}U6.prototype._version=3;U6.fromSourceMap=function q(_){var j=_.sourceRoot,K=new U6({file:_.file,sourceRoot:j});return _.eachMapping(function(Y){var f={generated:{line:Y.generatedLine,column:Y.generatedColumn}};if(Y.source!=null){if(f.source=Y.source,j!=null)f.source=K6.relative(j,f.source);if(f.original={line:Y.originalLine,column:Y.originalColumn},Y.name!=null)f.name=Y.name}K.addMapping(f)}),_.sources.forEach(function(Y){var f=Y;if(j!==null)f=K6.relative(j,Y);if(!K._sources.has(f))K._sources.add(f);var P=_.sourceContentFor(Y);if(P!=null)K.setSourceContent(Y,P)}),K};U6.prototype.addMapping=function q(_){var j=K6.getArg(_,"generated"),K=K6.getArg(_,"original",null),Y=K6.getArg(_,"source",null),f=K6.getArg(_,"name",null);if(!this._skipValidation)this._validateMapping(j,K,Y,f);if(Y!=null){if(Y=String(Y),!this._sources.has(Y))this._sources.add(Y)}if(f!=null){if(f=String(f),!this._names.has(f))this._names.add(f)}this._mappings.add({generatedLine:j.line,generatedColumn:j.column,originalLine:K!=null&&K.line,originalColumn:K!=null&&K.column,source:Y,name:f})};U6.prototype.setSourceContent=function q(_,j){var K=_;if(this._sourceRoot!=null)K=K6.relative(this._sourceRoot,K);if(j!=null){if(!this._sourcesContents)this._sourcesContents=Object.create(null);this._sourcesContents[K6.toSetString(K)]=j}else if(this._sourcesContents){if(delete this._sourcesContents[K6.toSetString(K)],Object.keys(this._sourcesContents).length===0)this._sourcesContents=null}};U6.prototype.applySourceMap=function q(_,j,K){var Y=j;if(j==null){if(_.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);Y=_.file}var f=this._sourceRoot;if(f!=null)Y=K6.relative(f,Y);var P=new j7,$=new j7;this._mappings.unsortedForEach(function(w){if(w.source===Y&&w.originalLine!=null){var O=_.originalPositionFor({line:w.originalLine,column:w.originalColumn});if(O.source!=null){if(w.source=O.source,K!=null)w.source=K6.join(K,w.source);if(f!=null)w.source=K6.relative(f,w.source);if(w.originalLine=O.line,w.originalColumn=O.column,O.name!=null)w.name=O.name}}var v=w.source;if(v!=null&&!P.has(v))P.add(v);var z=w.name;if(z!=null&&!$.has(z))$.add(z)},this),this._sources=P,this._names=$,_.sources.forEach(function(w){var O=_.sourceContentFor(w);if(O!=null){if(K!=null)w=K6.join(K,w);if(f!=null)w=K6.relative(f,w);this.setSourceContent(w,O)}},this)};U6.prototype._validateMapping=function q(_,j,K,Y){if(j&&typeof j.line!=="number"&&typeof j.column!=="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(_&&"line"in _&&"column"in _&&_.line>0&&_.column>=0&&!j&&!K&&!Y)return;else if(_&&"line"in _&&"column"in _&&j&&"line"in j&&"column"in j&&_.line>0&&_.column>=0&&j.line>0&&j.column>=0&&K)return;else throw new Error("Invalid mapping: "+JSON.stringify({generated:_,source:K,original:j,name:Y}))};U6.prototype._serializeMappings=function q(){var _=0,j=1,K=0,Y=0,f=0,P=0,$="",w,O,v,z,W=this._mappings.toArray();for(var J=0,T=W.length;J0){if(!K6.compareByGeneratedPositionsInflated(O,W[J-1]))continue;w+=","}if(w+=FK.encode(O.generatedColumn-_),_=O.generatedColumn,O.source!=null){if(z=this._sources.indexOf(O.source),w+=FK.encode(z-P),P=z,w+=FK.encode(O.originalLine-1-Y),Y=O.originalLine-1,w+=FK.encode(O.originalColumn-K),K=O.originalColumn,O.name!=null)v=this._names.indexOf(O.name),w+=FK.encode(v-f),f=v}$+=w}return $};U6.prototype._generateSourcesContent=function q(_,j){return _.map(function(K){if(!this._sourcesContents)return null;if(j!=null)K=K6.relative(j,K);var Y=K6.toSetString(K);return Object.prototype.hasOwnProperty.call(this._sourcesContents,Y)?this._sourcesContents[Y]:null},this)};U6.prototype.toJSON=function q(){var _={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null)_.file=this._file;if(this._sourceRoot!=null)_.sourceRoot=this._sourceRoot;if(this._sourcesContents)_.sourcesContent=this._generateSourcesContent(_.sources,_.sourceRoot);return _};U6.prototype.toString=function q(){return JSON.stringify(this.toJSON())};Rk.SourceMapGenerator=U6});var Uj=_8((Ik)=>{Ik.GREATEST_LOWER_BOUND=1;Ik.LEAST_UPPER_BOUND=2;function P2(q,_,j,K,Y,f){var P=Math.floor((_-q)/2)+q,$=Y(j,K[P],!0);if($===0)return P;else if($>0){if(_-P>1)return P2(P,_,j,K,Y,f);if(f==Ik.LEAST_UPPER_BOUND)return _1)return P2(q,P,j,K,Y,f);if(f==Ik.LEAST_UPPER_BOUND)return P;else return q<0?-1:q}}Ik.search=function q(_,j,K,Y){if(j.length===0)return-1;var f=P2(-1,j.length,_,j,K,Y||Ik.GREATEST_LOWER_BOUND);if(f<0)return-1;while(f-1>=0){if(K(j[f],j[f-1],!0)!==0)break;--f}return f}});var sj=_8((dk)=>{function f2(q,_,j){var K=q[_];q[_]=q[j],q[j]=K}function yk(q,_){return Math.round(q+Math.random()*(_-q))}function $2(q,_,j,K){if(j{var j8=jK(),w2=Uj(),PK=K2().ArraySet,Lk=s4(),UK=sj().quickSort;function I8(q,_){var j=q;if(typeof q==="string")j=j8.parseSourceMapInput(q);return j.sections!=null?new Oq(j,_):new W6(j,_)}I8.fromSourceMap=function(q,_){return W6.fromSourceMap(q,_)};I8.prototype._version=3;I8.prototype.__generatedMappings=null;Object.defineProperty(I8.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__generatedMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__generatedMappings}});I8.prototype.__originalMappings=null;Object.defineProperty(I8.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__originalMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__originalMappings}});I8.prototype._charIsMappingSeparator=function q(_,j){var K=_.charAt(j);return K===";"||K===","};I8.prototype._parseMappings=function q(_,j){throw new Error("Subclasses must implement _parseMappings")};I8.GENERATED_ORDER=1;I8.ORIGINAL_ORDER=2;I8.GREATEST_LOWER_BOUND=1;I8.LEAST_UPPER_BOUND=2;I8.prototype.eachMapping=function q(_,j,K){var Y=j||null,f=K||I8.GENERATED_ORDER,P;switch(f){case I8.GENERATED_ORDER:P=this._generatedMappings;break;case I8.ORIGINAL_ORDER:P=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var $=this.sourceRoot;P.map(function(w){var O=w.source===null?null:this._sources.at(w.source);return O=j8.computeSourceURL($,O,this._sourceMapURL),{source:O,generatedLine:w.generatedLine,generatedColumn:w.generatedColumn,originalLine:w.originalLine,originalColumn:w.originalColumn,name:w.name===null?null:this._names.at(w.name)}},this).forEach(_,Y)};I8.prototype.allGeneratedPositionsFor=function q(_){var j=j8.getArg(_,"line"),K={source:j8.getArg(_,"source"),originalLine:j,originalColumn:j8.getArg(_,"column",0)};if(K.source=this._findSourceIndex(K.source),K.source<0)return[];var Y=[],f=this._findMapping(K,this._originalMappings,"originalLine","originalColumn",j8.compareByOriginalPositions,w2.LEAST_UPPER_BOUND);if(f>=0){var P=this._originalMappings[f];if(_.column===void 0){var $=P.originalLine;while(P&&P.originalLine===$)Y.push({line:j8.getArg(P,"generatedLine",null),column:j8.getArg(P,"generatedColumn",null),lastColumn:j8.getArg(P,"lastGeneratedColumn",null)}),P=this._originalMappings[++f]}else{var w=P.originalColumn;while(P&&P.originalLine===j&&P.originalColumn==w)Y.push({line:j8.getArg(P,"generatedLine",null),column:j8.getArg(P,"generatedColumn",null),lastColumn:j8.getArg(P,"lastGeneratedColumn",null)}),P=this._originalMappings[++f]}}return Y};lk.SourceMapConsumer=I8;function W6(q,_){var j=q;if(typeof q==="string")j=j8.parseSourceMapInput(q);var K=j8.getArg(j,"version"),Y=j8.getArg(j,"sources"),f=j8.getArg(j,"names",[]),P=j8.getArg(j,"sourceRoot",null),$=j8.getArg(j,"sourcesContent",null),w=j8.getArg(j,"mappings"),O=j8.getArg(j,"file",null);if(K!=this._version)throw new Error("Unsupported version: "+K);if(P)P=j8.normalize(P);Y=Y.map(String).map(j8.normalize).map(function(v){return P&&j8.isAbsolute(P)&&j8.isAbsolute(v)?j8.relative(P,v):v}),this._names=PK.fromArray(f.map(String),!0),this._sources=PK.fromArray(Y,!0),this._absoluteSources=this._sources.toArray().map(function(v){return j8.computeSourceURL(P,v,_)}),this.sourceRoot=P,this.sourcesContent=$,this._mappings=w,this._sourceMapURL=_,this.file=O}W6.prototype=Object.create(I8.prototype);W6.prototype.consumer=I8;W6.prototype._findSourceIndex=function(q){var _=q;if(this.sourceRoot!=null)_=j8.relative(this.sourceRoot,_);if(this._sources.has(_))return this._sources.indexOf(_);var j;for(j=0;j1){if(H.source=$+A[1],$+=A[1],H.originalLine=f+A[2],f=H.originalLine,H.originalLine+=1,H.originalColumn=P+A[3],P=H.originalColumn,A.length>4)H.name=w+A[4],w+=A[4]}if(T.push(H),typeof H.originalLine==="number")J.push(H)}UK(T,j8.compareByGeneratedPositionsDeflated),this.__generatedMappings=T,UK(J,j8.compareByOriginalPositions),this.__originalMappings=J};W6.prototype._findMapping=function q(_,j,K,Y,f,P){if(_[K]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+_[K]);if(_[Y]<0)throw new TypeError("Column must be greater than or equal to 0, got "+_[Y]);return w2.search(_,j,f,P)};W6.prototype.computeColumnSpans=function q(){for(var _=0;_=0){var Y=this._generatedMappings[K];if(Y.generatedLine===j.generatedLine){var f=j8.getArg(Y,"source",null);if(f!==null)f=this._sources.at(f),f=j8.computeSourceURL(this.sourceRoot,f,this._sourceMapURL);var P=j8.getArg(Y,"name",null);if(P!==null)P=this._names.at(P);return{source:f,line:j8.getArg(Y,"originalLine",null),column:j8.getArg(Y,"originalColumn",null),name:P}}}return{source:null,line:null,column:null,name:null}};W6.prototype.hasContentsOfAllSources=function q(){if(!this.sourcesContent)return!1;return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(_){return _==null})};W6.prototype.sourceContentFor=function q(_,j){if(!this.sourcesContent)return null;var K=this._findSourceIndex(_);if(K>=0)return this.sourcesContent[K];var Y=_;if(this.sourceRoot!=null)Y=j8.relative(this.sourceRoot,Y);var f;if(this.sourceRoot!=null&&(f=j8.urlParse(this.sourceRoot))){var P=Y.replace(/^file:\/\//,"");if(f.scheme=="file"&&this._sources.has(P))return this.sourcesContent[this._sources.indexOf(P)];if((!f.path||f.path=="/")&&this._sources.has("/"+Y))return this.sourcesContent[this._sources.indexOf("/"+Y)]}if(j)return null;else throw new Error('"'+Y+'" is not in the SourceMap.')};W6.prototype.generatedPositionFor=function q(_){var j=j8.getArg(_,"source");if(j=this._findSourceIndex(j),j<0)return{line:null,column:null,lastColumn:null};var K={source:j,originalLine:j8.getArg(_,"line"),originalColumn:j8.getArg(_,"column")},Y=this._findMapping(K,this._originalMappings,"originalLine","originalColumn",j8.compareByOriginalPositions,j8.getArg(_,"bias",I8.GREATEST_LOWER_BOUND));if(Y>=0){var f=this._originalMappings[Y];if(f.source===K.source)return{line:j8.getArg(f,"generatedLine",null),column:j8.getArg(f,"generatedColumn",null),lastColumn:j8.getArg(f,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};lk.BasicSourceMapConsumer=W6;function Oq(q,_){var j=q;if(typeof q==="string")j=j8.parseSourceMapInput(q);var K=j8.getArg(j,"version"),Y=j8.getArg(j,"sections");if(K!=this._version)throw new Error("Unsupported version: "+K);this._sources=new PK,this._names=new PK;var f={line:-1,column:0};this._sections=Y.map(function(P){if(P.url)throw new Error("Support for url field in sections not implemented.");var $=j8.getArg(P,"offset"),w=j8.getArg($,"line"),O=j8.getArg($,"column");if(w{var rk=j2().SourceMapGenerator,P7=jK(),ik=/(\r?\n)/,ok=10,YK="$$$isSourceNode$$$";function p6(q,_,j,K,Y){if(this.children=[],this.sourceContents={},this.line=q==null?null:q,this.column=_==null?null:_,this.source=j==null?null:j,this.name=Y==null?null:Y,this[YK]=!0,K!=null)this.add(K)}p6.fromStringWithSourceMap=function q(_,j,K){var Y=new p6,f=_.split(ik),P=0,$=function(){var W=T(),J=T()||"";return W+J;function T(){return P=0;j--)this.prepend(_[j]);else if(_[YK]||typeof _==="string")this.children.unshift(_);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+_);return this};p6.prototype.walk=function q(_){var j;for(var K=0,Y=this.children.length;K0){j=[];for(K=0;K{tk.SourceMapGenerator=j2().SourceMapGenerator;tk.SourceMapConsumer=qP().SourceMapConsumer;tk.SourceNode=_P().SourceNode});var fP=_8((PP,YP)=>{PP.__esModule=!0;var z2=C6(),Z_=void 0;try{if(typeof define!=="function"||!define.amd)v2=KP(),Z_=v2.SourceNode}catch(q){}var v2;if(!Z_)Z_=function(q,_,j,K){if(this.src="",K)this.add(K)},Z_.prototype={add:function q(_){if(z2.isArray(_))_=_.join("");this.src+=_},prepend:function q(_){if(z2.isArray(_))_=_.join("");this.src=_+this.src},toStringWithSourceMap:function q(){return{code:this.toString()}},toString:function q(){return this.src}};function O2(q,_,j){if(z2.isArray(q)){var K=[];for(var Y=0,f=q.length;Y{zP.__esModule=!0;function OP(q){return q&&q.__esModule?q:{default:q}}var $P=F3(),qX=F6(),W2=OP(qX),_X=C6(),KX=fP(),wP=OP(KX);function fK(q){this.value=q}function $K(){}$K.prototype={nameLookup:function q(_,j){return this.internalNameLookup(_,j)},depthedLookup:function q(_){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(_),")"]},compilerInfo:function q(){var _=$P.COMPILER_REVISION,j=$P.REVISION_CHANGES[_];return[_,j]},appendToBuffer:function q(_,j,K){if(!_X.isArray(_))_=[_];if(_=this.source.wrap(_,j),this.environment.isSimple)return["return ",_,";"];else if(K)return["buffer += ",_,";"];else return _.appendToBuffer=!0,_},initializeBuffer:function q(){return this.quotedString("")},internalNameLookup:function q(_,j){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",_,",",JSON.stringify(j),")"]},lookupPropertyFunctionIsUsed:!1,compile:function q(_,j,K,Y){this.environment=_,this.options=j,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!Y,this.name=this.environment.name,this.isChild=!!K,this.context=K||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(_,j),this.useDepths=this.useDepths||_.useDepths||_.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||_.useBlockParams;var f=_.opcodes,P=void 0,$=void 0,w=void 0,O=void 0;for(w=0,O=f.length;w@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],K.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},K}();q.lexer=_;function j(){this.yy={}}return j.prototype=q,q.Parser=j,new j}();Aj.default=cT;Gj.exports=Aj.default});var q7=_8((Cj,Vj)=>{Cj.__esModule=!0;function oT(q){return q&&q.__esModule?q:{default:q}}var aT=F6(),i4=oT(aT);function s3(){this.parents=[]}s3.prototype={constructor:s3,mutating:!1,acceptKey:function q(_,j){var K=this.accept(_[j]);if(this.mutating){if(K&&!s3.prototype[K.type])throw new i4.default('Unexpected node type "'+K.type+'" found when accepting '+j+" on "+_.type);_[j]=K}},acceptRequired:function q(_,j){if(this.acceptKey(_,j),!_[j])throw new i4.default(_.type+" requires "+j)},acceptArray:function q(_){for(var j=0,K=_.length;j{Mj.__esModule=!0;function eT(q){return q&&q.__esModule?q:{default:q}}var FT=q7(),UT=eT(FT);function uq(){var q=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=q}uq.prototype=new UT.default;uq.prototype.Program=function(q){var _=!this.options.ignoreStandalone,j=!this.isRootSeen;this.isRootSeen=!0;var K=q.body;for(var Y=0,f=K.length;Y{WZ.__esModule=!0;WZ.SourceLocation=KZ;WZ.id=jZ;WZ.stripFlags=PZ;WZ.stripComment=YZ;WZ.preparePath=fZ;WZ.prepareMustache=$Z;WZ.prepareRawBlock=wZ;WZ.prepareBlock=OZ;WZ.prepareProgram=zZ;WZ.preparePartialBlock=vZ;function qZ(q){return q&&q.__esModule?q:{default:q}}var _Z=F6(),B4=qZ(_Z);function t4(q,_){if(_=_.path?_.path.original:_,q.path.original!==_){var j={loc:q.path.loc};throw new B4.default(q.path.original+" doesn't match "+_,j)}}function KZ(q,_){this.source=q,this.start={line:_.first_line,column:_.first_column},this.end={line:_.last_line,column:_.last_column}}function jZ(q){if(/^\[.*\]$/.test(q))return q.substring(1,q.length-1);else return q}function PZ(q,_){return{open:q.charAt(2)==="~",close:_.charAt(_.length-3)==="~"}}function YZ(q){return q.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function fZ(q,_,j){j=this.locInfo(j);var K=q?"@":"",Y=[],f=0;for(var P=0,$=_.length;P<$;P++){var w=_[P].part,O=_[P].original!==w;if(K+=(_[P].separator||"")+w,!O&&(w===".."||w==="."||w==="this")){if(Y.length>0)throw new B4.default("Invalid path: "+K,{loc:j});else if(w==="..")f++}else Y.push(w)}return{type:"PathExpression",data:q,depth:f,parts:Y,original:K,loc:j}}function $Z(q,_,j,K,Y,f){var P=K.charAt(3)||K.charAt(2),$=P!=="{"&&P!=="&",w=/\*/.test(K);return{type:w?"Decorator":"MustacheStatement",path:q,params:_,hash:j,escaped:$,strip:Y,loc:this.locInfo(f)}}function wZ(q,_,j,K){t4(q,j),K=this.locInfo(K);var Y={type:"Program",body:_,strip:{},loc:K};return{type:"BlockStatement",path:q.path,params:q.params,hash:q.hash,program:Y,openStrip:{},inverseStrip:{},closeStrip:{},loc:K}}function OZ(q,_,j,K,Y,f){if(K&&K.path)t4(q,K);var P=/\*/.test(q.open);_.blockParams=q.blockParams;var $=void 0,w=void 0;if(j){if(P)throw new B4.default("Unexpected inverse block on decorator",j);if(j.chain)j.program.body[0].closeStrip=K.strip;w=j.strip,$=j.program}if(Y)Y=$,$=_,_=Y;return{type:P?"DecoratorBlock":"BlockStatement",path:q.path,params:q.params,hash:q.hash,program:_,inverse:$,openStrip:q.strip,inverseStrip:w,closeStrip:K&&K.strip,loc:this.locInfo(f)}}function zZ(q,_){if(!_&&q.length){var j=q[0].loc,K=q[q.length-1].loc;if(j&&K)_={source:j.source,start:{line:j.start.line,column:j.start.column},end:{line:K.end.line,column:K.end.column}}}return{type:"Program",body:q,strip:{},loc:_}}function vZ(q,_,j,K){return t4(q,j),{type:"PartialBlockStatement",name:q.path,params:q.params,hash:q.hash,program:_,openStrip:q.strip,closeStrip:j&&j.strip,loc:this.locInfo(K)}}});var mj=_8((mZ)=>{mZ.__esModule=!0;mZ.parseWithoutProcessing=Rj;mZ.parse=RZ;function CZ(q){if(q&&q.__esModule)return q;else{var _={};if(q!=null){for(var j in q)if(Object.prototype.hasOwnProperty.call(q,j))_[j]=q[j]}return _.default=q,_}}function Ej(q){return q&&q.__esModule?q:{default:q}}var VZ=uj(),e4=Ej(VZ),MZ=bj(),NZ=Ej(MZ),bZ=Sj(),SZ=CZ(bZ),EZ=C6();mZ.parser=e4.default;var _7={};EZ.extend(_7,SZ);function Rj(q,_){if(q.type==="Program")return q;e4.default.yy=_7,_7.locInfo=function(K){return new _7.SourceLocation(_&&_.srcName,K)};var j=e4.default.parse(q);return j}function RZ(q,_){var j=Rj(q,_),K=new NZ.default(_);return K.accept(j)}});var dj=_8((cZ)=>{cZ.__esModule=!0;cZ.Compiler=F4;cZ.precompile=xZ;cZ.compile=nZ;function gj(q){return q&&q.__esModule?q:{default:q}}var pZ=F6(),BK=gj(pZ),tK=C6(),LZ=r4(),aK=gj(LZ),lZ=[].slice;function F4(){}F4.prototype={compiler:F4,equals:function q(_){var j=this.opcodes.length;if(_.opcodes.length!==j)return!1;for(var K=0;K1)throw new BK.default("Unsupported number of partial arguments: "+K.length,_);else if(!K.length)if(this.options.explicitPartialContext)this.opcode("pushLiteral","undefined");else K.push({type:"PathExpression",parts:[],depth:0});var Y=_.name.original,f=_.name.type==="SubExpression";if(f)this.accept(_.name);this.setupFullMustacheParams(_,j,void 0,!0);var P=_.indent||"";if(this.options.preventIndent&&P)this.opcode("appendContent",P),P="";this.opcode("invokePartial",f,Y,P),this.opcode("append")},PartialBlockStatement:function q(_){this.PartialStatement(_)},MustacheStatement:function q(_){if(this.SubExpression(_),_.escaped&&!this.options.noEscape)this.opcode("appendEscaped");else this.opcode("append")},Decorator:function q(_){this.DecoratorBlock(_)},ContentStatement:function q(_){if(_.value)this.opcode("appendContent",_.value)},CommentStatement:function q(){},SubExpression:function q(_){Ij(_);var j=this.classifySexpr(_);if(j==="simple")this.simpleSexpr(_);else if(j==="helper")this.helperSexpr(_);else this.ambiguousSexpr(_)},ambiguousSexpr:function q(_,j,K){var Y=_.path,f=Y.parts[0],P=j!=null||K!=null;this.opcode("getContext",Y.depth),this.opcode("pushProgram",j),this.opcode("pushProgram",K),Y.strict=!0,this.accept(Y),this.opcode("invokeAmbiguous",f,P)},simpleSexpr:function q(_){var j=_.path;j.strict=!0,this.accept(j),this.opcode("resolvePossibleLambda")},helperSexpr:function q(_,j,K){var Y=this.setupFullMustacheParams(_,j,K),f=_.path,P=f.parts[0];if(this.options.knownHelpers[P])this.opcode("invokeKnownHelper",Y.length,P);else if(this.options.knownHelpersOnly)throw new BK.default("You specified knownHelpersOnly, but used the unknown helper "+P,_);else f.strict=!0,f.falsy=!0,this.accept(f),this.opcode("invokeHelper",Y.length,f.original,aK.default.helpers.simpleId(f))},PathExpression:function q(_){this.addDepth(_.depth),this.opcode("getContext",_.depth);var j=_.parts[0],K=aK.default.helpers.scopedId(_),Y=!_.depth&&!K&&this.blockParamIndex(j);if(Y)this.opcode("lookupBlockParam",Y,_.parts);else if(!j)this.opcode("pushContext");else if(_.data)this.options.data=!0,this.opcode("lookupData",_.depth,_.parts,_.strict);else this.opcode("lookupOnContext",_.parts,_.falsy,_.strict,K)},StringLiteral:function q(_){this.opcode("pushString",_.value)},NumberLiteral:function q(_){this.opcode("pushLiteral",_.value)},BooleanLiteral:function q(_){this.opcode("pushLiteral",_.value)},UndefinedLiteral:function q(){this.opcode("pushLiteral","undefined")},NullLiteral:function q(){this.opcode("pushLiteral","null")},Hash:function q(_){var j=_.pairs,K=0,Y=j.length;this.opcode("pushHash");for(;K=0)return[j,f]}}};function xZ(q,_,j){if(q==null||typeof q!=="string"&&q.type!=="Program")throw new BK.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+q);if(_=_||{},!("data"in _))_.data=!0;if(_.compat)_.useDepths=!0;var K=j.parse(q,_),Y=new j.Compiler().compile(K,_);return new j.JavaScriptCompiler().compile(Y,_)}function nZ(q,_,j){if(_===void 0)_={};if(q==null||typeof q!=="string"&&q.type!=="Program")throw new BK.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+q);if(_=tK.extend({},_),!("data"in _))_.data=!0;if(_.compat)_.useDepths=!0;var K=void 0;function Y(){var P=j.parse(q,_),$=new j.Compiler().compile(P,_),w=new j.JavaScriptCompiler().compile($,_,void 0,!0);return j.template(w)}function f(P,$){if(!K)K=Y();return K.call(this,P,$)}return f._setup=function(P){if(!K)K=Y();return K._setup(P)},f._child=function(P,$,w,O){if(!K)K=Y();return K._child(P,$,w,O)},f}function yj(q,_){if(q===_)return!0;if(tK.isArray(q)&&tK.isArray(_)&&q.length===_.length){for(var j=0;j{var pj="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");BZ.encode=function(q){if(0<=q&&q{var lj=Lj(),U4=5,xj=1<>1;return _?-j:j}sZ.encode=function q(_){var j="",K,Y=FZ(_);do{if(K=Y&nj,Y>>>=U4,Y>0)K|=cj;j+=lj.encode(K)}while(Y>0);return j};sZ.decode=function q(_,j,K){var Y=_.length,f=0,P=0,$,w;do{if(j>=Y)throw new Error("Expected more digits in base 64 VLQ value.");if(w=lj.decode(_.charCodeAt(j++)),w===-1)throw new Error("Invalid base64 digit: "+_.charAt(j-1));$=!!(w&cj),w&=nj,f=f+(w<{function _k(q,_,j){if(_ in q)return q[_];else if(arguments.length===3)return j;else throw new Error('"'+_+'" is a required argument.')}vk.getArg=_k;var rj=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Kk=/^data:.+\,.+$/;function eK(q){var _=q.match(rj);if(!_)return null;return{scheme:_[1],auth:_[2],host:_[3],port:_[4],path:_[5]}}vk.urlParse=eK;function _K(q){var _="";if(q.scheme)_+=q.scheme+":";if(_+="//",q.auth)_+=q.auth+"@";if(q.host)_+=q.host;if(q.port)_+=":"+q.port;if(q.path)_+=q.path;return _}vk.urlGenerate=_K;function Q4(q){var _=q,j=eK(q);if(j){if(!j.path)return q;_=j.path}var K=vk.isAbsolute(_),Y=_.split(/\/+/);for(var f,P=0,$=Y.length-1;$>=0;$--)if(f=Y[$],f===".")Y.splice($,1);else if(f==="..")P++;else if(P>0)if(f==="")Y.splice($+1,P),P=0;else Y.splice($,2),P--;if(_=Y.join("/"),_==="")_=K?"/":".";if(j)return j.path=_,_K(j);return _}vk.normalize=Q4;function ij(q,_){if(q==="")q=".";if(_==="")_=".";var j=eK(_),K=eK(q);if(K)q=K.path||"/";if(j&&!j.scheme){if(K)j.scheme=K.scheme;return _K(j)}if(j||_.match(Kk))return _;if(K&&!K.host&&!K.path)return K.host=_,_K(K);var Y=_.charAt(0)==="/"?_:Q4(q.replace(/\/+$/,"")+"/"+_);if(K)return K.path=Y,_K(K);return Y}vk.join=ij;vk.isAbsolute=function(q){return q.charAt(0)==="/"||rj.test(q)};function jk(q,_){if(q==="")q=".";q=q.replace(/\/$/,"");var j=0;while(_.indexOf(q+"/")!==0){var K=q.lastIndexOf("/");if(K<0)return _;if(q=q.slice(0,K),q.match(/^([^\/]+:\/)?\/*$/))return _;++j}return Array(j+1).join("../")+_.substr(q.length+1)}vk.relative=jk;var oj=function(){var q=Object.create(null);return!("__proto__"in q)}();function aj(q){return q}function Pk(q){if(Bj(q))return"$"+q;return q}vk.toSetString=oj?aj:Pk;function Yk(q){if(Bj(q))return q.slice(1);return q}vk.fromSetString=oj?aj:Yk;function Bj(q){if(!q)return!1;var _=q.length;if(_<9)return!1;if(q.charCodeAt(_-1)!==95||q.charCodeAt(_-2)!==95||q.charCodeAt(_-3)!==111||q.charCodeAt(_-4)!==116||q.charCodeAt(_-5)!==111||q.charCodeAt(_-6)!==114||q.charCodeAt(_-7)!==112||q.charCodeAt(_-8)!==95||q.charCodeAt(_-9)!==95)return!1;for(var j=_-10;j>=0;j--)if(q.charCodeAt(j)!==36)return!1;return!0}function fk(q,_,j){var K=KK(q.source,_.source);if(K!==0)return K;if(K=q.originalLine-_.originalLine,K!==0)return K;if(K=q.originalColumn-_.originalColumn,K!==0||j)return K;if(K=q.generatedColumn-_.generatedColumn,K!==0)return K;if(K=q.generatedLine-_.generatedLine,K!==0)return K;return KK(q.name,_.name)}vk.compareByOriginalPositions=fk;function $k(q,_,j){var K=q.generatedLine-_.generatedLine;if(K!==0)return K;if(K=q.generatedColumn-_.generatedColumn,K!==0||j)return K;if(K=KK(q.source,_.source),K!==0)return K;if(K=q.originalLine-_.originalLine,K!==0)return K;if(K=q.originalColumn-_.originalColumn,K!==0)return K;return KK(q.name,_.name)}vk.compareByGeneratedPositionsDeflated=$k;function KK(q,_){if(q===_)return 0;if(q===null)return 1;if(_===null)return-1;if(q>_)return 1;return-1}function wk(q,_){var j=q.generatedLine-_.generatedLine;if(j!==0)return j;if(j=q.generatedColumn-_.generatedColumn,j!==0)return j;if(j=KK(q.source,_.source),j!==0)return j;if(j=q.originalLine-_.originalLine,j!==0)return j;if(j=q.originalColumn-_.originalColumn,j!==0)return j;return KK(q.name,_.name)}vk.compareByGeneratedPositionsInflated=wk;function Ok(q){return JSON.parse(q.replace(/^\)]}'[^\n]*\n/,""))}vk.parseSourceMapInput=Ok;function zk(q,_,j){if(_=_||"",q){if(q[q.length-1]!=="/"&&_[0]!=="/")q+="/";_=q+_}if(j){var K=eK(j);if(!K)throw new Error("sourceMapURL could not be parsed");if(K.path){var Y=K.path.lastIndexOf("/");if(Y>=0)K.path=K.path.substring(0,Y+1)}_=ij(_K(K),_)}return Q4(_)}vk.computeSourceURL=zk});var K2=_8((Mk)=>{var q2=jK(),_2=Object.prototype.hasOwnProperty,T_=typeof Map!=="undefined";function lq(){this._array=[],this._set=T_?new Map:Object.create(null)}lq.fromArray=function q(_,j){var K=new lq;for(var Y=0,f=_.length;Y=0)return j}else{var K=q2.toSetString(_);if(_2.call(this._set,K))return this._set[K]}throw new Error('"'+_+'" is not in the set.')};lq.prototype.at=function q(_){if(_>=0&&_{var tj=jK();function bk(q,_){var j=q.generatedLine,K=_.generatedLine,Y=q.generatedColumn,f=_.generatedColumn;return K>j||K==j&&f>=Y||tj.compareByGeneratedPositionsInflated(q,_)<=0}function K7(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}K7.prototype.unsortedForEach=function q(_,j){this._array.forEach(_,j)};K7.prototype.add=function q(_){if(bk(this._last,_))this._last=_,this._array.push(_);else this._sorted=!1,this._array.push(_)};K7.prototype.toArray=function q(){if(!this._sorted)this._array.sort(tj.compareByGeneratedPositionsInflated),this._sorted=!0;return this._array};Sk.MappingList=K7});var j2=_8((mk)=>{var FK=s4(),K6=jK(),j7=K2().ArraySet,Rk=ej().MappingList;function U6(q){if(!q)q={};this._file=K6.getArg(q,"file",null),this._sourceRoot=K6.getArg(q,"sourceRoot",null),this._skipValidation=K6.getArg(q,"skipValidation",!1),this._sources=new j7,this._names=new j7,this._mappings=new Rk,this._sourcesContents=null}U6.prototype._version=3;U6.fromSourceMap=function q(_){var j=_.sourceRoot,K=new U6({file:_.file,sourceRoot:j});return _.eachMapping(function(Y){var f={generated:{line:Y.generatedLine,column:Y.generatedColumn}};if(Y.source!=null){if(f.source=Y.source,j!=null)f.source=K6.relative(j,f.source);if(f.original={line:Y.originalLine,column:Y.originalColumn},Y.name!=null)f.name=Y.name}K.addMapping(f)}),_.sources.forEach(function(Y){var f=Y;if(j!==null)f=K6.relative(j,Y);if(!K._sources.has(f))K._sources.add(f);var P=_.sourceContentFor(Y);if(P!=null)K.setSourceContent(Y,P)}),K};U6.prototype.addMapping=function q(_){var j=K6.getArg(_,"generated"),K=K6.getArg(_,"original",null),Y=K6.getArg(_,"source",null),f=K6.getArg(_,"name",null);if(!this._skipValidation)this._validateMapping(j,K,Y,f);if(Y!=null){if(Y=String(Y),!this._sources.has(Y))this._sources.add(Y)}if(f!=null){if(f=String(f),!this._names.has(f))this._names.add(f)}this._mappings.add({generatedLine:j.line,generatedColumn:j.column,originalLine:K!=null&&K.line,originalColumn:K!=null&&K.column,source:Y,name:f})};U6.prototype.setSourceContent=function q(_,j){var K=_;if(this._sourceRoot!=null)K=K6.relative(this._sourceRoot,K);if(j!=null){if(!this._sourcesContents)this._sourcesContents=Object.create(null);this._sourcesContents[K6.toSetString(K)]=j}else if(this._sourcesContents){if(delete this._sourcesContents[K6.toSetString(K)],Object.keys(this._sourcesContents).length===0)this._sourcesContents=null}};U6.prototype.applySourceMap=function q(_,j,K){var Y=j;if(j==null){if(_.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);Y=_.file}var f=this._sourceRoot;if(f!=null)Y=K6.relative(f,Y);var P=new j7,$=new j7;this._mappings.unsortedForEach(function(w){if(w.source===Y&&w.originalLine!=null){var O=_.originalPositionFor({line:w.originalLine,column:w.originalColumn});if(O.source!=null){if(w.source=O.source,K!=null)w.source=K6.join(K,w.source);if(f!=null)w.source=K6.relative(f,w.source);if(w.originalLine=O.line,w.originalColumn=O.column,O.name!=null)w.name=O.name}}var v=w.source;if(v!=null&&!P.has(v))P.add(v);var z=w.name;if(z!=null&&!$.has(z))$.add(z)},this),this._sources=P,this._names=$,_.sources.forEach(function(w){var O=_.sourceContentFor(w);if(O!=null){if(K!=null)w=K6.join(K,w);if(f!=null)w=K6.relative(f,w);this.setSourceContent(w,O)}},this)};U6.prototype._validateMapping=function q(_,j,K,Y){if(j&&typeof j.line!=="number"&&typeof j.column!=="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(_&&"line"in _&&"column"in _&&_.line>0&&_.column>=0&&!j&&!K&&!Y)return;else if(_&&"line"in _&&"column"in _&&j&&"line"in j&&"column"in j&&_.line>0&&_.column>=0&&j.line>0&&j.column>=0&&K)return;else throw new Error("Invalid mapping: "+JSON.stringify({generated:_,source:K,original:j,name:Y}))};U6.prototype._serializeMappings=function q(){var _=0,j=1,K=0,Y=0,f=0,P=0,$="",w,O,v,z,W=this._mappings.toArray();for(var J=0,T=W.length;J0){if(!K6.compareByGeneratedPositionsInflated(O,W[J-1]))continue;w+=","}if(w+=FK.encode(O.generatedColumn-_),_=O.generatedColumn,O.source!=null){if(z=this._sources.indexOf(O.source),w+=FK.encode(z-P),P=z,w+=FK.encode(O.originalLine-1-Y),Y=O.originalLine-1,w+=FK.encode(O.originalColumn-K),K=O.originalColumn,O.name!=null)v=this._names.indexOf(O.name),w+=FK.encode(v-f),f=v}$+=w}return $};U6.prototype._generateSourcesContent=function q(_,j){return _.map(function(K){if(!this._sourcesContents)return null;if(j!=null)K=K6.relative(j,K);var Y=K6.toSetString(K);return Object.prototype.hasOwnProperty.call(this._sourcesContents,Y)?this._sourcesContents[Y]:null},this)};U6.prototype.toJSON=function q(){var _={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null)_.file=this._file;if(this._sourceRoot!=null)_.sourceRoot=this._sourceRoot;if(this._sourcesContents)_.sourcesContent=this._generateSourcesContent(_.sources,_.sourceRoot);return _};U6.prototype.toString=function q(){return JSON.stringify(this.toJSON())};mk.SourceMapGenerator=U6});var Uj=_8((gk)=>{gk.GREATEST_LOWER_BOUND=1;gk.LEAST_UPPER_BOUND=2;function P2(q,_,j,K,Y,f){var P=Math.floor((_-q)/2)+q,$=Y(j,K[P],!0);if($===0)return P;else if($>0){if(_-P>1)return P2(P,_,j,K,Y,f);if(f==gk.LEAST_UPPER_BOUND)return _1)return P2(q,P,j,K,Y,f);if(f==gk.LEAST_UPPER_BOUND)return P;else return q<0?-1:q}}gk.search=function q(_,j,K,Y){if(j.length===0)return-1;var f=P2(-1,j.length,_,j,K,Y||gk.GREATEST_LOWER_BOUND);if(f<0)return-1;while(f-1>=0){if(K(j[f],j[f-1],!0)!==0)break;--f}return f}});var sj=_8((pk)=>{function f2(q,_,j){var K=q[_];q[_]=q[j],q[j]=K}function dk(q,_){return Math.round(q+Math.random()*(_-q))}function $2(q,_,j,K){if(j{var j8=jK(),w2=Uj(),PK=K2().ArraySet,lk=s4(),UK=sj().quickSort;function I8(q,_){var j=q;if(typeof q==="string")j=j8.parseSourceMapInput(q);return j.sections!=null?new Oq(j,_):new W6(j,_)}I8.fromSourceMap=function(q,_){return W6.fromSourceMap(q,_)};I8.prototype._version=3;I8.prototype.__generatedMappings=null;Object.defineProperty(I8.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__generatedMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__generatedMappings}});I8.prototype.__originalMappings=null;Object.defineProperty(I8.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__originalMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__originalMappings}});I8.prototype._charIsMappingSeparator=function q(_,j){var K=_.charAt(j);return K===";"||K===","};I8.prototype._parseMappings=function q(_,j){throw new Error("Subclasses must implement _parseMappings")};I8.GENERATED_ORDER=1;I8.ORIGINAL_ORDER=2;I8.GREATEST_LOWER_BOUND=1;I8.LEAST_UPPER_BOUND=2;I8.prototype.eachMapping=function q(_,j,K){var Y=j||null,f=K||I8.GENERATED_ORDER,P;switch(f){case I8.GENERATED_ORDER:P=this._generatedMappings;break;case I8.ORIGINAL_ORDER:P=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var $=this.sourceRoot;P.map(function(w){var O=w.source===null?null:this._sources.at(w.source);return O=j8.computeSourceURL($,O,this._sourceMapURL),{source:O,generatedLine:w.generatedLine,generatedColumn:w.generatedColumn,originalLine:w.originalLine,originalColumn:w.originalColumn,name:w.name===null?null:this._names.at(w.name)}},this).forEach(_,Y)};I8.prototype.allGeneratedPositionsFor=function q(_){var j=j8.getArg(_,"line"),K={source:j8.getArg(_,"source"),originalLine:j,originalColumn:j8.getArg(_,"column",0)};if(K.source=this._findSourceIndex(K.source),K.source<0)return[];var Y=[],f=this._findMapping(K,this._originalMappings,"originalLine","originalColumn",j8.compareByOriginalPositions,w2.LEAST_UPPER_BOUND);if(f>=0){var P=this._originalMappings[f];if(_.column===void 0){var $=P.originalLine;while(P&&P.originalLine===$)Y.push({line:j8.getArg(P,"generatedLine",null),column:j8.getArg(P,"generatedColumn",null),lastColumn:j8.getArg(P,"lastGeneratedColumn",null)}),P=this._originalMappings[++f]}else{var w=P.originalColumn;while(P&&P.originalLine===j&&P.originalColumn==w)Y.push({line:j8.getArg(P,"generatedLine",null),column:j8.getArg(P,"generatedColumn",null),lastColumn:j8.getArg(P,"lastGeneratedColumn",null)}),P=this._originalMappings[++f]}}return Y};xk.SourceMapConsumer=I8;function W6(q,_){var j=q;if(typeof q==="string")j=j8.parseSourceMapInput(q);var K=j8.getArg(j,"version"),Y=j8.getArg(j,"sources"),f=j8.getArg(j,"names",[]),P=j8.getArg(j,"sourceRoot",null),$=j8.getArg(j,"sourcesContent",null),w=j8.getArg(j,"mappings"),O=j8.getArg(j,"file",null);if(K!=this._version)throw new Error("Unsupported version: "+K);if(P)P=j8.normalize(P);Y=Y.map(String).map(j8.normalize).map(function(v){return P&&j8.isAbsolute(P)&&j8.isAbsolute(v)?j8.relative(P,v):v}),this._names=PK.fromArray(f.map(String),!0),this._sources=PK.fromArray(Y,!0),this._absoluteSources=this._sources.toArray().map(function(v){return j8.computeSourceURL(P,v,_)}),this.sourceRoot=P,this.sourcesContent=$,this._mappings=w,this._sourceMapURL=_,this.file=O}W6.prototype=Object.create(I8.prototype);W6.prototype.consumer=I8;W6.prototype._findSourceIndex=function(q){var _=q;if(this.sourceRoot!=null)_=j8.relative(this.sourceRoot,_);if(this._sources.has(_))return this._sources.indexOf(_);var j;for(j=0;j1){if(H.source=$+A[1],$+=A[1],H.originalLine=f+A[2],f=H.originalLine,H.originalLine+=1,H.originalColumn=P+A[3],P=H.originalColumn,A.length>4)H.name=w+A[4],w+=A[4]}if(T.push(H),typeof H.originalLine==="number")J.push(H)}UK(T,j8.compareByGeneratedPositionsDeflated),this.__generatedMappings=T,UK(J,j8.compareByOriginalPositions),this.__originalMappings=J};W6.prototype._findMapping=function q(_,j,K,Y,f,P){if(_[K]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+_[K]);if(_[Y]<0)throw new TypeError("Column must be greater than or equal to 0, got "+_[Y]);return w2.search(_,j,f,P)};W6.prototype.computeColumnSpans=function q(){for(var _=0;_=0){var Y=this._generatedMappings[K];if(Y.generatedLine===j.generatedLine){var f=j8.getArg(Y,"source",null);if(f!==null)f=this._sources.at(f),f=j8.computeSourceURL(this.sourceRoot,f,this._sourceMapURL);var P=j8.getArg(Y,"name",null);if(P!==null)P=this._names.at(P);return{source:f,line:j8.getArg(Y,"originalLine",null),column:j8.getArg(Y,"originalColumn",null),name:P}}}return{source:null,line:null,column:null,name:null}};W6.prototype.hasContentsOfAllSources=function q(){if(!this.sourcesContent)return!1;return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(_){return _==null})};W6.prototype.sourceContentFor=function q(_,j){if(!this.sourcesContent)return null;var K=this._findSourceIndex(_);if(K>=0)return this.sourcesContent[K];var Y=_;if(this.sourceRoot!=null)Y=j8.relative(this.sourceRoot,Y);var f;if(this.sourceRoot!=null&&(f=j8.urlParse(this.sourceRoot))){var P=Y.replace(/^file:\/\//,"");if(f.scheme=="file"&&this._sources.has(P))return this.sourcesContent[this._sources.indexOf(P)];if((!f.path||f.path=="/")&&this._sources.has("/"+Y))return this.sourcesContent[this._sources.indexOf("/"+Y)]}if(j)return null;else throw new Error('"'+Y+'" is not in the SourceMap.')};W6.prototype.generatedPositionFor=function q(_){var j=j8.getArg(_,"source");if(j=this._findSourceIndex(j),j<0)return{line:null,column:null,lastColumn:null};var K={source:j,originalLine:j8.getArg(_,"line"),originalColumn:j8.getArg(_,"column")},Y=this._findMapping(K,this._originalMappings,"originalLine","originalColumn",j8.compareByOriginalPositions,j8.getArg(_,"bias",I8.GREATEST_LOWER_BOUND));if(Y>=0){var f=this._originalMappings[Y];if(f.source===K.source)return{line:j8.getArg(f,"generatedLine",null),column:j8.getArg(f,"generatedColumn",null),lastColumn:j8.getArg(f,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};xk.BasicSourceMapConsumer=W6;function Oq(q,_){var j=q;if(typeof q==="string")j=j8.parseSourceMapInput(q);var K=j8.getArg(j,"version"),Y=j8.getArg(j,"sections");if(K!=this._version)throw new Error("Unsupported version: "+K);this._sources=new PK,this._names=new PK;var f={line:-1,column:0};this._sections=Y.map(function(P){if(P.url)throw new Error("Support for url field in sections not implemented.");var $=j8.getArg(P,"offset"),w=j8.getArg($,"line"),O=j8.getArg($,"column");if(w{var ik=j2().SourceMapGenerator,P7=jK(),ok=/(\r?\n)/,ak=10,YK="$$$isSourceNode$$$";function p6(q,_,j,K,Y){if(this.children=[],this.sourceContents={},this.line=q==null?null:q,this.column=_==null?null:_,this.source=j==null?null:j,this.name=Y==null?null:Y,this[YK]=!0,K!=null)this.add(K)}p6.fromStringWithSourceMap=function q(_,j,K){var Y=new p6,f=_.split(ok),P=0,$=function(){var W=T(),J=T()||"";return W+J;function T(){return P=0;j--)this.prepend(_[j]);else if(_[YK]||typeof _==="string")this.children.unshift(_);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+_);return this};p6.prototype.walk=function q(_){var j;for(var K=0,Y=this.children.length;K0){j=[];for(K=0;K{ek.SourceMapGenerator=j2().SourceMapGenerator;ek.SourceMapConsumer=qP().SourceMapConsumer;ek.SourceNode=_P().SourceNode});var fP=_8((PP,YP)=>{PP.__esModule=!0;var z2=C6(),Z_=void 0;try{if(typeof define!=="function"||!define.amd)v2=KP(),Z_=v2.SourceNode}catch(q){}var v2;if(!Z_)Z_=function(q,_,j,K){if(this.src="",K)this.add(K)},Z_.prototype={add:function q(_){if(z2.isArray(_))_=_.join("");this.src+=_},prepend:function q(_){if(z2.isArray(_))_=_.join("");this.src=_+this.src},toStringWithSourceMap:function q(){return{code:this.toString()}},toString:function q(){return this.src}};function O2(q,_,j){if(z2.isArray(q)){var K=[];for(var Y=0,f=q.length;Y{zP.__esModule=!0;function OP(q){return q&&q.__esModule?q:{default:q}}var $P=F3(),_X=F6(),W2=OP(_X),KX=C6(),jX=fP(),wP=OP(jX);function fK(q){this.value=q}function $K(){}$K.prototype={nameLookup:function q(_,j){return this.internalNameLookup(_,j)},depthedLookup:function q(_){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(_),")"]},compilerInfo:function q(){var _=$P.COMPILER_REVISION,j=$P.REVISION_CHANGES[_];return[_,j]},appendToBuffer:function q(_,j,K){if(!KX.isArray(_))_=[_];if(_=this.source.wrap(_,j),this.environment.isSimple)return["return ",_,";"];else if(K)return["buffer += ",_,";"];else return _.appendToBuffer=!0,_},initializeBuffer:function q(){return this.quotedString("")},internalNameLookup:function q(_,j){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",_,",",JSON.stringify(j),")"]},lookupPropertyFunctionIsUsed:!1,compile:function q(_,j,K,Y){this.environment=_,this.options=j,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!Y,this.name=this.environment.name,this.isChild=!!K,this.context=K||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(_,j),this.useDepths=this.useDepths||_.useDepths||_.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||_.useBlockParams;var f=_.opcodes,P=void 0,$=void 0,w=void 0,O=void 0;for(w=0,O=f.length;w0)K+=", "+Y.join(", ");var f=0;if(Object.keys(this.aliases).forEach(function(w){var O=j.aliases[w];if(O.children&&O.referenceCount>1)K+=", alias"+ ++f+"="+w,O.children[0]="alias"+f}),this.lookupPropertyFunctionIsUsed)K+=", "+this.lookupPropertyFunctionVarDeclaration();var P=["container","depth0","helpers","partials","data"];if(this.useBlockParams||this.useDepths)P.push("blockParams");if(this.useDepths)P.push("depths");var $=this.mergeSource(K);if(_)return P.push($),Function.apply(this,P);else return this.source.wrap(["function(",P.join(","),`) { @@ -58,8 +58,8 @@ Expecting `+p.join(", ")+", got '"+(this.terminals_[M]||M)+"'";else c="Parse err } return undefined } - `.trim()},blockValue:function q(_){var j=this.aliasable("container.hooks.blockHelperMissing"),K=[this.contextName(0)];this.setupHelperArgs(_,0,K);var Y=this.popStack();K.splice(1,0,Y),this.push(this.source.functionCall(j,"call",K))},ambiguousBlockValue:function q(){var _=this.aliasable("container.hooks.blockHelperMissing"),j=[this.contextName(0)];this.setupHelperArgs("",0,j,!0),this.flushInline();var K=this.topStack();j.splice(1,0,K),this.pushSource(["if (!",this.lastHelper,") { ",K," = ",this.source.functionCall(_,"call",j),"}"])},appendContent:function q(_){if(this.pendingContent)_=this.pendingContent+_;else this.pendingLocation=this.source.currentLocation;this.pendingContent=_},append:function q(){if(this.isInline())this.replaceStack(function(j){return[" != null ? ",j,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var _=this.popStack();if(this.pushSource(["if (",_," != null) { ",this.appendToBuffer(_,void 0,!0)," }"]),this.environment.isSimple)this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function q(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function q(_){this.lastContext=_},pushContext:function q(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function q(_,j,K,Y){var f=0;if(!Y&&this.options.compat&&!this.lastContext)this.push(this.depthedLookup(_[f++]));else this.pushContext();this.resolvePath("context",_,f,j,K)},lookupBlockParam:function q(_,j){this.useBlockParams=!0,this.push(["blockParams[",_[0],"][",_[1],"]"]),this.resolvePath("context",j,1)},lookupData:function q(_,j,K){if(!_)this.pushStackLiteral("data");else this.pushStackLiteral("container.data(data, "+_+")");this.resolvePath("data",j,0,!0,K)},resolvePath:function q(_,j,K,Y,f){var P=this;if(this.options.strict||this.options.assumeObjects){this.push(jX(this.options.strict&&f,this,j,K,_));return}var $=j.length;for(;K<$;K++)this.replaceStack(function(w){var O=P.nameLookup(w,j[K],_);if(!Y)return[" != null ? ",O," : ",w];else return[" && ",O]})},resolvePossibleLambda:function q(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function q(_,j){if(this.pushContext(),this.pushString(j),j!=="SubExpression")if(typeof _==="string")this.pushString(_);else this.pushStackLiteral(_)},emptyHash:function q(_){if(this.trackIds)this.push("{}");if(this.stringParams)this.push("{}"),this.push("{}");this.pushStackLiteral(_?"undefined":"{}")},pushHash:function q(){if(this.hash)this.hashes.push(this.hash);this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function q(){var _=this.hash;if(this.hash=this.hashes.pop(),this.trackIds)this.push(this.objectLiteral(_.ids));if(this.stringParams)this.push(this.objectLiteral(_.contexts)),this.push(this.objectLiteral(_.types));this.push(this.objectLiteral(_.values))},pushString:function q(_){this.pushStackLiteral(this.quotedString(_))},pushLiteral:function q(_){this.pushStackLiteral(_)},pushProgram:function q(_){if(_!=null)this.pushStackLiteral(this.programExpression(_));else this.pushStackLiteral(null)},registerDecorator:function q(_,j){var K=this.nameLookup("decorators",j,"decorator"),Y=this.setupHelperArgs(j,_);this.decorators.push(["fn = ",this.decorators.functionCall(K,"",["fn","props","container",Y])," || fn;"])},invokeHelper:function q(_,j,K){var Y=this.popStack(),f=this.setupHelper(_,j),P=[];if(K)P.push(f.name);if(P.push(Y),!this.options.strict)P.push(this.aliasable("container.hooks.helperMissing"));var $=["(",this.itemsSeparatedBy(P,"||"),")"],w=this.source.functionCall($,"call",f.callParams);this.push(w)},itemsSeparatedBy:function q(_,j){var K=[];K.push(_[0]);for(var Y=1;Y<_.length;Y++)K.push(j,_[Y]);return K},invokeKnownHelper:function q(_,j){var K=this.setupHelper(_,j);this.push(this.source.functionCall(K.name,"call",K.callParams))},invokeAmbiguous:function q(_,j){this.useRegister("helper");var K=this.popStack();this.emptyHash();var Y=this.setupHelper(0,_,j),f=this.lastHelper=this.nameLookup("helpers",_,"helper"),P=["(","(helper = ",f," || ",K,")"];if(!this.options.strict)P[0]="(helper = ",P.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"));this.push(["(",P,Y.paramsInit?["),(",Y.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",Y.callParams)," : helper))"])},invokePartial:function q(_,j,K){var Y=[],f=this.setupParams(j,1,Y);if(_)j=this.popStack(),delete f.name;if(K)f.indent=JSON.stringify(K);if(f.helpers="helpers",f.partials="partials",f.decorators="container.decorators",!_)Y.unshift(this.nameLookup("partials",j,"partial"));else Y.unshift(j);if(this.options.compat)f.depths="depths";f=this.objectLiteral(f),Y.push(f),this.push(this.source.functionCall("container.invokePartial","",Y))},assignToHash:function q(_){var j=this.popStack(),K=void 0,Y=void 0,f=void 0;if(this.trackIds)f=this.popStack();if(this.stringParams)Y=this.popStack(),K=this.popStack();var P=this.hash;if(K)P.contexts[_]=K;if(Y)P.types[_]=Y;if(f)P.ids[_]=f;P.values[_]=j},pushId:function q(_,j,K){if(_==="BlockParam")this.pushStackLiteral("blockParams["+j[0]+"].path["+j[1]+"]"+(K?" + "+JSON.stringify("."+K):""));else if(_==="PathExpression")this.pushString(j);else if(_==="SubExpression")this.pushStackLiteral("true");else this.pushStackLiteral("null")},compiler:$K,compileChildren:function q(_,j){var K=_.children,Y=void 0,f=void 0;for(var P=0,$=K.length;P<$;P++){Y=K[P],f=new this.compiler;var w=this.matchExistingProgram(Y);if(w==null){this.context.programs.push("");var O=this.context.programs.length;Y.index=O,Y.name="program"+O,this.context.programs[O]=f.compile(Y,j,this.context,!this.precompile),this.context.decorators[O]=f.decorators,this.context.environments[O]=Y,this.useDepths=this.useDepths||f.useDepths,this.useBlockParams=this.useBlockParams||f.useBlockParams,Y.useDepths=this.useDepths,Y.useBlockParams=this.useBlockParams}else Y.index=w.index,Y.name="program"+w.index,this.useDepths=this.useDepths||w.useDepths,this.useBlockParams=this.useBlockParams||w.useBlockParams}},matchExistingProgram:function q(_){for(var j=0,K=this.context.environments.length;jthis.stackVars.length)this.stackVars.push("stack"+this.stackSlot);return this.topStackName()},topStackName:function q(){return"stack"+this.stackSlot},flushInline:function q(){var _=this.inlineStack;this.inlineStack=[];for(var j=0,K=_.length;j{JP.__esModule=!0;function sK(q){return q&&q.__esModule?q:{default:q}}var fX=Tj(),$X=sK(fX),wX=r4(),OX=sK(wX),H2=mj(),J2=dj(),zX=WP(),vX=sK(zX),WX=q7(),HX=sK(WX),JX=l4(),TX=sK(JX),ZX=$X.default.create;function HP(){var q=ZX();return q.compile=function(_,j){return J2.compile(_,j,q)},q.precompile=function(_,j){return J2.precompile(_,j,q)},q.AST=OX.default,q.Compiler=J2.Compiler,q.JavaScriptCompiler=vX.default,q.Parser=H2.parser,q.parse=H2.parse,q.parseWithoutProcessing=H2.parseWithoutProcessing,q}var wK=HP();wK.create=HP;TX.default(wK);wK.Visitor=HX.default;wK.default=wK;JP.default=wK;TP.exports=JP.default});var kP=_8((DX)=>{DX.__esModule=!0;DX.print=hX;DX.PrintVisitor=B8;function AX(q){return q&&q.__esModule?q:{default:q}}var GX=q7(),uX=AX(GX);function hX(q){return new B8().accept(q)}function B8(){this.padding=0}B8.prototype=new uX.default;B8.prototype.pad=function(q){var _="";for(var j=0,K=this.padding;j "+_+" }}")};B8.prototype.PartialBlockStatement=function(q){var _="PARTIAL BLOCK:"+q.name.original;if(q.params[0])_+=" "+this.accept(q.params[0]);if(q.hash)_+=" "+this.accept(q.hash);return _+=" "+this.pad("PROGRAM:"),this.padding++,_+=this.accept(q.program),this.padding--,this.pad("{{> "+_+" }}")};B8.prototype.ContentStatement=function(q){return this.pad("CONTENT[ '"+q.value+"' ]")};B8.prototype.CommentStatement=function(q){return this.pad("{{! '"+q.value+"' }}")};B8.prototype.SubExpression=function(q){var _=q.params,j=[],K=void 0;for(var Y=0,f=_.length;Ythis.stackVars.length)this.stackVars.push("stack"+this.stackSlot);return this.topStackName()},topStackName:function q(){return"stack"+this.stackSlot},flushInline:function q(){var _=this.inlineStack;this.inlineStack=[];for(var j=0,K=_.length;j{JP.__esModule=!0;function sK(q){return q&&q.__esModule?q:{default:q}}var $X=Tj(),wX=sK($X),OX=r4(),zX=sK(OX),H2=mj(),J2=dj(),vX=WP(),WX=sK(vX),HX=q7(),JX=sK(HX),TX=l4(),ZX=sK(TX),kX=wX.default.create;function HP(){var q=kX();return q.compile=function(_,j){return J2.compile(_,j,q)},q.precompile=function(_,j){return J2.precompile(_,j,q)},q.AST=zX.default,q.Compiler=J2.Compiler,q.JavaScriptCompiler=WX.default,q.Parser=H2.parser,q.parse=H2.parse,q.parseWithoutProcessing=H2.parseWithoutProcessing,q}var wK=HP();wK.create=HP;ZX.default(wK);wK.Visitor=JX.default;wK.default=wK;JP.default=wK;TP.exports=JP.default});var kP=_8((CX)=>{CX.__esModule=!0;CX.print=DX;CX.PrintVisitor=B8;function GX(q){return q&&q.__esModule?q:{default:q}}var uX=q7(),hX=GX(uX);function DX(q){return new B8().accept(q)}function B8(){this.padding=0}B8.prototype=new hX.default;B8.prototype.pad=function(q){var _="";for(var j=0,K=this.padding;j "+_+" }}")};B8.prototype.PartialBlockStatement=function(q){var _="PARTIAL BLOCK:"+q.name.original;if(q.params[0])_+=" "+this.accept(q.params[0]);if(q.hash)_+=" "+this.accept(q.hash);return _+=" "+this.pad("PROGRAM:"),this.padding++,_+=this.accept(q.program),this.padding--,this.pad("{{> "+_+" }}")};B8.prototype.ContentStatement=function(q){return this.pad("CONTENT[ '"+q.value+"' ]")};B8.prototype.CommentStatement=function(q){return this.pad("{{! '"+q.value+"' }}")};B8.prototype.SubExpression=function(q){var _=q.params,j=[],K=void 0;for(var Y=0,f=_.length;Y tags - Do not include any explanatory text before or after the JSON`;return Y+` -`+q+f}var hP,NX=`You are analyzing a Claude Code conversation transcript to create memories using the Chroma MCP memory system. +`+q+f}var hP,bX=`You are analyzing a Claude Code conversation transcript to create memories using the Chroma MCP memory system. YOUR TASK: 1. Extract key learnings and accomplishments as natural language memories @@ -120,7 +120,7 @@ If any tool calls fail, continue and return the JSON response anyway. Project: {{projectPrefix}} Session ID: {{sessionId}} -Conversation to compress:`,bX;var CP=f6(()=>{hP=Pq(uP(),1),bX=hP.default.compile(NX,{noEscape:!0})});class T2{projectName;constructor(q="claude-mem"){this.projectName=q}createAnalysisPrompt(q){let _=new Date().toISOString();return{prompt:this.buildAnalysisPrompt(q),context:q,type:"analysis",timestamp:_}}createSessionStartPrompt(q){let _=new Date().toISOString();return{message:this.buildSessionStartMessage(q),context:q,type:"session",timestamp:_}}createHookResponse(q){let _=new Date().toISOString();return{...this.buildHookResponse(q),context:q,type:"hook",timestamp:_}}buildAnalysisPrompt(q){let{transcriptContent:_,sessionId:j,projectName:K=this.projectName}=q,Y=K.replace(/[-\s]/g,"_").toLowerCase();return DP(_,j,Y)}buildSessionStartMessage(q){let{sessionId:_,source:j,projectName:K=this.projectName,additionalContext:Y,transcriptPath:f,cwd:P}=q,$=`## Session Started (${j}) +Conversation to compress:`,SX;var CP=f6(()=>{hP=Pq(uP(),1),SX=hP.default.compile(bX,{noEscape:!0})});class T2{projectName;constructor(q="claude-mem"){this.projectName=q}createAnalysisPrompt(q){let _=new Date().toISOString();return{prompt:this.buildAnalysisPrompt(q),context:q,type:"analysis",timestamp:_}}createSessionStartPrompt(q){let _=new Date().toISOString();return{message:this.buildSessionStartMessage(q),context:q,type:"session",timestamp:_}}createHookResponse(q){let _=new Date().toISOString();return{...this.buildHookResponse(q),context:q,type:"hook",timestamp:_}}buildAnalysisPrompt(q){let{transcriptContent:_,sessionId:j,projectName:K=this.projectName}=q;return DP(_,j,K)}buildSessionStartMessage(q){let{sessionId:_,source:j,projectName:K=this.projectName,additionalContext:Y,transcriptPath:f,cwd:P}=q,$=`## Session Started (${j}) **Project**: ${K} **Session ID**: ${_} `;if(f)$+=`**Transcript**: ${f} `;if(P)$+=`**Working Directory**: ${P} `;if(Y)$+=` @@ -128,12 +128,12 @@ Conversation to compress:`,bX;var CP=f6(()=>{hP=Pq(uP(),1),bX=hP.default.compile ${Y}`;return $+=` Memory system is active and ready to preserve context across sessions.`,$}buildHookResponse(q){let{hookEventName:_,success:j,message:K,data:Y,shouldContinue:f=j,stopReason:P}=q,$={continue:f,suppressOutput:!1};if(!f&&P)$.stopReason=P;if(_==="SessionStart")$.hookSpecificOutput={hookEventName:"SessionStart",additionalContext:K,...Y};else if(Y)$.hookSpecificOutput=Y;return $}validateAnalysisContext(q){return!!(q.transcriptContent&&q.sessionId)}validateSessionContext(q){return!!(q.sessionId&&q.source)}validateHookContext(q){return!!(q.hookEventName&&q.sessionId&&typeof q.success==="boolean")}getProjectName(){return this.projectName}setProjectName(q){this.projectName=q}}function VP(q,_,j={}){return{transcriptContent:q,sessionId:_,...j}}var MP=f6(()=>{CP()});var k_;var NP=f6(()=>{k_={COMPRESSION_STARTED:"\uD83D\uDE80 COMPRESSION STARTED",TRANSCRIPT_PATH:(q)=>`\uD83D\uDCC1 Transcript Path: ${q}`,SESSION_ID:(q)=>`\uD83D\uDD0D Session ID: ${q}`,PROJECT_NAME:(q)=>`\uD83D\uDCDD PROJECT NAME: ${q}`,CLAUDE_SDK_CALL:"\uD83E\uDD16 Calling Claude SDK to analyze and populate memory database...",TRANSCRIPT_STATS:(q,_)=>`\uD83D\uDCCA Transcript size: ${q} characters, ${_} messages`,COMPRESSION_COMPLETE:(q)=>`✅ COMPRESSION COMPLETE - Total summaries extracted: ${q}`,CLAUDE_PATH_FOUND:(q)=>`\uD83C\uDFAF Found Claude Code at: ${q}`,MCP_CONFIG_USED:(q)=>`\uD83D\uDCCB Using MCP config: ${q}`}});class bP{level=OK.INFO;setLevel(q){this.level=OK[q]}debug(q,..._){if(this.level<=OK.DEBUG)console.debug(`[DEBUG] ${q}`,..._)}info(q,..._){if(this.level<=OK.INFO)console.info(`[INFO] ${q}`,..._)}warn(q,..._){if(this.level<=OK.WARN)console.warn(`[WARN] ${q}`,..._)}error(q,_,j){if(this.level<=OK.ERROR){if(console.error(`[ERROR] ${q}`),_)console.error(_);if(j)console.error("Context:",j)}}}var OK,t8;var SP=f6(()=>{OK={DEBUG:0,INFO:1,WARN:2,ERROR:3};t8=new bP});import{readFileSync as EX,existsSync as RX}from"fs";import{join as mX}from"path";function zq(){return EP.getClaudePath()}var EP;var f7=f6(()=>{M4();EP=class EP{static settingsPath;static cachedSettings=null;static{let q=new yq;this.settingsPath=mX(q.getConfigDir(),"settings.json")}static readSettings(){if(this.cachedSettings!==null)return this.cachedSettings;try{if(RX(this.settingsPath)){let _=EX(this.settingsPath,"utf-8"),j=JSON.parse(_);return this.cachedSettings=j,j}}catch{}let q={};return this.cachedSettings=q,q}static getSetting(q,_){return this.readSettings()[q]??_}static getClaudePath(){return this.getSetting("claudePath","claude")}static clearCache(){this.cachedSettings=null}}});class X_{static DEFAULT_MAX_TOKENS=22400;static DEFAULT_MAX_BYTES=78400;static DEFAULT_CONTEXT_OVERLAP=2;static CHARS_PER_TOKEN_ESTIMATE=3.5;options;constructor(q={}){this.options={maxTokensPerChunk:q.maxTokensPerChunk??X_.DEFAULT_MAX_TOKENS,maxBytesPerChunk:q.maxBytesPerChunk??X_.DEFAULT_MAX_BYTES,preserveContext:q.preserveContext??!0,contextOverlap:q.contextOverlap??X_.DEFAULT_CONTEXT_OVERLAP,parallel:q.parallel??!1}}estimateTokenCount(q){return Math.ceil(q.length/X_.CHARS_PER_TOKEN_ESTIMATE)}parseFilteredOutput(q){let _=q.split(` + Total summaries extracted: ${q}`,CLAUDE_PATH_FOUND:(q)=>`\uD83C\uDFAF Found Claude Code at: ${q}`,MCP_CONFIG_USED:(q)=>`\uD83D\uDCCB Using MCP config: ${q}`}});class bP{level=OK.INFO;setLevel(q){this.level=OK[q]}debug(q,..._){if(this.level<=OK.DEBUG)console.debug(`[DEBUG] ${q}`,..._)}info(q,..._){if(this.level<=OK.INFO)console.info(`[INFO] ${q}`,..._)}warn(q,..._){if(this.level<=OK.WARN)console.warn(`[WARN] ${q}`,..._)}error(q,_,j){if(this.level<=OK.ERROR){if(console.error(`[ERROR] ${q}`),_)console.error(_);if(j)console.error("Context:",j)}}}var OK,t8;var SP=f6(()=>{OK={DEBUG:0,INFO:1,WARN:2,ERROR:3};t8=new bP});import{readFileSync as RX,existsSync as mX}from"fs";import{join as IX}from"path";function zq(){return EP.getClaudePath()}var EP;var f7=f6(()=>{M4();EP=class EP{static settingsPath;static cachedSettings=null;static{let q=new yq;this.settingsPath=IX(q.getConfigDir(),"settings.json")}static readSettings(){if(this.cachedSettings!==null)return this.cachedSettings;try{if(mX(this.settingsPath)){let _=RX(this.settingsPath,"utf-8"),j=JSON.parse(_);return this.cachedSettings=j,j}}catch{}let q={};return this.cachedSettings=q,q}static getSetting(q,_){return this.readSettings()[q]??_}static getClaudePath(){return this.getSetting("claudePath","claude")}static clearCache(){this.cachedSettings=null}}});class X_{static DEFAULT_MAX_TOKENS=22400;static DEFAULT_MAX_BYTES=78400;static DEFAULT_CONTEXT_OVERLAP=2;static CHARS_PER_TOKEN_ESTIMATE=3.5;options;constructor(q={}){this.options={maxTokensPerChunk:q.maxTokensPerChunk??X_.DEFAULT_MAX_TOKENS,maxBytesPerChunk:q.maxBytesPerChunk??X_.DEFAULT_MAX_BYTES,preserveContext:q.preserveContext??!0,contextOverlap:q.contextOverlap??X_.DEFAULT_CONTEXT_OVERLAP,parallel:q.parallel??!1}}estimateTokenCount(q){return Math.ceil(q.length/X_.CHARS_PER_TOKEN_ESTIMATE)}parseFilteredOutput(q){let _=q.split(` `).filter((K)=>K.trim()),j=[];for(let K of _)if(K.startsWith("- ")){let Y=K.substring(2);j.push({content:Y,estimatedTokens:this.estimateTokenCount(Y)})}return j}chunkTranscript(q){let _=this.parseFilteredOutput(q),j=[],K=[],Y=0,f=0,P=0;for(let $=0;$<_.length;$++){let w=_[$],O=this.formatMessage(w),v=Buffer.byteLength(O,"utf8"),z=w.estimatedTokens;if(K.length>0&&(Y+z>this.options.maxTokensPerChunk||f+v>this.options.maxBytesPerChunk)){let W=this.formatChunk(K);if(j.push({content:W,metadata:{chunkNumber:j.length+1,totalChunks:0,startIndex:P,endIndex:$-1,messageCount:K.length,estimatedTokens:Y,sizeBytes:f,hasOverlap:!1}}),K=[],Y=0,f=0,P=$,this.options.preserveContext&&j.length>0){let J=Math.max(0,$-this.options.contextOverlap);for(let T=J;T<$;T++){let H=_[T],X=this.formatMessage(H);K.push(H),Y+=H.estimatedTokens,f+=Buffer.byteLength(X,"utf8")}if(K.length>0)P=J}}K.push(w),Y+=z,f+=v}if(K.length>0){let $=this.formatChunk(K);j.push({content:$,metadata:{chunkNumber:j.length+1,totalChunks:0,startIndex:P,endIndex:_.length-1,messageCount:K.length,estimatedTokens:Y,sizeBytes:f,hasOverlap:this.options.preserveContext&&j.length>0}})}return j.forEach(($)=>{$.metadata.totalChunks=j.length}),j}formatMessage(q){return`- ${q.content}`}formatChunk(q){return q.map((_)=>this.formatMessage(_)).join(` `)}createChunkHeader(q){let _=[];if(q.firstTimestamp&&q.lastTimestamp)_.push(`# ${q.firstTimestamp} to ${q.lastTimestamp} (chunk ${q.chunkNumber}/${q.totalChunks})`);else _.push(`# Chunk ${q.chunkNumber} of ${q.totalChunks}`);return _.join(` `)+` `}needsChunking(q){let _=this.estimateTokenCount(q),j=Buffer.byteLength(q,"utf8");return _>this.options.maxTokensPerChunk||j>this.options.maxBytesPerChunk}getChunkingStats(q){let _=q.reduce((Y,f)=>Y+f.metadata.messageCount,0),j=q.reduce((Y,f)=>Y+f.metadata.estimatedTokens,0),K=q.reduce((Y,f)=>Y+f.metadata.sizeBytes,0);return["\uD83D\uDCCA Chunking Statistics:",` • Total chunks: ${q.length}`,` • Total messages: ${_}`,` • Total estimated tokens: ${j.toLocaleString()}`,` • Total size: ${(K/1024).toFixed(1)} KB`,` • Average tokens per chunk: ${Math.round(j/q.length).toLocaleString()}`,` • Average size per chunk: ${(K/q.length/1024).toFixed(1)} KB`].join(` -`)}}var RP={};EK(RP,{TranscriptCompressor:()=>zK});import L6,{createWriteStream as IX}from"fs";import $7,{join as Z2}from"path";class zK{paths;logStream=null;logFile=null;promptOrchestrator;chunkManager;constructor(q={}){this.paths=new yq,this.promptOrchestrator=new T2,this.chunkManager=new X_,this.ensureClaudeMemStructure(),this.initializeLogging(),t8.debug("\uD83E\uDD16 TranscriptCompressor initialized")}ensureClaudeMemStructure(){let q=this.paths.getConfigDir(),_=this.paths.getIndexDir(),j=this.paths.getArchiveDir(),K=this.paths.getLogsDir();yq.ensureDirectories([q,_,j,K])}initializeLogging(){let q=this.paths.getLogsDir(),_=new Date().toISOString().replace(/[:.]/g,"-");this.logFile=Z2(q,`claude-mem-${_}.log`),this.logStream=IX(this.logFile,{flags:"a"}),this.debugLog("\uD83D\uDE80 DEBUG LOG STARTED"),this.debugLog(`\uD83D\uDCC1 Log file: ${this.logFile}`),this.debugLog("═".repeat(60))}debugLog(q){if(!this.logStream)return;let j=`[${new Date().toISOString()}] ${q} +`)}}var RP={};EK(RP,{TranscriptCompressor:()=>zK});import L6,{createWriteStream as gX}from"fs";import $7,{join as Z2}from"path";class zK{paths;logStream=null;logFile=null;promptOrchestrator;chunkManager;constructor(q={}){this.paths=new yq,this.promptOrchestrator=new T2,this.chunkManager=new X_,this.ensureClaudeMemStructure(),this.initializeLogging(),t8.debug("\uD83E\uDD16 TranscriptCompressor initialized")}ensureClaudeMemStructure(){let q=this.paths.getConfigDir(),_=this.paths.getIndexDir(),j=this.paths.getArchiveDir(),K=this.paths.getLogsDir();yq.ensureDirectories([q,_,j,K])}initializeLogging(){let q=this.paths.getLogsDir(),_=new Date().toISOString().replace(/[:.]/g,"-");this.logFile=Z2(q,`claude-mem-${_}.log`),this.logStream=gX(this.logFile,{flags:"a"}),this.debugLog("\uD83D\uDE80 DEBUG LOG STARTED"),this.debugLog(`\uD83D\uDCC1 Log file: ${this.logFile}`),this.debugLog("═".repeat(60))}debugLog(q){if(!this.logStream)return;let j=`[${new Date().toISOString()}] ${q} `;this.logStream.write(j)}closeLogging(){if(this.logStream)this.debugLog("✅ DEBUG LOG ENDED"),this.logStream.end()}async compress(q,_,j){this.debugLog(`\uD83D\uDE80 Starting compression for: ${q}`),this.debugLog(`\uD83D\uDCCB Session ID: ${_||"auto-generated"}`);try{let K=j||yq.getCurrentProjectPrefix();t8.debug(k_.PROJECT_NAME(K)),this.debugLog(`\uD83D\uDCDD PROJECT PREFIX: ${K}`);let Y=L6.readFileSync(q,"utf-8");this.debugLog(`\uD83D\uDCD6 Reading transcript: ${Y.length} bytes`);let f=Y.trim().split(` `).filter((X)=>X.trim()),P=[],$=0;for(let X=0;X0)t8.debug(`Parse errors: ${$}`);this.debugLog(`\uD83D\uDCCA Transcript loaded: ${f.length} lines, ${P.length} messages, ${$} parse errors`);let w=_||$7.basename(q,".jsonl"),O=new Date().toISOString();for(let X=P.length-1;X>=0;X--){let A=P[X];if(A.timestamp)try{let G=A.timestamp,D;if(typeof G==="string"&&G.includes("T"))D=new Date(G);else{let M=Number(G),I=M<10000000000?M*1000:M;D=new Date(I)}if(!isNaN(D.getTime())){O=D.toISOString(),this.debugLog(`\uD83D\uDCC5 Using timestamp from last message: ${O}`);break}}catch(G){this.debugLog(`⚠️ Invalid timestamp in message: ${A.timestamp}, trying earlier message`)}}let v=`${w}.jsonl.archive`,z=this.formatConversationForPrompt(P),W=this.chunkManager.needsChunking(z),J=[],T=null;if(W){let X=await this.compressInChunks(P,w,K);J=X.summaries,T=X.overview}else{let X=VP(z,w,{projectName:K,trigger:"manual"}),A=this.promptOrchestrator.createAnalysisPrompt(X);t8.debug("\uD83D\uDCE4 Analysis prompt created"),t8.debug(`\uD83D\uDCCA Prompt length: ${A.prompt.length} characters`);let G=$7.join(this.paths.getLogsDir(),`claude-prompt-${Date.now()}.txt`);L6.writeFileSync(G,`=== CLAUDE ANALYSIS PROMPT === ${A.prompt} @@ -187,20 +187,20 @@ ${P.slice(-2).join(` `),_){let v={type:"overview",content:_,session_id:K,project:j,timestamp:P};L6.appendFileSync($,JSON.stringify(v)+` `)}if(!q||q.length===0){t8.debug("\uD83D\uDCDD No summaries extracted from JSON response");let v={type:"diagnostic",message:"NO SUMMARIES EXTRACTED - Check logs for valid JSON response",session_id:K,project:j,timestamp:P};L6.appendFileSync($,JSON.stringify(v)+` `),this.debugLog(`⚠️ No summaries for session ${K} - Check if Claude returned valid JSON in tags`)}else q.forEach((v)=>{let z={type:"memory",text:v.text,document_id:v.document_id,keywords:v.keywords,session_id:K,project:j,timestamp:v.timestamp||P,archive:$7.basename(f)};L6.appendFileSync($,JSON.stringify(z)+` -`)}),t8.debug(`\uD83D\uDCDD Appended ${q.length} summaries to index as JSONL`);t8.debug(`Index path: ${$}`)}}var w7=f6(()=>{a3();M4();d6();MP();NP();SP();f7()});import{basename as mP}from"path";async function QK(q,_={}){if(console.log(h5("compressing")),!q){console.log(d_("Compression","No transcript file provided","Please provide a path to a transcript file"));return}try{let j=Date.now(),{TranscriptCompressor:K}=await Promise.resolve().then(() => (w7(),RP)),Y=new K({verbose:_.verbose||!1}),f=_.sessionId||mP(q,".jsonl"),P=await Y.compress(q,f),$=Date.now()-j;console.log(p3("Compression",void 0,`Session archived as ${mP(P)}`)),console.log(C5("compress",{count:1,duration:$,details:`Session: ${f}`}))}catch(j){let K=j instanceof Error?j.message:String(j);throw console.log(d_("Compression",K,"Check that the transcript file exists and you have write permissions")),j}}var k2=f6(()=>{O4()});var A2=_8((SV,IP)=>{var X2={to(q,_){if(!_)return`\x1B[${q+1}G`;return`\x1B[${_+1};${q+1}H`},move(q,_){let j="";if(q<0)j+=`\x1B[${-q}D`;else if(q>0)j+=`\x1B[${q}C`;if(_<0)j+=`\x1B[${-_}A`;else if(_>0)j+=`\x1B[${_}B`;return j},up:(q=1)=>`\x1B[${q}A`,down:(q=1)=>`\x1B[${q}B`,forward:(q=1)=>`\x1B[${q}C`,backward:(q=1)=>`\x1B[${q}D`,nextLine:(q=1)=>"\x1B[E".repeat(q),prevLine:(q=1)=>"\x1B[F".repeat(q),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},gX={up:(q=1)=>"\x1B[S".repeat(q),down:(q=1)=>"\x1B[T".repeat(q)},yX={screen:"\x1B[2J",up:(q=1)=>"\x1B[1J".repeat(q),down:(q=1)=>"\x1B[J".repeat(q),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(q){let _="";for(let j=0;j{var z7=process||{},gP=z7.argv||[],O7=z7.env||{},dX=!(!!O7.NO_COLOR||gP.includes("--no-color"))&&(!!O7.FORCE_COLOR||gP.includes("--color")||z7.platform==="win32"||(z7.stdout||{}).isTTY&&O7.TERM!=="dumb"||!!O7.CI),pX=(q,_,j=q)=>(K)=>{let Y=""+K,f=Y.indexOf(_,q.length);return~f?q+LX(Y,_,j,f)+_:q+Y+_},LX=(q,_,j,K)=>{let Y="",f=0;do Y+=q.substring(f,K)+j,f=K+_.length,K=q.indexOf(_,f);while(~K);return Y+q.substring(f)},yP=(q=dX)=>{let _=q?pX:()=>String;return{isColorSupported:q,reset:_("\x1B[0m","\x1B[0m"),bold:_("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:_("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:_("\x1B[3m","\x1B[23m"),underline:_("\x1B[4m","\x1B[24m"),inverse:_("\x1B[7m","\x1B[27m"),hidden:_("\x1B[8m","\x1B[28m"),strikethrough:_("\x1B[9m","\x1B[29m"),black:_("\x1B[30m","\x1B[39m"),red:_("\x1B[31m","\x1B[39m"),green:_("\x1B[32m","\x1B[39m"),yellow:_("\x1B[33m","\x1B[39m"),blue:_("\x1B[34m","\x1B[39m"),magenta:_("\x1B[35m","\x1B[39m"),cyan:_("\x1B[36m","\x1B[39m"),white:_("\x1B[37m","\x1B[39m"),gray:_("\x1B[90m","\x1B[39m"),bgBlack:_("\x1B[40m","\x1B[49m"),bgRed:_("\x1B[41m","\x1B[49m"),bgGreen:_("\x1B[42m","\x1B[49m"),bgYellow:_("\x1B[43m","\x1B[49m"),bgBlue:_("\x1B[44m","\x1B[49m"),bgMagenta:_("\x1B[45m","\x1B[49m"),bgCyan:_("\x1B[46m","\x1B[49m"),bgWhite:_("\x1B[47m","\x1B[49m"),blackBright:_("\x1B[90m","\x1B[39m"),redBright:_("\x1B[91m","\x1B[39m"),greenBright:_("\x1B[92m","\x1B[39m"),yellowBright:_("\x1B[93m","\x1B[39m"),blueBright:_("\x1B[94m","\x1B[39m"),magentaBright:_("\x1B[95m","\x1B[39m"),cyanBright:_("\x1B[96m","\x1B[39m"),whiteBright:_("\x1B[97m","\x1B[39m"),bgBlackBright:_("\x1B[100m","\x1B[49m"),bgRedBright:_("\x1B[101m","\x1B[49m"),bgGreenBright:_("\x1B[102m","\x1B[49m"),bgYellowBright:_("\x1B[103m","\x1B[49m"),bgBlueBright:_("\x1B[104m","\x1B[49m"),bgMagentaBright:_("\x1B[105m","\x1B[49m"),bgCyanBright:_("\x1B[106m","\x1B[49m"),bgWhiteBright:_("\x1B[107m","\x1B[49m")}};G2.exports=yP();G2.exports.createColors=yP});import{stdin as oP,stdout as aP}from"node:process";import*as Uq from"node:readline";import dP from"node:readline";import{Writable as lX}from"node:stream";function xX({onlyFirst:q=!1}={}){let _=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(_,q?void 0:"g")}function tP(q){if(typeof q!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(nX,"")}function eP(q){return q&&q.__esModule&&Object.prototype.hasOwnProperty.call(q,"default")?q.default:q}function q3(q,_={}){if(typeof q!="string"||q.length===0||(_={ambiguousIsNarrow:!0,..._},q=tP(q),q.length===0))return 0;q=q.replace(oX()," ");let j=_.ambiguousIsNarrow?1:2,K=0;for(let Y of q){let f=Y.codePointAt(0);if(f<=31||f>=127&&f<=159||f>=768&&f<=879)continue;switch(rX.eastAsianWidth(Y)){case"F":case"W":K+=2;break;case"A":K+=j;break;default:K+=1}}return K}function tX(){let q=new Map;for(let[_,j]of Object.entries(p8)){for(let[K,Y]of Object.entries(j))p8[K]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},j[K]=p8[K],q.set(Y[0],Y[1]);Object.defineProperty(p8,_,{value:j,enumerable:!1})}return Object.defineProperty(p8,"codes",{value:q,enumerable:!1}),p8.color.close="\x1B[39m",p8.bgColor.close="\x1B[49m",p8.color.ansi=pP(),p8.color.ansi256=LP(),p8.color.ansi16m=lP(),p8.bgColor.ansi=pP(h2),p8.bgColor.ansi256=LP(h2),p8.bgColor.ansi16m=lP(h2),Object.defineProperties(p8,{rgbToAnsi256:{value:(_,j,K)=>_===j&&j===K?_<8?16:_>248?231:Math.round((_-8)/247*24)+232:16+36*Math.round(_/255*5)+6*Math.round(j/255*5)+Math.round(K/255*5),enumerable:!1},hexToRgb:{value:(_)=>{let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;K.length===3&&(K=[...K].map((f)=>f+f).join(""));let Y=Number.parseInt(K,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(_)=>p8.rgbToAnsi256(...p8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value:(_)=>{if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,Y;if(_>=232)j=((_-232)*10+8)/255,K=j,Y=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,Y=$%6/5}let f=Math.max(j,K,Y)*2;if(f===0)return 30;let P=30+(Math.round(Y)<<2|Math.round(K)<<1|Math.round(j));return f===2&&(P+=60),P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>p8.ansi256ToAnsi(p8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>p8.ansi256ToAnsi(p8.hexToAnsi256(_)),enumerable:!1}}),p8}function cP(q,_,j){return String(q).normalize().replace(/\r\n/g,` +`)}),t8.debug(`\uD83D\uDCDD Appended ${q.length} summaries to index as JSONL`);t8.debug(`Index path: ${$}`)}}var w7=f6(()=>{a3();M4();d6();MP();NP();SP();f7()});import{basename as mP}from"path";async function QK(q,_={}){if(console.log(h5("compressing")),!q){console.log(d_("Compression","No transcript file provided","Please provide a path to a transcript file"));return}try{let j=Date.now(),{TranscriptCompressor:K}=await Promise.resolve().then(() => (w7(),RP)),Y=new K({verbose:_.verbose||!1}),f=_.sessionId||mP(q,".jsonl"),P=await Y.compress(q,f),$=Date.now()-j;console.log(p3("Compression",void 0,`Session archived as ${mP(P)}`)),console.log(C5("compress",{count:1,duration:$,details:`Session: ${f}`}))}catch(j){let K=j instanceof Error?j.message:String(j);throw console.log(d_("Compression",K,"Check that the transcript file exists and you have write permissions")),j}}var k2=f6(()=>{O4()});var A2=_8((EV,IP)=>{var X2={to(q,_){if(!_)return`\x1B[${q+1}G`;return`\x1B[${_+1};${q+1}H`},move(q,_){let j="";if(q<0)j+=`\x1B[${-q}D`;else if(q>0)j+=`\x1B[${q}C`;if(_<0)j+=`\x1B[${-_}A`;else if(_>0)j+=`\x1B[${_}B`;return j},up:(q=1)=>`\x1B[${q}A`,down:(q=1)=>`\x1B[${q}B`,forward:(q=1)=>`\x1B[${q}C`,backward:(q=1)=>`\x1B[${q}D`,nextLine:(q=1)=>"\x1B[E".repeat(q),prevLine:(q=1)=>"\x1B[F".repeat(q),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},yX={up:(q=1)=>"\x1B[S".repeat(q),down:(q=1)=>"\x1B[T".repeat(q)},dX={screen:"\x1B[2J",up:(q=1)=>"\x1B[1J".repeat(q),down:(q=1)=>"\x1B[J".repeat(q),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(q){let _="";for(let j=0;j{var z7=process||{},gP=z7.argv||[],O7=z7.env||{},pX=!(!!O7.NO_COLOR||gP.includes("--no-color"))&&(!!O7.FORCE_COLOR||gP.includes("--color")||z7.platform==="win32"||(z7.stdout||{}).isTTY&&O7.TERM!=="dumb"||!!O7.CI),LX=(q,_,j=q)=>(K)=>{let Y=""+K,f=Y.indexOf(_,q.length);return~f?q+lX(Y,_,j,f)+_:q+Y+_},lX=(q,_,j,K)=>{let Y="",f=0;do Y+=q.substring(f,K)+j,f=K+_.length,K=q.indexOf(_,f);while(~K);return Y+q.substring(f)},yP=(q=pX)=>{let _=q?LX:()=>String;return{isColorSupported:q,reset:_("\x1B[0m","\x1B[0m"),bold:_("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:_("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:_("\x1B[3m","\x1B[23m"),underline:_("\x1B[4m","\x1B[24m"),inverse:_("\x1B[7m","\x1B[27m"),hidden:_("\x1B[8m","\x1B[28m"),strikethrough:_("\x1B[9m","\x1B[29m"),black:_("\x1B[30m","\x1B[39m"),red:_("\x1B[31m","\x1B[39m"),green:_("\x1B[32m","\x1B[39m"),yellow:_("\x1B[33m","\x1B[39m"),blue:_("\x1B[34m","\x1B[39m"),magenta:_("\x1B[35m","\x1B[39m"),cyan:_("\x1B[36m","\x1B[39m"),white:_("\x1B[37m","\x1B[39m"),gray:_("\x1B[90m","\x1B[39m"),bgBlack:_("\x1B[40m","\x1B[49m"),bgRed:_("\x1B[41m","\x1B[49m"),bgGreen:_("\x1B[42m","\x1B[49m"),bgYellow:_("\x1B[43m","\x1B[49m"),bgBlue:_("\x1B[44m","\x1B[49m"),bgMagenta:_("\x1B[45m","\x1B[49m"),bgCyan:_("\x1B[46m","\x1B[49m"),bgWhite:_("\x1B[47m","\x1B[49m"),blackBright:_("\x1B[90m","\x1B[39m"),redBright:_("\x1B[91m","\x1B[39m"),greenBright:_("\x1B[92m","\x1B[39m"),yellowBright:_("\x1B[93m","\x1B[39m"),blueBright:_("\x1B[94m","\x1B[39m"),magentaBright:_("\x1B[95m","\x1B[39m"),cyanBright:_("\x1B[96m","\x1B[39m"),whiteBright:_("\x1B[97m","\x1B[39m"),bgBlackBright:_("\x1B[100m","\x1B[49m"),bgRedBright:_("\x1B[101m","\x1B[49m"),bgGreenBright:_("\x1B[102m","\x1B[49m"),bgYellowBright:_("\x1B[103m","\x1B[49m"),bgBlueBright:_("\x1B[104m","\x1B[49m"),bgMagentaBright:_("\x1B[105m","\x1B[49m"),bgCyanBright:_("\x1B[106m","\x1B[49m"),bgWhiteBright:_("\x1B[107m","\x1B[49m")}};G2.exports=yP();G2.exports.createColors=yP});import{stdin as oP,stdout as aP}from"node:process";import*as Uq from"node:readline";import dP from"node:readline";import{Writable as xX}from"node:stream";function nX({onlyFirst:q=!1}={}){let _=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(_,q?void 0:"g")}function tP(q){if(typeof q!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(cX,"")}function eP(q){return q&&q.__esModule&&Object.prototype.hasOwnProperty.call(q,"default")?q.default:q}function q3(q,_={}){if(typeof q!="string"||q.length===0||(_={ambiguousIsNarrow:!0,..._},q=tP(q),q.length===0))return 0;q=q.replace(aX()," ");let j=_.ambiguousIsNarrow?1:2,K=0;for(let Y of q){let f=Y.codePointAt(0);if(f<=31||f>=127&&f<=159||f>=768&&f<=879)continue;switch(iX.eastAsianWidth(Y)){case"F":case"W":K+=2;break;case"A":K+=j;break;default:K+=1}}return K}function eX(){let q=new Map;for(let[_,j]of Object.entries(p8)){for(let[K,Y]of Object.entries(j))p8[K]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},j[K]=p8[K],q.set(Y[0],Y[1]);Object.defineProperty(p8,_,{value:j,enumerable:!1})}return Object.defineProperty(p8,"codes",{value:q,enumerable:!1}),p8.color.close="\x1B[39m",p8.bgColor.close="\x1B[49m",p8.color.ansi=pP(),p8.color.ansi256=LP(),p8.color.ansi16m=lP(),p8.bgColor.ansi=pP(h2),p8.bgColor.ansi256=LP(h2),p8.bgColor.ansi16m=lP(h2),Object.defineProperties(p8,{rgbToAnsi256:{value:(_,j,K)=>_===j&&j===K?_<8?16:_>248?231:Math.round((_-8)/247*24)+232:16+36*Math.round(_/255*5)+6*Math.round(j/255*5)+Math.round(K/255*5),enumerable:!1},hexToRgb:{value:(_)=>{let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;K.length===3&&(K=[...K].map((f)=>f+f).join(""));let Y=Number.parseInt(K,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(_)=>p8.rgbToAnsi256(...p8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value:(_)=>{if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,Y;if(_>=232)j=((_-232)*10+8)/255,K=j,Y=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,Y=$%6/5}let f=Math.max(j,K,Y)*2;if(f===0)return 30;let P=30+(Math.round(Y)<<2|Math.round(K)<<1|Math.round(j));return f===2&&(P+=60),P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>p8.ansi256ToAnsi(p8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>p8.ansi256ToAnsi(p8.hexToAnsi256(_)),enumerable:!1}}),p8}function cP(q,_,j){return String(q).normalize().replace(/\r\n/g,` `).split(` -`).map((K)=>qA(K,_,j)).join(` -`)}function N2(q,_){if(typeof q=="string")return W7.aliases.get(q)===_;for(let j of q)if(j!==void 0&&N2(j,_))return!0;return!1}function KA(q,_){if(q===_)return;let j=q.split(` +`).map((K)=>_A(K,_,j)).join(` +`)}function N2(q,_){if(typeof q=="string")return W7.aliases.get(q)===_;for(let j of q)if(j!==void 0&&N2(j,_))return!0;return!1}function jA(q,_){if(q===_)return;let j=q.split(` `),K=_.split(` -`),Y=[];for(let f=0;f{let O=String(P);if(N2([O,$,w],"cancel")){K&&_.write(X6.cursor.show),process.exit(0);return}if(!j)return;Uq.moveCursor(_,$==="return"?0:-1,$==="return"?-1:0,()=>{Uq.clearLine(_,1,()=>{q.once("keypress",f)})})};return K&&_.write(X6.cursor.hide),q.once("keypress",f),()=>{q.off("keypress",f),K&&_.write(X6.cursor.show),q.isTTY&&!jA&&q.setRawMode(!1),Y.terminal=!1,Y.close()}}class _3{constructor(q,_=!0){l6(this,"input"),l6(this,"output"),l6(this,"_abortSignal"),l6(this,"rl"),l6(this,"opts"),l6(this,"_render"),l6(this,"_track",!1),l6(this,"_prevFrame",""),l6(this,"_subscribers",new Map),l6(this,"_cursor",0),l6(this,"state","initial"),l6(this,"error",""),l6(this,"value");let{input:j=oP,output:K=aP,render:Y,signal:f,...P}=q;this.opts=P,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=Y.bind(this),this._track=_,this._abortSignal=f,this.input=j,this.output=K}unsubscribe(){this._subscribers.clear()}setSubscriber(q,_){let j=this._subscribers.get(q)??[];j.push(_),this._subscribers.set(q,j)}on(q,_){this.setSubscriber(q,{cb:_})}once(q,_){this.setSubscriber(q,{cb:_,once:!0})}emit(q,..._){let j=this._subscribers.get(q)??[],K=[];for(let Y of j)Y.cb(..._),Y.once&&K.push(()=>j.splice(j.indexOf(Y),1));for(let Y of K)Y()}prompt(){return new Promise((q,_)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),q(C2);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let j=new lX;j._write=(K,Y,f)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),f()},this.input.pipe(j),this.rl=dP.createInterface({input:this.input,output:j,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),dP.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),v7(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(X6.cursor.show),this.output.off("resize",this.render),v7(this.input,!1),q(this.value)}),this.once("cancel",()=>{this.output.write(X6.cursor.show),this.output.off("resize",this.render),v7(this.input,!1),q(C2)})})}onKeypress(q,_){if(this.state==="error"&&(this.state="active"),_?.name&&(!this._track&&W7.aliases.has(_.name)&&this.emit("cursor",W7.aliases.get(_.name)),W7.actions.has(_.name)&&this.emit("cursor",_.name)),q&&(q.toLowerCase()==="y"||q.toLowerCase()==="n")&&this.emit("confirm",q.toLowerCase()==="y"),q==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),q&&this.emit("key",q.toLowerCase()),_?.name==="return"){if(this.opts.validate){let j=this.opts.validate(this.value);j&&(this.error=j instanceof Error?j.message:j,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}N2([q,_?.name,_?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(` +`),Y=[];for(let f=0;f{let O=String(P);if(N2([O,$,w],"cancel")){K&&_.write(X6.cursor.show),process.exit(0);return}if(!j)return;Uq.moveCursor(_,$==="return"?0:-1,$==="return"?-1:0,()=>{Uq.clearLine(_,1,()=>{q.once("keypress",f)})})};return K&&_.write(X6.cursor.hide),q.once("keypress",f),()=>{q.off("keypress",f),K&&_.write(X6.cursor.show),q.isTTY&&!PA&&q.setRawMode(!1),Y.terminal=!1,Y.close()}}class _3{constructor(q,_=!0){l6(this,"input"),l6(this,"output"),l6(this,"_abortSignal"),l6(this,"rl"),l6(this,"opts"),l6(this,"_render"),l6(this,"_track",!1),l6(this,"_prevFrame",""),l6(this,"_subscribers",new Map),l6(this,"_cursor",0),l6(this,"state","initial"),l6(this,"error",""),l6(this,"value");let{input:j=oP,output:K=aP,render:Y,signal:f,...P}=q;this.opts=P,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=Y.bind(this),this._track=_,this._abortSignal=f,this.input=j,this.output=K}unsubscribe(){this._subscribers.clear()}setSubscriber(q,_){let j=this._subscribers.get(q)??[];j.push(_),this._subscribers.set(q,j)}on(q,_){this.setSubscriber(q,{cb:_})}once(q,_){this.setSubscriber(q,{cb:_,once:!0})}emit(q,..._){let j=this._subscribers.get(q)??[],K=[];for(let Y of j)Y.cb(..._),Y.once&&K.push(()=>j.splice(j.indexOf(Y),1));for(let Y of K)Y()}prompt(){return new Promise((q,_)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),q(C2);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let j=new xX;j._write=(K,Y,f)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),f()},this.input.pipe(j),this.rl=dP.createInterface({input:this.input,output:j,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),dP.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),v7(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(X6.cursor.show),this.output.off("resize",this.render),v7(this.input,!1),q(this.value)}),this.once("cancel",()=>{this.output.write(X6.cursor.show),this.output.off("resize",this.render),v7(this.input,!1),q(C2)})})}onKeypress(q,_){if(this.state==="error"&&(this.state="active"),_?.name&&(!this._track&&W7.aliases.has(_.name)&&this.emit("cursor",W7.aliases.get(_.name)),W7.actions.has(_.name)&&this.emit("cursor",_.name)),q&&(q.toLowerCase()==="y"||q.toLowerCase()==="n")&&this.emit("confirm",q.toLowerCase()==="y"),q==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),q&&this.emit("key",q.toLowerCase()),_?.name==="return"){if(this.opts.validate){let j=this.opts.validate(this.value);j&&(this.error=j instanceof Error?j.message:j,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}N2([q,_?.name,_?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(` `),v7(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let q=cP(this._prevFrame,process.stdout.columns,{hard:!0}).split(` -`).length-1;this.output.write(X6.cursor.move(-999,q*-1))}render(){let q=cP(this._render(this)??"",process.stdout.columns,{hard:!0});if(q!==this._prevFrame){if(this.state==="initial")this.output.write(X6.cursor.hide);else{let _=KA(this._prevFrame,q);if(this.restoreCursor(),_&&_?.length===1){let j=_[0];this.output.write(X6.cursor.move(0,j)),this.output.write(X6.erase.lines(1));let K=q.split(` +`).length-1;this.output.write(X6.cursor.move(-999,q*-1))}render(){let q=cP(this._render(this)??"",process.stdout.columns,{hard:!0});if(q!==this._prevFrame){if(this.state==="initial")this.output.write(X6.cursor.hide);else{let _=jA(this._prevFrame,q);if(this.restoreCursor(),_&&_?.length===1){let j=_[0];this.output.write(X6.cursor.move(0,j)),this.output.write(X6.erase.lines(1));let K=q.split(` `);this.output.write(K[j]),this._prevFrame=q,this.output.write(X6.cursor.move(0,K.length-j-1));return}if(_&&_?.length>1){let j=_[0];this.output.write(X6.cursor.move(0,j)),this.output.write(X6.erase.down());let K=q.split(` `).slice(j);this.output.write(K.join(` -`)),this._prevFrame=q;return}this.output.write(X6.erase.down())}this.output.write(q),this.state==="initial"&&(this.state="active"),this._prevFrame=q}}}var X6,BP,nX,FP,cX,rX,iX=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},oX,h2=10,pP=(q=0)=>(_)=>`\x1B[${_+q}m`,LP=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,lP=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,p8,aX,BX,eX,H7,FX=39,V2="\x07",UP="[",UX="]",sP="m",M2,xP=(q)=>`${H7.values().next().value}${UP}${q}${sP}`,nP=(q)=>`${H7.values().next().value}${M2}${q}${V2}`,sX=(q)=>q.split(" ").map((_)=>q3(_)),D2=(q,_,j)=>{let K=[..._],Y=!1,f=!1,P=q3(tP(q[q.length-1]));for(let[$,w]of K.entries()){let O=q3(w);if(P+O<=j?q[q.length-1]+=w:(q.push(w),P=0),H7.has(w)&&(Y=!0,f=K.slice($+1).join("").startsWith(M2)),Y){f?w===V2&&(Y=!1,f=!1):w===sP&&(Y=!1);continue}P+=O,P===j&&$0&&q.length>1&&(q[q.length-2]+=q.pop())},QX=(q)=>{let _=q.split(" "),j=_.length;for(;j>0&&!(q3(_[j-1])>0);)j--;return j===_.length?q:_.slice(0,j).join(" ")+_.slice(j).join("")},qA=(q,_,j={})=>{if(j.trim!==!1&&q.trim()==="")return"";let K="",Y,f,P=sX(q),$=[""];for(let[O,v]of q.split(" ").entries()){j.trim!==!1&&($[$.length-1]=$[$.length-1].trimStart());let z=q3($[$.length-1]);if(O!==0&&(z>=_&&(j.wordWrap===!1||j.trim===!1)&&($.push(""),z=0),(z>0||j.trim===!1)&&($[$.length-1]+=" ",z++)),j.hard&&P[O]>_){let W=_-z,J=1+Math.floor((P[O]-W-1)/_);Math.floor((P[O]-1)/_)_&&z>0&&P[O]>0){if(j.wordWrap===!1&&z<_){D2($,v,_);continue}$.push("")}if(z+P[O]>_&&j.wordWrap===!1){D2($,v,_);continue}$[$.length-1]+=v}j.trim!==!1&&($=$.map((O)=>QX(O)));let w=[...$.join(` -`)];for(let[O,v]of w.entries()){if(K+=v,H7.has(v)){let{groups:W}=new RegExp(`(?:\\${UP}(?\\d+)m|\\${M2}(?.*)${V2})`).exec(w.slice(O).join(""))||{groups:{}};if(W.code!==void 0){let J=Number.parseFloat(W.code);Y=J===FX?void 0:J}else W.uri!==void 0&&(f=W.uri.length===0?void 0:W.uri)}let z=eX.codes.get(Number(Y));w[O+1]===` +`)),this._prevFrame=q;return}this.output.write(X6.erase.down())}this.output.write(q),this.state==="initial"&&(this.state="active"),this._prevFrame=q}}}var X6,BP,cX,FP,rX,iX,oX=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},aX,h2=10,pP=(q=0)=>(_)=>`\x1B[${_+q}m`,LP=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,lP=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,p8,BX,tX,FX,H7,UX=39,V2="\x07",UP="[",sX="]",sP="m",M2,xP=(q)=>`${H7.values().next().value}${UP}${q}${sP}`,nP=(q)=>`${H7.values().next().value}${M2}${q}${V2}`,QX=(q)=>q.split(" ").map((_)=>q3(_)),D2=(q,_,j)=>{let K=[..._],Y=!1,f=!1,P=q3(tP(q[q.length-1]));for(let[$,w]of K.entries()){let O=q3(w);if(P+O<=j?q[q.length-1]+=w:(q.push(w),P=0),H7.has(w)&&(Y=!0,f=K.slice($+1).join("").startsWith(M2)),Y){f?w===V2&&(Y=!1,f=!1):w===sP&&(Y=!1);continue}P+=O,P===j&&$0&&q.length>1&&(q[q.length-2]+=q.pop())},qA=(q)=>{let _=q.split(" "),j=_.length;for(;j>0&&!(q3(_[j-1])>0);)j--;return j===_.length?q:_.slice(0,j).join(" ")+_.slice(j).join("")},_A=(q,_,j={})=>{if(j.trim!==!1&&q.trim()==="")return"";let K="",Y,f,P=QX(q),$=[""];for(let[O,v]of q.split(" ").entries()){j.trim!==!1&&($[$.length-1]=$[$.length-1].trimStart());let z=q3($[$.length-1]);if(O!==0&&(z>=_&&(j.wordWrap===!1||j.trim===!1)&&($.push(""),z=0),(z>0||j.trim===!1)&&($[$.length-1]+=" ",z++)),j.hard&&P[O]>_){let W=_-z,J=1+Math.floor((P[O]-W-1)/_);Math.floor((P[O]-1)/_)_&&z>0&&P[O]>0){if(j.wordWrap===!1&&z<_){D2($,v,_);continue}$.push("")}if(z+P[O]>_&&j.wordWrap===!1){D2($,v,_);continue}$[$.length-1]+=v}j.trim!==!1&&($=$.map((O)=>qA(O)));let w=[...$.join(` +`)];for(let[O,v]of w.entries()){if(K+=v,H7.has(v)){let{groups:W}=new RegExp(`(?:\\${UP}(?\\d+)m|\\${M2}(?.*)${V2})`).exec(w.slice(O).join(""))||{groups:{}};if(W.code!==void 0){let J=Number.parseFloat(W.code);Y=J===UX?void 0:J}else W.uri!==void 0&&(f=W.uri.length===0?void 0:W.uri)}let z=FX.codes.get(Number(Y));w[O+1]===` `?(f&&(K+=nP("")),Y&&z&&(K+=xP(z))):v===` -`&&(Y&&z&&(K+=xP(Y)),f&&(K+=nP(f)))}return K},_A,W7,jA,C2,PA,YA=(q,_,j)=>(_ in q)?PA(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,l6=(q,_,j)=>(YA(q,typeof _!="symbol"?_+"":_,j),j),b2,fA,$A,wA=(q,_,j)=>(_ in q)?$A(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,rP=(q,_,j)=>(wA(q,typeof _!="symbol"?_+"":_,j),j),qY,OA,zA=(q,_,j)=>(_ in q)?OA(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,iP=(q,_,j)=>(zA(q,typeof _!="symbol"?_+"":_,j),j),S2,E2;var R2=f6(()=>{X6=Pq(A2(),1),BP=Pq(u2(),1);nX=xX();FP={exports:{}};(function(q){var _={};q.exports=_,_.eastAsianWidth=function(K){var Y=K.charCodeAt(0),f=K.length==2?K.charCodeAt(1):0,P=Y;return 55296<=Y&&Y<=56319&&56320<=f&&f<=57343&&(Y&=1023,f&=1023,P=Y<<10|f,P+=65536),P==12288||65281<=P&&P<=65376||65504<=P&&P<=65510?"F":P==8361||65377<=P&&P<=65470||65474<=P&&P<=65479||65482<=P&&P<=65487||65490<=P&&P<=65495||65498<=P&&P<=65500||65512<=P&&P<=65518?"H":4352<=P&&P<=4447||4515<=P&&P<=4519||4602<=P&&P<=4607||9001<=P&&P<=9002||11904<=P&&P<=11929||11931<=P&&P<=12019||12032<=P&&P<=12245||12272<=P&&P<=12283||12289<=P&&P<=12350||12353<=P&&P<=12438||12441<=P&&P<=12543||12549<=P&&P<=12589||12593<=P&&P<=12686||12688<=P&&P<=12730||12736<=P&&P<=12771||12784<=P&&P<=12830||12832<=P&&P<=12871||12880<=P&&P<=13054||13056<=P&&P<=19903||19968<=P&&P<=42124||42128<=P&&P<=42182||43360<=P&&P<=43388||44032<=P&&P<=55203||55216<=P&&P<=55238||55243<=P&&P<=55291||63744<=P&&P<=64255||65040<=P&&P<=65049||65072<=P&&P<=65106||65108<=P&&P<=65126||65128<=P&&P<=65131||110592<=P&&P<=110593||127488<=P&&P<=127490||127504<=P&&P<=127546||127552<=P&&P<=127560||127568<=P&&P<=127569||131072<=P&&P<=194367||177984<=P&&P<=196605||196608<=P&&P<=262141?"W":32<=P&&P<=126||162<=P&&P<=163||165<=P&&P<=166||P==172||P==175||10214<=P&&P<=10221||10629<=P&&P<=10630?"Na":P==161||P==164||167<=P&&P<=168||P==170||173<=P&&P<=174||176<=P&&P<=180||182<=P&&P<=186||188<=P&&P<=191||P==198||P==208||215<=P&&P<=216||222<=P&&P<=225||P==230||232<=P&&P<=234||236<=P&&P<=237||P==240||242<=P&&P<=243||247<=P&&P<=250||P==252||P==254||P==257||P==273||P==275||P==283||294<=P&&P<=295||P==299||305<=P&&P<=307||P==312||319<=P&&P<=322||P==324||328<=P&&P<=331||P==333||338<=P&&P<=339||358<=P&&P<=359||P==363||P==462||P==464||P==466||P==468||P==470||P==472||P==474||P==476||P==593||P==609||P==708||P==711||713<=P&&P<=715||P==717||P==720||728<=P&&P<=731||P==733||P==735||768<=P&&P<=879||913<=P&&P<=929||931<=P&&P<=937||945<=P&&P<=961||963<=P&&P<=969||P==1025||1040<=P&&P<=1103||P==1105||P==8208||8211<=P&&P<=8214||8216<=P&&P<=8217||8220<=P&&P<=8221||8224<=P&&P<=8226||8228<=P&&P<=8231||P==8240||8242<=P&&P<=8243||P==8245||P==8251||P==8254||P==8308||P==8319||8321<=P&&P<=8324||P==8364||P==8451||P==8453||P==8457||P==8467||P==8470||8481<=P&&P<=8482||P==8486||P==8491||8531<=P&&P<=8532||8539<=P&&P<=8542||8544<=P&&P<=8555||8560<=P&&P<=8569||P==8585||8592<=P&&P<=8601||8632<=P&&P<=8633||P==8658||P==8660||P==8679||P==8704||8706<=P&&P<=8707||8711<=P&&P<=8712||P==8715||P==8719||P==8721||P==8725||P==8730||8733<=P&&P<=8736||P==8739||P==8741||8743<=P&&P<=8748||P==8750||8756<=P&&P<=8759||8764<=P&&P<=8765||P==8776||P==8780||P==8786||8800<=P&&P<=8801||8804<=P&&P<=8807||8810<=P&&P<=8811||8814<=P&&P<=8815||8834<=P&&P<=8835||8838<=P&&P<=8839||P==8853||P==8857||P==8869||P==8895||P==8978||9312<=P&&P<=9449||9451<=P&&P<=9547||9552<=P&&P<=9587||9600<=P&&P<=9615||9618<=P&&P<=9621||9632<=P&&P<=9633||9635<=P&&P<=9641||9650<=P&&P<=9651||9654<=P&&P<=9655||9660<=P&&P<=9661||9664<=P&&P<=9665||9670<=P&&P<=9672||P==9675||9678<=P&&P<=9681||9698<=P&&P<=9701||P==9711||9733<=P&&P<=9734||P==9737||9742<=P&&P<=9743||9748<=P&&P<=9749||P==9756||P==9758||P==9792||P==9794||9824<=P&&P<=9825||9827<=P&&P<=9829||9831<=P&&P<=9834||9836<=P&&P<=9837||P==9839||9886<=P&&P<=9887||9918<=P&&P<=9919||9924<=P&&P<=9933||9935<=P&&P<=9953||P==9955||9960<=P&&P<=9983||P==10045||P==10071||10102<=P&&P<=10111||11093<=P&&P<=11097||12872<=P&&P<=12879||57344<=P&&P<=63743||65024<=P&&P<=65039||P==65533||127232<=P&&P<=127242||127248<=P&&P<=127277||127280<=P&&P<=127337||127344<=P&&P<=127386||917760<=P&&P<=917999||983040<=P&&P<=1048573||1048576<=P&&P<=1114109?"A":"N"},_.characterLength=function(K){var Y=this.eastAsianWidth(K);return Y=="F"||Y=="W"||Y=="A"?2:1};function j(K){return K.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}_.length=function(K){for(var Y=j(K),f=0,P=0;P=Y-(z==2?1:0))if($+z<=f)P+=v;else break;$+=z}return P}})(FP);cX=FP.exports,rX=eP(cX),oX=eP(iX);p8={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]}};Object.keys(p8.modifier);aX=Object.keys(p8.color),BX=Object.keys(p8.bgColor);[...aX];eX=tX(),H7=new Set(["\x1B","›"]),M2=`${UX}8;;`;_A=["up","down","left","right","space","enter","cancel"],W7={actions:new Set(_A),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};jA=globalThis.process.platform.startsWith("win"),C2=Symbol("clack:cancel");PA=Object.defineProperty;b2=class b2 extends _3{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(q){super(q,!1),this.value=!!q.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(_)=>{this.output.write(X6.cursor.move(0,-1)),this.value=_,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};fA=new WeakMap;$A=Object.defineProperty,qY=class extends _3{constructor(q){super(q,!1),rP(this,"options"),rP(this,"cursor",0),this.options=q.options,this.value=[...q.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:_})=>_===q.cursorAt),0),this.on("key",(_)=>{_==="a"&&this.toggleAll()}),this.on("cursor",(_)=>{switch(_){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let q=this.value.length===this.options.length;this.value=q?[]:this.options.map((_)=>_.value)}toggleValue(){let q=this.value.includes(this._value);this.value=q?this.value.filter((_)=>_!==this._value):[...this.value,this._value]}},OA=Object.defineProperty;S2=class S2 extends _3{constructor(q){super(q,!1),iP(this,"options"),iP(this,"cursor",0),this.options=q.options,this.cursor=this.options.findIndex(({value:_})=>_===q.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(_)=>{switch(_){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};E2=class E2 extends _3{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}█`;let q=this.value.slice(0,this.cursor),[_,...j]=this.value.slice(this.cursor);return`${q}${BP.default.inverse(_)}${j.join("")}`}get cursor(){return this._cursor}constructor(q){super(q),this.on("finalize",()=>{this.value||(this.value=q.defaultValue)})}}});import{stripVTControlCharacters as m2}from"node:util";import vq from"node:process";function vA(){return vq.platform!=="win32"?vq.env.TERM!=="linux":!!vq.env.CI||!!vq.env.WT_SESSION||!!vq.env.TERMINUS_SUBLIME||vq.env.ConEmuTask==="{cmd::Cmder}"||vq.env.TERM_PROGRAM==="Terminus-Sublime"||vq.env.TERM_PROGRAM==="vscode"||vq.env.TERM==="xterm-256color"||vq.env.TERM==="alacritty"||vq.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var o,J7,I2,s8=(q,_)=>I2?q:_,WA,jY,PY,T7,HA,D8,sq,g2,y2,JA,_Y,TA,rV,KY,ZA,kA,XA,AA,GA,uA,hA,Z7=(q)=>{switch(q){case"initial":case"active":return o.default.cyan(WA);case"cancel":return o.default.red(jY);case"error":return o.default.yellow(PY);case"submit":return o.default.green(T7)}},d2=(q)=>{let{cursor:_,options:j,style:K}=q,Y=q.maxItems??Number.POSITIVE_INFINITY,f=Math.max(process.stdout.rows-4,0),P=Math.min(f,Math.max(Y,5)),$=0;_>=$+P-3?$=Math.max(Math.min(_-P+3,j.length-P),0):_<$+2&&($=Math.max(_-2,0));let w=P0,O=P{let J=z===0&&w,T=z===W.length-1&&O;return J||T?o.default.dim("..."):K(v,z+$===_)})},K3=(q)=>new E2({validate:q.validate,placeholder:q.placeholder,defaultValue:q.defaultValue,initialValue:q.initialValue,render(){let _=`${o.default.gray(D8)} +`&&(Y&&z&&(K+=xP(Y)),f&&(K+=nP(f)))}return K},KA,W7,PA,C2,YA,fA=(q,_,j)=>(_ in q)?YA(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,l6=(q,_,j)=>(fA(q,typeof _!="symbol"?_+"":_,j),j),b2,$A,wA,OA=(q,_,j)=>(_ in q)?wA(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,rP=(q,_,j)=>(OA(q,typeof _!="symbol"?_+"":_,j),j),qY,zA,vA=(q,_,j)=>(_ in q)?zA(q,_,{enumerable:!0,configurable:!0,writable:!0,value:j}):q[_]=j,iP=(q,_,j)=>(vA(q,typeof _!="symbol"?_+"":_,j),j),S2,E2;var R2=f6(()=>{X6=Pq(A2(),1),BP=Pq(u2(),1);cX=nX();FP={exports:{}};(function(q){var _={};q.exports=_,_.eastAsianWidth=function(K){var Y=K.charCodeAt(0),f=K.length==2?K.charCodeAt(1):0,P=Y;return 55296<=Y&&Y<=56319&&56320<=f&&f<=57343&&(Y&=1023,f&=1023,P=Y<<10|f,P+=65536),P==12288||65281<=P&&P<=65376||65504<=P&&P<=65510?"F":P==8361||65377<=P&&P<=65470||65474<=P&&P<=65479||65482<=P&&P<=65487||65490<=P&&P<=65495||65498<=P&&P<=65500||65512<=P&&P<=65518?"H":4352<=P&&P<=4447||4515<=P&&P<=4519||4602<=P&&P<=4607||9001<=P&&P<=9002||11904<=P&&P<=11929||11931<=P&&P<=12019||12032<=P&&P<=12245||12272<=P&&P<=12283||12289<=P&&P<=12350||12353<=P&&P<=12438||12441<=P&&P<=12543||12549<=P&&P<=12589||12593<=P&&P<=12686||12688<=P&&P<=12730||12736<=P&&P<=12771||12784<=P&&P<=12830||12832<=P&&P<=12871||12880<=P&&P<=13054||13056<=P&&P<=19903||19968<=P&&P<=42124||42128<=P&&P<=42182||43360<=P&&P<=43388||44032<=P&&P<=55203||55216<=P&&P<=55238||55243<=P&&P<=55291||63744<=P&&P<=64255||65040<=P&&P<=65049||65072<=P&&P<=65106||65108<=P&&P<=65126||65128<=P&&P<=65131||110592<=P&&P<=110593||127488<=P&&P<=127490||127504<=P&&P<=127546||127552<=P&&P<=127560||127568<=P&&P<=127569||131072<=P&&P<=194367||177984<=P&&P<=196605||196608<=P&&P<=262141?"W":32<=P&&P<=126||162<=P&&P<=163||165<=P&&P<=166||P==172||P==175||10214<=P&&P<=10221||10629<=P&&P<=10630?"Na":P==161||P==164||167<=P&&P<=168||P==170||173<=P&&P<=174||176<=P&&P<=180||182<=P&&P<=186||188<=P&&P<=191||P==198||P==208||215<=P&&P<=216||222<=P&&P<=225||P==230||232<=P&&P<=234||236<=P&&P<=237||P==240||242<=P&&P<=243||247<=P&&P<=250||P==252||P==254||P==257||P==273||P==275||P==283||294<=P&&P<=295||P==299||305<=P&&P<=307||P==312||319<=P&&P<=322||P==324||328<=P&&P<=331||P==333||338<=P&&P<=339||358<=P&&P<=359||P==363||P==462||P==464||P==466||P==468||P==470||P==472||P==474||P==476||P==593||P==609||P==708||P==711||713<=P&&P<=715||P==717||P==720||728<=P&&P<=731||P==733||P==735||768<=P&&P<=879||913<=P&&P<=929||931<=P&&P<=937||945<=P&&P<=961||963<=P&&P<=969||P==1025||1040<=P&&P<=1103||P==1105||P==8208||8211<=P&&P<=8214||8216<=P&&P<=8217||8220<=P&&P<=8221||8224<=P&&P<=8226||8228<=P&&P<=8231||P==8240||8242<=P&&P<=8243||P==8245||P==8251||P==8254||P==8308||P==8319||8321<=P&&P<=8324||P==8364||P==8451||P==8453||P==8457||P==8467||P==8470||8481<=P&&P<=8482||P==8486||P==8491||8531<=P&&P<=8532||8539<=P&&P<=8542||8544<=P&&P<=8555||8560<=P&&P<=8569||P==8585||8592<=P&&P<=8601||8632<=P&&P<=8633||P==8658||P==8660||P==8679||P==8704||8706<=P&&P<=8707||8711<=P&&P<=8712||P==8715||P==8719||P==8721||P==8725||P==8730||8733<=P&&P<=8736||P==8739||P==8741||8743<=P&&P<=8748||P==8750||8756<=P&&P<=8759||8764<=P&&P<=8765||P==8776||P==8780||P==8786||8800<=P&&P<=8801||8804<=P&&P<=8807||8810<=P&&P<=8811||8814<=P&&P<=8815||8834<=P&&P<=8835||8838<=P&&P<=8839||P==8853||P==8857||P==8869||P==8895||P==8978||9312<=P&&P<=9449||9451<=P&&P<=9547||9552<=P&&P<=9587||9600<=P&&P<=9615||9618<=P&&P<=9621||9632<=P&&P<=9633||9635<=P&&P<=9641||9650<=P&&P<=9651||9654<=P&&P<=9655||9660<=P&&P<=9661||9664<=P&&P<=9665||9670<=P&&P<=9672||P==9675||9678<=P&&P<=9681||9698<=P&&P<=9701||P==9711||9733<=P&&P<=9734||P==9737||9742<=P&&P<=9743||9748<=P&&P<=9749||P==9756||P==9758||P==9792||P==9794||9824<=P&&P<=9825||9827<=P&&P<=9829||9831<=P&&P<=9834||9836<=P&&P<=9837||P==9839||9886<=P&&P<=9887||9918<=P&&P<=9919||9924<=P&&P<=9933||9935<=P&&P<=9953||P==9955||9960<=P&&P<=9983||P==10045||P==10071||10102<=P&&P<=10111||11093<=P&&P<=11097||12872<=P&&P<=12879||57344<=P&&P<=63743||65024<=P&&P<=65039||P==65533||127232<=P&&P<=127242||127248<=P&&P<=127277||127280<=P&&P<=127337||127344<=P&&P<=127386||917760<=P&&P<=917999||983040<=P&&P<=1048573||1048576<=P&&P<=1114109?"A":"N"},_.characterLength=function(K){var Y=this.eastAsianWidth(K);return Y=="F"||Y=="W"||Y=="A"?2:1};function j(K){return K.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}_.length=function(K){for(var Y=j(K),f=0,P=0;P=Y-(z==2?1:0))if($+z<=f)P+=v;else break;$+=z}return P}})(FP);rX=FP.exports,iX=eP(rX),aX=eP(oX);p8={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]}};Object.keys(p8.modifier);BX=Object.keys(p8.color),tX=Object.keys(p8.bgColor);[...BX];FX=eX(),H7=new Set(["\x1B","›"]),M2=`${sX}8;;`;KA=["up","down","left","right","space","enter","cancel"],W7={actions:new Set(KA),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};PA=globalThis.process.platform.startsWith("win"),C2=Symbol("clack:cancel");YA=Object.defineProperty;b2=class b2 extends _3{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(q){super(q,!1),this.value=!!q.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(_)=>{this.output.write(X6.cursor.move(0,-1)),this.value=_,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};$A=new WeakMap;wA=Object.defineProperty,qY=class extends _3{constructor(q){super(q,!1),rP(this,"options"),rP(this,"cursor",0),this.options=q.options,this.value=[...q.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:_})=>_===q.cursorAt),0),this.on("key",(_)=>{_==="a"&&this.toggleAll()}),this.on("cursor",(_)=>{switch(_){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let q=this.value.length===this.options.length;this.value=q?[]:this.options.map((_)=>_.value)}toggleValue(){let q=this.value.includes(this._value);this.value=q?this.value.filter((_)=>_!==this._value):[...this.value,this._value]}},zA=Object.defineProperty;S2=class S2 extends _3{constructor(q){super(q,!1),iP(this,"options"),iP(this,"cursor",0),this.options=q.options,this.cursor=this.options.findIndex(({value:_})=>_===q.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(_)=>{switch(_){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};E2=class E2 extends _3{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}█`;let q=this.value.slice(0,this.cursor),[_,...j]=this.value.slice(this.cursor);return`${q}${BP.default.inverse(_)}${j.join("")}`}get cursor(){return this._cursor}constructor(q){super(q),this.on("finalize",()=>{this.value||(this.value=q.defaultValue)})}}});import{stripVTControlCharacters as m2}from"node:util";import vq from"node:process";function WA(){return vq.platform!=="win32"?vq.env.TERM!=="linux":!!vq.env.CI||!!vq.env.WT_SESSION||!!vq.env.TERMINUS_SUBLIME||vq.env.ConEmuTask==="{cmd::Cmder}"||vq.env.TERM_PROGRAM==="Terminus-Sublime"||vq.env.TERM_PROGRAM==="vscode"||vq.env.TERM==="xterm-256color"||vq.env.TERM==="alacritty"||vq.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var o,J7,I2,s8=(q,_)=>I2?q:_,HA,jY,PY,T7,JA,D8,sq,g2,y2,TA,_Y,ZA,iV,KY,kA,XA,AA,GA,uA,hA,DA,Z7=(q)=>{switch(q){case"initial":case"active":return o.default.cyan(HA);case"cancel":return o.default.red(jY);case"error":return o.default.yellow(PY);case"submit":return o.default.green(T7)}},d2=(q)=>{let{cursor:_,options:j,style:K}=q,Y=q.maxItems??Number.POSITIVE_INFINITY,f=Math.max(process.stdout.rows-4,0),P=Math.min(f,Math.max(Y,5)),$=0;_>=$+P-3?$=Math.max(Math.min(_-P+3,j.length-P),0):_<$+2&&($=Math.max(_-2,0));let w=P0,O=P{let J=z===0&&w,T=z===W.length-1&&O;return J||T?o.default.dim("..."):K(v,z+$===_)})},K3=(q)=>new E2({validate:q.validate,placeholder:q.placeholder,defaultValue:q.defaultValue,initialValue:q.initialValue,render(){let _=`${o.default.gray(D8)} ${Z7(this.state)} ${q.message} `,j=q.placeholder?o.default.inverse(q.placeholder[0])+o.default.dim(q.placeholder.slice(1)):o.default.inverse(o.default.hidden("_")),K=this.value?this.valueWithCursor:j;switch(this.state){case"error":return`${_.trim()} ${o.default.yellow(D8)} ${K} @@ -219,7 +219,7 @@ ${Z7(this.state)} ${q.message} ${o.default.gray(D8)}`;default:return`${j}${o.default.cyan(D8)} ${d2({cursor:this.cursor,options:this.options,maxItems:q.maxItems,style:(K,Y)=>_(K,Y?"active":"inactive")}).join(` ${o.default.cyan(D8)} `)} ${o.default.cyan(sq)} -`}}}).prompt()},p2=(q)=>{let _=(j,K)=>{let Y=j.label??String(j.value);return K==="active"?`${o.default.cyan(JA)} ${Y} ${j.hint?o.default.dim(`(${j.hint})`):""}`:K==="selected"?`${o.default.green(_Y)} ${o.default.dim(Y)} ${j.hint?o.default.dim(`(${j.hint})`):""}`:K==="cancelled"?`${o.default.strikethrough(o.default.dim(Y))}`:K==="active-selected"?`${o.default.green(_Y)} ${Y} ${j.hint?o.default.dim(`(${j.hint})`):""}`:K==="submitted"?`${o.default.dim(Y)}`:`${o.default.dim(TA)} ${o.default.dim(Y)}`};return new qY({options:q.options,initialValues:q.initialValues,required:q.required??!0,cursorAt:q.cursorAt,validate(j){if(this.required&&j.length===0)return`Please select at least one option. +`}}}).prompt()},p2=(q)=>{let _=(j,K)=>{let Y=j.label??String(j.value);return K==="active"?`${o.default.cyan(TA)} ${Y} ${j.hint?o.default.dim(`(${j.hint})`):""}`:K==="selected"?`${o.default.green(_Y)} ${o.default.dim(Y)} ${j.hint?o.default.dim(`(${j.hint})`):""}`:K==="cancelled"?`${o.default.strikethrough(o.default.dim(Y))}`:K==="active-selected"?`${o.default.green(_Y)} ${Y} ${j.hint?o.default.dim(`(${j.hint})`):""}`:K==="submitted"?`${o.default.dim(Y)}`:`${o.default.dim(ZA)} ${o.default.dim(Y)}`};return new qY({options:q.options,initialValues:q.initialValues,required:q.required??!0,cursorAt:q.cursorAt,validate(j){if(this.required&&j.length===0)return`Please select at least one option. ${o.default.reset(o.default.dim(`Press ${o.default.gray(o.default.bgWhite(o.default.inverse(" space ")))} to select, ${o.default.gray(o.default.bgWhite(o.default.inverse(" enter ")))} to submit`))}`},render(){let j=`${o.default.gray(D8)} ${Z7(this.state)} ${q.message} `,K=(Y,f)=>{let P=this.value.includes(Y.value);return f&&P?_(Y,"active-selected"):P?_(Y,"selected"):_(Y,f?"active":"inactive")};switch(this.state){case"submit":return`${j}${o.default.gray(D8)} ${this.options.filter(({value:Y})=>this.value.includes(Y)).map((Y)=>_(Y,"submitted")).join(o.default.dim(", "))||o.default.dim("none")}`;case"cancel":{let Y=this.options.filter(({value:f})=>this.value.includes(f)).map((f)=>_(f,"cancelled")).join(o.default.dim(", "));return`${j}${o.default.gray(D8)} ${Y.trim()?`${Y} @@ -236,56 +236,56 @@ ${q} `.split(` `),K=m2(_).length,Y=Math.max(j.reduce((P,$)=>{let w=m2($);return w.length>P?w.length:P},0),K)+2,f=j.map((P)=>`${o.default.gray(D8)} ${o.default.dim(P)}${" ".repeat(Y-m2(P).length)}${o.default.gray(D8)}`).join(` `);process.stdout.write(`${o.default.gray(D8)} -${o.default.green(T7)} ${o.default.reset(_)} ${o.default.gray(KY.repeat(Math.max(Y-K-1,1))+ZA)} +${o.default.green(T7)} ${o.default.reset(_)} ${o.default.gray(KY.repeat(Math.max(Y-K-1,1))+kA)} ${f} -${o.default.gray(kA+KY.repeat(Y+2)+XA)} +${o.default.gray(XA+KY.repeat(Y+2)+AA)} `)},$6=(q="")=>{process.stdout.write(`${o.default.gray(sq)} ${o.default.red(q)} -`)},YY=(q="")=>{process.stdout.write(`${o.default.gray(HA)} ${q} +`)},YY=(q="")=>{process.stdout.write(`${o.default.gray(JA)} ${q} `)},nq=(q="")=>{process.stdout.write(`${o.default.gray(D8)} ${o.default.gray(sq)} ${q} -`)},j6,iV,Qq=({indicator:q="dots"}={})=>{let _=I2?["◒","◐","◓","◑"]:["•","o","O","0"],j=I2?80:120,K=process.env.CI==="true",Y,f,P=!1,$="",w,O=performance.now(),v=(M)=>{let I=M>1?"Something went wrong":"Canceled";P&&D(I,M)},z=()=>v(2),W=()=>v(1),J=()=>{process.on("uncaughtExceptionMonitor",z),process.on("unhandledRejection",z),process.on("SIGINT",W),process.on("SIGTERM",W),process.on("exit",v)},T=()=>{process.removeListener("uncaughtExceptionMonitor",z),process.removeListener("unhandledRejection",z),process.removeListener("SIGINT",W),process.removeListener("SIGTERM",W),process.removeListener("exit",v)},H=()=>{if(w===void 0)return;K&&process.stdout.write(` +`)},j6,oV,Qq=({indicator:q="dots"}={})=>{let _=I2?["◒","◐","◓","◑"]:["•","o","O","0"],j=I2?80:120,K=process.env.CI==="true",Y,f,P=!1,$="",w,O=performance.now(),v=(M)=>{let I=M>1?"Something went wrong":"Canceled";P&&D(I,M)},z=()=>v(2),W=()=>v(1),J=()=>{process.on("uncaughtExceptionMonitor",z),process.on("unhandledRejection",z),process.on("SIGINT",W),process.on("SIGTERM",W),process.on("exit",v)},T=()=>{process.removeListener("uncaughtExceptionMonitor",z),process.removeListener("unhandledRejection",z),process.removeListener("SIGINT",W),process.removeListener("SIGTERM",W),process.removeListener("exit",v)},H=()=>{if(w===void 0)return;K&&process.stdout.write(` `);let M=w.split(` `);process.stdout.write(J7.cursor.move(-999,M.length-1)),process.stdout.write(J7.erase.down(M.length))},X=(M)=>M.replace(/\.+$/,""),A=(M)=>{let I=(performance.now()-M)/1000,N=Math.floor(I/60),R=Math.floor(I%60);return N>0?`[${N}m ${R}s]`:`[${R}s]`},G=(M="")=>{P=!0,Y=QP(),$=X(M),O=performance.now(),process.stdout.write(`${o.default.gray(D8)} `);let I=0,N=0;J(),f=setInterval(()=>{if(K&&$===w)return;H(),w=$;let R=o.default.magenta(_[I]);if(K)process.stdout.write(`${R} ${$}...`);else if(q==="timer")process.stdout.write(`${R} ${$} ${A(O)}`);else{let L=".".repeat(Math.floor(N)).slice(0,3);process.stdout.write(`${R} ${$}${L}`)}I=I+1<_.length?I+1:0,N=N<_.length?N+0.125:0},j)},D=(M="",I=0)=>{P=!1,clearInterval(f),H();let N=I===0?o.default.green(T7):I===1?o.default.red(jY):o.default.red(PY);$=X(M??$),q==="timer"?process.stdout.write(`${N} ${$} ${A(O)} `):process.stdout.write(`${N} ${$} -`),T(),Y()};return{start:G,stop:D,message:(M="")=>{$=X(M??$)}}};var vK=f6(()=>{R2();R2();o=Pq(u2(),1),J7=Pq(A2(),1);I2=vA(),WA=s8("◆","*"),jY=s8("■","x"),PY=s8("▲","x"),T7=s8("◇","o"),HA=s8("┌","T"),D8=s8("│","|"),sq=s8("└","—"),g2=s8("●",">"),y2=s8("○"," "),JA=s8("◻","[•]"),_Y=s8("◼","[+]"),TA=s8("◻","[ ]"),rV=s8("▪","•"),KY=s8("─","-"),ZA=s8("╮","+"),kA=s8("├","+"),XA=s8("╯","+"),AA=s8("●","•"),GA=s8("◆","*"),uA=s8("▲","!"),hA=s8("■","x"),j6={message:(q="",{symbol:_=o.default.gray(D8)}={})=>{let j=[`${o.default.gray(D8)}`];if(q){let[K,...Y]=q.split(` +`),T(),Y()};return{start:G,stop:D,message:(M="")=>{$=X(M??$)}}};var vK=f6(()=>{R2();R2();o=Pq(u2(),1),J7=Pq(A2(),1);I2=WA(),HA=s8("◆","*"),jY=s8("■","x"),PY=s8("▲","x"),T7=s8("◇","o"),JA=s8("┌","T"),D8=s8("│","|"),sq=s8("└","—"),g2=s8("●",">"),y2=s8("○"," "),TA=s8("◻","[•]"),_Y=s8("◼","[+]"),ZA=s8("◻","[ ]"),iV=s8("▪","•"),KY=s8("─","-"),kA=s8("╮","+"),XA=s8("├","+"),AA=s8("╯","+"),GA=s8("●","•"),uA=s8("◆","*"),hA=s8("▲","!"),DA=s8("■","x"),j6={message:(q="",{symbol:_=o.default.gray(D8)}={})=>{let j=[`${o.default.gray(D8)}`];if(q){let[K,...Y]=q.split(` `);j.push(`${_} ${K}`,...Y.map((f)=>`${o.default.gray(D8)} ${f}`))}process.stdout.write(`${j.join(` `)} -`)},info:(q)=>{j6.message(q,{symbol:o.default.blue(AA)})},success:(q)=>{j6.message(q,{symbol:o.default.green(GA)})},step:(q)=>{j6.message(q,{symbol:o.default.green(T7)})},warn:(q)=>{j6.message(q,{symbol:o.default.yellow(uA)})},warning:(q)=>{j6.warn(q)},error:(q)=>{j6.message(q,{symbol:o.default.red(hA)})}},iV=`${o.default.gray(D8)} `});var kY=_8((r2,i2)=>{(function(q,_){typeof r2==="object"&&typeof i2!=="undefined"?i2.exports=_():typeof define==="function"&&define.amd?define(_):(q=typeof globalThis!=="undefined"?globalThis:q||self,q.tinycolor=_())})(r2,function(){function q(h){return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},q(h)}var _=/^\s+/,j=/\s+$/;function K(h,C){if(h=h?h:"",C=C||{},h instanceof K)return h;if(!(this instanceof K))return new K(h,C);var Z=Y(h);if(this._originalInput=h,this._r=Z.r,this._g=Z.g,this._b=Z.b,this._a=Z.a,this._roundA=Math.round(100*this._a)/100,this._format=C.format||Z.format,this._gradientType=C.gradientType,this._r<1)this._r=Math.round(this._r);if(this._g<1)this._g=Math.round(this._g);if(this._b<1)this._b=Math.round(this._b);this._ok=Z.ok}K.prototype={isDark:function h(){return this.getBrightness()<128},isLight:function h(){return!this.isDark()},isValid:function h(){return this._ok},getOriginalInput:function h(){return this._originalInput},getFormat:function h(){return this._format},getAlpha:function h(){return this._a},getBrightness:function h(){var C=this.toRgb();return(C.r*299+C.g*587+C.b*114)/1000},getLuminance:function h(){var C=this.toRgb(),Z,E,x,i,r,a;if(Z=C.r/255,E=C.g/255,x=C.b/255,Z<=0.03928)i=Z/12.92;else i=Math.pow((Z+0.055)/1.055,2.4);if(E<=0.03928)r=E/12.92;else r=Math.pow((E+0.055)/1.055,2.4);if(x<=0.03928)a=x/12.92;else a=Math.pow((x+0.055)/1.055,2.4);return 0.2126*i+0.7152*r+0.0722*a},setAlpha:function h(C){return this._a=V(C),this._roundA=Math.round(100*this._a)/100,this},toHsv:function h(){var C=w(this._r,this._g,this._b);return{h:C.h*360,s:C.s,v:C.v,a:this._a}},toHsvString:function h(){var C=w(this._r,this._g,this._b),Z=Math.round(C.h*360),E=Math.round(C.s*100),x=Math.round(C.v*100);return this._a==1?"hsv("+Z+", "+E+"%, "+x+"%)":"hsva("+Z+", "+E+"%, "+x+"%, "+this._roundA+")"},toHsl:function h(){var C=P(this._r,this._g,this._b);return{h:C.h*360,s:C.s,l:C.l,a:this._a}},toHslString:function h(){var C=P(this._r,this._g,this._b),Z=Math.round(C.h*360),E=Math.round(C.s*100),x=Math.round(C.l*100);return this._a==1?"hsl("+Z+", "+E+"%, "+x+"%)":"hsla("+Z+", "+E+"%, "+x+"%, "+this._roundA+")"},toHex:function h(C){return v(this._r,this._g,this._b,C)},toHexString:function h(C){return"#"+this.toHex(C)},toHex8:function h(C){return z(this._r,this._g,this._b,this._a,C)},toHex8String:function h(C){return"#"+this.toHex8(C)},toRgb:function h(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function h(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function h(){return{r:Math.round(S(this._r,255)*100)+"%",g:Math.round(S(this._g,255)*100)+"%",b:Math.round(S(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function h(){return this._a==1?"rgb("+Math.round(S(this._r,255)*100)+"%, "+Math.round(S(this._g,255)*100)+"%, "+Math.round(S(this._b,255)*100)+"%)":"rgba("+Math.round(S(this._r,255)*100)+"%, "+Math.round(S(this._g,255)*100)+"%, "+Math.round(S(this._b,255)*100)+"%, "+this._roundA+")"},toName:function h(){if(this._a===0)return"transparent";if(this._a<1)return!1;return d[v(this._r,this._g,this._b,!0)]||!1},toFilter:function h(C){var Z="#"+W(this._r,this._g,this._b,this._a),E=Z,x=this._gradientType?"GradientType = 1, ":"";if(C){var i=K(C);E="#"+W(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+x+"startColorstr="+Z+",endColorstr="+E+")"},toString:function h(C){var Z=!!C;C=C||this._format;var E=!1,x=this._a<1&&this._a>=0,i=!Z&&x&&(C==="hex"||C==="hex6"||C==="hex3"||C==="hex4"||C==="hex8"||C==="name");if(i){if(C==="name"&&this._a===0)return this.toName();return this.toRgbString()}if(C==="rgb")E=this.toRgbString();if(C==="prgb")E=this.toPercentageRgbString();if(C==="hex"||C==="hex6")E=this.toHexString();if(C==="hex3")E=this.toHexString(!0);if(C==="hex4")E=this.toHex8String(!0);if(C==="hex8")E=this.toHex8String();if(C==="name")E=this.toName();if(C==="hsl")E=this.toHslString();if(C==="hsv")E=this.toHsvString();return E||this.toHexString()},clone:function h(){return K(this.toString())},_applyModification:function h(C,Z){var E=C.apply(null,[this].concat([].slice.call(Z)));return this._r=E._r,this._g=E._g,this._b=E._b,this.setAlpha(E._a),this},lighten:function h(){return this._applyModification(X,arguments)},brighten:function h(){return this._applyModification(A,arguments)},darken:function h(){return this._applyModification(G,arguments)},desaturate:function h(){return this._applyModification(J,arguments)},saturate:function h(){return this._applyModification(T,arguments)},greyscale:function h(){return this._applyModification(H,arguments)},spin:function h(){return this._applyModification(D,arguments)},_applyCombination:function h(C,Z){return C.apply(null,[this].concat([].slice.call(Z)))},analogous:function h(){return this._applyCombination(R,arguments)},complement:function h(){return this._applyCombination(M,arguments)},monochromatic:function h(){return this._applyCombination(L,arguments)},splitcomplement:function h(){return this._applyCombination(N,arguments)},triad:function h(){return this._applyCombination(I,[3])},tetrad:function h(){return this._applyCombination(I,[4])}},K.fromRatio=function(h,C){if(q(h)=="object"){var Z={};for(var E in h)if(h.hasOwnProperty(E))if(E==="a")Z[E]=h[E];else Z[E]=q8(h[E]);h=Z}return K(h,C)};function Y(h){var C={r:0,g:0,b:0},Z=1,E=null,x=null,i=null,r=!1,a=!1;if(typeof h=="string")h=o8(h);if(q(h)=="object"){if(G8(h.r)&&G8(h.g)&&G8(h.b))C=f(h.r,h.g,h.b),r=!0,a=String(h.r).substr(-1)==="%"?"prgb":"rgb";else if(G8(h.h)&&G8(h.s)&&G8(h.v))E=q8(h.s),x=q8(h.v),C=O(h.h,E,x),r=!0,a="hsv";else if(G8(h.h)&&G8(h.s)&&G8(h.l))E=q8(h.s),i=q8(h.l),C=$(h.h,E,i),r=!0,a="hsl";if(h.hasOwnProperty("a"))Z=h.a}return Z=V(Z),{ok:r,format:h.format||a,r:Math.min(255,Math.max(C.r,0)),g:Math.min(255,Math.max(C.g,0)),b:Math.min(255,Math.max(C.b,0)),a:Z}}function f(h,C,Z){return{r:S(h,255)*255,g:S(C,255)*255,b:S(Z,255)*255}}function P(h,C,Z){h=S(h,255),C=S(C,255),Z=S(Z,255);var E=Math.max(h,C,Z),x=Math.min(h,C,Z),i,r,a=(E+x)/2;if(E==x)i=r=0;else{var P8=E-x;switch(r=a>0.5?P8/(2-E-x):P8/(E+x),E){case h:i=(C-Z)/P8+(C1)A8-=1;if(A8<0.16666666666666666)return H8+(O8-H8)*6*A8;if(A8<0.5)return O8;if(A8<0.6666666666666666)return H8+(O8-H8)*(0.6666666666666666-A8)*6;return H8}if(C===0)E=x=i=Z;else{var a=Z<0.5?Z*(1+C):Z+C-Z*C,P8=2*Z-a;E=r(P8,a,h+0.3333333333333333),x=r(P8,a,h),i=r(P8,a,h-0.3333333333333333)}return{r:E*255,g:x*255,b:i*255}}function w(h,C,Z){h=S(h,255),C=S(C,255),Z=S(Z,255);var E=Math.max(h,C,Z),x=Math.min(h,C,Z),i,r,a=E,P8=E-x;if(r=E===0?0:P8/E,E==x)i=0;else{switch(E){case h:i=(C-Z)/P8+(C>1)+720)%360;--C;)E.h=(E.h+x)%360,i.push(K(E));return i}function L(h,C){C=C||6;var Z=K(h).toHsv(),E=Z.h,x=Z.s,i=Z.v,r=[],a=1/C;while(C--)r.push(K({h:E,s:x,v:i})),i=(i+a)%1;return r}K.mix=function(h,C,Z){Z=Z===0?0:Z||50;var E=K(h).toRgb(),x=K(C).toRgb(),i=Z/100,r={r:(x.r-E.r)*i+E.r,g:(x.g-E.g)*i+E.g,b:(x.b-E.b)*i+E.b,a:(x.a-E.a)*i+E.a};return K(r)},K.readability=function(h,C){var Z=K(h),E=K(C);return(Math.max(Z.getLuminance(),E.getLuminance())+0.05)/(Math.min(Z.getLuminance(),E.getLuminance())+0.05)},K.isReadable=function(h,C,Z){var E=K.readability(h,C),x,i;switch(i=!1,x=F8(Z),x.level+x.size){case"AAsmall":case"AAAlarge":i=E>=4.5;break;case"AAlarge":i=E>=3;break;case"AAAsmall":i=E>=7;break}return i},K.mostReadable=function(h,C,Z){var E=null,x=0,i,r,a,P8;Z=Z||{},r=Z.includeFallbackColors,a=Z.level,P8=Z.size;for(var H8=0;H8x)x=i,E=K(C[H8]);if(K.isReadable(h,E,{level:a,size:P8})||!r)return E;else return Z.includeFallbackColors=!1,K.mostReadable(h,["#fff","#000"],Z)};var b=K.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},d=K.hexNames=y(b);function y(h){var C={};for(var Z in h)if(h.hasOwnProperty(Z))C[h[Z]]=Z;return C}function V(h){if(h=parseFloat(h),isNaN(h)||h<0||h>1)h=1;return h}function S(h,C){if(B(h))h="100%";var Z=e(h);if(h=Math.min(C,Math.max(0,parseFloat(h))),Z)h=parseInt(h*C,10)/100;if(Math.abs(h-C)<0.000001)return 1;return h%C/parseFloat(C)}function p(h){return Math.min(1,Math.max(0,h))}function c(h){return parseInt(h,16)}function B(h){return typeof h=="string"&&h.indexOf(".")!=-1&&parseFloat(h)===1}function e(h){return typeof h==="string"&&h.indexOf("%")!=-1}function Y8(h){return h.length==1?"0"+h:""+h}function q8(h){if(h<=1)h=h*100+"%";return h}function z8(h){return Math.round(parseFloat(h)*255).toString(16)}function w8(h){return c(h)/255}var K8=function(){var h="[-\\+]?\\d+%?",C="[-\\+]?\\d*\\.\\d+%?",Z="(?:"+C+")|(?:"+h+")",E="[\\s|\\(]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")\\s*\\)?",x="[\\s|\\(]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")\\s*\\)?";return{CSS_UNIT:new RegExp(Z),rgb:new RegExp("rgb"+E),rgba:new RegExp("rgba"+x),hsl:new RegExp("hsl"+E),hsla:new RegExp("hsla"+x),hsv:new RegExp("hsv"+E),hsva:new RegExp("hsva"+x),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function G8(h){return!!K8.CSS_UNIT.exec(h)}function o8(h){h=h.replace(_,"").replace(j,"").toLowerCase();var C=!1;if(b[h])h=b[h],C=!0;else if(h=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var Z;if(Z=K8.rgb.exec(h))return{r:Z[1],g:Z[2],b:Z[3]};if(Z=K8.rgba.exec(h))return{r:Z[1],g:Z[2],b:Z[3],a:Z[4]};if(Z=K8.hsl.exec(h))return{h:Z[1],s:Z[2],l:Z[3]};if(Z=K8.hsla.exec(h))return{h:Z[1],s:Z[2],l:Z[3],a:Z[4]};if(Z=K8.hsv.exec(h))return{h:Z[1],s:Z[2],v:Z[3]};if(Z=K8.hsva.exec(h))return{h:Z[1],s:Z[2],v:Z[3],a:Z[4]};if(Z=K8.hex8.exec(h))return{r:c(Z[1]),g:c(Z[2]),b:c(Z[3]),a:w8(Z[4]),format:C?"name":"hex8"};if(Z=K8.hex6.exec(h))return{r:c(Z[1]),g:c(Z[2]),b:c(Z[3]),format:C?"name":"hex"};if(Z=K8.hex4.exec(h))return{r:c(Z[1]+""+Z[1]),g:c(Z[2]+""+Z[2]),b:c(Z[3]+""+Z[3]),a:w8(Z[4]+""+Z[4]),format:C?"name":"hex8"};if(Z=K8.hex3.exec(h))return{r:c(Z[1]+""+Z[1]),g:c(Z[2]+""+Z[2]),b:c(Z[3]+""+Z[3]),format:C?"name":"hex"};return!1}function F8(h){var C,Z;if(h=h||{level:"AA",size:"small"},C=(h.level||"AA").toUpperCase(),Z=(h.size||"small").toLowerCase(),C!=="AA"&&C!=="AAA")C="AA";if(Z!=="small"&&Z!=="large")Z="small";return{level:C,size:Z}}return K})});var CY=_8((YM,DY)=>{var f3=kY(),uY={r:256,g:256,b:256,a:1},hY={h:360,s:1,v:1,a:1};function a2(q,_,j){let K={};for(let Y in q)if(q.hasOwnProperty(Y))K[Y]=j===0?0:(_[Y]-q[Y])/j;return K}function B2(q,_,j,K){let Y={};for(let f in _)if(_.hasOwnProperty(f))Y[f]=q[f]*j+_[f],Y[f]=Y[f]<0?Y[f]+K[f]:K[f]!==1?Y[f]%K[f]:Y[f];return Y}function o2(q,_,j){let K=q.color.toRgb(),Y=_.color.toRgb(),f=a2(K,Y,j),P=[q.color];for(let $=1;$f.h&&Y.h-f.h>180;P=K==="long"&&v||K==="short"&&!v}let $=a2(Y,f,j),w=[q.color],O;if(Y.h<=f.h&&!P||Y.h>=f.h&&P)O=f.h-Y.h;else if(P)O=360-f.h+Y.h;else O=360-Y.h+f.h;$.h=Math.pow(-1,P?1:0)*Math.abs(O)/j;for(let v=1;v1)throw new Error("Position must be between 0 and 1");let Y,f;for(let w=0,O=q.length;w=q[w].pos&&_{let $=f.pos!==void 0;if(_^$)throw new Error("Cannot mix positionned and not posionned color stops");if($){let w=f.color!==void 0;if(!w&&(Y||P===0||P===j-1))throw new Error("Cannot define two consecutive position-only stops");if(Y=!w,f={color:w?f3(f.color):null,colorLess:!w,pos:f.pos},f.pos<0||f.pos>1)throw new Error("Color stops positions must be between 0 and 1");else if(f.pos{q.push({color:j.color,pos:j.pos/2})}),this.stops.slice(0,-1).forEach((j)=>{_.push({color:j.color,pos:1-j.pos/2})}),new A7(q.concat(_.reverse()))}rgb(q){let _=AY(this.stops,q),j=[];this.stops.forEach((K,Y)=>{if(K.colorLess)K.color=o2(this.stops[Y-1],this.stops[Y+1],2)[1]});for(let K=0,Y=this.stops.length;K{if(Y.colorLess)Y.color=XY(this.stops[f-1],this.stops[f+1],2,_)[1]});for(let Y=0,f=this.stops.length;Y{EY.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var IY=_8((uM,jG)=>{jG.exports={single:{topLeft:"┌",top:"─",topRight:"┐",right:"│",bottomRight:"┘",bottom:"─",bottomLeft:"└",left:"│"},double:{topLeft:"╔",top:"═",topRight:"╗",right:"║",bottomRight:"╝",bottom:"═",bottomLeft:"╚",left:"║"},round:{topLeft:"╭",top:"─",topRight:"╮",right:"│",bottomRight:"╯",bottom:"─",bottomLeft:"╰",left:"│"},bold:{topLeft:"┏",top:"━",topRight:"┓",right:"┃",bottomRight:"┛",bottom:"━",bottomLeft:"┗",left:"┃"},singleDouble:{topLeft:"╓",top:"─",topRight:"╖",right:"║",bottomRight:"╜",bottom:"─",bottomLeft:"╙",left:"║"},doubleSingle:{topLeft:"╒",top:"═",topRight:"╕",right:"│",bottomRight:"╛",bottom:"═",bottomLeft:"╘",left:"│"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"↘",top:"↓",topRight:"↙",right:"←",bottomRight:"↖",bottom:"↑",bottomLeft:"↗",left:"→"}}});var q9=_8((hM,Q2)=>{var gY=IY();Q2.exports=gY;Q2.exports.default=gY});var xY=_8((CM,lY)=>{lY.exports=({onlyFirst:q=!1}={})=>{let _=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(_,q?void 0:"g")}});var cY=_8((VM,nY)=>{var zG=xY();nY.exports=(q)=>typeof q==="string"?q.replace(zG(),""):q});var iY=_8((MM,j9)=>{var rY=(q)=>{if(Number.isNaN(q))return!1;if(q>=4352&&(q<=4447||q===9001||q===9002||11904<=q&&q<=12871&&q!==12351||12880<=q&&q<=19903||19968<=q&&q<=42182||43360<=q&&q<=43388||44032<=q&&q<=55203||63744<=q&&q<=64255||65040<=q&&q<=65049||65072<=q&&q<=65131||65281<=q&&q<=65376||65504<=q&&q<=65510||110592<=q&&q<=110593||127488<=q&&q<=127569||131072<=q&&q<=262141))return!0;return!1};j9.exports=rY;j9.exports.default=rY});var aY=_8((NM,oY)=>{oY.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var tY=_8((bM,P9)=>{var vG=cY(),WG=iY(),HG=aY(),BY=(q)=>{if(typeof q!=="string"||q.length===0)return 0;if(q=vG(q),q.length===0)return 0;q=q.replace(HG()," ");let _=0;for(let j=0;j=127&&K<=159)continue;if(K>=768&&K<=879)continue;if(K>65535)j++;_+=WG(K)?2:1}return _};P9.exports=BY;P9.exports.default=BY});var FY=_8((SM,eY)=>{var JG=tY();function A_(q,_){if(!q)return q;_=_||{};let j=_.align||"center";if(j==="left")return q;let K=_.split||` -`,Y=_.pad||" ",f=j!=="right"?TG:ZG,P=!1;if(!Array.isArray(q))P=!0,q=String(q).split(K);let $,w=0;return q=q.map(function(O){return O=String(O),$=JG(O),w=Math.max($,w),{str:O,width:$}}).map(function(O){return new Array(f(w,O.width)+1).join(Y)+O.str}),P?q.join(K):q}A_.left=function q(_){return A_(_,{align:"left"})};A_.center=function q(_){return A_(_,{align:"center"})};A_.right=function q(_){return A_(_,{align:"right"})};eY.exports=A_;function TG(q,_){return Math.floor((q-_)/2)}function ZG(q,_){return q-_}});import W3 from"fs";import{join as zu}from"path";function vu(q){if(q===0)return"0 B";let _=1024,j=["B","KB","MB","GB"],K=Math.floor(Math.log(q)/Math.log(_));return parseFloat((q/Math.pow(_,K)).toFixed(1))+" "+j[K]}function Wu(){let q=$8.getInstance().getTrashDirectory();if(!W3.existsSync(q))return{folderCount:0,fileCount:0,totalSize:0,isEmpty:!0};let _=W3.readdirSync(q);if(_.length===0)return{folderCount:0,fileCount:0,totalSize:0,isEmpty:!0};let j=0,K=0,Y=0;for(let f of _){let P=zu(q,f),$=W3.statSync(P);if($.isDirectory())j++;else K++;Y+=$.size}return{folderCount:j,fileCount:K,totalSize:Y,isEmpty:!1}}async function M7(q={}){let j=$8.getInstance().getIndexPath();try{if(!W3.existsSync(j)){if(q.format==="session-start")console.log(mK("NO_MEMORIES",q.project||"this project"));return}let Y=W3.readFileSync(j,"utf-8").trim().split(` -`).filter((z)=>z.trim());if(Y.length===0){if(q.format==="session-start")console.log(mK("NO_MEMORIES",q.project||"this project"));return}let f=[];for(let z of Y)try{if(!z.trim().startsWith("{"))continue;let W=JSON.parse(z);f.push(W)}catch(W){continue}if(f.length===0){if(q.format==="session-start")console.log(mK("NO_MEMORIES",q.project||"this project"));return}let P=f.filter((z)=>z.type==="memory"),$=f.filter((z)=>z.type==="overview"),w=f.filter((z)=>z.type==="session"),O=P,v=$;if(q.project)O=P.filter((z)=>z.project===q.project),v=$.filter((z)=>z.project===q.project);if(q.format==="session-start"){let z=O.slice(-10),W=v.slice(-5),J=[...z,...W],T="recently",H=J.map((X)=>{return X.timestamp?new Date(X.timestamp):null}).filter((X)=>X!==null).sort((X,A)=>A.getTime()-X.getTime());if(H.length>0)T=D5(H[0]);V5({projectName:q.project||"your project",memoryCount:z.length,lastSessionTime:T,recentObjects:J})}else if(q.format==="json"){let z=O.slice(-10),W=v.slice(-3),J=[...z,...W];console.log(JSON.stringify(J))}else{let z=O.slice(-10),W=v.slice(-3),J=z.length+W.length;console.log(p3("Context loading",J,"recent entries found")),z.forEach((T)=>{console.log(`${T.text} | ${T.document_id} | ${T.keywords}`)}),W.forEach((T)=>{console.log(`**Overview:** ${T.content}`)})}if(q.format!=="json"){let z=Wu();if(!z.isEmpty){let W=vu(z.totalSize);console.log(`\uD83D\uDDD1️ Trash – ${z.folderCount} folders | ${z.fileCount} files | ${W} – use \`$ claude-mem restore\``),console.log("")}}}catch(K){let Y=K instanceof Error?K.message:String(K);if(q.format==="session-start")console.log(mK("CONNECTION_FAILED",Y));else console.log(d_("Context loading",Y,"Check file permissions and try again"))}}var T9=f6(()=>{d6();O4()});var R$={};EK(R$,{viewTrash:()=>HD});import{readdirSync as N$,statSync as b$}from"fs";import{join as S$}from"path";function WD(q){let _=q.lastIndexOf(".");if(_===-1)return{name:q,timestamp:0};let j=parseInt(q.substring(_+1));if(isNaN(j))return{name:q,timestamp:0};return{name:q.substring(0,_),timestamp:j}}function M$(q){if(q===0)return"0 B";let _=1024,j=["B","KB","MB","GB"],K=Math.floor(Math.log(q)/Math.log(_));return parseFloat((q/Math.pow(_,K)).toFixed(2))+" "+j[K]}function E$(q){let _=0,j=N$(q);for(let K of j){let Y=S$(q,K),f=b$(Y);if(f.isDirectory())_+=E$(Y);else _+=f.size}return _}async function HD(){let q=$8.getInstance().getTrashDirectory();try{let _=N$(q);if(_.length===0){j6.info("\uD83D\uDDD1️ Trash is empty");return}let j=_.map((P)=>{let $=S$(q,P),w=b$($),{name:O,timestamp:v}=WD(P),z=w.isDirectory()?E$($):w.size;return{originalName:O,trashedName:P,size:z,trashedAt:new Date(v),isDirectory:w.isDirectory()}});j.sort((P,$)=>$.trashedAt.getTime()-P.trashedAt.getTime()),console.log(` +`)},info:(q)=>{j6.message(q,{symbol:o.default.blue(GA)})},success:(q)=>{j6.message(q,{symbol:o.default.green(uA)})},step:(q)=>{j6.message(q,{symbol:o.default.green(T7)})},warn:(q)=>{j6.message(q,{symbol:o.default.yellow(hA)})},warning:(q)=>{j6.warn(q)},error:(q)=>{j6.message(q,{symbol:o.default.red(DA)})}},oV=`${o.default.gray(D8)} `});var kY=_8((r2,i2)=>{(function(q,_){typeof r2==="object"&&typeof i2!=="undefined"?i2.exports=_():typeof define==="function"&&define.amd?define(_):(q=typeof globalThis!=="undefined"?globalThis:q||self,q.tinycolor=_())})(r2,function(){function q(h){return q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},q(h)}var _=/^\s+/,j=/\s+$/;function K(h,C){if(h=h?h:"",C=C||{},h instanceof K)return h;if(!(this instanceof K))return new K(h,C);var Z=Y(h);if(this._originalInput=h,this._r=Z.r,this._g=Z.g,this._b=Z.b,this._a=Z.a,this._roundA=Math.round(100*this._a)/100,this._format=C.format||Z.format,this._gradientType=C.gradientType,this._r<1)this._r=Math.round(this._r);if(this._g<1)this._g=Math.round(this._g);if(this._b<1)this._b=Math.round(this._b);this._ok=Z.ok}K.prototype={isDark:function h(){return this.getBrightness()<128},isLight:function h(){return!this.isDark()},isValid:function h(){return this._ok},getOriginalInput:function h(){return this._originalInput},getFormat:function h(){return this._format},getAlpha:function h(){return this._a},getBrightness:function h(){var C=this.toRgb();return(C.r*299+C.g*587+C.b*114)/1000},getLuminance:function h(){var C=this.toRgb(),Z,E,x,i,r,a;if(Z=C.r/255,E=C.g/255,x=C.b/255,Z<=0.03928)i=Z/12.92;else i=Math.pow((Z+0.055)/1.055,2.4);if(E<=0.03928)r=E/12.92;else r=Math.pow((E+0.055)/1.055,2.4);if(x<=0.03928)a=x/12.92;else a=Math.pow((x+0.055)/1.055,2.4);return 0.2126*i+0.7152*r+0.0722*a},setAlpha:function h(C){return this._a=V(C),this._roundA=Math.round(100*this._a)/100,this},toHsv:function h(){var C=w(this._r,this._g,this._b);return{h:C.h*360,s:C.s,v:C.v,a:this._a}},toHsvString:function h(){var C=w(this._r,this._g,this._b),Z=Math.round(C.h*360),E=Math.round(C.s*100),x=Math.round(C.v*100);return this._a==1?"hsv("+Z+", "+E+"%, "+x+"%)":"hsva("+Z+", "+E+"%, "+x+"%, "+this._roundA+")"},toHsl:function h(){var C=P(this._r,this._g,this._b);return{h:C.h*360,s:C.s,l:C.l,a:this._a}},toHslString:function h(){var C=P(this._r,this._g,this._b),Z=Math.round(C.h*360),E=Math.round(C.s*100),x=Math.round(C.l*100);return this._a==1?"hsl("+Z+", "+E+"%, "+x+"%)":"hsla("+Z+", "+E+"%, "+x+"%, "+this._roundA+")"},toHex:function h(C){return v(this._r,this._g,this._b,C)},toHexString:function h(C){return"#"+this.toHex(C)},toHex8:function h(C){return z(this._r,this._g,this._b,this._a,C)},toHex8String:function h(C){return"#"+this.toHex8(C)},toRgb:function h(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function h(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function h(){return{r:Math.round(S(this._r,255)*100)+"%",g:Math.round(S(this._g,255)*100)+"%",b:Math.round(S(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function h(){return this._a==1?"rgb("+Math.round(S(this._r,255)*100)+"%, "+Math.round(S(this._g,255)*100)+"%, "+Math.round(S(this._b,255)*100)+"%)":"rgba("+Math.round(S(this._r,255)*100)+"%, "+Math.round(S(this._g,255)*100)+"%, "+Math.round(S(this._b,255)*100)+"%, "+this._roundA+")"},toName:function h(){if(this._a===0)return"transparent";if(this._a<1)return!1;return d[v(this._r,this._g,this._b,!0)]||!1},toFilter:function h(C){var Z="#"+W(this._r,this._g,this._b,this._a),E=Z,x=this._gradientType?"GradientType = 1, ":"";if(C){var i=K(C);E="#"+W(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+x+"startColorstr="+Z+",endColorstr="+E+")"},toString:function h(C){var Z=!!C;C=C||this._format;var E=!1,x=this._a<1&&this._a>=0,i=!Z&&x&&(C==="hex"||C==="hex6"||C==="hex3"||C==="hex4"||C==="hex8"||C==="name");if(i){if(C==="name"&&this._a===0)return this.toName();return this.toRgbString()}if(C==="rgb")E=this.toRgbString();if(C==="prgb")E=this.toPercentageRgbString();if(C==="hex"||C==="hex6")E=this.toHexString();if(C==="hex3")E=this.toHexString(!0);if(C==="hex4")E=this.toHex8String(!0);if(C==="hex8")E=this.toHex8String();if(C==="name")E=this.toName();if(C==="hsl")E=this.toHslString();if(C==="hsv")E=this.toHsvString();return E||this.toHexString()},clone:function h(){return K(this.toString())},_applyModification:function h(C,Z){var E=C.apply(null,[this].concat([].slice.call(Z)));return this._r=E._r,this._g=E._g,this._b=E._b,this.setAlpha(E._a),this},lighten:function h(){return this._applyModification(X,arguments)},brighten:function h(){return this._applyModification(A,arguments)},darken:function h(){return this._applyModification(G,arguments)},desaturate:function h(){return this._applyModification(J,arguments)},saturate:function h(){return this._applyModification(T,arguments)},greyscale:function h(){return this._applyModification(H,arguments)},spin:function h(){return this._applyModification(D,arguments)},_applyCombination:function h(C,Z){return C.apply(null,[this].concat([].slice.call(Z)))},analogous:function h(){return this._applyCombination(R,arguments)},complement:function h(){return this._applyCombination(M,arguments)},monochromatic:function h(){return this._applyCombination(L,arguments)},splitcomplement:function h(){return this._applyCombination(N,arguments)},triad:function h(){return this._applyCombination(I,[3])},tetrad:function h(){return this._applyCombination(I,[4])}},K.fromRatio=function(h,C){if(q(h)=="object"){var Z={};for(var E in h)if(h.hasOwnProperty(E))if(E==="a")Z[E]=h[E];else Z[E]=q8(h[E]);h=Z}return K(h,C)};function Y(h){var C={r:0,g:0,b:0},Z=1,E=null,x=null,i=null,r=!1,a=!1;if(typeof h=="string")h=o8(h);if(q(h)=="object"){if(G8(h.r)&&G8(h.g)&&G8(h.b))C=f(h.r,h.g,h.b),r=!0,a=String(h.r).substr(-1)==="%"?"prgb":"rgb";else if(G8(h.h)&&G8(h.s)&&G8(h.v))E=q8(h.s),x=q8(h.v),C=O(h.h,E,x),r=!0,a="hsv";else if(G8(h.h)&&G8(h.s)&&G8(h.l))E=q8(h.s),i=q8(h.l),C=$(h.h,E,i),r=!0,a="hsl";if(h.hasOwnProperty("a"))Z=h.a}return Z=V(Z),{ok:r,format:h.format||a,r:Math.min(255,Math.max(C.r,0)),g:Math.min(255,Math.max(C.g,0)),b:Math.min(255,Math.max(C.b,0)),a:Z}}function f(h,C,Z){return{r:S(h,255)*255,g:S(C,255)*255,b:S(Z,255)*255}}function P(h,C,Z){h=S(h,255),C=S(C,255),Z=S(Z,255);var E=Math.max(h,C,Z),x=Math.min(h,C,Z),i,r,a=(E+x)/2;if(E==x)i=r=0;else{var P8=E-x;switch(r=a>0.5?P8/(2-E-x):P8/(E+x),E){case h:i=(C-Z)/P8+(C1)A8-=1;if(A8<0.16666666666666666)return H8+(O8-H8)*6*A8;if(A8<0.5)return O8;if(A8<0.6666666666666666)return H8+(O8-H8)*(0.6666666666666666-A8)*6;return H8}if(C===0)E=x=i=Z;else{var a=Z<0.5?Z*(1+C):Z+C-Z*C,P8=2*Z-a;E=r(P8,a,h+0.3333333333333333),x=r(P8,a,h),i=r(P8,a,h-0.3333333333333333)}return{r:E*255,g:x*255,b:i*255}}function w(h,C,Z){h=S(h,255),C=S(C,255),Z=S(Z,255);var E=Math.max(h,C,Z),x=Math.min(h,C,Z),i,r,a=E,P8=E-x;if(r=E===0?0:P8/E,E==x)i=0;else{switch(E){case h:i=(C-Z)/P8+(C>1)+720)%360;--C;)E.h=(E.h+x)%360,i.push(K(E));return i}function L(h,C){C=C||6;var Z=K(h).toHsv(),E=Z.h,x=Z.s,i=Z.v,r=[],a=1/C;while(C--)r.push(K({h:E,s:x,v:i})),i=(i+a)%1;return r}K.mix=function(h,C,Z){Z=Z===0?0:Z||50;var E=K(h).toRgb(),x=K(C).toRgb(),i=Z/100,r={r:(x.r-E.r)*i+E.r,g:(x.g-E.g)*i+E.g,b:(x.b-E.b)*i+E.b,a:(x.a-E.a)*i+E.a};return K(r)},K.readability=function(h,C){var Z=K(h),E=K(C);return(Math.max(Z.getLuminance(),E.getLuminance())+0.05)/(Math.min(Z.getLuminance(),E.getLuminance())+0.05)},K.isReadable=function(h,C,Z){var E=K.readability(h,C),x,i;switch(i=!1,x=F8(Z),x.level+x.size){case"AAsmall":case"AAAlarge":i=E>=4.5;break;case"AAlarge":i=E>=3;break;case"AAAsmall":i=E>=7;break}return i},K.mostReadable=function(h,C,Z){var E=null,x=0,i,r,a,P8;Z=Z||{},r=Z.includeFallbackColors,a=Z.level,P8=Z.size;for(var H8=0;H8x)x=i,E=K(C[H8]);if(K.isReadable(h,E,{level:a,size:P8})||!r)return E;else return Z.includeFallbackColors=!1,K.mostReadable(h,["#fff","#000"],Z)};var b=K.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},d=K.hexNames=y(b);function y(h){var C={};for(var Z in h)if(h.hasOwnProperty(Z))C[h[Z]]=Z;return C}function V(h){if(h=parseFloat(h),isNaN(h)||h<0||h>1)h=1;return h}function S(h,C){if(B(h))h="100%";var Z=e(h);if(h=Math.min(C,Math.max(0,parseFloat(h))),Z)h=parseInt(h*C,10)/100;if(Math.abs(h-C)<0.000001)return 1;return h%C/parseFloat(C)}function p(h){return Math.min(1,Math.max(0,h))}function c(h){return parseInt(h,16)}function B(h){return typeof h=="string"&&h.indexOf(".")!=-1&&parseFloat(h)===1}function e(h){return typeof h==="string"&&h.indexOf("%")!=-1}function Y8(h){return h.length==1?"0"+h:""+h}function q8(h){if(h<=1)h=h*100+"%";return h}function z8(h){return Math.round(parseFloat(h)*255).toString(16)}function w8(h){return c(h)/255}var K8=function(){var h="[-\\+]?\\d+%?",C="[-\\+]?\\d*\\.\\d+%?",Z="(?:"+C+")|(?:"+h+")",E="[\\s|\\(]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")\\s*\\)?",x="[\\s|\\(]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")[,|\\s]+("+Z+")\\s*\\)?";return{CSS_UNIT:new RegExp(Z),rgb:new RegExp("rgb"+E),rgba:new RegExp("rgba"+x),hsl:new RegExp("hsl"+E),hsla:new RegExp("hsla"+x),hsv:new RegExp("hsv"+E),hsva:new RegExp("hsva"+x),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function G8(h){return!!K8.CSS_UNIT.exec(h)}function o8(h){h=h.replace(_,"").replace(j,"").toLowerCase();var C=!1;if(b[h])h=b[h],C=!0;else if(h=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var Z;if(Z=K8.rgb.exec(h))return{r:Z[1],g:Z[2],b:Z[3]};if(Z=K8.rgba.exec(h))return{r:Z[1],g:Z[2],b:Z[3],a:Z[4]};if(Z=K8.hsl.exec(h))return{h:Z[1],s:Z[2],l:Z[3]};if(Z=K8.hsla.exec(h))return{h:Z[1],s:Z[2],l:Z[3],a:Z[4]};if(Z=K8.hsv.exec(h))return{h:Z[1],s:Z[2],v:Z[3]};if(Z=K8.hsva.exec(h))return{h:Z[1],s:Z[2],v:Z[3],a:Z[4]};if(Z=K8.hex8.exec(h))return{r:c(Z[1]),g:c(Z[2]),b:c(Z[3]),a:w8(Z[4]),format:C?"name":"hex8"};if(Z=K8.hex6.exec(h))return{r:c(Z[1]),g:c(Z[2]),b:c(Z[3]),format:C?"name":"hex"};if(Z=K8.hex4.exec(h))return{r:c(Z[1]+""+Z[1]),g:c(Z[2]+""+Z[2]),b:c(Z[3]+""+Z[3]),a:w8(Z[4]+""+Z[4]),format:C?"name":"hex8"};if(Z=K8.hex3.exec(h))return{r:c(Z[1]+""+Z[1]),g:c(Z[2]+""+Z[2]),b:c(Z[3]+""+Z[3]),format:C?"name":"hex"};return!1}function F8(h){var C,Z;if(h=h||{level:"AA",size:"small"},C=(h.level||"AA").toUpperCase(),Z=(h.size||"small").toLowerCase(),C!=="AA"&&C!=="AAA")C="AA";if(Z!=="small"&&Z!=="large")Z="small";return{level:C,size:Z}}return K})});var CY=_8((fM,DY)=>{var f3=kY(),uY={r:256,g:256,b:256,a:1},hY={h:360,s:1,v:1,a:1};function a2(q,_,j){let K={};for(let Y in q)if(q.hasOwnProperty(Y))K[Y]=j===0?0:(_[Y]-q[Y])/j;return K}function B2(q,_,j,K){let Y={};for(let f in _)if(_.hasOwnProperty(f))Y[f]=q[f]*j+_[f],Y[f]=Y[f]<0?Y[f]+K[f]:K[f]!==1?Y[f]%K[f]:Y[f];return Y}function o2(q,_,j){let K=q.color.toRgb(),Y=_.color.toRgb(),f=a2(K,Y,j),P=[q.color];for(let $=1;$f.h&&Y.h-f.h>180;P=K==="long"&&v||K==="short"&&!v}let $=a2(Y,f,j),w=[q.color],O;if(Y.h<=f.h&&!P||Y.h>=f.h&&P)O=f.h-Y.h;else if(P)O=360-f.h+Y.h;else O=360-Y.h+f.h;$.h=Math.pow(-1,P?1:0)*Math.abs(O)/j;for(let v=1;v1)throw new Error("Position must be between 0 and 1");let Y,f;for(let w=0,O=q.length;w=q[w].pos&&_{let $=f.pos!==void 0;if(_^$)throw new Error("Cannot mix positionned and not posionned color stops");if($){let w=f.color!==void 0;if(!w&&(Y||P===0||P===j-1))throw new Error("Cannot define two consecutive position-only stops");if(Y=!w,f={color:w?f3(f.color):null,colorLess:!w,pos:f.pos},f.pos<0||f.pos>1)throw new Error("Color stops positions must be between 0 and 1");else if(f.pos{q.push({color:j.color,pos:j.pos/2})}),this.stops.slice(0,-1).forEach((j)=>{_.push({color:j.color,pos:1-j.pos/2})}),new A7(q.concat(_.reverse()))}rgb(q){let _=AY(this.stops,q),j=[];this.stops.forEach((K,Y)=>{if(K.colorLess)K.color=o2(this.stops[Y-1],this.stops[Y+1],2)[1]});for(let K=0,Y=this.stops.length;K{if(Y.colorLess)Y.color=XY(this.stops[f-1],this.stops[f+1],2,_)[1]});for(let Y=0,f=this.stops.length;Y{EY.exports=()=>{return/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}});var IY=_8((hM,PG)=>{PG.exports={single:{topLeft:"┌",top:"─",topRight:"┐",right:"│",bottomRight:"┘",bottom:"─",bottomLeft:"└",left:"│"},double:{topLeft:"╔",top:"═",topRight:"╗",right:"║",bottomRight:"╝",bottom:"═",bottomLeft:"╚",left:"║"},round:{topLeft:"╭",top:"─",topRight:"╮",right:"│",bottomRight:"╯",bottom:"─",bottomLeft:"╰",left:"│"},bold:{topLeft:"┏",top:"━",topRight:"┓",right:"┃",bottomRight:"┛",bottom:"━",bottomLeft:"┗",left:"┃"},singleDouble:{topLeft:"╓",top:"─",topRight:"╖",right:"║",bottomRight:"╜",bottom:"─",bottomLeft:"╙",left:"║"},doubleSingle:{topLeft:"╒",top:"═",topRight:"╕",right:"│",bottomRight:"╛",bottom:"═",bottomLeft:"╘",left:"│"},classic:{topLeft:"+",top:"-",topRight:"+",right:"|",bottomRight:"+",bottom:"-",bottomLeft:"+",left:"|"},arrow:{topLeft:"↘",top:"↓",topRight:"↙",right:"←",bottomRight:"↖",bottom:"↑",bottomLeft:"↗",left:"→"}}});var q9=_8((DM,Q2)=>{var gY=IY();Q2.exports=gY;Q2.exports.default=gY});var xY=_8((VM,lY)=>{lY.exports=({onlyFirst:q=!1}={})=>{let _=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(_,q?void 0:"g")}});var cY=_8((MM,nY)=>{var vG=xY();nY.exports=(q)=>typeof q==="string"?q.replace(vG(),""):q});var iY=_8((NM,j9)=>{var rY=(q)=>{if(Number.isNaN(q))return!1;if(q>=4352&&(q<=4447||q===9001||q===9002||11904<=q&&q<=12871&&q!==12351||12880<=q&&q<=19903||19968<=q&&q<=42182||43360<=q&&q<=43388||44032<=q&&q<=55203||63744<=q&&q<=64255||65040<=q&&q<=65049||65072<=q&&q<=65131||65281<=q&&q<=65376||65504<=q&&q<=65510||110592<=q&&q<=110593||127488<=q&&q<=127569||131072<=q&&q<=262141))return!0;return!1};j9.exports=rY;j9.exports.default=rY});var aY=_8((bM,oY)=>{oY.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var tY=_8((SM,P9)=>{var WG=cY(),HG=iY(),JG=aY(),BY=(q)=>{if(typeof q!=="string"||q.length===0)return 0;if(q=WG(q),q.length===0)return 0;q=q.replace(JG()," ");let _=0;for(let j=0;j=127&&K<=159)continue;if(K>=768&&K<=879)continue;if(K>65535)j++;_+=HG(K)?2:1}return _};P9.exports=BY;P9.exports.default=BY});var FY=_8((EM,eY)=>{var TG=tY();function A_(q,_){if(!q)return q;_=_||{};let j=_.align||"center";if(j==="left")return q;let K=_.split||` +`,Y=_.pad||" ",f=j!=="right"?ZG:kG,P=!1;if(!Array.isArray(q))P=!0,q=String(q).split(K);let $,w=0;return q=q.map(function(O){return O=String(O),$=TG(O),w=Math.max($,w),{str:O,width:$}}).map(function(O){return new Array(f(w,O.width)+1).join(Y)+O.str}),P?q.join(K):q}A_.left=function q(_){return A_(_,{align:"left"})};A_.center=function q(_){return A_(_,{align:"center"})};A_.right=function q(_){return A_(_,{align:"right"})};eY.exports=A_;function ZG(q,_){return Math.floor((q-_)/2)}function kG(q,_){return q-_}});import W3 from"fs";import{join as vu}from"path";function Wu(q){let _=new Set;return _.add(q),_.add(q.replace(/-/g,"_")),_.add(q.replace(/_/g,"-")),(j)=>!!j&&_.has(j)}function Hu(q){if(q===0)return"0 B";let _=1024,j=["B","KB","MB","GB"],K=Math.floor(Math.log(q)/Math.log(_));return parseFloat((q/Math.pow(_,K)).toFixed(1))+" "+j[K]}function Ju(){let q=$8.getInstance().getTrashDirectory();if(!W3.existsSync(q))return{folderCount:0,fileCount:0,totalSize:0,isEmpty:!0};let _=W3.readdirSync(q);if(_.length===0)return{folderCount:0,fileCount:0,totalSize:0,isEmpty:!0};let j=0,K=0,Y=0;for(let f of _){let P=vu(q,f),$=W3.statSync(P);if($.isDirectory())j++;else K++;Y+=$.size}return{folderCount:j,fileCount:K,totalSize:Y,isEmpty:!1}}async function M7(q={}){let j=$8.getInstance().getIndexPath();try{if(!W3.existsSync(j)){if(q.format==="session-start")console.log(mK("NO_MEMORIES",q.project||"this project"));return}let Y=W3.readFileSync(j,"utf-8").trim().split(` +`).filter((W)=>W.trim());if(Y.length===0){if(q.format==="session-start")console.log(mK("NO_MEMORIES",q.project||"this project"));return}let f=[];for(let W of Y)try{if(!W.trim().startsWith("{"))continue;let J=JSON.parse(W);f.push(J)}catch(J){continue}if(f.length===0){if(q.format==="session-start")console.log(mK("NO_MEMORIES",q.project||"this project"));return}let P=f.filter((W)=>W.type==="memory"),$=f.filter((W)=>W.type==="overview"),w=f.filter((W)=>W.type==="session"),O=P,v=$,z=w;if(q.project){let W=Wu(q.project);O=P.filter((J)=>W(J.project)),v=$.filter((J)=>W(J.project)),z=w.filter((J)=>W(J.project))}if(q.format==="session-start"){let W=O.slice(-10),J=v.slice(-5),H=[...z.slice(-5),...W,...J],X="recently",A=H.map((G)=>{return G.timestamp?new Date(G.timestamp):null}).filter((G)=>G!==null).sort((G,D)=>D.getTime()-G.getTime());if(A.length>0)X=D5(A[0]);V5({projectName:q.project||"your project",memoryCount:W.length,lastSessionTime:X,recentObjects:H})}else if(q.format==="json"){let W=O.slice(-10),J=v.slice(-3),T=[...W,...J];console.log(JSON.stringify(T))}else{let W=O.slice(-10),J=v.slice(-3),T=W.length+J.length;console.log(p3("Context loading",T,"recent entries found")),W.forEach((H)=>{console.log(`${H.text} | ${H.document_id} | ${H.keywords}`)}),J.forEach((H)=>{console.log(`**Overview:** ${H.content}`)})}if(q.format!=="json"){let W=Ju();if(!W.isEmpty){let J=Hu(W.totalSize);console.log(`\uD83D\uDDD1️ Trash – ${W.folderCount} folders | ${W.fileCount} files | ${J} – use \`$ claude-mem restore\``),console.log("")}}}catch(K){let Y=K instanceof Error?K.message:String(K);if(q.format==="session-start")console.log(mK("CONNECTION_FAILED",Y));else console.log(d_("Context loading",Y,"Check file permissions and try again"))}}var T9=f6(()=>{d6();O4()});var m$={};EK(m$,{viewTrash:()=>JD});import{readdirSync as b$,statSync as S$}from"fs";import{join as E$}from"path";function HD(q){let _=q.lastIndexOf(".");if(_===-1)return{name:q,timestamp:0};let j=parseInt(q.substring(_+1));if(isNaN(j))return{name:q,timestamp:0};return{name:q.substring(0,_),timestamp:j}}function N$(q){if(q===0)return"0 B";let _=1024,j=["B","KB","MB","GB"],K=Math.floor(Math.log(q)/Math.log(_));return parseFloat((q/Math.pow(_,K)).toFixed(2))+" "+j[K]}function R$(q){let _=0,j=b$(q);for(let K of j){let Y=E$(q,K),f=S$(Y);if(f.isDirectory())_+=R$(Y);else _+=f.size}return _}async function JD(){let q=$8.getInstance().getTrashDirectory();try{let _=b$(q);if(_.length===0){j6.info("\uD83D\uDDD1️ Trash is empty");return}let j=_.map((P)=>{let $=E$(q,P),w=S$($),{name:O,timestamp:v}=HD(P),z=w.isDirectory()?R$($):w.size;return{originalName:O,trashedName:P,size:z,trashedAt:new Date(v),isDirectory:w.isDirectory()}});j.sort((P,$)=>$.trashedAt.getTime()-P.trashedAt.getTime()),console.log(` \uD83D\uDDD1️ Trash Contents -`),console.log("─".repeat(80));let K=0,Y=0,f=0;for(let P of j){if(K+=P.size,P.isDirectory)Y++;else f++;let $=P.isDirectory?"\uD83D\uDCC1":"\uD83D\uDCC4",w=P.trashedAt.toLocaleString(),O=M$(P.size);console.log(`${$} ${P.originalName}`),console.log(` Size: ${O} | Trashed: ${w}`),console.log(` ID: ${P.trashedName}`),console.log()}console.log("─".repeat(80)),console.log(`Total: ${Y} folders, ${f} files (${M$(K)})`),console.log(` -To restore files: claude-mem restore`),console.log("To empty trash: claude-mem trash empty")}catch(_){if(_.code==="ENOENT")j6.info("\uD83D\uDDD1️ Trash is empty");else j6.error("Failed to read trash directory"),console.error(_)}}var m$=f6(()=>{vK();d6()});var g$={};EK(g$,{emptyTrash:()=>XD});import{rmSync as JD,readdirSync as TD,existsSync as ZD,statSync as kD}from"fs";import{join as I$}from"path";async function XD(q={}){let _=$8.getInstance().getTrashDirectory();if(!ZD(_)){j6.info("\uD83D\uDDD1️ Trash is already empty");return}try{let j=TD(_);if(j.length===0){j6.info("\uD83D\uDDD1️ Trash is already empty");return}let K=0,Y=0;for(let P of j){let $=I$(_,P);if(kD($).isDirectory())K++;else Y++}if(!q.force){let P=await hq({message:`Permanently delete ${K} folders and ${Y} files from trash?`,initialValue:!1});if(L8(P)||!P){j6.info("Cancelled - trash not emptied");return}}let f=Qq();f.start("Emptying trash...");for(let P of j){let $=I$(_,P);JD($,{recursive:!0,force:!0})}f.stop(`\uD83D\uDDD1️ Trash emptied - permanently deleted ${K} folders and ${Y} files`)}catch(j){j6.error("Failed to empty trash"),console.error(j),process.exit(1)}}var y$=f6(()=>{vK();d6()});var a7={};EK(a7,{sessionStartHook:()=>GD,sessionEndHook:()=>uD,preCompactHook:()=>AD});import{basename as d$}from"path";async function AD(){try{let q="";process.stdin.setEncoding("utf8");for await(let j of process.stdin)q+=j;let _;if(q)try{_=JSON.parse(q).transcript_path}catch(j){_=q.trim()}if(!_)_=process.env.TRANSCRIPT_PATH||process.argv[2];if(!_){console.log("\uD83D\uDDDC️ Compressing session transcript..."),console.log("❌ No transcript path provided to pre-compact hook"),console.log("Hook data received:",q||"none"),console.log("Environment TRANSCRIPT_PATH:",process.env.TRANSCRIPT_PATH||"not set"),console.log("Command line args:",process.argv.slice(2));return}await QK(_,{dryRun:!1})}catch(q){console.error("Pre-compact hook failed:",q.message),process.exit(1)}}async function GD(){try{let q="";process.stdin.setEncoding("utf8");for await(let j of process.stdin)q+=j;let _;if(q)try{let j=JSON.parse(q);if(j.cwd)_=d$(j.cwd)}catch(j){console.error("Failed to parse session-start hook data:",j)}if(!_)_=d$(process.cwd());await M7({format:"session-start",count:"10",project:_})}catch(q){console.error("Session-start hook failed:",q.message),process.exit(1)}}async function uD(){try{let q="";process.stdin.setEncoding("utf8");for await(let _ of process.stdin)q+=_;if(q)try{let _=JSON.parse(q);if(_.reason==="clear"&&_.transcript_path)console.log("\uD83D\uDDDC️ Compressing current session before /clear..."),await QK(_.transcript_path,{dryRun:!1})}catch(_){console.error("Failed to parse hook data:",_)}console.log("Session ended successfully")}catch(q){console.error("Session-end hook failed:",q.message),process.exit(1)}}var B7=f6(()=>{k2();T9()});var v5=Pq(z5(),1),{program:lD,createCommand:xD,createArgument:nD,createOption:cD,CommanderError:rD,InvalidArgumentError:iD,InvalidOptionArgumentError:oD,Command:W5,Argument:aD,Option:BD,Help:tD}=v5.default;import{readFileSync as Uw,existsSync as sw}from"fs";import{join as Qw,dirname as qO}from"path";import{fileURLToPath as _O}from"url";var H5="claude-mem",J5="3.6.9",T5="Memory compression system for Claude Code - persist context across sessions",Z5=H5,k5=J5,X5=T5;try{let q=_O(import.meta.url),_=qO(q),j=Qw(_,"..","..","package.json");if(sw(j)){let K=JSON.parse(Uw(j,"utf-8"));Z5=K.name||H5,k5=K.version||J5,X5=K.description||T5}}catch{}var oq=Z5,A5=k5,G5=X5;k2();vK();import{readFileSync as JK,writeFileSync as h_,existsSync as R8,chmodSync as dG,mkdirSync as ZK,copyFileSync as u_,statSync as pG,readdirSync as LG}from"fs";import{join as V8,dirname as TK}from"path";import{homedir as v9,platform as zf}from"os";import{execSync as G_}from"child_process";import{fileURLToPath as vf}from"url";var fY=(q=0)=>(_)=>`\x1B[${_+q}m`,$Y=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,wY=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,l8={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]}},aV=Object.keys(l8.modifier),DA=Object.keys(l8.color),CA=Object.keys(l8.bgColor),BV=[...DA,...CA];function VA(){let q=new Map;for(let[_,j]of Object.entries(l8)){for(let[K,Y]of Object.entries(j))l8[K]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},j[K]=l8[K],q.set(Y[0],Y[1]);Object.defineProperty(l8,_,{value:j,enumerable:!1})}return Object.defineProperty(l8,"codes",{value:q,enumerable:!1}),l8.color.close="\x1B[39m",l8.bgColor.close="\x1B[49m",l8.color.ansi=fY(),l8.color.ansi256=$Y(),l8.color.ansi16m=wY(),l8.bgColor.ansi=fY(10),l8.bgColor.ansi256=$Y(10),l8.bgColor.ansi16m=wY(10),Object.defineProperties(l8,{rgbToAnsi256:{value(_,j,K){if(_===j&&j===K){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(j/255*5)+Math.round(K/255*5)},enumerable:!1},hexToRgb:{value(_){let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;if(K.length===3)K=[...K].map((f)=>f+f).join("");let Y=Number.parseInt(K,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(_)=>l8.rgbToAnsi256(...l8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value(_){if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,Y;if(_>=232)j=((_-232)*10+8)/255,K=j,Y=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,Y=$%6/5}let f=Math.max(j,K,Y)*2;if(f===0)return 30;let P=30+(Math.round(Y)<<2|Math.round(K)<<1|Math.round(j));if(f===2)P+=60;return P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>l8.ansi256ToAnsi(l8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>l8.ansi256ToAnsi(l8.hexToAnsi256(_)),enumerable:!1}}),l8}var MA=VA(),Wq=MA;import l2 from"node:process";import NA from"node:os";import OY from"node:tty";function s6(q,_=globalThis.Deno?globalThis.Deno.args:l2.argv){let j=q.startsWith("-")?"":q.length===1?"-":"--",K=_.indexOf(j+q),Y=_.indexOf("--");return K!==-1&&(Y===-1||K=2,has16m:q>=3}}function EA(q,{streamIsTTY:_,sniffFlags:j=!0}={}){let K=bA();if(K!==void 0)k7=K;let Y=j?k7:K;if(Y===0)return 0;if(j){if(s6("color=16m")||s6("color=full")||s6("color=truecolor"))return 3;if(s6("color=256"))return 2}if("TF_BUILD"in x8&&"AGENT_NAME"in x8)return 1;if(q&&!_&&Y===void 0)return 0;let f=Y||0;if(x8.TERM==="dumb")return f;if(l2.platform==="win32"){let P=NA.release().split(".");if(Number(P[0])>=10&&Number(P[2])>=10586)return Number(P[2])>=14931?3:2;return 1}if("CI"in x8){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((P)=>(P in x8)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((P)=>(P in x8))||x8.CI_NAME==="codeship")return 1;return f}if("TEAMCITY_VERSION"in x8)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(x8.TEAMCITY_VERSION)?1:0;if(x8.COLORTERM==="truecolor")return 3;if(x8.TERM==="xterm-kitty")return 3;if(x8.TERM==="xterm-ghostty")return 3;if(x8.TERM==="wezterm")return 3;if("TERM_PROGRAM"in x8){let P=Number.parseInt((x8.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(x8.TERM_PROGRAM){case"iTerm.app":return P>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(x8.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(x8.TERM))return 1;if("COLORTERM"in x8)return 1;return f}function zY(q,_={}){let j=EA(q,{streamIsTTY:q&&q.isTTY,..._});return SA(j)}var RA={stdout:zY({isTTY:OY.isatty(1)}),stderr:zY({isTTY:OY.isatty(2)})},vY=RA;function WY(q,_,j){let K=q.indexOf(_);if(K===-1)return q;let Y=_.length,f=0,P="";do P+=q.slice(f,K)+_+j,f=K+Y,K=q.indexOf(_,f);while(K!==-1);return P+=q.slice(f),P}function HY(q,_,j,K){let Y=0,f="";do{let P=q[K-1]==="\r";f+=q.slice(Y,P?K-1:K)+_+(P?`\r +`),console.log("─".repeat(80));let K=0,Y=0,f=0;for(let P of j){if(K+=P.size,P.isDirectory)Y++;else f++;let $=P.isDirectory?"\uD83D\uDCC1":"\uD83D\uDCC4",w=P.trashedAt.toLocaleString(),O=N$(P.size);console.log(`${$} ${P.originalName}`),console.log(` Size: ${O} | Trashed: ${w}`),console.log(` ID: ${P.trashedName}`),console.log()}console.log("─".repeat(80)),console.log(`Total: ${Y} folders, ${f} files (${N$(K)})`),console.log(` +To restore files: claude-mem restore`),console.log("To empty trash: claude-mem trash empty")}catch(_){if(_.code==="ENOENT")j6.info("\uD83D\uDDD1️ Trash is empty");else j6.error("Failed to read trash directory"),console.error(_)}}var I$=f6(()=>{vK();d6()});var y$={};EK(y$,{emptyTrash:()=>AD});import{rmSync as TD,readdirSync as ZD,existsSync as kD,statSync as XD}from"fs";import{join as g$}from"path";async function AD(q={}){let _=$8.getInstance().getTrashDirectory();if(!kD(_)){j6.info("\uD83D\uDDD1️ Trash is already empty");return}try{let j=ZD(_);if(j.length===0){j6.info("\uD83D\uDDD1️ Trash is already empty");return}let K=0,Y=0;for(let P of j){let $=g$(_,P);if(XD($).isDirectory())K++;else Y++}if(!q.force){let P=await hq({message:`Permanently delete ${K} folders and ${Y} files from trash?`,initialValue:!1});if(L8(P)||!P){j6.info("Cancelled - trash not emptied");return}}let f=Qq();f.start("Emptying trash...");for(let P of j){let $=g$(_,P);TD($,{recursive:!0,force:!0})}f.stop(`\uD83D\uDDD1️ Trash emptied - permanently deleted ${K} folders and ${Y} files`)}catch(j){j6.error("Failed to empty trash"),console.error(j),process.exit(1)}}var d$=f6(()=>{vK();d6()});var a7={};EK(a7,{sessionStartHook:()=>uD,sessionEndHook:()=>hD,preCompactHook:()=>GD});import{basename as p$}from"path";async function GD(){try{let q="";process.stdin.setEncoding("utf8");for await(let j of process.stdin)q+=j;let _;if(q)try{_=JSON.parse(q).transcript_path}catch(j){_=q.trim()}if(!_)_=process.env.TRANSCRIPT_PATH||process.argv[2];if(!_){console.log("\uD83D\uDDDC️ Compressing session transcript..."),console.log("❌ No transcript path provided to pre-compact hook"),console.log("Hook data received:",q||"none"),console.log("Environment TRANSCRIPT_PATH:",process.env.TRANSCRIPT_PATH||"not set"),console.log("Command line args:",process.argv.slice(2));return}await QK(_,{dryRun:!1})}catch(q){console.error("Pre-compact hook failed:",q.message),process.exit(1)}}async function uD(){try{let q="";process.stdin.setEncoding("utf8");for await(let j of process.stdin)q+=j;let _;if(q)try{let j=JSON.parse(q);if(j.cwd)_=p$(j.cwd)}catch(j){console.error("Failed to parse session-start hook data:",j)}if(!_)_=p$(process.cwd());await M7({format:"session-start",count:"10",project:_})}catch(q){console.error("Session-start hook failed:",q.message),process.exit(1)}}async function hD(){try{let q="";process.stdin.setEncoding("utf8");for await(let _ of process.stdin)q+=_;if(q)try{let _=JSON.parse(q);if(_.reason==="clear"&&_.transcript_path)console.log("\uD83D\uDDDC️ Compressing current session before /clear..."),await QK(_.transcript_path,{dryRun:!1})}catch(_){console.error("Failed to parse hook data:",_)}console.log("Session ended successfully")}catch(q){console.error("Session-end hook failed:",q.message),process.exit(1)}}var B7=f6(()=>{k2();T9()});var v5=Pq(z5(),1),{program:xD,createCommand:nD,createArgument:cD,createOption:rD,CommanderError:iD,InvalidArgumentError:oD,InvalidOptionArgumentError:aD,Command:W5,Argument:BD,Option:tD,Help:eD}=v5.default;import{readFileSync as sw,existsSync as Qw}from"fs";import{join as qO,dirname as _O}from"path";import{fileURLToPath as KO}from"url";var H5="claude-mem",J5="3.6.10",T5="Memory compression system for Claude Code - persist context across sessions",Z5=H5,k5=J5,X5=T5;try{let q=KO(import.meta.url),_=_O(q),j=qO(_,"..","..","package.json");if(Qw(j)){let K=JSON.parse(sw(j,"utf-8"));Z5=K.name||H5,k5=K.version||J5,X5=K.description||T5}}catch{}var oq=Z5,A5=k5,G5=X5;k2();vK();import{readFileSync as JK,writeFileSync as h_,existsSync as R8,chmodSync as pG,mkdirSync as ZK,copyFileSync as u_,statSync as LG,readdirSync as lG}from"fs";import{join as V8,dirname as TK}from"path";import{homedir as v9,platform as zf}from"os";import{execSync as G_}from"child_process";import{fileURLToPath as vf}from"url";var fY=(q=0)=>(_)=>`\x1B[${_+q}m`,$Y=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,wY=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,l8={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]}},BV=Object.keys(l8.modifier),CA=Object.keys(l8.color),VA=Object.keys(l8.bgColor),tV=[...CA,...VA];function MA(){let q=new Map;for(let[_,j]of Object.entries(l8)){for(let[K,Y]of Object.entries(j))l8[K]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},j[K]=l8[K],q.set(Y[0],Y[1]);Object.defineProperty(l8,_,{value:j,enumerable:!1})}return Object.defineProperty(l8,"codes",{value:q,enumerable:!1}),l8.color.close="\x1B[39m",l8.bgColor.close="\x1B[49m",l8.color.ansi=fY(),l8.color.ansi256=$Y(),l8.color.ansi16m=wY(),l8.bgColor.ansi=fY(10),l8.bgColor.ansi256=$Y(10),l8.bgColor.ansi16m=wY(10),Object.defineProperties(l8,{rgbToAnsi256:{value(_,j,K){if(_===j&&j===K){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(j/255*5)+Math.round(K/255*5)},enumerable:!1},hexToRgb:{value(_){let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;if(K.length===3)K=[...K].map((f)=>f+f).join("");let Y=Number.parseInt(K,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(_)=>l8.rgbToAnsi256(...l8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value(_){if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,Y;if(_>=232)j=((_-232)*10+8)/255,K=j,Y=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,Y=$%6/5}let f=Math.max(j,K,Y)*2;if(f===0)return 30;let P=30+(Math.round(Y)<<2|Math.round(K)<<1|Math.round(j));if(f===2)P+=60;return P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>l8.ansi256ToAnsi(l8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>l8.ansi256ToAnsi(l8.hexToAnsi256(_)),enumerable:!1}}),l8}var NA=MA(),Wq=NA;import l2 from"node:process";import bA from"node:os";import OY from"node:tty";function s6(q,_=globalThis.Deno?globalThis.Deno.args:l2.argv){let j=q.startsWith("-")?"":q.length===1?"-":"--",K=_.indexOf(j+q),Y=_.indexOf("--");return K!==-1&&(Y===-1||K=2,has16m:q>=3}}function RA(q,{streamIsTTY:_,sniffFlags:j=!0}={}){let K=SA();if(K!==void 0)k7=K;let Y=j?k7:K;if(Y===0)return 0;if(j){if(s6("color=16m")||s6("color=full")||s6("color=truecolor"))return 3;if(s6("color=256"))return 2}if("TF_BUILD"in x8&&"AGENT_NAME"in x8)return 1;if(q&&!_&&Y===void 0)return 0;let f=Y||0;if(x8.TERM==="dumb")return f;if(l2.platform==="win32"){let P=bA.release().split(".");if(Number(P[0])>=10&&Number(P[2])>=10586)return Number(P[2])>=14931?3:2;return 1}if("CI"in x8){if(["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((P)=>(P in x8)))return 3;if(["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((P)=>(P in x8))||x8.CI_NAME==="codeship")return 1;return f}if("TEAMCITY_VERSION"in x8)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(x8.TEAMCITY_VERSION)?1:0;if(x8.COLORTERM==="truecolor")return 3;if(x8.TERM==="xterm-kitty")return 3;if(x8.TERM==="xterm-ghostty")return 3;if(x8.TERM==="wezterm")return 3;if("TERM_PROGRAM"in x8){let P=Number.parseInt((x8.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(x8.TERM_PROGRAM){case"iTerm.app":return P>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(x8.TERM))return 2;if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(x8.TERM))return 1;if("COLORTERM"in x8)return 1;return f}function zY(q,_={}){let j=RA(q,{streamIsTTY:q&&q.isTTY,..._});return EA(j)}var mA={stdout:zY({isTTY:OY.isatty(1)}),stderr:zY({isTTY:OY.isatty(2)})},vY=mA;function WY(q,_,j){let K=q.indexOf(_);if(K===-1)return q;let Y=_.length,f=0,P="";do P+=q.slice(f,K)+_+j,f=K+Y,K=q.indexOf(_,f);while(K!==-1);return P+=q.slice(f),P}function HY(q,_,j,K){let Y=0,f="";do{let P=q[K-1]==="\r";f+=q.slice(Y,P?K-1:K)+_+(P?`\r `:` `)+j,Y=K+1,K=q.indexOf(` -`,Y)}while(K!==-1);return f+=q.slice(Y),f}var{stdout:JY,stderr:TY}=vY,x2=Symbol("GENERATOR"),WK=Symbol("STYLER"),P3=Symbol("IS_EMPTY"),ZY=["ansi","ansi","ansi256","ansi16m"],HK=Object.create(null),mA=(q,_={})=>{if(_.level&&!(Number.isInteger(_.level)&&_.level>=0&&_.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let j=JY?JY.level:0;q.level=_.level===void 0?j:_.level};var IA=(q)=>{let _=(...j)=>j.join(" ");return mA(_,q),Object.setPrototypeOf(_,Y3.prototype),_};function Y3(q){return IA(q)}Object.setPrototypeOf(Y3.prototype,Function.prototype);for(let[q,_]of Object.entries(Wq))HK[q]={get(){let j=X7(this,c2(_.open,_.close,this[WK]),this[P3]);return Object.defineProperty(this,q,{value:j}),j}};HK.visible={get(){let q=X7(this,this[WK],!0);return Object.defineProperty(this,"visible",{value:q}),q}};var n2=(q,_,j,...K)=>{if(q==="rgb"){if(_==="ansi16m")return Wq[j].ansi16m(...K);if(_==="ansi256")return Wq[j].ansi256(Wq.rgbToAnsi256(...K));return Wq[j].ansi(Wq.rgbToAnsi(...K))}if(q==="hex")return n2("rgb",_,j,...Wq.hexToRgb(...K));return Wq[j][q](...K)},gA=["rgb","hex","ansi256"];for(let q of gA){HK[q]={get(){let{level:j}=this;return function(...K){let Y=c2(n2(q,ZY[j],"color",...K),Wq.color.close,this[WK]);return X7(this,Y,this[P3])}}};let _="bg"+q[0].toUpperCase()+q.slice(1);HK[_]={get(){let{level:j}=this;return function(...K){let Y=c2(n2(q,ZY[j],"bgColor",...K),Wq.bgColor.close,this[WK]);return X7(this,Y,this[P3])}}}}var yA=Object.defineProperties(()=>{},{...HK,level:{enumerable:!0,get(){return this[x2].level},set(q){this[x2].level=q}}}),c2=(q,_,j)=>{let K,Y;if(j===void 0)K=q,Y=_;else K=j.openAll+q,Y=_+j.closeAll;return{open:q,close:_,openAll:K,closeAll:Y,parent:j}},X7=(q,_,j)=>{let K=(...Y)=>dA(K,Y.length===1?""+Y[0]:Y.join(" "));return Object.setPrototypeOf(K,yA),K[x2]=q,K[WK]=_,K[P3]=j,K},dA=(q,_)=>{if(q.level<=0||!_)return q[P3]?"":_;let j=q[WK];if(j===void 0)return _;let{openAll:K,closeAll:Y}=j;if(_.includes("\x1B"))while(j!==void 0)_=WY(_,j.close,j.open),j=j.parent;let f=_.indexOf(` -`);if(f!==-1)_=HY(_,Y,K,f);return K+_+Y};Object.defineProperties(Y3.prototype,HK);var pA=Y3(),jM=Y3({level:TY?TY.level:0});var Q=pA;var t2=Pq(CY(),1),A6=(...q)=>{let _,j;if(q.length===0)throw new Error("Missing gradient colors");if(!Array.isArray(q[0])){if(q.length===1)throw new Error(`Expected an array of colors, received ${JSON.stringify(q[0])}`);_=t2.default(...q)}else _=t2.default(q[0]),j=e2(q[1]);let K=(Y,f)=>{return LA(Y?Y.toString():"",_,f??j)};return K.multiline=(Y,f)=>lA(Y?Y.toString():"",_,f??j),K},VY=(q,_,j)=>{return _.interpolation?.toLowerCase()==="hsv"?q.hsv(j,_.hsvSpin?.toLowerCase()||!1):q.rgb(j)};function LA(q,_,j){let K=e2(j),Y=Math.max(q.replace(/\s/g,"").length,_.stops.length),f=VY(_,K,Y),P="";for(let $ of q)P+=$.match(/\s/g)?$:Q.hex(f.shift()?.toHex()||"#000")($);return P}function lA(q,_,j){let K=e2(j),Y=q.split(` +`,Y)}while(K!==-1);return f+=q.slice(Y),f}var{stdout:JY,stderr:TY}=vY,x2=Symbol("GENERATOR"),WK=Symbol("STYLER"),P3=Symbol("IS_EMPTY"),ZY=["ansi","ansi","ansi256","ansi16m"],HK=Object.create(null),IA=(q,_={})=>{if(_.level&&!(Number.isInteger(_.level)&&_.level>=0&&_.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let j=JY?JY.level:0;q.level=_.level===void 0?j:_.level};var gA=(q)=>{let _=(...j)=>j.join(" ");return IA(_,q),Object.setPrototypeOf(_,Y3.prototype),_};function Y3(q){return gA(q)}Object.setPrototypeOf(Y3.prototype,Function.prototype);for(let[q,_]of Object.entries(Wq))HK[q]={get(){let j=X7(this,c2(_.open,_.close,this[WK]),this[P3]);return Object.defineProperty(this,q,{value:j}),j}};HK.visible={get(){let q=X7(this,this[WK],!0);return Object.defineProperty(this,"visible",{value:q}),q}};var n2=(q,_,j,...K)=>{if(q==="rgb"){if(_==="ansi16m")return Wq[j].ansi16m(...K);if(_==="ansi256")return Wq[j].ansi256(Wq.rgbToAnsi256(...K));return Wq[j].ansi(Wq.rgbToAnsi(...K))}if(q==="hex")return n2("rgb",_,j,...Wq.hexToRgb(...K));return Wq[j][q](...K)},yA=["rgb","hex","ansi256"];for(let q of yA){HK[q]={get(){let{level:j}=this;return function(...K){let Y=c2(n2(q,ZY[j],"color",...K),Wq.color.close,this[WK]);return X7(this,Y,this[P3])}}};let _="bg"+q[0].toUpperCase()+q.slice(1);HK[_]={get(){let{level:j}=this;return function(...K){let Y=c2(n2(q,ZY[j],"bgColor",...K),Wq.bgColor.close,this[WK]);return X7(this,Y,this[P3])}}}}var dA=Object.defineProperties(()=>{},{...HK,level:{enumerable:!0,get(){return this[x2].level},set(q){this[x2].level=q}}}),c2=(q,_,j)=>{let K,Y;if(j===void 0)K=q,Y=_;else K=j.openAll+q,Y=_+j.closeAll;return{open:q,close:_,openAll:K,closeAll:Y,parent:j}},X7=(q,_,j)=>{let K=(...Y)=>pA(K,Y.length===1?""+Y[0]:Y.join(" "));return Object.setPrototypeOf(K,dA),K[x2]=q,K[WK]=_,K[P3]=j,K},pA=(q,_)=>{if(q.level<=0||!_)return q[P3]?"":_;let j=q[WK];if(j===void 0)return _;let{openAll:K,closeAll:Y}=j;if(_.includes("\x1B"))while(j!==void 0)_=WY(_,j.close,j.open),j=j.parent;let f=_.indexOf(` +`);if(f!==-1)_=HY(_,Y,K,f);return K+_+Y};Object.defineProperties(Y3.prototype,HK);var LA=Y3(),PM=Y3({level:TY?TY.level:0});var Q=LA;var t2=Pq(CY(),1),A6=(...q)=>{let _,j;if(q.length===0)throw new Error("Missing gradient colors");if(!Array.isArray(q[0])){if(q.length===1)throw new Error(`Expected an array of colors, received ${JSON.stringify(q[0])}`);_=t2.default(...q)}else _=t2.default(q[0]),j=e2(q[1]);let K=(Y,f)=>{return lA(Y?Y.toString():"",_,f??j)};return K.multiline=(Y,f)=>xA(Y?Y.toString():"",_,f??j),K},VY=(q,_,j)=>{return _.interpolation?.toLowerCase()==="hsv"?q.hsv(j,_.hsvSpin?.toLowerCase()||!1):q.rgb(j)};function lA(q,_,j){let K=e2(j),Y=Math.max(q.replace(/\s/g,"").length,_.stops.length),f=VY(_,K,Y),P="";for(let $ of q)P+=$.match(/\s/g)?$:Q.hex(f.shift()?.toHex()||"#000")($);return P}function xA(q,_,j){let K=e2(j),Y=q.split(` `),f=Math.max(...Y.map((w)=>w.length),_.stops.length),P=VY(_,K,f),$=[];for(let w of Y){let O=P.slice(0),v="";for(let z of w)v+=Q.hex(O.shift()?.toHex()||"#000")(z);$.push(v)}return $.join(` -`)}function e2(q){let _={interpolation:"rgb",hsvSpin:"short",...q};if(q!==void 0&&typeof q!=="object")throw new TypeError(`Expected \`options\` to be an \`object\`, got \`${typeof q}\``);if(typeof _.interpolation!=="string")throw new TypeError(`Expected \`options.interpolation\` to be \`rgb\` or \`hsv\`, got \`${typeof _.interpolation}\``);if(_.interpolation.toLowerCase()==="hsv"&&typeof _.hsvSpin!=="string")throw new TypeError(`Expected \`options.hsvSpin\` to be a \`short\` or \`long\`, got \`${typeof _.hsvSpin}\``);return _}var x6={atlas:{colors:["#feac5e","#c779d0","#4bc0c8"],options:{}},cristal:{colors:["#bdfff3","#4ac29a"],options:{}},teen:{colors:["#77a1d3","#79cbca","#e684ae"],options:{}},mind:{colors:["#473b7b","#3584a7","#30d2be"],options:{}},morning:{colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},vice:{colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}},passion:{colors:["#f43b47","#453a94"],options:{}},fruit:{colors:["#ff4e50","#f9d423"],options:{}},instagram:{colors:["#833ab4","#fd1d1d","#fcb045"],options:{}},retro:{colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"],options:{}},summer:{colors:["#fdbb2d","#22c1c3"],options:{}},rainbow:{colors:["#ff0000","#ff0100"],options:{interpolation:"hsv",hsvSpin:"long"}},pastel:{colors:["#74ebd5","#74ecd5"],options:{interpolation:"hsv",hsvSpin:"long"}}};function n6(q){let _=(j)=>A6(...q.colors)(j,q.options);return _.multiline=(j="")=>A6(...q.colors).multiline(j,q.options),_}var F2=A6,xA=n6(x6.atlas),nA=n6(x6.cristal),cA=n6(x6.teen),rA=n6(x6.mind),iA=n6(x6.morning),oA=n6(x6.vice),aA=n6(x6.passion),BA=n6(x6.fruit),tA=n6(x6.instagram),eA=n6(x6.retro),FA=n6(x6.summer),UA=n6(x6.rainbow),sA=n6(x6.pastel);A6.atlas=xA;A6.cristal=nA;A6.teen=cA;A6.mind=rA;A6.morning=iA;A6.vice=oA;A6.passion=aA;A6.fruit=BA;A6.instagram=tA;A6.retro=eA;A6.summer=FA;A6.rainbow=UA;A6.pastel=sA;import C7 from"node:process";function U2({onlyFirst:q=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",q?void 0:"g")}var QA=U2();function s2(q){if(typeof q!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(QA,"")}function MY(q){return q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109}function NY(q){return q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510}function bY(q){return q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9776&&q<=9783||q>=9800&&q<=9811||q===9855||q>=9866&&q<=9871||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12773||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101631&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q>=119552&&q<=119638||q>=119648&&q<=119670||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129673||q>=129679&&q<=129734||q>=129742&&q<=129756||q>=129759&&q<=129769||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141}function qG(q){if(!Number.isSafeInteger(q))throw new TypeError(`Expected a code point, got \`${typeof q}\`.`)}function SY(q,{ambiguousAsWide:_=!1}={}){if(qG(q),NY(q)||bY(q)||_&&MY(q))return 2;return 1}var mY=Pq(RY(),1),_G=new Intl.Segmenter,KG=/^\p{Default_Ignorable_Code_Point}$/u;function V6(q,_={}){if(typeof q!=="string"||q.length===0)return 0;let{ambiguousIsNarrow:j=!0,countAnsiEscapeCodes:K=!1}=_;if(!K)q=s2(q);if(q.length===0)return 0;let Y=0,f={ambiguousAsWide:!j};for(let{segment:P}of _G.segment(q)){let $=P.codePointAt(0);if($<=31||$>=127&&$<=159)continue;if($>=8203&&$<=8207||$===65279)continue;if($>=768&&$<=879||$>=6832&&$<=6911||$>=7616&&$<=7679||$>=8400&&$<=8447||$>=65056&&$<=65071)continue;if($>=55296&&$<=57343)continue;if($>=65024&&$<=65039)continue;if(KG.test(P))continue;if(mY.default().test(P)){Y+=2;continue}Y+=SY($,f)}return Y}function G7(q){let _=0;for(let j of q.split(` -`))_=Math.max(_,V6(j));return _}var wf=Pq(q9(),1);var PG=/[\p{Lu}]/u,YG=/[\p{Ll}]/u,yY=/^[\p{Lu}](?![\p{Lu}])/gu,LY=/([\p{Alpha}\p{N}_]|$)/u,_9=/[_.\- ]+/,fG=new RegExp("^"+_9.source),dY=new RegExp(_9.source+LY.source,"gu"),pY=new RegExp("\\d+"+LY.source,"gu"),$G=(q,_,j,K)=>{let Y=!1,f=!1,P=!1,$=!1;for(let w=0;w2?q[w-3]==="-":!0,Y&&PG.test(O))q=q.slice(0,w)+"-"+q.slice(w),Y=!1,P=f,f=!0,w++;else if(f&&P&&YG.test(O)&&(!$||K))q=q.slice(0,w-1)+"-"+q.slice(w-1),P=f,f=!1,Y=!0;else Y=_(O)===O&&j(O)!==O,P=f,f=j(O)===O&&_(O)!==O}return q},wG=(q,_)=>{return yY.lastIndex=0,q.replaceAll(yY,(j)=>_(j))},OG=(q,_)=>{return dY.lastIndex=0,pY.lastIndex=0,q.replaceAll(pY,(j,K,Y)=>["_","-"].includes(q.charAt(Y+j.length))?j:_(j)).replaceAll(dY,(j,K)=>_(K))};function K9(q,_){if(!(typeof q==="string"||Array.isArray(q)))throw new TypeError("Expected the input to be `string | string[]`");if(_={pascalCase:!1,preserveConsecutiveUppercase:!1,..._},Array.isArray(q))q=q.map((f)=>f.trim()).filter((f)=>f.length).join("-");else q=q.trim();if(q.length===0)return"";let j=_.locale===!1?(f)=>f.toLowerCase():(f)=>f.toLocaleLowerCase(_.locale),K=_.locale===!1?(f)=>f.toUpperCase():(f)=>f.toLocaleUpperCase(_.locale);if(q.length===1){if(_9.test(q))return"";return _.pascalCase?K(q):j(q)}if(q!==j(q))q=$G(q,j,K,_.preserveConsecutiveUppercase);if(q=q.replace(fG,""),q=_.preserveConsecutiveUppercase?wG(q,j):j(q),_.pascalCase)q=K(q.charAt(0))+q.slice(1);return OG(q,K)}var O9=Pq(FY(),1);function Y9({onlyFirst:q=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",q?void 0:"g")}var kG=Y9();function f9(q){if(typeof q!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(kG,"")}var UY=(q=0)=>(_)=>`\x1B[${_+q}m`,sY=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,QY=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,n8={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]}},IM=Object.keys(n8.modifier),XG=Object.keys(n8.color),AG=Object.keys(n8.bgColor),gM=[...XG,...AG];function GG(){let q=new Map;for(let[_,j]of Object.entries(n8)){for(let[K,Y]of Object.entries(j))n8[K]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},j[K]=n8[K],q.set(Y[0],Y[1]);Object.defineProperty(n8,_,{value:j,enumerable:!1})}return Object.defineProperty(n8,"codes",{value:q,enumerable:!1}),n8.color.close="\x1B[39m",n8.bgColor.close="\x1B[49m",n8.color.ansi=UY(),n8.color.ansi256=sY(),n8.color.ansi16m=QY(),n8.bgColor.ansi=UY(10),n8.bgColor.ansi256=sY(10),n8.bgColor.ansi16m=QY(10),Object.defineProperties(n8,{rgbToAnsi256:{value:(_,j,K)=>{if(_===j&&j===K){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(j/255*5)+Math.round(K/255*5)},enumerable:!1},hexToRgb:{value:(_)=>{let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;if(K.length===3)K=[...K].map((f)=>f+f).join("");let Y=Number.parseInt(K,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(_)=>n8.rgbToAnsi256(...n8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value:(_)=>{if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,Y;if(_>=232)j=((_-232)*10+8)/255,K=j,Y=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,Y=$%6/5}let f=Math.max(j,K,Y)*2;if(f===0)return 30;let P=30+(Math.round(Y)<<2|Math.round(K)<<1|Math.round(j));if(f===2)P+=60;return P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>n8.ansi256ToAnsi(n8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>n8.ansi256ToAnsi(n8.hexToAnsi256(_)),enumerable:!1}}),n8}var uG=GG(),qf=uG;var h7=new Set(["\x1B","›"]),hG=39,w9="\x07",jf="[",DG="]",Pf="m",u7=`${DG}8;;`,_f=(q)=>`${h7.values().next().value}${jf}${q}${Pf}`,Kf=(q)=>`${h7.values().next().value}${u7}${q}${w9}`,CG=(q)=>q.split(" ").map((_)=>V6(_)),$9=(q,_,j)=>{let K=[..._],Y=!1,f=!1,P=V6(f9(q.at(-1)));for(let[$,w]of K.entries()){let O=V6(w);if(P+O<=j)q[q.length-1]+=w;else q.push(w),P=0;if(h7.has(w))Y=!0,f=K.slice($+1,$+1+u7.length).join("")===u7;if(Y){if(f){if(w===w9)Y=!1,f=!1}else if(w===Pf)Y=!1;continue}if(P+=O,P===j&&$0&&q.length>1)q[q.length-2]+=q.pop()},VG=(q)=>{let _=q.split(" "),j=_.length;while(j>0){if(V6(_[j-1])>0)break;j--}if(j===_.length)return q;return _.slice(0,j).join(" ")+_.slice(j).join("")},MG=(q,_,j={})=>{if(j.trim!==!1&&q.trim()==="")return"";let K="",Y,f,P=CG(q),$=[""];for(let[z,W]of q.split(" ").entries()){if(j.trim!==!1)$[$.length-1]=$.at(-1).trimStart();let J=V6($.at(-1));if(z!==0){if(J>=_&&(j.wordWrap===!1||j.trim===!1))$.push(""),J=0;if(J>0||j.trim===!1)$[$.length-1]+=" ",J++}if(j.hard&&P[z]>_){let T=_-J,H=1+Math.floor((P[z]-T-1)/_);if(Math.floor((P[z]-1)/_)_&&J>0&&P[z]>0){if(j.wordWrap===!1&&J<_){$9($,W,_);continue}$.push("")}if(J+P[z]>_&&j.wordWrap===!1){$9($,W,_);continue}$[$.length-1]+=W}if(j.trim!==!1)$=$.map((z)=>VG(z));let w=$.join(` -`),O=[...w],v=0;for(let[z,W]of O.entries()){if(K+=W,h7.has(W)){let{groups:T}=new RegExp(`(?:\\${jf}(?\\d+)m|\\${u7}(?.*)${w9})`).exec(w.slice(v))||{groups:{}};if(T.code!==void 0){let H=Number.parseFloat(T.code);Y=H===hG?void 0:H}else if(T.uri!==void 0)f=T.uri.length===0?void 0:T.uri}let J=qf.codes.get(Number(Y));if(O[z+1]===` +`)}function e2(q){let _={interpolation:"rgb",hsvSpin:"short",...q};if(q!==void 0&&typeof q!=="object")throw new TypeError(`Expected \`options\` to be an \`object\`, got \`${typeof q}\``);if(typeof _.interpolation!=="string")throw new TypeError(`Expected \`options.interpolation\` to be \`rgb\` or \`hsv\`, got \`${typeof _.interpolation}\``);if(_.interpolation.toLowerCase()==="hsv"&&typeof _.hsvSpin!=="string")throw new TypeError(`Expected \`options.hsvSpin\` to be a \`short\` or \`long\`, got \`${typeof _.hsvSpin}\``);return _}var x6={atlas:{colors:["#feac5e","#c779d0","#4bc0c8"],options:{}},cristal:{colors:["#bdfff3","#4ac29a"],options:{}},teen:{colors:["#77a1d3","#79cbca","#e684ae"],options:{}},mind:{colors:["#473b7b","#3584a7","#30d2be"],options:{}},morning:{colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},vice:{colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}},passion:{colors:["#f43b47","#453a94"],options:{}},fruit:{colors:["#ff4e50","#f9d423"],options:{}},instagram:{colors:["#833ab4","#fd1d1d","#fcb045"],options:{}},retro:{colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"],options:{}},summer:{colors:["#fdbb2d","#22c1c3"],options:{}},rainbow:{colors:["#ff0000","#ff0100"],options:{interpolation:"hsv",hsvSpin:"long"}},pastel:{colors:["#74ebd5","#74ecd5"],options:{interpolation:"hsv",hsvSpin:"long"}}};function n6(q){let _=(j)=>A6(...q.colors)(j,q.options);return _.multiline=(j="")=>A6(...q.colors).multiline(j,q.options),_}var F2=A6,nA=n6(x6.atlas),cA=n6(x6.cristal),rA=n6(x6.teen),iA=n6(x6.mind),oA=n6(x6.morning),aA=n6(x6.vice),BA=n6(x6.passion),tA=n6(x6.fruit),eA=n6(x6.instagram),FA=n6(x6.retro),UA=n6(x6.summer),sA=n6(x6.rainbow),QA=n6(x6.pastel);A6.atlas=nA;A6.cristal=cA;A6.teen=rA;A6.mind=iA;A6.morning=oA;A6.vice=aA;A6.passion=BA;A6.fruit=tA;A6.instagram=eA;A6.retro=FA;A6.summer=UA;A6.rainbow=sA;A6.pastel=QA;import C7 from"node:process";function U2({onlyFirst:q=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",q?void 0:"g")}var qG=U2();function s2(q){if(typeof q!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(qG,"")}function MY(q){return q===161||q===164||q===167||q===168||q===170||q===173||q===174||q>=176&&q<=180||q>=182&&q<=186||q>=188&&q<=191||q===198||q===208||q===215||q===216||q>=222&&q<=225||q===230||q>=232&&q<=234||q===236||q===237||q===240||q===242||q===243||q>=247&&q<=250||q===252||q===254||q===257||q===273||q===275||q===283||q===294||q===295||q===299||q>=305&&q<=307||q===312||q>=319&&q<=322||q===324||q>=328&&q<=331||q===333||q===338||q===339||q===358||q===359||q===363||q===462||q===464||q===466||q===468||q===470||q===472||q===474||q===476||q===593||q===609||q===708||q===711||q>=713&&q<=715||q===717||q===720||q>=728&&q<=731||q===733||q===735||q>=768&&q<=879||q>=913&&q<=929||q>=931&&q<=937||q>=945&&q<=961||q>=963&&q<=969||q===1025||q>=1040&&q<=1103||q===1105||q===8208||q>=8211&&q<=8214||q===8216||q===8217||q===8220||q===8221||q>=8224&&q<=8226||q>=8228&&q<=8231||q===8240||q===8242||q===8243||q===8245||q===8251||q===8254||q===8308||q===8319||q>=8321&&q<=8324||q===8364||q===8451||q===8453||q===8457||q===8467||q===8470||q===8481||q===8482||q===8486||q===8491||q===8531||q===8532||q>=8539&&q<=8542||q>=8544&&q<=8555||q>=8560&&q<=8569||q===8585||q>=8592&&q<=8601||q===8632||q===8633||q===8658||q===8660||q===8679||q===8704||q===8706||q===8707||q===8711||q===8712||q===8715||q===8719||q===8721||q===8725||q===8730||q>=8733&&q<=8736||q===8739||q===8741||q>=8743&&q<=8748||q===8750||q>=8756&&q<=8759||q===8764||q===8765||q===8776||q===8780||q===8786||q===8800||q===8801||q>=8804&&q<=8807||q===8810||q===8811||q===8814||q===8815||q===8834||q===8835||q===8838||q===8839||q===8853||q===8857||q===8869||q===8895||q===8978||q>=9312&&q<=9449||q>=9451&&q<=9547||q>=9552&&q<=9587||q>=9600&&q<=9615||q>=9618&&q<=9621||q===9632||q===9633||q>=9635&&q<=9641||q===9650||q===9651||q===9654||q===9655||q===9660||q===9661||q===9664||q===9665||q>=9670&&q<=9672||q===9675||q>=9678&&q<=9681||q>=9698&&q<=9701||q===9711||q===9733||q===9734||q===9737||q===9742||q===9743||q===9756||q===9758||q===9792||q===9794||q===9824||q===9825||q>=9827&&q<=9829||q>=9831&&q<=9834||q===9836||q===9837||q===9839||q===9886||q===9887||q===9919||q>=9926&&q<=9933||q>=9935&&q<=9939||q>=9941&&q<=9953||q===9955||q===9960||q===9961||q>=9963&&q<=9969||q===9972||q>=9974&&q<=9977||q===9979||q===9980||q===9982||q===9983||q===10045||q>=10102&&q<=10111||q>=11094&&q<=11097||q>=12872&&q<=12879||q>=57344&&q<=63743||q>=65024&&q<=65039||q===65533||q>=127232&&q<=127242||q>=127248&&q<=127277||q>=127280&&q<=127337||q>=127344&&q<=127373||q===127375||q===127376||q>=127387&&q<=127404||q>=917760&&q<=917999||q>=983040&&q<=1048573||q>=1048576&&q<=1114109}function NY(q){return q===12288||q>=65281&&q<=65376||q>=65504&&q<=65510}function bY(q){return q>=4352&&q<=4447||q===8986||q===8987||q===9001||q===9002||q>=9193&&q<=9196||q===9200||q===9203||q===9725||q===9726||q===9748||q===9749||q>=9776&&q<=9783||q>=9800&&q<=9811||q===9855||q>=9866&&q<=9871||q===9875||q===9889||q===9898||q===9899||q===9917||q===9918||q===9924||q===9925||q===9934||q===9940||q===9962||q===9970||q===9971||q===9973||q===9978||q===9981||q===9989||q===9994||q===9995||q===10024||q===10060||q===10062||q>=10067&&q<=10069||q===10071||q>=10133&&q<=10135||q===10160||q===10175||q===11035||q===11036||q===11088||q===11093||q>=11904&&q<=11929||q>=11931&&q<=12019||q>=12032&&q<=12245||q>=12272&&q<=12287||q>=12289&&q<=12350||q>=12353&&q<=12438||q>=12441&&q<=12543||q>=12549&&q<=12591||q>=12593&&q<=12686||q>=12688&&q<=12773||q>=12783&&q<=12830||q>=12832&&q<=12871||q>=12880&&q<=42124||q>=42128&&q<=42182||q>=43360&&q<=43388||q>=44032&&q<=55203||q>=63744&&q<=64255||q>=65040&&q<=65049||q>=65072&&q<=65106||q>=65108&&q<=65126||q>=65128&&q<=65131||q>=94176&&q<=94180||q===94192||q===94193||q>=94208&&q<=100343||q>=100352&&q<=101589||q>=101631&&q<=101640||q>=110576&&q<=110579||q>=110581&&q<=110587||q===110589||q===110590||q>=110592&&q<=110882||q===110898||q>=110928&&q<=110930||q===110933||q>=110948&&q<=110951||q>=110960&&q<=111355||q>=119552&&q<=119638||q>=119648&&q<=119670||q===126980||q===127183||q===127374||q>=127377&&q<=127386||q>=127488&&q<=127490||q>=127504&&q<=127547||q>=127552&&q<=127560||q===127568||q===127569||q>=127584&&q<=127589||q>=127744&&q<=127776||q>=127789&&q<=127797||q>=127799&&q<=127868||q>=127870&&q<=127891||q>=127904&&q<=127946||q>=127951&&q<=127955||q>=127968&&q<=127984||q===127988||q>=127992&&q<=128062||q===128064||q>=128066&&q<=128252||q>=128255&&q<=128317||q>=128331&&q<=128334||q>=128336&&q<=128359||q===128378||q===128405||q===128406||q===128420||q>=128507&&q<=128591||q>=128640&&q<=128709||q===128716||q>=128720&&q<=128722||q>=128725&&q<=128727||q>=128732&&q<=128735||q===128747||q===128748||q>=128756&&q<=128764||q>=128992&&q<=129003||q===129008||q>=129292&&q<=129338||q>=129340&&q<=129349||q>=129351&&q<=129535||q>=129648&&q<=129660||q>=129664&&q<=129673||q>=129679&&q<=129734||q>=129742&&q<=129756||q>=129759&&q<=129769||q>=129776&&q<=129784||q>=131072&&q<=196605||q>=196608&&q<=262141}function _G(q){if(!Number.isSafeInteger(q))throw new TypeError(`Expected a code point, got \`${typeof q}\`.`)}function SY(q,{ambiguousAsWide:_=!1}={}){if(_G(q),NY(q)||bY(q)||_&&MY(q))return 2;return 1}var mY=Pq(RY(),1),KG=new Intl.Segmenter,jG=/^\p{Default_Ignorable_Code_Point}$/u;function V6(q,_={}){if(typeof q!=="string"||q.length===0)return 0;let{ambiguousIsNarrow:j=!0,countAnsiEscapeCodes:K=!1}=_;if(!K)q=s2(q);if(q.length===0)return 0;let Y=0,f={ambiguousAsWide:!j};for(let{segment:P}of KG.segment(q)){let $=P.codePointAt(0);if($<=31||$>=127&&$<=159)continue;if($>=8203&&$<=8207||$===65279)continue;if($>=768&&$<=879||$>=6832&&$<=6911||$>=7616&&$<=7679||$>=8400&&$<=8447||$>=65056&&$<=65071)continue;if($>=55296&&$<=57343)continue;if($>=65024&&$<=65039)continue;if(jG.test(P))continue;if(mY.default().test(P)){Y+=2;continue}Y+=SY($,f)}return Y}function G7(q){let _=0;for(let j of q.split(` +`))_=Math.max(_,V6(j));return _}var wf=Pq(q9(),1);var YG=/[\p{Lu}]/u,fG=/[\p{Ll}]/u,yY=/^[\p{Lu}](?![\p{Lu}])/gu,LY=/([\p{Alpha}\p{N}_]|$)/u,_9=/[_.\- ]+/,$G=new RegExp("^"+_9.source),dY=new RegExp(_9.source+LY.source,"gu"),pY=new RegExp("\\d+"+LY.source,"gu"),wG=(q,_,j,K)=>{let Y=!1,f=!1,P=!1,$=!1;for(let w=0;w2?q[w-3]==="-":!0,Y&&YG.test(O))q=q.slice(0,w)+"-"+q.slice(w),Y=!1,P=f,f=!0,w++;else if(f&&P&&fG.test(O)&&(!$||K))q=q.slice(0,w-1)+"-"+q.slice(w-1),P=f,f=!1,Y=!0;else Y=_(O)===O&&j(O)!==O,P=f,f=j(O)===O&&_(O)!==O}return q},OG=(q,_)=>{return yY.lastIndex=0,q.replaceAll(yY,(j)=>_(j))},zG=(q,_)=>{return dY.lastIndex=0,pY.lastIndex=0,q.replaceAll(pY,(j,K,Y)=>["_","-"].includes(q.charAt(Y+j.length))?j:_(j)).replaceAll(dY,(j,K)=>_(K))};function K9(q,_){if(!(typeof q==="string"||Array.isArray(q)))throw new TypeError("Expected the input to be `string | string[]`");if(_={pascalCase:!1,preserveConsecutiveUppercase:!1,..._},Array.isArray(q))q=q.map((f)=>f.trim()).filter((f)=>f.length).join("-");else q=q.trim();if(q.length===0)return"";let j=_.locale===!1?(f)=>f.toLowerCase():(f)=>f.toLocaleLowerCase(_.locale),K=_.locale===!1?(f)=>f.toUpperCase():(f)=>f.toLocaleUpperCase(_.locale);if(q.length===1){if(_9.test(q))return"";return _.pascalCase?K(q):j(q)}if(q!==j(q))q=wG(q,j,K,_.preserveConsecutiveUppercase);if(q=q.replace($G,""),q=_.preserveConsecutiveUppercase?OG(q,j):j(q),_.pascalCase)q=K(q.charAt(0))+q.slice(1);return zG(q,K)}var O9=Pq(FY(),1);function Y9({onlyFirst:q=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",q?void 0:"g")}var XG=Y9();function f9(q){if(typeof q!=="string")throw new TypeError(`Expected a \`string\`, got \`${typeof q}\``);return q.replace(XG,"")}var UY=(q=0)=>(_)=>`\x1B[${_+q}m`,sY=(q=0)=>(_)=>`\x1B[${38+q};5;${_}m`,QY=(q=0)=>(_,j,K)=>`\x1B[${38+q};2;${_};${j};${K}m`,n8={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]}},gM=Object.keys(n8.modifier),AG=Object.keys(n8.color),GG=Object.keys(n8.bgColor),yM=[...AG,...GG];function uG(){let q=new Map;for(let[_,j]of Object.entries(n8)){for(let[K,Y]of Object.entries(j))n8[K]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},j[K]=n8[K],q.set(Y[0],Y[1]);Object.defineProperty(n8,_,{value:j,enumerable:!1})}return Object.defineProperty(n8,"codes",{value:q,enumerable:!1}),n8.color.close="\x1B[39m",n8.bgColor.close="\x1B[49m",n8.color.ansi=UY(),n8.color.ansi256=sY(),n8.color.ansi16m=QY(),n8.bgColor.ansi=UY(10),n8.bgColor.ansi256=sY(10),n8.bgColor.ansi16m=QY(10),Object.defineProperties(n8,{rgbToAnsi256:{value:(_,j,K)=>{if(_===j&&j===K){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(j/255*5)+Math.round(K/255*5)},enumerable:!1},hexToRgb:{value:(_)=>{let j=/[a-f\d]{6}|[a-f\d]{3}/i.exec(_.toString(16));if(!j)return[0,0,0];let[K]=j;if(K.length===3)K=[...K].map((f)=>f+f).join("");let Y=Number.parseInt(K,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(_)=>n8.rgbToAnsi256(...n8.hexToRgb(_)),enumerable:!1},ansi256ToAnsi:{value:(_)=>{if(_<8)return 30+_;if(_<16)return 90+(_-8);let j,K,Y;if(_>=232)j=((_-232)*10+8)/255,K=j,Y=j;else{_-=16;let $=_%36;j=Math.floor(_/36)/5,K=Math.floor($/6)/5,Y=$%6/5}let f=Math.max(j,K,Y)*2;if(f===0)return 30;let P=30+(Math.round(Y)<<2|Math.round(K)<<1|Math.round(j));if(f===2)P+=60;return P},enumerable:!1},rgbToAnsi:{value:(_,j,K)=>n8.ansi256ToAnsi(n8.rgbToAnsi256(_,j,K)),enumerable:!1},hexToAnsi:{value:(_)=>n8.ansi256ToAnsi(n8.hexToAnsi256(_)),enumerable:!1}}),n8}var hG=uG(),qf=hG;var h7=new Set(["\x1B","›"]),DG=39,w9="\x07",jf="[",CG="]",Pf="m",u7=`${CG}8;;`,_f=(q)=>`${h7.values().next().value}${jf}${q}${Pf}`,Kf=(q)=>`${h7.values().next().value}${u7}${q}${w9}`,VG=(q)=>q.split(" ").map((_)=>V6(_)),$9=(q,_,j)=>{let K=[..._],Y=!1,f=!1,P=V6(f9(q.at(-1)));for(let[$,w]of K.entries()){let O=V6(w);if(P+O<=j)q[q.length-1]+=w;else q.push(w),P=0;if(h7.has(w))Y=!0,f=K.slice($+1,$+1+u7.length).join("")===u7;if(Y){if(f){if(w===w9)Y=!1,f=!1}else if(w===Pf)Y=!1;continue}if(P+=O,P===j&&$0&&q.length>1)q[q.length-2]+=q.pop()},MG=(q)=>{let _=q.split(" "),j=_.length;while(j>0){if(V6(_[j-1])>0)break;j--}if(j===_.length)return q;return _.slice(0,j).join(" ")+_.slice(j).join("")},NG=(q,_,j={})=>{if(j.trim!==!1&&q.trim()==="")return"";let K="",Y,f,P=VG(q),$=[""];for(let[z,W]of q.split(" ").entries()){if(j.trim!==!1)$[$.length-1]=$.at(-1).trimStart();let J=V6($.at(-1));if(z!==0){if(J>=_&&(j.wordWrap===!1||j.trim===!1))$.push(""),J=0;if(J>0||j.trim===!1)$[$.length-1]+=" ",J++}if(j.hard&&P[z]>_){let T=_-J,H=1+Math.floor((P[z]-T-1)/_);if(Math.floor((P[z]-1)/_)_&&J>0&&P[z]>0){if(j.wordWrap===!1&&J<_){$9($,W,_);continue}$.push("")}if(J+P[z]>_&&j.wordWrap===!1){$9($,W,_);continue}$[$.length-1]+=W}if(j.trim!==!1)$=$.map((z)=>MG(z));let w=$.join(` +`),O=[...w],v=0;for(let[z,W]of O.entries()){if(K+=W,h7.has(W)){let{groups:T}=new RegExp(`(?:\\${jf}(?\\d+)m|\\${u7}(?.*)${w9})`).exec(w.slice(v))||{groups:{}};if(T.code!==void 0){let H=Number.parseFloat(T.code);Y=H===DG?void 0:H}else if(T.uri!==void 0)f=T.uri.length===0?void 0:T.uri}let J=qf.codes.get(Number(Y));if(O[z+1]===` `){if(f)K+=Kf("");if(Y&&J)K+=_f(J)}else if(W===` `){if(Y&&J)K+=_f(Y);if(f)K+=Kf(f)}v+=W.length}return K};function D7(q,_,j){return String(q).normalize().replaceAll(`\r `,` `).split(` -`).map((K)=>MG(K,_,j)).join(` -`)}var yG=Pq(q9(),1),q_=` -`,c6=" ",$3="none",Of=()=>{let{env:q,stdout:_,stderr:j}=C7;if(_?.columns)return _.columns;if(j?.columns)return j.columns;if(q.COLUMNS)return Number.parseInt(q.COLUMNS,10);return 80},Yf=(q)=>typeof q==="number"?{top:q,right:q*3,bottom:q,left:q*3}:{top:0,right:0,bottom:0,left:0,...q},w3=(q)=>q===$3?0:2,NG=(q)=>{let _=["topLeft","topRight","bottomRight","bottomLeft","left","right","top","bottom"],j;if(q===$3){q={};for(let K of _)q[K]=""}if(typeof q==="string"){if(j=wf.default[q],!j)throw new TypeError(`Invalid border style: ${q}`)}else{if(typeof q?.vertical==="string")q.left=q.vertical,q.right=q.vertical;if(typeof q?.horizontal==="string")q.top=q.horizontal,q.bottom=q.horizontal;for(let K of _)if(q[K]===null||typeof q[K]!=="string")throw new TypeError(`Invalid border style: ${K}`);j=q}return j},bG=(q,_,j)=>{let K="",Y=V6(q);switch(j){case"left":{K=q+_.slice(Y);break}case"right":{K=_.slice(Y)+q;break}default:{if(_=_.slice(Y),_.length%2===1)_=_.slice(Math.floor(_.length/2)),K=_.slice(1)+q+_;else _=_.slice(_.length/2),K=_+q+_;break}}return K},SG=(q,{padding:_,width:j,textAlignment:K,height:Y})=>{q=O9.default(q,{align:K});let f=q.split(q_),P=G7(q),$=j-_.left-_.right;if(P>$){let v=[];for(let z of f){let W=D7(z,$,{hard:!0}),T=O9.default(W,{align:K}).split(` -`),H=Math.max(...T.map((X)=>V6(X)));for(let X of T){let A;switch(K){case"center":{A=c6.repeat(($-H)/2)+X;break}case"right":{A=c6.repeat($-H)+X;break}default:{A=X;break}}v.push(A)}}f=v}if(K==="center"&&P<$)f=f.map((v)=>c6.repeat(($-P)/2)+v);else if(K==="right"&&P<$)f=f.map((v)=>c6.repeat($-P)+v);let w=c6.repeat(_.left),O=c6.repeat(_.right);if(f=f.map((v)=>{let z=w+v+O;return z+c6.repeat(j-V6(z))}),_.top>0)f=[...Array.from({length:_.top}).fill(c6.repeat(j)),...f];if(_.bottom>0)f=[...f,...Array.from({length:_.bottom}).fill(c6.repeat(j))];if(Y&&f.length>Y)f=f.slice(0,Y);else if(Y&&f.length{let K=(v)=>{let z=j.borderColor?IG(j.borderColor)(v):v;return j.dimBorder?Q.dim(z):z},Y=(v)=>j.backgroundColor?gG(j.backgroundColor)(v):v,f=NG(j.borderStyle),P=Of(),$=c6.repeat(j.margin.left);if(j.float==="center"){let v=Math.max((P-_-w3(j.borderStyle))/2,0);$=c6.repeat(v)}else if(j.float==="right"){let v=Math.max(P-_-j.margin.right-w3(j.borderStyle),0);$=c6.repeat(v)}let w="";if(j.margin.top)w+=q_.repeat(j.margin.top);if(j.borderStyle!==$3||j.title)w+=K($+f.topLeft+(j.title?bG(j.title,f.top.repeat(_),j.titleAlignment):f.top.repeat(_))+f.topRight)+q_;let O=q.split(q_);if(w+=O.map((v)=>$+K(f.left)+Y(v)+K(f.right)).join(q_),j.borderStyle!==$3)w+=q_+K($+f.bottomLeft+f.bottom.repeat(_)+f.bottomRight);if(j.margin.bottom)w+=q_.repeat(j.margin.bottom);return w},RG=(q)=>{if(q.fullscreen&&C7?.stdout){let _=[C7.stdout.columns,C7.stdout.rows];if(typeof q.fullscreen==="function")_=q.fullscreen(..._);q.width||=_[0],q.height||=_[1]}return q.width&&=Math.max(1,q.width-w3(q.borderStyle)),q.height&&=Math.max(1,q.height-w3(q.borderStyle)),q},ff=(q,_)=>_===$3?q:` ${q} `,mG=(q,_)=>{_=RG(_);let j=_.width!==void 0,K=Of(),Y=w3(_.borderStyle),f=K-_.margin.left-_.margin.right-Y,P=G7(D7(q,K-Y,{hard:!0,trim:!1}))+_.padding.left+_.padding.right;if(_.title&&j)_.title=_.title.slice(0,Math.max(0,_.width-2)),_.title&&=ff(_.title,_.borderStyle);else if(_.title){if(_.title=_.title.slice(0,Math.max(0,f-2)),_.title){if(_.title=ff(_.title,_.borderStyle),V6(_.title)>P)_.width=V6(_.title)}}if(_.width||=P,!j){if(_.margin.left&&_.margin.right&&_.width>f){let w=(K-_.width-Y)/(_.margin.left+_.margin.right);_.margin.left=Math.max(0,Math.floor(_.margin.left*w)),_.margin.right=Math.max(0,Math.floor(_.margin.right*w))}_.width=Math.min(_.width,K-Y-_.margin.left-_.margin.right)}if(_.width-(_.padding.left+_.padding.right)<=0)_.padding.left=0,_.padding.right=0;if(_.height&&_.height-(_.padding.top+_.padding.bottom)<=0)_.padding.top=0,_.padding.bottom=0;return _},z9=(q)=>q.match(/^#(?:[0-f]{3}){1,2}$/i),$f=(q)=>typeof q==="string"&&(Q[q]??z9(q)),IG=(q)=>z9(q)?Q.hex(q):Q[q],gG=(q)=>z9(q)?Q.bgHex(q):Q[K9(["bg",q])];function __(q,_){if(_={padding:0,borderStyle:"single",dimBorder:!1,textAlignment:"left",float:"left",titleAlignment:"left",..._},_.align)_.textAlignment=_.align;if(_.borderColor&&!$f(_.borderColor))throw new Error(`${_.borderColor} is not a valid borderColor`);if(_.backgroundColor&&!$f(_.backgroundColor))throw new Error(`${_.backgroundColor} is not a valid backgroundColor`);return _.padding=Yf(_.padding),_.margin=Yf(_.margin),_=mG(q,_),q=SG(q,_),EG(q,_.width,_)}d6();function W9(q){let _,j=0,K=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];return{start(){_=setInterval(()=>{process.stdout.write(`\r${Q.cyan(K[j%K.length])} ${q}`),j++},50)},stop(Y,f=!0){clearInterval(_);let P=f?Q.green("✓"):Q.red("✗");process.stdout.write(`\r${P} ${Y} -`)}}}var H6=(q)=>new Promise((_)=>setTimeout(_,q)),O3=F2(["#ff0000","#ff4500","#ffa500","#ffff00","#00ff00","#00ffff","#0000ff","#8b00ff"]),V7=F2(["#ff006e","#fb5607","#ffbe0b","#8338ec","#3a86ff"]);async function lG(){let q=[{name:"Node.js version",check:async()=>{let j=process.versions.node,[K]=j.split(".").map(Number);return{success:K>=18,message:K>=18?"":`Node.js ${j} is below required version 18.0.0`}}},{name:"Claude Code CLI",check:async()=>{try{let j=zf()==="win32"?"where claude":"which claude";return G_(j,{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!1,message:"Claude Code CLI not found. Please install: https://docs.anthropic.com/claude/docs/claude-code"}}}},{name:"uv (Python package manager)",check:async()=>{try{return G_("which uv",{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!0,message:"",needsInstall:!0}}}},{name:"Write permissions",check:async()=>{let j=V8($8.getDataDirectory(),"test-permissions");try{return ZK(j,{recursive:!0}),h_(V8(j,"test"),"test"),G_(`rm -rf ${j}`,{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!1,message:"No write permissions to claude-mem data directory"}}}}],_=!1;for(let{name:j,check:K}of q){let Y=await K();if(!Y.success)return console.log(__(Q.red(`❌ ${j} check failed! +`).map((K)=>NG(K,_,j)).join(` +`)}var dG=Pq(q9(),1),q_=` +`,c6=" ",$3="none",Of=()=>{let{env:q,stdout:_,stderr:j}=C7;if(_?.columns)return _.columns;if(j?.columns)return j.columns;if(q.COLUMNS)return Number.parseInt(q.COLUMNS,10);return 80},Yf=(q)=>typeof q==="number"?{top:q,right:q*3,bottom:q,left:q*3}:{top:0,right:0,bottom:0,left:0,...q},w3=(q)=>q===$3?0:2,bG=(q)=>{let _=["topLeft","topRight","bottomRight","bottomLeft","left","right","top","bottom"],j;if(q===$3){q={};for(let K of _)q[K]=""}if(typeof q==="string"){if(j=wf.default[q],!j)throw new TypeError(`Invalid border style: ${q}`)}else{if(typeof q?.vertical==="string")q.left=q.vertical,q.right=q.vertical;if(typeof q?.horizontal==="string")q.top=q.horizontal,q.bottom=q.horizontal;for(let K of _)if(q[K]===null||typeof q[K]!=="string")throw new TypeError(`Invalid border style: ${K}`);j=q}return j},SG=(q,_,j)=>{let K="",Y=V6(q);switch(j){case"left":{K=q+_.slice(Y);break}case"right":{K=_.slice(Y)+q;break}default:{if(_=_.slice(Y),_.length%2===1)_=_.slice(Math.floor(_.length/2)),K=_.slice(1)+q+_;else _=_.slice(_.length/2),K=_+q+_;break}}return K},EG=(q,{padding:_,width:j,textAlignment:K,height:Y})=>{q=O9.default(q,{align:K});let f=q.split(q_),P=G7(q),$=j-_.left-_.right;if(P>$){let v=[];for(let z of f){let W=D7(z,$,{hard:!0}),T=O9.default(W,{align:K}).split(` +`),H=Math.max(...T.map((X)=>V6(X)));for(let X of T){let A;switch(K){case"center":{A=c6.repeat(($-H)/2)+X;break}case"right":{A=c6.repeat($-H)+X;break}default:{A=X;break}}v.push(A)}}f=v}if(K==="center"&&P<$)f=f.map((v)=>c6.repeat(($-P)/2)+v);else if(K==="right"&&P<$)f=f.map((v)=>c6.repeat($-P)+v);let w=c6.repeat(_.left),O=c6.repeat(_.right);if(f=f.map((v)=>{let z=w+v+O;return z+c6.repeat(j-V6(z))}),_.top>0)f=[...Array.from({length:_.top}).fill(c6.repeat(j)),...f];if(_.bottom>0)f=[...f,...Array.from({length:_.bottom}).fill(c6.repeat(j))];if(Y&&f.length>Y)f=f.slice(0,Y);else if(Y&&f.length{let K=(v)=>{let z=j.borderColor?gG(j.borderColor)(v):v;return j.dimBorder?Q.dim(z):z},Y=(v)=>j.backgroundColor?yG(j.backgroundColor)(v):v,f=bG(j.borderStyle),P=Of(),$=c6.repeat(j.margin.left);if(j.float==="center"){let v=Math.max((P-_-w3(j.borderStyle))/2,0);$=c6.repeat(v)}else if(j.float==="right"){let v=Math.max(P-_-j.margin.right-w3(j.borderStyle),0);$=c6.repeat(v)}let w="";if(j.margin.top)w+=q_.repeat(j.margin.top);if(j.borderStyle!==$3||j.title)w+=K($+f.topLeft+(j.title?SG(j.title,f.top.repeat(_),j.titleAlignment):f.top.repeat(_))+f.topRight)+q_;let O=q.split(q_);if(w+=O.map((v)=>$+K(f.left)+Y(v)+K(f.right)).join(q_),j.borderStyle!==$3)w+=q_+K($+f.bottomLeft+f.bottom.repeat(_)+f.bottomRight);if(j.margin.bottom)w+=q_.repeat(j.margin.bottom);return w},mG=(q)=>{if(q.fullscreen&&C7?.stdout){let _=[C7.stdout.columns,C7.stdout.rows];if(typeof q.fullscreen==="function")_=q.fullscreen(..._);q.width||=_[0],q.height||=_[1]}return q.width&&=Math.max(1,q.width-w3(q.borderStyle)),q.height&&=Math.max(1,q.height-w3(q.borderStyle)),q},ff=(q,_)=>_===$3?q:` ${q} `,IG=(q,_)=>{_=mG(_);let j=_.width!==void 0,K=Of(),Y=w3(_.borderStyle),f=K-_.margin.left-_.margin.right-Y,P=G7(D7(q,K-Y,{hard:!0,trim:!1}))+_.padding.left+_.padding.right;if(_.title&&j)_.title=_.title.slice(0,Math.max(0,_.width-2)),_.title&&=ff(_.title,_.borderStyle);else if(_.title){if(_.title=_.title.slice(0,Math.max(0,f-2)),_.title){if(_.title=ff(_.title,_.borderStyle),V6(_.title)>P)_.width=V6(_.title)}}if(_.width||=P,!j){if(_.margin.left&&_.margin.right&&_.width>f){let w=(K-_.width-Y)/(_.margin.left+_.margin.right);_.margin.left=Math.max(0,Math.floor(_.margin.left*w)),_.margin.right=Math.max(0,Math.floor(_.margin.right*w))}_.width=Math.min(_.width,K-Y-_.margin.left-_.margin.right)}if(_.width-(_.padding.left+_.padding.right)<=0)_.padding.left=0,_.padding.right=0;if(_.height&&_.height-(_.padding.top+_.padding.bottom)<=0)_.padding.top=0,_.padding.bottom=0;return _},z9=(q)=>q.match(/^#(?:[0-f]{3}){1,2}$/i),$f=(q)=>typeof q==="string"&&(Q[q]??z9(q)),gG=(q)=>z9(q)?Q.hex(q):Q[q],yG=(q)=>z9(q)?Q.bgHex(q):Q[K9(["bg",q])];function __(q,_){if(_={padding:0,borderStyle:"single",dimBorder:!1,textAlignment:"left",float:"left",titleAlignment:"left",..._},_.align)_.textAlignment=_.align;if(_.borderColor&&!$f(_.borderColor))throw new Error(`${_.borderColor} is not a valid borderColor`);if(_.backgroundColor&&!$f(_.backgroundColor))throw new Error(`${_.backgroundColor} is not a valid backgroundColor`);return _.padding=Yf(_.padding),_.margin=Yf(_.margin),_=IG(q,_),q=EG(q,_),RG(q,_.width,_)}d6();function W9(q){let _,j=0,K=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];return{start(){_=setInterval(()=>{process.stdout.write(`\r${Q.cyan(K[j%K.length])} ${q}`),j++},50)},stop(Y,f=!0){clearInterval(_);let P=f?Q.green("✓"):Q.red("✗");process.stdout.write(`\r${P} ${Y} +`)}}}var H6=(q)=>new Promise((_)=>setTimeout(_,q)),O3=F2(["#ff0000","#ff4500","#ffa500","#ffff00","#00ff00","#00ffff","#0000ff","#8b00ff"]),V7=F2(["#ff006e","#fb5607","#ffbe0b","#8338ec","#3a86ff"]);async function xG(){let q=[{name:"Node.js version",check:async()=>{let j=process.versions.node,[K]=j.split(".").map(Number);return{success:K>=18,message:K>=18?"":`Node.js ${j} is below required version 18.0.0`}}},{name:"Claude Code CLI",check:async()=>{try{let j=zf()==="win32"?"where claude":"which claude";return G_(j,{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!1,message:"Claude Code CLI not found. Please install: https://docs.anthropic.com/claude/docs/claude-code"}}}},{name:"uv (Python package manager)",check:async()=>{try{return G_("which uv",{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!0,message:"",needsInstall:!0}}}},{name:"Write permissions",check:async()=>{let j=V8($8.getDataDirectory(),"test-permissions");try{return ZK(j,{recursive:!0}),h_(V8(j,"test"),"test"),G_(`rm -rf ${j}`,{stdio:"ignore"}),{success:!0,message:""}}catch{return{success:!1,message:"No write permissions to claude-mem data directory"}}}}],_=!1;for(let{name:j,check:K}of q){let Y=await K();if(!Y.success)return console.log(__(Q.red(`❌ ${j} check failed! ${Y.message}`),{padding:1,margin:1,borderStyle:"double",borderColor:"red"})),!1;if(Y.needsInstall&&j==="uv (Python package manager)")_=!0}if(_){let j=W9("Installing uv (Python package manager)...");j.start();try{G_("curl -LsSf https://astral.sh/uv/install.sh | sh",{stdio:"pipe",shell:"/bin/sh"}),process.env.PATH=`${v9()}/.cargo/bin:${process.env.PATH}`,j.stop("uv installed successfully",!0)}catch(K){return j.stop("Failed to install uv automatically",!1),console.log(__(Q.yellow(`⚠️ Please install uv manually: ${Q.cyan("curl -LsSf https://astral.sh/uv/install.sh | sh")} -Or visit: ${Q.cyan("https://docs.astral.sh/uv/getting-started/installation/")}`),{padding:1,margin:1,borderStyle:"round",borderColor:"yellow"})),!1}}return!0}function xG(){try{let q=zf()==="win32"?"where claude":"which claude";return G_(q,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||null}catch{return null}}function nG(){let q={hasHooks:!1,hasChromaMcp:!1,hasSettings:!1,scope:void 0},_=$8.getHooksDirectory();q.hasHooks=R8(_)&&R8(V8(_,"pre-compact.js"))&&R8(V8(_,"session-start.js"));let j=$8.getInstance(),K=j.getMcpConfigPath(),Y=j.getProjectMcpConfigPath();if(R8(K))try{if(JSON.parse(JK(K,"utf8")).mcpServers?.["claude-mem"])q.hasChromaMcp=!0,q.scope="user"}catch{}if(R8(Y))try{if(JSON.parse(JK(Y,"utf8")).mcpServers?.["claude-mem"])q.hasChromaMcp=!0,q.scope="project"}catch{}let f=j.getUserSettingsPath();return q.hasSettings=R8(f),q}async function cG(q){let _={};if(q.hasHooks||q.hasChromaMcp){let f=await hq({message:`\uD83E\uDDE0 Existing claude-mem installation detected. Your memories and data are safe! +Or visit: ${Q.cyan("https://docs.astral.sh/uv/getting-started/installation/")}`),{padding:1,margin:1,borderStyle:"round",borderColor:"yellow"})),!1}}return!0}function nG(){try{let q=zf()==="win32"?"where claude":"which claude";return G_(q,{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim()||null}catch{return null}}function cG(){let q={hasHooks:!1,hasChromaMcp:!1,hasSettings:!1,scope:void 0},_=$8.getHooksDirectory();q.hasHooks=R8(_)&&R8(V8(_,"pre-compact.js"))&&R8(V8(_,"session-start.js"));let j=$8.getInstance(),K=j.getMcpConfigPath(),Y=j.getProjectMcpConfigPath();if(R8(K))try{if(JSON.parse(JK(K,"utf8")).mcpServers?.["claude-mem"])q.hasChromaMcp=!0,q.scope="user"}catch{}if(R8(Y))try{if(JSON.parse(JK(Y,"utf8")).mcpServers?.["claude-mem"])q.hasChromaMcp=!0,q.scope="project"}catch{}let f=j.getUserSettingsPath();return q.hasSettings=R8(f),q}async function rG(q){let _={};if(q.hasHooks||q.hasChromaMcp){let f=await hq({message:`\uD83E\uDDE0 Existing claude-mem installation detected. Your memories and data are safe! Reinstall to update hooks and configuration?`,initialValue:!0});if(L8(f))return $6("Installation cancelled"),null;if(!f)return $6("Installation cancelled"),null;_.forceReinstall=!0}else _.forceReinstall=!1;let j=await xq({message:"Select installation scope",options:[{value:"user",label:"User (Recommended)",hint:"Install for current user (~/.claude)"},{value:"project",label:"Project",hint:"Install for current project only (./.mcp.json)"},{value:"local",label:"Local",hint:"Custom local installation"}],initialValue:q.scope||"user"});if(L8(j))return $6("Installation cancelled"),null;if(_.scope=j,j==="local"){let f=await K3({message:"Enter custom installation directory",placeholder:V8(process.cwd(),".claude-mem"),validate:(P)=>{if(!P)return"Path is required";if(!P.startsWith("/")&&!P.startsWith("~"))return"Please provide an absolute path"}});if(L8(f))return $6("Installation cancelled"),null;_.customPath=f}_.hookTimeout=180000;let K=await hq({message:'Enable Smart Trash? This creates an alias for "rm" that moves files to ~/.claude-mem/trash instead of permanently deleting them. You can restore files anytime by typing "claude-mem restore".',initialValue:!0});if(L8(K))return $6("Installation cancelled"),null;_.enableSmartTrash=K;let Y=await hq({message:`claude-mem is designed to save "memories" when you type /compact. The official compact summary + claude-mem produces the best ongoing results, but sometimes you may want to completely clear the context and still retain the "memories" from your last conversation. -Would you like to save memories when you type "/clear" in Claude Code? When running /clear with this on, it takes about a minute to save memories before your new session starts.`,initialValue:!1});if(L8(Y))return $6("Installation cancelled"),null;return _.saveMemoriesOnClear=Y,_}async function rG(){let q=$8.getInstance(),_=V8(q.getBackupsDirectory(),new Date().toISOString().replace(/[:.]/g,"-"));try{ZK(_,{recursive:!0});let j=q.getHooksDirectory();if(R8(j))H9(j,V8(_,"hooks"));let K=q.getUserSettingsPath();if(R8(K))u_(K,V8(_,"settings.json"));let Y=q.getClaudeSettingsPath();if(R8(Y))u_(Y,V8(_,"claude-settings.json"));return _}catch(j){return null}}function iG(){let q=$8.getInstance();q.ensureAllDataDirectories(),q.ensureAllClaudeDirectories();let _=V8(q.getDataDirectory(),"package.json");if(!R8(_))h_(_,JSON.stringify({name:"claude-mem-data",type:"module"},null,2))}function H9(q,_){if(pG(q).isDirectory()){if(!R8(_))ZK(_,{recursive:!0});LG(q).forEach((Y)=>{H9(V8(q,Y),V8(_,Y))})}else u_(q,_)}function oG(q=180000){let _=$8.getInstance(),j=_.getHooksDirectory(),K=vf(import.meta.url),f=TK(K),P=null;for(let W=0;W<10;W++){let J=V8(f,"hooks");if(R8(V8(J,"pre-compact.js"))){P=J;break}let T=TK(f);if(T===f)break;f=T}if(!P)try{P=_.findPackageHooksDirectory()}catch(W){throw new Error("Cannot dynamically locate hooks directory. The package may be corrupted.")}let $=["pre-compact.js","session-start.js","session-end.js"];for(let W of $){let J=V8(P,W),T=V8(j,W);if(R8(J))u_(J,T),dG(T,493)}let w=V8(P,"shared"),O=V8(j,"shared");if(R8(w))H9(w,O);let v=V8(j,"config.json");h_(v,JSON.stringify({packageName:oq,cliCommand:oq,backend:"chroma",timeout:q},null,2))}function aG(){let _=$8.getInstance().getClaudeMdPath(),j=TK(_);if(!R8(j))ZK(j,{recursive:!0});let K=` +Would you like to save memories when you type "/clear" in Claude Code? When running /clear with this on, it takes about a minute to save memories before your new session starts.`,initialValue:!1});if(L8(Y))return $6("Installation cancelled"),null;return _.saveMemoriesOnClear=Y,_}async function iG(){let q=$8.getInstance(),_=V8(q.getBackupsDirectory(),new Date().toISOString().replace(/[:.]/g,"-"));try{ZK(_,{recursive:!0});let j=q.getHooksDirectory();if(R8(j))H9(j,V8(_,"hooks"));let K=q.getUserSettingsPath();if(R8(K))u_(K,V8(_,"settings.json"));let Y=q.getClaudeSettingsPath();if(R8(Y))u_(Y,V8(_,"claude-settings.json"));return _}catch(j){return null}}function oG(){let q=$8.getInstance();q.ensureAllDataDirectories(),q.ensureAllClaudeDirectories();let _=V8(q.getDataDirectory(),"package.json");if(!R8(_))h_(_,JSON.stringify({name:"claude-mem-data",type:"module"},null,2))}function H9(q,_){if(LG(q).isDirectory()){if(!R8(_))ZK(_,{recursive:!0});lG(q).forEach((Y)=>{H9(V8(q,Y),V8(_,Y))})}else u_(q,_)}function aG(q=180000){let _=$8.getInstance(),j=_.getHooksDirectory(),K=vf(import.meta.url),f=TK(K),P=null;for(let W=0;W<10;W++){let J=V8(f,"hooks");if(R8(V8(J,"pre-compact.js"))){P=J;break}let T=TK(f);if(T===f)break;f=T}if(!P)try{P=_.findPackageHooksDirectory()}catch(W){throw new Error("Cannot dynamically locate hooks directory. The package may be corrupted.")}let $=["pre-compact.js","session-start.js","session-end.js"];for(let W of $){let J=V8(P,W),T=V8(j,W);if(R8(J))u_(J,T),pG(T,493)}let w=V8(P,"shared"),O=V8(j,"shared");if(R8(w))H9(w,O);let v=V8(j,"config.json");h_(v,JSON.stringify({packageName:oq,cliCommand:oq,backend:"chroma",timeout:q},null,2))}function BG(){let _=$8.getInstance().getClaudeMdPath(),j=TK(_);if(!R8(j))ZK(j,{recursive:!0});let K=` ## \uD83E\uDDE0 Memory System Quick Reference @@ -311,24 +311,24 @@ Would you like to save memories when you type "/clear" in Claude Code? When runn - Collection: "claude_memories" - Archives: ~/.claude-mem/archives/ `,Y="";if(R8(_)){Y=JK(_,"utf8");let f=Y.includes(""),P=Y.includes("");if(f||P){let $,w;if(f)$="",w="";else $="",w="";let O=Y.indexOf($),v=Y.indexOf(w)+w.length;if(O!==-1&&v!==-1)Y=Y.substring(0,O)+K.trim()+Y.substring(v)}else Y=Y.trim()+` -`+K}else Y=K.trim();h_(_,Y)}async function BG(){let q=W9("Installing Chroma MCP server...");q.start();try{await H6(400);try{G_("claude mcp remove claude-mem",{stdio:"pipe"}),await H6(200)}catch{}let _=`${v9()}/.cargo/bin`;if(R8(_)&&!process.env.PATH?.includes(_))process.env.PATH=`${_}:${process.env.PATH}`;let j=`claude mcp add claude-mem -- uvx chroma-mcp --client-type persistent --data-dir ${$8.getInstance().getChromaDirectory()}`;return G_(j,{stdio:"pipe",env:process.env}),await H6(300),q.stop(V7("Chroma MCP server installed successfully! \uD83D\uDE80"),!0),!0}catch(_){return q.stop("Chroma MCP server installation failed",!1),console.log(__(Q.yellow(`⚠️ Manual installation required: +`+K}else Y=K.trim();h_(_,Y)}async function tG(){let q=W9("Installing Chroma MCP server...");q.start();try{await H6(400);try{G_("claude mcp remove claude-mem",{stdio:"pipe"}),await H6(200)}catch{}let _=`${v9()}/.cargo/bin`;if(R8(_)&&!process.env.PATH?.includes(_))process.env.PATH=`${_}:${process.env.PATH}`;let j=`claude mcp add claude-mem -- uvx chroma-mcp --client-type persistent --data-dir ${$8.getInstance().getChromaDirectory()}`;return G_(j,{stdio:"pipe",env:process.env}),await H6(300),q.stop(V7("Chroma MCP server installed successfully! \uD83D\uDE80"),!0),!0}catch(_){return q.stop("Chroma MCP server installation failed",!1),console.log(__(Q.yellow(`⚠️ Manual installation required: ${Q.cyan(`claude mcp add claude-mem -- uvx chroma-mcp --client-type persistent --data-dir ${$8.getInstance().getChromaDirectory()}`)} -Make sure uv is installed: ${Q.cyan("https://docs.astral.sh/uv/getting-started/installation/")}`),{padding:1,margin:1,borderStyle:"round",borderColor:"yellow"})),!1}}async function tG(q,_){let K=$8.getInstance().getHooksDirectory(),Y=V8(K,"pre-compact.js"),f=V8(K,"session-start.js"),P=V8(K,"session-end.js"),$={};if(R8(q)){let O=JK(q,"utf8");$=JSON.parse(O)}let w=TK(q);if(!R8(w))ZK(w,{recursive:!0});if(!$.hooks)$.hooks={};if($.hooks.PreCompact){if($.hooks.PreCompact=$.hooks.PreCompact.filter((O)=>!O.hooks?.some((v)=>v.command?.includes(oq)||v.command?.includes("pre-compact.js"))),!$.hooks.PreCompact.length)delete $.hooks.PreCompact}if($.hooks.SessionStart){if($.hooks.SessionStart=$.hooks.SessionStart.filter((O)=>!O.hooks?.some((v)=>v.command?.includes(oq)||v.command?.includes("session-start.js"))),!$.hooks.SessionStart.length)delete $.hooks.SessionStart}if($.hooks.SessionEnd){if($.hooks.SessionEnd=$.hooks.SessionEnd.filter((O)=>!O.hooks?.some((v)=>v.command?.includes(oq)||v.command?.includes("session-end.js"))),!$.hooks.SessionEnd.length)delete $.hooks.SessionEnd}if(!$.hooks.PreCompact)$.hooks.PreCompact=[];if($.hooks.PreCompact.push({hooks:[{type:"command",command:Y,timeout:180}]}),!$.hooks.SessionStart)$.hooks.SessionStart=[];if($.hooks.SessionStart.push({hooks:[{type:"command",command:f,timeout:180}]}),R8(P)){if(!$.hooks.SessionEnd)$.hooks.SessionEnd=[];$.hooks.SessionEnd.push({hooks:[{type:"command",command:P,timeout:180}]})}h_(q,JSON.stringify($,null,2))}async function eG(){let q=v9(),_=[V8(q,".bashrc"),V8(q,".zshrc"),V8(q,".bash_profile")],j='alias rm="claude-mem trash"',K="# claude-mem smart trash alias";for(let Y of _){if(!R8(Y))continue;try{let f=JK(Y,"utf8");if(f.includes('alias rm="claude-mem trash"'))continue;f+=` +Make sure uv is installed: ${Q.cyan("https://docs.astral.sh/uv/getting-started/installation/")}`),{padding:1,margin:1,borderStyle:"round",borderColor:"yellow"})),!1}}async function eG(q,_){let K=$8.getInstance().getHooksDirectory(),Y=V8(K,"pre-compact.js"),f=V8(K,"session-start.js"),P=V8(K,"session-end.js"),$={};if(R8(q)){let O=JK(q,"utf8");$=JSON.parse(O)}let w=TK(q);if(!R8(w))ZK(w,{recursive:!0});if(!$.hooks)$.hooks={};if($.hooks.PreCompact){if($.hooks.PreCompact=$.hooks.PreCompact.filter((O)=>!O.hooks?.some((v)=>v.command?.includes(oq)||v.command?.includes("pre-compact.js"))),!$.hooks.PreCompact.length)delete $.hooks.PreCompact}if($.hooks.SessionStart){if($.hooks.SessionStart=$.hooks.SessionStart.filter((O)=>!O.hooks?.some((v)=>v.command?.includes(oq)||v.command?.includes("session-start.js"))),!$.hooks.SessionStart.length)delete $.hooks.SessionStart}if($.hooks.SessionEnd){if($.hooks.SessionEnd=$.hooks.SessionEnd.filter((O)=>!O.hooks?.some((v)=>v.command?.includes(oq)||v.command?.includes("session-end.js"))),!$.hooks.SessionEnd.length)delete $.hooks.SessionEnd}if(!$.hooks.PreCompact)$.hooks.PreCompact=[];if($.hooks.PreCompact.push({hooks:[{type:"command",command:Y,timeout:180}]}),!$.hooks.SessionStart)$.hooks.SessionStart=[];if($.hooks.SessionStart.push({hooks:[{type:"command",command:f,timeout:180}]}),R8(P)){if(!$.hooks.SessionEnd)$.hooks.SessionEnd=[];$.hooks.SessionEnd.push({hooks:[{type:"command",command:P,timeout:180}]})}h_(q,JSON.stringify($,null,2))}async function FG(){let q=v9(),_=[V8(q,".bashrc"),V8(q,".zshrc"),V8(q,".bash_profile")],j='alias rm="claude-mem trash"',K="# claude-mem smart trash alias";for(let Y of _){if(!R8(Y))continue;try{let f=JK(Y,"utf8");if(f.includes('alias rm="claude-mem trash"'))continue;f+=` # claude-mem smart trash alias alias rm="claude-mem trash" -`,h_(Y,f)}catch(f){}}}function FG(q){let j=new Date().toISOString().replace(/T/,"-").replace(/:/g,"").replace(/\..+/,"").replace(/-/g,""),K=`${j.slice(0,8)}-${j.slice(8)}`;return`${q}.backup.${K}`}function UG(q=!1){let _=$8.getInstance(),j=_.getClaudeCommandsDirectory(),K=vf(import.meta.url),f=TK(K),P=null;for(let z=0;z<10;z++){let W=V8(f,"commands");if(R8(V8(W,"save.md"))){P=W;break}let J=TK(f);if(J===f)break;f=J}if(!P)try{P=_.findPackageCommandsDirectory()}catch(z){throw new Error("Cannot dynamically locate commands directory. The package may be corrupted.")}if(!R8(j))ZK(j,{recursive:!0});let $=["save.md","remember.md","claude-mem.md"],w=[],O=[],v=[];for(let z of $){let W=V8(P,z),J=V8(j,z);if(R8(W))if(R8(J))if(q){let T=FG(J);u_(J,T),u_(W,J),v.push(z)}else O.push(z);else u_(W,J),w.push(z)}if(w.length>0)console.log(` ${Q.green("✓")} Copied commands: ${w.join(", ")}`);if(v.length>0)console.log(` ${Q.blue("\uD83D\uDCE6")} Backed up and replaced commands: ${v.join(", ")}`);if(O.length>0)console.log(` ${Q.yellow("→")} Skipped existing commands: ${O.join(", ")}`)}async function sG(){let q=Qq();q.start("Verifying installation");let _=[],K=$8.getInstance().getHooksDirectory();if(!R8(V8(K,"pre-compact.js")))_.push("Pre-compact hook not found");if(!R8(V8(K,"session-start.js")))_.push("Session-start hook not found");if(_.length>0)q.stop("Installation verification completed with issues"),j6.warn("The following issues were detected:"),_.forEach((Y)=>j6.error(` - ${Y}`)),j6.info("The installation may not work correctly. Consider reinstalling with --force flag.");else q.stop("Installation verified successfully")}async function Wf(q={}){console.log(O3(` +`,h_(Y,f)}catch(f){}}}function UG(q){let j=new Date().toISOString().replace(/T/,"-").replace(/:/g,"").replace(/\..+/,"").replace(/-/g,""),K=`${j.slice(0,8)}-${j.slice(8)}`;return`${q}.backup.${K}`}function sG(q=!1){let _=$8.getInstance(),j=_.getClaudeCommandsDirectory(),K=vf(import.meta.url),f=TK(K),P=null;for(let z=0;z<10;z++){let W=V8(f,"commands");if(R8(V8(W,"save.md"))){P=W;break}let J=TK(f);if(J===f)break;f=J}if(!P)try{P=_.findPackageCommandsDirectory()}catch(z){throw new Error("Cannot dynamically locate commands directory. The package may be corrupted.")}if(!R8(j))ZK(j,{recursive:!0});let $=["save.md","remember.md","claude-mem.md"],w=[],O=[],v=[];for(let z of $){let W=V8(P,z),J=V8(j,z);if(R8(W))if(R8(J))if(q){let T=UG(J);u_(J,T),u_(W,J),v.push(z)}else O.push(z);else u_(W,J),w.push(z)}if(w.length>0)console.log(` ${Q.green("✓")} Copied commands: ${w.join(", ")}`);if(v.length>0)console.log(` ${Q.blue("\uD83D\uDCE6")} Backed up and replaced commands: ${v.join(", ")}`);if(O.length>0)console.log(` ${Q.yellow("→")} Skipped existing commands: ${O.join(", ")}`)}async function QG(){let q=Qq();q.start("Verifying installation");let _=[],K=$8.getInstance().getHooksDirectory();if(!R8(V8(K,"pre-compact.js")))_.push("Pre-compact hook not found");if(!R8(V8(K,"session-start.js")))_.push("Session-start hook not found");if(_.length>0)q.stop("Installation verification completed with issues"),j6.warn("The following issues were detected:"),_.forEach((Y)=>j6.error(` - ${Y}`)),j6.info("The installation may not work correctly. Consider reinstalling with --force flag.");else q.stop("Installation verified successfully")}async function Wf(q={}){console.log(O3(` ═══════════════════════════════════════`)),console.log(O3(" CLAUDE-MEM INSTALLER ")),console.log(O3("═══════════════════════════════════════")),console.log(__(V7(`\uD83E\uDDE0 Persistent Memory System for Claude Code ✨ Transform your Claude experience with seamless context preservation -\uD83D\uDE80 Never lose your conversation history again`),{padding:2,margin:1,borderStyle:"double",borderColor:"magenta",textAlignment:"center"})),await H6(500);let _=q.user||q.project||q.local||q.force,j;if(_)j={scope:q.local?"local":q.project?"project":"user",customPath:q.path,hookTimeout:q.timeout?parseInt(q.timeout):180,forceReinstall:!!q.force};else{if(!await lG())nq("Please fix the prerequisites issues and try again"),process.exit(1);let v=nG(),z=await cG(v);if(!z)process.exit(0);j=z}if(j.forceReinstall){let O=await rG();if(O)j6.info(`Backup created at: ${O}`)}console.log(V7(` +\uD83D\uDE80 Never lose your conversation history again`),{padding:2,margin:1,borderStyle:"double",borderColor:"magenta",textAlignment:"center"})),await H6(500);let _=q.user||q.project||q.local||q.force,j;if(_)j={scope:q.local?"local":q.project?"project":"user",customPath:q.path,hookTimeout:q.timeout?parseInt(q.timeout):180,forceReinstall:!!q.force};else{if(!await xG())nq("Please fix the prerequisites issues and try again"),process.exit(1);let v=cG(),z=await rG(v);if(!z)process.exit(0);j=z}if(j.forceReinstall){let O=await iG();if(O)j6.info(`Backup created at: ${O}`)}console.log(V7(` \uD83D\uDE80 Beginning Installation Process -`));let K=[{name:"Creating directory structure",action:async()=>{await H6(200),iG(),await H6(100)}},{name:"Installing Chroma MCP server",action:async()=>{if(!await BG())throw new Error("MCP installation failed")}},{name:"Adding CLAUDE.md instructions",action:async()=>{await H6(300),aG(),await H6(200)}},{name:"Installing Claude commands",action:async()=>{await H6(200),UG(j.forceReinstall),await H6(100)}},{name:"Installing memory hooks",action:async()=>{await H6(400),oG(j.hookTimeout),await H6(200)}},{name:"Configuring Claude settings",action:async()=>{await H6(300);let O;if(j.scope==="local"&&j.customPath)O=V8(j.customPath,"settings.local.json");else if(j.scope==="project")O=V8(process.cwd(),".claude","settings.json");else O=$8.getInstance().getClaudeSettingsPath();await tG(O,j);let z=$8.getInstance().getUserSettingsPath(),W={};if(R8(z))try{W=JSON.parse(JK(z,"utf8"))}catch{}W.backend="chroma",W.installed=!0,W.embedded=!0,W.saveMemoriesOnClear=j.saveMemoriesOnClear||!1;let J=xG();if(J)W.claudePath=J;else delete W.claudePath;h_(z,JSON.stringify(W,null,2)),await H6(200)}}];if(j.enableSmartTrash)K.push({name:"Configuring Smart Trash alias",action:async()=>{await H6(200),await eG(),await H6(100)}});for(let O=0;O{await H6(200),oG(),await H6(100)}},{name:"Installing Chroma MCP server",action:async()=>{if(!await tG())throw new Error("MCP installation failed")}},{name:"Adding CLAUDE.md instructions",action:async()=>{await H6(300),BG(),await H6(200)}},{name:"Installing Claude commands",action:async()=>{await H6(200),sG(j.forceReinstall),await H6(100)}},{name:"Installing memory hooks",action:async()=>{await H6(400),aG(j.hookTimeout),await H6(200)}},{name:"Configuring Claude settings",action:async()=>{await H6(300);let O;if(j.scope==="local"&&j.customPath)O=V8(j.customPath,"settings.local.json");else if(j.scope==="project")O=V8(process.cwd(),".claude","settings.json");else O=$8.getInstance().getClaudeSettingsPath();await eG(O,j);let z=$8.getInstance().getUserSettingsPath(),W={};if(R8(z))try{W=JSON.parse(JK(z,"utf8"))}catch{}W.backend="chroma",W.installed=!0,W.embedded=!0,W.saveMemoriesOnClear=j.saveMemoriesOnClear||!1;let J=nG();if(J)W.claudePath=J;else delete W.claudePath;h_(z,JSON.stringify(W,null,2)),await H6(200)}}];if(j.enableSmartTrash)K.push({name:"Configuring Smart Trash alias",action:async()=>{await H6(200),await FG(),await H6(100)}});for(let O=0;O!J.hooks?.some((T)=>T.command===Y||T.command?.includes("pre-compact.js")||T.command?.includes("claude-mem")));if(W.length!==v.hooks.PreCompact.length)v.hooks.PreCompact=W.length?W:void 0,z=!0,console.log(`✅ Removed PreCompact hook from ${w.name} settings`)}if(v.hooks.SessionStart){let W=v.hooks.SessionStart.filter((J)=>!J.hooks?.some((T)=>T.command===f||T.command?.includes("session-start.js")||T.command?.includes("claude-mem")));if(W.length!==v.hooks.SessionStart.length)v.hooks.SessionStart=W.length?W:void 0,z=!0,console.log(`✅ Removed SessionStart hook from ${w.name} settings`)}if(v.hooks.SessionEnd){let W=v.hooks.SessionEnd.filter((J)=>!J.hooks?.some((T)=>T.command===P||T.command?.includes("session-end.js")||T.command?.includes("claude-mem")));if(W.length!==v.hooks.SessionEnd.length)v.hooks.SessionEnd=W.length?W:void 0,z=!0,console.log(`✅ Removed SessionEnd hook from ${w.name} settings`)}if(v.hooks.PreCompact===void 0)delete v.hooks.PreCompact;if(v.hooks.SessionStart===void 0)delete v.hooks.SessionStart;if(v.hooks.SessionEnd===void 0)delete v.hooks.SessionEnd;if(!Object.keys(v.hooks).length)delete v.hooks;if(z){let W=w.path+".backup."+Date.now();Hf(W,O),console.log(`\uD83D\uDCCB Created backup: ${W}`),Hf(w.path,JSON.stringify(v,null,2)),$++,console.log(`✅ Updated ${w.name} settings: ${w.path}`)}else console.log(`ℹ️ No Claude Memory System hooks found in ${w.name} settings`)}catch(O){console.log(`⚠️ Could not process ${w.name} settings: ${O.message}`)}}if(console.log(""),$>0)console.log("✨ Uninstallation complete!"),console.log("The Claude Memory System hooks have been removed from your settings."),console.log(""),console.log("Note: Your compressed transcripts and archives are preserved."),console.log("To reinstall: claude-mem install");else console.log("ℹ️ No Claude Memory System hooks were found to remove.")}d6();import{readFileSync as J9,existsSync as v3,readdirSync as _u,statSync as Ku}from"fs";import{join as D_,dirname as ju}from"path";import{execSync as Pu}from"child_process";import{fileURLToPath as Yu}from"url";var T0=ju(Yu(import.meta.url));async function Tf(){console.log("\uD83D\uDD0D Claude Memory System Status Check"),console.log(`===================================== -`),console.log("\uD83D\uDCC2 Installed Hook Scripts:");let q=$8.getInstance(),_=q.getHooksDirectory(),j=D_(_,"pre-compact.js"),K=D_(_,"session-start.js"),Y=D_(_,"session-end.js"),f=(J,T)=>{if(v3(J))console.log(` ✅ ${T}: Found at ${J}`);else console.log(` ❌ ${T}: Not found at ${J}`)};f(j,"pre-compact.js"),f(K,"session-start.js"),f(Y,"session-end.js"),console.log(""),console.log("⚙️ Settings Configuration:");let P=(J,T)=>{if(!v3(T)){console.log(` ⏭️ ${J}: No settings file`);return}console.log(` \uD83D\uDCCB ${J}: ${T}`);try{let H=JSON.parse(J9(T,"utf8")),X=H.hooks?.PreCompact?.some((D)=>D.hooks?.some((M)=>M.command?.includes("pre-compact.js")||M.command?.includes("claude-mem"))),A=H.hooks?.SessionStart?.some((D)=>D.hooks?.some((M)=>M.command?.includes("session-start.js")||M.command?.includes("claude-mem"))),G=H.hooks?.SessionEnd?.some((D)=>D.hooks?.some((M)=>M.command?.includes("session-end.js")||M.command?.includes("claude-mem")));console.log(` PreCompact: ${X?"✅":"❌"}`),console.log(` SessionStart: ${A?"✅":"❌"}`),console.log(` SessionEnd: ${G?"✅":"❌"}`)}catch(H){console.log(" ⚠️ Could not parse settings")}};P("Global",q.getClaudeSettingsPath()),P("Project",D_(process.cwd(),".claude","settings.json")),console.log(""),console.log("\uD83D\uDCE6 Compressed Transcripts:");let $=D_(q.getClaudeConfigDirectory(),"projects");if(v3($))try{let J=0,T=0,H=(X,A=0)=>{if(A>3)return;let G=_u(X);for(let D of G){let M=D_(X,D);if(Ku(M).isDirectory()&&!D.startsWith("."))H(M,A+1);else if(D.endsWith(".jsonl.compressed"))J++;else if(D.endsWith(".jsonl.archive"))T++}};H($),console.log(` Compressed files: ${J}`),console.log(` Archive files: ${T}`)}catch(J){console.log(" ⚠️ Could not scan projects directory")}else console.log(" ℹ️ No Claude projects directory found");console.log(""),console.log("\uD83D\uDD27 Runtime Environment:");let w=(J,T)=>{try{let H=Pu(`${J} --version`,{encoding:"utf8"}).trim();console.log(` ✅ ${T}: ${H}`)}catch{console.log(` ❌ ${T}: Not found`)}};w("node","Node.js"),w("bun","Bun"),console.log(""),console.log("\uD83E\uDDE0 Chroma Storage Status:"),console.log(" ✅ Storage backend: Chroma MCP"),console.log(` \uD83D\uDCCD Data location: ${q.getChromaDirectory()}`),console.log(" \uD83D\uDD0D Features: Vector search, semantic similarity, document storage"),console.log(""),console.log("\uD83D\uDCCA Summary:");let O=q.getClaudeSettingsPath(),v=D_(process.cwd(),".claude","settings.json"),z=!1,W="Not installed";try{if(v3(O)){let J=JSON.parse(J9(O,"utf8"));if(J.hooks?.PreCompact||J.hooks?.SessionStart||J.hooks?.SessionEnd)z=!0,W="Global"}if(v3(v)){let J=JSON.parse(J9(v,"utf8"));if(J.hooks?.PreCompact||J.hooks?.SessionStart||J.hooks?.SessionEnd)z=!0,W=W==="Global"?"Global + Project":"Project"}}catch{}if(z)console.log(` ✅ Claude Memory System is installed (${W})`),console.log(""),console.log("\uD83D\uDCA1 To test: Use /compact in Claude Code");else console.log(" ❌ Claude Memory System is not installed"),console.log(""),console.log("\uD83D\uDCA1 To install: claude-mem install")}d6();import{readFileSync as fu,readdirSync as $u,statSync as wu}from"fs";import{join as Zf}from"path";async function Ou(q,_,j){try{let f=fu(q,"utf8").split(` -`).filter((P)=>P.trim()).slice(-j);if(console.log(`\uD83D\uDCCB ${_} Logs (last ${j} lines):`),console.log(` File: ${q}`),console.log(""),f.length===0)console.log(" No log entries found");else f.forEach((P)=>{console.log(` ${P}`)});console.log("")}catch(K){console.log(`❌ Could not read ${_.toLowerCase()} log: ${q}`)}}async function kf(q={}){let _=$8.getLogsDirectory(),j=parseInt(q.tail)||20;try{let Y=$u(_).filter((f)=>f.startsWith("claude-mem-")&&f.endsWith(".log")).map((f)=>({name:f,path:Zf(_,f),mtime:wu(Zf(_,f)).mtime})).sort((f,P)=>P.mtime.getTime()-f.mtime.getTime());if(Y.length===0){console.log("❌ No log files found in ~/.claude-mem/logs/");return}if(await Ou(Y[0].path,"Most Recent",j),q.all&&Y.length>1)console.log(`\uD83D\uDCDA Found ${Y.length} total log files`)}catch(K){console.log("❌ Could not read logs directory: ~/.claude-mem/logs/"),console.log(" Run a compression first to generate logs")}if(q.follow)console.log("Following logs... (Press Ctrl+C to stop)"),setInterval(()=>{},1000)}T9();import{renameSync as Uh,existsSync as H$,mkdirSync as sh,statSync as Qh}from"fs";import{join as qD,basename as _D}from"path";var Z9=(q,_,j)=>{let K=q instanceof RegExp?Xf(q,j):q,Y=_ instanceof RegExp?Xf(_,j):_,f=K!==null&&Y!=null&&Hu(K,Y,j);return f&&{start:f[0],end:f[1],pre:j.slice(0,f[0]),body:j.slice(f[0]+K.length,f[1]),post:j.slice(f[1]+Y.length)}},Xf=(q,_)=>{let j=_.match(q);return j?j[0]:null},Hu=(q,_,j)=>{let K,Y,f,P=void 0,$,w=j.indexOf(q),O=j.indexOf(_,w+1),v=w;if(w>=0&&O>0){if(q===_)return[w,O];K=[],f=j.length;while(v>=0&&!$){if(v===w)K.push(v),w=j.indexOf(q,v+1);else if(K.length===1){let z=K.pop();if(z!==void 0)$=[z,O]}else{if(Y=K.pop(),Y!==void 0&&Y=0?w:O}if(K.length&&P!==void 0)$=[f,P]}return $};var Af="\x00SLASH"+Math.random()+"\x00",Gf="\x00OPEN"+Math.random()+"\x00",X9="\x00CLOSE"+Math.random()+"\x00",uf="\x00COMMA"+Math.random()+"\x00",hf="\x00PERIOD"+Math.random()+"\x00",Ju=new RegExp(Af,"g"),Tu=new RegExp(Gf,"g"),Zu=new RegExp(X9,"g"),ku=new RegExp(uf,"g"),Xu=new RegExp(hf,"g"),Au=/\\\\/g,Gu=/\\{/g,uu=/\\}/g,hu=/\\,/g,Du=/\\./g;function k9(q){return!isNaN(q)?parseInt(q,10):q.charCodeAt(0)}function Cu(q){return q.replace(Au,Af).replace(Gu,Gf).replace(uu,X9).replace(hu,uf).replace(Du,hf)}function Vu(q){return q.replace(Ju,"\\").replace(Tu,"{").replace(Zu,"}").replace(ku,",").replace(Xu,".")}function Df(q){if(!q)return[""];let _=[],j=Z9("{","}",q);if(!j)return q.split(",");let{pre:K,body:Y,post:f}=j,P=K.split(",");P[P.length-1]+="{"+Y+"}";let $=Df(f);if(f.length)P[P.length-1]+=$.shift(),P.push.apply(P,$);return _.push.apply(_,P),_}function Cf(q){if(!q)return[];if(q.slice(0,2)==="{}")q="\\{\\}"+q.slice(2);return H3(Cu(q),!0).map(Vu)}function Mu(q){return"{"+q+"}"}function Nu(q){return/^-?0\d/.test(q)}function bu(q,_){return q<=_}function Su(q,_){return q>=_}function H3(q,_){let j=[],K=Z9("{","}",q);if(!K)return[q];let Y=K.pre,f=K.post.length?H3(K.post,!1):[""];if(/\$$/.test(K.pre))for(let P=0;P=0;if(!w&&!O){if(K.post.match(/,(?!,).*\}/))return q=K.pre+"{"+K.body+X9+K.post,H3(q);return[q]}let v;if(w)v=K.body.split(/\.\./);else if(v=Df(K.body),v.length===1&&v[0]!==void 0){if(v=H3(v[0],!1).map(Mu),v.length===1)return f.map((W)=>K.pre+v[0]+W)}let z;if(w&&v[0]!==void 0&&v[1]!==void 0){let W=k9(v[0]),J=k9(v[1]),T=Math.max(v[0].length,v[1].length),H=v.length===3&&v[2]!==void 0?Math.abs(k9(v[2])):1,X=bu;if(J0){let N=new Array(I+1).join("0");if(D<0)M="-"+N+M.slice(1);else M=N+M}}z.push(M)}}else{z=[];for(let W=0;W{if(typeof q!=="string")throw new TypeError("invalid pattern");if(q.length>65536)throw new TypeError("pattern is too long")};var Eu={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},T3=(q)=>q.replace(/[[\]\\-]/g,"\\$&"),Ru=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Vf=(q)=>q.join(""),Mf=(q,_)=>{let j=_;if(q.charAt(j)!=="[")throw new Error("not in a brace expression");let K=[],Y=[],f=j+1,P=!1,$=!1,w=!1,O=!1,v=j,z="";q:while(fz)K.push(T3(z)+"-"+T3(H));else if(H===z)K.push(T3(H));z="",f++;continue}if(q.startsWith("-]",f+1)){K.push(T3(H+"-")),f+=2;continue}if(q.startsWith("-",f+1)){z=H,f+=2;continue}K.push(T3(H)),f++}if(v{return _?q.replace(/\[([^\/\\])\]/g,"$1"):q.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")};var mu=new Set(["!","?","+","*","@"]),Nf=(q)=>mu.has(q),Iu="(?!(?:^|/)\\.\\.?(?:$|/))",N7="(?!\\.)",gu=new Set(["[","."]),yu=new Set(["..","."]),du=new Set("().*{}+?[]^$\\!"),pu=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),A9="[^/]",bf=A9+"*?",Sf=A9+"+?";class J6{type;#q;#_;#Y=!1;#P=[];#f;#G;#X;#z=!1;#$;#W;#v=!1;constructor(q,_,j={}){if(this.type=q,q)this.#_=!0;if(this.#f=_,this.#q=this.#f?this.#f.#q:this,this.#$=this.#q===this?j:this.#q.#$,this.#X=this.#q===this?[]:this.#q.#X,q==="!"&&!this.#q.#z)this.#X.push(this);this.#G=this.#f?this.#f.#P.length:0}get hasMagic(){if(this.#_!==void 0)return this.#_;for(let q of this.#P){if(typeof q==="string")continue;if(q.type||q.hasMagic)return this.#_=!0}return this.#_}toString(){if(this.#W!==void 0)return this.#W;if(!this.type)return this.#W=this.#P.map((q)=>String(q)).join("");else return this.#W=this.type+"("+this.#P.map((q)=>String(q)).join("|")+")"}#w(){if(this!==this.#q)throw new Error("should only call on root");if(this.#z)return this;this.toString(),this.#z=!0;let q;while(q=this.#X.pop()){if(q.type!=="!")continue;let _=q,j=_.#f;while(j){for(let K=_.#G+1;!j.type&&Ktypeof _==="string"?_:_.toJSON()):[this.type,...this.#P.map((_)=>_.toJSON())];if(this.isStart()&&!this.type)q.unshift([]);if(this.isEnd()&&(this===this.#q||this.#q.#z&&this.#f?.type==="!"))q.push({});return q}isStart(){if(this.#q===this)return!0;if(!this.#f?.isStart())return!1;if(this.#G===0)return!0;let q=this.#f;for(let _=0;_{let[J,T,H,X]=typeof W==="string"?J6.#u(W,this.#_,$):W.toRegExpSource(q);return this.#_=this.#_||H,this.#Y=this.#Y||X,J}).join(""),O="";if(this.isStart()){if(typeof this.#P[0]==="string"){if(!(this.#P.length===1&&yu.has(this.#P[0]))){let J=gu,T=_&&J.has(w.charAt(0))||w.startsWith("\\.")&&J.has(w.charAt(2))||w.startsWith("\\.\\.")&&J.has(w.charAt(4)),H=!_&&!q&&J.has(w.charAt(0));O=T?Iu:H?N7:""}}}let v="";if(this.isEnd()&&this.#q.#z&&this.#f?.type==="!")v="(?:$|\\/)";return[O+w+v,Hq(w),this.#_=!!this.#_,this.#Y]}let j=this.type==="*"||this.type==="+",K=this.type==="!"?"(?:(?!(?:":"(?:",Y=this.#J(_);if(this.isStart()&&this.isEnd()&&!Y&&this.type!=="!"){let $=this.toString();return this.#P=[$],this.type=null,this.#_=void 0,[$,Hq(this.toString()),!1,!1]}let f=!j||q||_||!N7?"":this.#J(!0);if(f===Y)f="";if(f)Y=`(?:${Y})(?:${f})*?`;let P="";if(this.type==="!"&&this.#v)P=(this.isStart()&&!_?N7:"")+Sf;else{let $=this.type==="!"?"))"+(this.isStart()&&!_&&!q?N7:"")+bf+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&f?")":this.type==="*"&&f?")?":`)${this.type}`;P=K+Y+$}return[P,Hq(Y),this.#_=!!this.#_,this.#Y]}#J(q){return this.#P.map((_)=>{if(typeof _==="string")throw new Error("string type in extglob ast??");let[j,K,Y,f]=_.toRegExpSource(q);return this.#Y=this.#Y||f,j}).filter((_)=>!(this.isStart()&&this.isEnd())||!!_).join("|")}static#u(q,_,j=!1){let K=!1,Y="",f=!1;for(let P=0;P{return _?q.replace(/[?*()[\]]/g,"[$&]"):q.replace(/[?*()[\]\\]/g,"\\$&")};var M6=(q,_,j={})=>{if(J3(_),!j.nocomment&&_.charAt(0)==="#")return!1;return new qq(_,j).match(q)},Lu=/^\*+([^+@!?\*\[\(]*)$/,lu=(q)=>(_)=>!_.startsWith(".")&&_.endsWith(q),xu=(q)=>(_)=>_.endsWith(q),nu=(q)=>{return q=q.toLowerCase(),(_)=>!_.startsWith(".")&&_.toLowerCase().endsWith(q)},cu=(q)=>{return q=q.toLowerCase(),(_)=>_.toLowerCase().endsWith(q)},ru=/^\*+\.\*+$/,iu=(q)=>!q.startsWith(".")&&q.includes("."),ou=(q)=>q!=="."&&q!==".."&&q.includes("."),au=/^\.\*+$/,Bu=(q)=>q!=="."&&q!==".."&&q.startsWith("."),tu=/^\*+$/,eu=(q)=>q.length!==0&&!q.startsWith("."),Fu=(q)=>q.length!==0&&q!=="."&&q!=="..",Uu=/^\?+([^+@!?\*\[\(]*)?$/,su=([q,_=""])=>{let j=mf([q]);if(!_)return j;return _=_.toLowerCase(),(K)=>j(K)&&K.toLowerCase().endsWith(_)},Qu=([q,_=""])=>{let j=If([q]);if(!_)return j;return _=_.toLowerCase(),(K)=>j(K)&&K.toLowerCase().endsWith(_)},qh=([q,_=""])=>{let j=If([q]);return!_?j:(K)=>j(K)&&K.endsWith(_)},_h=([q,_=""])=>{let j=mf([q]);return!_?j:(K)=>j(K)&&K.endsWith(_)},mf=([q])=>{let _=q.length;return(j)=>j.length===_&&!j.startsWith(".")},If=([q])=>{let _=q.length;return(j)=>j.length===_&&j!=="."&&j!==".."},gf=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ef={win32:{sep:"\\"},posix:{sep:"/"}},Kh=gf==="win32"?Ef.win32.sep:Ef.posix.sep;M6.sep=Kh;var T6=Symbol("globstar **");M6.GLOBSTAR=T6;var jh="[^/]",Ph=jh+"*?",Yh="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",fh="(?:(?!(?:\\/|^)\\.).)*?",$h=(q,_={})=>(j)=>M6(j,q,_);M6.filter=$h;var Q6=(q,_={})=>Object.assign({},q,_),wh=(q)=>{if(!q||typeof q!=="object"||!Object.keys(q).length)return M6;let _=M6;return Object.assign((K,Y,f={})=>_(K,Y,Q6(q,f)),{Minimatch:class K extends _.Minimatch{constructor(Y,f={}){super(Y,Q6(q,f))}static defaults(Y){return _.defaults(Q6(q,Y)).Minimatch}},AST:class K extends _.AST{constructor(Y,f,P={}){super(Y,f,Q6(q,P))}static fromGlob(Y,f={}){return _.AST.fromGlob(Y,Q6(q,f))}},unescape:(K,Y={})=>_.unescape(K,Q6(q,Y)),escape:(K,Y={})=>_.escape(K,Q6(q,Y)),filter:(K,Y={})=>_.filter(K,Q6(q,Y)),defaults:(K)=>_.defaults(Q6(q,K)),makeRe:(K,Y={})=>_.makeRe(K,Q6(q,Y)),braceExpand:(K,Y={})=>_.braceExpand(K,Q6(q,Y)),match:(K,Y,f={})=>_.match(K,Y,Q6(q,f)),sep:_.sep,GLOBSTAR:T6})};M6.defaults=wh;var yf=(q,_={})=>{if(J3(q),_.nobrace||!/\{(?:(?!\{).)*\}/.test(q))return[q];return Cf(q)};M6.braceExpand=yf;var Oh=(q,_={})=>new qq(q,_).makeRe();M6.makeRe=Oh;var zh=(q,_,j={})=>{let K=new qq(_,j);if(q=q.filter((Y)=>K.match(Y)),K.options.nonull&&!q.length)q.push(_);return q};M6.match=zh;var Rf=/[?*]|[+@!]\(.*?\)|\[|\]/,vh=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class qq{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(q,_={}){if(J3(q),_=_||{},this.options=_,this.pattern=q,this.platform=_.platform||gf,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!_.windowsPathsNoEscape||_.allowWindowsEscape===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!_.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!_.nonegate,this.comment=!1,this.empty=!1,this.partial=!!_.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=_.windowsNoMagicRoot!==void 0?_.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let q of this.set)for(let _ of q)if(typeof _!=="string")return!0;return!1}debug(...q){}make(){let q=this.pattern,_=this.options;if(!_.nocomment&&q.charAt(0)==="#"){this.comment=!0;return}if(!q){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],_.debug)this.debug=(...Y)=>console.error(...Y);this.debug(this.pattern,this.globSet);let j=this.globSet.map((Y)=>this.slashSplit(Y));this.globParts=this.preprocess(j),this.debug(this.pattern,this.globParts);let K=this.globParts.map((Y,f,P)=>{if(this.isWindows&&this.windowsNoMagicRoot){let $=Y[0]===""&&Y[1]===""&&(Y[2]==="?"||!Rf.test(Y[2]))&&!Rf.test(Y[3]),w=/^[a-z]:/i.test(Y[0]);if($)return[...Y.slice(0,4),...Y.slice(4).map((O)=>this.parse(O))];else if(w)return[Y[0],...Y.slice(1).map((O)=>this.parse(O))]}return Y.map(($)=>this.parse($))});if(this.debug(this.pattern,K),this.set=K.filter((Y)=>Y.indexOf(!1)===-1),this.isWindows)for(let Y=0;Y=2)q=this.firstPhasePreProcess(q),q=this.secondPhasePreProcess(q);else if(_>=1)q=this.levelOneOptimize(q);else q=this.adjascentGlobstarOptimize(q);return q}adjascentGlobstarOptimize(q){return q.map((_)=>{let j=-1;while((j=_.indexOf("**",j+1))!==-1){let K=j;while(_[K+1]==="**")K++;if(K!==j)_.splice(j,K-j)}return _})}levelOneOptimize(q){return q.map((_)=>{return _=_.reduce((j,K)=>{let Y=j[j.length-1];if(K==="**"&&Y==="**")return j;if(K===".."){if(Y&&Y!==".."&&Y!=="."&&Y!=="**")return j.pop(),j}return j.push(K),j},[]),_.length===0?[""]:_})}levelTwoFileOptimize(q){if(!Array.isArray(q))q=this.slashSplit(q);let _=!1;do{if(_=!1,!this.preserveMultipleSlashes){for(let K=1;KK)j.splice(K+1,f-K);let P=j[K+1],$=j[K+2],w=j[K+3];if(P!=="..")continue;if(!$||$==="."||$===".."||!w||w==="."||w==="..")continue;_=!0,j.splice(K,1);let O=j.slice(0);O[K]="**",q.push(O),K--}if(!this.preserveMultipleSlashes){for(let f=1;f_.length)}partsMatch(q,_,j=!1){let K=0,Y=0,f=[],P="";while(KG)_=_.slice(D);else if(G>D)q=q.slice(G)}}}let{optimizationLevel:Y=1}=this.options;if(Y>=2)q=this.levelTwoFileOptimize(q);this.debug("matchOne",this,{file:q,pattern:_}),this.debug("matchOne",q.length,_.length);for(var f=0,P=0,$=q.length,w=_.length;f<$&&P!J.hooks?.some((T)=>T.command===Y||T.command?.includes("pre-compact.js")||T.command?.includes("claude-mem")));if(W.length!==v.hooks.PreCompact.length)v.hooks.PreCompact=W.length?W:void 0,z=!0,console.log(`✅ Removed PreCompact hook from ${w.name} settings`)}if(v.hooks.SessionStart){let W=v.hooks.SessionStart.filter((J)=>!J.hooks?.some((T)=>T.command===f||T.command?.includes("session-start.js")||T.command?.includes("claude-mem")));if(W.length!==v.hooks.SessionStart.length)v.hooks.SessionStart=W.length?W:void 0,z=!0,console.log(`✅ Removed SessionStart hook from ${w.name} settings`)}if(v.hooks.SessionEnd){let W=v.hooks.SessionEnd.filter((J)=>!J.hooks?.some((T)=>T.command===P||T.command?.includes("session-end.js")||T.command?.includes("claude-mem")));if(W.length!==v.hooks.SessionEnd.length)v.hooks.SessionEnd=W.length?W:void 0,z=!0,console.log(`✅ Removed SessionEnd hook from ${w.name} settings`)}if(v.hooks.PreCompact===void 0)delete v.hooks.PreCompact;if(v.hooks.SessionStart===void 0)delete v.hooks.SessionStart;if(v.hooks.SessionEnd===void 0)delete v.hooks.SessionEnd;if(!Object.keys(v.hooks).length)delete v.hooks;if(z){let W=w.path+".backup."+Date.now();Hf(W,O),console.log(`\uD83D\uDCCB Created backup: ${W}`),Hf(w.path,JSON.stringify(v,null,2)),$++,console.log(`✅ Updated ${w.name} settings: ${w.path}`)}else console.log(`ℹ️ No Claude Memory System hooks found in ${w.name} settings`)}catch(O){console.log(`⚠️ Could not process ${w.name} settings: ${O.message}`)}}if(console.log(""),$>0)console.log("✨ Uninstallation complete!"),console.log("The Claude Memory System hooks have been removed from your settings."),console.log(""),console.log("Note: Your compressed transcripts and archives are preserved."),console.log("To reinstall: claude-mem install");else console.log("ℹ️ No Claude Memory System hooks were found to remove.")}d6();import{readFileSync as J9,existsSync as v3,readdirSync as Ku,statSync as ju}from"fs";import{join as D_,dirname as Pu}from"path";import{execSync as Yu}from"child_process";import{fileURLToPath as fu}from"url";var Z0=Pu(fu(import.meta.url));async function Tf(){console.log("\uD83D\uDD0D Claude Memory System Status Check"),console.log(`===================================== +`),console.log("\uD83D\uDCC2 Installed Hook Scripts:");let q=$8.getInstance(),_=q.getHooksDirectory(),j=D_(_,"pre-compact.js"),K=D_(_,"session-start.js"),Y=D_(_,"session-end.js"),f=(J,T)=>{if(v3(J))console.log(` ✅ ${T}: Found at ${J}`);else console.log(` ❌ ${T}: Not found at ${J}`)};f(j,"pre-compact.js"),f(K,"session-start.js"),f(Y,"session-end.js"),console.log(""),console.log("⚙️ Settings Configuration:");let P=(J,T)=>{if(!v3(T)){console.log(` ⏭️ ${J}: No settings file`);return}console.log(` \uD83D\uDCCB ${J}: ${T}`);try{let H=JSON.parse(J9(T,"utf8")),X=H.hooks?.PreCompact?.some((D)=>D.hooks?.some((M)=>M.command?.includes("pre-compact.js")||M.command?.includes("claude-mem"))),A=H.hooks?.SessionStart?.some((D)=>D.hooks?.some((M)=>M.command?.includes("session-start.js")||M.command?.includes("claude-mem"))),G=H.hooks?.SessionEnd?.some((D)=>D.hooks?.some((M)=>M.command?.includes("session-end.js")||M.command?.includes("claude-mem")));console.log(` PreCompact: ${X?"✅":"❌"}`),console.log(` SessionStart: ${A?"✅":"❌"}`),console.log(` SessionEnd: ${G?"✅":"❌"}`)}catch(H){console.log(" ⚠️ Could not parse settings")}};P("Global",q.getClaudeSettingsPath()),P("Project",D_(process.cwd(),".claude","settings.json")),console.log(""),console.log("\uD83D\uDCE6 Compressed Transcripts:");let $=D_(q.getClaudeConfigDirectory(),"projects");if(v3($))try{let J=0,T=0,H=(X,A=0)=>{if(A>3)return;let G=Ku(X);for(let D of G){let M=D_(X,D);if(ju(M).isDirectory()&&!D.startsWith("."))H(M,A+1);else if(D.endsWith(".jsonl.compressed"))J++;else if(D.endsWith(".jsonl.archive"))T++}};H($),console.log(` Compressed files: ${J}`),console.log(` Archive files: ${T}`)}catch(J){console.log(" ⚠️ Could not scan projects directory")}else console.log(" ℹ️ No Claude projects directory found");console.log(""),console.log("\uD83D\uDD27 Runtime Environment:");let w=(J,T)=>{try{let H=Yu(`${J} --version`,{encoding:"utf8"}).trim();console.log(` ✅ ${T}: ${H}`)}catch{console.log(` ❌ ${T}: Not found`)}};w("node","Node.js"),w("bun","Bun"),console.log(""),console.log("\uD83E\uDDE0 Chroma Storage Status:"),console.log(" ✅ Storage backend: Chroma MCP"),console.log(` \uD83D\uDCCD Data location: ${q.getChromaDirectory()}`),console.log(" \uD83D\uDD0D Features: Vector search, semantic similarity, document storage"),console.log(""),console.log("\uD83D\uDCCA Summary:");let O=q.getClaudeSettingsPath(),v=D_(process.cwd(),".claude","settings.json"),z=!1,W="Not installed";try{if(v3(O)){let J=JSON.parse(J9(O,"utf8"));if(J.hooks?.PreCompact||J.hooks?.SessionStart||J.hooks?.SessionEnd)z=!0,W="Global"}if(v3(v)){let J=JSON.parse(J9(v,"utf8"));if(J.hooks?.PreCompact||J.hooks?.SessionStart||J.hooks?.SessionEnd)z=!0,W=W==="Global"?"Global + Project":"Project"}}catch{}if(z)console.log(` ✅ Claude Memory System is installed (${W})`),console.log(""),console.log("\uD83D\uDCA1 To test: Use /compact in Claude Code");else console.log(" ❌ Claude Memory System is not installed"),console.log(""),console.log("\uD83D\uDCA1 To install: claude-mem install")}d6();import{readFileSync as $u,readdirSync as wu,statSync as Ou}from"fs";import{join as Zf}from"path";async function zu(q,_,j){try{let f=$u(q,"utf8").split(` +`).filter((P)=>P.trim()).slice(-j);if(console.log(`\uD83D\uDCCB ${_} Logs (last ${j} lines):`),console.log(` File: ${q}`),console.log(""),f.length===0)console.log(" No log entries found");else f.forEach((P)=>{console.log(` ${P}`)});console.log("")}catch(K){console.log(`❌ Could not read ${_.toLowerCase()} log: ${q}`)}}async function kf(q={}){let _=$8.getLogsDirectory(),j=parseInt(q.tail)||20;try{let Y=wu(_).filter((f)=>f.startsWith("claude-mem-")&&f.endsWith(".log")).map((f)=>({name:f,path:Zf(_,f),mtime:Ou(Zf(_,f)).mtime})).sort((f,P)=>P.mtime.getTime()-f.mtime.getTime());if(Y.length===0){console.log("❌ No log files found in ~/.claude-mem/logs/");return}if(await zu(Y[0].path,"Most Recent",j),q.all&&Y.length>1)console.log(`\uD83D\uDCDA Found ${Y.length} total log files`)}catch(K){console.log("❌ Could not read logs directory: ~/.claude-mem/logs/"),console.log(" Run a compression first to generate logs")}if(q.follow)console.log("Following logs... (Press Ctrl+C to stop)"),setInterval(()=>{},1000)}T9();import{renameSync as Qh,existsSync as H$,mkdirSync as qD,statSync as _D}from"fs";import{join as KD,basename as jD}from"path";var Z9=(q,_,j)=>{let K=q instanceof RegExp?Xf(q,j):q,Y=_ instanceof RegExp?Xf(_,j):_,f=K!==null&&Y!=null&&Tu(K,Y,j);return f&&{start:f[0],end:f[1],pre:j.slice(0,f[0]),body:j.slice(f[0]+K.length,f[1]),post:j.slice(f[1]+Y.length)}},Xf=(q,_)=>{let j=_.match(q);return j?j[0]:null},Tu=(q,_,j)=>{let K,Y,f,P=void 0,$,w=j.indexOf(q),O=j.indexOf(_,w+1),v=w;if(w>=0&&O>0){if(q===_)return[w,O];K=[],f=j.length;while(v>=0&&!$){if(v===w)K.push(v),w=j.indexOf(q,v+1);else if(K.length===1){let z=K.pop();if(z!==void 0)$=[z,O]}else{if(Y=K.pop(),Y!==void 0&&Y=0?w:O}if(K.length&&P!==void 0)$=[f,P]}return $};var Af="\x00SLASH"+Math.random()+"\x00",Gf="\x00OPEN"+Math.random()+"\x00",X9="\x00CLOSE"+Math.random()+"\x00",uf="\x00COMMA"+Math.random()+"\x00",hf="\x00PERIOD"+Math.random()+"\x00",Zu=new RegExp(Af,"g"),ku=new RegExp(Gf,"g"),Xu=new RegExp(X9,"g"),Au=new RegExp(uf,"g"),Gu=new RegExp(hf,"g"),uu=/\\\\/g,hu=/\\{/g,Du=/\\}/g,Cu=/\\,/g,Vu=/\\./g;function k9(q){return!isNaN(q)?parseInt(q,10):q.charCodeAt(0)}function Mu(q){return q.replace(uu,Af).replace(hu,Gf).replace(Du,X9).replace(Cu,uf).replace(Vu,hf)}function Nu(q){return q.replace(Zu,"\\").replace(ku,"{").replace(Xu,"}").replace(Au,",").replace(Gu,".")}function Df(q){if(!q)return[""];let _=[],j=Z9("{","}",q);if(!j)return q.split(",");let{pre:K,body:Y,post:f}=j,P=K.split(",");P[P.length-1]+="{"+Y+"}";let $=Df(f);if(f.length)P[P.length-1]+=$.shift(),P.push.apply(P,$);return _.push.apply(_,P),_}function Cf(q){if(!q)return[];if(q.slice(0,2)==="{}")q="\\{\\}"+q.slice(2);return H3(Mu(q),!0).map(Nu)}function bu(q){return"{"+q+"}"}function Su(q){return/^-?0\d/.test(q)}function Eu(q,_){return q<=_}function Ru(q,_){return q>=_}function H3(q,_){let j=[],K=Z9("{","}",q);if(!K)return[q];let Y=K.pre,f=K.post.length?H3(K.post,!1):[""];if(/\$$/.test(K.pre))for(let P=0;P=0;if(!w&&!O){if(K.post.match(/,(?!,).*\}/))return q=K.pre+"{"+K.body+X9+K.post,H3(q);return[q]}let v;if(w)v=K.body.split(/\.\./);else if(v=Df(K.body),v.length===1&&v[0]!==void 0){if(v=H3(v[0],!1).map(bu),v.length===1)return f.map((W)=>K.pre+v[0]+W)}let z;if(w&&v[0]!==void 0&&v[1]!==void 0){let W=k9(v[0]),J=k9(v[1]),T=Math.max(v[0].length,v[1].length),H=v.length===3&&v[2]!==void 0?Math.abs(k9(v[2])):1,X=Eu;if(J0){let N=new Array(I+1).join("0");if(D<0)M="-"+N+M.slice(1);else M=N+M}}z.push(M)}}else{z=[];for(let W=0;W{if(typeof q!=="string")throw new TypeError("invalid pattern");if(q.length>65536)throw new TypeError("pattern is too long")};var mu={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},T3=(q)=>q.replace(/[[\]\\-]/g,"\\$&"),Iu=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Vf=(q)=>q.join(""),Mf=(q,_)=>{let j=_;if(q.charAt(j)!=="[")throw new Error("not in a brace expression");let K=[],Y=[],f=j+1,P=!1,$=!1,w=!1,O=!1,v=j,z="";q:while(fz)K.push(T3(z)+"-"+T3(H));else if(H===z)K.push(T3(H));z="",f++;continue}if(q.startsWith("-]",f+1)){K.push(T3(H+"-")),f+=2;continue}if(q.startsWith("-",f+1)){z=H,f+=2;continue}K.push(T3(H)),f++}if(v{return _?q.replace(/\[([^\/\\])\]/g,"$1"):q.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1")};var gu=new Set(["!","?","+","*","@"]),Nf=(q)=>gu.has(q),yu="(?!(?:^|/)\\.\\.?(?:$|/))",N7="(?!\\.)",du=new Set(["[","."]),pu=new Set(["..","."]),Lu=new Set("().*{}+?[]^$\\!"),lu=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),A9="[^/]",bf=A9+"*?",Sf=A9+"+?";class J6{type;#q;#_;#Y=!1;#P=[];#f;#G;#X;#z=!1;#$;#W;#v=!1;constructor(q,_,j={}){if(this.type=q,q)this.#_=!0;if(this.#f=_,this.#q=this.#f?this.#f.#q:this,this.#$=this.#q===this?j:this.#q.#$,this.#X=this.#q===this?[]:this.#q.#X,q==="!"&&!this.#q.#z)this.#X.push(this);this.#G=this.#f?this.#f.#P.length:0}get hasMagic(){if(this.#_!==void 0)return this.#_;for(let q of this.#P){if(typeof q==="string")continue;if(q.type||q.hasMagic)return this.#_=!0}return this.#_}toString(){if(this.#W!==void 0)return this.#W;if(!this.type)return this.#W=this.#P.map((q)=>String(q)).join("");else return this.#W=this.type+"("+this.#P.map((q)=>String(q)).join("|")+")"}#w(){if(this!==this.#q)throw new Error("should only call on root");if(this.#z)return this;this.toString(),this.#z=!0;let q;while(q=this.#X.pop()){if(q.type!=="!")continue;let _=q,j=_.#f;while(j){for(let K=_.#G+1;!j.type&&Ktypeof _==="string"?_:_.toJSON()):[this.type,...this.#P.map((_)=>_.toJSON())];if(this.isStart()&&!this.type)q.unshift([]);if(this.isEnd()&&(this===this.#q||this.#q.#z&&this.#f?.type==="!"))q.push({});return q}isStart(){if(this.#q===this)return!0;if(!this.#f?.isStart())return!1;if(this.#G===0)return!0;let q=this.#f;for(let _=0;_{let[J,T,H,X]=typeof W==="string"?J6.#u(W,this.#_,$):W.toRegExpSource(q);return this.#_=this.#_||H,this.#Y=this.#Y||X,J}).join(""),O="";if(this.isStart()){if(typeof this.#P[0]==="string"){if(!(this.#P.length===1&&pu.has(this.#P[0]))){let J=du,T=_&&J.has(w.charAt(0))||w.startsWith("\\.")&&J.has(w.charAt(2))||w.startsWith("\\.\\.")&&J.has(w.charAt(4)),H=!_&&!q&&J.has(w.charAt(0));O=T?yu:H?N7:""}}}let v="";if(this.isEnd()&&this.#q.#z&&this.#f?.type==="!")v="(?:$|\\/)";return[O+w+v,Hq(w),this.#_=!!this.#_,this.#Y]}let j=this.type==="*"||this.type==="+",K=this.type==="!"?"(?:(?!(?:":"(?:",Y=this.#J(_);if(this.isStart()&&this.isEnd()&&!Y&&this.type!=="!"){let $=this.toString();return this.#P=[$],this.type=null,this.#_=void 0,[$,Hq(this.toString()),!1,!1]}let f=!j||q||_||!N7?"":this.#J(!0);if(f===Y)f="";if(f)Y=`(?:${Y})(?:${f})*?`;let P="";if(this.type==="!"&&this.#v)P=(this.isStart()&&!_?N7:"")+Sf;else{let $=this.type==="!"?"))"+(this.isStart()&&!_&&!q?N7:"")+bf+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&f?")":this.type==="*"&&f?")?":`)${this.type}`;P=K+Y+$}return[P,Hq(Y),this.#_=!!this.#_,this.#Y]}#J(q){return this.#P.map((_)=>{if(typeof _==="string")throw new Error("string type in extglob ast??");let[j,K,Y,f]=_.toRegExpSource(q);return this.#Y=this.#Y||f,j}).filter((_)=>!(this.isStart()&&this.isEnd())||!!_).join("|")}static#u(q,_,j=!1){let K=!1,Y="",f=!1;for(let P=0;P{return _?q.replace(/[?*()[\]]/g,"[$&]"):q.replace(/[?*()[\]\\]/g,"\\$&")};var M6=(q,_,j={})=>{if(J3(_),!j.nocomment&&_.charAt(0)==="#")return!1;return new qq(_,j).match(q)},xu=/^\*+([^+@!?\*\[\(]*)$/,nu=(q)=>(_)=>!_.startsWith(".")&&_.endsWith(q),cu=(q)=>(_)=>_.endsWith(q),ru=(q)=>{return q=q.toLowerCase(),(_)=>!_.startsWith(".")&&_.toLowerCase().endsWith(q)},iu=(q)=>{return q=q.toLowerCase(),(_)=>_.toLowerCase().endsWith(q)},ou=/^\*+\.\*+$/,au=(q)=>!q.startsWith(".")&&q.includes("."),Bu=(q)=>q!=="."&&q!==".."&&q.includes("."),tu=/^\.\*+$/,eu=(q)=>q!=="."&&q!==".."&&q.startsWith("."),Fu=/^\*+$/,Uu=(q)=>q.length!==0&&!q.startsWith("."),su=(q)=>q.length!==0&&q!=="."&&q!=="..",Qu=/^\?+([^+@!?\*\[\(]*)?$/,qh=([q,_=""])=>{let j=mf([q]);if(!_)return j;return _=_.toLowerCase(),(K)=>j(K)&&K.toLowerCase().endsWith(_)},_h=([q,_=""])=>{let j=If([q]);if(!_)return j;return _=_.toLowerCase(),(K)=>j(K)&&K.toLowerCase().endsWith(_)},Kh=([q,_=""])=>{let j=If([q]);return!_?j:(K)=>j(K)&&K.endsWith(_)},jh=([q,_=""])=>{let j=mf([q]);return!_?j:(K)=>j(K)&&K.endsWith(_)},mf=([q])=>{let _=q.length;return(j)=>j.length===_&&!j.startsWith(".")},If=([q])=>{let _=q.length;return(j)=>j.length===_&&j!=="."&&j!==".."},gf=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ef={win32:{sep:"\\"},posix:{sep:"/"}},Ph=gf==="win32"?Ef.win32.sep:Ef.posix.sep;M6.sep=Ph;var T6=Symbol("globstar **");M6.GLOBSTAR=T6;var Yh="[^/]",fh=Yh+"*?",$h="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",wh="(?:(?!(?:\\/|^)\\.).)*?",Oh=(q,_={})=>(j)=>M6(j,q,_);M6.filter=Oh;var Q6=(q,_={})=>Object.assign({},q,_),zh=(q)=>{if(!q||typeof q!=="object"||!Object.keys(q).length)return M6;let _=M6;return Object.assign((K,Y,f={})=>_(K,Y,Q6(q,f)),{Minimatch:class K extends _.Minimatch{constructor(Y,f={}){super(Y,Q6(q,f))}static defaults(Y){return _.defaults(Q6(q,Y)).Minimatch}},AST:class K extends _.AST{constructor(Y,f,P={}){super(Y,f,Q6(q,P))}static fromGlob(Y,f={}){return _.AST.fromGlob(Y,Q6(q,f))}},unescape:(K,Y={})=>_.unescape(K,Q6(q,Y)),escape:(K,Y={})=>_.escape(K,Q6(q,Y)),filter:(K,Y={})=>_.filter(K,Q6(q,Y)),defaults:(K)=>_.defaults(Q6(q,K)),makeRe:(K,Y={})=>_.makeRe(K,Q6(q,Y)),braceExpand:(K,Y={})=>_.braceExpand(K,Q6(q,Y)),match:(K,Y,f={})=>_.match(K,Y,Q6(q,f)),sep:_.sep,GLOBSTAR:T6})};M6.defaults=zh;var yf=(q,_={})=>{if(J3(q),_.nobrace||!/\{(?:(?!\{).)*\}/.test(q))return[q];return Cf(q)};M6.braceExpand=yf;var vh=(q,_={})=>new qq(q,_).makeRe();M6.makeRe=vh;var Wh=(q,_,j={})=>{let K=new qq(_,j);if(q=q.filter((Y)=>K.match(Y)),K.options.nonull&&!q.length)q.push(_);return q};M6.match=Wh;var Rf=/[?*]|[+@!]\(.*?\)|\[|\]/,Hh=(q)=>q.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class qq{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(q,_={}){if(J3(q),_=_||{},this.options=_,this.pattern=q,this.platform=_.platform||gf,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!_.windowsPathsNoEscape||_.allowWindowsEscape===!1,this.windowsPathsNoEscape)this.pattern=this.pattern.replace(/\\/g,"/");this.preserveMultipleSlashes=!!_.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!_.nonegate,this.comment=!1,this.empty=!1,this.partial=!!_.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=_.windowsNoMagicRoot!==void 0?_.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let q of this.set)for(let _ of q)if(typeof _!=="string")return!0;return!1}debug(...q){}make(){let q=this.pattern,_=this.options;if(!_.nocomment&&q.charAt(0)==="#"){this.comment=!0;return}if(!q){this.empty=!0;return}if(this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],_.debug)this.debug=(...Y)=>console.error(...Y);this.debug(this.pattern,this.globSet);let j=this.globSet.map((Y)=>this.slashSplit(Y));this.globParts=this.preprocess(j),this.debug(this.pattern,this.globParts);let K=this.globParts.map((Y,f,P)=>{if(this.isWindows&&this.windowsNoMagicRoot){let $=Y[0]===""&&Y[1]===""&&(Y[2]==="?"||!Rf.test(Y[2]))&&!Rf.test(Y[3]),w=/^[a-z]:/i.test(Y[0]);if($)return[...Y.slice(0,4),...Y.slice(4).map((O)=>this.parse(O))];else if(w)return[Y[0],...Y.slice(1).map((O)=>this.parse(O))]}return Y.map(($)=>this.parse($))});if(this.debug(this.pattern,K),this.set=K.filter((Y)=>Y.indexOf(!1)===-1),this.isWindows)for(let Y=0;Y=2)q=this.firstPhasePreProcess(q),q=this.secondPhasePreProcess(q);else if(_>=1)q=this.levelOneOptimize(q);else q=this.adjascentGlobstarOptimize(q);return q}adjascentGlobstarOptimize(q){return q.map((_)=>{let j=-1;while((j=_.indexOf("**",j+1))!==-1){let K=j;while(_[K+1]==="**")K++;if(K!==j)_.splice(j,K-j)}return _})}levelOneOptimize(q){return q.map((_)=>{return _=_.reduce((j,K)=>{let Y=j[j.length-1];if(K==="**"&&Y==="**")return j;if(K===".."){if(Y&&Y!==".."&&Y!=="."&&Y!=="**")return j.pop(),j}return j.push(K),j},[]),_.length===0?[""]:_})}levelTwoFileOptimize(q){if(!Array.isArray(q))q=this.slashSplit(q);let _=!1;do{if(_=!1,!this.preserveMultipleSlashes){for(let K=1;KK)j.splice(K+1,f-K);let P=j[K+1],$=j[K+2],w=j[K+3];if(P!=="..")continue;if(!$||$==="."||$===".."||!w||w==="."||w==="..")continue;_=!0,j.splice(K,1);let O=j.slice(0);O[K]="**",q.push(O),K--}if(!this.preserveMultipleSlashes){for(let f=1;f_.length)}partsMatch(q,_,j=!1){let K=0,Y=0,f=[],P="";while(KG)_=_.slice(D);else if(G>D)q=q.slice(G)}}}let{optimizationLevel:Y=1}=this.options;if(Y>=2)q=this.levelTwoFileOptimize(q);this.debug("matchOne",this,{file:q,pattern:_}),this.debug("matchOne",q.length,_.length);for(var f=0,P=0,$=q.length,w=_.length;f<$&&P>> no match, partial?`,q,z,_,W),z===$)return!0}return!1}let T;if(typeof O==="string")T=v===O,this.debug("string match",O,v,T);else T=O.test(v),this.debug("pattern match",O,v,T);if(!T)return!1}if(f===$&&P===w)return!0;else if(f===$)return j;else if(P===w)return f===$-1&&q[f]==="";else throw new Error("wtf?")}braceExpand(){return yf(this.pattern,this.options)}parse(q){J3(q);let _=this.options;if(q==="**")return T6;if(q==="")return"";let j,K=null;if(j=q.match(tu))K=_.dot?Fu:eu;else if(j=q.match(Lu))K=(_.nocase?_.dot?cu:nu:_.dot?xu:lu)(j[1]);else if(j=q.match(Uu))K=(_.nocase?_.dot?Qu:su:_.dot?qh:_h)(j);else if(j=q.match(ru))K=_.dot?ou:iu;else if(j=q.match(au))K=Bu;let Y=J6.fromGlob(q,this.options).toMMPattern();if(K&&typeof Y==="object")Reflect.defineProperty(Y,"test",{value:K});return Y}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let q=this.set;if(!q.length)return this.regexp=!1,this.regexp;let _=this.options,j=_.noglobstar?Ph:_.dot?Yh:fh,K=new Set(_.nocase?["i"]:[]),Y=q.map(($)=>{let w=$.map((O)=>{if(O instanceof RegExp)for(let v of O.flags.split(""))K.add(v);return typeof O==="string"?vh(O):O===T6?T6:O._src});return w.forEach((O,v)=>{let z=w[v+1],W=w[v-1];if(O!==T6||W===T6)return;if(W===void 0)if(z!==void 0&&z!==T6)w[v+1]="(?:\\/|"+j+"\\/)?"+z;else w[v]=j;else if(z===void 0)w[v-1]=W+"(?:\\/|"+j+")?";else if(z!==T6)w[v-1]=W+"(?:\\/|\\/"+j+"\\/)"+z,w[v+1]=T6}),w.filter((O)=>O!==T6).join("/")}).join("|"),[f,P]=q.length>1?["(?:",")"]:["",""];if(Y="^"+f+Y+P+"$",this.negate)Y="^(?!"+Y+").+$";try{this.regexp=new RegExp(Y,[...K].join(""))}catch($){this.regexp=!1}return this.regexp}slashSplit(q){if(this.preserveMultipleSlashes)return q.split("/");else if(this.isWindows&&/^\/\/[^\/]+/.test(q))return["",...q.split(/\/+/)];else return q.split(/\/+/)}match(q,_=this.partial){if(this.debug("match",q,this.pattern),this.comment)return!1;if(this.empty)return q==="";if(q==="/"&&_)return!0;let j=this.options;if(this.isWindows)q=q.split("\\").join("/");let K=this.slashSplit(q);this.debug(this.pattern,"split",K);let Y=this.set;this.debug(this.pattern,"set",Y);let f=K[K.length-1];if(!f)for(let P=K.length-2;!f&&P>=0;P--)f=K[P];for(let P=0;P{typeof G9.emitWarning==="function"?G9.emitWarning(q,_,j,K):console.error(`[${j}] ${_}: ${q}`)},b7=globalThis.AbortController,df=globalThis.AbortSignal;if(typeof b7==="undefined"){df=class j{onabort;_onabort=[];reason;aborted=!1;addEventListener(K,Y){this._onabort.push(Y)}},b7=class j{constructor(){_()}signal=new df;abort(K){if(this.signal.aborted)return;this.signal.reason=K,this.signal.aborted=!0;for(let Y of this.signal._onabort)Y(K);this.signal.onabort?.(K)}};let q=G9.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",_=()=>{if(!q)return;q=!1,Lf("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",_)}}var Hh=(q)=>!pf.has(q),o0=Symbol("type"),K_=(q)=>q&&q===Math.floor(q)&&q>0&&isFinite(q),lf=(q)=>!K_(q)?null:q<=Math.pow(2,8)?Uint8Array:q<=Math.pow(2,16)?Uint16Array:q<=Math.pow(2,32)?Uint32Array:q<=Number.MAX_SAFE_INTEGER?Z3:null;class Z3 extends Array{constructor(q){super(q);this.fill(0)}}class XK{heap;length;static#q=!1;static create(q){let _=lf(q);if(!_)return[];XK.#q=!0;let j=new XK(q,_);return XK.#q=!1,j}constructor(q,_){if(!XK.#q)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new _(q),this.length=0}push(q){this.heap[this.length++]=q}pop(){return this.heap[--this.length]}}class k3{#q;#_;#Y;#P;#f;#G;#X;#z;get perf(){return this.#z}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#$;#W;#v;#w;#K;#J;#u;#A;#T;#b;#Z;#D;#M;#k;#h;#N;#H;#j;static unsafeExposeInternals(q){return{starts:q.#M,ttls:q.#k,sizes:q.#D,keyMap:q.#v,keyList:q.#w,valList:q.#K,next:q.#J,prev:q.#u,get head(){return q.#A},get tail(){return q.#T},free:q.#b,isBackgroundFetch:(_)=>q.#O(_),backgroundFetch:(_,j,K,Y)=>q.#r(_,j,K,Y),moveToTail:(_)=>q.#p(_),indexes:(_)=>q.#E(_),rindexes:(_)=>q.#m(_),isStale:(_)=>q.#V(_)}}get max(){return this.#q}get maxSize(){return this.#_}get calculatedSize(){return this.#W}get size(){return this.#$}get fetchMethod(){return this.#G}get memoMethod(){return this.#X}get dispose(){return this.#Y}get onInsert(){return this.#P}get disposeAfter(){return this.#f}constructor(q){let{max:_=0,ttl:j,ttlResolution:K=1,ttlAutopurge:Y,updateAgeOnGet:f,updateAgeOnHas:P,allowStale:$,dispose:w,onInsert:O,disposeAfter:v,noDisposeOnSet:z,noUpdateTTL:W,maxSize:J=0,maxEntrySize:T=0,sizeCalculation:H,fetchMethod:X,memoMethod:A,noDeleteOnFetchRejection:G,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:M,allowStaleOnFetchAbort:I,ignoreFetchAbort:N,perf:R}=q;if(R!==void 0){if(typeof R?.now!=="function")throw new TypeError("perf option must have a now() method if specified")}if(this.#z=R??Wh,_!==0&&!K_(_))throw new TypeError("max option must be a nonnegative integer");let L=_?lf(_):Array;if(!L)throw new Error("invalid max value: "+_);if(this.#q=_,this.#_=J,this.maxEntrySize=T||this.#_,this.sizeCalculation=H,this.sizeCalculation){if(!this.#_&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw new TypeError("sizeCalculation set to non-function")}if(A!==void 0&&typeof A!=="function")throw new TypeError("memoMethod must be a function if defined");if(this.#X=A,X!==void 0&&typeof X!=="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#G=X,this.#N=!!X,this.#v=new Map,this.#w=new Array(_).fill(void 0),this.#K=new Array(_).fill(void 0),this.#J=new L(_),this.#u=new L(_),this.#A=0,this.#T=0,this.#b=XK.create(_),this.#$=0,this.#W=0,typeof w==="function")this.#Y=w;if(typeof O==="function")this.#P=O;if(typeof v==="function")this.#f=v,this.#Z=[];else this.#f=void 0,this.#Z=void 0;if(this.#h=!!this.#Y,this.#j=!!this.#P,this.#H=!!this.#f,this.noDisposeOnSet=!!z,this.noUpdateTTL=!!W,this.noDeleteOnFetchRejection=!!G,this.allowStaleOnFetchRejection=!!M,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!N,this.maxEntrySize!==0){if(this.#_!==0){if(!K_(this.#_))throw new TypeError("maxSize must be a positive integer if specified")}if(!K_(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#L()}if(this.allowStale=!!$,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!f,this.updateAgeOnHas=!!P,this.ttlResolution=K_(K)||K===0?K:1,this.ttlAutopurge=!!Y,this.ttl=j||0,this.ttl){if(!K_(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}if(this.#q===0&&this.ttl===0&&this.#_===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#q&&!this.#_){if(Hh("LRU_CACHE_UNBOUNDED"))pf.add("LRU_CACHE_UNBOUNDED"),Lf("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",k3)}}getRemainingTTL(q){return this.#v.has(q)?1/0:0}#I(){let q=new Z3(this.#q),_=new Z3(this.#q);this.#k=q,this.#M=_,this.#n=(Y,f,P=this.#z.now())=>{if(_[Y]=f!==0?P:0,q[Y]=f,f!==0&&this.ttlAutopurge){let $=setTimeout(()=>{if(this.#V(Y))this.#R(this.#w[Y],"expire")},f+1);if($.unref)$.unref()}},this.#S=(Y)=>{_[Y]=q[Y]!==0?this.#z.now():0},this.#C=(Y,f)=>{if(q[f]){let P=q[f],$=_[f];if(!P||!$)return;Y.ttl=P,Y.start=$,Y.now=j||K();let w=Y.now-$;Y.remainingTTL=P-w}};let j=0,K=()=>{let Y=this.#z.now();if(this.ttlResolution>0){j=Y;let f=setTimeout(()=>j=0,this.ttlResolution);if(f.unref)f.unref()}return Y};this.getRemainingTTL=(Y)=>{let f=this.#v.get(Y);if(f===void 0)return 0;let P=q[f],$=_[f];if(!P||!$)return 1/0;let w=(j||K())-$;return P-w},this.#V=(Y)=>{let f=_[Y],P=q[Y];return!!P&&!!f&&(j||K())-f>P}}#S=()=>{};#C=()=>{};#n=()=>{};#V=()=>!1;#L(){let q=new Z3(this.#q);this.#W=0,this.#D=q,this.#g=(_)=>{this.#W-=q[_],q[_]=0},this.#y=(_,j,K,Y)=>{if(this.#O(j))return 0;if(!K_(K))if(Y){if(typeof Y!=="function")throw new TypeError("sizeCalculation must be a function");if(K=Y(j,_),!K_(K))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return K},this.#l=(_,j,K)=>{if(q[_]=j,this.#_){let Y=this.#_-q[_];while(this.#W>Y)this.#d(!0)}if(this.#W+=q[_],K)K.entrySize=j,K.totalCalculatedSize=this.#W}}#g=(q)=>{};#l=(q,_,j)=>{};#y=(q,_,j,K)=>{if(j||K)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#E({allowStale:q=this.allowStale}={}){if(this.#$)for(let _=this.#T;;){if(!this.#c(_))break;if(q||!this.#V(_))yield _;if(_===this.#A)break;else _=this.#u[_]}}*#m({allowStale:q=this.allowStale}={}){if(this.#$)for(let _=this.#A;;){if(!this.#c(_))break;if(q||!this.#V(_))yield _;if(_===this.#T)break;else _=this.#J[_]}}#c(q){return q!==void 0&&this.#v.get(this.#w[q])===q}*entries(){for(let q of this.#E())if(this.#K[q]!==void 0&&this.#w[q]!==void 0&&!this.#O(this.#K[q]))yield[this.#w[q],this.#K[q]]}*rentries(){for(let q of this.#m())if(this.#K[q]!==void 0&&this.#w[q]!==void 0&&!this.#O(this.#K[q]))yield[this.#w[q],this.#K[q]]}*keys(){for(let q of this.#E()){let _=this.#w[q];if(_!==void 0&&!this.#O(this.#K[q]))yield _}}*rkeys(){for(let q of this.#m()){let _=this.#w[q];if(_!==void 0&&!this.#O(this.#K[q]))yield _}}*values(){for(let q of this.#E())if(this.#K[q]!==void 0&&!this.#O(this.#K[q]))yield this.#K[q]}*rvalues(){for(let q of this.#m())if(this.#K[q]!==void 0&&!this.#O(this.#K[q]))yield this.#K[q]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(q,_={}){for(let j of this.#E()){let K=this.#K[j],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0)continue;if(q(Y,this.#w[j],this))return this.get(this.#w[j],_)}}forEach(q,_=this){for(let j of this.#E()){let K=this.#K[j],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0)continue;q.call(_,Y,this.#w[j],this)}}rforEach(q,_=this){for(let j of this.#m()){let K=this.#K[j],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0)continue;q.call(_,Y,this.#w[j],this)}}purgeStale(){let q=!1;for(let _ of this.#m({allowStale:!0}))if(this.#V(_))this.#R(this.#w[_],"expire"),q=!0;return q}info(q){let _=this.#v.get(q);if(_===void 0)return;let j=this.#K[_],K=this.#O(j)?j.__staleWhileFetching:j;if(K===void 0)return;let Y={value:K};if(this.#k&&this.#M){let f=this.#k[_],P=this.#M[_];if(f&&P){let $=f-(this.#z.now()-P);Y.ttl=$,Y.start=Date.now()}}if(this.#D)Y.size=this.#D[_];return Y}dump(){let q=[];for(let _ of this.#E({allowStale:!0})){let j=this.#w[_],K=this.#K[_],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0||j===void 0)continue;let f={value:Y};if(this.#k&&this.#M){f.ttl=this.#k[_];let P=this.#z.now()-this.#M[_];f.start=Math.floor(Date.now()-P)}if(this.#D)f.size=this.#D[_];q.unshift([j,f])}return q}load(q){this.clear();for(let[_,j]of q){if(j.start){let K=Date.now()-j.start;j.start=this.#z.now()-K}this.set(_,j.value,j)}}set(q,_,j={}){if(_===void 0)return this.delete(q),this;let{ttl:K=this.ttl,start:Y,noDisposeOnSet:f=this.noDisposeOnSet,sizeCalculation:P=this.sizeCalculation,status:$}=j,{noUpdateTTL:w=this.noUpdateTTL}=j,O=this.#y(q,_,j.size||0,P);if(this.maxEntrySize&&O>this.maxEntrySize){if($)$.set="miss",$.maxEntrySizeExceeded=!0;return this.#R(q,"set"),this}let v=this.#$===0?void 0:this.#v.get(q);if(v===void 0){if(v=this.#$===0?this.#T:this.#b.length!==0?this.#b.pop():this.#$===this.#q?this.#d(!1):this.#$,this.#w[v]=q,this.#K[v]=_,this.#v.set(q,v),this.#J[this.#T]=v,this.#u[v]=this.#T,this.#T=v,this.#$++,this.#l(v,O,$),$)$.set="add";if(w=!1,this.#j)this.#P?.(_,q,"add")}else{this.#p(v);let z=this.#K[v];if(_!==z){if(this.#N&&this.#O(z)){z.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:W}=z;if(W!==void 0&&!f){if(this.#h)this.#Y?.(W,q,"set");if(this.#H)this.#Z?.push([W,q,"set"])}}else if(!f){if(this.#h)this.#Y?.(z,q,"set");if(this.#H)this.#Z?.push([z,q,"set"])}if(this.#g(v),this.#l(v,O,$),this.#K[v]=_,$){$.set="replace";let W=z&&this.#O(z)?z.__staleWhileFetching:z;if(W!==void 0)$.oldValue=W}}else if($)$.set="update";if(this.#j)this.onInsert?.(_,q,_===z?"update":"replace")}if(K!==0&&!this.#k)this.#I();if(this.#k){if(!w)this.#n(v,K,Y);if($)this.#C($,v)}if(!f&&this.#H&&this.#Z){let z=this.#Z,W;while(W=z?.shift())this.#f?.(...W)}return this}pop(){try{while(this.#$){let q=this.#K[this.#A];if(this.#d(!0),this.#O(q)){if(q.__staleWhileFetching)return q.__staleWhileFetching}else if(q!==void 0)return q}}finally{if(this.#H&&this.#Z){let q=this.#Z,_;while(_=q?.shift())this.#f?.(..._)}}}#d(q){let _=this.#A,j=this.#w[_],K=this.#K[_];if(this.#N&&this.#O(K))K.__abortController.abort(new Error("evicted"));else if(this.#h||this.#H){if(this.#h)this.#Y?.(K,j,"evict");if(this.#H)this.#Z?.push([K,j,"evict"])}if(this.#g(_),q)this.#w[_]=void 0,this.#K[_]=void 0,this.#b.push(_);if(this.#$===1)this.#A=this.#T=0,this.#b.length=0;else this.#A=this.#J[_];return this.#v.delete(j),this.#$--,_}has(q,_={}){let{updateAgeOnHas:j=this.updateAgeOnHas,status:K}=_,Y=this.#v.get(q);if(Y!==void 0){let f=this.#K[Y];if(this.#O(f)&&f.__staleWhileFetching===void 0)return!1;if(!this.#V(Y)){if(j)this.#S(Y);if(K)K.has="hit",this.#C(K,Y);return!0}else if(K)K.has="stale",this.#C(K,Y)}else if(K)K.has="miss";return!1}peek(q,_={}){let{allowStale:j=this.allowStale}=_,K=this.#v.get(q);if(K===void 0||!j&&this.#V(K))return;let Y=this.#K[K];return this.#O(Y)?Y.__staleWhileFetching:Y}#r(q,_,j,K){let Y=_===void 0?void 0:this.#K[_];if(this.#O(Y))return Y;let f=new b7,{signal:P}=j;P?.addEventListener("abort",()=>f.abort(P.reason),{signal:f.signal});let $={signal:f.signal,options:j,context:K},w=(T,H=!1)=>{let{aborted:X}=f.signal,A=j.ignoreFetchAbort&&T!==void 0;if(j.status)if(X&&!H){if(j.status.fetchAborted=!0,j.status.fetchError=f.signal.reason,A)j.status.fetchAbortIgnored=!0}else j.status.fetchResolved=!0;if(X&&!A&&!H)return v(f.signal.reason);let G=W;if(this.#K[_]===W)if(T===void 0)if(G.__staleWhileFetching!==void 0)this.#K[_]=G.__staleWhileFetching;else this.#R(q,"fetch");else{if(j.status)j.status.fetchUpdated=!0;this.set(q,T,$.options)}return T},O=(T)=>{if(j.status)j.status.fetchRejected=!0,j.status.fetchError=T;return v(T)},v=(T)=>{let{aborted:H}=f.signal,X=H&&j.allowStaleOnFetchAbort,A=X||j.allowStaleOnFetchRejection,G=A||j.noDeleteOnFetchRejection,D=W;if(this.#K[_]===W){if(!G||D.__staleWhileFetching===void 0)this.#R(q,"fetch");else if(!X)this.#K[_]=D.__staleWhileFetching}if(A){if(j.status&&D.__staleWhileFetching!==void 0)j.status.returnedStale=!0;return D.__staleWhileFetching}else if(D.__returned===D)throw T},z=(T,H)=>{let X=this.#G?.(q,Y,$);if(X&&X instanceof Promise)X.then((A)=>T(A===void 0?void 0:A),H);f.signal.addEventListener("abort",()=>{if(!j.ignoreFetchAbort||j.allowStaleOnFetchAbort){if(T(void 0),j.allowStaleOnFetchAbort)T=(A)=>w(A,!0)}})};if(j.status)j.status.fetchDispatched=!0;let W=new Promise(z).then(w,O),J=Object.assign(W,{__abortController:f,__staleWhileFetching:Y,__returned:void 0});if(_===void 0)this.set(q,J,{...$.options,status:void 0}),_=this.#v.get(q);else this.#K[_]=J;return J}#O(q){if(!this.#N)return!1;let _=q;return!!_&&_ instanceof Promise&&_.hasOwnProperty("__staleWhileFetching")&&_.__abortController instanceof b7}async fetch(q,_={}){let{allowStale:j=this.allowStale,updateAgeOnGet:K=this.updateAgeOnGet,noDeleteOnStaleGet:Y=this.noDeleteOnStaleGet,ttl:f=this.ttl,noDisposeOnSet:P=this.noDisposeOnSet,size:$=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:O=this.noUpdateTTL,noDeleteOnFetchRejection:v=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:z=this.allowStaleOnFetchRejection,ignoreFetchAbort:W=this.ignoreFetchAbort,allowStaleOnFetchAbort:J=this.allowStaleOnFetchAbort,context:T,forceRefresh:H=!1,status:X,signal:A}=_;if(!this.#N){if(X)X.fetch="get";return this.get(q,{allowStale:j,updateAgeOnGet:K,noDeleteOnStaleGet:Y,status:X})}let G={allowStale:j,updateAgeOnGet:K,noDeleteOnStaleGet:Y,ttl:f,noDisposeOnSet:P,size:$,sizeCalculation:w,noUpdateTTL:O,noDeleteOnFetchRejection:v,allowStaleOnFetchRejection:z,allowStaleOnFetchAbort:J,ignoreFetchAbort:W,status:X,signal:A},D=this.#v.get(q);if(D===void 0){if(X)X.fetch="miss";let M=this.#r(q,D,G,T);return M.__returned=M}else{let M=this.#K[D];if(this.#O(M)){let b=j&&M.__staleWhileFetching!==void 0;if(X){if(X.fetch="inflight",b)X.returnedStale=!0}return b?M.__staleWhileFetching:M.__returned=M}let I=this.#V(D);if(!H&&!I){if(X)X.fetch="hit";if(this.#p(D),K)this.#S(D);if(X)this.#C(X,D);return M}let N=this.#r(q,D,G,T),L=N.__staleWhileFetching!==void 0&&j;if(X){if(X.fetch=I?"stale":"refresh",L&&I)X.returnedStale=!0}return L?N.__staleWhileFetching:N.__returned=N}}async forceFetch(q,_={}){let j=await this.fetch(q,_);if(j===void 0)throw new Error("fetch() returned undefined");return j}memo(q,_={}){let j=this.#X;if(!j)throw new Error("no memoMethod provided to constructor");let{context:K,forceRefresh:Y,...f}=_,P=this.get(q,f);if(!Y&&P!==void 0)return P;let $=j(q,P,{options:f,context:K});return this.set(q,$,f),$}get(q,_={}){let{allowStale:j=this.allowStale,updateAgeOnGet:K=this.updateAgeOnGet,noDeleteOnStaleGet:Y=this.noDeleteOnStaleGet,status:f}=_,P=this.#v.get(q);if(P!==void 0){let $=this.#K[P],w=this.#O($);if(f)this.#C(f,P);if(this.#V(P)){if(f)f.get="stale";if(!w){if(!Y)this.#R(q,"expire");if(f&&j)f.returnedStale=!0;return j?$:void 0}else{if(f&&j&&$.__staleWhileFetching!==void 0)f.returnedStale=!0;return j?$.__staleWhileFetching:void 0}}else{if(f)f.get="hit";if(w)return $.__staleWhileFetching;if(this.#p(P),K)this.#S(P);return $}}else if(f)f.get="miss"}#i(q,_){this.#u[_]=q,this.#J[q]=_}#p(q){if(q!==this.#T){if(q===this.#A)this.#A=this.#J[q];else this.#i(this.#u[q],this.#J[q]);this.#i(this.#T,q),this.#T=q}}delete(q){return this.#R(q,"delete")}#R(q,_){let j=!1;if(this.#$!==0){let K=this.#v.get(q);if(K!==void 0)if(j=!0,this.#$===1)this.#x(_);else{this.#g(K);let Y=this.#K[K];if(this.#O(Y))Y.__abortController.abort(new Error("deleted"));else if(this.#h||this.#H){if(this.#h)this.#Y?.(Y,q,_);if(this.#H)this.#Z?.push([Y,q,_])}if(this.#v.delete(q),this.#w[K]=void 0,this.#K[K]=void 0,K===this.#T)this.#T=this.#u[K];else if(K===this.#A)this.#A=this.#J[K];else{let f=this.#u[K];this.#J[f]=this.#J[K];let P=this.#J[K];this.#u[P]=this.#u[K]}this.#$--,this.#b.push(K)}}if(this.#H&&this.#Z?.length){let K=this.#Z,Y;while(Y=K?.shift())this.#f?.(...Y)}return j}clear(){return this.#x("delete")}#x(q){for(let _ of this.#m({allowStale:!0})){let j=this.#K[_];if(this.#O(j))j.__abortController.abort(new Error("deleted"));else{let K=this.#w[_];if(this.#h)this.#Y?.(j,K,q);if(this.#H)this.#Z?.push([j,K,q])}}if(this.#v.clear(),this.#K.fill(void 0),this.#w.fill(void 0),this.#k&&this.#M)this.#k.fill(0),this.#M.fill(0);if(this.#D)this.#D.fill(0);if(this.#A=0,this.#T=0,this.#b.length=0,this.#W=0,this.#$=0,this.#H&&this.#Z){let _=this.#Z,j;while(j=_?.shift())this.#f?.(...j)}}}import{posix as Ch,win32 as E9}from"node:path";import{fileURLToPath as Vh}from"node:url";import{lstatSync as Mh,readdir as Nh,readdirSync as bh,readlinkSync as Sh,realpathSync as Eh}from"fs";import*as Rh from"node:fs";import{lstat as Ih,readdir as gh,readlink as yh,realpath as dh}from"node:fs/promises";import{EventEmitter as M9}from"node:events";import of from"node:stream";import{StringDecoder as Jh}from"node:string_decoder";var xf=typeof process==="object"&&process?process:{stdout:null,stderr:null},Th=(q)=>!!q&&typeof q==="object"&&(q instanceof V_||q instanceof of||Zh(q)||kh(q)),Zh=(q)=>!!q&&typeof q==="object"&&q instanceof M9&&typeof q.pipe==="function"&&q.pipe!==of.Writable.prototype.pipe,kh=(q)=>!!q&&typeof q==="object"&&q instanceof M9&&typeof q.write==="function"&&typeof q.end==="function",cq=Symbol("EOF"),rq=Symbol("maybeEmitEnd"),j_=Symbol("emittedEnd"),S7=Symbol("emittingEnd"),X3=Symbol("emittedError"),E7=Symbol("closed"),nf=Symbol("read"),R7=Symbol("flush"),cf=Symbol("flushChunk"),Jq=Symbol("encoding"),AK=Symbol("decoder"),w6=Symbol("flowing"),A3=Symbol("paused"),GK=Symbol("resume"),O6=Symbol("buffer"),N6=Symbol("pipes"),z6=Symbol("bufferLength"),u9=Symbol("bufferPush"),m7=Symbol("bufferShift"),G6=Symbol("objectMode"),Q8=Symbol("destroyed"),h9=Symbol("error"),D9=Symbol("emitData"),rf=Symbol("emitEnd"),C9=Symbol("emitEnd2"),Dq=Symbol("async"),V9=Symbol("abort"),I7=Symbol("aborted"),G3=Symbol("signal"),C_=Symbol("dataListeners"),r6=Symbol("discarded"),u3=(q)=>Promise.resolve().then(q),Xh=(q)=>q(),Ah=(q)=>q==="end"||q==="finish"||q==="prefinish",Gh=(q)=>q instanceof ArrayBuffer||!!q&&typeof q==="object"&&q.constructor&&q.constructor.name==="ArrayBuffer"&&q.byteLength>=0,uh=(q)=>!Buffer.isBuffer(q)&&ArrayBuffer.isView(q);class N9{src;dest;opts;ondrain;constructor(q,_,j){this.src=q,this.dest=_,this.opts=j,this.ondrain=()=>q[GK](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(q){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class af extends N9{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(q,_,j){super(q,_,j);this.proxyErrors=(K)=>_.emit("error",K),q.on("error",this.proxyErrors)}}var hh=(q)=>!!q.objectMode,Dh=(q)=>!q.objectMode&&!!q.encoding&&q.encoding!=="buffer";class V_ extends M9{[w6]=!1;[A3]=!1;[N6]=[];[O6]=[];[G6];[Jq];[Dq];[AK];[cq]=!1;[j_]=!1;[S7]=!1;[E7]=!1;[X3]=null;[z6]=0;[Q8]=!1;[G3];[I7]=!1;[C_]=0;[r6]=!1;writable=!0;readable=!0;constructor(...q){let _=q[0]||{};super();if(_.objectMode&&typeof _.encoding==="string")throw new TypeError("Encoding and objectMode may not be used together");if(hh(_))this[G6]=!0,this[Jq]=null;else if(Dh(_))this[Jq]=_.encoding,this[G6]=!1;else this[G6]=!1,this[Jq]=null;if(this[Dq]=!!_.async,this[AK]=this[Jq]?new Jh(this[Jq]):null,_&&_.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[O6]});if(_&&_.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[N6]});let{signal:j}=_;if(j)if(this[G3]=j,j.aborted)this[V9]();else j.addEventListener("abort",()=>this[V9]())}get bufferLength(){return this[z6]}get encoding(){return this[Jq]}set encoding(q){throw new Error("Encoding must be set at instantiation time")}setEncoding(q){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[G6]}set objectMode(q){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[Dq]}set["async"](q){this[Dq]=this[Dq]||!!q}[V9](){this[I7]=!0,this.emit("abort",this[G3]?.reason),this.destroy(this[G3]?.reason)}get aborted(){return this[I7]}set aborted(q){}write(q,_,j){if(this[I7])return!1;if(this[cq])throw new Error("write after end");if(this[Q8])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof _==="function")j=_,_="utf8";if(!_)_="utf8";let K=this[Dq]?u3:Xh;if(!this[G6]&&!Buffer.isBuffer(q)){if(uh(q))q=Buffer.from(q.buffer,q.byteOffset,q.byteLength);else if(Gh(q))q=Buffer.from(q);else if(typeof q!=="string")throw new Error("Non-contiguous data written to non-objectMode stream")}if(this[G6]){if(this[w6]&&this[z6]!==0)this[R7](!0);if(this[w6])this.emit("data",q);else this[u9](q);if(this[z6]!==0)this.emit("readable");if(j)K(j);return this[w6]}if(!q.length){if(this[z6]!==0)this.emit("readable");if(j)K(j);return this[w6]}if(typeof q==="string"&&!(_===this[Jq]&&!this[AK]?.lastNeed))q=Buffer.from(q,_);if(Buffer.isBuffer(q)&&this[Jq])q=this[AK].write(q);if(this[w6]&&this[z6]!==0)this[R7](!0);if(this[w6])this.emit("data",q);else this[u9](q);if(this[z6]!==0)this.emit("readable");if(j)K(j);return this[w6]}read(q){if(this[Q8])return null;if(this[r6]=!1,this[z6]===0||q===0||q&&q>this[z6])return this[rq](),null;if(this[G6])q=null;if(this[O6].length>1&&!this[G6])this[O6]=[this[Jq]?this[O6].join(""):Buffer.concat(this[O6],this[z6])];let _=this[nf](q||null,this[O6][0]);return this[rq](),_}[nf](q,_){if(this[G6])this[m7]();else{let j=_;if(q===j.length||q===null)this[m7]();else if(typeof j==="string")this[O6][0]=j.slice(q),_=j.slice(0,q),this[z6]-=q;else this[O6][0]=j.subarray(q),_=j.subarray(0,q),this[z6]-=q}if(this.emit("data",_),!this[O6].length&&!this[cq])this.emit("drain");return _}end(q,_,j){if(typeof q==="function")j=q,q=void 0;if(typeof _==="function")j=_,_="utf8";if(q!==void 0)this.write(q,_);if(j)this.once("end",j);if(this[cq]=!0,this.writable=!1,this[w6]||!this[A3])this[rq]();return this}[GK](){if(this[Q8])return;if(!this[C_]&&!this[N6].length)this[r6]=!0;if(this[A3]=!1,this[w6]=!0,this.emit("resume"),this[O6].length)this[R7]();else if(this[cq])this[rq]();else this.emit("drain")}resume(){return this[GK]()}pause(){this[w6]=!1,this[A3]=!0,this[r6]=!1}get destroyed(){return this[Q8]}get flowing(){return this[w6]}get paused(){return this[A3]}[u9](q){if(this[G6])this[z6]+=1;else this[z6]+=q.length;this[O6].push(q)}[m7](){if(this[G6])this[z6]-=1;else this[z6]-=this[O6][0].length;return this[O6].shift()}[R7](q=!1){do;while(this[cf](this[m7]())&&this[O6].length);if(!q&&!this[O6].length&&!this[cq])this.emit("drain")}[cf](q){return this.emit("data",q),this[w6]}pipe(q,_){if(this[Q8])return q;this[r6]=!1;let j=this[j_];if(_=_||{},q===xf.stdout||q===xf.stderr)_.end=!1;else _.end=_.end!==!1;if(_.proxyErrors=!!_.proxyErrors,j){if(_.end)q.end()}else if(this[N6].push(!_.proxyErrors?new N9(this,q,_):new af(this,q,_)),this[Dq])u3(()=>this[GK]());else this[GK]();return q}unpipe(q){let _=this[N6].find((j)=>j.dest===q);if(_){if(this[N6].length===1){if(this[w6]&&this[C_]===0)this[w6]=!1;this[N6]=[]}else this[N6].splice(this[N6].indexOf(_),1);_.unpipe()}}addListener(q,_){return this.on(q,_)}on(q,_){let j=super.on(q,_);if(q==="data"){if(this[r6]=!1,this[C_]++,!this[N6].length&&!this[w6])this[GK]()}else if(q==="readable"&&this[z6]!==0)super.emit("readable");else if(Ah(q)&&this[j_])super.emit(q),this.removeAllListeners(q);else if(q==="error"&&this[X3]){let K=_;if(this[Dq])u3(()=>K.call(this,this[X3]));else K.call(this,this[X3])}return j}removeListener(q,_){return this.off(q,_)}off(q,_){let j=super.off(q,_);if(q==="data"){if(this[C_]=this.listeners("data").length,this[C_]===0&&!this[r6]&&!this[N6].length)this[w6]=!1}return j}removeAllListeners(q){let _=super.removeAllListeners(q);if(q==="data"||q===void 0){if(this[C_]=0,!this[r6]&&!this[N6].length)this[w6]=!1}return _}get emittedEnd(){return this[j_]}[rq](){if(!this[S7]&&!this[j_]&&!this[Q8]&&this[O6].length===0&&this[cq]){if(this[S7]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[E7])this.emit("close");this[S7]=!1}}emit(q,..._){let j=_[0];if(q!=="error"&&q!=="close"&&q!==Q8&&this[Q8])return!1;else if(q==="data")return!this[G6]&&!j?!1:this[Dq]?(u3(()=>this[D9](j)),!0):this[D9](j);else if(q==="end")return this[rf]();else if(q==="close"){if(this[E7]=!0,!this[j_]&&!this[Q8])return!1;let Y=super.emit("close");return this.removeAllListeners("close"),Y}else if(q==="error"){this[X3]=j,super.emit(h9,j);let Y=!this[G3]||this.listeners("error").length?super.emit("error",j):!1;return this[rq](),Y}else if(q==="resume"){let Y=super.emit("resume");return this[rq](),Y}else if(q==="finish"||q==="prefinish"){let Y=super.emit(q);return this.removeAllListeners(q),Y}let K=super.emit(q,..._);return this[rq](),K}[D9](q){for(let j of this[N6])if(j.dest.write(q)===!1)this.pause();let _=this[r6]?!1:super.emit("data",q);return this[rq](),_}[rf](){if(this[j_])return!1;return this[j_]=!0,this.readable=!1,this[Dq]?(u3(()=>this[C9]()),!0):this[C9]()}[C9](){if(this[AK]){let _=this[AK].end();if(_){for(let j of this[N6])j.dest.write(_);if(!this[r6])super.emit("data",_)}}for(let _ of this[N6])_.end();let q=super.emit("end");return this.removeAllListeners("end"),q}async collect(){let q=Object.assign([],{dataLength:0});if(!this[G6])q.dataLength=0;let _=this.promise();return this.on("data",(j)=>{if(q.push(j),!this[G6])q.dataLength+=j.length}),await _,q}async concat(){if(this[G6])throw new Error("cannot concat in objectMode");let q=await this.collect();return this[Jq]?q.join(""):Buffer.concat(q,q.dataLength)}async promise(){return new Promise((q,_)=>{this.on(Q8,()=>_(new Error("stream destroyed"))),this.on("error",(j)=>_(j)),this.on("end",()=>q())})}[Symbol.asyncIterator](){this[r6]=!1;let q=!1,_=async()=>{return this.pause(),q=!0,{value:void 0,done:!0}};return{next:()=>{if(q)return _();let K=this.read();if(K!==null)return Promise.resolve({done:!1,value:K});if(this[cq])return _();let Y,f,P=(v)=>{this.off("data",$),this.off("end",w),this.off(Q8,O),_(),f(v)},$=(v)=>{this.off("error",P),this.off("end",w),this.off(Q8,O),this.pause(),Y({value:v,done:!!this[cq]})},w=()=>{this.off("error",P),this.off("data",$),this.off(Q8,O),_(),Y({done:!0,value:void 0})},O=()=>P(new Error("stream destroyed"));return new Promise((v,z)=>{f=z,Y=v,this.once(Q8,O),this.once("error",P),this.once("end",w),this.once("data",$)})},throw:_,return:_,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[r6]=!1;let q=!1,_=()=>{return this.pause(),this.off(h9,_),this.off(Q8,_),this.off("end",_),q=!0,{done:!0,value:void 0}},j=()=>{if(q)return _();let K=this.read();return K===null?_():{done:!1,value:K}};return this.once("end",_),this.once(h9,_),this.once(Q8,_),{next:j,throw:_,return:_,[Symbol.iterator](){return this}}}destroy(q){if(this[Q8]){if(q)this.emit("error",q);else this.emit(Q8);return this}this[Q8]=!0,this[r6]=!0,this[O6].length=0,this[z6]=0;let _=this;if(typeof _.close==="function"&&!this[E7])_.close();if(q)this.emit("error",q);else this.emit(Q8);return this}static get isStream(){return Th}}var mh=Eh.native,D3={lstatSync:Mh,readdir:Nh,readdirSync:bh,readlinkSync:Sh,realpathSync:mh,promises:{lstat:Ih,readdir:gh,readlink:yh,realpath:dh}},Uf=(q)=>!q||q===D3||q===Rh?D3:{...D3,...q,promises:{...D3.promises,...q.promises||{}}},sf=/^\\\\\?\\([a-z]:)\\?$/i,ph=(q)=>q.replace(/\//g,"\\").replace(sf,"$1\\"),Lh=/[\\\/]/,Kq=0,Qf=1,q$=2,Cq=4,_$=6,K$=8,M_=10,j$=12,_q=15,h3=~_q,b9=16,Bf=32,C3=64,Tq=128,g7=256,d7=512,tf=C3|Tq|d7,lh=1023,S9=(q)=>q.isFile()?K$:q.isDirectory()?Cq:q.isSymbolicLink()?M_:q.isCharacterDevice()?q$:q.isBlockDevice()?_$:q.isSocket()?j$:q.isFIFO()?Qf:Kq,ef=new Map,V3=(q)=>{let _=ef.get(q);if(_)return _;let j=q.normalize("NFKD");return ef.set(q,j),j},Ff=new Map,y7=(q)=>{let _=Ff.get(q);if(_)return _;let j=V3(q.toLowerCase());return Ff.set(q,j),j};class R9 extends k3{constructor(){super({max:256})}}class P$ extends k3{constructor(q=16384){super({maxSize:q,sizeCalculation:(_)=>_.length+1})}}var Y$=Symbol("PathScurry setAsCwd");class b6{name;root;roots;parent;nocase;isCWD=!1;#q;#_;get dev(){return this.#_}#Y;get mode(){return this.#Y}#P;get nlink(){return this.#P}#f;get uid(){return this.#f}#G;get gid(){return this.#G}#X;get rdev(){return this.#X}#z;get blksize(){return this.#z}#$;get ino(){return this.#$}#W;get size(){return this.#W}#v;get blocks(){return this.#v}#w;get atimeMs(){return this.#w}#K;get mtimeMs(){return this.#K}#J;get ctimeMs(){return this.#J}#u;get birthtimeMs(){return this.#u}#A;get atime(){return this.#A}#T;get mtime(){return this.#T}#b;get ctime(){return this.#b}#Z;get birthtime(){return this.#Z}#D;#M;#k;#h;#N;#H;#j;#I;#S;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(q,_=Kq,j,K,Y,f,P){if(this.name=q,this.#D=Y?y7(q):V3(q),this.#j=_&lh,this.nocase=Y,this.roots=K,this.root=j||this,this.#I=f,this.#k=P.fullpath,this.#N=P.relative,this.#H=P.relativePosix,this.parent=P.parent,this.parent)this.#q=this.parent.#q;else this.#q=Uf(P.fs)}depth(){if(this.#M!==void 0)return this.#M;if(!this.parent)return this.#M=0;return this.#M=this.parent.depth()+1}childrenCache(){return this.#I}resolve(q){if(!q)return this;let _=this.getRootString(q),K=q.substring(_.length).split(this.splitSep);return _?this.getRoot(_).#n(K):this.#n(K)}#n(q){let _=this;for(let j of q)_=_.child(j);return _}children(){let q=this.#I.get(this);if(q)return q;let _=Object.assign([],{provisional:0});return this.#I.set(this,_),this.#j&=~b9,_}child(q,_){if(q===""||q===".")return this;if(q==="..")return this.parent||this;let j=this.children(),K=this.nocase?y7(q):V3(q);for(let $ of j)if($.#D===K)return $;let Y=this.parent?this.sep:"",f=this.#k?this.#k+Y+q:void 0,P=this.newChild(q,Kq,{..._,parent:this,fullpath:f});if(!this.canReaddir())P.#j|=Tq;return j.push(P),P}relative(){if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let q=this.name,_=this.parent;if(!_)return this.#N=this.name;let j=_.relative();return j+(!j||!_.parent?"":this.sep)+q}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#H!==void 0)return this.#H;let q=this.name,_=this.parent;if(!_)return this.#H=this.fullpathPosix();let j=_.relativePosix();return j+(!j||!_.parent?"":"/")+q}fullpath(){if(this.#k!==void 0)return this.#k;let q=this.name,_=this.parent;if(!_)return this.#k=this.name;let K=_.fullpath()+(!_.parent?"":this.sep)+q;return this.#k=K}fullpathPosix(){if(this.#h!==void 0)return this.#h;if(this.sep==="/")return this.#h=this.fullpath();if(!this.parent){let K=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(K))return this.#h=`//?/${K}`;else return this.#h=K}let q=this.parent,_=q.fullpathPosix(),j=_+(!_||!q.parent?"":"/")+this.name;return this.#h=j}isUnknown(){return(this.#j&_q)===Kq}isType(q){return this[`is${q}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#j&_q)===K$}isDirectory(){return(this.#j&_q)===Cq}isCharacterDevice(){return(this.#j&_q)===q$}isBlockDevice(){return(this.#j&_q)===_$}isFIFO(){return(this.#j&_q)===Qf}isSocket(){return(this.#j&_q)===j$}isSymbolicLink(){return(this.#j&M_)===M_}lstatCached(){return this.#j&Bf?this:void 0}readlinkCached(){return this.#S}realpathCached(){return this.#C}readdirCached(){let q=this.children();return q.slice(0,q.provisional)}canReadlink(){if(this.#S)return!0;if(!this.parent)return!1;let q=this.#j&_q;return!(q!==Kq&&q!==M_||this.#j&g7||this.#j&Tq)}calledReaddir(){return!!(this.#j&b9)}isENOENT(){return!!(this.#j&Tq)}isNamed(q){return!this.nocase?this.#D===V3(q):this.#D===y7(q)}async readlink(){let q=this.#S;if(q)return q;if(!this.canReadlink())return;if(!this.parent)return;try{let _=await this.#q.promises.readlink(this.fullpath()),j=(await this.parent.realpath())?.resolve(_);if(j)return this.#S=j}catch(_){this.#c(_.code);return}}readlinkSync(){let q=this.#S;if(q)return q;if(!this.canReadlink())return;if(!this.parent)return;try{let _=this.#q.readlinkSync(this.fullpath()),j=this.parent.realpathSync()?.resolve(_);if(j)return this.#S=j}catch(_){this.#c(_.code);return}}#V(q){this.#j|=b9;for(let _=q.provisional;_j(null,q))}readdirCB(q,_=!1){if(!this.canReaddir()){if(_)q(null,[]);else queueMicrotask(()=>q(null,[]));return}let j=this.children();if(this.calledReaddir()){let Y=j.slice(0,j.provisional);if(_)q(null,Y);else queueMicrotask(()=>q(null,Y));return}if(this.#R.push(q),this.#x)return;this.#x=!0;let K=this.fullpath();this.#q.readdir(K,{withFileTypes:!0},(Y,f)=>{if(Y)this.#E(Y.code),j.provisional=0;else{for(let P of f)this.#d(P,j);this.#V(j)}this.#a(j.slice(0,j.provisional));return})}#o;async readdir(){if(!this.canReaddir())return[];let q=this.children();if(this.calledReaddir())return q.slice(0,q.provisional);let _=this.fullpath();if(this.#o)await this.#o;else{let j=()=>{};this.#o=new Promise((K)=>j=K);try{for(let K of await this.#q.promises.readdir(_,{withFileTypes:!0}))this.#d(K,q);this.#V(q)}catch(K){this.#E(K.code),q.provisional=0}this.#o=void 0,j()}return q.slice(0,q.provisional)}readdirSync(){if(!this.canReaddir())return[];let q=this.children();if(this.calledReaddir())return q.slice(0,q.provisional);let _=this.fullpath();try{for(let j of this.#q.readdirSync(_,{withFileTypes:!0}))this.#d(j,q);this.#V(q)}catch(j){this.#E(j.code),q.provisional=0}return q.slice(0,q.provisional)}canReaddir(){if(this.#j&tf)return!1;let q=_q&this.#j;if(!(q===Kq||q===Cq||q===M_))return!1;return!0}shouldWalk(q,_){return(this.#j&Cq)===Cq&&!(this.#j&tf)&&!q.has(this)&&(!_||_(this))}async realpath(){if(this.#C)return this.#C;if((d7|g7|Tq)&this.#j)return;try{let q=await this.#q.promises.realpath(this.fullpath());return this.#C=this.resolve(q)}catch(q){this.#l()}}realpathSync(){if(this.#C)return this.#C;if((d7|g7|Tq)&this.#j)return;try{let q=this.#q.realpathSync(this.fullpath());return this.#C=this.resolve(q)}catch(q){this.#l()}}[Y$](q){if(q===this)return;q.isCWD=!1,this.isCWD=!0;let _=new Set([]),j=[],K=this;while(K&&K.parent)_.add(K),K.#N=j.join(this.sep),K.#H=j.join("/"),K=K.parent,j.push("..");K=q;while(K&&K.parent&&!_.has(K))K.#N=void 0,K.#H=void 0,K=K.parent}}class p7 extends b6{sep="\\";splitSep=Lh;constructor(q,_=Kq,j,K,Y,f,P){super(q,_,j,K,Y,f,P)}newChild(q,_=Kq,j={}){return new p7(q,_,this.root,this.roots,this.nocase,this.childrenCache(),j)}getRootString(q){return E9.parse(q).root}getRoot(q){if(q=ph(q.toUpperCase()),q===this.root.name)return this.root;for(let[_,j]of Object.entries(this.roots))if(this.sameRoot(q,_))return this.roots[q]=j;return this.roots[q]=new M3(q,this).root}sameRoot(q,_=this.root.name){return q=q.toUpperCase().replace(/\//g,"\\").replace(sf,"$1\\"),q===_}}class L7 extends b6{splitSep="/";sep="/";constructor(q,_=Kq,j,K,Y,f,P){super(q,_,j,K,Y,f,P)}getRootString(q){return q.startsWith("/")?"/":""}getRoot(q){return this.root}newChild(q,_=Kq,j={}){return new L7(q,_,this.root,this.roots,this.nocase,this.childrenCache(),j)}}class m9{root;rootPath;roots;cwd;#q;#_;#Y;nocase;#P;constructor(q=process.cwd(),_,j,{nocase:K,childrenCacheSize:Y=16384,fs:f=D3}={}){if(this.#P=Uf(f),q instanceof URL||q.startsWith("file://"))q=Vh(q);let P=_.resolve(q);this.roots=Object.create(null),this.rootPath=this.parseRootPath(P),this.#q=new R9,this.#_=new R9,this.#Y=new P$(Y);let $=P.substring(this.rootPath.length).split(j);if($.length===1&&!$[0])$.pop();if(K===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=K,this.root=this.newRoot(this.#P),this.roots[this.rootPath]=this.root;let w=this.root,O=$.length-1,v=_.sep,z=this.rootPath,W=!1;for(let J of $){let T=O--;w=w.child(J,{relative:new Array(T).fill("..").join(v),relativePosix:new Array(T).fill("..").join("/"),fullpath:z+=(W?"":v)+J}),W=!0}this.cwd=w}depth(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.depth()}childrenCache(){return this.#Y}resolve(...q){let _="";for(let Y=q.length-1;Y>=0;Y--){let f=q[Y];if(!f||f===".")continue;if(_=_?`${f}/${_}`:f,this.isAbsolute(f))break}let j=this.#q.get(_);if(j!==void 0)return j;let K=this.cwd.resolve(_).fullpath();return this.#q.set(_,K),K}resolvePosix(...q){let _="";for(let Y=q.length-1;Y>=0;Y--){let f=q[Y];if(!f||f===".")continue;if(_=_?`${f}/${_}`:f,this.isAbsolute(f))break}let j=this.#_.get(_);if(j!==void 0)return j;let K=this.cwd.resolve(_).fullpathPosix();return this.#_.set(_,K),K}relative(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.relative()}relativePosix(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.relativePosix()}basename(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.name}dirname(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return(q.parent||q).fullpath()}async readdir(q=this.cwd,_={withFileTypes:!0}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;let{withFileTypes:j}=_;if(!q.canReaddir())return[];else{let K=await q.readdir();return j?K:K.map((Y)=>Y.name)}}readdirSync(q=this.cwd,_={withFileTypes:!0}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;let{withFileTypes:j=!0}=_;if(!q.canReaddir())return[];else if(j)return q.readdirSync();else return q.readdirSync().map((K)=>K.name)}async lstat(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.lstat()}lstatSync(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.lstatSync()}async readlink(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q.withFileTypes,q=this.cwd;let j=await q.readlink();return _?j:j?.fullpath()}readlinkSync(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q.withFileTypes,q=this.cwd;let j=q.readlinkSync();return _?j:j?.fullpath()}async realpath(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q.withFileTypes,q=this.cwd;let j=await q.realpath();return _?j:j?.fullpath()}realpathSync(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q.withFileTypes,q=this.cwd;let j=q.realpathSync();return _?j:j?.fullpath()}async walk(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=[];if(!Y||Y(q))P.push(j?q:q.fullpath());let $=new Set,w=(v,z)=>{$.add(v),v.readdirCB((W,J)=>{if(W)return z(W);let T=J.length;if(!T)return z();let H=()=>{if(--T===0)z()};for(let X of J){if(!Y||Y(X))P.push(j?X:X.fullpath());if(K&&X.isSymbolicLink())X.realpath().then((A)=>A?.isUnknown()?A.lstat():A).then((A)=>A?.shouldWalk($,f)?w(A,H):H());else if(X.shouldWalk($,f))w(X,H);else H()}},!0)},O=q;return new Promise((v,z)=>{w(O,(W)=>{if(W)return z(W);v(P)})})}walkSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=[];if(!Y||Y(q))P.push(j?q:q.fullpath());let $=new Set([q]);for(let w of $){let O=w.readdirSync();for(let v of O){if(!Y||Y(v))P.push(j?v:v.fullpath());let z=v;if(v.isSymbolicLink()){if(!(K&&(z=v.realpathSync())))continue;if(z.isUnknown())z.lstatSync()}if(z.shouldWalk($,f))$.add(z)}}return P}[Symbol.asyncIterator](){return this.iterate()}iterate(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;return this.stream(q,_)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_;if(!Y||Y(q))yield j?q:q.fullpath();let P=new Set([q]);for(let $ of P){let w=$.readdirSync();for(let O of w){if(!Y||Y(O))yield j?O:O.fullpath();let v=O;if(O.isSymbolicLink()){if(!(K&&(v=O.realpathSync())))continue;if(v.isUnknown())v.lstatSync()}if(v.shouldWalk(P,f))P.add(v)}}}stream(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=new V_({objectMode:!0});if(!Y||Y(q))P.write(j?q:q.fullpath());let $=new Set,w=[q],O=0,v=()=>{let z=!1;while(!z){let W=w.shift();if(!W){if(O===0)P.end();return}O++,$.add(W);let J=(H,X,A=!1)=>{if(H)return P.emit("error",H);if(K&&!A){let G=[];for(let D of X)if(D.isSymbolicLink())G.push(D.realpath().then((M)=>M?.isUnknown()?M.lstat():M));if(G.length){Promise.all(G).then(()=>J(null,X,!0));return}}for(let G of X)if(G&&(!Y||Y(G))){if(!P.write(j?G:G.fullpath()))z=!0}O--;for(let G of X){let D=G.realpathCached()||G;if(D.shouldWalk($,f))w.push(D)}if(z&&!P.flowing)P.once("drain",v);else if(!T)v()},T=!0;W.readdirCB(J,!0),T=!1}};return v(),P}streamSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=new V_({objectMode:!0}),$=new Set;if(!Y||Y(q))P.write(j?q:q.fullpath());let w=[q],O=0,v=()=>{let z=!1;while(!z){let W=w.shift();if(!W){if(O===0)P.end();return}O++,$.add(W);let J=W.readdirSync();for(let T of J)if(!Y||Y(T)){if(!P.write(j?T:T.fullpath()))z=!0}O--;for(let T of J){let H=T;if(T.isSymbolicLink()){if(!(K&&(H=T.realpathSync())))continue;if(H.isUnknown())H.lstatSync()}if(H.shouldWalk($,f))w.push(H)}}if(z&&!P.flowing)P.once("drain",v)};return v(),P}chdir(q=this.cwd){let _=this.cwd;this.cwd=typeof q==="string"?this.cwd.resolve(q):q,this.cwd[Y$](_)}}class M3 extends m9{sep="\\";constructor(q=process.cwd(),_={}){let{nocase:j=!0}=_;super(q,E9,"\\",{..._,nocase:j});this.nocase=j;for(let K=this.cwd;K;K=K.parent)K.nocase=this.nocase}parseRootPath(q){return E9.parse(q).root.toUpperCase()}newRoot(q){return new p7(this.rootPath,Cq,void 0,this.roots,this.nocase,this.childrenCache(),{fs:q})}isAbsolute(q){return q.startsWith("/")||q.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(q)}}class N3 extends m9{sep="/";constructor(q=process.cwd(),_={}){let{nocase:j=!1}=_;super(q,Ch,"/",{..._,nocase:j});this.nocase=j}parseRootPath(q){return"/"}newRoot(q){return new L7(this.rootPath,Cq,void 0,this.roots,this.nocase,this.childrenCache(),{fs:q})}isAbsolute(q){return q.startsWith("/")}}class l7 extends N3{constructor(q=process.cwd(),_={}){let{nocase:j=!0}=_;super(q,{..._,nocase:j})}}var jN=process.platform==="win32"?p7:L7,f$=process.platform==="win32"?M3:process.platform==="darwin"?l7:N3;var xh=(q)=>q.length>=1,nh=(q)=>q.length>=1;class uK{#q;#_;#Y;length;#P;#f;#G;#X;#z;#$;#W=!0;constructor(q,_,j,K){if(!xh(q))throw new TypeError("empty pattern list");if(!nh(_))throw new TypeError("empty glob list");if(_.length!==q.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=q.length,j<0||j>=this.length)throw new TypeError("index out of range");if(this.#q=q,this.#_=_,this.#Y=j,this.#P=K,this.#Y===0){if(this.isUNC()){let[Y,f,P,$,...w]=this.#q,[O,v,z,W,...J]=this.#_;if(w[0]==="")w.shift(),J.shift();let T=[Y,f,P,$,""].join("/"),H=[O,v,z,W,""].join("/");this.#q=[T,...w],this.#_=[H,...J],this.length=this.#q.length}else if(this.isDrive()||this.isAbsolute()){let[Y,...f]=this.#q,[P,...$]=this.#_;if(f[0]==="")f.shift(),$.shift();let w=Y+"/",O=P+"/";this.#q=[w,...f],this.#_=[O,...$],this.length=this.#q.length}}}pattern(){return this.#q[this.#Y]}isString(){return typeof this.#q[this.#Y]==="string"}isGlobstar(){return this.#q[this.#Y]===T6}isRegExp(){return this.#q[this.#Y]instanceof RegExp}globString(){return this.#G=this.#G||(this.#Y===0?this.isAbsolute()?this.#_[0]+this.#_.slice(1).join("/"):this.#_.join("/"):this.#_.slice(this.#Y).join("/"))}hasMore(){return this.length>this.#Y+1}rest(){if(this.#f!==void 0)return this.#f;if(!this.hasMore())return this.#f=null;return this.#f=new uK(this.#q,this.#_,this.#Y+1,this.#P),this.#f.#$=this.#$,this.#f.#z=this.#z,this.#f.#X=this.#X,this.#f}isUNC(){let q=this.#q;return this.#z!==void 0?this.#z:this.#z=this.#P==="win32"&&this.#Y===0&&q[0]===""&&q[1]===""&&typeof q[2]==="string"&&!!q[2]&&typeof q[3]==="string"&&!!q[3]}isDrive(){let q=this.#q;return this.#X!==void 0?this.#X:this.#X=this.#P==="win32"&&this.#Y===0&&this.length>1&&typeof q[0]==="string"&&/^[a-z]:$/i.test(q[0])}isAbsolute(){let q=this.#q;return this.#$!==void 0?this.#$:this.#$=q[0]===""&&q.length>1||this.isDrive()||this.isUNC()}root(){let q=this.#q[0];return typeof q==="string"&&this.isAbsolute()&&this.#Y===0?q:""}checkFollowGlobstar(){return!(this.#Y===0||!this.isGlobstar()||!this.#W)}markFollowGlobstar(){if(this.#Y===0||!this.isGlobstar()||!this.#W)return!1;return this.#W=!1,!0}}var ch=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class b3{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(q,{nobrace:_,nocase:j,noext:K,noglobstar:Y,platform:f=ch}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=f,this.mmopts={dot:!0,nobrace:_,nocase:j,noext:K,noglobstar:Y,optimizationLevel:2,platform:f,nocomment:!0,nonegate:!0};for(let P of q)this.add(P)}add(q){let _=new qq(q,this.mmopts);for(let j=0;j<_.set.length;j++){let K=_.set[j],Y=_.globParts[j];if(!K||!Y)throw new Error("invalid pattern object");while(K[0]==="."&&Y[0]===".")K.shift(),Y.shift();let f=new uK(K,Y,0,this.platform),P=new qq(f.globString(),this.mmopts),$=Y[Y.length-1]==="**",w=f.isAbsolute();if(w)this.absolute.push(P);else this.relative.push(P);if($)if(w)this.absoluteChildren.push(P);else this.relativeChildren.push(P)}}ignored(q){let _=q.fullpath(),j=`${_}/`,K=q.relative()||".",Y=`${K}/`;for(let f of this.relative)if(f.match(K)||f.match(Y))return!0;for(let f of this.absolute)if(f.match(_)||f.match(j))return!0;return!1}childrenIgnored(q){let _=q.fullpath()+"/",j=(q.relative()||".")+"/";for(let K of this.relativeChildren)if(K.match(j))return!0;for(let K of this.absoluteChildren)if(K.match(_))return!0;return!1}}class I9{store;constructor(q=new Map){this.store=q}copy(){return new I9(new Map(this.store))}hasWalked(q,_){return this.store.get(q.fullpath())?.has(_.globString())}storeWalked(q,_){let j=q.fullpath(),K=this.store.get(j);if(K)K.add(_.globString());else this.store.set(j,new Set([_.globString()]))}}class $${store=new Map;add(q,_,j){let K=(_?2:0)|(j?1:0),Y=this.store.get(q);this.store.set(q,Y===void 0?K:K&Y)}entries(){return[...this.store.entries()].map(([q,_])=>[q,!!(_&2),!!(_&1)])}}class w${store=new Map;add(q,_){if(!q.canReaddir())return;let j=this.store.get(q);if(j){if(!j.find((K)=>K.globString()===_.globString()))j.push(_)}else this.store.set(q,[_])}get(q){let _=this.store.get(q);if(!_)throw new Error("attempting to walk unknown path");return _}entries(){return this.keys().map((q)=>[q,this.store.get(q)])}keys(){return[...this.store.keys()].filter((q)=>q.canReaddir())}}class S3{hasWalkedCache;matches=new $$;subwalks=new w$;patterns;follow;dot;opts;constructor(q,_){this.opts=q,this.follow=!!q.follow,this.dot=!!q.dot,this.hasWalkedCache=_?_.copy():new I9}processPatterns(q,_){this.patterns=_;let j=_.map((K)=>[q,K]);for(let[K,Y]of j){this.hasWalkedCache.storeWalked(K,Y);let f=Y.root(),P=Y.isAbsolute()&&this.opts.absolute!==!1;if(f){K=K.resolve(f==="/"&&this.opts.root!==void 0?this.opts.root:f);let v=Y.rest();if(!v){this.matches.add(K,!0,!1);continue}else Y=v}if(K.isENOENT())continue;let $,w,O=!1;while(typeof($=Y.pattern())==="string"&&(w=Y.rest()))K=K.resolve($),Y=w,O=!0;if($=Y.pattern(),w=Y.rest(),O){if(this.hasWalkedCache.hasWalked(K,Y))continue;this.hasWalkedCache.storeWalked(K,Y)}if(typeof $==="string"){let v=$===".."||$===""||$===".";this.matches.add(K.resolve($),P,v);continue}else if($===T6){if(!K.isSymbolicLink()||this.follow||Y.checkFollowGlobstar())this.subwalks.add(K,Y);let v=w?.pattern(),z=w?.rest();if(!w||(v===""||v===".")&&!z)this.matches.add(K,P,v===""||v===".");else if(v===".."){let W=K.parent||K;if(!z)this.matches.add(W,P,!0);else if(!this.hasWalkedCache.hasWalked(W,z))this.subwalks.add(W,z)}}else if($ instanceof RegExp)this.subwalks.add(K,Y)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new S3(this.opts,this.hasWalkedCache)}filterEntries(q,_){let j=this.subwalks.get(q),K=this.child();for(let Y of _)for(let f of j){let P=f.isAbsolute(),$=f.pattern(),w=f.rest();if($===T6)K.testGlobstar(Y,f,w,P);else if($ instanceof RegExp)K.testRegExp(Y,$,w,P);else K.testString(Y,$,w,P)}return K}testGlobstar(q,_,j,K){if(this.dot||!q.name.startsWith(".")){if(!_.hasMore())this.matches.add(q,K,!1);if(q.canReaddir()){if(this.follow||!q.isSymbolicLink())this.subwalks.add(q,_);else if(q.isSymbolicLink()){if(j&&_.checkFollowGlobstar())this.subwalks.add(q,j);else if(_.markFollowGlobstar())this.subwalks.add(q,_)}}}if(j){let Y=j.pattern();if(typeof Y==="string"&&Y!==".."&&Y!==""&&Y!==".")this.testString(q,Y,j.rest(),K);else if(Y===".."){let f=q.parent||q;this.subwalks.add(f,j)}else if(Y instanceof RegExp)this.testRegExp(q,Y,j.rest(),K)}}testRegExp(q,_,j,K){if(!_.test(q.name))return;if(!j)this.matches.add(q,K,!1);else this.subwalks.add(q,j)}testString(q,_,j,K){if(!q.isNamed(_))return;if(!j)this.matches.add(q,K,!1);else this.subwalks.add(q,j)}}var rh=(q,_)=>typeof q==="string"?new b3([q],_):Array.isArray(q)?new b3(q,_):q;class g9{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#q=[];#_;#Y;signal;maxDepth;includeChildMatches;constructor(q,_,j){if(this.patterns=q,this.path=_,this.opts=j,this.#Y=!j.posix&&j.platform==="win32"?"\\":"/",this.includeChildMatches=j.includeChildMatches!==!1,j.ignore||!this.includeChildMatches){if(this.#_=rh(j.ignore??[],j),!this.includeChildMatches&&typeof this.#_.add!=="function")throw new Error("cannot ignore child matches, ignore lacks add() method.")}if(this.maxDepth=j.maxDepth||1/0,j.signal)this.signal=j.signal,this.signal.addEventListener("abort",()=>{this.#q.length=0})}#P(q){return this.seen.has(q)||!!this.#_?.ignored?.(q)}#f(q){return!!this.#_?.childrenIgnored?.(q)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let q=void 0;while(!this.paused&&(q=this.#q.shift()))q()}onResume(q){if(this.signal?.aborted)return;if(!this.paused)q();else this.#q.push(q)}async matchCheck(q,_){if(_&&this.opts.nodir)return;let j;if(this.opts.realpath){if(j=q.realpathCached()||await q.realpath(),!j)return;q=j}let Y=q.isUnknown()||this.opts.stat?await q.lstat():q;if(this.opts.follow&&this.opts.nodir&&Y?.isSymbolicLink()){let f=await Y.realpath();if(f&&(f.isUnknown()||this.opts.stat))await f.lstat()}return this.matchCheckTest(Y,_)}matchCheckTest(q,_){return q&&(this.maxDepth===1/0||q.depth()<=this.maxDepth)&&(!_||q.canReaddir())&&(!this.opts.nodir||!q.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!q.isSymbolicLink()||!q.realpathCached()?.isDirectory())&&!this.#P(q)?q:void 0}matchCheckSync(q,_){if(_&&this.opts.nodir)return;let j;if(this.opts.realpath){if(j=q.realpathCached()||q.realpathSync(),!j)return;q=j}let Y=q.isUnknown()||this.opts.stat?q.lstatSync():q;if(this.opts.follow&&this.opts.nodir&&Y?.isSymbolicLink()){let f=Y.realpathSync();if(f&&(f?.isUnknown()||this.opts.stat))f.lstatSync()}return this.matchCheckTest(Y,_)}matchFinish(q,_){if(this.#P(q))return;if(!this.includeChildMatches&&this.#_?.add){let Y=`${q.relativePosix()}/**`;this.#_.add(Y)}let j=this.opts.absolute===void 0?_:this.opts.absolute;this.seen.add(q);let K=this.opts.mark&&q.isDirectory()?this.#Y:"";if(this.opts.withFileTypes)this.matchEmit(q);else if(j){let Y=this.opts.posix?q.fullpathPosix():q.fullpath();this.matchEmit(Y+K)}else{let Y=this.opts.posix?q.relativePosix():q.relative(),f=this.opts.dotRelative&&!Y.startsWith(".."+this.#Y)?"."+this.#Y:"";this.matchEmit(!Y?"."+K:f+Y+K)}}async match(q,_,j){let K=await this.matchCheck(q,j);if(K)this.matchFinish(K,_)}matchSync(q,_,j){let K=this.matchCheckSync(q,j);if(K)this.matchFinish(K,_)}walkCB(q,_,j){if(this.signal?.aborted)j();this.walkCB2(q,_,new S3(this.opts),j)}walkCB2(q,_,j,K){if(this.#f(q))return K();if(this.signal?.aborted)K();if(this.paused){this.onResume(()=>this.walkCB2(q,_,j,K));return}j.processPatterns(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,w]of j.matches.entries()){if(this.#P(P))continue;Y++,this.match(P,$,w).then(()=>f())}for(let P of j.subwalkTargets()){if(this.maxDepth!==1/0&&P.depth()>=this.maxDepth)continue;Y++;let $=P.readdirCached();if(P.calledReaddir())this.walkCB3(P,$,j,f);else P.readdirCB((w,O)=>this.walkCB3(P,O,j,f),!0)}f()}walkCB3(q,_,j,K){j=j.filterEntries(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,w]of j.matches.entries()){if(this.#P(P))continue;Y++,this.match(P,$,w).then(()=>f())}for(let[P,$]of j.subwalks.entries())Y++,this.walkCB2(P,$,j.child(),f);f()}walkCBSync(q,_,j){if(this.signal?.aborted)j();this.walkCB2Sync(q,_,new S3(this.opts),j)}walkCB2Sync(q,_,j,K){if(this.#f(q))return K();if(this.signal?.aborted)K();if(this.paused){this.onResume(()=>this.walkCB2Sync(q,_,j,K));return}j.processPatterns(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,w]of j.matches.entries()){if(this.#P(P))continue;this.matchSync(P,$,w)}for(let P of j.subwalkTargets()){if(this.maxDepth!==1/0&&P.depth()>=this.maxDepth)continue;Y++;let $=P.readdirSync();this.walkCB3Sync(P,$,j,f)}f()}walkCB3Sync(q,_,j,K){j=j.filterEntries(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,w]of j.matches.entries()){if(this.#P(P))continue;this.matchSync(P,$,w)}for(let[P,$]of j.subwalks.entries())Y++,this.walkCB2Sync(P,$,j.child(),f);f()}}class x7 extends g9{matches=new Set;constructor(q,_,j){super(q,_,j)}matchEmit(q){this.matches.add(q)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())await this.path.lstat();return await new Promise((q,_)=>{this.walkCB(this.path,this.patterns,()=>{if(this.signal?.aborted)_(this.signal.reason);else q(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}}class n7 extends g9{results;constructor(q,_,j){super(q,_,j);this.results=new V_({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(q){if(this.results.write(q),!this.results.flowing)this.pause()}stream(){let q=this.path;if(q.isUnknown())q.lstat().then(()=>{this.walkCB(q,this.patterns,()=>this.results.end())});else this.walkCB(q,this.patterns,()=>this.results.end());return this.results}streamSync(){if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}var oh=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Vq{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(q,_){if(!_)throw new TypeError("glob options required");if(this.withFileTypes=!!_.withFileTypes,this.signal=_.signal,this.follow=!!_.follow,this.dot=!!_.dot,this.dotRelative=!!_.dotRelative,this.nodir=!!_.nodir,this.mark=!!_.mark,!_.cwd)this.cwd="";else if(_.cwd instanceof URL||_.cwd.startsWith("file://"))_.cwd=ih(_.cwd);if(this.cwd=_.cwd||"",this.root=_.root,this.magicalBraces=!!_.magicalBraces,this.nobrace=!!_.nobrace,this.noext=!!_.noext,this.realpath=!!_.realpath,this.absolute=_.absolute,this.includeChildMatches=_.includeChildMatches!==!1,this.noglobstar=!!_.noglobstar,this.matchBase=!!_.matchBase,this.maxDepth=typeof _.maxDepth==="number"?_.maxDepth:1/0,this.stat=!!_.stat,this.ignore=_.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof q==="string")q=[q];if(this.windowsPathsNoEscape=!!_.windowsPathsNoEscape||_.allowWindowsEscape===!1,this.windowsPathsNoEscape)q=q.map(($)=>$.replace(/\\/g,"/"));if(this.matchBase){if(_.noglobstar)throw new TypeError("base matching requires globstar");q=q.map(($)=>$.includes("/")?$:`./**/${$}`)}if(this.pattern=q,this.platform=_.platform||oh,this.opts={..._,platform:this.platform},_.scurry){if(this.scurry=_.scurry,_.nocase!==void 0&&_.nocase!==_.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let $=_.platform==="win32"?M3:_.platform==="darwin"?l7:_.platform?N3:f$;this.scurry=new $(this.cwd,{nocase:_.nocase,fs:_.fs})}this.nocase=this.scurry.nocase;let j=this.platform==="darwin"||this.platform==="win32",K={..._,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:j,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},Y=this.pattern.map(($)=>new qq($,K)),[f,P]=Y.reduce(($,w)=>{return $[0].push(...w.set),$[1].push(...w.globParts),$},[[],[]]);this.patterns=f.map(($,w)=>{let O=P[w];if(!O)throw new Error("invalid pattern object");return new uK($,O,0,this.platform)})}async walk(){return[...await new x7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new x7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new n7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new n7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}var y9=(q,_={})=>{if(!Array.isArray(q))q=[q];for(let j of q)if(new qq(j,_).hasMagic())return!0;return!1};function r7(q,_={}){return new Vq(q,_).streamSync()}function z$(q,_={}){return new Vq(q,_).stream()}function v$(q,_={}){return new Vq(q,_).walkSync()}async function O$(q,_={}){return new Vq(q,_).walk()}function i7(q,_={}){return new Vq(q,_).iterateSync()}function W$(q,_={}){return new Vq(q,_).iterate()}var ah=r7,Bh=Object.assign(z$,{sync:r7}),th=i7,eh=Object.assign(W$,{sync:i7}),Fh=Object.assign(v$,{stream:r7,iterate:i7}),c7=Object.assign(O$,{glob:O$,globSync:v$,sync:Fh,globStream:z$,stream:Bh,globStreamSync:r7,streamSync:ah,globIterate:W$,iterate:eh,globIterateSync:i7,iterateSync:th,Glob:Vq,hasMagic:y9,escape:kK,unescape:Hq});c7.glob=c7;d6();async function J$(q,_={}){let j=$8.getInstance().getTrashDirectory();if(!H$(j))sh(j,{recursive:!0});let K=Array.isArray(q)?q:[q];for(let Y of K){let f=await c7(Y),P=f.length>0?f:[Y];for(let $ of P)try{if(!H$($)){if(!_.force){console.error(`trash: ${$}: No such file or directory`);continue}continue}if(Qh($).isDirectory()&&!_.recursive){if(!_.force){console.error(`trash: ${$}: is a directory`);continue}}let O=_D($),v=Date.now(),z=qD(j,`${O}.${v}`);Uh($,z),console.log(`Moved ${O} to trash`)}catch(w){if(!_.force){let O=w instanceof Error?w.message:String(w);console.error(`trash: ${$}: ${O}`)}}}}vK();d6();import{readdirSync as KD,renameSync as jD}from"fs";import{join as T$}from"path";async function Z$(){let q=$8.getInstance().getTrashDirectory(),_=KD(q);if(_.length===0){console.log("Trash is empty");return}let j=await xq({message:"Select file to restore:",options:_.map((K)=>({value:K,label:K}))});if(L8(j))return;jD(T$(q,j),T$(process.cwd(),j)),console.log(`Restored ${j}`)}d6();import{appendFileSync as PD}from"fs";function YD(q){let j=q.toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/).filter((f)=>f.length>2).slice(0,4).join("-"),K=j.length>30?j.substring(0,27)+"...":j,Y=new Date().toISOString().substring(11,19).replace(/:/g,"");return`${K}-${Y}`}async function k$(q,_={}){if(!q||q.trim()==="")console.error("Error: Message is required"),process.exit(1);let j=$8.getInstance(),K=new Date().toISOString(),Y=$8.getCurrentProjectName(),f=YD(q),P=`${Y}_${f}_overview`,$=j.getIndexPath(),w={type:"overview",content:q,session_id:f,project:Y,timestamp:K};j.ensureDirectory(j.getDataDirectory()),PD($,JSON.stringify(w)+` -`,"utf8"),console.log(JSON.stringify({success:!0,document_id:P,session_id:f,project:Y,timestamp:K,suppressOutput:!0}))}a3();f7();import e8 from"fs";import R6 from"path";import{execSync as X$}from"child_process";async function G$(q){try{if(q.update){await A$(q);return}let _=R6.join(process.cwd(),"package.json"),j="unknown",K="unknown";if(e8.existsSync(_))try{let b=JSON.parse(e8.readFileSync(_,"utf-8"));j=b.version||"unknown",K=b.name||R6.basename(process.cwd())}catch(b){K=R6.basename(process.cwd())}let Y=[],f=q.historical||1;if(q.generate)Y.push(q.generate),f=1,console.log(`\uD83C\uDFAF Generating changelog for specific version: ${q.generate}`);else if(j!=="unknown"){let b=j.split(".");if(b.length===3){let d=parseInt(b[0]),y=parseInt(b[1]),V=parseInt(b[2]);for(let S=0;S>> no match, partial?`,q,z,_,W),z===$)return!0}return!1}let T;if(typeof O==="string")T=v===O,this.debug("string match",O,v,T);else T=O.test(v),this.debug("pattern match",O,v,T);if(!T)return!1}if(f===$&&P===w)return!0;else if(f===$)return j;else if(P===w)return f===$-1&&q[f]==="";else throw new Error("wtf?")}braceExpand(){return yf(this.pattern,this.options)}parse(q){J3(q);let _=this.options;if(q==="**")return T6;if(q==="")return"";let j,K=null;if(j=q.match(Fu))K=_.dot?su:Uu;else if(j=q.match(xu))K=(_.nocase?_.dot?iu:ru:_.dot?cu:nu)(j[1]);else if(j=q.match(Qu))K=(_.nocase?_.dot?_h:qh:_.dot?Kh:jh)(j);else if(j=q.match(ou))K=_.dot?Bu:au;else if(j=q.match(tu))K=eu;let Y=J6.fromGlob(q,this.options).toMMPattern();if(K&&typeof Y==="object")Reflect.defineProperty(Y,"test",{value:K});return Y}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let q=this.set;if(!q.length)return this.regexp=!1,this.regexp;let _=this.options,j=_.noglobstar?fh:_.dot?$h:wh,K=new Set(_.nocase?["i"]:[]),Y=q.map(($)=>{let w=$.map((O)=>{if(O instanceof RegExp)for(let v of O.flags.split(""))K.add(v);return typeof O==="string"?Hh(O):O===T6?T6:O._src});return w.forEach((O,v)=>{let z=w[v+1],W=w[v-1];if(O!==T6||W===T6)return;if(W===void 0)if(z!==void 0&&z!==T6)w[v+1]="(?:\\/|"+j+"\\/)?"+z;else w[v]=j;else if(z===void 0)w[v-1]=W+"(?:\\/|"+j+")?";else if(z!==T6)w[v-1]=W+"(?:\\/|\\/"+j+"\\/)"+z,w[v+1]=T6}),w.filter((O)=>O!==T6).join("/")}).join("|"),[f,P]=q.length>1?["(?:",")"]:["",""];if(Y="^"+f+Y+P+"$",this.negate)Y="^(?!"+Y+").+$";try{this.regexp=new RegExp(Y,[...K].join(""))}catch($){this.regexp=!1}return this.regexp}slashSplit(q){if(this.preserveMultipleSlashes)return q.split("/");else if(this.isWindows&&/^\/\/[^\/]+/.test(q))return["",...q.split(/\/+/)];else return q.split(/\/+/)}match(q,_=this.partial){if(this.debug("match",q,this.pattern),this.comment)return!1;if(this.empty)return q==="";if(q==="/"&&_)return!0;let j=this.options;if(this.isWindows)q=q.split("\\").join("/");let K=this.slashSplit(q);this.debug(this.pattern,"split",K);let Y=this.set;this.debug(this.pattern,"set",Y);let f=K[K.length-1];if(!f)for(let P=K.length-2;!f&&P>=0;P--)f=K[P];for(let P=0;P{typeof G9.emitWarning==="function"?G9.emitWarning(q,_,j,K):console.error(`[${j}] ${_}: ${q}`)},b7=globalThis.AbortController,df=globalThis.AbortSignal;if(typeof b7==="undefined"){df=class j{onabort;_onabort=[];reason;aborted=!1;addEventListener(K,Y){this._onabort.push(Y)}},b7=class j{constructor(){_()}signal=new df;abort(K){if(this.signal.aborted)return;this.signal.reason=K,this.signal.aborted=!0;for(let Y of this.signal._onabort)Y(K);this.signal.onabort?.(K)}};let q=G9.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",_=()=>{if(!q)return;q=!1,Lf("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",_)}}var Th=(q)=>!pf.has(q),a0=Symbol("type"),K_=(q)=>q&&q===Math.floor(q)&&q>0&&isFinite(q),lf=(q)=>!K_(q)?null:q<=Math.pow(2,8)?Uint8Array:q<=Math.pow(2,16)?Uint16Array:q<=Math.pow(2,32)?Uint32Array:q<=Number.MAX_SAFE_INTEGER?Z3:null;class Z3 extends Array{constructor(q){super(q);this.fill(0)}}class XK{heap;length;static#q=!1;static create(q){let _=lf(q);if(!_)return[];XK.#q=!0;let j=new XK(q,_);return XK.#q=!1,j}constructor(q,_){if(!XK.#q)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new _(q),this.length=0}push(q){this.heap[this.length++]=q}pop(){return this.heap[--this.length]}}class k3{#q;#_;#Y;#P;#f;#G;#X;#z;get perf(){return this.#z}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#$;#W;#v;#w;#K;#J;#u;#A;#T;#b;#Z;#D;#M;#k;#h;#N;#H;#j;static unsafeExposeInternals(q){return{starts:q.#M,ttls:q.#k,sizes:q.#D,keyMap:q.#v,keyList:q.#w,valList:q.#K,next:q.#J,prev:q.#u,get head(){return q.#A},get tail(){return q.#T},free:q.#b,isBackgroundFetch:(_)=>q.#O(_),backgroundFetch:(_,j,K,Y)=>q.#r(_,j,K,Y),moveToTail:(_)=>q.#p(_),indexes:(_)=>q.#E(_),rindexes:(_)=>q.#m(_),isStale:(_)=>q.#V(_)}}get max(){return this.#q}get maxSize(){return this.#_}get calculatedSize(){return this.#W}get size(){return this.#$}get fetchMethod(){return this.#G}get memoMethod(){return this.#X}get dispose(){return this.#Y}get onInsert(){return this.#P}get disposeAfter(){return this.#f}constructor(q){let{max:_=0,ttl:j,ttlResolution:K=1,ttlAutopurge:Y,updateAgeOnGet:f,updateAgeOnHas:P,allowStale:$,dispose:w,onInsert:O,disposeAfter:v,noDisposeOnSet:z,noUpdateTTL:W,maxSize:J=0,maxEntrySize:T=0,sizeCalculation:H,fetchMethod:X,memoMethod:A,noDeleteOnFetchRejection:G,noDeleteOnStaleGet:D,allowStaleOnFetchRejection:M,allowStaleOnFetchAbort:I,ignoreFetchAbort:N,perf:R}=q;if(R!==void 0){if(typeof R?.now!=="function")throw new TypeError("perf option must have a now() method if specified")}if(this.#z=R??Jh,_!==0&&!K_(_))throw new TypeError("max option must be a nonnegative integer");let L=_?lf(_):Array;if(!L)throw new Error("invalid max value: "+_);if(this.#q=_,this.#_=J,this.maxEntrySize=T||this.#_,this.sizeCalculation=H,this.sizeCalculation){if(!this.#_&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!=="function")throw new TypeError("sizeCalculation set to non-function")}if(A!==void 0&&typeof A!=="function")throw new TypeError("memoMethod must be a function if defined");if(this.#X=A,X!==void 0&&typeof X!=="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#G=X,this.#N=!!X,this.#v=new Map,this.#w=new Array(_).fill(void 0),this.#K=new Array(_).fill(void 0),this.#J=new L(_),this.#u=new L(_),this.#A=0,this.#T=0,this.#b=XK.create(_),this.#$=0,this.#W=0,typeof w==="function")this.#Y=w;if(typeof O==="function")this.#P=O;if(typeof v==="function")this.#f=v,this.#Z=[];else this.#f=void 0,this.#Z=void 0;if(this.#h=!!this.#Y,this.#j=!!this.#P,this.#H=!!this.#f,this.noDisposeOnSet=!!z,this.noUpdateTTL=!!W,this.noDeleteOnFetchRejection=!!G,this.allowStaleOnFetchRejection=!!M,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!N,this.maxEntrySize!==0){if(this.#_!==0){if(!K_(this.#_))throw new TypeError("maxSize must be a positive integer if specified")}if(!K_(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#L()}if(this.allowStale=!!$,this.noDeleteOnStaleGet=!!D,this.updateAgeOnGet=!!f,this.updateAgeOnHas=!!P,this.ttlResolution=K_(K)||K===0?K:1,this.ttlAutopurge=!!Y,this.ttl=j||0,this.ttl){if(!K_(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}if(this.#q===0&&this.ttl===0&&this.#_===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#q&&!this.#_){if(Th("LRU_CACHE_UNBOUNDED"))pf.add("LRU_CACHE_UNBOUNDED"),Lf("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning","LRU_CACHE_UNBOUNDED",k3)}}getRemainingTTL(q){return this.#v.has(q)?1/0:0}#I(){let q=new Z3(this.#q),_=new Z3(this.#q);this.#k=q,this.#M=_,this.#n=(Y,f,P=this.#z.now())=>{if(_[Y]=f!==0?P:0,q[Y]=f,f!==0&&this.ttlAutopurge){let $=setTimeout(()=>{if(this.#V(Y))this.#R(this.#w[Y],"expire")},f+1);if($.unref)$.unref()}},this.#S=(Y)=>{_[Y]=q[Y]!==0?this.#z.now():0},this.#C=(Y,f)=>{if(q[f]){let P=q[f],$=_[f];if(!P||!$)return;Y.ttl=P,Y.start=$,Y.now=j||K();let w=Y.now-$;Y.remainingTTL=P-w}};let j=0,K=()=>{let Y=this.#z.now();if(this.ttlResolution>0){j=Y;let f=setTimeout(()=>j=0,this.ttlResolution);if(f.unref)f.unref()}return Y};this.getRemainingTTL=(Y)=>{let f=this.#v.get(Y);if(f===void 0)return 0;let P=q[f],$=_[f];if(!P||!$)return 1/0;let w=(j||K())-$;return P-w},this.#V=(Y)=>{let f=_[Y],P=q[Y];return!!P&&!!f&&(j||K())-f>P}}#S=()=>{};#C=()=>{};#n=()=>{};#V=()=>!1;#L(){let q=new Z3(this.#q);this.#W=0,this.#D=q,this.#g=(_)=>{this.#W-=q[_],q[_]=0},this.#y=(_,j,K,Y)=>{if(this.#O(j))return 0;if(!K_(K))if(Y){if(typeof Y!=="function")throw new TypeError("sizeCalculation must be a function");if(K=Y(j,_),!K_(K))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return K},this.#l=(_,j,K)=>{if(q[_]=j,this.#_){let Y=this.#_-q[_];while(this.#W>Y)this.#d(!0)}if(this.#W+=q[_],K)K.entrySize=j,K.totalCalculatedSize=this.#W}}#g=(q)=>{};#l=(q,_,j)=>{};#y=(q,_,j,K)=>{if(j||K)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#E({allowStale:q=this.allowStale}={}){if(this.#$)for(let _=this.#T;;){if(!this.#c(_))break;if(q||!this.#V(_))yield _;if(_===this.#A)break;else _=this.#u[_]}}*#m({allowStale:q=this.allowStale}={}){if(this.#$)for(let _=this.#A;;){if(!this.#c(_))break;if(q||!this.#V(_))yield _;if(_===this.#T)break;else _=this.#J[_]}}#c(q){return q!==void 0&&this.#v.get(this.#w[q])===q}*entries(){for(let q of this.#E())if(this.#K[q]!==void 0&&this.#w[q]!==void 0&&!this.#O(this.#K[q]))yield[this.#w[q],this.#K[q]]}*rentries(){for(let q of this.#m())if(this.#K[q]!==void 0&&this.#w[q]!==void 0&&!this.#O(this.#K[q]))yield[this.#w[q],this.#K[q]]}*keys(){for(let q of this.#E()){let _=this.#w[q];if(_!==void 0&&!this.#O(this.#K[q]))yield _}}*rkeys(){for(let q of this.#m()){let _=this.#w[q];if(_!==void 0&&!this.#O(this.#K[q]))yield _}}*values(){for(let q of this.#E())if(this.#K[q]!==void 0&&!this.#O(this.#K[q]))yield this.#K[q]}*rvalues(){for(let q of this.#m())if(this.#K[q]!==void 0&&!this.#O(this.#K[q]))yield this.#K[q]}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(q,_={}){for(let j of this.#E()){let K=this.#K[j],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0)continue;if(q(Y,this.#w[j],this))return this.get(this.#w[j],_)}}forEach(q,_=this){for(let j of this.#E()){let K=this.#K[j],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0)continue;q.call(_,Y,this.#w[j],this)}}rforEach(q,_=this){for(let j of this.#m()){let K=this.#K[j],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0)continue;q.call(_,Y,this.#w[j],this)}}purgeStale(){let q=!1;for(let _ of this.#m({allowStale:!0}))if(this.#V(_))this.#R(this.#w[_],"expire"),q=!0;return q}info(q){let _=this.#v.get(q);if(_===void 0)return;let j=this.#K[_],K=this.#O(j)?j.__staleWhileFetching:j;if(K===void 0)return;let Y={value:K};if(this.#k&&this.#M){let f=this.#k[_],P=this.#M[_];if(f&&P){let $=f-(this.#z.now()-P);Y.ttl=$,Y.start=Date.now()}}if(this.#D)Y.size=this.#D[_];return Y}dump(){let q=[];for(let _ of this.#E({allowStale:!0})){let j=this.#w[_],K=this.#K[_],Y=this.#O(K)?K.__staleWhileFetching:K;if(Y===void 0||j===void 0)continue;let f={value:Y};if(this.#k&&this.#M){f.ttl=this.#k[_];let P=this.#z.now()-this.#M[_];f.start=Math.floor(Date.now()-P)}if(this.#D)f.size=this.#D[_];q.unshift([j,f])}return q}load(q){this.clear();for(let[_,j]of q){if(j.start){let K=Date.now()-j.start;j.start=this.#z.now()-K}this.set(_,j.value,j)}}set(q,_,j={}){if(_===void 0)return this.delete(q),this;let{ttl:K=this.ttl,start:Y,noDisposeOnSet:f=this.noDisposeOnSet,sizeCalculation:P=this.sizeCalculation,status:$}=j,{noUpdateTTL:w=this.noUpdateTTL}=j,O=this.#y(q,_,j.size||0,P);if(this.maxEntrySize&&O>this.maxEntrySize){if($)$.set="miss",$.maxEntrySizeExceeded=!0;return this.#R(q,"set"),this}let v=this.#$===0?void 0:this.#v.get(q);if(v===void 0){if(v=this.#$===0?this.#T:this.#b.length!==0?this.#b.pop():this.#$===this.#q?this.#d(!1):this.#$,this.#w[v]=q,this.#K[v]=_,this.#v.set(q,v),this.#J[this.#T]=v,this.#u[v]=this.#T,this.#T=v,this.#$++,this.#l(v,O,$),$)$.set="add";if(w=!1,this.#j)this.#P?.(_,q,"add")}else{this.#p(v);let z=this.#K[v];if(_!==z){if(this.#N&&this.#O(z)){z.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:W}=z;if(W!==void 0&&!f){if(this.#h)this.#Y?.(W,q,"set");if(this.#H)this.#Z?.push([W,q,"set"])}}else if(!f){if(this.#h)this.#Y?.(z,q,"set");if(this.#H)this.#Z?.push([z,q,"set"])}if(this.#g(v),this.#l(v,O,$),this.#K[v]=_,$){$.set="replace";let W=z&&this.#O(z)?z.__staleWhileFetching:z;if(W!==void 0)$.oldValue=W}}else if($)$.set="update";if(this.#j)this.onInsert?.(_,q,_===z?"update":"replace")}if(K!==0&&!this.#k)this.#I();if(this.#k){if(!w)this.#n(v,K,Y);if($)this.#C($,v)}if(!f&&this.#H&&this.#Z){let z=this.#Z,W;while(W=z?.shift())this.#f?.(...W)}return this}pop(){try{while(this.#$){let q=this.#K[this.#A];if(this.#d(!0),this.#O(q)){if(q.__staleWhileFetching)return q.__staleWhileFetching}else if(q!==void 0)return q}}finally{if(this.#H&&this.#Z){let q=this.#Z,_;while(_=q?.shift())this.#f?.(..._)}}}#d(q){let _=this.#A,j=this.#w[_],K=this.#K[_];if(this.#N&&this.#O(K))K.__abortController.abort(new Error("evicted"));else if(this.#h||this.#H){if(this.#h)this.#Y?.(K,j,"evict");if(this.#H)this.#Z?.push([K,j,"evict"])}if(this.#g(_),q)this.#w[_]=void 0,this.#K[_]=void 0,this.#b.push(_);if(this.#$===1)this.#A=this.#T=0,this.#b.length=0;else this.#A=this.#J[_];return this.#v.delete(j),this.#$--,_}has(q,_={}){let{updateAgeOnHas:j=this.updateAgeOnHas,status:K}=_,Y=this.#v.get(q);if(Y!==void 0){let f=this.#K[Y];if(this.#O(f)&&f.__staleWhileFetching===void 0)return!1;if(!this.#V(Y)){if(j)this.#S(Y);if(K)K.has="hit",this.#C(K,Y);return!0}else if(K)K.has="stale",this.#C(K,Y)}else if(K)K.has="miss";return!1}peek(q,_={}){let{allowStale:j=this.allowStale}=_,K=this.#v.get(q);if(K===void 0||!j&&this.#V(K))return;let Y=this.#K[K];return this.#O(Y)?Y.__staleWhileFetching:Y}#r(q,_,j,K){let Y=_===void 0?void 0:this.#K[_];if(this.#O(Y))return Y;let f=new b7,{signal:P}=j;P?.addEventListener("abort",()=>f.abort(P.reason),{signal:f.signal});let $={signal:f.signal,options:j,context:K},w=(T,H=!1)=>{let{aborted:X}=f.signal,A=j.ignoreFetchAbort&&T!==void 0;if(j.status)if(X&&!H){if(j.status.fetchAborted=!0,j.status.fetchError=f.signal.reason,A)j.status.fetchAbortIgnored=!0}else j.status.fetchResolved=!0;if(X&&!A&&!H)return v(f.signal.reason);let G=W;if(this.#K[_]===W)if(T===void 0)if(G.__staleWhileFetching!==void 0)this.#K[_]=G.__staleWhileFetching;else this.#R(q,"fetch");else{if(j.status)j.status.fetchUpdated=!0;this.set(q,T,$.options)}return T},O=(T)=>{if(j.status)j.status.fetchRejected=!0,j.status.fetchError=T;return v(T)},v=(T)=>{let{aborted:H}=f.signal,X=H&&j.allowStaleOnFetchAbort,A=X||j.allowStaleOnFetchRejection,G=A||j.noDeleteOnFetchRejection,D=W;if(this.#K[_]===W){if(!G||D.__staleWhileFetching===void 0)this.#R(q,"fetch");else if(!X)this.#K[_]=D.__staleWhileFetching}if(A){if(j.status&&D.__staleWhileFetching!==void 0)j.status.returnedStale=!0;return D.__staleWhileFetching}else if(D.__returned===D)throw T},z=(T,H)=>{let X=this.#G?.(q,Y,$);if(X&&X instanceof Promise)X.then((A)=>T(A===void 0?void 0:A),H);f.signal.addEventListener("abort",()=>{if(!j.ignoreFetchAbort||j.allowStaleOnFetchAbort){if(T(void 0),j.allowStaleOnFetchAbort)T=(A)=>w(A,!0)}})};if(j.status)j.status.fetchDispatched=!0;let W=new Promise(z).then(w,O),J=Object.assign(W,{__abortController:f,__staleWhileFetching:Y,__returned:void 0});if(_===void 0)this.set(q,J,{...$.options,status:void 0}),_=this.#v.get(q);else this.#K[_]=J;return J}#O(q){if(!this.#N)return!1;let _=q;return!!_&&_ instanceof Promise&&_.hasOwnProperty("__staleWhileFetching")&&_.__abortController instanceof b7}async fetch(q,_={}){let{allowStale:j=this.allowStale,updateAgeOnGet:K=this.updateAgeOnGet,noDeleteOnStaleGet:Y=this.noDeleteOnStaleGet,ttl:f=this.ttl,noDisposeOnSet:P=this.noDisposeOnSet,size:$=0,sizeCalculation:w=this.sizeCalculation,noUpdateTTL:O=this.noUpdateTTL,noDeleteOnFetchRejection:v=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:z=this.allowStaleOnFetchRejection,ignoreFetchAbort:W=this.ignoreFetchAbort,allowStaleOnFetchAbort:J=this.allowStaleOnFetchAbort,context:T,forceRefresh:H=!1,status:X,signal:A}=_;if(!this.#N){if(X)X.fetch="get";return this.get(q,{allowStale:j,updateAgeOnGet:K,noDeleteOnStaleGet:Y,status:X})}let G={allowStale:j,updateAgeOnGet:K,noDeleteOnStaleGet:Y,ttl:f,noDisposeOnSet:P,size:$,sizeCalculation:w,noUpdateTTL:O,noDeleteOnFetchRejection:v,allowStaleOnFetchRejection:z,allowStaleOnFetchAbort:J,ignoreFetchAbort:W,status:X,signal:A},D=this.#v.get(q);if(D===void 0){if(X)X.fetch="miss";let M=this.#r(q,D,G,T);return M.__returned=M}else{let M=this.#K[D];if(this.#O(M)){let b=j&&M.__staleWhileFetching!==void 0;if(X){if(X.fetch="inflight",b)X.returnedStale=!0}return b?M.__staleWhileFetching:M.__returned=M}let I=this.#V(D);if(!H&&!I){if(X)X.fetch="hit";if(this.#p(D),K)this.#S(D);if(X)this.#C(X,D);return M}let N=this.#r(q,D,G,T),L=N.__staleWhileFetching!==void 0&&j;if(X){if(X.fetch=I?"stale":"refresh",L&&I)X.returnedStale=!0}return L?N.__staleWhileFetching:N.__returned=N}}async forceFetch(q,_={}){let j=await this.fetch(q,_);if(j===void 0)throw new Error("fetch() returned undefined");return j}memo(q,_={}){let j=this.#X;if(!j)throw new Error("no memoMethod provided to constructor");let{context:K,forceRefresh:Y,...f}=_,P=this.get(q,f);if(!Y&&P!==void 0)return P;let $=j(q,P,{options:f,context:K});return this.set(q,$,f),$}get(q,_={}){let{allowStale:j=this.allowStale,updateAgeOnGet:K=this.updateAgeOnGet,noDeleteOnStaleGet:Y=this.noDeleteOnStaleGet,status:f}=_,P=this.#v.get(q);if(P!==void 0){let $=this.#K[P],w=this.#O($);if(f)this.#C(f,P);if(this.#V(P)){if(f)f.get="stale";if(!w){if(!Y)this.#R(q,"expire");if(f&&j)f.returnedStale=!0;return j?$:void 0}else{if(f&&j&&$.__staleWhileFetching!==void 0)f.returnedStale=!0;return j?$.__staleWhileFetching:void 0}}else{if(f)f.get="hit";if(w)return $.__staleWhileFetching;if(this.#p(P),K)this.#S(P);return $}}else if(f)f.get="miss"}#i(q,_){this.#u[_]=q,this.#J[q]=_}#p(q){if(q!==this.#T){if(q===this.#A)this.#A=this.#J[q];else this.#i(this.#u[q],this.#J[q]);this.#i(this.#T,q),this.#T=q}}delete(q){return this.#R(q,"delete")}#R(q,_){let j=!1;if(this.#$!==0){let K=this.#v.get(q);if(K!==void 0)if(j=!0,this.#$===1)this.#x(_);else{this.#g(K);let Y=this.#K[K];if(this.#O(Y))Y.__abortController.abort(new Error("deleted"));else if(this.#h||this.#H){if(this.#h)this.#Y?.(Y,q,_);if(this.#H)this.#Z?.push([Y,q,_])}if(this.#v.delete(q),this.#w[K]=void 0,this.#K[K]=void 0,K===this.#T)this.#T=this.#u[K];else if(K===this.#A)this.#A=this.#J[K];else{let f=this.#u[K];this.#J[f]=this.#J[K];let P=this.#J[K];this.#u[P]=this.#u[K]}this.#$--,this.#b.push(K)}}if(this.#H&&this.#Z?.length){let K=this.#Z,Y;while(Y=K?.shift())this.#f?.(...Y)}return j}clear(){return this.#x("delete")}#x(q){for(let _ of this.#m({allowStale:!0})){let j=this.#K[_];if(this.#O(j))j.__abortController.abort(new Error("deleted"));else{let K=this.#w[_];if(this.#h)this.#Y?.(j,K,q);if(this.#H)this.#Z?.push([j,K,q])}}if(this.#v.clear(),this.#K.fill(void 0),this.#w.fill(void 0),this.#k&&this.#M)this.#k.fill(0),this.#M.fill(0);if(this.#D)this.#D.fill(0);if(this.#A=0,this.#T=0,this.#b.length=0,this.#W=0,this.#$=0,this.#H&&this.#Z){let _=this.#Z,j;while(j=_?.shift())this.#f?.(...j)}}}import{posix as Mh,win32 as E9}from"node:path";import{fileURLToPath as Nh}from"node:url";import{lstatSync as bh,readdir as Sh,readdirSync as Eh,readlinkSync as Rh,realpathSync as mh}from"fs";import*as Ih from"node:fs";import{lstat as yh,readdir as dh,readlink as ph,realpath as Lh}from"node:fs/promises";import{EventEmitter as M9}from"node:events";import of from"node:stream";import{StringDecoder as Zh}from"node:string_decoder";var xf=typeof process==="object"&&process?process:{stdout:null,stderr:null},kh=(q)=>!!q&&typeof q==="object"&&(q instanceof V_||q instanceof of||Xh(q)||Ah(q)),Xh=(q)=>!!q&&typeof q==="object"&&q instanceof M9&&typeof q.pipe==="function"&&q.pipe!==of.Writable.prototype.pipe,Ah=(q)=>!!q&&typeof q==="object"&&q instanceof M9&&typeof q.write==="function"&&typeof q.end==="function",cq=Symbol("EOF"),rq=Symbol("maybeEmitEnd"),j_=Symbol("emittedEnd"),S7=Symbol("emittingEnd"),X3=Symbol("emittedError"),E7=Symbol("closed"),nf=Symbol("read"),R7=Symbol("flush"),cf=Symbol("flushChunk"),Jq=Symbol("encoding"),AK=Symbol("decoder"),w6=Symbol("flowing"),A3=Symbol("paused"),GK=Symbol("resume"),O6=Symbol("buffer"),N6=Symbol("pipes"),z6=Symbol("bufferLength"),u9=Symbol("bufferPush"),m7=Symbol("bufferShift"),G6=Symbol("objectMode"),Q8=Symbol("destroyed"),h9=Symbol("error"),D9=Symbol("emitData"),rf=Symbol("emitEnd"),C9=Symbol("emitEnd2"),Dq=Symbol("async"),V9=Symbol("abort"),I7=Symbol("aborted"),G3=Symbol("signal"),C_=Symbol("dataListeners"),r6=Symbol("discarded"),u3=(q)=>Promise.resolve().then(q),Gh=(q)=>q(),uh=(q)=>q==="end"||q==="finish"||q==="prefinish",hh=(q)=>q instanceof ArrayBuffer||!!q&&typeof q==="object"&&q.constructor&&q.constructor.name==="ArrayBuffer"&&q.byteLength>=0,Dh=(q)=>!Buffer.isBuffer(q)&&ArrayBuffer.isView(q);class N9{src;dest;opts;ondrain;constructor(q,_,j){this.src=q,this.dest=_,this.opts=j,this.ondrain=()=>q[GK](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(q){}end(){if(this.unpipe(),this.opts.end)this.dest.end()}}class af extends N9{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(q,_,j){super(q,_,j);this.proxyErrors=(K)=>_.emit("error",K),q.on("error",this.proxyErrors)}}var Ch=(q)=>!!q.objectMode,Vh=(q)=>!q.objectMode&&!!q.encoding&&q.encoding!=="buffer";class V_ extends M9{[w6]=!1;[A3]=!1;[N6]=[];[O6]=[];[G6];[Jq];[Dq];[AK];[cq]=!1;[j_]=!1;[S7]=!1;[E7]=!1;[X3]=null;[z6]=0;[Q8]=!1;[G3];[I7]=!1;[C_]=0;[r6]=!1;writable=!0;readable=!0;constructor(...q){let _=q[0]||{};super();if(_.objectMode&&typeof _.encoding==="string")throw new TypeError("Encoding and objectMode may not be used together");if(Ch(_))this[G6]=!0,this[Jq]=null;else if(Vh(_))this[Jq]=_.encoding,this[G6]=!1;else this[G6]=!1,this[Jq]=null;if(this[Dq]=!!_.async,this[AK]=this[Jq]?new Zh(this[Jq]):null,_&&_.debugExposeBuffer===!0)Object.defineProperty(this,"buffer",{get:()=>this[O6]});if(_&&_.debugExposePipes===!0)Object.defineProperty(this,"pipes",{get:()=>this[N6]});let{signal:j}=_;if(j)if(this[G3]=j,j.aborted)this[V9]();else j.addEventListener("abort",()=>this[V9]())}get bufferLength(){return this[z6]}get encoding(){return this[Jq]}set encoding(q){throw new Error("Encoding must be set at instantiation time")}setEncoding(q){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[G6]}set objectMode(q){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[Dq]}set["async"](q){this[Dq]=this[Dq]||!!q}[V9](){this[I7]=!0,this.emit("abort",this[G3]?.reason),this.destroy(this[G3]?.reason)}get aborted(){return this[I7]}set aborted(q){}write(q,_,j){if(this[I7])return!1;if(this[cq])throw new Error("write after end");if(this[Q8])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof _==="function")j=_,_="utf8";if(!_)_="utf8";let K=this[Dq]?u3:Gh;if(!this[G6]&&!Buffer.isBuffer(q)){if(Dh(q))q=Buffer.from(q.buffer,q.byteOffset,q.byteLength);else if(hh(q))q=Buffer.from(q);else if(typeof q!=="string")throw new Error("Non-contiguous data written to non-objectMode stream")}if(this[G6]){if(this[w6]&&this[z6]!==0)this[R7](!0);if(this[w6])this.emit("data",q);else this[u9](q);if(this[z6]!==0)this.emit("readable");if(j)K(j);return this[w6]}if(!q.length){if(this[z6]!==0)this.emit("readable");if(j)K(j);return this[w6]}if(typeof q==="string"&&!(_===this[Jq]&&!this[AK]?.lastNeed))q=Buffer.from(q,_);if(Buffer.isBuffer(q)&&this[Jq])q=this[AK].write(q);if(this[w6]&&this[z6]!==0)this[R7](!0);if(this[w6])this.emit("data",q);else this[u9](q);if(this[z6]!==0)this.emit("readable");if(j)K(j);return this[w6]}read(q){if(this[Q8])return null;if(this[r6]=!1,this[z6]===0||q===0||q&&q>this[z6])return this[rq](),null;if(this[G6])q=null;if(this[O6].length>1&&!this[G6])this[O6]=[this[Jq]?this[O6].join(""):Buffer.concat(this[O6],this[z6])];let _=this[nf](q||null,this[O6][0]);return this[rq](),_}[nf](q,_){if(this[G6])this[m7]();else{let j=_;if(q===j.length||q===null)this[m7]();else if(typeof j==="string")this[O6][0]=j.slice(q),_=j.slice(0,q),this[z6]-=q;else this[O6][0]=j.subarray(q),_=j.subarray(0,q),this[z6]-=q}if(this.emit("data",_),!this[O6].length&&!this[cq])this.emit("drain");return _}end(q,_,j){if(typeof q==="function")j=q,q=void 0;if(typeof _==="function")j=_,_="utf8";if(q!==void 0)this.write(q,_);if(j)this.once("end",j);if(this[cq]=!0,this.writable=!1,this[w6]||!this[A3])this[rq]();return this}[GK](){if(this[Q8])return;if(!this[C_]&&!this[N6].length)this[r6]=!0;if(this[A3]=!1,this[w6]=!0,this.emit("resume"),this[O6].length)this[R7]();else if(this[cq])this[rq]();else this.emit("drain")}resume(){return this[GK]()}pause(){this[w6]=!1,this[A3]=!0,this[r6]=!1}get destroyed(){return this[Q8]}get flowing(){return this[w6]}get paused(){return this[A3]}[u9](q){if(this[G6])this[z6]+=1;else this[z6]+=q.length;this[O6].push(q)}[m7](){if(this[G6])this[z6]-=1;else this[z6]-=this[O6][0].length;return this[O6].shift()}[R7](q=!1){do;while(this[cf](this[m7]())&&this[O6].length);if(!q&&!this[O6].length&&!this[cq])this.emit("drain")}[cf](q){return this.emit("data",q),this[w6]}pipe(q,_){if(this[Q8])return q;this[r6]=!1;let j=this[j_];if(_=_||{},q===xf.stdout||q===xf.stderr)_.end=!1;else _.end=_.end!==!1;if(_.proxyErrors=!!_.proxyErrors,j){if(_.end)q.end()}else if(this[N6].push(!_.proxyErrors?new N9(this,q,_):new af(this,q,_)),this[Dq])u3(()=>this[GK]());else this[GK]();return q}unpipe(q){let _=this[N6].find((j)=>j.dest===q);if(_){if(this[N6].length===1){if(this[w6]&&this[C_]===0)this[w6]=!1;this[N6]=[]}else this[N6].splice(this[N6].indexOf(_),1);_.unpipe()}}addListener(q,_){return this.on(q,_)}on(q,_){let j=super.on(q,_);if(q==="data"){if(this[r6]=!1,this[C_]++,!this[N6].length&&!this[w6])this[GK]()}else if(q==="readable"&&this[z6]!==0)super.emit("readable");else if(uh(q)&&this[j_])super.emit(q),this.removeAllListeners(q);else if(q==="error"&&this[X3]){let K=_;if(this[Dq])u3(()=>K.call(this,this[X3]));else K.call(this,this[X3])}return j}removeListener(q,_){return this.off(q,_)}off(q,_){let j=super.off(q,_);if(q==="data"){if(this[C_]=this.listeners("data").length,this[C_]===0&&!this[r6]&&!this[N6].length)this[w6]=!1}return j}removeAllListeners(q){let _=super.removeAllListeners(q);if(q==="data"||q===void 0){if(this[C_]=0,!this[r6]&&!this[N6].length)this[w6]=!1}return _}get emittedEnd(){return this[j_]}[rq](){if(!this[S7]&&!this[j_]&&!this[Q8]&&this[O6].length===0&&this[cq]){if(this[S7]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[E7])this.emit("close");this[S7]=!1}}emit(q,..._){let j=_[0];if(q!=="error"&&q!=="close"&&q!==Q8&&this[Q8])return!1;else if(q==="data")return!this[G6]&&!j?!1:this[Dq]?(u3(()=>this[D9](j)),!0):this[D9](j);else if(q==="end")return this[rf]();else if(q==="close"){if(this[E7]=!0,!this[j_]&&!this[Q8])return!1;let Y=super.emit("close");return this.removeAllListeners("close"),Y}else if(q==="error"){this[X3]=j,super.emit(h9,j);let Y=!this[G3]||this.listeners("error").length?super.emit("error",j):!1;return this[rq](),Y}else if(q==="resume"){let Y=super.emit("resume");return this[rq](),Y}else if(q==="finish"||q==="prefinish"){let Y=super.emit(q);return this.removeAllListeners(q),Y}let K=super.emit(q,..._);return this[rq](),K}[D9](q){for(let j of this[N6])if(j.dest.write(q)===!1)this.pause();let _=this[r6]?!1:super.emit("data",q);return this[rq](),_}[rf](){if(this[j_])return!1;return this[j_]=!0,this.readable=!1,this[Dq]?(u3(()=>this[C9]()),!0):this[C9]()}[C9](){if(this[AK]){let _=this[AK].end();if(_){for(let j of this[N6])j.dest.write(_);if(!this[r6])super.emit("data",_)}}for(let _ of this[N6])_.end();let q=super.emit("end");return this.removeAllListeners("end"),q}async collect(){let q=Object.assign([],{dataLength:0});if(!this[G6])q.dataLength=0;let _=this.promise();return this.on("data",(j)=>{if(q.push(j),!this[G6])q.dataLength+=j.length}),await _,q}async concat(){if(this[G6])throw new Error("cannot concat in objectMode");let q=await this.collect();return this[Jq]?q.join(""):Buffer.concat(q,q.dataLength)}async promise(){return new Promise((q,_)=>{this.on(Q8,()=>_(new Error("stream destroyed"))),this.on("error",(j)=>_(j)),this.on("end",()=>q())})}[Symbol.asyncIterator](){this[r6]=!1;let q=!1,_=async()=>{return this.pause(),q=!0,{value:void 0,done:!0}};return{next:()=>{if(q)return _();let K=this.read();if(K!==null)return Promise.resolve({done:!1,value:K});if(this[cq])return _();let Y,f,P=(v)=>{this.off("data",$),this.off("end",w),this.off(Q8,O),_(),f(v)},$=(v)=>{this.off("error",P),this.off("end",w),this.off(Q8,O),this.pause(),Y({value:v,done:!!this[cq]})},w=()=>{this.off("error",P),this.off("data",$),this.off(Q8,O),_(),Y({done:!0,value:void 0})},O=()=>P(new Error("stream destroyed"));return new Promise((v,z)=>{f=z,Y=v,this.once(Q8,O),this.once("error",P),this.once("end",w),this.once("data",$)})},throw:_,return:_,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[r6]=!1;let q=!1,_=()=>{return this.pause(),this.off(h9,_),this.off(Q8,_),this.off("end",_),q=!0,{done:!0,value:void 0}},j=()=>{if(q)return _();let K=this.read();return K===null?_():{done:!1,value:K}};return this.once("end",_),this.once(h9,_),this.once(Q8,_),{next:j,throw:_,return:_,[Symbol.iterator](){return this}}}destroy(q){if(this[Q8]){if(q)this.emit("error",q);else this.emit(Q8);return this}this[Q8]=!0,this[r6]=!0,this[O6].length=0,this[z6]=0;let _=this;if(typeof _.close==="function"&&!this[E7])_.close();if(q)this.emit("error",q);else this.emit(Q8);return this}static get isStream(){return kh}}var gh=mh.native,D3={lstatSync:bh,readdir:Sh,readdirSync:Eh,readlinkSync:Rh,realpathSync:gh,promises:{lstat:yh,readdir:dh,readlink:ph,realpath:Lh}},Uf=(q)=>!q||q===D3||q===Ih?D3:{...D3,...q,promises:{...D3.promises,...q.promises||{}}},sf=/^\\\\\?\\([a-z]:)\\?$/i,lh=(q)=>q.replace(/\//g,"\\").replace(sf,"$1\\"),xh=/[\\\/]/,Kq=0,Qf=1,q$=2,Cq=4,_$=6,K$=8,M_=10,j$=12,_q=15,h3=~_q,b9=16,Bf=32,C3=64,Tq=128,g7=256,d7=512,tf=C3|Tq|d7,nh=1023,S9=(q)=>q.isFile()?K$:q.isDirectory()?Cq:q.isSymbolicLink()?M_:q.isCharacterDevice()?q$:q.isBlockDevice()?_$:q.isSocket()?j$:q.isFIFO()?Qf:Kq,ef=new Map,V3=(q)=>{let _=ef.get(q);if(_)return _;let j=q.normalize("NFKD");return ef.set(q,j),j},Ff=new Map,y7=(q)=>{let _=Ff.get(q);if(_)return _;let j=V3(q.toLowerCase());return Ff.set(q,j),j};class R9 extends k3{constructor(){super({max:256})}}class P$ extends k3{constructor(q=16384){super({maxSize:q,sizeCalculation:(_)=>_.length+1})}}var Y$=Symbol("PathScurry setAsCwd");class b6{name;root;roots;parent;nocase;isCWD=!1;#q;#_;get dev(){return this.#_}#Y;get mode(){return this.#Y}#P;get nlink(){return this.#P}#f;get uid(){return this.#f}#G;get gid(){return this.#G}#X;get rdev(){return this.#X}#z;get blksize(){return this.#z}#$;get ino(){return this.#$}#W;get size(){return this.#W}#v;get blocks(){return this.#v}#w;get atimeMs(){return this.#w}#K;get mtimeMs(){return this.#K}#J;get ctimeMs(){return this.#J}#u;get birthtimeMs(){return this.#u}#A;get atime(){return this.#A}#T;get mtime(){return this.#T}#b;get ctime(){return this.#b}#Z;get birthtime(){return this.#Z}#D;#M;#k;#h;#N;#H;#j;#I;#S;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(q,_=Kq,j,K,Y,f,P){if(this.name=q,this.#D=Y?y7(q):V3(q),this.#j=_&nh,this.nocase=Y,this.roots=K,this.root=j||this,this.#I=f,this.#k=P.fullpath,this.#N=P.relative,this.#H=P.relativePosix,this.parent=P.parent,this.parent)this.#q=this.parent.#q;else this.#q=Uf(P.fs)}depth(){if(this.#M!==void 0)return this.#M;if(!this.parent)return this.#M=0;return this.#M=this.parent.depth()+1}childrenCache(){return this.#I}resolve(q){if(!q)return this;let _=this.getRootString(q),K=q.substring(_.length).split(this.splitSep);return _?this.getRoot(_).#n(K):this.#n(K)}#n(q){let _=this;for(let j of q)_=_.child(j);return _}children(){let q=this.#I.get(this);if(q)return q;let _=Object.assign([],{provisional:0});return this.#I.set(this,_),this.#j&=~b9,_}child(q,_){if(q===""||q===".")return this;if(q==="..")return this.parent||this;let j=this.children(),K=this.nocase?y7(q):V3(q);for(let $ of j)if($.#D===K)return $;let Y=this.parent?this.sep:"",f=this.#k?this.#k+Y+q:void 0,P=this.newChild(q,Kq,{..._,parent:this,fullpath:f});if(!this.canReaddir())P.#j|=Tq;return j.push(P),P}relative(){if(this.isCWD)return"";if(this.#N!==void 0)return this.#N;let q=this.name,_=this.parent;if(!_)return this.#N=this.name;let j=_.relative();return j+(!j||!_.parent?"":this.sep)+q}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#H!==void 0)return this.#H;let q=this.name,_=this.parent;if(!_)return this.#H=this.fullpathPosix();let j=_.relativePosix();return j+(!j||!_.parent?"":"/")+q}fullpath(){if(this.#k!==void 0)return this.#k;let q=this.name,_=this.parent;if(!_)return this.#k=this.name;let K=_.fullpath()+(!_.parent?"":this.sep)+q;return this.#k=K}fullpathPosix(){if(this.#h!==void 0)return this.#h;if(this.sep==="/")return this.#h=this.fullpath();if(!this.parent){let K=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(K))return this.#h=`//?/${K}`;else return this.#h=K}let q=this.parent,_=q.fullpathPosix(),j=_+(!_||!q.parent?"":"/")+this.name;return this.#h=j}isUnknown(){return(this.#j&_q)===Kq}isType(q){return this[`is${q}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#j&_q)===K$}isDirectory(){return(this.#j&_q)===Cq}isCharacterDevice(){return(this.#j&_q)===q$}isBlockDevice(){return(this.#j&_q)===_$}isFIFO(){return(this.#j&_q)===Qf}isSocket(){return(this.#j&_q)===j$}isSymbolicLink(){return(this.#j&M_)===M_}lstatCached(){return this.#j&Bf?this:void 0}readlinkCached(){return this.#S}realpathCached(){return this.#C}readdirCached(){let q=this.children();return q.slice(0,q.provisional)}canReadlink(){if(this.#S)return!0;if(!this.parent)return!1;let q=this.#j&_q;return!(q!==Kq&&q!==M_||this.#j&g7||this.#j&Tq)}calledReaddir(){return!!(this.#j&b9)}isENOENT(){return!!(this.#j&Tq)}isNamed(q){return!this.nocase?this.#D===V3(q):this.#D===y7(q)}async readlink(){let q=this.#S;if(q)return q;if(!this.canReadlink())return;if(!this.parent)return;try{let _=await this.#q.promises.readlink(this.fullpath()),j=(await this.parent.realpath())?.resolve(_);if(j)return this.#S=j}catch(_){this.#c(_.code);return}}readlinkSync(){let q=this.#S;if(q)return q;if(!this.canReadlink())return;if(!this.parent)return;try{let _=this.#q.readlinkSync(this.fullpath()),j=this.parent.realpathSync()?.resolve(_);if(j)return this.#S=j}catch(_){this.#c(_.code);return}}#V(q){this.#j|=b9;for(let _=q.provisional;_j(null,q))}readdirCB(q,_=!1){if(!this.canReaddir()){if(_)q(null,[]);else queueMicrotask(()=>q(null,[]));return}let j=this.children();if(this.calledReaddir()){let Y=j.slice(0,j.provisional);if(_)q(null,Y);else queueMicrotask(()=>q(null,Y));return}if(this.#R.push(q),this.#x)return;this.#x=!0;let K=this.fullpath();this.#q.readdir(K,{withFileTypes:!0},(Y,f)=>{if(Y)this.#E(Y.code),j.provisional=0;else{for(let P of f)this.#d(P,j);this.#V(j)}this.#a(j.slice(0,j.provisional));return})}#o;async readdir(){if(!this.canReaddir())return[];let q=this.children();if(this.calledReaddir())return q.slice(0,q.provisional);let _=this.fullpath();if(this.#o)await this.#o;else{let j=()=>{};this.#o=new Promise((K)=>j=K);try{for(let K of await this.#q.promises.readdir(_,{withFileTypes:!0}))this.#d(K,q);this.#V(q)}catch(K){this.#E(K.code),q.provisional=0}this.#o=void 0,j()}return q.slice(0,q.provisional)}readdirSync(){if(!this.canReaddir())return[];let q=this.children();if(this.calledReaddir())return q.slice(0,q.provisional);let _=this.fullpath();try{for(let j of this.#q.readdirSync(_,{withFileTypes:!0}))this.#d(j,q);this.#V(q)}catch(j){this.#E(j.code),q.provisional=0}return q.slice(0,q.provisional)}canReaddir(){if(this.#j&tf)return!1;let q=_q&this.#j;if(!(q===Kq||q===Cq||q===M_))return!1;return!0}shouldWalk(q,_){return(this.#j&Cq)===Cq&&!(this.#j&tf)&&!q.has(this)&&(!_||_(this))}async realpath(){if(this.#C)return this.#C;if((d7|g7|Tq)&this.#j)return;try{let q=await this.#q.promises.realpath(this.fullpath());return this.#C=this.resolve(q)}catch(q){this.#l()}}realpathSync(){if(this.#C)return this.#C;if((d7|g7|Tq)&this.#j)return;try{let q=this.#q.realpathSync(this.fullpath());return this.#C=this.resolve(q)}catch(q){this.#l()}}[Y$](q){if(q===this)return;q.isCWD=!1,this.isCWD=!0;let _=new Set([]),j=[],K=this;while(K&&K.parent)_.add(K),K.#N=j.join(this.sep),K.#H=j.join("/"),K=K.parent,j.push("..");K=q;while(K&&K.parent&&!_.has(K))K.#N=void 0,K.#H=void 0,K=K.parent}}class p7 extends b6{sep="\\";splitSep=xh;constructor(q,_=Kq,j,K,Y,f,P){super(q,_,j,K,Y,f,P)}newChild(q,_=Kq,j={}){return new p7(q,_,this.root,this.roots,this.nocase,this.childrenCache(),j)}getRootString(q){return E9.parse(q).root}getRoot(q){if(q=lh(q.toUpperCase()),q===this.root.name)return this.root;for(let[_,j]of Object.entries(this.roots))if(this.sameRoot(q,_))return this.roots[q]=j;return this.roots[q]=new M3(q,this).root}sameRoot(q,_=this.root.name){return q=q.toUpperCase().replace(/\//g,"\\").replace(sf,"$1\\"),q===_}}class L7 extends b6{splitSep="/";sep="/";constructor(q,_=Kq,j,K,Y,f,P){super(q,_,j,K,Y,f,P)}getRootString(q){return q.startsWith("/")?"/":""}getRoot(q){return this.root}newChild(q,_=Kq,j={}){return new L7(q,_,this.root,this.roots,this.nocase,this.childrenCache(),j)}}class m9{root;rootPath;roots;cwd;#q;#_;#Y;nocase;#P;constructor(q=process.cwd(),_,j,{nocase:K,childrenCacheSize:Y=16384,fs:f=D3}={}){if(this.#P=Uf(f),q instanceof URL||q.startsWith("file://"))q=Nh(q);let P=_.resolve(q);this.roots=Object.create(null),this.rootPath=this.parseRootPath(P),this.#q=new R9,this.#_=new R9,this.#Y=new P$(Y);let $=P.substring(this.rootPath.length).split(j);if($.length===1&&!$[0])$.pop();if(K===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=K,this.root=this.newRoot(this.#P),this.roots[this.rootPath]=this.root;let w=this.root,O=$.length-1,v=_.sep,z=this.rootPath,W=!1;for(let J of $){let T=O--;w=w.child(J,{relative:new Array(T).fill("..").join(v),relativePosix:new Array(T).fill("..").join("/"),fullpath:z+=(W?"":v)+J}),W=!0}this.cwd=w}depth(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.depth()}childrenCache(){return this.#Y}resolve(...q){let _="";for(let Y=q.length-1;Y>=0;Y--){let f=q[Y];if(!f||f===".")continue;if(_=_?`${f}/${_}`:f,this.isAbsolute(f))break}let j=this.#q.get(_);if(j!==void 0)return j;let K=this.cwd.resolve(_).fullpath();return this.#q.set(_,K),K}resolvePosix(...q){let _="";for(let Y=q.length-1;Y>=0;Y--){let f=q[Y];if(!f||f===".")continue;if(_=_?`${f}/${_}`:f,this.isAbsolute(f))break}let j=this.#_.get(_);if(j!==void 0)return j;let K=this.cwd.resolve(_).fullpathPosix();return this.#_.set(_,K),K}relative(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.relative()}relativePosix(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.relativePosix()}basename(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.name}dirname(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return(q.parent||q).fullpath()}async readdir(q=this.cwd,_={withFileTypes:!0}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;let{withFileTypes:j}=_;if(!q.canReaddir())return[];else{let K=await q.readdir();return j?K:K.map((Y)=>Y.name)}}readdirSync(q=this.cwd,_={withFileTypes:!0}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;let{withFileTypes:j=!0}=_;if(!q.canReaddir())return[];else if(j)return q.readdirSync();else return q.readdirSync().map((K)=>K.name)}async lstat(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.lstat()}lstatSync(q=this.cwd){if(typeof q==="string")q=this.cwd.resolve(q);return q.lstatSync()}async readlink(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q.withFileTypes,q=this.cwd;let j=await q.readlink();return _?j:j?.fullpath()}readlinkSync(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q.withFileTypes,q=this.cwd;let j=q.readlinkSync();return _?j:j?.fullpath()}async realpath(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q.withFileTypes,q=this.cwd;let j=await q.realpath();return _?j:j?.fullpath()}realpathSync(q=this.cwd,{withFileTypes:_}={withFileTypes:!1}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q.withFileTypes,q=this.cwd;let j=q.realpathSync();return _?j:j?.fullpath()}async walk(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=[];if(!Y||Y(q))P.push(j?q:q.fullpath());let $=new Set,w=(v,z)=>{$.add(v),v.readdirCB((W,J)=>{if(W)return z(W);let T=J.length;if(!T)return z();let H=()=>{if(--T===0)z()};for(let X of J){if(!Y||Y(X))P.push(j?X:X.fullpath());if(K&&X.isSymbolicLink())X.realpath().then((A)=>A?.isUnknown()?A.lstat():A).then((A)=>A?.shouldWalk($,f)?w(A,H):H());else if(X.shouldWalk($,f))w(X,H);else H()}},!0)},O=q;return new Promise((v,z)=>{w(O,(W)=>{if(W)return z(W);v(P)})})}walkSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=[];if(!Y||Y(q))P.push(j?q:q.fullpath());let $=new Set([q]);for(let w of $){let O=w.readdirSync();for(let v of O){if(!Y||Y(v))P.push(j?v:v.fullpath());let z=v;if(v.isSymbolicLink()){if(!(K&&(z=v.realpathSync())))continue;if(z.isUnknown())z.lstatSync()}if(z.shouldWalk($,f))$.add(z)}}return P}[Symbol.asyncIterator](){return this.iterate()}iterate(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;return this.stream(q,_)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_;if(!Y||Y(q))yield j?q:q.fullpath();let P=new Set([q]);for(let $ of P){let w=$.readdirSync();for(let O of w){if(!Y||Y(O))yield j?O:O.fullpath();let v=O;if(O.isSymbolicLink()){if(!(K&&(v=O.realpathSync())))continue;if(v.isUnknown())v.lstatSync()}if(v.shouldWalk(P,f))P.add(v)}}}stream(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=new V_({objectMode:!0});if(!Y||Y(q))P.write(j?q:q.fullpath());let $=new Set,w=[q],O=0,v=()=>{let z=!1;while(!z){let W=w.shift();if(!W){if(O===0)P.end();return}O++,$.add(W);let J=(H,X,A=!1)=>{if(H)return P.emit("error",H);if(K&&!A){let G=[];for(let D of X)if(D.isSymbolicLink())G.push(D.realpath().then((M)=>M?.isUnknown()?M.lstat():M));if(G.length){Promise.all(G).then(()=>J(null,X,!0));return}}for(let G of X)if(G&&(!Y||Y(G))){if(!P.write(j?G:G.fullpath()))z=!0}O--;for(let G of X){let D=G.realpathCached()||G;if(D.shouldWalk($,f))w.push(D)}if(z&&!P.flowing)P.once("drain",v);else if(!T)v()},T=!0;W.readdirCB(J,!0),T=!1}};return v(),P}streamSync(q=this.cwd,_={}){if(typeof q==="string")q=this.cwd.resolve(q);else if(!(q instanceof b6))_=q,q=this.cwd;let{withFileTypes:j=!0,follow:K=!1,filter:Y,walkFilter:f}=_,P=new V_({objectMode:!0}),$=new Set;if(!Y||Y(q))P.write(j?q:q.fullpath());let w=[q],O=0,v=()=>{let z=!1;while(!z){let W=w.shift();if(!W){if(O===0)P.end();return}O++,$.add(W);let J=W.readdirSync();for(let T of J)if(!Y||Y(T)){if(!P.write(j?T:T.fullpath()))z=!0}O--;for(let T of J){let H=T;if(T.isSymbolicLink()){if(!(K&&(H=T.realpathSync())))continue;if(H.isUnknown())H.lstatSync()}if(H.shouldWalk($,f))w.push(H)}}if(z&&!P.flowing)P.once("drain",v)};return v(),P}chdir(q=this.cwd){let _=this.cwd;this.cwd=typeof q==="string"?this.cwd.resolve(q):q,this.cwd[Y$](_)}}class M3 extends m9{sep="\\";constructor(q=process.cwd(),_={}){let{nocase:j=!0}=_;super(q,E9,"\\",{..._,nocase:j});this.nocase=j;for(let K=this.cwd;K;K=K.parent)K.nocase=this.nocase}parseRootPath(q){return E9.parse(q).root.toUpperCase()}newRoot(q){return new p7(this.rootPath,Cq,void 0,this.roots,this.nocase,this.childrenCache(),{fs:q})}isAbsolute(q){return q.startsWith("/")||q.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(q)}}class N3 extends m9{sep="/";constructor(q=process.cwd(),_={}){let{nocase:j=!1}=_;super(q,Mh,"/",{..._,nocase:j});this.nocase=j}parseRootPath(q){return"/"}newRoot(q){return new L7(this.rootPath,Cq,void 0,this.roots,this.nocase,this.childrenCache(),{fs:q})}isAbsolute(q){return q.startsWith("/")}}class l7 extends N3{constructor(q=process.cwd(),_={}){let{nocase:j=!0}=_;super(q,{..._,nocase:j})}}var PN=process.platform==="win32"?p7:L7,f$=process.platform==="win32"?M3:process.platform==="darwin"?l7:N3;var ch=(q)=>q.length>=1,rh=(q)=>q.length>=1;class uK{#q;#_;#Y;length;#P;#f;#G;#X;#z;#$;#W=!0;constructor(q,_,j,K){if(!ch(q))throw new TypeError("empty pattern list");if(!rh(_))throw new TypeError("empty glob list");if(_.length!==q.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=q.length,j<0||j>=this.length)throw new TypeError("index out of range");if(this.#q=q,this.#_=_,this.#Y=j,this.#P=K,this.#Y===0){if(this.isUNC()){let[Y,f,P,$,...w]=this.#q,[O,v,z,W,...J]=this.#_;if(w[0]==="")w.shift(),J.shift();let T=[Y,f,P,$,""].join("/"),H=[O,v,z,W,""].join("/");this.#q=[T,...w],this.#_=[H,...J],this.length=this.#q.length}else if(this.isDrive()||this.isAbsolute()){let[Y,...f]=this.#q,[P,...$]=this.#_;if(f[0]==="")f.shift(),$.shift();let w=Y+"/",O=P+"/";this.#q=[w,...f],this.#_=[O,...$],this.length=this.#q.length}}}pattern(){return this.#q[this.#Y]}isString(){return typeof this.#q[this.#Y]==="string"}isGlobstar(){return this.#q[this.#Y]===T6}isRegExp(){return this.#q[this.#Y]instanceof RegExp}globString(){return this.#G=this.#G||(this.#Y===0?this.isAbsolute()?this.#_[0]+this.#_.slice(1).join("/"):this.#_.join("/"):this.#_.slice(this.#Y).join("/"))}hasMore(){return this.length>this.#Y+1}rest(){if(this.#f!==void 0)return this.#f;if(!this.hasMore())return this.#f=null;return this.#f=new uK(this.#q,this.#_,this.#Y+1,this.#P),this.#f.#$=this.#$,this.#f.#z=this.#z,this.#f.#X=this.#X,this.#f}isUNC(){let q=this.#q;return this.#z!==void 0?this.#z:this.#z=this.#P==="win32"&&this.#Y===0&&q[0]===""&&q[1]===""&&typeof q[2]==="string"&&!!q[2]&&typeof q[3]==="string"&&!!q[3]}isDrive(){let q=this.#q;return this.#X!==void 0?this.#X:this.#X=this.#P==="win32"&&this.#Y===0&&this.length>1&&typeof q[0]==="string"&&/^[a-z]:$/i.test(q[0])}isAbsolute(){let q=this.#q;return this.#$!==void 0?this.#$:this.#$=q[0]===""&&q.length>1||this.isDrive()||this.isUNC()}root(){let q=this.#q[0];return typeof q==="string"&&this.isAbsolute()&&this.#Y===0?q:""}checkFollowGlobstar(){return!(this.#Y===0||!this.isGlobstar()||!this.#W)}markFollowGlobstar(){if(this.#Y===0||!this.isGlobstar()||!this.#W)return!1;return this.#W=!1,!0}}var ih=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class b3{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(q,{nobrace:_,nocase:j,noext:K,noglobstar:Y,platform:f=ih}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=f,this.mmopts={dot:!0,nobrace:_,nocase:j,noext:K,noglobstar:Y,optimizationLevel:2,platform:f,nocomment:!0,nonegate:!0};for(let P of q)this.add(P)}add(q){let _=new qq(q,this.mmopts);for(let j=0;j<_.set.length;j++){let K=_.set[j],Y=_.globParts[j];if(!K||!Y)throw new Error("invalid pattern object");while(K[0]==="."&&Y[0]===".")K.shift(),Y.shift();let f=new uK(K,Y,0,this.platform),P=new qq(f.globString(),this.mmopts),$=Y[Y.length-1]==="**",w=f.isAbsolute();if(w)this.absolute.push(P);else this.relative.push(P);if($)if(w)this.absoluteChildren.push(P);else this.relativeChildren.push(P)}}ignored(q){let _=q.fullpath(),j=`${_}/`,K=q.relative()||".",Y=`${K}/`;for(let f of this.relative)if(f.match(K)||f.match(Y))return!0;for(let f of this.absolute)if(f.match(_)||f.match(j))return!0;return!1}childrenIgnored(q){let _=q.fullpath()+"/",j=(q.relative()||".")+"/";for(let K of this.relativeChildren)if(K.match(j))return!0;for(let K of this.absoluteChildren)if(K.match(_))return!0;return!1}}class I9{store;constructor(q=new Map){this.store=q}copy(){return new I9(new Map(this.store))}hasWalked(q,_){return this.store.get(q.fullpath())?.has(_.globString())}storeWalked(q,_){let j=q.fullpath(),K=this.store.get(j);if(K)K.add(_.globString());else this.store.set(j,new Set([_.globString()]))}}class $${store=new Map;add(q,_,j){let K=(_?2:0)|(j?1:0),Y=this.store.get(q);this.store.set(q,Y===void 0?K:K&Y)}entries(){return[...this.store.entries()].map(([q,_])=>[q,!!(_&2),!!(_&1)])}}class w${store=new Map;add(q,_){if(!q.canReaddir())return;let j=this.store.get(q);if(j){if(!j.find((K)=>K.globString()===_.globString()))j.push(_)}else this.store.set(q,[_])}get(q){let _=this.store.get(q);if(!_)throw new Error("attempting to walk unknown path");return _}entries(){return this.keys().map((q)=>[q,this.store.get(q)])}keys(){return[...this.store.keys()].filter((q)=>q.canReaddir())}}class S3{hasWalkedCache;matches=new $$;subwalks=new w$;patterns;follow;dot;opts;constructor(q,_){this.opts=q,this.follow=!!q.follow,this.dot=!!q.dot,this.hasWalkedCache=_?_.copy():new I9}processPatterns(q,_){this.patterns=_;let j=_.map((K)=>[q,K]);for(let[K,Y]of j){this.hasWalkedCache.storeWalked(K,Y);let f=Y.root(),P=Y.isAbsolute()&&this.opts.absolute!==!1;if(f){K=K.resolve(f==="/"&&this.opts.root!==void 0?this.opts.root:f);let v=Y.rest();if(!v){this.matches.add(K,!0,!1);continue}else Y=v}if(K.isENOENT())continue;let $,w,O=!1;while(typeof($=Y.pattern())==="string"&&(w=Y.rest()))K=K.resolve($),Y=w,O=!0;if($=Y.pattern(),w=Y.rest(),O){if(this.hasWalkedCache.hasWalked(K,Y))continue;this.hasWalkedCache.storeWalked(K,Y)}if(typeof $==="string"){let v=$===".."||$===""||$===".";this.matches.add(K.resolve($),P,v);continue}else if($===T6){if(!K.isSymbolicLink()||this.follow||Y.checkFollowGlobstar())this.subwalks.add(K,Y);let v=w?.pattern(),z=w?.rest();if(!w||(v===""||v===".")&&!z)this.matches.add(K,P,v===""||v===".");else if(v===".."){let W=K.parent||K;if(!z)this.matches.add(W,P,!0);else if(!this.hasWalkedCache.hasWalked(W,z))this.subwalks.add(W,z)}}else if($ instanceof RegExp)this.subwalks.add(K,Y)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new S3(this.opts,this.hasWalkedCache)}filterEntries(q,_){let j=this.subwalks.get(q),K=this.child();for(let Y of _)for(let f of j){let P=f.isAbsolute(),$=f.pattern(),w=f.rest();if($===T6)K.testGlobstar(Y,f,w,P);else if($ instanceof RegExp)K.testRegExp(Y,$,w,P);else K.testString(Y,$,w,P)}return K}testGlobstar(q,_,j,K){if(this.dot||!q.name.startsWith(".")){if(!_.hasMore())this.matches.add(q,K,!1);if(q.canReaddir()){if(this.follow||!q.isSymbolicLink())this.subwalks.add(q,_);else if(q.isSymbolicLink()){if(j&&_.checkFollowGlobstar())this.subwalks.add(q,j);else if(_.markFollowGlobstar())this.subwalks.add(q,_)}}}if(j){let Y=j.pattern();if(typeof Y==="string"&&Y!==".."&&Y!==""&&Y!==".")this.testString(q,Y,j.rest(),K);else if(Y===".."){let f=q.parent||q;this.subwalks.add(f,j)}else if(Y instanceof RegExp)this.testRegExp(q,Y,j.rest(),K)}}testRegExp(q,_,j,K){if(!_.test(q.name))return;if(!j)this.matches.add(q,K,!1);else this.subwalks.add(q,j)}testString(q,_,j,K){if(!q.isNamed(_))return;if(!j)this.matches.add(q,K,!1);else this.subwalks.add(q,j)}}var oh=(q,_)=>typeof q==="string"?new b3([q],_):Array.isArray(q)?new b3(q,_):q;class g9{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#q=[];#_;#Y;signal;maxDepth;includeChildMatches;constructor(q,_,j){if(this.patterns=q,this.path=_,this.opts=j,this.#Y=!j.posix&&j.platform==="win32"?"\\":"/",this.includeChildMatches=j.includeChildMatches!==!1,j.ignore||!this.includeChildMatches){if(this.#_=oh(j.ignore??[],j),!this.includeChildMatches&&typeof this.#_.add!=="function")throw new Error("cannot ignore child matches, ignore lacks add() method.")}if(this.maxDepth=j.maxDepth||1/0,j.signal)this.signal=j.signal,this.signal.addEventListener("abort",()=>{this.#q.length=0})}#P(q){return this.seen.has(q)||!!this.#_?.ignored?.(q)}#f(q){return!!this.#_?.childrenIgnored?.(q)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let q=void 0;while(!this.paused&&(q=this.#q.shift()))q()}onResume(q){if(this.signal?.aborted)return;if(!this.paused)q();else this.#q.push(q)}async matchCheck(q,_){if(_&&this.opts.nodir)return;let j;if(this.opts.realpath){if(j=q.realpathCached()||await q.realpath(),!j)return;q=j}let Y=q.isUnknown()||this.opts.stat?await q.lstat():q;if(this.opts.follow&&this.opts.nodir&&Y?.isSymbolicLink()){let f=await Y.realpath();if(f&&(f.isUnknown()||this.opts.stat))await f.lstat()}return this.matchCheckTest(Y,_)}matchCheckTest(q,_){return q&&(this.maxDepth===1/0||q.depth()<=this.maxDepth)&&(!_||q.canReaddir())&&(!this.opts.nodir||!q.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!q.isSymbolicLink()||!q.realpathCached()?.isDirectory())&&!this.#P(q)?q:void 0}matchCheckSync(q,_){if(_&&this.opts.nodir)return;let j;if(this.opts.realpath){if(j=q.realpathCached()||q.realpathSync(),!j)return;q=j}let Y=q.isUnknown()||this.opts.stat?q.lstatSync():q;if(this.opts.follow&&this.opts.nodir&&Y?.isSymbolicLink()){let f=Y.realpathSync();if(f&&(f?.isUnknown()||this.opts.stat))f.lstatSync()}return this.matchCheckTest(Y,_)}matchFinish(q,_){if(this.#P(q))return;if(!this.includeChildMatches&&this.#_?.add){let Y=`${q.relativePosix()}/**`;this.#_.add(Y)}let j=this.opts.absolute===void 0?_:this.opts.absolute;this.seen.add(q);let K=this.opts.mark&&q.isDirectory()?this.#Y:"";if(this.opts.withFileTypes)this.matchEmit(q);else if(j){let Y=this.opts.posix?q.fullpathPosix():q.fullpath();this.matchEmit(Y+K)}else{let Y=this.opts.posix?q.relativePosix():q.relative(),f=this.opts.dotRelative&&!Y.startsWith(".."+this.#Y)?"."+this.#Y:"";this.matchEmit(!Y?"."+K:f+Y+K)}}async match(q,_,j){let K=await this.matchCheck(q,j);if(K)this.matchFinish(K,_)}matchSync(q,_,j){let K=this.matchCheckSync(q,j);if(K)this.matchFinish(K,_)}walkCB(q,_,j){if(this.signal?.aborted)j();this.walkCB2(q,_,new S3(this.opts),j)}walkCB2(q,_,j,K){if(this.#f(q))return K();if(this.signal?.aborted)K();if(this.paused){this.onResume(()=>this.walkCB2(q,_,j,K));return}j.processPatterns(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,w]of j.matches.entries()){if(this.#P(P))continue;Y++,this.match(P,$,w).then(()=>f())}for(let P of j.subwalkTargets()){if(this.maxDepth!==1/0&&P.depth()>=this.maxDepth)continue;Y++;let $=P.readdirCached();if(P.calledReaddir())this.walkCB3(P,$,j,f);else P.readdirCB((w,O)=>this.walkCB3(P,O,j,f),!0)}f()}walkCB3(q,_,j,K){j=j.filterEntries(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,w]of j.matches.entries()){if(this.#P(P))continue;Y++,this.match(P,$,w).then(()=>f())}for(let[P,$]of j.subwalks.entries())Y++,this.walkCB2(P,$,j.child(),f);f()}walkCBSync(q,_,j){if(this.signal?.aborted)j();this.walkCB2Sync(q,_,new S3(this.opts),j)}walkCB2Sync(q,_,j,K){if(this.#f(q))return K();if(this.signal?.aborted)K();if(this.paused){this.onResume(()=>this.walkCB2Sync(q,_,j,K));return}j.processPatterns(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,w]of j.matches.entries()){if(this.#P(P))continue;this.matchSync(P,$,w)}for(let P of j.subwalkTargets()){if(this.maxDepth!==1/0&&P.depth()>=this.maxDepth)continue;Y++;let $=P.readdirSync();this.walkCB3Sync(P,$,j,f)}f()}walkCB3Sync(q,_,j,K){j=j.filterEntries(q,_);let Y=1,f=()=>{if(--Y===0)K()};for(let[P,$,w]of j.matches.entries()){if(this.#P(P))continue;this.matchSync(P,$,w)}for(let[P,$]of j.subwalks.entries())Y++,this.walkCB2Sync(P,$,j.child(),f);f()}}class x7 extends g9{matches=new Set;constructor(q,_,j){super(q,_,j)}matchEmit(q){this.matches.add(q)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())await this.path.lstat();return await new Promise((q,_)=>{this.walkCB(this.path,this.patterns,()=>{if(this.signal?.aborted)_(this.signal.reason);else q(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}}class n7 extends g9{results;constructor(q,_,j){super(q,_,j);this.results=new V_({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(q){if(this.results.write(q),!this.results.flowing)this.pause()}stream(){let q=this.path;if(q.isUnknown())q.lstat().then(()=>{this.walkCB(q,this.patterns,()=>this.results.end())});else this.walkCB(q,this.patterns,()=>this.results.end());return this.results}streamSync(){if(this.path.isUnknown())this.path.lstatSync();return this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}}var Bh=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Vq{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(q,_){if(!_)throw new TypeError("glob options required");if(this.withFileTypes=!!_.withFileTypes,this.signal=_.signal,this.follow=!!_.follow,this.dot=!!_.dot,this.dotRelative=!!_.dotRelative,this.nodir=!!_.nodir,this.mark=!!_.mark,!_.cwd)this.cwd="";else if(_.cwd instanceof URL||_.cwd.startsWith("file://"))_.cwd=ah(_.cwd);if(this.cwd=_.cwd||"",this.root=_.root,this.magicalBraces=!!_.magicalBraces,this.nobrace=!!_.nobrace,this.noext=!!_.noext,this.realpath=!!_.realpath,this.absolute=_.absolute,this.includeChildMatches=_.includeChildMatches!==!1,this.noglobstar=!!_.noglobstar,this.matchBase=!!_.matchBase,this.maxDepth=typeof _.maxDepth==="number"?_.maxDepth:1/0,this.stat=!!_.stat,this.ignore=_.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof q==="string")q=[q];if(this.windowsPathsNoEscape=!!_.windowsPathsNoEscape||_.allowWindowsEscape===!1,this.windowsPathsNoEscape)q=q.map(($)=>$.replace(/\\/g,"/"));if(this.matchBase){if(_.noglobstar)throw new TypeError("base matching requires globstar");q=q.map(($)=>$.includes("/")?$:`./**/${$}`)}if(this.pattern=q,this.platform=_.platform||Bh,this.opts={..._,platform:this.platform},_.scurry){if(this.scurry=_.scurry,_.nocase!==void 0&&_.nocase!==_.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let $=_.platform==="win32"?M3:_.platform==="darwin"?l7:_.platform?N3:f$;this.scurry=new $(this.cwd,{nocase:_.nocase,fs:_.fs})}this.nocase=this.scurry.nocase;let j=this.platform==="darwin"||this.platform==="win32",K={..._,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:j,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},Y=this.pattern.map(($)=>new qq($,K)),[f,P]=Y.reduce(($,w)=>{return $[0].push(...w.set),$[1].push(...w.globParts),$},[[],[]]);this.patterns=f.map(($,w)=>{let O=P[w];if(!O)throw new Error("invalid pattern object");return new uK($,O,0,this.platform)})}async walk(){return[...await new x7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new x7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new n7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new n7(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}var y9=(q,_={})=>{if(!Array.isArray(q))q=[q];for(let j of q)if(new qq(j,_).hasMagic())return!0;return!1};function r7(q,_={}){return new Vq(q,_).streamSync()}function z$(q,_={}){return new Vq(q,_).stream()}function v$(q,_={}){return new Vq(q,_).walkSync()}async function O$(q,_={}){return new Vq(q,_).walk()}function i7(q,_={}){return new Vq(q,_).iterateSync()}function W$(q,_={}){return new Vq(q,_).iterate()}var th=r7,eh=Object.assign(z$,{sync:r7}),Fh=i7,Uh=Object.assign(W$,{sync:i7}),sh=Object.assign(v$,{stream:r7,iterate:i7}),c7=Object.assign(O$,{glob:O$,globSync:v$,sync:sh,globStream:z$,stream:eh,globStreamSync:r7,streamSync:th,globIterate:W$,iterate:Uh,globIterateSync:i7,iterateSync:Fh,Glob:Vq,hasMagic:y9,escape:kK,unescape:Hq});c7.glob=c7;d6();async function J$(q,_={}){let j=$8.getInstance().getTrashDirectory();if(!H$(j))qD(j,{recursive:!0});let K=Array.isArray(q)?q:[q];for(let Y of K){let f=await c7(Y),P=f.length>0?f:[Y];for(let $ of P)try{if(!H$($)){if(!_.force){console.error(`trash: ${$}: No such file or directory`);continue}continue}if(_D($).isDirectory()&&!_.recursive){if(!_.force){console.error(`trash: ${$}: is a directory`);continue}}let O=jD($),v=Date.now(),z=KD(j,`${O}.${v}`);Qh($,z),console.log(`Moved ${O} to trash`)}catch(w){if(!_.force){let O=w instanceof Error?w.message:String(w);console.error(`trash: ${$}: ${O}`)}}}}vK();d6();import{readdirSync as PD,renameSync as YD}from"fs";import{join as T$}from"path";async function Z$(){let q=$8.getInstance().getTrashDirectory(),_=PD(q);if(_.length===0){console.log("Trash is empty");return}let j=await xq({message:"Select file to restore:",options:_.map((K)=>({value:K,label:K}))});if(L8(j))return;YD(T$(q,j),T$(process.cwd(),j)),console.log(`Restored ${j}`)}d6();import{appendFileSync as k$}from"fs";function fD(q){let j=q.toLowerCase().replace(/[^\w\s]/g," ").split(/\s+/).filter((f)=>f.length>2).slice(0,4).join("-"),K=j.length>30?j.substring(0,27)+"...":j,Y=new Date().toISOString().substring(11,19).replace(/:/g,"");return`${K}-${Y}`}async function X$(q,_={}){if(k$("/Users/alexnewman/.claude-mem/save-debug.log",`[${new Date().toISOString()}] Received message: "${q}" (type: ${typeof q}, length: ${q?.length}) +`,"utf8"),!q||q.trim()==="")console.error("Error: Message is required"),process.exit(1);let j=$8.getInstance(),K=new Date().toISOString(),Y=$8.getCurrentProjectName(),f=fD(q),P=`${Y}_${f}_overview`,$=j.getIndexPath(),w={type:"overview",content:q,session_id:f,project:Y,timestamp:K};j.ensureDirectory(j.getDataDirectory()),k$($,JSON.stringify(w)+` +`,"utf8"),console.log(JSON.stringify({success:!0,document_id:P,session_id:f,project:Y,timestamp:K,suppressOutput:!0}))}a3();f7();import e8 from"fs";import R6 from"path";import{execSync as A$}from"child_process";async function u$(q){try{if(q.update){await G$(q);return}let _=R6.join(process.cwd(),"package.json"),j="unknown",K="unknown";if(e8.existsSync(_))try{let b=JSON.parse(e8.readFileSync(_,"utf-8"));j=b.version||"unknown",K=b.name||R6.basename(process.cwd())}catch(b){K=R6.basename(process.cwd())}let Y=[],f=q.historical||1;if(q.generate)Y.push(q.generate),f=1,console.log(`\uD83C\uDFAF Generating changelog for specific version: ${q.generate}`);else if(j!=="unknown"){let b=j.split(".");if(b.length===3){let d=parseInt(b[0]),y=parseInt(b[1]),V=parseInt(b[2]);for(let S=0;Sd.trim());for(let d of b)try{if(JSON.parse(d).version===j)w=!0}catch(y){}if(!q.historical&&!q.generate&&f===1){if(w)console.log(`❌ Version ${j} already has changelog entries.`),console.log(` \uD83D\uDCDD Workflow:`),console.log(" 1. Make your code updates"),console.log(" 2. Build and test: bun run build"),console.log(" 3. Bump version: npm version patch"),console.log(" 4. Generate changelog: claude-mem changelog"),console.log(` 5. Commit and push -`),console.log("\uD83D\uDCA1 Or use --historical 1 to regenerate this version's changelog"),process.exit(1)}}let O=[];if(q.start&&q.end){let b=q.generate||j;O.push({version:b,startTime:q.start,endTime:q.end}),console.log(`\uD83D\uDCC5 Using custom time range for ${b}:`),console.log(` Start: ${new Date(q.start).toLocaleString()}`),console.log(` End: ${new Date(q.end).toLocaleString()}`)}else try{let b=X$(`npm view ${K} time --json`,{encoding:"utf-8",timeout:5000}),d=JSON.parse(b),y="";if(f>1){let S=Y[Y.length-1].split("."),p=parseInt(S[0]),c=parseInt(S[1]),B=parseInt(S[2]);if(B>0)y=`${p}.${c}.${B-1}`;else if(c>0){let e=`${p}.${c-1}.`,Y8=Object.keys(d).filter((q8)=>q8.startsWith(e)).sort((q8,z8)=>{let w8=parseInt(q8.split(".")[2]||"0");return parseInt(z8.split(".")[2]||"0")-w8});if(Y8.length>0)y=Y8[0]}else if(p>0){let e=`${p-1}.`,Y8=Object.keys(d).filter((q8)=>q8.startsWith(e)).sort((q8,z8)=>{let[,w8,K8]=q8.split(".").map(Number),[,G8,o8]=z8.split(".").map(Number);if(w8!==G8)return G8-w8;return o8-K8});if(Y8.length>0)y=Y8[0]}if(q.verbose&&y&&d[y])console.log(`\uD83D\uDCCD Using ${y} as start boundary for time ranges`)}for(let V=0;V0)z8=`${e}.${Y8}.${q8-1}`;else if(Y8>0){let w8=`${e}.${Y8-1}.`,K8=Object.keys(d).filter((G8)=>G8.startsWith(w8)).sort((G8,o8)=>{let F8=parseInt(G8.split(".")[2]||"0");return parseInt(o8.split(".")[2]||"0")-F8});if(K8.length>0)z8=K8[0]}if(d[z8])p=d[z8]}else if(V1){let S=Y[Y.length-1].split("."),p=parseInt(S[0]),c=parseInt(S[1]),B=parseInt(S[2]);if(B>0)y=`${p}.${c}.${B-1}`;else if(c>0){let e=`${p}.${c-1}.`,Y8=Object.keys(d).filter((q8)=>q8.startsWith(e)).sort((q8,z8)=>{let w8=parseInt(q8.split(".")[2]||"0");return parseInt(z8.split(".")[2]||"0")-w8});if(Y8.length>0)y=Y8[0]}else if(p>0){let e=`${p-1}.`,Y8=Object.keys(d).filter((q8)=>q8.startsWith(e)).sort((q8,z8)=>{let[,w8,K8]=q8.split(".").map(Number),[,G8,o8]=z8.split(".").map(Number);if(w8!==G8)return G8-w8;return o8-K8});if(Y8.length>0)y=Y8[0]}if(q.verbose&&y&&d[y])console.log(`\uD83D\uDCCD Using ${y} as start boundary for time ranges`)}for(let V=0;V0)z8=`${e}.${Y8}.${q8-1}`;else if(Y8>0){let w8=`${e}.${Y8-1}.`,K8=Object.keys(d).filter((G8)=>G8.startsWith(w8)).sort((G8,o8)=>{let F8=parseInt(G8.split(".")[2]||"0");return parseInt(o8.split(".")[2]||"0")-F8});if(K8.length>0)z8=K8[0]}if(d[z8])p=d[z8]}else if(V0?`You are helping generate a changelog by searching for memories within specific time ranges for multiple versions. PROJECT: ${K} @@ -414,8 +415,8 @@ Return a JSON object with this structure: Group memories by the version they belong to based on timestamp. Start searching now.`:"ERROR: No time ranges available. This should never happen.";if(O.length===0)console.log("❌ No time ranges available. Cannot search memories."),process.exit(1);if(q.verbose)console.log("\uD83D\uDCDD Calling Claude to search memories...");let z=await gq({prompt:v,options:{allowedTools:["mcp__claude-mem__chroma_query_documents","mcp__claude-mem__chroma_get_documents"],pathToClaudeCodeExecutable:zq()}}),W="";if(z&&typeof z==="object"&&Symbol.asyncIterator in z){for await(let b of z)if(b?.type==="assistant"&&b?.message?.content){let d=b.message.content;if(typeof d==="string")W+=d;else if(Array.isArray(d)){for(let y of d)if(y.type==="text"&&y.text)W+=y.text}}}let J=[];try{let b=W.match(/```json\n([\s\S]*?)\n```/)||W.match(/\{[\s\S]*\}/);if(b){let d=JSON.parse(b[1]||b[0]);if(d.memories&&Array.isArray(d.memories))J=d.memories}}catch(b){console.error("⚠️ Could not parse memory search results:",b)}if(J.length===0){console.log(` ⚠️ No version-related memories found for this version.`),console.log(" This is normal for the first release or when no changes were tracked."),console.log(" Creating a placeholder changelog entry...");let b={version:Y[0],date:H,type:"Changed",description:"Initial release or minor updates",timestamp:new Date().toISOString(),generatedAt:new Date().toISOString()};if(!e8.existsSync(P))e8.mkdirSync(P,{recursive:!0});let d=JSON.stringify(b)+` -`;e8.appendFileSync($,d),console.log(`✅ Created placeholder changelog entry for v${Y[0]}`),await A$(q);return}console.log(`✅ Found ${J.length} version-related memories -`);let H=X$('date "+%Y-%m-%d %H:%M:%S %Z"').toString().trim().split(" ")[0],X=`Analyze these memories and generate changelog entries. +`;e8.appendFileSync($,d),console.log(`✅ Created placeholder changelog entry for v${Y[0]}`),await G$(q);return}console.log(`✅ Found ${J.length} version-related memories +`);let H=A$('date "+%Y-%m-%d %H:%M:%S %Z"').toString().trim().split(" ")[0],X=`Analyze these memories and generate changelog entries. PROJECT: ${K} DATE: ${H} @@ -473,7 +474,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). `).slice(0,30).join(` `)),N.split(` `).length>30)console.log(` -... (truncated for preview)`)}}catch(_){if(console.error("❌ Error generating changelog:",_ instanceof Error?_.message:_),_ instanceof Error&&_.stack)console.error("Stack:",_.stack);process.exit(1)}}async function A$(q){try{let _=R6.join(process.cwd(),"package.json"),j="unknown";if(e8.existsSync(_))try{j=JSON.parse(e8.readFileSync(_,"utf-8")).name||R6.basename(process.cwd())}catch(z){j=R6.basename(process.cwd())}let K=R6.join(process.env.HOME||process.env.USERPROFILE||"",".claude-mem","projects"),Y=R6.join(K,`${j}-changelog.jsonl`);if(!e8.existsSync(Y))console.log("❌ No changelog entries found. Generate some first with: claude-mem changelog"),process.exit(1);console.log("\uD83D\uDCDD Updating CHANGELOG.md from JSONL entries...");let f=[],P=e8.readFileSync(Y,"utf-8").split(` +... (truncated for preview)`)}}catch(_){if(console.error("❌ Error generating changelog:",_ instanceof Error?_.message:_),_ instanceof Error&&_.stack)console.error("Stack:",_.stack);process.exit(1)}}async function G$(q){try{let _=R6.join(process.cwd(),"package.json"),j="unknown";if(e8.existsSync(_))try{j=JSON.parse(e8.readFileSync(_,"utf-8")).name||R6.basename(process.cwd())}catch(z){j=R6.basename(process.cwd())}let K=R6.join(process.env.HOME||process.env.USERPROFILE||"",".claude-mem","projects"),Y=R6.join(K,`${j}-changelog.jsonl`);if(!e8.existsSync(Y))console.log("❌ No changelog entries found. Generate some first with: claude-mem changelog"),process.exit(1);console.log("\uD83D\uDCDD Updating CHANGELOG.md from JSONL entries...");let f=[],P=e8.readFileSync(Y,"utf-8").split(` `).filter((z)=>z.trim());for(let z of P)try{f.push(JSON.parse(z))}catch(W){}if(f.length===0)console.log("❌ No valid entries found in JSONL file"),process.exit(1);let $=new Map;for(let z of f){if(!$.has(z.version))$.set(z.version,[]);$.get(z.version).push(z)}let w=`# Changelog All notable changes to this project will be documented in this file. @@ -492,7 +493,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). `).slice(0,30).join(` `)),w.split(` `).length>30)console.log(` -... (truncated for preview)`)}}catch(_){console.error("❌ Error updating changelog:",_ instanceof Error?_.message:_),process.exit(1)}}vK();import iq from"path";import Mq from"fs";import C$ from"os";w7();a3();f7();import N_ from"fs";import u$ from"path";import fD from"os";class hK{titlesIndexPath;constructor(){this.titlesIndexPath=u$.join(fD.homedir(),".claude-mem","conversation-titles.jsonl"),this.ensureTitlesIndex()}ensureTitlesIndex(){let q=u$.dirname(this.titlesIndexPath);if(!N_.existsSync(q))N_.mkdirSync(q,{recursive:!0});if(!N_.existsSync(this.titlesIndexPath))N_.writeFileSync(this.titlesIndexPath,"","utf-8")}async generateTitle(q){let _=`Generate a 3-7 word descriptive title for this conversation based on the first message. +... (truncated for preview)`)}}catch(_){console.error("❌ Error updating changelog:",_ instanceof Error?_.message:_),process.exit(1)}}vK();import iq from"path";import Mq from"fs";import V$ from"os";w7();a3();f7();import N_ from"fs";import h$ from"path";import $D from"os";class hK{titlesIndexPath;constructor(){this.titlesIndexPath=h$.join($D.homedir(),".claude-mem","conversation-titles.jsonl"),this.ensureTitlesIndex()}ensureTitlesIndex(){let q=h$.dirname(this.titlesIndexPath);if(!N_.existsSync(q))N_.mkdirSync(q,{recursive:!0});if(!N_.existsSync(this.titlesIndexPath))N_.writeFileSync(this.titlesIndexPath,"","utf-8")}async generateTitle(q){let _=`Generate a 3-7 word descriptive title for this conversation based on the first message. The title should: - Capture the main topic or intent @@ -504,9 +505,9 @@ First message: "${q.substring(0,500)}" Respond with just the title, nothing else.`,j=await gq({prompt:_,options:{model:"claude-3-5-haiku-20241022",pathToClaudeCodeExecutable:zq()}}),K="";if(j&&typeof j==="object"&&Symbol.asyncIterator in j)for await(let Y of j){if(Y?.content)K+=Y.content;if(Y?.text)K+=Y.text}else if(typeof j==="string")K=j;return K.trim().replace(/^["']|["']$/g,"")}async batchGenerateTitles(q){let _=[];for(let j of q)try{let K=await this.generateTitle(j.firstMessage),Y={session_id:j.sessionId,generated_title:K,timestamp:new Date().toISOString(),project_name:j.projectName};_.push(Y),this.storeTitleInIndex(Y)}catch(K){console.error(`Failed to generate title for ${j.sessionId}:`,K)}return _}storeTitleInIndex(q){let _=JSON.stringify(q)+` `;N_.appendFileSync(this.titlesIndexPath,_,"utf-8")}getExistingTitles(){let q=new Map;if(!N_.existsSync(this.titlesIndexPath))return q;let j=N_.readFileSync(this.titlesIndexPath,"utf-8").trim().split(` -`).filter(Boolean);for(let K of j)try{let Y=JSON.parse(K);q.set(Y.session_id,Y)}catch(Y){}return q}getTitleForSession(q){let j=this.getExistingTitles().get(q);return j?j.generated_title:null}}function o7(q){if(q<1024)return`${q}B`;if(q<1048576)return`${(q/1024).toFixed(1)}KB`;return`${(q/1048576).toFixed(1)}MB`}function $D(q){let j=new Date().getTime()-q.getTime(),K=Math.floor(j/60000),Y=Math.floor(j/3600000),f=Math.floor(j/86400000);if(K<1)return"just now";if(K<60)return`${K}m ago`;if(Y<24)return`${Y}h ago`;if(f<7)return`${f}d ago`;if(f<30)return`${Math.floor(f/7)}w ago`;if(f<365)return`${Math.floor(f/30)}mo ago`;return`${Math.floor(f/365)}y ago`}function wD(q,_){try{let Y=new Date(q);if(!isNaN(Y.getTime()))return Y}catch{}let j=_.match(/(\d{4})-(\d{2})-(\d{2})_(\d{2})-(\d{2})-(\d{2})/);if(j){let[Y,f,P,$,w,O,v]=j;return new Date(parseInt(f),parseInt(P)-1,parseInt($),parseInt(w),parseInt(O),parseInt(v))}return Mq.statSync(_).mtime}function OD(q){try{let j=Mq.readFileSync(q,"utf-8").trim().split(` -`).filter(Boolean);for(let K of j)try{let Y=JSON.parse(K);if(Y.type==="user"&&Y.message?.content){let f=Y.message.content;if(Array.isArray(f)){let P=f.filter(($)=>$.type==="text").map(($)=>$.text).join(" ");if(P.trim())return P.trim()}else if(typeof f==="string")return f.trim()}}catch{}return"Conversation"}catch{return"Conversation"}}async function zD(){let q=new Set,_=iq.join(C$.homedir(),".claude-mem","claude-mem-index.jsonl");if(!Mq.existsSync(_))return q;let K=Mq.readFileSync(_,"utf-8").trim().split(` -`).filter(Boolean);for(let Y of K)try{let f=JSON.parse(Y);if(f.session_id)q.add(f.session_id);else if(f.sessionId)q.add(f.sessionId)}catch{}return q}async function vD(){let q=iq.join(C$.homedir(),".claude","projects");if(!Mq.existsSync(q))return{conversations:[],skippedCount:0};let _=Mq.readdirSync(q).filter((f)=>Mq.statSync(iq.join(q,f)).isDirectory()),j=[],K=await zD(),Y=0;for(let f of _){let P=iq.join(q,f),$=Mq.readdirSync(P).filter((w)=>w.endsWith(".jsonl")).map((w)=>iq.join(P,w));for(let w of $)try{let v=Mq.readFileSync(w,"utf-8").trim().split(` -`).filter(Boolean),z=JSON.parse(v[0]),W=v.length,J=Mq.statSync(w),T=J.size,H={sessionId:z.sessionId||iq.basename(w,".jsonl"),timestamp:z.timestamp||J.mtime.toISOString(),messageCount:W,branch:z.branch,cwd:z.cwd||P,fileSize:T};if(K.has(H.sessionId)){Y++;continue}let X=iq.basename(iq.dirname(w)),A=wD(H.timestamp,w),G=$D(A);j.push({filePath:w,...H,projectName:X,parsedDate:A,relativeDate:G})}catch{}}return{conversations:j,skippedCount:Y}}async function V$(q={}){console.clear(),YY(Q.bgCyan.black(" CLAUDE-MEM IMPORT "));let _=Qq();_.start("Scanning conversation history");let{conversations:j,skippedCount:K}=await vD();if(j.length===0){_.stop("No new conversations found");let w=K>0?`All ${K} conversation${K===1?" is":"s are"} already imported.`:"No conversations found.";nq(Q.yellow(w));return}j.sort((w,O)=>O.parsedDate.getTime()-w.parsedDate.getTime());let Y=K>0?`Found ${j.length} new conversation${j.length===1?"":"s"} (${K} already imported)`:`Found ${j.length} new conversation${j.length===1?"":"s"}`;_.stop(Y);let f=j.reduce((w,O)=>{if(!w[O.projectName])w[O.projectName]=[];return w[O.projectName].push(O),w},{}),P=await xq({message:"How would you like to import?",options:[{value:"browse",label:"Browse by Project",hint:"Select project then conversations"},{value:"project",label:"Import Entire Project",hint:"Select project and import all conversations"},{value:"recent",label:"Recent Conversations",hint:"Import most recent across all projects"},{value:"search",label:"Search",hint:"Search for specific conversations"}]});if(L8(P)){$6("Import cancelled");return}let $=[];if(P==="browse"){let w=Object.entries(f).sort((T,H)=>H[1][0].parsedDate.getTime()-T[1][0].parsedDate.getTime()).map(([T,H])=>({value:T,label:T,hint:`${H.length} conversation${H.length===1?"":"s"}, latest: ${H[0].relativeDate}`})),O=await xq({message:"Select a project",options:w});if(L8(O)){$6("Import cancelled");return}let v=f[O],z=await hq({message:"Would you like to generate titles for easier browsing?",initialValue:!1});if(L8(z)){$6("Import cancelled");return}if(z)await h$(v,O);let W=new hK,J=v.map((T)=>{let H=W.getTitleForSession(T.sessionId),X=H?`"${H}" • `:"";return{value:T.sessionId,label:`${X}${T.relativeDate} • ${T.messageCount} messages • ${o7(T.fileSize)}`,hint:T.branch?`branch: ${T.branch}`:void 0}});if(q.multi){let T=await p2({message:`Select conversations from ${O} (Space to select, Enter to confirm)`,options:J,required:!1});if(L8(T)){$6("Import cancelled");return}let H=T;$=v.filter((X)=>H.includes(X.sessionId))}else{let T=!0,H=new Set;while(T&&v.length>H.size){let X=v.filter((I)=>!H.has(I.sessionId));if(X.length===0)break;let A=new hK,G=X.map((I)=>{let N=A.getTitleForSession(I.sessionId),R=N?`"${N}" • `:"";return{value:I.sessionId,label:`${R}${I.relativeDate} • ${I.messageCount} messages • ${o7(I.fileSize)}`,hint:I.branch?`branch: ${I.branch}`:void 0}}),D=await xq({message:`Select a conversation (${H.size}/${v.length} imported)`,options:[...G,{value:"done",label:"✅ Done importing",hint:"Exit import mode"}]});if(L8(D)||D==="done"){T=!1;break}let M=X.find((I)=>I.sessionId===D);if(M)$=[M],await D$($,q.verbose),H.add(M.sessionId)}if(H.size>0)nq(Q.green(`✅ Imported ${H.size} conversation${H.size===1?"":"s"}`));else nq(Q.yellow("No conversations imported"));return}}else if(P==="project"){let w=Object.entries(f).sort((J,T)=>T[1][0].parsedDate.getTime()-J[1][0].parsedDate.getTime()).map(([J,T])=>({value:J,label:J,hint:`${T.length} conversation${T.length===1?"":"s"}, latest: ${T[0].relativeDate}`})),O=await xq({message:"Select a project to import all conversations",options:w});if(L8(O)){$6("Import cancelled");return}let v=f[O],z=await hq({message:"Would you like to generate titles for easier browsing?",initialValue:!1});if(L8(z)){$6("Import cancelled");return}if(z)await h$(v,O);let W=await hq({message:`Import all ${v.length} conversation${v.length===1?"":"s"} from ${O}?`});if(L8(W)||!W){$6("Import cancelled");return}$=v}else if(P==="recent"){let w=await K3({message:"How many recent conversations?",placeholder:"10",initialValue:"10",validate:(v)=>{let z=parseInt(v);if(isNaN(z)||z<1)return"Please enter a valid number";if(z>j.length)return`Only ${j.length} available`}});if(L8(w)){$6("Import cancelled");return}let O=parseInt(w);$=j.slice(0,O)}else if(P==="search"){let w=await K3({message:"Search conversations (project name or session ID)",placeholder:"Enter search term"});if(L8(w)){$6("Import cancelled");return}let O=w.toLowerCase(),v=j.filter((H)=>H.projectName.toLowerCase().includes(O)||H.sessionId.toLowerCase().includes(O)||H.branch&&H.branch.toLowerCase().includes(O));if(v.length===0){nq(Q.yellow("No matching conversations found"));return}let z=new hK,W=v.map((H)=>{let X=z.getTitleForSession(H.sessionId),A=X?`"${X}" • `:"";return{value:H.sessionId,label:`${A}${H.projectName} • ${H.relativeDate} • ${H.messageCount} msgs`,hint:o7(H.fileSize)}}),J=await p2({message:`Found ${v.length} matches. Select to import:`,options:W,required:!1});if(L8(J)){$6("Import cancelled");return}let T=J;$=v.filter((H)=>T.includes(H.sessionId))}if($.length>0)await D$($,q.verbose),nq(Q.green(`✅ Successfully imported ${$.length} conversation${$.length===1?"":"s"}`));else nq(Q.yellow("No conversations selected for import"))}async function h$(q,_){let j=new hK,K=j.getExistingTitles(),Y=q.filter(($)=>!K.has($.sessionId));if(Y.length===0){L2("All conversations already have titles!","Title Generation");return}let f=Qq();f.start(`Generating titles for ${Y.length} conversations...`);let P=Y.map(($)=>({sessionId:$.sessionId,projectName:_,firstMessage:OD($.filePath)}));try{await j.batchGenerateTitles(P),f.stop(`✅ Generated ${Y.length} titles`)}catch($){f.stop("❌ Failed to generate titles"),console.error(Q.red(`Error: ${$}`))}}async function D$(q,_){let j=Qq();for(let K=0;K1?`[${K+1}/${q.length}] `:"";j.start(`${f}Importing ${Y.projectName} (${Y.relativeDate})`);try{let P=iq.basename(Y.cwd);if(await new zK().compress(Y.filePath,Y.sessionId,P),j.stop(`${f}Imported ${Y.projectName} (${Y.messageCount} messages)`),_)L2(`Session: ${Y.sessionId} +`).filter(Boolean);for(let K of j)try{let Y=JSON.parse(K);q.set(Y.session_id,Y)}catch(Y){}return q}getTitleForSession(q){let j=this.getExistingTitles().get(q);return j?j.generated_title:null}}function o7(q){if(q<1024)return`${q}B`;if(q<1048576)return`${(q/1024).toFixed(1)}KB`;return`${(q/1048576).toFixed(1)}MB`}function wD(q){let j=new Date().getTime()-q.getTime(),K=Math.floor(j/60000),Y=Math.floor(j/3600000),f=Math.floor(j/86400000);if(K<1)return"just now";if(K<60)return`${K}m ago`;if(Y<24)return`${Y}h ago`;if(f<7)return`${f}d ago`;if(f<30)return`${Math.floor(f/7)}w ago`;if(f<365)return`${Math.floor(f/30)}mo ago`;return`${Math.floor(f/365)}y ago`}function OD(q,_){try{let Y=new Date(q);if(!isNaN(Y.getTime()))return Y}catch{}let j=_.match(/(\d{4})-(\d{2})-(\d{2})_(\d{2})-(\d{2})-(\d{2})/);if(j){let[Y,f,P,$,w,O,v]=j;return new Date(parseInt(f),parseInt(P)-1,parseInt($),parseInt(w),parseInt(O),parseInt(v))}return Mq.statSync(_).mtime}function zD(q){try{let j=Mq.readFileSync(q,"utf-8").trim().split(` +`).filter(Boolean);for(let K of j)try{let Y=JSON.parse(K);if(Y.type==="user"&&Y.message?.content){let f=Y.message.content;if(Array.isArray(f)){let P=f.filter(($)=>$.type==="text").map(($)=>$.text).join(" ");if(P.trim())return P.trim()}else if(typeof f==="string")return f.trim()}}catch{}return"Conversation"}catch{return"Conversation"}}async function vD(){let q=new Set,_=iq.join(V$.homedir(),".claude-mem","claude-mem-index.jsonl");if(!Mq.existsSync(_))return q;let K=Mq.readFileSync(_,"utf-8").trim().split(` +`).filter(Boolean);for(let Y of K)try{let f=JSON.parse(Y);if(f.session_id)q.add(f.session_id);else if(f.sessionId)q.add(f.sessionId)}catch{}return q}async function WD(){let q=iq.join(V$.homedir(),".claude","projects");if(!Mq.existsSync(q))return{conversations:[],skippedCount:0};let _=Mq.readdirSync(q).filter((f)=>Mq.statSync(iq.join(q,f)).isDirectory()),j=[],K=await vD(),Y=0;for(let f of _){let P=iq.join(q,f),$=Mq.readdirSync(P).filter((w)=>w.endsWith(".jsonl")).map((w)=>iq.join(P,w));for(let w of $)try{let v=Mq.readFileSync(w,"utf-8").trim().split(` +`).filter(Boolean),z=JSON.parse(v[0]),W=v.length,J=Mq.statSync(w),T=J.size,H={sessionId:z.sessionId||iq.basename(w,".jsonl"),timestamp:z.timestamp||J.mtime.toISOString(),messageCount:W,branch:z.branch,cwd:z.cwd||P,fileSize:T};if(K.has(H.sessionId)){Y++;continue}let X=iq.basename(iq.dirname(w)),A=OD(H.timestamp,w),G=wD(A);j.push({filePath:w,...H,projectName:X,parsedDate:A,relativeDate:G})}catch{}}return{conversations:j,skippedCount:Y}}async function M$(q={}){console.clear(),YY(Q.bgCyan.black(" CLAUDE-MEM IMPORT "));let _=Qq();_.start("Scanning conversation history");let{conversations:j,skippedCount:K}=await WD();if(j.length===0){_.stop("No new conversations found");let w=K>0?`All ${K} conversation${K===1?" is":"s are"} already imported.`:"No conversations found.";nq(Q.yellow(w));return}j.sort((w,O)=>O.parsedDate.getTime()-w.parsedDate.getTime());let Y=K>0?`Found ${j.length} new conversation${j.length===1?"":"s"} (${K} already imported)`:`Found ${j.length} new conversation${j.length===1?"":"s"}`;_.stop(Y);let f=j.reduce((w,O)=>{if(!w[O.projectName])w[O.projectName]=[];return w[O.projectName].push(O),w},{}),P=await xq({message:"How would you like to import?",options:[{value:"browse",label:"Browse by Project",hint:"Select project then conversations"},{value:"project",label:"Import Entire Project",hint:"Select project and import all conversations"},{value:"recent",label:"Recent Conversations",hint:"Import most recent across all projects"},{value:"search",label:"Search",hint:"Search for specific conversations"}]});if(L8(P)){$6("Import cancelled");return}let $=[];if(P==="browse"){let w=Object.entries(f).sort((T,H)=>H[1][0].parsedDate.getTime()-T[1][0].parsedDate.getTime()).map(([T,H])=>({value:T,label:T,hint:`${H.length} conversation${H.length===1?"":"s"}, latest: ${H[0].relativeDate}`})),O=await xq({message:"Select a project",options:w});if(L8(O)){$6("Import cancelled");return}let v=f[O],z=await hq({message:"Would you like to generate titles for easier browsing?",initialValue:!1});if(L8(z)){$6("Import cancelled");return}if(z)await D$(v,O);let W=new hK,J=v.map((T)=>{let H=W.getTitleForSession(T.sessionId),X=H?`"${H}" • `:"";return{value:T.sessionId,label:`${X}${T.relativeDate} • ${T.messageCount} messages • ${o7(T.fileSize)}`,hint:T.branch?`branch: ${T.branch}`:void 0}});if(q.multi){let T=await p2({message:`Select conversations from ${O} (Space to select, Enter to confirm)`,options:J,required:!1});if(L8(T)){$6("Import cancelled");return}let H=T;$=v.filter((X)=>H.includes(X.sessionId))}else{let T=!0,H=new Set;while(T&&v.length>H.size){let X=v.filter((I)=>!H.has(I.sessionId));if(X.length===0)break;let A=new hK,G=X.map((I)=>{let N=A.getTitleForSession(I.sessionId),R=N?`"${N}" • `:"";return{value:I.sessionId,label:`${R}${I.relativeDate} • ${I.messageCount} messages • ${o7(I.fileSize)}`,hint:I.branch?`branch: ${I.branch}`:void 0}}),D=await xq({message:`Select a conversation (${H.size}/${v.length} imported)`,options:[...G,{value:"done",label:"✅ Done importing",hint:"Exit import mode"}]});if(L8(D)||D==="done"){T=!1;break}let M=X.find((I)=>I.sessionId===D);if(M)$=[M],await C$($,q.verbose),H.add(M.sessionId)}if(H.size>0)nq(Q.green(`✅ Imported ${H.size} conversation${H.size===1?"":"s"}`));else nq(Q.yellow("No conversations imported"));return}}else if(P==="project"){let w=Object.entries(f).sort((J,T)=>T[1][0].parsedDate.getTime()-J[1][0].parsedDate.getTime()).map(([J,T])=>({value:J,label:J,hint:`${T.length} conversation${T.length===1?"":"s"}, latest: ${T[0].relativeDate}`})),O=await xq({message:"Select a project to import all conversations",options:w});if(L8(O)){$6("Import cancelled");return}let v=f[O],z=await hq({message:"Would you like to generate titles for easier browsing?",initialValue:!1});if(L8(z)){$6("Import cancelled");return}if(z)await D$(v,O);let W=await hq({message:`Import all ${v.length} conversation${v.length===1?"":"s"} from ${O}?`});if(L8(W)||!W){$6("Import cancelled");return}$=v}else if(P==="recent"){let w=await K3({message:"How many recent conversations?",placeholder:"10",initialValue:"10",validate:(v)=>{let z=parseInt(v);if(isNaN(z)||z<1)return"Please enter a valid number";if(z>j.length)return`Only ${j.length} available`}});if(L8(w)){$6("Import cancelled");return}let O=parseInt(w);$=j.slice(0,O)}else if(P==="search"){let w=await K3({message:"Search conversations (project name or session ID)",placeholder:"Enter search term"});if(L8(w)){$6("Import cancelled");return}let O=w.toLowerCase(),v=j.filter((H)=>H.projectName.toLowerCase().includes(O)||H.sessionId.toLowerCase().includes(O)||H.branch&&H.branch.toLowerCase().includes(O));if(v.length===0){nq(Q.yellow("No matching conversations found"));return}let z=new hK,W=v.map((H)=>{let X=z.getTitleForSession(H.sessionId),A=X?`"${X}" • `:"";return{value:H.sessionId,label:`${A}${H.projectName} • ${H.relativeDate} • ${H.messageCount} msgs`,hint:o7(H.fileSize)}}),J=await p2({message:`Found ${v.length} matches. Select to import:`,options:W,required:!1});if(L8(J)){$6("Import cancelled");return}let T=J;$=v.filter((H)=>T.includes(H.sessionId))}if($.length>0)await C$($,q.verbose),nq(Q.green(`✅ Successfully imported ${$.length} conversation${$.length===1?"":"s"}`));else nq(Q.yellow("No conversations selected for import"))}async function D$(q,_){let j=new hK,K=j.getExistingTitles(),Y=q.filter(($)=>!K.has($.sessionId));if(Y.length===0){L2("All conversations already have titles!","Title Generation");return}let f=Qq();f.start(`Generating titles for ${Y.length} conversations...`);let P=Y.map(($)=>({sessionId:$.sessionId,projectName:_,firstMessage:zD($.filePath)}));try{await j.batchGenerateTitles(P),f.stop(`✅ Generated ${Y.length} titles`)}catch($){f.stop("❌ Failed to generate titles"),console.error(Q.red(`Error: ${$}`))}}async function C$(q,_){let j=Qq();for(let K=0;K1?`[${K+1}/${q.length}] `:"";j.start(`${f}Importing ${Y.projectName} (${Y.relativeDate})`);try{let P=iq.basename(Y.cwd);if(await new zK().compress(Y.filePath,Y.sessionId,P),j.stop(`${f}Imported ${Y.projectName} (${Y.messageCount} messages)`),_)L2(`Session: ${Y.sessionId} Size: ${o7(Y.fileSize)} -Branch: ${Y.branch||"main"}`,"Details")}catch(P){if(j.stop(`${f}Failed to import ${Y.projectName}`),_)console.error(Q.red(`Error: ${P}`))}}}w7();var Z6=new W5;Z6.name(oq).description(G5).version(A5);Z6.command("compress [transcript]").description("Compress a Claude Code transcript into memory").option("--output ","Output directory for compressed files").option("--dry-run","Show what would be compressed without doing it").option("-v, --verbose","Show detailed output").action(QK);Z6.command("install").description("Install Claude Code hooks for automatic compression").option("--user","Install for current user (default)").option("--project","Install for current project only").option("--local","Install to custom local directory").option("--path ","Custom installation path (with --local)").option("--timeout ","Hook execution timeout in milliseconds","180000").option("--skip-mcp","Skip Chroma MCP server installation").option("--force","Force installation even if already installed").action(Wf);Z6.command("uninstall").description("Remove Claude Code hooks").option("--user","Remove from user settings (default)").option("--project","Remove from project settings").option("--all","Remove from both user and project settings").action(Jf);Z6.command("status").description("Check installation status of Claude Memory System").action(Tf);Z6.command("logs").description("View claude-mem operation logs").option("--debug","Show debug logs only").option("--error","Show error logs only").option("--tail [n]","Show last n lines","50").option("--follow","Follow log output").action(kf);Z6.command("load-context").description("Load compressed memories for current session").option("--project ","Filter by project name").option("--count ","Number of memories to load","10").option("--raw","Output raw JSON instead of formatted text").option("--format ","Output format: json, session-start, or default").action(M7);var d9=Z6.command("trash").description("Manage trash bin for safe file deletion").argument("[files...]","Files to move to trash").option("-r, --recursive","Remove directories recursively").option("-R","Remove directories recursively (same as -r)").option("-f, --force","Suppress errors for nonexistent files").action(async(q,_)=>{if(!q||q.length===0){d9.outputHelp();return}if(_.R)_.recursive=!0;await J$(q,{force:_.force,recursive:_.recursive})});d9.command("view").description("View contents of trash bin").action(async()=>{let{viewTrash:q}=await Promise.resolve().then(() => (m$(),R$));await q()});d9.command("empty").description("Permanently delete all files in trash").option("-f, --force","Skip confirmation prompt").action(async(q)=>{let{emptyTrash:_}=await Promise.resolve().then(() => (y$(),g$));await _(q)});Z6.command("restore").description("Restore files from trash interactively").action(Z$);Z6.command("save ").description("Save a message to the memory system").action(k$);Z6.command("changelog").description("Generate CHANGELOG.md from claude-mem memories").option("--historical ","Number of versions to search (default: current version only)").option("--generate ","Generate changelog for a specific version").option("--start