ripplepush 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/index.js +78 -62
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,102 +1,118 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
3
|
-
`)}displayWidth(t){return
|
|
4
|
-
`+" ".repeat(n+u)),s+a+" ".repeat(u)+
|
|
5
|
-
${s}`)}boxWrap(t,n){if(n<this.minWidthToWrap)return t;let r=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,o=[];return r.forEach(s=>{let a=s.match(i);if(a===null){o.push("");return}let u=[a.shift()],l=this.displayWidth(u[0]);a.forEach(
|
|
6
|
-
`)}};var
|
|
2
|
+
var Yw=Object.defineProperty;var Gd=(e,t)=>{for(var n in t)Yw(e,n,{get:t[n],enumerable:!0})};import{fstatSync as rE}from"node:fs";import{createInterface as iE}from"node:readline";import{setTimeout as oE}from"node:timers/promises";var et=class extends Error{constructor(t,n,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=n,this.exitCode=t,this.nestedError=void 0}},Ye=class extends et{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};var qt=class{constructor(t,n){switch(this.description=n||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,n){return n===this.defaultValue||!Array.isArray(n)?[t]:(n.push(t),n)}default(t,n){return this.defaultValue=t,this.defaultValueDescription=n,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(n,r)=>{if(!this.argChoices.includes(n))throw new Ye(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(n,r):n},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Xo(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}import{EventEmitter as Xw}from"node:events";import Ba from"node:child_process";import jt from"node:path";import es from"node:fs";import Y from"node:process";import{stripVTControlCharacters as Qw}from"node:util";import{stripVTControlCharacters as Zw}from"node:util";var wi=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let n=t.commands.filter(i=>!i._hidden),r=t._getHelpCommand();return r&&!r._hidden&&n.push(r),this.sortSubcommands&&n.sort((i,o)=>i.name().localeCompare(o.name())),n}compareOptions(t,n){let r=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return r(t).localeCompare(r(n))}visibleOptions(t){let n=t.options.filter(i=>!i.hidden),r=t._getHelpOption();if(r&&!r.hidden){let i=r.short&&t._findOption(r.short),o=r.long&&t._findOption(r.long);!i&&!o?n.push(r):r.long&&!o?n.push(t.createOption(r.long,r.description)):r.short&&!i&&n.push(t.createOption(r.short,r.description))}return this.sortOptions&&n.sort(this.compareOptions),n}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let n=[];for(let r=t.parent;r;r=r.parent){let i=r.options.filter(o=>!o.hidden);n.push(...i)}return this.sortOptions&&n.sort(this.compareOptions),n}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(n=>{n.description=n.description||t._argsDescription[n.name()]||""}),t.registeredArguments.find(n=>n.description)?t.registeredArguments:[]}subcommandTerm(t){let n=t.registeredArguments.map(r=>Xo(r)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,n){return n.visibleCommands(t).reduce((r,i)=>Math.max(r,this.displayWidth(n.styleSubcommandTerm(n.subcommandTerm(i)))),0)}longestOptionTermLength(t,n){return n.visibleOptions(t).reduce((r,i)=>Math.max(r,this.displayWidth(n.styleOptionTerm(n.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,n){return n.visibleGlobalOptions(t).reduce((r,i)=>Math.max(r,this.displayWidth(n.styleOptionTerm(n.optionTerm(i)))),0)}longestArgumentTermLength(t,n){return n.visibleArguments(t).reduce((r,i)=>Math.max(r,this.displayWidth(n.styleArgumentTerm(n.argumentTerm(i)))),0)}commandUsage(t){let n=t._name;t._aliases[0]&&(n=n+"|"+t._aliases[0]);let r="";for(let i=t.parent;i;i=i.parent)r=i.name()+" "+r;return r+n+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let n=[];if(t.argChoices&&n.push(`choices: ${t.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&n.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&n.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&n.push(`env: ${t.envVar}`),n.length>0){let r=`(${n.join(", ")})`;return t.description?`${t.description} ${r}`:r}return t.description}argumentDescription(t){let n=[];if(t.argChoices&&n.push(`choices: ${t.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),t.defaultValue!==void 0&&n.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),n.length>0){let r=`(${n.join(", ")})`;return t.description?`${t.description} ${r}`:r}return t.description}formatItemList(t,n,r){return n.length===0?[]:[r.styleTitle(t),...n,""]}groupItems(t,n,r){let i=new Map;return t.forEach(o=>{let s=r(o);i.has(s)||i.set(s,[])}),n.forEach(o=>{let s=r(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(t,n){let r=n.padWidth(t,n),i=n.helpWidth??80;function o(c,m){return n.formatItem(c,r,m,n)}let s=[`${n.styleTitle("Usage:")} ${n.styleUsage(n.commandUsage(t))}`,""],a=n.commandDescription(t);a.length>0&&(s=s.concat([n.boxWrap(n.styleCommandDescription(a),i),""]));let u=n.visibleArguments(t).map(c=>o(n.styleArgumentTerm(n.argumentTerm(c)),n.styleArgumentDescription(n.argumentDescription(c))));if(s=s.concat(this.formatItemList("Arguments:",u,n)),this.groupItems(t.options,n.visibleOptions(t),c=>c.helpGroupHeading??"Options:").forEach((c,m)=>{let p=c.map(f=>o(n.styleOptionTerm(n.optionTerm(f)),n.styleOptionDescription(n.optionDescription(f))));s=s.concat(this.formatItemList(m,p,n))}),n.showGlobalOptions){let c=n.visibleGlobalOptions(t).map(m=>o(n.styleOptionTerm(n.optionTerm(m)),n.styleOptionDescription(n.optionDescription(m))));s=s.concat(this.formatItemList("Global Options:",c,n))}return this.groupItems(t.commands,n.visibleCommands(t),c=>c.helpGroup()||"Commands:").forEach((c,m)=>{let p=c.map(f=>o(n.styleSubcommandTerm(n.subcommandTerm(f)),n.styleSubcommandDescription(n.subcommandDescription(f))));s=s.concat(this.formatItemList(m,p,n))}),s.join(`
|
|
3
|
+
`)}displayWidth(t){return Zw(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n==="[command]"?this.styleSubcommandText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleCommandText(n)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleSubcommandText(n)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,n){return Math.max(n.longestOptionTermLength(t,n),n.longestGlobalOptionTermLength(t,n),n.longestSubcommandTermLength(t,n),n.longestArgumentTermLength(t,n))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,n,r,i){let s=" ".repeat(2);if(!r)return s+t;let a=t.padEnd(n+t.length-i.displayWidth(t)),u=2,d=(this.helpWidth??80)-n-u-2,c;return d<this.minWidthToWrap||i.preformatted(r)?c=r:c=i.boxWrap(r,d).replace(/\n/g,`
|
|
4
|
+
`+" ".repeat(n+u)),s+a+" ".repeat(u)+c.replace(/\n/g,`
|
|
5
|
+
${s}`)}boxWrap(t,n){if(n<this.minWidthToWrap)return t;let r=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,o=[];return r.forEach(s=>{let a=s.match(i);if(a===null){o.push("");return}let u=[a.shift()],l=this.displayWidth(u[0]);a.forEach(d=>{let c=this.displayWidth(d);if(l+c<=n){u.push(d),l+=c;return}o.push(u.join(""));let m=d.trimStart();u=[m],l=this.displayWidth(m)}),o.push(u.join(""))}),o.join(`
|
|
6
|
+
`)}};var se=class{constructor(t,n){this.flags=t,this.description=n||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let r=Kw(t);this.short=r.shortFlag,this.long=r.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(t,n){return this.defaultValue=t,this.defaultValueDescription=n,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let n=t;return typeof t=="string"&&(n={[t]:!0}),this.implied=Object.assign(this.implied||{},n),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,n){return n===this.defaultValue||!Array.isArray(n)?[t]:(n.push(t),n)}choices(t){return this.argChoices=t.slice(),this.parseArg=(n,r)=>{if(!this.argChoices.includes(n))throw new Ye(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(n,r):n},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Vd(this.name().replace(/^no-/,"")):Vd(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Qo=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(n=>{n.negate?this.negativeOptions.set(n.attributeName(),n):this.positiveOptions.set(n.attributeName(),n)}),this.negativeOptions.forEach((n,r)=>{this.positiveOptions.has(r)&&this.dualOptions.add(r)})}valueFromOption(t,n){let r=n.attributeName();if(!this.dualOptions.has(r))return!0;let i=this.negativeOptions.get(r).presetArg,o=i!==void 0?i:!1;return n.negate===(o===t)}};function Vd(e){return e.split("-").reduce((t,n)=>t+n[0].toUpperCase()+n.slice(1))}function Kw(e){let t,n,r=/^-[^-]$/,i=/^--[^-]/,o=e.split(/[ |,]+/).concat("guard");if(r.test(o[0])&&(t=o.shift()),i.test(o[0])&&(n=o.shift()),!t&&r.test(o[0])&&(t=o.shift()),!t&&i.test(o[0])&&(t=n,n=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${e}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
|
|
7
7
|
- a short flag is a single dash and a single character
|
|
8
8
|
- either use a single dash and a single character (for a short flag)
|
|
9
9
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):r.test(s)?new Error(`${a}
|
|
10
10
|
- too many short flags`):i.test(s)?new Error(`${a}
|
|
11
11
|
- too many long flags`):new Error(`${a}
|
|
12
|
-
- unrecognised flag format`)}if(t===void 0&&n===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}function
|
|
12
|
+
- unrecognised flag format`)}if(t===void 0&&n===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:n}}function Jw(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let n=[];for(let r=0;r<=e.length;r++)n[r]=[r];for(let r=0;r<=t.length;r++)n[0][r]=r;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let o;e[i-1]===t[r-1]?o=0:o=1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+o),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}function za(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let n=e.startsWith("--");n&&(e=e.slice(2),t=t.map(s=>s.slice(2)));let r=[],i=3,o=.4;return t.forEach(s=>{if(s.length<=1)return;let a=Jw(e,s),u=Math.max(e.length,s.length);(u-a)/u>o&&(a<i?(i=a,r=[s]):a===i&&r.push(s))}),r.sort((s,a)=>s.localeCompare(a)),n&&(r=r.map(s=>`--${s}`)),r.length>1?`
|
|
13
13
|
(Did you mean one of ${r.join(", ")}?)`:r.length===1?`
|
|
14
|
-
(Did you mean ${r[0]}?)`:""}var
|
|
14
|
+
(Did you mean ${r[0]}?)`:""}var Cr=class e extends Xw{constructor(t){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=t||"",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:n=>Y.stdout.write(n),writeErr:n=>Y.stderr.write(n),outputError:(n,r)=>r(n),getOutHelpWidth:()=>Y.stdout.isTTY?Y.stdout.columns:void 0,getErrHelpWidth:()=>Y.stderr.isTTY?Y.stderr.columns:void 0,getOutHasColors:()=>Zd()??(Y.stdout.isTTY&&Y.stdout.hasColors?.()),getErrHasColors:()=>Zd()??(Y.stderr.isTTY&&Y.stderr.hasColors?.()),stripColor:n=>Qw(n)},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(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let n=this;n;n=n.parent)t.push(n);return t}command(t,n,r){let i=n,o=r;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=t.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(t){return new e(t)}createHelp(){return Object.assign(new wi,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,n){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
15
15
|
- specify the name in Command constructor or using .name()`);return n=n||{},n.isDefault&&(this._defaultCommandName=t._name),(n.noHelp||n.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,n){return new qt(t,n)}argument(t,n,r,i){let o=this.createArgument(t,n);return typeof r=="function"?o.default(i).argParser(r):o.default(r),this.addArgument(o),this}arguments(t){return t.trim().split(/ +/).forEach(n=>{this.argument(n)}),this}addArgument(t){let n=this.registeredArguments.slice(-1)[0];if(n?.variadic)throw new Error(`only the last argument can be variadic '${n.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,n){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let r=t??"help [command]",[,i,o]=r.match(/([^ ]+) *(.*)/),s=n??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(t||n)&&this._initCommandGroup(a),this}addHelpCommand(t,n){return typeof t!="object"?(this.helpCommand(t,n),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,n){let r=["preSubcommand","preAction","postAction"];if(!r.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
|
|
16
|
-
Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(n):this._lifeCycleHooks[t]=[n],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(t,n,r){this._exitCallback&&this._exitCallback(new
|
|
17
|
-
- already used by option '${n.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let n=i=>[i.name()].concat(i.aliases()),r=n(t).find(i=>this._findCommand(i));if(r){let i=n(this._findCommand(r)).join("|"),o=n(t).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let n=t.name(),r=t.attributeName();t.defaultValue!==void 0&&this.setOptionValueWithSource(r,t.defaultValue,"default");let i=(o,s,a)=>{o==null&&t.presetArg!==void 0&&(o=t.presetArg);let u=this.getOptionValue(r);o!==null&&t.parseArg?o=this._callParseArg(t,o,u,s):o!==null&&t.variadic&&(o=t._collectValue(o,u)),o==null&&(t.negate?o=!1:t.isBoolean()||t.optional?o=!0:o=""),this.setOptionValueWithSource(r,o,a)};return this.on("option:"+n,o=>{let s=`error: option '${t.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),t.envVar&&this.on("optionEnv:"+n,o=>{let s=`error: option '${t.flags}' value '${o}' from env '${t.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(t,n,r,i,o){if(typeof n=="object"&&n instanceof
|
|
18
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,n,r){if(
|
|
16
|
+
Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(n):this._lifeCycleHooks[t]=[n],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=n=>{if(n.code!=="commander.executeSubCommandAsync")throw n},this}_exit(t,n,r){this._exitCallback&&this._exitCallback(new et(t,n,r)),Y.exit(t)}action(t){let n=r=>{let i=this.registeredArguments.length,o=r.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),t.apply(this,o)};return this._actionHandler=n,this}createOption(t,n){return new se(t,n)}_callParseArg(t,n,r,i){try{return t.parseArg(n,r)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(t){let n=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(n){let r=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${r}'
|
|
17
|
+
- already used by option '${n.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let n=i=>[i.name()].concat(i.aliases()),r=n(t).find(i=>this._findCommand(i));if(r){let i=n(this._findCommand(r)).join("|"),o=n(t).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let n=t.name(),r=t.attributeName();t.defaultValue!==void 0&&this.setOptionValueWithSource(r,t.defaultValue,"default");let i=(o,s,a)=>{o==null&&t.presetArg!==void 0&&(o=t.presetArg);let u=this.getOptionValue(r);o!==null&&t.parseArg?o=this._callParseArg(t,o,u,s):o!==null&&t.variadic&&(o=t._collectValue(o,u)),o==null&&(t.negate?o=!1:t.isBoolean()||t.optional?o=!0:o=""),this.setOptionValueWithSource(r,o,a)};return this.on("option:"+n,o=>{let s=`error: option '${t.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),t.envVar&&this.on("optionEnv:"+n,o=>{let s=`error: option '${t.flags}' value '${o}' from env '${t.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(t,n,r,i,o){if(typeof n=="object"&&n instanceof se)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(n,r);if(s.makeOptionMandatory(!!t.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(u,l)=>{let d=a.exec(u);return d?d[0]:l},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(t,n,r,i){return this._optionEx({},t,n,r,i)}requiredOption(t,n,r,i){return this._optionEx({mandatory:!0},t,n,r,i)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,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(t=!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=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,n){return this.setOptionValueWithSource(t,n,void 0)}setOptionValueWithSource(t,n,r){return this._storeOptionsAsProperties?this[t]=n:this._optionValues[t]=n,this._optionValueSources[t]=r,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let n;return this._getCommandAndAncestors().forEach(r=>{r.getOptionValueSource(t)!==void 0&&(n=r.getOptionValueSource(t))}),n}_prepareUserArgs(t,n){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(n=n||{},t===void 0&&n.from===void 0){Y.versions?.electron&&(n.from="electron");let i=Y.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(n.from="eval")}t===void 0&&(t=Y.argv),this.rawArgs=t.slice();let r;switch(n.from){case void 0:case"node":this._scriptPath=t[1],r=t.slice(2);break;case"electron":Y.defaultApp?(this._scriptPath=t[1],r=t.slice(2)):r=t.slice(1);break;case"user":r=t.slice(0);break;case"eval":r=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${n.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",r}parse(t,n){this._prepareForParse();let r=this._prepareUserArgs(t,n);return this._parseCommand([],r),this}async parseAsync(t,n){this._prepareForParse();let r=this._prepareUserArgs(t,n);return await this._parseCommand([],r),this}_prepareForParse(){this._savedState===null?(this.options.filter(t=>t.negate&&t.defaultValue===void 0&&this.getOptionValue(t.attributeName())===void 0).forEach(t=>{let n=t.long.replace(/^--no-/,"--");this._findOption(n)||this.setOptionValueWithSource(t.attributeName(),!0,"default")}),this.saveStateBeforeParse()):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.
|
|
18
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,n,r){if(es.existsSync(t))return;let i=n?`searched for local subcommand relative to directory '${n}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${t}' does not exist
|
|
19
19
|
- if '${r}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
20
20
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
21
|
-
- ${i}`;throw new Error(o)}_executeSubCommand(t,n){n=n.slice();let r=[".js",".ts",".tsx",".mjs",".cjs"];function i(c
|
|
21
|
+
- ${i}`;throw new Error(o)}_executeSubCommand(t,n){n=n.slice();let r=[".js",".ts",".tsx",".mjs",".cjs"];function i(d,c){let m=jt.resolve(d,c);if(es.existsSync(m))return m;if(r.includes(jt.extname(c)))return;let p=r.find(f=>es.existsSync(`${m}${f}`));if(p)return`${m}${p}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=t._executableFile||`${this._name}-${t._name}`,s=this._executableDir||"";if(this._scriptPath){let d;try{d=es.realpathSync(this._scriptPath)}catch{d=this._scriptPath}s=jt.resolve(jt.dirname(d),s)}if(s){let d=i(s,o);if(!d&&!t._executableFile&&this._scriptPath){let c=jt.basename(this._scriptPath,jt.extname(this._scriptPath));c!==this._name&&(d=i(s,`${c}-${t._name}`))}o=d||o}let a=r.includes(jt.extname(o)),u;Y.platform!=="win32"?a?(n.unshift(o),n=Yd(Y.execArgv).concat(n),u=Ba.spawn(Y.argv[0],n,{stdio:"inherit"})):u=Ba.spawn(o,n,{stdio:"inherit"}):(this._checkForMissingExecutable(o,s,t._name),n.unshift(o),n=Yd(Y.execArgv).concat(n),u=Ba.spawn(Y.execPath,n,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(c=>{Y.on(c,()=>{u.killed===!1&&u.exitCode===null&&u.kill(c)})});let l=this._exitCallback;u.on("close",d=>{d=d??1,l?l(new et(d,"commander.executeSubCommandAsync","(close)")):Y.exit(d)}),u.on("error",d=>{if(d.code==="ENOENT")this._checkForMissingExecutable(o,s,t._name);else if(d.code==="EACCES")throw new Error(`'${o}' not executable`);if(!l)Y.exit(1);else{let c=new et(1,"commander.executeSubCommandAsync","(error)");c.nestedError=d,l(c)}}),this.runningCommand=u}_dispatchSubcommand(t,n,r){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,n.concat(r));else return i._parseCommand(n,r)}),o}_dispatchHelpCommand(t){t||this.help();let n=this._findCommand(t);return n&&!n._executableHandler&&n.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,n)=>{t.required&&this.args[n]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(r,i,o)=>{let s=i;if(i!==null&&r.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${r.name()}'.`;s=this._callParseArg(r,i,o,a)}return s};this._checkNumberOfArguments();let n=[];this.registeredArguments.forEach((r,i)=>{let o=r.defaultValue;r.variadic?i<this.args.length?(o=this.args.slice(i),r.parseArg&&(o=o.reduce((s,a)=>t(r,a,s),r.defaultValue))):o===void 0&&(o=[]):i<this.args.length&&(o=this.args[i],r.parseArg&&(o=t(r,o,r.defaultValue))),n[i]=o}),this.processedArgs=n}_chainOrCall(t,n){return t?.then&&typeof t.then=="function"?t.then(()=>n()):n()}_chainOrCallHooks(t,n){let r=t,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[n]!==void 0).forEach(o=>{o._lifeCycleHooks[n].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),n==="postAction"&&i.reverse(),i.forEach(o=>{r=this._chainOrCall(r,()=>o.callback(o.hookedCommand,this))}),r}_chainOrCallSubCommandHook(t,n,r){let i=t;return this._lifeCycleHooks[r]!==void 0&&this._lifeCycleHooks[r].forEach(o=>{i=this._chainOrCall(i,()=>o(this,n))}),i}_parseCommand(t,n){let r=this.parseOptions(n);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(r.operands),n=r.unknown,this.args=t.concat(n),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),n);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(n),this._dispatchSubcommand(this._defaultCommandName,t,n);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(r.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{r.unknown.length>0&&this.unknownOption(r.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,t,n)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,t,n);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,n);this.listenerCount("command:*")?this.emit("command:*",t,n):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(n=>n._name===t||n._aliases.includes(t))}_findOption(t){return this.options.find(n=>n.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(n=>{n.mandatory&&t.getOptionValue(n.attributeName())===void 0&&t.missingMandatoryOptionValue(n)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(r=>{let i=r.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});t.filter(r=>r.conflictsWith.length>0).forEach(r=>{let i=t.find(o=>r.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(r,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let n=[],r=[],i=n;function o(d){return d.length>1&&d[0]==="-"}let s=d=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(d)?!this._getCommandAndAncestors().some(c=>c.options.map(m=>m.short).some(m=>/^-\d$/.test(m))):!1,a=null,u=null,l=0;for(;l<t.length||u;){let d=u??t[l++];if(u=null,d==="--"){i===r&&i.push(d),i.push(...t.slice(l));break}if(a&&(!o(d)||s(d))){this.emit(`option:${a.name()}`,d);continue}if(a=null,o(d)){let c=this._findOption(d);if(c){if(c.required){let m=t[l++];m===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,m)}else if(c.optional){let m=null;l<t.length&&(!o(t[l])||s(t[l]))&&(m=t[l++]),this.emit(`option:${c.name()}`,m)}else this.emit(`option:${c.name()}`);a=c.variadic?c:null;continue}}if(d.length>2&&d[0]==="-"&&d[1]!=="-"){let c=this._findOption(`-${d[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,d.slice(2)):(this.emit(`option:${c.name()}`),u=`-${d.slice(2)}`);continue}}if(/^--[^=]+=/.test(d)){let c=d.indexOf("="),m=this._findOption(d.slice(0,c));if(m&&(m.required||m.optional)){this.emit(`option:${m.name()}`,d.slice(c+1));continue}}if(i===n&&o(d)&&!(this.commands.length===0&&s(d))&&(i=r),(this._enablePositionalOptions||this._passThroughOptions)&&n.length===0&&r.length===0){if(this._findCommand(d)){n.push(d),r.push(...t.slice(l));break}else if(this._getHelpCommand()&&d===this._getHelpCommand().name()){n.push(d,...t.slice(l));break}else if(this._defaultCommandName){r.push(d,...t.slice(l));break}}if(this._passThroughOptions){i.push(d,...t.slice(l));break}i.push(d)}return{operands:n,unknown:r}}opts(){if(this._storeOptionsAsProperties){let t={},n=this.options.length;for(let r=0;r<n;r++){let i=this.options[r].attributeName();t[i]=i===this._versionOptionName?this._version:this[i]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,n)=>Object.assign(t,n.opts()),{})}error(t,n){this._outputConfiguration.outputError(`${t}
|
|
22
22
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
23
23
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
24
|
-
`),this.outputHelp({error:!0}));let r=n||{},i=r.exitCode||1,o=r.code||"commander.error";this._exit(i,o,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in
|
|
25
|
-
`),this._exit(0,"commander.version",t)}),this}description(t,n){return t===void 0&&n===void 0?this._description:(this._description=t,n&&(this._argsDescription=n),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let n=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(n=this.commands[this.commands.length-1]),t===n._name)throw new Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(t);if(r){let i=[r.name()].concat(r.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return n._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(n=>this.alias(n)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let n=this.registeredArguments.map(r=>
|
|
24
|
+
`),this.outputHelp({error:!0}));let r=n||{},i=r.exitCode||1,o=r.code||"commander.error";this._exit(i,o,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in Y.env){let n=t.attributeName();(this.getOptionValue(n)===void 0||["default","config","env"].includes(this.getOptionValueSource(n)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,Y.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new Qo(this.options),n=r=>this.getOptionValue(r)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(r));this.options.filter(r=>r.implied!==void 0&&n(r.attributeName())&&t.valueFromOption(this.getOptionValue(r.attributeName()),r)).forEach(r=>{Object.keys(r.implied).filter(i=>!n(i)).forEach(i=>{this.setOptionValueWithSource(i,r.implied[i],"implied")})})}missingArgument(t){let n=`error: missing required argument '${t}'`;this.error(n,{code:"commander.missingArgument"})}optionMissingArgument(t){let n=`error: option '${t.flags}' argument missing`;this.error(n,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let n=`error: required option '${t.flags}' not specified`;this.error(n,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,n){let r=s=>{let a=s.attributeName(),u=this.getOptionValue(a),l=this.options.find(c=>c.negate&&a===c.attributeName()),d=this.options.find(c=>!c.negate&&a===c.attributeName());return l&&(l.presetArg===void 0&&u===!1||l.presetArg!==void 0&&u===l.presetArg)?l:d||s},i=s=>{let a=r(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(t)} cannot be used with ${i(n)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let n="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);n=za(t,i)}let r=`error: unknown option '${t}'${n}`;this.error(r,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let n=this.registeredArguments.length,r=n===1?"":"s",i=t.length,o=this.parent?` for '${this.name()}'`:"",s=t.join(", "),a=`error: too many arguments${o}. Expected ${n} argument${r} but got ${i}: ${s}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],n="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),n=za(t,i)}let r=`error: unknown command '${t}'${n}`;this.error(r,{code:"commander.unknownCommand"})}version(t,n,r){if(t===void 0)return this._version;this._version=t,n=n||"-V, --version",r=r||"output the version number";let i=this.createOption(n,r);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${t}
|
|
25
|
+
`),this._exit(0,"commander.version",t)}),this}description(t,n){return t===void 0&&n===void 0?this._description:(this._description=t,n&&(this._argsDescription=n),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let n=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(n=this.commands[this.commands.length-1]),t===n._name)throw new Error("Command alias can't be the same as its name");let r=this.parent?._findCommand(t);if(r){let i=[r.name()].concat(r.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return n._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(n=>this.alias(n)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let n=this.registeredArguments.map(r=>Xo(r));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?n:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=jt.basename(t,jt.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let n=this.createHelp(),r=this._getOutputContext(t);n.prepareContext({error:r.error,helpWidth:r.helpWidth,outputHasColors:r.hasColors});let i=n.formatHelp(this,n);return r.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(t){t=t||{};let n=!!t.error,r,i,o;return n?(r=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(r=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:n,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),r(a)),hasColors:i,helpWidth:o}}outputHelp(t){let n;typeof t=="function"&&(n=t,t=void 0);let r=this._getOutputContext(t),i={error:r.error,write:r.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:r.error});if(n&&(o=n(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");r.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(t,n){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",n??"display help for command"),(t||n)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let n=Number(Y.exitCode??0);n===0&&t&&typeof t!="function"&&t.error&&(n=1),this._exit(n,"commander.help","(outputHelp)")}addHelpText(t,n){let r=["beforeAll","before","after","afterAll"];if(!r.includes(t))throw new Error(`Unexpected value for position to addHelpText.
|
|
26
26
|
Expecting one of '${r.join("', '")}'`);let i=`${t}Help`;return this.on(i,o=>{let s;typeof n=="function"?s=n({error:o.error,command:o.command}):s=n,s&&o.write(`${s}
|
|
27
|
-
`)}),this}_outputHelpIfRequested(t){let n=this._getHelpOption();n&&t.find(i=>n.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function
|
|
27
|
+
`)}),this}_outputHelpIfRequested(t){let n=this._getHelpOption();n&&t.find(i=>n.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Yd(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let n,r="127.0.0.1",i="9229",o;return(o=t.match(/^(--inspect(-brk)?)$/))!==null?n=o[1]:(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(n=o[1],/^\d+$/.test(o[3])?i=o[3]:r=o[3]):(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(n=o[1],r=o[3],i=o[4]),n&&i!=="0"?`${n}=${r}:${parseInt(i)+1}`:t})}function Zd(){if(Y.env.NO_COLOR||Y.env.FORCE_COLOR==="0"||Y.env.FORCE_COLOR==="false")return!1;if(Y.env.FORCE_COLOR||Y.env.CLICOLOR_FORCE!==void 0)return!0}var HE=new Cr;var ts="en-US",ex={and:new Intl.ListFormat(ts,{type:"conjunction"}),or:new Intl.ListFormat(ts,{type:"disjunction"})};function ln(e,t="and"){return ex[t].format(e)}var Kd={read_only:["read"],send_only:["send"],read_and_send:["send","read","tidy"],everything:["send","read","tidy","manage"]},qa={read_only:"Read only",send_only:"Send only",read_and_send:"Read and send",everything:"Everything"};function Jd(e){return typeof e=="string"&&Object.hasOwn(Kd,e)}function tx(e,t){return Kd[e].includes(t)}function Xd(e){return ln(e.map(t=>qa[t]),"or")}function Qd(e){return tx(e,"read")}function em(e){return e==="all"?"All sources":e.length===1?e[0]:e.length?`${e.length} sources`:"No sources"}var tm=[{method:"GET",path:"/v1/access",access:["send","read"],sendKey:!0},{method:"POST",path:"/v1/send",access:["send"],sendKey:!0},{method:"GET",path:"/v1/messages",access:["read"]},{method:"GET",path:"/v1/messages/stream",access:["read"]},{method:"GET",path:"/v1/messages/{messageId}",access:["read"]},{method:"POST",path:"/v1/messages/read",access:["tidy"]},{method:"POST",path:"/v1/messages/unread",access:["tidy"]},{method:"POST",path:"/v1/messages/archive",access:["tidy"]},{method:"POST",path:"/v1/messages/unarchive",access:["tidy"]},{method:"POST",path:"/v1/messages/trash",access:["manage"]},{method:"POST",path:"/v1/messages/search",access:["read"]},{method:"POST",path:"/v1/messages/move",access:["tidy"]},{method:"PUT",path:"/v1/messages/{messageId}/snooze",access:["tidy"]},{method:"DELETE",path:"/v1/messages/{messageId}/snooze",access:["tidy"]},{method:"GET",path:"/v1/threads/{threadId}",access:["read"]},{method:"GET",path:"/v1/message-images/{imageId}/{variant}",access:["read"]},{method:"GET",path:"/v1/sources",access:["send","read"]},{method:"POST",path:"/v1/sources",access:["manage"]},{method:"GET",path:"/v1/sources/{sourceId}",access:["read"]},{method:"PATCH",path:"/v1/sources/{sourceId}",access:["manage"]},{method:"DELETE",path:"/v1/sources/{sourceId}",access:["manage"]},{method:"POST",path:"/v1/sources/{sourceId}/mute",access:["manage"]},{method:"POST",path:"/v1/sources/{sourceId}/unmute",access:["manage"]},{method:"POST",path:"/v1/sources/{sourceId}/disable",access:["manage"]},{method:"POST",path:"/v1/sources/{sourceId}/enable",access:["manage"]},{method:"POST",path:"/v1/sources/{sourceId}/read",access:["tidy"]},{method:"POST",path:"/v1/sources/{sourceId}/send-key",access:["manage"]},{method:"POST",path:"/v1/sources/{sourceId}/send-key/reset",access:["manage"]},{method:"GET",path:"/v1/trash",access:["read"]},{method:"POST",path:"/v1/trash/search",access:["read"]},{method:"GET",path:"/v1/trash/messages/{messageId}",access:["read"]},{method:"DELETE",path:"/v1/trash/messages/{messageId}",access:["manage"]},{method:"POST",path:"/v1/trash/messages/{messageId}/restore",access:["manage"]},{method:"GET",path:"/v1/trash/threads/{threadId}",access:["read"]},{method:"DELETE",path:"/v1/trash/threads/{threadId}",access:["manage"]},{method:"POST",path:"/v1/trash/threads/{threadId}/restore",access:["manage"]},{method:"DELETE",path:"/v1/trash/sources/{sourceId}",access:["manage"]},{method:"POST",path:"/v1/trash/sources/{sourceId}/restore",access:["manage"]}];var re={rejected:1,usage:2,notFound:3,access:4,tryLater:5,unknownOutcome:6},rx={invalid_arguments:re.usage,invalid_base_url:re.usage,insecure_base_url:re.usage,invalid_config:re.usage,invalid_source:re.rejected,not_found:re.notFound,missing_key:re.access,invalid_key:re.access,send_key_only:re.access,signed_out:re.access,login_cancelled:re.rejected,login_failed:re.rejected,update_failed:re.rejected,request_timeout:re.unknownOutcome,network_error:re.unknownOutcome,empty_response:re.unknownOutcome,unexpected_error:re.rejected},$=class extends Error{constructor(n,r,i){super(r);this.code=n;this.hint=i;this.exitCode=rx[n]}exitCode},B=class extends Error{},Ht=class extends Error{constructor(n,r){super(r.message);this.reason=n;this.undone=r}};function H(e,t,{params:n={},...r}={}){let i=tm.find(s=>s.path===t&&s.method===e);if(!i)throw new Error(`${e} ${t} is not a published operation.`);let o=t.replace(/\{([^}]+)\}/g,(s,a)=>{let u=n[a];if(!u?.trim()||u==="."||u==="..")throw new B(`"${u??""}" is not a valid ID.`);return encodeURIComponent(u)});return{method:e,path:o,..."sendKey"in i?{sendKey:!0}:{},...r}}function ns(e,t="reach"){return new $("network_error",`Could not ${t} Ripple at ${e}. Check your network connection.`)}function rs(e="reach"){return new $("invalid_base_url",`Could not ${e} Ripple. RIPPLE_BASE_URL must be a valid URL.`)}function ja(e,{baseUrl:t,key:n,signal:r}){let i=new URL(t.replace(/\/$/,"")+e.path);for(let[s,a]of Object.entries(e.query??{}))a!==void 0&&i.searchParams.set(s,String(a));let o=e.body!==void 0;return new Request(i,{method:e.method,headers:{authorization:`Bearer ${n}`,...e.headers,...o?{"content-type":"application/json"}:{}},...o?{body:JSON.stringify(e.body)}:{},signal:r})}function Ha(e){return e.headers.get("x-ripple-latest-cli-version")??void 0}async function Wa(e,t){let n=await fetch(ja(e,t)),r=Ha(n);return{...await Ga(n,e.file),...r?{latestRelease:r}:{}}}async function Ga(e,t=!1){let{status:n}=e;if(n===204)return{status:n};if(t&&e.ok)return{status:n,data:new Uint8Array(await e.arrayBuffer())};let r=e.ok?void 0:Number(e.headers.get("retry-after"))||void 0,i=await e.text(),o;try{o=JSON.parse(i)}catch{return{status:n,unreadable:!0,retryAfter:r,error:{code:"invalid_response",message:`Ripple returned HTTP ${n} without a JSON response. The operation may have completed; reconcile before retrying.`}}}return e.ok?typeof o!="object"||o===null?{status:n,unreadable:!0,error:{code:"invalid_response",message:"Ripple returned an invalid JSON response."}}:{status:n,data:o}:{status:n,retryAfter:r,error:typeof o=="object"&&o!==null?o:{code:"http_error",message:`Ripple returned HTTP ${n}.`}}}async function*nm(e){let t=new TextDecoder,n="",r,i="",o=[];for await(let s of e){n+=t.decode(s,{stream:!0});for(let a=n.indexOf(`
|
|
28
28
|
`);a>=0;a=n.indexOf(`
|
|
29
29
|
`)){let u=n.slice(0,a).replace(/\r$/,"");if(n=n.slice(a+1),u===""){yield{event:i||"message",...o.length?{data:o.join(`
|
|
30
|
-
`)}:{},...r===void 0?{}:{id:r}},i="",o=[];continue}let l=u.indexOf(":");if(l===0)continue;let
|
|
31
|
-
`))
|
|
32
|
-
|
|
30
|
+
`)}:{},...r===void 0?{}:{id:r}},i="",o=[];continue}let l=u.indexOf(":");if(l===0)continue;let d=l<0?u:u.slice(0,l),c=l<0?"":u.slice(l+1).replace(/^ /,"");d==="id"?r=c:d==="event"?i=c:d==="data"&&o.push(c)}}}import{existsSync as ox,readFileSync as sx,statSync as ax}from"node:fs";import{homedir as ux}from"node:os";import{join as lx}from"node:path";var rm="[0-9a-hjkmnp-tv-z]";function is(e){return new RegExp(`^${e}_${rm}{16}$`)}function os(e){return new RegExp(`^${e}_${rm}{26}$`)}var im={send:"rpl_send",api:"rpl_api",access:"rpl_at",refresh:"rpl_rt"},tI=`${im.send}_`,ix=Object.entries(im).map(([e,t])=>[e,os(t)]);function om(e){return ix.find(([,t])=>t.test(e))?.[0]??null}var Va="https://api.ripple.do";function cx(){return lx(ux(),".config","ripple","config.json")}function dx(e){if(!ox(e))return;let{baseUrl:t}=JSON.parse(sx(e,"utf8"));if(t){if(process.platform!=="win32"&&(ax(e).mode&18)!==0)throw new Error("Refusing to use CLI config file because it is writable by other users. Run `chmod 600` on the file.");return t}}function mx(e){let t=e.RIPPLE_KEY?.trim();if(!t)return{};let n=om(t);if(n!=="send"&&n!=="api")throw new $("invalid_key","RIPPLE_KEY isn't a Ripple key. Keys start with rpl_send_ or rpl_api_.","Copy it again from Ripple, then run: export RIPPLE_KEY=<key>");return{key:t,kind:n}}function sm({env:e,flags:t,configPath:n=cx()}){let r=mx(e),i=t.baseUrl||e.RIPPLE_BASE_URL||dx(n)||Va;if(!Ya(i))throw new $("insecure_base_url","Ripple's address must start with https://, so your key isn't sent unencrypted.","Plain http:// works only for localhost.");return{baseUrl:i,...r}}function Ya(e){let t;try{t=new URL(e)}catch{return!0}return t.protocol==="https:"||t.protocol==="http:"&&["localhost","127.0.0.1","[::1]"].includes(t.hostname)}import{spawn as px}from"node:child_process";import{randomBytes as fx}from"node:crypto";import{existsSync as hx}from"node:fs";import{chmod as am,mkdir as gx,readFile as yx,rename as wx,rm as um,writeFile as xx}from"node:fs/promises";import{homedir as lm}from"node:os";import{dirname as bx,join as kx}from"node:path";var Sx="Ripple CLI",cm="/usr/bin/security";function dm(e){if(typeof e!="object"||e===null)return null;let{accessToken:t,refreshToken:n,expiresAt:r,tokenEndpoint:i,revocationEndpoint:o}=e;return typeof t=="string"&&typeof n=="string"&&typeof r=="number"&&typeof i=="string"&&typeof o=="string"?{accessToken:t,refreshToken:n,expiresAt:r,tokenEndpoint:i,revocationEndpoint:o}:null}function Za(e){return new Promise((t,n)=>{let r=px(cm,["-i"],{stdio:["pipe","pipe","ignore"]}),i="";r.stdout.on("data",o=>{i+=o.toString()}),r.once("error",n),r.once("close",o=>t({status:o??1,output:i})),r.stdin.end(`${e}
|
|
31
|
+
`)})}var Ka=e=>`"${e.replace(/["\\]/g,"")}"`;function Tx(){let e=t=>`-a ${Ka(t)} -s ${Ka(Sx)}`;return{description:"the macOS Keychain",async load(t){let{status:n,output:r}=await Za(`find-generic-password ${e(t)} -w`);if(n!==0)return null;try{return dm(JSON.parse(Buffer.from(r.trim(),"base64").toString("utf8")))}catch{return null}},async save(t,n){let r=Buffer.from(JSON.stringify(n)).toString("base64"),{status:i}=await Za(`add-generic-password -U ${e(t)} -w ${Ka(r)}`);if(i!==0)throw new Error(`Could not save the sign-in in the Keychain (security exited with ${i}).`)},async delete(t){await Za(`delete-generic-password ${e(t)}`)}}}function Cx(e=kx(lm(),".config","ripple","credentials.json")){async function t(){try{await am(e,384);let r=JSON.parse(await yx(e,"utf8"));return typeof r=="object"&&r!==null&&!Array.isArray(r)?r:{}}catch{return{}}}async function n(r){if(Object.keys(r).length===0){await um(e,{force:!0});return}await gx(bx(e),{recursive:!0,mode:448});let i=`${e}.${fx(6).toString("hex")}.tmp`;try{await xx(i,`${JSON.stringify(r,null,2)}
|
|
32
|
+
`,{mode:384,flag:"wx"}),await am(i,384),await wx(i,e)}catch(o){throw await um(i,{force:!0}),o}}return{description:e.replace(lm(),"~"),async load(r){return dm((await t())[r])},async save(r,i){await n({...await t(),[r]:i})},async delete(r){let{[r]:i,...o}=await t();await n(o)}}}var Ja=e=>!!(e.SSH_CONNECTION||e.SSH_CLIENT||e.SSH_TTY);function mm(e){return process.platform==="darwin"&&!Ja(e)&&hx(cm)?Tx():Cx()}import{styleText as Fx}from"node:util";function xi(e){return/\u0000|[\uD800-\uDFFF]/u.test(e)}var Ex=/\x1b(?:\[[0-?]*[ -/]*[@-~]|\][^\x07\x1b]*(?:\x07|\x1b\\)|[ -/]*[0-~]?)/g;function bi(e){return e.replace(Ex,"")}var Ix=new Intl.Segmenter("en",{granularity:"grapheme"});function ss(e,t,n){if(!n&&e.length<=t)return e;let r=0;for(let{index:i,segment:o}of Ix.segment(e))if(r+=n?n(o):o.length,r>t)return e.slice(0,i);return e}var as=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],us=[12288,12288,65281,65376,65504,65510],Xa=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Qa=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],ki=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141];var ls=(e,t)=>{let n=0,r=Math.floor(e.length/2)-1;for(;n<=r;){let i=Math.floor((n+r)/2),o=i*2;if(t<e[o])r=i-1;else if(t>e[o+1])n=i+1;else return!0}return!1};var Ax=as[0],_x=as.at(-1),Ox=us[0],Dx=us.at(-1),kI=Xa[0],SI=Xa.at(-1),TI=Qa[0],CI=Qa.at(-1),vx=ki[0],Mx=ki.at(-1),pm=19968,[Nx,Rx]=Px(ki);function Px(e){let t=e[0],n=e[1];for(let r=0;r<e.length;r+=2){let i=e[r],o=e[r+1];if(pm>=i&&pm<=o)return[i,o];o-i>n-t&&(t=i,n=o)}return[t,n]}var fm=e=>e<Ax||e>_x?!1:ls(as,e),hm=e=>e<Ox||e>Dx?!1:ls(us,e);var gm=e=>e>=Nx&&e<=Rx?!0:e<vx||e>Mx?!1:ls(ki,e);function Lx(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function ym(e,{ambiguousAsWide:t=!1}={}){return Lx(e),hm(e)||gm(e)||t&&fm(e)?2:1}function bm(e){let t=n=>r=>e?Fx(n,r,{validateStream:!1}):r;return{color:e,bold:t("bold"),dim:t("dim"),accent:t("blue"),error:t("red"),warning:t("yellow")}}function Pe(e,t){return`${e} ${t}${e===1?"":"s"}`}function St(e){return e.charAt(0).toUpperCase()+e.slice(1)}function wm(e){return e.replace(/\s+/g," ").trim()}var $x=new Intl.Segmenter("en",{granularity:"grapheme"}),Ux=new RegExp("^\\p{RGI_Emoji}$","v"),zx=/^[\p{Control}\p{Mark}\p{Default_Ignorable_Code_Point}]/u;function km(e){return Ux.test(e)?2:zx.test(e)?0:ym(e.codePointAt(0))}function Er(e){let t=0;for(let{segment:n}of $x.segment(e))t+=km(n);return t}function Sm(e,t){return e+" ".repeat(Math.max(0,t-Er(e)))}function xm(e,t){return Er(e)<=t?e:`${ss(e,Math.max(0,t-1),km).trimEnd()}\u2026`}function cn(e,t,n){return new Intl.DateTimeFormat(ts,{timeZone:t.timeZone,...n}).format(new Date(e)).replace(/ /g," ")}var eu={hour:"numeric",minute:"2-digit"};function Si(e,t){let n=t.now.toISOString(),r=i=>cn(i,t,{year:"numeric",month:"numeric",day:"numeric"});return r(e)===r(n)?cn(e,t,eu):cn(e,t,{year:"numeric"})===cn(n,t,{year:"numeric"})?cn(e,t,{month:"short",day:"numeric",...eu}):zn(e,t)}function Wt(e,t){return`${cn(e,t,{weekday:"short",month:"short",day:"numeric",year:"numeric"})} at ${cn(e,t,eu)}`}function zn(e,t){return cn(e,t,{month:"short",day:"numeric",year:"numeric"})}function Ti(e,{unread:t=!1,title:n,detail:r,facts:i,extra:o}){let{style:s}=e,a=(e.width??1/0)-2,u=xm(wm(n),a),l=a-Er(u)-2,d=r&&l>=12?` ${s.dim(xm(wm(r),l))}`:"";return[`${t?s.accent("\u25CF"):" "} ${t?s.bold(u):u}${d}`,` ${s.dim(i.filter(Boolean).join(" \xB7 "))}`,...o?[` ${s.dim(o)}`]:[]].join(`
|
|
33
|
+
`)}function Ci(e,t,n,r=[]){let i=r.filter(s=>!!s).map(e.style.dim);return[t.length?t.join(`
|
|
33
34
|
|
|
34
35
|
`):n,...i.length?["",...i]:[]].join(`
|
|
35
36
|
`)+`
|
|
36
|
-
`}function
|
|
37
|
-
|
|
37
|
+
`}function Ir(e,t){let n=t.filter(o=>!!o[1]),r=Math.max(...n.map(([o])=>Er(o))),i=`
|
|
38
|
+
${" ".repeat(r+2)}`;return n.map(([o,s])=>`${e.style.dim(Sm(o,r))} ${s.replaceAll(`
|
|
39
|
+
`,i)}`).join(`
|
|
40
|
+
`)}function tu(e,t,n){let r=t.map((o,s)=>Math.max(Er(o),...n.map(a=>Er(a[s])))),i=o=>o.map((s,a)=>a===o.length-1?s:Sm(s,r[a])).join(" ");return[e.style.dim(i(t)),...n.map(i)].join(`
|
|
38
41
|
`)+`
|
|
39
|
-
`}function
|
|
42
|
+
`}function Tm(e,t,n){return`${e.style.error("Error:")} ${t}
|
|
40
43
|
${n?`${e.style.dim(n)}
|
|
41
|
-
`:""}`}function
|
|
42
|
-
`)
|
|
44
|
+
`:""}`}function nu(e){return e?`Next page: --cursor ${e}`:void 0}function cs(e){let{nextCursor:t,total:n}=e.at(-1),r=e.reduce((i,o)=>i+o.items.length,0);return t?`Showing ${r} of ${n}. ${nu(t)}`:void 0}import{randomUUID as bb}from"node:crypto";var PI=10*1024*1024,LI=20*1024*1024;var Bx=["jpeg","png","webp","gif"],FI=[...Bx,"svg"];var $I=is("img");function Cm(e,t){return`ripple-${e.slice(-8)}${t==="thumbnail"?"-thumbnail":""}.webp`}var qx=[{id:"hop",name:"Hop"},{id:"arcade",name:"Arcade"},{id:"clink",name:"Clink"},{id:"drop",name:"Drop"},{id:"echo",name:"Echo"},{id:"glow",name:"Glow"},{id:"lift",name:"Lift"},{id:"sparkle",name:"Sparkle"},{id:"swoop",name:"Swoop"},{id:"tick",name:"Tick"}],Ei=qx.map(e=>e.id),Em=ln(Ei,"or");var ds=["quiet","standard","important"];var Hx=["text","markdown"],KI=[...Hx,"html"];var Im=64e3;var Am=4,ms=120,_m={title:"Hello from Ripple",body:"The first of many."};var Om=e=>`This key sends only to ${e}.`;function Wx(e){return e.replace(/\s+/g," ").trim()}var Gx=/^thr_[0-9a-hjkmnp-tv-z]{16}$/;function Dm(e){return typeof e=="string"&&Gx.test(e)}var JI=`a non-empty string of ${ms} characters or fewer`;function ru(e){if(typeof e!="string"||xi(e))return null;let t=Wx(e);return t.length>0&&t.length<=ms?t:null}import{spawn as Xx,spawnSync as Qx}from"node:child_process";import{createHash as eb,randomBytes as $m}from"node:crypto";import{createServer as tb}from"node:http";import{hostname as nb}from"node:os";function iu(e){let t=(e??"").replace(/[\p{Cc}\p{Cf}]/gu,"").replace(/\s+/g," ").trim();return t?t.slice(0,64):null}var ou="ripple-cli",Mm="offline_access";var su=10,Nm="computer_name",au={approve:"/connect",code:"/connect/code",done:"/connect/done"};var Rm="http://127.0.0.1/callback",Vx="Unknown computer";function Pm(e){return iu(iu(e)?.replace(/\.local$/i,""))??Vx}var Yx=["amber","autumn","bold","brave","bright","brisk","calm","clear","clever","cosmic","crisp","dapper","eager","early","fancy","gentle","giant","golden","grand","happy","hidden","honest","humble","jolly","kind","lively","lucky","lunar","mellow","merry","misty","modest","noble","olive","patient","plucky","polar","proud","quick","quiet","rapid","rosy","royal","rustic","silent","silver","simple","sleepy","smooth","snowy","solar","steady","sunny","swift","tidy","tranquil","velvet","vivid","warm","wild","windy","wise","witty","young"],vm=["acorn","anchor","apple","arrow","aspen","badger","basin","beacon","birch","bison","blossom","bridge","brook","button","cabin","canyon","candle","canoe","castle","cedar","cello","cherry","cloud","clover","comet","compass","coral","cove","crane","creek","dawn","delta","desert","dune","eagle","echo","ember","falcon","fern","field","finch","fjord","forest","fox","garden","geyser","glacier","harbor","hazel","heron","hill","island","ivy","jasmine","kayak","kettle","lagoon","lantern","lark","lemon","lily","lotus","maple","marble","meadow","meteor","mint","moon","moss","mountain","nectar","nest","oak","ocean","orbit","orchid","otter","owl","palm","panda","pebble","pine","planet","plum","pond","poppy","prairie","quartz","rabbit","raven","reef","ridge","river","robin","rocket","saddle","sage","sail","shell","shore","sparrow","spruce","star","stone","summit","sunset","swan","thistle","tiger","trail","tulip","tundra","valley","violet","walnut","whale","willow","wind","wren","yarrow","zephyr","lake","bay","glade","grove","peak","spring","tide"],Zx="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function Lm(e){let t=[...(e??"").slice(0,5)].map(o=>Zx.indexOf(o));if(t.length<5||t.some(o=>o<0))return null;let[n,...r]=t,i=(o,s)=>vm[(o*64+s)%vm.length];return`${Yx[n]}-${i(r[0],r[1])}-${i(r[2],r[3])}`}var Kx="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Jx=8;function Fm(e){let t=e.toUpperCase().replace(/[\s-]/g,"").replace(/O/g,"0").replace(/[IL]/g,"1");return t.length===Jx&&[...t].every(n=>Kx.includes(n))?t:null}var rb=6e4;async function lu(e,t,n){try{return await fetch(new Request(e,{headers:{accept:"application/json",...n&&{"content-type":"application/x-www-form-urlencoded"}},...n&&{method:"POST",body:new URLSearchParams({client_id:ou,...n})},signal:AbortSignal.timeout(t.timeoutMs)}))}catch{throw ns(t.baseUrl)}}async function Um(e,t){let n=await lu(e,t),r=n.ok?await n.json().catch(()=>null):null;if(!r)throw new $("login_failed","This Ripple server doesn't offer signing in from the CLI.","Set RIPPLE_KEY to an API token from Settings \u2192 Developer \u2192 API tokens instead.");return r}async function ib(e){let t="/.well-known/oauth-protected-resource";if(!URL.canParse(t,e.baseUrl))throw rs();let n=await Um(new URL(t,e.baseUrl),e),r=Array.isArray(n.authorization_servers)?n.authorization_servers[0]:void 0,i=new $("login_failed","Ripple's sign-in server described itself in a way the CLI can't use.");if(typeof r!="string"||!URL.canParse(r))throw i;let o=new URL(r),s=await Um(new URL(`/.well-known/oauth-authorization-server${o.pathname.replace(/\/$/,"")}`,o.origin),e),a={issuer:r,authorizationEndpoint:s.authorization_endpoint,tokenEndpoint:s.token_endpoint,revocationEndpoint:s.revocation_endpoint},u=[r,a.authorizationEndpoint,a.tokenEndpoint,a.revocationEndpoint];if(s.issuer!==r||!u.every(l=>typeof l=="string"&&URL.canParse(l)&&Ya(l)))throw i;return a}async function cu(e,t,n){let r=await lu(e.tokenEndpoint,n,t),i=await r.json().catch(()=>({})),{access_token:o,refresh_token:s,expires_in:a}=i;return r.ok&&typeof o=="string"&&typeof s=="string"&&typeof a=="number"?{credential:{accessToken:o,refreshToken:s,expiresAt:Date.now()+a*1e3,tokenEndpoint:e.tokenEndpoint,revocationEndpoint:e.revocationEndpoint}}:{error:typeof i.error=="string"?i.error:`http_${r.status}`}}function du(e,t){return lu(e.revocationEndpoint,t,{token:e.refreshToken,token_type_hint:"refresh_token"}).then(n=>n.ok,()=>!1)}var mu=e=>e.expiresAt-rb>Date.now();async function zm(e,{refused:t}={}){let n=await e.store.load(e.baseUrl);if(!n||n.accessToken!==t&&mu(n))return n;let r=await cu(n,{grant_type:"refresh_token",refresh_token:n.refreshToken},e);if("credential"in r)return await e.store.save(e.baseUrl,r.credential),r.credential;if(r.error!=="invalid_grant")throw new $("login_failed",`Ripple couldn't renew this terminal's sign-in (${r.error}).`,"Try again in a moment.");let i=await e.store.load(e.baseUrl);if(i&&i.refreshToken!==n.refreshToken)return i;throw await e.store.delete(e.baseUrl),new $("signed_out","This terminal's sign-in has ended.","Run ripple login to sign in again.")}function Bm(){if(process.platform==="darwin"){let e=Qx("/usr/sbin/scutil",["--get","ComputerName"],{encoding:"utf8"});if(e.status===0&&e.stdout.trim())return e.stdout.trim()}return nb()}function qm(e){return Ja(e)||process.platform==="linux"&&!e.DISPLAY&&!e.WAYLAND_DISPLAY}function jm(e){let[t,n]=process.platform==="darwin"?["open",[e]]:process.platform==="win32"?["rundll32",["url.dll,FileProtocolHandler",e]]:["xdg-open",[e]];return new Promise(r=>{let i=Xx(t,n,{stdio:"ignore",detached:!0});i.once("error",()=>r(!1)),i.once("exit",o=>r(o===0)),i.unref()})}async function ob(e,t){let n=tb(),r=new URL(Rm);await new Promise((a,u)=>{n.once("error",u),n.listen(0,r.hostname,a)}),r.port=String(n.address().port);let i=r.toString(),o=()=>{n.close(),n.closeAllConnections?.()},s=new Promise(a=>{n.on("request",(u,l)=>{let d=new URL(u.url??"/",i).searchParams;if(!u.url?.startsWith(`${r.pathname}?`)||d.get("state")!==e){l.writeHead(404,{connection:"close"}).end();return}a({params:d,finish(c){l.writeHead(303,{location:`${t}?result=${c}`,"cache-control":"no-store",connection:"close"}).end()}})})});return{redirectUri:i,approval:s,close:o}}function Hm(){let e=$m(32).toString("base64url"),t=eb("sha256").update(e).digest("base64url");return{verifier:e,challenge:t,state:$m(16).toString("base64url"),phrase:Lm(t)}}function Wm(e,t,n,r){let i=new URL(e.authorizationEndpoint);return i.search=new URLSearchParams({response_type:"code",client_id:ou,redirect_uri:n,scope:Mm,state:t.state,code_challenge:t.challenge,code_challenge_method:"S256",[Nm]:Pm(r)}).toString(),i.toString()}var uu=()=>new $("login_cancelled","Not connected: the request was canceled."),ps=e=>new $("login_failed",`Not connected: ${e}.`,"Run ripple login to try again.");async function sb(e,t){let{style:n,say:r}=t,i=Hm(),o=new URL(e.issuer).origin,s=await ob(i.state,`${o}${au.done}`);try{let a=Wm(e,i,s.redirectUri,t.computerName),u=await t.openBrowser(a);r([u?"Opening your browser to connect this terminal.":"Open this link to connect this terminal:",...u?[]:[a],`Connect only if the page shows ${n.bold(i.phrase)}`,...u?["",n.dim(`Didn't open? Go to ${a}`)]:[],""].join(`
|
|
45
|
+
`));let l=AbortSignal.timeout(su*6e4),d=AbortSignal.any([l,...t.signal?[t.signal]:[]]),{params:c,finish:m}=await new Promise((S,w)=>{d.addEventListener("abort",()=>w(l.aborted?ps(`the request expired after ${su} minutes`):uu()),{once:!0}),s.approval.then(S)}),p=c.get("code"),f=c.get("iss");if(!p||f!==null&&f!==e.issuer){let S=c.get("error")==="access_denied";throw m(S?"cancelled":"failed"),S?uu():ps("Ripple didn't approve the request")}let x=await cu(e,{grant_type:"authorization_code",code:p,redirect_uri:s.redirectUri,code_verifier:i.verifier},t).catch(S=>{throw m("failed"),S});if(m("credential"in x?"connected":"failed"),"credential"in x)return x.credential;throw ps(`Ripple refused the approval (${x.error})`)}finally{s.close()}}async function ab(e,t,n){let{style:r,say:i}=t,o=Hm(),s=`${new URL(e.issuer).origin}${au.code}`;for(i(["To connect this terminal, open this link on any device:",Wm(e,o,s,t.computerName),"",`Connect only if the page shows ${r.bold(o.phrase)}, then enter the code it gives you.`,""].join(`
|
|
46
|
+
`));;){let a=await n("Code: ");if(a===null)throw uu();if(!a.trim())continue;let u=Fm(a);if(!u){i(r.warning("Codes have 8 letters and numbers, like 7QK2-M9XD."));continue}let l=await cu(e,{grant_type:"authorization_code",code:u,redirect_uri:s,code_verifier:o.verifier},t);if("credential"in l)return l.credential;if(l.error!=="invalid_grant")throw ps(`Ripple refused the code (${l.error})`);i(r.warning("That code didn't work. Check it, or open the link again for a new one."))}}async function Gm(e,{browser:t}){let{ask:n}=e;if(!t&&!n)throw new $("login_failed","Connecting without a browser needs a terminal to type the code in.","Run ripple login at a terminal, or set RIPPLE_KEY to an API token instead.");let r=await ib(e),i=t?await sb(r,e):await ab(r,e,n),o=await e.store.load(e.baseUrl).catch(()=>null);return await e.store.save(e.baseUrl,i),o&&!await du(o,e)&&e.say(e.style.warning("Could not reach Ripple to end this terminal's previous sign-in. Sign out the older one in Settings \u2192 Account \u2192 Signed in.")),{credential:i,replaced:o!==null}}import{randomUUID as mb}from"node:crypto";import{readFile as pb}from"node:fs/promises";import fb from"node:path";var ub=5*1024*1024;var bA=`Choose an image up to ${ub/(1024*1024)} MB.`;var Vm=["red","orange","yellow","green","teal","blue","indigo","purple","pink"];function Ym(e,t){let n=t?.name.trim();return n&&dn(n)!==dn(e)?n:null}var kA=os("pic");function dn(e){return e.trim().replace(/\s+/g," ").toLowerCase()}function lb(e){return t=>{let n=Number(t);if(!Number.isSafeInteger(n)||n<1||n>e)throw new Ye(`must be a whole number from 1 to ${e}.`);return n}}function hs(e){if(!e.trim())throw new Ye("needs a value.");return e}function pu(e){return/T.*(?:Z|[+-]\d{2}:\d{2})$/.test(e)&&Number.isFinite(Date.parse(e))}function cb(e){if(!pu(e))throw new Ye("must be a time like 2026-10-17T09:00:00Z, with Z or an offset such as -04:00.");return e}var de=(e,t)=>new se(e,t).argParser(hs),Zm=(e,t)=>new se(e,t).argParser(cb),fu=(e,t,n)=>new se(e,t).argParser(lb(n)),Ze=(e,t,n)=>new se(e,t).choices(n),fs=100,Ii=25;function qn(e,t){let n=fu("--limit <count>",`How many ${e} a page holds, up to ${fs}${t?` (default ${t})`:""}`,fs);return t===void 0?n:n.default(t)}var jn=()=>de("--cursor <cursor>","Continue from where the last page ended"),Ai=e=>Ze("-a, --alert <level>",e,ds),Hn=()=>new se("--all",`Show every page; without --limit, each holds ${fs}`).conflicts("cursor").implies({limit:fs}),hu=()=>[new se("--unread","Only unread messages").conflicts("read"),new se("--read","Only read messages")];function gu({unread:e,read:t}){return e?!0:t?!1:void 0}async function Gt(e,t,{many:n=!1,named:r=i=>yu(e,i)}={}){if(t===void 0)return;let i=(n?t.split(","):[t]).map(a=>a.trim());if(i.some(a=>!a))throw new B("--source needs sources separated by commas, with none left empty.");let o=i.filter(a=>!Km(a)),s=o.length?await r(o):[];return[...new Set(i.flatMap(a=>{let u=Km(a)?a:s[o.indexOf(a)];return u===void 0?[]:[u]}))]}var db=is("src"),Km=e=>db.test(e);async function yu(e,t){let{items:n}=await e.call(H("GET","/v1/sources"));return t.map(r=>{let i=n.find(o=>dn(o.name)===dn(r));if(!i)throw new $("not_found",`You have no source named ${r}.`,'Run "ripple sources" to see your sources.');return i.sourceId})}function mn({limit:e,cursor:t,all:n},r){return i=>{let o=i.at(-1);if(!o)return r({limit:e,cursor:t});let s=n&&"nextCursor"in o?o.nextCursor:void 0;return typeof s=="string"&&s?r({limit:e,cursor:s}):void 0}}function gs(){return[de("-s, --source <sources>","Only messages from these sources, by name or ID, separated by commas"),...hu(),Zm("--after <time>","Only messages received after this time"),Zm("--before <time>","Only messages received before this time"),Ai("Only messages with this alert level"),Ze("--sort <order>","Best matches first, or newest first",["relevance","newest"]),qn("results",Ii),jn(),Hn()]}async function ys(e,t,n){return{query:t.length?t.join(" "):void 0,unread:gu(n),sourceIds:await Gt(e,n.source,{many:!0}),after:n.after,before:n.before,alert:n.alert,sort:n.sort}}var Bn=100;async function Jm(e,t){if(!e.includes("-")){if(e.length>Bn)throw new B(`Give at most ${Bn} message IDs as arguments; got ${e.length}. For more, use - and pipe them in.`);return e}if(e.length>1)throw new B("Use - on its own to pipe message IDs in.");let n=await ws(t,{asked:!0});if(n===void 0)throw new B("Pipe the message IDs in when using -.");let r=[...new Set(n.split(/\s+/).filter(Boolean))];if(!r.length)throw new B("No message IDs were piped in.");return r}async function ws(e,{asked:t}){if(!e||!(t||e.piped))return;let n=[];for await(let r of e.stream)n.push(Buffer.from(r));return Buffer.concat(n).toString("utf8")}function Xm(e,t){let n=[];e.command("send").description("Send a message. A send key sends to its own source; an API token sends to Inbox or the source you choose. With no message text, ripple send uses what you pipe in, shown exactly as printed unless you add --markdown or --html. When Ripple can't take it, ripple send keeps trying for 5 minutes, and never sends it twice.").summary("Send a message").argument("[message...]").addOption(de("-t, --title <text>","A title shown above the message (by default its first line, or a field that names its JSON)")).addOption(de("-s, --source <source>","Send to this source, by name or ID, instead of Inbox; a send key sends only to its own")).addOption(de("--thread <key>","Add to the source's thread with this key, such as a deploy or ticket ID, starting it if there's none")).addOption(de("--thread-title <text>","The name a thread --thread starts is shown by, instead of its key")).addOption(de("--thread-id <id>","Add to the thread with this ID, as an earlier send returned it")).addOption(Ai("How strongly to alert")).addOption(Ze("--sound <name>","Which sound it plays, instead of the source's or your account's",Ei)).addOption(new se("--link <url>",`A link to open from the message: https, email, phone, or another app's; repeat for up to ${Am}, the first leading`).argParser(r=>(n.push(hs(r)),n))).addOption(new se("--link-title <text>","A label for the --link before it, instead of its domain").argParser(r=>{let i=n.at(-1);if(typeof i!="string")throw new Ye("must follow the --link it names.");return n[n.length-1]={url:i,title:hs(r)},n})).addOption(de("--body <text>","Same as the message argument")).option("--markdown","Format the message as Markdown, such as headings, lists, links, and code").option("--html","Turn the message from HTML, such as an email, into formatted text; its <title> becomes the title").addOption(de("--json-file <path>","Send a full request from a JSON file, or - to pipe it in")).addOption(de("--idempotency-key <key>","Send only once, however often it runs with this key within 24 hours")).example('ripple send "Deploy finished"','make test 2>&1 | tail -20 | ripple send --title "Test results"','ripple send --markdown --title "Release notes" < notes.md',"ripple send --html < digest.html",'ripple send --source Deploys --thread deploy-42 --thread-title "Deploy #42" --title "Tests passed" "All 312 green"','ripple send --source Deploys --thread-id thr_06gm53wzxakqgkm4 "Shipped"','ripple send --title "Disk almost full" --alert important "Only 2 GB left on /data"','ripple send --title "Deploy failed" --sound tick "Build 42 failed"','ripple send --link https://ci.example.com/runs/42 --link-title "Open run" --link https://example.com/logs "Deploy failed"').action(async(r,i)=>{let o=H("POST","/v1/send",{body:await hb(r,n,i,t),headers:{"Idempotency-Key":i.idempotencyKey??mb()}});await t.run(o,s=>xu(s,t.display))})}async function hb(e,t,n,r){let{title:i,alert:o,sound:s,jsonFile:a,markdown:u,html:l}=n;if(n.body!==void 0&&e.length)throw new B("Give the message text once, either as an argument or with --body.");let d=n.body??(e.length?e.join(" "):void 0);if(u&&l)throw new B("Choose either --markdown or --html, not both.");let c=yb(n);if(a!==void 0){if(t.length||[i,d,n.source,c,o,s,u,l].some(f=>f!==void 0))throw new B("--json-file holds the whole message, so use it without other message options or text.");return xb(await wb(a,r),a)}let m=d??((await ws(r.input,{asked:!1}))?.trimEnd()||void 0);if(i===void 0&&m===void 0)throw new B('Add a message, for example: ripple send "Deploy finished"');let[p]=await Gt(r,n.source,{named:async f=>await r.keyKind()==="send"?gb(r,f):yu(r,f)})??[];return{title:i,body:m,format:u?"markdown":l?"html":void 0,links:t.length?t:void 0,alert:o,sound:s,source:p,thread:c}}var wu="Leave out --source: a send key always sends to its own source.";async function gb(e,t){let{source:n}=await e.call(H("GET","/v1/access"));return t.map(r=>{if(dn(r)!==dn(n.name))throw new $("invalid_source",Om(n.name),wu);return n.sourceId})}function yb({thread:e,threadTitle:t,threadId:n}){let r=`a non-empty text of ${ms} characters or fewer`;if(n!==void 0){if(e!==void 0||t!==void 0)throw new B("--thread-id names its thread, so leave out --thread and --thread-title.");if(!Dm(n.trim()))throw new B("--thread-id must be a thread ID Ripple returned, such as thr_06gm53wzxakqgkm4.");return{id:n.trim()}}if(e===void 0){if(t!==void 0)throw new B("--thread-title names the thread --thread starts, so add --thread.");return}let i=ru(e);if(!i)throw new B(`--thread must be ${r}.`);if(t===void 0)return i;let o=ru(t);if(!o)throw new B(`--thread-title must be ${r}.`);return{key:i,title:o}}async function wb(e,t){if(e==="-"){let n=await ws(t.input,{asked:!0});if(n===void 0)throw new B("Pipe the JSON in when using --json-file -.");return n}try{return await pb(fb.resolve(t.env.INIT_CWD??process.cwd(),e),"utf8")}catch(n){throw new B(`Could not read ${e}: ${n instanceof Error?n.message:String(n)}`)}}function xb(e,t){let n;try{n=JSON.parse(e)}catch(r){throw new B(`Could not parse JSON from ${t}: ${r instanceof Error?r.message:String(r)}`)}if(!n||typeof n!="object"||Array.isArray(n))throw new B("The JSON must be an object shaped like the /v1/send request body.");return n}function xu(e,t){let{style:n}=t,r=e.thread?` in "${e.thread.title}" (message ${e.thread.messageNumber})`:"",i=(e.warnings??[]).map(o=>`${n.warning("Warning:")} ${o.message}
|
|
47
|
+
`).join("");return`Sent to ${e.source.name}${r} ${n.dim(e.messageId)}
|
|
48
|
+
${i}`}async function Qm(e,t){let n=await e(`${t} [Y/n] `);return n!==null&&!/^\s*no?\s*$/i.test(n)}async function ep(e,{browser:t=!0}={}){let n=e.loginContext();return{...await Gm(n,{browser:t&&!qm(e.env)}),savedIn:n.store.description}}var tp=e=>`Connected. Your sign-in is saved in ${e}.
|
|
49
|
+
`;async function np(e){let{ask:t}=e;if(!t||!await Qm(t,"This terminal isn't connected to Ripple. Sign in now?"))return null;let{credential:n,savedIn:r}=await ep(e);return e.loginContext().say(tp(r)),n}function rp(e,t){e.command("login").description("Connect this terminal to your Ripple account. Your browser opens to approve it, with one click when you're signed in. Over SSH, or with --no-browser, ripple login gives you a link to open on any device, which shows a code to type here. The sign-in is kept in the macOS Keychain, or elsewhere in ~/.config/ripple/credentials.json, which only you can read. RIPPLE_KEY, when set, takes its place.").summary("Connect this terminal to your account").option("--no-browser","Open the link on another device and type the code it shows").example("ripple login","ripple login --no-browser").action(async({browser:n})=>{let{replaced:r,savedIn:i}=await ep(t,{browser:n});if(t.print({status:"connected",savedIn:i},()=>tp(i)),t.env.RIPPLE_KEY?.trim())t.hint("RIPPLE_KEY is set, so commands keep using it until you unset it.");else if(!r&&t.ask&&await Qm(t.ask,"Send a first message now?")){let o=await t.call(H("POST","/v1/send",{body:_m,headers:{"Idempotency-Key":bb()}}));t.print(o,s=>xu(s,t.display))}}),e.command("logout").description("Sign this terminal out of Ripple. Its sign-in ends on Ripple and is removed from this computer. RIPPLE_KEY, when set, keeps working.").summary("Sign this terminal out").example("ripple logout").action(async()=>{let n=t.loginContext(),r=await n.store.load(n.baseUrl);if(!r){t.print({status:"signed_out"},()=>`This terminal isn't signed in.
|
|
50
|
+
`);return}let i=await du(r,n);if(await n.store.delete(n.baseUrl),!i)throw new $("network_error","Signed out on this computer, but couldn't reach Ripple to end the sign-in there.","Sign this terminal out in Settings \u2192 Account \u2192 Signed in.");t.print({status:"signed_out"},()=>`Signed out. This terminal's sign-in has ended.
|
|
51
|
+
`),t.env.RIPPLE_KEY?.trim()&&t.hint("RIPPLE_KEY is still set, so commands keep using it.")})}import{spawn as Sb}from"node:child_process";import{mkdirSync as Tb,realpathSync as Cb,statSync as Eb,utimesSync as Ib,writeFileSync as Ab}from"node:fs";import{homedir as _b}from"node:os";import ku from"node:path";var Ar={name:"@ripple/cli",version:"0.3.0",description:"Send notifications to your devices and manage your messages",private:!0,type:"module",bin:{ripple:"./dist/index.js"},scripts:{build:"pnpm run lint && pnpm run build:bin","build:bin":"node scripts/build.mjs",lint:"tsc --noEmit -p tsconfig.json",test:"vitest run tests",release:"node scripts/release.mjs"},devDependencies:{"@types/node":"25.5.0",esbuild:"0.25.12",typescript:"^5.8.2",vitest:"^3.2.6"},dependencies:{"@ripple/contract":"workspace:*","@ripple/domain":"workspace:*",commander:"15.0.0","get-east-asian-width":"1.5.0"}};var ip="https://ripple.do/install",op={script:"ripple update",homebrew:"brew upgrade ripple",npm:"npm install -g ripplepush@latest"};function bu(e){try{return Cb(e).replaceAll("\\","/")}catch{return e}}function sp(){if(process.versions.bun)return bu(process.execPath).includes("/Cellar/")?"homebrew":"script";let e=bu(process.argv[1]??"");return e.includes("/_npx/")?"npx":e.includes("/node_modules/")?"npm":"source"}function Ob(e){let[t,n]=[e,Ar.version].map(i=>i.split(".").map(Number)),r=t.findIndex((i,o)=>i!==n[o]);return r!==-1&&t[r]>n[r]}function ap(e,t){let n=op[t];if(!(!e||!n||!/^\d+\.\d+\.\d+$/.test(e)||!Ob(e)))return[`Ripple ${e} is out (you have ${Ar.version}). Update with: ${n}`,`What's new: https://github.com/ripplepush/cli/releases/tag/v${e}`].join(`
|
|
52
|
+
`)}var Db=1440*60*1e3,up=()=>ku.join(_b(),".cache","ripple","update-notice");function lp(e,t){try{if(t.getTime()-Eb(e).mtimeMs<Db)return!1}catch{}try{Tb(ku.dirname(e),{recursive:!0}),Ab(e,""),Ib(e,t,t)}catch{}return!0}function cp(e,t){e.command("update").description("Update Ripple to the newest release. A copy from Homebrew or npm shows the command that updates it.").summary("Update Ripple to the newest release").example("ripple update").action(async()=>{let n=t.installMethod;if(n!=="script"){let a=op[n];t.print({installedWith:n,...a?{command:a}:{}},()=>n==="npx"?`npx runs the newest Ripple each time, so there's nothing to update.
|
|
43
53
|
`:n==="source"?`This copy runs from Ripple's source code. Pull and rebuild it to update.
|
|
44
54
|
`:`This copy came from ${n==="homebrew"?"Homebrew":"npm"}. Update it with: ${a}
|
|
45
|
-
`);return}let r;try{let a=await fetch(new Request(
|
|
46
|
-
`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"};var kx={}.hasOwnProperty;function Er(e){return kx.call(qa,e)?qa[e]:!1}function ue(e,t,n,r){let i=e.length,o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Ne(e,t){return e.length>0?(ue(e,e.length,0,t),e):t}var Wd={}.hasOwnProperty;function ts(e){let t={},n=-1;for(;++n<e.length;)Sx(t,e[n]);return t}function Sx(e,t){let n;for(n in t){let i=(Wd.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n],s;if(o)for(s in o){Wd.call(i,s)||(i[s]=[]);let a=o[s];Cx(i[s],Array.isArray(a)?a:a?[a]:[])}}}function Cx(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ue(e,0,0,r)}function ns(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}function De(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var de=ln(/[A-Za-z]/),me=ln(/[\dA-Za-z]/),jd=ln(/[#-'*+\--9=?A-Z^-~]/);function $n(e){return e!==null&&(e<32||e===127)}var wi=ln(/\d/),Vd=ln(/[\dA-Fa-f]/),Gd=ln(/[!-/:-@[-`{-~]/);function D(e){return e!==null&&e<-2}function z(e){return e!==null&&(e<0||e===32)}function R(e){return e===-2||e===-1||e===32}var zn=ln(new RegExp("\\p{P}|\\p{S}","u")),kt=ln(/\s/);function ln(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function N(e,t,n,r){let i=r?r-1:Number.POSITIVE_INFINITY,o=0;return s;function s(u){return R(u)?(e.enter(n),a(u)):t(u)}function a(u){return R(u)&&o++<i?(e.consume(u),a):(e.exit(n),t(u))}}var Yd={tokenize:Ex};function Ex(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),N(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){let u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return D(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}var Kd={tokenize:Ix},Zd={tokenize:Ax};function Ix(e){let t=this,n=[],r=0,i,o,s;return a;function a(k){if(r<n.length){let I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,u,l)(k)}return l(k)}function u(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&S();let I=t.events.length,A=I,x;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){x=t.events[A][1].end;break}b(r);let v=I;for(;v<t.events.length;)t.events[v][1].end={...x},v++;return ue(t.events,A+1,0,t.events.slice(I)),t.events.length=v,l(k)}return a(k)}function l(k){if(r===n.length){if(!i)return m(k);if(i.currentConstruct&&i.currentConstruct.concrete)return p(k);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Zd,c,d)(k)}function c(k){return i&&S(),b(r),m(k)}function d(k){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,p(k)}function m(k){return t.containerState={},e.attempt(Zd,f,p)(k)}function f(k){return r++,n.push([t.currentConstruct,t.containerState]),m(k)}function p(k){if(k===null){i&&S(),b(0),e.consume(k);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),w(k)}function w(k){if(k===null){C(e.exit("chunkFlow"),!0),b(0),e.consume(k);return}return D(k)?(e.consume(k),C(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(k),w)}function C(k,I){let A=t.sliceStream(k);if(I&&A.push(null),k.previous=o,o&&(o.next=k),o=k,i.defineSkip(k.start),i.write(A),t.parser.lazy[k.start.line]){let x=i.events.length;for(;x--;)if(i.events[x][1].start.offset<s&&(!i.events[x][1].end||i.events[x][1].end.offset>s))return;let v=t.events.length,P=v,M,y;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(M){y=t.events[P][1].end;break}M=!0}for(b(r),x=v;x<t.events.length;)t.events[x][1].end={...y},x++;ue(t.events,P+1,0,t.events.slice(v)),t.events.length=x}}function b(k){let I=n.length;for(;I-- >k;){let A=n[I];t.containerState=A[1],A[0].exit.call(t,e)}n.length=k}function S(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Ax(e,t,n){return N(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ir(e){if(e===null||z(e)||kt(e))return 1;if(zn(e))return 2}function cn(e,t,n){let r=[],i=-1;for(;++i<e.length;){let o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}var Ti={name:"attention",resolveAll:Dx,tokenize:_x};function Dx(e,t){let n=-1,r,i,o,s,a,u,l,c;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},m={...e[n][1].start};Jd(d,-u),Jd(m,u),s={type:u>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Ne(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=Ne(l,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),l=Ne(l,cn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Ne(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(c=2,l=Ne(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):c=0,ue(e,r-1,n-r+3,l),n=r+l.length-c-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function _x(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ir(r),o;return s;function s(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;let l=e.exit("attentionSequence"),c=Ir(u),d=!c||c===2&&i||n.includes(u),m=!i||i===2&&c||n.includes(r);return l._open=!!(o===42?d:d&&(i||!m)),l._close=!!(o===42?m:m&&(c||!d)),t(u)}}function Jd(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Ha={name:"autolink",tokenize:Ox};function Ox(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(f){return de(f)?(e.consume(f),s):f===64?n(f):l(f)}function s(f){return f===43||f===45||f===46||me(f)?(r=1,a(f)):l(f)}function a(f){return f===58?(e.consume(f),r=0,u):(f===43||f===45||f===46||me(f))&&r++<32?(e.consume(f),a):(r=0,l(f))}function u(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||$n(f)?n(f):(e.consume(f),u)}function l(f){return f===64?(e.consume(f),c):jd(f)?(e.consume(f),l):n(f)}function c(f){return me(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,c):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):m(f)}function m(f){if((f===45||me(f))&&r++<63){let p=f===45?m:d;return e.consume(f),p}return n(f)}}var St={partial:!0,tokenize:vx};function vx(e,t,n){return r;function r(o){return R(o)?N(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||D(o)?t(o):n(o)}}var rs={continuation:{tokenize:Nx},exit:Px,name:"blockQuote",tokenize:Mx};function Mx(e,t,n){let r=this;return i;function i(s){if(s===62){let a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return R(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Nx(e,t,n){let r=this;return i;function i(s){return R(s)?N(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(rs,t,n)(s)}}function Px(e){e.exit("blockQuote")}var is={name:"characterEscape",tokenize:Rx};function Rx(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return Gd(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}var os={name:"characterReference",tokenize:Fx};function Fx(e,t,n){let r=this,i=0,o,s;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),u}function u(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,s=me,c(d))}function l(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=Vd,c):(e.enter("characterReferenceValue"),o=7,s=wi,c(d))}function c(d){if(d===59&&i){let m=e.exit("characterReferenceValue");return s===me&&!Er(r.sliceSerialize(m))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),c):n(d)}}var Xd={partial:!0,tokenize:$x},ss={concrete:!0,name:"codeFenced",tokenize:Lx};function Lx(e,t,n){let r=this,i={partial:!0,tokenize:A},o=0,s=0,a;return u;function u(x){return l(x)}function l(x){let v=r.events[r.events.length-1];return o=v&&v[1].type==="linePrefix"?v[2].sliceSerialize(v[1],!0).length:0,a=x,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),c(x)}function c(x){return x===a?(s++,e.consume(x),c):s<3?n(x):(e.exit("codeFencedFenceSequence"),R(x)?N(e,d,"whitespace")(x):d(x))}function d(x){return x===null||D(x)?(e.exit("codeFencedFence"),r.interrupt?t(x):e.check(Xd,w,I)(x)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===null||D(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(x)):R(x)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),N(e,f,"whitespace")(x)):x===96&&x===a?n(x):(e.consume(x),m)}function f(x){return x===null||D(x)?d(x):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===null||D(x)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(x)):x===96&&x===a?n(x):(e.consume(x),p)}function w(x){return e.attempt(i,I,C)(x)}function C(x){return e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),b}function b(x){return o>0&&R(x)?N(e,S,"linePrefix",o+1)(x):S(x)}function S(x){return x===null||D(x)?e.check(Xd,w,I)(x):(e.enter("codeFlowValue"),k(x))}function k(x){return x===null||D(x)?(e.exit("codeFlowValue"),S(x)):(e.consume(x),k)}function I(x){return e.exit("codeFenced"),t(x)}function A(x,v,P){let M=0;return y;function y($){return x.enter("lineEnding"),x.consume($),x.exit("lineEnding"),re}function re($){return x.enter("codeFencedFence"),R($)?N(x,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):H($)}function H($){return $===a?(x.enter("codeFencedFenceSequence"),_($)):P($)}function _($){return $===a?(M++,x.consume($),_):M>=s?(x.exit("codeFencedFenceSequence"),R($)?N(x,F,"whitespace")($):F($)):P($)}function F($){return $===null||D($)?(x.exit("codeFencedFence"),v($)):P($)}}}function $x(e,t,n){let r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}var ki={name:"codeIndented",tokenize:Bx},zx={partial:!0,tokenize:Ux};function Bx(e,t,n){let r=this;return i;function i(l){return e.enter("codeIndented"),N(e,o,"linePrefix",5)(l)}function o(l){let c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?s(l):n(l)}function s(l){return l===null?u(l):D(l)?e.attempt(zx,s,u)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||D(l)?(e.exit("codeFlowValue"),s(l)):(e.consume(l),a)}function u(l){return e.exit("codeIndented"),t(l)}}function Ux(e,t,n){let r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):D(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):N(e,o,"linePrefix",5)(s)}function o(s){let a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):D(s)?i(s):n(s)}}var Wa={name:"codeText",previous:Hx,resolve:qx,tokenize:Wx};function qx(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Hx(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Wx(e,t,n){let r=this,i=0,o,s;return a;function a(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),i++,u):(e.exit("codeTextSequence"),l(m))}function l(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),l):m===96?(s=e.enter("codeTextSequence"),o=0,d(m)):D(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(m))}function c(m){return m===null||m===32||m===96||D(m)?(e.exit("codeTextData"),l(m)):(e.consume(m),c)}function d(m){return m===96?(e.consume(m),o++,d):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(s.type="codeTextData",c(m))}}var as=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){let r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){let i=n||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Si(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Si(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Si(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let n=this.left.splice(t,Number.POSITIVE_INFINITY);Si(this.right,n.reverse())}else{let n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Si(this.left,n.reverse())}}};function Si(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function us(e){let t={},n=-1,r,i,o,s,a,u,l,c=new as(e);for(;++n<c.length;){for(;n in t;)n=t[n];if(r=c.get(n),n&&r[1].type==="chunkFlow"&&c.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,jx(c,n)),n=t[n],l=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=c.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(c.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...c.get(i)[1].start},a=c.slice(i,n),a.unshift(r),c.splice(i,n-i+1,a))}}return ue(e,0,Number.POSITIVE_INFINITY,c.slice(0)),!l}function jx(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,o=[],s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let a=s.events,u=[],l={},c,d,m=-1,f=n,p=0,w=0,C=[w];for(;f;){for(;e.get(++i)[1]!==f;);o.push(i),f._tokenizer||(c=r.sliceStream(f),f.next||c.push(null),d&&s.defineSkip(f.start),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(c),f._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++m<a.length;)a[m][0]==="exit"&&a[m-1][0]==="enter"&&a[m][1].type===a[m-1][1].type&&a[m][1].start.line!==a[m][1].end.line&&(w=m+1,C.push(w),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(s.events=[],f?(f._tokenizer=void 0,f.previous=void 0):C.pop(),m=C.length;m--;){let b=a.slice(C[m],C[m+1]),S=o.pop();u.push([S,S+b.length-1]),e.splice(S,2,b)}for(u.reverse(),m=-1;++m<u.length;)l[p+u[m][0]]=p+u[m][1],p+=u[m][1]-u[m][0]-1;return l}var ja={resolve:Gx,tokenize:Yx},Vx={partial:!0,tokenize:Zx};function Gx(e){return us(e),e}function Yx(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):D(a)?e.check(Vx,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Zx(e,t,n){let r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),N(e,o,"linePrefix")}function o(s){if(s===null||D(s))return n(s);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function ls(e,t,n,r,i,o,s,a,u){let l=u||Number.POSITIVE_INFINITY,c=0;return d;function d(b){return b===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(b),e.exit(o),m):b===null||b===32||b===41||$n(b)?n(b):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(b))}function m(b){return b===62?(e.enter(o),e.consume(b),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===62?(e.exit("chunkString"),e.exit(a),m(b)):b===null||b===60||D(b)?n(b):(e.consume(b),b===92?p:f)}function p(b){return b===60||b===62||b===92?(e.consume(b),f):f(b)}function w(b){return!c&&(b===null||b===41||z(b))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(b)):c<l&&b===40?(e.consume(b),c++,w):b===41?(e.consume(b),c--,w):b===null||b===32||b===40||$n(b)?n(b):(e.consume(b),b===92?C:w)}function C(b){return b===40||b===41||b===92?(e.consume(b),w):w(b)}}function cs(e,t,n,r,i,o){let s=this,a=0,u;return l;function l(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(o),c}function c(f){return a>999||f===null||f===91||f===93&&!u||f===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(f):f===93?(e.exit(o),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):D(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||D(f)||a++>999?(e.exit("chunkString"),c(f)):(e.consume(f),u||(u=!R(f)),f===92?m:d)}function m(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function ds(e,t,n,r,i,o){let s;return a;function a(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),s=m===40?41:m,u):n(m)}function u(m){return m===s?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(o),l(m))}function l(m){return m===s?(e.exit(o),u(s)):m===null?n(m):D(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),N(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(m))}function c(m){return m===s||m===null||D(m)?(e.exit("chunkString"),l(m)):(e.consume(m),m===92?d:c)}function d(m){return m===s||m===92?(e.consume(m),c):c(m)}}function Bn(e,t){let n;return r;function r(i){return D(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):R(i)?N(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}var Va={name:"definition",tokenize:Jx},Kx={partial:!0,tokenize:Xx};function Jx(e,t,n){let r=this,i;return o;function o(f){return e.enter("definition"),s(f)}function s(f){return cs.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=De(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),u):n(f)}function u(f){return z(f)?Bn(e,l)(f):l(f)}function l(f){return ls(e,c,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function c(f){return e.attempt(Kx,d,d)(f)}function d(f){return R(f)?N(e,m,"whitespace")(f):m(f)}function m(f){return f===null||D(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function Xx(e,t,n){return r;function r(a){return z(a)?Bn(e,i)(a):n(a)}function i(a){return ds(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return R(a)?N(e,s,"whitespace")(a):s(a)}function s(a){return a===null||D(a)?t(a):n(a)}}var Ga={name:"hardBreakEscape",tokenize:Qx};function Qx(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return D(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}var Ya={name:"headingAtx",resolve:eb,tokenize:tb};function eb(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ue(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function tb(e,t,n){let r=0;return i;function i(c){return e.enter("atxHeading"),o(c)}function o(c){return e.enter("atxHeadingSequence"),s(c)}function s(c){return c===35&&r++<6?(e.consume(c),s):c===null||z(c)?(e.exit("atxHeadingSequence"),a(c)):n(c)}function a(c){return c===35?(e.enter("atxHeadingSequence"),u(c)):c===null||D(c)?(e.exit("atxHeading"),t(c)):R(c)?N(e,a,"whitespace")(c):(e.enter("atxHeadingText"),l(c))}function u(c){return c===35?(e.consume(c),u):(e.exit("atxHeadingSequence"),a(c))}function l(c){return c===null||c===35||z(c)?(e.exit("atxHeadingText"),a(c)):(e.consume(c),l)}}var Qd=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Za=["pre","script","style","textarea"];var Ka={concrete:!0,name:"htmlFlow",resolveTo:ib,tokenize:ob},nb={partial:!0,tokenize:ab},rb={partial:!0,tokenize:sb};function ib(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ob(e,t,n){let r=this,i,o,s,a,u;return l;function l(g){return c(g)}function c(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),d}function d(g){return g===33?(e.consume(g),m):g===47?(e.consume(g),o=!0,w):g===63?(e.consume(g),i=3,r.interrupt?t:h):de(g)?(e.consume(g),s=String.fromCharCode(g),C):n(g)}function m(g){return g===45?(e.consume(g),i=2,f):g===91?(e.consume(g),i=5,a=0,p):de(g)?(e.consume(g),i=4,r.interrupt?t:h):n(g)}function f(g){return g===45?(e.consume(g),r.interrupt?t:h):n(g)}function p(g){let He="CDATA[";return g===He.charCodeAt(a++)?(e.consume(g),a===He.length?r.interrupt?t:H:p):n(g)}function w(g){return de(g)?(e.consume(g),s=String.fromCharCode(g),C):n(g)}function C(g){if(g===null||g===47||g===62||z(g)){let He=g===47,Pn=s.toLowerCase();return!He&&!o&&Za.includes(Pn)?(i=1,r.interrupt?t(g):H(g)):Qd.includes(s.toLowerCase())?(i=6,He?(e.consume(g),b):r.interrupt?t(g):H(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):o?S(g):k(g))}return g===45||me(g)?(e.consume(g),s+=String.fromCharCode(g),C):n(g)}function b(g){return g===62?(e.consume(g),r.interrupt?t:H):n(g)}function S(g){return R(g)?(e.consume(g),S):y(g)}function k(g){return g===47?(e.consume(g),y):g===58||g===95||de(g)?(e.consume(g),I):R(g)?(e.consume(g),k):y(g)}function I(g){return g===45||g===46||g===58||g===95||me(g)?(e.consume(g),I):A(g)}function A(g){return g===61?(e.consume(g),x):R(g)?(e.consume(g),A):k(g)}function x(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),u=g,v):R(g)?(e.consume(g),x):P(g)}function v(g){return g===u?(e.consume(g),u=null,M):g===null||D(g)?n(g):(e.consume(g),v)}function P(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||z(g)?A(g):(e.consume(g),P)}function M(g){return g===47||g===62||R(g)?k(g):n(g)}function y(g){return g===62?(e.consume(g),re):n(g)}function re(g){return g===null||D(g)?H(g):R(g)?(e.consume(g),re):n(g)}function H(g){return g===45&&i===2?(e.consume(g),ie):g===60&&i===1?(e.consume(g),ce):g===62&&i===4?(e.consume(g),Ke):g===63&&i===3?(e.consume(g),h):g===93&&i===5?(e.consume(g),wt):D(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(nb,$t,_)(g)):g===null||D(g)?(e.exit("htmlFlowData"),_(g)):(e.consume(g),H)}function _(g){return e.check(rb,F,$t)(g)}function F(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),$}function $(g){return g===null||D(g)?_(g):(e.enter("htmlFlowData"),H(g))}function ie(g){return g===45?(e.consume(g),h):H(g)}function ce(g){return g===47?(e.consume(g),s="",ut):H(g)}function ut(g){if(g===62){let He=s.toLowerCase();return Za.includes(He)?(e.consume(g),Ke):H(g)}return de(g)&&s.length<8?(e.consume(g),s+=String.fromCharCode(g),ut):H(g)}function wt(g){return g===93?(e.consume(g),h):H(g)}function h(g){return g===62?(e.consume(g),Ke):g===45&&i===2?(e.consume(g),h):H(g)}function Ke(g){return g===null||D(g)?(e.exit("htmlFlowData"),$t(g)):(e.consume(g),Ke)}function $t(g){return e.exit("htmlFlow"),t(g)}}function sb(e,t,n){let r=this;return i;function i(s){return D(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function ab(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(St,t,n)}}var Ja={name:"htmlText",tokenize:ub};function ub(e,t,n){let r=this,i,o,s;return a;function a(h){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(h),u}function u(h){return h===33?(e.consume(h),l):h===47?(e.consume(h),A):h===63?(e.consume(h),k):de(h)?(e.consume(h),P):n(h)}function l(h){return h===45?(e.consume(h),c):h===91?(e.consume(h),o=0,p):de(h)?(e.consume(h),S):n(h)}function c(h){return h===45?(e.consume(h),f):n(h)}function d(h){return h===null?n(h):h===45?(e.consume(h),m):D(h)?(s=d,ce(h)):(e.consume(h),d)}function m(h){return h===45?(e.consume(h),f):d(h)}function f(h){return h===62?ie(h):h===45?m(h):d(h)}function p(h){let Ke="CDATA[";return h===Ke.charCodeAt(o++)?(e.consume(h),o===Ke.length?w:p):n(h)}function w(h){return h===null?n(h):h===93?(e.consume(h),C):D(h)?(s=w,ce(h)):(e.consume(h),w)}function C(h){return h===93?(e.consume(h),b):w(h)}function b(h){return h===62?ie(h):h===93?(e.consume(h),b):w(h)}function S(h){return h===null||h===62?ie(h):D(h)?(s=S,ce(h)):(e.consume(h),S)}function k(h){return h===null?n(h):h===63?(e.consume(h),I):D(h)?(s=k,ce(h)):(e.consume(h),k)}function I(h){return h===62?ie(h):k(h)}function A(h){return de(h)?(e.consume(h),x):n(h)}function x(h){return h===45||me(h)?(e.consume(h),x):v(h)}function v(h){return D(h)?(s=v,ce(h)):R(h)?(e.consume(h),v):ie(h)}function P(h){return h===45||me(h)?(e.consume(h),P):h===47||h===62||z(h)?M(h):n(h)}function M(h){return h===47?(e.consume(h),ie):h===58||h===95||de(h)?(e.consume(h),y):D(h)?(s=M,ce(h)):R(h)?(e.consume(h),M):ie(h)}function y(h){return h===45||h===46||h===58||h===95||me(h)?(e.consume(h),y):re(h)}function re(h){return h===61?(e.consume(h),H):D(h)?(s=re,ce(h)):R(h)?(e.consume(h),re):M(h)}function H(h){return h===null||h===60||h===61||h===62||h===96?n(h):h===34||h===39?(e.consume(h),i=h,_):D(h)?(s=H,ce(h)):R(h)?(e.consume(h),H):(e.consume(h),F)}function _(h){return h===i?(e.consume(h),i=void 0,$):h===null?n(h):D(h)?(s=_,ce(h)):(e.consume(h),_)}function F(h){return h===null||h===34||h===39||h===60||h===61||h===96?n(h):h===47||h===62||z(h)?M(h):(e.consume(h),F)}function $(h){return h===47||h===62||z(h)?M(h):n(h)}function ie(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),t):n(h)}function ce(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ut}function ut(h){return R(h)?N(e,wt,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):wt(h)}function wt(h){return e.enter("htmlTextData"),s(h)}}var Un={name:"labelEnd",resolveAll:mb,resolveTo:fb,tokenize:pb},lb={tokenize:hb},cb={tokenize:gb},db={tokenize:yb};function mb(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){let i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ue(e,0,e.length,n),e}function fb(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);let u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},c={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",u,t],["enter",l,t]],a=Ne(a,e.slice(o+1,o+r+3)),a=Ne(a,[["enter",c,t]]),a=Ne(a,cn(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=Ne(a,[["exit",c,t],e[s-2],e[s-1],["exit",l,t]]),a=Ne(a,e.slice(s+1)),a=Ne(a,[["exit",u,t]]),ue(e,o,e.length,a),e}function pb(e,t,n){let r=this,i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(m){return o?o._inactive?d(m):(s=r.parser.defined.includes(De(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),u):n(m)}function u(m){return m===40?e.attempt(lb,c,s?c:d)(m):m===91?e.attempt(cb,c,s?l:d)(m):s?c(m):d(m)}function l(m){return e.attempt(db,c,d)(m)}function c(m){return t(m)}function d(m){return o._balanced=!0,n(m)}}function hb(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return z(d)?Bn(e,o)(d):o(d)}function o(d){return d===41?c(d):ls(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return z(d)?Bn(e,u)(d):c(d)}function a(d){return n(d)}function u(d){return d===34||d===39||d===40?ds(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):c(d)}function l(d){return z(d)?Bn(e,c)(d):c(d)}function c(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function gb(e,t,n){let r=this;return i;function i(a){return cs.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(De(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function yb(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}var Xa={name:"labelStartImage",resolveAll:Un.resolveAll,tokenize:xb};function xb(e,t,n){let r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}var Qa={name:"labelStartLink",resolveAll:Un.resolveAll,tokenize:bb};function bb(e,t,n){let r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}var Ci={name:"lineEnding",tokenize:wb};function wb(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),N(e,t,"linePrefix")}}var qn={name:"thematicBreak",tokenize:Tb};function Tb(e,t,n){let r=0,i;return o;function o(l){return e.enter("thematicBreak"),s(l)}function s(l){return i=l,a(l)}function a(l){return l===i?(e.enter("thematicBreakSequence"),u(l)):r>=3&&(l===null||D(l))?(e.exit("thematicBreak"),t(l)):n(l)}function u(l){return l===i?(e.consume(l),r++,u):(e.exit("thematicBreakSequence"),R(l)?N(e,a,"whitespace")(l):a(l))}}var _e={continuation:{tokenize:Eb},exit:Ab,name:"list",tokenize:Cb},kb={partial:!0,tokenize:Db},Sb={partial:!0,tokenize:Ib};function Cb(e,t,n){let r=this,i=r.events[r.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(f){let p=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:wi(f)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(qn,n,l)(f):l(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(f)}return n(f)}function u(f){return wi(f)&&++s<10?(e.consume(f),u):(!r.interrupt||s<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),l(f)):n(f)}function l(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(St,r.interrupt?n:c,e.attempt(kb,m,d))}function c(f){return r.containerState.initialBlankLine=!0,o++,m(f)}function d(f){return R(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),m):n(f)}function m(f){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function Eb(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(St,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,N(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!R(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Sb,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,N(e,e.attempt(_e,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Ib(e,t,n){let r=this;return N(e,i,"listItemIndent",r.containerState.size+1);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Ab(e){e.exit(this.containerState.type)}function Db(e,t,n){let r=this;return N(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=r.events[r.events.length-1];return!R(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}var ms={name:"setextUnderline",resolveTo:_b,tokenize:Ob};function _b(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);let s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Ob(e,t,n){let r=this,i;return o;function o(l){let c=r.events.length,d;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){d=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=l,s(l)):n(l)}function s(l){return e.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(e.consume(l),a):(e.exit("setextHeadingLineSequence"),R(l)?N(e,u,"lineSuffix")(l):u(l))}function u(l){return l===null||D(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}var em={tokenize:vb};function vb(e){let t=this,n=e.attempt(St,r,e.attempt(this.parser.constructs.flowInitial,i,N(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ja,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var tm={resolveAll:om()},nm=im("string"),rm=im("text");function im(e){return{resolveAll:om(e==="text"?Mb:void 0),tokenize:t};function t(n){let r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(c){return l(c)?o(c):a(c)}function a(c){if(c===null){n.consume(c);return}return n.enter("data"),n.consume(c),u}function u(c){return l(c)?(n.exit("data"),o(c)):(n.consume(c),u)}function l(c){if(c===null)return!0;let d=i[c],m=-1;if(d)for(;++m<d.length;){let f=d[m];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function om(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Mb(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){let r=e[n-1][1],i=t.sliceStream(r),o=i.length,s=-1,a=0,u;for(;o--;){let l=i[o];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(l===-2)u=!0,a++;else if(l!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){let l={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}var eu={};fd(eu,{attentionMarkers:()=>Bb,contentInitial:()=>Pb,disable:()=>Ub,document:()=>Nb,flow:()=>Fb,flowInitial:()=>Rb,insideSpan:()=>zb,string:()=>Lb,text:()=>$b});var Nb={42:_e,43:_e,45:_e,48:_e,49:_e,50:_e,51:_e,52:_e,53:_e,54:_e,55:_e,56:_e,57:_e,62:rs},Pb={91:Va},Rb={[-2]:ki,[-1]:ki,32:ki},Fb={35:Ya,42:qn,45:[ms,qn],60:Ka,61:ms,95:qn,96:ss,126:ss},Lb={38:os,92:is},$b={[-5]:Ci,[-4]:Ci,[-3]:Ci,33:Xa,38:os,42:Ti,60:[Ha,Ja],91:Qa,92:[Ga,is],93:Un,95:Ti,96:Wa},zb={null:[Ti,tm]},Bb={null:[42,95]},Ub={null:[]};function sm(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},o=[],s=[],a=[],u=!0,l={attempt:M(v),check:M(P),consume:I,enter:A,exit:x,interrupt:M(P,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:C,parser:e,previous:null,sliceSerialize:p,sliceStream:w,write:f},d=t.tokenize.call(c,l),m;return t.resolveAll&&o.push(t),c;function f(_){return s=Ne(s,_),S(),s[s.length-1]!==null?[]:(y(t,0),c.events=cn(o,c.events,c),c.events)}function p(_,F){return Hb(w(_),F)}function w(_){return qb(s,_)}function C(){let{_bufferIndex:_,_index:F,line:$,column:ie,offset:ce}=r;return{_bufferIndex:_,_index:F,line:$,column:ie,offset:ce}}function b(_){i[_.line]=_.column,H()}function S(){let _;for(;r._index<s.length;){let F=s[r._index];if(typeof F=="string")for(_=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===_&&r._bufferIndex<F.length;)k(F.charCodeAt(r._bufferIndex));else k(F)}}function k(_){u=void 0,m=_,d=d(_)}function I(_){D(_)?(r.line++,r.column=1,r.offset+=_===-3?2:1,H()):_!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=_,u=!0}function A(_,F){let $=F||{};return $.type=_,$.start=C(),c.events.push(["enter",$,c]),a.push($),$}function x(_){let F=a.pop();return F.end=C(),c.events.push(["exit",F,c]),F}function v(_,F){y(_,F.from)}function P(_,F){F.restore()}function M(_,F){return $;function $(ie,ce,ut){let wt,h,Ke,$t;return Array.isArray(ie)?He(ie):"tokenize"in ie?He([ie]):g(ie);function g(ke){return mi;function mi(zt){let Rn=zt!==null&&ke[zt],wr=zt!==null&&ke.null,Ia=[...Array.isArray(Rn)?Rn:Rn?[Rn]:[],...Array.isArray(wr)?wr:wr?[wr]:[]];return He(Ia)(zt)}}function He(ke){return wt=ke,h=0,ke.length===0?ut:Pn(ke[h])}function Pn(ke){return mi;function mi(zt){return $t=re(),Ke=ke,ke.partial||(c.currentConstruct=ke),ke.name&&c.parser.constructs.disable.null.includes(ke.name)?jo(zt):ke.tokenize.call(F?Object.assign(Object.create(c),F):c,l,Ea,jo)(zt)}}function Ea(ke){return u=!0,_(Ke,$t),ce}function jo(ke){return u=!0,$t.restore(),++h<wt.length?Pn(wt[h]):ut}}}function y(_,F){_.resolveAll&&!o.includes(_)&&o.push(_),_.resolve&&ue(c.events,F,c.events.length-F,_.resolve(c.events.slice(F),c)),_.resolveTo&&(c.events=_.resolveTo(c.events,c))}function re(){let _=C(),F=c.previous,$=c.currentConstruct,ie=c.events.length,ce=Array.from(a);return{from:ie,restore:ut};function ut(){r=_,c.previous=F,c.currentConstruct=$,c.events.length=ie,a=ce,H()}}function H(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function qb(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex,s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Hb(e,t){let n=-1,r=[],i;for(;++n<e.length;){let o=e[n],s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
55
|
+
`);return}let r;try{let a=await fetch(new Request(ip,{signal:AbortSignal.timeout(3e4)}));if(!a.ok)throw new Error(`HTTP ${a.status}`);r=await a.text()}catch{throw new $("network_error",`Could not download Ripple's installer from ${ip}. Check your network connection.`)}let i=!!e.opts().json,o="";if(await new Promise((a,u)=>{let l=Sb("sh",[],{env:{...t.env,RIPPLE_INSTALL_DIR:ku.dirname(bu(process.execPath))},stdio:["pipe",i?"ignore":"inherit",i?"pipe":"inherit"]});l.stderr?.on("data",d=>{o+=d.toString()}),l.on("error",u),l.on("close",a),l.stdin.end(r)})!==0)throw new $("update_failed",/^Error: (.+)$/m.exec(o)?.[1]??"Ripple wasn't updated.");t.print({installedWith:n},()=>"")})}import{writeFile as BC}from"node:fs/promises";import qC from"node:path";var Su={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
|
|
56
|
+
`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"};var vb={}.hasOwnProperty;function _r(e){return vb.call(Su,e)?Su[e]:!1}function xs(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}var Mb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bs(e){return e.replace(Mb,Nb)}function Nb(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let i=n.charCodeAt(1),o=i===120||i===88;return xs(n.slice(o?2:1),o?16:10)}return _r(n)||e}var Rb={};function Tu(e,t){let n=t||Rb,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return mp(e,r,i)}function mp(e,t,n){if(Pb(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return dp(e.children,t,n)}return Array.isArray(e)?dp(e,t,n):""}function dp(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=mp(e[i],t,n);return r.join("")}function Pb(e){return!!(e&&typeof e=="object")}function me(e,t,n,r){let i=e.length,o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Le(e,t){return e.length>0?(me(e,e.length,0,t),e):t}var pp={}.hasOwnProperty;function ks(e){let t={},n=-1;for(;++n<e.length;)Lb(t,e[n]);return t}function Lb(e,t){let n;for(n in t){let i=(pp.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n],s;if(o)for(s in o){pp.call(i,s)||(i[s]=[]);let a=o[s];Fb(i[s],Array.isArray(a)?a:a?[a]:[])}}}function Fb(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);me(e,0,0,r)}function Oe(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var fe=pn(/[A-Za-z]/),he=pn(/[\dA-Za-z]/),fp=pn(/[#-'*+\--9=?A-Z^-~]/);function Wn(e){return e!==null&&(e<32||e===127)}var _i=pn(/\d/),hp=pn(/[\dA-Fa-f]/),gp=pn(/[!-/:-@[-`{-~]/);function A(e){return e!==null&&e<-2}function q(e){return e!==null&&(e<0||e===32)}function L(e){return e===-2||e===-1||e===32}var Gn=pn(new RegExp("\\p{P}|\\p{S}","u")),Tt=pn(/\s/);function pn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function P(e,t,n,r){let i=r?r-1:Number.POSITIVE_INFINITY,o=0;return s;function s(u){return L(u)?(e.enter(n),a(u)):t(u)}function a(u){return L(u)&&o++<i?(e.consume(u),a):(e.exit(n),t(u))}}var yp={tokenize:$b};function $b(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),P(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){let u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return A(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}var xp={tokenize:Ub},wp={tokenize:zb};function Ub(e){let t=this,n=[],r=0,i,o,s;return a;function a(T){if(r<n.length){let M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,u,l)(T)}return l(T)}function u(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&D();let M=t.events.length,O=M,b;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){b=t.events[O][1].end;break}w(r);let C=M;for(;C<t.events.length;)t.events[C][1].end={...b},C++;return me(t.events,O+1,0,t.events.slice(M)),t.events.length=C,l(T)}return a(T)}function l(T){if(r===n.length){if(!i)return m(T);if(i.currentConstruct&&i.currentConstruct.concrete)return f(T);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(wp,d,c)(T)}function d(T){return i&&D(),w(r),m(T)}function c(T){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,f(T)}function m(T){return t.containerState={},e.attempt(wp,p,f)(T)}function p(T){return r++,n.push([t.currentConstruct,t.containerState]),m(T)}function f(T){if(T===null){i&&D(),w(0),e.consume(T);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),x(T)}function x(T){if(T===null){S(e.exit("chunkFlow"),!0),w(0),e.consume(T);return}return A(T)?(e.consume(T),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(T),x)}function S(T,M){let O=t.sliceStream(T);if(M&&O.push(null),T.previous=o,o&&(o.next=T),o=T,i.defineSkip(T.start),i.write(O),t.parser.lazy[T.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<s&&(!i.events[b][1].end||i.events[b][1].end.offset>s))return;let C=t.events.length,N=C,E,y;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){if(E){y=t.events[N][1].end;break}E=!0}for(w(r),b=C;b<t.events.length;)t.events[b][1].end={...y},b++;me(t.events,N+1,0,t.events.slice(C)),t.events.length=b}}function w(T){let M=n.length;for(;M-- >T;){let O=n[M];t.containerState=O[1],O[0].exit.call(t,e)}n.length=T}function D(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function zb(e,t,n){return P(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Or(e){if(e===null||q(e)||Tt(e))return 1;if(Gn(e))return 2}function fn(e,t,n){let r=[],i=-1;for(;++i<e.length;){let o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}var Oi={name:"attention",resolveAll:Bb,tokenize:qb};function Bb(e,t){let n=-1,r,i,o,s,a,u,l,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let c={...e[r][1].end},m={...e[n][1].start};bp(c,-u),bp(m,u),s={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Le(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=Le(l,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),l=Le(l,fn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Le(l,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,l=Le(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,me(e,r-1,n-r+3,l),n=r+l.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function qb(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Or(r),o;return s;function s(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;let l=e.exit("attentionSequence"),d=Or(u),c=!d||d===2&&i||n.includes(u),m=!i||i===2&&d||n.includes(r);return l._open=!!(o===42?c:c&&(i||!m)),l._close=!!(o===42?m:m&&(d||!c)),t(u)}}function bp(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Cu={name:"autolink",tokenize:jb};function jb(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return fe(p)?(e.consume(p),s):p===64?n(p):l(p)}function s(p){return p===43||p===45||p===46||he(p)?(r=1,a(p)):l(p)}function a(p){return p===58?(e.consume(p),r=0,u):(p===43||p===45||p===46||he(p))&&r++<32?(e.consume(p),a):(r=0,l(p))}function u(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Wn(p)?n(p):(e.consume(p),u)}function l(p){return p===64?(e.consume(p),d):fp(p)?(e.consume(p),l):n(p)}function d(p){return he(p)?c(p):n(p)}function c(p){return p===46?(e.consume(p),r=0,d):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):m(p)}function m(p){if((p===45||he(p))&&r++<63){let f=p===45?m:c;return e.consume(p),f}return n(p)}}var Ct={partial:!0,tokenize:Hb};function Hb(e,t,n){return r;function r(o){return L(o)?P(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||A(o)?t(o):n(o)}}var Ss={continuation:{tokenize:Gb},exit:Vb,name:"blockQuote",tokenize:Wb};function Wb(e,t,n){let r=this;return i;function i(s){if(s===62){let a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return L(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Gb(e,t,n){let r=this;return i;function i(s){return L(s)?P(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Ss,t,n)(s)}}function Vb(e){e.exit("blockQuote")}var Ts={name:"characterEscape",tokenize:Yb};function Yb(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return gp(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}var Cs={name:"characterReference",tokenize:Zb};function Zb(e,t,n){let r=this,i=0,o,s;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),o=31,s=he,d(c))}function l(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=hp,d):(e.enter("characterReferenceValue"),o=7,s=_i,d(c))}function d(c){if(c===59&&i){let m=e.exit("characterReferenceValue");return s===he&&!_r(r.sliceSerialize(m))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(c)&&i++<o?(e.consume(c),d):n(c)}}var kp={partial:!0,tokenize:Jb},Es={concrete:!0,name:"codeFenced",tokenize:Kb};function Kb(e,t,n){let r=this,i={partial:!0,tokenize:O},o=0,s=0,a;return u;function u(b){return l(b)}function l(b){let C=r.events[r.events.length-1];return o=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(b)}function d(b){return b===a?(s++,e.consume(b),d):s<3?n(b):(e.exit("codeFencedFenceSequence"),L(b)?P(e,c,"whitespace")(b):c(b))}function c(b){return b===null||A(b)?(e.exit("codeFencedFence"),r.interrupt?t(b):e.check(kp,x,M)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||A(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(b)):L(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),P(e,p,"whitespace")(b)):b===96&&b===a?n(b):(e.consume(b),m)}function p(b){return b===null||A(b)?c(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(b))}function f(b){return b===null||A(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(b)):b===96&&b===a?n(b):(e.consume(b),f)}function x(b){return e.attempt(i,M,S)(b)}function S(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),w}function w(b){return o>0&&L(b)?P(e,D,"linePrefix",o+1)(b):D(b)}function D(b){return b===null||A(b)?e.check(kp,x,M)(b):(e.enter("codeFlowValue"),T(b))}function T(b){return b===null||A(b)?(e.exit("codeFlowValue"),D(b)):(e.consume(b),T)}function M(b){return e.exit("codeFenced"),t(b)}function O(b,C,N){let E=0;return y;function y(U){return b.enter("lineEnding"),b.consume(U),b.exit("lineEnding"),Z}function Z(U){return b.enter("codeFencedFence"),L(U)?P(b,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):F(U)}function F(U){return U===a?(b.enter("codeFencedFenceSequence"),_(U)):N(U)}function _(U){return U===a?(E++,b.consume(U),_):E>=s?(b.exit("codeFencedFenceSequence"),L(U)?P(b,R,"whitespace")(U):R(U)):N(U)}function R(U){return U===null||A(U)?(b.exit("codeFencedFence"),C(U)):N(U)}}}function Jb(e,t,n){let r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}var Di={name:"codeIndented",tokenize:Qb},Xb={partial:!0,tokenize:ek};function Qb(e,t,n){let r=this;return i;function i(l){return e.enter("codeIndented"),P(e,o,"linePrefix",5)(l)}function o(l){let d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(l):n(l)}function s(l){return l===null?u(l):A(l)?e.attempt(Xb,s,u)(l):(e.enter("codeFlowValue"),a(l))}function a(l){return l===null||A(l)?(e.exit("codeFlowValue"),s(l)):(e.consume(l),a)}function u(l){return e.exit("codeIndented"),t(l)}}function ek(e,t,n){let r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):A(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):P(e,o,"linePrefix",5)(s)}function o(s){let a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):A(s)?i(s):n(s)}}var Eu={name:"codeText",previous:nk,resolve:tk,tokenize:rk};function tk(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function nk(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function rk(e,t,n){let r=this,i=0,o,s;return a;function a(m){return e.enter("codeText"),e.enter("codeTextSequence"),u(m)}function u(m){return m===96?(e.consume(m),i++,u):(e.exit("codeTextSequence"),l(m))}function l(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),l):m===96?(s=e.enter("codeTextSequence"),o=0,c(m)):A(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),l):(e.enter("codeTextData"),d(m))}function d(m){return m===null||m===32||m===96||A(m)?(e.exit("codeTextData"),l(m)):(e.consume(m),d)}function c(m){return m===96?(e.consume(m),o++,c):o===i?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(s.type="codeTextData",d(m))}}var Is=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){let r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){let i=n||0;this.setCursor(Math.trunc(t));let o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&vi(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),vi(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),vi(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let n=this.left.splice(t,Number.POSITIVE_INFINITY);vi(this.right,n.reverse())}else{let n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);vi(this.left,n.reverse())}}};function vi(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function As(e){let t={},n=-1,r,i,o,s,a,u,l,d=new Is(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,ik(d,n)),n=t[n],l=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=d.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},a=d.slice(i,n),a.unshift(r),d.splice(i,n-i+1,a))}}return me(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!l}function ik(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,o=[],s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let a=s.events,u=[],l={},d,c,m=-1,p=n,f=0,x=0,S=[x];for(;p;){for(;e.get(++i)[1]!==p;);o.push(i),p._tokenizer||(d=r.sliceStream(p),p.next||d.push(null),c&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),c=p,p=p.next}for(p=n;++m<a.length;)a[m][0]==="exit"&&a[m-1][0]==="enter"&&a[m][1].type===a[m-1][1].type&&a[m][1].start.line!==a[m][1].end.line&&(x=m+1,S.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):S.pop(),m=S.length;m--;){let w=a.slice(S[m],S[m+1]),D=o.pop();u.push([D,D+w.length-1]),e.splice(D,2,w)}for(u.reverse(),m=-1;++m<u.length;)l[f+u[m][0]]=f+u[m][1],f+=u[m][1]-u[m][0]-1;return l}var Iu={resolve:sk,tokenize:ak},ok={partial:!0,tokenize:uk};function sk(e){return As(e),e}function ak(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):A(a)?e.check(ok,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function uk(e,t,n){let r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),P(e,o,"linePrefix")}function o(s){if(s===null||A(s))return n(s);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function _s(e,t,n,r,i,o,s,a,u){let l=u||Number.POSITIVE_INFINITY,d=0;return c;function c(w){return w===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(w),e.exit(o),m):w===null||w===32||w===41||Wn(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),x(w))}function m(w){return w===62?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(a),m(w)):w===null||w===60||A(w)?n(w):(e.consume(w),w===92?f:p)}function f(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function x(w){return!d&&(w===null||w===41||q(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):d<l&&w===40?(e.consume(w),d++,x):w===41?(e.consume(w),d--,x):w===null||w===32||w===40||Wn(w)?n(w):(e.consume(w),w===92?S:x)}function S(w){return w===40||w===41||w===92?(e.consume(w),x):x(w)}}function Os(e,t,n,r,i,o){let s=this,a=0,u;return l;function l(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),d}function d(p){return a>999||p===null||p===91||p===93&&!u||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):A(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),c(p))}function c(p){return p===null||p===91||p===93||A(p)||a++>999?(e.exit("chunkString"),d(p)):(e.consume(p),u||(u=!L(p)),p===92?m:c)}function m(p){return p===91||p===92||p===93?(e.consume(p),a++,c):c(p)}}function Ds(e,t,n,r,i,o){let s;return a;function a(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),s=m===40?41:m,u):n(m)}function u(m){return m===s?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(o),l(m))}function l(m){return m===s?(e.exit(o),u(s)):m===null?n(m):A(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),P(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===s||m===null||A(m)?(e.exit("chunkString"),l(m)):(e.consume(m),m===92?c:d)}function c(m){return m===s||m===92?(e.consume(m),d):d(m)}}function Vn(e,t){let n;return r;function r(i){return A(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):L(i)?P(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}var Au={name:"definition",tokenize:ck},lk={partial:!0,tokenize:dk};function ck(e,t,n){let r=this,i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return Os.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Oe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),u):n(p)}function u(p){return q(p)?Vn(e,l)(p):l(p)}function l(p){return _s(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function d(p){return e.attempt(lk,c,c)(p)}function c(p){return L(p)?P(e,m,"whitespace")(p):m(p)}function m(p){return p===null||A(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function dk(e,t,n){return r;function r(a){return q(a)?Vn(e,i)(a):n(a)}function i(a){return Ds(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return L(a)?P(e,s,"whitespace")(a):s(a)}function s(a){return a===null||A(a)?t(a):n(a)}}var _u={name:"hardBreakEscape",tokenize:mk};function mk(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return A(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}var Ou={name:"headingAtx",resolve:pk,tokenize:fk};function pk(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},me(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function fk(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),o(d)}function o(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&r++<6?(e.consume(d),s):d===null||q(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||A(d)?(e.exit("atxHeading"),t(d)):L(d)?P(e,a,"whitespace")(d):(e.enter("atxHeadingText"),l(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),a(d))}function l(d){return d===null||d===35||q(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),l)}}var Sp=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Du=["pre","script","style","textarea"];var vu={concrete:!0,name:"htmlFlow",resolveTo:yk,tokenize:wk},hk={partial:!0,tokenize:bk},gk={partial:!0,tokenize:xk};function yk(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function wk(e,t,n){let r=this,i,o,s,a,u;return l;function l(g){return d(g)}function d(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),m):g===47?(e.consume(g),o=!0,x):g===63?(e.consume(g),i=3,r.interrupt?t:h):fe(g)?(e.consume(g),s=String.fromCharCode(g),S):n(g)}function m(g){return g===45?(e.consume(g),i=2,p):g===91?(e.consume(g),i=5,a=0,f):fe(g)?(e.consume(g),i=4,r.interrupt?t:h):n(g)}function p(g){return g===45?(e.consume(g),r.interrupt?t:h):n(g)}function f(g){let Ge="CDATA[";return g===Ge.charCodeAt(a++)?(e.consume(g),a===Ge.length?r.interrupt?t:F:f):n(g)}function x(g){return fe(g)?(e.consume(g),s=String.fromCharCode(g),S):n(g)}function S(g){if(g===null||g===47||g===62||q(g)){let Ge=g===47,Fn=s.toLowerCase();return!Ge&&!o&&Du.includes(Fn)?(i=1,r.interrupt?t(g):F(g)):Sp.includes(s.toLowerCase())?(i=6,Ge?(e.consume(g),w):r.interrupt?t(g):F(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):o?D(g):T(g))}return g===45||he(g)?(e.consume(g),s+=String.fromCharCode(g),S):n(g)}function w(g){return g===62?(e.consume(g),r.interrupt?t:F):n(g)}function D(g){return L(g)?(e.consume(g),D):y(g)}function T(g){return g===47?(e.consume(g),y):g===58||g===95||fe(g)?(e.consume(g),M):L(g)?(e.consume(g),T):y(g)}function M(g){return g===45||g===46||g===58||g===95||he(g)?(e.consume(g),M):O(g)}function O(g){return g===61?(e.consume(g),b):L(g)?(e.consume(g),O):T(g)}function b(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),u=g,C):L(g)?(e.consume(g),b):N(g)}function C(g){return g===u?(e.consume(g),u=null,E):g===null||A(g)?n(g):(e.consume(g),C)}function N(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||q(g)?O(g):(e.consume(g),N)}function E(g){return g===47||g===62||L(g)?T(g):n(g)}function y(g){return g===62?(e.consume(g),Z):n(g)}function Z(g){return g===null||A(g)?F(g):L(g)?(e.consume(g),Z):n(g)}function F(g){return g===45&&i===2?(e.consume(g),te):g===60&&i===1?(e.consume(g),oe):g===62&&i===4?(e.consume(g),Qe):g===63&&i===3?(e.consume(g),h):g===93&&i===5?(e.consume(g),J):A(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(hk,$t,_)(g)):g===null||A(g)?(e.exit("htmlFlowData"),_(g)):(e.consume(g),F)}function _(g){return e.check(gk,R,$t)(g)}function R(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),U}function U(g){return g===null||A(g)?_(g):(e.enter("htmlFlowData"),F(g))}function te(g){return g===45?(e.consume(g),h):F(g)}function oe(g){return g===47?(e.consume(g),s="",Re):F(g)}function Re(g){if(g===62){let Ge=s.toLowerCase();return Du.includes(Ge)?(e.consume(g),Qe):F(g)}return fe(g)&&s.length<8?(e.consume(g),s+=String.fromCharCode(g),Re):F(g)}function J(g){return g===93?(e.consume(g),h):F(g)}function h(g){return g===62?(e.consume(g),Qe):g===45&&i===2?(e.consume(g),h):F(g)}function Qe(g){return g===null||A(g)?(e.exit("htmlFlowData"),$t(g)):(e.consume(g),Qe)}function $t(g){return e.exit("htmlFlow"),t(g)}}function xk(e,t,n){let r=this;return i;function i(s){return A(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function bk(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ct,t,n)}}var Mu={name:"htmlText",tokenize:kk};function kk(e,t,n){let r=this,i,o,s;return a;function a(h){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(h),u}function u(h){return h===33?(e.consume(h),l):h===47?(e.consume(h),O):h===63?(e.consume(h),T):fe(h)?(e.consume(h),N):n(h)}function l(h){return h===45?(e.consume(h),d):h===91?(e.consume(h),o=0,f):fe(h)?(e.consume(h),D):n(h)}function d(h){return h===45?(e.consume(h),p):n(h)}function c(h){return h===null?n(h):h===45?(e.consume(h),m):A(h)?(s=c,oe(h)):(e.consume(h),c)}function m(h){return h===45?(e.consume(h),p):c(h)}function p(h){return h===62?te(h):h===45?m(h):c(h)}function f(h){let Qe="CDATA[";return h===Qe.charCodeAt(o++)?(e.consume(h),o===Qe.length?x:f):n(h)}function x(h){return h===null?n(h):h===93?(e.consume(h),S):A(h)?(s=x,oe(h)):(e.consume(h),x)}function S(h){return h===93?(e.consume(h),w):x(h)}function w(h){return h===62?te(h):h===93?(e.consume(h),w):x(h)}function D(h){return h===null||h===62?te(h):A(h)?(s=D,oe(h)):(e.consume(h),D)}function T(h){return h===null?n(h):h===63?(e.consume(h),M):A(h)?(s=T,oe(h)):(e.consume(h),T)}function M(h){return h===62?te(h):T(h)}function O(h){return fe(h)?(e.consume(h),b):n(h)}function b(h){return h===45||he(h)?(e.consume(h),b):C(h)}function C(h){return A(h)?(s=C,oe(h)):L(h)?(e.consume(h),C):te(h)}function N(h){return h===45||he(h)?(e.consume(h),N):h===47||h===62||q(h)?E(h):n(h)}function E(h){return h===47?(e.consume(h),te):h===58||h===95||fe(h)?(e.consume(h),y):A(h)?(s=E,oe(h)):L(h)?(e.consume(h),E):te(h)}function y(h){return h===45||h===46||h===58||h===95||he(h)?(e.consume(h),y):Z(h)}function Z(h){return h===61?(e.consume(h),F):A(h)?(s=Z,oe(h)):L(h)?(e.consume(h),Z):E(h)}function F(h){return h===null||h===60||h===61||h===62||h===96?n(h):h===34||h===39?(e.consume(h),i=h,_):A(h)?(s=F,oe(h)):L(h)?(e.consume(h),F):(e.consume(h),R)}function _(h){return h===i?(e.consume(h),i=void 0,U):h===null?n(h):A(h)?(s=_,oe(h)):(e.consume(h),_)}function R(h){return h===null||h===34||h===39||h===60||h===61||h===96?n(h):h===47||h===62||q(h)?E(h):(e.consume(h),R)}function U(h){return h===47||h===62||q(h)?E(h):n(h)}function te(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),t):n(h)}function oe(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Re}function Re(h){return L(h)?P(e,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):J(h)}function J(h){return e.enter("htmlTextData"),s(h)}}var Yn={name:"labelEnd",resolveAll:Ek,resolveTo:Ik,tokenize:Ak},Sk={tokenize:_k},Tk={tokenize:Ok},Ck={tokenize:Dk};function Ek(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){let i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&me(e,0,e.length,n),e}function Ik(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);let u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",u,t],["enter",l,t]],a=Le(a,e.slice(o+1,o+r+3)),a=Le(a,[["enter",d,t]]),a=Le(a,fn(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=Le(a,[["exit",d,t],e[s-2],e[s-1],["exit",l,t]]),a=Le(a,e.slice(s+1)),a=Le(a,[["exit",u,t]]),me(e,o,e.length,a),e}function Ak(e,t,n){let r=this,i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(m){return o?o._inactive?c(m):(s=r.parser.defined.includes(Oe(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),u):n(m)}function u(m){return m===40?e.attempt(Sk,d,s?d:c)(m):m===91?e.attempt(Tk,d,s?l:c)(m):s?d(m):c(m)}function l(m){return e.attempt(Ck,d,c)(m)}function d(m){return t(m)}function c(m){return o._balanced=!0,n(m)}}function _k(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return q(c)?Vn(e,o)(c):o(c)}function o(c){return c===41?d(c):_s(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return q(c)?Vn(e,u)(c):d(c)}function a(c){return n(c)}function u(c){return c===34||c===39||c===40?Ds(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):d(c)}function l(c){return q(c)?Vn(e,d)(c):d(c)}function d(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function Ok(e,t,n){let r=this;return i;function i(a){return Os.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Oe(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Dk(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}var Nu={name:"labelStartImage",resolveAll:Yn.resolveAll,tokenize:vk};function vk(e,t,n){let r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}var Ru={name:"labelStartLink",resolveAll:Yn.resolveAll,tokenize:Mk};function Mk(e,t,n){let r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}var Mi={name:"lineEnding",tokenize:Nk};function Nk(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),P(e,t,"linePrefix")}}var Zn={name:"thematicBreak",tokenize:Rk};function Rk(e,t,n){let r=0,i;return o;function o(l){return e.enter("thematicBreak"),s(l)}function s(l){return i=l,a(l)}function a(l){return l===i?(e.enter("thematicBreakSequence"),u(l)):r>=3&&(l===null||A(l))?(e.exit("thematicBreak"),t(l)):n(l)}function u(l){return l===i?(e.consume(l),r++,u):(e.exit("thematicBreakSequence"),L(l)?P(e,a,"whitespace")(l):a(l))}}var De={continuation:{tokenize:$k},exit:zk,name:"list",tokenize:Fk},Pk={partial:!0,tokenize:Bk},Lk={partial:!0,tokenize:Uk};function Fk(e,t,n){let r=this,i=r.events[r.events.length-1],o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(p){let f=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(f==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:_i(p)){if(r.containerState.type||(r.containerState.type=f,e.enter(f,{_container:!0})),f==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Zn,n,l)(p):l(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(p)}return n(p)}function u(p){return _i(p)&&++s<10?(e.consume(p),u):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),l(p)):n(p)}function l(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Ct,r.interrupt?n:d,e.attempt(Pk,m,c))}function d(p){return r.containerState.initialBlankLine=!0,o++,m(p)}function c(p){return L(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function $k(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Ct,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,P(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!L(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Lk,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,P(e,e.attempt(De,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Uk(e,t,n){let r=this;return P(e,i,"listItemIndent",r.containerState.size+1);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function zk(e){e.exit(this.containerState.type)}function Bk(e,t,n){let r=this;return P(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){let s=r.events[r.events.length-1];return!L(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}var vs={name:"setextUnderline",resolveTo:qk,tokenize:jk};function qk(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);let s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function jk(e,t,n){let r=this,i;return o;function o(l){let d=r.events.length,c;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){c=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=l,s(l)):n(l)}function s(l){return e.enter("setextHeadingLineSequence"),a(l)}function a(l){return l===i?(e.consume(l),a):(e.exit("setextHeadingLineSequence"),L(l)?P(e,u,"lineSuffix")(l):u(l))}function u(l){return l===null||A(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}var Tp={tokenize:Hk};function Hk(e){let t=this,n=e.attempt(Ct,r,e.attempt(this.parser.constructs.flowInitial,i,P(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Iu,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var Cp={resolveAll:_p()},Ep=Ap("string"),Ip=Ap("text");function Ap(e){return{resolveAll:_p(e==="text"?Wk:void 0),tokenize:t};function t(n){let r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(d){return l(d)?o(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return l(d)?(n.exit("data"),o(d)):(n.consume(d),u)}function l(d){if(d===null)return!0;let c=i[d],m=-1;if(c)for(;++m<c.length;){let p=c[m];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function _p(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Wk(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){let r=e[n-1][1],i=t.sliceStream(r),o=i.length,s=-1,a=0,u;for(;o--;){let l=i[o];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(l===-2)u=!0,a++;else if(l!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){let l={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}var Pu={};Gd(Pu,{attentionMarkers:()=>Qk,contentInitial:()=>Vk,disable:()=>e0,document:()=>Gk,flow:()=>Zk,flowInitial:()=>Yk,insideSpan:()=>Xk,string:()=>Kk,text:()=>Jk});var Gk={42:De,43:De,45:De,48:De,49:De,50:De,51:De,52:De,53:De,54:De,55:De,56:De,57:De,62:Ss},Vk={91:Au},Yk={[-2]:Di,[-1]:Di,32:Di},Zk={35:Ou,42:Zn,45:[vs,Zn],60:vu,61:vs,95:Zn,96:Es,126:Es},Kk={38:Cs,92:Ts},Jk={[-5]:Mi,[-4]:Mi,[-3]:Mi,33:Nu,38:Cs,42:Oi,60:[Cu,Mu],91:Ru,92:[_u,Ts],93:Yn,95:Oi,96:Eu},Xk={null:[Oi,Cp]},Qk={null:[42,95]},e0={null:[]};function Op(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},o=[],s=[],a=[],u=!0,l={attempt:E(C),check:E(N),consume:M,enter:O,exit:b,interrupt:E(N,{interrupt:!0})},d={code:null,containerState:{},defineSkip:w,events:[],now:S,parser:e,previous:null,sliceSerialize:f,sliceStream:x,write:p},c=t.tokenize.call(d,l),m;return t.resolveAll&&o.push(t),d;function p(_){return s=Le(s,_),D(),s[s.length-1]!==null?[]:(y(t,0),d.events=fn(o,d.events,d),d.events)}function f(_,R){return n0(x(_),R)}function x(_){return t0(s,_)}function S(){let{_bufferIndex:_,_index:R,line:U,column:te,offset:oe}=r;return{_bufferIndex:_,_index:R,line:U,column:te,offset:oe}}function w(_){i[_.line]=_.column,F()}function D(){let _;for(;r._index<s.length;){let R=s[r._index];if(typeof R=="string")for(_=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===_&&r._bufferIndex<R.length;)T(R.charCodeAt(r._bufferIndex));else T(R)}}function T(_){u=void 0,m=_,c=c(_)}function M(_){A(_)?(r.line++,r.column=1,r.offset+=_===-3?2:1,F()):_!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=_,u=!0}function O(_,R){let U=R||{};return U.type=_,U.start=S(),d.events.push(["enter",U,d]),a.push(U),U}function b(_){let R=a.pop();return R.end=S(),d.events.push(["exit",R,d]),R}function C(_,R){y(_,R.from)}function N(_,R){R.restore()}function E(_,R){return U;function U(te,oe,Re){let J,h,Qe,$t;return Array.isArray(te)?Ge(te):"tokenize"in te?Ge([te]):g(te);function g(Ce){return hi;function hi(Ut){let $n=Ut!==null&&Ce[Ut],Sr=Ut!==null&&Ce.null,Ua=[...Array.isArray($n)?$n:$n?[$n]:[],...Array.isArray(Sr)?Sr:Sr?[Sr]:[]];return Ge(Ua)(Ut)}}function Ge(Ce){return J=Ce,h=0,Ce.length===0?Re:Fn(Ce[h])}function Fn(Ce){return hi;function hi(Ut){return $t=Z(),Qe=Ce,Ce.partial||(d.currentConstruct=Ce),Ce.name&&d.parser.constructs.disable.null.includes(Ce.name)?Jo(Ut):Ce.tokenize.call(R?Object.assign(Object.create(d),R):d,l,$a,Jo)(Ut)}}function $a(Ce){return u=!0,_(Qe,$t),oe}function Jo(Ce){return u=!0,$t.restore(),++h<J.length?Fn(J[h]):Re}}}function y(_,R){_.resolveAll&&!o.includes(_)&&o.push(_),_.resolve&&me(d.events,R,d.events.length-R,_.resolve(d.events.slice(R),d)),_.resolveTo&&(d.events=_.resolveTo(d.events,d))}function Z(){let _=S(),R=d.previous,U=d.currentConstruct,te=d.events.length,oe=Array.from(a);return{from:te,restore:Re};function Re(){r=_,d.previous=R,d.currentConstruct=U,d.events.length=te,a=oe,F()}}function F(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function t0(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex,s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function n0(e,t){let n=-1,r=[],i;for(;++n<e.length;){let o=e[n],s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
|
|
47
57
|
`;break}case-3:{s=`\r
|
|
48
|
-
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function tu(e){let r={constructs:ts([eu,...(e||{}).extensions||[]]),content:i(Yd),defined:[],document:i(Kd),flow:i(em),lazy:{},string:i(nm),text:i(rm)};return r;function i(o){return s;function s(a){return sm(r,o,a)}}}function nu(e){for(;!us(e););return e}var am=/[\0\t\n\r]/g;function ru(){let e=1,t="",n=!0,r;return i;function i(o,s,a){let u=[],l,c,d,m,f;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(am.lastIndex=d,l=am.exec(o),m=l&&l.index!==void 0?l.index:o.length,f=o.charCodeAt(m),!l){t=o.slice(d);break}if(f===10&&d===m&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),d<m&&(u.push(o.slice(d,m)),e+=m-d),f){case 0:{u.push(65533),e++;break}case 9:{for(c=Math.ceil(e/4)*4,u.push(-2);e++<c;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}d=m+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}var Wb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function fs(e){return e.replace(Wb,jb)}function jb(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let i=n.charCodeAt(1),o=i===120||i===88;return ns(n.slice(o?2:1),o?16:10)}return Er(n)||e}function Ar(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?um(e.position):"start"in e||"end"in e?um(e):"line"in e||"column"in e?iu(e):""}function iu(e){return lm(e&&e.line)+":"+lm(e&&e.column)}function um(e){return iu(e&&e.start)+"-"+iu(e&&e.end)}function lm(e){return e&&typeof e=="number"?e:1}var dm={}.hasOwnProperty;function ou(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),Vb(n)(nu(tu(n).document().write(ru()(e,t,!0))))}function Vb(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(dd),autolinkProtocol:M,autolinkEmail:M,atxHeading:o(ud),blockQuote:o(zt),characterEscape:M,characterReference:M,codeFenced:o(Rn),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(Rn,s),codeText:o(wr,s),codeTextData:M,data:M,codeFlowValue:M,definition:o(Ia),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(wy),hardBreakEscape:o(ld),hardBreakTrailing:o(ld),htmlFlow:o(cd,s),htmlFlowData:M,htmlText:o(cd,s),htmlTextData:M,image:o(Ty),label:s,link:o(dd),listItem:o(ky),listItemValue:m,listOrdered:o(md,d),listUnordered:o(md),paragraph:o(Sy),reference:g,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(ud),strong:o(Cy),thematicBreak:o(Iy)},exit:{atxHeading:u(),atxHeadingSequence:A,autolink:u(),autolinkEmail:mi,autolinkProtocol:ke,blockQuote:u(),characterEscapeValue:y,characterReferenceMarkerHexadecimal:Pn,characterReferenceMarkerNumeric:Pn,characterReferenceValue:Ea,characterReference:jo,codeFenced:u(C),codeFencedFence:w,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:y,codeIndented:u(b),codeText:u($),codeTextData:y,data:y,definition:u(),definitionDestinationString:I,definitionLabelString:S,definitionTitleString:k,emphasis:u(),hardBreakEscape:u(H),hardBreakTrailing:u(H),htmlFlow:u(_),htmlFlowData:y,htmlText:u(F),htmlTextData:y,image:u(ce),label:wt,labelText:ut,lineEnding:re,link:u(ie),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:He,resourceDestinationString:h,resourceTitleString:Ke,resource:$t,setextHeading:u(P),setextHeadingLineSequence:v,setextHeadingText:x,strong:u(),thematicBreak:u()}};mm(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(T){let E={type:"root",children:[]},L={stack:[E],tokenStack:[],config:t,enter:a,exit:l,buffer:s,resume:c,data:n},q=[],J=-1;for(;++J<T.length;)if(T[J][1].type==="listOrdered"||T[J][1].type==="listUnordered")if(T[J][0]==="enter")q.push(J);else{let lt=q.pop();J=i(T,lt,J)}for(J=-1;++J<T.length;){let lt=t[T[J][0]];dm.call(lt,T[J][1].type)&<[T[J][1].type].call(Object.assign({sliceSerialize:T[J][2].sliceSerialize},L),T[J][1])}if(L.tokenStack.length>0){let lt=L.tokenStack[L.tokenStack.length-1];(lt[1]||cm).call(L,void 0,lt[0])}for(E.position={start:dn(T.length>0?T[0][1].start:{line:1,column:1,offset:0}),end:dn(T.length>0?T[T.length-2][1].end:{line:1,column:1,offset:0})},J=-1;++J<t.transforms.length;)E=t.transforms[J](E)||E;return E}function i(T,E,L){let q=E-1,J=-1,lt=!1,Fn,Bt,fi,pi;for(;++q<=L;){let We=T[q];switch(We[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{We[0]==="enter"?J++:J--,pi=void 0;break}case"lineEndingBlank":{We[0]==="enter"&&(Fn&&!pi&&!J&&!fi&&(fi=q),pi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:pi=void 0}if(!J&&We[0]==="enter"&&We[1].type==="listItemPrefix"||J===-1&&We[0]==="exit"&&(We[1].type==="listUnordered"||We[1].type==="listOrdered")){if(Fn){let Tr=q;for(Bt=void 0;Tr--;){let Ut=T[Tr];if(Ut[1].type==="lineEnding"||Ut[1].type==="lineEndingBlank"){if(Ut[0]==="exit")continue;Bt&&(T[Bt][1].type="lineEndingBlank",lt=!0),Ut[1].type="lineEnding",Bt=Tr}else if(!(Ut[1].type==="linePrefix"||Ut[1].type==="blockQuotePrefix"||Ut[1].type==="blockQuotePrefixWhitespace"||Ut[1].type==="blockQuoteMarker"||Ut[1].type==="listItemIndent"))break}fi&&(!Bt||fi<Bt)&&(Fn._spread=!0),Fn.end=Object.assign({},Bt?T[Bt][1].start:We[1].end),T.splice(Bt||q,0,["exit",Fn,We[2]]),q++,L++}if(We[1].type==="listItemPrefix"){let Tr={type:"listItem",_spread:!1,start:Object.assign({},We[1].start),end:void 0};Fn=Tr,T.splice(q,0,["enter",Tr,We[2]]),q++,L++,fi=void 0,pi=!0}}}return T[E][1]._spread=lt,L}function o(T,E){return L;function L(q){a.call(this,T(q),q),E&&E.call(this,q)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(T,E,L){this.stack[this.stack.length-1].children.push(T),this.stack.push(T),this.tokenStack.push([E,L||void 0]),T.position={start:dn(E.start),end:void 0}}function u(T){return E;function E(L){T&&T.call(this,L),l.call(this,L)}}function l(T,E){let L=this.stack.pop(),q=this.tokenStack.pop();if(q)q[0].type!==T.type&&(E?E.call(this,T,q[0]):(q[1]||cm).call(this,T,q[0]));else throw new Error("Cannot close `"+T.type+"` ("+Ar({start:T.start,end:T.end})+"): it\u2019s not open");L.position.end=dn(T.end)}function c(){return Ua(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function m(T){if(this.data.expectingFirstListItemValue){let E=this.stack[this.stack.length-2];E.start=Number.parseInt(this.sliceSerialize(T),10),this.data.expectingFirstListItemValue=void 0}}function f(){let T=this.resume(),E=this.stack[this.stack.length-1];E.lang=T}function p(){let T=this.resume(),E=this.stack[this.stack.length-1];E.meta=T}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function C(){let T=this.resume(),E=this.stack[this.stack.length-1];E.value=T.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){let T=this.resume(),E=this.stack[this.stack.length-1];E.value=T.replace(/(\r?\n|\r)$/g,"")}function S(T){let E=this.resume(),L=this.stack[this.stack.length-1];L.label=E,L.identifier=De(this.sliceSerialize(T)).toLowerCase()}function k(){let T=this.resume(),E=this.stack[this.stack.length-1];E.title=T}function I(){let T=this.resume(),E=this.stack[this.stack.length-1];E.url=T}function A(T){let E=this.stack[this.stack.length-1];if(!E.depth){let L=this.sliceSerialize(T).length;E.depth=L}}function x(){this.data.setextHeadingSlurpLineEnding=!0}function v(T){let E=this.stack[this.stack.length-1];E.depth=this.sliceSerialize(T).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function M(T){let L=this.stack[this.stack.length-1].children,q=L[L.length-1];(!q||q.type!=="text")&&(q=Ey(),q.position={start:dn(T.start),end:void 0},L.push(q)),this.stack.push(q)}function y(T){let E=this.stack.pop();E.value+=this.sliceSerialize(T),E.position.end=dn(T.end)}function re(T){let E=this.stack[this.stack.length-1];if(this.data.atHardBreak){let L=E.children[E.children.length-1];L.position.end=dn(T.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(E.type)&&(M.call(this,T),y.call(this,T))}function H(){this.data.atHardBreak=!0}function _(){let T=this.resume(),E=this.stack[this.stack.length-1];E.value=T}function F(){let T=this.resume(),E=this.stack[this.stack.length-1];E.value=T}function $(){let T=this.resume(),E=this.stack[this.stack.length-1];E.value=T}function ie(){let T=this.stack[this.stack.length-1];if(this.data.inReference){let E=this.data.referenceType||"shortcut";T.type+="Reference",T.referenceType=E,delete T.url,delete T.title}else delete T.identifier,delete T.label;this.data.referenceType=void 0}function ce(){let T=this.stack[this.stack.length-1];if(this.data.inReference){let E=this.data.referenceType||"shortcut";T.type+="Reference",T.referenceType=E,delete T.url,delete T.title}else delete T.identifier,delete T.label;this.data.referenceType=void 0}function ut(T){let E=this.sliceSerialize(T),L=this.stack[this.stack.length-2];L.label=fs(E),L.identifier=De(E).toLowerCase()}function wt(){let T=this.stack[this.stack.length-1],E=this.resume(),L=this.stack[this.stack.length-1];if(this.data.inReference=!0,L.type==="link"){let q=T.children;L.children=q}else L.alt=E}function h(){let T=this.resume(),E=this.stack[this.stack.length-1];E.url=T}function Ke(){let T=this.resume(),E=this.stack[this.stack.length-1];E.title=T}function $t(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function He(T){let E=this.resume(),L=this.stack[this.stack.length-1];L.label=E,L.identifier=De(this.sliceSerialize(T)).toLowerCase(),this.data.referenceType="full"}function Pn(T){this.data.characterReferenceType=T.type}function Ea(T){let E=this.sliceSerialize(T),L=this.data.characterReferenceType,q;L?(q=ns(E,L==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):q=Er(E);let J=this.stack[this.stack.length-1];J.value+=q}function jo(T){let E=this.stack.pop();E.position.end=dn(T.end)}function ke(T){y.call(this,T);let E=this.stack[this.stack.length-1];E.url=this.sliceSerialize(T)}function mi(T){y.call(this,T);let E=this.stack[this.stack.length-1];E.url="mailto:"+this.sliceSerialize(T)}function zt(){return{type:"blockquote",children:[]}}function Rn(){return{type:"code",lang:null,meta:null,value:""}}function wr(){return{type:"inlineCode",value:""}}function Ia(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function wy(){return{type:"emphasis",children:[]}}function ud(){return{type:"heading",depth:0,children:[]}}function ld(){return{type:"break"}}function cd(){return{type:"html",value:""}}function Ty(){return{type:"image",title:null,url:"",alt:null}}function dd(){return{type:"link",title:null,url:"",children:[]}}function md(T){return{type:"list",ordered:T.type==="listOrdered",start:null,spread:T._spread,children:[]}}function ky(T){return{type:"listItem",spread:T._spread,checked:null,children:[]}}function Sy(){return{type:"paragraph",children:[]}}function Cy(){return{type:"strong",children:[]}}function Ey(){return{type:"text",value:""}}function Iy(){return{type:"thematicBreak"}}}function dn(e){return{line:e.line,column:e.column,offset:e.offset}}function mm(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?mm(e,r):Gb(e,r)}}function Gb(e,t){let n;for(n in t)if(dm.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r);break}}}function cm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ar({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ar({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ar({start:t.start,end:t.end})+") is still open")}function su(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function au(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Dr=(function(e){if(e==null)return Jb;if(typeof e=="function")return ps(e);if(typeof e=="object")return Array.isArray(e)?Yb(e):Zb(e);if(typeof e=="string")return Kb(e);throw new Error("Expected function, string, or object as test")});function Yb(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Dr(e[n]);return ps(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Zb(e){let t=e;return ps(n);function n(r){let i=r,o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Kb(e){return ps(t);function t(n){return n&&n.type===e}}function ps(e){return t;function t(n,r,i){return!!(Xb(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Jb(){return!0}function Xb(e){return e!==null&&typeof e=="object"&&"type"in e}function fm(e){return"\x1B[33m"+e+"\x1B[39m"}var pm=[],hm=!0,uu=!1,gm="skip";function lu(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;let o=Dr(i),s=r?-1:1;a(e,void 0,[])();function a(u,l,c){let d=u&&typeof u=="object"?u:{};if(typeof d.type=="string"){let f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(m,"name",{value:"node ("+fm(u.type+(f?"<"+f+">":""))+")"})}return m;function m(){let f=pm,p,w,C;if((!t||o(u,l,c[c.length-1]||void 0))&&(f=Qb(n(u,c)),f[0]===uu))return f;if("children"in u&&u.children){let b=u;if(b.children&&f[0]!==gm)for(w=(r?b.children.length:-1)+s,C=c.concat(b);w>-1&&w<b.children.length;){let S=b.children[w];if(p=a(S,w,C)(),p[0]===uu)return p;w=typeof p[1]=="number"?p[1]:w+s}}return f}}}function Qb(e){return Array.isArray(e)?e:typeof e=="number"?[hm,e]:e==null?pm:[e]}function cu(e,t,n){let i=Dr((n||{}).ignore||[]),o=e1(t),s=-1;for(;++s<o.length;)lu(e,"text",a);function a(l,c){let d=-1,m;for(;++d<c.length;){let f=c[d],p=m?m.children:void 0;if(i(f,p?p.indexOf(f):void 0,m))return;m=f}if(m)return u(l,c)}function u(l,c){let d=c[c.length-1],m=o[s][0],f=o[s][1],p=0,C=d.children.indexOf(l),b=!1,S=[];m.lastIndex=0;let k=m.exec(l.value);for(;k;){let I=k.index,A={index:k.index,input:k.input,stack:[...c,l]},x=f(...k,A);if(typeof x=="string"&&(x=x.length>0?{type:"text",value:x}:void 0),x===!1?m.lastIndex=I+1:(p!==I&&S.push({type:"text",value:l.value.slice(p,I)}),Array.isArray(x)?S.push(...x):x&&S.push(x),p=I+k[0].length,b=!0),!m.global)break;k=m.exec(l.value)}return b?(p<l.value.length&&S.push({type:"text",value:l.value.slice(p)}),d.children.splice(C,1,...S)):S=[l],C+S.length}}function e1(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let i=n[r];t.push([t1(i[0]),n1(i[1])])}return t}function t1(e){return typeof e=="string"?new RegExp(au(e),"g"):e}function n1(e){return typeof e=="function"?e:function(){return e}}function mu(){return{transforms:[u1],enter:{literalAutolink:r1,literalAutolinkEmail:du,literalAutolinkHttp:du,literalAutolinkWww:du},exit:{literalAutolink:a1,literalAutolinkEmail:s1,literalAutolinkHttp:i1,literalAutolinkWww:o1}}}function r1(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function du(e){this.config.enter.autolinkProtocol.call(this,e)}function i1(e){this.config.exit.autolinkProtocol.call(this,e)}function o1(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function s1(e){this.config.exit.autolinkEmail.call(this,e)}function a1(e){this.exit(e)}function u1(e){cu(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,l1],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),c1]],{ignore:["link","linkReference"]})}function l1(e,t,n,r,i){let o="";if(!ym(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!d1(n)))return!1;let s=m1(n+r);if(!s[0])return!1;let a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function c1(e,t,n,r){return!ym(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function d1(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function m1(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=su(e,"("),o=su(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function ym(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||kt(n)||zn(n))&&(!t||n!==47)}S1.peek=k1;function p1(){this.buffer()}function h1(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function g1(){this.buffer()}function y1(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function x1(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=De(this.sliceSerialize(e)).toLowerCase(),n.label=t}function b1(e){this.exit(e)}function w1(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=De(this.sliceSerialize(e)).toLowerCase(),n.label=t}function T1(e){this.exit(e)}function k1(){return"["}function S1(e,t,n,r){let i=n.createTracker(r),o=i.move("[^"),s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function fu(){return{enter:{gfmFootnoteCallString:p1,gfmFootnoteCall:h1,gfmFootnoteDefinitionLabelString:g1,gfmFootnoteDefinition:y1},exit:{gfmFootnoteCallString:x1,gfmFootnoteCall:b1,gfmFootnoteDefinitionLabelString:w1,gfmFootnoteDefinition:T1}}}A1.peek=D1;function pu(){return{canContainEols:["delete"],enter:{strikethrough:E1},exit:{strikethrough:I1}}}function E1(e){this.enter({type:"delete",children:[]},e)}function I1(e){this.exit(e)}function A1(e,t,n,r){let i=n.createTracker(r),o=n.enter("strikethrough"),s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function D1(){return"~"}function gu(){return{enter:{table:O1,tableData:xm,tableHeader:xm,tableRow:M1},exit:{codeText:N1,table:v1,tableData:hu,tableHeader:hu,tableRow:hu}}}function O1(e){let t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function v1(e){this.exit(e),this.data.inTable=void 0}function M1(e){this.enter({type:"tableRow",children:[]},e)}function hu(e){this.exit(e)}function xm(e){this.enter({type:"tableCell",children:[]},e)}function N1(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,P1));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function P1(e,t){return t==="|"?t:e}function yu(){return{exit:{taskListCheckValueChecked:bm,taskListCheckValueUnchecked:bm,paragraph:F1}}}function bm(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function F1(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let n=this.stack[this.stack.length-1];n.type;let r=n.children[0];if(r&&r.type==="text"){let i=t.children,o=-1,s;for(;++o<i.length;){let a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function xu(){return[mu(),fu(),pu(),gu(),yu()]}var $1={tokenize:H1,partial:!0},wm={tokenize:W1,partial:!0},Tm={tokenize:j1,partial:!0},km={tokenize:V1,partial:!0},z1={tokenize:G1,partial:!0},Sm={name:"wwwAutolink",tokenize:U1,previous:Em},Cm={name:"protocolAutolink",tokenize:q1,previous:Im},Vt={name:"emailAutolink",tokenize:B1,previous:Am},Ct={};function wu(){return{text:Ct}}var Hn=48;for(;Hn<123;)Ct[Hn]=Vt,Hn++,Hn===58?Hn=65:Hn===91&&(Hn=97);Ct[43]=Vt;Ct[45]=Vt;Ct[46]=Vt;Ct[95]=Vt;Ct[72]=[Vt,Cm];Ct[104]=[Vt,Cm];Ct[87]=[Vt,Sm];Ct[119]=[Vt,Sm];function B1(e,t,n){let r=this,i,o;return s;function s(d){return!bu(d)||!Am.call(r,r.previous)||Tu(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return bu(d)?(e.consume(d),a):d===64?(e.consume(d),u):n(d)}function u(d){return d===46?e.check(z1,c,l)(d):d===45||d===95||me(d)?(o=!0,e.consume(d),u):c(d)}function l(d){return e.consume(d),i=!0,u}function c(d){return o&&i&&de(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function U1(e,t,n){let r=this;return i;function i(s){return s!==87&&s!==119||!Em.call(r,r.previous)||Tu(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check($1,e.attempt(wm,e.attempt(Tm,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function q1(e,t,n){let r=this,i="",o=!1;return s;function s(d){return(d===72||d===104)&&Im.call(r,r.previous)&&!Tu(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(de(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){let m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(d),u}return n(d)}function u(d){return d===47?(e.consume(d),o?l:(o=!0,u)):n(d)}function l(d){return d===null||$n(d)||z(d)||kt(d)||zn(d)?n(d):e.attempt(wm,e.attempt(Tm,c),n)(d)}function c(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function H1(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function W1(e,t,n){let r,i,o;return s;function s(l){return l===46||l===95?e.check(km,u,a)(l):l===null||z(l)||kt(l)||l!==45&&zn(l)?u(l):(o=!0,e.consume(l),s)}function a(l){return l===95?r=!0:(i=r,r=void 0),e.consume(l),s}function u(l){return i||r||!o?n(l):t(l)}}function j1(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(km,t,o)(s):s===null||z(s)||kt(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function V1(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||z(a)||kt(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||z(a)||kt(a)?t(a):r(a)}function o(a){return de(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):de(a)?(e.consume(a),s):n(a)}}function G1(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return me(o)?n(o):t(o)}}function Em(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||z(e)}function Im(e){return!de(e)}function Am(e){return!(e===47||bu(e))}function bu(e){return e===43||e===45||e===46||e===95||me(e)}function Tu(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Y1={tokenize:t0,partial:!0};function ku(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:X1,continuation:{tokenize:Q1},exit:e0}},text:{91:{name:"gfmFootnoteCall",tokenize:J1},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Z1,resolveTo:K1}}}}function Z1(e,t,n){let r=this,i=r.events.length,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),s;for(;i--;){let u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return n(u);let l=De(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!o.includes(l.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function K1(e,t){let n=e.length,r;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){r=e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...u),e}function J1(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o=0,s;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),u}function u(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(d){if(o>999||d===93&&!s||d===null||d===91||z(d))return n(d);if(d===93){e.exit("chunkString");let m=e.exit("gfmFootnoteCallString");return i.includes(De(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return z(d)||(s=!0),o++,e.consume(d),d===92?c:l}function c(d){return d===91||d===92||d===93?(e.consume(d),o++,l):l(d)}}function X1(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o,s=0,a;return u;function u(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(p)}function c(p){if(s>999||p===93&&!a||p===null||p===91||z(p))return n(p);if(p===93){e.exit("chunkString");let w=e.exit("gfmFootnoteDefinitionLabelString");return o=De(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return z(p)||(a=!0),s++,e.consume(p),p===92?d:c}function d(p){return p===91||p===92||p===93?(e.consume(p),s++,c):c(p)}function m(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(o)||i.push(o),N(e,f,"gfmFootnoteDefinitionWhitespace")):n(p)}function f(p){return t(p)}}function Q1(e,t,n){return e.check(St,t,e.attempt(Y1,t,n))}function e0(e){e.exit("gfmFootnoteDefinition")}function t0(e,t,n){let r=this;return N(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function Su(e){let n=(e||{}).singleTilde,r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let l=u;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[u][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";let c={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[u][1].end)},d={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[u][1].start)},m=[["enter",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["enter",d,a]],f=a.parser.constructs.insideSpan.null;f&&ue(m,m.length,0,cn(f,s.slice(l+1,u),a)),ue(m,m.length,0,[["exit",d,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",c,a]]),ue(s,l-1,u-l+3,m),u=l+m.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,a,u){let l=this.previous,c=this.events,d=0;return m;function m(p){return l===126&&c[c.length-1][1].type!=="characterEscape"?u(p):(s.enter("strikethroughSequenceTemporary"),f(p))}function f(p){let w=Ir(l);if(p===126)return d>1?u(p):(s.consume(p),d++,f);if(d<2&&!n)return u(p);let C=s.exit("strikethroughSequenceTemporary"),b=Ir(p);return C._open=!b||b===2&&!!w,C._close=!w||w===2&&!!b,a(p)}}}var hs=class{constructor(){this.map=[]}add(t,n,r){n0(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length,r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(let o of i)t.push(o);i=r.pop()}this.map.length=0}};function n0(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Dm(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function Cu(){return{flow:{null:{name:"table",tokenize:r0,resolveAll:i0}}}}function r0(e,t,n){let r=this,i=0,o=0,s;return a;function a(y){let re=r.events.length-1;for(;re>-1;){let F=r.events[re][1].type;if(F==="lineEnding"||F==="linePrefix")re--;else break}let H=re>-1?r.events[re][1].type:null,_=H==="tableHead"||H==="tableRow"?x:u;return _===x&&r.parser.lazy[r.now().line]?n(y):_(y)}function u(y){return e.enter("tableHead"),e.enter("tableRow"),l(y)}function l(y){return y===124||(s=!0,o+=1),c(y)}function c(y){return y===null?n(y):D(y)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),f):n(y):R(y)?N(e,c,"whitespace")(y):(o+=1,s&&(s=!1,i+=1),y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),s=!0,c):(e.enter("data"),d(y)))}function d(y){return y===null||y===124||z(y)?(e.exit("data"),c(y)):(e.consume(y),y===92?m:d)}function m(y){return y===92||y===124?(e.consume(y),d):d(y)}function f(y){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(y):(e.enter("tableDelimiterRow"),s=!1,R(y)?N(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):p(y))}function p(y){return y===45||y===58?C(y):y===124?(s=!0,e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),w):A(y)}function w(y){return R(y)?N(e,C,"whitespace")(y):C(y)}function C(y){return y===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),b):y===45?(o+=1,b(y)):y===null||D(y)?I(y):A(y)}function b(y){return y===45?(e.enter("tableDelimiterFiller"),S(y)):A(y)}function S(y){return y===45?(e.consume(y),S):y===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(y))}function k(y){return R(y)?N(e,I,"whitespace")(y):I(y)}function I(y){return y===124?p(y):y===null||D(y)?!s||i!==o?A(y):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(y)):A(y)}function A(y){return n(y)}function x(y){return e.enter("tableRow"),v(y)}function v(y){return y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),v):y===null||D(y)?(e.exit("tableRow"),t(y)):R(y)?N(e,v,"whitespace")(y):(e.enter("data"),P(y))}function P(y){return y===null||y===124||z(y)?(e.exit("data"),v(y)):(e.consume(y),y===92?M:P)}function M(y){return y===92||y===124?(e.consume(y),P):P(y)}}function i0(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,l,c,d,m=new hs;for(;++n<e.length;){let f=e[n],p=f[1];f[0]==="enter"?p.type==="tableHead"?(a=!1,u!==0&&(_m(m,t,u,l,c),c=void 0,u=0),l={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},m.add(n,0,[["enter",l,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,d=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,c={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},m.add(n,0,[["enter",c,t]])),i=p.type==="tableDelimiterRow"?2:c?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],d=gs(m,t,o,i,void 0,d),o=[0,0,0,0]),s[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],d=gs(m,t,o,i,void 0,d)),o=s,s=[o[1],n,0,0])):p.type==="tableHead"?(a=!0,u=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(u=n,o[1]!==0?(s[0]=s[1],d=gs(m,t,o,i,n,d)):s[1]!==0&&(d=gs(m,t,s,i,n,d)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&_m(m,t,u,l,c),m.consume(t.events),n=-1;++n<t.events.length;){let f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=Dm(t.events,n))}return e}function gs(e,t,n,r,i,o){let s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},_r(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));let u=_r(t.events,n[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){let l=_r(t.events,n[2]),c=_r(t.events,n[3]),d={type:a,start:Object.assign({},l),end:Object.assign({},c)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){let m=t.events[n[2]],f=t.events[n[3]];if(m[1].end=Object.assign({},f[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){let p=n[2]+1,w=n[3]-n[2]-1;e.add(p,w,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(o.end=Object.assign({},_r(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function _m(e,t,n,r,i){let o=[],s=_r(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function _r(e,t){let n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}var o0={name:"tasklistCheck",tokenize:s0};function Eu(){return{text:{91:o0}}}function s0(e,t,n){let r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return z(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(u)}function a(u){return D(u)?t(u):R(u)?e.check({tokenize:a0},t,n)(u):n(u)}}function a0(e,t,n){return N(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Om(e){return ts([wu(),ku(),Su(e),Cu(),Eu()])}var u0=[{id:"hop",name:"Hop"},{id:"arcade",name:"Arcade"},{id:"clink",name:"Clink"},{id:"drop",name:"Drop"},{id:"echo",name:"Echo"},{id:"glow",name:"Glow"},{id:"knock",name:"Knock"},{id:"lift",name:"Lift"},{id:"sparkle",name:"Sparkle"},{id:"swoop",name:"Swoop"},{id:"tick",name:"Tick"},{id:"wave",name:"Wave"}],Ei=u0.map(e=>e.id),vm=new Intl.ListFormat("en",{type:"disjunction"}).format(Ei);var ys=["quiet","standard","important"];var Mm=64e3;var Iu=120;var m0=new Set("*_~`[]<>|!\\-+"),f0=new Set("*_[]|"),p0=new Set(".-+_"),h0=/[\w.+-]/,Nm=1e7;function Pm(e){if(e.length>Mm)return!1;let t=0,n=1,r=0,i=!0,o=!0,s=0,a="",u=0,l=0,c=0;for(let d of e){if(h0.test(d))u+=1,p0.has(a)&&(l+=1);else if(l>0){if(c+=l*u,c>Nm)return!1;u=l=0}else u=0;if(d===`
|
|
49
|
-
`){if(++n>4e3)return!1;i=!0,o=!0,r=0,s=0,a="";continue}if(i&&(
|
|
50
|
-
`)
|
|
51
|
-
`))
|
|
52
|
-
`).replace(/^(?:[ \t]*\n)+/,"")}function T0(e,t){let n=t==="markdown"?k0(e):null;return n?O0(C0(n)):xs(e)}function k0(e){if(!Pm(e))return null;let t=ou(e,{extensions:[Om()],mdastExtensions:[xu()]});return Rm(t)?t:null}var S0=/^\[!(note|tip|important|warning|caution)\]\s*/iu;function C0(e){let t=[],n=null,r=!1,i=!1,o=[{node:e}];for(;o.length;){let{node:s,number:a}=o.pop();switch(s.type){case"paragraph":case"heading":case"tableCell":case"code":case"html":{let u=s.type==="html"?D0(s.value):[{kind:s.type==="heading"?"heading":s.type==="tableCell"?"cell":"other",text:s.type==="code"?s.value:E0(s)}];for(let l of u){let c=l.text;i&&(c=c.replace(S0,(f,p)=>`${p[0].toUpperCase()}${p.slice(1).toLowerCase()}: `));let d=l.kind==="other"&&n?"item":l.kind;n?.number!==void 0&&(c=`${n.number}. ${c}`);let m=r||l.rowStart;t.push({kind:d,text:c,...n?.number!==void 0?{number:n.number}:{},...m?{rowStart:m}:{}}),n=null,r=!1,i=!1}break}case"list":for(let u=s.children.length-1;u>=0;u--)o.push({node:s.children[u],...s.ordered?{number:(s.start??1)+u}:{}});break;case"listItem":n=a===void 0?{}:{number:a},Or(o,s);break;case"tableRow":r=!0,Or(o,s);break;case"blockquote":i=!0,Or(o,s);break;case"definition":case"thematicBreak":break;default:"children"in s&&Or(o,s)}}return t}function Or(e,t){for(let n=t.children.length-1;n>=0;n--)e.push({node:t.children[n]})}function E0(e){let t="",n=[];for(Or(n,e);n.length;){let{node:r}=n.pop();r.type==="text"||r.type==="inlineCode"?t+=r.value:r.type==="image"||r.type==="imageReference"?t+=r.alt??"":r.type==="break"?t+=" ":r.type==="html"?t+=$m(r.value):"children"in r&&Or(n,r)}return t}var I0=/<\/?(?:a|abbr|b|bdi|bdo|cite|code|data|del|dfn|em|font|i|ins|kbd|mark|q|s|samp|small|span|strike|strong|sub|sup|time|u|var|wbr)\b[^<>]*>/giu,Lm=e=>e.replace(/<!--[\s\S]*?(?:-->|$)/gu," ").replace(/<(script|style)\b[\s\S]*?(?:<\/\1\s*>|$)/giu," ");function $m(e){return fs(Lm(e).replace(/<img\b[^<>]*?\balt\s*=\s*(?:"([^"<>]*)"|'([^'<>]*)')[^<>]*>/giu," $1$2 ").replace(I0,"").replace(/<[^<>]*>/gu," "))}var A0=/<(\/?)(h[1-6]|li|t[dh]|tr|p|div|ul|ol|table|blockquote|pre|hr|section|article|header|footer)\b[^<>]*>/giu;function D0(e){let t=[],n=Lm(e),r="other",i=!1,o=0,s=a=>{let u=$m(n.slice(o,a));u.trim()&&(t.push({kind:r,text:u,...i?{rowStart:i}:{}}),i=!1)};for(let a of n.matchAll(A0)){s(a.index),o=a.index+a[0].length;let[,u,l]=a,c=l.toLowerCase();c==="tr"?i=!u:r=u?"other":/^h\d$/u.test(c)?"heading":c==="li"?"item":/^t[dh]$/u.test(c)?"cell":"other"}return s(n.length),t}var _0=/[\p{Terminal_Punctuation}…][\p{Pe}\p{Pf}"']*$/u;function O0(e){let t="",n=null;for(let r of e){let i=xs(r.text);i&&(n&&(t+=v0(n,r,t)),t+=i,n=r)}return t}function v0(e,t,n){return _0.test(n)?" ":e.kind==="heading"?" \u2014 ":t.kind==="heading"?". ":e.kind==="cell"&&t.kind==="cell"?t.rowStart?"; ":", ":e.kind==="item"&&t.kind==="item"?t.number===void 0?", ":" ":". "}var _s={};fd(_s,{Chrono:()=>Gn,GB:()=>Ww,Meridiem:()=>B,ParsingComponents:()=>U,ParsingResult:()=>mt,ReferenceWithTimezone:()=>Et,Weekday:()=>Z,casual:()=>Ds,configuration:()=>As,parse:()=>jw,parseDate:()=>Vw,strict:()=>Sf});var B;(function(e){e[e.AM=0]="AM",e[e.PM=1]="PM"})(B||(B={}));var Z;(function(e){e[e.SUNDAY=0]="SUNDAY",e[e.MONDAY=1]="MONDAY",e[e.TUESDAY=2]="TUESDAY",e[e.WEDNESDAY=3]="WEDNESDAY",e[e.THURSDAY=4]="THURSDAY",e[e.FRIDAY=5]="FRIDAY",e[e.SATURDAY=6]="SATURDAY"})(Z||(Z={}));var Ve;(function(e){e[e.JANUARY=1]="JANUARY",e[e.FEBRUARY=2]="FEBRUARY",e[e.MARCH=3]="MARCH",e[e.APRIL=4]="APRIL",e[e.MAY=5]="MAY",e[e.JUNE=6]="JUNE",e[e.JULY=7]="JULY",e[e.AUGUST=8]="AUGUST",e[e.SEPTEMBER=9]="SEPTEMBER",e[e.OCTOBER=10]="OCTOBER",e[e.NOVEMBER=11]="NOVEMBER",e[e.DECEMBER=12]="DECEMBER"})(Ve||(Ve={}));function dt(e,t){e.assign("day",t.getDate()),e.assign("month",t.getMonth()+1),e.assign("year",t.getFullYear())}function bs(e,t){e.assign("hour",t.getHours()),e.assign("minute",t.getMinutes()),e.assign("second",t.getSeconds()),e.assign("millisecond",t.getMilliseconds()),e.assign("meridiem",t.getHours()<12?B.AM:B.PM)}function Gt(e,t){e.imply("day",t.getDate()),e.imply("month",t.getMonth()+1),e.imply("year",t.getFullYear())}function Ii(e,t){e.imply("hour",t.getHours()),e.imply("minute",t.getMinutes()),e.imply("second",t.getSeconds()),e.imply("millisecond",t.getMilliseconds()),e.imply("meridiem",t.getHours()<12?B.AM:B.PM)}var N0={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:{timezoneOffsetDuringDst:120,timezoneOffsetNonDst:60,dstStart:e=>zm(e,Ve.MARCH,Z.SUNDAY,2),dstEnd:e=>zm(e,Ve.OCTOBER,Z.SUNDAY,3)},CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CT:{timezoneOffsetDuringDst:-300,timezoneOffsetNonDst:-360,dstStart:e=>mn(e,Ve.MARCH,Z.SUNDAY,2,2),dstEnd:e=>mn(e,Ve.NOVEMBER,Z.SUNDAY,1,2)},CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:{timezoneOffsetDuringDst:-240,timezoneOffsetNonDst:-300,dstStart:e=>mn(e,Ve.MARCH,Z.SUNDAY,2,2),dstEnd:e=>mn(e,Ve.NOVEMBER,Z.SUNDAY,1,2)},FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MT:{timezoneOffsetDuringDst:-360,timezoneOffsetNonDst:-420,dstStart:e=>mn(e,Ve.MARCH,Z.SUNDAY,2,2),dstEnd:e=>mn(e,Ve.NOVEMBER,Z.SUNDAY,1,2)},MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:{timezoneOffsetDuringDst:-420,timezoneOffsetNonDst:-480,dstStart:e=>mn(e,Ve.MARCH,Z.SUNDAY,2,2),dstEnd:e=>mn(e,Ve.NOVEMBER,Z.SUNDAY,1,2)},PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function mn(e,t,n,r,i=0){let o=0,s=0;for(;s<r;)o++,new Date(e,t-1,o).getDay()===n&&s++;return new Date(e,t-1,o,i)}function zm(e,t,n,r=0){let i=n===0?7:n,o=new Date(e,t-1+1,1,12),s=o.getDay()===0?7:o.getDay(),a;return s===i?a=7:s<i?a=7+s-i:a=s-i,o.setDate(o.getDate()-a),new Date(e,t-1,o.getDate(),r)}function ws(e,t,n={}){if(e==null)return null;if(typeof e=="number")return e;let r=n[e]??N0[e];return r==null?null:typeof r=="number"?r:t==null?null:t>r.dstStart(t.getFullYear())&&!(t>r.dstEnd(t.getFullYear()))?r.timezoneOffsetDuringDst:r.timezoneOffsetNonDst}var Bm={day:0,second:0,millisecond:0};function be(e,t){let n=new Date(e);if(t.y&&(t.year=t.y,delete t.y),t.mo&&(t.month=t.mo,delete t.mo),t.M&&(t.month=t.M,delete t.M),t.w&&(t.week=t.w,delete t.w),t.d&&(t.day=t.d,delete t.d),t.h&&(t.hour=t.h,delete t.h),t.m&&(t.minute=t.m,delete t.m),t.s&&(t.second=t.s,delete t.s),t.ms&&(t.millisecond=t.ms,delete t.ms),"year"in t){let r=Math.floor(t.year);n.setFullYear(n.getFullYear()+r);let i=t.year-r;i>0&&(t.month=t?.month??0,t.month+=i*12)}if("quarter"in t){let r=Math.floor(t.quarter);n.setMonth(n.getMonth()+r*3)}if("month"in t){let r=Math.floor(t.month);n.setMonth(n.getMonth()+r);let i=t.month-r;i>0&&(t.week=t?.week??0,t.week+=i*4)}if("week"in t){let r=Math.floor(t.week);n.setDate(n.getDate()+r*7);let i=t.week-r;i>0&&(t.day=t?.day??0,t.day+=Math.round(i*7))}if("day"in t){let r=Math.floor(t.day);n.setDate(n.getDate()+r);let i=t.day-r;i>0&&(t.hour=t?.hour??0,t.hour+=Math.round(i*24))}if("hour"in t){let r=Math.floor(t.hour);n.setHours(n.getHours()+r);let i=t.hour-r;i>0&&(t.minute=t?.minute??0,t.minute+=Math.round(i*60))}if("minute"in t){let r=Math.floor(t.minute);n.setMinutes(n.getMinutes()+r);let i=t.minute-r;i>0&&(t.second=t?.second??0,t.second+=Math.round(i*60))}if("second"in t){let r=Math.floor(t.second);n.setSeconds(n.getSeconds()+r);let i=t.second-r;i>0&&(t.millisecond=t?.millisecond??0,t.millisecond+=Math.round(i*1e3))}if("millisecond"in t){let r=Math.floor(t.millisecond);n.setMilliseconds(n.getMilliseconds()+r)}return n}function fn(e){let t={};for(let n in e)t[n]=-e[n];return t}var Et=class e{instant;timezoneOffset;constructor(t,n){this.instant=t??new Date,this.timezoneOffset=n??null}static fromDate(t){return new e(t)}static fromInput(t,n){if(t instanceof Date)return e.fromDate(t);let r=t?.instant??new Date,i=ws(t?.timezone,r,n);return new e(r,i)}getDateWithAdjustedTimezone(){let t=new Date(this.instant);return this.timezoneOffset!==null&&t.setMinutes(t.getMinutes()-this.getSystemTimezoneAdjustmentMinute(this.instant)),t}getSystemTimezoneAdjustmentMinute(t,n){t||(t=new Date);let r=-t.getTimezoneOffset(),i=n??this.timezoneOffset??r;return r-i}getTimezoneOffset(){return this.timezoneOffset??-this.instant.getTimezoneOffset()}},U=class e{knownValues;impliedValues;reference;_tags=new Set;constructor(t,n){if(this.reference=t,this.knownValues={},this.impliedValues={},n)for(let i in n)this.knownValues[i]=n[i];let r=t.getDateWithAdjustedTimezone();this.imply("day",r.getDate()),this.imply("month",r.getMonth()+1),this.imply("year",r.getFullYear()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}static createRelativeFromReference(t,n=Bm){let r=be(t.getDateWithAdjustedTimezone(),n),i=new e(t);return i.addTag("result/relativeDate"),"hour"in n||"minute"in n||"second"in n||"millisecond"in n?(i.addTag("result/relativeDateAndTime"),bs(i,r),dt(i,r),i.assign("timezoneOffset",t.getTimezoneOffset())):(Ii(i,r),i.imply("timezoneOffset",t.getTimezoneOffset()),"day"in n?(i.assign("day",r.getDate()),i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear()),i.assign("weekday",r.getDay())):"week"in n?(i.assign("day",r.getDate()),i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear()),i.imply("weekday",r.getDay())):(i.imply("day",r.getDate()),"month"in n?(i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear())):(i.imply("month",r.getMonth()+1),"year"in n?i.assign("year",r.getFullYear()):i.imply("year",r.getFullYear())))),i}get(t){return t in this.knownValues?this.knownValues[t]:t in this.impliedValues?this.impliedValues[t]:null}isCertain(t){return t in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(t,n){return t in this.knownValues?this:(this.impliedValues[t]=n,this)}assign(t,n){return this.knownValues[t]=n,delete this.impliedValues[t],this}addDurationAsImplied(t){let n=this.dateWithoutTimezoneAdjustment(),r=be(n,t);return("day"in t||"week"in t||"month"in t||"year"in t)&&(this.delete(["day","weekday","month","year"]),this.imply("day",r.getDate()),this.imply("weekday",r.getDay()),this.imply("month",r.getMonth()+1),this.imply("year",r.getFullYear())),("second"in t||"minute"in t||"hour"in t)&&(this.delete(["second","minute","hour"]),this.imply("second",r.getSeconds()),this.imply("minute",r.getMinutes()),this.imply("hour",r.getHours())),this}delete(t){typeof t=="string"&&(t=[t]);for(let n of t)delete this.knownValues[n],delete this.impliedValues[n]}clone(){let t=new e(this.reference);t.knownValues={},t.impliedValues={};for(let n in this.knownValues)t.knownValues[n]=this.knownValues[n];for(let n in this.impliedValues)t.impliedValues[n]=this.impliedValues[n];return t}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")&&!this.isCertain("year")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isDateWithUnknownYear(){return this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let t=new Date(Date.UTC(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond")));return t.setUTCFullYear(this.get("year")),!(t.getUTCFullYear()!==this.get("year")||t.getUTCMonth()!==this.get("month")-1||t.getUTCDate()!==this.get("day")||this.get("hour")!=null&&t.getUTCHours()!=this.get("hour")||this.get("minute")!=null&&t.getUTCMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {
|
|
58
|
+
`;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function Lu(e){let r={constructs:ks([Pu,...(e||{}).extensions||[]]),content:i(yp),defined:[],document:i(xp),flow:i(Tp),lazy:{},string:i(Ep),text:i(Ip)};return r;function i(o){return s;function s(a){return Op(r,o,a)}}}function Fu(e){for(;!As(e););return e}var Dp=/[\0\t\n\r]/g;function $u(){let e=1,t="",n=!0,r;return i;function i(o,s,a){let u=[],l,d,c,m,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(Dp.lastIndex=c,l=Dp.exec(o),m=l&&l.index!==void 0?l.index:o.length,p=o.charCodeAt(m),!l){t=o.slice(c);break}if(p===10&&c===m&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<m&&(u.push(o.slice(c,m)),e+=m-c),p){case 0:{u.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,u.push(-2);e++<d;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=m+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}function Dr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?vp(e.position):"start"in e||"end"in e?vp(e):"line"in e||"column"in e?Uu(e):""}function Uu(e){return Mp(e&&e.line)+":"+Mp(e&&e.column)}function vp(e){return Uu(e&&e.start)+"-"+Uu(e&&e.end)}function Mp(e){return e&&typeof e=="number"?e:1}var Rp={}.hasOwnProperty;function zu(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),r0(n)(Fu(Lu(n).document().write($u()(e,t,!0))))}function r0(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Hd),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(Bd),blockQuote:o(Ut),characterEscape:E,characterReference:E,codeFenced:o($n),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o($n,s),codeText:o(Sr,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(Ua),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Bw),hardBreakEscape:o(qd),hardBreakTrailing:o(qd),htmlFlow:o(jd,s),htmlFlowData:E,htmlText:o(jd,s),htmlTextData:E,image:o(qw),label:s,link:o(Hd),listItem:o(jw),listItemValue:m,listOrdered:o(Wd,c),listUnordered:o(Wd),paragraph:o(Hw),reference:g,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Bd),strong:o(Ww),thematicBreak:o(Vw)},exit:{atxHeading:u(),atxHeadingSequence:O,autolink:u(),autolinkEmail:hi,autolinkProtocol:Ce,blockQuote:u(),characterEscapeValue:y,characterReferenceMarkerHexadecimal:Fn,characterReferenceMarkerNumeric:Fn,characterReferenceValue:$a,characterReference:Jo,codeFenced:u(S),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:f,codeFlowValue:y,codeIndented:u(w),codeText:u(U),codeTextData:y,data:y,definition:u(),definitionDestinationString:M,definitionLabelString:D,definitionTitleString:T,emphasis:u(),hardBreakEscape:u(F),hardBreakTrailing:u(F),htmlFlow:u(_),htmlFlowData:y,htmlText:u(R),htmlTextData:y,image:u(oe),label:J,labelText:Re,lineEnding:Z,link:u(te),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:Ge,resourceDestinationString:h,resourceTitleString:Qe,resource:$t,setextHeading:u(N),setextHeadingLineSequence:C,setextHeadingText:b,strong:u(),thematicBreak:u()}};Pp(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(k){let I={type:"root",children:[]},z={stack:[I],tokenStack:[],config:t,enter:a,exit:l,buffer:s,resume:d,data:n},G=[],Q=-1;for(;++Q<k.length;)if(k[Q][1].type==="listOrdered"||k[Q][1].type==="listUnordered")if(k[Q][0]==="enter")G.push(Q);else{let mt=G.pop();Q=i(k,mt,Q)}for(Q=-1;++Q<k.length;){let mt=t[k[Q][0]];Rp.call(mt,k[Q][1].type)&&mt[k[Q][1].type].call(Object.assign({sliceSerialize:k[Q][2].sliceSerialize},z),k[Q][1])}if(z.tokenStack.length>0){let mt=z.tokenStack[z.tokenStack.length-1];(mt[1]||Np).call(z,void 0,mt[0])}for(I.position={start:hn(k.length>0?k[0][1].start:{line:1,column:1,offset:0}),end:hn(k.length>0?k[k.length-2][1].end:{line:1,column:1,offset:0})},Q=-1;++Q<t.transforms.length;)I=t.transforms[Q](I)||I;return I}function i(k,I,z){let G=I-1,Q=-1,mt=!1,Un,zt,gi,yi;for(;++G<=z;){let Ve=k[G];switch(Ve[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ve[0]==="enter"?Q++:Q--,yi=void 0;break}case"lineEndingBlank":{Ve[0]==="enter"&&(Un&&!yi&&!Q&&!gi&&(gi=G),yi=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:yi=void 0}if(!Q&&Ve[0]==="enter"&&Ve[1].type==="listItemPrefix"||Q===-1&&Ve[0]==="exit"&&(Ve[1].type==="listUnordered"||Ve[1].type==="listOrdered")){if(Un){let Tr=G;for(zt=void 0;Tr--;){let Bt=k[Tr];if(Bt[1].type==="lineEnding"||Bt[1].type==="lineEndingBlank"){if(Bt[0]==="exit")continue;zt&&(k[zt][1].type="lineEndingBlank",mt=!0),Bt[1].type="lineEnding",zt=Tr}else if(!(Bt[1].type==="linePrefix"||Bt[1].type==="blockQuotePrefix"||Bt[1].type==="blockQuotePrefixWhitespace"||Bt[1].type==="blockQuoteMarker"||Bt[1].type==="listItemIndent"))break}gi&&(!zt||gi<zt)&&(Un._spread=!0),Un.end=Object.assign({},zt?k[zt][1].start:Ve[1].end),k.splice(zt||G,0,["exit",Un,Ve[2]]),G++,z++}if(Ve[1].type==="listItemPrefix"){let Tr={type:"listItem",_spread:!1,start:Object.assign({},Ve[1].start),end:void 0};Un=Tr,k.splice(G,0,["enter",Tr,Ve[2]]),G++,z++,gi=void 0,yi=!0}}}return k[I][1]._spread=mt,z}function o(k,I){return z;function z(G){a.call(this,k(G),G),I&&I.call(this,G)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(k,I,z){this.stack[this.stack.length-1].children.push(k),this.stack.push(k),this.tokenStack.push([I,z||void 0]),k.position={start:hn(I.start),end:void 0}}function u(k){return I;function I(z){k&&k.call(this,z),l.call(this,z)}}function l(k,I){let z=this.stack.pop(),G=this.tokenStack.pop();if(G)G[0].type!==k.type&&(I?I.call(this,k,G[0]):(G[1]||Np).call(this,k,G[0]));else throw new Error("Cannot close `"+k.type+"` ("+Dr({start:k.start,end:k.end})+"): it\u2019s not open");z.position.end=hn(k.end)}function d(){return Tu(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function m(k){if(this.data.expectingFirstListItemValue){let I=this.stack[this.stack.length-2];I.start=Number.parseInt(this.sliceSerialize(k),10),this.data.expectingFirstListItemValue=void 0}}function p(){let k=this.resume(),I=this.stack[this.stack.length-1];I.lang=k}function f(){let k=this.resume(),I=this.stack[this.stack.length-1];I.meta=k}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k.replace(/(\r?\n|\r)$/g,"")}function D(k){let I=this.resume(),z=this.stack[this.stack.length-1];z.label=I,z.identifier=Oe(this.sliceSerialize(k)).toLowerCase()}function T(){let k=this.resume(),I=this.stack[this.stack.length-1];I.title=k}function M(){let k=this.resume(),I=this.stack[this.stack.length-1];I.url=k}function O(k){let I=this.stack[this.stack.length-1];if(!I.depth){let z=this.sliceSerialize(k).length;I.depth=z}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function C(k){let I=this.stack[this.stack.length-1];I.depth=this.sliceSerialize(k).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function E(k){let z=this.stack[this.stack.length-1].children,G=z[z.length-1];(!G||G.type!=="text")&&(G=Gw(),G.position={start:hn(k.start),end:void 0},z.push(G)),this.stack.push(G)}function y(k){let I=this.stack.pop();I.value+=this.sliceSerialize(k),I.position.end=hn(k.end)}function Z(k){let I=this.stack[this.stack.length-1];if(this.data.atHardBreak){let z=I.children[I.children.length-1];z.position.end=hn(k.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(I.type)&&(E.call(this,k),y.call(this,k))}function F(){this.data.atHardBreak=!0}function _(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k}function R(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k}function U(){let k=this.resume(),I=this.stack[this.stack.length-1];I.value=k}function te(){let k=this.stack[this.stack.length-1];if(this.data.inReference){let I=this.data.referenceType||"shortcut";k.type+="Reference",k.referenceType=I,delete k.url,delete k.title}else delete k.identifier,delete k.label;this.data.referenceType=void 0}function oe(){let k=this.stack[this.stack.length-1];if(this.data.inReference){let I=this.data.referenceType||"shortcut";k.type+="Reference",k.referenceType=I,delete k.url,delete k.title}else delete k.identifier,delete k.label;this.data.referenceType=void 0}function Re(k){let I=this.sliceSerialize(k),z=this.stack[this.stack.length-2];z.label=bs(I),z.identifier=Oe(I).toLowerCase()}function J(){let k=this.stack[this.stack.length-1],I=this.resume(),z=this.stack[this.stack.length-1];if(this.data.inReference=!0,z.type==="link"){let G=k.children;z.children=G}else z.alt=I}function h(){let k=this.resume(),I=this.stack[this.stack.length-1];I.url=k}function Qe(){let k=this.resume(),I=this.stack[this.stack.length-1];I.title=k}function $t(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function Ge(k){let I=this.resume(),z=this.stack[this.stack.length-1];z.label=I,z.identifier=Oe(this.sliceSerialize(k)).toLowerCase(),this.data.referenceType="full"}function Fn(k){this.data.characterReferenceType=k.type}function $a(k){let I=this.sliceSerialize(k),z=this.data.characterReferenceType,G;z?(G=xs(I,z==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):G=_r(I);let Q=this.stack[this.stack.length-1];Q.value+=G}function Jo(k){let I=this.stack.pop();I.position.end=hn(k.end)}function Ce(k){y.call(this,k);let I=this.stack[this.stack.length-1];I.url=this.sliceSerialize(k)}function hi(k){y.call(this,k);let I=this.stack[this.stack.length-1];I.url="mailto:"+this.sliceSerialize(k)}function Ut(){return{type:"blockquote",children:[]}}function $n(){return{type:"code",lang:null,meta:null,value:""}}function Sr(){return{type:"inlineCode",value:""}}function Ua(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Bw(){return{type:"emphasis",children:[]}}function Bd(){return{type:"heading",depth:0,children:[]}}function qd(){return{type:"break"}}function jd(){return{type:"html",value:""}}function qw(){return{type:"image",title:null,url:"",alt:null}}function Hd(){return{type:"link",title:null,url:"",children:[]}}function Wd(k){return{type:"list",ordered:k.type==="listOrdered",start:null,spread:k._spread,children:[]}}function jw(k){return{type:"listItem",spread:k._spread,checked:null,children:[]}}function Hw(){return{type:"paragraph",children:[]}}function Ww(){return{type:"strong",children:[]}}function Gw(){return{type:"text",value:""}}function Vw(){return{type:"thematicBreak"}}}function hn(e){return{line:e.line,column:e.column,offset:e.offset}}function Pp(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?Pp(e,r):i0(e,r)}}function i0(e,t){let n;for(n in t)if(Rp.call(t,n))switch(n){case"canContainEols":{let r=t[n];r&&e[n].push(...r);break}case"transforms":{let r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{let r=t[n];r&&Object.assign(e[n],r);break}}}function Np(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Dr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Dr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Dr({start:t.start,end:t.end})+") is still open")}function Bu(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function qu(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var vr=(function(e){if(e==null)return u0;if(typeof e=="function")return Ms(e);if(typeof e=="object")return Array.isArray(e)?o0(e):s0(e);if(typeof e=="string")return a0(e);throw new Error("Expected function, string, or object as test")});function o0(e){let t=[],n=-1;for(;++n<e.length;)t[n]=vr(e[n]);return Ms(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function s0(e){let t=e;return Ms(n);function n(r){let i=r,o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function a0(e){return Ms(t);function t(n){return n&&n.type===e}}function Ms(e){return t;function t(n,r,i){return!!(l0(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function u0(){return!0}function l0(e){return e!==null&&typeof e=="object"&&"type"in e}function Lp(e){return"\x1B[33m"+e+"\x1B[39m"}var Fp=[],$p=!0,ju=!1,Up="skip";function Hu(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;let o=vr(i),s=r?-1:1;a(e,void 0,[])();function a(u,l,d){let c=u&&typeof u=="object"?u:{};if(typeof c.type=="string"){let p=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(m,"name",{value:"node ("+Lp(u.type+(p?"<"+p+">":""))+")"})}return m;function m(){let p=Fp,f,x,S;if((!t||o(u,l,d[d.length-1]||void 0))&&(p=c0(n(u,d)),p[0]===ju))return p;if("children"in u&&u.children){let w=u;if(w.children&&p[0]!==Up)for(x=(r?w.children.length:-1)+s,S=d.concat(w);x>-1&&x<w.children.length;){let D=w.children[x];if(f=a(D,x,S)(),f[0]===ju)return f;x=typeof f[1]=="number"?f[1]:x+s}}return p}}}function c0(e){return Array.isArray(e)?e:typeof e=="number"?[$p,e]:e==null?Fp:[e]}function Wu(e,t,n){let i=vr((n||{}).ignore||[]),o=d0(t),s=-1;for(;++s<o.length;)Hu(e,"text",a);function a(l,d){let c=-1,m;for(;++c<d.length;){let p=d[c],f=m?m.children:void 0;if(i(p,f?f.indexOf(p):void 0,m))return;m=p}if(m)return u(l,d)}function u(l,d){let c=d[d.length-1],m=o[s][0],p=o[s][1],f=0,S=c.children.indexOf(l),w=!1,D=[];m.lastIndex=0;let T=m.exec(l.value);for(;T;){let M=T.index,O={index:T.index,input:T.input,stack:[...d,l]},b=p(...T,O);if(typeof b=="string"&&(b=b.length>0?{type:"text",value:b}:void 0),b===!1?m.lastIndex=M+1:(f!==M&&D.push({type:"text",value:l.value.slice(f,M)}),Array.isArray(b)?D.push(...b):b&&D.push(b),f=M+T[0].length,w=!0),!m.global)break;T=m.exec(l.value)}return w?(f<l.value.length&&D.push({type:"text",value:l.value.slice(f)}),c.children.splice(S,1,...D)):D=[l],S+D.length}}function d0(e){let t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let i=n[r];t.push([m0(i[0]),p0(i[1])])}return t}function m0(e){return typeof e=="string"?new RegExp(qu(e),"g"):e}function p0(e){return typeof e=="function"?e:function(){return e}}function Vu(){return{transforms:[x0],enter:{literalAutolink:f0,literalAutolinkEmail:Gu,literalAutolinkHttp:Gu,literalAutolinkWww:Gu},exit:{literalAutolink:w0,literalAutolinkEmail:y0,literalAutolinkHttp:h0,literalAutolinkWww:g0}}}function f0(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Gu(e){this.config.enter.autolinkProtocol.call(this,e)}function h0(e){this.config.exit.autolinkProtocol.call(this,e)}function g0(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function y0(e){this.config.exit.autolinkEmail.call(this,e)}function w0(e){this.exit(e)}function x0(e){Wu(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,b0],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),k0]],{ignore:["link","linkReference"]})}function b0(e,t,n,r,i){let o="";if(!zp(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!S0(n)))return!1;let s=T0(n+r);if(!s[0])return!1;let a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function k0(e,t,n,r){return!zp(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function S0(e){let t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function T0(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")"),i=Bu(e,"("),o=Bu(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function zp(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Tt(n)||Gn(n))&&(!t||n!==47)}R0.peek=N0;function E0(){this.buffer()}function I0(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function A0(){this.buffer()}function _0(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function O0(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Oe(this.sliceSerialize(e)).toLowerCase(),n.label=t}function D0(e){this.exit(e)}function v0(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Oe(this.sliceSerialize(e)).toLowerCase(),n.label=t}function M0(e){this.exit(e)}function N0(){return"["}function R0(e,t,n,r){let i=n.createTracker(r),o=i.move("[^"),s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function Yu(){return{enter:{gfmFootnoteCallString:E0,gfmFootnoteCall:I0,gfmFootnoteDefinitionLabelString:A0,gfmFootnoteDefinition:_0},exit:{gfmFootnoteCallString:O0,gfmFootnoteCall:D0,gfmFootnoteDefinitionLabelString:v0,gfmFootnoteDefinition:M0}}}$0.peek=U0;function Zu(){return{canContainEols:["delete"],enter:{strikethrough:L0},exit:{strikethrough:F0}}}function L0(e){this.enter({type:"delete",children:[]},e)}function F0(e){this.exit(e)}function $0(e,t,n,r){let i=n.createTracker(r),o=n.enter("strikethrough"),s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function U0(){return"~"}function Ju(){return{enter:{table:B0,tableData:Bp,tableHeader:Bp,tableRow:j0},exit:{codeText:H0,table:q0,tableData:Ku,tableHeader:Ku,tableRow:Ku}}}function B0(e){let t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function q0(e){this.exit(e),this.data.inTable=void 0}function j0(e){this.enter({type:"tableRow",children:[]},e)}function Ku(e){this.exit(e)}function Bp(e){this.enter({type:"tableCell",children:[]},e)}function H0(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,W0));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function W0(e,t){return t==="|"?t:e}function Xu(){return{exit:{taskListCheckValueChecked:qp,taskListCheckValueUnchecked:qp,paragraph:V0}}}function qp(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function V0(e){let t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){let n=this.stack[this.stack.length-1];n.type;let r=n.children[0];if(r&&r.type==="text"){let i=t.children,o=-1,s;for(;++o<i.length;){let a=i[o];if(a.type==="paragraph"){s=a;break}}s===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function Qu(){return[Vu(),Yu(),Zu(),Ju(),Xu()]}var Z0={tokenize:eS,partial:!0},jp={tokenize:tS,partial:!0},Hp={tokenize:nS,partial:!0},Wp={tokenize:rS,partial:!0},K0={tokenize:iS,partial:!0},Gp={name:"wwwAutolink",tokenize:X0,previous:Yp},Vp={name:"protocolAutolink",tokenize:Q0,previous:Zp},Vt={name:"emailAutolink",tokenize:J0,previous:Kp},Et={};function tl(){return{text:Et}}var Kn=48;for(;Kn<123;)Et[Kn]=Vt,Kn++,Kn===58?Kn=65:Kn===91&&(Kn=97);Et[43]=Vt;Et[45]=Vt;Et[46]=Vt;Et[95]=Vt;Et[72]=[Vt,Vp];Et[104]=[Vt,Vp];Et[87]=[Vt,Gp];Et[119]=[Vt,Gp];function J0(e,t,n){let r=this,i,o;return s;function s(c){return!el(c)||!Kp.call(r,r.previous)||nl(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return el(c)?(e.consume(c),a):c===64?(e.consume(c),u):n(c)}function u(c){return c===46?e.check(K0,d,l)(c):c===45||c===95||he(c)?(o=!0,e.consume(c),u):d(c)}function l(c){return e.consume(c),i=!0,u}function d(c){return o&&i&&fe(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function X0(e,t,n){let r=this;return i;function i(s){return s!==87&&s!==119||!Yp.call(r,r.previous)||nl(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Z0,e.attempt(jp,e.attempt(Hp,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function Q0(e,t,n){let r=this,i="",o=!1;return s;function s(c){return(c===72||c===104)&&Zp.call(r,r.previous)&&!nl(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(fe(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){let m=i.toLowerCase();if(m==="http"||m==="https")return e.consume(c),u}return n(c)}function u(c){return c===47?(e.consume(c),o?l:(o=!0,u)):n(c)}function l(c){return c===null||Wn(c)||q(c)||Tt(c)||Gn(c)?n(c):e.attempt(jp,e.attempt(Hp,d),n)(c)}function d(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function eS(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function tS(e,t,n){let r,i,o;return s;function s(l){return l===46||l===95?e.check(Wp,u,a)(l):l===null||q(l)||Tt(l)||l!==45&&Gn(l)?u(l):(o=!0,e.consume(l),s)}function a(l){return l===95?r=!0:(i=r,r=void 0),e.consume(l),s}function u(l){return i||r||!o?n(l):t(l)}}function nS(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Wp,t,o)(s):s===null||q(s)||Tt(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function rS(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),o):a===93?(e.consume(a),i):a===60||a===null||q(a)||Tt(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||q(a)||Tt(a)?t(a):r(a)}function o(a){return fe(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):fe(a)?(e.consume(a),s):n(a)}}function iS(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return he(o)?n(o):t(o)}}function Yp(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||q(e)}function Zp(e){return!fe(e)}function Kp(e){return!(e===47||el(e))}function el(e){return e===43||e===45||e===46||e===95||he(e)}function nl(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var oS={tokenize:mS,partial:!0};function rl(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:lS,continuation:{tokenize:cS},exit:dS}},text:{91:{name:"gfmFootnoteCall",tokenize:uS},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:sS,resolveTo:aS}}}}function sS(e,t,n){let r=this,i=r.events.length,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),s;for(;i--;){let u=r.events[i][1];if(u.type==="labelImage"){s=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return a;function a(u){if(!s||!s._balanced)return n(u);let l=Oe(r.sliceSerialize({start:s.end,end:r.now()}));return l.codePointAt(0)!==94||!o.includes(l.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function aS(e,t){let n=e.length,r;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){r=e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";let i={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;let s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[e[n+1],e[n+2],["enter",i,t],e[n+3],e[n+4],["enter",o,t],["exit",o,t],["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(n,e.length-n+1,...u),e}function uS(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o=0,s;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",l)}function l(c){if(o>999||c===93&&!s||c===null||c===91||q(c))return n(c);if(c===93){e.exit("chunkString");let m=e.exit("gfmFootnoteCallString");return i.includes(Oe(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return q(c)||(s=!0),o++,e.consume(c),c===92?d:l}function d(c){return c===91||c===92||c===93?(e.consume(c),o++,l):l(c)}}function lS(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o,s=0,a;return u;function u(f){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionLabelMarker"),l}function l(f){return f===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(f)}function d(f){if(s>999||f===93&&!a||f===null||f===91||q(f))return n(f);if(f===93){e.exit("chunkString");let x=e.exit("gfmFootnoteDefinitionLabelString");return o=Oe(r.sliceSerialize(x)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(f),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return q(f)||(a=!0),s++,e.consume(f),f===92?c:d}function c(f){return f===91||f===92||f===93?(e.consume(f),s++,d):d(f)}function m(f){return f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),i.includes(o)||i.push(o),P(e,p,"gfmFootnoteDefinitionWhitespace")):n(f)}function p(f){return t(f)}}function cS(e,t,n){return e.check(Ct,t,e.attempt(oS,t,n))}function dS(e){e.exit("gfmFootnoteDefinition")}function mS(e,t,n){let r=this;return P(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){let s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function il(e){let n=(e||{}).singleTilde,r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let u=-1;for(;++u<s.length;)if(s[u][0]==="enter"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._close){let l=u;for(;l--;)if(s[l][0]==="exit"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._open&&s[u][1].end.offset-s[u][1].start.offset===s[l][1].end.offset-s[l][1].start.offset){s[u][1].type="strikethroughSequence",s[l][1].type="strikethroughSequence";let d={type:"strikethrough",start:Object.assign({},s[l][1].start),end:Object.assign({},s[u][1].end)},c={type:"strikethroughText",start:Object.assign({},s[l][1].end),end:Object.assign({},s[u][1].start)},m=[["enter",d,a],["enter",s[l][1],a],["exit",s[l][1],a],["enter",c,a]],p=a.parser.constructs.insideSpan.null;p&&me(m,m.length,0,fn(p,s.slice(l+1,u),a)),me(m,m.length,0,[["exit",c,a],["enter",s[u][1],a],["exit",s[u][1],a],["exit",d,a]]),me(s,l-1,u-l+3,m),u=l+m.length-2;break}}for(u=-1;++u<s.length;)s[u][1].type==="strikethroughSequenceTemporary"&&(s[u][1].type="data");return s}function o(s,a,u){let l=this.previous,d=this.events,c=0;return m;function m(f){return l===126&&d[d.length-1][1].type!=="characterEscape"?u(f):(s.enter("strikethroughSequenceTemporary"),p(f))}function p(f){let x=Or(l);if(f===126)return c>1?u(f):(s.consume(f),c++,p);if(c<2&&!n)return u(f);let S=s.exit("strikethroughSequenceTemporary"),w=Or(f);return S._open=!w||w===2&&!!x,S._close=!x||x===2&&!!w,a(f)}}}var Ns=class{constructor(){this.map=[]}add(t,n,r){pS(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[0]}),this.map.length===0)return;let n=this.map.length,r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(let o of i)t.push(o);i=r.pop()}this.map.length=0}};function pS(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function Jp(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){let o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function ol(){return{flow:{null:{name:"table",tokenize:fS,resolveAll:hS}}}}function fS(e,t,n){let r=this,i=0,o=0,s;return a;function a(y){let Z=r.events.length-1;for(;Z>-1;){let R=r.events[Z][1].type;if(R==="lineEnding"||R==="linePrefix")Z--;else break}let F=Z>-1?r.events[Z][1].type:null,_=F==="tableHead"||F==="tableRow"?b:u;return _===b&&r.parser.lazy[r.now().line]?n(y):_(y)}function u(y){return e.enter("tableHead"),e.enter("tableRow"),l(y)}function l(y){return y===124||(s=!0,o+=1),d(y)}function d(y){return y===null?n(y):A(y)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):n(y):L(y)?P(e,d,"whitespace")(y):(o+=1,s&&(s=!1,i+=1),y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),s=!0,d):(e.enter("data"),c(y)))}function c(y){return y===null||y===124||q(y)?(e.exit("data"),d(y)):(e.consume(y),y===92?m:c)}function m(y){return y===92||y===124?(e.consume(y),c):c(y)}function p(y){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(y):(e.enter("tableDelimiterRow"),s=!1,L(y)?P(e,f,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(y):f(y))}function f(y){return y===45||y===58?S(y):y===124?(s=!0,e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),x):O(y)}function x(y){return L(y)?P(e,S,"whitespace")(y):S(y)}function S(y){return y===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),w):y===45?(o+=1,w(y)):y===null||A(y)?M(y):O(y)}function w(y){return y===45?(e.enter("tableDelimiterFiller"),D(y)):O(y)}function D(y){return y===45?(e.consume(y),D):y===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(y),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(y))}function T(y){return L(y)?P(e,M,"whitespace")(y):M(y)}function M(y){return y===124?f(y):y===null||A(y)?!s||i!==o?O(y):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(y)):O(y)}function O(y){return n(y)}function b(y){return e.enter("tableRow"),C(y)}function C(y){return y===124?(e.enter("tableCellDivider"),e.consume(y),e.exit("tableCellDivider"),C):y===null||A(y)?(e.exit("tableRow"),t(y)):L(y)?P(e,C,"whitespace")(y):(e.enter("data"),N(y))}function N(y){return y===null||y===124||q(y)?(e.exit("data"),C(y)):(e.consume(y),y===92?E:N)}function E(y){return y===92||y===124?(e.consume(y),N):N(y)}}function hS(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,u=0,l,d,c,m=new Ns;for(;++n<e.length;){let p=e[n],f=p[1];p[0]==="enter"?f.type==="tableHead"?(a=!1,u!==0&&(Xp(m,t,u,l,d),d=void 0,u=0),l={type:"table",start:Object.assign({},f.start),end:Object.assign({},f.end)},m.add(n,0,[["enter",l,t]])):f.type==="tableRow"||f.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,d={type:"tableBody",start:Object.assign({},f.start),end:Object.assign({},f.end)},m.add(n,0,[["enter",d,t]])),i=f.type==="tableDelimiterRow"?2:d?3:1):i&&(f.type==="data"||f.type==="tableDelimiterMarker"||f.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=Rs(m,t,o,i,void 0,c),o=[0,0,0,0]),s[2]=n)):f.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],c=Rs(m,t,o,i,void 0,c)),o=s,s=[o[1],n,0,0])):f.type==="tableHead"?(a=!0,u=n):f.type==="tableRow"||f.type==="tableDelimiterRow"?(u=n,o[1]!==0?(s[0]=s[1],c=Rs(m,t,o,i,n,c)):s[1]!==0&&(c=Rs(m,t,s,i,n,c)),i=0):i&&(f.type==="data"||f.type==="tableDelimiterMarker"||f.type==="tableDelimiterFiller")&&(s[3]=n)}for(u!==0&&Xp(m,t,u,l,d),m.consume(t.events),n=-1;++n<t.events.length;){let p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=Jp(t.events,n))}return e}function Rs(e,t,n,r,i,o){let s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Mr(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));let u=Mr(t.events,n[1]);if(o={type:s,start:Object.assign({},u),end:Object.assign({},u)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){let l=Mr(t.events,n[2]),d=Mr(t.events,n[3]),c={type:a,start:Object.assign({},l),end:Object.assign({},d)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){let m=t.events[n[2]],p=t.events[n[3]];if(m[1].end=Object.assign({},p[1].end),m[1].type="chunkText",m[1].contentType="text",n[3]>n[2]+1){let f=n[2]+1,x=n[3]-n[2]-1;e.add(f,x,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},Mr(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Xp(e,t,n,r,i){let o=[],s=Mr(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Mr(e,t){let n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}var gS={name:"tasklistCheck",tokenize:yS};function sl(){return{text:{91:gS}}}function yS(e,t,n){let r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return q(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),s):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),s):n(u)}function s(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(u)}function a(u){return A(u)?t(u):L(u)?e.check({tokenize:wS},t,n)(u):n(u)}}function wS(e,t,n){return P(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function Qp(e){return ks([tl(),rl(),il(e),ol(),sl()])}var xS=new Set("*_~`[]<>|!\\-+"),bS=new Set("*_[]|"),kS=new Set(".-+_"),SS=/[\w.+-]/,ef=1e7;function TS(e){if(e.length>Im)return!1;let t=0,n=1,r=0,i=!0,o=!0,s=0,a="",u=0,l=0,d=0;for(let c of e){if(SS.test(c))u+=1,kS.has(a)&&(l+=1);else if(l>0){if(d+=l*u,d>ef)return!1;u=l=0}else u=0;if(c===`
|
|
59
|
+
`){if(++n>4e3)return!1;i=!0,o=!0,r=0,s=0,a="";continue}if(i&&(c===" "||c===" ")){if(r+=c===" "?4:1,r>128)return!1}else i=!1;let m=o&&(c==="."||c===")")&&a>="0"&&a<="9";if(o&&=m||" >-+*0123456789".includes(c),(m||xS.has(c)&&(c!==a||bS.has(c)||o&&c===">"))&&(++s>128||++t>2e3))return!1;a=c}return d+l*u<=ef}var al=4e3;function CS(e){let t=[{node:e,depth:0}],n=0;for(;t.length;){let{node:r,depth:i}=t.pop();if(n+=1,r.type==="table"&&(n+=(r.children?.length??0)*(r.children?.[0]?.children?.length??0)),i>32||n>al)return!1;for(let o of r.children??[])t.push({node:o,depth:i+1})}return!0}function tf(e){if(!TS(e))return null;let t=zu(e,{extensions:[Qp()],mdastExtensions:[Qu()]});return CS(t)?t:null}var nf={note:"Note",tip:"Tip",important:"Important",warning:"Warning",caution:"Caution"};var ES=/^\[!(note|tip|important|warning|caution)\][ \t]*(?:\r?\n|$)/i;function rf(e){let t=new Map;for(let n of e.children??[]){let r=n.type==="blockquote"?IS(n):null;r&&t.set(n,r)}return t}function IS(e){let t=e.children?.[0],n=t?.type==="paragraph"?t.children??[]:[],[r,i]=n,o=r?.type==="text"?ES.exec(r.value??""):null;if(!t||!r||!o)return null;let s=r.value.slice(o[0].length);if(!s&&i&&i.type!=="break"&&!o[0].endsWith(`
|
|
60
|
+
`))return null;let a=s?0:i?.type==="break"?2:1;return n.length===a&&e.children.length===1?null:(r.value=s,n.splice(0,a),n.length||e.children.shift(),o[1].toLowerCase())}var AS=64,ul=/[ \t\n\r]*/y,of=/"(?:[^"\\]|\\.)*"/y,_S=/-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?|true|false|null/y;function ll(e){if(!/^[ \t\n\r]*[[{]/.test(e))return null;try{JSON.parse(e)}catch{return null}let t=0,n=()=>{ul.lastIndex=t,ul.exec(e),t=ul.lastIndex},r=a=>{let u=JSON.parse(a);return xi(u)?null:u},i=a=>{a.lastIndex=t;let u=a.exec(e)[0];return t=a.lastIndex,u},o=0,s=a=>{if(++o>al)return null;n();let u=e[t];if(u==="{"||u==="["){if(a>=AS)return null;t++,n();let d=u==="{"?{kind:"object",entries:[]}:{kind:"array",items:[]};for(;e[t]!==(u==="{"?"}":"]");){if(e[t]===","&&t++,d.kind==="object"){n();let c=i(of),m=r(c);n(),t++;let p=s(a+1);if(m===null||!p)return null;d.entries.push({key:m,keyText:c,value:p})}else{let c=s(a+1);if(!c)return null;d.items.push(c)}n()}return t++,d}if(u==='"'){let d=i(of),c=r(d);return c===null?null:{kind:"string",text:d,value:c}}let l=i(_S);return{kind:l==="null"?"null":l==="true"||l==="false"?"boolean":"number",text:l}};return s(0)}var Ps=e=>e.replace(/\s+/gu," ").trim(),OS=/^\s*(?:```|~~~)|^\s{0,3}(?:([-*_])(?:\s*\1){2,}|=+)\s*$|^\s*\|?(?:\s*:?-+:?\s*\|)+\s*(?::?-+:?\s*)?$/,DS=/^\s{0,3}(?:>\s?)*\s*(?:#{1,6}\s+|(?:[-*+]|\d{1,9}[.)])\s+(?:\[[ xX]\]\s+)?)?/,vS=[[/\\\r?$/,""],[/!?\[([^\]]*)\]\([^)]*\)/g,"$1"],[/<((?:https?|mailto):[^>\s]+)>/g,"$1"],[/`+([^`]+)`+/g,"$1"],[/\*\*([^*]+)\*\*/g,"$1"],[/__([^_]+)__/g,"$1"],[/~~([^~]+)~~/g,"$1"],[/\*([^*\s](?:[^*]*[^*\s])?)\*/g,"$1"],[/(?<![\p{L}\p{N}_])_([^_\s](?:[^_]*[^_\s])?)_(?![\p{L}\p{N}_])/gu,"$1"],[/\\([!-/:-@[-`{-~])/g,"$1"]];function sf(e,t){let n=bi(e);if(t!=="markdown")return Ps(n);if(OS.test(n))return"";let r=n.replace(DS,"");for(let[i,o]of vS)r=r.replace(i,o);return Ps(r)}var af=e=>e.replace(/[\s.!?…:;,]+$/u,"");function Ni(e,t){let n=af(bi(e));return n!==""&&n===af(bi(t))}function MS(e,t,n){let r=t.findIndex(o=>sf(o,n)!=="");if(!e||r===-1)return-1;let i=t[r];return Ni(sf(i,n),e)||Ni(RS(i,n),e)?r:-1}var NS=/^\s*(?:```|~~~)|\]\(|<(?:https?|mailto):|https?:\/\/|www\./im;function cl(e,t,n){if(!t)return"";let r=t.split(`
|
|
61
|
+
`),i=MS(e,r,n);return i===-1||ll(t)||(n==="markdown"?NS.test(r.slice(0,i+1).join(`
|
|
62
|
+
`)):!Ni(r[i],e))?t:r.slice(i+1).join(`
|
|
63
|
+
`).replace(/^(?:[ \t]*\n)+/,"")}function RS(e,t){return PS(e,t,n=>n.value)}function PS(e,t,n){let r=bi(e),i=t==="markdown"&&!ll(r)?tf(r):null;return i?qS(LS(i,n)):Ps(r)}function LS(e,t){let n=[],r=null,i=!1,o=null,s=rf(e),a=new Set(e.children),u=[{node:e}];for(;u.length;){let{node:l,number:d}=u.pop();switch(a.has(l)&&(o=null),l.type){case"paragraph":case"heading":case"tableCell":case"code":case"html":{let c=l.type==="html"?zS(l.value):[{kind:l.type==="heading"?"heading":l.type==="tableCell"?"cell":"other",text:l.type==="code"?t(l):FS(l)}];for(let m of c){let p=m.text;o&&(p=`${o}: ${p}`);let f=m.kind==="other"&&r?"item":m.kind;r?.number!==void 0&&(p=`${r.number}. ${p}`);let x=i||m.rowStart;n.push({kind:f,text:p,...r?.number!==void 0?{number:r.number}:{},...x?{rowStart:x}:{}}),r=null,i=!1,o=null}break}case"list":for(let c=l.children.length-1;c>=0;c--)u.push({node:l.children[c],...l.ordered?{number:(l.start??1)+c}:{}});break;case"listItem":r=d===void 0?{}:{number:d},Nr(u,l);break;case"tableRow":i=!0,Nr(u,l);break;case"blockquote":{let c=s.get(l);c&&(o=nf[c]),Nr(u,l);break}case"definition":case"thematicBreak":break;default:"children"in l&&Nr(u,l)}}return n}function Nr(e,t){for(let n=t.children.length-1;n>=0;n--)e.push({node:t.children[n]})}function FS(e){let t="",n=[];for(Nr(n,e);n.length;){let{node:r}=n.pop();r.type==="text"||r.type==="inlineCode"?t+=r.value:r.type==="image"||r.type==="imageReference"?t+=r.alt??"":r.type==="break"?t+=" ":r.type==="html"?t+=lf(r.value):"children"in r&&Nr(n,r)}return t}var $S=/<\/?(?:a|abbr|b|bdi|bdo|cite|code|data|del|dfn|em|font|i|ins|kbd|mark|q|s|samp|small|span|strike|strong|sub|sup|time|u|var|wbr)\b[^<>]*>/giu,uf=e=>e.replace(/<!--[\s\S]*?(?:-->|$)/gu," ").replace(/<(script|style)\b[\s\S]*?(?:<\/\1\s*>|$)/giu," ");function lf(e){return bs(uf(e).replace(/<img\b[^<>]*?\balt\s*=\s*(?:"([^"<>]*)"|'([^'<>]*)')[^<>]*>/giu," $1$2 ").replace($S,"").replace(/<[^<>]*>/gu," "))}var US=/<(\/?)(h[1-6]|li|t[dh]|tr|p|div|ul|ol|table|blockquote|pre|hr|section|article|header|footer)\b[^<>]*>/giu;function zS(e){let t=[],n=uf(e),r="other",i=!1,o=0,s=a=>{let u=lf(n.slice(o,a));u.trim()&&(t.push({kind:r,text:u,...i?{rowStart:i}:{}}),i=!1)};for(let a of n.matchAll(US)){s(a.index),o=a.index+a[0].length;let[,u,l]=a,d=l.toLowerCase();d==="tr"?i=!u:r=u?"other":/^h\d$/u.test(d)?"heading":d==="li"?"item":/^t[dh]$/u.test(d)?"cell":"other"}return s(n.length),t}var BS=/[\p{Terminal_Punctuation}…][\p{Pe}\p{Pf}"']*$/u;function qS(e){let t="",n=null;for(let r of e){let i=Ps(r.text);i&&(n&&(t+=jS(n,r,t)),t+=i,n=r)}return t}function jS(e,t,n){return BS.test(n)?" ":e.kind==="heading"?" \u2014 ":t.kind==="heading"?". ":e.kind==="cell"&&t.kind==="cell"?t.rowStart?"; ":", ":e.kind==="item"&&t.kind==="item"?t.number===void 0?", ":" ":". "}var Gs={};Gd(Gs,{Chrono:()=>er,GB:()=>n1,Meridiem:()=>j,ParsingComponents:()=>W,ParsingResult:()=>ft,ReferenceWithTimezone:()=>It,Weekday:()=>K,casual:()=>Ws,configuration:()=>Hs,parse:()=>r1,parseDate:()=>i1,strict:()=>Vf});var j;(function(e){e[e.AM=0]="AM",e[e.PM=1]="PM"})(j||(j={}));var K;(function(e){e[e.SUNDAY=0]="SUNDAY",e[e.MONDAY=1]="MONDAY",e[e.TUESDAY=2]="TUESDAY",e[e.WEDNESDAY=3]="WEDNESDAY",e[e.THURSDAY=4]="THURSDAY",e[e.FRIDAY=5]="FRIDAY",e[e.SATURDAY=6]="SATURDAY"})(K||(K={}));var Ke;(function(e){e[e.JANUARY=1]="JANUARY",e[e.FEBRUARY=2]="FEBRUARY",e[e.MARCH=3]="MARCH",e[e.APRIL=4]="APRIL",e[e.MAY=5]="MAY",e[e.JUNE=6]="JUNE",e[e.JULY=7]="JULY",e[e.AUGUST=8]="AUGUST",e[e.SEPTEMBER=9]="SEPTEMBER",e[e.OCTOBER=10]="OCTOBER",e[e.NOVEMBER=11]="NOVEMBER",e[e.DECEMBER=12]="DECEMBER"})(Ke||(Ke={}));function pt(e,t){e.assign("day",t.getDate()),e.assign("month",t.getMonth()+1),e.assign("year",t.getFullYear())}function Ls(e,t){e.assign("hour",t.getHours()),e.assign("minute",t.getMinutes()),e.assign("second",t.getSeconds()),e.assign("millisecond",t.getMilliseconds()),e.assign("meridiem",t.getHours()<12?j.AM:j.PM)}function Yt(e,t){e.imply("day",t.getDate()),e.imply("month",t.getMonth()+1),e.imply("year",t.getFullYear())}function Ri(e,t){e.imply("hour",t.getHours()),e.imply("minute",t.getMinutes()),e.imply("second",t.getSeconds()),e.imply("millisecond",t.getMilliseconds()),e.imply("meridiem",t.getHours()<12?j.AM:j.PM)}var WS={ACDT:630,ACST:570,ADT:-180,AEDT:660,AEST:600,AFT:270,AKDT:-480,AKST:-540,ALMT:360,AMST:-180,AMT:-240,ANAST:720,ANAT:720,AQTT:300,ART:-180,AST:-240,AWDT:540,AWST:480,AZOST:0,AZOT:-60,AZST:300,AZT:240,BNT:480,BOT:-240,BRST:-120,BRT:-180,BST:60,BTT:360,CAST:480,CAT:120,CCT:390,CDT:-300,CEST:120,CET:{timezoneOffsetDuringDst:120,timezoneOffsetNonDst:60,dstStart:e=>cf(e,Ke.MARCH,K.SUNDAY,2),dstEnd:e=>cf(e,Ke.OCTOBER,K.SUNDAY,3)},CHADT:825,CHAST:765,CKT:-600,CLST:-180,CLT:-240,COT:-300,CST:-360,CT:{timezoneOffsetDuringDst:-300,timezoneOffsetNonDst:-360,dstStart:e=>gn(e,Ke.MARCH,K.SUNDAY,2,2),dstEnd:e=>gn(e,Ke.NOVEMBER,K.SUNDAY,1,2)},CVT:-60,CXT:420,ChST:600,DAVT:420,EASST:-300,EAST:-360,EAT:180,ECT:-300,EDT:-240,EEST:180,EET:120,EGST:0,EGT:-60,EST:-300,ET:{timezoneOffsetDuringDst:-240,timezoneOffsetNonDst:-300,dstStart:e=>gn(e,Ke.MARCH,K.SUNDAY,2,2),dstEnd:e=>gn(e,Ke.NOVEMBER,K.SUNDAY,1,2)},FJST:780,FJT:720,FKST:-180,FKT:-240,FNT:-120,GALT:-360,GAMT:-540,GET:240,GFT:-180,GILT:720,GMT:0,GST:240,GYT:-240,HAA:-180,HAC:-300,HADT:-540,HAE:-240,HAP:-420,HAR:-360,HAST:-600,HAT:-90,HAY:-480,HKT:480,HLV:-210,HNA:-240,HNC:-360,HNE:-300,HNP:-480,HNR:-420,HNT:-150,HNY:-540,HOVT:420,ICT:420,IDT:180,IOT:360,IRDT:270,IRKST:540,IRKT:540,IRST:210,IST:330,JST:540,KGT:360,KRAST:480,KRAT:480,KST:540,KUYT:240,LHDT:660,LHST:630,LINT:840,MAGST:720,MAGT:720,MART:-510,MAWT:300,MDT:-360,MESZ:120,MEZ:60,MHT:720,MMT:390,MSD:240,MSK:180,MST:-420,MT:{timezoneOffsetDuringDst:-360,timezoneOffsetNonDst:-420,dstStart:e=>gn(e,Ke.MARCH,K.SUNDAY,2,2),dstEnd:e=>gn(e,Ke.NOVEMBER,K.SUNDAY,1,2)},MUT:240,MVT:300,MYT:480,NCT:660,NDT:-90,NFT:690,NOVST:420,NOVT:360,NPT:345,NST:-150,NUT:-660,NZDT:780,NZST:720,OMSST:420,OMST:420,PDT:-420,PET:-300,PETST:720,PETT:720,PGT:600,PHOT:780,PHT:480,PKT:300,PMDT:-120,PMST:-180,PONT:660,PST:-480,PT:{timezoneOffsetDuringDst:-420,timezoneOffsetNonDst:-480,dstStart:e=>gn(e,Ke.MARCH,K.SUNDAY,2,2),dstEnd:e=>gn(e,Ke.NOVEMBER,K.SUNDAY,1,2)},PWT:540,PYST:-180,PYT:-240,RET:240,SAMT:240,SAST:120,SBT:660,SCT:240,SGT:480,SRT:-180,SST:-660,TAHT:-600,TFT:300,TJT:300,TKT:780,TLT:540,TMT:300,TVT:720,ULAT:480,UTC:0,UYST:-120,UYT:-180,UZT:300,VET:-210,VLAST:660,VLAT:660,VUT:660,WAST:120,WAT:60,WEST:60,WESZ:60,WET:0,WEZ:0,WFT:720,WGST:-120,WGT:-180,WIB:420,WIT:540,WITA:480,WST:780,WT:0,YAKST:600,YAKT:600,YAPT:600,YEKST:360,YEKT:360};function gn(e,t,n,r,i=0){let o=0,s=0;for(;s<r;)o++,new Date(e,t-1,o).getDay()===n&&s++;return new Date(e,t-1,o,i)}function cf(e,t,n,r=0){let i=n===0?7:n,o=new Date(e,t-1+1,1,12),s=o.getDay()===0?7:o.getDay(),a;return s===i?a=7:s<i?a=7+s-i:a=s-i,o.setDate(o.getDate()-a),new Date(e,t-1,o.getDate(),r)}function Fs(e,t,n={}){if(e==null)return null;if(typeof e=="number")return e;let r=n[e]??WS[e];return r==null?null:typeof r=="number"?r:t==null?null:t>r.dstStart(t.getFullYear())&&!(t>r.dstEnd(t.getFullYear()))?r.timezoneOffsetDuringDst:r.timezoneOffsetNonDst}var df={day:0,second:0,millisecond:0};function ke(e,t){let n=new Date(e);if(t.y&&(t.year=t.y,delete t.y),t.mo&&(t.month=t.mo,delete t.mo),t.M&&(t.month=t.M,delete t.M),t.w&&(t.week=t.w,delete t.w),t.d&&(t.day=t.d,delete t.d),t.h&&(t.hour=t.h,delete t.h),t.m&&(t.minute=t.m,delete t.m),t.s&&(t.second=t.s,delete t.s),t.ms&&(t.millisecond=t.ms,delete t.ms),"year"in t){let r=Math.floor(t.year);n.setFullYear(n.getFullYear()+r);let i=t.year-r;i>0&&(t.month=t?.month??0,t.month+=i*12)}if("quarter"in t){let r=Math.floor(t.quarter);n.setMonth(n.getMonth()+r*3)}if("month"in t){let r=Math.floor(t.month);n.setMonth(n.getMonth()+r);let i=t.month-r;i>0&&(t.week=t?.week??0,t.week+=i*4)}if("week"in t){let r=Math.floor(t.week);n.setDate(n.getDate()+r*7);let i=t.week-r;i>0&&(t.day=t?.day??0,t.day+=Math.round(i*7))}if("day"in t){let r=Math.floor(t.day);n.setDate(n.getDate()+r);let i=t.day-r;i>0&&(t.hour=t?.hour??0,t.hour+=Math.round(i*24))}if("hour"in t){let r=Math.floor(t.hour);n.setHours(n.getHours()+r);let i=t.hour-r;i>0&&(t.minute=t?.minute??0,t.minute+=Math.round(i*60))}if("minute"in t){let r=Math.floor(t.minute);n.setMinutes(n.getMinutes()+r);let i=t.minute-r;i>0&&(t.second=t?.second??0,t.second+=Math.round(i*60))}if("second"in t){let r=Math.floor(t.second);n.setSeconds(n.getSeconds()+r);let i=t.second-r;i>0&&(t.millisecond=t?.millisecond??0,t.millisecond+=Math.round(i*1e3))}if("millisecond"in t){let r=Math.floor(t.millisecond);n.setMilliseconds(n.getMilliseconds()+r)}return n}function yn(e){let t={};for(let n in e)t[n]=-e[n];return t}var It=class e{instant;timezoneOffset;constructor(t,n){this.instant=t??new Date,this.timezoneOffset=n??null}static fromDate(t){return new e(t)}static fromInput(t,n){if(t instanceof Date)return e.fromDate(t);let r=t?.instant??new Date,i=Fs(t?.timezone,r,n);return new e(r,i)}getDateWithAdjustedTimezone(){let t=new Date(this.instant);return this.timezoneOffset!==null&&t.setMinutes(t.getMinutes()-this.getSystemTimezoneAdjustmentMinute(this.instant)),t}getSystemTimezoneAdjustmentMinute(t,n){t||(t=new Date);let r=-t.getTimezoneOffset(),i=n??this.timezoneOffset??r;return r-i}getTimezoneOffset(){return this.timezoneOffset??-this.instant.getTimezoneOffset()}},W=class e{knownValues;impliedValues;reference;_tags=new Set;constructor(t,n){if(this.reference=t,this.knownValues={},this.impliedValues={},n)for(let i in n)this.knownValues[i]=n[i];let r=t.getDateWithAdjustedTimezone();this.imply("day",r.getDate()),this.imply("month",r.getMonth()+1),this.imply("year",r.getFullYear()),this.imply("hour",12),this.imply("minute",0),this.imply("second",0),this.imply("millisecond",0)}static createRelativeFromReference(t,n=df){let r=ke(t.getDateWithAdjustedTimezone(),n),i=new e(t);return i.addTag("result/relativeDate"),"hour"in n||"minute"in n||"second"in n||"millisecond"in n?(i.addTag("result/relativeDateAndTime"),Ls(i,r),pt(i,r),i.assign("timezoneOffset",t.getTimezoneOffset())):(Ri(i,r),i.imply("timezoneOffset",t.getTimezoneOffset()),"day"in n?(i.assign("day",r.getDate()),i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear()),i.assign("weekday",r.getDay())):"week"in n?(i.assign("day",r.getDate()),i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear()),i.imply("weekday",r.getDay())):(i.imply("day",r.getDate()),"month"in n?(i.assign("month",r.getMonth()+1),i.assign("year",r.getFullYear())):(i.imply("month",r.getMonth()+1),"year"in n?i.assign("year",r.getFullYear()):i.imply("year",r.getFullYear())))),i}get(t){return t in this.knownValues?this.knownValues[t]:t in this.impliedValues?this.impliedValues[t]:null}isCertain(t){return t in this.knownValues}getCertainComponents(){return Object.keys(this.knownValues)}imply(t,n){return t in this.knownValues?this:(this.impliedValues[t]=n,this)}assign(t,n){return this.knownValues[t]=n,delete this.impliedValues[t],this}addDurationAsImplied(t){let n=this.dateWithoutTimezoneAdjustment(),r=ke(n,t);return("day"in t||"week"in t||"month"in t||"year"in t)&&(this.delete(["day","weekday","month","year"]),this.imply("day",r.getDate()),this.imply("weekday",r.getDay()),this.imply("month",r.getMonth()+1),this.imply("year",r.getFullYear())),("second"in t||"minute"in t||"hour"in t)&&(this.delete(["second","minute","hour"]),this.imply("second",r.getSeconds()),this.imply("minute",r.getMinutes()),this.imply("hour",r.getHours())),this}delete(t){typeof t=="string"&&(t=[t]);for(let n of t)delete this.knownValues[n],delete this.impliedValues[n]}clone(){let t=new e(this.reference);t.knownValues={},t.impliedValues={};for(let n in this.knownValues)t.knownValues[n]=this.knownValues[n];for(let n in this.impliedValues)t.impliedValues[n]=this.impliedValues[n];return t}isOnlyDate(){return!this.isCertain("hour")&&!this.isCertain("minute")&&!this.isCertain("second")}isOnlyTime(){return!this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")&&!this.isCertain("year")}isOnlyWeekdayComponent(){return this.isCertain("weekday")&&!this.isCertain("day")&&!this.isCertain("month")}isDateWithUnknownYear(){return this.isCertain("month")&&!this.isCertain("year")}isValidDate(){let t=new Date(Date.UTC(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond")));return t.setUTCFullYear(this.get("year")),!(t.getUTCFullYear()!==this.get("year")||t.getUTCMonth()!==this.get("month")-1||t.getUTCDate()!==this.get("day")||this.get("hour")!=null&&t.getUTCHours()!=this.get("hour")||this.get("minute")!=null&&t.getUTCMinutes()!=this.get("minute"))}toString(){return`[ParsingComponents {
|
|
53
64
|
tags: ${JSON.stringify(Array.from(this._tags).sort())},
|
|
54
65
|
knownValues: ${JSON.stringify(this.knownValues)},
|
|
55
66
|
impliedValues: ${JSON.stringify(this.impliedValues)}},
|
|
56
|
-
reference: ${JSON.stringify(this.reference)}]`}date(){let t=this.get("timezoneOffset")??this.reference.timezoneOffset;if(t==null)return this.dateWithoutTimezoneAdjustment();let n=new Date(Date.UTC(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond")));return n.setUTCFullYear(this.get("year")),new Date(n.getTime()-t*6e4)}addTag(t){return this._tags.add(t),this}addTags(t){for(let n of t)this._tags.add(n);return this}tags(){return new Set(this._tags)}dateWithoutTimezoneAdjustment(){let t=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return t.setFullYear(this.get("year")),t}},mt=class e{refDate;index;text;reference;start;end;constructor(t,n,r,i,o){this.reference=t,this.refDate=t.instant,this.index=n,this.text=r,this.start=i||new U(t),this.end=o}clone(){let t=new e(this.reference,this.index,this.text);return t.start=this.start?this.start.clone():null,t.end=this.end?this.end.clone():null,t}date(){return this.start.date()}addTag(t){return this.start.addTag(t),this.end&&this.end.addTag(t),this}addTags(t){return this.start.addTags(t),this.end&&this.end.addTags(t),this}tags(){let t=new Set(this.start.tags());if(this.end)for(let n of this.end.tags())t.add(n);return t}toString(){let t=Array.from(this.tags()).sort();return`[ParsingResult {index: ${this.index}, text: '${this.text}', tags: ${JSON.stringify(t)} ...}]`}};function Du(e,t,n="\\s{0,5},?\\s{0,5}"){let r=t.replace(/\((?!\?)/g,"(?:");return`${e}${r}(?:${n}${r}){0,10}`}function P0(e){let t;return e instanceof Array?t=[...e]:e instanceof Map?t=Array.from(e.keys()):t=Object.keys(e),t}function fe(e){return`(?:${P0(e).sort((n,r)=>r.length-n.length).join("|").replace(/\./g,"\\.")})`}function Ts(e){return e<100&&(e>50?e=e+1900:e=e+2e3),e}function pn(e,t,n){let r=new Date(e);r.setMonth(n-1),r.setDate(t);let i=be(r,{year:1}),o=be(r,{year:-1});return Math.abs(i.getTime()-e.getTime())<Math.abs(r.getTime()-e.getTime())?r=i:Math.abs(o.getTime()-e.getTime())<Math.abs(r.getTime()-e.getTime())&&(r=o),r.getFullYear()}var ks={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6},vu={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Pe={...vu,jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12},_u={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},Ou={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31},qm={second:"second",seconds:"second",minute:"minute",minutes:"minute",hour:"hour",hours:"hour",day:"day",days:"day",week:"week",weeks:"week",month:"month",months:"month",quarter:"quarter",quarters:"quarter",year:"year",years:"year"},Ai={s:"second",sec:"second",second:"second",seconds:"second",m:"minute",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",d:"day",day:"day",days:"day",w:"week",week:"week",weeks:"week",mo:"month",mon:"month",mos:"month",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year",...qm},Hm=`(?:${fe(_u)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|the|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function R0(e){let t=e.toLowerCase();return _u[t]!==void 0?_u[t]:t==="a"||t==="an"||t=="the"?1:t.match(/few/)?3:t.match(/half/)?.5:t.match(/couple/)?2:t.match(/several/)?7:parseFloat(t)}var vr=`(?:${fe(Ou)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function Mr(e){let t=e.toLowerCase();return Ou[t]!==void 0?Ou[t]:(t=t.replace(/(?:st|nd|rd|th)$/i,""),parseInt(t))}var hn="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-9][0-9]{3}|[0-9]{2}(?!\\w|:\\d|\\s+(?:am|pm|o\\s*clock|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)))";function It(e){if(/BE/i.test(e))return e=e.replace(/BE/i,""),parseInt(e)-543;if(/BCE?/i.test(e))return e=e.replace(/BCE?/i,""),-parseInt(e);if(/(AD|CE)/i.test(e))return e=e.replace(/(AD|CE)/i,""),parseInt(e);let t=parseInt(e);return Ts(t)}var Wm=`(${Hm})\\s{0,3}(${fe(Ai)})`,Um=new RegExp(Wm,"i"),F0=`(${Hm})\\s{0,3}(${fe(qm)})`,jm="\\s{0,5},?(?:\\s*and)?\\s{0,5}",Yt=Du("(?:(?:about|around)\\s{0,3})?",Wm,jm),gn=Du("(?:(?:about|around)\\s{0,3})?",F0,jm);function Xe(e){let t={},n=e,r=Um.exec(n);for(;r;)L0(t,r),n=n.substring(r[0].length).trim(),r=Um.exec(n);return Object.keys(t).length==0?null:t}function L0(e,t){if(t[0].match(/^[a-zA-Z]+$/))return;let n=R0(t[1]),r=Ai[t[2].toLowerCase()];e[r]=n}var j=class{innerPatternHasChange(t,n){return this.innerPattern(t)!==n}patternLeftBoundary(){return"(\\W|^)"}cachedInnerPattern=null;cachedPattern=null;pattern(t){return this.cachedInnerPattern&&!this.innerPatternHasChange(t,this.cachedInnerPattern)?this.cachedPattern:(this.cachedInnerPattern=this.innerPattern(t),this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${this.cachedInnerPattern.source}`,this.cachedInnerPattern.flags),this.cachedPattern)}extract(t,n){let r=n[1]??"";n.index=n.index+r.length,n[0]=n[0].substring(r.length);for(let i=2;i<n.length;i++)n[i-1]=n[i];return this.innerExtract(t,n)}};var $0=new RegExp(`(?:(?:within|in|for)\\s*)?(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Yt})(?=\\W|$)`,"i"),z0=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Yt})(?=\\W|$)`,"i"),B0=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${gn})(?=\\W|$)`,"i"),Di=class extends j{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(t){return this.strictMode?B0:t.option.forwardDate?$0:z0}innerExtract(t,n){if(n[0].match(/^for\s*the\s*\w+/))return null;let r=Xe(n[1]);return r?U.createRelativeFromReference(t.reference,r):null}};var U0=new RegExp(`(?:on\\s{0,3})?(${vr})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)\\s{0,3}(${vr}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${fe(Pe)})(?:(?:-|/|,?\\s{0,3})(${hn}(?!\\w)))?(?=\\W|$)`,"i"),Vm=1,Gm=2,q0=3,Ym=4,_i=class extends j{innerPattern(){return U0}innerExtract(t,n){let r=t.createParsingResult(n.index,n[0]),i=Pe[n[q0].toLowerCase()],o=Mr(n[Vm]);if(o>31)return n.index=n.index+n[Vm].length,null;if(r.start.assign("month",i),r.start.assign("day",o),n[Ym]){let s=It(n[Ym]);r.start.assign("year",s)}else{let s=pn(t.refDate,o,i);r.start.imply("year",s)}if(n[Gm]){let s=Mr(n[Gm]);r.end=r.start.clone(),r.end.assign("day",s)}return r}};var H0=new RegExp(`(${fe(Pe)})(?:-|/|\\s*,?\\s*)(${vr})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${vr})\\s*)?(?:(?:-|/|\\s*,\\s*|\\s+)(${hn}))?(?=\\W|$)(?!\\:\\d)`,"i"),W0=1,Zm=2,Mu=3,Nu=4,Oi=class extends j{shouldSkipYearLikeDate;constructor(t){super(),this.shouldSkipYearLikeDate=t}innerPattern(){return H0}innerExtract(t,n){let r=Pe[n[W0].toLowerCase()],i=Mr(n[Zm]);if(i>31||this.shouldSkipYearLikeDate&&!n[Mu]&&!n[Nu]&&n[Zm].match(/^\d{2}$/))return null;let o=t.createParsingComponents({day:i,month:r}).addTag("parser/ENMonthNameMiddleEndianParser");if(n[Nu]){let u=It(n[Nu]);o.assign("year",u)}else{let u=pn(t.refDate,i,r);o.imply("year",u)}if(!n[Mu])return o;let s=Mr(n[Mu]),a=t.createParsingResult(n.index,n[0]);return a.start=o,a.end=o.clone(),a.end.assign("day",s),a}};var j0=new RegExp(`((?:in)\\s*)?(${fe(Pe)})\\s*(?:(?:,|-|of)?\\s*(${hn})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),V0=1,G0=2,Km=3,vi=class extends j{innerPattern(){return j0}innerExtract(t,n){let r=n[G0].toLowerCase();if(n[0].length<=3&&!vu[r])return null;let i=t.createParsingResult(n.index+(n[V0]||"").length,n.index+n[0].length);i.start.imply("day",1),i.start.addTag("parser/ENMonthNameParser");let o=Pe[r];if(i.start.assign("month",o),n[Km]){let s=It(n[Km]);i.start.assign("year",s)}else{let s=pn(t.refDate,1,o);i.start.imply("year",s)}return i}};var Y0=new RegExp(`([0-9]{4})[-\\.\\/\\s](?:(${fe(Pe)})|([0-9]{1,2}))[-\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),Z0=1,K0=2,Jm=3,J0=4,Mi=class extends j{strictMonthDateOrder;constructor(t){super(),this.strictMonthDateOrder=t}innerPattern(){return Y0}innerExtract(t,n){let r=parseInt(n[Z0]),i=parseInt(n[J0]),o=n[Jm]?parseInt(n[Jm]):Pe[n[K0].toLowerCase()];if(o<1||o>12){if(this.strictMonthDateOrder)return null;i>=1&&i<=12&&([o,i]=[i,o])}return i<1||i>31?null:{day:i,month:o,year:r}}};var X0="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-9][0-9]{3})",Q0=new RegExp(`(${X0})(?:\\s*[-.\\/,]?\\s*|\\s+of\\s+)(${fe(Pe)})(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),ew=1,tw=2,Ni=class extends j{innerPattern(){return Q0}innerExtract(t,n){let r=It(n[ew]),i=n[tw].toLowerCase(),o=Pe[i],s=t.createParsingResult(n.index,n[0]);return s.start.imply("day",1),s.start.assign("month",o),s.start.assign("year",r),s.start.addTag("parser/ENYearMonthNameParser"),s}};var nw=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),rw=1,iw=2,Pi=class extends j{innerPattern(){return nw}innerExtract(t,n){let r=parseInt(n[iw]),i=parseInt(n[rw]);return t.createParsingComponents().imply("day",1).assign("month",i).assign("year",r)}};function ow(e,t,n,r){return new RegExp(`${e}${t}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${n}`,r)}function sw(e,t){return new RegExp(`^(${e})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,"i")}var Pu=2,Wn=3,Ss=4,Cs=5,Nr=6,Es=class{strictMode;constructor(t=!1){this.strictMode=t}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?!/)(?=\\W|$)"}followingSuffix(){return"(?!/)(?=\\W|$)"}pattern(t){return this.getPrimaryTimePatternThroughCache()}extract(t,n){let r=this.extractPrimaryTimeComponents(t,n);if(!r)return n[0].match(/^\d{4}/)?(n.index+=4,null):(n.index+=n[0].length,null);let i=n.index+n[1].length,o=n[0].substring(n[1].length),s=t.createParsingResult(i,o,r);n.index+=n[0].length;let a=t.text.substring(n.index),l=this.getFollowingTimePatternThroughCache().exec(a);return o.match(/^\d{3,4}/)&&l&&(l[0].match(/^\s*([+-])\s*\d{2,4}$/)||l[0].match(/^\s*([+-])\s*\d{2}\W\d{2}/))?null:!l||l[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(s):(s.end=this.extractFollowingTimeComponents(t,l,s),s.end&&(s.text+=l[0]),this.checkAndReturnWithFollowingPattern(s))}extractPrimaryTimeComponents(t,n,r=!1){let i=t.createParsingComponents(),o=0,s=null,a=parseInt(n[Pu]);if(a>100){if(n[Pu].length==4&&n[Wn]==null&&!n[Nr]||this.strictMode||n[Wn]!=null)return null;o=a%100,a=Math.floor(a/100)}if(a>24)return null;if(n[Wn]!=null){if(n[Wn].length==1&&!n[Nr])return null;o=parseInt(n[Wn])}if(o>=60)return null;if(a>12&&(s=B.PM),n[Nr]!=null){if(a>12)return null;let u=n[Nr][0].toLowerCase();u=="a"&&(s=B.AM,a==12&&(a=0)),u=="p"&&(s=B.PM,a!=12&&(a+=12))}if(i.assign("hour",a),i.assign("minute",o),s!==null?i.assign("meridiem",s):a<12?i.imply("meridiem",B.AM):i.imply("meridiem",B.PM),n[Cs]!=null){let u=parseInt(n[Cs].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(n[Ss]!=null){let u=parseInt(n[Ss]);if(u>=60)return null;i.assign("second",u)}return i}extractFollowingTimeComponents(t,n,r){let i=t.createParsingComponents();if(n[Cs]!=null){let u=parseInt(n[Cs].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(n[Ss]!=null){let u=parseInt(n[Ss]);if(u>=60)return null;i.assign("second",u)}let o=parseInt(n[Pu]),s=0,a=-1;if(n[Wn]!=null?s=parseInt(n[Wn]):o>100&&(s=o%100,o=Math.floor(o/100)),s>=60||o>24)return null;if(o>=12&&(a=B.PM),n[Nr]!=null){if(o>12)return null;let u=n[Nr][0].toLowerCase();u=="a"&&(a=B.AM,o==12&&(o=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),u=="p"&&(a=B.PM,o!=12&&(o+=12)),r.start.isCertain("meridiem")||(a==B.AM?(r.start.imply("meridiem",B.AM),r.start.get("hour")==12&&r.start.assign("hour",0)):(r.start.imply("meridiem",B.PM),r.start.get("hour")!=12&&r.start.assign("hour",r.start.get("hour")+12)))}return i.assign("hour",o),i.assign("minute",s),a>=0?i.assign("meridiem",a):r.start.isCertain("meridiem")&&r.start.get("hour")>12?r.start.get("hour")-12>o?i.imply("meridiem",B.AM):o<=12&&(i.assign("hour",o+12),i.assign("meridiem",B.PM)):o>12?i.imply("meridiem",B.PM):o<=12&&i.imply("meridiem",B.AM),i.date().getTime()<r.start.date().getTime()&&i.imply("day",i.get("day")+1),i}checkAndReturnWithoutFollowingPattern(t){if(t.text.match(/^\d$/)||t.text.match(/^\d\d\d+$/)||t.text.match(/\d[apAP]$/))return null;let n=t.text.match(/[^\d:.](\d[\d.]+)$/);if(n){let r=n[1];if(this.strictMode||r.includes(".")&&!r.match(/\d(\.\d{2})+$/)||parseInt(r)>24)return null}return t}checkAndReturnWithFollowingPattern(t){if(t.text.match(/^\d+-\d+$/))return null;let n=t.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(n){if(this.strictMode)return null;let r=n[1],i=n[2];if(i.includes(".")&&!i.match(/\d(\.\d{2})+$/))return null;let o=parseInt(i),s=parseInt(r);if(o>24||s>24)return null}return t}cachedPrimaryPrefix=null;cachedPrimarySuffix=null;cachedPrimaryTimePattern=null;getPrimaryTimePatternThroughCache(){let t=this.primaryPrefix(),n=this.primarySuffix();return this.cachedPrimaryPrefix===t&&this.cachedPrimarySuffix===n?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=ow(this.primaryPatternLeftBoundary(),t,n,this.patternFlags()),this.cachedPrimaryPrefix=t,this.cachedPrimarySuffix=n,this.cachedPrimaryTimePattern)}cachedFollowingPhase=null;cachedFollowingSuffix=null;cachedFollowingTimePatten=null;getFollowingTimePatternThroughCache(){let t=this.followingPhase(),n=this.followingSuffix();return this.cachedFollowingPhase===t&&this.cachedFollowingSuffix===n?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=sw(t,n),this.cachedFollowingPhase=t,this.cachedFollowingSuffix=n,this.cachedFollowingTimePatten)}};var Ri=class extends Es{constructor(t){super(t)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|until|through|till|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(t,n){let r=super.extractPrimaryTimeComponents(t,n);if(!r)return r;if(n[0].endsWith("night")){let i=r.get("hour");i>=6&&i<12?(r.assign("hour",r.get("hour")+12),r.assign("meridiem",B.PM)):i<6&&r.assign("meridiem",B.AM)}if(n[0].endsWith("afternoon")){r.assign("meridiem",B.PM);let i=r.get("hour");i>=0&&i<=6&&r.assign("hour",r.get("hour")+12)}return n[0].endsWith("morning")&&(r.assign("meridiem",B.AM),r.get("hour")<12&&r.assign("hour",r.get("hour"))),r.addTag("parser/ENTimeExpressionParser")}extractFollowingTimeComponents(t,n,r){let i=super.extractFollowingTimeComponents(t,n,r);return i&&i.addTag("parser/ENTimeExpressionParser"),i}};var aw=new RegExp(`(${Yt})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),uw=new RegExp(`(${gn})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),Fi=class extends j{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(){return this.strictMode?uw:aw}innerExtract(t,n){let r=Xe(n[1]);return r?U.createRelativeFromReference(t.reference,fn(r)):null}};var lw=new RegExp(`(${Yt})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),cw=new RegExp(`(${gn})\\s{0,5}(later|after|from now)(?=\\W|$)`,"i"),dw=1,Li=class extends j{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(){return this.strictMode?cw:lw}innerExtract(t,n){let r=Xe(n[dw]);return r?U.createRelativeFromReference(t.reference,r):null}};var Pr=class{refine(t,n){return n.filter(r=>this.isValid(t,r))}},Qe=class{refine(t,n){if(n.length<2)return n;let r=[],i=n[0],o=null;for(let s=1;s<n.length;s++){o=n[s];let a=t.text.substring(i.index+i.text.length,o.index);if(!this.shouldMergeResults(a,i,o,t))r.push(i),i=o;else{let u=i,l=o,c=this.mergeResults(a,u,l,t);t.debug(()=>{console.log(`${this.constructor.name} merged ${u} and ${l} into ${c}`)}),i=c}}return i!=null&&r.push(i),r}};var $i=class extends Qe{shouldMergeResults(t,n,r){return!n.end&&!r.end&&t.match(this.patternBetween())!=null}mergeResults(t,n,r){if(!n.start.isOnlyWeekdayComponent()&&!r.start.isOnlyWeekdayComponent()&&(r.start.getCertainComponents().forEach(o=>{n.start.isCertain(o)||n.start.imply(o,r.start.get(o))}),n.start.getCertainComponents().forEach(o=>{r.start.isCertain(o)||r.start.imply(o,n.start.get(o))})),n.start.date()>r.start.date()){let o=n.start.date(),s=r.start.date();r.start.isOnlyWeekdayComponent()&&be(s,{day:7})>o?(s=be(s,{day:7}),r.start.imply("day",s.getDate()),r.start.imply("month",s.getMonth()+1),r.start.imply("year",s.getFullYear())):n.start.isOnlyWeekdayComponent()&&be(o,{day:-7})<s?(o=be(o,{day:-7}),n.start.imply("day",o.getDate()),n.start.imply("month",o.getMonth()+1),n.start.imply("year",o.getFullYear())):r.start.isDateWithUnknownYear()&&be(s,{year:1})>o?(s=be(s,{year:1}),r.start.imply("year",s.getFullYear())):n.start.isDateWithUnknownYear()&&be(o,{year:-1})<s?(o=be(o,{year:-1}),n.start.imply("year",o.getFullYear())):[r,n]=[n,r]}let i=n.clone();return i.start=n.start,i.end=r.start,i.index=Math.min(n.index,r.index),n.index<r.index?i.text=n.text+t+r.text:i.text=r.text+t+n.text,i}};var zi=class extends $i{patternBetween(){return/^\s*(to|-|–|until|through|till)\s*$/i}};function Ru(e,t){let n=e.clone(),r=e.start,i=t.start;if(n.start=Xm(r,i),e.end!=null||t.end!=null){let o=e.end==null?e.start:e.end,s=t.end==null?t.start:t.end,a=Xm(o,s);if(e.end==null&&a.date().getTime()<n.start.date().getTime()){let u=new Date(a.date().getTime());u.setDate(u.getDate()+1),a.isCertain("day")?dt(a,u):Gt(a,u)}n.end=a}return n}function Xm(e,t){let n=e.clone();t.isCertain("hour")?(n.assign("hour",t.get("hour")),n.assign("minute",t.get("minute")),t.isCertain("second")?(n.assign("second",t.get("second")),t.isCertain("millisecond")?n.assign("millisecond",t.get("millisecond")):n.imply("millisecond",t.get("millisecond"))):(n.imply("second",t.get("second")),n.imply("millisecond",t.get("millisecond")))):(n.imply("hour",t.get("hour")),n.imply("minute",t.get("minute")),n.imply("second",t.get("second")),n.imply("millisecond",t.get("millisecond"))),t.isCertain("timezoneOffset")&&n.assign("timezoneOffset",t.get("timezoneOffset"));let r=e.get("meridiem")!=null&&(e.isCertain("meridiem")||Array.from(e.tags()).some(i=>i.startsWith("casualReference/")));return t.isCertain("meridiem")?n.assign("meridiem",t.get("meridiem")):t.get("meridiem")!=null&&!r&&n.imply("meridiem",t.get("meridiem")),n.get("meridiem")==B.PM&&n.get("hour")<12&&(t.isCertain("hour")?n.assign("hour",n.get("hour")+12):n.imply("hour",n.get("hour")+12)),n.addTags(e.tags()),n.addTags(t.tags()),n}var Bi=class extends Qe{shouldMergeResults(t,n,r){return(n.start.isOnlyDate()&&r.start.isOnlyTime()||r.start.isOnlyDate()&&n.start.isOnlyTime())&&t.match(this.patternBetween())!=null}mergeResults(t,n,r){let i=n.start.isOnlyDate()?Ru(n,r):Ru(r,n);return i.index=n.index,i.text=n.text+t+r.text,i}};var Rr=class extends Bi{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-|\\.|\u2219|:)?\\s*$")}};var mw=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),Ui=class{timezoneOverrides;constructor(t){this.timezoneOverrides=t}refine(t,n){let r=t.option.timezones??{};return n.forEach(i=>{let o=t.text.substring(i.index+i.text.length),s=mw.exec(o);if(!s)return;let a=s[1].toUpperCase(),u=i.start.date()??i.refDate??new Date,l={...this.timezoneOverrides,...r},c=ws(a,u,l);if(c==null)return;t.debug(()=>{console.log(`Extracting timezone: '${a}' into: ${c} for: ${i.start}`)});let d=i.start.get("timezoneOffset");d!==null&&c!=d&&(i.start.isCertain("timezoneOffset")||a!=s[1])||i.start.isOnlyDate()&&a!=s[1]||(i.text+=s[0],i.start.isCertain("timezoneOffset")||i.start.assign("timezoneOffset",c),i.end!=null&&!i.end.isCertain("timezoneOffset")&&i.end.assign("timezoneOffset",c))}),n}};var fw=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),pw=1,hw=2,gw=3,qi=class{refine(t,n){return n.forEach(function(r){if(r.start.isCertain("timezoneOffset"))return;let i=t.text.substring(r.index+r.text.length),o=fw.exec(i);if(!o)return;t.debug(()=>{console.log(`Extracting timezone: '${o[0]}' into : ${r}`)});let s=parseInt(o[hw]),a=parseInt(o[gw]||"0"),u=s*60+a;u>840||(o[pw]==="-"&&(u=-u),r.end!=null&&r.end.assign("timezoneOffset",u),r.start.assign("timezoneOffset",u),r.text+=o[0])}),n}};var yn=class{refine(t,n){if(n.length<2)return n;let r=[],i=n[0];for(let o=1;o<n.length;o++){let s=n[o];if(s.index>=i.index+i.text.length){r.push(i),i=s;continue}let a=null,u=null;s.text.length>i.text.length?(a=s,u=i):(a=i,u=s),t.debug(()=>{console.log(`${this.constructor.name} remove ${u} by ${a}`)}),i=a}return i!=null&&r.push(i),r}};function Qm(e,t,n){let r=e.getDateWithAdjustedTimezone(),i=yw(r,t,n),o=new U(e);return o=o.addDurationAsImplied({day:i}),o.assign("weekday",t),o}function yw(e,t,n){let r=e.getDay();switch(n){case"this":return jn(e,t);case"last":return ef(e,t);case"next":return r==Z.SUNDAY?t==Z.SUNDAY?7:t:r==Z.SATURDAY?t==Z.SATURDAY?7:t==Z.SUNDAY?8:1+t:t<r&&t!=Z.SUNDAY?jn(e,t):jn(e,t)+7}return xw(e,t)}function xw(e,t){let n=ef(e,t),r=jn(e,t);return r<-n?r:n}function jn(e,t){let n=e.getDay(),r=t-n;return r<0&&(r+=7),r}function ef(e,t){let n=e.getDay(),r=t-n;return r>=0&&(r-=7),r}var Hi=class{refine(t,n){return t.option.forwardDate&&n.forEach(r=>{let i=t.reference.getDateWithAdjustedTimezone();if(r.start.isOnlyTime()&&t.reference.instant>r.start.date()){let o=t.reference.getDateWithAdjustedTimezone(),s=new Date(o);s.setDate(s.getDate()+1),Gt(r.start,s),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} time from the ref date (${o}) to the following day (${s})`)}),r.end&&r.end.isOnlyTime()&&(Gt(r.end,s),r.start.date()>r.end.date()&&(s.setDate(s.getDate()+1),Gt(r.end,s)))}if(r.start.isOnlyWeekdayComponent()&&i>r.start.date()){let o=jn(i,r.start.get("weekday"))||7,s=be(i,{day:o});if(Gt(r.start,s),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} weekday (${r.start})`)}),r.end&&r.start.date()>r.end.date()){let a=jn(i,r.start.get("weekday"))||7,u=be(i,{day:a});Gt(r.end,u),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} weekday (${r.end})`)})}}if(r.start.isDateWithUnknownYear()&&i>r.start.date())for(let o=0;o<3&&i>r.start.date();o++)r.start.imply("year",r.start.get("year")+1),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} year (${r.start})`)}),r.end&&!r.end.isCertain("year")&&(r.end.imply("year",r.end.get("year")+1),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} month (${r.start})`)}))}),n}};var Wi=class extends Pr{strictMode;constructor(t){super(),this.strictMode=t}isValid(t,n){return n.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(t.debug(()=>{console.log(`Removing unlikely result '${n.text}'`)}),!1):n.start.isValidDate()?n.end&&!n.end.isValidDate()?(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.end})`)}),!1):this.strictMode?this.isStrictModeValid(t,n):!0:(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.start})`)}),!1)}isStrictModeValid(t,n){return n.start.isOnlyWeekdayComponent()?(t.debug(()=>{console.log(`(Strict) Removing weekday only component: ${n} (${n.end})`)}),!1):!0}};var bw=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),ww=1,Tw=2,kw=3,tf=4,Sw=5,nf=6,rf=7,Cw=8,of=9,sf=10,ji=class extends j{innerPattern(){return bw}innerExtract(t,n){let r=t.createParsingComponents({year:parseInt(n[ww]),month:parseInt(n[Tw]),day:parseInt(n[kw])});if(n[tf]!=null&&(r.assign("hour",parseInt(n[tf])),r.assign("minute",parseInt(n[Sw])),n[nf]!=null&&r.assign("second",parseInt(n[nf])),n[rf]!=null&&r.assign("millisecond",parseInt(n[rf])),n[Cw]!=null)){let i=0;if(n[of]){let o=parseInt(n[of]),s=0;n[sf]!=null&&(s=parseInt(n[sf])),i=o*60,i<0?i-=s:i+=s}r.assign("timezoneOffset",i)}return r.addTag("parser/ISOFormatParser")}};var Vi=class extends Qe{mergeResults(t,n,r){let i=r.clone();return i.index=n.index,i.text=n.text+t+i.text,i.start.assign("weekday",n.start.get("weekday")),i.end&&i.end.assign("weekday",n.start.get("weekday")),i}shouldMergeResults(t,n,r){return n.start.isOnlyWeekdayComponent()&&!n.start.isCertain("hour")&&r.start.isCertain("day")&&t.match(/^,?\s*$/)!=null}};function af(e,t=!1){return e.parsers.unshift(new ji),e.refiners.unshift(new Vi),e.refiners.unshift(new qi),e.refiners.unshift(new yn),e.refiners.push(new Ui),e.refiners.push(new yn),e.refiners.push(new Hi),e.refiners.push(new Wi(t)),e}function uf(e){let t=e.getDateWithAdjustedTimezone(),n=new U(e,{});return dt(n,t),bs(n,t),n.assign("timezoneOffset",e.getTimezoneOffset()),n.addTag("casualReference/now"),n}function lf(e){let t=e.getDateWithAdjustedTimezone(),n=new U(e,{});return dt(n,t),Ii(n,t),n.delete("meridiem"),n.addTag("casualReference/today"),n}function cf(e){return Ew(e,1).addTag("casualReference/yesterday")}function df(e){return Is(e,1).addTag("casualReference/tomorrow")}function Ew(e,t){return Is(e,-t)}function Is(e,t){let n=e.getDateWithAdjustedTimezone(),r=new U(e,{}),i=new Date(n.getTime());return i.setDate(i.getDate()+t),dt(r,i),Ii(r,i),r.delete("meridiem"),r}function mf(e,t=22){let n=e.getDateWithAdjustedTimezone(),r=new U(e,{});return dt(r,n),r.imply("hour",t),r.imply("meridiem",B.PM),r.addTag("casualReference/tonight"),r}function ff(e,t=20){let n=new U(e,{});return n.imply("meridiem",B.PM),n.imply("hour",t),n.addTag("casualReference/evening"),n}function pf(e){let t=new U(e,{});return e.getDateWithAdjustedTimezone().getHours()>2&&t.addDurationAsImplied({day:1}),t.assign("hour",0),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/midnight"),t}function hf(e,t=6){let n=new U(e,{});return n.imply("meridiem",B.AM),n.imply("hour",t),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n.addTag("casualReference/morning"),n}function gf(e,t=15){let n=new U(e,{});return n.imply("meridiem",B.PM),n.imply("hour",t),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n.addTag("casualReference/afternoon"),n}function yf(e){let t=new U(e,{});return t.imply("meridiem",B.AM),t.assign("hour",12),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/noon"),t}var Iw=/(now|today|tonight|tomorrow|overmorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,Gi=class extends j{innerPattern(t){return Iw}innerExtract(t,n){let r=t.refDate,i=n[0].toLowerCase(),o=t.createParsingComponents();switch(i){case"now":o=uf(t.reference);break;case"today":o=lf(t.reference);break;case"yesterday":o=cf(t.reference);break;case"tomorrow":case"tmr":case"tmrw":o=df(t.reference);break;case"tonight":o=mf(t.reference);break;case"overmorrow":o=Is(t.reference,2);break;default:if(i.match(/last\s*night/)){if(r.getHours()>6){let s=new Date(r.getTime());s.setDate(s.getDate()-1),r=s}dt(o,r),o.imply("hour",0)}break}return o.addTag("parser/ENCasualDateParser"),o}};var Aw=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|midday|noon)(?=\W|$)/i,Yi=class extends j{innerPattern(){return Aw}innerExtract(t,n){let r=null;switch(n[1].toLowerCase()){case"afternoon":r=gf(t.reference);break;case"evening":case"night":r=ff(t.reference);break;case"midnight":r=pf(t.reference);break;case"morning":r=hf(t.reference);break;case"noon":case"midday":r=yf(t.reference);break}return r&&r.addTag("parser/ENCasualTimeParser"),r}};var Dw=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${fe(ks)}|weekend|weekday)(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(?:of\\s*)?(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),_w=1,Ow=2,vw=3,Zi=class extends j{innerPattern(){return Dw}innerExtract(t,n){let r=n[_w],i=n[vw],o=r||i;o=o||"",o=o.toLowerCase();let s=null;o=="last"||o=="past"?s="last":o=="next"?s="next":o=="this"&&(s="this");let a=n[Ow].toLowerCase(),u;if(ks[a]!==void 0)u=ks[a];else if(a=="weekend")u=s=="last"?Z.SUNDAY:Z.SATURDAY;else if(a=="weekday"){let l=t.reference.getDateWithAdjustedTimezone().getDay();l==Z.SUNDAY||l==Z.SATURDAY?u=s=="last"?Z.FRIDAY:Z.MONDAY:(u=l-1,u=s=="last"?u-1:u+1,u=u%5+1)}else return null;return Qm(t.reference,u,s)}};var Mw=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${fe(Ai)})(?=\\s*)(?=\\W|$)`,"i"),Nw=1,Pw=2,Ki=class extends j{innerPattern(){return Mw}innerExtract(t,n){let r=n[Nw].toLowerCase(),i=n[Pw].toLowerCase(),o=Ai[i];if(r=="next"||r.startsWith("after")){let u={};return u[o]=1,U.createRelativeFromReference(t.reference,u)}if(r=="last"||r=="past"){let u={};return u[o]=-1,U.createRelativeFromReference(t.reference,u)}let s=t.createParsingComponents(),a=new Date(t.reference.instant.getTime());return i.match(/week/i)?(a.setDate(a.getDate()-a.getDay()),s.imply("day",a.getDate()),s.imply("month",a.getMonth()+1),s.imply("year",a.getFullYear())):i.match(/month/i)?(a.setDate(1),s.imply("day",a.getDate()),s.assign("year",a.getFullYear()),s.assign("month",a.getMonth()+1)):i.match(/year/i)&&(a.setDate(1),a.setMonth(0),s.imply("day",a.getDate()),s.imply("month",a.getMonth()+1),s.assign("year",a.getFullYear())),s}};var Rw=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),Fw=1,Lw=5,bf=2,wf=3,Fu=4,Ji=class{groupNumberMonth;groupNumberDay;constructor(t){this.groupNumberMonth=t?wf:bf,this.groupNumberDay=t?bf:wf}pattern(){return Rw}extract(t,n){let r=n.index+n[Fw].length,i=n.index+n[0].length-n[Lw].length;if(r>0&&t.text.substring(0,r).match("\\d/?$")||i<t.text.length&&t.text.substring(i).match("^/?\\d"))return;let o=t.text.substring(r,i);if(o.match(/^\d\.\d$/)||o.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!n[Fu]&&o.indexOf("/")<0)return;let s=t.createParsingResult(r,o),a=parseInt(n[this.groupNumberMonth]),u=parseInt(n[this.groupNumberDay]);if((a<1||a>12)&&a>12)if(u>=1&&u<=12&&a<=31)[u,a]=[a,u];else return null;if(u<1||u>31)return null;if(s.start.assign("day",u),s.start.assign("month",a),n[Fu]){let l=parseInt(n[Fu]),c=Ts(l);s.start.assign("year",c)}else{let l=pn(t.refDate,u,a);s.start.imply("year",l)}return s.addTag("parser/SlashDateFormatParser")}};var $w=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Yt})(?=\\W|$)`,"i"),zw=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${gn})(?=\\W|$)`,"i"),Xi=class extends j{allowAbbreviations;constructor(t=!0){super(),this.allowAbbreviations=t}innerPattern(){return this.allowAbbreviations?$w:zw}innerExtract(t,n){let r=n[1].toLowerCase(),i=Xe(n[2]);if(!i)return null;switch(r){case"last":case"past":case"-":i=fn(i);break}return U.createRelativeFromReference(t.reference,i)}};function Bw(e){return e.text.match(/^[+-]/i)!=null}function Tf(e){return e.text.match(/^-/i)!=null}var Qi=class extends Qe{shouldMergeResults(t,n,r){return t.match(/^\s*$/i)?Bw(r)||Tf(r):!1}mergeResults(t,n,r,i){let o=Xe(r.text);Tf(r)&&(o=fn(o));let s=U.createRelativeFromReference(Et.fromDate(n.start.date()),o);return new mt(n.reference,n.index,`${n.text}${t}${r.text}`,s)}};function kf(e){return e.text.match(/\s+(before|from)$/i)!=null}function Uw(e){return e.text.match(/\s+(after|since)$/i)!=null}var eo=class extends Qe{patternBetween(){return/^\s*$/i}shouldMergeResults(t,n,r){return!t.match(this.patternBetween())||!kf(n)&&!Uw(n)?!1:!!r.start.get("day")&&!!r.start.get("month")&&!!r.start.get("year")}mergeResults(t,n,r){let i=Xe(n.text);kf(n)&&(i=fn(i));let o=U.createRelativeFromReference(Et.fromDate(r.start.date()),i);return new mt(r.reference,n.index,`${n.text}${t}${r.text}`,o)}};var qw=new RegExp(`^\\s*(${hn})`,"i"),Hw=1,to=class{refine(t,n){return n.forEach(function(r){if(!r.start.isDateWithUnknownYear())return;let i=t.text.substring(r.index+r.text.length),o=qw.exec(i);if(!o||o[0].trim().length<=3)return;t.debug(()=>{console.log(`Extracting year: '${o[0]}' into : ${r}`)});let s=It(o[Hw]);r.end!=null&&r.end.assign("year",s),r.start.assign("year",s),r.text+=o[0]}),n}};var no=class extends Pr{constructor(){super()}isValid(t,n){let r=n.text.trim();return r===t.text.trim()?!0:r.toLowerCase()==="may"&&!t.text.substring(0,n.index).trim().match(/\b(in)$/i)?(t.debug(()=>{console.log(`Removing unlikely result: ${n}`)}),!1):r.toLowerCase().endsWith("the second")?(t.text.substring(n.index+n.text.length).trim().length>0&&t.debug(()=>{console.log(`Removing unlikely result: ${n}`)}),!1):!0}};var Vn=class{createCasualConfiguration(t=!1){let n=this.createConfiguration(!1,t);return n.parsers.push(new Gi),n.parsers.push(new Yi),n.parsers.push(new vi),n.parsers.push(new Ki),n.parsers.push(new Xi),n.refiners.push(new no),n}createConfiguration(t=!0,n=!1){let r=af({parsers:[new Ji(n),new Di(t),new _i,new Oi(n),new Zi,new Pi,new Ri(t),new Fi(t),new Li(t),new Ni],refiners:[new Rr]},t);return r.parsers.unshift(new Mi(t)),r.refiners.unshift(new eo),r.refiners.unshift(new Qi),r.refiners.unshift(new yn),r.refiners.push(new Rr),r.refiners.push(new to),r.refiners.push(new zi),r}};var Gn=class e{parsers;refiners;defaultConfig=new Vn;constructor(t){t=t||this.defaultConfig.createCasualConfiguration(),this.parsers=[...t.parsers],this.refiners=[...t.refiners]}clone(){return new e({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(t,n,r){let i=this.parse(t,n,r);return i.length>0?i[0].start.date():null}parse(t,n,r){let i=new Lu(t,n,r),o=[];return this.parsers.forEach(s=>{let a=e.executeParser(i,s);o=o.concat(a)}),o.sort((s,a)=>s.index-a.index),this.refiners.forEach(function(s){o=s.refine(i,o)}),o}static executeParser(t,n){let r=[],i=n.pattern(t),o=t.text,s=t.text,a=i.exec(s);for(;a;){let u=a.index+o.length-s.length;a.index=u;let l=n.extract(t,a);if(!l){s=o.substring(a.index+1),a=i.exec(s);continue}let c=null;l instanceof mt?c=l:l instanceof U?(c=t.createParsingResult(a.index,a[0]),c.start=l):c=t.createParsingResult(a.index,a[0],l);let d=c.index,m=c.text;t.debug(()=>console.log(`${n.constructor.name} extracted (at index=${d}) '${m}'`)),r.push(c),s=o.substring(d+m.length),a=i.exec(s)}return r}},Lu=class{text;option;reference;refDate;constructor(t,n,r){this.text=t,this.option=r??{},this.reference=Et.fromInput(n,this.option.timezones),this.refDate=this.reference.instant}createParsingComponents(t){return t instanceof U?t:new U(this.reference,t)}createParsingResult(t,n,r,i){let o=typeof n=="string"?n:this.text.substring(t,n),s=r?this.createParsingComponents(r):null,a=i?this.createParsingComponents(i):null;return new mt(this.reference,t,o,s,a)}debug(t){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(t):this.option.debug.debug(t))}};var As=new Vn,Ds=new Gn(As.createCasualConfiguration(!1)),Sf=new Gn(As.createConfiguration(!0,!1)),Ww=new Gn(As.createCasualConfiguration(!0));function jw(e,t,n){return Ds.parse(e,t,n)}function Vw(e,t,n){return Ds.parseDate(e,t,n)}var $u=globalThis.Temporal;var Cf=(e,t)=>`Non-positive ${e}: ${t}`,Ef=(e,t)=>`Non-finite ${e}: ${t}`,If=e=>`Cannot convert bigint to ${e}`,Af="Invalid object",ro=(e,t,n,r)=>Yn(e,t)+`; must be between ${n}-${r}`,Yn=(e,t)=>`Invalid ${e}: ${t}`;var zu=1e3,Bu=1e6,Uu=1e9,qu=6e10,Hu=36e11;function et(e){return e===void 0?Object.create(null):Zn(e)}function Os(e,t="number"){if(typeof e=="bigint")throw new TypeError(If(t));if(e=Number(e),!Number.isFinite(e))throw new RangeError(Ef(t,e));return e}function Se(e,t){return Math.trunc(Os(e,t))||0}function vs(e,t){return Df(Se(e,t),t)}function Df(e,t="number"){if(e<=0)throw new RangeError(Cf(t,e));return e}function Wu(e,t,n){return Math.min(Math.max(e,t),n)}function Fr(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function Zn(e){if(!Fr(e))throw new TypeError(Af);return e}var Bs=Yn;var lo=e=>`Missing ${e}`,$f=e=>"No valid fields: "+e.join(),zf="Invalid bag",Bf=(e,t,n)=>Yn(e,t)+"; must be "+Object.keys(n).join(),Uf="Cannot use valueOf",qf="Invalid calling context",Us=e=>"Missing year"+(e?"/era/eraYear":""),Jn="Invalid leap month",Hf=e=>Yn("Calendar",e),Wf=(e,t)=>`Unknown calendar ${e}; might need ${t}`,sl=e=>Yn("TimeZone",e),xn="Out-of-bounds date";var jf=e=>`Cannot parse: ${e}`,Zt=e=>`Invalid substring: ${e}`;var al=Wu,ze=Fr;function O(e){throw new RangeError(e)}function Q(e){throw new TypeError(e)}function Yu(e,t,n,r,i){return Dt(t,((o,s)=>{let a=o[s];return a===void 0&&Q(lo(s)),a})(e,t),n,r,i)}function Dt(e,t,n,r,i,o){let s=al(t,n,r);return i&&t!==s&&O(((a,u,l,c,d)=>d?ro(a,d[u],d[l],d[c]):ro(a,u,l,c))(e,t,n,r,o)),s}function zr(e,t=Map){let n=new t;return(r,...i)=>{if(n.has(r))return n.get(r);let o=e(r,...i);return n.set(r,o),o}}var Vf=e=>qs({name:e},1),qs=(e,t)=>Sn(n=>({value:n,configurable:1,writable:!t}),e),co=e=>({[Symbol.toStringTag]:{value:e,configurable:1}});function Sn(e,t){let n={};for(let r in t)n[r]=e(t[r],r);return n}function mo(e,t){let n={};for(let r of e)n[r]=t;return n}function Hs(e){let t={};for(let n of e)t[n]=r=>r[n];return t}function _t(e,t,n=Object.create(null)){for(let r of e)n[r]=t[r];return n}function Gf(e,t,n){for(let r of e)if(t[r]!==n[r])return 0;return 1}function Jw(e,t,n){let r={...n};for(let i=0;i<t;i++)r[e[i]]=0;return r}function Be(e,...t){return(...n)=>e(...t,...n)}function ul(){}function _f(e){return e[0].toUpperCase()+e.substring(1)}function Te(...e){return[].concat(...e).sort()}function Hr(e){return new RegExp(`^${e}$`,"i")}function ll(e){return parseInt(e.padEnd(9,"0"))}function cl(e){return e&&e!=="+"?-1:1}function Lr(e){return e===void 0?0:parseInt(e)}function Rs(e,t){return String(t).padStart(e,"0")}var ft=Be(Rs,2);function Kt(e,t){return Math.sign(e-t)}function pe(e,t){return e<t?-1:e>t?1:0}function Yf(e,t){let n=e/t;return e%t<0n?n-1n:n}function dl(e,t){let n=Yf(e,t);return[n,e-n*t]}function At(e,t){return[Math.floor(e/t),Ws(e,t)]}function Ws(e,t){return(e%t+t)%t}function Wr(e,t){return Math.trunc(e/t)||0}function ml(e,t){return e%t||0}function Zf(e,t=1){return t*(.5+e/5)}function Ms(e){return Math.abs(e%1)===.5}var fl="iso8601",Kf="gregory",Xw={bce:-1,ce:0};function Jf(e){let t=e.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,"");return t==="bc"||t==="b"?"bce":t==="ad"||t==="a"?"ce":t}var tt=void 0,Xf=0;function ht(e){return e===tt?"iso8601":e===0?"gregory":e.id}var Qw=/^M(\d{2})(L?)$/;function Qf(e){let t=Qw.exec(e);return t||O((n=>`Invalid monthCode: ${n}`)(e)),[parseInt(t[1]),!!t[2]]}function ep(e,t){return"M"+ft(e)+(t?"L":"")}function Zu(e,t,n){return e+(t||n&&e>=n?1:0)}var Ku={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},pl=Object.keys(Ku);var fo=zu,po=Bu,Cn=Uu,ho=qu,go=Hu,Qt=864e11,gt=[1,fo,po,Cn,ho,go,Qt],eT=BigInt(fo),jr=BigInt(po),Xn=BigInt(Cn),tT=BigInt(ho),nT=BigInt(go),oe=BigInt(Qt);function tp(e,t){let n=Number(e/oe),r=Number(e%oe);return n*(Qt/t)+(Math.trunc(r/t)+r%t/t)}var Re=pl.slice(0,6),yo=Hs(Re),js=["year"],ir=["day"],hl=["day","month","year"],Vs=["offset"],gl=["timeZone"],Vr=["era","eraYear"],rT=["era","eraYear","year"],np=["month","monthCode"],iT=["day","month","monthCode"],Ju=Te(Re),oT=Te(Vr,js),xo=Te(np,js),rp=Te(Vr,xo),bo=Te(["monthCode"],js),ip=Te(Vr,bo),op=Te(ir,["monthCode"]),or=Te(ir,xo),sr=Te(ir,Vr,xo),sp=Te(or,Re),ap=Te(sr,Re),sT=Te(or,Re,Vs),aT=Te(sr,Re,Vs),up=Te(or,Re,Vs,gl),lp=Te(sr,Re,Vs,gl),uT=Te(ir,bo),lT=Te(ir,Vr,bo),Le=mo(Re,0);function wo(e){return Gs(e,1),e}var cT={hour:23,minute:59,second:59};function Gs(e,t){let n={};for(let r of Re)n[r]=Dt(r,e[r],0,cT[r]||999,t);return n}function Ge(e){return xl(e)*Cn+cp(e)}function yl(e){return 1e3*xl(e)+e.millisecond}function xl(e){return 3600*e.hour+60*e.minute+e.second}function cp(e){return e.millisecond*po+e.microsecond*fo+e.nanosecond}function bl(e){let[t,n]=At(e,Qt);return[dp(n),t]}function dp(e){let[t,n]=At(e,po),[r,i]=At(n,fo);return dT(t,r,i)}function dT(e,t=0,n=0){let[r,i]=At(e,36e5),[o,s]=At(i,6e4),[a,u]=At(s,1e3);return{hour:r,minute:o,second:a,millisecond:u,microsecond:t,nanosecond:n}}function Of(e){let[t,n]=dl(e,Xn);return[Number(t),Number(n)]}function nt(e){return bn(e)+BigInt(Ge(e))}function mp(e){return To(e)+yl(e)}function bn(e){return BigInt(Ot(e))*oe}function To(e){return 864e5*Ot(e)}function Ot(e){return io(e.year,e.month,e.day)}function io(e,t=1,n=1){let r=t-1;return e+=Math.floor(r/12),t=Ws(r,12),Date.UTC(e%400-400,t,0)/864e5+146097*(Wr(e,400)+1)+n}function ko(e){let[t,n]=dl(e,oe);return{...fp(Number(t)),...dp(Number(n))}}function fp(e){let t=new Date(864e5*Ws(e,146097));return{year:t.getUTCFullYear()+400*Math.floor(e/146097),month:t.getUTCMonth()+1,day:t.getUTCDate()}}var pp=1972;function mT(e){return[e,0]}function Xu(e,t){if(!t)return{year:1972,month:e}}function fT(e,t,n){return{year:e,month:t,day:n}}function hp(e,t){switch(t){case 2:return Ys(e)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function pT(e){return Ys(e)?366:365}function Ys(e){return e%4==0&&(e%100!=0||e%400==0)}function gp(e,t,n){return e+=Wr(n,12),(t+=ml(n,12))<1?(e--,t+=12):t>12&&(e++,t-=12),{year:e,month:t}}function hT(e,t,n,r){return 12*(n-e)+r-t}function Zs(e){return Ws(io(e.year,e.month,e.day)+4,7)||7}function yp(e){return io(e.year,e.month,e.day)-io(e.year)+1}function xp(e){let t=e.year,n=Math.floor((yp(e)-Zs(e)+10)/7),r=ju(t);return n<1?n=r=ju(--t):n>r&&(n=1,r=ju(++t)),{weekOfYear:n,yearOfWeek:t,Be:r}}function ju(e){let t=Zs({year:e,month:1,day:1});return t===4||t===3&&Ys(e)?53:52}function gT({year:e}){return e<1?{era:"bce",eraYear:1-e}:{era:"ce",eraYear:e}}function So(e){return en(e),wo(e)}function en(e){return bp(e,1),e}function vf(e){return Gf(hl,e,bp(e))}function bp(e,t){let{year:n}=e,r=Yu(e,"month",1,12,t);return{year:n,month:r,day:Yu(e,"day",1,hp(n,r),t)}}function te(e,t){return e?e.ae(t):t}function Qn(e,t,n){return e?e.L(t,n):mT(n)}function Co(e,t){return e===0?gT(t):e&&e.h?.(t)||{}}function er(e,t,n,r){return e?e.de(t,n,r):fT(t,n,r)}function oo(e,t){return e?e.j(t):12}function so(e,t,n){return e?e.o(t,n):hp(t,n)}function Ks(e,t){let{year:n,month:r}=te(e,t),[i,o]=Qn(e,n,r);return ep(i,o)}function wl(e,t){let{year:n}=te(e,t);return e?e.q(n):Ys(n)}function Tl(e,t){let{year:n}=te(e,t);return oo(e,n)}function kl(e,t){let{year:n,month:r}=te(e,t);return so(e,n,r)}function Sl(e,t){let{year:n}=te(e,t);return e?e.i(n):pT(n)}function wp(e,t){if(!e)return yp(t);let{year:n}=te(e,t),r=er(e,n,1,1);return Ot(t)-Ot(r)+1}function Tp(e,t){return e===tt?xp(t).weekOfYear:void 0}function kp(e,t){return e===tt?xp(t).yearOfWeek:void 0}var se=pl.map(e=>e+"s"),Cl=Hs(se),Sp=Te(se),yT=se.slice(0,6),Cp=se.slice(6),xT=Cp.slice(1),he=mo(se,0),El=mo(yT,0),Il=Be(Jw,se);function Ep(e,t){return t==null&&O(lo(e)),t}var Oe=Be(bT,"string");function bT(e,t,n=e){return typeof t!==e&&Q(Bs(n,t)),t}function Al(e,t="number"){return Number.isInteger(e)||O(((n,r)=>`Non-integer ${n}: ${r}`)(t,e)),e||0}function Dl(e){return typeof e=="symbol"&&Q("Cannot convert Symbol to string"),String(e)}function _l(e,t){return Fr(e)?String(e):Oe(e,t)}function Js(e){return typeof e=="boolean"?BigInt(e?1:0):typeof e=="string"?BigInt(e):(typeof e!="bigint"&&Q(`Invalid bigint: ${e}`),e)}function Xs(e,t){return Al(Os(e,t),t)}function Qs(e,t){return typeof e=="string"?((n,r)=>{let i=Object.create(null);return i[n]=r,i})(t,e):Zn(e)}var Jt="smallestUnit";var wT={constrain:0,reject:1},TT={compatible:0,reject:1,earlier:2,later:3},kT={reject:0,use:1,prefer:2,ignore:3},ST={auto:0,never:1,critical:2,always:3},CT={auto:0,never:1,critical:2},ET={auto:0,never:1},IT={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},AT=[Math.floor,e=>Ms(e)?Math.floor(e):Math.round(e),Math.ceil,e=>Ms(e)?Math.ceil(e):Math.round(e),Math.trunc,e=>Ms(e)?Math.trunc(e)||0:Math.round(e),e=>e<0?Math.floor(e):Math.ceil(e),e=>Math.sign(e)*Math.round(Math.abs(e))||0,e=>Ms(e)?(e=Math.trunc(e)||0)+e%2:Math.round(e)],DT={previous:-1,next:1};function Ol(e){let t=e.roundingIncrement;return t===void 0?1:Se(t,"roundingIncrement")}function vl(e){let t=e.fractionalSecondDigits;if(t!==void 0){if(typeof t!="number"){if(Dl(t)==="auto")return;O(Bs("fractionalSecondDigits",t))}t=Dt("fractionalSecondDigits",Math.floor(t),0,9,1)}return t}function Ml(e,t,n=0,r){let i=t[e];if(i===void 0)return r?n:void 0;if(i=Dl(i),i==="auto")return r?n:null;let o=Ku[i];return o===void 0&&(o=se.indexOf(i)),o<0&&O(Bf(e,i,Ku)),o}function En(e,t,n,r=0){let i=n[e];if(i===void 0)return r;let o=Dl(i),s=t[o];return s===void 0&&O(Bf(e,o,t)),s}var Gr=Be(Ml,Jt),Ip=Be(Ml,"largestUnit"),_T=Be(Ml,"unit"),Ap=Be(En,"overflow",wT),Dp=Be(En,"disambiguation",TT),OT=Be(En,"offset",kT),Nl=Be(En,"calendarName",ST),vT=Be(En,"timeZoneName",CT),MT=Be(En,"offset",ET),Yr=Be(En,"roundingMode",IT),NT=Be(En,"direction",DT);function Pl(e,t,n,r){let i=r?Qt:gt[t+1];if(i){let o=gt[t];i%((e=Dt("roundingIncrement",e,1,i/o-(r?0:1),1))*o)&&O(Bs("roundingIncrement",e))}else e=Dt("roundingIncrement",e,1,n?10**9:1,1);return e}function Br(e,t,n,r){return t!=null&&Dt(e,t,n,r,1,pl),t}function _p(e,t){t>e&&O("smallestUnit > largestUnit")}function Zr(e,t,n,r=9,i=0,o=4){t=et(t);let s=Ip(t,i),a=Ol(t),u=Yr(t,o),l=Gr(t,i,1);return s=Br("largestUnit",s,i,r),l=Br(Jt,l,i,r),s==null?s=Math.max(n,l):_p(s,l),a=Pl(a,l,1),e&&(u=(c=>c<4?(c+2)%4:c)(u)),[s,l,a,u]}function Eo(e,t=6,n){let r=Ol(e=Qs(e,Jt)),i=Yr(e,7),o=Gr(e);return o=Ep(Jt,o),o=Br(Jt,o,0,t),r=Pl(r,o,void 0,n),[o,r,i]}function ee(e,t){return _t(hl,e,_t(Re,t))}function K(e){return e===void 0?0:Ap(Zn(e))}function Ur(e,t=0){e=et(e);let n=Dp(e),r=OT(e,t);return[Ap(e),r,n]}var Op=BigInt(1e8)*oe,Rl=BigInt(-1e8)*oe,vp=Rl-oe,Mp=-3261848;function ea(e){let t=12*e.year+e.month;return(t<Mp||t>3309129)&&O(xn),e}function $e(e,t=1){return Np(bn(e),t),e}function ar(e){let t=bn(e);return Np(t),t!==vp||Ge(e)||O(xn),e}function Np(e,t=1){(e<(t?vp:Rl)||e>Op)&&O(xn)}function yt(e){return(e<Rl||e>Op)&&O(xn),e}function Fl(e,t){return yt(bn(e)+BigInt(Ge(e)-t))}function rt(e){return{epochNanoseconds:e}}function xt(e,t,n){return{calendar:n,timeZone:t,epochNanoseconds:e}}function vt(e,t){return _t(Re,e,ne(e,t))}function ne(e,t){return _t(hl,e,{calendar:t})}function ur(e){return _t(Re,e)}function we(e){return _t(se,e,{sign:ua(e)})}function Io(e){return t=e.epochNanoseconds,Number(Yf(t,jr));var t}function Ll(e){return e.epochNanoseconds}function Pp(e,t,n){let r=kn(t),[i,o]=((d,m)=>{let f=m((d=Qs(d,"unit")).relativeTo),p=_T(d);return p=Ep("unit",p),[p,f]})(n,e),s=Math.max(i,r),a=o&&rr(o);if(!o&&$r(s,a))return Mf(t,i);if(o||O("Missing relativeTo"),!t.sign&&$r(i,a))return 0;let[u,l,c]=Zp(o,t,i);return $r(i,a)?Mf(u,i):PT(u,l,i,c)}function PT(e,t,n,r){let i=ua(e)||1,o=$l(Il(n,e),n,i,r,t),s=o.ee,a=o.te,u=Number(a-s),l=Number(t-s);return o.pe[se[n]]+l/u*i}function Mf(e,t){return tp(Xt(e),gt[t])}function $l(e,t,n,r,i){let o=se[t],s=e,a=0,u=Nf(s,o,n,r);return i&&!((l,c,d,m)=>m>0?pe(c,l)<=0&&pe(l,d)<=0:pe(d,l)<=0&&pe(l,c)<=0)(i,u.ee,u.te,Math.sign(n))&&(s={...e,[o]:e[o]+n},a=1,u=Nf(s,o,n,r)),{...u,pe:s,Ae:a}}function Nf(e,t,n,r){let i={...e,[t]:e[t]+n};return{ee:tl(r,e),te:tl(r,i),se:i}}function Rp(e,t,n){let r=n-t,i=e-t;if(!i)return 0;let o=i<0n?-i:i,s=r<0n?-r:r,a=pe(i,0n)===pe(r,0n)?1:-1;return pe(o,s)<=0?o===s?a:Zf(pe(2n*o,s),a):Number(i)/Number(r)}function Fp(e,t,n,r){let{epochNanoseconds:i}=e,{timeZone:o,calendar:s}=e;if(t===0&&n===1)return{epochNanoseconds:i,timeZone:o,calendar:s};if(t===6){let a=ee(ge(e),Le),u=ee(In(a,1),Le),l=wn(o,a),c=wn(o,u);i=zl(RT(i,l,c),r)?c:l}else{let a=ge(e),u=a.offsetNanoseconds;i=Jr(o,ta(a,Kr(t,n),r),u,2,0,1)}return{epochNanoseconds:i,timeZone:o,calendar:s}}function Lp(e){let{timeZone:t}=e,n=ee(ge(e),Le),r=ee(In(n,1),Le),i=wn(t,n);return tp(wn(t,r)-i,go)}function $p(e){let{timeZone:t,calendar:n}=e;return xt(wn(t,ee(ge(e),Le)),t,n)}function RT(e,t,n){return Rp(e<n?e:n-1n,t,n)}function ta(e,t,n){let[r,i]=na(e,t,n),o=ee(In(e,i),r);return ar(o),o}function na(e,t,n){return bl(qr(Ge(e),t,n))}function Fs(e){return qr(e,ho,7)}function Kr(e,t){return gt[e]*t}function Ao(e,t){return BigInt(gt[e])*BigInt(t)}function FT(e,t,n){let r=Math.min(kn(e),6);return Tn(ia(Xt(e),BigInt(t),n),r)}function ra(e,t,n,r,i,o,s,a){if(r===0&&i===1)return e;let u=ua(e)||1,l=$r(r,a)?a&&r<6&&n>=6?$T:LT:zT,[c,d,m]=l(u,e,t,n,r,i,o,s);return m&&r!==7&&(c=((f,p,w,C,b,S)=>{for(let k=C+1;k<=w;k++){if(k===7&&w!==7)continue;let I=Il(k,f);I[se[k]]+=b;let A=pe(p,tl(S,I));if(A&&A!==b)break;f=I}return f})(c,d,n,Math.max(6,r),u,s)),c}function ia(e,t,n){return zp(e,t,n,e/t%2n)}function oa(e,t,n){let[r,i]=dl(e,oe),o=r*oe;return o+zp(i,t,n,(o/t+i/t)%2n)}function zp(e,t,n,r){let i=e/t,o=e%t,s=0;o&&(s=Zf(pe(2n*(o<0n?-o:o),t),Math.sign(Number(o))));let a=zl(Number(r)+s,n);return(i-r+BigInt(a))*t}function qr(e,t,n){return zl(e/t,n)*t}function zl(e,t){return AT[t](e)}function LT(e,t,n,r,i,o,s){let a=Xt(t),u=ia(a,Ao(i,o),s),l=u-a,c=Math.sign(Number(u/oe)-Number(a/oe))===e,d=Tn(u,Math.min(r,6));return[{...t,...d},n+l,c]}function $T(e,t,n,r,i,o,s,a){let u=Number(lr(t)),l=Kr(i,o),c=qr(u,l,s),d=$l({...t,...El},6,e,a,n),m=d.ee,f=d.te,p=c-Number(f-m),w=0;p&&Math.sign(p)!==e?n=m+BigInt(c):(w+=e,c=qr(p,l,s),n=f+BigInt(c));let C=la(c);return[{...t,...C,days:t.days+w},n,!!w]}function zT(e,t,n,r,i,o,s,a){let u=se[i],l=Il(i,t);i===7&&(t={...t,weeks:t.weeks+Math.trunc(t.days/7)});let c=Wr(t[u],o)*o;l[u]=c;let d=$l(l,i,o*e,a,n),m=d.ee,f=d.te,p=Rp(n,m,f),w=d.pe[u],C=d.se[u],b=qr(w+p*e*o,o,s),S=b===C;return l[u]=b,[l,S?f:m,d.Ae||S]}function Bp(e,t){return e.timeZone.O(e.epochNanoseconds,(n=>{let r=Qs(n,"direction"),i=NT(r,0);return i||O(Bs("direction",i)),i})(t))}var ge=zr(BT,WeakMap);function BT(e){let{epochNanoseconds:t,timeZone:n}=e,r=n.B(t);return{...ko(t+BigInt(r)),offsetNanoseconds:r}}function Jr(e,t,n,r=0,i=0,o,s){if(n!==void 0&&r===1&&(r===1||s))return Fl(t,n);r!==2&&r!==0||$e(t,0);let a=e.N(t);if(n!==void 0&&r!==3){let u=((l,c,d,m)=>{let f=nt(c);m&&(d=Fs(d));for(let p of l){let w=Number(f-p);if(m&&(w=Fs(w)),w===d)return p}})(a,t,n,o);if(u!==void 0)return u;r===0&&O("Invalid TimeZone offset")}return s?nt(t):Xr(e,t,i,a)}function Xr(e,t,n=0,r=e.N(t)){if(r.length===1)return r[0];if(n===1&&O("Ambiguous offset"),r.length)return r[n===3?1:0];let i=nt(t),o=((a,u)=>{let l=a.B(u-oe);return(c=>(c>Qt&&O("Out-of-bounds TimeZone gap"),c))(a.B(u+oe)-l)})(e,i),s=ko(i+BigInt(o*(n===2?-1:1)));return(r=e.N(s))[n===2?0:r.length-1]}function wn(e,t){let n=e.N(t);if(n.length)return n[0];let r=nt(t)-oe;return e.O(r,1)}function Bl(e,t,n,r,i){let o=K(i);r.sign&&kn(r)<8&&O("Cannot use small units");let s=$e(ao(t,n));return ao(t,Up(t,s,e?ve(r):r,o))}function Ul(e,t){return yt(e+(Ql(n=t)&&O("Cannot use large units"),lr(n)));var n}function tr(e,t,n){let{calendar:r,epochNanoseconds:i,timeZone:o}=e,s=lr(t),a=i;if(Ql(t)){let u=ge(e);a=Xr(o,ee(Qr(r,u,{...t,...El},n),u))+s}else a+=s,K(n);return{...e,epochNanoseconds:yt(a)}}function nr(e,t,n,r){let[i,o]=sa(t,n);return ar(ee(Qr(e,t,{...n,...El,days:n.days+o},r),i))}function Qr(e,t,n,r){if(n.years||n.months||n.weeks)return Up(e,t,n,K(r));K(r);let i=n.days+Number(lr(n)/oe);return i?$e(In(t,i)):t}function ao(e,t){return In(t,1-te(e,t).day)}function sa(e,t){let n=lr(t),r=Number(n/oe),i=Number(n%oe),[o,s]=bl(Ge(e)+i);return[o,r+s]}function In(e,t){return t?fp(Ot(e)+t):e}function Up(e,t,n,r){let{years:i,months:o,weeks:s,days:a}=n,u;if(a+=Number(lr(n)/oe),i||o)u=Qu(e,t,i,o,r);else{if(!s&&!a)return t;u=t}return(s||a)&&(u=In(u,7*s+a)),$e(u)}function Qu(e,t,n,r,i){let o=te(e,t),{year:s,month:a,day:u}=o;if(n){let[l,c]=Qn(e,s,a);s+=n,a=el(e,l,c,e?e.p(s):void 0,i),a=Dt("month",a,1,oo(e,s),i)}return r&&({year:s,month:a}=e?e.K(s,a,r):gp(s,a,r)),u=Dt("day",u,1,so(e,s,a),i),er(e,s,a,u)}function el(e,t,n,r,i){if(n){let o=e?e.l:void 0;return r!==void 0&&(o<0||r===t+1)?r:(i===1&&O(Jn),o<0?-o:t)}return Zu(t,0,r)}function tn(e,t){return ht(e)!==ht(t)&&O("Mismatching Calendars"),e}function UT(e,t){return e.m!==t.m&&O("Mismatching TimeZones"),e}function qp(e){return e.timeZone.id}function ql(e,t,n,r){let[i,o,s,a]=Zr(e,r,3,5),u=aa(t.epochNanoseconds,n.epochNanoseconds,i,o,s,a);return we(e?ve(u):u)}function Hl(e,t,n,r,i){let[o,s,a,u]=Zr(e,i,5),l=n.epochNanoseconds,c=r.epochNanoseconds,d;if(pe(c,l))if(o<6)d=aa(l,c,o,s,a,u);else{let m=UT(n.timeZone,r.timeZone);d=Yl(m,t,n,r,o),d=ra(d,c,o,s,a,u,Yp(t,m,n),1)}else d=he;return we(e?ve(d):d)}function Wl(e,t,n,r,i){let[o,s,a,u]=Zr(e,i,6),l=nt(n),c=nt(r),d=pe(c,l),m;return d?o<=6?m=aa(l,c,o,s,a,u):(m=jp(t,n,r,d,o),m=ra(m,c,o,s,a,u,HT(t,n))):m=he,we(e?ve(m):m)}function jl(e,t,n,r,i){let[o,s,a,u]=Zr(e,i,6,9,6);return Hp(e,t,n,r,o,s,a,u)}function Vl(e,t,n,r,i){let[o,s,a,u]=Zr(e,i,9,9,8),l=ao(t,n),c=ao(t,r);return Vp(l,c)?Hp(e,t,$e(l),$e(c),o,s,a,u,8):we(he)}function Hp(e,t,n,r,i,o,s,a,u=6){let l=bn(n),c=bn(r),d;return pe(c,l)?i===6?d=aa(l,c,i,o,s,a):(d=Zl(t,n,r,i),o===u&&s===1||(d=ra(d,c,i,o,s,a,Gp(t,n)))):d=he,we(e?ve(d):d)}function Gl(e,t,n,r){let[i,o,s,a]=Zr(e,r,5,5),u=qr(Ge(n)-Ge(t),Kr(o,s),a),l={...he,...la(u,i)};return we(e?ve(l):l)}function Yl(e,t,n,r,i){let o=pe(r.epochNanoseconds,n.epochNanoseconds);if(!o)return he;if(i<6)return{...he,...Tn(r.epochNanoseconds-n.epochNanoseconds,i)};if(!Vp(ge(n),ge(r)))return{...he,...Tn(r.epochNanoseconds-n.epochNanoseconds,5)};let[s,a,u]=qT(e,n,r,o);return{...i===6?{...he,days:Ps(s,a)}:Zl(t,s,a,i),...la(u)}}function Wp(e,t,n,r){let i=nt(t),o=nt(n),s=pe(o,i);return s?r<=6?{...he,...Tn(o-i,r)}:jp(e,t,n,s,r):he}function jp(e,t,n,r,i){let o=n,s=Ge(n)-Ge(t);return Math.sign(s)===-r&&(o=In(n,-r),s+=Qt*r),{...Zl(e,t,o,i),...la(s)}}function Zl(e,t,n,r){if(r<=7){let w=Ps(t,n);return r===7?{...he,weeks:Wr(w,7),days:ml(w,7)}:{...he,days:w}}let i=te(e,t),o=te(e,n);if(r===8){let{year:w,month:C,day:b}=i,{year:S,month:k,day:I}=o,A=Math.sign(Kt(S,w)||Kt(k,C)||Ps(t,n)),x=0,v=0;if(A){x=e?e._(w,C,S,k):hT(w,C,S,k);let P=Qu(e,t,0,x,0);A*Kt(b,I)>0&&(x-=A,P=Qu(e,t,0,x,0)),v=Ps(P,n)}return{...he,months:x,days:v}}let{year:s,month:a,day:u}=i,{year:l,month:c,day:d}=o,m=l-s,f=c-a,p=d-u;if(m||f){let w=Math.sign(m||f),C=so(e,l,c),b=0;if(Math.sign(d-u)===-w){let S=C;({year:l,month:c}=e?e.K(l,c,-w):gp(l,c,-w)),m=l-s,f=c-a,C=so(e,l,c),b=w<0?-S:C}if(p=d-Math.min(u,C)+b,m){let[S,k]=Qn(e,s,a),[I,A]=Qn(e,l,c),x=e?e.l:void 0;if(f=x!==void 0&&k&&!A&&(x<0?w>0&&I===-x:w<0&&I===S)?0:I-S||Number(A)-Number(k),Math.sign(f)===-w){let v=w<0&&-oo(e,l);l-=w,m=l-s,f=c-el(e,S,k,e?e.p(l):void 0,0)+(v||oo(e,l))}else if(e){let v=el(e,S,k,e.p(l),0);f=e._(l,v,l,c)}}}return{...he,years:m,months:f,days:p}}function Vp(e,t){return Kt(e.year,t.year)||Kt(e.month,t.month)||Kt(e.day,t.day)}function qT(e,t,n,r){let i=ge(t),o=ge(n),s=n.epochNanoseconds,a=0,u=Ge(o)-Ge(i);Math.sign(u)===-r&&a++;let l=a+(r>0?1:0);for(;a<=l;a++){let c=In(o,a*-r),d=Xr(e,ee(c,i));if(pe(s,d)!==-r)return[i,c,Number(s-d)]}}function aa(e,t,n,r,i,o){return{...he,...Tn(ia(t-e,Ao(r,i),o),n)}}function Ps(e,t){return Ot(t)-Ot(e)}function Gp(e,t){return{origin:t,ie:bn(t),calendar:e,he:bn}}function HT(e,t){return{origin:t,ie:nt(t),calendar:e,he:n=>nt(ee(n,t))}}function Yp(e,t,n){let r=ge(n);return{origin:r,ie:n.epochNanoseconds,calendar:e,he:i=>Xr(t,ee(i,r))}}function tl(e,t){return Ql(t)?e.he(Qr(e.calendar,e.origin,t)):e.ie}function Zp(e,t,n){let{calendar:r}=e;if(rr(e)){let{timeZone:s}=e,a=tr(e,t);return[Yl(s,r,e,a,n),a.epochNanoseconds,Yp(r,s,e)]}let i=ar(ee(e,Le)),o=nr(r,i,t);return[Wp(r,i,o,n),nt(o),Gp(r,e)]}function Pf(e,t){return rr(e)?tr(e,t).epochNanoseconds:nt(nr(e.calendar,ee(e,Le),t))}function rr(e){return"timeZone"in e}function $r(e,t){return e<=6-(t?1:0)}function Kl(e,t,n){let r={};for(let i=t;i>=0;i--){let o=gt[i];r[n[i]]=Wr(e,o),e=ml(e,o)}return r}var WT=2**53;function Jl(e,t,n,r,i){let o=e(et(i).relativeTo),s=Math.max(kn(n),kn(r));return $r(s,o&&rr(o))?jT(t,n,r,s):(o||O("Missing relativeTo"),t&&(r=ve(r)),we(((a,u,l,c)=>{let{calendar:d}=a;if(rr(a)){let{timeZone:p}=a,w=tr(a,u);return Yl(p,d,a,tr(w,l),c)}let m=ee(a,Le),f=nr(d,m,u);return Wp(d,m,nr(d,f,l),c)})(o,n,r,s)))}function jT(e,t,n,r){return we(An(((i,o,s,a)=>{let u=Xt(i)+Xt(o)*BigInt(a?-1:1);return Number.isFinite(Number(u/oe))||O(xn),{...he,...Tn(u,s)}})(t,n,r,e)))}function Kp(e,t,n){let r=kn(t),[i,o,s,a,u]=((p,w,C)=>{p=Qs(p,Jt);let b=Ip(p),S=C(p.relativeTo),k=Ol(p),I=Yr(p,7),A=Gr(p);return b===void 0&&A===void 0&&O("Required smallestUnit or largestUnit"),A==null&&(A=0),b==null&&(b=Math.max(A,w)),_p(b,A),k=Pl(k,A,1),k>1&&A>5&&b!==A&&O("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit"),[b,A,k,I,S]})(n,r,e);if(!u&&Math.max(r,i)<=6)return we(An(((p,w,C,b,S)=>{let k=ia(Xt(p),Ao(C,b),S);return{...he,...Tn(k,w)}})(t,i,o,s,a)));let l=u&&rr(u),c=l&&i>=6&&o<6;if(!t.sign&&!c)return t;u||O("Missing relativeTo");let[d,m,f]=Zp(u,t,i);return we(ra(d,m,i,o,s,a,f,l))}function Jp(e){return e.sign===-1?Xl(e):e}function Xl(e){return we(ve(e))}function ve(e){let t={};for(let n of se)t[n]=-1*e[n]||0;return t}function ua(e,t=se){let n=0;for(let r of t){let i=Math.sign(e[r]);i&&(n&&n!==i&&O("Cannot mix duration signs"),n=i)}return n}function An(e){for(let n of xT)Dt(n,e[n],-4294967295,4294967295,1);let t=Xt(e);return Xp(Number(t/Xn)),e}function Xp(e){Number.isSafeInteger(e)||O("Out-of-bounds duration")}function Xt(e){return BigInt(e.days)*oe+lr(e)}function lr(e){return BigInt(e.hours)*nT+BigInt(e.minutes)*tT+Qp(e)}function Qp(e){return BigInt(e.seconds)*Xn+BigInt(e.milliseconds)*jr+BigInt(e.microseconds)*eT+BigInt(e.nanoseconds)}function Tn(e,t=6){let n=Number(e/oe),r=Number(e%oe),i=gt[t],o=t<=3?Number(e/BigInt(i)):n*(Qt/i)+Wr(r,i);Number.isFinite(o)||O(xn),t<=3&&Math.abs(o)/(Cn/gt[t])>=WT&&O(xn);let s=Kl(r,t,se);return s[se[t]]=o,s}function la(e,t=5){return Kl(e,t,se)}function Ql(e){return!!ua(e,Cp)}function kn(e){let t=9;for(;t>0&&!e[se[t]];t--);return t}function Do(e,t){return pe(e.epochNanoseconds,t.epochNanoseconds)}function eh(e,t,n,r){let i=e(et(r).relativeTo),o=Math.max(kn(t),kn(n));return Gf(se,t,n)?0:$r(o,i&&rr(i))?pe(Xt(t),Xt(n)):(i||O("Missing relativeTo"),pe(Pf(i,t),Pf(i,n)))}function ec(e,t){return cr(e,t)||ca(e,t)}function cr(e,t){return Kt(Ot(e),Ot(t))}function ca(e,t){return Kt(Ge(e),Ge(t))}function th(e,t){return!Do(e,t)}function nh(e,t){return!Do(e,t)&&e.timeZone.m===t.timeZone.m&&e.calendar===t.calendar}function rh(e,t){return!ec(e,t)&&e.calendar===t.calendar}function ih(e,t){return!cr(e,t)&&e.calendar===t.calendar}function oh(e,t){return!cr(e,t)&&e.calendar===t.calendar}function sh(e,t){return!cr(e,t)&&e.calendar===t.calendar}function ah(e,t){return!ca(e,t)}function ei(e){return e===0?Xw:e?e.k:void 0}function Fe(e,t,n=t){return ei(e)?n:t}function tc(e,t){let n=e||void 0,r=ei(e),{era:i,eraYear:o,year:s}=t;if(s!==void 0&&(s=Se(s,"year")),o!==void 0&&(o=Se(o,"eraYear")),i!==void 0||o!==void 0){i!==void 0&&o!==void 0||Q("Mismatching era/eraYear"),r||O("Forbidden era/eraYear");let a=Jf(i),u=r[a];u===void 0&&O((c=>`Invalid era: ${c}`)(i));let l=n?.$?n.$(o,a,u):VT(o,u);s!==void 0&&s!==l&&O("Mismatching year/eraYear"),s=l}else s===void 0&&Q(Us(r));return s}function Ls(e,t,n,r,i){let{month:o,monthCode:s}=t;if(s!==void 0){let a=((u,l,c,d,m=Qf(l))=>{let f=u?u.p(c):void 0,[p,w]=m,C=Zu(p,w,f);if(w){let b=u?u.l:void 0;b===void 0&&O(Jn),b>0?(C>b&&O(Jn),f!==C&&(d===1&&O(Jn),C=Zu(p,0,f))):(C!==-b&&O(Jn),f===void 0&&d===1&&O(Jn))}return C})(e,s,n,r,i);o!==void 0&&o!==a&&O("Mismatching month/monthCode"),o=a,r=1}else o===void 0&&Q("Missing month/monthCode");return Dt("month",o,1,oo(e,n),r)}function nl(e,t,n,r,i){return Yu(t,"day",1,so(e,r,n),i)}function VT(e,t){return(t+e)*(Math.sign(t)||1)||0}function _o(e,t){return Gs(_t(Re,{...Le,...e}),t)}var GT=Hr("([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?");function da(e){let t=nc(e);return t===void 0&&O(jf(e)),t}function nc(e,t){let n=GT.exec(e);if(n&&(r=>(i=>{i[0]!=="T"&&i[0]!=="t"||(i=i.slice(1));let o=i.search(/[.,]/),s=o<0?i:i.slice(0,o),a=s.split(":");return a.length===1?/^(?:\d{2}|\d{4}|\d{6})$/i.test(s):(a.length===2||a.length===3)&&a.every(u=>u.length===2&&/^\d{2}$/i.test(u))})(r.slice(1)))(n[0]))return((r,i)=>{let o=r[4]||r[5];return i&&o&&O(Zt(o)),a=(Lr(r[2])*go+Lr(r[3])*ho+Lr(r[4])*Cn+ll(r[5]||""))*cl(r[1]),Math.abs(a)>=Qt&&O("Out-of-bounds offset"),a;var a})(n,t)}var it={era:_l,month:vs,monthCode(e,t){if(typeof e=="string")return e;if(e&&typeof e=="object"){let n=e.toString;if(typeof n=="function")return Oe(n.call(e),t)}return Oe(e,t)},day:vs},rc=mo(Re,Se),uh=mo(se,Xs),ic=Object.assign({},it,rc),oc={offset(e){return da(_l(e))},...ic};function le(e,t,n,r,i=!r){let o={},s=0;for(let a of t){let u=e[a];if(u!==void 0){s=1;let l=n[a];l&&(u=l(u,a)),o[a]=u}else r&&r.includes(a)&&Q(lo(a))}return i&&!s&&Q($f(t)),o}function Oo(e,t=Le,n){let r=ee(e,t);return ar(r),vt(r,n)}function uo(e,t,n){return lh(e,t,ch(e,t),K(n))}function ma(e,t,n){let r=ch(e,t),i=n();return[lh(e,t,r,i[0]),...i]}function lh(e,t,n,r){let i=n[1],o=Ls(e,t,i,r,n[0]);return ne($e(er(e,i,o,nl(e,t,o,i,r))),e)}function sc(e){if(e.monthCode!==void 0)return Qf(e.monthCode)}function ch(e,t){let n=ei(e);return t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||Q(Us(n)),t.monthCode===void 0&&t.month===void 0&&Q("Missing month/monthCode"),t.day===void 0&&Q(lo("day")),[sc(t),tc(e,t)]}function ac(e,t,n){let r=ei(e);t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||Q(Us(r)),t.monthCode===void 0&&t.month===void 0&&Q("Missing month/monthCode");let i=sc(t),o=tc(e,t);return ne(ea(er(e,o,Ls(e,t,o,K(n),i),1)),e)}function uc(e,t,n){let r=e===tt,i=ei(e);t.day===void 0&&Q(lo("day")),r||t.month===void 0||t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||Q(Us(i));let o=sc(t),s=t.eraYear!==void 0||t.year!==void 0?tc(e,t):void 0,a=K(n),u,l,c;if(s===void 0&&r&&(s=1972),s!==void 0){r||$e(er(e,s,1,1));let p=Ls(e,t,s,a,o);u=nl(e,t,p,s,a),[l,c]=Qn(e,s,p)}else{t.monthCode===void 0&&Q("Missing month/monthCode"),[l,c]=o;let p=e?e.ne:1972;if(p!==void 0)u=nl(e,t,Ls(e,t,p,a,o),p,a);else{let w=a===0&&e?e.fe?.(l,c,t.day):void 0;u=w!==void 0?w:t.day}}c&&((e&&e.U?.[l])??1/0)<t.day&&(a===1&&O(Jn),c=0,u=al(t.day,1,(e&&e.R)??1/0));let d=e?e.u(l,!!c,u):Xu(l,!!c);for(;!d&&a===0&&u>1;)u--,d=e?e.u(l,!!c,u):Xu(l,!!c);d||O("Cannot guess year");let{year:m,month:f}=d;return ne($e(er(e,m,f,u)),e)}var Mt=Intl.DateTimeFormat;function YT(e,t){t<-864e13&&O(xn);let n=e.formatToParts(t),r={};for(let i of n)r[i.type]=i.value;return r}var ZT={El_Aaiun:17,Tucuman:12,Tirane:11,Riga:10,Simferopol:9,Vienna:9,Tunis:8,Boa_Vista:6,Fortaleza:6,Maceio:6,Noronha:6,Recife:6,Gaza:6,Hebron:6,DeNoronha:6},Vu=-388152e4;function dh(e,t=4){let n=vl(e),r=Yr(e,4),i=Gr(e);return[r,...cc(Br(Jt,i,0,t),n)]}function lc(e){return Nl(et(e))}function mh(e,t){return dh(et(e),t)}function cc(e,t){return e!=null?[gt[e],e<4?9-3*e:-1]:[t===void 0?1:10**(9-t),t]}function dc(e,t,n){let[r,i,o,s]=(u=>{let l=vl(u=et(u)),c=Yr(u,4),d=Gr(u);return[u.timeZone,c,...cc(Br(Jt,d,0,4),l)]})(n),a=r!==void 0;return((u,l,c,d,m,f)=>{c=oa(c,BigInt(m),d);let p=l.B(c);return xc(ko(c+BigInt(p)),f)+(u?vo(Fs(p)):"Z")})(a,Ue(a?e(r):"UTC"),t.epochNanoseconds,i,o,s)}function mc(e,t){let n=(r=>{r=et(r);let i=Nl(r),o=vl(r),s=MT(r),a=Yr(r,4),u=Gr(r);return[i,vT(r),s,a,...cc(Br(Jt,u,0,4),o)]})(t);return((r,i,o,s,a,u,l,c,d,m)=>{s=oa(s,BigInt(d),c);let f=o.B(s);return xc(ko(s+BigInt(f)),m)+vo(Fs(f),l)+XT(i,u)+bc(r,a)})(e.calendar,e.timeZone.id,e.timeZone,e.epochNanoseconds,...n)}function fc(e,t){let n=(r=>(r=et(r),[Nl(r),...dh(r)]))(t);return((r,i,o,s,a,u)=>xc(ta(i,a,s),u)+bc(r,o))(e.calendar,e,...n)}function pc(e,t){return n=e.calendar,r=e,i=lc(t),$s(r)+bc(n,i);var n,r,i}function hc(e,t){return fh(e.calendar,ph,e,lc(t))}function gc(e,t){return fh(e.calendar,JT,e,lc(t))}function fh(e,t,n,r){let i=r>1||r===0&&e!==tt;return r===1?e===tt?t(n):$s(n):i?$s(n)+gh(ht(e),r===2):t(n)}function yc(e,t){return((n,r,i,o)=>hh(na(n,i,r)[0],o))(e,...mh(t))}function fa(e,t){let[n,r,i]=mh(t,3);return r>1&&An(e={...e,...FT(e,r,n)}),KT(e,i)}function KT(e,t){let{sign:n}=e,r=n===-1?ve(e):e,{hours:i,minutes:o}=r,s=Qp(r),a=Number(s/Xn),u=Number(s%Xn);Xp(a);let l=wc(u,t),c=t>=0||!n||l;return(n<0?"-":"")+"P"+Rf({Y:Kn(r.years),M:Kn(r.months),W:Kn(r.weeks),D:Kn(r.days)})+(i||o||a||c?"T"+Rf({H:Kn(i),M:Kn(o),S:Kn(a,c)+l}):"")}function Rf(e){let t=[];for(let n in e){let r=e[n];r&&t.push(r,n)}return t.join("")}function Kn(e,t){if(!e&&!t)return"";let n=Object.create(null);return n.useGrouping=0,e.toLocaleString("fullwide",n)}function xc(e,t){return $s(e)+"T"+hh(e,t)}function $s(e){return ph(e)+"-"+ft(e.day)}function ph(e){let{year:t}=e;return(t<0||t>9999?yh(t)+Rs(6,Math.abs(t)):Rs(4,t))+"-"+ft(e.month)}function JT(e){return ft(e.month)+"-"+ft(e.day)}function hh(e,t){let n=[ft(e.hour),ft(e.minute)];return t!==-1&&n.push(ft(e.second)+((r,i,o,s)=>wc(r*po+i*fo+o,s))(e.millisecond,e.microsecond,e.nanosecond,t)),n.join(":")}function vo(e,t=0){if(t===1)return"";let[n,r]=At(Math.abs(e),go),[i,o]=At(r,ho),[s,a]=At(o,Cn);return yh(e)+ft(n)+":"+ft(i)+(s||a?":"+ft(s)+wc(a):"")}function XT(e,t){return t!==1?"["+(t===2?"!":"")+e+"]":""}function bc(e,t){return t>1||t===0&&e!==tt?gh(ht(e),t===2):""}function gh(e,t){return"["+(t?"!":"")+"u-ca="+e+"]"}var QT=/0+$/;function wc(e,t){let n=Rs(9,e);return n=t===void 0?n.replace(QT,""):n.slice(0,t),n?"."+n:""}function yh(e){return e<0?"-":"+"}var ek=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,tk=/[^\w\/:+-]+/;function xh(e){return pa(Oe(e))}function pa(e){return bh(e).id}function bh(e){let t=e.toUpperCase(),n=(i=>{let o=nc(i,1);if(o!==void 0)return{id:vo(o),X:o,m:o}})(t);if(n)return{kind:"fixed",...n};let r=t==="UTC"?"UTC":(i=>(tk.test(i)&&O(sl(i)),ek.test(i)&&O("Forbidden ICU TimeZone"),i.toLowerCase().split("/").map((o,s)=>(o.length<=3||/\d/.test(o))&&!/etc|yap/.test(o)?o.toUpperCase():o.replace(/baja|dumont|[a-z]+/g,(a,u)=>a.length<=2&&!s||a==="in"||a==="chat"?a.toUpperCase():a.length>2||!u?_f(a).replace(/island|noronha|murdo|rivadavia|urville/,_f):a)).join("/")))(e);return nk(r)}var nk=zr(e=>{if(e==="UTC")return{kind:"utc",id:e,m:e};let t=e.toUpperCase(),n=rk(t);return{kind:"named",id:e,format:n,m:n.resolvedOptions().timeZone}}),rk=zr(e=>new Mt("en-u-hc-h23",{calendar:"iso8601",timeZone:e,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}));function Ue(e){let t=bh(e);return ik(t.id,t)}var ik=zr((e,t)=>t.kind==="named"?new il(e,t.m,t.format):new rl(e,t.m,t.kind==="fixed"?t.X:0)),rl=class{constructor(t,n,r){this.id=t,this.m=n,this.X=r}B(){return this.X}N(t){return[Fl(t,this.X)]}O(){}},il=class{constructor(t,n,r){this.id=t,this.m=n,this.ke=((i,o)=>{let s=zr(i),a=zr(ok),u=86400*o;function l(d){let[m,f]=Lf(d,u),p=Ns(m),w=Ns(f),C=s(p),b=s(w);return C===b?C:c(a(p,w),C,b,d)}function c(d,m,f,p){let w,C;for(;(p===void 0||(w=p<d[0]?m:p>=d[1]?f:void 0)===void 0)&&(C=d[1]-d[0]);){let b=d[0]+Math.floor(C/2);i(b)===f?d[1]=b:d[0]=b+1}return w}return{xe(d){let m=l(d-86400),f=l(d+86400),p=d-m,w=d-f;if(m===f)return[p];let C=l(p);return C===l(w)?[d-C]:m>f?[p,w]:[]},we:l,O:function d(m,f){if(f>0&&m>=864e10)return;if(f<0){if(m<=Vu)return;let I=Ff()+94867200;if(m>I)return d(I,-1)}let p=f>0?Math.max(m,Vu):m,[w,C]=Lf(p,u),b=u*f,S=f>0?Math.max(m,Ff())+94867200:Vu,k=()=>f<0?C>S:w<S;for(;k();){let I=Ns(w),A=Ns(C),x=s(I),v=s(A);if(x!==v){let P=a(I,A);c(P,x,v);let M=P[0];if((Kt(M,m)||1)===f)return M}w+=b,C+=b}}}})((i=>o=>{let s=YT(i,1e3*o);return 86400*io((a=>{let u=a.relatedYear;if(u!==void 0)return parseInt(u);let l=parseInt(a.year);return a.era!==void 0&&Jf(a.era)==="bce"?1-l:l})(s),parseInt(s.month),parseInt(s.day))+3600*parseInt(s.hour)+60*parseInt(s.minute)+parseInt(s.second)-o})(r),(i=>{let o=i.split("/").pop();return ZT[o]||60})(t))}B(t){return this.ke.we((n=>Of(n)[0])(t))*Cn}N(t){let n=86400*Ot(t)+xl(t),r=cp(t);return this.ke.xe(n).map(i=>yt(BigInt(i)*Xn+BigInt(r)))}O(t,n){let[r,i]=Of(t),o=this.ke.O(r+(n>0||i?1:0),n);if(o!==void 0)return BigInt(o)*Xn}};function Ff(){return Math.floor(Date.now()/1e3)}function ok(e,t){return[e,t]}function Lf(e,t){let n=Math.floor(e/t)*t;return[n,n+t]}function Ns(e){return al(e,-1e10,864e10)}function wh(e,t,n){let r=le(n,Fe(t,up,lp),oc,[],0);if(r.timeZone!==void 0){let i=uo(t,r),o=_o(r),s=Ue(e(r.timeZone));return{epochNanoseconds:Jr(s,ee(i,o),r.offset),timeZone:s,calendar:t}}return uo(t,r)}function Th(e,t,n,r){let i=le(n,Fe(t,up,lp),oc,gl,0),o=e(i.timeZone),[s,a,u,l]=ma(t,i,()=>Ur(r)),c=_o(i,a),d=Ue(o);return xt(Jr(d,ee(s,c),i.offset,u,l),d,t)}function kh(e,t,n){let r=le(t,Fe(e,sp,ap),ic,[],0),[i,o]=ma(e,r,()=>[K(n)]);return Oo(i,_o(r,o),e)}function Sh(e,t,n,r=[]){return uo(e,le(t,Fe(e,or,sr),it,r),n)}function Ch(e,t,n,r){return ac(e,le(t,Fe(e,xo,rp),it,r),n)}function Eh(e,t,n,r){let i=le(n,Fe(e,or,sr),it,ir,0);return t&&i.month!==void 0&&i.monthCode===void 0&&i.year===void 0&&(i.year=1972),uc(e,i,r)}function Ih(e,t){return _o(le(e,Ju,rc,[],1),K(t))}function Ah(e){let t=le(e,Sp,uh);return we(An({...he,...t}))}function pt(e){O(jf(e))}function Dh(e){let t=Dn(e=_l(e)),n;return t||pt(e),t.C?n=0:t.offset?n=da(t.offset):pt(e),t.timeZoneId&&nc(t.timeZoneId,1),So(t),rt(Fl(t,n))}function _h(e,t){let n=Dn(Oe(e));return n||pt(e),n.timeZoneId?zh(n,t,void 0):(n.C&&pt(e),ol(n,t))}function Oh(e,t,n){let r=Dn(Oe(e));return r&&r.timeZoneId||pt(e),zh(r,t,n)}function vh(e,t){let n=Dn(Oe(e));return n&&!n.C||pt(e),Bh(n,t)}function Mh(e,t){let n=Sc(kc(Oe(e)),void 0,t);return ne(n,n.calendar)}function Nh(e,t){let n=Cc(Oe(e));if(n)return Tc(n),ne(ea(en(n)),t(n.calendarId));let r=Sc(kc(e),sk,t),{calendar:i}=r;return ne(ao(i,r),i)}function Tc(e){e.calendarId!=="iso8601"&&O(Zt(e.calendarId))}function Ph(e,t){let n=Ec(Oe(e));if(n)return Tc(n),ne(en(n),t(n.calendarId));let r=Sc(kc(e),ak,t),{calendar:i}=r,{year:o,month:s,day:a}=te(i,r),[u,l]=Qn(i,o,s),{year:c,month:d}=((m,f,p,w)=>{let C=m?m.u(f,p,w):Xu(f,p);return C||O("Cannot guess year"),C})(i,u,l,a);return ne($e(er(i,c,d,a)),i)}function Rh(e){let t=(r=>{let i=Uh(r);return i?(Mo(i[13]),qh(i,1)):void 0})(e=Oe(e));if(!t){let r=Dn(e);r&&r.re||pt(e),r.C&&O(Zt("Z")),Tc(r),t=r}let n;return(n=Cc(e))&&vf(n)&&pt(e),(n=Ec(e))&&vf(n)&&pt(e),ur(wo(t))}function Fh(e){let t=pk.exec(Oe(e));return t||pt(e),we(An((n=>{let r=0,i=0,o=0,s={years:a(n[2]),months:a(n[3]),weeks:a(n[4]),days:a(n[5]),hours:a(n[6],n[7],5),minutes:a(n[8],n[9],4),seconds:a(n[10],n[11],3),...Kl(o,2,se)};return r||O($f(se)),cl(n[1])<0&&(s=ve(s)),s;function a(u,l,c){let d=0,m=0;return c&&([d,o]=At(o,gt[c])),u!==void 0&&(i&&O(Zt(u)),m=(f=>{let p=parseInt(f);return Number.isFinite(p)||O(Zt(f)),p})(u),r=1,l&&(o=ll(l)*(gt[c]/Cn),i=1)),d+m}})(t)))}function Lh(e){let t=Dn(e)||Cc(e)||Ec(e);if(t)return t.calendarId;let n=Uh(e);return n?Mo(n[13]).calendarId:e}function $h(e){let t=Dn(e);return t&&(t.timeZoneId||t.C&&"UTC"||t.offset)||e}function kc(e){let t=Dn(e);return t&&!t.C||pt(e),t}function Sc(e,t,n){return t&&e.calendarId==="iso8601"?(en(e),e.re&&wo(e),ol(t(e),n)):e.re?Bh(e,n):ol(e,n)}function sk(e){let t=12*e.year+e.month===Mp?20:1;return{...e,day:t}}function ak(e){return{...e,year:1972}}function zh(e,t,n){let r=Ue(pa(e.timeZoneId)),i;if(So(e),e.re){let s=e.offset?da(e.offset):void 0,[,a,u]=Ur(n);i=Jr(r,e,s,a,u,!(r.X||e.offset===void 0||(o=e.offset,o.replace(/\D/g,"").length>4)),e.C)}else Ur(n),i=wn(r,e);var o;return yt(i),xt(i,r,t(e.calendarId))}function Bh(e,t){return So(e),ar(e),{...ee(e,e),calendar:t(e.calendarId)}}function ol(e,t){return en(e),$e(e),{calendar:t(e.calendarId),year:e.year,month:e.month,day:e.day}}function zs(e){return`(\\d{2})(?:(:?)(\\d{2})(?:\\${e}(\\d{2})(?:[.,](\\d{1,9}))?)?)?`}var uk="(?:(?:([+-])(\\d{6}))|(\\d{4}))(-?)(\\d{2})\\4(\\d{2})(?:[T ]"+zs(8)+"(Z|([+-])"+zs(15)+")?)?",lk=Hr("(?:(?:([+-])(\\d{6}))|(\\d{4}))-?(\\d{2})((?:\\[(!?)([^\\]]*)\\]){0,9})"),ck=Hr("(?:--)?(\\d{2})-?(\\d{2})((?:\\[(!?)([^\\]]*)\\]){0,9})"),dk=Hr(uk+"((?:\\[(!?)([^\\]]*)\\]){0,9})"),mk=Hr("T?"+zs(2)+`(([+-])${zs(9)})?((?:\\[(!?)([^\\]]*)\\]){0,9})`),fk=new RegExp("\\[(!?)([^\\]]*)\\]","g"),pk=Hr("([+-])?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?!$)(?:(\\d+)(?:[.,](\\d{1,9}))?H)?(?:(\\d+)(?:[.,](\\d{1,9}))?M)?(?:(\\d+)(?:[.,](\\d{1,9}))?S)?)?");function Dn(e){let t=dk.exec(e);return t?(n=>{let r=n[12],i=(r||"").toUpperCase()==="Z";return{year:Hh(n),month:parseInt(n[5]),day:parseInt(n[6]),...qh(n,7),...Mo(n[19]),re:!!n[7],C:i,offset:i?void 0:r}})(t):void 0}function Cc(e){let t=lk.exec(e);if(t)return(n=>({year:Hh(n),month:parseInt(n[4]),day:1,...Mo(n[5])}))(t)}function Ec(e){let t=ck.exec(e);return t?(n=>({year:1972,month:parseInt(n[1]),day:parseInt(n[2]),...Mo(n[3])}))(t):void 0}function Uh(e){let t=mk.exec(e);if(t)return t[6]&&da(t[6]),t}function qh(e,t){let n=Lr(e[t+3]);return{...bl(ll(e[t+4]||""))[0],hour:Lr(e[t]),minute:Lr(e[t+2]),second:n===60?59:n}}function Hh(e){let t=cl(e[1]),n=parseInt(e[2]||e[3]);return t<0&&!n&&O(Zt(-0)),t*n}function Mo(e){let t,n,r=[];return e.replace(fk,(i,o,s)=>{let a=!!o,[u,l]=s.split("=").reverse();return l?l==="u-ca"?(r.push(u.toLowerCase()),t||(t=a)):(a||/[A-Z]/.test(l))&&O(Zt(i)):(n&&O(Zt(i)),n=u),""}),r.length>1&&t&&O(Zt(e)),{timeZoneId:n,calendarId:r[0]||"iso8601"}}function ti(e,t,n){let r=Object.assign(Object.create(null),t);return Gu(r,n,np),ei(e)&&(Gu(r,n,rT),e&&e.ge&&Gu(r,n,iT,Vr)),r}function Gu(e,t,n,r){let i=0,o=[];for(let s of n)t[s]!==void 0?i=1:o.push(s);if(Object.assign(e,t),i)for(let s of r||o)delete e[s]}function Wh(e,t,n){let{calendar:r,timeZone:i}=e,o=Fe(r,sT,aT),s=ge(e),{year:a,month:u,day:l}=te(r,s),c={year:a,monthCode:No(r,a,u),day:l,hour:s.hour,minute:s.minute,second:s.second,millisecond:s.millisecond,microsecond:s.microsecond,nanosecond:s.nanosecond,offset:s.offsetNanoseconds},d=le(t,o,oc),m=ti(r,c,d),f={...c,...d},[p,w,C,b]=ma(r,m,()=>Ur(n,2));return xt(Jr(i,ee(p,Gs(f,w)),f.offset,C,b),i,r)}function jh(e,t,n){let{calendar:r}=e,i=Fe(r,sp,ap),{year:o,month:s,day:a}=te(r,e),u={year:o,monthCode:No(r,o,s),day:a,hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond,microsecond:e.microsecond,nanosecond:e.nanosecond},l=le(t,i,ic),c=ti(r,u,l),d={...u,...l},[m,f]=ma(r,c,()=>[K(n)]);return Oo(m,Gs(d,f),r)}function Vh(e,t,n){let{calendar:r}=e,i=Fe(r,or,sr),{year:o,month:s,day:a}=te(r,e);return uo(r,ti(r,{year:o,monthCode:No(r,o,s),day:a},le(t,i,it)),n)}function Gh(e,t,n){let{calendar:r}=e,i=Fe(r,xo,rp),{year:o,month:s}=te(r,e);return ac(r,ti(r,{year:o,monthCode:No(r,o,s)},le(t,i,it)),n)}function Yh(e,t,n){let{calendar:r}=e,i=Fe(r,or,sr),{year:o,month:s,day:a}=te(r,e);return uc(r,ti(r,{monthCode:No(r,o,s),day:a},le(t,i,it)),n)}function Zh(e,t,n){return((r,i,o)=>_o({..._t(Ju,r),...le(i,Ju,rc)},K(o)))(e,t,n)}function Kh(e,t){return we((n=e,r=t,An({...n,...le(r,Sp,uh)})));var n,r}function No(e,t,n){let[r,i]=Qn(e,t,n);return ep(r,i)}function Jh(e,t,n){return xt(e.epochNanoseconds,t,n)}function Xh(e){return rt(e.epochNanoseconds)}function Ic(e){return vt(ge(e),e.calendar)}function Ac(e){return ne(ge(e),e.calendar)}function Dc(e){return ur(ge(e))}function Qh(e,t,n){let r=Xr(t,e,(i=>Dp(et(i)))(n));return xt(yt(r),t,e.calendar)}function eg(e,t,n,r){let i=e(r.timeZone),o=r.plainTime,s=o!==void 0?t(o):void 0,a=Ue(i),u;return u=s?Xr(a,ee(n,s)):wn(a,ee(n,Le)),xt(u,a,n.calendar)}function tg(e,t,n){return og(e,_t(Fe(e,bo,ip),t),le(Zn(n),ir,it,[]))}function ng(e,t,n){let r=Fe(e,js,oT);return og(e,_t(op,t),le(Zn(n),r,it,[]))}function rg(e,t){return uc(e,le(t,op,it))}function ig(e,t,n){return ac(e,le(t,Fe(e,bo,ip),it),n)}function og(e,t,n){let r=Fe(e,uT,lT),i=ti(e,t,n);return i=le(i,r,it,[]),uo(e,i)}function sg(e){return rt(yt(BigInt(Xs(e))*jr))}function ag(e){return rt(yt(Js(e)))}function ni(e){return e.timeZone="UTC",["full","long"].includes(e.timeStyle)&&(e.timeStyle="medium"),e}function ug(e,t){return e.timeZone!==void 0&&Q("Cannot specify TimeZone"),e.timeZone=t,e}function ri(e,t,n){let r=e.resolvedOptions().calendar;!n&&t.calendar===tt||ht(t.calendar)===r||O("Mismatching Calendars")}function dr(e,t,n,r,i){let o=new Set(e),s=new Set(t),a=new Set(n);return(u,l)=>{let c,d,m={},f={},p={},w=0,C=0;for(let M of Object.keys(u)){let y=u[M];y===void 0||a.has(M)||(o.has(M)?M==="dateStyle"?c=y:M==="timeStyle"?d=y:m[M]=y:M==="era"?f[M]=y:s.has(M)?M==="dateStyle"||M==="timeStyle"?C=1:w=1:p[M]=y)}let b=c!==void 0,S=d!==void 0,k=b||S,I=Object.keys(m).length>0,A=w||C,x=I||b||S,v=Object.keys(f).length>0;(!l&&A||l&&A&&!x||k&&(I||v||w))&&Q("Invalid formatting options");let P={};return k||x||Object.assign(P,r),Object.assign(P,m,f,p),b&&(i?Object.assign(P,i[c]):P.dateStyle=c),S&&(P.timeStyle=d),P}}var lg={year:"numeric",month:"numeric",day:"numeric"},cg={hour:"numeric",minute:"numeric",second:"numeric"},_c=Object.assign({},lg,cg),Oc=["weekday","year","month","day","dateStyle"],Po=["dayPeriod","hour","minute","second","fractionalSecondDigits","timeStyle"],vc=Oc.concat(Po),hk=["weekday","day"].concat(Po),gk=["weekday","year"].concat(Po),dg=dr(vc,[],[],_c),mg=dr(vc,[],[],{..._c,timeZoneName:"short"}),fg=dr(vc,[],["timeZoneName"],_c),pg=dr(Oc,Po,["timeZoneName"],lg),hg=dr(Po,Oc,["timeZoneName","era"],cg),gg=dr(["year","month","dateStyle"],hk,["timeZoneName"],{year:"numeric",month:"numeric"},{full:{year:"numeric",month:"long"},long:{year:"numeric",month:"long"},medium:{year:"numeric",month:"short"},short:{year:"2-digit",month:"numeric"}}),yg=dr(["month","day","dateStyle"],gk,["timeZoneName","era"],{month:"numeric",day:"numeric"},{full:{month:"long",day:"numeric"},long:{month:"long",day:"numeric"},medium:{month:"short",day:"numeric"},short:{month:"numeric",day:"numeric"}});function xg(e,t){let{timeZone:n}=e,r=ge(e),{offsetNanoseconds:i}=r,o=t||Le,s;return s=t?Jr(n,ee(r,o),i,2):wn(n,ee(r,o)),xt(s,n,e.calendar)}function ha(e){let t=ga(),n=e.B(t);return ko(t+BigInt(n))}function ga(){return BigInt(Date.now())*jr}function ii(){return new Mt().resolvedOptions().timeZone}var Mc="PlainYearMonth",Nc="PlainMonthDay",Pc="PlainDate",Rc="PlainDateTime",Fc="PlainTime",Lc="ZonedDateTime",$c="Instant",zc="Duration";function nn(e,t,n,...r){return Object.defineProperties(t,Vf(e)),Object.defineProperties(t.prototype,co("Temporal."+e)),Object.defineProperties(t.prototype,Sn(i=>({get(){return i(n(this))},configurable:1}),Object.assign({},...r))),t}var rn=ul.name==="noop"?e=>{Object.defineProperty(e,"_str_",{value:e.toJSON()})}:ul;function on(){Q(qf)}function sn(){Q(Uf)}var wg={era(e){return Co(e.calendar,e).era},eraYear(e){return Co(e.calendar,e).eraYear},year(e){return te(e.calendar,e).year},month(e){return te(e.calendar,e).month},monthCode(e){return Ks(e.calendar,e)}},ya={era(e){return Co(e.calendar,e).era},eraYear(e){return Co(e.calendar,e).eraYear},year(e){return te(e.calendar,e).year},month(e){return te(e.calendar,e).month},monthCode(e){return Ks(e.calendar,e)},day(e){return te(e.calendar,e).day}},Tg={monthCode(e){return Ks(e.calendar,e)},day(e){return te(e.calendar,e).day}},Bc={daysInMonth(e){return kl(e.calendar,e)},daysInYear(e){return Sl(e.calendar,e)},monthsInYear(e){return Tl(e.calendar,e)},inLeapYear(e){return wl(e.calendar,e)}},Ro={dayOfWeek(e){return Zs(e)},dayOfYear(e){return wp(e.calendar,e)},weekOfYear(e){return Tp(e.calendar,e)},yearOfWeek(e){return kp(e.calendar,e)},daysInWeek(){return 7},daysInMonth(e){return kl(e.calendar,e)},daysInYear(e){return Sl(e.calendar,e)},monthsInYear(e){return Tl(e.calendar,e)},inLeapYear(e){return wl(e.calendar,e)}};function bg(e){return Hs(Object.keys(e))}bg(Bc),bg(Ro);function Mn(e){let t=Oe(e).toLowerCase();return t===fl?tt:t===Kf?Xf:void O(Wf(e,"temporal-polyfill/full"))}function $o(e=fl){return Mn(e)}var Sg=new WeakMap,Cg=nn(Lc,class{constructor(e,t,n=void 0){let r=yt(Js(e)),i=Ue(xh(t)),o=$o(n);Eg(this,xt(r,i,o))}static from(e,t=void 0){return qe(oi(e,t))}static compare(e,t){return Do(oi(e),oi(t))}get calendarId(){return ht(X(this).calendar)}get timeZoneId(){return X(this).timeZone.id}get epochMilliseconds(){return Io(X(this))}get epochNanoseconds(){return Ll(X(this))}get offset(){return vo(ge(X(this)).offsetNanoseconds)}get offsetNanoseconds(){return ge(X(this)).offsetNanoseconds}get hoursInDay(){return Lp(X(this))}with(e,t=void 0){return qe(Wh(X(this),ci(e),t))}withCalendar(e){return qe({...X(this),calendar:wa(e)})}withTimeZone(e){return qe({...X(this),timeZone:Ue(at(e))})}withPlainTime(e=void 0){return qe(xg(X(this),Wc(e)))}add(e,t=void 0){let n=X(this);return qe(tr(n,Ee(e),t))}subtract(e,t=void 0){let n=X(this);return qe(tr(n,ve(Ee(e)),t))}until(e,t=void 0){let n=X(this),r=oi(e),i=tn(n.calendar,r.calendar);return ye(we(Hl(0,i,n,r,t)))}since(e,t=void 0){let n=X(this),r=oi(e),i=tn(n.calendar,r.calendar);return ye(we(Hl(1,i,n,r,t)))}round(e){let t=X(this),[n,r,i]=Eo(e);return qe(Fp(t,n,r,i))}startOfDay(){return qe($p(X(this)))}equals(e){return nh(X(this),oi(e))}toInstant(){return an(Xh(X(this)))}toPlainDateTime(){return Nt(Ic(X(this)))}toPlainDate(){return Pt(Ac(X(this)))}toPlainTime(){return vn(Dc(X(this)))}toLocaleString(e=void 0,t={}){let n=X(this),r=new Mt(e,ug(mg(t),qp(n)));return ri(r,n),r.format(Io(n))}toString(e=void 0){return mc(X(this),e)}toJSON(){return mc(X(this))}getTimeZoneTransition(e){let t=X(this),n=Bp(t,e);return n?qe({...t,epochNanoseconds:n}):null}valueOf(){return sn()}},yk,ya,Ro,yo);function qe(e){return Eg(Object.create(Cg.prototype),e)}function X(e){return Rt(e)||on()}function yk(e){let t=X(e);return{...ge(t),calendar:t.calendar}}function Rt(e){return Sg.get(e)}function oi(e,t){if(ze(e)){let n=Rt(e);if(n)return Ur(t),n;let r=zo(e);return Th(at,r,e,t)}return Oh(e,Mn,t)}function Eg(e,t){return Sg.set(e,t),rn(e),e}function at(e){if(ze(e)){let t=Rt(e);return t||Q(sl(e)),t.timeZone.id}return(t=>pa($h(Oe(t))))(e)}var Ig=new WeakMap,Ag=nn($c,class{constructor(e){let t=yt(Js(e));_g(this,rt(t))}static from(e){return an(si(e))}static fromEpochMilliseconds(e){return an(sg(e))}static fromEpochNanoseconds(e){return an(ag(e))}static compare(e,t){return Do(si(e),si(t))}get epochMilliseconds(){return Io(ot(this))}get epochNanoseconds(){return Ll(ot(this))}add(e){let t=ot(this);return an(rt(Ul(t.epochNanoseconds,Ee(e))))}subtract(e){let t=ot(this);return an(rt(Ul(t.epochNanoseconds,ve(Ee(e)))))}until(e,t=void 0){return ye(ql(0,ot(this),si(e),t))}since(e,t=void 0){return ye(ql(1,ot(this),si(e),t))}round(e){let t=ot(this),[n,r,i]=Eo(e,5,1);return an(rt(oa(t.epochNanoseconds,Ao(n,r),i)))}equals(e){return th(ot(this),si(e))}toZonedDateTimeISO(e){return qe(Jh(ot(this),Ue(at(e))))}toLocaleString(e=void 0,t={}){let n=ot(this);return new Mt(e,dg(t)).format(Io(n))}toString(e=void 0){return dc(at,ot(this),e)}toJSON(){return dc(at,ot(this))}valueOf(){return sn()}});function an(e){return _g(Object.create(Ag.prototype),e)}function ot(e){return qc(e)||on()}function qc(e){return Ig.get(e)}function si(e){if(ze(e)){let t=qc(e);if(t)return t;let n=Rt(e);if(n)return rt(n.epochNanoseconds)}return Dh(e)}var{toTemporalInstant:Dg}={toTemporalInstant(){let e=Date.prototype.valueOf.call(this);return an(rt(BigInt(Al(e))*jr))}};function _g(e,t){return Ig.set(e,t),rn(e),e}var Og=new WeakMap,vg=nn(Nc,class{constructor(e,t,n=void 0,r){let i=Se(e),o=Se(t),s=$o(n),a=Se(r??pp),u=$e(en({year:a,month:i,day:o}));Mg(this,ne(u,s))}static from(e,t=void 0){return Uc(kg(e,t))}get calendarId(){return ht(_n(this).calendar)}with(e,t=void 0){return Uc(Yh(_n(this),ci(e),t))}equals(e){return sh(_n(this),kg(e))}toPlainDate(e){let t=_n(this);return Pt(ng(t.calendar,this,e))}toLocaleString(e=void 0,t={}){let n=_n(this),r=new Mt(e,ni(yg(t)));return ri(r,n,1),r.format(To(n))}toString(e=void 0){return gc(_n(this),e)}toJSON(){return gc(_n(this))}valueOf(){return sn()}},_n,Tg);function Uc(e){return Mg(Object.create(vg.prototype),e)}function _n(e){return xa(e)||on()}function xa(e){return Og.get(e)}function kg(e,t){if(ze(e)){let r=xa(e);if(r)return K(t),r;let i=jg(e);return Eh(i===void 0?tt:i,i===void 0,e,t)}let n=Ph(e,Mn);return K(t),n}function Mg(e,t){return Og.set(e,t),rn(e),e}var Ng=new WeakMap,Pg=nn(Mc,class{constructor(e,t,n=void 0,r){let i=Se(e),o=Se(t),s=$o(n),a=Se(r??1),u=ea(en({year:i,month:o,day:a}));Rg(this,ne(u,s))}static from(e,t=void 0){return Lo(ai(e,t))}static compare(e,t){return cr(ai(e),ai(t))}get calendarId(){return ht(st(this).calendar)}with(e,t=void 0){return Lo(Gh(st(this),ci(e),t))}add(e,t=void 0){let n=st(this);return Lo(ne(Bl(0,n.calendar,n,Ee(e),t),n.calendar))}subtract(e,t=void 0){let n=st(this);return Lo(ne(Bl(1,n.calendar,n,Ee(e),t),n.calendar))}until(e,t=void 0){let n=st(this),r=ai(e),i=tn(n.calendar,r.calendar);return ye(Vl(0,i,n,r,t))}since(e,t=void 0){let n=st(this),r=ai(e),i=tn(n.calendar,r.calendar);return ye(Vl(1,i,n,r,t))}equals(e){return oh(st(this),ai(e))}toPlainDate(e){let t=st(this);return Pt(tg(t.calendar,this,e))}toLocaleString(e=void 0,t={}){let n=st(this),r=new Mt(e,ni(gg(t)));return ri(r,n,1),r.format(To(n))}toString(e=void 0){return hc(st(this),e)}toJSON(){return hc(st(this))}valueOf(){return sn()}},st,wg,Bc);function Lo(e){return Rg(Object.create(Pg.prototype),e)}function st(e){return ba(e)||on()}function ba(e){return Ng.get(e)}function ai(e,t){if(ze(e)){let r=ba(e);if(r)return K(t),r;let i=zo(e);return Ch(i,e,t)}let n=Nh(e,Mn);return K(t),n}function Rg(e,t){return Ng.set(e,t),rn(e),e}function xk(e){if(!ze(e))return;let t=qc(e);return t?[$c,t]:(t=Rt(e),t?[Lc,t]:(t=mr(e),t?[Rc,t]:(t=di(e),t?[Pc,t]:(t=Hc(e),t?[Fc,t]:(t=ba(e),t?[Mc,t]:(t=xa(e),t?[Nc,t]:(t=jc(e),t?[zc,t]:void 0)))))))}function ci(e){return(xk(e)||e.calendar!==void 0||e.timeZone!==void 0)&&Q(zf),e}var Fg=new WeakMap,Lg=nn(Fc,class{constructor(e=0,t=0,n=0,r=0,i=0,o=0){let s=wo(Sn(Se,{hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:o}));$g(this,ur(s))}static from(e,t=void 0){return vn(On(e,t))}static compare(e,t){return ca(On(e),On(t))}with(e,t=void 0){return vn(Zh(bt(this),ci(e),t))}add(e){let t=bt(this);return vn(sa(t,Ee(e))[0])}subtract(e){let t=bt(this);return vn(sa(t,ve(Ee(e)))[0])}until(e,t=void 0){return ye(Gl(0,bt(this),On(e),t))}since(e,t=void 0){return ye(Gl(1,bt(this),On(e),t))}round(e){let t=bt(this),[n,r,i]=Eo(e,5);return vn(na(t,Kr(n,r),i)[0])}equals(e){return ah(bt(this),On(e))}toLocaleString(e=void 0,t={}){let n=bt(this);return new Mt(e,ni(hg(t))).format(yl(n))}toString(e=void 0){return yc(bt(this),e)}toJSON(){return yc(bt(this))}valueOf(){return sn()}},bt,yo);function vn(e){return $g(Object.create(Lg.prototype),e)}function bt(e){return Hc(e)||on()}function Hc(e){return Fg.get(e)}function On(e,t){if(ze(e)){let r=Hc(e);if(r)return K(t),r;let i=mr(e);if(i)return K(t),ur(i);let o=Rt(e);return o?(K(t),Dc(o)):Ih(e,t)}let n=Rh(e);return K(t),n}function Wc(e){return e===void 0?void 0:On(e)}function $g(e,t){return Fg.set(e,t),rn(e),e}var zg=new WeakMap,Bg=nn(Rc,class{constructor(e,t,n,r=0,i=0,o=0,s=0,a=0,u=0,l=void 0){let c=ar(So(Sn(Se,{year:e,month:t,day:n,hour:r,minute:i,second:o,millisecond:s,microsecond:a,nanosecond:u}))),d=$o(l);Ug(this,vt(c,d))}static from(e,t=void 0){return Nt(ui(e,t))}static compare(e,t){let n=ui(e),r=ui(t);return ec(n,r)}get calendarId(){return ht(Ce(this).calendar)}with(e,t=void 0){return Nt(jh(Ce(this),ci(e),t))}withCalendar(e){let t=Ce(this);return Nt(vt(t,wa(e)))}withPlainTime(e=void 0){let t=Ce(this);return Nt(Oo(t,Wc(e),t.calendar))}add(e,t=void 0){let n=Ce(this);return Nt(vt(nr(n.calendar,n,Ee(e),t),n.calendar))}subtract(e,t=void 0){let n=Ce(this);return Nt(vt(nr(n.calendar,n,ve(Ee(e)),t),n.calendar))}until(e,t=void 0){let n=Ce(this),r=ui(e),i=tn(n.calendar,r.calendar);return ye(Wl(0,i,n,r,t))}since(e,t=void 0){let n=Ce(this),r=ui(e),i=tn(n.calendar,r.calendar);return ye(Wl(1,i,n,r,t))}round(e){let t=Ce(this),[n,r,i]=Eo(e);return Nt(vt(ta(t,Kr(n,r),i),t.calendar))}equals(e){return rh(Ce(this),ui(e))}toZonedDateTime(e,t=void 0){return qe(Qh(Ce(this),Ue(at(e)),t))}toPlainDate(){let e=Ce(this);return Pt(ne(e,e.calendar))}toPlainTime(){return vn(ur(Ce(this)))}toLocaleString(e=void 0,t={}){let n=Ce(this),r=new Mt(e,ni(fg(t)));return ri(r,n),r.format(mp(n))}toString(e=void 0){return fc(Ce(this),e)}toJSON(){return fc(Ce(this))}valueOf(){return sn()}},Ce,ya,Ro,yo);function Nt(e){return Ug(Object.create(Bg.prototype),e)}function Ce(e){return mr(e)||on()}function mr(e){return zg.get(e)}function ui(e,t){if(ze(e)){let r=mr(e);if(r)return K(t),r;let i=di(e);if(i)return K(t),vt(ee(i,Le),i.calendar);let o=Rt(e);if(o)return K(t),Ic(o);let s=zo(e);return kh(s,e,t)}let n=vh(e,Mn);return K(t),n}function Ug(e,t){return zg.set(e,t),rn(e),e}var qg=new WeakMap,Hg=nn(Pc,class{constructor(e,t,n,r=void 0){let i=$e(en(Sn(Se,{year:e,month:t,day:n}))),o=$o(r);Wg(this,ne(i,o))}static from(e,t=void 0){return Pt(li(e,t))}static compare(e,t){return cr(li(e),li(t))}get calendarId(){return ht(Me(this).calendar)}with(e,t=void 0){let n=Me(this);return Pt(Vh(n,ci(e),t))}withCalendar(e){let t=Me(this);return Pt(ne(t,wa(e)))}add(e,t=void 0){let n=Me(this);return Pt(ne(Qr(n.calendar,n,Ee(e),t),n.calendar))}subtract(e,t=void 0){let n=Me(this);return Pt(ne(Qr(n.calendar,n,ve(Ee(e)),t),n.calendar))}until(e,t=void 0){let n=Me(this),r=li(e),i=tn(n.calendar,r.calendar);return ye(jl(0,i,n,r,t))}since(e,t=void 0){let n=Me(this),r=li(e),i=tn(n.calendar,r.calendar);return ye(jl(1,i,n,r,t))}equals(e){return ih(Me(this),li(e))}toZonedDateTime(e){let t=ze(e)?{timeZone:e.timeZone,plainTime:e.plainTime}:{timeZone:e};return qe(eg(at,On,Me(this),t))}toPlainDateTime(e=void 0){let t=Me(this);return Nt(Oo(t,Wc(e),t.calendar))}toPlainYearMonth(){let e=Me(this);return Lo(ig(e.calendar,this))}toPlainMonthDay(){let e=Me(this);return Uc(rg(e.calendar,this))}toLocaleString(e=void 0,t={}){let n=Me(this),r=new Mt(e,ni(pg(t)));return ri(r,n),r.format(To(n))}toString(e=void 0){return pc(Me(this),e)}toJSON(){return pc(Me(this))}valueOf(){return sn()}},Me,ya,Ro);function Pt(e){return Wg(Object.create(Hg.prototype),e)}function Me(e){return di(e)||on()}function di(e){return qg.get(e)}function li(e,t){if(ze(e)){let r=di(e);if(r)return K(t),r;let i=mr(e);if(i)return K(t),ne(i,i.calendar);let o=Rt(e);if(o)return K(t),Ac(o);let s=zo(e);return Sh(s,e,t)}let n=Mh(e,Mn);return K(t),n}function Wg(e,t){return qg.set(e,t),rn(e),e}function zo(e){let t=jg(e);return t===void 0?tt:t}function jg(e){let{calendar:t}=e;if(t!==void 0)return wa(t)}function wa(e){if(ze(e)){let t=di(e)||mr(e)||Rt(e)||xa(e)||ba(e);return t||Q(Hf(e)),t.calendar}return(t=>Mn(Lh(Oe(t))))(e)}var Vg=new WeakMap,Gg=nn(zc,class{constructor(e=0,t=0,n=0,r=0,i=0,o=0,s=0,a=0,u=0,l=0){let c=An(Sn(Xs,{years:e,months:t,weeks:n,days:r,hours:i,minutes:o,seconds:s,milliseconds:a,microseconds:u,nanoseconds:l}));Yg(this,we(c))}static from(e){return ye(Ee(e))}static compare(e,t,n=void 0){return eh(Fo,Ee(e),Ee(t),n)}get sign(){return Ye(this).sign}get blank(){return!Ye(this).sign}with(e){return ye(Kh(Ye(this),e))}negated(){return ye(Xl(Ye(this)))}abs(){return ye(Jp(Ye(this)))}add(e,t=void 0){return ye(Jl(Fo,0,Ye(this),Ee(e),t))}subtract(e,t=void 0){return ye(Jl(Fo,1,Ye(this),Ee(e),t))}round(e){return ye(Kp(Fo,Ye(this),e))}total(e){return Pp(Fo,Ye(this),e)}toLocaleString(e=void 0,t){let n=Ye(this);return Intl.DurationFormat?new Intl.DurationFormat(e,t).format(n):fa(n,t)}toString(e=void 0){return fa(Ye(this),e)}toJSON(){return fa(Ye(this))}valueOf(){return sn()}},Ye,Cl);function ye(e){return Yg(Object.create(Gg.prototype),e)}function Ye(e){return jc(e)||on()}function jc(e){return Vg.get(e)}function Ee(e){return ze(e)?jc(e)||Ah(e):Fh(e)}function Fo(e){if(e!==void 0){if(ze(e)){let t=Rt(e);if(t)return t;let n=di(e);if(n)return n;let r=mr(e);if(r)return ne(r,r.calendar);let i=zo(e);return wh(at,i,e)}return _h(e,Mn)}}function Yg(e,t){return Vg.set(e,t),rn(e),e}var bk=Object.defineProperties({},{...co("Temporal.Now"),...qs({timeZoneId(){return ii()},instant(){return an(rt(ga()))},zonedDateTimeISO(e=ii()){let t=Ue(at(e));return qe(xt(ga(),t))},plainDateTimeISO(e=ii()){let t=ha(Ue(at(e)));return Nt(vt(t))},plainDateISO(e=ii()){let t=ha(Ue(at(e)));return Pt(ne(t))},plainTimeISO(e=ii()){let t=ha(Ue(at(e)));return vn(ur(t))}})}),Zg=Object.defineProperties({},{...co("Temporal"),...qs({PlainYearMonth:Pg,PlainMonthDay:vg,PlainDate:Hg,PlainTime:Lg,PlainDateTime:Bg,ZonedDateTime:Cg,Instant:Ag,Duration:Gg,Now:bk})});var Bo=$u||Zg;var SN=$u?Date.prototype.toTemporalInstant:Dg;var wk=120,Vc=365*24*60*60*1e3;var Kg=/^[\s,.;:!?()[\]{}]*$/u;function Ie(e){return{ok:!1,reason:e}}function Tk(e){let t=e.now instanceof Date?e.now.getTime():Number.NaN;if(!Number.isFinite(t))return Ie("invalid_reference_time");let n=typeof e.timeZone=="string"?e.timeZone.trim():"";if(n.length===0)return Ie("invalid_time_zone");try{new Intl.DateTimeFormat("en-US",{timeZone:n}).format(e.now);let r=Bo.Instant.fromEpochMilliseconds(t),i=r.toZonedDateTimeISO(n);return{nowMs:t,timeZone:n,nowInstant:r,nowZoned:i}}catch{return Ie("invalid_time_zone")}}function kk(e){return"ok"in e&&e.ok===!1}function fr(e,t=2){return String(e).padStart(t,"0")}function Sk(e){return[`${fr(e.year,4)}-${fr(e.month)}-${fr(e.day)}`,`${fr(e.hour)}:${fr(e.minute)}:${fr(e.second)}.${fr(e.millisecond,3)}`].join("T")}function Ck(e){let t=Number(e.instant.epochMilliseconds);if(t<=e.context.nowMs)return Ie("time_in_past");if(t-e.context.nowMs>Vc)return Ie("time_too_far");let n=e.instant.toZonedDateTimeISO(e.context.timeZone);return{ok:!0,schedule:{returnAt:new Date(t).toISOString(),timeZone:e.context.timeZone,localDateTime:Sk(n),source:e.source,...e.preset?{preset:e.preset}:{},...e.matchedText?{matchedText:e.matchedText}:{}}}}function Ek(e,t,n){let r=e.slice(0,t),i=e.slice(t+n.length);return Kg.test(r)&&Kg.test(i)}function Ft(e,t){let n=e.get(t);if(n==null)throw new RangeError(`Missing parsed ${t}`);return n}function Ik(e,t){let n;try{n=Bo.PlainDateTime.from({year:Ft(e.start,"year"),month:Ft(e.start,"month"),day:Ft(e.start,"day"),hour:Ft(e.start,"hour"),minute:Ft(e.start,"minute"),second:Ft(e.start,"second"),millisecond:Ft(e.start,"millisecond")},{overflow:"reject"})}catch{return null}try{return n.toZonedDateTime(t.timeZone,{disambiguation:"reject"}).toInstant()}catch{return null}}function Ak(e,t){let n=Ft(e.start,"year"),r=Ft(e.start,"month"),i=Ft(e.start,"day"),o=n===t.nowZoned.year&&r===t.nowZoned.month&&i===t.nowZoned.day;if(o&&t.nowZoned.hour>=23)return"no_time_left_today";let s=o?t.nowZoned.hour+1:t.nowZoned.hour,a=o?0:t.nowZoned.minute;try{return Bo.PlainDateTime.from({year:n,month:r,day:i,hour:s,minute:a,second:0,millisecond:0},{overflow:"reject"}).toZonedDateTime(t.timeZone,{disambiguation:"reject"}).toInstant()}catch{return null}}function Dk(e,t){let n=Number(t.nowZoned.offsetNanoseconds)/6e10;return _s.casual.parse(e,{instant:new Date(t.nowMs),timezone:n},{forwardDate:!0})}function Jg(e,t){let n=typeof e=="string"?e.trim():"";if(n.length===0)return Ie("empty");if(n.length>wk)return Ie("input_too_long");let r=Tk(t);if(kk(r))return r;let i=Dk(n,r);if(i.length===0)return Ie("not_recognized");if(i.length>1)return Ie("multiple_results");let o=i[0];if(o.end)return Ie("range_not_supported");if(!Ek(n,o.index,o.text))return Ie("partial_match");let s=o.tags(),a=s.has("result/relativeDateAndTime"),u=s.has("result/relativeDate"),l=s.has("parser/ENCasualTimeParser"),c=!o.start.isCertain("hour")&&!l&&!u&&!a;if(o.start.isCertain("timezoneOffset")&&!a)return Ie("explicit_time_zone_not_supported");if(o.start.isCertain("hour")&&!o.start.isCertain("meridiem")&&!l&&!u&&!a)return Ie("meridiem_required");let d;if(c){let m=Ak(o,r);if(m==="no_time_left_today")return Ie("no_time_left_today");if(!m)return Ie("clock_change_time");d=m}else if(a){let m=o.date();if(!Number.isFinite(m.getTime()))return Ie("not_recognized");d=Bo.Instant.fromEpochMilliseconds(m.getTime())}else{let m=Ik(o,r);if(!m)return Ie("clock_change_time");d=m}return Ck({instant:d,context:r,source:"natural_language",matchedText:o.text})}function _k(e){return t=>{let n=Number(t);if(!Number.isSafeInteger(n)||n<1||n>e)throw new ct(`must be a whole number from 1 to ${e}.`);return n}}function Ok(e){if(!e.trim())throw new ct("needs a value.");return e}function Gc(e){return/T.*(?:Z|[+-]\d{2}:\d{2})$/.test(e)&&Number.isFinite(Date.parse(e))}function vk(e){if(!Gc(e))throw new ct("must be a time like 2026-10-17T09:00:00Z, with Z or an offset such as -04:00.");return e}var xe=(e,t)=>new Ae(e,t).argParser(Ok),Xg=(e,t)=>new Ae(e,t).argParser(vk),Yc=(e,t,n)=>new Ae(e,t).argParser(_k(n)),Ze=(e,t,n)=>new Ae(e,t).choices(n),Ta=100,Uo=25;function hr(e,t){let n=Yc("--limit <count>",`How many ${e} a page holds, up to ${Ta}${t?` (default ${t})`:""}`,Ta);return t===void 0?n:n.default(t)}var gr=()=>xe("--cursor <cursor>","Continue from where the last page ended"),qo=e=>Ze("-a, --alert <level>",e,ys),yr=()=>new Ae("--all",`Show every page; without --limit, each holds ${Ta}`).conflicts("cursor").implies({limit:Ta}),Zc=()=>[new Ae("--unread","Only unread messages").conflicts("read"),new Ae("--read","Only read messages")];function Kc({unread:e,read:t}){return e?!0:t?!1:void 0}async function xr(e,t,{many:n=!1,inbox:r=()=>Mk(e)}={}){if(t===void 0)return;let i=(n?t.split(","):[t]).map(a=>a.trim());if(i.some(a=>!a))throw new W("--source needs source IDs separated by commas, with none left empty.");let o=a=>a.toLowerCase()==="inbox",s=i.some(o)?await r():void 0;return[...new Set(i.flatMap(a=>o(a)?s===void 0?[]:[s]:[a]))]}async function Mk(e){let{items:t}=await e.call(Y("GET","/v1/sources")),n=t.find(r=>r.kind==="system");if(!n)throw new G("not_found","Ripple didn't list Inbox among your sources.");return n.sourceId}function Nn({limit:e,cursor:t,all:n},r){return i=>{let o=i.at(-1);if(!o)return r({limit:e,cursor:t});let s=n&&"nextCursor"in o?o.nextCursor:void 0;return typeof s=="string"&&s?r({limit:e,cursor:s}):void 0}}function ka(){return[xe("-s, --source <ids>","Only messages from these sources, separated by commas; inbox means Inbox"),...Zc(),Xg("--after <time>","Only messages received after this time"),Xg("--before <time>","Only messages received before this time"),qo("Only messages with this alert level"),Ze("--sort <order>","Best matches first, or newest first",["relevance","newest"]),hr("results",Uo),gr(),yr()]}async function Sa(e,t,n){return{query:t.length?t.join(" "):void 0,unread:Kc(n),sourceIds:await xr(e,n.source,{many:!0}),after:n.after,before:n.before,alert:n.alert,sort:n.sort}}var pr=100;async function Qg(e,t){if(!e.includes("-")){if(e.length>pr)throw new W(`Give at most ${pr} message IDs as arguments; got ${e.length}. For more, use - and pipe them in.`);return e}if(e.length>1)throw new W("Use - on its own to pipe message IDs in.");let n=await Ca(t,{asked:!0});if(n===void 0)throw new W("Pipe the message IDs in when using -.");let r=[...new Set(n.split(/\s+/).filter(Boolean))];if(!r.length)throw new W("No message IDs were piped in.");return r}async function Ca(e,{asked:t}){if(!e||!(t||e.piped))return;let n=[];for await(let r of e.stream)n.push(Buffer.from(r));return Buffer.concat(n).toString("utf8")}var Nk=[{name:"read",description:"Mark messages read.",done:"Marked {n} read"},{name:"unread",description:"Mark messages unread.",done:"Marked {n} unread"},{name:"archive",description:"Archive messages.",done:"Archived {n}"},{name:"unarchive",description:"Move messages out of the archive.",done:"Unarchived {n}"},{name:"trash",description:"Move messages to the trash.",done:"Moved {n} to the trash",unchanged:"already in the trash"}],ey=["all","archive","snoozed"];function ry(e,t){let{display:n}=t,r=br(e,"messages","Read, search and organize messages.").example("ripple messages","ripple messages --unread","ripple messages search invoice","ripple messages archive msg_123 msg_456"),i=r.command("list").description("List messages, most recently updated first, or with --in snoozed, soonest to return. Plain `ripple messages` does the same.").summary("List messages").addOption(Ze("--in <view>","Where to look; all, the default, leaves out archived and snoozed messages",ey)).addOption(xe("-s, --source <id>","Only this source's messages; inbox means Inbox"));for(let a of Zc())i.addOption(a);i.addOption(hr("messages",Uo)).addOption(gr()).addOption(yr()).example("ripple messages list --in snoozed","ripple messages list --source inbox --unread","ripple messages list --source src_abc123 --in archive --all").action(async a=>{let[u]=await xr(t,a.source)??[],l=Kc(a),c=Nn(a,d=>Y("GET","/v1/messages",{query:{in:a.in,sourceId:u,unread:l?.toString(),...d}}));await t.runEach(c,d=>bi(n,d.flatMap(m=>m.items).map(m=>Jc(m,n)),Pk(a.in,l),[es(d)]))}),r.command("watch").description("Show each new message as it arrives, until you stop it with Control-C. If the connection drops, it reconnects and catches up.").summary("Show new messages as they arrive").addOption(xe("-s, --source <id>","Only this source's messages; inbox means Inbox")).example("ripple messages watch","ripple messages watch --source inbox",`ripple messages watch --json | jq --unbuffered -r 'select(.alert == "important") | .title'`).action(async a=>{let[u]=await xr(t,a.source)??[];t.hint("Watching for new messages. Press Control-C to stop.");let l=0;await t.watch(Y("GET","/v1/messages/stream",{query:{sourceId:u}}),({event:c,data:d})=>{c==="message"&&t.print(JSON.parse(d),m=>`${l++?`
|
|
57
|
-
`:""}${
|
|
58
|
-
`)})}),r.command("get").description("Show a message in full.").argument("<id>").action(async a=>{await t.run(
|
|
59
|
-
`)}
|
|
60
|
-
|
|
67
|
+
reference: ${JSON.stringify(this.reference)}]`}date(){let t=this.get("timezoneOffset")??this.reference.timezoneOffset;if(t==null)return this.dateWithoutTimezoneAdjustment();let n=new Date(Date.UTC(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond")));return n.setUTCFullYear(this.get("year")),new Date(n.getTime()-t*6e4)}addTag(t){return this._tags.add(t),this}addTags(t){for(let n of t)this._tags.add(n);return this}tags(){return new Set(this._tags)}dateWithoutTimezoneAdjustment(){let t=new Date(this.get("year"),this.get("month")-1,this.get("day"),this.get("hour"),this.get("minute"),this.get("second"),this.get("millisecond"));return t.setFullYear(this.get("year")),t}},ft=class e{refDate;index;text;reference;start;end;constructor(t,n,r,i,o){this.reference=t,this.refDate=t.instant,this.index=n,this.text=r,this.start=i||new W(t),this.end=o}clone(){let t=new e(this.reference,this.index,this.text);return t.start=this.start?this.start.clone():null,t.end=this.end?this.end.clone():null,t}date(){return this.start.date()}addTag(t){return this.start.addTag(t),this.end&&this.end.addTag(t),this}addTags(t){return this.start.addTags(t),this.end&&this.end.addTags(t),this}tags(){let t=new Set(this.start.tags());if(this.end)for(let n of this.end.tags())t.add(n);return t}toString(){let t=Array.from(this.tags()).sort();return`[ParsingResult {index: ${this.index}, text: '${this.text}', tags: ${JSON.stringify(t)} ...}]`}};function dl(e,t,n="\\s{0,5},?\\s{0,5}"){let r=t.replace(/\((?!\?)/g,"(?:");return`${e}${r}(?:${n}${r}){0,10}`}function GS(e){let t;return e instanceof Array?t=[...e]:e instanceof Map?t=Array.from(e.keys()):t=Object.keys(e),t}function ge(e){return`(?:${GS(e).sort((n,r)=>r.length-n.length).join("|").replace(/\./g,"\\.")})`}function $s(e){return e<100&&(e>50?e=e+1900:e=e+2e3),e}function wn(e,t,n){let r=new Date(e);r.setMonth(n-1),r.setDate(t);let i=ke(r,{year:1}),o=ke(r,{year:-1});return Math.abs(i.getTime()-e.getTime())<Math.abs(r.getTime()-e.getTime())?r=i:Math.abs(o.getTime()-e.getTime())<Math.abs(r.getTime()-e.getTime())&&(r=o),r.getFullYear()}var Us={sunday:0,sun:0,"sun.":0,monday:1,mon:1,"mon.":1,tuesday:2,tue:2,"tue.":2,wednesday:3,wed:3,"wed.":3,thursday:4,thurs:4,"thurs.":4,thur:4,"thur.":4,thu:4,"thu.":4,friday:5,fri:5,"fri.":5,saturday:6,sat:6,"sat.":6},fl={january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12},Fe={...fl,jan:1,"jan.":1,feb:2,"feb.":2,mar:3,"mar.":3,apr:4,"apr.":4,jun:6,"jun.":6,jul:7,"jul.":7,aug:8,"aug.":8,sep:9,"sep.":9,sept:9,"sept.":9,oct:10,"oct.":10,nov:11,"nov.":11,dec:12,"dec.":12},ml={one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12},pl={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6,seventh:7,eighth:8,ninth:9,tenth:10,eleventh:11,twelfth:12,thirteenth:13,fourteenth:14,fifteenth:15,sixteenth:16,seventeenth:17,eighteenth:18,nineteenth:19,twentieth:20,"twenty first":21,"twenty-first":21,"twenty second":22,"twenty-second":22,"twenty third":23,"twenty-third":23,"twenty fourth":24,"twenty-fourth":24,"twenty fifth":25,"twenty-fifth":25,"twenty sixth":26,"twenty-sixth":26,"twenty seventh":27,"twenty-seventh":27,"twenty eighth":28,"twenty-eighth":28,"twenty ninth":29,"twenty-ninth":29,thirtieth:30,"thirty first":31,"thirty-first":31},pf={second:"second",seconds:"second",minute:"minute",minutes:"minute",hour:"hour",hours:"hour",day:"day",days:"day",week:"week",weeks:"week",month:"month",months:"month",quarter:"quarter",quarters:"quarter",year:"year",years:"year"},Pi={s:"second",sec:"second",second:"second",seconds:"second",m:"minute",min:"minute",mins:"minute",minute:"minute",minutes:"minute",h:"hour",hr:"hour",hrs:"hour",hour:"hour",hours:"hour",d:"day",day:"day",days:"day",w:"week",week:"week",weeks:"week",mo:"month",mon:"month",mos:"month",month:"month",months:"month",qtr:"quarter",quarter:"quarter",quarters:"quarter",y:"year",yr:"year",year:"year",years:"year",...pf},ff=`(?:${ge(ml)}|[0-9]+|[0-9]+\\.[0-9]+|half(?:\\s{0,2}an?)?|an?\\b(?:\\s{0,2}few)?|few|several|the|a?\\s{0,2}couple\\s{0,2}(?:of)?)`;function VS(e){let t=e.toLowerCase();return ml[t]!==void 0?ml[t]:t==="a"||t==="an"||t=="the"?1:t.match(/few/)?3:t.match(/half/)?.5:t.match(/couple/)?2:t.match(/several/)?7:parseFloat(t)}var Rr=`(?:${ge(pl)}|[0-9]{1,2}(?:st|nd|rd|th)?)`;function Pr(e){let t=e.toLowerCase();return pl[t]!==void 0?pl[t]:(t=t.replace(/(?:st|nd|rd|th)$/i,""),parseInt(t))}var xn="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-9][0-9]{3}|[0-9]{2}(?!\\w|:\\d|\\s+(?:am|pm|o\\s*clock|jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)))";function At(e){if(/BE/i.test(e))return e=e.replace(/BE/i,""),parseInt(e)-543;if(/BCE?/i.test(e))return e=e.replace(/BCE?/i,""),-parseInt(e);if(/(AD|CE)/i.test(e))return e=e.replace(/(AD|CE)/i,""),parseInt(e);let t=parseInt(e);return $s(t)}var hf=`(${ff})\\s{0,3}(${ge(Pi)})`,mf=new RegExp(hf,"i"),YS=`(${ff})\\s{0,3}(${ge(pf)})`,gf="\\s{0,5},?(?:\\s*and)?\\s{0,5}",Zt=dl("(?:(?:about|around)\\s{0,3})?",hf,gf),bn=dl("(?:(?:about|around)\\s{0,3})?",YS,gf);function tt(e){let t={},n=e,r=mf.exec(n);for(;r;)ZS(t,r),n=n.substring(r[0].length).trim(),r=mf.exec(n);return Object.keys(t).length==0?null:t}function ZS(e,t){if(t[0].match(/^[a-zA-Z]+$/))return;let n=VS(t[1]),r=Pi[t[2].toLowerCase()];e[r]=n}var V=class{innerPatternHasChange(t,n){return this.innerPattern(t)!==n}patternLeftBoundary(){return"(\\W|^)"}cachedInnerPattern=null;cachedPattern=null;pattern(t){return this.cachedInnerPattern&&!this.innerPatternHasChange(t,this.cachedInnerPattern)?this.cachedPattern:(this.cachedInnerPattern=this.innerPattern(t),this.cachedPattern=new RegExp(`${this.patternLeftBoundary()}${this.cachedInnerPattern.source}`,this.cachedInnerPattern.flags),this.cachedPattern)}extract(t,n){let r=n[1]??"";n.index=n.index+r.length,n[0]=n[0].substring(r.length);for(let i=2;i<n.length;i++)n[i-1]=n[i];return this.innerExtract(t,n)}};var KS=new RegExp(`(?:(?:within|in|for)\\s*)?(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Zt})(?=\\W|$)`,"i"),JS=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${Zt})(?=\\W|$)`,"i"),XS=new RegExp(`(?:within|in|for)\\s*(?:(?:about|around|roughly|approximately|just)\\s*(?:~\\s*)?)?(${bn})(?=\\W|$)`,"i"),Li=class extends V{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(t){return this.strictMode?XS:t.option.forwardDate?KS:JS}innerExtract(t,n){if(n[0].match(/^for\s*the\s*\w+/))return null;let r=tt(n[1]);return r?W.createRelativeFromReference(t.reference,r):null}};var QS=new RegExp(`(?:on\\s{0,3})?(${Rr})(?:\\s{0,3}(?:to|\\-|\\\u2013|until|through|till)\\s{0,3}(${Rr}))?(?:-|/|\\s{0,3}(?:of)?\\s{0,3})(${ge(Fe)})(?:(?:-|/|,?\\s{0,3})(${xn}(?!\\w)))?(?=\\W|$)`,"i"),yf=1,wf=2,eT=3,xf=4,Fi=class extends V{innerPattern(){return QS}innerExtract(t,n){let r=t.createParsingResult(n.index,n[0]),i=Fe[n[eT].toLowerCase()],o=Pr(n[yf]);if(o>31)return n.index=n.index+n[yf].length,null;if(r.start.assign("month",i),r.start.assign("day",o),n[xf]){let s=At(n[xf]);r.start.assign("year",s)}else{let s=wn(t.refDate,o,i);r.start.imply("year",s)}if(n[wf]){let s=Pr(n[wf]);r.end=r.start.clone(),r.end.assign("day",s)}return r}};var tT=new RegExp(`(${ge(Fe)})(?:-|/|\\s*,?\\s*)(${Rr})(?!\\s*(?:am|pm))\\s*(?:(?:to|\\-)\\s*(${Rr})\\s*)?(?:(?:-|/|\\s*,\\s*|\\s+)(${xn}))?(?=\\W|$)(?!\\:\\d)`,"i"),nT=1,bf=2,hl=3,gl=4,$i=class extends V{shouldSkipYearLikeDate;constructor(t){super(),this.shouldSkipYearLikeDate=t}innerPattern(){return tT}innerExtract(t,n){let r=Fe[n[nT].toLowerCase()],i=Pr(n[bf]);if(i>31||this.shouldSkipYearLikeDate&&!n[hl]&&!n[gl]&&n[bf].match(/^\d{2}$/))return null;let o=t.createParsingComponents({day:i,month:r}).addTag("parser/ENMonthNameMiddleEndianParser");if(n[gl]){let u=At(n[gl]);o.assign("year",u)}else{let u=wn(t.refDate,i,r);o.imply("year",u)}if(!n[hl])return o;let s=Pr(n[hl]),a=t.createParsingResult(n.index,n[0]);return a.start=o,a.end=o.clone(),a.end.assign("day",s),a}};var rT=new RegExp(`((?:in)\\s*)?(${ge(Fe)})\\s*(?:(?:,|-|of)?\\s*(${xn})?)?(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),iT=1,oT=2,kf=3,Ui=class extends V{innerPattern(){return rT}innerExtract(t,n){let r=n[oT].toLowerCase();if(n[0].length<=3&&!fl[r])return null;let i=t.createParsingResult(n.index+(n[iT]||"").length,n.index+n[0].length);i.start.imply("day",1),i.start.addTag("parser/ENMonthNameParser");let o=Fe[r];if(i.start.assign("month",o),n[kf]){let s=At(n[kf]);i.start.assign("year",s)}else{let s=wn(t.refDate,1,o);i.start.imply("year",s)}return i}};var sT=new RegExp(`([0-9]{4})[-\\.\\/\\s](?:(${ge(Fe)})|([0-9]{1,2}))[-\\.\\/\\s]([0-9]{1,2})(?=\\W|$)`,"i"),aT=1,uT=2,Sf=3,lT=4,zi=class extends V{strictMonthDateOrder;constructor(t){super(),this.strictMonthDateOrder=t}innerPattern(){return sT}innerExtract(t,n){let r=parseInt(n[aT]),i=parseInt(n[lT]),o=n[Sf]?parseInt(n[Sf]):Fe[n[uT].toLowerCase()];if(o<1||o>12){if(this.strictMonthDateOrder)return null;i>=1&&i<=12&&([o,i]=[i,o])}return i<1||i>31?null:{day:i,month:o,year:r}}};var cT="(?:[1-9][0-9]{0,3}\\s{0,2}(?:BE|AD|BC|BCE|CE)|[1-9][0-9]{3})",dT=new RegExp(`(${cT})(?:\\s*[-.\\/,]?\\s*|\\s+of\\s+)(${ge(Fe)})(?=[^\\s\\w]|\\s+[^0-9]|\\s+$|$)`,"i"),mT=1,pT=2,Bi=class extends V{innerPattern(){return dT}innerExtract(t,n){let r=At(n[mT]),i=n[pT].toLowerCase(),o=Fe[i],s=t.createParsingResult(n.index,n[0]);return s.start.imply("day",1),s.start.assign("month",o),s.start.assign("year",r),s.start.addTag("parser/ENYearMonthNameParser"),s}};var fT=new RegExp("([0-9]|0[1-9]|1[012])/([0-9]{4})","i"),hT=1,gT=2,qi=class extends V{innerPattern(){return fT}innerExtract(t,n){let r=parseInt(n[gT]),i=parseInt(n[hT]);return t.createParsingComponents().imply("day",1).assign("month",i).assign("year",r)}};function yT(e,t,n,r){return new RegExp(`${e}${t}(\\d{1,4})(?:(?:\\.|:|\uFF1A)(\\d{1,2})(?:(?::|\uFF1A)(\\d{2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${n}`,r)}function wT(e,t){return new RegExp(`^(${e})(\\d{1,4})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:(?:\\.|\\:|\\\uFF1A)(\\d{1,2})(?:\\.(\\d{1,6}))?)?)?(?:\\s*(a\\.m\\.|p\\.m\\.|am?|pm?))?${t}`,"i")}var yl=2,Jn=3,zs=4,Bs=5,Lr=6,qs=class{strictMode;constructor(t=!1){this.strictMode=t}patternFlags(){return"i"}primaryPatternLeftBoundary(){return"(^|\\s|T|\\b)"}primarySuffix(){return"(?!/)(?=\\W|$)"}followingSuffix(){return"(?!/)(?=\\W|$)"}pattern(t){return this.getPrimaryTimePatternThroughCache()}extract(t,n){let r=this.extractPrimaryTimeComponents(t,n);if(!r)return n[0].match(/^\d{4}/)?(n.index+=4,null):(n.index+=n[0].length,null);let i=n.index+n[1].length,o=n[0].substring(n[1].length),s=t.createParsingResult(i,o,r);n.index+=n[0].length;let a=t.text.substring(n.index),l=this.getFollowingTimePatternThroughCache().exec(a);return o.match(/^\d{3,4}/)&&l&&(l[0].match(/^\s*([+-])\s*\d{2,4}$/)||l[0].match(/^\s*([+-])\s*\d{2}\W\d{2}/))?null:!l||l[0].match(/^\s*([+-])\s*\d{3,4}$/)?this.checkAndReturnWithoutFollowingPattern(s):(s.end=this.extractFollowingTimeComponents(t,l,s),s.end&&(s.text+=l[0]),this.checkAndReturnWithFollowingPattern(s))}extractPrimaryTimeComponents(t,n,r=!1){let i=t.createParsingComponents(),o=0,s=null,a=parseInt(n[yl]);if(a>100){if(n[yl].length==4&&n[Jn]==null&&!n[Lr]||this.strictMode||n[Jn]!=null)return null;o=a%100,a=Math.floor(a/100)}if(a>24)return null;if(n[Jn]!=null){if(n[Jn].length==1&&!n[Lr])return null;o=parseInt(n[Jn])}if(o>=60)return null;if(a>12&&(s=j.PM),n[Lr]!=null){if(a>12)return null;let u=n[Lr][0].toLowerCase();u=="a"&&(s=j.AM,a==12&&(a=0)),u=="p"&&(s=j.PM,a!=12&&(a+=12))}if(i.assign("hour",a),i.assign("minute",o),s!==null?i.assign("meridiem",s):a<12?i.imply("meridiem",j.AM):i.imply("meridiem",j.PM),n[Bs]!=null){let u=parseInt(n[Bs].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(n[zs]!=null){let u=parseInt(n[zs]);if(u>=60)return null;i.assign("second",u)}return i}extractFollowingTimeComponents(t,n,r){let i=t.createParsingComponents();if(n[Bs]!=null){let u=parseInt(n[Bs].substring(0,3));if(u>=1e3)return null;i.assign("millisecond",u)}if(n[zs]!=null){let u=parseInt(n[zs]);if(u>=60)return null;i.assign("second",u)}let o=parseInt(n[yl]),s=0,a=-1;if(n[Jn]!=null?s=parseInt(n[Jn]):o>100&&(s=o%100,o=Math.floor(o/100)),s>=60||o>24)return null;if(o>=12&&(a=j.PM),n[Lr]!=null){if(o>12)return null;let u=n[Lr][0].toLowerCase();u=="a"&&(a=j.AM,o==12&&(o=0,i.isCertain("day")||i.imply("day",i.get("day")+1))),u=="p"&&(a=j.PM,o!=12&&(o+=12)),r.start.isCertain("meridiem")||(a==j.AM?(r.start.imply("meridiem",j.AM),r.start.get("hour")==12&&r.start.assign("hour",0)):(r.start.imply("meridiem",j.PM),r.start.get("hour")!=12&&r.start.assign("hour",r.start.get("hour")+12)))}return i.assign("hour",o),i.assign("minute",s),a>=0?i.assign("meridiem",a):r.start.isCertain("meridiem")&&r.start.get("hour")>12?r.start.get("hour")-12>o?i.imply("meridiem",j.AM):o<=12&&(i.assign("hour",o+12),i.assign("meridiem",j.PM)):o>12?i.imply("meridiem",j.PM):o<=12&&i.imply("meridiem",j.AM),i.date().getTime()<r.start.date().getTime()&&i.imply("day",i.get("day")+1),i}checkAndReturnWithoutFollowingPattern(t){if(t.text.match(/^\d$/)||t.text.match(/^\d\d\d+$/)||t.text.match(/\d[apAP]$/))return null;let n=t.text.match(/[^\d:.](\d[\d.]+)$/);if(n){let r=n[1];if(this.strictMode||r.includes(".")&&!r.match(/\d(\.\d{2})+$/)||parseInt(r)>24)return null}return t}checkAndReturnWithFollowingPattern(t){if(t.text.match(/^\d+-\d+$/))return null;let n=t.text.match(/[^\d:.](\d[\d.]+)\s*-\s*(\d[\d.]+)$/);if(n){if(this.strictMode)return null;let r=n[1],i=n[2];if(i.includes(".")&&!i.match(/\d(\.\d{2})+$/))return null;let o=parseInt(i),s=parseInt(r);if(o>24||s>24)return null}return t}cachedPrimaryPrefix=null;cachedPrimarySuffix=null;cachedPrimaryTimePattern=null;getPrimaryTimePatternThroughCache(){let t=this.primaryPrefix(),n=this.primarySuffix();return this.cachedPrimaryPrefix===t&&this.cachedPrimarySuffix===n?this.cachedPrimaryTimePattern:(this.cachedPrimaryTimePattern=yT(this.primaryPatternLeftBoundary(),t,n,this.patternFlags()),this.cachedPrimaryPrefix=t,this.cachedPrimarySuffix=n,this.cachedPrimaryTimePattern)}cachedFollowingPhase=null;cachedFollowingSuffix=null;cachedFollowingTimePatten=null;getFollowingTimePatternThroughCache(){let t=this.followingPhase(),n=this.followingSuffix();return this.cachedFollowingPhase===t&&this.cachedFollowingSuffix===n?this.cachedFollowingTimePatten:(this.cachedFollowingTimePatten=wT(t,n),this.cachedFollowingPhase=t,this.cachedFollowingSuffix=n,this.cachedFollowingTimePatten)}};var ji=class extends qs{constructor(t){super(t)}followingPhase(){return"\\s*(?:\\-|\\\u2013|\\~|\\\u301C|to|until|through|till|\\?)\\s*"}primaryPrefix(){return"(?:(?:at|from)\\s*)??"}primarySuffix(){return"(?:\\s*(?:o\\W*clock|at\\s*night|in\\s*the\\s*(?:morning|afternoon)))?(?!/)(?=\\W|$)"}extractPrimaryTimeComponents(t,n){let r=super.extractPrimaryTimeComponents(t,n);if(!r)return r;if(n[0].endsWith("night")){let i=r.get("hour");i>=6&&i<12?(r.assign("hour",r.get("hour")+12),r.assign("meridiem",j.PM)):i<6&&r.assign("meridiem",j.AM)}if(n[0].endsWith("afternoon")){r.assign("meridiem",j.PM);let i=r.get("hour");i>=0&&i<=6&&r.assign("hour",r.get("hour")+12)}return n[0].endsWith("morning")&&(r.assign("meridiem",j.AM),r.get("hour")<12&&r.assign("hour",r.get("hour"))),r.addTag("parser/ENTimeExpressionParser")}extractFollowingTimeComponents(t,n,r){let i=super.extractFollowingTimeComponents(t,n,r);return i&&i.addTag("parser/ENTimeExpressionParser"),i}};var xT=new RegExp(`(${Zt})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),bT=new RegExp(`(${bn})\\s{0,5}(?:ago|before|earlier)(?=\\W|$)`,"i"),Hi=class extends V{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(){return this.strictMode?bT:xT}innerExtract(t,n){let r=tt(n[1]);return r?W.createRelativeFromReference(t.reference,yn(r)):null}};var kT=new RegExp(`(${Zt})\\s{0,5}(?:later|after|from now|henceforth|forward|out)(?=(?:\\W|$))`,"i"),ST=new RegExp(`(${bn})\\s{0,5}(later|after|from now)(?=\\W|$)`,"i"),TT=1,Wi=class extends V{strictMode;constructor(t){super(),this.strictMode=t}innerPattern(){return this.strictMode?ST:kT}innerExtract(t,n){let r=tt(n[TT]);return r?W.createRelativeFromReference(t.reference,r):null}};var Fr=class{refine(t,n){return n.filter(r=>this.isValid(t,r))}},nt=class{refine(t,n){if(n.length<2)return n;let r=[],i=n[0],o=null;for(let s=1;s<n.length;s++){o=n[s];let a=t.text.substring(i.index+i.text.length,o.index);if(!this.shouldMergeResults(a,i,o,t))r.push(i),i=o;else{let u=i,l=o,d=this.mergeResults(a,u,l,t);t.debug(()=>{console.log(`${this.constructor.name} merged ${u} and ${l} into ${d}`)}),i=d}}return i!=null&&r.push(i),r}};var Gi=class extends nt{shouldMergeResults(t,n,r){return!n.end&&!r.end&&t.match(this.patternBetween())!=null}mergeResults(t,n,r){if(!n.start.isOnlyWeekdayComponent()&&!r.start.isOnlyWeekdayComponent()&&(r.start.getCertainComponents().forEach(o=>{n.start.isCertain(o)||n.start.imply(o,r.start.get(o))}),n.start.getCertainComponents().forEach(o=>{r.start.isCertain(o)||r.start.imply(o,n.start.get(o))})),n.start.date()>r.start.date()){let o=n.start.date(),s=r.start.date();r.start.isOnlyWeekdayComponent()&&ke(s,{day:7})>o?(s=ke(s,{day:7}),r.start.imply("day",s.getDate()),r.start.imply("month",s.getMonth()+1),r.start.imply("year",s.getFullYear())):n.start.isOnlyWeekdayComponent()&&ke(o,{day:-7})<s?(o=ke(o,{day:-7}),n.start.imply("day",o.getDate()),n.start.imply("month",o.getMonth()+1),n.start.imply("year",o.getFullYear())):r.start.isDateWithUnknownYear()&&ke(s,{year:1})>o?(s=ke(s,{year:1}),r.start.imply("year",s.getFullYear())):n.start.isDateWithUnknownYear()&&ke(o,{year:-1})<s?(o=ke(o,{year:-1}),n.start.imply("year",o.getFullYear())):[r,n]=[n,r]}let i=n.clone();return i.start=n.start,i.end=r.start,i.index=Math.min(n.index,r.index),n.index<r.index?i.text=n.text+t+r.text:i.text=r.text+t+n.text,i}};var Vi=class extends Gi{patternBetween(){return/^\s*(to|-|–|until|through|till)\s*$/i}};function wl(e,t){let n=e.clone(),r=e.start,i=t.start;if(n.start=Tf(r,i),e.end!=null||t.end!=null){let o=e.end==null?e.start:e.end,s=t.end==null?t.start:t.end,a=Tf(o,s);if(e.end==null&&a.date().getTime()<n.start.date().getTime()){let u=new Date(a.date().getTime());u.setDate(u.getDate()+1),a.isCertain("day")?pt(a,u):Yt(a,u)}n.end=a}return n}function Tf(e,t){let n=e.clone();t.isCertain("hour")?(n.assign("hour",t.get("hour")),n.assign("minute",t.get("minute")),t.isCertain("second")?(n.assign("second",t.get("second")),t.isCertain("millisecond")?n.assign("millisecond",t.get("millisecond")):n.imply("millisecond",t.get("millisecond"))):(n.imply("second",t.get("second")),n.imply("millisecond",t.get("millisecond")))):(n.imply("hour",t.get("hour")),n.imply("minute",t.get("minute")),n.imply("second",t.get("second")),n.imply("millisecond",t.get("millisecond"))),t.isCertain("timezoneOffset")&&n.assign("timezoneOffset",t.get("timezoneOffset"));let r=e.get("meridiem")!=null&&(e.isCertain("meridiem")||Array.from(e.tags()).some(i=>i.startsWith("casualReference/")));return t.isCertain("meridiem")?n.assign("meridiem",t.get("meridiem")):t.get("meridiem")!=null&&!r&&n.imply("meridiem",t.get("meridiem")),n.get("meridiem")==j.PM&&n.get("hour")<12&&(t.isCertain("hour")?n.assign("hour",n.get("hour")+12):n.imply("hour",n.get("hour")+12)),n.addTags(e.tags()),n.addTags(t.tags()),n}var Yi=class extends nt{shouldMergeResults(t,n,r){return(n.start.isOnlyDate()&&r.start.isOnlyTime()||r.start.isOnlyDate()&&n.start.isOnlyTime())&&t.match(this.patternBetween())!=null}mergeResults(t,n,r){let i=n.start.isOnlyDate()?wl(n,r):wl(r,n);return i.index=n.index,i.text=n.text+t+r.text,i}};var $r=class extends Yi{patternBetween(){return new RegExp("^\\s*(T|at|after|before|on|of|,|-|\\.|\u2219|:)?\\s*$")}};var CT=new RegExp("^\\s*,?\\s*\\(?([A-Z]{2,4})\\)?(?=\\W|$)","i"),Zi=class{timezoneOverrides;constructor(t){this.timezoneOverrides=t}refine(t,n){let r=t.option.timezones??{};return n.forEach(i=>{let o=t.text.substring(i.index+i.text.length),s=CT.exec(o);if(!s)return;let a=s[1].toUpperCase(),u=i.start.date()??i.refDate??new Date,l={...this.timezoneOverrides,...r},d=Fs(a,u,l);if(d==null)return;t.debug(()=>{console.log(`Extracting timezone: '${a}' into: ${d} for: ${i.start}`)});let c=i.start.get("timezoneOffset");c!==null&&d!=c&&(i.start.isCertain("timezoneOffset")||a!=s[1])||i.start.isOnlyDate()&&a!=s[1]||(i.text+=s[0],i.start.isCertain("timezoneOffset")||i.start.assign("timezoneOffset",d),i.end!=null&&!i.end.isCertain("timezoneOffset")&&i.end.assign("timezoneOffset",d))}),n}};var ET=new RegExp("^\\s*(?:\\(?(?:GMT|UTC)\\s?)?([+-])(\\d{1,2})(?::?(\\d{2}))?\\)?","i"),IT=1,AT=2,_T=3,Ki=class{refine(t,n){return n.forEach(function(r){if(r.start.isCertain("timezoneOffset"))return;let i=t.text.substring(r.index+r.text.length),o=ET.exec(i);if(!o)return;t.debug(()=>{console.log(`Extracting timezone: '${o[0]}' into : ${r}`)});let s=parseInt(o[AT]),a=parseInt(o[_T]||"0"),u=s*60+a;u>840||(o[IT]==="-"&&(u=-u),r.end!=null&&r.end.assign("timezoneOffset",u),r.start.assign("timezoneOffset",u),r.text+=o[0])}),n}};var kn=class{refine(t,n){if(n.length<2)return n;let r=[],i=n[0];for(let o=1;o<n.length;o++){let s=n[o];if(s.index>=i.index+i.text.length){r.push(i),i=s;continue}let a=null,u=null;s.text.length>i.text.length?(a=s,u=i):(a=i,u=s),t.debug(()=>{console.log(`${this.constructor.name} remove ${u} by ${a}`)}),i=a}return i!=null&&r.push(i),r}};function Cf(e,t,n){let r=e.getDateWithAdjustedTimezone(),i=OT(r,t,n),o=new W(e);return o=o.addDurationAsImplied({day:i}),o.assign("weekday",t),o}function OT(e,t,n){let r=e.getDay();switch(n){case"this":return Xn(e,t);case"last":return Ef(e,t);case"next":return r==K.SUNDAY?t==K.SUNDAY?7:t:r==K.SATURDAY?t==K.SATURDAY?7:t==K.SUNDAY?8:1+t:t<r&&t!=K.SUNDAY?Xn(e,t):Xn(e,t)+7}return DT(e,t)}function DT(e,t){let n=Ef(e,t),r=Xn(e,t);return r<-n?r:n}function Xn(e,t){let n=e.getDay(),r=t-n;return r<0&&(r+=7),r}function Ef(e,t){let n=e.getDay(),r=t-n;return r>=0&&(r-=7),r}var Ji=class{refine(t,n){return t.option.forwardDate&&n.forEach(r=>{let i=t.reference.getDateWithAdjustedTimezone();if(r.start.isOnlyTime()&&t.reference.instant>r.start.date()){let o=t.reference.getDateWithAdjustedTimezone(),s=new Date(o);s.setDate(s.getDate()+1),Yt(r.start,s),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} time from the ref date (${o}) to the following day (${s})`)}),r.end&&r.end.isOnlyTime()&&(Yt(r.end,s),r.start.date()>r.end.date()&&(s.setDate(s.getDate()+1),Yt(r.end,s)))}if(r.start.isOnlyWeekdayComponent()&&i>r.start.date()){let o=Xn(i,r.start.get("weekday"))||7,s=ke(i,{day:o});if(Yt(r.start,s),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} weekday (${r.start})`)}),r.end&&r.start.date()>r.end.date()){let a=Xn(i,r.start.get("weekday"))||7,u=ke(i,{day:a});Yt(r.end,u),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} weekday (${r.end})`)})}}if(r.start.isDateWithUnknownYear()&&i>r.start.date())for(let o=0;o<3&&i>r.start.date();o++)r.start.imply("year",r.start.get("year")+1),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} year (${r.start})`)}),r.end&&!r.end.isCertain("year")&&(r.end.imply("year",r.end.get("year")+1),t.debug(()=>{console.log(`${this.constructor.name} adjusted ${r} month (${r.start})`)}))}),n}};var Xi=class extends Fr{strictMode;constructor(t){super(),this.strictMode=t}isValid(t,n){return n.text.replace(" ","").match(/^\d*(\.\d*)?$/)?(t.debug(()=>{console.log(`Removing unlikely result '${n.text}'`)}),!1):n.start.isValidDate()?n.end&&!n.end.isValidDate()?(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.end})`)}),!1):this.strictMode?this.isStrictModeValid(t,n):!0:(t.debug(()=>{console.log(`Removing invalid result: ${n} (${n.start})`)}),!1)}isStrictModeValid(t,n){return n.start.isOnlyWeekdayComponent()?(t.debug(()=>{console.log(`(Strict) Removing weekday only component: ${n} (${n.end})`)}),!1):!0}};var vT=new RegExp("([0-9]{4})\\-([0-9]{1,2})\\-([0-9]{1,2})(?:T([0-9]{1,2}):([0-9]{1,2})(?::([0-9]{1,2})(?:\\.(\\d{1,4}))?)?(Z|([+-]\\d{2}):?(\\d{2})?)?)?(?=\\W|$)","i"),MT=1,NT=2,RT=3,If=4,PT=5,Af=6,_f=7,LT=8,Of=9,Df=10,Qi=class extends V{innerPattern(){return vT}innerExtract(t,n){let r=t.createParsingComponents({year:parseInt(n[MT]),month:parseInt(n[NT]),day:parseInt(n[RT])});if(n[If]!=null&&(r.assign("hour",parseInt(n[If])),r.assign("minute",parseInt(n[PT])),n[Af]!=null&&r.assign("second",parseInt(n[Af])),n[_f]!=null&&r.assign("millisecond",parseInt(n[_f])),n[LT]!=null)){let i=0;if(n[Of]){let o=parseInt(n[Of]),s=0;n[Df]!=null&&(s=parseInt(n[Df])),i=o*60,i<0?i-=s:i+=s}r.assign("timezoneOffset",i)}return r.addTag("parser/ISOFormatParser")}};var eo=class extends nt{mergeResults(t,n,r){let i=r.clone();return i.index=n.index,i.text=n.text+t+i.text,i.start.assign("weekday",n.start.get("weekday")),i.end&&i.end.assign("weekday",n.start.get("weekday")),i}shouldMergeResults(t,n,r){return n.start.isOnlyWeekdayComponent()&&!n.start.isCertain("hour")&&r.start.isCertain("day")&&t.match(/^,?\s*$/)!=null}};function vf(e,t=!1){return e.parsers.unshift(new Qi),e.refiners.unshift(new eo),e.refiners.unshift(new Ki),e.refiners.unshift(new kn),e.refiners.push(new Zi),e.refiners.push(new kn),e.refiners.push(new Ji),e.refiners.push(new Xi(t)),e}function Mf(e){let t=e.getDateWithAdjustedTimezone(),n=new W(e,{});return pt(n,t),Ls(n,t),n.assign("timezoneOffset",e.getTimezoneOffset()),n.addTag("casualReference/now"),n}function Nf(e){let t=e.getDateWithAdjustedTimezone(),n=new W(e,{});return pt(n,t),Ri(n,t),n.delete("meridiem"),n.addTag("casualReference/today"),n}function Rf(e){return FT(e,1).addTag("casualReference/yesterday")}function Pf(e){return js(e,1).addTag("casualReference/tomorrow")}function FT(e,t){return js(e,-t)}function js(e,t){let n=e.getDateWithAdjustedTimezone(),r=new W(e,{}),i=new Date(n.getTime());return i.setDate(i.getDate()+t),pt(r,i),Ri(r,i),r.delete("meridiem"),r}function Lf(e,t=22){let n=e.getDateWithAdjustedTimezone(),r=new W(e,{});return pt(r,n),r.imply("hour",t),r.imply("meridiem",j.PM),r.addTag("casualReference/tonight"),r}function Ff(e,t=20){let n=new W(e,{});return n.imply("meridiem",j.PM),n.imply("hour",t),n.addTag("casualReference/evening"),n}function $f(e){let t=new W(e,{});return e.getDateWithAdjustedTimezone().getHours()>2&&t.addDurationAsImplied({day:1}),t.assign("hour",0),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/midnight"),t}function Uf(e,t=6){let n=new W(e,{});return n.imply("meridiem",j.AM),n.imply("hour",t),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n.addTag("casualReference/morning"),n}function zf(e,t=15){let n=new W(e,{});return n.imply("meridiem",j.PM),n.imply("hour",t),n.imply("minute",0),n.imply("second",0),n.imply("millisecond",0),n.addTag("casualReference/afternoon"),n}function Bf(e){let t=new W(e,{});return t.imply("meridiem",j.AM),t.assign("hour",12),t.imply("minute",0),t.imply("second",0),t.imply("millisecond",0),t.addTag("casualReference/noon"),t}var $T=/(now|today|tonight|tomorrow|overmorrow|tmr|tmrw|yesterday|last\s*night)(?=\W|$)/i,to=class extends V{innerPattern(t){return $T}innerExtract(t,n){let r=t.refDate,i=n[0].toLowerCase(),o=t.createParsingComponents();switch(i){case"now":o=Mf(t.reference);break;case"today":o=Nf(t.reference);break;case"yesterday":o=Rf(t.reference);break;case"tomorrow":case"tmr":case"tmrw":o=Pf(t.reference);break;case"tonight":o=Lf(t.reference);break;case"overmorrow":o=js(t.reference,2);break;default:if(i.match(/last\s*night/)){if(r.getHours()>6){let s=new Date(r.getTime());s.setDate(s.getDate()-1),r=s}pt(o,r),o.imply("hour",0)}break}return o.addTag("parser/ENCasualDateParser"),o}};var UT=/(?:this)?\s{0,3}(morning|afternoon|evening|night|midnight|midday|noon)(?=\W|$)/i,no=class extends V{innerPattern(){return UT}innerExtract(t,n){let r=null;switch(n[1].toLowerCase()){case"afternoon":r=zf(t.reference);break;case"evening":case"night":r=Ff(t.reference);break;case"midnight":r=$f(t.reference);break;case"morning":r=Uf(t.reference);break;case"noon":case"midday":r=Bf(t.reference);break}return r&&r.addTag("parser/ENCasualTimeParser"),r}};var zT=new RegExp(`(?:(?:\\,|\\(|\\\uFF08)\\s*)?(?:on\\s*?)?(?:(this|last|past|next)\\s*)?(${ge(Us)}|weekend|weekday)(?:\\s*(?:\\,|\\)|\\\uFF09))?(?:\\s*(?:of\\s*)?(this|last|past|next)\\s*week)?(?=\\W|$)`,"i"),BT=1,qT=2,jT=3,ro=class extends V{innerPattern(){return zT}innerExtract(t,n){let r=n[BT],i=n[jT],o=r||i;o=o||"",o=o.toLowerCase();let s=null;o=="last"||o=="past"?s="last":o=="next"?s="next":o=="this"&&(s="this");let a=n[qT].toLowerCase(),u;if(Us[a]!==void 0)u=Us[a];else if(a=="weekend")u=s=="last"?K.SUNDAY:K.SATURDAY;else if(a=="weekday"){let l=t.reference.getDateWithAdjustedTimezone().getDay();l==K.SUNDAY||l==K.SATURDAY?u=s=="last"?K.FRIDAY:K.MONDAY:(u=l-1,u=s=="last"?u-1:u+1,u=u%5+1)}else return null;return Cf(t.reference,u,s)}};var HT=new RegExp(`(this|last|past|next|after\\s*this)\\s*(${ge(Pi)})(?=\\s*)(?=\\W|$)`,"i"),WT=1,GT=2,io=class extends V{innerPattern(){return HT}innerExtract(t,n){let r=n[WT].toLowerCase(),i=n[GT].toLowerCase(),o=Pi[i];if(r=="next"||r.startsWith("after")){let u={};return u[o]=1,W.createRelativeFromReference(t.reference,u)}if(r=="last"||r=="past"){let u={};return u[o]=-1,W.createRelativeFromReference(t.reference,u)}let s=t.createParsingComponents(),a=new Date(t.reference.instant.getTime());return i.match(/week/i)?(a.setDate(a.getDate()-a.getDay()),s.imply("day",a.getDate()),s.imply("month",a.getMonth()+1),s.imply("year",a.getFullYear())):i.match(/month/i)?(a.setDate(1),s.imply("day",a.getDate()),s.assign("year",a.getFullYear()),s.assign("month",a.getMonth()+1)):i.match(/year/i)&&(a.setDate(1),a.setMonth(0),s.imply("day",a.getDate()),s.imply("month",a.getMonth()+1),s.assign("year",a.getFullYear())),s}};var VT=new RegExp("([^\\d]|^)([0-3]{0,1}[0-9]{1})[\\/\\.\\-]([0-3]{0,1}[0-9]{1})(?:[\\/\\.\\-]([0-9]{4}|[0-9]{2}))?(\\W|$)","i"),YT=1,ZT=5,jf=2,Hf=3,xl=4,oo=class{groupNumberMonth;groupNumberDay;constructor(t){this.groupNumberMonth=t?Hf:jf,this.groupNumberDay=t?jf:Hf}pattern(){return VT}extract(t,n){let r=n.index+n[YT].length,i=n.index+n[0].length-n[ZT].length;if(r>0&&t.text.substring(0,r).match("\\d/?$")||i<t.text.length&&t.text.substring(i).match("^/?\\d"))return;let o=t.text.substring(r,i);if(o.match(/^\d\.\d$/)||o.match(/^\d\.\d{1,2}\.\d{1,2}\s*$/)||!n[xl]&&o.indexOf("/")<0)return;let s=t.createParsingResult(r,o),a=parseInt(n[this.groupNumberMonth]),u=parseInt(n[this.groupNumberDay]);if((a<1||a>12)&&a>12)if(u>=1&&u<=12&&a<=31)[u,a]=[a,u];else return null;if(u<1||u>31)return null;if(s.start.assign("day",u),s.start.assign("month",a),n[xl]){let l=parseInt(n[xl]),d=$s(l);s.start.assign("year",d)}else{let l=wn(t.refDate,u,a);s.start.imply("year",l)}return s.addTag("parser/SlashDateFormatParser")}};var KT=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${Zt})(?=\\W|$)`,"i"),JT=new RegExp(`(this|last|past|next|after|\\+|-)\\s*(${bn})(?=\\W|$)`,"i"),so=class extends V{allowAbbreviations;constructor(t=!0){super(),this.allowAbbreviations=t}innerPattern(){return this.allowAbbreviations?KT:JT}innerExtract(t,n){let r=n[1].toLowerCase(),i=tt(n[2]);if(!i)return null;switch(r){case"last":case"past":case"-":i=yn(i);break}return W.createRelativeFromReference(t.reference,i)}};function XT(e){return e.text.match(/^[+-]/i)!=null}function Wf(e){return e.text.match(/^-/i)!=null}var ao=class extends nt{shouldMergeResults(t,n,r){return t.match(/^\s*$/i)?XT(r)||Wf(r):!1}mergeResults(t,n,r,i){let o=tt(r.text);Wf(r)&&(o=yn(o));let s=W.createRelativeFromReference(It.fromDate(n.start.date()),o);return new ft(n.reference,n.index,`${n.text}${t}${r.text}`,s)}};function Gf(e){return e.text.match(/\s+(before|from)$/i)!=null}function QT(e){return e.text.match(/\s+(after|since)$/i)!=null}var uo=class extends nt{patternBetween(){return/^\s*$/i}shouldMergeResults(t,n,r){return!t.match(this.patternBetween())||!Gf(n)&&!QT(n)?!1:!!r.start.get("day")&&!!r.start.get("month")&&!!r.start.get("year")}mergeResults(t,n,r){let i=tt(n.text);Gf(n)&&(i=yn(i));let o=W.createRelativeFromReference(It.fromDate(r.start.date()),i);return new ft(r.reference,n.index,`${n.text}${t}${r.text}`,o)}};var e1=new RegExp(`^\\s*(${xn})`,"i"),t1=1,lo=class{refine(t,n){return n.forEach(function(r){if(!r.start.isDateWithUnknownYear())return;let i=t.text.substring(r.index+r.text.length),o=e1.exec(i);if(!o||o[0].trim().length<=3)return;t.debug(()=>{console.log(`Extracting year: '${o[0]}' into : ${r}`)});let s=At(o[t1]);r.end!=null&&r.end.assign("year",s),r.start.assign("year",s),r.text+=o[0]}),n}};var co=class extends Fr{constructor(){super()}isValid(t,n){let r=n.text.trim();return r===t.text.trim()?!0:r.toLowerCase()==="may"&&!t.text.substring(0,n.index).trim().match(/\b(in)$/i)?(t.debug(()=>{console.log(`Removing unlikely result: ${n}`)}),!1):r.toLowerCase().endsWith("the second")?(t.text.substring(n.index+n.text.length).trim().length>0&&t.debug(()=>{console.log(`Removing unlikely result: ${n}`)}),!1):!0}};var Qn=class{createCasualConfiguration(t=!1){let n=this.createConfiguration(!1,t);return n.parsers.push(new to),n.parsers.push(new no),n.parsers.push(new Ui),n.parsers.push(new io),n.parsers.push(new so),n.refiners.push(new co),n}createConfiguration(t=!0,n=!1){let r=vf({parsers:[new oo(n),new Li(t),new Fi,new $i(n),new ro,new qi,new ji(t),new Hi(t),new Wi(t),new Bi],refiners:[new $r]},t);return r.parsers.unshift(new zi(t)),r.refiners.unshift(new uo),r.refiners.unshift(new ao),r.refiners.unshift(new kn),r.refiners.push(new $r),r.refiners.push(new lo),r.refiners.push(new Vi),r}};var er=class e{parsers;refiners;defaultConfig=new Qn;constructor(t){t=t||this.defaultConfig.createCasualConfiguration(),this.parsers=[...t.parsers],this.refiners=[...t.refiners]}clone(){return new e({parsers:[...this.parsers],refiners:[...this.refiners]})}parseDate(t,n,r){let i=this.parse(t,n,r);return i.length>0?i[0].start.date():null}parse(t,n,r){let i=new bl(t,n,r),o=[];return this.parsers.forEach(s=>{let a=e.executeParser(i,s);o=o.concat(a)}),o.sort((s,a)=>s.index-a.index),this.refiners.forEach(function(s){o=s.refine(i,o)}),o}static executeParser(t,n){let r=[],i=n.pattern(t),o=t.text,s=t.text,a=i.exec(s);for(;a;){let u=a.index+o.length-s.length;a.index=u;let l=n.extract(t,a);if(!l){s=o.substring(a.index+1),a=i.exec(s);continue}let d=null;l instanceof ft?d=l:l instanceof W?(d=t.createParsingResult(a.index,a[0]),d.start=l):d=t.createParsingResult(a.index,a[0],l);let c=d.index,m=d.text;t.debug(()=>console.log(`${n.constructor.name} extracted (at index=${c}) '${m}'`)),r.push(d),s=o.substring(c+m.length),a=i.exec(s)}return r}},bl=class{text;option;reference;refDate;constructor(t,n,r){this.text=t,this.option=r??{},this.reference=It.fromInput(n,this.option.timezones),this.refDate=this.reference.instant}createParsingComponents(t){return t instanceof W?t:new W(this.reference,t)}createParsingResult(t,n,r,i){let o=typeof n=="string"?n:this.text.substring(t,n),s=r?this.createParsingComponents(r):null,a=i?this.createParsingComponents(i):null;return new ft(this.reference,t,o,s,a)}debug(t){this.option.debug&&(this.option.debug instanceof Function?this.option.debug(t):this.option.debug.debug(t))}};var Hs=new Qn,Ws=new er(Hs.createCasualConfiguration(!1)),Vf=new er(Hs.createConfiguration(!0,!1)),n1=new er(Hs.createCasualConfiguration(!0));function r1(e,t,n){return Ws.parse(e,t,n)}function i1(e,t,n){return Ws.parseDate(e,t,n)}var kl=globalThis.Temporal;var Yf=(e,t)=>`Non-positive ${e}: ${t}`,Zf=(e,t)=>`Non-finite ${e}: ${t}`,Kf=e=>`Cannot convert bigint to ${e}`,Jf="Invalid object",mo=(e,t,n,r)=>tr(e,t)+`; must be between ${n}-${r}`,tr=(e,t)=>`Invalid ${e}: ${t}`;var Sl=1e3,Tl=1e6,Cl=1e9,El=6e10,Il=36e11;function rt(e){return e===void 0?Object.create(null):nr(e)}function Vs(e,t="number"){if(typeof e=="bigint")throw new TypeError(Kf(t));if(e=Number(e),!Number.isFinite(e))throw new RangeError(Zf(t,e));return e}function Ee(e,t){return Math.trunc(Vs(e,t))||0}function Ys(e,t){return Xf(Ee(e,t),t)}function Xf(e,t="number"){if(e<=0)throw new RangeError(Yf(t,e));return e}function Al(e,t,n){return Math.min(Math.max(e,t),n)}function Ur(e){return e!==null&&(typeof e=="object"||typeof e=="function")}function nr(e){if(!Ur(e))throw new TypeError(Jf);return e}var ra=tr;var wo=e=>`Missing ${e}`,uh=e=>"No valid fields: "+e.join(),lh="Invalid bag",ch=(e,t,n)=>tr(e,t)+"; must be "+Object.keys(n).join(),dh="Cannot use valueOf",mh="Invalid calling context",ia=e=>"Missing year"+(e?"/era/eraYear":""),ir="Invalid leap month",ph=e=>tr("Calendar",e),fh=(e,t)=>`Unknown calendar ${e}; might need ${t}`,jl=e=>tr("TimeZone",e),Sn="Out-of-bounds date";var hh=e=>`Cannot parse: ${e}`,Kt=e=>`Invalid substring: ${e}`;var Hl=Al,qe=Ur;function v(e){throw new RangeError(e)}function ne(e){throw new TypeError(e)}function vl(e,t,n,r,i){return Ot(t,((o,s)=>{let a=o[s];return a===void 0&&ne(wo(s)),a})(e,t),n,r,i)}function Ot(e,t,n,r,i,o){let s=Hl(t,n,r);return i&&t!==s&&v(((a,u,l,d,c)=>c?mo(a,c[u],c[l],c[d]):mo(a,u,l,d))(e,t,n,r,o)),s}function qr(e,t=Map){let n=new t;return(r,...i)=>{if(n.has(r))return n.get(r);let o=e(r,...i);return n.set(r,o),o}}var gh=e=>oa({name:e},1),oa=(e,t)=>An(n=>({value:n,configurable:1,writable:!t}),e),xo=e=>({[Symbol.toStringTag]:{value:e,configurable:1}});function An(e,t){let n={};for(let r in t)n[r]=e(t[r],r);return n}function bo(e,t){let n={};for(let r of e)n[r]=t;return n}function sa(e){let t={};for(let n of e)t[n]=r=>r[n];return t}function Dt(e,t,n=Object.create(null)){for(let r of e)n[r]=t[r];return n}function yh(e,t,n){for(let r of e)if(t[r]!==n[r])return 0;return 1}function l1(e,t,n){let r={...n};for(let i=0;i<t;i++)r[e[i]]=0;return r}function je(e,...t){return(...n)=>e(...t,...n)}function Wl(){}function Qf(e){return e[0].toUpperCase()+e.substring(1)}function Te(...e){return[].concat(...e).sort()}function Gr(e){return new RegExp(`^${e}$`,"i")}function Gl(e){return parseInt(e.padEnd(9,"0"))}function Vl(e){return e&&e!=="+"?-1:1}function zr(e){return e===void 0?0:parseInt(e)}function Xs(e,t){return String(t).padStart(e,"0")}var ht=je(Xs,2);function Jt(e,t){return Math.sign(e-t)}function ye(e,t){return e<t?-1:e>t?1:0}function wh(e,t){let n=e/t;return e%t<0n?n-1n:n}function Yl(e,t){let n=wh(e,t);return[n,e-n*t]}function _t(e,t){return[Math.floor(e/t),aa(e,t)]}function aa(e,t){return(e%t+t)%t}function Vr(e,t){return Math.trunc(e/t)||0}function Zl(e,t){return e%t||0}function xh(e,t=1){return t*(.5+e/5)}function Zs(e){return Math.abs(e%1)===.5}var Kl="iso8601",bh="gregory",c1={bce:-1,ce:0};function kh(e){let t=e.normalize("NFD").toLowerCase().replace(/[^a-z0-9]/g,"");return t==="bc"||t==="b"?"bce":t==="ad"||t==="a"?"ce":t}var it=void 0,Sh=0;function yt(e){return e===it?"iso8601":e===0?"gregory":e.id}var d1=/^M(\d{2})(L?)$/;function Th(e){let t=d1.exec(e);return t||v((n=>`Invalid monthCode: ${n}`)(e)),[parseInt(t[1]),!!t[2]]}function Ch(e,t){return"M"+ht(e)+(t?"L":"")}function Ml(e,t,n){return e+(t||n&&e>=n?1:0)}var Nl={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},Jl=Object.keys(Nl);var ko=Sl,So=Tl,_n=Cl,To=El,Co=Il,en=864e11,wt=[1,ko,So,_n,To,Co,en],m1=BigInt(ko),Yr=BigInt(So),or=BigInt(_n),p1=BigInt(To),f1=BigInt(Co),le=BigInt(en);function Eh(e,t){let n=Number(e/le),r=Number(e%le);return n*(en/t)+(Math.trunc(r/t)+r%t/t)}var $e=Jl.slice(0,6),Eo=sa($e),ua=["year"],dr=["day"],Xl=["day","month","year"],la=["offset"],Ql=["timeZone"],Zr=["era","eraYear"],h1=["era","eraYear","year"],Ih=["month","monthCode"],g1=["day","month","monthCode"],Rl=Te($e),y1=Te(Zr,ua),Io=Te(Ih,ua),Ah=Te(Zr,Io),Ao=Te(["monthCode"],ua),_h=Te(Zr,Ao),Oh=Te(dr,["monthCode"]),mr=Te(dr,Io),pr=Te(dr,Zr,Io),Dh=Te(mr,$e),vh=Te(pr,$e),w1=Te(mr,$e,la),x1=Te(pr,$e,la),Mh=Te(mr,$e,la,Ql),Nh=Te(pr,$e,la,Ql),b1=Te(dr,Ao),k1=Te(dr,Zr,Ao),ze=bo($e,0);function _o(e){return ca(e,1),e}var S1={hour:23,minute:59,second:59};function ca(e,t){let n={};for(let r of $e)n[r]=Ot(r,e[r],0,S1[r]||999,t);return n}function Je(e){return tc(e)*_n+Rh(e)}function ec(e){return 1e3*tc(e)+e.millisecond}function tc(e){return 3600*e.hour+60*e.minute+e.second}function Rh(e){return e.millisecond*So+e.microsecond*ko+e.nanosecond}function nc(e){let[t,n]=_t(e,en);return[Ph(n),t]}function Ph(e){let[t,n]=_t(e,So),[r,i]=_t(n,ko);return T1(t,r,i)}function T1(e,t=0,n=0){let[r,i]=_t(e,36e5),[o,s]=_t(i,6e4),[a,u]=_t(s,1e3);return{hour:r,minute:o,second:a,millisecond:u,microsecond:t,nanosecond:n}}function eh(e){let[t,n]=Yl(e,or);return[Number(t),Number(n)]}function ot(e){return Tn(e)+BigInt(Je(e))}function Lh(e){return Oo(e)+ec(e)}function Tn(e){return BigInt(vt(e))*le}function Oo(e){return 864e5*vt(e)}function vt(e){return po(e.year,e.month,e.day)}function po(e,t=1,n=1){let r=t-1;return e+=Math.floor(r/12),t=aa(r,12),Date.UTC(e%400-400,t,0)/864e5+146097*(Vr(e,400)+1)+n}function Do(e){let[t,n]=Yl(e,le);return{...Fh(Number(t)),...Ph(Number(n))}}function Fh(e){let t=new Date(864e5*aa(e,146097));return{year:t.getUTCFullYear()+400*Math.floor(e/146097),month:t.getUTCMonth()+1,day:t.getUTCDate()}}var $h=1972;function C1(e){return[e,0]}function Pl(e,t){if(!t)return{year:1972,month:e}}function E1(e,t,n){return{year:e,month:t,day:n}}function Uh(e,t){switch(t){case 2:return da(e)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function I1(e){return da(e)?366:365}function da(e){return e%4==0&&(e%100!=0||e%400==0)}function zh(e,t,n){return e+=Vr(n,12),(t+=Zl(n,12))<1?(e--,t+=12):t>12&&(e++,t-=12),{year:e,month:t}}function A1(e,t,n,r){return 12*(n-e)+r-t}function ma(e){return aa(po(e.year,e.month,e.day)+4,7)||7}function Bh(e){return po(e.year,e.month,e.day)-po(e.year)+1}function qh(e){let t=e.year,n=Math.floor((Bh(e)-ma(e)+10)/7),r=_l(t);return n<1?n=r=_l(--t):n>r&&(n=1,r=_l(++t)),{weekOfYear:n,yearOfWeek:t,Be:r}}function _l(e){let t=ma({year:e,month:1,day:1});return t===4||t===3&&da(e)?53:52}function _1({year:e}){return e<1?{era:"bce",eraYear:1-e}:{era:"ce",eraYear:e}}function vo(e){return tn(e),_o(e)}function tn(e){return jh(e,1),e}function th(e){return yh(Xl,e,jh(e))}function jh(e,t){let{year:n}=e,r=vl(e,"month",1,12,t);return{year:n,month:r,day:vl(e,"day",1,Uh(n,r),t)}}function ae(e,t){return e?e.ae(t):t}function sr(e,t,n){return e?e.L(t,n):C1(n)}function Mo(e,t){return e===0?_1(t):e&&e.h?.(t)||{}}function ar(e,t,n,r){return e?e.de(t,n,r):E1(t,n,r)}function fo(e,t){return e?e.j(t):12}function ho(e,t,n){return e?e.o(t,n):Uh(t,n)}function pa(e,t){let{year:n,month:r}=ae(e,t),[i,o]=sr(e,n,r);return Ch(i,o)}function rc(e,t){let{year:n}=ae(e,t);return e?e.q(n):da(n)}function ic(e,t){let{year:n}=ae(e,t);return fo(e,n)}function oc(e,t){let{year:n,month:r}=ae(e,t);return ho(e,n,r)}function sc(e,t){let{year:n}=ae(e,t);return e?e.i(n):I1(n)}function Hh(e,t){if(!e)return Bh(t);let{year:n}=ae(e,t),r=ar(e,n,1,1);return vt(t)-vt(r)+1}function Wh(e,t){return e===it?qh(t).weekOfYear:void 0}function Gh(e,t){return e===it?qh(t).yearOfWeek:void 0}var ce=Jl.map(e=>e+"s"),ac=sa(ce),Vh=Te(ce),O1=ce.slice(0,6),Yh=ce.slice(6),D1=Yh.slice(1),we=bo(ce,0),uc=bo(O1,0),lc=je(l1,ce);function Zh(e,t){return t==null&&v(wo(e)),t}var ve=je(v1,"string");function v1(e,t,n=e){return typeof t!==e&&ne(ra(n,t)),t}function cc(e,t="number"){return Number.isInteger(e)||v(((n,r)=>`Non-integer ${n}: ${r}`)(t,e)),e||0}function dc(e){return typeof e=="symbol"&&ne("Cannot convert Symbol to string"),String(e)}function mc(e,t){return Ur(e)?String(e):ve(e,t)}function fa(e){return typeof e=="boolean"?BigInt(e?1:0):typeof e=="string"?BigInt(e):(typeof e!="bigint"&&ne(`Invalid bigint: ${e}`),e)}function ha(e,t){return cc(Vs(e,t),t)}function ga(e,t){return typeof e=="string"?((n,r)=>{let i=Object.create(null);return i[n]=r,i})(t,e):nr(e)}var Xt="smallestUnit";var M1={constrain:0,reject:1},N1={compatible:0,reject:1,earlier:2,later:3},R1={reject:0,use:1,prefer:2,ignore:3},P1={auto:0,never:1,critical:2,always:3},L1={auto:0,never:1,critical:2},F1={auto:0,never:1},$1={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},U1=[Math.floor,e=>Zs(e)?Math.floor(e):Math.round(e),Math.ceil,e=>Zs(e)?Math.ceil(e):Math.round(e),Math.trunc,e=>Zs(e)?Math.trunc(e)||0:Math.round(e),e=>e<0?Math.floor(e):Math.ceil(e),e=>Math.sign(e)*Math.round(Math.abs(e))||0,e=>Zs(e)?(e=Math.trunc(e)||0)+e%2:Math.round(e)],z1={previous:-1,next:1};function pc(e){let t=e.roundingIncrement;return t===void 0?1:Ee(t,"roundingIncrement")}function fc(e){let t=e.fractionalSecondDigits;if(t!==void 0){if(typeof t!="number"){if(dc(t)==="auto")return;v(ra("fractionalSecondDigits",t))}t=Ot("fractionalSecondDigits",Math.floor(t),0,9,1)}return t}function hc(e,t,n=0,r){let i=t[e];if(i===void 0)return r?n:void 0;if(i=dc(i),i==="auto")return r?n:null;let o=Nl[i];return o===void 0&&(o=ce.indexOf(i)),o<0&&v(ch(e,i,Nl)),o}function On(e,t,n,r=0){let i=n[e];if(i===void 0)return r;let o=dc(i),s=t[o];return s===void 0&&v(ch(e,o,t)),s}var Kr=je(hc,Xt),Kh=je(hc,"largestUnit"),B1=je(hc,"unit"),Jh=je(On,"overflow",M1),Xh=je(On,"disambiguation",N1),q1=je(On,"offset",R1),gc=je(On,"calendarName",P1),j1=je(On,"timeZoneName",L1),H1=je(On,"offset",F1),Jr=je(On,"roundingMode",$1),W1=je(On,"direction",z1);function yc(e,t,n,r){let i=r?en:wt[t+1];if(i){let o=wt[t];i%((e=Ot("roundingIncrement",e,1,i/o-(r?0:1),1))*o)&&v(ra("roundingIncrement",e))}else e=Ot("roundingIncrement",e,1,n?10**9:1,1);return e}function jr(e,t,n,r){return t!=null&&Ot(e,t,n,r,1,Jl),t}function Qh(e,t){t>e&&v("smallestUnit > largestUnit")}function Xr(e,t,n,r=9,i=0,o=4){t=rt(t);let s=Kh(t,i),a=pc(t),u=Jr(t,o),l=Kr(t,i,1);return s=jr("largestUnit",s,i,r),l=jr(Xt,l,i,r),s==null?s=Math.max(n,l):Qh(s,l),a=yc(a,l,1),e&&(u=(d=>d<4?(d+2)%4:d)(u)),[s,l,a,u]}function No(e,t=6,n){let r=pc(e=ga(e,Xt)),i=Jr(e,7),o=Kr(e);return o=Zh(Xt,o),o=jr(Xt,o,0,t),r=yc(r,o,void 0,n),[o,r,i]}function ie(e,t){return Dt(Xl,e,Dt($e,t))}function X(e){return e===void 0?0:Jh(nr(e))}function Hr(e,t=0){e=rt(e);let n=Xh(e),r=q1(e,t);return[Jh(e),r,n]}var eg=BigInt(1e8)*le,wc=BigInt(-1e8)*le,tg=wc-le,ng=-3261848;function ya(e){let t=12*e.year+e.month;return(t<ng||t>3309129)&&v(Sn),e}function Be(e,t=1){return rg(Tn(e),t),e}function fr(e){let t=Tn(e);return rg(t),t!==tg||Je(e)||v(Sn),e}function rg(e,t=1){(e<(t?tg:wc)||e>eg)&&v(Sn)}function xt(e){return(e<wc||e>eg)&&v(Sn),e}function xc(e,t){return xt(Tn(e)+BigInt(Je(e)-t))}function st(e){return{epochNanoseconds:e}}function bt(e,t,n){return{calendar:n,timeZone:t,epochNanoseconds:e}}function Mt(e,t){return Dt($e,e,ue(e,t))}function ue(e,t){return Dt(Xl,e,{calendar:t})}function hr(e){return Dt($e,e)}function Se(e){return Dt(ce,e,{sign:Ea(e)})}function Ro(e){return t=e.epochNanoseconds,Number(wh(t,Yr));var t}function bc(e){return e.epochNanoseconds}function ig(e,t,n){let r=In(t),[i,o]=((c,m)=>{let p=m((c=ga(c,"unit")).relativeTo),f=B1(c);return f=Zh("unit",f),[f,p]})(n,e),s=Math.max(i,r),a=o&&cr(o);if(!o&&Br(s,a))return nh(t,i);if(o||v("Missing relativeTo"),!t.sign&&Br(i,a))return 0;let[u,l,d]=xg(o,t,i);return Br(i,a)?nh(u,i):G1(u,l,i,d)}function G1(e,t,n,r){let i=Ea(e)||1,o=kc(lc(n,e),n,i,r,t),s=o.ee,a=o.te,u=Number(a-s),l=Number(t-s);return o.pe[ce[n]]+l/u*i}function nh(e,t){return Eh(Qt(e),wt[t])}function kc(e,t,n,r,i){let o=ce[t],s=e,a=0,u=rh(s,o,n,r);return i&&!((l,d,c,m)=>m>0?ye(d,l)<=0&&ye(l,c)<=0:ye(c,l)<=0&&ye(l,d)<=0)(i,u.ee,u.te,Math.sign(n))&&(s={...e,[o]:e[o]+n},a=1,u=rh(s,o,n,r)),{...u,pe:s,Ae:a}}function rh(e,t,n,r){let i={...e,[t]:e[t]+n};return{ee:$l(r,e),te:$l(r,i),se:i}}function og(e,t,n){let r=n-t,i=e-t;if(!i)return 0;let o=i<0n?-i:i,s=r<0n?-r:r,a=ye(i,0n)===ye(r,0n)?1:-1;return ye(o,s)<=0?o===s?a:xh(ye(2n*o,s),a):Number(i)/Number(r)}function sg(e,t,n,r){let{epochNanoseconds:i}=e,{timeZone:o,calendar:s}=e;if(t===0&&n===1)return{epochNanoseconds:i,timeZone:o,calendar:s};if(t===6){let a=ie(xe(e),ze),u=ie(Dn(a,1),ze),l=Cn(o,a),d=Cn(o,u);i=Sc(V1(i,l,d),r)?d:l}else{let a=xe(e),u=a.offsetNanoseconds;i=ei(o,wa(a,Qr(t,n),r),u,2,0,1)}return{epochNanoseconds:i,timeZone:o,calendar:s}}function ag(e){let{timeZone:t}=e,n=ie(xe(e),ze),r=ie(Dn(n,1),ze),i=Cn(t,n);return Eh(Cn(t,r)-i,Co)}function ug(e){let{timeZone:t,calendar:n}=e;return bt(Cn(t,ie(xe(e),ze)),t,n)}function V1(e,t,n){return og(e<n?e:n-1n,t,n)}function wa(e,t,n){let[r,i]=xa(e,t,n),o=ie(Dn(e,i),r);return fr(o),o}function xa(e,t,n){return nc(Wr(Je(e),t,n))}function Qs(e){return Wr(e,To,7)}function Qr(e,t){return wt[e]*t}function Po(e,t){return BigInt(wt[e])*BigInt(t)}function Y1(e,t,n){let r=Math.min(In(e),6);return En(ka(Qt(e),BigInt(t),n),r)}function ba(e,t,n,r,i,o,s,a){if(r===0&&i===1)return e;let u=Ea(e)||1,l=Br(r,a)?a&&r<6&&n>=6?K1:Z1:J1,[d,c,m]=l(u,e,t,n,r,i,o,s);return m&&r!==7&&(d=((p,f,x,S,w,D)=>{for(let T=S+1;T<=x;T++){if(T===7&&x!==7)continue;let M=lc(T,p);M[ce[T]]+=w;let O=ye(f,$l(D,M));if(O&&O!==w)break;p=M}return p})(d,c,n,Math.max(6,r),u,s)),d}function ka(e,t,n){return lg(e,t,n,e/t%2n)}function Sa(e,t,n){let[r,i]=Yl(e,le),o=r*le;return o+lg(i,t,n,(o/t+i/t)%2n)}function lg(e,t,n,r){let i=e/t,o=e%t,s=0;o&&(s=xh(ye(2n*(o<0n?-o:o),t),Math.sign(Number(o))));let a=Sc(Number(r)+s,n);return(i-r+BigInt(a))*t}function Wr(e,t,n){return Sc(e/t,n)*t}function Sc(e,t){return U1[t](e)}function Z1(e,t,n,r,i,o,s){let a=Qt(t),u=ka(a,Po(i,o),s),l=u-a,d=Math.sign(Number(u/le)-Number(a/le))===e,c=En(u,Math.min(r,6));return[{...t,...c},n+l,d]}function K1(e,t,n,r,i,o,s,a){let u=Number(gr(t)),l=Qr(i,o),d=Wr(u,l,s),c=kc({...t,...uc},6,e,a,n),m=c.ee,p=c.te,f=d-Number(p-m),x=0;f&&Math.sign(f)!==e?n=m+BigInt(d):(x+=e,d=Wr(f,l,s),n=p+BigInt(d));let S=Ia(d);return[{...t,...S,days:t.days+x},n,!!x]}function J1(e,t,n,r,i,o,s,a){let u=ce[i],l=lc(i,t);i===7&&(t={...t,weeks:t.weeks+Math.trunc(t.days/7)});let d=Vr(t[u],o)*o;l[u]=d;let c=kc(l,i,o*e,a,n),m=c.ee,p=c.te,f=og(n,m,p),x=c.pe[u],S=c.se[u],w=Wr(x+f*e*o,o,s),D=w===S;return l[u]=w,[l,D?p:m,c.Ae||D]}function cg(e,t){return e.timeZone.O(e.epochNanoseconds,(n=>{let r=ga(n,"direction"),i=W1(r,0);return i||v(ra("direction",i)),i})(t))}var xe=qr(X1,WeakMap);function X1(e){let{epochNanoseconds:t,timeZone:n}=e,r=n.B(t);return{...Do(t+BigInt(r)),offsetNanoseconds:r}}function ei(e,t,n,r=0,i=0,o,s){if(n!==void 0&&r===1&&(r===1||s))return xc(t,n);r!==2&&r!==0||Be(t,0);let a=e.N(t);if(n!==void 0&&r!==3){let u=((l,d,c,m)=>{let p=ot(d);m&&(c=Qs(c));for(let f of l){let x=Number(p-f);if(m&&(x=Qs(x)),x===c)return f}})(a,t,n,o);if(u!==void 0)return u;r===0&&v("Invalid TimeZone offset")}return s?ot(t):ti(e,t,i,a)}function ti(e,t,n=0,r=e.N(t)){if(r.length===1)return r[0];if(n===1&&v("Ambiguous offset"),r.length)return r[n===3?1:0];let i=ot(t),o=((a,u)=>{let l=a.B(u-le);return(d=>(d>en&&v("Out-of-bounds TimeZone gap"),d))(a.B(u+le)-l)})(e,i),s=Do(i+BigInt(o*(n===2?-1:1)));return(r=e.N(s))[n===2?0:r.length-1]}function Cn(e,t){let n=e.N(t);if(n.length)return n[0];let r=ot(t)-le;return e.O(r,1)}function Tc(e,t,n,r,i){let o=X(i);r.sign&&In(r)<8&&v("Cannot use small units");let s=Be(go(t,n));return go(t,dg(t,s,e?Me(r):r,o))}function Cc(e,t){return xt(e+(Lc(n=t)&&v("Cannot use large units"),gr(n)));var n}function ur(e,t,n){let{calendar:r,epochNanoseconds:i,timeZone:o}=e,s=gr(t),a=i;if(Lc(t)){let u=xe(e);a=ti(o,ie(ni(r,u,{...t,...uc},n),u))+s}else a+=s,X(n);return{...e,epochNanoseconds:xt(a)}}function lr(e,t,n,r){let[i,o]=Ta(t,n);return fr(ie(ni(e,t,{...n,...uc,days:n.days+o},r),i))}function ni(e,t,n,r){if(n.years||n.months||n.weeks)return dg(e,t,n,X(r));X(r);let i=n.days+Number(gr(n)/le);return i?Be(Dn(t,i)):t}function go(e,t){return Dn(t,1-ae(e,t).day)}function Ta(e,t){let n=gr(t),r=Number(n/le),i=Number(n%le),[o,s]=nc(Je(e)+i);return[o,r+s]}function Dn(e,t){return t?Fh(vt(e)+t):e}function dg(e,t,n,r){let{years:i,months:o,weeks:s,days:a}=n,u;if(a+=Number(gr(n)/le),i||o)u=Ll(e,t,i,o,r);else{if(!s&&!a)return t;u=t}return(s||a)&&(u=Dn(u,7*s+a)),Be(u)}function Ll(e,t,n,r,i){let o=ae(e,t),{year:s,month:a,day:u}=o;if(n){let[l,d]=sr(e,s,a);s+=n,a=Fl(e,l,d,e?e.p(s):void 0,i),a=Ot("month",a,1,fo(e,s),i)}return r&&({year:s,month:a}=e?e.K(s,a,r):zh(s,a,r)),u=Ot("day",u,1,ho(e,s,a),i),ar(e,s,a,u)}function Fl(e,t,n,r,i){if(n){let o=e?e.l:void 0;return r!==void 0&&(o<0||r===t+1)?r:(i===1&&v(ir),o<0?-o:t)}return Ml(t,0,r)}function nn(e,t){return yt(e)!==yt(t)&&v("Mismatching Calendars"),e}function Q1(e,t){return e.m!==t.m&&v("Mismatching TimeZones"),e}function mg(e){return e.timeZone.id}function Ec(e,t,n,r){let[i,o,s,a]=Xr(e,r,3,5),u=Ca(t.epochNanoseconds,n.epochNanoseconds,i,o,s,a);return Se(e?Me(u):u)}function Ic(e,t,n,r,i){let[o,s,a,u]=Xr(e,i,5),l=n.epochNanoseconds,d=r.epochNanoseconds,c;if(ye(d,l))if(o<6)c=Ca(l,d,o,s,a,u);else{let m=Q1(n.timeZone,r.timeZone);c=vc(m,t,n,r,o),c=ba(c,d,o,s,a,u,wg(t,m,n),1)}else c=we;return Se(e?Me(c):c)}function Ac(e,t,n,r,i){let[o,s,a,u]=Xr(e,i,6),l=ot(n),d=ot(r),c=ye(d,l),m;return c?o<=6?m=Ca(l,d,o,s,a,u):(m=hg(t,n,r,c,o),m=ba(m,d,o,s,a,u,tC(t,n))):m=we,Se(e?Me(m):m)}function _c(e,t,n,r,i){let[o,s,a,u]=Xr(e,i,6,9,6);return pg(e,t,n,r,o,s,a,u)}function Oc(e,t,n,r,i){let[o,s,a,u]=Xr(e,i,9,9,8),l=go(t,n),d=go(t,r);return gg(l,d)?pg(e,t,Be(l),Be(d),o,s,a,u,8):Se(we)}function pg(e,t,n,r,i,o,s,a,u=6){let l=Tn(n),d=Tn(r),c;return ye(d,l)?i===6?c=Ca(l,d,i,o,s,a):(c=Mc(t,n,r,i),o===u&&s===1||(c=ba(c,d,i,o,s,a,yg(t,n)))):c=we,Se(e?Me(c):c)}function Dc(e,t,n,r){let[i,o,s,a]=Xr(e,r,5,5),u=Wr(Je(n)-Je(t),Qr(o,s),a),l={...we,...Ia(u,i)};return Se(e?Me(l):l)}function vc(e,t,n,r,i){let o=ye(r.epochNanoseconds,n.epochNanoseconds);if(!o)return we;if(i<6)return{...we,...En(r.epochNanoseconds-n.epochNanoseconds,i)};if(!gg(xe(n),xe(r)))return{...we,...En(r.epochNanoseconds-n.epochNanoseconds,5)};let[s,a,u]=eC(e,n,r,o);return{...i===6?{...we,days:Js(s,a)}:Mc(t,s,a,i),...Ia(u)}}function fg(e,t,n,r){let i=ot(t),o=ot(n),s=ye(o,i);return s?r<=6?{...we,...En(o-i,r)}:hg(e,t,n,s,r):we}function hg(e,t,n,r,i){let o=n,s=Je(n)-Je(t);return Math.sign(s)===-r&&(o=Dn(n,-r),s+=en*r),{...Mc(e,t,o,i),...Ia(s)}}function Mc(e,t,n,r){if(r<=7){let x=Js(t,n);return r===7?{...we,weeks:Vr(x,7),days:Zl(x,7)}:{...we,days:x}}let i=ae(e,t),o=ae(e,n);if(r===8){let{year:x,month:S,day:w}=i,{year:D,month:T,day:M}=o,O=Math.sign(Jt(D,x)||Jt(T,S)||Js(t,n)),b=0,C=0;if(O){b=e?e._(x,S,D,T):A1(x,S,D,T);let N=Ll(e,t,0,b,0);O*Jt(w,M)>0&&(b-=O,N=Ll(e,t,0,b,0)),C=Js(N,n)}return{...we,months:b,days:C}}let{year:s,month:a,day:u}=i,{year:l,month:d,day:c}=o,m=l-s,p=d-a,f=c-u;if(m||p){let x=Math.sign(m||p),S=ho(e,l,d),w=0;if(Math.sign(c-u)===-x){let D=S;({year:l,month:d}=e?e.K(l,d,-x):zh(l,d,-x)),m=l-s,p=d-a,S=ho(e,l,d),w=x<0?-D:S}if(f=c-Math.min(u,S)+w,m){let[D,T]=sr(e,s,a),[M,O]=sr(e,l,d),b=e?e.l:void 0;if(p=b!==void 0&&T&&!O&&(b<0?x>0&&M===-b:x<0&&M===D)?0:M-D||Number(O)-Number(T),Math.sign(p)===-x){let C=x<0&&-fo(e,l);l-=x,m=l-s,p=d-Fl(e,D,T,e?e.p(l):void 0,0)+(C||fo(e,l))}else if(e){let C=Fl(e,D,T,e.p(l),0);p=e._(l,C,l,d)}}}return{...we,years:m,months:p,days:f}}function gg(e,t){return Jt(e.year,t.year)||Jt(e.month,t.month)||Jt(e.day,t.day)}function eC(e,t,n,r){let i=xe(t),o=xe(n),s=n.epochNanoseconds,a=0,u=Je(o)-Je(i);Math.sign(u)===-r&&a++;let l=a+(r>0?1:0);for(;a<=l;a++){let d=Dn(o,a*-r),c=ti(e,ie(d,i));if(ye(s,c)!==-r)return[i,d,Number(s-c)]}}function Ca(e,t,n,r,i,o){return{...we,...En(ka(t-e,Po(r,i),o),n)}}function Js(e,t){return vt(t)-vt(e)}function yg(e,t){return{origin:t,ie:Tn(t),calendar:e,he:Tn}}function tC(e,t){return{origin:t,ie:ot(t),calendar:e,he:n=>ot(ie(n,t))}}function wg(e,t,n){let r=xe(n);return{origin:r,ie:n.epochNanoseconds,calendar:e,he:i=>ti(t,ie(i,r))}}function $l(e,t){return Lc(t)?e.he(ni(e.calendar,e.origin,t)):e.ie}function xg(e,t,n){let{calendar:r}=e;if(cr(e)){let{timeZone:s}=e,a=ur(e,t);return[vc(s,r,e,a,n),a.epochNanoseconds,wg(r,s,e)]}let i=fr(ie(e,ze)),o=lr(r,i,t);return[fg(r,i,o,n),ot(o),yg(r,e)]}function ih(e,t){return cr(e)?ur(e,t).epochNanoseconds:ot(lr(e.calendar,ie(e,ze),t))}function cr(e){return"timeZone"in e}function Br(e,t){return e<=6-(t?1:0)}function Nc(e,t,n){let r={};for(let i=t;i>=0;i--){let o=wt[i];r[n[i]]=Vr(e,o),e=Zl(e,o)}return r}var nC=2**53;function Rc(e,t,n,r,i){let o=e(rt(i).relativeTo),s=Math.max(In(n),In(r));return Br(s,o&&cr(o))?rC(t,n,r,s):(o||v("Missing relativeTo"),t&&(r=Me(r)),Se(((a,u,l,d)=>{let{calendar:c}=a;if(cr(a)){let{timeZone:f}=a,x=ur(a,u);return vc(f,c,a,ur(x,l),d)}let m=ie(a,ze),p=lr(c,m,u);return fg(c,m,lr(c,p,l),d)})(o,n,r,s)))}function rC(e,t,n,r){return Se(vn(((i,o,s,a)=>{let u=Qt(i)+Qt(o)*BigInt(a?-1:1);return Number.isFinite(Number(u/le))||v(Sn),{...we,...En(u,s)}})(t,n,r,e)))}function bg(e,t,n){let r=In(t),[i,o,s,a,u]=((f,x,S)=>{f=ga(f,Xt);let w=Kh(f),D=S(f.relativeTo),T=pc(f),M=Jr(f,7),O=Kr(f);return w===void 0&&O===void 0&&v("Required smallestUnit or largestUnit"),O==null&&(O=0),w==null&&(w=Math.max(O,x)),Qh(w,O),T=yc(T,O,1),T>1&&O>5&&w!==O&&v("For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit"),[w,O,T,M,D]})(n,r,e);if(!u&&Math.max(r,i)<=6)return Se(vn(((f,x,S,w,D)=>{let T=ka(Qt(f),Po(S,w),D);return{...we,...En(T,x)}})(t,i,o,s,a)));let l=u&&cr(u),d=l&&i>=6&&o<6;if(!t.sign&&!d)return t;u||v("Missing relativeTo");let[c,m,p]=xg(u,t,i);return Se(ba(c,m,i,o,s,a,p,l))}function kg(e){return e.sign===-1?Pc(e):e}function Pc(e){return Se(Me(e))}function Me(e){let t={};for(let n of ce)t[n]=-1*e[n]||0;return t}function Ea(e,t=ce){let n=0;for(let r of t){let i=Math.sign(e[r]);i&&(n&&n!==i&&v("Cannot mix duration signs"),n=i)}return n}function vn(e){for(let n of D1)Ot(n,e[n],-4294967295,4294967295,1);let t=Qt(e);return Sg(Number(t/or)),e}function Sg(e){Number.isSafeInteger(e)||v("Out-of-bounds duration")}function Qt(e){return BigInt(e.days)*le+gr(e)}function gr(e){return BigInt(e.hours)*f1+BigInt(e.minutes)*p1+Tg(e)}function Tg(e){return BigInt(e.seconds)*or+BigInt(e.milliseconds)*Yr+BigInt(e.microseconds)*m1+BigInt(e.nanoseconds)}function En(e,t=6){let n=Number(e/le),r=Number(e%le),i=wt[t],o=t<=3?Number(e/BigInt(i)):n*(en/i)+Vr(r,i);Number.isFinite(o)||v(Sn),t<=3&&Math.abs(o)/(_n/wt[t])>=nC&&v(Sn);let s=Nc(r,t,ce);return s[ce[t]]=o,s}function Ia(e,t=5){return Nc(e,t,ce)}function Lc(e){return!!Ea(e,Yh)}function In(e){let t=9;for(;t>0&&!e[ce[t]];t--);return t}function Lo(e,t){return ye(e.epochNanoseconds,t.epochNanoseconds)}function Cg(e,t,n,r){let i=e(rt(r).relativeTo),o=Math.max(In(t),In(n));return yh(ce,t,n)?0:Br(o,i&&cr(i))?ye(Qt(t),Qt(n)):(i||v("Missing relativeTo"),ye(ih(i,t),ih(i,n)))}function Fc(e,t){return yr(e,t)||Aa(e,t)}function yr(e,t){return Jt(vt(e),vt(t))}function Aa(e,t){return Jt(Je(e),Je(t))}function Eg(e,t){return!Lo(e,t)}function Ig(e,t){return!Lo(e,t)&&e.timeZone.m===t.timeZone.m&&e.calendar===t.calendar}function Ag(e,t){return!Fc(e,t)&&e.calendar===t.calendar}function _g(e,t){return!yr(e,t)&&e.calendar===t.calendar}function Og(e,t){return!yr(e,t)&&e.calendar===t.calendar}function Dg(e,t){return!yr(e,t)&&e.calendar===t.calendar}function vg(e,t){return!Aa(e,t)}function ri(e){return e===0?c1:e?e.k:void 0}function Ue(e,t,n=t){return ri(e)?n:t}function $c(e,t){let n=e||void 0,r=ri(e),{era:i,eraYear:o,year:s}=t;if(s!==void 0&&(s=Ee(s,"year")),o!==void 0&&(o=Ee(o,"eraYear")),i!==void 0||o!==void 0){i!==void 0&&o!==void 0||ne("Mismatching era/eraYear"),r||v("Forbidden era/eraYear");let a=kh(i),u=r[a];u===void 0&&v((d=>`Invalid era: ${d}`)(i));let l=n?.$?n.$(o,a,u):iC(o,u);s!==void 0&&s!==l&&v("Mismatching year/eraYear"),s=l}else s===void 0&&ne(ia(r));return s}function ea(e,t,n,r,i){let{month:o,monthCode:s}=t;if(s!==void 0){let a=((u,l,d,c,m=Th(l))=>{let p=u?u.p(d):void 0,[f,x]=m,S=Ml(f,x,p);if(x){let w=u?u.l:void 0;w===void 0&&v(ir),w>0?(S>w&&v(ir),p!==S&&(c===1&&v(ir),S=Ml(f,0,p))):(S!==-w&&v(ir),p===void 0&&c===1&&v(ir))}return S})(e,s,n,r,i);o!==void 0&&o!==a&&v("Mismatching month/monthCode"),o=a,r=1}else o===void 0&&ne("Missing month/monthCode");return Ot("month",o,1,fo(e,n),r)}function Ul(e,t,n,r,i){return vl(t,"day",1,ho(e,r,n),i)}function iC(e,t){return(t+e)*(Math.sign(t)||1)||0}function Fo(e,t){return ca(Dt($e,{...ze,...e}),t)}var oC=Gr("([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?");function _a(e){let t=Uc(e);return t===void 0&&v(hh(e)),t}function Uc(e,t){let n=oC.exec(e);if(n&&(r=>(i=>{i[0]!=="T"&&i[0]!=="t"||(i=i.slice(1));let o=i.search(/[.,]/),s=o<0?i:i.slice(0,o),a=s.split(":");return a.length===1?/^(?:\d{2}|\d{4}|\d{6})$/i.test(s):(a.length===2||a.length===3)&&a.every(u=>u.length===2&&/^\d{2}$/i.test(u))})(r.slice(1)))(n[0]))return((r,i)=>{let o=r[4]||r[5];return i&&o&&v(Kt(o)),a=(zr(r[2])*Co+zr(r[3])*To+zr(r[4])*_n+Gl(r[5]||""))*Vl(r[1]),Math.abs(a)>=en&&v("Out-of-bounds offset"),a;var a})(n,t)}var at={era:mc,month:Ys,monthCode(e,t){if(typeof e=="string")return e;if(e&&typeof e=="object"){let n=e.toString;if(typeof n=="function")return ve(n.call(e),t)}return ve(e,t)},day:Ys},zc=bo($e,Ee),Mg=bo(ce,ha),Bc=Object.assign({},at,zc),qc={offset(e){return _a(mc(e))},...Bc};function pe(e,t,n,r,i=!r){let o={},s=0;for(let a of t){let u=e[a];if(u!==void 0){s=1;let l=n[a];l&&(u=l(u,a)),o[a]=u}else r&&r.includes(a)&&ne(wo(a))}return i&&!s&&ne(uh(t)),o}function $o(e,t=ze,n){let r=ie(e,t);return fr(r),Mt(r,n)}function yo(e,t,n){return Ng(e,t,Rg(e,t),X(n))}function Oa(e,t,n){let r=Rg(e,t),i=n();return[Ng(e,t,r,i[0]),...i]}function Ng(e,t,n,r){let i=n[1],o=ea(e,t,i,r,n[0]);return ue(Be(ar(e,i,o,Ul(e,t,o,i,r))),e)}function jc(e){if(e.monthCode!==void 0)return Th(e.monthCode)}function Rg(e,t){let n=ri(e);return t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||ne(ia(n)),t.monthCode===void 0&&t.month===void 0&&ne("Missing month/monthCode"),t.day===void 0&&ne(wo("day")),[jc(t),$c(e,t)]}function Hc(e,t,n){let r=ri(e);t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||ne(ia(r)),t.monthCode===void 0&&t.month===void 0&&ne("Missing month/monthCode");let i=jc(t),o=$c(e,t);return ue(ya(ar(e,o,ea(e,t,o,X(n),i),1)),e)}function Wc(e,t,n){let r=e===it,i=ri(e);t.day===void 0&&ne(wo("day")),r||t.month===void 0||t.year!==void 0||t.era!==void 0&&t.eraYear!==void 0||ne(ia(i));let o=jc(t),s=t.eraYear!==void 0||t.year!==void 0?$c(e,t):void 0,a=X(n),u,l,d;if(s===void 0&&r&&(s=1972),s!==void 0){r||Be(ar(e,s,1,1));let f=ea(e,t,s,a,o);u=Ul(e,t,f,s,a),[l,d]=sr(e,s,f)}else{t.monthCode===void 0&&ne("Missing month/monthCode"),[l,d]=o;let f=e?e.ne:1972;if(f!==void 0)u=Ul(e,t,ea(e,t,f,a,o),f,a);else{let x=a===0&&e?e.fe?.(l,d,t.day):void 0;u=x!==void 0?x:t.day}}d&&((e&&e.U?.[l])??1/0)<t.day&&(a===1&&v(ir),d=0,u=Hl(t.day,1,(e&&e.R)??1/0));let c=e?e.u(l,!!d,u):Pl(l,!!d);for(;!c&&a===0&&u>1;)u--,c=e?e.u(l,!!d,u):Pl(l,!!d);c||v("Cannot guess year");let{year:m,month:p}=c;return ue(Be(ar(e,m,p,u)),e)}var Nt=Intl.DateTimeFormat;function sC(e,t){t<-864e13&&v(Sn);let n=e.formatToParts(t),r={};for(let i of n)r[i.type]=i.value;return r}var aC={El_Aaiun:17,Tucuman:12,Tirane:11,Riga:10,Simferopol:9,Vienna:9,Tunis:8,Boa_Vista:6,Fortaleza:6,Maceio:6,Noronha:6,Recife:6,Gaza:6,Hebron:6,DeNoronha:6},Ol=-388152e4;function Pg(e,t=4){let n=fc(e),r=Jr(e,4),i=Kr(e);return[r,...Vc(jr(Xt,i,0,t),n)]}function Gc(e){return gc(rt(e))}function Lg(e,t){return Pg(rt(e),t)}function Vc(e,t){return e!=null?[wt[e],e<4?9-3*e:-1]:[t===void 0?1:10**(9-t),t]}function Yc(e,t,n){let[r,i,o,s]=(u=>{let l=fc(u=rt(u)),d=Jr(u,4),c=Kr(u);return[u.timeZone,d,...Vc(jr(Xt,c,0,4),l)]})(n),a=r!==void 0;return((u,l,d,c,m,p)=>{d=Sa(d,BigInt(m),c);let f=l.B(d);return td(Do(d+BigInt(f)),p)+(u?Uo(Qs(f)):"Z")})(a,He(a?e(r):"UTC"),t.epochNanoseconds,i,o,s)}function Zc(e,t){let n=(r=>{r=rt(r);let i=gc(r),o=fc(r),s=H1(r),a=Jr(r,4),u=Kr(r);return[i,j1(r),s,a,...Vc(jr(Xt,u,0,4),o)]})(t);return((r,i,o,s,a,u,l,d,c,m)=>{s=Sa(s,BigInt(c),d);let p=o.B(s);return td(Do(s+BigInt(p)),m)+Uo(Qs(p),l)+cC(i,u)+nd(r,a)})(e.calendar,e.timeZone.id,e.timeZone,e.epochNanoseconds,...n)}function Kc(e,t){let n=(r=>(r=rt(r),[gc(r),...Pg(r)]))(t);return((r,i,o,s,a,u)=>td(wa(i,a,s),u)+nd(r,o))(e.calendar,e,...n)}function Jc(e,t){return n=e.calendar,r=e,i=Gc(t),ta(r)+nd(n,i);var n,r,i}function Xc(e,t){return Fg(e.calendar,$g,e,Gc(t))}function Qc(e,t){return Fg(e.calendar,lC,e,Gc(t))}function Fg(e,t,n,r){let i=r>1||r===0&&e!==it;return r===1?e===it?t(n):ta(n):i?ta(n)+zg(yt(e),r===2):t(n)}function ed(e,t){return((n,r,i,o)=>Ug(xa(n,i,r)[0],o))(e,...Lg(t))}function Da(e,t){let[n,r,i]=Lg(t,3);return r>1&&vn(e={...e,...Y1(e,r,n)}),uC(e,i)}function uC(e,t){let{sign:n}=e,r=n===-1?Me(e):e,{hours:i,minutes:o}=r,s=Tg(r),a=Number(s/or),u=Number(s%or);Sg(a);let l=rd(u,t),d=t>=0||!n||l;return(n<0?"-":"")+"P"+oh({Y:rr(r.years),M:rr(r.months),W:rr(r.weeks),D:rr(r.days)})+(i||o||a||d?"T"+oh({H:rr(i),M:rr(o),S:rr(a,d)+l}):"")}function oh(e){let t=[];for(let n in e){let r=e[n];r&&t.push(r,n)}return t.join("")}function rr(e,t){if(!e&&!t)return"";let n=Object.create(null);return n.useGrouping=0,e.toLocaleString("fullwide",n)}function td(e,t){return ta(e)+"T"+Ug(e,t)}function ta(e){return $g(e)+"-"+ht(e.day)}function $g(e){let{year:t}=e;return(t<0||t>9999?Bg(t)+Xs(6,Math.abs(t)):Xs(4,t))+"-"+ht(e.month)}function lC(e){return ht(e.month)+"-"+ht(e.day)}function Ug(e,t){let n=[ht(e.hour),ht(e.minute)];return t!==-1&&n.push(ht(e.second)+((r,i,o,s)=>rd(r*So+i*ko+o,s))(e.millisecond,e.microsecond,e.nanosecond,t)),n.join(":")}function Uo(e,t=0){if(t===1)return"";let[n,r]=_t(Math.abs(e),Co),[i,o]=_t(r,To),[s,a]=_t(o,_n);return Bg(e)+ht(n)+":"+ht(i)+(s||a?":"+ht(s)+rd(a):"")}function cC(e,t){return t!==1?"["+(t===2?"!":"")+e+"]":""}function nd(e,t){return t>1||t===0&&e!==it?zg(yt(e),t===2):""}function zg(e,t){return"["+(t?"!":"")+"u-ca="+e+"]"}var dC=/0+$/;function rd(e,t){let n=Xs(9,e);return n=t===void 0?n.replace(dC,""):n.slice(0,t),n?"."+n:""}function Bg(e){return e<0?"-":"+"}var mC=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,pC=/[^\w\/:+-]+/;function qg(e){return va(ve(e))}function va(e){return jg(e).id}function jg(e){let t=e.toUpperCase(),n=(i=>{let o=Uc(i,1);if(o!==void 0)return{id:Uo(o),X:o,m:o}})(t);if(n)return{kind:"fixed",...n};let r=t==="UTC"?"UTC":(i=>(pC.test(i)&&v(jl(i)),mC.test(i)&&v("Forbidden ICU TimeZone"),i.toLowerCase().split("/").map((o,s)=>(o.length<=3||/\d/.test(o))&&!/etc|yap/.test(o)?o.toUpperCase():o.replace(/baja|dumont|[a-z]+/g,(a,u)=>a.length<=2&&!s||a==="in"||a==="chat"?a.toUpperCase():a.length>2||!u?Qf(a).replace(/island|noronha|murdo|rivadavia|urville/,Qf):a)).join("/")))(e);return fC(r)}var fC=qr(e=>{if(e==="UTC")return{kind:"utc",id:e,m:e};let t=e.toUpperCase(),n=hC(t);return{kind:"named",id:e,format:n,m:n.resolvedOptions().timeZone}}),hC=qr(e=>new Nt("en-u-hc-h23",{calendar:"iso8601",timeZone:e,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}));function He(e){let t=jg(e);return gC(t.id,t)}var gC=qr((e,t)=>t.kind==="named"?new Bl(e,t.m,t.format):new zl(e,t.m,t.kind==="fixed"?t.X:0)),zl=class{constructor(t,n,r){this.id=t,this.m=n,this.X=r}B(){return this.X}N(t){return[xc(t,this.X)]}O(){}},Bl=class{constructor(t,n,r){this.id=t,this.m=n,this.ke=((i,o)=>{let s=qr(i),a=qr(yC),u=86400*o;function l(c){let[m,p]=ah(c,u),f=Ks(m),x=Ks(p),S=s(f),w=s(x);return S===w?S:d(a(f,x),S,w,c)}function d(c,m,p,f){let x,S;for(;(f===void 0||(x=f<c[0]?m:f>=c[1]?p:void 0)===void 0)&&(S=c[1]-c[0]);){let w=c[0]+Math.floor(S/2);i(w)===p?c[1]=w:c[0]=w+1}return x}return{xe(c){let m=l(c-86400),p=l(c+86400),f=c-m,x=c-p;if(m===p)return[f];let S=l(f);return S===l(x)?[c-S]:m>p?[f,x]:[]},we:l,O:function c(m,p){if(p>0&&m>=864e10)return;if(p<0){if(m<=Ol)return;let M=sh()+94867200;if(m>M)return c(M,-1)}let f=p>0?Math.max(m,Ol):m,[x,S]=ah(f,u),w=u*p,D=p>0?Math.max(m,sh())+94867200:Ol,T=()=>p<0?S>D:x<D;for(;T();){let M=Ks(x),O=Ks(S),b=s(M),C=s(O);if(b!==C){let N=a(M,O);d(N,b,C);let E=N[0];if((Jt(E,m)||1)===p)return E}x+=w,S+=w}}}})((i=>o=>{let s=sC(i,1e3*o);return 86400*po((a=>{let u=a.relatedYear;if(u!==void 0)return parseInt(u);let l=parseInt(a.year);return a.era!==void 0&&kh(a.era)==="bce"?1-l:l})(s),parseInt(s.month),parseInt(s.day))+3600*parseInt(s.hour)+60*parseInt(s.minute)+parseInt(s.second)-o})(r),(i=>{let o=i.split("/").pop();return aC[o]||60})(t))}B(t){return this.ke.we((n=>eh(n)[0])(t))*_n}N(t){let n=86400*vt(t)+tc(t),r=Rh(t);return this.ke.xe(n).map(i=>xt(BigInt(i)*or+BigInt(r)))}O(t,n){let[r,i]=eh(t),o=this.ke.O(r+(n>0||i?1:0),n);if(o!==void 0)return BigInt(o)*or}};function sh(){return Math.floor(Date.now()/1e3)}function yC(e,t){return[e,t]}function ah(e,t){let n=Math.floor(e/t)*t;return[n,n+t]}function Ks(e){return Hl(e,-1e10,864e10)}function Hg(e,t,n){let r=pe(n,Ue(t,Mh,Nh),qc,[],0);if(r.timeZone!==void 0){let i=yo(t,r),o=Fo(r),s=He(e(r.timeZone));return{epochNanoseconds:ei(s,ie(i,o),r.offset),timeZone:s,calendar:t}}return yo(t,r)}function Wg(e,t,n,r){let i=pe(n,Ue(t,Mh,Nh),qc,Ql,0),o=e(i.timeZone),[s,a,u,l]=Oa(t,i,()=>Hr(r)),d=Fo(i,a),c=He(o);return bt(ei(c,ie(s,d),i.offset,u,l),c,t)}function Gg(e,t,n){let r=pe(t,Ue(e,Dh,vh),Bc,[],0),[i,o]=Oa(e,r,()=>[X(n)]);return $o(i,Fo(r,o),e)}function Vg(e,t,n,r=[]){return yo(e,pe(t,Ue(e,mr,pr),at,r),n)}function Yg(e,t,n,r){return Hc(e,pe(t,Ue(e,Io,Ah),at,r),n)}function Zg(e,t,n,r){let i=pe(n,Ue(e,mr,pr),at,dr,0);return t&&i.month!==void 0&&i.monthCode===void 0&&i.year===void 0&&(i.year=1972),Wc(e,i,r)}function Kg(e,t){return Fo(pe(e,Rl,zc,[],1),X(t))}function Jg(e){let t=pe(e,Vh,Mg);return Se(vn({...we,...t}))}function gt(e){v(hh(e))}function Xg(e){let t=Mn(e=mc(e)),n;return t||gt(e),t.C?n=0:t.offset?n=_a(t.offset):gt(e),t.timeZoneId&&Uc(t.timeZoneId,1),vo(t),st(xc(t,n))}function Qg(e,t){let n=Mn(ve(e));return n||gt(e),n.timeZoneId?ly(n,t,void 0):(n.C&>(e),ql(n,t))}function ey(e,t,n){let r=Mn(ve(e));return r&&r.timeZoneId||gt(e),ly(r,t,n)}function ty(e,t){let n=Mn(ve(e));return n&&!n.C||gt(e),cy(n,t)}function ny(e,t){let n=sd(od(ve(e)),void 0,t);return ue(n,n.calendar)}function ry(e,t){let n=ad(ve(e));if(n)return id(n),ue(ya(tn(n)),t(n.calendarId));let r=sd(od(e),wC,t),{calendar:i}=r;return ue(go(i,r),i)}function id(e){e.calendarId!=="iso8601"&&v(Kt(e.calendarId))}function iy(e,t){let n=ud(ve(e));if(n)return id(n),ue(tn(n),t(n.calendarId));let r=sd(od(e),xC,t),{calendar:i}=r,{year:o,month:s,day:a}=ae(i,r),[u,l]=sr(i,o,s),{year:d,month:c}=((m,p,f,x)=>{let S=m?m.u(p,f,x):Pl(p,f);return S||v("Cannot guess year"),S})(i,u,l,a);return ue(Be(ar(i,d,c,a)),i)}function oy(e){let t=(r=>{let i=dy(r);return i?(zo(i[13]),my(i,1)):void 0})(e=ve(e));if(!t){let r=Mn(e);r&&r.re||gt(e),r.C&&v(Kt("Z")),id(r),t=r}let n;return(n=ad(e))&&th(n)&>(e),(n=ud(e))&&th(n)&>(e),hr(_o(t))}function sy(e){let t=IC.exec(ve(e));return t||gt(e),Se(vn((n=>{let r=0,i=0,o=0,s={years:a(n[2]),months:a(n[3]),weeks:a(n[4]),days:a(n[5]),hours:a(n[6],n[7],5),minutes:a(n[8],n[9],4),seconds:a(n[10],n[11],3),...Nc(o,2,ce)};return r||v(uh(ce)),Vl(n[1])<0&&(s=Me(s)),s;function a(u,l,d){let c=0,m=0;return d&&([c,o]=_t(o,wt[d])),u!==void 0&&(i&&v(Kt(u)),m=(p=>{let f=parseInt(p);return Number.isFinite(f)||v(Kt(p)),f})(u),r=1,l&&(o=Gl(l)*(wt[d]/_n),i=1)),c+m}})(t)))}function ay(e){let t=Mn(e)||ad(e)||ud(e);if(t)return t.calendarId;let n=dy(e);return n?zo(n[13]).calendarId:e}function uy(e){let t=Mn(e);return t&&(t.timeZoneId||t.C&&"UTC"||t.offset)||e}function od(e){let t=Mn(e);return t&&!t.C||gt(e),t}function sd(e,t,n){return t&&e.calendarId==="iso8601"?(tn(e),e.re&&_o(e),ql(t(e),n)):e.re?cy(e,n):ql(e,n)}function wC(e){let t=12*e.year+e.month===ng?20:1;return{...e,day:t}}function xC(e){return{...e,year:1972}}function ly(e,t,n){let r=He(va(e.timeZoneId)),i;if(vo(e),e.re){let s=e.offset?_a(e.offset):void 0,[,a,u]=Hr(n);i=ei(r,e,s,a,u,!(r.X||e.offset===void 0||(o=e.offset,o.replace(/\D/g,"").length>4)),e.C)}else Hr(n),i=Cn(r,e);var o;return xt(i),bt(i,r,t(e.calendarId))}function cy(e,t){return vo(e),fr(e),{...ie(e,e),calendar:t(e.calendarId)}}function ql(e,t){return tn(e),Be(e),{calendar:t(e.calendarId),year:e.year,month:e.month,day:e.day}}function na(e){return`(\\d{2})(?:(:?)(\\d{2})(?:\\${e}(\\d{2})(?:[.,](\\d{1,9}))?)?)?`}var bC="(?:(?:([+-])(\\d{6}))|(\\d{4}))(-?)(\\d{2})\\4(\\d{2})(?:[T ]"+na(8)+"(Z|([+-])"+na(15)+")?)?",kC=Gr("(?:(?:([+-])(\\d{6}))|(\\d{4}))-?(\\d{2})((?:\\[(!?)([^\\]]*)\\]){0,9})"),SC=Gr("(?:--)?(\\d{2})-?(\\d{2})((?:\\[(!?)([^\\]]*)\\]){0,9})"),TC=Gr(bC+"((?:\\[(!?)([^\\]]*)\\]){0,9})"),CC=Gr("T?"+na(2)+`(([+-])${na(9)})?((?:\\[(!?)([^\\]]*)\\]){0,9})`),EC=new RegExp("\\[(!?)([^\\]]*)\\]","g"),IC=Gr("([+-])?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?!$)(?:(\\d+)(?:[.,](\\d{1,9}))?H)?(?:(\\d+)(?:[.,](\\d{1,9}))?M)?(?:(\\d+)(?:[.,](\\d{1,9}))?S)?)?");function Mn(e){let t=TC.exec(e);return t?(n=>{let r=n[12],i=(r||"").toUpperCase()==="Z";return{year:py(n),month:parseInt(n[5]),day:parseInt(n[6]),...my(n,7),...zo(n[19]),re:!!n[7],C:i,offset:i?void 0:r}})(t):void 0}function ad(e){let t=kC.exec(e);if(t)return(n=>({year:py(n),month:parseInt(n[4]),day:1,...zo(n[5])}))(t)}function ud(e){let t=SC.exec(e);return t?(n=>({year:1972,month:parseInt(n[1]),day:parseInt(n[2]),...zo(n[3])}))(t):void 0}function dy(e){let t=CC.exec(e);if(t)return t[6]&&_a(t[6]),t}function my(e,t){let n=zr(e[t+3]);return{...nc(Gl(e[t+4]||""))[0],hour:zr(e[t]),minute:zr(e[t+2]),second:n===60?59:n}}function py(e){let t=Vl(e[1]),n=parseInt(e[2]||e[3]);return t<0&&!n&&v(Kt(-0)),t*n}function zo(e){let t,n,r=[];return e.replace(EC,(i,o,s)=>{let a=!!o,[u,l]=s.split("=").reverse();return l?l==="u-ca"?(r.push(u.toLowerCase()),t||(t=a)):(a||/[A-Z]/.test(l))&&v(Kt(i)):(n&&v(Kt(i)),n=u),""}),r.length>1&&t&&v(Kt(e)),{timeZoneId:n,calendarId:r[0]||"iso8601"}}function ii(e,t,n){let r=Object.assign(Object.create(null),t);return Dl(r,n,Ih),ri(e)&&(Dl(r,n,h1),e&&e.ge&&Dl(r,n,g1,Zr)),r}function Dl(e,t,n,r){let i=0,o=[];for(let s of n)t[s]!==void 0?i=1:o.push(s);if(Object.assign(e,t),i)for(let s of r||o)delete e[s]}function fy(e,t,n){let{calendar:r,timeZone:i}=e,o=Ue(r,w1,x1),s=xe(e),{year:a,month:u,day:l}=ae(r,s),d={year:a,monthCode:Bo(r,a,u),day:l,hour:s.hour,minute:s.minute,second:s.second,millisecond:s.millisecond,microsecond:s.microsecond,nanosecond:s.nanosecond,offset:s.offsetNanoseconds},c=pe(t,o,qc),m=ii(r,d,c),p={...d,...c},[f,x,S,w]=Oa(r,m,()=>Hr(n,2));return bt(ei(i,ie(f,ca(p,x)),p.offset,S,w),i,r)}function hy(e,t,n){let{calendar:r}=e,i=Ue(r,Dh,vh),{year:o,month:s,day:a}=ae(r,e),u={year:o,monthCode:Bo(r,o,s),day:a,hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond,microsecond:e.microsecond,nanosecond:e.nanosecond},l=pe(t,i,Bc),d=ii(r,u,l),c={...u,...l},[m,p]=Oa(r,d,()=>[X(n)]);return $o(m,ca(c,p),r)}function gy(e,t,n){let{calendar:r}=e,i=Ue(r,mr,pr),{year:o,month:s,day:a}=ae(r,e);return yo(r,ii(r,{year:o,monthCode:Bo(r,o,s),day:a},pe(t,i,at)),n)}function yy(e,t,n){let{calendar:r}=e,i=Ue(r,Io,Ah),{year:o,month:s}=ae(r,e);return Hc(r,ii(r,{year:o,monthCode:Bo(r,o,s)},pe(t,i,at)),n)}function wy(e,t,n){let{calendar:r}=e,i=Ue(r,mr,pr),{year:o,month:s,day:a}=ae(r,e);return Wc(r,ii(r,{monthCode:Bo(r,o,s),day:a},pe(t,i,at)),n)}function xy(e,t,n){return((r,i,o)=>Fo({...Dt(Rl,r),...pe(i,Rl,zc)},X(o)))(e,t,n)}function by(e,t){return Se((n=e,r=t,vn({...n,...pe(r,Vh,Mg)})));var n,r}function Bo(e,t,n){let[r,i]=sr(e,t,n);return Ch(r,i)}function ky(e,t,n){return bt(e.epochNanoseconds,t,n)}function Sy(e){return st(e.epochNanoseconds)}function ld(e){return Mt(xe(e),e.calendar)}function cd(e){return ue(xe(e),e.calendar)}function dd(e){return hr(xe(e))}function Ty(e,t,n){let r=ti(t,e,(i=>Xh(rt(i)))(n));return bt(xt(r),t,e.calendar)}function Cy(e,t,n,r){let i=e(r.timeZone),o=r.plainTime,s=o!==void 0?t(o):void 0,a=He(i),u;return u=s?ti(a,ie(n,s)):Cn(a,ie(n,ze)),bt(u,a,n.calendar)}function Ey(e,t,n){return Oy(e,Dt(Ue(e,Ao,_h),t),pe(nr(n),dr,at,[]))}function Iy(e,t,n){let r=Ue(e,ua,y1);return Oy(e,Dt(Oh,t),pe(nr(n),r,at,[]))}function Ay(e,t){return Wc(e,pe(t,Oh,at))}function _y(e,t,n){return Hc(e,pe(t,Ue(e,Ao,_h),at),n)}function Oy(e,t,n){let r=Ue(e,b1,k1),i=ii(e,t,n);return i=pe(i,r,at,[]),yo(e,i)}function Dy(e){return st(xt(BigInt(ha(e))*Yr))}function vy(e){return st(xt(fa(e)))}function oi(e){return e.timeZone="UTC",["full","long"].includes(e.timeStyle)&&(e.timeStyle="medium"),e}function My(e,t){return e.timeZone!==void 0&&ne("Cannot specify TimeZone"),e.timeZone=t,e}function si(e,t,n){let r=e.resolvedOptions().calendar;!n&&t.calendar===it||yt(t.calendar)===r||v("Mismatching Calendars")}function wr(e,t,n,r,i){let o=new Set(e),s=new Set(t),a=new Set(n);return(u,l)=>{let d,c,m={},p={},f={},x=0,S=0;for(let E of Object.keys(u)){let y=u[E];y===void 0||a.has(E)||(o.has(E)?E==="dateStyle"?d=y:E==="timeStyle"?c=y:m[E]=y:E==="era"?p[E]=y:s.has(E)?E==="dateStyle"||E==="timeStyle"?S=1:x=1:f[E]=y)}let w=d!==void 0,D=c!==void 0,T=w||D,M=Object.keys(m).length>0,O=x||S,b=M||w||D,C=Object.keys(p).length>0;(!l&&O||l&&O&&!b||T&&(M||C||x))&&ne("Invalid formatting options");let N={};return T||b||Object.assign(N,r),Object.assign(N,m,p,f),w&&(i?Object.assign(N,i[d]):N.dateStyle=d),D&&(N.timeStyle=c),N}}var Ny={year:"numeric",month:"numeric",day:"numeric"},Ry={hour:"numeric",minute:"numeric",second:"numeric"},md=Object.assign({},Ny,Ry),pd=["weekday","year","month","day","dateStyle"],qo=["dayPeriod","hour","minute","second","fractionalSecondDigits","timeStyle"],fd=pd.concat(qo),AC=["weekday","day"].concat(qo),_C=["weekday","year"].concat(qo),Py=wr(fd,[],[],md),Ly=wr(fd,[],[],{...md,timeZoneName:"short"}),Fy=wr(fd,[],["timeZoneName"],md),$y=wr(pd,qo,["timeZoneName"],Ny),Uy=wr(qo,pd,["timeZoneName","era"],Ry),zy=wr(["year","month","dateStyle"],AC,["timeZoneName"],{year:"numeric",month:"numeric"},{full:{year:"numeric",month:"long"},long:{year:"numeric",month:"long"},medium:{year:"numeric",month:"short"},short:{year:"2-digit",month:"numeric"}}),By=wr(["month","day","dateStyle"],_C,["timeZoneName","era"],{month:"numeric",day:"numeric"},{full:{month:"long",day:"numeric"},long:{month:"long",day:"numeric"},medium:{month:"short",day:"numeric"},short:{month:"numeric",day:"numeric"}});function qy(e,t){let{timeZone:n}=e,r=xe(e),{offsetNanoseconds:i}=r,o=t||ze,s;return s=t?ei(n,ie(r,o),i,2):Cn(n,ie(r,o)),bt(s,n,e.calendar)}function Ma(e){let t=Na(),n=e.B(t);return Do(t+BigInt(n))}function Na(){return BigInt(Date.now())*Yr}function ai(){return new Nt().resolvedOptions().timeZone}var hd="PlainYearMonth",gd="PlainMonthDay",yd="PlainDate",wd="PlainDateTime",xd="PlainTime",bd="ZonedDateTime",kd="Instant",Sd="Duration";function rn(e,t,n,...r){return Object.defineProperties(t,gh(e)),Object.defineProperties(t.prototype,xo("Temporal."+e)),Object.defineProperties(t.prototype,An(i=>({get(){return i(n(this))},configurable:1}),Object.assign({},...r))),t}var on=Wl.name==="noop"?e=>{Object.defineProperty(e,"_str_",{value:e.toJSON()})}:Wl;function sn(){ne(mh)}function an(){ne(dh)}var Hy={era(e){return Mo(e.calendar,e).era},eraYear(e){return Mo(e.calendar,e).eraYear},year(e){return ae(e.calendar,e).year},month(e){return ae(e.calendar,e).month},monthCode(e){return pa(e.calendar,e)}},Ra={era(e){return Mo(e.calendar,e).era},eraYear(e){return Mo(e.calendar,e).eraYear},year(e){return ae(e.calendar,e).year},month(e){return ae(e.calendar,e).month},monthCode(e){return pa(e.calendar,e)},day(e){return ae(e.calendar,e).day}},Wy={monthCode(e){return pa(e.calendar,e)},day(e){return ae(e.calendar,e).day}},Td={daysInMonth(e){return oc(e.calendar,e)},daysInYear(e){return sc(e.calendar,e)},monthsInYear(e){return ic(e.calendar,e)},inLeapYear(e){return rc(e.calendar,e)}},jo={dayOfWeek(e){return ma(e)},dayOfYear(e){return Hh(e.calendar,e)},weekOfYear(e){return Wh(e.calendar,e)},yearOfWeek(e){return Gh(e.calendar,e)},daysInWeek(){return 7},daysInMonth(e){return oc(e.calendar,e)},daysInYear(e){return sc(e.calendar,e)},monthsInYear(e){return ic(e.calendar,e)},inLeapYear(e){return rc(e.calendar,e)}};function jy(e){return sa(Object.keys(e))}jy(Td),jy(jo);function Ln(e){let t=ve(e).toLowerCase();return t===Kl?it:t===bh?Sh:void v(fh(e,"temporal-polyfill/full"))}function Go(e=Kl){return Ln(e)}var Vy=new WeakMap,Yy=rn(bd,class{constructor(e,t,n=void 0){let r=xt(fa(e)),i=He(qg(t)),o=Go(n);Zy(this,bt(r,i,o))}static from(e,t=void 0){return We(ui(e,t))}static compare(e,t){return Lo(ui(e),ui(t))}get calendarId(){return yt(ee(this).calendar)}get timeZoneId(){return ee(this).timeZone.id}get epochMilliseconds(){return Ro(ee(this))}get epochNanoseconds(){return bc(ee(this))}get offset(){return Uo(xe(ee(this)).offsetNanoseconds)}get offsetNanoseconds(){return xe(ee(this)).offsetNanoseconds}get hoursInDay(){return ag(ee(this))}with(e,t=void 0){return We(fy(ee(this),pi(e),t))}withCalendar(e){return We({...ee(this),calendar:Fa(e)})}withTimeZone(e){return We({...ee(this),timeZone:He(ct(e))})}withPlainTime(e=void 0){return We(qy(ee(this),Ad(e)))}add(e,t=void 0){let n=ee(this);return We(ur(n,Ae(e),t))}subtract(e,t=void 0){let n=ee(this);return We(ur(n,Me(Ae(e)),t))}until(e,t=void 0){let n=ee(this),r=ui(e),i=nn(n.calendar,r.calendar);return be(Se(Ic(0,i,n,r,t)))}since(e,t=void 0){let n=ee(this),r=ui(e),i=nn(n.calendar,r.calendar);return be(Se(Ic(1,i,n,r,t)))}round(e){let t=ee(this),[n,r,i]=No(e);return We(sg(t,n,r,i))}startOfDay(){return We(ug(ee(this)))}equals(e){return Ig(ee(this),ui(e))}toInstant(){return un(Sy(ee(this)))}toPlainDateTime(){return Rt(ld(ee(this)))}toPlainDate(){return Pt(cd(ee(this)))}toPlainTime(){return Pn(dd(ee(this)))}toLocaleString(e=void 0,t={}){let n=ee(this),r=new Nt(e,My(Ly(t),mg(n)));return si(r,n),r.format(Ro(n))}toString(e=void 0){return Zc(ee(this),e)}toJSON(){return Zc(ee(this))}getTimeZoneTransition(e){let t=ee(this),n=cg(t,e);return n?We({...t,epochNanoseconds:n}):null}valueOf(){return an()}},OC,Ra,jo,Eo);function We(e){return Zy(Object.create(Yy.prototype),e)}function ee(e){return Lt(e)||sn()}function OC(e){let t=ee(e);return{...xe(t),calendar:t.calendar}}function Lt(e){return Vy.get(e)}function ui(e,t){if(qe(e)){let n=Lt(e);if(n)return Hr(t),n;let r=Vo(e);return Wg(ct,r,e,t)}return ey(e,Ln,t)}function Zy(e,t){return Vy.set(e,t),on(e),e}function ct(e){if(qe(e)){let t=Lt(e);return t||ne(jl(e)),t.timeZone.id}return(t=>va(uy(ve(t))))(e)}var Ky=new WeakMap,Jy=rn(kd,class{constructor(e){let t=xt(fa(e));Qy(this,st(t))}static from(e){return un(li(e))}static fromEpochMilliseconds(e){return un(Dy(e))}static fromEpochNanoseconds(e){return un(vy(e))}static compare(e,t){return Lo(li(e),li(t))}get epochMilliseconds(){return Ro(ut(this))}get epochNanoseconds(){return bc(ut(this))}add(e){let t=ut(this);return un(st(Cc(t.epochNanoseconds,Ae(e))))}subtract(e){let t=ut(this);return un(st(Cc(t.epochNanoseconds,Me(Ae(e)))))}until(e,t=void 0){return be(Ec(0,ut(this),li(e),t))}since(e,t=void 0){return be(Ec(1,ut(this),li(e),t))}round(e){let t=ut(this),[n,r,i]=No(e,5,1);return un(st(Sa(t.epochNanoseconds,Po(n,r),i)))}equals(e){return Eg(ut(this),li(e))}toZonedDateTimeISO(e){return We(ky(ut(this),He(ct(e))))}toLocaleString(e=void 0,t={}){let n=ut(this);return new Nt(e,Py(t)).format(Ro(n))}toString(e=void 0){return Yc(ct,ut(this),e)}toJSON(){return Yc(ct,ut(this))}valueOf(){return an()}});function un(e){return Qy(Object.create(Jy.prototype),e)}function ut(e){return Ed(e)||sn()}function Ed(e){return Ky.get(e)}function li(e){if(qe(e)){let t=Ed(e);if(t)return t;let n=Lt(e);if(n)return st(n.epochNanoseconds)}return Xg(e)}var{toTemporalInstant:Xy}={toTemporalInstant(){let e=Date.prototype.valueOf.call(this);return un(st(BigInt(cc(e))*Yr))}};function Qy(e,t){return Ky.set(e,t),on(e),e}var ew=new WeakMap,tw=rn(gd,class{constructor(e,t,n=void 0,r){let i=Ee(e),o=Ee(t),s=Go(n),a=Ee(r??$h),u=Be(tn({year:a,month:i,day:o}));nw(this,ue(u,s))}static from(e,t=void 0){return Cd(Gy(e,t))}get calendarId(){return yt(Nn(this).calendar)}with(e,t=void 0){return Cd(wy(Nn(this),pi(e),t))}equals(e){return Dg(Nn(this),Gy(e))}toPlainDate(e){let t=Nn(this);return Pt(Iy(t.calendar,this,e))}toLocaleString(e=void 0,t={}){let n=Nn(this),r=new Nt(e,oi(By(t)));return si(r,n,1),r.format(Oo(n))}toString(e=void 0){return Qc(Nn(this),e)}toJSON(){return Qc(Nn(this))}valueOf(){return an()}},Nn,Wy);function Cd(e){return nw(Object.create(tw.prototype),e)}function Nn(e){return Pa(e)||sn()}function Pa(e){return ew.get(e)}function Gy(e,t){if(qe(e)){let r=Pa(e);if(r)return X(t),r;let i=hw(e);return Zg(i===void 0?it:i,i===void 0,e,t)}let n=iy(e,Ln);return X(t),n}function nw(e,t){return ew.set(e,t),on(e),e}var rw=new WeakMap,iw=rn(hd,class{constructor(e,t,n=void 0,r){let i=Ee(e),o=Ee(t),s=Go(n),a=Ee(r??1),u=ya(tn({year:i,month:o,day:a}));ow(this,ue(u,s))}static from(e,t=void 0){return Wo(ci(e,t))}static compare(e,t){return yr(ci(e),ci(t))}get calendarId(){return yt(lt(this).calendar)}with(e,t=void 0){return Wo(yy(lt(this),pi(e),t))}add(e,t=void 0){let n=lt(this);return Wo(ue(Tc(0,n.calendar,n,Ae(e),t),n.calendar))}subtract(e,t=void 0){let n=lt(this);return Wo(ue(Tc(1,n.calendar,n,Ae(e),t),n.calendar))}until(e,t=void 0){let n=lt(this),r=ci(e),i=nn(n.calendar,r.calendar);return be(Oc(0,i,n,r,t))}since(e,t=void 0){let n=lt(this),r=ci(e),i=nn(n.calendar,r.calendar);return be(Oc(1,i,n,r,t))}equals(e){return Og(lt(this),ci(e))}toPlainDate(e){let t=lt(this);return Pt(Ey(t.calendar,this,e))}toLocaleString(e=void 0,t={}){let n=lt(this),r=new Nt(e,oi(zy(t)));return si(r,n,1),r.format(Oo(n))}toString(e=void 0){return Xc(lt(this),e)}toJSON(){return Xc(lt(this))}valueOf(){return an()}},lt,Hy,Td);function Wo(e){return ow(Object.create(iw.prototype),e)}function lt(e){return La(e)||sn()}function La(e){return rw.get(e)}function ci(e,t){if(qe(e)){let r=La(e);if(r)return X(t),r;let i=Vo(e);return Yg(i,e,t)}let n=ry(e,Ln);return X(t),n}function ow(e,t){return rw.set(e,t),on(e),e}function DC(e){if(!qe(e))return;let t=Ed(e);return t?[kd,t]:(t=Lt(e),t?[bd,t]:(t=xr(e),t?[wd,t]:(t=fi(e),t?[yd,t]:(t=Id(e),t?[xd,t]:(t=La(e),t?[hd,t]:(t=Pa(e),t?[gd,t]:(t=_d(e),t?[Sd,t]:void 0)))))))}function pi(e){return(DC(e)||e.calendar!==void 0||e.timeZone!==void 0)&&ne(lh),e}var sw=new WeakMap,aw=rn(xd,class{constructor(e=0,t=0,n=0,r=0,i=0,o=0){let s=_o(An(Ee,{hour:e,minute:t,second:n,millisecond:r,microsecond:i,nanosecond:o}));uw(this,hr(s))}static from(e,t=void 0){return Pn(Rn(e,t))}static compare(e,t){return Aa(Rn(e),Rn(t))}with(e,t=void 0){return Pn(xy(kt(this),pi(e),t))}add(e){let t=kt(this);return Pn(Ta(t,Ae(e))[0])}subtract(e){let t=kt(this);return Pn(Ta(t,Me(Ae(e)))[0])}until(e,t=void 0){return be(Dc(0,kt(this),Rn(e),t))}since(e,t=void 0){return be(Dc(1,kt(this),Rn(e),t))}round(e){let t=kt(this),[n,r,i]=No(e,5);return Pn(xa(t,Qr(n,r),i)[0])}equals(e){return vg(kt(this),Rn(e))}toLocaleString(e=void 0,t={}){let n=kt(this);return new Nt(e,oi(Uy(t))).format(ec(n))}toString(e=void 0){return ed(kt(this),e)}toJSON(){return ed(kt(this))}valueOf(){return an()}},kt,Eo);function Pn(e){return uw(Object.create(aw.prototype),e)}function kt(e){return Id(e)||sn()}function Id(e){return sw.get(e)}function Rn(e,t){if(qe(e)){let r=Id(e);if(r)return X(t),r;let i=xr(e);if(i)return X(t),hr(i);let o=Lt(e);return o?(X(t),dd(o)):Kg(e,t)}let n=oy(e);return X(t),n}function Ad(e){return e===void 0?void 0:Rn(e)}function uw(e,t){return sw.set(e,t),on(e),e}var lw=new WeakMap,cw=rn(wd,class{constructor(e,t,n,r=0,i=0,o=0,s=0,a=0,u=0,l=void 0){let d=fr(vo(An(Ee,{year:e,month:t,day:n,hour:r,minute:i,second:o,millisecond:s,microsecond:a,nanosecond:u}))),c=Go(l);dw(this,Mt(d,c))}static from(e,t=void 0){return Rt(di(e,t))}static compare(e,t){let n=di(e),r=di(t);return Fc(n,r)}get calendarId(){return yt(Ie(this).calendar)}with(e,t=void 0){return Rt(hy(Ie(this),pi(e),t))}withCalendar(e){let t=Ie(this);return Rt(Mt(t,Fa(e)))}withPlainTime(e=void 0){let t=Ie(this);return Rt($o(t,Ad(e),t.calendar))}add(e,t=void 0){let n=Ie(this);return Rt(Mt(lr(n.calendar,n,Ae(e),t),n.calendar))}subtract(e,t=void 0){let n=Ie(this);return Rt(Mt(lr(n.calendar,n,Me(Ae(e)),t),n.calendar))}until(e,t=void 0){let n=Ie(this),r=di(e),i=nn(n.calendar,r.calendar);return be(Ac(0,i,n,r,t))}since(e,t=void 0){let n=Ie(this),r=di(e),i=nn(n.calendar,r.calendar);return be(Ac(1,i,n,r,t))}round(e){let t=Ie(this),[n,r,i]=No(e);return Rt(Mt(wa(t,Qr(n,r),i),t.calendar))}equals(e){return Ag(Ie(this),di(e))}toZonedDateTime(e,t=void 0){return We(Ty(Ie(this),He(ct(e)),t))}toPlainDate(){let e=Ie(this);return Pt(ue(e,e.calendar))}toPlainTime(){return Pn(hr(Ie(this)))}toLocaleString(e=void 0,t={}){let n=Ie(this),r=new Nt(e,oi(Fy(t)));return si(r,n),r.format(Lh(n))}toString(e=void 0){return Kc(Ie(this),e)}toJSON(){return Kc(Ie(this))}valueOf(){return an()}},Ie,Ra,jo,Eo);function Rt(e){return dw(Object.create(cw.prototype),e)}function Ie(e){return xr(e)||sn()}function xr(e){return lw.get(e)}function di(e,t){if(qe(e)){let r=xr(e);if(r)return X(t),r;let i=fi(e);if(i)return X(t),Mt(ie(i,ze),i.calendar);let o=Lt(e);if(o)return X(t),ld(o);let s=Vo(e);return Gg(s,e,t)}let n=ty(e,Ln);return X(t),n}function dw(e,t){return lw.set(e,t),on(e),e}var mw=new WeakMap,pw=rn(yd,class{constructor(e,t,n,r=void 0){let i=Be(tn(An(Ee,{year:e,month:t,day:n}))),o=Go(r);fw(this,ue(i,o))}static from(e,t=void 0){return Pt(mi(e,t))}static compare(e,t){return yr(mi(e),mi(t))}get calendarId(){return yt(Ne(this).calendar)}with(e,t=void 0){let n=Ne(this);return Pt(gy(n,pi(e),t))}withCalendar(e){let t=Ne(this);return Pt(ue(t,Fa(e)))}add(e,t=void 0){let n=Ne(this);return Pt(ue(ni(n.calendar,n,Ae(e),t),n.calendar))}subtract(e,t=void 0){let n=Ne(this);return Pt(ue(ni(n.calendar,n,Me(Ae(e)),t),n.calendar))}until(e,t=void 0){let n=Ne(this),r=mi(e),i=nn(n.calendar,r.calendar);return be(_c(0,i,n,r,t))}since(e,t=void 0){let n=Ne(this),r=mi(e),i=nn(n.calendar,r.calendar);return be(_c(1,i,n,r,t))}equals(e){return _g(Ne(this),mi(e))}toZonedDateTime(e){let t=qe(e)?{timeZone:e.timeZone,plainTime:e.plainTime}:{timeZone:e};return We(Cy(ct,Rn,Ne(this),t))}toPlainDateTime(e=void 0){let t=Ne(this);return Rt($o(t,Ad(e),t.calendar))}toPlainYearMonth(){let e=Ne(this);return Wo(_y(e.calendar,this))}toPlainMonthDay(){let e=Ne(this);return Cd(Ay(e.calendar,this))}toLocaleString(e=void 0,t={}){let n=Ne(this),r=new Nt(e,oi($y(t)));return si(r,n),r.format(Oo(n))}toString(e=void 0){return Jc(Ne(this),e)}toJSON(){return Jc(Ne(this))}valueOf(){return an()}},Ne,Ra,jo);function Pt(e){return fw(Object.create(pw.prototype),e)}function Ne(e){return fi(e)||sn()}function fi(e){return mw.get(e)}function mi(e,t){if(qe(e)){let r=fi(e);if(r)return X(t),r;let i=xr(e);if(i)return X(t),ue(i,i.calendar);let o=Lt(e);if(o)return X(t),cd(o);let s=Vo(e);return Vg(s,e,t)}let n=ny(e,Ln);return X(t),n}function fw(e,t){return mw.set(e,t),on(e),e}function Vo(e){let t=hw(e);return t===void 0?it:t}function hw(e){let{calendar:t}=e;if(t!==void 0)return Fa(t)}function Fa(e){if(qe(e)){let t=fi(e)||xr(e)||Lt(e)||Pa(e)||La(e);return t||ne(ph(e)),t.calendar}return(t=>Ln(ay(ve(t))))(e)}var gw=new WeakMap,yw=rn(Sd,class{constructor(e=0,t=0,n=0,r=0,i=0,o=0,s=0,a=0,u=0,l=0){let d=vn(An(ha,{years:e,months:t,weeks:n,days:r,hours:i,minutes:o,seconds:s,milliseconds:a,microseconds:u,nanoseconds:l}));ww(this,Se(d))}static from(e){return be(Ae(e))}static compare(e,t,n=void 0){return Cg(Ho,Ae(e),Ae(t),n)}get sign(){return Xe(this).sign}get blank(){return!Xe(this).sign}with(e){return be(by(Xe(this),e))}negated(){return be(Pc(Xe(this)))}abs(){return be(kg(Xe(this)))}add(e,t=void 0){return be(Rc(Ho,0,Xe(this),Ae(e),t))}subtract(e,t=void 0){return be(Rc(Ho,1,Xe(this),Ae(e),t))}round(e){return be(bg(Ho,Xe(this),e))}total(e){return ig(Ho,Xe(this),e)}toLocaleString(e=void 0,t){let n=Xe(this);return Intl.DurationFormat?new Intl.DurationFormat(e,t).format(n):Da(n,t)}toString(e=void 0){return Da(Xe(this),e)}toJSON(){return Da(Xe(this))}valueOf(){return an()}},Xe,ac);function be(e){return ww(Object.create(yw.prototype),e)}function Xe(e){return _d(e)||sn()}function _d(e){return gw.get(e)}function Ae(e){return qe(e)?_d(e)||Jg(e):sy(e)}function Ho(e){if(e!==void 0){if(qe(e)){let t=Lt(e);if(t)return t;let n=fi(e);if(n)return n;let r=xr(e);if(r)return ue(r,r.calendar);let i=Vo(e);return Hg(ct,i,e)}return Qg(e,Ln)}}function ww(e,t){return gw.set(e,t),on(e),e}var vC=Object.defineProperties({},{...xo("Temporal.Now"),...oa({timeZoneId(){return ai()},instant(){return un(st(Na()))},zonedDateTimeISO(e=ai()){let t=He(ct(e));return We(bt(Na(),t))},plainDateTimeISO(e=ai()){let t=Ma(He(ct(e)));return Rt(Mt(t))},plainDateISO(e=ai()){let t=Ma(He(ct(e)));return Pt(ue(t))},plainTimeISO(e=ai()){let t=Ma(He(ct(e)));return Pn(hr(t))}})}),xw=Object.defineProperties({},{...xo("Temporal"),...oa({PlainYearMonth:iw,PlainMonthDay:tw,PlainDate:pw,PlainTime:aw,PlainDateTime:cw,ZonedDateTime:Yy,Instant:Jy,Duration:yw,Now:vC})});var Yo=kl||xw;var sL=kl?Date.prototype.toTemporalInstant:Xy;var MC=120,Od=365*24*60*60*1e3;var bw=/^[\s,.;:!?()[\]{}]*$/u;function _e(e){return{ok:!1,reason:e}}function NC(e){let t=e.now instanceof Date?e.now.getTime():Number.NaN;if(!Number.isFinite(t))return _e("invalid_reference_time");let n=typeof e.timeZone=="string"?e.timeZone.trim():"";if(n.length===0)return _e("invalid_time_zone");try{new Intl.DateTimeFormat("en-US",{timeZone:n}).format(e.now);let r=Yo.Instant.fromEpochMilliseconds(t),i=r.toZonedDateTimeISO(n);return{nowMs:t,timeZone:n,nowInstant:r,nowZoned:i}}catch{return _e("invalid_time_zone")}}function RC(e){return"ok"in e&&e.ok===!1}function br(e,t=2){return String(e).padStart(t,"0")}function PC(e){return[`${br(e.year,4)}-${br(e.month)}-${br(e.day)}`,`${br(e.hour)}:${br(e.minute)}:${br(e.second)}.${br(e.millisecond,3)}`].join("T")}function LC(e){let t=Number(e.instant.epochMilliseconds);if(t<=e.context.nowMs)return _e("time_in_past");if(t-e.context.nowMs>Od)return _e("time_too_far");let n=e.instant.toZonedDateTimeISO(e.context.timeZone);return{ok:!0,schedule:{returnAt:new Date(t).toISOString(),timeZone:e.context.timeZone,localDateTime:PC(n),source:e.source,...e.preset?{preset:e.preset}:{},...e.matchedText?{matchedText:e.matchedText}:{}}}}function FC(e,t,n){let r=e.slice(0,t),i=e.slice(t+n.length);return bw.test(r)&&bw.test(i)}function Ft(e,t){let n=e.get(t);if(n==null)throw new RangeError(`Missing parsed ${t}`);return n}function $C(e,t){let n;try{n=Yo.PlainDateTime.from({year:Ft(e.start,"year"),month:Ft(e.start,"month"),day:Ft(e.start,"day"),hour:Ft(e.start,"hour"),minute:Ft(e.start,"minute"),second:Ft(e.start,"second"),millisecond:Ft(e.start,"millisecond")},{overflow:"reject"})}catch{return null}try{return n.toZonedDateTime(t.timeZone,{disambiguation:"reject"}).toInstant()}catch{return null}}function UC(e,t){let n=Ft(e.start,"year"),r=Ft(e.start,"month"),i=Ft(e.start,"day"),o=n===t.nowZoned.year&&r===t.nowZoned.month&&i===t.nowZoned.day;if(o&&t.nowZoned.hour>=23)return"no_time_left_today";let s=o?t.nowZoned.hour+1:t.nowZoned.hour,a=o?0:t.nowZoned.minute;try{return Yo.PlainDateTime.from({year:n,month:r,day:i,hour:s,minute:a,second:0,millisecond:0},{overflow:"reject"}).toZonedDateTime(t.timeZone,{disambiguation:"reject"}).toInstant()}catch{return null}}function zC(e,t){let n=Number(t.nowZoned.offsetNanoseconds)/6e10;return Gs.casual.parse(e,{instant:new Date(t.nowMs),timezone:n},{forwardDate:!0})}function kw(e,t){let n=typeof e=="string"?e.trim():"";if(n.length===0)return _e("empty");if(n.length>MC)return _e("input_too_long");let r=NC(t);if(RC(r))return r;let i=zC(n,r);if(i.length===0)return _e("not_recognized");if(i.length>1)return _e("multiple_results");let o=i[0];if(o.end)return _e("range_not_supported");if(!FC(n,o.index,o.text))return _e("partial_match");let s=o.tags(),a=s.has("result/relativeDateAndTime"),u=s.has("result/relativeDate"),l=s.has("parser/ENCasualTimeParser"),d=!o.start.isCertain("hour")&&!l&&!u&&!a;if(o.start.isCertain("timezoneOffset")&&!a)return _e("explicit_time_zone_not_supported");if(o.start.isCertain("hour")&&!o.start.isCertain("meridiem")&&!l&&!u&&!a)return _e("meridiem_required");let c;if(d){let m=UC(o,r);if(m==="no_time_left_today")return _e("no_time_left_today");if(!m)return _e("clock_change_time");c=m}else if(a){let m=o.date();if(!Number.isFinite(m.getTime()))return _e("not_recognized");c=Yo.Instant.fromEpochMilliseconds(m.getTime())}else{let m=$C(o,r);if(!m)return _e("clock_change_time");c=m}return LC({instant:c,context:r,source:"natural_language",matchedText:o.text})}var jC=[{name:"read",description:"Mark messages read.",done:"Marked {n} read"},{name:"unread",description:"Mark messages unread.",done:"Marked {n} unread"},{name:"archive",description:"Archive messages.",done:"Archived {n}"},{name:"unarchive",description:"Move messages out of the archive.",done:"Unarchived {n}"},{name:"trash",description:"Move messages to the trash.",done:"Moved {n} to the trash",unchanged:"already in the trash"}],Sw=["all","archive","snoozed"];function Ew(e,t){let{display:n}=t,r=kr(e,"messages","Read, search, and organize messages.").example("ripple messages","ripple messages --unread","ripple messages search invoice","ripple messages archive msg_06gp035p55zrz46e msg_06gjy0yyqzns5kta","ripple messages image img_06gh9kxn7m5q0ynq"),i=r.command("list").description("List messages, most recently updated first, or with --in snoozed, soonest to return. Plain `ripple messages` does the same.").summary("List messages").addOption(Ze("--in <view>","Where to look; all, the default, leaves out archived and snoozed messages",Sw)).addOption(de("-s, --source <source>","Only this source's messages, by name or ID"));for(let a of hu())i.addOption(a);i.addOption(qn("messages",Ii)).addOption(jn()).addOption(Hn()).example("ripple messages list --in snoozed","ripple messages list --source inbox --unread","ripple messages list --source Deploys --in archive --all").action(async a=>{let[u]=await Gt(t,a.source)??[],l=gu(a),d=mn(a,c=>H("GET","/v1/messages",{query:{in:a.in,sourceId:u,unread:l?.toString(),...c}}));await t.runEach(d,c=>Ci(n,c.flatMap(m=>m.items).map(m=>Dd(m,n)),HC(a.in,l),[cs(c)]))}),r.command("watch").description("Show each new message as it arrives, until you stop it with Control-C. If the connection drops, it reconnects and catches up.").summary("Show new messages as they arrive").addOption(de("-s, --source <source>","Only this source's messages, by name or ID")).example("ripple messages watch","ripple messages watch --source inbox",`ripple messages watch --json | jq --unbuffered -r 'select(.alert == "important") | .title'`).action(async a=>{let[u]=await Gt(t,a.source)??[];t.hint("Watching for new messages. Press Control-C to stop.");let l=0;await t.watch(H("GET","/v1/messages/stream",{query:{sourceId:u}}),({event:d,data:c})=>{d==="message"&&t.print(JSON.parse(c),({images:m,...p})=>{let f=m?.length?{imageId:m[0].id,count:m.length}:void 0;return`${l++?`
|
|
68
|
+
`:""}${Dd({...p,preview:p.body??"",imagePreview:f},n)}
|
|
69
|
+
`})})}),r.command("get").description("Show a message in full.").argument("<id>").action(async a=>{await t.run(Tw(a),({message:u})=>Md(u,n))}),r.command("image").description("Save one of a message's images as a WebP file. `ripple messages get` lists a message's image IDs.").summary("Save a message's image").argument("<id>","The image's ID").addOption(de("-o, --output <file>","Where to save it; without it, ripple-<last 8 characters of the ID>.webp (or -thumbnail.webp) in this folder, never replacing a file")).option("--thumbnail","Save the 256-pixel square lists show instead").example("ripple messages image img_06gh9kxn7m5q0ynq","ripple messages image img_06gh9kxn7m5q0ynq -o porch.webp --thumbnail").action(async(a,u)=>{let l=u.thumbnail?"thumbnail":"display",d=await t.call(H("GET","/v1/message-images/{imageId}/{variant}",{params:{imageId:a,variant:l},file:!0})),c=u.output??Cm(a,l);try{await BC(qC.resolve(t.env.INIT_CWD??process.cwd(),c),d,{flag:u.output?"w":"wx"})}catch(m){throw m.code==="EEXIST"?new B(`${c} already exists. Choose another name with --output.`):new B(`Could not save ${c}: ${m instanceof Error?m.message:String(m)}`)}t.print({file:c,bytes:d.byteLength},()=>`Saved to ${c}.
|
|
70
|
+
`)});let o=r.command("search").description("Search your messages. With no words, it lists every message the filters allow, newest first.").summary("Search messages").argument("[words...]").addOption(Ze("--in <view>","Where to look; without it, everywhere except the trash",Sw));for(let a of gs())o.addOption(a);o.example("ripple messages search invoice",'ripple messages search "release notes" --in archive --sort newest',"ripple messages search --source inbox --unread --after 2026-10-01T00:00:00Z").action(async(a,u)=>{let l={...await ys(t,a,u),in:u.in},d=mn(u,c=>H("POST","/v1/messages/search",{body:{...l,...c}}));await t.runEach(d,c=>Rd(n,c,c.flatMap(m=>m.items).map(({message:m,excerpt:p})=>Dd(m,n,vd(p))),a.length?`No messages match "${a.join(" ")}".`:"No messages match these filters."))});for(let a of jC)r.command(a.name).description(a.description).argument("<ids...>",`Message IDs, up to ${Bn}, or - to pipe in any number`).example(`ripple messages ${a.name} msg_06gp035p55zrz46e msg_06gjy0yyqzns5kta`,`ripple messages ${a.name} - < ids.txt`).action(async u=>{let l=await Jm(u,t.input),d=Array.from({length:Math.ceil(l.length/Bn)},(m,p)=>l.slice(p*Bn,(p+1)*Bn)),c=0;try{await t.runEach(m=>(c=m.length,c<d.length?H("POST",`/v1/messages/${a.name}`,{body:{messageIds:d[c]}}):void 0),m=>`${VC(a,new Set(l).size,m)}
|
|
71
|
+
`)}catch(m){let p=d.slice(c+1).flat().length;throw p?new Ht(m,{code:"not_attempted",message:p===1?"The last message ID wasn't sent.":`The last ${p} message IDs weren't sent.`}):m}});r.command("move").description("Move a message to another source. A message in a thread moves with its whole thread.").summary("Move a message or its thread to another source").argument("<id>").addOption(de("-s, --source <source>","The source to move it to, by name or ID").makeOptionMandatory()).example("ripple messages move msg_06gp035p55zrz46e --source Deploys","ripple messages move msg_06gp035p55zrz46e --source inbox").action(async(a,u)=>{let[l]=await Gt(t,u.source),d=H("POST","/v1/messages/move",{body:{moves:[{messageId:a,sourceId:l}]}});await t.run(d,({results:[c]})=>c?c.changed?`Moved to ${c.toSource.name}.
|
|
72
|
+
`:`Already in ${c.toSource.name}.
|
|
61
73
|
`:`Moved.
|
|
62
|
-
`)}),r.command("snooze").description("Hide a message until a set time, when it comes back with an alert. Times are read in your computer's time zone.").summary("Hide a message until later").argument("<id>","The message's ID").argument("<when...>","When it comes back, like 2h, tomorrow 9am or friday at 5pm").addOption(
|
|
63
|
-
`)}),r.command("unsnooze").description("Bring a snoozed message back now.").argument("<id>").action(async a=>{let{message:u}=await t.call(
|
|
74
|
+
`)}),r.command("snooze").description("Hide a message until a set time, when it comes back with an alert. Times are read in your computer's time zone.").summary("Hide a message until later").argument("<id>","The message's ID").argument("<when...>","When it comes back, like 2h, tomorrow 9am, or friday at 5pm").addOption(Ai("How to alert when it comes back; standard unless the message is important")).example("ripple messages snooze msg_06gp035p55zrz46e 2h","ripple messages snooze msg_06gp035p55zrz46e tomorrow 9am --alert quiet","ripple messages snooze msg_06gp035p55zrz46e 2026-10-17T09:00:00-04:00").action(async(a,u,l)=>{let d=WC(u.join(" "),n.timeZone,n.now),c=H("PUT","/v1/messages/{messageId}/snooze",{params:{messageId:a},body:{returnAt:d,timeZone:n.timeZone,alert:l.alert}});await t.run(c,({message:m})=>`Snoozed until ${Wt(m.snooze?.returnAt??d,n)}.
|
|
75
|
+
`)}),r.command("unsnooze").description("Bring a snoozed message back now.").argument("<id>").action(async a=>{let{message:u}=await t.call(Tw(a)),l=H("DELETE","/v1/messages/{messageId}/snooze",{params:{messageId:a},query:{expectedRevision:u.revision}});await t.run(l,()=>u.snooze?`Unsnoozed.
|
|
64
76
|
`:`No change: the message wasn't snoozed.
|
|
65
|
-
`)}),
|
|
77
|
+
`)}),kr(e,"threads","Read a thread's messages.").command("get").description("Show a thread's messages, oldest first.").argument("<id>").addOption(qn("messages")).addOption(jn()).addOption(Hn()).example("ripple threads get thr_06gm53wzxakqgkm4","ripple threads get thr_06gm53wzxakqgkm4 --limit 20","ripple threads get thr_06gm53wzxakqgkm4 --all").action(async(a,u)=>{let l=mn(u,d=>H("GET","/v1/threads/{threadId}",{params:{threadId:a},query:d}));await t.runEach(l,d=>{let[{thread:c,latestMessage:m}]=d;return Nd(n,{...c,source:m.source.name},d.flatMap(p=>p.messages),d.at(-1).nextCursor)})})}function Tw(e){return H("GET","/v1/messages/{messageId}",{params:{messageId:e}})}function HC(e,t){if(t===void 0)return{archive:"Nothing in the archive.",snoozed:"Nothing is snoozed."}[e??""]??"No messages.";let n=t?"unread":"read";return{archive:`No ${n} messages in the archive.`,snoozed:`No ${n} messages are snoozed.`}[e??""]??`No ${n} messages.`}var Cw={time_in_past:"That time has passed.",time_too_far:"Choose a time within one year.",no_time_left_today:"Add a time later today.",meridiem_required:"Add AM or PM, like 9am.",multiple_results:"Choose one date and time.",range_not_supported:"Choose one date and time.",explicit_time_zone_not_supported:"Remove the time zone. Times are read in your computer's time zone.",clock_change_time:"A clock change skips that time. Choose another.",invalid_time_zone:"Your computer's time zone isn't available. Set TZ to one like America/New_York.",input_too_long:"Try a shorter date and time."};function WC(e,t,n){if(pu(e)){let i=Date.parse(e)-n.getTime();if(i<=0||i>Od)throw new B(Cw[i<=0?"time_in_past":"time_too_far"]);return e}let r=kw(e,{now:n,timeZone:t});if(r.ok)return r.schedule.returnAt;throw new B(Cw[r.reason]??`Could not read "${e}" as a time. Try 2h, tomorrow 9am, or friday at 5pm.`)}function GC(e){let t=new Map;for(let r of e){let i="results"in r?r.results:r.messages.map(({messageId:o,thread:s})=>({messageId:o,threadId:s?.id??null}));for(let{messageId:o,threadId:s}of i)t.set(s?`thread:${s}`:o,s?"thread":"message")}let n=[...t.values()].filter(r=>r==="thread").length;return{messages:t.size-n,threads:n}}function VC(e,t,n){let{messages:r,threads:i}=GC(n);if(!r&&!i)return e.unchanged?`No change: ${t===1?"the message was":`all ${t} were`} ${e.unchanged}.`:"No change.";let o=[r&&Pe(r,"message"),i&&Pe(i,"thread")].filter(Boolean).join(" and "),s=`${e.done.replace("{n}",o)}.`,a=e.unchanged&&!i?t-r:0;return a>0?`${s} ${a} ${a===1?"was":"were"} ${e.unchanged}.`:s}function vd(e){return`${e.truncatedStart?"\u2026":""}${e.text}${e.truncatedEnd?"\u2026":""}`}function Iw(e){return e.sourceState==="trash"&&"Source in the trash"}function YC(e){let t=Ym(e.source.name,e.sender);return t&&`via ${t}`}function Dd(e,t,n=e.preview){let r=e.thread?.messageCount??0,i=e.thread?.title??e.title;return Ti(t,{unread:e.readAt===null,title:i??n,detail:i?e.thread&&e.title?[e.title,n].filter(Boolean).join(": "):n:void 0,facts:[e.source.name,Si(e.receivedAt,t),r>1&&`${Pe(r,"message")} in thread`,e.imagePreview&&Pe(e.imagePreview.count,"image"),e.snooze&&`Snoozed until ${Si(e.snooze.returnAt,t)}`,e.archivedAt&&"Archived",Iw(e),e.messageId]})}function Md(e,t,n=[]){let{style:r}=t,i=[e.readAt===null&&"Unread",e.archivedAt&&"Archived",e.snooze&&`Snoozed until ${Wt(e.snooze.returnAt,t)}`,Iw(e)],o=e.title??e.thread?.title,s=cl(o,e.body,e.format);return[...o?[r.bold(o)]:[],r.dim([e.source.name,YC(e),Wt(e.receivedAt,t),...i].filter(Boolean).join(" \xB7 ")),...s?["",s]:[],"",Ir(t,[[e.links?.length===1?"Link":"Links",e.links?.map(({url:a,title:u})=>u?`${u} ${r.dim(a)}`:a).join(`
|
|
78
|
+
`)],["Thread",e.thread&&`${e.thread.title} \xB7 ${Pe(e.thread.messageCount,"message")} \xB7 ${e.thread.id}`],["Alert",e.alert&&St(e.alert)],["Sound",e.sound&&St(e.sound)],["Format",e.format==="markdown"&&"Markdown"],["Images",e.images?.map(({id:a})=>a).join(" ")],["Body images",e.bodyImages?.map(({id:a})=>a).join(" ")],["ID",e.messageId],...n])].join(`
|
|
66
79
|
`)+`
|
|
67
|
-
`}function
|
|
68
|
-
`)});return[o.bold(t.title),o.dim([t.source,
|
|
80
|
+
`}function Nd(e,t,n,r,i=[]){let{style:o}=e,s=u=>u.replace(/^/gm," "),a=[...n].sort((u,l)=>u.messageNumber-l.messageNumber).map(u=>{let l=cl(u.title??t.title,u.body,u.format);return[o.dim([`#${u.messageNumber}`,Wt(u.receivedAt,e),u.title&&!Ni(u.title,t.title)&&u.title,u.sound&&`${St(u.sound)} sound`,u.images?.length&&Pe(u.images.length,"image")].filter(Boolean).join(" \xB7 ")),...l?[s(l)]:[]].join(`
|
|
81
|
+
`)});return[o.bold(t.title),o.dim([t.source,Pe(t.messageCount,"message"),t.id].join(" \xB7 ")),"",a.join(`
|
|
69
82
|
|
|
70
83
|
`),...[r&&`Earlier messages: --cursor ${r}`,...i].filter(Boolean).map(u=>`
|
|
71
84
|
${o.dim(u)}`)].join(`
|
|
72
85
|
`)+`
|
|
73
|
-
`}function
|
|
86
|
+
`}function Rd(e,t,n,r){let[i]=t,o=t.at(-1),s=i.corrections.map(a=>e.style.dim(`Searched for ${ln(a.alternatives,"or")} instead of ${a.original}.`));return(s.length?`${s.join(`
|
|
74
87
|
`)}
|
|
75
88
|
|
|
76
|
-
`:"")+
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
`)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
`)})
|
|
85
|
-
|
|
86
|
-
`)}),r.command("trash").description("Move a source to the trash. Its messages stay unless you add --delete-messages.").summary("Move a source to the trash").argument("<id>").option("--delete-messages","Also move its messages to the trash").action(async(s,a)=>{let u=Y("DELETE","/v1/sources/{sourceId}",{params:{sourceId:s},query:{deleteMessages:a.deleteMessages?"true":void 0}});await t.run(u,l=>`Moved the source to the trash${l.deletedMessageCount?`, with ${je(l.deletedMessageCount,"message")}`:""}. It's deleted for good on ${Ln(l.purgeAt,n)}.
|
|
87
|
-
`)})}function cy(e,t=!1){return Y("POST",t?"/v1/sources/{sourceId}/send-key/reset":"/v1/sources/{sourceId}/send-key",{params:{sourceId:e}})}function dy(e){return`Try it: RIPPLE_KEY=$(ripple sources key ${e}) ripple send "Hello"`}function Yk(e,t){let n=Nd(t,["Name","Status","Unread","ID"],e.map(r=>[r.label,Tt(r.status),String(r.unreadCount),r.sourceId]));return e.some(r=>r.kind==="custom")?n:`${n}
|
|
89
|
+
`:"")+Ci(e,n,r,[o.truncated&&"There are more matches than one search returns. Narrow the search to see the rest.",t.some(a=>a.coverage==="indexing")&&"Search is still catching up, so the newest messages may be missing.",nu(o.nextCursor)])}var ZC=[["icon","clearIcon","iconSymbol"],["iconColor","clearIconColor","iconColor"],["imageUrl","clearImage","imageUrl"],["defaultAlert","clearDefaultAlert","defaultAlert"],["defaultSound","clearDefaultSound","defaultSound"],["defaultLink","clearDefaultLink","defaultLink"]],Aw=e=>`--${e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}`;function _w(){return[de("--icon <name>","An icon from the app's icon picker, such as rocket, or a brand's logo, such as brand:github. A new source gets one that suits its name"),Ze("--icon-color <color>","The icon's color",Vm),de("--image-url <url>","An image to show instead of the icon"),Ze("--default-alert <level>","The alert for messages that don't choose one",ds),Ze("--default-sound <name>","The sound its messages play in Ripple instead of your account's",Ei),de("--default-link <url>","The link for messages that don't include one"),new se("--email-threads","Group emails with the same subject into a thread, as a new source does"),new se("--no-email-threads","Keep each email its own message")]}function Ow(e){let t={};for(let[n,r,i]of ZC){if(e[n]!==void 0&&e[r])throw new B(`Choose ${Aw(n)} or ${Aw(r)}, not both.`);e[r]?t[i]=null:e[n]!==void 0&&(t[i]=e[n])}return typeof e.emailThreads=="boolean"&&(t.emailThreads=e.emailThreads),t}var KC=[{name:"mute",description:"Turn off a source's notifications but keep its messages.",done:e=>`Muted ${e}. New messages arrive without notifications.`},{name:"unmute",description:"Turn a source's notifications back on.",done:e=>`Unmuted ${e}.`},{name:"disable",description:"Stop a source from accepting new messages.",done:e=>`Disabled ${e}. It won't accept new messages.`},{name:"enable",description:"Let a disabled source accept messages again.",done:e=>`Enabled ${e}. It accepts new messages again.`}];function Mw(e,t){let{display:n}=t,r=kr(e,"sources","Manage where messages come from. Name a source by its name or its ID.").example("ripple sources",'ripple sources create "GitHub Alerts"','ripple sources key "GitHub Alerts"','ripple sources update "GitHub Alerts" --name "GitHub Deploys"'),i=async a=>(await Gt(t,a))[0];r.command("list").description("List your sources. Plain `ripple sources` does the same.").summary("List sources").action(async()=>{await t.run(H("GET","/v1/sources"),({items:a})=>JC(a,n))}),r.command("get").description("Show a source's settings.").argument("<source>").action(async a=>{await t.run(H("GET","/v1/sources/{sourceId}",{params:{sourceId:await i(a)}}),u=>XC(u,n))});let o=r.command("create").description("Create a source and show its send key.").argument("<name>");for(let a of _w())o.addOption(a);o.example('ripple sources create "GitHub Alerts"','ripple sources create "Deploys" --icon-color green --default-alert quiet').action(async(a,u)=>{let l=await t.call(H("POST","/v1/sources",{body:{name:a,...Ow(u)}})),d;try{d=await t.call(Dw(l.sourceId))}catch(c){throw new Ht(c,{code:"send_key_unavailable",message:`Created ${l.name} (${l.sourceId}), but couldn't get its send key.`,hint:`Run "ripple sources key ${l.sourceId}" to get it.`})}t.print({...l,sendKey:d.key,webhookUrl:d.webhookUrl,emailAddress:d.emailAddress},()=>`Created ${l.name} ${n.style.dim(l.sourceId)}
|
|
90
|
+
${d.key}
|
|
91
|
+
`),t.hint(vw(l.sourceId))}),r.command("key").description("Show a source's send key, which sends only to that source. --webhook-url and --email show the same key as a webhook URL or an email address. Add --reset to replace it; the old one stops working at once.").summary("Show or replace a source's send key").argument("<source>").addOption(new se("--webhook-url","Show the key as a webhook URL").conflicts("email")).option("--email","Show the key as an email address").option("--reset","Replace the key; the old one stops working at once").option("--yes","Confirm the reset").example('ripple sources key "GitHub Alerts"','ripple sources key "NAS" --email',"ripple sources key src_06gh81f7x0xmzj8z --reset --yes").action(async(a,u)=>{if(u.reset&&!u.yes)throw new B("Resetting stops the current key at once. Add --yes to confirm.");let l=await i(a);await t.run(Dw(l,u.reset),d=>`${u.email?d.emailAddress:u.webhookUrl?d.webhookUrl:d.key}
|
|
92
|
+
`),u.reset&&t.hint("Replaced the send key, with its webhook URL and email address. The old ones stopped working."),!u.email&&!u.webhookUrl&&t.hint(vw(l))});let s=r.command("update").description("Rename a source or change its settings.").argument("<source>").addOption(de("--name <name>","A new name"));for(let a of _w())s.addOption(a);s.option("--clear-icon","Remove the icon").option("--clear-icon-color","Remove the icon color").option("--clear-image","Remove the image").option("--clear-default-alert","Remove the default alert").option("--clear-default-sound","Remove the default sound").option("--clear-default-link","Remove the default link").example('ripple sources update "GitHub Alerts" --name "GitHub Deploys"',"ripple sources update Deploys --icon database --icon-color blue","ripple sources update src_06gh81f7x0xmzj8z --default-sound glow","ripple sources update NAS --no-email-threads").action(async(a,u)=>{let l={...u.name!==void 0?{name:u.name}:{},...Ow(u)},d=Object.keys(l);if(!d.length)throw new B("Give at least one setting to change, such as --name.");await t.run(H("PATCH","/v1/sources/{sourceId}",{params:{sourceId:await i(a)},body:l}),c=>d.length===1&&"name"in l?`Renamed to ${c.name}.
|
|
93
|
+
`:`Updated ${c.name}.
|
|
94
|
+
`)});for(let a of KC)r.command(a.name).description(a.description).argument("<source>").action(async u=>{await t.run(H("POST",`/v1/sources/{sourceId}/${a.name}`,{params:{sourceId:await i(u)}}),l=>`${a.done(l.name)}
|
|
95
|
+
`)});r.command("read").description("Mark all of a source's messages read.").argument("<source>").action(async a=>{await t.run(H("POST","/v1/sources/{sourceId}/read",{params:{sourceId:await i(a)}}),({source:u,markedReadCount:l})=>l?`Marked ${Pe(l,"message")} read in ${u.name}.
|
|
96
|
+
`:`Everything in ${u.name} was already read.
|
|
97
|
+
`)}),r.command("trash").description("Move a source to the trash. Its messages stay unless you add --delete-messages.").summary("Move a source to the trash").argument("<source>").option("--delete-messages","Also move its messages to the trash").action(async(a,u)=>{let l=H("DELETE","/v1/sources/{sourceId}",{params:{sourceId:await i(a)},query:{deleteMessages:u.deleteMessages?"true":void 0}});await t.run(l,d=>`Moved the source to the trash${d.deletedMessageCount?`, with ${Pe(d.deletedMessageCount,"message")}`:""}. It's deleted for good on ${zn(d.purgeAt,n)}.
|
|
98
|
+
`)})}function Dw(e,t=!1){return H("POST",t?"/v1/sources/{sourceId}/send-key/reset":"/v1/sources/{sourceId}/send-key",{params:{sourceId:e}})}function vw(e){return`Try it: RIPPLE_KEY=$(ripple sources key ${e}) ripple send "Hello"`}function JC(e,t){let n=e.filter(i=>"status"in i),r=n.length===e.length?tu(t,["Name","Status","Unread","ID"],n.map(i=>[i.name,St(i.status),String(i.unreadCount),i.sourceId])):tu(t,["Name","ID"],e.map(i=>[i.name,i.sourceId]));return e.some(i=>i.kind==="custom")?r:`${r}
|
|
88
99
|
${t.style.dim('Add a source with: ripple sources create "Name"')}
|
|
89
|
-
`}function
|
|
100
|
+
`}function XC(e,t){let{style:n}=t;return[n.bold(e.name),n.dim([St(e.status),`${e.unreadCount} unread`,e.snoozedCount?`${e.snoozedCount} snoozed`:null,e.sourceId].filter(Boolean).join(" \xB7 ")),"",Ir(t,[["Default alert",e.defaultAlert&&St(e.defaultAlert)],["Default sound",e.defaultSound&&St(e.defaultSound)],["Default link",e.defaultLink],["Email threads",e.emailThreads?"By subject":"Off"],["Icon",[e.iconSymbol,e.iconColor&&St(e.iconColor)].filter(Boolean).join(", ")],["Image",e.imageUrl],["Contained until",e.autoContainedUntil&&Wt(e.autoContainedUntil,t)],["Created",zn(e.createdAt,t)]])].join(`
|
|
90
101
|
`)+`
|
|
91
|
-
`}
|
|
102
|
+
`}function Nw(e,t){e.command("status").description("Show what this terminal reaches Ripple with, and check that it works: your sign-in from ripple login, or the send key or API token in RIPPLE_KEY, which takes its place. It shows whose it is, what it may do, and Ripple's address.").summary("Show what this terminal is connected as").example("ripple status","ripple status --json").action(async()=>{let n=await t.call(H("GET","/v1/access")),r=n.kind==="send_key"||n.sources==="all"?[]:(await t.call(H("GET","/v1/sources"))).items.map(s=>s.name),{baseUrl:i,store:o}=t.loginContext();t.print(n,s=>QC(s,r,i,t.display)),n.kind!=="sign_in"&&await o.load(i)&&t.hint("This terminal is also signed in. Unset RIPPLE_KEY to use its sign-in.")})}function QC(e,t,n,r){let i=e.kind==="send_key"?`Using the ${e.source.name} send key from RIPPLE_KEY`:e.kind==="api_token"?`Using the API token "${e.label}" from RIPPLE_KEY`:`Signed in as ${e.email}`,o=e.kind!=="send_key"&&Qd(e.access);return[r.style.bold(i),"",Ir(r,[["Access",e.kind==="send_key"?`Sends only to ${e.source.name}`:qa[e.access]],["Sources",o&&(t.length>1?ln(t):em(e.sources==="all"?"all":t))],["Address",n]])].join(`
|
|
103
|
+
`)+`
|
|
104
|
+
`}var eE="To restore an item, run ripple trash restore followed by its last line.";function Pw(e,t){let{display:n}=t,r=kr(e,"trash","Restore or permanently delete items.").example("ripple trash","ripple trash restore message msg_06gp035p55zrz46e");r.command("list").description("List what's in the trash. Plain `ripple trash` does the same.").summary("List what's in the trash").addOption(Ze("--type <type>","Only one kind of item; content means messages and threads",["message","thread","source","content"])).addOption(qn("items",Ii)).addOption(jn()).addOption(Hn()).action(async o=>{let s=mn(o,a=>H("GET","/v1/trash",{query:{type:o.type,...a}}));await t.runEach(s,a=>{let u=a.flatMap(l=>l.items);return Ci(n,u.map(l=>Rw(l,n)),"The trash is empty.",[u.length>0&&eE,cs(a)])})}),r.command("get").description("Show a message or thread in the trash.").addArgument(new qt("<type>","What kind of item").choices(["message","thread"])).argument("<id>","Its ID, shown by ripple trash").addOption(qn("thread messages")).addOption(jn()).addOption(Hn()).example("ripple trash get thread thr_06gm53wzxakqgkm4","ripple trash get thread thr_06gm53wzxakqgkm4 --all").action(async(o,s,a)=>{if(o==="message"&&(a.limit!==void 0||a.cursor!==void 0||a.all))throw new B("--limit, --cursor, and --all only apply to threads.");let u=mn(a,l=>H("GET",`/v1/trash/${o}s/{${o}Id}`,{params:{[`${o}Id`]:s},query:l}));await t.runEach(u,l=>tE(l,n))});let i=r.command("search").description("Search messages and threads in the trash. With no words, it lists everything the filters allow, newest first.").summary("Search the trash").argument("[words...]");for(let o of gs())i.addOption(o);i.action(async(o,s)=>{let a=await ys(t,o,s),u=mn(s,l=>H("POST","/v1/trash/search",{body:{...a,...l}}));await t.runEach(u,l=>Rd(n,l,l.flatMap(d=>d.items).map(({item:d,excerpt:c})=>Rw(d,n,vd(c))),o.length?`Nothing in the trash matches "${o.join(" ")}".`:"Nothing in the trash matches these filters."))}),r.command("restore").description("Restore a message, thread, or source from the trash.").summary("Restore an item").addArgument(new qt("<type>","What kind of item").choices(["message","thread","source"])).argument("<id>","Its ID, shown by ripple trash").example("ripple trash restore message msg_06gp035p55zrz46e").action(async(o,s)=>{let a=H("POST",`/v1/trash/${o}s/{${o}Id}/restore`,{params:{[`${o}Id`]:s}});await t.run(a,u=>{if("source"in u)return`Restored ${u.source.name}.
|
|
92
105
|
`;let l=u.message.title??u.message.thread?.title;return`Restored ${l?`"${l}"`:"the message"}.
|
|
93
|
-
`})}),r.command("delete").description("Delete a message, thread or source for good. This can't be undone.").summary("Delete an item for good").addArgument(new qt("<type>","What kind of item").choices(["message","thread","source"])).argument("<id>","Its ID, shown by ripple trash").option("--yes","Confirm that this can't be undone").example("ripple trash delete message
|
|
94
|
-
`)})}function
|
|
95
|
-
`)).exitOverride().configureOutput({...t,outputError:()=>{},getOutHelpWidth:()=>r??80,getErrHelpWidth:()=>r??80,getOutHasColors:()=>n.color,getErrHasColors:()=>n.color}).configureHelp({showGlobalOptions:!0,formatHelp:(o,s)=>
|
|
96
|
-
`)}var
|
|
97
|
-
`)
|
|
98
|
-
`}
|
|
106
|
+
`})}),r.command("delete").description("Delete a message, thread, or source for good. This can't be undone.").summary("Delete an item for good").addArgument(new qt("<type>","What kind of item").choices(["message","thread","source"])).argument("<id>","Its ID, shown by ripple trash").option("--yes","Confirm that this can't be undone").example("ripple trash delete message msg_06gp035p55zrz46e --yes").action(async(o,s,a)=>{if(!a.yes)throw new B("Deleting for good can't be undone. Add --yes to confirm.");let u=H("DELETE",`/v1/trash/${o}s/{${o}Id}`,{params:{[`${o}Id`]:s},noContent:!0});await t.run(u,()=>`Deleted for good.
|
|
107
|
+
`)})}function Rw(e,t,n){let r=[`Trashed ${Si(e.deletedAt,t)}`,`Deleted for good ${zn(e.purgeAt,t)}`],i=`${e.type} ${e.id}`;if(e.type==="source")return Ti(t,{title:e.source.name,facts:["Source",...r],extra:i});let o=n??e.preview;return Ti(t,{title:e.title??o,detail:e.title?o:void 0,facts:[e.type==="thread"?`Thread of ${Pe(e.thread.messageCount,"message")}`:"Message",e.source.name,...r],extra:i})}function tE(e,t){let[n]=e,{item:r}=n,i=`Trashed ${Wt(r.deletedAt,t)} \xB7 deleted for good ${zn(r.purgeAt,t)}`,o=`ripple trash restore ${r.type} ${r.id}`;if(n.item.type==="message")return Md({...n.item,thread:void 0},t,[["Trash",i],["Restore",o]]);let s=e;return Nd(t,{...n.item.thread,source:n.item.source.name},s.flatMap(a=>a.messages),s.at(-1).nextCursor,[i,`Restore: ${o}`])}var Pd=class e extends Cr{examples=[];example(...t){return this.examples.push(...t),this}createCommand(t){return new e(t)}};function kr(e,t,n){return e.command(t).description(n).helpCommand(!1)}function Lw(e,t){let{style:n,width:r}=e.display,i=new Pd("ripple").description(`${Ar.description}.`).option("--json","Print raw JSON, for scripts").version(Ar.version,"--version","Show the version").helpOption("-h, --help","Show help").helpCommand("help [command]","Show help for a command").addOption(new se("--base-url <url>").hideHelp()).addOption(fu("--timeout <ms>","Request deadline in milliseconds",2147483647).hideHelp().default(3e4)).example("ripple login",'ripple send "Deploy finished"',"ripple messages",'ripple messages search "invoice"',"ripple help send").addHelpText("after",()=>["",n.bold("Connecting")," Run ripple login to connect this terminal to your account."," Scripts and servers can set RIPPLE_KEY instead, which wins over"," a sign-in. A send key only sends, and only to its source: copy it"," from the source's menu (Copy send key). An API token is Read only,"," Send only, Read and send, or Everything, on all your sources or"," chosen ones; add one under Settings \u2192 Developer \u2192 API tokens."," ripple status shows which one it's using, and checks it works.","",` Commands go to ${Va}. To use another address, set`," RIPPLE_BASE_URL or save baseUrl in ~/.config/ripple/config.json."," --base-url and --timeout <ms> override these for one command.",""].join(`
|
|
108
|
+
`)).exitOverride().configureOutput({...t,outputError:()=>{},getOutHelpWidth:()=>r??80,getErrHelpWidth:()=>r??80,getOutHasColors:()=>n.color,getErrHasColors:()=>n.color}).configureHelp({showGlobalOptions:!0,formatHelp:(o,s)=>nE(o,s,n),optionTerm:o=>o.short?o.flags:` ${o.flags}`,optionDescription:o=>o.description+(o.argChoices?` (${o.argChoices.join(", ")})`:""),argumentTerm:Ld,argumentDescription:o=>o.description+(o.argChoices?` (${o.argChoices.join(", ")})`:""),subcommandTerm:o=>[o.name(),...o.registeredArguments.map(Ld)].join(" "),subcommandDescription:o=>(o.summary()||o.description()).replace(/\.$/,"")});return Xm(i,e),Ew(i,e),Mw(i,e),Pw(i,e),rp(i,e),Nw(i,e),cp(i,e),i}function Ld(e){let t=`${e.name()}${e.variadic?"...":""}`;return e.required?`<${t}>`:`[${t}]`}function Zo(e){let t=[];for(let n=e;n;n=n.parent)t.unshift(n.name());return t.join(" ")}function nE(e,t,n){let r=t.visibleCommands(e),i=r.length>0&&e.parent!==null,o=t.visibleOptions(e),s=o.filter(f=>f.long==="--help"),a=t.visibleGlobalOptions(e).filter(f=>f.long!=="--version"),u=i?[]:[...o.filter(f=>f.long!=="--help"),...a,...s],l=r.length?`${Zo(e)} <command>`:[Zo(e),...e.registeredArguments.map(Ld),"[options]"].join(" "),d={Commands:r.map(f=>[t.subcommandTerm(f),t.subcommandDescription(f)]),Arguments:t.visibleArguments(e).map(f=>[t.argumentTerm(f),t.argumentDescription(f)]),Options:u.map(f=>[t.optionTerm(f),t.optionDescription(f)])},c=Math.max(0,...Object.values(d).flat().map(([f])=>t.displayWidth(f))),m=(f,x)=>x.length?[n.bold(f),...x,""]:[],p=f=>m(f,d[f].map(([x,S])=>t.formatItem(x,c,S,t)));return[t.boxWrap(t.commandDescription(e),t.helpWidth??80),"",...m("Usage",[` ${l}`]),...p("Commands"),...p("Arguments"),...p("Options"),...m("Examples",e.examples.map(f=>` ${f}`)),...i?[n.dim(`Run "${Zo(e)} <command> --help" for a command's options.`),""]:[]].join(`
|
|
109
|
+
`)}var Fw=45e3,Fd={first:1e3,longest:3e4},dt=class extends Error{constructor(n,r,i,o){super(i);this.response=n;this.exitCode=r;this.hint=o}},Ko=class extends Error{constructor(n,r){super(n.message);this.reason=n;this.idempotencyKey=r}},sE=5*6e4;function Ud(e){return e instanceof $?e.code==="network_error"||e.code==="request_timeout":e.status===429||e.status>=500}function aE(e){return e instanceof $?e.code==="request_timeout"?"Ripple didn't answer in time.":"Could not reach Ripple.":e.status!==429?`Ripple is unavailable (HTTP ${e.status}).`:e.error?.code==="invalid_key_rate_limited"?"Ripple is refusing keys from this IP address for a moment.":"Ripple is limiting sends."}async function uE(e,t){let n=Date.now()+sE;for(let r=1;;r++){let i=await e(),o=n-Date.now(),s=i instanceof $?0:(i.retryAfter??0)*1e3;if(!Ud(i)||o<=0||s>o)return i;let a=Math.min(3e4,1e3*2**(r-1)),u=Math.min(Math.max(s,a)*(1+Math.random()/2),o);t(`${aE(i)} Trying again in ${Math.ceil(u/1e3)}s\u2026`),await new Promise(l=>setTimeout(l,u))}}function lE({status:e,unreadable:t,error:n}){return t?re.unknownOutcome:e===404?re.notFound:e===401||e===403&&n?.code==="insufficient_access"?re.access:e===429||e===503?re.tryLater:re.rejected}function cE(e,t){return e instanceof $?e:e instanceof et||e instanceof B?new $("invalid_arguments",e instanceof et?fE(e.message):e.message,`Run "${Zo(t)} --help" for usage.`):new $("unexpected_error",zw(e))}function dE(e){let[t,n]=e;return t?t==="help"?[...e.slice(1),"--help"]:["messages","sources","trash"].includes(t)&&(n===void 0||n.startsWith("-")&&n!=="-h"&&n!=="--help")?[t,"list",...e.slice(1)]:e:["--help"]}function mE(e){let t=iE({input:process.stdin,output:process.stderr});return new Promise(n=>{t.once("close",()=>n(null)),t.once("SIGINT",()=>{process.stderr.write(`
|
|
110
|
+
`),process.exit(130)}),t.question(e,r=>{n(r),t.close()})})}function pE(){if(process.stdin.isTTY)return;let e=!1;try{let t=rE(0);e=t.isFIFO()||t.isFile()}catch{}return{stream:process.stdin,piped:e}}async function Uw(e={}){let t=dE(e.argv??process.argv.slice(2)),n=e.env??process.env,r=e.writeStdout??(C=>void process.stdout.write(C)),i=e.writeStderr??(C=>void process.stderr.write(C)),o=!e.writeStdout&&!!process.stdout.isTTY,s={style:bm(e.color??(o&&n.NO_COLOR===void 0)),width:e.width??(o?process.stdout.columns:void 0),timeZone:e.timeZone??Intl.DateTimeFormat().resolvedOptions().timeZone,get now(){return e.now??new Date}},a=t.includes("--json"),u,l=null,d=e.credentials??mm(n),c=a?void 0:e.ask??(e.argv===void 0&&process.stdin.isTTY&&process.stderr.isTTY?mE:void 0),m,p=()=>s.width!==void 0&&!O.opts().json,f=()=>{try{return u??=sm({env:n,flags:{baseUrl:O.opts().baseUrl},configPath:e.configPath})}catch(C){throw C instanceof $?C:new $("invalid_config",zw(C),'Run "ripple --help" to see how to connect.')}},x=C=>{b()||i(`${s.style.dim(C)}
|
|
111
|
+
`)},S=()=>({baseUrl:f().baseUrl,store:d,timeoutMs:O.opts().timeout}),w=async({refused:C}={})=>{let{baseUrl:N,key:E,kind:y}=f();if(E)return{baseUrl:N,key:E,kind:y};if((!l||C||!mu(l))&&(l=await zm(S(),{refused:C})??await np(M)),!l)throw new $("missing_key","This terminal isn't connected to Ripple.","Run ripple login to connect it, or set RIPPLE_KEY to a send key or an API token.");return{baseUrl:N,key:l.accessToken,kind:"access"}},D=async()=>{let C=await w();if(C.kind==="send")throw new $("send_key_only","RIPPLE_KEY is a send key, which only sends. Reading and managing need an API token.","Unset RIPPLE_KEY and run ripple login, or set it to an API token from Settings \u2192 Developer \u2192 API tokens.");return C},T=(C,{baseUrl:N},E="reach")=>gE(C)?rs(E):ns(N,E),M={display:s,env:n,installMethod:e.installMethod??sp(),input:e.stdin?{stream:e.stdin,piped:!0}:e.argv?void 0:pE(),keyKind:async()=>(await w()).kind,ask:c,loginContext:()=>({...S(),style:s.style,say:C=>i(`${C}
|
|
112
|
+
`),ask:c,openBrowser:e.openBrowser??jm,get computerName(){return e.computerName??Bm()},signal:e.signal}),async call(C){let N=C.path==="/v1/send",E=C.sendKey?await w():await D(),y=async()=>{let _=AbortSignal.timeout(O.opts().timeout);try{let R=await Wa(C,{...E,signal:_});return R.status!==401||E.kind!=="access"?R:(Object.assign(E,await w({refused:E.key})),await Wa(C,{...E,signal:_}))}catch(R){return R instanceof $?R:_.aborted?new $("request_timeout",N?"Ripple didn't answer in time, so it's unknown whether the message was sent.":"Ripple didn't answer in time, so the outcome is unknown. Before creating a source again, check ripple sources."):T(R,E,N?"send notification to":void 0)}},Z=C.headers?.["Idempotency-Key"],F=Z?await uE(y,x):await y();if(F instanceof $||(m=F.latestRelease??m),F instanceof $||F.error||F.data===void 0&&!C.noContent){let _=F instanceof $?F:F.error?$d(F,{sending:N,kind:E.kind}):new $("empty_response","Ripple sent back an empty response."),R=Ud(F)||_.exitCode===re.unknownOutcome;throw Z&&R?new Ko(_,Z):_}return F.data},async watch(C,N){let E=await D(),y=e.signal,Z,F=!1,_=!1,R=Fd.first;for(;!y?.aborted;){let U=new AbortController,te=()=>U.abort();y?.addEventListener("abort",te,{once:!0});let oe,Re=J=>{clearTimeout(oe),oe=setTimeout(te,J)};try{E.kind==="access"&&Object.assign(E,await w()),Re(O.opts().timeout);let J=await fetch(ja({...C,headers:{accept:"text/event-stream",...Z===void 0?{}:{"last-event-id":Z}}},{...E,signal:U.signal}));if(m=Ha(J)??m,J.ok){if(!J.body||!J.headers.get("content-type")?.startsWith("text/event-stream"))throw $d({status:J.status,unreadable:!0,error:{code:"invalid_response",message:"Ripple didn't answer with a stream of messages."}},{sending:!1,kind:E.kind});F=!0,_=!1,R=Fd.first,Re(Fw);for await(let h of nm(J.body))Re(Fw),h.id!==void 0&&(Z=h.id),h.data!==void 0&&N({event:h.event,data:h.data})}else{let h=await Ga(J);if(h.status===401&&E.kind==="access"&&!_){_=!0,Object.assign(E,await w({refused:E.key}));continue}if(!F||!Ud(h))throw $d(h,{sending:!1,kind:E.kind});R=Math.max(R,(h.retryAfter??0)*1e3)}}catch(J){if(y?.aborted)break;if(!(F&&J instanceof $&&J.code==="network_error")&&(J instanceof dt||J instanceof $||J instanceof B))throw J;if(!F)throw U.signal.aborted?new $("request_timeout","Ripple didn't answer in time."):T(J,E)}finally{clearTimeout(oe),y?.removeEventListener("abort",te)}await oE(R,void 0,{signal:y}).catch(()=>{}),R=Math.min(R*2,Fd.longest)}},print(C,N){r(b()?zd(C):N(C))},run(C,N){return M.runEach(E=>E.length?void 0:C,([E])=>N(E))},async runEach(C,N){let E=[];for(let y=C(E);y;y=C(E)){let Z=await M.call(y);E.push(Z),b()&&r(zd(Z))}b()||r(N(E))},hint(C){p()&&x(C)}},O=Lw(M,{writeOut:r,writeErr:i}),b=()=>!!O.opts().json;try{return await O.parseAsync(t,{from:"user"}),0}catch(C){if(C instanceof et&&["commander.helpDisplayed","commander.version","commander.help"].includes(C.code))return C.exitCode===0?0:re.usage;let N=C instanceof Ht?C.undone:void 0,E=C instanceof Ht||C instanceof Ko?C.reason:C,y=E instanceof dt?E:cE(E,hE(O,t));return i($w(y,s,a,C instanceof Ko?C.idempotencyKey:void 0)+(N?$w(N,s,a):"")),y.exitCode}finally{let C=ap(m,M.installMethod);C&&p()&&lp(e.noticePath??up(),s.now)&&M.hint(C)}}function zd(e){return`${JSON.stringify(e??{status:"ok"})}
|
|
113
|
+
`}function $w(e,t,n,r){if(n){let i=e instanceof dt?e.response:{code:e.code,message:e.message};return zd(r?{...i,idempotencyKey:r}:i)}if(e instanceof dt||e instanceof $){let i=r&&`Send it again with --idempotency-key ${r} so it can't arrive twice.`;return Tm(t,e.message,[e.hint,i].filter(Boolean).join(`
|
|
99
114
|
`))}return`${e.message}
|
|
100
115
|
${e.hint?`${t.style.dim(e.hint)}
|
|
101
|
-
`:""}`}function
|
|
102
|
-
`));if(o==="
|
|
116
|
+
`:""}`}function fE(e){return e.replace(/^error: /,"").replace(/^option '(?:-\w, )?(--[\w-]+)[^']*' argument '[^']*' is invalid\. Allowed choices are (.*)\.$/s,"$1 must be one of: $2.").replace(/^option '(?:-\w, )?(--[\w-]+)[^']*' argument '[^']*' is invalid\. (.*)$/s,"$1 $2").replace(/^option '(?:-\w, )?(--[\w-]+)[^']*' argument missing$/,"$1 needs a value.").replace(/^required option '(?:-\w, )?(--[\w-]+)[^']*' not specified$/,"$1 is required.").replace(/^option '(?:-\w, )?(--[\w-]+)[^']*' cannot be used with option '(?:-\w, )?(--[\w-]+)[^']*'$/,"Choose either $1 or $2, not both.").replace(/^command-argument value '[^']*' is invalid for argument '(\w+)'\. Allowed choices are (.*)\.$/s,"<$1> must be one of: $2.").replace(/^missing required argument '(\w+)'$/,"Missing <$1>.").replace(/^too many arguments(?: for '[^']*')?\. Expected (\d+) arguments? but got \d+: (.*)\.$/s,(t,n,r)=>`Expected ${Pe(Number(n),"argument")} but got ${r}. Put quotes around text with spaces.`).replace(/^unknown (command|option) '([^']*)'/,'Unknown $1 "$2".').replace(/\n\(Did you mean (.+)\?\)$/," Did you mean $1?").replace(/^./,t=>t.toUpperCase())}function hE(e,t){let n=e;for(let r of t){let i=n.commands.find(o=>o.name()===r);if(i)n=i;else if(!r.startsWith("-"))break}return n}function $d(e,{sending:t,kind:n}){let r=e.error??{},i=lE(e),{code:o}=r,s=typeof r.message=="string"?r.message:void 0;if((o==="invalid_credential"||o==="unauthorized")&&n==="access")return new dt(r,i,s??"Ripple didn't accept this terminal's sign-in.","Run ripple login to sign in again.");if(o==="invalid_credential"||o==="unauthorized")return new dt(r,i,s??"Ripple didn't accept RIPPLE_KEY.",["A send key stops working once it's reset, and an API token after 180 days unused.","Get a new one in Ripple, then export RIPPLE_KEY again."].join(`
|
|
117
|
+
`));if(o==="invalid_key_rate_limited")return new dt(r,i,s??"Too many invalid keys from this IP address.",`After too many invalid keys, Ripple refuses every key from this network for a moment.
|
|
118
|
+
Check that scripts on this network use current keys.`);if(o==="insufficient_access"){let u=Array.isArray(r.neededAccess)?r.neededAccess.filter(Jd):[];return new dt(r,i,s??"This API token can't do that.",`Add one${u.length?` with ${Xd(u)}`:""} in Settings \u2192 Developer \u2192 API tokens, then run: export RIPPLE_KEY=<token>`)}let a=`Ripple rejected the request${o?` (${String(o)})`:""}.`;return o==="invalid_source"&&t?new dt(r,i,s??a,n==="send"?wu:'Run "ripple sources" to see your sources.'):new dt(r,i,s??a)}function gE(e){return e instanceof Error?("code"in e?e.code:void 0)==="ERR_INVALID_URL"||e.message.includes("Invalid URL")||e.message.includes("Failed to parse URL"):!1}function zw(e){return e instanceof Error?e.message:String(e)}process.stdout.on("error",e=>{if(e.code!=="EPIPE")throw e;process.exit(0)});Uw().then(e=>{process.exitCode=e});
|