From aa3711e3b0ff68913eb9eae882cacc9b96457718 Mon Sep 17 00:00:00 2001 From: Ernest Cui Date: Mon, 13 May 2024 09:16:34 +0800 Subject: [PATCH] build: build --- cli/build/irvm.mjs | 4 ++-- .../{cssMode-c20b4059.js => cssMode-67b982ab.js} | 2 +- ...freemarker2-6df495c3.js => freemarker2-56aebadc.js} | 2 +- .../{handlebars-57fde516.js => handlebars-5888b9b7.js} | 2 +- docs/assets/{html-f9ec217a.js => html-ad157992.js} | 2 +- .../{htmlMode-a02b4db6.js => htmlMode-639cee69.js} | 2 +- docs/assets/{index-0f719e36.js => index-650b196f.js} | 10 +++++----- .../{javascript-e355c851.js => javascript-603c281f.js} | 2 +- .../{jsonMode-324adb46.js => jsonMode-9dcc9a7c.js} | 2 +- docs/assets/{liquid-8ad1f6f1.js => liquid-9f7a360d.js} | 2 +- docs/assets/{mdx-66407150.js => mdx-da5b6492.js} | 2 +- docs/assets/{python-675f20c3.js => python-289fae18.js} | 2 +- docs/assets/{razor-6002a854.js => razor-97daa2a2.js} | 2 +- docs/assets/{tsMode-93e6f265.js => tsMode-59ab1782.js} | 2 +- .../{typescript-0713de27.js => typescript-54992499.js} | 2 +- docs/assets/{xml-2867d133.js => xml-12c779e0.js} | 2 +- docs/assets/{yaml-a4b03d68.js => yaml-639752e1.js} | 2 +- docs/index.html | 2 +- 18 files changed, 23 insertions(+), 23 deletions(-) rename docs/assets/{cssMode-c20b4059.js => cssMode-67b982ab.js} (99%) rename docs/assets/{freemarker2-6df495c3.js => freemarker2-56aebadc.js} (99%) rename docs/assets/{handlebars-57fde516.js => handlebars-5888b9b7.js} (99%) rename docs/assets/{html-f9ec217a.js => html-ad157992.js} (98%) rename docs/assets/{htmlMode-a02b4db6.js => htmlMode-639cee69.js} (99%) rename docs/assets/{index-0f719e36.js => index-650b196f.js} (99%) rename docs/assets/{javascript-e355c851.js => javascript-603c281f.js} (89%) rename docs/assets/{jsonMode-324adb46.js => jsonMode-9dcc9a7c.js} (99%) rename docs/assets/{liquid-8ad1f6f1.js => liquid-9f7a360d.js} (98%) rename docs/assets/{mdx-66407150.js => mdx-da5b6492.js} (98%) rename docs/assets/{python-675f20c3.js => python-289fae18.js} (98%) rename docs/assets/{razor-6002a854.js => razor-97daa2a2.js} (99%) rename docs/assets/{tsMode-93e6f265.js => tsMode-59ab1782.js} (99%) rename docs/assets/{typescript-0713de27.js => typescript-54992499.js} (98%) rename docs/assets/{xml-2867d133.js => xml-12c779e0.js} (97%) rename docs/assets/{yaml-a4b03d68.js => yaml-639752e1.js} (98%) diff --git a/cli/build/irvm.mjs b/cli/build/irvm.mjs index fd31045..5badfe0 100644 --- a/cli/build/irvm.mjs +++ b/cli/build/irvm.mjs @@ -1,4 +1,4 @@ -import t from"fs";import e from"readline";import r from"assert";import n from"util";import i from"path";var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},o={exports:{}};const{inspect:a}=n;var u,l,c=function(t,...e){let r=t.replace(/%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g,(function(t,r,n,i,s,o){if(r)return"%";let u,l=0;if(i){if(0===e.length)throw new TypeError("not enough arguments for format string");if(l=e.shift(),!Number.isInteger(l))throw new TypeError("* wants int")}if(void 0!==s){let t=e[0];if("object"!=typeof t||null===t)throw new TypeError("format requires a mapping");if(!(s in t))throw new TypeError(`no such key: '${s}'`);u=t[s]}else{if(0===e.length)throw new TypeError("not enough arguments for format string");u=e.shift()}switch(o){case"s":u=String(u);break;case"r":u=a(u);break;case"d":case"i":if("number"!=typeof u)throw new TypeError(`%${o} format: a number is required, not ${typeof u}`);u=String(u.toFixed(0));break;default:throw new TypeError(`unsupported format character '${o}'`)}return l>0?n?u.padEnd(l):u.padStart(l):u}));if(e.length&&(1!==e.length||"object"!=typeof e[0]||null===e[0]))throw new TypeError("not all arguments converted during string formatting");return r};function h(){if(l)return u;l=1;const t=/([\t\n\x0b\x0c\r ]+)/;class e{constructor(t={}){let{width:e=70,initial_indent:r="",subsequent_indent:n="",expand_tabs:i=!0,replace_whitespace:s=!0,fix_sentence_endings:o=!1,break_long_words:a=!0,drop_whitespace:u=!0,break_on_hyphens:l=!0,tabsize:c=8,max_lines:h,placeholder:f=" [...]"}=t;this.width=e,this.initial_indent=r,this.subsequent_indent=n,this.expand_tabs=i,this.replace_whitespace=s,this.fix_sentence_endings=o,this.break_long_words=a,this.drop_whitespace=u,this.break_on_hyphens=l,this.tabsize=c,this.max_lines=h,this.placeholder=f}_munge_whitespace(t){return this.expand_tabs&&(t=t.replace(/\t/g," ".repeat(this.tabsize))),this.replace_whitespace&&(t=t.replace(/[\t\n\x0b\x0c\r]/g," ")),t}_split(e){let r=e.split(t);return r=r.filter(Boolean),r}_handle_long_word(t,e,r,n){let i;i=n<1?1:n-r,this.break_long_words?(e.push(t[t.length-1].slice(0,i)),t[t.length-1]=t[t.length-1].slice(i)):e||e.push(...t.pop())}_wrap_chunks(t){let e,r=[];if(this.width<=0)throw Error(`invalid width ${this.width} (must be > 0)`);if(void 0!==this.max_lines&&(e=this.max_lines>1?this.subsequent_indent:this.initial_indent,e.length+this.placeholder.trimStart().length>this.width))throw Error("placeholder too large for max width");for(t=t.reverse();t.length>0;){let e,n=[],i=0;e=r?this.subsequent_indent:this.initial_indent;let s=this.width-e.length;for(this.drop_whitespace&&""===t[t.length-1].trim()&&r.length>0&&t.pop();t.length>0;){let e=t[t.length-1].length;if(!(i+e<=s))break;n.push(t.pop()),i+=e}if(t.length&&t[t.length-1].length>s&&(this._handle_long_word(t,n,i,s),i=n.map((t=>t.length)).reduce(((t,e)=>t+e),0)),this.drop_whitespace&&n.length>0&&""===n[n.length-1].trim()&&(i-=n[n.length-1].length,n.pop()),n){if(!(void 0===this.max_lines||r.length+10)for(let i=t;ie;i+=r)n.push(i);return n}function O(t,e=!1){let r;if(e){r=[];let e=t.split(/(\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029])/);for(let t=0;tr&&(n=n.slice(0,r).concat([n.slice(r).join(e)])),n}function N(t,e){if(t.length!==e.length)return!1;for(let r=0;rt[0]+t[2].toUpperCase()));r!==e&&M(t.prototype,r,e)}return t}function P(t){return"default"===(t=t.replace(/\w_[a-z]/g,(t=>t[0]+t[2].toUpperCase())))&&(t="defaultValue"),"const"===t&&(t="constant"),t}function x(t){return"defaultValue"===t&&(t="default"),"constant"===t&&(t="const"),t=t.replace(/[A-Z]/g,(t=>"_"+t.toLowerCase()))}let U=Symbol("no_default_value");function G(t,e){function r(){let t=(new Error).stack.split("\n").map((t=>t.match(/^ at (.*) \(.*\)$/))).filter(Boolean).map((t=>t[1])).map((t=>t.match(/[^ .]*$/)[0]));return t.length&&t[0]===r.name&&t.shift(),t.length&&t[0]===G.name&&t.shift(),t.length?t[0]:""}let n={},i=[],s=(t=Array.from(t)).length&&t[t.length-1];"object"!=typeof s||null===s||Array.isArray(s)||s.constructor&&"Object"!==s.constructor.name||(n=Object.assign({},t.pop()));let o=[];for(let t of Object.keys(e)){let e=P(t);e!==t&&e in n&&(t in n||(n[t]=n[e]),o.push([e,t]),delete n[e])}if(o.length){let t=r();F("camelcase_"+t,m("%s(): following options are renamed: %s",t,o.map((([t,e])=>m("%r -> %r",t,e)))))}let a=[],u=t.length;for(let[s,o]of Object.entries(e))if("*"===s[0])if(s.length>0&&"*"===s[1]){let t=[];for(let e of Object.keys(n)){let r=x(e);r!==e&&e in n&&(r in n||(n[r]=n[e]),t.push([e,r]),delete n[e])}if(t.length){let e=r();F("camelcase_"+e,m("%s(): following options are renamed: %s",e,t.map((([t,e])=>m("%r -> %r",t,e)))))}i.push(n),n={}}else i.push(t),t=[];else{if(s in n&&t.length>0)throw new TypeError(m("%s() got multiple values for argument %r",r(),s));s in n?(i.push(n[s]),delete n[s]):t.length>0?i.push(t.shift()):o!==U?i.push(o):a.push(s)}if(Object.keys(n).length)throw new TypeError(m("%s() got an unexpected keyword argument %r",r(),Object.keys(n)[0]));if(t.length){let t=Object.entries(e).filter((([t,e])=>"*"!==t[0]&&e!==U)).length,n=Object.entries(e).filter((([t])=>"*"!==t[0])).length;throw new TypeError(m("%s() takes %s positional argument%s but %s %s given",r(),t===n?m("from %s to %s",t,n):n,t===n&&1===n?"":"s",u,1===u?"was":"were"))}if(a.length){let t=a.map(v);t.length>1&&(t[t.length-1]="and "+t[t.length-1]);let e=t.join(2===t.length?"":", ");throw new TypeError(m("%s() missing %i required positional argument%s: %s",r(),t.length,1===t.length?"":"s",e))}return i}let k={};function F(t,e){k[t]=k[t]||g.deprecate((()=>{}),e),k[t]()}function H(t=Object){return class extends t{[g.inspect.custom](){let t=this.constructor.name,e=[],r={};for(let t of this._get_args())e.push(v(t));for(let[t,n]of this._get_kwargs())/^[a-z_][a-z0-9_$]*$/i.test(t)?e.push(m("%s=%r",t,n)):r[t]=n;return Object.keys(r).length&&e.push(m("**%s",v(r))),m("%s(%s)",t,e.join(", "))}toString(){return this[g.inspect.custom]()}_get_kwargs(){return Object.entries(this)}_get_args(){return[]}}}function j(t){return void 0===t?[]:t.slice(0)}const V=B(D(class{constructor(){let[t,e,r,n]=G(arguments,{prog:U,indent_increment:2,max_help_position:24,width:void 0});void 0===n&&(n=+process.env.COLUMNS||process.stdout.columns||80,n-=2),this._prog=t,this._indent_increment=e,this._max_help_position=Math.min(r,Math.max(n-20,2*e)),this._width=n,this._current_indent=0,this._level=0,this._action_max_length=0,this._root_section=this._Section(this,void 0),this._current_section=this._root_section,this._whitespace_matcher=/[ \t\n\r\f\v]+/g,this._long_break_matcher=/\n\n\n+/g}_indent(){this._current_indent+=this._indent_increment,this._level+=1}_dedent(){this._current_indent-=this._indent_increment,p(this._current_indent>=0,"Indent decreased below 0."),this._level-=1}_add_item(t,e){this._current_section.items.push([t,e])}start_section(t){this._indent();let e=this._Section(this,this._current_section,t);this._add_item(e.format_help.bind(e),[]),this._current_section=e}end_section(){this._current_section=this._current_section.parent,this._dedent()}add_text(t){t!==s&&void 0!==t&&this._add_item(this._format_text.bind(this),[t])}add_usage(t,e,r,n=void 0){if(t!==s){let i=[t,e,r,n];this._add_item(this._format_usage.bind(this),i)}}add_argument(t){if(t.help!==s){let e=[this._format_action_invocation(t)];for(let r of this._iter_indented_subactions(t))e.push(this._format_action_invocation(r));let r=Math.max(...e.map((t=>t.length)))+this._current_indent;this._action_max_length=Math.max(this._action_max_length,r),this._add_item(this._format_action.bind(this),[t])}}add_arguments(t){for(let e of t)this.add_argument(e)}format_help(){let t=this._root_section.format_help();return t&&(t=t.replace(this._long_break_matcher,"\n\n"),t=t.replace(/^\n+|\n+$/g,"")+"\n"),t}_join_parts(t){return t.filter((t=>t&&t!==s)).join("")}_format_usage(t,e,r,n){if(void 0===n&&(n="usage: "),void 0!==t)t=m(t,{prog:this._prog});else if(void 0!==t||e.length){if(void 0===t){let i=m("%(prog)s",{prog:this._prog}),s=[],o=[];for(let t of e)t.option_strings.length?s.push(t):o.push(t);t=[i,this._format_actions_usage([].concat(s).concat(o),r)].map(String).join(" ");let a=this._width-this._current_indent;if(n.length+t.length>a){let e=/\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+/g,u=this._format_actions_usage(s,r),l=this._format_actions_usage(o,r),c=u.match(e)||[],h=l.match(e)||[];p(c.join(" ")===u),p(h.join(" ")===l);let f,_=(t,e,r=void 0)=>{let n,i=[],s=[];n=void 0!==r?r.length-1:e.length-1;for(let r of t)n+1+r.length>a&&s&&(i.push(e+s.join(" ")),s=[],n=e.length-1),s.push(r),n+=r.length+1;return s.length&&i.push(e+s.join(" ")),void 0!==r&&(i[0]=i[0].slice(e.length)),i};if(n.length+i.length<=.75*a){let t=" ".repeat(n.length+i.length+1);c.length?(f=_([i].concat(c),t,n),f=f.concat(_(h,t))):f=h.length?_([i].concat(h),t,n):[i]}else{let t=" ".repeat(n.length);f=_([].concat(c).concat(h),t),f.length>1&&(f=[],f=f.concat(_(c,t)),f=f.concat(_(h,t))),f=[i].concat(f)}t=f.join("\n")}}}else t=m("%(prog)s",{prog:this._prog});return m("%s%s\n\n",n,t)}_format_actions_usage(t,e){let r=new Set,n={};for(let i of e){let e=t.indexOf(i._group_actions[0]);if(-1!==e){let s=e+i._group_actions.length;if(N(t.slice(e,s),i._group_actions)){for(let t of i._group_actions)r.add(t);i.required?(e in n?n[e]+=" (":n[e]="(",s in n?n[s]+=")":n[s]=")"):(e in n?n[e]+=" [":n[e]="[",s in n?n[s]+="]":n[s]="]");for(let t of L(e+1,s))n[t]="|"}}}let i=[];for(let[e,o]of Object.entries(t))if(o.help===s)i.push(void 0),"|"===n[+e]?delete n[+e]:"|"===n[+e+1]&&delete n[+e+1];else if(o.option_strings.length){let t,e=o.option_strings[0];if(0===o.nargs)t=o.format_usage();else{let r=this._get_default_metavar_for_optional(o),n=this._format_args(o,r);t=m("%s %s",e,n)}o.required||r.has(o)||(t=m("[%s]",t)),i.push(t)}else{let t=this._get_default_metavar_for_positional(o),e=this._format_args(o,t);r.has(o)&&"["===e[0]&&"]"===e[e.length-1]&&(e=e.slice(1,-1)),i.push(e)}for(let t of Object.keys(n).map(Number).sort(((t,e)=>e-t)))i.splice(+t,0,n[+t]);let o=i.filter(Boolean).join(" ");return o=o.replace(/([\[(]) /g,"$1"),o=o.replace(/ ([\])])/g,"$1"),o=o.replace(/[\[(] *[\])]/g,""),o=o.replace(/\(([^|]*)\)/g,"$1",o),o=o.trim(),o}_format_text(t){t.includes("%(prog)")&&(t=m(t,{prog:this._prog}));let e=Math.max(this._width-this._current_indent,11),r=" ".repeat(this._current_indent);return this._fill_text(t,e,r)+"\n\n"}_format_action(t){let e,r=Math.min(this._action_max_length+2,this._max_help_position),n=Math.max(this._width-r,11),i=r-this._current_indent-2,s=this._format_action_invocation(t);if(t.help)if(s.length<=i){let t=[this._current_indent,"",i,s];s=m("%*s%-*s ",...t),e=0}else{let t=[this._current_indent,"",s];s=m("%*s%s\n",...t),e=r}else{let t=[this._current_indent,"",s];s=m("%*s%s\n",...t)}let o=[s];if(t.help){let i=this._expand_help(t),s=this._split_lines(i,n);o.push(m("%*s%s\n",e,"",s[0]));for(let t of s.slice(1))o.push(m("%*s%s\n",r,"",t))}else s.endsWith("\n")||o.push("\n");for(let e of this._iter_indented_subactions(t))o.push(this._format_action(e));return this._join_parts(o)}_format_action_invocation(t){if(t.option_strings.length){let e=[];if(0===t.nargs)e=e.concat(t.option_strings);else{let r=this._get_default_metavar_for_optional(t),n=this._format_args(t,r);for(let r of t.option_strings)e.push(m("%s %s",r,n))}return e.join(", ")}{let e=this._get_default_metavar_for_positional(t);return this._metavar_formatter(t,e)(1)[0]}}_metavar_formatter(t,e){let r;if(void 0!==t.metavar)r=t.metavar;else if(void 0!==t.choices){let e=C(t.choices).map(String);r=m("{%s}",e.join(","))}else r=e;return function(t){return Array.isArray(r)?r:Array(t).fill(r)}}_format_args(t,e){let r,n=this._metavar_formatter(t,e);if(void 0===t.nargs)r=m("%s",...n(1));else if(t.nargs===o)r=m("[%s]",...n(1));else if(t.nargs===a){let t=n(1);r=2===t.length?m("[%s [%s ...]]",...t):m("[%s ...]",...t)}else if(t.nargs===u)r=m("%s [%s ...]",...n(2));else if(t.nargs===f)r="...";else if(t.nargs===l)r=m("%s ...",...n(1));else if(t.nargs===s)r="";else{let e;try{e=L(t.nargs).map((()=>"%s"))}catch(t){throw new TypeError("invalid nargs value")}r=m(e.join(" "),...n(t.nargs))}return r}_expand_help(t){let e=Object.assign({prog:this._prog},t);for(let t of Object.keys(e))e[t]===s&&delete e[t];for(let t of Object.keys(e))e[t]&&e[t].name&&(e[t]=e[t].name);if(void 0!==e.choices){let t=C(e.choices).map(String).join(", ");e.choices=t}for(let t of Object.keys(e)){let r=P(t);r!==t&&(e[r]=e[t])}return m(this._get_help_string(t),e)}*_iter_indented_subactions(t){"function"==typeof t._get_subactions&&(this._indent(),yield*t._get_subactions(),this._dedent())}_split_lines(t,e){return t=t.replace(this._whitespace_matcher," ").trim(),h().wrap(t,{width:e})}_fill_text(t,e,r){return t=t.replace(this._whitespace_matcher," ").trim(),h().fill(t,{width:e,initial_indent:r,subsequent_indent:r})}_get_help_string(t){return t.help}_get_default_metavar_for_optional(t){return t.dest.toUpperCase()}_get_default_metavar_for_positional(t){return t.dest}}));V.prototype._Section=D(class{constructor(t,e,r=void 0){this.formatter=t,this.parent=e,this.heading=r,this.items=[]}format_help(){void 0!==this.parent&&this.formatter._indent();let t,e=this.formatter._join_parts(this.items.map((([t,e])=>t.apply(null,e))));if(void 0!==this.parent&&this.formatter._dedent(),!e)return"";if(this.heading!==s&&void 0!==this.heading){let e=this.formatter._current_indent;t=m("%*s%s:\n",e,"",this.heading)}else t="";return this.formatter._join_parts(["\n",t,e,"\n"])}});const z=B(D(class extends V{_fill_text(t,e,r){return O(t,!0).map((t=>r+t)).join("")}})),W=B(D(class extends z{_split_lines(t){return O(t)}})),K=B(D(class extends V{_get_help_string(t){let e=t.help;if(!t.help.includes("%(default)")&&!t.help.includes("%(defaultValue)")&&t.default!==s){let r=[o,a];(t.option_strings.length||r.includes(t.nargs))&&(e+=" (default: %(default)s)")}return e}})),Y=B(D(class extends V{_get_default_metavar_for_optional(t){return"function"==typeof t.type?t.type.name:t.type}_get_default_metavar_for_positional(t){return"function"==typeof t.type?t.type.name:t.type}}));function X(t){return void 0===t?void 0:t.option_strings.length?t.option_strings.join("/"):[void 0,s].includes(t.metavar)?[void 0,s].includes(t.dest)?void 0:t.dest:t.metavar}const Z=D(class extends Error{constructor(t,e){super(),this.name="ArgumentError",this._argument_name=X(t),this._message=e,this.message=this.str()}str(){let t;return t=void 0===this._argument_name?"%(message)s":"argument %(argument_name)s: %(message)s",m(t,{message:this._message,argument_name:this._argument_name})}}),q=D(class extends Error{constructor(t){super(t),this.name="ArgumentTypeError"}}),$=B(D(class extends(H(Function)){constructor(){let[t,e,r,n,i,s,o,a,u,l]=G(arguments,{option_strings:U,dest:U,nargs:void 0,const:void 0,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0});super("return arguments.callee.call.apply(arguments.callee, arguments)"),this.option_strings=t,this.dest=e,this.nargs=r,this.const=n,this.default=i,this.type=s,this.choices=o,this.required=a,this.help=u,this.metavar=l}_get_kwargs(){return["option_strings","dest","nargs","const","default","type","choices","help","metavar"].map((t=>[t,b(this,t)]))}format_usage(){return this.option_strings[0]}call(){throw new Error(".call() not defined")}})),Q=B(D(class extends ${constructor(){let[t,e,r,n,i,s,o,a]=G(arguments,{option_strings:U,dest:U,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0}),u=[];for(let e of t)u.push(e),e.startsWith("--")&&(e="--no-"+e.slice(2),u.push(e));void 0!==o&&void 0!==r&&(o+=` (default: ${r})`),super({option_strings:u,dest:e,nargs:0,default:r,type:n,choices:i,required:s,help:o,metavar:a})}call(t,e,r,n=void 0){this.option_strings.includes(n)&&R(e,this.dest,!n.startsWith("--no-"))}format_usage(){return this.option_strings.join(" | ")}})),J=D(class extends ${constructor(){let[t,e,r,n,i,s,a,u,l,c]=G(arguments,{option_strings:U,dest:U,nargs:void 0,const:void 0,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0});if(0===r)throw new TypeError("nargs for store actions must be != 0; if you have nothing to store, actions such as store true or store const may be more appropriate");if(void 0!==n&&r!==o)throw new TypeError(m("nargs must be %r to supply const",o));super({option_strings:t,dest:e,nargs:r,const:n,default:i,type:s,choices:a,required:u,help:l,metavar:c})}call(t,e,r){R(e,this.dest,r)}}),tt=D(class extends ${constructor(){let[t,e,r,n,i,s]=G(arguments,{option_strings:U,dest:U,const:U,default:void 0,required:!1,help:void 0,metavar:void 0});super({option_strings:t,dest:e,nargs:0,const:r,default:n,required:i,help:s})}call(t,e){R(e,this.dest,this.const)}}),et=D(class extends tt{constructor(){let[t,e,r,n,i]=G(arguments,{option_strings:U,dest:U,default:!1,required:!1,help:void 0});super({option_strings:t,dest:e,const:!0,default:r,required:n,help:i})}}),rt=D(class extends tt{constructor(){let[t,e,r,n,i]=G(arguments,{option_strings:U,dest:U,default:!0,required:!1,help:void 0});super({option_strings:t,dest:e,const:!1,default:r,required:n,help:i})}}),nt=D(class extends ${constructor(){let[t,e,r,n,i,s,a,u,l,c]=G(arguments,{option_strings:U,dest:U,nargs:void 0,const:void 0,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0});if(0===r)throw new TypeError("nargs for append actions must be != 0; if arg strings are not supplying the value to append, the append const action may be more appropriate");if(void 0!==n&&r!==o)throw new TypeError(m("nargs must be %r to supply const",o));super({option_strings:t,dest:e,nargs:r,const:n,default:i,type:s,choices:a,required:u,help:l,metavar:c})}call(t,e,r){let n=b(e,this.dest,void 0);n=j(n),n.push(r),R(e,this.dest,n)}}),it=D(class extends ${constructor(){let[t,e,r,n,i,s,o]=G(arguments,{option_strings:U,dest:U,const:U,default:void 0,required:!1,help:void 0,metavar:void 0});super({option_strings:t,dest:e,nargs:0,const:r,default:n,required:i,help:s,metavar:o})}call(t,e){let r=b(e,this.dest,void 0);r=j(r),r.push(this.const),R(e,this.dest,r)}}),st=D(class extends ${constructor(){let[t,e,r,n,i]=G(arguments,{option_strings:U,dest:U,default:void 0,required:!1,help:void 0});super({option_strings:t,dest:e,nargs:0,default:r,required:n,help:i})}call(t,e){let r=b(e,this.dest,void 0);void 0===r&&(r=0),R(e,this.dest,r+1)}}),ot=D(class extends ${constructor(){let[t,e,r,n]=G(arguments,{option_strings:U,dest:s,default:s,help:void 0});super({option_strings:t,dest:e,default:r,nargs:0,help:n})}call(t){t.print_help(),t.exit()}}),at=D(class extends ${constructor(){let[t,e,r,n,i]=G(arguments,{option_strings:U,version:void 0,dest:s,default:s,help:"show program's version number and exit"});super({option_strings:t,dest:r,default:n,nargs:0,help:i}),this.version=e}call(t){let e=this.version;void 0===e&&(e=t.version);let r=t._get_formatter();r.add_text(e),t._print_message(r.format_help(),process.stdout),t.exit()}}),ut=B(D(class extends ${constructor(){let[t,e,r,n,i,o,a]=G(arguments,{option_strings:U,prog:U,parser_class:U,dest:s,required:!1,help:void 0,metavar:void 0}),u={};super({option_strings:t,dest:n,nargs:l,choices:u,required:i,help:o,metavar:a}),this._prog_prefix=e,this._parser_class=r,this._name_parser_map=u,this._choices_actions=[]}add_parser(){let[t,e]=G(arguments,{name:U,"**kwargs":U});void 0===e.prog&&(e.prog=m("%s %s",this._prog_prefix,t));let r=b(e,"aliases",[]);if(delete e.aliases,"help"in e){let n=e.help;delete e.help;let i=this._ChoicesPseudoAction(t,r,n);this._choices_actions.push(i)}let n=new this._parser_class(e);this._name_parser_map[t]=n;for(let t of r)this._name_parser_map[t]=n;return n}_get_subactions(){return this._choices_actions}call(t,e,r){let n,i=r[0],o=r.slice(1);if(this.dest!==s&&R(e,this.dest,i),!A(this._name_parser_map,i)){let t={parser_name:i,choices:this._name_parser_map.join(", ")},e=m("unknown parser %(parser_name)r (choices: %(choices)s)",t);throw new Z(this,e)}t=this._name_parser_map[i],[n,o]=t.parse_known_args(o,void 0);for(let[t,r]of Object.entries(n))R(e,t,r);o.length&&(T(e,_,[]),b(e,_).push(...o))}}));ut.prototype._ChoicesPseudoAction=D(class extends ${constructor(t,e,r){let n=t,i=t;e.length&&(n+=m(" (%s)",e.join(", "))),super({option_strings:[],dest:i,help:r,metavar:n})}});const lt=D(class extends nt{call(t,e,r){let n=b(e,this.dest,void 0);n=j(n),n=n.concat(r),R(e,this.dest,n)}}),ct=D(class extends Function{constructor(){let[t,e,r,n,i,s,o,a,u]=G(arguments,{flags:"r",encoding:void 0,mode:void 0,autoClose:void 0,emitClose:void 0,start:void 0,end:void 0,highWaterMark:void 0,fs:void 0});super("return arguments.callee.call.apply(arguments.callee, arguments)"),Object.defineProperty(this,"name",{get:()=>m("FileType(%r)",t)}),this._flags=t,this._options={},void 0!==e&&(this._options.encoding=e),void 0!==r&&(this._options.mode=r),void 0!==n&&(this._options.autoClose=n),void 0!==i&&(this._options.emitClose=i),void 0!==s&&(this._options.start=s),void 0!==o&&(this._options.end=o),void 0!==a&&(this._options.highWaterMark=a),void 0!==u&&(this._options.fs=u)}call(t){if("-"===t){if(this._flags.includes("r"))return process.stdin;if(this._flags.includes("w"))return process.stdout;{let t=m('argument "-" with mode %r',this._flags);throw new TypeError(t)}}let e;try{e=d.openSync(t,this._flags,this._options.mode)}catch(e){let r={filename:t,error:e.message};throw new q(m("can't open '%(filename)s': %(error)s",r))}let r=Object.assign({fd:e,flags:this._flags},this._options);if(this._flags.includes("r"))return d.createReadStream(void 0,r);if(this._flags.includes("w"))return d.createWriteStream(void 0,r);{let e=m('argument "%s" with mode %r',t,this._flags);throw new TypeError(e)}}[g.inspect.custom](){let t=[this._flags],e=Object.entries(this._options).map((([t,e])=>("mode"===t&&(e={value:e,[g.inspect.custom](){return"0o"+this.value.toString(8)}}),[t,e]))),r=[].concat(t.filter((t=>-1!==t)).map(v)).concat(e.filter((([,t])=>void 0!==t)).map((([t,e])=>m("%s=%r",t,e)))).join(", ");return m("%s(%s)",this.constructor.name,r)}toString(){return this[g.inspect.custom]()}}),ht=D(class extends(H()){constructor(t={}){super(),Object.assign(this,t)}});ht.prototype[Symbol.toStringTag]=void 0;const ft=B(D(class{constructor(){let[t,e,r,n]=G(arguments,{description:U,prefix_chars:U,argument_default:U,conflict_handler:U});this.description=t,this.argument_default=r,this.prefix_chars=e,this.conflict_handler=n,this._registries={},this.register("action",void 0,J),this.register("action","store",J),this.register("action","store_const",tt),this.register("action","store_true",et),this.register("action","store_false",rt),this.register("action","append",nt),this.register("action","append_const",it),this.register("action","count",st),this.register("action","help",ot),this.register("action","version",at),this.register("action","parsers",ut),this.register("action","extend",lt),["storeConst","storeTrue","storeFalse","appendConst"].forEach((t=>{let e=x(t);this.register("action",t,g.deprecate(this._registry_get("action",e),m('{action: "%s"} is renamed to {action: "%s"}',t,e)))})),this._get_handler(),this._actions=[],this._option_string_actions={},this._action_groups=[],this._mutually_exclusive_groups=[],this._defaults={},this._negative_number_matcher=/^-\d+$|^-\d*\.\d+$/,this._has_negative_number_optionals=[]}register(t,e,r){T(this._registries,t,{})[e]=r}_registry_get(t,e,r=void 0){return b(this._registries[t],e,r)}set_defaults(t){Object.assign(this._defaults,t);for(let e of this._actions)e.dest in t&&(e.default=t[e.dest])}get_default(t){for(let e of this._actions)if(e.dest===t&&void 0!==e.default)return e.default;return this._defaults[t]}add_argument(){let[t,e]=G(arguments,{"*args":U,"**kwargs":U});1===t.length&&Array.isArray(t[0])&&(t=t[0],F("argument-array",m("use add_argument(%(args)s, {...}) instead of add_argument([ %(args)s ], { ... })",{args:t.map(v).join(", ")})));let r=this.prefix_chars;if(!t.length||1===t.length&&!r.includes(t[0][0])){if(t.length&&"dest"in e)throw new TypeError("dest supplied twice for positional argument");e=this._get_positional_kwargs(...t,e)}else e=this._get_optional_kwargs(...t,e);if(!("default"in e)){let t=e.dest;t in this._defaults?e.default=this._defaults[t]:void 0!==this.argument_default&&(e.default=this.argument_default)}let n=this._pop_action_class(e);if("function"!=typeof n)throw new TypeError(m('unknown action "%s"',n));let i=new n(e),s=this._registry_get("type",i.type,i.type);if("function"!=typeof s)throw new TypeError(m("%r is not callable",s));if(s===ct)throw new TypeError(m("%r is a FileType class object, instance of it must be passed",s));if("_get_formatter"in this)try{this._get_formatter()._format_args(i,void 0)}catch(t){throw t instanceof TypeError&&"invalid nargs value"!==t.message?new TypeError("length of metavar tuple does not match nargs"):t}return this._add_action(i)}add_argument_group(){let t=_t(this,...arguments);return this._action_groups.push(t),t}add_mutually_exclusive_group(){let t=pt(this,...arguments);return this._mutually_exclusive_groups.push(t),t}_add_action(t){this._check_conflict(t),this._actions.push(t),t.container=this;for(let e of t.option_strings)this._option_string_actions[e]=t;for(let e of t.option_strings)this._negative_number_matcher.test(e)&&(this._has_negative_number_optionals.length||this._has_negative_number_optionals.push(!0));return t}_remove_action(t){w(this._actions,t)}_add_container_actions(t){let e={};for(let t of this._action_groups){if(t.title in e){throw new TypeError(m("cannot merge actions - two groups are named %r",t.title))}e[t.title]=t}let r=new Map;for(let n of t._action_groups){n.title in e||(e[n.title]=this.add_argument_group({title:n.title,description:n.description,conflict_handler:n.conflict_handler}));for(let t of n._group_actions)r.set(t,e[n.title])}for(let e of t._mutually_exclusive_groups){let t=this.add_mutually_exclusive_group({required:e.required});for(let n of e._group_actions)r.set(n,t)}for(let e of t._actions)r.get(e)._add_action(e)}_get_positional_kwargs(){let[t,e]=G(arguments,{dest:U,"**kwargs":U});if("required"in e){throw new TypeError("'required' is an invalid argument for positionals")}return[o,a].includes(e.nargs)||(e.required=!0),e.nargs!==a||"default"in e||(e.required=!0),Object.assign(e,{dest:t,option_strings:[]})}_get_optional_kwargs(){let t,[e,r]=G(arguments,{"*args":U,"**kwargs":U}),n=[],i=[];for(t of e){if(!this.prefix_chars.includes(t[0])){let e={option:t,prefix_chars:this.prefix_chars};throw new TypeError(m("invalid option string %(option)r: must start with a character %(prefix_chars)r",e))}n.push(t),t.length>1&&this.prefix_chars.includes(t[1])&&i.push(t)}let s=r.dest;if(delete r.dest,void 0===s){let e;if(e=i.length?i[0]:n[0],s=function(t,e){let r=0;for(;rt)).join(", ");throw new Z(t,m(r,n))}_handle_conflict_resolve(t,e){for(let[t,r]of e)w(r.option_strings,t),delete this._option_string_actions[t],r.option_strings.length||r.container._remove_action(r)}})),_t=D(class extends ft{constructor(){let[t,e,r,n]=G(arguments,{container:U,title:void 0,description:void 0,"**kwargs":U});T(n,"conflict_handler",t.conflict_handler),T(n,"prefix_chars",t.prefix_chars),T(n,"argument_default",t.argument_default),super(Object.assign({description:r},n)),this.title=e,this._group_actions=[],this._registries=t._registries,this._actions=t._actions,this._option_string_actions=t._option_string_actions,this._defaults=t._defaults,this._has_negative_number_optionals=t._has_negative_number_optionals,this._mutually_exclusive_groups=t._mutually_exclusive_groups}_add_action(t){return t=super._add_action(t),this._group_actions.push(t),t}_remove_action(t){super._remove_action(t),w(this._group_actions,t)}}),pt=D(class extends _t{constructor(){let[t,e]=G(arguments,{container:U,required:!1});super(t),this.required=e,this._container=t}_add_action(t){if(t.required){throw new TypeError("mutually exclusive arguments must be optional")}return t=this._container._add_action(t),this._group_actions.push(t),t}_remove_action(t){this._container._remove_action(t),w(this._group_actions,t)}}),gt=B(D(class extends(H(ft)){constructor(){let[t,e,r,n,i,o,a,u,l,c,h,f,_,p,d]=G(arguments,{prog:void 0,usage:void 0,description:void 0,epilog:void 0,parents:[],formatter_class:V,prefix_chars:"-",fromfile_prefix_chars:void 0,argument_default:void 0,conflict_handler:"error",add_help:!0,allow_abbrev:!0,exit_on_error:!0,debug:void 0,version:void 0});function v(t){return t}void 0!==p&&F("debug",'The "debug" argument to ArgumentParser is deprecated. Please override ArgumentParser.exit function instead.'),void 0!==d&&F("version","The \"version\" argument to ArgumentParser is deprecated. Please use add_argument(..., { action: 'version', version: 'N', ... }) instead."),super({description:r,prefix_chars:a,argument_default:l,conflict_handler:c}),void 0===t&&(t=E.basename(y()[0]||"")),this.prog=t,this.usage=e,this.epilog=n,this.formatter_class=o,this.fromfile_prefix_chars=u,this.add_help=h,this.allow_abbrev=f,this.exit_on_error=_,this.debug=p,this._positionals=this.add_argument_group("positional arguments"),this._optionals=this.add_argument_group("optional arguments"),this._subparsers=void 0,this.register("type",void 0,v),this.register("type",null,v),this.register("type","auto",v),this.register("type","int",(function(t){let e=Number(t);if(!Number.isInteger(e))throw new TypeError(m("could not convert string to int: %r",t));return e})),this.register("type","float",(function(t){let e=Number(t);if(isNaN(e))throw new TypeError(m("could not convert string to float: %r",t));return e})),this.register("type","str",String),this.register("type","string",g.deprecate(String,'use {type:"str"} or {type:String} instead of {type:"string"}'));let A=a.includes("-")?"-":a[0];this.add_help&&this.add_argument(A+"h",A.repeat(2)+"help",{action:"help",default:s,help:"show this help message and exit"}),d&&this.add_argument(A+"v",A.repeat(2)+"version",{action:"version",default:s,version:this.version,help:"show program's version number and exit"});for(let t of i)this._add_container_actions(t),Object.assign(this._defaults,t._defaults)}_get_kwargs(){return["prog","usage","description","formatter_class","conflict_handler","add_help"].map((t=>[t,b(this,t)]))}add_subparsers(){let[t]=G(arguments,{"**kwargs":U});if(void 0!==this._subparsers&&this.error("cannot have multiple subparser arguments"),T(t,"parser_class",this.constructor),"title"in t||"description"in t){let e=b(t,"title","subcommands"),r=b(t,"description",void 0);delete t.title,delete t.description,this._subparsers=this.add_argument_group(e,r)}else this._subparsers=this._positionals;if(void 0===t.prog){let e=this._get_formatter(),r=this._get_positional_actions(),n=this._mutually_exclusive_groups;e.add_usage(this.usage,r,n,""),t.prog=e.format_help().trim()}let e=new(this._pop_action_class(t,"parsers"))(Object.assign({option_strings:[]},t));return this._subparsers._add_action(e),e}_add_action(t){return t.option_strings.length?this._optionals._add_action(t):this._positionals._add_action(t),t}_get_optional_actions(){return this._actions.filter((t=>t.option_strings.length))}_get_positional_actions(){return this._actions.filter((t=>!t.option_strings.length))}parse_args(t=void 0,e=void 0){let r;if([t,r]=this.parse_known_args(t,e),r&&r.length>0){let t="unrecognized arguments: %s";this.error(m(t,r.join(" ")))}return t}parse_known_args(t=void 0,e=void 0){void 0===t&&(t=y().slice(1)),void 0===e&&(e=new ht);for(let t of this._actions)t.dest!==s&&(A(e,t.dest)||t.default!==s&&R(e,t.dest,t.default));for(let t of Object.keys(this._defaults))A(e,t)||R(e,t,this._defaults[t]);if(this.exit_on_error)try{[e,t]=this._parse_known_args(t,e)}catch(t){if(!(t instanceof Z))throw t;this.error(t.message)}else[e,t]=this._parse_known_args(t,e);return A(e,_)&&(t=t.concat(b(e,_)),I(e,_)),[e,t]}_parse_known_args(t,e){void 0!==this.fromfile_prefix_chars&&(t=this._read_args_from_files(t));let r=new Map;for(let t of this._mutually_exclusive_groups){let e=t._group_actions;for(let[n,i]of Object.entries(t._group_actions)){let t=r.get(i)||[];t=t.concat(e.slice(0,+n)),t=t.concat(e.slice(+n+1)),r.set(i,t)}}let n={},i=[],o=Object.entries(t)[Symbol.iterator]();for(let[t,e]of o)if("--"===e)for([t,e]of(i.push("-"),o))i.push("A");else{let r,s=this._parse_optional(e);void 0===s?r="A":(n[t]=s,r="O"),i.push(r)}let a,u=i.join(""),l=new Set,c=new Set,h=(t,n,i=void 0)=>{l.add(t);let o=this._get_values(t,n);if(o!==t.default){c.add(t);for(let e of r.get(t)||[])if(c.has(e)){let r="not allowed with argument %s",n=X(e);throw new Z(t,m(r,n))}}o!==s&&t(this,e,o,i)},f=e=>{let r,i=n[e],[s,o,l]=i,c=[];for(;;){if(void 0===s)return a.push(t[e]),e+1;if(void 0===l){let n=e+1,i=u.slice(n);r=n+this._match_argument(s,i);let a=t.slice(n,r);c.push([s,a,o]);break}{let t=this._match_argument(s,"A"),n=this.prefix_chars;if(0!==t||n.includes(o[1])){if(1===t){r=e+1;let t=[l];c.push([s,t,o]);break}throw new Z(s,m("ignored explicit argument %r",l))}{c.push([s,[],o]),o=o[0]+l[0];let t=l.slice(1)||void 0,e=this._option_string_actions;if(!A(e,o)){throw new Z(s,m("ignored explicit argument %r",l))}s=e[o],l=t}}}p(c.length);for(let[t,e,r]of c)h(t,e,r);return r},_=this._get_positional_actions(),g=e=>{let r=u.slice(e),n=this._match_arguments_partial(_,r);for(let r=0;r<_.length&&rt>=d)));if(d!==e){let t=g(d);if(t>d){d=t;continue}d=t}if(!(d in n)){let r=t.slice(d,e);a=a.concat(r),d=e}d=f(d)}let v=g(d);a=a.concat(t.slice(v));let y=[];for(let t of this._actions)l.has(t)||(t.required?y.push(X(t)):void 0!==t.default&&"string"==typeof t.default&&A(e,t.dest)&&t.default===b(e,t.dest)&&R(e,t.dest,this._get_value(t,t.default)));y.length&&this.error(m("the following arguments are required: %s",y.join(", ")));for(let t of this._mutually_exclusive_groups)if(t.required){let e=!0;for(let r of t._group_actions)if(c.has(r)){e=!1;break}if(e){let e=t._group_actions.filter((t=>t.help!==s)).map((t=>X(t))),r="one of the arguments %s is required";this.error(m(r,e.join(" ")))}}return[e,a]}_read_args_from_files(t){let e=[];for(let r of t)if(r&&this.fromfile_prefix_chars.includes(r[0]))try{let t=d.readFileSync(r.slice(1),"utf8"),n=[];for(let e of O(t))for(let t of this.convert_arg_line_to_args(e))n.push(t);n=this._read_args_from_files(n),e=e.concat(n)}catch(t){this.error(t.message)}else e.push(r);return e}convert_arg_line_to_args(t){return[t]}_match_argument(t,e){let r=this._get_nargs_pattern(t),n=e.match(new RegExp("^"+r));if(null===n){let e={undefined:"expected one argument",[o]:"expected at most one argument",[u]:"expected at least one argument"}[t.nargs];throw void 0===e&&(e=m(1===t.nargs?"expected %s argument":"expected %s arguments",t.nargs)),new Z(t,e)}return n[1].length}_match_arguments_partial(t,e){let r=[];for(let n of L(t.length,0,-1)){let i=t.slice(0,n).map((t=>this._get_nargs_pattern(t))).join(""),s=e.match(new RegExp("^"+i));if(null!==s){r=r.concat(s.slice(1).map((t=>t.length)));break}}return r}_parse_optional(t){if(!t)return;if(!this.prefix_chars.includes(t[0]))return;if(t in this._option_string_actions){return[this._option_string_actions[t],t,void 0]}if(1===t.length)return;if(t.includes("=")){let[e,r]=S(t,"=",1);if(e in this._option_string_actions){return[this._option_string_actions[e],e,r]}}let e=this._get_option_tuples(t);if(e.length>1){let r={option:t,matches:e.map((([,t])=>t)).join(", ")},n="ambiguous option: %(option)s could match %(matches)s";this.error(m(n,r))}else if(1===e.length){let[t]=e;return t}return this._negative_number_matcher.test(t)&&!this._has_negative_number_optionals.length||t.includes(" ")?void 0:[void 0,t,void 0]}_get_option_tuples(t){let e=[],r=this.prefix_chars;if(r.includes(t[0])&&r.includes(t[1])){if(this.allow_abbrev){let r,n;t.includes("=")?[r,n]=S(t,"=",1):(r=t,n=void 0);for(let t of Object.keys(this._option_string_actions))if(t.startsWith(r)){let r=[this._option_string_actions[t],t,n];e.push(r)}}}else if(r.includes(t[0])&&!r.includes(t[1])){let r,n=t,i=t.slice(0,2),s=t.slice(2);for(let t of Object.keys(this._option_string_actions))if(t===i){let r=[this._option_string_actions[t],t,s];e.push(r)}else if(t.startsWith(n)){let n=[this._option_string_actions[t],t,r];e.push(n)}}else this.error(m("unexpected option string: %s",t));return e}_get_nargs_pattern(t){let e,r=t.nargs;return e=void 0===r?"(-*A-*)":r===o?"(-*A?-*)":r===a?"(-*[A-]*)":r===u?"(-*A[A-]*)":r===f?"([-AO]*)":r===l?"(-*A[-AO]*)":r===s?"(-*-*)":m("(-*%s-*)","A".repeat(r).split("").join("-*")),t.option_strings.length&&(e=e.replace(/-\*/g,""),e=e.replace(/-/g,"")),e}parse_intermixed_args(t=void 0,e=void 0){let r;if([t,r]=this.parse_known_intermixed_args(t,e),r.length){let t="unrecognized arguments: %s";this.error(m(t,r.join(" ")))}return t}parse_known_intermixed_args(t=void 0,e=void 0){let r,n,i=this._get_positional_actions(),o=i.filter((t=>[l,f].includes(t.nargs)));if(o.length)throw new TypeError(m("parse_intermixed_args: positional arg with nargs=%s",o[0].nargs));for(let t of this._mutually_exclusive_groups)for(let e of t._group_actions)if(i.includes(e))throw new TypeError("parse_intermixed_args: positional in mutuallyExclusiveGroup");try{let o;n=this.usage;try{void 0===this.usage&&(this.usage=this.format_usage().slice(7));for(let t of i)t.save_nargs=t.nargs,t.nargs=s,t.save_default=t.default,t.default=s;[e,o]=this.parse_known_args(t,e);for(let t of i){let r=b(e,t.dest);Array.isArray(r)&&0===r.length&&(console.warn(m("Do not expect %s in %s",t.dest,e)),I(e,t.dest))}}finally{for(let t of i)t.nargs=t.save_nargs,t.default=t.save_default}let a=this._get_optional_actions();try{for(let t of a)t.save_required=t.required,t.required=!1;for(let t of this._mutually_exclusive_groups)t.save_required=t.required,t.required=!1;[e,r]=this.parse_known_args(o,e)}finally{for(let t of a)t.required=t.save_required;for(let t of this._mutually_exclusive_groups)t.required=t.save_required}}finally{this.usage=n}return[e,r]}_get_values(t,e){if(![l,f].includes(t.nargs))try{w(e,"--")}catch(t){}let r;if(e.length||t.nargs!==o)if(e.length||t.nargs!==a||t.option_strings.length)if(1===e.length&&[void 0,o].includes(t.nargs)){let n=e[0];r=this._get_value(t,n),this._check_value(t,r)}else if(t.nargs===f)r=e.map((e=>this._get_value(t,e)));else if(t.nargs===l)r=e.map((e=>this._get_value(t,e))),this._check_value(t,r[0]);else if(t.nargs===s)r=s;else{r=e.map((e=>this._get_value(t,e)));for(let e of r)this._check_value(t,e)}else r=void 0!==t.default?t.default:e,this._check_value(t,r);else r=t.option_strings.length?t.const:t.default,"string"==typeof r&&(r=this._get_value(t,r),this._check_value(t,r));return r}_get_value(t,e){let r,n=this._registry_get("type",t.type,t.type);if("function"!=typeof n){throw new Z(t,m("%r is not callable",n))}try{try{r=n(e)}catch(t){if(!(t instanceof TypeError&&/Class constructor .* cannot be invoked without 'new'/.test(t.message)))throw t;r=new n(e)}}catch(r){if(r instanceof q){let e=r.message;throw new Z(t,e)}if(r instanceof TypeError){let r=b(t.type,"name",v(t.type));throw new Z(t,m("invalid %(type)s value: %(value)r",{type:r,value:e}))}throw r}return r}_check_value(t,e){if(void 0!==t.choices&&!C(t.choices).includes(e)){let r={value:e,choices:C(t.choices).map(v).join(", ")};throw new Z(t,m("invalid choice: %(value)r (choose from %(choices)s)",r))}}format_usage(){let t=this._get_formatter();return t.add_usage(this.usage,this._actions,this._mutually_exclusive_groups),t.format_help()}format_help(){let t=this._get_formatter();t.add_usage(this.usage,this._actions,this._mutually_exclusive_groups),t.add_text(this.description);for(let e of this._action_groups)t.start_section(e.title),t.add_text(e.description),t.add_arguments(e._group_actions),t.end_section();return t.add_text(this.epilog),t.format_help()}_get_formatter(){return new this.formatter_class({prog:this.prog})}print_usage(t=void 0){void 0===t&&(t=process.stdout),this._print_message(this.format_usage(),t)}print_help(t=void 0){void 0===t&&(t=process.stdout),this._print_message(this.format_help(),t)}_print_message(t,e=void 0){t&&(void 0===e&&(e=process.stderr),e.write(t))}exit(t=0,e=void 0){e&&this._print_message(e,process.stderr),process.exit(t)}error(t){if(!0===this.debug)throw new Error(t);this.print_usage(process.stderr);let e={prog:this.prog,message:t};this.exit(2,m("%(prog)s: error: %(message)s\n",e))}}));e.exports={ArgumentParser:gt,ArgumentError:Z,ArgumentTypeError:q,BooleanOptionalAction:Q,FileType:ct,HelpFormatter:V,ArgumentDefaultsHelpFormatter:K,RawDescriptionHelpFormatter:z,RawTextHelpFormatter:W,MetavarTypeHelpFormatter:Y,Namespace:ht,Action:$,ONE_OR_MORE:u,OPTIONAL:o,PARSER:l,REMAINDER:f,SUPPRESS:s,ZERO_OR_MORE:a},Object.defineProperty(e.exports,"Const",{get(){let t={};return Object.entries({ONE_OR_MORE:u,OPTIONAL:o,PARSER:l,REMAINDER:f,SUPPRESS:s,ZERO_OR_MORE:a}).forEach((([e,r])=>{Object.defineProperty(t,e,{get:()=>(F(e,m("use argparse.%s instead of argparse.Const.%s",e,e)),r)})})),Object.entries({_UNRECOGNIZED_ARGS_ATTR:_}).forEach((([e,r])=>{Object.defineProperty(t,e,{get:()=>(F(e,m("argparse.Const.%s is an internal symbol and will no longer be available",e)),r)})})),t},enumerable:!1})}(o);var f=o.exports,_=function(t,e){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},_(t,e)};function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}_(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var g,d,m,E=function(){return E=Object.assign||function(t){for(var e,r=1,n=arguments.length;r1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(U,(function(t,r,n,i,s,o){if(r)e.minimumIntegerDigits=n.length;else{if(i&&s)throw new Error("We currently do not support maximum integer digits");if(o)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(G.test(i.stem))e.minimumIntegerDigits=i.stem.length;else if(P.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(P,(function(t,r,n,i,s,o){return"*"===n?e.minimumFractionDigits=r.length:i&&"#"===i[0]?e.maximumFractionDigits=i.length:s&&o?(e.minimumFractionDigits=s.length,e.maximumFractionDigits=s.length+o.length):(e.minimumFractionDigits=r.length,e.maximumFractionDigits=r.length),""}));var s=i.options[0];"w"===s?e=E(E({},e),{trailingZeroDisplay:"stripIfInteger"}):s&&(e=E(E({},e),k(s)))}else if(x.test(i.stem))e=E(E({},e),k(i.stem));else{var o=F(i.stem);o&&(e=E(E({},e),o));var a=H(i.stem);a&&(e=E(E({},e),a))}}return e}var z,W={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function K(t){var e=t.hourCycle;if(void 0===e&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r,n=t.language;return"root"!==n&&(r=t.maximize().region),(W[r||""]||W[n||""]||W["".concat(n,"-001")]||W["001"])[0]}var Y=new RegExp("^".concat(C.source,"*")),X=new RegExp("".concat(C.source,"*$"));function Z(t,e){return{start:t,end:e}}var q=!!String.prototype.startsWith,$=!!String.fromCodePoint,Q=!!Object.fromEntries,J=!!String.prototype.codePointAt,tt=!!String.prototype.trimStart,et=!!String.prototype.trimEnd,rt=!!Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},nt=!0;try{nt="a"===(null===(z=ht("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===z?void 0:z[0])}catch(t){nt=!1}var it,st=q?function(t,e,r){return t.startsWith(e,r)}:function(t,e,r){return t.slice(r,r+e.length)===e},ot=$?String.fromCodePoint:function(){for(var t=[],e=0;es;){if((r=t[s++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},at=Q?Object.fromEntries:function(t){for(var e={},r=0,n=t;r=r)){var n,i=t.charCodeAt(e);return i<55296||i>56319||e+1===r||(n=t.charCodeAt(e+1))<56320||n>57343?i:n-56320+(i-55296<<10)+65536}},lt=tt?function(t){return t.trimStart()}:function(t){return t.replace(Y,"")},ct=et?function(t){return t.trimEnd()}:function(t){return t.replace(X,"")};function ht(t,e){return new RegExp(t,e)}if(nt){var ft=ht("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");it=function(t,e){var r;return ft.lastIndex=e,null!==(r=ft.exec(t)[1])&&void 0!==r?r:""}}else it=function(t,e){for(var r=[];;){var n=ut(t,e);if(void 0===n||gt(n)||dt(n))break;r.push(n),e+=n>=65536?2:1}return ot.apply(void 0,r)};var _t=function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,r){for(var n=[];!this.isEOF();){var i=this.char();if(123===i){if((s=this.parseArgument(t,r)).err)return s;n.push(s.val)}else{if(125===i&&t>0)break;if(35!==i||"plural"!==e&&"selectordinal"!==e){if(60===i&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(g.UNMATCHED_CLOSING_TAG,Z(this.clonePosition(),this.clonePosition()))}if(60===i&&!this.ignoreTag&&pt(this.peek()||0)){if((s=this.parseTag(t,e)).err)return s;n.push(s.val)}else{var s;if((s=this.parseLiteral(t,e)).err)return s;n.push(s.val)}}else{var o=this.clonePosition();this.bump(),n.push({type:d.pound,location:Z(o,this.clonePosition())})}}}return{val:n,err:null}},t.prototype.parseTag=function(t,e){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:d.literal,value:"<".concat(n,"/>"),location:Z(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(t+1,e,!0);if(i.err)return i;var s=i.val,o=this.clonePosition();if(this.bumpIf("")?{val:{type:d.tag,value:n,children:s,location:Z(r,this.clonePosition())},err:null}:this.error(g.INVALID_TAG,Z(o,this.clonePosition())))}return this.error(g.UNCLOSED_TAG,Z(r,this.clonePosition()))}return this.error(g.INVALID_TAG,Z(r,this.clonePosition()))},t.prototype.parseTagName=function(){var t,e=this.offset();for(this.bump();!this.isEOF()&&(45===(t=this.char())||46===t||t>=48&&t<=57||95===t||t>=97&&t<=122||t>=65&&t<=90||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039);)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(t,e){for(var r=this.clonePosition(),n="";;){var i=this.tryParseQuote(e);if(i)n+=i;else{var s=this.tryParseUnquoted(t,e);if(s)n+=s;else{var o=this.tryParseLeftAngleBracket();if(!o)break;n+=o}}}var a=Z(r,this.clonePosition());return{val:{type:d.literal,value:n,location:a},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(pt(t=this.peek()||0)||47===t)?null:(this.bump(),"<");var t},t.prototype.tryParseQuote=function(t){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();var e=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(39===r){if(39!==this.peek()){this.bump();break}e.push(39),this.bump()}else e.push(r);this.bump()}return ot.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===e||"selectordinal"===e)||125===r&&t>0?null:(this.bump(),ot(r))},t.prototype.parseArgument=function(t,e){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Z(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(g.EMPTY_ARGUMENT,Z(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(g.MALFORMED_ARGUMENT,Z(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Z(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:d.argument,value:n,location:Z(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Z(r,this.clonePosition())):this.parseArgumentOptions(t,e,n,r);default:return this.error(g.MALFORMED_ARGUMENT,Z(r,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),r=it(this.message,e),n=e+r.length;return this.bumpTo(n),{value:r,location:Z(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,r,n){var i,s=this.clonePosition(),o=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(o){case"":return this.error(g.EXPECT_ARGUMENT_TYPE,Z(s,a));case"number":case"date":case"time":this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition();if((A=this.parseSimpleArgStyleIfPossible()).err)return A;if(0===(_=ct(A.val)).length)return this.error(g.EXPECT_ARGUMENT_STYLE,Z(this.clonePosition(),this.clonePosition()));u={style:_,styleLocation:Z(l,this.clonePosition())}}if((b=this.tryParseArgumentClose(n)).err)return b;var c=Z(n,this.clonePosition());if(u&&st(null==u?void 0:u.style,"::",0)){var h=lt(u.style.slice(2));if("number"===o)return(A=this.parseNumberSkeletonFromString(h,u.styleLocation)).err?A:{val:{type:d.number,value:r,location:c,style:A.val},err:null};if(0===h.length)return this.error(g.EXPECT_DATE_TIME_SKELETON,c);var f=h;this.locale&&(f=function(t,e){for(var r="",n=0;n>1),u=K(e);for("H"!=u&&"k"!=u||(a=0);a-- >0;)r+="a";for(;o-- >0;)r=u+r}else r+="J"===i?"H":i}return r}(h,this.locale));var _={type:m.dateTime,pattern:f,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?M(f):{}};return{val:{type:"date"===o?d.date:d.time,value:r,location:c,style:_},err:null}}return{val:{type:"number"===o?d.number:"date"===o?d.date:d.time,value:r,location:c,style:null!==(i=null==u?void 0:u.style)&&void 0!==i?i:null},err:null};case"plural":case"selectordinal":case"select":var p=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(g.EXPECT_SELECT_ARGUMENT_OPTIONS,Z(p,E({},p)));this.bumpSpace();var v=this.parseIdentifierIfPossible(),y=0;if("select"!==o&&"offset"===v.value){if(!this.bumpIf(":"))return this.error(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Z(this.clonePosition(),this.clonePosition()));var A;if(this.bumpSpace(),(A=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,g.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return A;this.bumpSpace(),v=this.parseIdentifierIfPossible(),y=A.val}var b,R=this.tryParsePluralOrSelectOptions(t,o,e,v);if(R.err)return R;if((b=this.tryParseArgumentClose(n)).err)return b;var T=Z(n,this.clonePosition());return"select"===o?{val:{type:d.select,value:r,options:at(R.val),location:T},err:null}:{val:{type:d.plural,value:r,options:at(R.val),offset:y,pluralType:"plural"===o?"cardinal":"ordinal",location:T},err:null};default:return this.error(g.INVALID_ARGUMENT_TYPE,Z(s,a))}},t.prototype.tryParseArgumentClose=function(t){return this.isEOF()||125!==this.char()?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Z(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(g.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Z(r,this.clonePosition()));this.bump();break;case 123:t+=1,this.bump();break;case 125:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var r=[];try{r=function(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");for(var e=[],r=0,n=t.split(B).filter((function(t){return t.length>0}));r=48&&o<=57))break;i=!0,s=10*s+(o-48),this.bump()}var a=Z(n,this.clonePosition());return i?rt(s*=r)?{val:s,err:null}:this.error(e,a):this.error(t,a)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=ut(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},t.prototype.bumpIf=function(t){if(st(this.message,t,this.offset())){for(var e=0;e=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&>(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),r=this.message.charCodeAt(e+(t>=65536?2:1));return null!=r?r:null},t}();function pt(t){return t>=97&&t<=122||t>=65&&t<=90}function gt(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}function dt(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function mt(t){t.forEach((function(t){if(delete t.location,I(t)||L(t))for(var e in t.options)delete t.options[e].location,mt(t.options[e].value);else b(t)&&N(t.style)||(R(t)||T(t))&&w(t.style)?delete t.style.location:S(t)&&mt(t.children)}))}function Et(t,e){void 0===e&&(e={}),e=E({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var r=new _t(t,e).parse();if(r.err){var n=SyntaxError(g[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return(null==e?void 0:e.captureLocation)||mt(r.val),r.val}function vt(t,e){var r=e&&e.cache?e.cache:Ot,n=e&&e.serializer?e.serializer:Tt;return(e&&e.strategy?e.strategy:Rt)(t,{cache:r,serializer:n})}function yt(t,e,r,n){var i,s=null==(i=n)||"number"==typeof i||"boolean"==typeof i?n:r(n),o=e.get(s);return void 0===o&&(o=t.call(this,n),e.set(s,o)),o}function At(t,e,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),s=e.get(i);return void 0===s&&(s=t.apply(this,n),e.set(i,s)),s}function bt(t,e,r,n,i){return r.bind(e,t,n,i)}function Rt(t,e){return bt(t,this,1===t.length?yt:At,e.cache.create(),e.serializer)}var Tt=function(){return JSON.stringify(arguments)};function It(){this.cache=Object.create(null)}It.prototype.get=function(t){return this.cache[t]},It.prototype.set=function(t,e){this.cache[t]=e};var Lt,Ot={create:function(){return new It}},St={variadic:function(t,e){return bt(t,this,At,e.cache.create(),e.serializer)},monadic:function(t,e){return bt(t,this,yt,e.cache.create(),e.serializer)}};!function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"}(Lt||(Lt={}));var Nt,wt=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.code=r,i.originalMessage=n,i}return p(e,t),e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),Ct=function(t){function e(e,r,n,i){return t.call(this,'Invalid values for "'.concat(e,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),Lt.INVALID_VALUE,i)||this}return p(e,t),e}(wt),Dt=function(t){function e(e,r,n){return t.call(this,'Value for "'.concat(e,'" must be of type ').concat(r),Lt.INVALID_VALUE,n)||this}return p(e,t),e}(wt),Mt=function(t){function e(e,r){return t.call(this,'The intl string context variable "'.concat(e,'" was not provided to the string "').concat(r,'"'),Lt.MISSING_VALUE,r)||this}return p(e,t),e}(wt);function Bt(t){return"function"==typeof t}function Pt(t,e,r,n,i,s,o){if(1===t.length&&y(t[0]))return[{type:Nt.literal,value:t[0].value}];for(var a=[],u=0,l=t;u0?new Intl.Locale(e[0]):new Intl.Locale("string"==typeof t?t:t[0])}},t.__parse=Et,t.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},t}();!function(t){t.FORMAT_ERROR="FORMAT_ERROR",t.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",t.INVALID_CONFIG="INVALID_CONFIG",t.MISSING_DATA="MISSING_DATA",t.MISSING_TRANSLATION="MISSING_TRANSLATION"}(Gt||(Gt={}));var Ft=function(t){function e(r,n,i){var s=this,o=i?i instanceof Error?i:new Error(String(i)):void 0;return(s=t.call(this,"[@formatjs/intl Error ".concat(r,"] ").concat(n,"\n").concat(o?"\n".concat(o.message,"\n").concat(o.stack):""))||this).code=r,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s,e),s}return p(e,t),e}(Error),Ht=function(t){function e(e,r){return t.call(this,Gt.UNSUPPORTED_FORMATTER,e,r)||this}return p(e,t),e}(Ft),jt=function(t){function e(e,r){return t.call(this,Gt.INVALID_CONFIG,e,r)||this}return p(e,t),e}(Ft),Vt=function(t){function e(e,r){return t.call(this,Gt.MISSING_DATA,e,r)||this}return p(e,t),e}(Ft),zt=function(t){function e(e,r,n){var i=t.call(this,Gt.FORMAT_ERROR,"".concat(e,"\nLocale: ").concat(r,"\n"),n)||this;return i.locale=r,i}return p(e,t),e}(Ft),Wt=function(t){function e(e,r,n,i){var s=t.call(this,"".concat(e,"\nMessageID: ").concat(null==n?void 0:n.id,"\nDefault Message: ").concat(null==n?void 0:n.defaultMessage,"\nDescription: ").concat(null==n?void 0:n.description,"\n"),r,i)||this;return s.descriptor=n,s.locale=r,s}return p(e,t),e}(zt),Kt=function(t){function e(e,r){var n=t.call(this,Gt.MISSING_TRANSLATION,'Missing message: "'.concat(e.id,'" for locale "').concat(r,'", using ').concat(e.defaultMessage?"default message (".concat("string"==typeof e.defaultMessage?e.defaultMessage:e.defaultMessage.map((function(t){var e;return null!==(e=t.value)&&void 0!==e?e:JSON.stringify(t)})).join(),")"):"id"," as fallback."))||this;return n.descriptor=e,n}return p(e,t),e}(Ft);function Yt(t,e,r){return void 0===r&&(r={}),e.reduce((function(e,n){return n in t?e[n]=t[n]:n in r&&(e[n]=r[n]),e}),{})}var Xt={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:function(t){"production"!==process.env.NODE_ENV&&console.error(t)},onWarn:function(t){"production"!==process.env.NODE_ENV&&console.warn(t)}};function Zt(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,r){t[e]=r}}}}}function qt(t,e,r,n){var i,s=t&&t[e];if(s&&(i=s[r]),i)return i;n(new Ht("No ".concat(e," format named: ").concat(r)))}function $t(t,e){return Object.keys(t).reduce((function(r,n){return r[n]=E({timeZone:e},t[n]),r}),{})}function Qt(t,e){return Object.keys(E(E({},t),e)).reduce((function(r,n){return r[n]=E(E({},t[n]||{}),e[n]||{}),r}),{})}function Jt(t,e){if(!e)return t;var r=kt.formats;return E(E(E({},r),t),{date:Qt($t(r.date,e),$t(t.date||{},e)),time:Qt($t(r.time,e),$t(t.time||{},e))})}var te=function(t,e,r,n,i){var s=t.locale,o=t.formats,a=t.messages,u=t.defaultLocale,l=t.defaultFormats,c=t.fallbackOnEmptyString,h=t.onError,f=t.timeZone,_=t.defaultRichTextElements;void 0===r&&(r={id:""});var p=r.id,g=r.defaultMessage;!function(t,e,r){if(void 0===r&&(r=Error),!t)throw new r(e)}(!!p,"[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");var m=String(p),v=a&&Object.prototype.hasOwnProperty.call(a,m)&&a[m];if(Array.isArray(v)&&1===v.length&&v[0].type===d.literal)return v[0].value;if(!n&&v&&"string"==typeof v&&!_)return v.replace(/'\{(.*?)\}'/gi,"{$1}");if(n=E(E({},_),n||{}),o=Jt(o,f),l=Jt(l,f),!v){if(!1===c&&""===v)return v;if((!g||s&&s.toLowerCase()!==u.toLowerCase())&&h(new Kt(r,s)),g)try{return e.getMessageFormat(g,u,l,i).format(n)}catch(t){return h(new Wt('Error formatting default message for: "'.concat(m,'", rendering default message verbatim'),s,r,t)),"string"==typeof g?g:m}return m}try{return e.getMessageFormat(v,s,o,E({formatters:e},i||{})).format(n)}catch(t){h(new Wt('Error formatting message: "'.concat(m,'", using ').concat(g?"default message":"id"," as fallback."),s,r,t))}if(g)try{return e.getMessageFormat(g,u,l,i).format(n)}catch(t){h(new Wt('Error formatting the default message for: "'.concat(m,'", rendering message verbatim'),s,r,t))}return"string"==typeof v?v:"string"==typeof g?g:m},ee=["formatMatcher","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName","hourCycle","dateStyle","timeStyle","calendar","numberingSystem","fractionalSecondDigits"];function re(t,e,r,n){var i=t.locale,s=t.formats,o=t.onError,a=t.timeZone;void 0===n&&(n={});var u=n.format,l=E(E({},a&&{timeZone:a}),u&&qt(s,e,u,o)),c=Yt(n,ee,l);return"time"!==e||c.hour||c.minute||c.second||c.timeStyle||c.dateStyle||(c=E(E({},c),{hour:"numeric",minute:"numeric"})),r(i,c)}function ne(t,e){for(var r=[],n=2;n",READ_INPUT:"{value}",PROGRAM_EXITED:"程序执行结束,返回值为{returnValue}。",EXECUTION_STEP_COUNT_TIME:"总执行步数:{stepCount, number};总执行耗时:{time, number}ms"}},{name:"English",locale:{APP_TITLE:"IR Virtual Machine",ADD:"New",IMPORT:"Import",DEMOS:"Demos",DEMO_SOURCES:"Sources",SAVE:"Save",THEME:"Theme",ABOUT:"About",CLOSE:"Close",CONFIRM_UNSAVED_CLOSE:"Save changes to {name} before close?",SAVE_CLOSE:"Save&Close",UNSAVE_CLOSE:"Close",OK:"OK",CANCEL:"Cancel",EMPTY_PLACEHOLDER_DESC:"An IR virtual machine for HIT/NJU Compilation Principle labs",EMPTY_PLACEHOLDER_HINT_TITLE:"You may:",EMPTY_PLACEHOLDER_HINT_1:"Add or import .ir files in left sidebar",EMPTY_PLACEHOLDER_HINT_2:"Drag one or more .ir files inside",EMPTY_PLACEHOLDER_HINT_3:"Try out Demos in left sidebar",FETCH_FAILED:"fetch() for {url} failed",NOT_AN_IR_FILE:"{fileName} is not an ir file",IR_IMPORT_FAILED:"Failed to import {fileName}",RUN:"Run",RUN_STEP:"Step",RESET:"Reset",CLEAR_CONSOLE:"Clear",STEP_COUNT:"Step Count: ",STEP_COUNT_NUMBER:"{stepCount, number}",STATE:"VM State: ",STATE_INITIAL:"Initial",STATE_BUSY:"Busy",STATE_WAIT_INPUT:"Awaiting Input",STATE_FREE:"Free",STATE_STATIC_CHECK_FAILED:"IR Static Check Error",STATE_RUNTIME_ERROR:"Runtime Error",STATE_MAX_STEP_REACHED:"Max Step Count Reached",STATE_EXITED_NORMALLY:"Exited Normally (Return value 0)",STATE_EXITED_ABNORMALLY:"Exited Abnormally (Return value not 0)",MAX_EXECUTION_STEP_COUNT:"Max Steps",SET_0_MEANS_NO_STEP_LIMIT:"No step limit if set to 0",MEMORY_SIZE:"Memory Size/B",STACK_SIZE:"Stack Size/B",TOTAL_MEMORY_USAGE:"Total Memory Usage: ",STACK_MEMORY_USAGE:"Stack Memory Usage: ",GLOBAL_VARIABLE_MEMORY_USAGE:"GlobalVar Memory Usage: ",PEAK_MEMORY_USAGE:"Peak Usage: ",PERCENTAGE_USAGE:"{percentage, number, ::.0}%",BYTE_USAGE:"{used}B/{total}B",ARBITRARY_UNIT_MEMORY_USAGE:"{used, number, ::.0}{unit}/{total, number, ::.0}{unit}",BYTE_SIZE:"{size}B",ARBITRARY_UNIT_SIZE:"{size, number, ::.0}{unit}",GLOBAL_VARIABLE_TABLE:"Global Variable Table",LOCAL_VARIABLE_TABLE:"Local Variable Table",VARIABLE_ID:"ID",ADDRESS:"Address",SIZE:"Size",VALUES:"Value",EMPTY_VATIABLE_TABLE:"(Empty)",CALL_STACK_DEPTH:"Call stack depth {depth}",STATIC_ERROR_PREFIX:"Static Check Error (Line {lineNumber}): ",STATIC_ERROR_PREFIX_NO_LINE_NUMBER:"Static Check Error: ",DECODE_ERROR_PREFIX:"IR Decoding Error (Line {lineNumber}): ",UNRECOGNIZED_INSTRUCTION:"Unrecognized IR instruction",ILLEGAL_INSTRUCTION_FORMAT:"Illegal IR format",FUNCTION_ILLEGAL_ID:"FUNCTION id illegal",ASSIGN_ILLEGAL_LEFT:"Illegal left hand side of assignment",ASSIGN_ILLEGAL_RIGHT:"Illegal right hand side of assignment",ASSIGN_RIGHT_IMM_TOO_LARGE:"Right hand side immediate number of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERATOR:"Illegal math operator on RHS of assignment",ASSIGN_ILLEGAL_RIGHT_OPERAND1:"Illegal first Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE:"First immediate number operand on RHS of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERAND2:"Illegal second Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE:"Second immediate number operand on RHS of assignment too large",DEC_ILLEGAL_ID:"DEC's id illegal",DEC_ILLEGAL_SIZE_FORMAT:"DEC's size format illegal",DEC_SIZE_TOO_LARGE:"DEC's size too large",DEC_SIZE_NOT_4_MULTIPLE:"DEC's size not a multiple of 4",GLOBAL_DEC_ILLEGAL_ID:"GLOBAL_DEC's id illegal",GLOBAL_DEC_ILLEGAL_SIZE_FORMAT:"GLOBAL_DEC's size format illegal",GLOBAL_DEC_SIZE_TOO_LARGE:"GLOBAL_DEC's size too large",GLOBAL_DEC_SIZE_NOT_4_MULTIPLE:"GLOBAL_DEC's size not a multiple of 4",LABEL_ILLEGAL_ID:"LABEL's id illegal",GOTO_ILLEGAL_ID:"GOTO's id illegal",DUPLICATE_LABEL_ID:"LABEL's label id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_FUNCTION_ID:"FUNCTION's function id ''{id}'' already declared (last declared at line {lastLineNumber})",FUNCTION_NOT_FOUND:"Can't find function ''{id}''",LABEL_NOT_FOUND:"Can't find label ''{id}''",IF_ILLEGAL_COND_OPERATOR:"IF's relop illegal",IF_ILLEGAL_COND_OPERAND1:"IF's first Singular operand in condition illegal",IF_COND_OPERAND1_IMM_TOO_LARGE:"IF's first immediate number operand in condition too large",IF_ILLEGAL_COND_OPERAND2:"IF's second Singular operand in condition illegal",IF_COND_OPERAND2_IMM_TOO_LARGE:"IF's second immediate number operand in condition too large",IF_ILLEGAL_GOTO_ID:"IF's GOTO id illegal",ARG_ILLEGAL:"ARG's Singular arg illegal",ARG_IMM_TOO_LARGE:"ARG's immediate number arg too large",CALL_ILLEGAL_ID:"CALL's function id illegal",PARAM_ILLEGAL_ID:"PARAM's param id illegal",RETURN_ILLEGAL:"RETURN's Singular return value illegal",RETURN_IMM_TOO_LARGE:"RETURN's immediate number return value too large",READ_ILLEGAL:"Illegal LValue for READ",WRITE_ILLEGAL:"Illegal Singular for WRITE",WRITE_IMM_TOO_LARGE:"Immediate number for WRITE too large",NO_MAIN_FUNCTION:"Function 'main' is not defined",RUNTIME_ERROR_PREFIX:"Runtime Error (Line {lineNumber}): ",RUNTIME_ERROR_PREFIX_NO_LN:"Runtime Error: ",GLOBAL_VARIABLE_SEGMENT_OVERFLOW:"Global variable segment overflow",STACK_OVERFLOW:"Stack overflow",VARIABLE_NOT_FOUND:"Can't find variable ''{id}''",INSTRUCTION_READ_OUT_OF_BOUND:"Reading instruction from {address} is out of bound",MEMORY_READ_OUT_OF_BOUND:"Reading 4 bytes from {address} is out of bound",MEMORY_WRITE_OUT_OF_BOUND:"Writing 4 bytes to {address} is out of bound",EMPTY_VARIABLE_TABLE_STACK:"Empty local variable stack",DUPLICATE_DEC_ID:"DEC's variable id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_GLOBAL_DEC_ID:"GLOBAL_DEC's global variable id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_PARAM_ID:"PARAM's param id ''{id}'' already declared (last declared at line {lastLineNumber})",DIVIDE_BY_ZERO:"Cannot divide by 0",MAX_STEP_REACHED:"Maximum execution step count reached ({maxExecutionStepCount, number})",INPUT_INT_ILLEGAL:"Illegal input integer",INPUT_INT_ABS_TOO_LARGE:"Absolute value of input integer too large",WRITE_OUTPUT:"{value}",READ_PROMPT:"Please enter a value for {name}:",CONSOLE_ARROW:">",READ_INPUT:"{value}",PROGRAM_EXITED:"Program exited with return value {returnValue}.",EXECUTION_STEP_COUNT_TIME:"Execution step count: {stepCount, number}; Execution time: {time, number}ms"}}],Ie=new Int32Array(1);function Le(t){return Ie[0]=t,Ie[0]}function Oe(t,e){return Le(t+e)}function Se(t,e){return Le(t-e)}var Ne,we,Ce,De,Me,Be,Pe,xe,Ue;function Ge(t,e){return t<0||t+4>e.length?{value:null,status:Ne.OUT_OF_BOUND}:{value:Le(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24),status:Ne.SUCCESS}}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.OUT_OF_BOUND=1]="OUT_OF_BOUND"}(Ne||(Ne={})),function(t){t[t.SUCCESS=0]="SUCCESS",t[t.OUT_OF_BOUND=1]="OUT_OF_BOUND"}(we||(we={})),function(t){t[t.IMM=0]="IMM",t[t.ID=1]="ID",t[t.ADDRESS_ID=2]="ADDRESS_ID",t[t.DEREF_ID=3]="DEREF_ID"}(Ce||(Ce={})),function(t){t[t.ADD=0]="ADD",t[t.SUB=1]="SUB",t[t.MUL=2]="MUL",t[t.DIV=3]="DIV"}(De||(De={})),function(t){t[t.EQ=0]="EQ",t[t.NE=1]="NE",t[t.LT=2]="LT",t[t.LE=3]="LE",t[t.GT=4]="GT",t[t.GE=5]="GE"}(Me||(Me={})),function(t){t[t.ID=0]="ID",t[t.DEREF_ID=1]="DEREF_ID"}(Be||(Be={})),function(t){t[t.SINGULAR=0]="SINGULAR",t[t.BINARY_MATH_OP=1]="BINARY_MATH_OP"}(Pe||(Pe={})),function(t){t[t.FUNCTION=0]="FUNCTION",t[t.ASSIGN=1]="ASSIGN",t[t.DEC=2]="DEC",t[t.GLOBAL_DEC=3]="GLOBAL_DEC",t[t.LABEL=4]="LABEL",t[t.GOTO=5]="GOTO",t[t.IF=6]="IF",t[t.ARG=7]="ARG",t[t.CALL=8]="CALL",t[t.ASSIGN_CALL=9]="ASSIGN_CALL",t[t.PARAM=10]="PARAM",t[t.RETURN=11]="RETURN",t[t.READ=12]="READ",t[t.WRITE=13]="WRITE",t[t.EMPTY=14]="EMPTY",t[t.COMMENT=15]="COMMENT",t[t.ERROR=16]="ERROR"}(xe||(xe={})),function(t){t[t.ASSIGN=1]="ASSIGN",t[t.DEC=2]="DEC",t[t.GLOBAL_DEC=3]="GLOBAL_DEC",t[t.GOTO=5]="GOTO",t[t.IF=6]="IF",t[t.ARG=7]="ARG",t[t.CALL=8]="CALL",t[t.ASSIGN_CALL=9]="ASSIGN_CALL",t[t.PARAM=10]="PARAM",t[t.RETURN=11]="RETURN",t[t.READ=12]="READ",t[t.WRITE=13]="WRITE"}(Ue||(Ue={}));const ke=new Set(["FUNCTION","DEC","GLOBAL_DEC","LABEL","GOTO","IF","ARG","PARAM","CALL","RETURN","READ","WRITE"]),Fe="[a-zA-Z_$][\\w$]*";class He{patternId=new RegExp(`^(?${Fe})$`);patternSize=new RegExp("^(?\\d+)$");patternSingular=new RegExp(`^(#(?-?\\d+))$|^(?${Fe})$|^(\\*(?${Fe}))$|^(&(?${Fe}))$`);patternLValue=new RegExp(`^((?${Fe}))$|^(\\*(?${Fe}))$`);illegalInstructionFormatError={type:xe.ERROR,messageKey:"ILLEGAL_INSTRUCTION_FORMAT"};purify(t){return t.trim().replaceAll(/[ \t]+/g," ")}decodeComponentId(t){const e=t.match(this.patternId);return null===e||ke.has(t)?null:e.groups.id}decodeComponentSize(t){const e=t.match(this.patternSize);if(null===e)return null;const r=parseInt(e.groups.size);return Number.isSafeInteger(r)?Le(r):1/0}decodeComponentSingular(t){const e=t.match(this.patternSingular);if(null===e)return null;if(void 0!==e.groups.imm){const t=parseInt(e.groups.imm);return Number.isSafeInteger(t)?{type:Ce.IMM,imm:Le(t)}:{type:Ce.IMM,imm:1/0}}return void 0!==e.groups.id?{type:Ce.ID,id:e.groups.id}:void 0!==e.groups.derefId?{type:Ce.DEREF_ID,id:e.groups.derefId}:{type:Ce.ADDRESS_ID,id:e.groups.addressId}}decodeComponentLValue(t){const e=t.match(this.patternLValue);return null===e?null:void 0!==e.groups.id?{type:Be.ID,id:e.groups.id}:{type:Be.DEREF_ID,id:e.groups.derefId}}decodeFunction(t){if(3!==t.length||":"!==t[2])return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"FUNCTION_ILLEGAL_ID"}:{type:xe.FUNCTION,value:{id:e}}}decodeAssign(t){if(3!==t.length&&5!==t.length||":="!==t[1])return this.illegalInstructionFormatError;const e=this.decodeComponentLValue(t[0]);if(null===e)return{type:xe.ERROR,messageKey:"ASSIGN_ILLEGAL_LEFT"};const r=this.decodeComponentSingular(t[2]);if(null===r)return{type:xe.ERROR,messageKey:3===t.length?"ASSIGN_ILLEGAL_RIGHT":"ASSIGN_ILLEGAL_RIGHT_OPERAND1"};if(r.type===Ce.IMM&&!Number.isFinite(r.imm))return{type:xe.ERROR,messageKey:3===t.length?"ASSIGN_RIGHT_IMM_TOO_LARGE":"ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE"};if(3===t.length)return{type:xe.ASSIGN,value:{lValue:e,rValue:{type:Pe.SINGULAR,singular:r}}};{let n=De.ADD;switch(t[3]){case"+":n=De.ADD;break;case"-":n=De.SUB;break;case"*":n=De.MUL;break;case"/":n=De.DIV;break;default:return{type:xe.ERROR,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERATOR"}}const i=this.decodeComponentSingular(t[4]);return null===i?{type:xe.ERROR,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERAND2"}:i.type!==Ce.IMM||Number.isFinite(i.imm)?{type:xe.ASSIGN,value:{lValue:e,rValue:{type:Pe.BINARY_MATH_OP,singularL:r,singularR:i,binaryMathOp:n}}}:{type:xe.ERROR,messageKey:"ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE"}}}decodeDec(t){if(3!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);if(null===e)return{type:xe.ERROR,messageKey:"DEC_ILLEGAL_ID"};const r=this.decodeComponentSize(t[2]);return null===r?{type:xe.ERROR,messageKey:"DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(r)?r%4!=0?{type:xe.ERROR,messageKey:"DEC_SIZE_NOT_4_MULTIPLE"}:{type:xe.DEC,value:{id:e,size:r}}:{type:xe.ERROR,messageKey:"DEC_SIZE_TOO_LARGE"}}decodeGlobalDec(t){if(3!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);if(null===e)return{type:xe.ERROR,messageKey:"GLOBAL_DEC_ILLEGAL_ID"};const r=this.decodeComponentSize(t[2]);return null===r?{type:xe.ERROR,messageKey:"GLOBAL_DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(r)?r%4!=0?{type:xe.ERROR,messageKey:"GLOBAL_DEC_SIZE_NOT_4_MULTIPLE"}:{type:xe.GLOBAL_DEC,value:{id:e,size:r}}:{type:xe.ERROR,messageKey:"GLOBAL_DEC_SIZE_TOO_LARGE"}}decodeLabel(t){if(3!==t.length||":"!==t[2])return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"LABEL_ILLEGAL_ID"}:{type:xe.LABEL,value:{id:e}}}decodeGoto(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"GOTO_ILLEGAL_ID"}:{type:xe.GOTO,value:{id:e}}}decodeIf(t){if(6!==t.length||"GOTO"!==t[4])return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);if(null===e)return{type:xe.ERROR,messageKey:"IF_ILLEGAL_COND_OPERAND1"};if(e.type===Ce.IMM&&!Number.isFinite(e.imm))return{type:xe.ERROR,messageKey:"IF_COND_OPERAND1_IMM_TOO_LARGE"};let r=Me.EQ;switch(t[2]){case"==":r=Me.EQ;break;case"!=":r=Me.NE;break;case"<":r=Me.LT;break;case"<=":r=Me.LE;break;case">":r=Me.GT;break;case">=":r=Me.GE;break;default:return{type:xe.ERROR,messageKey:"IF_ILLEGAL_COND_OPERATOR"}}const n=this.decodeComponentSingular(t[3]);if(null===n)return{type:xe.ERROR,messageKey:"IF_ILLEGAL_COND_OPERAND2"};if(n.type===Ce.IMM&&!Number.isFinite(n.imm))return{type:xe.ERROR,messageKey:"IF_COND_OPERAND2_IMM_TOO_LARGE"};const i=this.decodeComponentId(t[5]);return null===i?{type:xe.ERROR,messageKey:"IF_ILLEGAL_GOTO_ID"}:{type:xe.IF,value:{condition:{singularL:e,singularR:n,binaryRelOp:r},gotoId:i}}}decodeArg(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);return null===e?{type:xe.ERROR,messageKey:"ARG_ILLEGAL"}:e.type!==Ce.IMM||Number.isFinite(e.imm)?{type:xe.ARG,value:{value:e}}:{type:xe.ERROR,messageKey:"ARG_IMM_TOO_LARGE"}}decodeCall(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"CALL_ILLEGAL_ID"}:{type:xe.CALL,value:{id:e}}}decodeAssignCall(t){if(4!==t.length||":="!==t[1]||"CALL"!==t[2])return this.illegalInstructionFormatError;const e=this.decodeComponentLValue(t[0]);if(null===e)return{type:xe.ERROR,messageKey:"ASSIGN_ILLEGAL_LEFT"};const r=this.decodeComponentId(t[3]);return null===r?{type:xe.ERROR,messageKey:"CALL_ILLEGAL_ID"}:{type:xe.ASSIGN_CALL,value:{lValue:e,functionId:r}}}decodeParam(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"PARAM_ILLEGAL_ID"}:{type:xe.PARAM,value:{id:e}}}decodeReturn(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);return null===e?{type:xe.ERROR,messageKey:"RETURN_ILLEGAL"}:e.type!==Ce.IMM||Number.isFinite(e.imm)?{type:xe.RETURN,value:{value:e}}:{type:xe.ERROR,messageKey:"RETURN_IMM_TOO_LARGE"}}decodeRead(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentLValue(t[1]);return null===e?{type:xe.ERROR,messageKey:"READ_ILLEGAL"}:{type:xe.READ,value:{lValue:e}}}decodeWrite(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);return null===e?{type:xe.ERROR,messageKey:"WRITE_ILLEGAL"}:e.type!==Ce.IMM||Number.isFinite(e.imm)?{type:xe.WRITE,value:{value:e}}:{type:xe.ERROR,messageKey:"WRITE_IMM_TOO_LARGE"}}decode(t){if(t.match(/^[ \t]*$/))return{type:xe.EMPTY};const e={type:xe.ERROR,messageKey:"UNRECOGNIZED_INSTRUCTION"},r=this.purify(t);if(r.startsWith(";"))return{type:xe.COMMENT};const n=r.split(" ");if(n.length<1)return e;switch(n[0]){case"FUNCTION":return this.decodeFunction(n);case"DEC":return this.decodeDec(n);case"GLOBAL_DEC":return this.decodeGlobalDec(n);case"LABEL":return this.decodeLabel(n);case"GOTO":return this.decodeGoto(n);case"IF":return this.decodeIf(n);case"ARG":return this.decodeArg(n);case"CALL":return this.decodeCall(n);case"PARAM":return this.decodeParam(n);case"RETURN":return this.decodeReturn(n);case"READ":return this.decodeRead(n);case"WRITE":return this.decodeWrite(n);default:{const t=this.decodeAssign(n);if(t.type===xe.ASSIGN)return t;const e=this.decodeAssignCall(n);return e.type===xe.ASSIGN_CALL?e:t}}}}var je,Ve,ze={exports:{}}; +import t from"fs";import e from"readline";import r from"assert";import n from"util";import i from"path";var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},o={exports:{}};const{inspect:a}=n;var u,l,c=function(t,...e){let r=t.replace(/%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g,(function(t,r,n,i,s,o){if(r)return"%";let u,l=0;if(i){if(0===e.length)throw new TypeError("not enough arguments for format string");if(l=e.shift(),!Number.isInteger(l))throw new TypeError("* wants int")}if(void 0!==s){let t=e[0];if("object"!=typeof t||null===t)throw new TypeError("format requires a mapping");if(!(s in t))throw new TypeError(`no such key: '${s}'`);u=t[s]}else{if(0===e.length)throw new TypeError("not enough arguments for format string");u=e.shift()}switch(o){case"s":u=String(u);break;case"r":u=a(u);break;case"d":case"i":if("number"!=typeof u)throw new TypeError(`%${o} format: a number is required, not ${typeof u}`);u=String(u.toFixed(0));break;default:throw new TypeError(`unsupported format character '${o}'`)}return l>0?n?u.padEnd(l):u.padStart(l):u}));if(e.length&&(1!==e.length||"object"!=typeof e[0]||null===e[0]))throw new TypeError("not all arguments converted during string formatting");return r};function h(){if(l)return u;l=1;const t=/([\t\n\x0b\x0c\r ]+)/;class e{constructor(t={}){let{width:e=70,initial_indent:r="",subsequent_indent:n="",expand_tabs:i=!0,replace_whitespace:s=!0,fix_sentence_endings:o=!1,break_long_words:a=!0,drop_whitespace:u=!0,break_on_hyphens:l=!0,tabsize:c=8,max_lines:h,placeholder:f=" [...]"}=t;this.width=e,this.initial_indent=r,this.subsequent_indent=n,this.expand_tabs=i,this.replace_whitespace=s,this.fix_sentence_endings=o,this.break_long_words=a,this.drop_whitespace=u,this.break_on_hyphens=l,this.tabsize=c,this.max_lines=h,this.placeholder=f}_munge_whitespace(t){return this.expand_tabs&&(t=t.replace(/\t/g," ".repeat(this.tabsize))),this.replace_whitespace&&(t=t.replace(/[\t\n\x0b\x0c\r]/g," ")),t}_split(e){let r=e.split(t);return r=r.filter(Boolean),r}_handle_long_word(t,e,r,n){let i;i=n<1?1:n-r,this.break_long_words?(e.push(t[t.length-1].slice(0,i)),t[t.length-1]=t[t.length-1].slice(i)):e||e.push(...t.pop())}_wrap_chunks(t){let e,r=[];if(this.width<=0)throw Error(`invalid width ${this.width} (must be > 0)`);if(void 0!==this.max_lines&&(e=this.max_lines>1?this.subsequent_indent:this.initial_indent,e.length+this.placeholder.trimStart().length>this.width))throw Error("placeholder too large for max width");for(t=t.reverse();t.length>0;){let e,n=[],i=0;e=r?this.subsequent_indent:this.initial_indent;let s=this.width-e.length;for(this.drop_whitespace&&""===t[t.length-1].trim()&&r.length>0&&t.pop();t.length>0;){let e=t[t.length-1].length;if(!(i+e<=s))break;n.push(t.pop()),i+=e}if(t.length&&t[t.length-1].length>s&&(this._handle_long_word(t,n,i,s),i=n.map((t=>t.length)).reduce(((t,e)=>t+e),0)),this.drop_whitespace&&n.length>0&&""===n[n.length-1].trim()&&(i-=n[n.length-1].length,n.pop()),n){if(!(void 0===this.max_lines||r.length+10)for(let i=t;ie;i+=r)n.push(i);return n}function S(t,e=!1){let r;if(e){r=[];let e=t.split(/(\r\n|[\n\r\v\f\x1c\x1d\x1e\x85\u2028\u2029])/);for(let t=0;tr&&(n=n.slice(0,r).concat([n.slice(r).join(e)])),n}function N(t,e){if(t.length!==e.length)return!1;for(let r=0;rt[0]+t[2].toUpperCase()));r!==e&&M(t.prototype,r,e)}return t}function P(t){return"default"===(t=t.replace(/\w_[a-z]/g,(t=>t[0]+t[2].toUpperCase())))&&(t="defaultValue"),"const"===t&&(t="constant"),t}function x(t){return"defaultValue"===t&&(t="default"),"constant"===t&&(t="const"),t=t.replace(/[A-Z]/g,(t=>"_"+t.toLowerCase()))}let U=Symbol("no_default_value");function G(t,e){function r(){let t=(new Error).stack.split("\n").map((t=>t.match(/^ at (.*) \(.*\)$/))).filter(Boolean).map((t=>t[1])).map((t=>t.match(/[^ .]*$/)[0]));return t.length&&t[0]===r.name&&t.shift(),t.length&&t[0]===G.name&&t.shift(),t.length?t[0]:""}let n={},i=[],s=(t=Array.from(t)).length&&t[t.length-1];"object"!=typeof s||null===s||Array.isArray(s)||s.constructor&&"Object"!==s.constructor.name||(n=Object.assign({},t.pop()));let o=[];for(let t of Object.keys(e)){let e=P(t);e!==t&&e in n&&(t in n||(n[t]=n[e]),o.push([e,t]),delete n[e])}if(o.length){let t=r();F("camelcase_"+t,m("%s(): following options are renamed: %s",t,o.map((([t,e])=>m("%r -> %r",t,e)))))}let a=[],u=t.length;for(let[s,o]of Object.entries(e))if("*"===s[0])if(s.length>0&&"*"===s[1]){let t=[];for(let e of Object.keys(n)){let r=x(e);r!==e&&e in n&&(r in n||(n[r]=n[e]),t.push([e,r]),delete n[e])}if(t.length){let e=r();F("camelcase_"+e,m("%s(): following options are renamed: %s",e,t.map((([t,e])=>m("%r -> %r",t,e)))))}i.push(n),n={}}else i.push(t),t=[];else{if(s in n&&t.length>0)throw new TypeError(m("%s() got multiple values for argument %r",r(),s));s in n?(i.push(n[s]),delete n[s]):t.length>0?i.push(t.shift()):o!==U?i.push(o):a.push(s)}if(Object.keys(n).length)throw new TypeError(m("%s() got an unexpected keyword argument %r",r(),Object.keys(n)[0]));if(t.length){let t=Object.entries(e).filter((([t,e])=>"*"!==t[0]&&e!==U)).length,n=Object.entries(e).filter((([t])=>"*"!==t[0])).length;throw new TypeError(m("%s() takes %s positional argument%s but %s %s given",r(),t===n?m("from %s to %s",t,n):n,t===n&&1===n?"":"s",u,1===u?"was":"were"))}if(a.length){let t=a.map(v);t.length>1&&(t[t.length-1]="and "+t[t.length-1]);let e=t.join(2===t.length?"":", ");throw new TypeError(m("%s() missing %i required positional argument%s: %s",r(),t.length,1===t.length?"":"s",e))}return i}let k={};function F(t,e){k[t]=k[t]||g.deprecate((()=>{}),e),k[t]()}function H(t=Object){return class extends t{[g.inspect.custom](){let t=this.constructor.name,e=[],r={};for(let t of this._get_args())e.push(v(t));for(let[t,n]of this._get_kwargs())/^[a-z_][a-z0-9_$]*$/i.test(t)?e.push(m("%s=%r",t,n)):r[t]=n;return Object.keys(r).length&&e.push(m("**%s",v(r))),m("%s(%s)",t,e.join(", "))}toString(){return this[g.inspect.custom]()}_get_kwargs(){return Object.entries(this)}_get_args(){return[]}}}function j(t){return void 0===t?[]:t.slice(0)}const V=B(D(class{constructor(){let[t,e,r,n]=G(arguments,{prog:U,indent_increment:2,max_help_position:24,width:void 0});void 0===n&&(n=+process.env.COLUMNS||process.stdout.columns||80,n-=2),this._prog=t,this._indent_increment=e,this._max_help_position=Math.min(r,Math.max(n-20,2*e)),this._width=n,this._current_indent=0,this._level=0,this._action_max_length=0,this._root_section=this._Section(this,void 0),this._current_section=this._root_section,this._whitespace_matcher=/[ \t\n\r\f\v]+/g,this._long_break_matcher=/\n\n\n+/g}_indent(){this._current_indent+=this._indent_increment,this._level+=1}_dedent(){this._current_indent-=this._indent_increment,p(this._current_indent>=0,"Indent decreased below 0."),this._level-=1}_add_item(t,e){this._current_section.items.push([t,e])}start_section(t){this._indent();let e=this._Section(this,this._current_section,t);this._add_item(e.format_help.bind(e),[]),this._current_section=e}end_section(){this._current_section=this._current_section.parent,this._dedent()}add_text(t){t!==s&&void 0!==t&&this._add_item(this._format_text.bind(this),[t])}add_usage(t,e,r,n=void 0){if(t!==s){let i=[t,e,r,n];this._add_item(this._format_usage.bind(this),i)}}add_argument(t){if(t.help!==s){let e=[this._format_action_invocation(t)];for(let r of this._iter_indented_subactions(t))e.push(this._format_action_invocation(r));let r=Math.max(...e.map((t=>t.length)))+this._current_indent;this._action_max_length=Math.max(this._action_max_length,r),this._add_item(this._format_action.bind(this),[t])}}add_arguments(t){for(let e of t)this.add_argument(e)}format_help(){let t=this._root_section.format_help();return t&&(t=t.replace(this._long_break_matcher,"\n\n"),t=t.replace(/^\n+|\n+$/g,"")+"\n"),t}_join_parts(t){return t.filter((t=>t&&t!==s)).join("")}_format_usage(t,e,r,n){if(void 0===n&&(n="usage: "),void 0!==t)t=m(t,{prog:this._prog});else if(void 0!==t||e.length){if(void 0===t){let i=m("%(prog)s",{prog:this._prog}),s=[],o=[];for(let t of e)t.option_strings.length?s.push(t):o.push(t);t=[i,this._format_actions_usage([].concat(s).concat(o),r)].map(String).join(" ");let a=this._width-this._current_indent;if(n.length+t.length>a){let e=/\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+/g,u=this._format_actions_usage(s,r),l=this._format_actions_usage(o,r),c=u.match(e)||[],h=l.match(e)||[];p(c.join(" ")===u),p(h.join(" ")===l);let f,_=(t,e,r=void 0)=>{let n,i=[],s=[];n=void 0!==r?r.length-1:e.length-1;for(let r of t)n+1+r.length>a&&s&&(i.push(e+s.join(" ")),s=[],n=e.length-1),s.push(r),n+=r.length+1;return s.length&&i.push(e+s.join(" ")),void 0!==r&&(i[0]=i[0].slice(e.length)),i};if(n.length+i.length<=.75*a){let t=" ".repeat(n.length+i.length+1);c.length?(f=_([i].concat(c),t,n),f=f.concat(_(h,t))):f=h.length?_([i].concat(h),t,n):[i]}else{let t=" ".repeat(n.length);f=_([].concat(c).concat(h),t),f.length>1&&(f=[],f=f.concat(_(c,t)),f=f.concat(_(h,t))),f=[i].concat(f)}t=f.join("\n")}}}else t=m("%(prog)s",{prog:this._prog});return m("%s%s\n\n",n,t)}_format_actions_usage(t,e){let r=new Set,n={};for(let i of e){let e=t.indexOf(i._group_actions[0]);if(-1!==e){let s=e+i._group_actions.length;if(N(t.slice(e,s),i._group_actions)){for(let t of i._group_actions)r.add(t);i.required?(e in n?n[e]+=" (":n[e]="(",s in n?n[s]+=")":n[s]=")"):(e in n?n[e]+=" [":n[e]="[",s in n?n[s]+="]":n[s]="]");for(let t of L(e+1,s))n[t]="|"}}}let i=[];for(let[e,o]of Object.entries(t))if(o.help===s)i.push(void 0),"|"===n[+e]?delete n[+e]:"|"===n[+e+1]&&delete n[+e+1];else if(o.option_strings.length){let t,e=o.option_strings[0];if(0===o.nargs)t=o.format_usage();else{let r=this._get_default_metavar_for_optional(o),n=this._format_args(o,r);t=m("%s %s",e,n)}o.required||r.has(o)||(t=m("[%s]",t)),i.push(t)}else{let t=this._get_default_metavar_for_positional(o),e=this._format_args(o,t);r.has(o)&&"["===e[0]&&"]"===e[e.length-1]&&(e=e.slice(1,-1)),i.push(e)}for(let t of Object.keys(n).map(Number).sort(((t,e)=>e-t)))i.splice(+t,0,n[+t]);let o=i.filter(Boolean).join(" ");return o=o.replace(/([\[(]) /g,"$1"),o=o.replace(/ ([\])])/g,"$1"),o=o.replace(/[\[(] *[\])]/g,""),o=o.replace(/\(([^|]*)\)/g,"$1",o),o=o.trim(),o}_format_text(t){t.includes("%(prog)")&&(t=m(t,{prog:this._prog}));let e=Math.max(this._width-this._current_indent,11),r=" ".repeat(this._current_indent);return this._fill_text(t,e,r)+"\n\n"}_format_action(t){let e,r=Math.min(this._action_max_length+2,this._max_help_position),n=Math.max(this._width-r,11),i=r-this._current_indent-2,s=this._format_action_invocation(t);if(t.help)if(s.length<=i){let t=[this._current_indent,"",i,s];s=m("%*s%-*s ",...t),e=0}else{let t=[this._current_indent,"",s];s=m("%*s%s\n",...t),e=r}else{let t=[this._current_indent,"",s];s=m("%*s%s\n",...t)}let o=[s];if(t.help){let i=this._expand_help(t),s=this._split_lines(i,n);o.push(m("%*s%s\n",e,"",s[0]));for(let t of s.slice(1))o.push(m("%*s%s\n",r,"",t))}else s.endsWith("\n")||o.push("\n");for(let e of this._iter_indented_subactions(t))o.push(this._format_action(e));return this._join_parts(o)}_format_action_invocation(t){if(t.option_strings.length){let e=[];if(0===t.nargs)e=e.concat(t.option_strings);else{let r=this._get_default_metavar_for_optional(t),n=this._format_args(t,r);for(let r of t.option_strings)e.push(m("%s %s",r,n))}return e.join(", ")}{let e=this._get_default_metavar_for_positional(t);return this._metavar_formatter(t,e)(1)[0]}}_metavar_formatter(t,e){let r;if(void 0!==t.metavar)r=t.metavar;else if(void 0!==t.choices){let e=C(t.choices).map(String);r=m("{%s}",e.join(","))}else r=e;return function(t){return Array.isArray(r)?r:Array(t).fill(r)}}_format_args(t,e){let r,n=this._metavar_formatter(t,e);if(void 0===t.nargs)r=m("%s",...n(1));else if(t.nargs===o)r=m("[%s]",...n(1));else if(t.nargs===a){let t=n(1);r=2===t.length?m("[%s [%s ...]]",...t):m("[%s ...]",...t)}else if(t.nargs===u)r=m("%s [%s ...]",...n(2));else if(t.nargs===f)r="...";else if(t.nargs===l)r=m("%s ...",...n(1));else if(t.nargs===s)r="";else{let e;try{e=L(t.nargs).map((()=>"%s"))}catch(t){throw new TypeError("invalid nargs value")}r=m(e.join(" "),...n(t.nargs))}return r}_expand_help(t){let e=Object.assign({prog:this._prog},t);for(let t of Object.keys(e))e[t]===s&&delete e[t];for(let t of Object.keys(e))e[t]&&e[t].name&&(e[t]=e[t].name);if(void 0!==e.choices){let t=C(e.choices).map(String).join(", ");e.choices=t}for(let t of Object.keys(e)){let r=P(t);r!==t&&(e[r]=e[t])}return m(this._get_help_string(t),e)}*_iter_indented_subactions(t){"function"==typeof t._get_subactions&&(this._indent(),yield*t._get_subactions(),this._dedent())}_split_lines(t,e){return t=t.replace(this._whitespace_matcher," ").trim(),h().wrap(t,{width:e})}_fill_text(t,e,r){return t=t.replace(this._whitespace_matcher," ").trim(),h().fill(t,{width:e,initial_indent:r,subsequent_indent:r})}_get_help_string(t){return t.help}_get_default_metavar_for_optional(t){return t.dest.toUpperCase()}_get_default_metavar_for_positional(t){return t.dest}}));V.prototype._Section=D(class{constructor(t,e,r=void 0){this.formatter=t,this.parent=e,this.heading=r,this.items=[]}format_help(){void 0!==this.parent&&this.formatter._indent();let t,e=this.formatter._join_parts(this.items.map((([t,e])=>t.apply(null,e))));if(void 0!==this.parent&&this.formatter._dedent(),!e)return"";if(this.heading!==s&&void 0!==this.heading){let e=this.formatter._current_indent;t=m("%*s%s:\n",e,"",this.heading)}else t="";return this.formatter._join_parts(["\n",t,e,"\n"])}});const z=B(D(class extends V{_fill_text(t,e,r){return S(t,!0).map((t=>r+t)).join("")}})),W=B(D(class extends z{_split_lines(t){return S(t)}})),K=B(D(class extends V{_get_help_string(t){let e=t.help;if(!t.help.includes("%(default)")&&!t.help.includes("%(defaultValue)")&&t.default!==s){let r=[o,a];(t.option_strings.length||r.includes(t.nargs))&&(e+=" (default: %(default)s)")}return e}})),Y=B(D(class extends V{_get_default_metavar_for_optional(t){return"function"==typeof t.type?t.type.name:t.type}_get_default_metavar_for_positional(t){return"function"==typeof t.type?t.type.name:t.type}}));function X(t){return void 0===t?void 0:t.option_strings.length?t.option_strings.join("/"):[void 0,s].includes(t.metavar)?[void 0,s].includes(t.dest)?void 0:t.dest:t.metavar}const Z=D(class extends Error{constructor(t,e){super(),this.name="ArgumentError",this._argument_name=X(t),this._message=e,this.message=this.str()}str(){let t;return t=void 0===this._argument_name?"%(message)s":"argument %(argument_name)s: %(message)s",m(t,{message:this._message,argument_name:this._argument_name})}}),q=D(class extends Error{constructor(t){super(t),this.name="ArgumentTypeError"}}),$=B(D(class extends(H(Function)){constructor(){let[t,e,r,n,i,s,o,a,u,l]=G(arguments,{option_strings:U,dest:U,nargs:void 0,const:void 0,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0});super("return arguments.callee.call.apply(arguments.callee, arguments)"),this.option_strings=t,this.dest=e,this.nargs=r,this.const=n,this.default=i,this.type=s,this.choices=o,this.required=a,this.help=u,this.metavar=l}_get_kwargs(){return["option_strings","dest","nargs","const","default","type","choices","help","metavar"].map((t=>[t,b(this,t)]))}format_usage(){return this.option_strings[0]}call(){throw new Error(".call() not defined")}})),Q=B(D(class extends ${constructor(){let[t,e,r,n,i,s,o,a]=G(arguments,{option_strings:U,dest:U,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0}),u=[];for(let e of t)u.push(e),e.startsWith("--")&&(e="--no-"+e.slice(2),u.push(e));void 0!==o&&void 0!==r&&(o+=` (default: ${r})`),super({option_strings:u,dest:e,nargs:0,default:r,type:n,choices:i,required:s,help:o,metavar:a})}call(t,e,r,n=void 0){this.option_strings.includes(n)&&R(e,this.dest,!n.startsWith("--no-"))}format_usage(){return this.option_strings.join(" | ")}})),J=D(class extends ${constructor(){let[t,e,r,n,i,s,a,u,l,c]=G(arguments,{option_strings:U,dest:U,nargs:void 0,const:void 0,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0});if(0===r)throw new TypeError("nargs for store actions must be != 0; if you have nothing to store, actions such as store true or store const may be more appropriate");if(void 0!==n&&r!==o)throw new TypeError(m("nargs must be %r to supply const",o));super({option_strings:t,dest:e,nargs:r,const:n,default:i,type:s,choices:a,required:u,help:l,metavar:c})}call(t,e,r){R(e,this.dest,r)}}),tt=D(class extends ${constructor(){let[t,e,r,n,i,s]=G(arguments,{option_strings:U,dest:U,const:U,default:void 0,required:!1,help:void 0,metavar:void 0});super({option_strings:t,dest:e,nargs:0,const:r,default:n,required:i,help:s})}call(t,e){R(e,this.dest,this.const)}}),et=D(class extends tt{constructor(){let[t,e,r,n,i]=G(arguments,{option_strings:U,dest:U,default:!1,required:!1,help:void 0});super({option_strings:t,dest:e,const:!0,default:r,required:n,help:i})}}),rt=D(class extends tt{constructor(){let[t,e,r,n,i]=G(arguments,{option_strings:U,dest:U,default:!0,required:!1,help:void 0});super({option_strings:t,dest:e,const:!1,default:r,required:n,help:i})}}),nt=D(class extends ${constructor(){let[t,e,r,n,i,s,a,u,l,c]=G(arguments,{option_strings:U,dest:U,nargs:void 0,const:void 0,default:void 0,type:void 0,choices:void 0,required:!1,help:void 0,metavar:void 0});if(0===r)throw new TypeError("nargs for append actions must be != 0; if arg strings are not supplying the value to append, the append const action may be more appropriate");if(void 0!==n&&r!==o)throw new TypeError(m("nargs must be %r to supply const",o));super({option_strings:t,dest:e,nargs:r,const:n,default:i,type:s,choices:a,required:u,help:l,metavar:c})}call(t,e,r){let n=b(e,this.dest,void 0);n=j(n),n.push(r),R(e,this.dest,n)}}),it=D(class extends ${constructor(){let[t,e,r,n,i,s,o]=G(arguments,{option_strings:U,dest:U,const:U,default:void 0,required:!1,help:void 0,metavar:void 0});super({option_strings:t,dest:e,nargs:0,const:r,default:n,required:i,help:s,metavar:o})}call(t,e){let r=b(e,this.dest,void 0);r=j(r),r.push(this.const),R(e,this.dest,r)}}),st=D(class extends ${constructor(){let[t,e,r,n,i]=G(arguments,{option_strings:U,dest:U,default:void 0,required:!1,help:void 0});super({option_strings:t,dest:e,nargs:0,default:r,required:n,help:i})}call(t,e){let r=b(e,this.dest,void 0);void 0===r&&(r=0),R(e,this.dest,r+1)}}),ot=D(class extends ${constructor(){let[t,e,r,n]=G(arguments,{option_strings:U,dest:s,default:s,help:void 0});super({option_strings:t,dest:e,default:r,nargs:0,help:n})}call(t){t.print_help(),t.exit()}}),at=D(class extends ${constructor(){let[t,e,r,n,i]=G(arguments,{option_strings:U,version:void 0,dest:s,default:s,help:"show program's version number and exit"});super({option_strings:t,dest:r,default:n,nargs:0,help:i}),this.version=e}call(t){let e=this.version;void 0===e&&(e=t.version);let r=t._get_formatter();r.add_text(e),t._print_message(r.format_help(),process.stdout),t.exit()}}),ut=B(D(class extends ${constructor(){let[t,e,r,n,i,o,a]=G(arguments,{option_strings:U,prog:U,parser_class:U,dest:s,required:!1,help:void 0,metavar:void 0}),u={};super({option_strings:t,dest:n,nargs:l,choices:u,required:i,help:o,metavar:a}),this._prog_prefix=e,this._parser_class=r,this._name_parser_map=u,this._choices_actions=[]}add_parser(){let[t,e]=G(arguments,{name:U,"**kwargs":U});void 0===e.prog&&(e.prog=m("%s %s",this._prog_prefix,t));let r=b(e,"aliases",[]);if(delete e.aliases,"help"in e){let n=e.help;delete e.help;let i=this._ChoicesPseudoAction(t,r,n);this._choices_actions.push(i)}let n=new this._parser_class(e);this._name_parser_map[t]=n;for(let t of r)this._name_parser_map[t]=n;return n}_get_subactions(){return this._choices_actions}call(t,e,r){let n,i=r[0],o=r.slice(1);if(this.dest!==s&&R(e,this.dest,i),!A(this._name_parser_map,i)){let t={parser_name:i,choices:this._name_parser_map.join(", ")},e=m("unknown parser %(parser_name)r (choices: %(choices)s)",t);throw new Z(this,e)}t=this._name_parser_map[i],[n,o]=t.parse_known_args(o,void 0);for(let[t,r]of Object.entries(n))R(e,t,r);o.length&&(T(e,_,[]),b(e,_).push(...o))}}));ut.prototype._ChoicesPseudoAction=D(class extends ${constructor(t,e,r){let n=t,i=t;e.length&&(n+=m(" (%s)",e.join(", "))),super({option_strings:[],dest:i,help:r,metavar:n})}});const lt=D(class extends nt{call(t,e,r){let n=b(e,this.dest,void 0);n=j(n),n=n.concat(r),R(e,this.dest,n)}}),ct=D(class extends Function{constructor(){let[t,e,r,n,i,s,o,a,u]=G(arguments,{flags:"r",encoding:void 0,mode:void 0,autoClose:void 0,emitClose:void 0,start:void 0,end:void 0,highWaterMark:void 0,fs:void 0});super("return arguments.callee.call.apply(arguments.callee, arguments)"),Object.defineProperty(this,"name",{get:()=>m("FileType(%r)",t)}),this._flags=t,this._options={},void 0!==e&&(this._options.encoding=e),void 0!==r&&(this._options.mode=r),void 0!==n&&(this._options.autoClose=n),void 0!==i&&(this._options.emitClose=i),void 0!==s&&(this._options.start=s),void 0!==o&&(this._options.end=o),void 0!==a&&(this._options.highWaterMark=a),void 0!==u&&(this._options.fs=u)}call(t){if("-"===t){if(this._flags.includes("r"))return process.stdin;if(this._flags.includes("w"))return process.stdout;{let t=m('argument "-" with mode %r',this._flags);throw new TypeError(t)}}let e;try{e=d.openSync(t,this._flags,this._options.mode)}catch(e){let r={filename:t,error:e.message};throw new q(m("can't open '%(filename)s': %(error)s",r))}let r=Object.assign({fd:e,flags:this._flags},this._options);if(this._flags.includes("r"))return d.createReadStream(void 0,r);if(this._flags.includes("w"))return d.createWriteStream(void 0,r);{let e=m('argument "%s" with mode %r',t,this._flags);throw new TypeError(e)}}[g.inspect.custom](){let t=[this._flags],e=Object.entries(this._options).map((([t,e])=>("mode"===t&&(e={value:e,[g.inspect.custom](){return"0o"+this.value.toString(8)}}),[t,e]))),r=[].concat(t.filter((t=>-1!==t)).map(v)).concat(e.filter((([,t])=>void 0!==t)).map((([t,e])=>m("%s=%r",t,e)))).join(", ");return m("%s(%s)",this.constructor.name,r)}toString(){return this[g.inspect.custom]()}}),ht=D(class extends(H()){constructor(t={}){super(),Object.assign(this,t)}});ht.prototype[Symbol.toStringTag]=void 0;const ft=B(D(class{constructor(){let[t,e,r,n]=G(arguments,{description:U,prefix_chars:U,argument_default:U,conflict_handler:U});this.description=t,this.argument_default=r,this.prefix_chars=e,this.conflict_handler=n,this._registries={},this.register("action",void 0,J),this.register("action","store",J),this.register("action","store_const",tt),this.register("action","store_true",et),this.register("action","store_false",rt),this.register("action","append",nt),this.register("action","append_const",it),this.register("action","count",st),this.register("action","help",ot),this.register("action","version",at),this.register("action","parsers",ut),this.register("action","extend",lt),["storeConst","storeTrue","storeFalse","appendConst"].forEach((t=>{let e=x(t);this.register("action",t,g.deprecate(this._registry_get("action",e),m('{action: "%s"} is renamed to {action: "%s"}',t,e)))})),this._get_handler(),this._actions=[],this._option_string_actions={},this._action_groups=[],this._mutually_exclusive_groups=[],this._defaults={},this._negative_number_matcher=/^-\d+$|^-\d*\.\d+$/,this._has_negative_number_optionals=[]}register(t,e,r){T(this._registries,t,{})[e]=r}_registry_get(t,e,r=void 0){return b(this._registries[t],e,r)}set_defaults(t){Object.assign(this._defaults,t);for(let e of this._actions)e.dest in t&&(e.default=t[e.dest])}get_default(t){for(let e of this._actions)if(e.dest===t&&void 0!==e.default)return e.default;return this._defaults[t]}add_argument(){let[t,e]=G(arguments,{"*args":U,"**kwargs":U});1===t.length&&Array.isArray(t[0])&&(t=t[0],F("argument-array",m("use add_argument(%(args)s, {...}) instead of add_argument([ %(args)s ], { ... })",{args:t.map(v).join(", ")})));let r=this.prefix_chars;if(!t.length||1===t.length&&!r.includes(t[0][0])){if(t.length&&"dest"in e)throw new TypeError("dest supplied twice for positional argument");e=this._get_positional_kwargs(...t,e)}else e=this._get_optional_kwargs(...t,e);if(!("default"in e)){let t=e.dest;t in this._defaults?e.default=this._defaults[t]:void 0!==this.argument_default&&(e.default=this.argument_default)}let n=this._pop_action_class(e);if("function"!=typeof n)throw new TypeError(m('unknown action "%s"',n));let i=new n(e),s=this._registry_get("type",i.type,i.type);if("function"!=typeof s)throw new TypeError(m("%r is not callable",s));if(s===ct)throw new TypeError(m("%r is a FileType class object, instance of it must be passed",s));if("_get_formatter"in this)try{this._get_formatter()._format_args(i,void 0)}catch(t){throw t instanceof TypeError&&"invalid nargs value"!==t.message?new TypeError("length of metavar tuple does not match nargs"):t}return this._add_action(i)}add_argument_group(){let t=_t(this,...arguments);return this._action_groups.push(t),t}add_mutually_exclusive_group(){let t=pt(this,...arguments);return this._mutually_exclusive_groups.push(t),t}_add_action(t){this._check_conflict(t),this._actions.push(t),t.container=this;for(let e of t.option_strings)this._option_string_actions[e]=t;for(let e of t.option_strings)this._negative_number_matcher.test(e)&&(this._has_negative_number_optionals.length||this._has_negative_number_optionals.push(!0));return t}_remove_action(t){w(this._actions,t)}_add_container_actions(t){let e={};for(let t of this._action_groups){if(t.title in e){throw new TypeError(m("cannot merge actions - two groups are named %r",t.title))}e[t.title]=t}let r=new Map;for(let n of t._action_groups){n.title in e||(e[n.title]=this.add_argument_group({title:n.title,description:n.description,conflict_handler:n.conflict_handler}));for(let t of n._group_actions)r.set(t,e[n.title])}for(let e of t._mutually_exclusive_groups){let t=this.add_mutually_exclusive_group({required:e.required});for(let n of e._group_actions)r.set(n,t)}for(let e of t._actions)r.get(e)._add_action(e)}_get_positional_kwargs(){let[t,e]=G(arguments,{dest:U,"**kwargs":U});if("required"in e){throw new TypeError("'required' is an invalid argument for positionals")}return[o,a].includes(e.nargs)||(e.required=!0),e.nargs!==a||"default"in e||(e.required=!0),Object.assign(e,{dest:t,option_strings:[]})}_get_optional_kwargs(){let t,[e,r]=G(arguments,{"*args":U,"**kwargs":U}),n=[],i=[];for(t of e){if(!this.prefix_chars.includes(t[0])){let e={option:t,prefix_chars:this.prefix_chars};throw new TypeError(m("invalid option string %(option)r: must start with a character %(prefix_chars)r",e))}n.push(t),t.length>1&&this.prefix_chars.includes(t[1])&&i.push(t)}let s=r.dest;if(delete r.dest,void 0===s){let e;if(e=i.length?i[0]:n[0],s=function(t,e){let r=0;for(;rt)).join(", ");throw new Z(t,m(r,n))}_handle_conflict_resolve(t,e){for(let[t,r]of e)w(r.option_strings,t),delete this._option_string_actions[t],r.option_strings.length||r.container._remove_action(r)}})),_t=D(class extends ft{constructor(){let[t,e,r,n]=G(arguments,{container:U,title:void 0,description:void 0,"**kwargs":U});T(n,"conflict_handler",t.conflict_handler),T(n,"prefix_chars",t.prefix_chars),T(n,"argument_default",t.argument_default),super(Object.assign({description:r},n)),this.title=e,this._group_actions=[],this._registries=t._registries,this._actions=t._actions,this._option_string_actions=t._option_string_actions,this._defaults=t._defaults,this._has_negative_number_optionals=t._has_negative_number_optionals,this._mutually_exclusive_groups=t._mutually_exclusive_groups}_add_action(t){return t=super._add_action(t),this._group_actions.push(t),t}_remove_action(t){super._remove_action(t),w(this._group_actions,t)}}),pt=D(class extends _t{constructor(){let[t,e]=G(arguments,{container:U,required:!1});super(t),this.required=e,this._container=t}_add_action(t){if(t.required){throw new TypeError("mutually exclusive arguments must be optional")}return t=this._container._add_action(t),this._group_actions.push(t),t}_remove_action(t){this._container._remove_action(t),w(this._group_actions,t)}}),gt=B(D(class extends(H(ft)){constructor(){let[t,e,r,n,i,o,a,u,l,c,h,f,_,p,d]=G(arguments,{prog:void 0,usage:void 0,description:void 0,epilog:void 0,parents:[],formatter_class:V,prefix_chars:"-",fromfile_prefix_chars:void 0,argument_default:void 0,conflict_handler:"error",add_help:!0,allow_abbrev:!0,exit_on_error:!0,debug:void 0,version:void 0});function v(t){return t}void 0!==p&&F("debug",'The "debug" argument to ArgumentParser is deprecated. Please override ArgumentParser.exit function instead.'),void 0!==d&&F("version","The \"version\" argument to ArgumentParser is deprecated. Please use add_argument(..., { action: 'version', version: 'N', ... }) instead."),super({description:r,prefix_chars:a,argument_default:l,conflict_handler:c}),void 0===t&&(t=E.basename(y()[0]||"")),this.prog=t,this.usage=e,this.epilog=n,this.formatter_class=o,this.fromfile_prefix_chars=u,this.add_help=h,this.allow_abbrev=f,this.exit_on_error=_,this.debug=p,this._positionals=this.add_argument_group("positional arguments"),this._optionals=this.add_argument_group("optional arguments"),this._subparsers=void 0,this.register("type",void 0,v),this.register("type",null,v),this.register("type","auto",v),this.register("type","int",(function(t){let e=Number(t);if(!Number.isInteger(e))throw new TypeError(m("could not convert string to int: %r",t));return e})),this.register("type","float",(function(t){let e=Number(t);if(isNaN(e))throw new TypeError(m("could not convert string to float: %r",t));return e})),this.register("type","str",String),this.register("type","string",g.deprecate(String,'use {type:"str"} or {type:String} instead of {type:"string"}'));let A=a.includes("-")?"-":a[0];this.add_help&&this.add_argument(A+"h",A.repeat(2)+"help",{action:"help",default:s,help:"show this help message and exit"}),d&&this.add_argument(A+"v",A.repeat(2)+"version",{action:"version",default:s,version:this.version,help:"show program's version number and exit"});for(let t of i)this._add_container_actions(t),Object.assign(this._defaults,t._defaults)}_get_kwargs(){return["prog","usage","description","formatter_class","conflict_handler","add_help"].map((t=>[t,b(this,t)]))}add_subparsers(){let[t]=G(arguments,{"**kwargs":U});if(void 0!==this._subparsers&&this.error("cannot have multiple subparser arguments"),T(t,"parser_class",this.constructor),"title"in t||"description"in t){let e=b(t,"title","subcommands"),r=b(t,"description",void 0);delete t.title,delete t.description,this._subparsers=this.add_argument_group(e,r)}else this._subparsers=this._positionals;if(void 0===t.prog){let e=this._get_formatter(),r=this._get_positional_actions(),n=this._mutually_exclusive_groups;e.add_usage(this.usage,r,n,""),t.prog=e.format_help().trim()}let e=new(this._pop_action_class(t,"parsers"))(Object.assign({option_strings:[]},t));return this._subparsers._add_action(e),e}_add_action(t){return t.option_strings.length?this._optionals._add_action(t):this._positionals._add_action(t),t}_get_optional_actions(){return this._actions.filter((t=>t.option_strings.length))}_get_positional_actions(){return this._actions.filter((t=>!t.option_strings.length))}parse_args(t=void 0,e=void 0){let r;if([t,r]=this.parse_known_args(t,e),r&&r.length>0){let t="unrecognized arguments: %s";this.error(m(t,r.join(" ")))}return t}parse_known_args(t=void 0,e=void 0){void 0===t&&(t=y().slice(1)),void 0===e&&(e=new ht);for(let t of this._actions)t.dest!==s&&(A(e,t.dest)||t.default!==s&&R(e,t.dest,t.default));for(let t of Object.keys(this._defaults))A(e,t)||R(e,t,this._defaults[t]);if(this.exit_on_error)try{[e,t]=this._parse_known_args(t,e)}catch(t){if(!(t instanceof Z))throw t;this.error(t.message)}else[e,t]=this._parse_known_args(t,e);return A(e,_)&&(t=t.concat(b(e,_)),I(e,_)),[e,t]}_parse_known_args(t,e){void 0!==this.fromfile_prefix_chars&&(t=this._read_args_from_files(t));let r=new Map;for(let t of this._mutually_exclusive_groups){let e=t._group_actions;for(let[n,i]of Object.entries(t._group_actions)){let t=r.get(i)||[];t=t.concat(e.slice(0,+n)),t=t.concat(e.slice(+n+1)),r.set(i,t)}}let n={},i=[],o=Object.entries(t)[Symbol.iterator]();for(let[t,e]of o)if("--"===e)for([t,e]of(i.push("-"),o))i.push("A");else{let r,s=this._parse_optional(e);void 0===s?r="A":(n[t]=s,r="O"),i.push(r)}let a,u=i.join(""),l=new Set,c=new Set,h=(t,n,i=void 0)=>{l.add(t);let o=this._get_values(t,n);if(o!==t.default){c.add(t);for(let e of r.get(t)||[])if(c.has(e)){let r="not allowed with argument %s",n=X(e);throw new Z(t,m(r,n))}}o!==s&&t(this,e,o,i)},f=e=>{let r,i=n[e],[s,o,l]=i,c=[];for(;;){if(void 0===s)return a.push(t[e]),e+1;if(void 0===l){let n=e+1,i=u.slice(n);r=n+this._match_argument(s,i);let a=t.slice(n,r);c.push([s,a,o]);break}{let t=this._match_argument(s,"A"),n=this.prefix_chars;if(0!==t||n.includes(o[1])){if(1===t){r=e+1;let t=[l];c.push([s,t,o]);break}throw new Z(s,m("ignored explicit argument %r",l))}{c.push([s,[],o]),o=o[0]+l[0];let t=l.slice(1)||void 0,e=this._option_string_actions;if(!A(e,o)){throw new Z(s,m("ignored explicit argument %r",l))}s=e[o],l=t}}}p(c.length);for(let[t,e,r]of c)h(t,e,r);return r},_=this._get_positional_actions(),g=e=>{let r=u.slice(e),n=this._match_arguments_partial(_,r);for(let r=0;r<_.length&&rt>=d)));if(d!==e){let t=g(d);if(t>d){d=t;continue}d=t}if(!(d in n)){let r=t.slice(d,e);a=a.concat(r),d=e}d=f(d)}let v=g(d);a=a.concat(t.slice(v));let y=[];for(let t of this._actions)l.has(t)||(t.required?y.push(X(t)):void 0!==t.default&&"string"==typeof t.default&&A(e,t.dest)&&t.default===b(e,t.dest)&&R(e,t.dest,this._get_value(t,t.default)));y.length&&this.error(m("the following arguments are required: %s",y.join(", ")));for(let t of this._mutually_exclusive_groups)if(t.required){let e=!0;for(let r of t._group_actions)if(c.has(r)){e=!1;break}if(e){let e=t._group_actions.filter((t=>t.help!==s)).map((t=>X(t))),r="one of the arguments %s is required";this.error(m(r,e.join(" ")))}}return[e,a]}_read_args_from_files(t){let e=[];for(let r of t)if(r&&this.fromfile_prefix_chars.includes(r[0]))try{let t=d.readFileSync(r.slice(1),"utf8"),n=[];for(let e of S(t))for(let t of this.convert_arg_line_to_args(e))n.push(t);n=this._read_args_from_files(n),e=e.concat(n)}catch(t){this.error(t.message)}else e.push(r);return e}convert_arg_line_to_args(t){return[t]}_match_argument(t,e){let r=this._get_nargs_pattern(t),n=e.match(new RegExp("^"+r));if(null===n){let e={undefined:"expected one argument",[o]:"expected at most one argument",[u]:"expected at least one argument"}[t.nargs];throw void 0===e&&(e=m(1===t.nargs?"expected %s argument":"expected %s arguments",t.nargs)),new Z(t,e)}return n[1].length}_match_arguments_partial(t,e){let r=[];for(let n of L(t.length,0,-1)){let i=t.slice(0,n).map((t=>this._get_nargs_pattern(t))).join(""),s=e.match(new RegExp("^"+i));if(null!==s){r=r.concat(s.slice(1).map((t=>t.length)));break}}return r}_parse_optional(t){if(!t)return;if(!this.prefix_chars.includes(t[0]))return;if(t in this._option_string_actions){return[this._option_string_actions[t],t,void 0]}if(1===t.length)return;if(t.includes("=")){let[e,r]=O(t,"=",1);if(e in this._option_string_actions){return[this._option_string_actions[e],e,r]}}let e=this._get_option_tuples(t);if(e.length>1){let r={option:t,matches:e.map((([,t])=>t)).join(", ")},n="ambiguous option: %(option)s could match %(matches)s";this.error(m(n,r))}else if(1===e.length){let[t]=e;return t}return this._negative_number_matcher.test(t)&&!this._has_negative_number_optionals.length||t.includes(" ")?void 0:[void 0,t,void 0]}_get_option_tuples(t){let e=[],r=this.prefix_chars;if(r.includes(t[0])&&r.includes(t[1])){if(this.allow_abbrev){let r,n;t.includes("=")?[r,n]=O(t,"=",1):(r=t,n=void 0);for(let t of Object.keys(this._option_string_actions))if(t.startsWith(r)){let r=[this._option_string_actions[t],t,n];e.push(r)}}}else if(r.includes(t[0])&&!r.includes(t[1])){let r,n=t,i=t.slice(0,2),s=t.slice(2);for(let t of Object.keys(this._option_string_actions))if(t===i){let r=[this._option_string_actions[t],t,s];e.push(r)}else if(t.startsWith(n)){let n=[this._option_string_actions[t],t,r];e.push(n)}}else this.error(m("unexpected option string: %s",t));return e}_get_nargs_pattern(t){let e,r=t.nargs;return e=void 0===r?"(-*A-*)":r===o?"(-*A?-*)":r===a?"(-*[A-]*)":r===u?"(-*A[A-]*)":r===f?"([-AO]*)":r===l?"(-*A[-AO]*)":r===s?"(-*-*)":m("(-*%s-*)","A".repeat(r).split("").join("-*")),t.option_strings.length&&(e=e.replace(/-\*/g,""),e=e.replace(/-/g,"")),e}parse_intermixed_args(t=void 0,e=void 0){let r;if([t,r]=this.parse_known_intermixed_args(t,e),r.length){let t="unrecognized arguments: %s";this.error(m(t,r.join(" ")))}return t}parse_known_intermixed_args(t=void 0,e=void 0){let r,n,i=this._get_positional_actions(),o=i.filter((t=>[l,f].includes(t.nargs)));if(o.length)throw new TypeError(m("parse_intermixed_args: positional arg with nargs=%s",o[0].nargs));for(let t of this._mutually_exclusive_groups)for(let e of t._group_actions)if(i.includes(e))throw new TypeError("parse_intermixed_args: positional in mutuallyExclusiveGroup");try{let o;n=this.usage;try{void 0===this.usage&&(this.usage=this.format_usage().slice(7));for(let t of i)t.save_nargs=t.nargs,t.nargs=s,t.save_default=t.default,t.default=s;[e,o]=this.parse_known_args(t,e);for(let t of i){let r=b(e,t.dest);Array.isArray(r)&&0===r.length&&(console.warn(m("Do not expect %s in %s",t.dest,e)),I(e,t.dest))}}finally{for(let t of i)t.nargs=t.save_nargs,t.default=t.save_default}let a=this._get_optional_actions();try{for(let t of a)t.save_required=t.required,t.required=!1;for(let t of this._mutually_exclusive_groups)t.save_required=t.required,t.required=!1;[e,r]=this.parse_known_args(o,e)}finally{for(let t of a)t.required=t.save_required;for(let t of this._mutually_exclusive_groups)t.required=t.save_required}}finally{this.usage=n}return[e,r]}_get_values(t,e){if(![l,f].includes(t.nargs))try{w(e,"--")}catch(t){}let r;if(e.length||t.nargs!==o)if(e.length||t.nargs!==a||t.option_strings.length)if(1===e.length&&[void 0,o].includes(t.nargs)){let n=e[0];r=this._get_value(t,n),this._check_value(t,r)}else if(t.nargs===f)r=e.map((e=>this._get_value(t,e)));else if(t.nargs===l)r=e.map((e=>this._get_value(t,e))),this._check_value(t,r[0]);else if(t.nargs===s)r=s;else{r=e.map((e=>this._get_value(t,e)));for(let e of r)this._check_value(t,e)}else r=void 0!==t.default?t.default:e,this._check_value(t,r);else r=t.option_strings.length?t.const:t.default,"string"==typeof r&&(r=this._get_value(t,r),this._check_value(t,r));return r}_get_value(t,e){let r,n=this._registry_get("type",t.type,t.type);if("function"!=typeof n){throw new Z(t,m("%r is not callable",n))}try{try{r=n(e)}catch(t){if(!(t instanceof TypeError&&/Class constructor .* cannot be invoked without 'new'/.test(t.message)))throw t;r=new n(e)}}catch(r){if(r instanceof q){let e=r.message;throw new Z(t,e)}if(r instanceof TypeError){let r=b(t.type,"name",v(t.type));throw new Z(t,m("invalid %(type)s value: %(value)r",{type:r,value:e}))}throw r}return r}_check_value(t,e){if(void 0!==t.choices&&!C(t.choices).includes(e)){let r={value:e,choices:C(t.choices).map(v).join(", ")};throw new Z(t,m("invalid choice: %(value)r (choose from %(choices)s)",r))}}format_usage(){let t=this._get_formatter();return t.add_usage(this.usage,this._actions,this._mutually_exclusive_groups),t.format_help()}format_help(){let t=this._get_formatter();t.add_usage(this.usage,this._actions,this._mutually_exclusive_groups),t.add_text(this.description);for(let e of this._action_groups)t.start_section(e.title),t.add_text(e.description),t.add_arguments(e._group_actions),t.end_section();return t.add_text(this.epilog),t.format_help()}_get_formatter(){return new this.formatter_class({prog:this.prog})}print_usage(t=void 0){void 0===t&&(t=process.stdout),this._print_message(this.format_usage(),t)}print_help(t=void 0){void 0===t&&(t=process.stdout),this._print_message(this.format_help(),t)}_print_message(t,e=void 0){t&&(void 0===e&&(e=process.stderr),e.write(t))}exit(t=0,e=void 0){e&&this._print_message(e,process.stderr),process.exit(t)}error(t){if(!0===this.debug)throw new Error(t);this.print_usage(process.stderr);let e={prog:this.prog,message:t};this.exit(2,m("%(prog)s: error: %(message)s\n",e))}}));e.exports={ArgumentParser:gt,ArgumentError:Z,ArgumentTypeError:q,BooleanOptionalAction:Q,FileType:ct,HelpFormatter:V,ArgumentDefaultsHelpFormatter:K,RawDescriptionHelpFormatter:z,RawTextHelpFormatter:W,MetavarTypeHelpFormatter:Y,Namespace:ht,Action:$,ONE_OR_MORE:u,OPTIONAL:o,PARSER:l,REMAINDER:f,SUPPRESS:s,ZERO_OR_MORE:a},Object.defineProperty(e.exports,"Const",{get(){let t={};return Object.entries({ONE_OR_MORE:u,OPTIONAL:o,PARSER:l,REMAINDER:f,SUPPRESS:s,ZERO_OR_MORE:a}).forEach((([e,r])=>{Object.defineProperty(t,e,{get:()=>(F(e,m("use argparse.%s instead of argparse.Const.%s",e,e)),r)})})),Object.entries({_UNRECOGNIZED_ARGS_ATTR:_}).forEach((([e,r])=>{Object.defineProperty(t,e,{get:()=>(F(e,m("argparse.Const.%s is an internal symbol and will no longer be available",e)),r)})})),t},enumerable:!1})}(o);var f=o.exports,_=function(t,e){return _=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},_(t,e)};function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}_(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var g,d,m,E=function(){return E=Object.assign||function(t){for(var e,r=1,n=arguments.length;r1)throw new RangeError("integer-width stems only accept a single optional option");i.options[0].replace(U,(function(t,r,n,i,s,o){if(r)e.minimumIntegerDigits=n.length;else{if(i&&s)throw new Error("We currently do not support maximum integer digits");if(o)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(G.test(i.stem))e.minimumIntegerDigits=i.stem.length;else if(P.test(i.stem)){if(i.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");i.stem.replace(P,(function(t,r,n,i,s,o){return"*"===n?e.minimumFractionDigits=r.length:i&&"#"===i[0]?e.maximumFractionDigits=i.length:s&&o?(e.minimumFractionDigits=s.length,e.maximumFractionDigits=s.length+o.length):(e.minimumFractionDigits=r.length,e.maximumFractionDigits=r.length),""}));var s=i.options[0];"w"===s?e=E(E({},e),{trailingZeroDisplay:"stripIfInteger"}):s&&(e=E(E({},e),k(s)))}else if(x.test(i.stem))e=E(E({},e),k(i.stem));else{var o=F(i.stem);o&&(e=E(E({},e),o));var a=H(i.stem);a&&(e=E(E({},e),a))}}return e}var z,W={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function K(t){var e=t.hourCycle;if(void 0===e&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var r,n=t.language;return"root"!==n&&(r=t.maximize().region),(W[r||""]||W[n||""]||W["".concat(n,"-001")]||W["001"])[0]}var Y=new RegExp("^".concat(C.source,"*")),X=new RegExp("".concat(C.source,"*$"));function Z(t,e){return{start:t,end:e}}var q=!!String.prototype.startsWith,$=!!String.fromCodePoint,Q=!!Object.fromEntries,J=!!String.prototype.codePointAt,tt=!!String.prototype.trimStart,et=!!String.prototype.trimEnd,rt=!!Number.isSafeInteger?Number.isSafeInteger:function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},nt=!0;try{nt="a"===(null===(z=ht("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===z?void 0:z[0])}catch(t){nt=!1}var it,st=q?function(t,e,r){return t.startsWith(e,r)}:function(t,e,r){return t.slice(r,r+e.length)===e},ot=$?String.fromCodePoint:function(){for(var t=[],e=0;es;){if((r=t[s++])>1114111)throw RangeError(r+" is not a valid code point");n+=r<65536?String.fromCharCode(r):String.fromCharCode(55296+((r-=65536)>>10),r%1024+56320)}return n},at=Q?Object.fromEntries:function(t){for(var e={},r=0,n=t;r=r)){var n,i=t.charCodeAt(e);return i<55296||i>56319||e+1===r||(n=t.charCodeAt(e+1))<56320||n>57343?i:n-56320+(i-55296<<10)+65536}},lt=tt?function(t){return t.trimStart()}:function(t){return t.replace(Y,"")},ct=et?function(t){return t.trimEnd()}:function(t){return t.replace(X,"")};function ht(t,e){return new RegExp(t,e)}if(nt){var ft=ht("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");it=function(t,e){var r;return ft.lastIndex=e,null!==(r=ft.exec(t)[1])&&void 0!==r?r:""}}else it=function(t,e){for(var r=[];;){var n=ut(t,e);if(void 0===n||gt(n)||dt(n))break;r.push(n),e+=n>=65536?2:1}return ot.apply(void 0,r)};var _t=function(){function t(t,e){void 0===e&&(e={}),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!e.ignoreTag,this.locale=e.locale,this.requiresOtherClause=!!e.requiresOtherClause,this.shouldParseSkeletons=!!e.shouldParseSkeletons}return t.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(t,e,r){for(var n=[];!this.isEOF();){var i=this.char();if(123===i){if((s=this.parseArgument(t,r)).err)return s;n.push(s.val)}else{if(125===i&&t>0)break;if(35!==i||"plural"!==e&&"selectordinal"!==e){if(60===i&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(g.UNMATCHED_CLOSING_TAG,Z(this.clonePosition(),this.clonePosition()))}if(60===i&&!this.ignoreTag&&pt(this.peek()||0)){if((s=this.parseTag(t,e)).err)return s;n.push(s.val)}else{var s;if((s=this.parseLiteral(t,e)).err)return s;n.push(s.val)}}else{var o=this.clonePosition();this.bump(),n.push({type:d.pound,location:Z(o,this.clonePosition())})}}}return{val:n,err:null}},t.prototype.parseTag=function(t,e){var r=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:d.literal,value:"<".concat(n,"/>"),location:Z(r,this.clonePosition())},err:null};if(this.bumpIf(">")){var i=this.parseMessage(t+1,e,!0);if(i.err)return i;var s=i.val,o=this.clonePosition();if(this.bumpIf("")?{val:{type:d.tag,value:n,children:s,location:Z(r,this.clonePosition())},err:null}:this.error(g.INVALID_TAG,Z(o,this.clonePosition())))}return this.error(g.UNCLOSED_TAG,Z(r,this.clonePosition()))}return this.error(g.INVALID_TAG,Z(r,this.clonePosition()))},t.prototype.parseTagName=function(){var t,e=this.offset();for(this.bump();!this.isEOF()&&(45===(t=this.char())||46===t||t>=48&&t<=57||95===t||t>=97&&t<=122||t>=65&&t<=90||183==t||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039);)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(t,e){for(var r=this.clonePosition(),n="";;){var i=this.tryParseQuote(e);if(i)n+=i;else{var s=this.tryParseUnquoted(t,e);if(s)n+=s;else{var o=this.tryParseLeftAngleBracket();if(!o)break;n+=o}}}var a=Z(r,this.clonePosition());return{val:{type:d.literal,value:n,location:a},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(pt(t=this.peek()||0)||47===t)?null:(this.bump(),"<");var t},t.prototype.tryParseQuote=function(t){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===t||"selectordinal"===t)break;return null;default:return null}this.bump();var e=[this.char()];for(this.bump();!this.isEOF();){var r=this.char();if(39===r){if(39!==this.peek()){this.bump();break}e.push(39),this.bump()}else e.push(r);this.bump()}return ot.apply(void 0,e)},t.prototype.tryParseUnquoted=function(t,e){if(this.isEOF())return null;var r=this.char();return 60===r||123===r||35===r&&("plural"===e||"selectordinal"===e)||125===r&&t>0?null:(this.bump(),ot(r))},t.prototype.parseArgument=function(t,e){var r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Z(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(g.EMPTY_ARGUMENT,Z(r,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(g.MALFORMED_ARGUMENT,Z(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Z(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:d.argument,value:n,location:Z(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Z(r,this.clonePosition())):this.parseArgumentOptions(t,e,n,r);default:return this.error(g.MALFORMED_ARGUMENT,Z(r,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var t=this.clonePosition(),e=this.offset(),r=it(this.message,e),n=e+r.length;return this.bumpTo(n),{value:r,location:Z(t,this.clonePosition())}},t.prototype.parseArgumentOptions=function(t,e,r,n){var i,s=this.clonePosition(),o=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(o){case"":return this.error(g.EXPECT_ARGUMENT_TYPE,Z(s,a));case"number":case"date":case"time":this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var l=this.clonePosition();if((A=this.parseSimpleArgStyleIfPossible()).err)return A;if(0===(_=ct(A.val)).length)return this.error(g.EXPECT_ARGUMENT_STYLE,Z(this.clonePosition(),this.clonePosition()));u={style:_,styleLocation:Z(l,this.clonePosition())}}if((b=this.tryParseArgumentClose(n)).err)return b;var c=Z(n,this.clonePosition());if(u&&st(null==u?void 0:u.style,"::",0)){var h=lt(u.style.slice(2));if("number"===o)return(A=this.parseNumberSkeletonFromString(h,u.styleLocation)).err?A:{val:{type:d.number,value:r,location:c,style:A.val},err:null};if(0===h.length)return this.error(g.EXPECT_DATE_TIME_SKELETON,c);var f=h;this.locale&&(f=function(t,e){for(var r="",n=0;n>1),u=K(e);for("H"!=u&&"k"!=u||(a=0);a-- >0;)r+="a";for(;o-- >0;)r=u+r}else r+="J"===i?"H":i}return r}(h,this.locale));var _={type:m.dateTime,pattern:f,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?M(f):{}};return{val:{type:"date"===o?d.date:d.time,value:r,location:c,style:_},err:null}}return{val:{type:"number"===o?d.number:"date"===o?d.date:d.time,value:r,location:c,style:null!==(i=null==u?void 0:u.style)&&void 0!==i?i:null},err:null};case"plural":case"selectordinal":case"select":var p=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(g.EXPECT_SELECT_ARGUMENT_OPTIONS,Z(p,E({},p)));this.bumpSpace();var v=this.parseIdentifierIfPossible(),y=0;if("select"!==o&&"offset"===v.value){if(!this.bumpIf(":"))return this.error(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Z(this.clonePosition(),this.clonePosition()));var A;if(this.bumpSpace(),(A=this.tryParseDecimalInteger(g.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,g.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return A;this.bumpSpace(),v=this.parseIdentifierIfPossible(),y=A.val}var b,R=this.tryParsePluralOrSelectOptions(t,o,e,v);if(R.err)return R;if((b=this.tryParseArgumentClose(n)).err)return b;var T=Z(n,this.clonePosition());return"select"===o?{val:{type:d.select,value:r,options:at(R.val),location:T},err:null}:{val:{type:d.plural,value:r,options:at(R.val),offset:y,pluralType:"plural"===o?"cardinal":"ordinal",location:T},err:null};default:return this.error(g.INVALID_ARGUMENT_TYPE,Z(s,a))}},t.prototype.tryParseArgumentClose=function(t){return this.isEOF()||125!==this.char()?this.error(g.EXPECT_ARGUMENT_CLOSING_BRACE,Z(t,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var t=0,e=this.clonePosition();!this.isEOF();){switch(this.char()){case 39:this.bump();var r=this.clonePosition();if(!this.bumpUntil("'"))return this.error(g.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Z(r,this.clonePosition()));this.bump();break;case 123:t+=1,this.bump();break;case 125:if(!(t>0))return{val:this.message.slice(e.offset,this.offset()),err:null};t-=1;break;default:this.bump()}}return{val:this.message.slice(e.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(t,e){var r=[];try{r=function(t){if(0===t.length)throw new Error("Number skeleton cannot be empty");for(var e=[],r=0,n=t.split(B).filter((function(t){return t.length>0}));r=48&&o<=57))break;i=!0,s=10*s+(o-48),this.bump()}var a=Z(n,this.clonePosition());return i?rt(s*=r)?{val:s,err:null}:this.error(e,a):this.error(t,a)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var t=this.position.offset;if(t>=this.message.length)throw Error("out of bound");var e=ut(this.message,t);if(void 0===e)throw Error("Offset ".concat(t," is at invalid UTF-16 code unit boundary"));return e},t.prototype.error=function(t,e){return{val:null,err:{kind:t,message:this.message,location:e}}},t.prototype.bump=function(){if(!this.isEOF()){var t=this.char();10===t?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=t<65536?1:2)}},t.prototype.bumpIf=function(t){if(st(this.message,t,this.offset())){for(var e=0;e=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(t){if(this.offset()>t)throw Error("targetOffset ".concat(t," must be greater than or equal to the current offset ").concat(this.offset()));for(t=Math.min(t,this.message.length);;){var e=this.offset();if(e===t)break;if(e>t)throw Error("targetOffset ".concat(t," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&>(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var t=this.char(),e=this.offset(),r=this.message.charCodeAt(e+(t>=65536?2:1));return null!=r?r:null},t}();function pt(t){return t>=97&&t<=122||t>=65&&t<=90}function gt(t){return t>=9&&t<=13||32===t||133===t||t>=8206&&t<=8207||8232===t||8233===t}function dt(t){return t>=33&&t<=35||36===t||t>=37&&t<=39||40===t||41===t||42===t||43===t||44===t||45===t||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||91===t||92===t||93===t||94===t||96===t||123===t||124===t||125===t||126===t||161===t||t>=162&&t<=165||166===t||167===t||169===t||171===t||172===t||174===t||176===t||177===t||182===t||187===t||191===t||215===t||247===t||t>=8208&&t<=8213||t>=8214&&t<=8215||8216===t||8217===t||8218===t||t>=8219&&t<=8220||8221===t||8222===t||8223===t||t>=8224&&t<=8231||t>=8240&&t<=8248||8249===t||8250===t||t>=8251&&t<=8254||t>=8257&&t<=8259||8260===t||8261===t||8262===t||t>=8263&&t<=8273||8274===t||8275===t||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||8608===t||t>=8609&&t<=8610||8611===t||t>=8612&&t<=8613||8614===t||t>=8615&&t<=8621||8622===t||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||8658===t||8659===t||8660===t||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||8968===t||8969===t||8970===t||8971===t||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||9001===t||9002===t||t>=9003&&t<=9083||9084===t||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||9655===t||t>=9656&&t<=9664||9665===t||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||9839===t||t>=9840&&t<=10087||10088===t||10089===t||10090===t||10091===t||10092===t||10093===t||10094===t||10095===t||10096===t||10097===t||10098===t||10099===t||10100===t||10101===t||t>=10132&&t<=10175||t>=10176&&t<=10180||10181===t||10182===t||t>=10183&&t<=10213||10214===t||10215===t||10216===t||10217===t||10218===t||10219===t||10220===t||10221===t||10222===t||10223===t||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||10627===t||10628===t||10629===t||10630===t||10631===t||10632===t||10633===t||10634===t||10635===t||10636===t||10637===t||10638===t||10639===t||10640===t||10641===t||10642===t||10643===t||10644===t||10645===t||10646===t||10647===t||10648===t||t>=10649&&t<=10711||10712===t||10713===t||10714===t||10715===t||t>=10716&&t<=10747||10748===t||10749===t||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||11158===t||t>=11159&&t<=11263||t>=11776&&t<=11777||11778===t||11779===t||11780===t||11781===t||t>=11782&&t<=11784||11785===t||11786===t||11787===t||11788===t||11789===t||t>=11790&&t<=11798||11799===t||t>=11800&&t<=11801||11802===t||11803===t||11804===t||11805===t||t>=11806&&t<=11807||11808===t||11809===t||11810===t||11811===t||11812===t||11813===t||11814===t||11815===t||11816===t||11817===t||t>=11818&&t<=11822||11823===t||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||11840===t||11841===t||11842===t||t>=11843&&t<=11855||t>=11856&&t<=11857||11858===t||t>=11859&&t<=11903||t>=12289&&t<=12291||12296===t||12297===t||12298===t||12299===t||12300===t||12301===t||12302===t||12303===t||12304===t||12305===t||t>=12306&&t<=12307||12308===t||12309===t||12310===t||12311===t||12312===t||12313===t||12314===t||12315===t||12316===t||12317===t||t>=12318&&t<=12319||12320===t||12336===t||64830===t||64831===t||t>=65093&&t<=65094}function mt(t){t.forEach((function(t){if(delete t.location,I(t)||L(t))for(var e in t.options)delete t.options[e].location,mt(t.options[e].value);else b(t)&&N(t.style)||(R(t)||T(t))&&w(t.style)?delete t.style.location:O(t)&&mt(t.children)}))}function Et(t,e){void 0===e&&(e={}),e=E({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var r=new _t(t,e).parse();if(r.err){var n=SyntaxError(g[r.err.kind]);throw n.location=r.err.location,n.originalMessage=r.err.message,n}return(null==e?void 0:e.captureLocation)||mt(r.val),r.val}function vt(t,e){var r=e&&e.cache?e.cache:St,n=e&&e.serializer?e.serializer:Tt;return(e&&e.strategy?e.strategy:Rt)(t,{cache:r,serializer:n})}function yt(t,e,r,n){var i,s=null==(i=n)||"number"==typeof i||"boolean"==typeof i?n:r(n),o=e.get(s);return void 0===o&&(o=t.call(this,n),e.set(s,o)),o}function At(t,e,r){var n=Array.prototype.slice.call(arguments,3),i=r(n),s=e.get(i);return void 0===s&&(s=t.apply(this,n),e.set(i,s)),s}function bt(t,e,r,n,i){return r.bind(e,t,n,i)}function Rt(t,e){return bt(t,this,1===t.length?yt:At,e.cache.create(),e.serializer)}var Tt=function(){return JSON.stringify(arguments)};function It(){this.cache=Object.create(null)}It.prototype.get=function(t){return this.cache[t]},It.prototype.set=function(t,e){this.cache[t]=e};var Lt,St={create:function(){return new It}},Ot={variadic:function(t,e){return bt(t,this,At,e.cache.create(),e.serializer)},monadic:function(t,e){return bt(t,this,yt,e.cache.create(),e.serializer)}};!function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"}(Lt||(Lt={}));var Nt,wt=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.code=r,i.originalMessage=n,i}return p(e,t),e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),Ct=function(t){function e(e,r,n,i){return t.call(this,'Invalid values for "'.concat(e,'": "').concat(r,'". Options are "').concat(Object.keys(n).join('", "'),'"'),Lt.INVALID_VALUE,i)||this}return p(e,t),e}(wt),Dt=function(t){function e(e,r,n){return t.call(this,'Value for "'.concat(e,'" must be of type ').concat(r),Lt.INVALID_VALUE,n)||this}return p(e,t),e}(wt),Mt=function(t){function e(e,r){return t.call(this,'The intl string context variable "'.concat(e,'" was not provided to the string "').concat(r,'"'),Lt.MISSING_VALUE,r)||this}return p(e,t),e}(wt);function Bt(t){return"function"==typeof t}function Pt(t,e,r,n,i,s,o){if(1===t.length&&y(t[0]))return[{type:Nt.literal,value:t[0].value}];for(var a=[],u=0,l=t;u0?new Intl.Locale(e[0]):new Intl.Locale("string"==typeof t?t:t[0])}},t.__parse=Et,t.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},t}();!function(t){t.FORMAT_ERROR="FORMAT_ERROR",t.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",t.INVALID_CONFIG="INVALID_CONFIG",t.MISSING_DATA="MISSING_DATA",t.MISSING_TRANSLATION="MISSING_TRANSLATION"}(Gt||(Gt={}));var Ft=function(t){function e(r,n,i){var s=this,o=i?i instanceof Error?i:new Error(String(i)):void 0;return(s=t.call(this,"[@formatjs/intl Error ".concat(r,"] ").concat(n,"\n").concat(o?"\n".concat(o.message,"\n").concat(o.stack):""))||this).code=r,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s,e),s}return p(e,t),e}(Error),Ht=function(t){function e(e,r){return t.call(this,Gt.UNSUPPORTED_FORMATTER,e,r)||this}return p(e,t),e}(Ft),jt=function(t){function e(e,r){return t.call(this,Gt.INVALID_CONFIG,e,r)||this}return p(e,t),e}(Ft),Vt=function(t){function e(e,r){return t.call(this,Gt.MISSING_DATA,e,r)||this}return p(e,t),e}(Ft),zt=function(t){function e(e,r,n){var i=t.call(this,Gt.FORMAT_ERROR,"".concat(e,"\nLocale: ").concat(r,"\n"),n)||this;return i.locale=r,i}return p(e,t),e}(Ft),Wt=function(t){function e(e,r,n,i){var s=t.call(this,"".concat(e,"\nMessageID: ").concat(null==n?void 0:n.id,"\nDefault Message: ").concat(null==n?void 0:n.defaultMessage,"\nDescription: ").concat(null==n?void 0:n.description,"\n"),r,i)||this;return s.descriptor=n,s.locale=r,s}return p(e,t),e}(zt),Kt=function(t){function e(e,r){var n=t.call(this,Gt.MISSING_TRANSLATION,'Missing message: "'.concat(e.id,'" for locale "').concat(r,'", using ').concat(e.defaultMessage?"default message (".concat("string"==typeof e.defaultMessage?e.defaultMessage:e.defaultMessage.map((function(t){var e;return null!==(e=t.value)&&void 0!==e?e:JSON.stringify(t)})).join(),")"):"id"," as fallback."))||this;return n.descriptor=e,n}return p(e,t),e}(Ft);function Yt(t,e,r){return void 0===r&&(r={}),e.reduce((function(e,n){return n in t?e[n]=t[n]:n in r&&(e[n]=r[n]),e}),{})}var Xt={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:function(t){"production"!==process.env.NODE_ENV&&console.error(t)},onWarn:function(t){"production"!==process.env.NODE_ENV&&console.warn(t)}};function Zt(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,r){t[e]=r}}}}}function qt(t,e,r,n){var i,s=t&&t[e];if(s&&(i=s[r]),i)return i;n(new Ht("No ".concat(e," format named: ").concat(r)))}function $t(t,e){return Object.keys(t).reduce((function(r,n){return r[n]=E({timeZone:e},t[n]),r}),{})}function Qt(t,e){return Object.keys(E(E({},t),e)).reduce((function(r,n){return r[n]=E(E({},t[n]||{}),e[n]||{}),r}),{})}function Jt(t,e){if(!e)return t;var r=kt.formats;return E(E(E({},r),t),{date:Qt($t(r.date,e),$t(t.date||{},e)),time:Qt($t(r.time,e),$t(t.time||{},e))})}var te=function(t,e,r,n,i){var s=t.locale,o=t.formats,a=t.messages,u=t.defaultLocale,l=t.defaultFormats,c=t.fallbackOnEmptyString,h=t.onError,f=t.timeZone,_=t.defaultRichTextElements;void 0===r&&(r={id:""});var p=r.id,g=r.defaultMessage;!function(t,e,r){if(void 0===r&&(r=Error),!t)throw new r(e)}(!!p,"[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");var m=String(p),v=a&&Object.prototype.hasOwnProperty.call(a,m)&&a[m];if(Array.isArray(v)&&1===v.length&&v[0].type===d.literal)return v[0].value;if(!n&&v&&"string"==typeof v&&!_)return v.replace(/'\{(.*?)\}'/gi,"{$1}");if(n=E(E({},_),n||{}),o=Jt(o,f),l=Jt(l,f),!v){if(!1===c&&""===v)return v;if((!g||s&&s.toLowerCase()!==u.toLowerCase())&&h(new Kt(r,s)),g)try{return e.getMessageFormat(g,u,l,i).format(n)}catch(t){return h(new Wt('Error formatting default message for: "'.concat(m,'", rendering default message verbatim'),s,r,t)),"string"==typeof g?g:m}return m}try{return e.getMessageFormat(v,s,o,E({formatters:e},i||{})).format(n)}catch(t){h(new Wt('Error formatting message: "'.concat(m,'", using ').concat(g?"default message":"id"," as fallback."),s,r,t))}if(g)try{return e.getMessageFormat(g,u,l,i).format(n)}catch(t){h(new Wt('Error formatting the default message for: "'.concat(m,'", rendering message verbatim'),s,r,t))}return"string"==typeof v?v:"string"==typeof g?g:m},ee=["formatMatcher","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName","hourCycle","dateStyle","timeStyle","calendar","numberingSystem","fractionalSecondDigits"];function re(t,e,r,n){var i=t.locale,s=t.formats,o=t.onError,a=t.timeZone;void 0===n&&(n={});var u=n.format,l=E(E({},a&&{timeZone:a}),u&&qt(s,e,u,o)),c=Yt(n,ee,l);return"time"!==e||c.hour||c.minute||c.second||c.timeStyle||c.dateStyle||(c=E(E({},c),{hour:"numeric",minute:"numeric"})),r(i,c)}function ne(t,e){for(var r=[],n=2;n",READ_INPUT:"{value}",PROGRAM_EXITED:"程序执行结束,返回值为{returnValue}。",EXECUTION_STEP_COUNT_TIME:"总执行步数:{stepCount, number};总执行耗时:{time, number}ms"}},{name:"English",locale:{APP_TITLE:"IR Virtual Machine",ADD:"New",IMPORT:"Import",DEMOS:"Demos",DEMO_SOURCES:"Sources",SAVE:"Save",THEME:"Theme",ABOUT:"About",CLOSE:"Close",CONFIRM_UNSAVED_CLOSE:"Save changes to {name} before close?",SAVE_CLOSE:"Save&Close",UNSAVE_CLOSE:"Close",OK:"OK",CANCEL:"Cancel",EMPTY_PLACEHOLDER_DESC:"An IR virtual machine for HIT/NJU Compilation Principle labs",EMPTY_PLACEHOLDER_HINT_TITLE:"You may:",EMPTY_PLACEHOLDER_HINT_1:"Add or import .ir files in left sidebar",EMPTY_PLACEHOLDER_HINT_2:"Drag one or more .ir files inside",EMPTY_PLACEHOLDER_HINT_3:"Try out Demos in left sidebar",FETCH_FAILED:"fetch() for {url} failed",NOT_AN_IR_FILE:"{fileName} is not an ir file",IR_IMPORT_FAILED:"Failed to import {fileName}",RUN:"Run",RUN_STEP:"Step",RESET:"Reset",CLEAR_CONSOLE:"Clear",STEP_COUNT:"Step Count: ",STEP_COUNT_NUMBER:"{stepCount, number}",STATE:"VM State: ",STATE_INITIAL:"Initial",STATE_BUSY:"Busy",STATE_WAIT_INPUT:"Awaiting Input",STATE_FREE:"Free",STATE_STATIC_CHECK_FAILED:"IR Static Check Error",STATE_RUNTIME_ERROR:"Runtime Error",STATE_MAX_STEP_REACHED:"Max Step Count Reached",STATE_EXITED_NORMALLY:"Exited Normally (Return value 0)",STATE_EXITED_ABNORMALLY:"Exited Abnormally (Return value not 0)",MAX_EXECUTION_STEP_COUNT:"Max Steps",SET_0_MEANS_NO_STEP_LIMIT:"No step limit if set to 0",MEMORY_SIZE:"Memory Size/B",STACK_SIZE:"Stack Size/B",TOTAL_MEMORY_USAGE:"Total Memory Usage: ",STACK_MEMORY_USAGE:"Stack Memory Usage: ",GLOBAL_VARIABLE_MEMORY_USAGE:"GlobalVar Memory Usage: ",PEAK_MEMORY_USAGE:"Peak Usage: ",PERCENTAGE_USAGE:"{percentage, number, ::.0}%",BYTE_USAGE:"{used}B/{total}B",ARBITRARY_UNIT_MEMORY_USAGE:"{used, number, ::.0}{unit}/{total, number, ::.0}{unit}",BYTE_SIZE:"{size}B",ARBITRARY_UNIT_SIZE:"{size, number, ::.0}{unit}",GLOBAL_VARIABLE_TABLE:"Global Variable Table",LOCAL_VARIABLE_TABLE:"Local Variable Table",VARIABLE_ID:"ID",ADDRESS:"Address",SIZE:"Size",VALUES:"Value",EMPTY_VATIABLE_TABLE:"(Empty)",CALL_STACK_DEPTH:"Call stack depth {depth}",STATIC_ERROR_PREFIX:"Static Check Error (Line {lineNumber}): ",STATIC_ERROR_PREFIX_NO_LINE_NUMBER:"Static Check Error: ",DECODE_ERROR_PREFIX:"IR Decoding Error (Line {lineNumber}): ",UNRECOGNIZED_INSTRUCTION:"Unrecognized IR instruction",ILLEGAL_INSTRUCTION_FORMAT:"Illegal IR format",FUNCTION_ILLEGAL_ID:"FUNCTION id illegal",ASSIGN_ILLEGAL_LEFT:"Illegal left hand side of assignment",ASSIGN_ILLEGAL_RIGHT:"Illegal right hand side of assignment",ASSIGN_RIGHT_IMM_TOO_LARGE:"Right hand side immediate number of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERATOR:"Illegal math operator on RHS of assignment",ASSIGN_ILLEGAL_RIGHT_OPERAND1:"Illegal first Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE:"First immediate number operand on RHS of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERAND2:"Illegal second Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE:"Second immediate number operand on RHS of assignment too large",DEC_ILLEGAL_ID:"DEC's id illegal",DEC_ILLEGAL_SIZE_FORMAT:"DEC's size format illegal",DEC_SIZE_TOO_LARGE:"DEC's size too large",DEC_SIZE_NOT_4_MULTIPLE:"DEC's size not a multiple of 4",GLOBAL_DEC_ILLEGAL_ID:"GLOBAL_DEC's id illegal",GLOBAL_DEC_ILLEGAL_SIZE_FORMAT:"GLOBAL_DEC's size format illegal",GLOBAL_DEC_SIZE_TOO_LARGE:"GLOBAL_DEC's size too large",GLOBAL_DEC_SIZE_NOT_4_MULTIPLE:"GLOBAL_DEC's size not a multiple of 4",LABEL_ILLEGAL_ID:"LABEL's id illegal",GOTO_ILLEGAL_ID:"GOTO's id illegal",DUPLICATE_LABEL_ID:"LABEL's label id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_FUNCTION_ID:"FUNCTION's function id ''{id}'' already declared (last declared at line {lastLineNumber})",FUNCTION_NOT_FOUND:"Can't find function ''{id}''",LABEL_NOT_FOUND:"Can't find label ''{id}''",IF_ILLEGAL_COND_OPERATOR:"IF's relop illegal",IF_ILLEGAL_COND_OPERAND1:"IF's first Singular operand in condition illegal",IF_COND_OPERAND1_IMM_TOO_LARGE:"IF's first immediate number operand in condition too large",IF_ILLEGAL_COND_OPERAND2:"IF's second Singular operand in condition illegal",IF_COND_OPERAND2_IMM_TOO_LARGE:"IF's second immediate number operand in condition too large",IF_ILLEGAL_GOTO_ID:"IF's GOTO id illegal",ARG_ILLEGAL:"ARG's Singular arg illegal",ARG_IMM_TOO_LARGE:"ARG's immediate number arg too large",CALL_ILLEGAL_ID:"CALL's function id illegal",PARAM_ILLEGAL_ID:"PARAM's param id illegal",RETURN_ILLEGAL:"RETURN's Singular return value illegal",RETURN_IMM_TOO_LARGE:"RETURN's immediate number return value too large",READ_ILLEGAL:"Illegal LValue for READ",WRITE_ILLEGAL:"Illegal Singular for WRITE",WRITE_IMM_TOO_LARGE:"Immediate number for WRITE too large",NO_MAIN_FUNCTION:"Function 'main' is not defined",RUNTIME_ERROR_PREFIX:"Runtime Error (Line {lineNumber}): ",RUNTIME_ERROR_PREFIX_NO_LN:"Runtime Error: ",GLOBAL_VARIABLE_SEGMENT_OVERFLOW:"Global variable segment overflow",STACK_OVERFLOW:"Stack overflow",VARIABLE_NOT_FOUND:"Can't find variable ''{id}''",INSTRUCTION_READ_OUT_OF_BOUND:"Reading instruction from {address} is out of bound",MEMORY_READ_OUT_OF_BOUND:"Reading 4 bytes from {address} is out of bound",MEMORY_WRITE_OUT_OF_BOUND:"Writing 4 bytes to {address} is out of bound",EMPTY_VARIABLE_TABLE_STACK:"Empty local variable stack",DUPLICATE_DEC_ID:"DEC's variable id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_GLOBAL_DEC_ID:"GLOBAL_DEC's global variable id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_PARAM_ID:"PARAM's param id ''{id}'' already declared (last declared at line {lastLineNumber})",DIVIDE_BY_ZERO:"Cannot divide by 0",MAX_STEP_REACHED:"Maximum execution step count reached ({maxExecutionStepCount, number})",INPUT_INT_ILLEGAL:"Illegal input integer",INPUT_INT_ABS_TOO_LARGE:"Absolute value of input integer too large",WRITE_OUTPUT:"{value}",READ_PROMPT:"Please enter a value for {name}:",CONSOLE_ARROW:">",READ_INPUT:"{value}",PROGRAM_EXITED:"Program exited with return value {returnValue}.",EXECUTION_STEP_COUNT_TIME:"Execution step count: {stepCount, number}; Execution time: {time, number}ms"}}],Ie=new Int32Array(1);function Le(t){return Ie[0]=t,Ie[0]}function Se(t,e){return Le(t+e)}function Oe(t,e){return Le(t-e)}var Ne,we,Ce,De,Me,Be,Pe,xe,Ue;function Ge(t,e){return t<0||t+4>e.length?{value:null,status:Ne.OUT_OF_BOUND}:{value:Le(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24),status:Ne.SUCCESS}}!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.OUT_OF_BOUND=1]="OUT_OF_BOUND"}(Ne||(Ne={})),function(t){t[t.SUCCESS=0]="SUCCESS",t[t.OUT_OF_BOUND=1]="OUT_OF_BOUND"}(we||(we={})),function(t){t[t.IMM=0]="IMM",t[t.ID=1]="ID",t[t.ADDRESS_ID=2]="ADDRESS_ID",t[t.DEREF_ID=3]="DEREF_ID"}(Ce||(Ce={})),function(t){t[t.ADD=0]="ADD",t[t.SUB=1]="SUB",t[t.MUL=2]="MUL",t[t.DIV=3]="DIV"}(De||(De={})),function(t){t[t.EQ=0]="EQ",t[t.NE=1]="NE",t[t.LT=2]="LT",t[t.LE=3]="LE",t[t.GT=4]="GT",t[t.GE=5]="GE"}(Me||(Me={})),function(t){t[t.ID=0]="ID",t[t.DEREF_ID=1]="DEREF_ID"}(Be||(Be={})),function(t){t[t.SINGULAR=0]="SINGULAR",t[t.BINARY_MATH_OP=1]="BINARY_MATH_OP"}(Pe||(Pe={})),function(t){t[t.FUNCTION=0]="FUNCTION",t[t.ASSIGN=1]="ASSIGN",t[t.DEC=2]="DEC",t[t.GLOBAL_DEC=3]="GLOBAL_DEC",t[t.LABEL=4]="LABEL",t[t.GOTO=5]="GOTO",t[t.IF=6]="IF",t[t.ARG=7]="ARG",t[t.CALL=8]="CALL",t[t.ASSIGN_CALL=9]="ASSIGN_CALL",t[t.PARAM=10]="PARAM",t[t.RETURN=11]="RETURN",t[t.READ=12]="READ",t[t.WRITE=13]="WRITE",t[t.EMPTY=14]="EMPTY",t[t.COMMENT=15]="COMMENT",t[t.ERROR=16]="ERROR"}(xe||(xe={})),function(t){t[t.ASSIGN=1]="ASSIGN",t[t.DEC=2]="DEC",t[t.GLOBAL_DEC=3]="GLOBAL_DEC",t[t.GOTO=5]="GOTO",t[t.IF=6]="IF",t[t.ARG=7]="ARG",t[t.CALL=8]="CALL",t[t.ASSIGN_CALL=9]="ASSIGN_CALL",t[t.PARAM=10]="PARAM",t[t.RETURN=11]="RETURN",t[t.READ=12]="READ",t[t.WRITE=13]="WRITE"}(Ue||(Ue={}));const ke=new Set(["FUNCTION","DEC","GLOBAL_DEC","LABEL","GOTO","IF","ARG","PARAM","CALL","RETURN","READ","WRITE"]),Fe="[a-zA-Z_$][\\w$]*";class He{patternId=new RegExp(`^(?${Fe})$`);patternSize=new RegExp("^(?\\d+)$");patternSingular=new RegExp(`^(#(?-?\\d+))$|^(?${Fe})$|^(\\*(?${Fe}))$|^(&(?${Fe}))$`);patternLValue=new RegExp(`^((?${Fe}))$|^(\\*(?${Fe}))$`);illegalInstructionFormatError={type:xe.ERROR,messageKey:"ILLEGAL_INSTRUCTION_FORMAT"};purify(t){return t.trim().replaceAll(/[ \t]+/g," ")}decodeComponentId(t){const e=t.match(this.patternId);return null===e||ke.has(t)?null:e.groups.id}decodeComponentSize(t){const e=t.match(this.patternSize);if(null===e)return null;const r=parseInt(e.groups.size);return Number.isSafeInteger(r)?Le(r):1/0}decodeComponentSingular(t){const e=t.match(this.patternSingular);if(null===e)return null;if(void 0!==e.groups.imm){const t=parseInt(e.groups.imm);return Number.isSafeInteger(t)?{type:Ce.IMM,imm:Le(t)}:{type:Ce.IMM,imm:1/0}}return void 0!==e.groups.id?{type:Ce.ID,id:e.groups.id}:void 0!==e.groups.derefId?{type:Ce.DEREF_ID,id:e.groups.derefId}:{type:Ce.ADDRESS_ID,id:e.groups.addressId}}decodeComponentLValue(t){const e=t.match(this.patternLValue);return null===e?null:void 0!==e.groups.id?{type:Be.ID,id:e.groups.id}:{type:Be.DEREF_ID,id:e.groups.derefId}}decodeFunction(t){if(3!==t.length||":"!==t[2])return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"FUNCTION_ILLEGAL_ID"}:{type:xe.FUNCTION,value:{id:e}}}decodeAssign(t){if(3!==t.length&&5!==t.length||":="!==t[1])return this.illegalInstructionFormatError;const e=this.decodeComponentLValue(t[0]);if(null===e)return{type:xe.ERROR,messageKey:"ASSIGN_ILLEGAL_LEFT"};const r=this.decodeComponentSingular(t[2]);if(null===r)return{type:xe.ERROR,messageKey:3===t.length?"ASSIGN_ILLEGAL_RIGHT":"ASSIGN_ILLEGAL_RIGHT_OPERAND1"};if(r.type===Ce.IMM&&!Number.isFinite(r.imm))return{type:xe.ERROR,messageKey:3===t.length?"ASSIGN_RIGHT_IMM_TOO_LARGE":"ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE"};if(3===t.length)return{type:xe.ASSIGN,value:{lValue:e,rValue:{type:Pe.SINGULAR,singular:r}}};{let n=De.ADD;switch(t[3]){case"+":n=De.ADD;break;case"-":n=De.SUB;break;case"*":n=De.MUL;break;case"/":n=De.DIV;break;default:return{type:xe.ERROR,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERATOR"}}const i=this.decodeComponentSingular(t[4]);return null===i?{type:xe.ERROR,messageKey:"ASSIGN_ILLEGAL_RIGHT_OPERAND2"}:i.type!==Ce.IMM||Number.isFinite(i.imm)?{type:xe.ASSIGN,value:{lValue:e,rValue:{type:Pe.BINARY_MATH_OP,singularL:r,singularR:i,binaryMathOp:n}}}:{type:xe.ERROR,messageKey:"ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE"}}}decodeDec(t){if(3!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);if(null===e)return{type:xe.ERROR,messageKey:"DEC_ILLEGAL_ID"};const r=this.decodeComponentSize(t[2]);return null===r?{type:xe.ERROR,messageKey:"DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(r)?r%4!=0?{type:xe.ERROR,messageKey:"DEC_SIZE_NOT_4_MULTIPLE"}:{type:xe.DEC,value:{id:e,size:r}}:{type:xe.ERROR,messageKey:"DEC_SIZE_TOO_LARGE"}}decodeGlobalDec(t){if(3!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);if(null===e)return{type:xe.ERROR,messageKey:"GLOBAL_DEC_ILLEGAL_ID"};const r=this.decodeComponentSize(t[2]);return null===r?{type:xe.ERROR,messageKey:"GLOBAL_DEC_ILLEGAL_SIZE_FORMAT"}:Number.isFinite(r)?r%4!=0?{type:xe.ERROR,messageKey:"GLOBAL_DEC_SIZE_NOT_4_MULTIPLE"}:{type:xe.GLOBAL_DEC,value:{id:e,size:r}}:{type:xe.ERROR,messageKey:"GLOBAL_DEC_SIZE_TOO_LARGE"}}decodeLabel(t){if(3!==t.length||":"!==t[2])return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"LABEL_ILLEGAL_ID"}:{type:xe.LABEL,value:{id:e}}}decodeGoto(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"GOTO_ILLEGAL_ID"}:{type:xe.GOTO,value:{id:e}}}decodeIf(t){if(6!==t.length||"GOTO"!==t[4])return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);if(null===e)return{type:xe.ERROR,messageKey:"IF_ILLEGAL_COND_OPERAND1"};if(e.type===Ce.IMM&&!Number.isFinite(e.imm))return{type:xe.ERROR,messageKey:"IF_COND_OPERAND1_IMM_TOO_LARGE"};let r=Me.EQ;switch(t[2]){case"==":r=Me.EQ;break;case"!=":r=Me.NE;break;case"<":r=Me.LT;break;case"<=":r=Me.LE;break;case">":r=Me.GT;break;case">=":r=Me.GE;break;default:return{type:xe.ERROR,messageKey:"IF_ILLEGAL_COND_OPERATOR"}}const n=this.decodeComponentSingular(t[3]);if(null===n)return{type:xe.ERROR,messageKey:"IF_ILLEGAL_COND_OPERAND2"};if(n.type===Ce.IMM&&!Number.isFinite(n.imm))return{type:xe.ERROR,messageKey:"IF_COND_OPERAND2_IMM_TOO_LARGE"};const i=this.decodeComponentId(t[5]);return null===i?{type:xe.ERROR,messageKey:"IF_ILLEGAL_GOTO_ID"}:{type:xe.IF,value:{condition:{singularL:e,singularR:n,binaryRelOp:r},gotoId:i}}}decodeArg(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);return null===e?{type:xe.ERROR,messageKey:"ARG_ILLEGAL"}:e.type!==Ce.IMM||Number.isFinite(e.imm)?{type:xe.ARG,value:{value:e}}:{type:xe.ERROR,messageKey:"ARG_IMM_TOO_LARGE"}}decodeCall(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"CALL_ILLEGAL_ID"}:{type:xe.CALL,value:{id:e}}}decodeAssignCall(t){if(4!==t.length||":="!==t[1]||"CALL"!==t[2])return this.illegalInstructionFormatError;const e=this.decodeComponentLValue(t[0]);if(null===e)return{type:xe.ERROR,messageKey:"ASSIGN_ILLEGAL_LEFT"};const r=this.decodeComponentId(t[3]);return null===r?{type:xe.ERROR,messageKey:"CALL_ILLEGAL_ID"}:{type:xe.ASSIGN_CALL,value:{lValue:e,functionId:r}}}decodeParam(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentId(t[1]);return null===e?{type:xe.ERROR,messageKey:"PARAM_ILLEGAL_ID"}:{type:xe.PARAM,value:{id:e}}}decodeReturn(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);return null===e?{type:xe.ERROR,messageKey:"RETURN_ILLEGAL"}:e.type!==Ce.IMM||Number.isFinite(e.imm)?{type:xe.RETURN,value:{value:e}}:{type:xe.ERROR,messageKey:"RETURN_IMM_TOO_LARGE"}}decodeRead(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentLValue(t[1]);return null===e?{type:xe.ERROR,messageKey:"READ_ILLEGAL"}:{type:xe.READ,value:{lValue:e}}}decodeWrite(t){if(2!==t.length)return this.illegalInstructionFormatError;const e=this.decodeComponentSingular(t[1]);return null===e?{type:xe.ERROR,messageKey:"WRITE_ILLEGAL"}:e.type!==Ce.IMM||Number.isFinite(e.imm)?{type:xe.WRITE,value:{value:e}}:{type:xe.ERROR,messageKey:"WRITE_IMM_TOO_LARGE"}}decode(t){if(t.match(/^[ \t]*$/))return{type:xe.EMPTY};const e={type:xe.ERROR,messageKey:"UNRECOGNIZED_INSTRUCTION"},r=this.purify(t);if(r.startsWith(";"))return{type:xe.COMMENT};const n=r.split(" ");if(n.length<1)return e;switch(n[0]){case"FUNCTION":return this.decodeFunction(n);case"DEC":return this.decodeDec(n);case"GLOBAL_DEC":return this.decodeGlobalDec(n);case"LABEL":return this.decodeLabel(n);case"GOTO":return this.decodeGoto(n);case"IF":return this.decodeIf(n);case"ARG":return this.decodeArg(n);case"CALL":return this.decodeCall(n);case"PARAM":return this.decodeParam(n);case"RETURN":return this.decodeReturn(n);case"READ":return this.decodeRead(n);case"WRITE":return this.decodeWrite(n);default:{const t=this.decodeAssign(n);if(t.type===xe.ASSIGN)return t;const e=this.decodeAssignCall(n);return e.type===xe.ASSIGN_CALL?e:t}}}}var je,Ve,ze={exports:{}}; /** * @license * Lodash @@ -6,4 +6,4 @@ import t from"fs";import e from"readline";import r from"assert";import n from"ut * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */je=ze,Ve=ze.exports,function(){var t,e="Expected a function",r="__lodash_hash_undefined__",n="__lodash_placeholder__",i=16,o=32,a=64,u=128,l=256,c=1/0,h=9007199254740991,f=NaN,_=4294967295,p=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",o],["partialRight",a],["rearg",l]],g="[object Arguments]",d="[object Array]",m="[object Boolean]",E="[object Date]",v="[object Error]",y="[object Function]",A="[object GeneratorFunction]",b="[object Map]",R="[object Number]",T="[object Object]",I="[object Promise]",L="[object RegExp]",O="[object Set]",S="[object String]",N="[object Symbol]",w="[object WeakMap]",C="[object ArrayBuffer]",D="[object DataView]",M="[object Float32Array]",B="[object Float64Array]",P="[object Int8Array]",x="[object Int16Array]",U="[object Int32Array]",G="[object Uint8Array]",k="[object Uint8ClampedArray]",F="[object Uint16Array]",H="[object Uint32Array]",j=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,Y=RegExp(W.source),X=RegExp(K.source),Z=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(et.source),nt=/^\s+/,it=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ot=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ft=/\w*$/,_t=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,dt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,Et=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,yt=/['\n\r\u2028\u2029\\]/g,At="\\ud800-\\udfff",bt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Rt="\\u2700-\\u27bf",Tt="a-z\\xdf-\\xf6\\xf8-\\xff",It="A-Z\\xc0-\\xd6\\xd8-\\xde",Lt="\\ufe0e\\ufe0f",Ot="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",St="['’]",Nt="["+At+"]",wt="["+Ot+"]",Ct="["+bt+"]",Dt="\\d+",Mt="["+Rt+"]",Bt="["+Tt+"]",Pt="[^"+At+Ot+Dt+Rt+Tt+It+"]",xt="\\ud83c[\\udffb-\\udfff]",Ut="[^"+At+"]",Gt="(?:\\ud83c[\\udde6-\\uddff]){2}",kt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+It+"]",Ht="\\u200d",jt="(?:"+Bt+"|"+Pt+")",Vt="(?:"+Ft+"|"+Pt+")",zt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Kt="(?:"+Ct+"|"+xt+")?",Yt="["+Lt+"]?",Xt=Yt+Kt+"(?:"+Ht+"(?:"+[Ut,Gt,kt].join("|")+")"+Yt+Kt+")*",Zt="(?:"+[Mt,Gt,kt].join("|")+")"+Xt,qt="(?:"+[Ut+Ct+"?",Ct,Gt,kt,Nt].join("|")+")",$t=RegExp(St,"g"),Qt=RegExp(Ct,"g"),Jt=RegExp(xt+"(?="+xt+")|"+qt+Xt,"g"),te=RegExp([Ft+"?"+Bt+"+"+zt+"(?="+[wt,Ft,"$"].join("|")+")",Vt+"+"+Wt+"(?="+[wt,Ft+jt,"$"].join("|")+")",Ft+"?"+jt+"+"+zt,Ft+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dt,Zt].join("|"),"g"),ee=RegExp("["+Ht+At+bt+Lt+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ie=-1,se={};se[M]=se[B]=se[P]=se[x]=se[U]=se[G]=se[k]=se[F]=se[H]=!0,se[g]=se[d]=se[C]=se[m]=se[D]=se[E]=se[v]=se[y]=se[b]=se[R]=se[T]=se[L]=se[O]=se[S]=se[w]=!1;var oe={};oe[g]=oe[d]=oe[C]=oe[D]=oe[m]=oe[E]=oe[M]=oe[B]=oe[P]=oe[x]=oe[U]=oe[b]=oe[R]=oe[T]=oe[L]=oe[O]=oe[S]=oe[N]=oe[G]=oe[k]=oe[F]=oe[H]=!0,oe[v]=oe[y]=oe[w]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ue=parseFloat,le=parseInt,ce="object"==typeof s&&s&&s.Object===Object&&s,he="object"==typeof self&&self&&self.Object===Object&&self,fe=ce||he||Function("return this")(),_e=Ve&&!Ve.nodeType&&Ve,pe=_e&&je&&!je.nodeType&&je,ge=pe&&pe.exports===_e,de=ge&&ce.process,me=function(){try{var t=pe&&pe.require&&pe.require("util").types;return t||de&&de.binding&&de.binding("util")}catch(t){}}(),Ee=me&&me.isArrayBuffer,ve=me&&me.isDate,ye=me&&me.isMap,Ae=me&&me.isRegExp,be=me&&me.isSet,Re=me&&me.isTypedArray;function Te(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ie(t,e,r,n){for(var i=-1,s=null==t?0:t.length;++i-1}function Ce(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function rr(t,e){for(var r=t.length;r--&&Fe(e,t[r],0)>-1;);return r}var nr=Ye({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ir=Ye({"&":"&","<":"<",">":">",'"':""","'":"'"});function sr(t){return"\\"+ae[t]}function or(t){return ee.test(t)}function ar(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function ur(t,e){return function(r){return t(e(r))}}function lr(t,e){for(var r=-1,i=t.length,s=0,o=[];++r",""":'"',"'":"'"}),dr=function s(it){var At,bt=(it=null==it?fe:dr.defaults(fe.Object(),it,dr.pick(fe,ne))).Array,Rt=it.Date,Tt=it.Error,It=it.Function,Lt=it.Math,Ot=it.Object,St=it.RegExp,Nt=it.String,wt=it.TypeError,Ct=bt.prototype,Dt=It.prototype,Mt=Ot.prototype,Bt=it["__core-js_shared__"],Pt=Dt.toString,xt=Mt.hasOwnProperty,Ut=0,Gt=(At=/[^.]+$/.exec(Bt&&Bt.keys&&Bt.keys.IE_PROTO||""))?"Symbol(src)_1."+At:"",kt=Mt.toString,Ft=Pt.call(Ot),Ht=fe._,jt=St("^"+Pt.call(xt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=ge?it.Buffer:t,zt=it.Symbol,Wt=it.Uint8Array,Kt=Vt?Vt.allocUnsafe:t,Yt=ur(Ot.getPrototypeOf,Ot),Xt=Ot.create,Zt=Mt.propertyIsEnumerable,qt=Ct.splice,Jt=zt?zt.isConcatSpreadable:t,ee=zt?zt.iterator:t,ae=zt?zt.toStringTag:t,ce=function(){try{var t=fs(Ot,"defineProperty");return t({},"",{}),t}catch(t){}}(),he=it.clearTimeout!==fe.clearTimeout&&it.clearTimeout,_e=Rt&&Rt.now!==fe.Date.now&&Rt.now,pe=it.setTimeout!==fe.setTimeout&&it.setTimeout,de=Lt.ceil,me=Lt.floor,Ue=Ot.getOwnPropertySymbols,je=Vt?Vt.isBuffer:t,Ve=it.isFinite,Ye=Ct.join,mr=ur(Ot.keys,Ot),Er=Lt.max,vr=Lt.min,yr=Rt.now,Ar=it.parseInt,br=Lt.random,Rr=Ct.reverse,Tr=fs(it,"DataView"),Ir=fs(it,"Map"),Lr=fs(it,"Promise"),Or=fs(it,"Set"),Sr=fs(it,"WeakMap"),Nr=fs(Ot,"create"),wr=Sr&&new Sr,Cr={},Dr=Gs(Tr),Mr=Gs(Ir),Br=Gs(Lr),Pr=Gs(Or),xr=Gs(Sr),Ur=zt?zt.prototype:t,Gr=Ur?Ur.valueOf:t,kr=Ur?Ur.toString:t;function Fr(t){if(ra(t)&&!Wo(t)&&!(t instanceof zr)){if(t instanceof Vr)return t;if(xt.call(t,"__wrapped__"))return ks(t)}return new Vr(t)}var Hr=function(){function e(){}return function(r){if(!ea(r))return{};if(Xt)return Xt(r);e.prototype=r;var n=new e;return e.prototype=t,n}}();function jr(){}function Vr(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=t}function zr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=_,this.__views__=[]}function Wr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=r?e:r)),e}function ln(e,r,n,i,s,o){var a,u=1&r,l=2&r,c=4&r;if(n&&(a=s?n(e,i,s,o):n(e)),a!==t)return a;if(!ea(e))return e;var h=Wo(e);if(h){if(a=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&xt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(e),!u)return wi(e,a)}else{var f=gs(e),_=f==y||f==A;if(Zo(e))return Ti(e,u);if(f==T||f==g||_&&!s){if(a=l||_?{}:ms(e),!u)return l?function(t,e){return Ci(t,ps(t),e)}(e,function(t,e){return t&&Ci(e,Ma(e),t)}(a,e)):function(t,e){return Ci(t,_s(t),e)}(e,sn(a,e))}else{if(!oe[f])return s?e:{};a=function(t,e,r){var n,i=t.constructor;switch(e){case C:return Ii(t);case m:case E:return new i(+t);case D:return function(t,e){var r=e?Ii(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case M:case B:case P:case x:case U:case G:case k:case F:case H:return Li(t,r);case b:return new i;case R:case S:return new i(t);case L:return function(t){var e=new t.constructor(t.source,ft.exec(t));return e.lastIndex=t.lastIndex,e}(t);case O:return new i;case N:return n=t,Gr?Ot(Gr.call(n)):{}}}(e,f,u)}}o||(o=new Zr);var p=o.get(e);if(p)return p;o.set(e,a),aa(e)?e.forEach((function(t){a.add(ln(t,r,n,t,e,o))})):na(e)&&e.forEach((function(t,i){a.set(i,ln(t,r,n,i,e,o))}));var d=h?t:(c?l?ss:is:l?Ma:Da)(e);return Le(d||e,(function(t,i){d&&(t=e[i=t]),en(a,i,ln(t,r,n,i,e,o))})),a}function cn(e,r,n){var i=n.length;if(null==e)return!i;for(e=Ot(e);i--;){var s=n[i],o=r[s],a=e[s];if(a===t&&!(s in e)||!o(a))return!1}return!0}function hn(r,n,i){if("function"!=typeof r)throw new wt(e);return Cs((function(){r.apply(t,i)}),n)}function fn(t,e,r,n){var i=-1,s=we,o=!0,a=t.length,u=[],l=e.length;if(!a)return u;r&&(e=De(e,Qe(r))),n?(s=Ce,o=!1):e.length>=200&&(s=tr,o=!1,e=new Xr(e));t:for(;++i-1},Kr.prototype.set=function(t,e){var r=this.__data__,n=rn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Yr.prototype.clear=function(){this.size=0,this.__data__={hash:new Wr,map:new(Ir||Kr),string:new Wr}},Yr.prototype.delete=function(t){var e=cs(this,t).delete(t);return this.size-=e?1:0,e},Yr.prototype.get=function(t){return cs(this,t).get(t)},Yr.prototype.has=function(t){return cs(this,t).has(t)},Yr.prototype.set=function(t,e){var r=cs(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Xr.prototype.add=Xr.prototype.push=function(t){return this.__data__.set(t,r),this},Xr.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.clear=function(){this.__data__=new Kr,this.size=0},Zr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Zr.prototype.get=function(t){return this.__data__.get(t)},Zr.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Kr){var n=r.__data__;if(!Ir||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Yr(n)}return r.set(t,e),this.size=r.size,this};var _n=Bi(An),pn=Bi(bn,!0);function gn(t,e){var r=!0;return _n(t,(function(t,n,i){return r=!!e(t,n,i)})),r}function dn(e,r,n){for(var i=-1,s=e.length;++i0&&r(a)?e>1?En(a,e-1,r,n,i):Me(i,a):n||(i[i.length]=a)}return i}var vn=Pi(),yn=Pi(!0);function An(t,e){return t&&vn(t,e,Da)}function bn(t,e){return t&&yn(t,e,Da)}function Rn(t,e){return Ne(e,(function(e){return Qo(t[e])}))}function Tn(e,r){for(var n=0,i=(r=yi(r,e)).length;null!=e&&ne}function Sn(t,e){return null!=t&&xt.call(t,e)}function Nn(t,e){return null!=t&&e in Ot(t)}function wn(e,r,n){for(var i=n?Ce:we,s=e[0].length,o=e.length,a=o,u=bt(o),l=1/0,c=[];a--;){var h=e[a];a&&r&&(h=De(h,Qe(r))),l=vr(h.length,l),u[a]=!n&&(r||s>=120&&h.length>=120)?new Xr(a&&h):t}h=e[0];var f=-1,_=u[0];t:for(;++f=a?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}))}function Kn(t,e,r){for(var n=-1,i=e.length,s={};++n-1;)a!==t&&qt.call(a,u,1),qt.call(t,u,1);return t}function Xn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==s){var s=i;vs(i)?qt.call(t,i,1):fi(t,i)}}return t}function Zn(t,e){return t+me(br()*(e-t+1))}function qn(t,e){var r="";if(!t||e<1||e>h)return r;do{e%2&&(r+=t),(e=me(e/2))&&(t+=t)}while(e);return r}function $n(t,e){return Ds(Os(t,e,iu),t+"")}function Qn(t){return $r(Ha(t))}function Jn(t,e){var r=Ha(t);return Ps(r,un(e,0,r.length))}function ti(e,r,n,i){if(!ea(e))return e;for(var s=-1,o=(r=yi(r,e)).length,a=o-1,u=e;null!=u&&++si?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=bt(i);++n>>1,o=t[s];null!==o&&!la(o)&&(r?o<=e:o=200){var l=e?null:qi(t);if(l)return cr(l);o=!1,i=tr,u=new Xr}else u=e?[]:a;t:for(;++n=i?e:ii(e,r,n)}var Ri=he||function(t){return fe.clearTimeout(t)};function Ti(t,e){if(e)return t.slice();var r=t.length,n=Kt?Kt(r):new t.constructor(r);return t.copy(n),n}function Ii(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Li(t,e){var r=e?Ii(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Oi(e,r){if(e!==r){var n=e!==t,i=null===e,s=e==e,o=la(e),a=r!==t,u=null===r,l=r==r,c=la(r);if(!u&&!c&&!o&&e>r||o&&a&&l&&!u&&!c||i&&a&&l||!n&&l||!s)return 1;if(!i&&!o&&!c&&e1?n[s-1]:t,a=s>2?n[2]:t;for(o=e.length>3&&"function"==typeof o?(s--,o):t,a&&ys(n[0],n[1],a)&&(o=s<3?t:o,s=1),r=Ot(r);++i-1?s[o?r[a]:a]:t}}function Fi(r){return ns((function(n){var i=n.length,s=i,o=Vr.prototype.thru;for(r&&n.reverse();s--;){var a=n[s];if("function"!=typeof a)throw new wt(e);if(o&&!u&&"wrapper"==as(a))var u=new Vr([],!0)}for(s=u?s:i;++s1&&v.reverse(),f&&cu))return!1;var c=o.get(e),h=o.get(r);if(c&&h)return c==r&&h==e;var f=-1,_=!0,p=2&n?new Xr:t;for(o.set(e,r),o.set(r,e);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Le(p,(function(r){var n="_."+r[0];e&r[1]&&!we(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(ot);return e?e[1].split(at):[]}(n),r)))}function Bs(e){var r=0,n=0;return function(){var i=yr(),s=16-(i-n);if(n=i,s>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(t,arguments)}}function Ps(e,r){var n=-1,i=e.length,s=i-1;for(r=r===t?i:r;++n1?e[r-1]:t;return n="function"==typeof n?(e.pop(),n):t,so(e,n)}));function fo(t){var e=Fr(t);return e.__chain__=!0,e}function _o(t,e){return e(t)}var po=ns((function(e){var r=e.length,n=r?e[0]:0,i=this.__wrapped__,s=function(t){return an(t,e)};return!(r>1||this.__actions__.length)&&i instanceof zr&&vs(n)?((i=i.slice(n,+n+(r?1:0))).__actions__.push({func:_o,args:[s],thisArg:t}),new Vr(i,this.__chain__).thru((function(e){return r&&!e.length&&e.push(t),e}))):this.thru(s)})),go=Di((function(t,e,r){xt.call(t,r)?++t[r]:on(t,r,1)})),mo=ki(Vs),Eo=ki(zs);function vo(t,e){return(Wo(t)?Le:_n)(t,ls(e,3))}function yo(t,e){return(Wo(t)?Oe:pn)(t,ls(e,3))}var Ao=Di((function(t,e,r){xt.call(t,r)?t[r].push(e):on(t,r,[e])})),bo=$n((function(t,e,r){var n=-1,i="function"==typeof e,s=Yo(t)?bt(t.length):[];return _n(t,(function(t){s[++n]=i?Te(e,t,r):Cn(t,e,r)})),s})),Ro=Di((function(t,e,r){on(t,r,e)}));function To(t,e){return(Wo(t)?De:Fn)(t,ls(e,3))}var Io=Di((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),Lo=$n((function(t,e){if(null==t)return[];var r=e.length;return r>1&&ys(t,e[0],e[1])?e=[]:r>2&&ys(e[0],e[1],e[2])&&(e=[e[0]]),Wn(t,En(e,1),[])})),Oo=_e||function(){return fe.Date.now()};function So(e,r,n){return r=n?t:r,r=e&&null==r?e.length:r,Qi(e,u,t,t,t,t,r)}function No(r,n){var i;if("function"!=typeof n)throw new wt(e);return r=ga(r),function(){return--r>0&&(i=n.apply(this,arguments)),r<=1&&(n=t),i}}var wo=$n((function(t,e,r){var n=1;if(r.length){var i=lr(r,us(wo));n|=o}return Qi(t,n,e,r,i)})),Co=$n((function(t,e,r){var n=3;if(r.length){var i=lr(r,us(Co));n|=o}return Qi(e,n,t,r,i)}));function Do(r,n,i){var s,o,a,u,l,c,h=0,f=!1,_=!1,p=!0;if("function"!=typeof r)throw new wt(e);function g(e){var n=s,i=o;return s=o=t,h=e,u=r.apply(i,n)}function d(e){var r=e-c;return c===t||r>=n||r<0||_&&e-h>=a}function m(){var t=Oo();if(d(t))return E(t);l=Cs(m,function(t){var e=n-(t-c);return _?vr(e,a-(t-h)):e}(t))}function E(e){return l=t,p&&s?g(e):(s=o=t,u)}function v(){var e=Oo(),r=d(e);if(s=arguments,o=this,c=e,r){if(l===t)return function(t){return h=t,l=Cs(m,n),f?g(t):u}(c);if(_)return Ri(l),l=Cs(m,n),g(c)}return l===t&&(l=Cs(m,n)),u}return n=ma(n)||0,ea(i)&&(f=!!i.leading,a=(_="maxWait"in i)?Er(ma(i.maxWait)||0,n):a,p="trailing"in i?!!i.trailing:p),v.cancel=function(){l!==t&&Ri(l),h=0,s=c=o=l=t},v.flush=function(){return l===t?u:E(Oo())},v}var Mo=$n((function(t,e){return hn(t,1,e)})),Bo=$n((function(t,e,r){return hn(t,ma(e)||0,r)}));function Po(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new wt(e);var n=function(){var e=arguments,i=r?r.apply(this,e):e[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,e);return n.cache=s.set(i,o)||s,o};return n.cache=new(Po.Cache||Yr),n}function xo(t){if("function"!=typeof t)throw new wt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Po.Cache=Yr;var Uo=Ai((function(t,e){var r=(e=1==e.length&&Wo(e[0])?De(e[0],Qe(ls())):De(En(e,1),Qe(ls()))).length;return $n((function(n){for(var i=-1,s=vr(n.length,r);++i=e})),zo=Dn(function(){return arguments}())?Dn:function(t){return ra(t)&&xt.call(t,"callee")&&!Zt.call(t,"callee")},Wo=bt.isArray,Ko=Ee?Qe(Ee):function(t){return ra(t)&&Ln(t)==C};function Yo(t){return null!=t&&ta(t.length)&&!Qo(t)}function Xo(t){return ra(t)&&Yo(t)}var Zo=je||mu,qo=ve?Qe(ve):function(t){return ra(t)&&Ln(t)==E};function $o(t){if(!ra(t))return!1;var e=Ln(t);return e==v||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!sa(t)}function Qo(t){if(!ea(t))return!1;var e=Ln(t);return e==y||e==A||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Jo(t){return"number"==typeof t&&t==ga(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function ea(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ra(t){return null!=t&&"object"==typeof t}var na=ye?Qe(ye):function(t){return ra(t)&&gs(t)==b};function ia(t){return"number"==typeof t||ra(t)&&Ln(t)==R}function sa(t){if(!ra(t)||Ln(t)!=T)return!1;var e=Yt(t);if(null===e)return!0;var r=xt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Pt.call(r)==Ft}var oa=Ae?Qe(Ae):function(t){return ra(t)&&Ln(t)==L},aa=be?Qe(be):function(t){return ra(t)&&gs(t)==O};function ua(t){return"string"==typeof t||!Wo(t)&&ra(t)&&Ln(t)==S}function la(t){return"symbol"==typeof t||ra(t)&&Ln(t)==N}var ca=Re?Qe(Re):function(t){return ra(t)&&ta(t.length)&&!!se[Ln(t)]},ha=Yi(kn),fa=Yi((function(t,e){return t<=e}));function _a(t){if(!t)return[];if(Yo(t))return ua(t)?_r(t):wi(t);if(ee&&t[ee])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ee]());var e=gs(t);return(e==b?ar:e==O?cr:Ha)(t)}function pa(t){return t?(t=ma(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ga(t){var e=pa(t),r=e%1;return e==e?r?e-r:e:0}function da(t){return t?un(ga(t),0,_):0}function ma(t){if("number"==typeof t)return t;if(la(t))return f;if(ea(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ea(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$e(t);var r=pt.test(t);return r||dt.test(t)?le(t.slice(2),r?2:8):_t.test(t)?f:+t}function Ea(t){return Ci(t,Ma(t))}function va(t){return null==t?"":ci(t)}var ya=Mi((function(t,e){if(Ts(e)||Yo(e))Ci(e,Da(e),t);else for(var r in e)xt.call(e,r)&&en(t,r,e[r])})),Aa=Mi((function(t,e){Ci(e,Ma(e),t)})),ba=Mi((function(t,e,r,n){Ci(e,Ma(e),t,n)})),Ra=Mi((function(t,e,r,n){Ci(e,Da(e),t,n)})),Ta=ns(an),Ia=$n((function(e,r){e=Ot(e);var n=-1,i=r.length,s=i>2?r[2]:t;for(s&&ys(r[0],r[1],s)&&(i=1);++n1),e})),Ci(t,ss(t),r),n&&(r=ln(r,7,es));for(var i=e.length;i--;)fi(r,e[i]);return r})),Ua=ns((function(t,e){return null==t?{}:function(t,e){return Kn(t,e,(function(e,r){return Sa(t,r)}))}(t,e)}));function Ga(t,e){if(null==t)return{};var r=De(ss(t),(function(t){return[t]}));return e=ls(e),Kn(t,r,(function(t,r){return e(t,r[0])}))}var ka=$i(Da),Fa=$i(Ma);function Ha(t){return null==t?[]:Je(t,Da(t))}var ja=Ui((function(t,e,r){return e=e.toLowerCase(),t+(r?Va(e):e)}));function Va(t){return $a(va(t).toLowerCase())}function za(t){return(t=va(t))&&t.replace(Et,nr).replace(Qt,"")}var Wa=Ui((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Ka=Ui((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Ya=xi("toLowerCase"),Xa=Ui((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Za=Ui((function(t,e,r){return t+(r?" ":"")+$a(e)})),qa=Ui((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),$a=xi("toUpperCase");function Qa(e,r,n){return e=va(e),(r=n?t:r)===t?function(t){return re.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(ut)||[]}(e):e.match(r)||[]}var Ja=$n((function(e,r){try{return Te(e,t,r)}catch(t){return $o(t)?t:new Tt(t)}})),tu=ns((function(t,e){return Le(e,(function(e){e=Us(e),on(t,e,wo(t[e],t))})),t}));function eu(t){return function(){return t}}var ru=Fi(),nu=Fi(!0);function iu(t){return t}function su(t){return xn("function"==typeof t?t:ln(t,1))}var ou=$n((function(t,e){return function(r){return Cn(r,t,e)}})),au=$n((function(t,e){return function(r){return Cn(t,r,e)}}));function uu(t,e,r){var n=Da(e),i=Rn(e,n);null!=r||ea(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Rn(e,Da(e)));var s=!(ea(r)&&"chain"in r&&!r.chain),o=Qo(t);return Le(i,(function(r){var n=e[r];t[r]=n,o&&(t.prototype[r]=function(){var e=this.__chain__;if(s||e){var r=t(this.__wrapped__);return(r.__actions__=wi(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Me([this.value()],arguments))})})),t}function lu(){}var cu=zi(De),hu=zi(Se),fu=zi(xe);function _u(t){return As(t)?Ke(Us(t)):function(t){return function(e){return Tn(e,t)}}(t)}var pu=Ki(),gu=Ki(!0);function du(){return[]}function mu(){return!1}var Eu,vu=Vi((function(t,e){return t+e}),0),yu=Zi("ceil"),Au=Vi((function(t,e){return t/e}),1),bu=Zi("floor"),Ru=Vi((function(t,e){return t*e}),1),Tu=Zi("round"),Iu=Vi((function(t,e){return t-e}),0);return Fr.after=function(t,r){if("function"!=typeof r)throw new wt(e);return t=ga(t),function(){if(--t<1)return r.apply(this,arguments)}},Fr.ary=So,Fr.assign=ya,Fr.assignIn=Aa,Fr.assignInWith=ba,Fr.assignWith=Ra,Fr.at=Ta,Fr.before=No,Fr.bind=wo,Fr.bindAll=tu,Fr.bindKey=Co,Fr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Wo(t)?t:[t]},Fr.chain=fo,Fr.chunk=function(e,r,n){r=(n?ys(e,r,n):r===t)?1:Er(ga(r),0);var i=null==e?0:e.length;if(!i||r<1)return[];for(var s=0,o=0,a=bt(de(i/r));ss?0:s+n),(i=i===t||i>s?s:ga(i))<0&&(i+=s),i=n>i?0:da(i);n>>0)?(e=va(e))&&("string"==typeof r||null!=r&&!oa(r))&&!(r=ci(r))&&or(e)?bi(_r(e),0,n):e.split(r,n):[]},Fr.spread=function(t,r){if("function"!=typeof t)throw new wt(e);return r=null==r?0:Er(ga(r),0),$n((function(e){var n=e[r],i=bi(e,0,r);return n&&Me(i,n),Te(t,this,i)}))},Fr.tail=function(t){var e=null==t?0:t.length;return e?ii(t,1,e):[]},Fr.take=function(e,r,n){return e&&e.length?ii(e,0,(r=n||r===t?1:ga(r))<0?0:r):[]},Fr.takeRight=function(e,r,n){var i=null==e?0:e.length;return i?ii(e,(r=i-(r=n||r===t?1:ga(r)))<0?0:r,i):[]},Fr.takeRightWhile=function(t,e){return t&&t.length?pi(t,ls(e,3),!1,!0):[]},Fr.takeWhile=function(t,e){return t&&t.length?pi(t,ls(e,3)):[]},Fr.tap=function(t,e){return e(t),t},Fr.throttle=function(t,r,n){var i=!0,s=!0;if("function"!=typeof t)throw new wt(e);return ea(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),Do(t,r,{leading:i,maxWait:r,trailing:s})},Fr.thru=_o,Fr.toArray=_a,Fr.toPairs=ka,Fr.toPairsIn=Fa,Fr.toPath=function(t){return Wo(t)?De(t,Us):la(t)?[t]:wi(xs(va(t)))},Fr.toPlainObject=Ea,Fr.transform=function(t,e,r){var n=Wo(t),i=n||Zo(t)||ca(t);if(e=ls(e,4),null==r){var s=t&&t.constructor;r=i?n?new s:[]:ea(t)&&Qo(s)?Hr(Yt(t)):{}}return(i?Le:An)(t,(function(t,n,i){return e(r,t,n,i)})),r},Fr.unary=function(t){return So(t,1)},Fr.union=eo,Fr.unionBy=ro,Fr.unionWith=no,Fr.uniq=function(t){return t&&t.length?hi(t):[]},Fr.uniqBy=function(t,e){return t&&t.length?hi(t,ls(e,2)):[]},Fr.uniqWith=function(e,r){return r="function"==typeof r?r:t,e&&e.length?hi(e,t,r):[]},Fr.unset=function(t,e){return null==t||fi(t,e)},Fr.unzip=io,Fr.unzipWith=so,Fr.update=function(t,e,r){return null==t?t:_i(t,e,vi(r))},Fr.updateWith=function(e,r,n,i){return i="function"==typeof i?i:t,null==e?e:_i(e,r,vi(n),i)},Fr.values=Ha,Fr.valuesIn=function(t){return null==t?[]:Je(t,Ma(t))},Fr.without=oo,Fr.words=Qa,Fr.wrap=function(t,e){return Go(vi(e),t)},Fr.xor=ao,Fr.xorBy=uo,Fr.xorWith=lo,Fr.zip=co,Fr.zipObject=function(t,e){return mi(t||[],e||[],en)},Fr.zipObjectDeep=function(t,e){return mi(t||[],e||[],ti)},Fr.zipWith=ho,Fr.entries=ka,Fr.entriesIn=Fa,Fr.extend=Aa,Fr.extendWith=ba,uu(Fr,Fr),Fr.add=vu,Fr.attempt=Ja,Fr.camelCase=ja,Fr.capitalize=Va,Fr.ceil=yu,Fr.clamp=function(e,r,n){return n===t&&(n=r,r=t),n!==t&&(n=(n=ma(n))==n?n:0),r!==t&&(r=(r=ma(r))==r?r:0),un(ma(e),r,n)},Fr.clone=function(t){return ln(t,4)},Fr.cloneDeep=function(t){return ln(t,5)},Fr.cloneDeepWith=function(e,r){return ln(e,5,r="function"==typeof r?r:t)},Fr.cloneWith=function(e,r){return ln(e,4,r="function"==typeof r?r:t)},Fr.conformsTo=function(t,e){return null==e||cn(t,e,Da(e))},Fr.deburr=za,Fr.defaultTo=function(t,e){return null==t||t!=t?e:t},Fr.divide=Au,Fr.endsWith=function(e,r,n){e=va(e),r=ci(r);var i=e.length,s=n=n===t?i:un(ga(n),0,i);return(n-=r.length)>=0&&e.slice(n,s)==r},Fr.eq=Ho,Fr.escape=function(t){return(t=va(t))&&X.test(t)?t.replace(K,ir):t},Fr.escapeRegExp=function(t){return(t=va(t))&&rt.test(t)?t.replace(et,"\\$&"):t},Fr.every=function(e,r,n){var i=Wo(e)?Se:gn;return n&&ys(e,r,n)&&(r=t),i(e,ls(r,3))},Fr.find=mo,Fr.findIndex=Vs,Fr.findKey=function(t,e){return Ge(t,ls(e,3),An)},Fr.findLast=Eo,Fr.findLastIndex=zs,Fr.findLastKey=function(t,e){return Ge(t,ls(e,3),bn)},Fr.floor=bu,Fr.forEach=vo,Fr.forEachRight=yo,Fr.forIn=function(t,e){return null==t?t:vn(t,ls(e,3),Ma)},Fr.forInRight=function(t,e){return null==t?t:yn(t,ls(e,3),Ma)},Fr.forOwn=function(t,e){return t&&An(t,ls(e,3))},Fr.forOwnRight=function(t,e){return t&&bn(t,ls(e,3))},Fr.get=Oa,Fr.gt=jo,Fr.gte=Vo,Fr.has=function(t,e){return null!=t&&ds(t,e,Sn)},Fr.hasIn=Sa,Fr.head=Ks,Fr.identity=iu,Fr.includes=function(t,e,r,n){t=Yo(t)?t:Ha(t),r=r&&!n?ga(r):0;var i=t.length;return r<0&&(r=Er(i+r,0)),ua(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Fe(t,e,r)>-1},Fr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:ga(r);return i<0&&(i=Er(n+i,0)),Fe(t,e,i)},Fr.inRange=function(e,r,n){return r=pa(r),n===t?(n=r,r=0):n=pa(n),function(t,e,r){return t>=vr(e,r)&&t=-9007199254740991&&t<=h},Fr.isSet=aa,Fr.isString=ua,Fr.isSymbol=la,Fr.isTypedArray=ca,Fr.isUndefined=function(e){return e===t},Fr.isWeakMap=function(t){return ra(t)&&gs(t)==w},Fr.isWeakSet=function(t){return ra(t)&&"[object WeakSet]"==Ln(t)},Fr.join=function(t,e){return null==t?"":Ye.call(t,e)},Fr.kebabCase=Wa,Fr.last=qs,Fr.lastIndexOf=function(e,r,n){var i=null==e?0:e.length;if(!i)return-1;var s=i;return n!==t&&(s=(s=ga(n))<0?Er(i+s,0):vr(s,i-1)),r==r?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(e,r,s):ke(e,ze,s,!0)},Fr.lowerCase=Ka,Fr.lowerFirst=Ya,Fr.lt=ha,Fr.lte=fa,Fr.max=function(e){return e&&e.length?dn(e,iu,On):t},Fr.maxBy=function(e,r){return e&&e.length?dn(e,ls(r,2),On):t},Fr.mean=function(t){return We(t,iu)},Fr.meanBy=function(t,e){return We(t,ls(e,2))},Fr.min=function(e){return e&&e.length?dn(e,iu,kn):t},Fr.minBy=function(e,r){return e&&e.length?dn(e,ls(r,2),kn):t},Fr.stubArray=du,Fr.stubFalse=mu,Fr.stubObject=function(){return{}},Fr.stubString=function(){return""},Fr.stubTrue=function(){return!0},Fr.multiply=Ru,Fr.nth=function(e,r){return e&&e.length?zn(e,ga(r)):t},Fr.noConflict=function(){return fe._===this&&(fe._=Ht),this},Fr.noop=lu,Fr.now=Oo,Fr.pad=function(t,e,r){t=va(t);var n=(e=ga(e))?fr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return Wi(me(i),r)+t+Wi(de(i),r)},Fr.padEnd=function(t,e,r){t=va(t);var n=(e=ga(e))?fr(t):0;return e&&nr){var i=e;e=r,r=i}if(n||e%1||r%1){var s=br();return vr(e+s*(r-e+ue("1e-"+((s+"").length-1))),r)}return Zn(e,r)},Fr.reduce=function(t,e,r){var n=Wo(t)?Be:Xe,i=arguments.length<3;return n(t,ls(e,4),r,i,_n)},Fr.reduceRight=function(t,e,r){var n=Wo(t)?Pe:Xe,i=arguments.length<3;return n(t,ls(e,4),r,i,pn)},Fr.repeat=function(e,r,n){return r=(n?ys(e,r,n):r===t)?1:ga(r),qn(va(e),r)},Fr.replace=function(){var t=arguments,e=va(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Fr.result=function(e,r,n){var i=-1,s=(r=yi(r,e)).length;for(s||(s=1,e=t);++ih)return[];var r=_,n=vr(t,_);e=ls(e),t-=_;for(var i=qe(n,e);++r=o)return e;var u=n-fr(i);if(u<1)return i;var l=a?bi(a,0,u).join(""):e.slice(0,u);if(s===t)return l+i;if(a&&(u+=l.length-u),oa(s)){if(e.slice(u).search(s)){var c,h=l;for(s.global||(s=St(s.source,va(ft.exec(s))+"g")),s.lastIndex=0;c=s.exec(h);)var f=c.index;l=l.slice(0,f===t?u:f)}}else if(e.indexOf(ci(s),u)!=u){var _=l.lastIndexOf(s);_>-1&&(l=l.slice(0,_))}return l+i},Fr.unescape=function(t){return(t=va(t))&&Y.test(t)?t.replace(W,gr):t},Fr.uniqueId=function(t){var e=++Ut;return va(t)+e},Fr.upperCase=qa,Fr.upperFirst=$a,Fr.each=vo,Fr.eachRight=yo,Fr.first=Ks,uu(Fr,(Eu={},An(Fr,(function(t,e){xt.call(Fr.prototype,e)||(Eu[e]=t)})),Eu),{chain:!1}),Fr.VERSION="4.17.21",Le(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Fr[t].placeholder=Fr})),Le(["drop","take"],(function(e,r){zr.prototype[e]=function(n){n=n===t?1:Er(ga(n),0);var i=this.__filtered__&&!r?new zr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,_),type:e+(i.__dir__<0?"Right":"")}),i},zr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Le(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;zr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ls(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),Le(["head","last"],(function(t,e){var r="take"+(e?"Right":"");zr.prototype[t]=function(){return this[r](1).value()[0]}})),Le(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");zr.prototype[t]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(iu)},zr.prototype.find=function(t){return this.filter(t).head()},zr.prototype.findLast=function(t){return this.reverse().find(t)},zr.prototype.invokeMap=$n((function(t,e){return"function"==typeof t?new zr(this):this.map((function(r){return Cn(r,t,e)}))})),zr.prototype.reject=function(t){return this.filter(xo(ls(t)))},zr.prototype.slice=function(e,r){e=ga(e);var n=this;return n.__filtered__&&(e>0||r<0)?new zr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),r!==t&&(n=(r=ga(r))<0?n.dropRight(-r):n.take(r-e)),n)},zr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},zr.prototype.toArray=function(){return this.take(_)},An(zr.prototype,(function(e,r){var n=/^(?:filter|find|map|reject)|While$/.test(r),i=/^(?:head|last)$/.test(r),s=Fr[i?"take"+("last"==r?"Right":""):r],o=i||/^find/.test(r);s&&(Fr.prototype[r]=function(){var r=this.__wrapped__,a=i?[1]:arguments,u=r instanceof zr,l=a[0],c=u||Wo(r),h=function(t){var e=s.apply(Fr,Me([t],a));return i&&f?e[0]:e};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var f=this.__chain__,_=!!this.__actions__.length,p=o&&!f,g=u&&!_;if(!o&&c){r=g?r:new zr(this);var d=e.apply(r,a);return d.__actions__.push({func:_o,args:[h],thisArg:t}),new Vr(d,f)}return p&&g?e.apply(this,a):(d=this.thru(h),p?i?d.value()[0]:d.value():d)})})),Le(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Fr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(Wo(i)?i:[],t)}return this[r]((function(r){return e.apply(Wo(r)?r:[],t)}))}})),An(zr.prototype,(function(t,e){var r=Fr[e];if(r){var n=r.name+"";xt.call(Cr,n)||(Cr[n]=[]),Cr[n].push({name:e,func:r})}})),Cr[Hi(t,2).name]=[{name:"wrapper",func:t}],zr.prototype.clone=function(){var t=new zr(this.__wrapped__);return t.__actions__=wi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=wi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=wi(this.__views__),t},zr.prototype.reverse=function(){if(this.__filtered__){var t=new zr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},zr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Wo(t),n=e<0,i=r?t.length:0,s=function(t,e,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Fr.prototype.plant=function(e){for(var r,n=this;n instanceof jr;){var i=ks(n);i.__index__=0,i.__values__=t,r?s.__wrapped__=i:r=i;var s=i;n=n.__wrapped__}return s.__wrapped__=e,r},Fr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zr){var r=e;return this.__actions__.length&&(r=new zr(this)),(r=r.reverse()).__actions__.push({func:_o,args:[to],thisArg:t}),new Vr(r,this.__chain__)}return this.thru(to)},Fr.prototype.toJSON=Fr.prototype.valueOf=Fr.prototype.value=function(){return gi(this.__wrapped__,this.__actions__)},Fr.prototype.first=Fr.prototype.head,ee&&(Fr.prototype[ee]=function(){return this}),Fr}();pe?((pe.exports=dr)._=dr,_e._=dr):fe._=dr}.call(s);var We=ze.exports;const Ke=1048576;var Ye;!function(t){t[t.INITIAL=0]="INITIAL",t[t.BUSY=1]="BUSY",t[t.WAIT_INPUT=2]="WAIT_INPUT",t[t.FREE=3]="FREE",t[t.STATIC_CHECK_FAILED=4]="STATIC_CHECK_FAILED",t[t.RUNTIME_ERROR=5]="RUNTIME_ERROR",t[t.MAX_STEP_REACHED=6]="MAX_STEP_REACHED",t[t.EXITED_NORMALLY=7]="EXITED_NORMALLY",t[t.EXITED_ABNORMALLY=8]="EXITED_ABNORMALLY",t[t.CLOSED=9]="CLOSED"}(Ye||(Ye={}));const Xe={instructions:[],text:[],memory:new Uint8Array},Ze={total:0,stack:0,globalVariable:0},qe={mainFunctionAddressBefore:-1,globalVariableTable:{},variableTableStack:[],assignCallLValueStack:[]},$e={stepCount:0,timeElapsed:0,state:Ye.INITIAL,callStack:[],staticErrors:[],runtimeErrors:[]};var Qe;!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.WARNING=2]="WARNING",t[t.INPUT=3]="INPUT",t[t.OUTPUT=4]="OUTPUT",t[t.PROMPT=5]="PROMPT",t[t.ARROW=6]="ARROW"}(Qe||(Qe={}));const Je={maxExecutionStepCount:{min:0,max:999999999},memorySize:{min:1024,max:32*Ke},stackSize:{min:512,max:33553920}},tr={maxExecutionStepCount:5e6,memorySize:2*Ke,stackSize:1*Ke};const er=new f.ArgumentParser({description:"IR Virtual Machine CLI"});er.add_argument("irFile",{nargs:1,help:"path to IR file that will be run"}),er.add_argument("-p",{action:"store_true",dest:"prompt",help:"print input prompt to stdout"}),er.add_argument("-s",{action:"store_true",dest:"stepCount",help:"print machine-readable execution step count to stdout after execution finishes"}),er.add_argument("-t",{action:"store_true",dest:"timeElapsed",help:"print machine-readable execution time in milliseconds to stdout after execution finishes"}),er.add_argument("-r",{action:"store_true",dest:"summary",help:"print human-readable execution summary to stdout after execution finishes"}),er.add_argument("-l",{action:"store",dest:"locale",choices:["en","zh-cn"],default:"zh-cn",help:"CLI message locale, defaults to 'zh-cn'"});const rr=er.parse_args(),nr={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}};let ir;if("en"===rr.locale)ir=Re({locale:"en",messages:Te[1].locale},nr);else ir=Re({locale:"zh-cn",messages:Te[0].locale},nr);const sr=e.createInterface({input:process.stdin});let or;try{or=t.readFileSync(rr.irFile[0],{encoding:"utf-8"})}catch(t){console.error(t),process.exit(1)}function ar(){ur.flushWriteBuffer((t=>{for(const e of t){let t=!1,r=!1;for(const n of e)switch(n.type){case Qe.OUTPUT:process.stdout.write(ir.formatMessage({id:n.key},n.values)),t=!0;break;case Qe.ERROR:process.stderr.write(ir.formatMessage({id:n.key},n.values)),t=!0,r=!0;break;case Qe.SUCCESS:case Qe.WARNING:if(rr.summary){process.stdout.write(ir.formatMessage({id:n.key},n.values)),t=!0;break}}t&&(r?process.stderr:process.stdout).write("\n")}}))}const ur=new class{initialRegisters={eax:0,ebx:0,ecx:0,edx:0,ebp:0,esp:tr.memorySize,eip:0};decoder=new He;memory=We.cloneDeep(Xe);registers=We.cloneDeep(this.initialRegisters);tables=We.cloneDeep(qe);executionStatus=We.cloneDeep($e);peakMemoryUsage=We.cloneDeep(Ze);options=We.cloneDeep(tr);executionStartTime=new Date;writeBuffer=[];readConsole=()=>Promise.resolve("");entryFunctionName="main";setReadConsoleFn(t){this.readConsole=t}getSingleVariableValues(t){const e=[];for(let r=t.address;r=this.memory.text.length?-1:this.memory.text[this.registers.eip].lineNumber}get instructions(){return this.memory.instructions}get globalVariableDetails(){return this.getSingleTableVariableDetails(this.tables.globalVariableTable)}get localVariableDetailsStack(){const t=[];for(let e=0;e(t=Math.max(t,e.min),t=Math.min(t,e.max));void 0!==t.maxExecutionStepCount&&(t.maxExecutionStepCount=e(t.maxExecutionStepCount,Je.maxExecutionStepCount),this.options.maxExecutionStepCount=t.maxExecutionStepCount),void 0!==t.memorySize&&(t.memorySize=e(t.memorySize,Je.memorySize),t.memorySize=e(t.memorySize,{min:this.options.stackSize,max:Je.memorySize.max}),this.options.memorySize=t.memorySize,this.initialRegisters.esp=Le(t.memorySize),this.registers.esp=Le(t.memorySize),this.updatePeakMemoryUsage()),void 0!==t.stackSize&&(t.stackSize=e(t.stackSize,Je.stackSize),t.stackSize=e(t.stackSize,{min:Je.stackSize.min,max:this.options.memorySize}),this.options.stackSize=t.stackSize)}reset(){this.memory.text=[],this.memory.memory=new Uint8Array,this.registers=We.cloneDeep(this.initialRegisters),this.tables=We.cloneDeep(qe),this.executionStatus=We.cloneDeep($e),this.peakMemoryUsage=We.cloneDeep(Ze),this.writeBuffer=[]}close(){this.executionStatus.state=Ye.CLOSED}loadNewInstructions(t){this.reset(),this.memory.instructions=t}loadAndDecodeNewInstructions(t){this.loadNewInstructions(t),this.decodeInstructions(!0)}decodeInstructions(t){const e=new Map,r=new Map;for(let n=0;nr.length?we.OUT_OF_BOUND:(r[e]=255&t,r[e+1]=(65280&t)>>>8,r[e+2]=(16711680&t)>>>16,r[e+3]=(4278190080&t)>>>24,we.SUCCESS)}(t,e,this.memory.memory);return r!==we.OUT_OF_BOUND||(this.writeRuntimeError({key:"MEMORY_WRITE_OUT_OF_BOUND",values:{address:e}}),!1)}pushl(t){return this.checkStackSize(4)?(this.registers.esp=Se(this.registers.esp,4),this.updatePeakMemoryUsage(),!!this.storeMemory32(t,this.registers.esp)):(this.writeRuntimeError({key:"STACK_OVERFLOW"}),!1)}popl(){const t=this.loadMemory32(this.registers.esp);return null===t?null:(this.registers.esp=Oe(this.registers.esp,4),this.updatePeakMemoryUsage(),t)}getVariableById(t,e){return 0===this.tables.variableTableStack.length?(this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"}),null):t in this.tables.variableTableStack[this.tables.variableTableStack.length-1]?this.tables.variableTableStack[this.tables.variableTableStack.length-1][t]:t in this.tables.globalVariableTable?this.tables.globalVariableTable[t]:(e&&this.writeRuntimeError({key:"VARIABLE_NOT_FOUND",values:{id:t}}),null)}getSingularValue(t){if(t.type===Ce.IMM)return t.imm;{const e=this.getVariableById(t.id,!0);if(null===e)return null;if(t.type===Ce.ADDRESS_ID)return e.address;const r=this.loadMemory32(e.address);if(null===r)return null;if(t.type===Ce.ID)return r;const n=this.loadMemory32(r);return null===n?null:n}}getRValue(t){switch(t.type){case Pe.SINGULAR:return this.getSingularValue(t.singular);case Pe.BINARY_MATH_OP:{const e=this.getSingularValue(t.singularL);if(null===e)return null;const r=this.getSingularValue(t.singularR);if(null===r)return null;switch(t.binaryMathOp){case De.ADD:return Oe(e,r);case De.SUB:return Se(e,r);case De.MUL:return function(t,e){const r=65535&t,n=65535&e;return Le((((4294901760&t)>>>16)*n+r*((4294901760&e)>>>16)<<16)+r*n)}(e,r);case De.DIV:return 0===r?(this.writeRuntimeError({key:"DIVIDE_BY_ZERO"}),null):Le(e/r)}}}}createStackVariable(t,e){if(!this.checkStackSize(e))return this.writeRuntimeError({key:"STACK_OVERFLOW"}),null;const r=this.memory.text[this.registers.eip].lineNumber;if(t in this.tables.variableTableStack[this.tables.variableTableStack.length-1])return this.tables.variableTableStack[this.tables.variableTableStack.length-1][t].lineNumber!==r?(this.writeRuntimeError({key:"DUPLICATE_DEC_ID",values:{id:t,lastLineNumber:this.tables.variableTableStack[this.tables.variableTableStack.length-1][t].lineNumber}}),null):this.tables.variableTableStack[this.tables.variableTableStack.length-1][t];this.registers.esp=Se(this.registers.esp,e),this.updatePeakMemoryUsage();const n={address:this.registers.esp,size:e,lineNumber:r};return 0===this.tables.variableTableStack.length?(this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"}),null):(this.tables.variableTableStack[this.tables.variableTableStack.length-1][t]=n,n)}getLValueAddress(t){let e=this.getVariableById(t.id,t.type===Be.DEREF_ID);if(null===e){if(t.type!==Be.ID)return null;if(e=this.createStackVariable(t.id,4),null===e)return null}let r=e.address;if(t.type===Be.DEREF_ID){const t=this.loadMemory32(e.address);if(null===t)return null;r=t}return r}getCondValue(t){const e=this.getSingularValue(t.singularL);if(null===e)return null;const r=this.getSingularValue(t.singularR);if(null===r)return null;switch(t.binaryRelOp){case Me.EQ:return e===r;case Me.NE:return e!==r;case Me.LT:return er;case Me.GE:return e>=r}}async execute(t){do{if(this.executionStatus.state!==Ye.EXITED_NORMALLY&&this.executionStatus.state!==Ye.EXITED_ABNORMALLY&&this.executionStatus.state!==Ye.INITIAL||(this.reset(),this.prepareExcution()),this.executionStatus.state!==Ye.FREE)return;if(this.executionStatus.state=Ye.BUSY,this.options.maxExecutionStepCount>0&&this.executionStatus.stepCount>=this.options.maxExecutionStepCount)return this.executionStatus.state=Ye.MAX_STEP_REACHED,void this.writeBuffer.push([{key:"MAX_STEP_REACHED",values:{maxExecutionStepCount:this.options.maxExecutionStepCount},type:Qe.ERROR}]);if(this.registers.eip>=this.memory.text.length||this.registers.eip<0)return this.executionStatus.state=Ye.RUNTIME_ERROR,void this.writeBuffer.push([{key:"RUNTIME_ERROR_PREFIX_NO_LN",type:Qe.ERROR},{key:"INSTRUCTION_READ_OUT_OF_BOUND",values:{address:this.registers.eip},type:Qe.ERROR}]);this.executionStatus.stepCount++;const t=this.memory.text[this.registers.eip];switch(t.type){case Ue.ARG:{const e=this.getSingularValue(t.value.value);if(null===e||!this.pushl(e))return;this.registers.ecx=Oe(this.registers.ecx,4);break}case Ue.ASSIGN:{const e=this.getRValue(t.value.rValue);if(null===e)return;const r=this.getLValueAddress(t.value.lValue);if(null===r)return;if(!this.storeMemory32(e,r))return;break}case Ue.ASSIGN_CALL:case Ue.CALL:{const e=t.type===Ue.CALL?t.value.id:t.value.functionId;if(this.registers.ebx=this.registers.esp,!this.pushl(this.registers.ecx))return;if(this.registers.ecx=0,!this.pushl(this.registers.eip))return;if(!this.pushl(this.registers.ebp))return;this.registers.ebp=this.registers.esp,t.type===Ue.ASSIGN_CALL?this.tables.assignCallLValueStack.push(t.value.lValue):this.tables.assignCallLValueStack.push(null),this.tables.variableTableStack.push({}),this.executionStatus.callStack.push(e),this.registers.eip=t.value.functionAddressBefore;break}case Ue.DEC:if(null===this.createStackVariable(t.value.id,t.value.size))return;break;case Ue.GOTO:this.registers.eip=t.value.gotoAddressBefore;break;case Ue.IF:{const e=this.getCondValue(t.value.condition);if(null===e)return;e&&(this.registers.eip=t.value.gotoAddressBefore);break}case Ue.PARAM:{const e=t.value.id;if(e in this.tables.variableTableStack[this.tables.variableTableStack.length-1])return void this.writeRuntimeError({key:"DUPLICATE_PARAM_ID",values:{id:e,lastLineNumber:this.tables.variableTableStack[this.tables.variableTableStack.length-1][e].lineNumber}});if(null===this.loadMemory32(this.registers.ebx))return;this.tables.variableTableStack[this.tables.variableTableStack.length-1][e]={address:this.registers.ebx,size:4,lineNumber:t.lineNumber},this.registers.ebx=Oe(this.registers.ebx,4);break}case Ue.RETURN:{const e=this.getSingularValue(t.value.value);if(null===e)return;this.registers.eax=e,this.registers.esp=this.registers.ebp,this.updatePeakMemoryUsage();const r=this.popl();if(null===r)return;this.registers.ebp=r;const n=this.popl();if(null===n)return;this.registers.eip=n;const i=this.popl();if(null===i)return;if(this.registers.esp=Oe(this.registers.esp,i),this.updatePeakMemoryUsage(),this.registers.ecx=0,0===this.tables.variableTableStack.length)return void this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"});if(this.executionStatus.callStack.pop(),this.tables.variableTableStack.pop(),this.registers.eip===this.memory.text.length)return void this.finalizeExcution();const s=this.tables.assignCallLValueStack.pop();if(null!==s){const t=this.getLValueAddress(s);if(null===t)return;if(!this.storeMemory32(this.registers.eax,t))return}break}case Ue.READ:{const e=t.value,r=this.getLValueAddress(e.lValue);if(null===r)return;const n=e.lValue.type===Be.ID?e.lValue.id:"*"+e.lValue.id;this.executionStatus.state=Ye.WAIT_INPUT;const i=await this.readConsole([{key:"READ_PROMPT",values:{name:n}}]);if(this.state!==Ye.WAIT_INPUT)return;this.executionStatus.state=Ye.BUSY;const s=parseInt(i);if(isNaN(s))return void this.writeRuntimeError({key:"INPUT_INT_ILLEGAL"});if(!Number.isSafeInteger(s))return void this.writeRuntimeError({key:"INPUT_INT_ABS_TOO_LARGE"});if(!this.storeMemory32(Le(s),r))return;break}case Ue.WRITE:{const e=this.getSingularValue(t.value.value);if(null===e)return;this.writeBuffer.push([{key:"WRITE_OUTPUT",values:{value:e},type:Qe.OUTPUT}]);break}}for(this.registers.eip=Oe(this.registers.eip,1);this.registers.eip=0&&this.memory.text[this.registers.eip].type===Ue.GLOBAL_DEC;)this.registers.eip=Oe(this.registers.eip,1);this.executionStatus.state=Ye.FREE}while(t)}async executeSingleStep(){await this.execute(!1)}async executeContinuously(){await this.execute(!0)}};ur.configure({maxExecutionStepCount:0,memorySize:32*Ke,stackSize:16*Ke});const lr=[];let cr=0,hr=null;sr.on("line",(t=>{const e=t.trim().split(/\s/).filter((t=>t.length>0));lr.push(...e),null!==hr&&cr(ar(),rr.prompt&&console.log(t.reduce(((t,e)=>t+ir.formatMessage({id:e.key},e.values)),"")),cr{hr=t}))))),ur.loadNewInstructions(or.split(/\r\n|[\r\n]/)),await ur.executeContinuously(),ar(),rr.stepCount&&console.log(ur.stepCount),rr.timeElapsed&&console.log(ur.timeElapsed);const fr=ur.state;switch(ur.close(),fr){case Ye.EXITED_NORMALLY:process.exit(0);case Ye.EXITED_ABNORMALLY:process.exit(ur.returnValue);case Ye.STATIC_CHECK_FAILED:case Ye.RUNTIME_ERROR:process.exit(1)} + */je=ze,Ve=ze.exports,function(){var t,e="Expected a function",r="__lodash_hash_undefined__",n="__lodash_placeholder__",i=16,o=32,a=64,u=128,l=256,c=1/0,h=9007199254740991,f=NaN,_=4294967295,p=[["ary",u],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",o],["partialRight",a],["rearg",l]],g="[object Arguments]",d="[object Array]",m="[object Boolean]",E="[object Date]",v="[object Error]",y="[object Function]",A="[object GeneratorFunction]",b="[object Map]",R="[object Number]",T="[object Object]",I="[object Promise]",L="[object RegExp]",S="[object Set]",O="[object String]",N="[object Symbol]",w="[object WeakMap]",C="[object ArrayBuffer]",D="[object DataView]",M="[object Float32Array]",B="[object Float64Array]",P="[object Int8Array]",x="[object Int16Array]",U="[object Int32Array]",G="[object Uint8Array]",k="[object Uint8ClampedArray]",F="[object Uint16Array]",H="[object Uint32Array]",j=/\b__p \+= '';/g,V=/\b(__p \+=) '' \+/g,z=/(__e\(.*?\)|\b__t\)) \+\n'';/g,W=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,Y=RegExp(W.source),X=RegExp(K.source),Z=/<%-([\s\S]+?)%>/g,q=/<%([\s\S]+?)%>/g,$=/<%=([\s\S]+?)%>/g,Q=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,J=/^\w*$/,tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,et=/[\\^$.*+?()[\]{}|]/g,rt=RegExp(et.source),nt=/^\s+/,it=/\s/,st=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ot=/\{\n\/\* \[wrapped with (.+)\] \*/,at=/,? & /,ut=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,lt=/[()=,{}\[\]\/\s]/,ct=/\\(\\)?/g,ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ft=/\w*$/,_t=/^[-+]0x[0-9a-f]+$/i,pt=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,dt=/^0o[0-7]+$/i,mt=/^(?:0|[1-9]\d*)$/,Et=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,vt=/($^)/,yt=/['\n\r\u2028\u2029\\]/g,At="\\ud800-\\udfff",bt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Rt="\\u2700-\\u27bf",Tt="a-z\\xdf-\\xf6\\xf8-\\xff",It="A-Z\\xc0-\\xd6\\xd8-\\xde",Lt="\\ufe0e\\ufe0f",St="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ot="['’]",Nt="["+At+"]",wt="["+St+"]",Ct="["+bt+"]",Dt="\\d+",Mt="["+Rt+"]",Bt="["+Tt+"]",Pt="[^"+At+St+Dt+Rt+Tt+It+"]",xt="\\ud83c[\\udffb-\\udfff]",Ut="[^"+At+"]",Gt="(?:\\ud83c[\\udde6-\\uddff]){2}",kt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ft="["+It+"]",Ht="\\u200d",jt="(?:"+Bt+"|"+Pt+")",Vt="(?:"+Ft+"|"+Pt+")",zt="(?:['’](?:d|ll|m|re|s|t|ve))?",Wt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Kt="(?:"+Ct+"|"+xt+")?",Yt="["+Lt+"]?",Xt=Yt+Kt+"(?:"+Ht+"(?:"+[Ut,Gt,kt].join("|")+")"+Yt+Kt+")*",Zt="(?:"+[Mt,Gt,kt].join("|")+")"+Xt,qt="(?:"+[Ut+Ct+"?",Ct,Gt,kt,Nt].join("|")+")",$t=RegExp(Ot,"g"),Qt=RegExp(Ct,"g"),Jt=RegExp(xt+"(?="+xt+")|"+qt+Xt,"g"),te=RegExp([Ft+"?"+Bt+"+"+zt+"(?="+[wt,Ft,"$"].join("|")+")",Vt+"+"+Wt+"(?="+[wt,Ft+jt,"$"].join("|")+")",Ft+"?"+jt+"+"+zt,Ft+"+"+Wt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dt,Zt].join("|"),"g"),ee=RegExp("["+Ht+At+bt+Lt+"]"),re=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ne=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ie=-1,se={};se[M]=se[B]=se[P]=se[x]=se[U]=se[G]=se[k]=se[F]=se[H]=!0,se[g]=se[d]=se[C]=se[m]=se[D]=se[E]=se[v]=se[y]=se[b]=se[R]=se[T]=se[L]=se[S]=se[O]=se[w]=!1;var oe={};oe[g]=oe[d]=oe[C]=oe[D]=oe[m]=oe[E]=oe[M]=oe[B]=oe[P]=oe[x]=oe[U]=oe[b]=oe[R]=oe[T]=oe[L]=oe[S]=oe[O]=oe[N]=oe[G]=oe[k]=oe[F]=oe[H]=!0,oe[v]=oe[y]=oe[w]=!1;var ae={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ue=parseFloat,le=parseInt,ce="object"==typeof s&&s&&s.Object===Object&&s,he="object"==typeof self&&self&&self.Object===Object&&self,fe=ce||he||Function("return this")(),_e=Ve&&!Ve.nodeType&&Ve,pe=_e&&je&&!je.nodeType&&je,ge=pe&&pe.exports===_e,de=ge&&ce.process,me=function(){try{var t=pe&&pe.require&&pe.require("util").types;return t||de&&de.binding&&de.binding("util")}catch(t){}}(),Ee=me&&me.isArrayBuffer,ve=me&&me.isDate,ye=me&&me.isMap,Ae=me&&me.isRegExp,be=me&&me.isSet,Re=me&&me.isTypedArray;function Te(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ie(t,e,r,n){for(var i=-1,s=null==t?0:t.length;++i-1}function Ce(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function rr(t,e){for(var r=t.length;r--&&Fe(e,t[r],0)>-1;);return r}var nr=Ye({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),ir=Ye({"&":"&","<":"<",">":">",'"':""","'":"'"});function sr(t){return"\\"+ae[t]}function or(t){return ee.test(t)}function ar(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function ur(t,e){return function(r){return t(e(r))}}function lr(t,e){for(var r=-1,i=t.length,s=0,o=[];++r",""":'"',"'":"'"}),dr=function s(it){var At,bt=(it=null==it?fe:dr.defaults(fe.Object(),it,dr.pick(fe,ne))).Array,Rt=it.Date,Tt=it.Error,It=it.Function,Lt=it.Math,St=it.Object,Ot=it.RegExp,Nt=it.String,wt=it.TypeError,Ct=bt.prototype,Dt=It.prototype,Mt=St.prototype,Bt=it["__core-js_shared__"],Pt=Dt.toString,xt=Mt.hasOwnProperty,Ut=0,Gt=(At=/[^.]+$/.exec(Bt&&Bt.keys&&Bt.keys.IE_PROTO||""))?"Symbol(src)_1."+At:"",kt=Mt.toString,Ft=Pt.call(St),Ht=fe._,jt=Ot("^"+Pt.call(xt).replace(et,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vt=ge?it.Buffer:t,zt=it.Symbol,Wt=it.Uint8Array,Kt=Vt?Vt.allocUnsafe:t,Yt=ur(St.getPrototypeOf,St),Xt=St.create,Zt=Mt.propertyIsEnumerable,qt=Ct.splice,Jt=zt?zt.isConcatSpreadable:t,ee=zt?zt.iterator:t,ae=zt?zt.toStringTag:t,ce=function(){try{var t=fs(St,"defineProperty");return t({},"",{}),t}catch(t){}}(),he=it.clearTimeout!==fe.clearTimeout&&it.clearTimeout,_e=Rt&&Rt.now!==fe.Date.now&&Rt.now,pe=it.setTimeout!==fe.setTimeout&&it.setTimeout,de=Lt.ceil,me=Lt.floor,Ue=St.getOwnPropertySymbols,je=Vt?Vt.isBuffer:t,Ve=it.isFinite,Ye=Ct.join,mr=ur(St.keys,St),Er=Lt.max,vr=Lt.min,yr=Rt.now,Ar=it.parseInt,br=Lt.random,Rr=Ct.reverse,Tr=fs(it,"DataView"),Ir=fs(it,"Map"),Lr=fs(it,"Promise"),Sr=fs(it,"Set"),Or=fs(it,"WeakMap"),Nr=fs(St,"create"),wr=Or&&new Or,Cr={},Dr=Gs(Tr),Mr=Gs(Ir),Br=Gs(Lr),Pr=Gs(Sr),xr=Gs(Or),Ur=zt?zt.prototype:t,Gr=Ur?Ur.valueOf:t,kr=Ur?Ur.toString:t;function Fr(t){if(ra(t)&&!Wo(t)&&!(t instanceof zr)){if(t instanceof Vr)return t;if(xt.call(t,"__wrapped__"))return ks(t)}return new Vr(t)}var Hr=function(){function e(){}return function(r){if(!ea(r))return{};if(Xt)return Xt(r);e.prototype=r;var n=new e;return e.prototype=t,n}}();function jr(){}function Vr(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=t}function zr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=_,this.__views__=[]}function Wr(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=r?e:r)),e}function ln(e,r,n,i,s,o){var a,u=1&r,l=2&r,c=4&r;if(n&&(a=s?n(e,i,s,o):n(e)),a!==t)return a;if(!ea(e))return e;var h=Wo(e);if(h){if(a=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&xt.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(e),!u)return wi(e,a)}else{var f=gs(e),_=f==y||f==A;if(Zo(e))return Ti(e,u);if(f==T||f==g||_&&!s){if(a=l||_?{}:ms(e),!u)return l?function(t,e){return Ci(t,ps(t),e)}(e,function(t,e){return t&&Ci(e,Ma(e),t)}(a,e)):function(t,e){return Ci(t,_s(t),e)}(e,sn(a,e))}else{if(!oe[f])return s?e:{};a=function(t,e,r){var n,i=t.constructor;switch(e){case C:return Ii(t);case m:case E:return new i(+t);case D:return function(t,e){var r=e?Ii(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case M:case B:case P:case x:case U:case G:case k:case F:case H:return Li(t,r);case b:return new i;case R:case O:return new i(t);case L:return function(t){var e=new t.constructor(t.source,ft.exec(t));return e.lastIndex=t.lastIndex,e}(t);case S:return new i;case N:return n=t,Gr?St(Gr.call(n)):{}}}(e,f,u)}}o||(o=new Zr);var p=o.get(e);if(p)return p;o.set(e,a),aa(e)?e.forEach((function(t){a.add(ln(t,r,n,t,e,o))})):na(e)&&e.forEach((function(t,i){a.set(i,ln(t,r,n,i,e,o))}));var d=h?t:(c?l?ss:is:l?Ma:Da)(e);return Le(d||e,(function(t,i){d&&(t=e[i=t]),en(a,i,ln(t,r,n,i,e,o))})),a}function cn(e,r,n){var i=n.length;if(null==e)return!i;for(e=St(e);i--;){var s=n[i],o=r[s],a=e[s];if(a===t&&!(s in e)||!o(a))return!1}return!0}function hn(r,n,i){if("function"!=typeof r)throw new wt(e);return Cs((function(){r.apply(t,i)}),n)}function fn(t,e,r,n){var i=-1,s=we,o=!0,a=t.length,u=[],l=e.length;if(!a)return u;r&&(e=De(e,Qe(r))),n?(s=Ce,o=!1):e.length>=200&&(s=tr,o=!1,e=new Xr(e));t:for(;++i-1},Kr.prototype.set=function(t,e){var r=this.__data__,n=rn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},Yr.prototype.clear=function(){this.size=0,this.__data__={hash:new Wr,map:new(Ir||Kr),string:new Wr}},Yr.prototype.delete=function(t){var e=cs(this,t).delete(t);return this.size-=e?1:0,e},Yr.prototype.get=function(t){return cs(this,t).get(t)},Yr.prototype.has=function(t){return cs(this,t).has(t)},Yr.prototype.set=function(t,e){var r=cs(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Xr.prototype.add=Xr.prototype.push=function(t){return this.__data__.set(t,r),this},Xr.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.clear=function(){this.__data__=new Kr,this.size=0},Zr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Zr.prototype.get=function(t){return this.__data__.get(t)},Zr.prototype.has=function(t){return this.__data__.has(t)},Zr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Kr){var n=r.__data__;if(!Ir||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Yr(n)}return r.set(t,e),this.size=r.size,this};var _n=Bi(An),pn=Bi(bn,!0);function gn(t,e){var r=!0;return _n(t,(function(t,n,i){return r=!!e(t,n,i)})),r}function dn(e,r,n){for(var i=-1,s=e.length;++i0&&r(a)?e>1?En(a,e-1,r,n,i):Me(i,a):n||(i[i.length]=a)}return i}var vn=Pi(),yn=Pi(!0);function An(t,e){return t&&vn(t,e,Da)}function bn(t,e){return t&&yn(t,e,Da)}function Rn(t,e){return Ne(e,(function(e){return Qo(t[e])}))}function Tn(e,r){for(var n=0,i=(r=yi(r,e)).length;null!=e&&ne}function On(t,e){return null!=t&&xt.call(t,e)}function Nn(t,e){return null!=t&&e in St(t)}function wn(e,r,n){for(var i=n?Ce:we,s=e[0].length,o=e.length,a=o,u=bt(o),l=1/0,c=[];a--;){var h=e[a];a&&r&&(h=De(h,Qe(r))),l=vr(h.length,l),u[a]=!n&&(r||s>=120&&h.length>=120)?new Xr(a&&h):t}h=e[0];var f=-1,_=u[0];t:for(;++f=a?u:u*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}))}function Kn(t,e,r){for(var n=-1,i=e.length,s={};++n-1;)a!==t&&qt.call(a,u,1),qt.call(t,u,1);return t}function Xn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==s){var s=i;vs(i)?qt.call(t,i,1):fi(t,i)}}return t}function Zn(t,e){return t+me(br()*(e-t+1))}function qn(t,e){var r="";if(!t||e<1||e>h)return r;do{e%2&&(r+=t),(e=me(e/2))&&(t+=t)}while(e);return r}function $n(t,e){return Ds(Ss(t,e,iu),t+"")}function Qn(t){return $r(Ha(t))}function Jn(t,e){var r=Ha(t);return Ps(r,un(e,0,r.length))}function ti(e,r,n,i){if(!ea(e))return e;for(var s=-1,o=(r=yi(r,e)).length,a=o-1,u=e;null!=u&&++si?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var s=bt(i);++n>>1,o=t[s];null!==o&&!la(o)&&(r?o<=e:o=200){var l=e?null:qi(t);if(l)return cr(l);o=!1,i=tr,u=new Xr}else u=e?[]:a;t:for(;++n=i?e:ii(e,r,n)}var Ri=he||function(t){return fe.clearTimeout(t)};function Ti(t,e){if(e)return t.slice();var r=t.length,n=Kt?Kt(r):new t.constructor(r);return t.copy(n),n}function Ii(t){var e=new t.constructor(t.byteLength);return new Wt(e).set(new Wt(t)),e}function Li(t,e){var r=e?Ii(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Si(e,r){if(e!==r){var n=e!==t,i=null===e,s=e==e,o=la(e),a=r!==t,u=null===r,l=r==r,c=la(r);if(!u&&!c&&!o&&e>r||o&&a&&l&&!u&&!c||i&&a&&l||!n&&l||!s)return 1;if(!i&&!o&&!c&&e1?n[s-1]:t,a=s>2?n[2]:t;for(o=e.length>3&&"function"==typeof o?(s--,o):t,a&&ys(n[0],n[1],a)&&(o=s<3?t:o,s=1),r=St(r);++i-1?s[o?r[a]:a]:t}}function Fi(r){return ns((function(n){var i=n.length,s=i,o=Vr.prototype.thru;for(r&&n.reverse();s--;){var a=n[s];if("function"!=typeof a)throw new wt(e);if(o&&!u&&"wrapper"==as(a))var u=new Vr([],!0)}for(s=u?s:i;++s1&&v.reverse(),f&&cu))return!1;var c=o.get(e),h=o.get(r);if(c&&h)return c==r&&h==e;var f=-1,_=!0,p=2&n?new Xr:t;for(o.set(e,r),o.set(r,e);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(st,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Le(p,(function(r){var n="_."+r[0];e&r[1]&&!we(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(ot);return e?e[1].split(at):[]}(n),r)))}function Bs(e){var r=0,n=0;return function(){var i=yr(),s=16-(i-n);if(n=i,s>0){if(++r>=800)return arguments[0]}else r=0;return e.apply(t,arguments)}}function Ps(e,r){var n=-1,i=e.length,s=i-1;for(r=r===t?i:r;++n1?e[r-1]:t;return n="function"==typeof n?(e.pop(),n):t,so(e,n)}));function fo(t){var e=Fr(t);return e.__chain__=!0,e}function _o(t,e){return e(t)}var po=ns((function(e){var r=e.length,n=r?e[0]:0,i=this.__wrapped__,s=function(t){return an(t,e)};return!(r>1||this.__actions__.length)&&i instanceof zr&&vs(n)?((i=i.slice(n,+n+(r?1:0))).__actions__.push({func:_o,args:[s],thisArg:t}),new Vr(i,this.__chain__).thru((function(e){return r&&!e.length&&e.push(t),e}))):this.thru(s)})),go=Di((function(t,e,r){xt.call(t,r)?++t[r]:on(t,r,1)})),mo=ki(Vs),Eo=ki(zs);function vo(t,e){return(Wo(t)?Le:_n)(t,ls(e,3))}function yo(t,e){return(Wo(t)?Se:pn)(t,ls(e,3))}var Ao=Di((function(t,e,r){xt.call(t,r)?t[r].push(e):on(t,r,[e])})),bo=$n((function(t,e,r){var n=-1,i="function"==typeof e,s=Yo(t)?bt(t.length):[];return _n(t,(function(t){s[++n]=i?Te(e,t,r):Cn(t,e,r)})),s})),Ro=Di((function(t,e,r){on(t,r,e)}));function To(t,e){return(Wo(t)?De:Fn)(t,ls(e,3))}var Io=Di((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),Lo=$n((function(t,e){if(null==t)return[];var r=e.length;return r>1&&ys(t,e[0],e[1])?e=[]:r>2&&ys(e[0],e[1],e[2])&&(e=[e[0]]),Wn(t,En(e,1),[])})),So=_e||function(){return fe.Date.now()};function Oo(e,r,n){return r=n?t:r,r=e&&null==r?e.length:r,Qi(e,u,t,t,t,t,r)}function No(r,n){var i;if("function"!=typeof n)throw new wt(e);return r=ga(r),function(){return--r>0&&(i=n.apply(this,arguments)),r<=1&&(n=t),i}}var wo=$n((function(t,e,r){var n=1;if(r.length){var i=lr(r,us(wo));n|=o}return Qi(t,n,e,r,i)})),Co=$n((function(t,e,r){var n=3;if(r.length){var i=lr(r,us(Co));n|=o}return Qi(e,n,t,r,i)}));function Do(r,n,i){var s,o,a,u,l,c,h=0,f=!1,_=!1,p=!0;if("function"!=typeof r)throw new wt(e);function g(e){var n=s,i=o;return s=o=t,h=e,u=r.apply(i,n)}function d(e){var r=e-c;return c===t||r>=n||r<0||_&&e-h>=a}function m(){var t=So();if(d(t))return E(t);l=Cs(m,function(t){var e=n-(t-c);return _?vr(e,a-(t-h)):e}(t))}function E(e){return l=t,p&&s?g(e):(s=o=t,u)}function v(){var e=So(),r=d(e);if(s=arguments,o=this,c=e,r){if(l===t)return function(t){return h=t,l=Cs(m,n),f?g(t):u}(c);if(_)return Ri(l),l=Cs(m,n),g(c)}return l===t&&(l=Cs(m,n)),u}return n=ma(n)||0,ea(i)&&(f=!!i.leading,a=(_="maxWait"in i)?Er(ma(i.maxWait)||0,n):a,p="trailing"in i?!!i.trailing:p),v.cancel=function(){l!==t&&Ri(l),h=0,s=c=o=l=t},v.flush=function(){return l===t?u:E(So())},v}var Mo=$n((function(t,e){return hn(t,1,e)})),Bo=$n((function(t,e,r){return hn(t,ma(e)||0,r)}));function Po(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new wt(e);var n=function(){var e=arguments,i=r?r.apply(this,e):e[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,e);return n.cache=s.set(i,o)||s,o};return n.cache=new(Po.Cache||Yr),n}function xo(t){if("function"!=typeof t)throw new wt(e);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Po.Cache=Yr;var Uo=Ai((function(t,e){var r=(e=1==e.length&&Wo(e[0])?De(e[0],Qe(ls())):De(En(e,1),Qe(ls()))).length;return $n((function(n){for(var i=-1,s=vr(n.length,r);++i=e})),zo=Dn(function(){return arguments}())?Dn:function(t){return ra(t)&&xt.call(t,"callee")&&!Zt.call(t,"callee")},Wo=bt.isArray,Ko=Ee?Qe(Ee):function(t){return ra(t)&&Ln(t)==C};function Yo(t){return null!=t&&ta(t.length)&&!Qo(t)}function Xo(t){return ra(t)&&Yo(t)}var Zo=je||mu,qo=ve?Qe(ve):function(t){return ra(t)&&Ln(t)==E};function $o(t){if(!ra(t))return!1;var e=Ln(t);return e==v||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!sa(t)}function Qo(t){if(!ea(t))return!1;var e=Ln(t);return e==y||e==A||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Jo(t){return"number"==typeof t&&t==ga(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=h}function ea(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ra(t){return null!=t&&"object"==typeof t}var na=ye?Qe(ye):function(t){return ra(t)&&gs(t)==b};function ia(t){return"number"==typeof t||ra(t)&&Ln(t)==R}function sa(t){if(!ra(t)||Ln(t)!=T)return!1;var e=Yt(t);if(null===e)return!0;var r=xt.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&Pt.call(r)==Ft}var oa=Ae?Qe(Ae):function(t){return ra(t)&&Ln(t)==L},aa=be?Qe(be):function(t){return ra(t)&&gs(t)==S};function ua(t){return"string"==typeof t||!Wo(t)&&ra(t)&&Ln(t)==O}function la(t){return"symbol"==typeof t||ra(t)&&Ln(t)==N}var ca=Re?Qe(Re):function(t){return ra(t)&&ta(t.length)&&!!se[Ln(t)]},ha=Yi(kn),fa=Yi((function(t,e){return t<=e}));function _a(t){if(!t)return[];if(Yo(t))return ua(t)?_r(t):wi(t);if(ee&&t[ee])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ee]());var e=gs(t);return(e==b?ar:e==S?cr:Ha)(t)}function pa(t){return t?(t=ma(t))===c||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ga(t){var e=pa(t),r=e%1;return e==e?r?e-r:e:0}function da(t){return t?un(ga(t),0,_):0}function ma(t){if("number"==typeof t)return t;if(la(t))return f;if(ea(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ea(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=$e(t);var r=pt.test(t);return r||dt.test(t)?le(t.slice(2),r?2:8):_t.test(t)?f:+t}function Ea(t){return Ci(t,Ma(t))}function va(t){return null==t?"":ci(t)}var ya=Mi((function(t,e){if(Ts(e)||Yo(e))Ci(e,Da(e),t);else for(var r in e)xt.call(e,r)&&en(t,r,e[r])})),Aa=Mi((function(t,e){Ci(e,Ma(e),t)})),ba=Mi((function(t,e,r,n){Ci(e,Ma(e),t,n)})),Ra=Mi((function(t,e,r,n){Ci(e,Da(e),t,n)})),Ta=ns(an),Ia=$n((function(e,r){e=St(e);var n=-1,i=r.length,s=i>2?r[2]:t;for(s&&ys(r[0],r[1],s)&&(i=1);++n1),e})),Ci(t,ss(t),r),n&&(r=ln(r,7,es));for(var i=e.length;i--;)fi(r,e[i]);return r})),Ua=ns((function(t,e){return null==t?{}:function(t,e){return Kn(t,e,(function(e,r){return Oa(t,r)}))}(t,e)}));function Ga(t,e){if(null==t)return{};var r=De(ss(t),(function(t){return[t]}));return e=ls(e),Kn(t,r,(function(t,r){return e(t,r[0])}))}var ka=$i(Da),Fa=$i(Ma);function Ha(t){return null==t?[]:Je(t,Da(t))}var ja=Ui((function(t,e,r){return e=e.toLowerCase(),t+(r?Va(e):e)}));function Va(t){return $a(va(t).toLowerCase())}function za(t){return(t=va(t))&&t.replace(Et,nr).replace(Qt,"")}var Wa=Ui((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),Ka=Ui((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Ya=xi("toLowerCase"),Xa=Ui((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Za=Ui((function(t,e,r){return t+(r?" ":"")+$a(e)})),qa=Ui((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),$a=xi("toUpperCase");function Qa(e,r,n){return e=va(e),(r=n?t:r)===t?function(t){return re.test(t)}(e)?function(t){return t.match(te)||[]}(e):function(t){return t.match(ut)||[]}(e):e.match(r)||[]}var Ja=$n((function(e,r){try{return Te(e,t,r)}catch(t){return $o(t)?t:new Tt(t)}})),tu=ns((function(t,e){return Le(e,(function(e){e=Us(e),on(t,e,wo(t[e],t))})),t}));function eu(t){return function(){return t}}var ru=Fi(),nu=Fi(!0);function iu(t){return t}function su(t){return xn("function"==typeof t?t:ln(t,1))}var ou=$n((function(t,e){return function(r){return Cn(r,t,e)}})),au=$n((function(t,e){return function(r){return Cn(t,r,e)}}));function uu(t,e,r){var n=Da(e),i=Rn(e,n);null!=r||ea(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Rn(e,Da(e)));var s=!(ea(r)&&"chain"in r&&!r.chain),o=Qo(t);return Le(i,(function(r){var n=e[r];t[r]=n,o&&(t.prototype[r]=function(){var e=this.__chain__;if(s||e){var r=t(this.__wrapped__);return(r.__actions__=wi(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Me([this.value()],arguments))})})),t}function lu(){}var cu=zi(De),hu=zi(Oe),fu=zi(xe);function _u(t){return As(t)?Ke(Us(t)):function(t){return function(e){return Tn(e,t)}}(t)}var pu=Ki(),gu=Ki(!0);function du(){return[]}function mu(){return!1}var Eu,vu=Vi((function(t,e){return t+e}),0),yu=Zi("ceil"),Au=Vi((function(t,e){return t/e}),1),bu=Zi("floor"),Ru=Vi((function(t,e){return t*e}),1),Tu=Zi("round"),Iu=Vi((function(t,e){return t-e}),0);return Fr.after=function(t,r){if("function"!=typeof r)throw new wt(e);return t=ga(t),function(){if(--t<1)return r.apply(this,arguments)}},Fr.ary=Oo,Fr.assign=ya,Fr.assignIn=Aa,Fr.assignInWith=ba,Fr.assignWith=Ra,Fr.at=Ta,Fr.before=No,Fr.bind=wo,Fr.bindAll=tu,Fr.bindKey=Co,Fr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Wo(t)?t:[t]},Fr.chain=fo,Fr.chunk=function(e,r,n){r=(n?ys(e,r,n):r===t)?1:Er(ga(r),0);var i=null==e?0:e.length;if(!i||r<1)return[];for(var s=0,o=0,a=bt(de(i/r));ss?0:s+n),(i=i===t||i>s?s:ga(i))<0&&(i+=s),i=n>i?0:da(i);n>>0)?(e=va(e))&&("string"==typeof r||null!=r&&!oa(r))&&!(r=ci(r))&&or(e)?bi(_r(e),0,n):e.split(r,n):[]},Fr.spread=function(t,r){if("function"!=typeof t)throw new wt(e);return r=null==r?0:Er(ga(r),0),$n((function(e){var n=e[r],i=bi(e,0,r);return n&&Me(i,n),Te(t,this,i)}))},Fr.tail=function(t){var e=null==t?0:t.length;return e?ii(t,1,e):[]},Fr.take=function(e,r,n){return e&&e.length?ii(e,0,(r=n||r===t?1:ga(r))<0?0:r):[]},Fr.takeRight=function(e,r,n){var i=null==e?0:e.length;return i?ii(e,(r=i-(r=n||r===t?1:ga(r)))<0?0:r,i):[]},Fr.takeRightWhile=function(t,e){return t&&t.length?pi(t,ls(e,3),!1,!0):[]},Fr.takeWhile=function(t,e){return t&&t.length?pi(t,ls(e,3)):[]},Fr.tap=function(t,e){return e(t),t},Fr.throttle=function(t,r,n){var i=!0,s=!0;if("function"!=typeof t)throw new wt(e);return ea(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),Do(t,r,{leading:i,maxWait:r,trailing:s})},Fr.thru=_o,Fr.toArray=_a,Fr.toPairs=ka,Fr.toPairsIn=Fa,Fr.toPath=function(t){return Wo(t)?De(t,Us):la(t)?[t]:wi(xs(va(t)))},Fr.toPlainObject=Ea,Fr.transform=function(t,e,r){var n=Wo(t),i=n||Zo(t)||ca(t);if(e=ls(e,4),null==r){var s=t&&t.constructor;r=i?n?new s:[]:ea(t)&&Qo(s)?Hr(Yt(t)):{}}return(i?Le:An)(t,(function(t,n,i){return e(r,t,n,i)})),r},Fr.unary=function(t){return Oo(t,1)},Fr.union=eo,Fr.unionBy=ro,Fr.unionWith=no,Fr.uniq=function(t){return t&&t.length?hi(t):[]},Fr.uniqBy=function(t,e){return t&&t.length?hi(t,ls(e,2)):[]},Fr.uniqWith=function(e,r){return r="function"==typeof r?r:t,e&&e.length?hi(e,t,r):[]},Fr.unset=function(t,e){return null==t||fi(t,e)},Fr.unzip=io,Fr.unzipWith=so,Fr.update=function(t,e,r){return null==t?t:_i(t,e,vi(r))},Fr.updateWith=function(e,r,n,i){return i="function"==typeof i?i:t,null==e?e:_i(e,r,vi(n),i)},Fr.values=Ha,Fr.valuesIn=function(t){return null==t?[]:Je(t,Ma(t))},Fr.without=oo,Fr.words=Qa,Fr.wrap=function(t,e){return Go(vi(e),t)},Fr.xor=ao,Fr.xorBy=uo,Fr.xorWith=lo,Fr.zip=co,Fr.zipObject=function(t,e){return mi(t||[],e||[],en)},Fr.zipObjectDeep=function(t,e){return mi(t||[],e||[],ti)},Fr.zipWith=ho,Fr.entries=ka,Fr.entriesIn=Fa,Fr.extend=Aa,Fr.extendWith=ba,uu(Fr,Fr),Fr.add=vu,Fr.attempt=Ja,Fr.camelCase=ja,Fr.capitalize=Va,Fr.ceil=yu,Fr.clamp=function(e,r,n){return n===t&&(n=r,r=t),n!==t&&(n=(n=ma(n))==n?n:0),r!==t&&(r=(r=ma(r))==r?r:0),un(ma(e),r,n)},Fr.clone=function(t){return ln(t,4)},Fr.cloneDeep=function(t){return ln(t,5)},Fr.cloneDeepWith=function(e,r){return ln(e,5,r="function"==typeof r?r:t)},Fr.cloneWith=function(e,r){return ln(e,4,r="function"==typeof r?r:t)},Fr.conformsTo=function(t,e){return null==e||cn(t,e,Da(e))},Fr.deburr=za,Fr.defaultTo=function(t,e){return null==t||t!=t?e:t},Fr.divide=Au,Fr.endsWith=function(e,r,n){e=va(e),r=ci(r);var i=e.length,s=n=n===t?i:un(ga(n),0,i);return(n-=r.length)>=0&&e.slice(n,s)==r},Fr.eq=Ho,Fr.escape=function(t){return(t=va(t))&&X.test(t)?t.replace(K,ir):t},Fr.escapeRegExp=function(t){return(t=va(t))&&rt.test(t)?t.replace(et,"\\$&"):t},Fr.every=function(e,r,n){var i=Wo(e)?Oe:gn;return n&&ys(e,r,n)&&(r=t),i(e,ls(r,3))},Fr.find=mo,Fr.findIndex=Vs,Fr.findKey=function(t,e){return Ge(t,ls(e,3),An)},Fr.findLast=Eo,Fr.findLastIndex=zs,Fr.findLastKey=function(t,e){return Ge(t,ls(e,3),bn)},Fr.floor=bu,Fr.forEach=vo,Fr.forEachRight=yo,Fr.forIn=function(t,e){return null==t?t:vn(t,ls(e,3),Ma)},Fr.forInRight=function(t,e){return null==t?t:yn(t,ls(e,3),Ma)},Fr.forOwn=function(t,e){return t&&An(t,ls(e,3))},Fr.forOwnRight=function(t,e){return t&&bn(t,ls(e,3))},Fr.get=Sa,Fr.gt=jo,Fr.gte=Vo,Fr.has=function(t,e){return null!=t&&ds(t,e,On)},Fr.hasIn=Oa,Fr.head=Ks,Fr.identity=iu,Fr.includes=function(t,e,r,n){t=Yo(t)?t:Ha(t),r=r&&!n?ga(r):0;var i=t.length;return r<0&&(r=Er(i+r,0)),ua(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Fe(t,e,r)>-1},Fr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:ga(r);return i<0&&(i=Er(n+i,0)),Fe(t,e,i)},Fr.inRange=function(e,r,n){return r=pa(r),n===t?(n=r,r=0):n=pa(n),function(t,e,r){return t>=vr(e,r)&&t=-9007199254740991&&t<=h},Fr.isSet=aa,Fr.isString=ua,Fr.isSymbol=la,Fr.isTypedArray=ca,Fr.isUndefined=function(e){return e===t},Fr.isWeakMap=function(t){return ra(t)&&gs(t)==w},Fr.isWeakSet=function(t){return ra(t)&&"[object WeakSet]"==Ln(t)},Fr.join=function(t,e){return null==t?"":Ye.call(t,e)},Fr.kebabCase=Wa,Fr.last=qs,Fr.lastIndexOf=function(e,r,n){var i=null==e?0:e.length;if(!i)return-1;var s=i;return n!==t&&(s=(s=ga(n))<0?Er(i+s,0):vr(s,i-1)),r==r?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(e,r,s):ke(e,ze,s,!0)},Fr.lowerCase=Ka,Fr.lowerFirst=Ya,Fr.lt=ha,Fr.lte=fa,Fr.max=function(e){return e&&e.length?dn(e,iu,Sn):t},Fr.maxBy=function(e,r){return e&&e.length?dn(e,ls(r,2),Sn):t},Fr.mean=function(t){return We(t,iu)},Fr.meanBy=function(t,e){return We(t,ls(e,2))},Fr.min=function(e){return e&&e.length?dn(e,iu,kn):t},Fr.minBy=function(e,r){return e&&e.length?dn(e,ls(r,2),kn):t},Fr.stubArray=du,Fr.stubFalse=mu,Fr.stubObject=function(){return{}},Fr.stubString=function(){return""},Fr.stubTrue=function(){return!0},Fr.multiply=Ru,Fr.nth=function(e,r){return e&&e.length?zn(e,ga(r)):t},Fr.noConflict=function(){return fe._===this&&(fe._=Ht),this},Fr.noop=lu,Fr.now=So,Fr.pad=function(t,e,r){t=va(t);var n=(e=ga(e))?fr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return Wi(me(i),r)+t+Wi(de(i),r)},Fr.padEnd=function(t,e,r){t=va(t);var n=(e=ga(e))?fr(t):0;return e&&nr){var i=e;e=r,r=i}if(n||e%1||r%1){var s=br();return vr(e+s*(r-e+ue("1e-"+((s+"").length-1))),r)}return Zn(e,r)},Fr.reduce=function(t,e,r){var n=Wo(t)?Be:Xe,i=arguments.length<3;return n(t,ls(e,4),r,i,_n)},Fr.reduceRight=function(t,e,r){var n=Wo(t)?Pe:Xe,i=arguments.length<3;return n(t,ls(e,4),r,i,pn)},Fr.repeat=function(e,r,n){return r=(n?ys(e,r,n):r===t)?1:ga(r),qn(va(e),r)},Fr.replace=function(){var t=arguments,e=va(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Fr.result=function(e,r,n){var i=-1,s=(r=yi(r,e)).length;for(s||(s=1,e=t);++ih)return[];var r=_,n=vr(t,_);e=ls(e),t-=_;for(var i=qe(n,e);++r=o)return e;var u=n-fr(i);if(u<1)return i;var l=a?bi(a,0,u).join(""):e.slice(0,u);if(s===t)return l+i;if(a&&(u+=l.length-u),oa(s)){if(e.slice(u).search(s)){var c,h=l;for(s.global||(s=Ot(s.source,va(ft.exec(s))+"g")),s.lastIndex=0;c=s.exec(h);)var f=c.index;l=l.slice(0,f===t?u:f)}}else if(e.indexOf(ci(s),u)!=u){var _=l.lastIndexOf(s);_>-1&&(l=l.slice(0,_))}return l+i},Fr.unescape=function(t){return(t=va(t))&&Y.test(t)?t.replace(W,gr):t},Fr.uniqueId=function(t){var e=++Ut;return va(t)+e},Fr.upperCase=qa,Fr.upperFirst=$a,Fr.each=vo,Fr.eachRight=yo,Fr.first=Ks,uu(Fr,(Eu={},An(Fr,(function(t,e){xt.call(Fr.prototype,e)||(Eu[e]=t)})),Eu),{chain:!1}),Fr.VERSION="4.17.21",Le(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Fr[t].placeholder=Fr})),Le(["drop","take"],(function(e,r){zr.prototype[e]=function(n){n=n===t?1:Er(ga(n),0);var i=this.__filtered__&&!r?new zr(this):this.clone();return i.__filtered__?i.__takeCount__=vr(n,i.__takeCount__):i.__views__.push({size:vr(n,_),type:e+(i.__dir__<0?"Right":"")}),i},zr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Le(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;zr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:ls(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),Le(["head","last"],(function(t,e){var r="take"+(e?"Right":"");zr.prototype[t]=function(){return this[r](1).value()[0]}})),Le(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");zr.prototype[t]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(iu)},zr.prototype.find=function(t){return this.filter(t).head()},zr.prototype.findLast=function(t){return this.reverse().find(t)},zr.prototype.invokeMap=$n((function(t,e){return"function"==typeof t?new zr(this):this.map((function(r){return Cn(r,t,e)}))})),zr.prototype.reject=function(t){return this.filter(xo(ls(t)))},zr.prototype.slice=function(e,r){e=ga(e);var n=this;return n.__filtered__&&(e>0||r<0)?new zr(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),r!==t&&(n=(r=ga(r))<0?n.dropRight(-r):n.take(r-e)),n)},zr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},zr.prototype.toArray=function(){return this.take(_)},An(zr.prototype,(function(e,r){var n=/^(?:filter|find|map|reject)|While$/.test(r),i=/^(?:head|last)$/.test(r),s=Fr[i?"take"+("last"==r?"Right":""):r],o=i||/^find/.test(r);s&&(Fr.prototype[r]=function(){var r=this.__wrapped__,a=i?[1]:arguments,u=r instanceof zr,l=a[0],c=u||Wo(r),h=function(t){var e=s.apply(Fr,Me([t],a));return i&&f?e[0]:e};c&&n&&"function"==typeof l&&1!=l.length&&(u=c=!1);var f=this.__chain__,_=!!this.__actions__.length,p=o&&!f,g=u&&!_;if(!o&&c){r=g?r:new zr(this);var d=e.apply(r,a);return d.__actions__.push({func:_o,args:[h],thisArg:t}),new Vr(d,f)}return p&&g?e.apply(this,a):(d=this.thru(h),p?i?d.value()[0]:d.value():d)})})),Le(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Fr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(Wo(i)?i:[],t)}return this[r]((function(r){return e.apply(Wo(r)?r:[],t)}))}})),An(zr.prototype,(function(t,e){var r=Fr[e];if(r){var n=r.name+"";xt.call(Cr,n)||(Cr[n]=[]),Cr[n].push({name:e,func:r})}})),Cr[Hi(t,2).name]=[{name:"wrapper",func:t}],zr.prototype.clone=function(){var t=new zr(this.__wrapped__);return t.__actions__=wi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=wi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=wi(this.__views__),t},zr.prototype.reverse=function(){if(this.__filtered__){var t=new zr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},zr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Wo(t),n=e<0,i=r?t.length:0,s=function(t,e,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},Fr.prototype.plant=function(e){for(var r,n=this;n instanceof jr;){var i=ks(n);i.__index__=0,i.__values__=t,r?s.__wrapped__=i:r=i;var s=i;n=n.__wrapped__}return s.__wrapped__=e,r},Fr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof zr){var r=e;return this.__actions__.length&&(r=new zr(this)),(r=r.reverse()).__actions__.push({func:_o,args:[to],thisArg:t}),new Vr(r,this.__chain__)}return this.thru(to)},Fr.prototype.toJSON=Fr.prototype.valueOf=Fr.prototype.value=function(){return gi(this.__wrapped__,this.__actions__)},Fr.prototype.first=Fr.prototype.head,ee&&(Fr.prototype[ee]=function(){return this}),Fr}();pe?((pe.exports=dr)._=dr,_e._=dr):fe._=dr}.call(s);var We=ze.exports;const Ke=1048576;var Ye;!function(t){t[t.INITIAL=0]="INITIAL",t[t.BUSY=1]="BUSY",t[t.WAIT_INPUT=2]="WAIT_INPUT",t[t.FREE=3]="FREE",t[t.STATIC_CHECK_FAILED=4]="STATIC_CHECK_FAILED",t[t.RUNTIME_ERROR=5]="RUNTIME_ERROR",t[t.MAX_STEP_REACHED=6]="MAX_STEP_REACHED",t[t.EXITED_NORMALLY=7]="EXITED_NORMALLY",t[t.EXITED_ABNORMALLY=8]="EXITED_ABNORMALLY",t[t.CLOSED=9]="CLOSED"}(Ye||(Ye={}));const Xe={instructions:[],text:[],memory:new Uint8Array},Ze={total:0,stack:0,globalVariable:0},qe={mainFunctionAddressBefore:-1,globalVariableTable:{},variableTableStack:[],assignCallLValueStack:[]},$e={stepCount:0,timeElapsed:0,state:Ye.INITIAL,callStack:[],staticErrors:[],runtimeErrors:[]};var Qe;!function(t){t[t.SUCCESS=0]="SUCCESS",t[t.ERROR=1]="ERROR",t[t.WARNING=2]="WARNING",t[t.INPUT=3]="INPUT",t[t.OUTPUT=4]="OUTPUT",t[t.PROMPT=5]="PROMPT",t[t.ARROW=6]="ARROW"}(Qe||(Qe={}));const Je={maxExecutionStepCount:{min:0,max:999999999},memorySize:{min:1024,max:32*Ke},stackSize:{min:512,max:33553920}},tr={maxExecutionStepCount:5e6,memorySize:2*Ke,stackSize:1*Ke};const er=new f.ArgumentParser({description:"IR Virtual Machine CLI"});er.add_argument("irFile",{nargs:1,help:"path to IR file that will be run"}),er.add_argument("-p",{action:"store_true",dest:"prompt",help:"print input prompt to stdout"}),er.add_argument("-s",{action:"store_true",dest:"stepCount",help:"print machine-readable execution step count to stdout after execution finishes"}),er.add_argument("-t",{action:"store_true",dest:"timeElapsed",help:"print machine-readable execution time in milliseconds to stdout after execution finishes"}),er.add_argument("-r",{action:"store_true",dest:"summary",help:"print human-readable execution summary to stdout after execution finishes"}),er.add_argument("-l",{action:"store",dest:"locale",choices:["en","zh-cn"],default:"zh-cn",help:"CLI message locale, defaults to 'zh-cn'"});const rr=er.parse_args(),nr={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}};let ir;if("en"===rr.locale)ir=Re({locale:"en",messages:Te[1].locale},nr);else ir=Re({locale:"zh-cn",messages:Te[0].locale},nr);const sr=e.createInterface({input:process.stdin});let or;try{or=t.readFileSync(rr.irFile[0],{encoding:"utf-8"})}catch(t){console.error(t),process.exit(1)}function ar(){ur.flushWriteBuffer((t=>{for(const e of t){let t=!1,r=!1;for(const n of e)switch(n.type){case Qe.OUTPUT:process.stdout.write(ir.formatMessage({id:n.key},n.values)),t=!0;break;case Qe.ERROR:process.stderr.write(ir.formatMessage({id:n.key},n.values)),t=!0,r=!0;break;case Qe.SUCCESS:case Qe.WARNING:if(rr.summary){process.stdout.write(ir.formatMessage({id:n.key},n.values)),t=!0;break}}t&&(r?process.stderr:process.stdout).write("\n")}}))}const ur=new class{initialRegisters={eax:0,ebx:0,ecx:0,edx:0,ebp:0,esp:tr.memorySize,eip:0};decoder=new He;memory=We.cloneDeep(Xe);registers=We.cloneDeep(this.initialRegisters);tables=We.cloneDeep(qe);executionStatus=We.cloneDeep($e);peakMemoryUsage=We.cloneDeep(Ze);options=We.cloneDeep(tr);executionStartTime=new Date;writeBuffer=[];readConsole=()=>Promise.resolve("");entryFunctionName="main";setReadConsoleFn(t){this.readConsole=t}getSingleVariableValues(t){const e=[];for(let r=t.address;r=this.memory.text.length?-1:this.memory.text[this.registers.eip].lineNumber}get instructions(){return this.memory.instructions}get globalVariableDetails(){return this.getSingleTableVariableDetails(this.tables.globalVariableTable)}get localVariableDetailsStack(){const t=[];for(let e=0;e(t=Math.max(t,e.min),t=Math.min(t,e.max));void 0!==t.maxExecutionStepCount&&(t.maxExecutionStepCount=e(t.maxExecutionStepCount,Je.maxExecutionStepCount),this.options.maxExecutionStepCount=t.maxExecutionStepCount),void 0!==t.memorySize&&(t.memorySize=e(t.memorySize,Je.memorySize),t.memorySize=e(t.memorySize,{min:this.options.stackSize,max:Je.memorySize.max}),this.options.memorySize=t.memorySize,this.initialRegisters.esp=Le(t.memorySize),this.registers.esp=Le(t.memorySize),this.updatePeakMemoryUsage()),void 0!==t.stackSize&&(t.stackSize=e(t.stackSize,Je.stackSize),t.stackSize=e(t.stackSize,{min:Je.stackSize.min,max:this.options.memorySize}),this.options.stackSize=t.stackSize)}reset(){this.memory.text=[],this.memory.memory=new Uint8Array,this.registers=We.cloneDeep(this.initialRegisters),this.tables=We.cloneDeep(qe),this.executionStatus=We.cloneDeep($e),this.peakMemoryUsage=We.cloneDeep(Ze),this.writeBuffer=[]}close(){this.executionStatus.state=Ye.CLOSED}loadNewInstructions(t){this.reset(),this.memory.instructions=t}loadAndDecodeNewInstructions(t){this.loadNewInstructions(t),this.decodeInstructions(!0)}decodeInstructions(t){const e=new Map,r=new Map;for(let n=0;nr.length?we.OUT_OF_BOUND:(r[e]=255&t,r[e+1]=(65280&t)>>>8,r[e+2]=(16711680&t)>>>16,r[e+3]=(4278190080&t)>>>24,we.SUCCESS)}(t,e,this.memory.memory);return r!==we.OUT_OF_BOUND||(this.writeRuntimeError({key:"MEMORY_WRITE_OUT_OF_BOUND",values:{address:e}}),!1)}pushl(t){return this.checkStackSize(4)?(this.registers.esp=Oe(this.registers.esp,4),this.updatePeakMemoryUsage(),!!this.storeMemory32(t,this.registers.esp)):(this.writeRuntimeError({key:"STACK_OVERFLOW"}),!1)}popl(){const t=this.loadMemory32(this.registers.esp);return null===t?null:(this.registers.esp=Se(this.registers.esp,4),this.updatePeakMemoryUsage(),t)}getVariableById(t,e){return 0===this.tables.variableTableStack.length?(this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"}),null):t in this.tables.variableTableStack[this.tables.variableTableStack.length-1]?this.tables.variableTableStack[this.tables.variableTableStack.length-1][t]:t in this.tables.globalVariableTable?this.tables.globalVariableTable[t]:(e&&this.writeRuntimeError({key:"VARIABLE_NOT_FOUND",values:{id:t}}),null)}getSingularValue(t){if(t.type===Ce.IMM)return t.imm;{const e=this.getVariableById(t.id,!0);if(null===e)return null;if(t.type===Ce.ADDRESS_ID)return e.address;const r=this.loadMemory32(e.address);if(null===r)return null;if(t.type===Ce.ID)return r;const n=this.loadMemory32(r);return null===n?null:n}}getRValue(t){switch(t.type){case Pe.SINGULAR:return this.getSingularValue(t.singular);case Pe.BINARY_MATH_OP:{const e=this.getSingularValue(t.singularL);if(null===e)return null;const r=this.getSingularValue(t.singularR);if(null===r)return null;switch(t.binaryMathOp){case De.ADD:return Se(e,r);case De.SUB:return Oe(e,r);case De.MUL:return function(t,e){const r=65535&t,n=65535&e;return Le((((4294901760&t)>>>16)*n+r*((4294901760&e)>>>16)<<16)+r*n)}(e,r);case De.DIV:return 0===r?(this.writeRuntimeError({key:"DIVIDE_BY_ZERO"}),null):Le(e/r)}}}}createStackVariable(t,e){if(!this.checkStackSize(e))return this.writeRuntimeError({key:"STACK_OVERFLOW"}),null;const r=this.memory.text[this.registers.eip].lineNumber;if(t in this.tables.variableTableStack[this.tables.variableTableStack.length-1])return this.tables.variableTableStack[this.tables.variableTableStack.length-1][t].lineNumber!==r?(this.writeRuntimeError({key:"DUPLICATE_DEC_ID",values:{id:t,lastLineNumber:this.tables.variableTableStack[this.tables.variableTableStack.length-1][t].lineNumber}}),null):this.tables.variableTableStack[this.tables.variableTableStack.length-1][t];this.registers.esp=Oe(this.registers.esp,e),this.updatePeakMemoryUsage();const n={address:this.registers.esp,size:e,lineNumber:r};return 0===this.tables.variableTableStack.length?(this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"}),null):(this.tables.variableTableStack[this.tables.variableTableStack.length-1][t]=n,n)}getLValueAddress(t){let e=this.getVariableById(t.id,t.type===Be.DEREF_ID);if(null===e){if(t.type!==Be.ID)return null;if(e=this.createStackVariable(t.id,4),null===e)return null}let r=e.address;if(t.type===Be.DEREF_ID){const t=this.loadMemory32(e.address);if(null===t)return null;r=t}return r}getCondValue(t){const e=this.getSingularValue(t.singularL);if(null===e)return null;const r=this.getSingularValue(t.singularR);if(null===r)return null;switch(t.binaryRelOp){case Me.EQ:return e===r;case Me.NE:return e!==r;case Me.LT:return er;case Me.GE:return e>=r}}async execute(t){do{if(this.executionStatus.state!==Ye.EXITED_NORMALLY&&this.executionStatus.state!==Ye.EXITED_ABNORMALLY&&this.executionStatus.state!==Ye.INITIAL||(this.reset(),this.prepareExcution()),this.executionStatus.state!==Ye.FREE)return;if(this.executionStatus.state=Ye.BUSY,this.options.maxExecutionStepCount>0&&this.executionStatus.stepCount>=this.options.maxExecutionStepCount)return this.executionStatus.state=Ye.MAX_STEP_REACHED,void this.writeBuffer.push([{key:"MAX_STEP_REACHED",values:{maxExecutionStepCount:this.options.maxExecutionStepCount},type:Qe.ERROR}]);if(this.registers.eip>=this.memory.text.length||this.registers.eip<0)return this.executionStatus.state=Ye.RUNTIME_ERROR,void this.writeBuffer.push([{key:"RUNTIME_ERROR_PREFIX_NO_LN",type:Qe.ERROR},{key:"INSTRUCTION_READ_OUT_OF_BOUND",values:{address:this.registers.eip},type:Qe.ERROR}]);this.executionStatus.stepCount++;const t=this.memory.text[this.registers.eip];switch(t.type){case Ue.ARG:{const e=this.getSingularValue(t.value.value);if(null===e||!this.pushl(e))return;this.registers.ecx=Se(this.registers.ecx,4);break}case Ue.ASSIGN:{const e=this.getRValue(t.value.rValue);if(null===e)return;const r=this.getLValueAddress(t.value.lValue);if(null===r)return;if(!this.storeMemory32(e,r))return;break}case Ue.ASSIGN_CALL:case Ue.CALL:{const e=t.type===Ue.CALL?t.value.id:t.value.functionId;if(this.registers.ebx=this.registers.esp,!this.pushl(this.registers.ecx))return;if(this.registers.ecx=0,!this.pushl(this.registers.eip))return;if(!this.pushl(this.registers.ebp))return;this.registers.ebp=this.registers.esp,t.type===Ue.ASSIGN_CALL?this.tables.assignCallLValueStack.push(t.value.lValue):this.tables.assignCallLValueStack.push(null),this.tables.variableTableStack.push({}),this.executionStatus.callStack.push(e),this.registers.eip=t.value.functionAddressBefore;break}case Ue.DEC:if(null===this.createStackVariable(t.value.id,t.value.size))return;break;case Ue.GOTO:this.registers.eip=t.value.gotoAddressBefore;break;case Ue.IF:{const e=this.getCondValue(t.value.condition);if(null===e)return;e&&(this.registers.eip=t.value.gotoAddressBefore);break}case Ue.PARAM:{const e=t.value.id;if(e in this.tables.variableTableStack[this.tables.variableTableStack.length-1])return void this.writeRuntimeError({key:"DUPLICATE_PARAM_ID",values:{id:e,lastLineNumber:this.tables.variableTableStack[this.tables.variableTableStack.length-1][e].lineNumber}});if(null===this.loadMemory32(this.registers.ebx))return;this.tables.variableTableStack[this.tables.variableTableStack.length-1][e]={address:this.registers.ebx,size:4,lineNumber:t.lineNumber},this.registers.ebx=Se(this.registers.ebx,4);break}case Ue.RETURN:{const e=this.getSingularValue(t.value.value);if(null===e)return;this.registers.eax=e,this.registers.esp=this.registers.ebp,this.updatePeakMemoryUsage();const r=this.popl();if(null===r)return;this.registers.ebp=r;const n=this.popl();if(null===n)return;this.registers.eip=n;const i=this.popl();if(null===i)return;if(this.registers.esp=Se(this.registers.esp,i),this.updatePeakMemoryUsage(),this.registers.ecx=0,0===this.tables.variableTableStack.length)return void this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"});if(this.executionStatus.callStack.pop(),this.tables.variableTableStack.pop(),this.registers.eip===this.memory.text.length)return void this.finalizeExcution();const s=this.tables.assignCallLValueStack.pop();if(null!==s){const t=this.getLValueAddress(s);if(null===t)return;if(!this.storeMemory32(this.registers.eax,t))return}break}case Ue.READ:{const e=t.value,r=this.getLValueAddress(e.lValue);if(null===r)return;const n=e.lValue.type===Be.ID?e.lValue.id:"*"+e.lValue.id;this.executionStatus.state=Ye.WAIT_INPUT;const i=await this.readConsole([{key:"READ_PROMPT",values:{name:n}}]);if(this.state!==Ye.WAIT_INPUT)return;this.executionStatus.state=Ye.BUSY;const s=parseInt(i);if(isNaN(s))return void this.writeRuntimeError({key:"INPUT_INT_ILLEGAL"});if(!Number.isSafeInteger(s))return void this.writeRuntimeError({key:"INPUT_INT_ABS_TOO_LARGE"});if(!this.storeMemory32(Le(s),r))return;break}case Ue.WRITE:{const e=this.getSingularValue(t.value.value);if(null===e)return;this.writeBuffer.push([{key:"WRITE_OUTPUT",values:{value:e},type:Qe.OUTPUT}]);break}}for(this.registers.eip=Se(this.registers.eip,1);this.registers.eip=0&&this.memory.text[this.registers.eip].type===Ue.GLOBAL_DEC;)this.registers.eip=Se(this.registers.eip,1);this.executionStatus.state=Ye.FREE}while(t)}async executeSingleStep(){await this.execute(!1)}async executeContinuously(){await this.execute(!0)}};ur.configure({maxExecutionStepCount:0,memorySize:32*Ke,stackSize:16*Ke});const lr=[];let cr=0,hr=null;sr.on("line",(t=>{const e=t.trim().split(/\s/).filter((t=>t.length>0));lr.push(...e),null!==hr&&cr(ar(),rr.prompt&&console.log(t.reduce(((t,e)=>t+ir.formatMessage({id:e.key},e.values)),"")),cr{hr=t}))))),ur.loadNewInstructions(or.split(/\r\n|[\r\n]/)),await ur.executeContinuously(),ar(),rr.stepCount&&console.log(ur.stepCount),rr.timeElapsed&&console.log(ur.timeElapsed);const fr=ur.state;switch(ur.close(),fr){case Ye.EXITED_NORMALLY:process.exit(0);case Ye.EXITED_ABNORMALLY:process.exit(ur.returnValue);case Ye.STATIC_CHECK_FAILED:case Ye.RUNTIME_ERROR:process.exit(1)} diff --git a/docs/assets/cssMode-c20b4059.js b/docs/assets/cssMode-67b982ab.js similarity index 99% rename from docs/assets/cssMode-c20b4059.js rename to docs/assets/cssMode-67b982ab.js index 961ebb7..5334ed3 100644 --- a/docs/assets/cssMode-c20b4059.js +++ b/docs/assets/cssMode-67b982ab.js @@ -1,4 +1,4 @@ -import{m as je}from"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{m as je}from"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/freemarker2-6df495c3.js b/docs/assets/freemarker2-56aebadc.js similarity index 99% rename from docs/assets/freemarker2-6df495c3.js rename to docs/assets/freemarker2-56aebadc.js index 93e6b90..3db10c9 100644 --- a/docs/assets/freemarker2-6df495c3.js +++ b/docs/assets/freemarker2-56aebadc.js @@ -1,4 +1,4 @@ -import{m as F}from"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{m as F}from"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/handlebars-57fde516.js b/docs/assets/handlebars-5888b9b7.js similarity index 99% rename from docs/assets/handlebars-57fde516.js rename to docs/assets/handlebars-5888b9b7.js index 9436153..fb52120 100644 --- a/docs/assets/handlebars-57fde516.js +++ b/docs/assets/handlebars-5888b9b7.js @@ -1,4 +1,4 @@ -import{m as i}from"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/html-f9ec217a.js b/docs/assets/html-ad157992.js similarity index 98% rename from docs/assets/html-f9ec217a.js rename to docs/assets/html-ad157992.js index 3d0023a..5f5ae71 100644 --- a/docs/assets/html-f9ec217a.js +++ b/docs/assets/html-ad157992.js @@ -1,4 +1,4 @@ -import{m as d}from"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/htmlMode-a02b4db6.js b/docs/assets/htmlMode-639cee69.js similarity index 99% rename from docs/assets/htmlMode-a02b4db6.js rename to docs/assets/htmlMode-639cee69.js index fd6a265..b830395 100644 --- a/docs/assets/htmlMode-a02b4db6.js +++ b/docs/assets/htmlMode-639cee69.js @@ -1,4 +1,4 @@ -import{m as qe}from"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{m as qe}from"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/index-0f719e36.js b/docs/assets/index-650b196f.js similarity index 99% rename from docs/assets/index-0f719e36.js rename to docs/assets/index-650b196f.js index d445150..cdb2bda 100644 --- a/docs/assets/index-0f719e36.js +++ b/docs/assets/index-650b196f.js @@ -750,22 +750,22 @@ ${e.toString()}`}}class tO{constructor(e=new Kk,t=!1,n,r=cZe){var o;this._servic * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Det=Object.defineProperty,Iet=Object.getOwnPropertyDescriptor,ket=Object.getOwnPropertyNames,Tet=Object.prototype.hasOwnProperty,aae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ket(e))!Tet.call(i,r)&&r!==t&&Det(i,r,{get:()=>e[r],enumerable:!(n=Iet(e,r))||n.enumerable});return i},Net=(i,e,t)=>(aae(i,e,"default"),t&&aae(t,e,"default")),BL={};Net(BL,w3);var _be={},y9={},Ret=class bbe{static getOrCreate(e){return y9[e]||(y9[e]=new bbe(e)),y9[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,n)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=n})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,_be[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function kt(i){const e=i.id;_be[e]=i,BL.languages.register(i);const t=Ret.getOrCreate(e);BL.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),BL.languages.onLanguageEncountered(e,async()=>{const n=await t.load();BL.languages.setLanguageConfiguration(e,n.conf)})}kt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Dt(()=>import("./abap-ad6e811d.js"),[])});kt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Dt(()=>import("./apex-992ba105.js"),[])});kt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Dt(()=>import("./azcli-2ae42e71.js"),[])});kt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Dt(()=>import("./bat-638cac0f.js"),[])});kt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Dt(()=>import("./bicep-389290ac.js"),[])});kt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Dt(()=>import("./cameligo-e2b87a47.js"),[])});kt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Dt(()=>import("./clojure-9f651a27.js"),[])});kt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Dt(()=>import("./coffee-4e075114.js"),[])});kt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Dt(()=>import("./cpp-8ffe77ae.js"),[])});kt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Dt(()=>import("./cpp-8ffe77ae.js"),[])});kt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Dt(()=>import("./csharp-0b267c6b.js"),[])});kt({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>Dt(()=>import("./csp-c23415e1.js"),[])});kt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Dt(()=>import("./css-c62f5578.js"),[])});kt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>Dt(()=>import("./cypher-16871f29.js"),[])});kt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Dt(()=>import("./dart-20618e99.js"),[])});kt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Dt(()=>import("./dockerfile-13942c6d.js"),[])});kt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Dt(()=>import("./ecl-82a13cc7.js"),[])});kt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Dt(()=>import("./elixir-941d33da.js"),[])});kt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Dt(()=>import("./flow9-82e25a0d.js"),[])});kt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Dt(()=>import("./fsharp-930eb6d7.js"),[])});kt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Dt(()=>import("./freemarker2-6df495c3.js"),[]).then(i=>i.TagAutoInterpolationDollar)});kt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Dt(()=>import("./freemarker2-6df495c3.js"),[]).then(i=>i.TagAngleInterpolationDollar)});kt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Dt(()=>import("./freemarker2-6df495c3.js"),[]).then(i=>i.TagBracketInterpolationDollar)});kt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Dt(()=>import("./freemarker2-6df495c3.js"),[]).then(i=>i.TagAngleInterpolationBracket)});kt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Dt(()=>import("./freemarker2-6df495c3.js"),[]).then(i=>i.TagBracketInterpolationBracket)});kt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Dt(()=>import("./freemarker2-6df495c3.js"),[]).then(i=>i.TagAutoInterpolationDollar)});kt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Dt(()=>import("./freemarker2-6df495c3.js"),[]).then(i=>i.TagAutoInterpolationBracket)});kt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>Dt(()=>import("./go-ace823b2.js"),[])});kt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>Dt(()=>import("./graphql-9395e6dd.js"),[])});kt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Dt(()=>import("./handlebars-57fde516.js"),[])});kt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>Dt(()=>import("./hcl-4160620f.js"),[])});kt({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>Dt(()=>import("./html-f9ec217a.js"),[])});kt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>Dt(()=>import("./ini-1cc2fa96.js"),[])});kt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>Dt(()=>import("./java-fe979474.js"),[])});kt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Dt(()=>import("./javascript-e355c851.js"),["assets/javascript-e355c851.js","assets/typescript-0713de27.js"])});kt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>Dt(()=>import("./julia-1a2d9387.js"),[])});kt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>Dt(()=>import("./kotlin-45b3a4f3.js"),[])});kt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>Dt(()=>import("./less-a184ed1c.js"),[])});kt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>Dt(()=>import("./lexon-ebf376fd.js"),[])});kt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>Dt(()=>import("./lua-666d20d5.js"),[])});kt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Dt(()=>import("./liquid-8ad1f6f1.js"),[])});kt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>Dt(()=>import("./m3-bbbbbca9.js"),[])});kt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>Dt(()=>import("./markdown-5de2301d.js"),[])});kt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Dt(()=>import("./mdx-66407150.js"),[])});kt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>Dt(()=>import("./mips-7b46d093.js"),[])});kt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>Dt(()=>import("./msdax-295c0d3c.js"),[])});kt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>Dt(()=>import("./mysql-28fc43b5.js"),[])});kt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>Dt(()=>import("./objective-c-5f7f7623.js"),[])});kt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>Dt(()=>import("./pascal-830d8a16.js"),[])});kt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>Dt(()=>import("./pascaligo-ff6a611d.js"),[])});kt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>Dt(()=>import("./perl-0c4cf450.js"),[])});kt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>Dt(()=>import("./pgsql-85eb1e14.js"),[])});kt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>Dt(()=>import("./php-571f6521.js"),[])});kt({id:"pla",extensions:[".pla"],loader:()=>Dt(()=>import("./pla-5e6cd4d5.js"),[])});kt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>Dt(()=>import("./postiats-4d02d044.js"),[])});kt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>Dt(()=>import("./powerquery-c6baddff.js"),[])});kt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>Dt(()=>import("./powershell-8bfccb2f.js"),[])});kt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>Dt(()=>import("./protobuf-7c245adb.js"),[])});kt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>Dt(()=>import("./pug-e0d77a81.js"),[])});kt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Dt(()=>import("./python-675f20c3.js"),[])});kt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>Dt(()=>import("./qsharp-560af9ec.js"),[])});kt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>Dt(()=>import("./r-96b98db0.js"),[])});kt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Dt(()=>import("./razor-6002a854.js"),[])});kt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>Dt(()=>import("./redis-2313a258.js"),[])});kt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>Dt(()=>import("./redshift-e81279f9.js"),[])});kt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>Dt(()=>import("./restructuredtext-23e36e2c.js"),[])});kt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>Dt(()=>import("./ruby-6e5b4752.js"),[])});kt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>Dt(()=>import("./rust-c4e1d9a9.js"),[])});kt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>Dt(()=>import("./sb-095651a8.js"),[])});kt({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>Dt(()=>import("./scala-dfd2c035.js"),[])});kt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>Dt(()=>import("./scheme-4bd59040.js"),[])});kt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>Dt(()=>import("./scss-0b769ec8.js"),[])});kt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>Dt(()=>import("./shell-5fa60225.js"),[])});kt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>Dt(()=>import("./solidity-3efd84d4.js"),[])});kt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>Dt(()=>import("./sophia-156a057a.js"),[])});kt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>Dt(()=>import("./sparql-25a61c8a.js"),[])});kt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>Dt(()=>import("./sql-ef431720.js"),[])});kt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>Dt(()=>import("./st-06071006.js"),[])});kt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>Dt(()=>import("./swift-941c2e3c.js"),[])});kt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>Dt(()=>import("./systemverilog-dc0c3813.js"),[])});kt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>Dt(()=>import("./systemverilog-dc0c3813.js"),[])});kt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>Dt(()=>import("./tcl-cc963d5c.js"),[])});kt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>Dt(()=>import("./twig-cdf47909.js"),[])});kt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Dt(()=>import("./typescript-0713de27.js"),[])});kt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>Dt(()=>import("./vb-3ff3c116.js"),[])});kt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>Dt(()=>import("./wgsl-7be617f0.js"),[])});kt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\Dt(()=>import("./xml-2867d133.js"),[])});kt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Dt(()=>import("./yaml-a4b03d68.js"),[])});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Det=Object.defineProperty,Iet=Object.getOwnPropertyDescriptor,ket=Object.getOwnPropertyNames,Tet=Object.prototype.hasOwnProperty,aae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ket(e))!Tet.call(i,r)&&r!==t&&Det(i,r,{get:()=>e[r],enumerable:!(n=Iet(e,r))||n.enumerable});return i},Net=(i,e,t)=>(aae(i,e,"default"),t&&aae(t,e,"default")),BL={};Net(BL,w3);var _be={},y9={},Ret=class bbe{static getOrCreate(e){return y9[e]||(y9[e]=new bbe(e)),y9[e]}constructor(e){this._languageId=e,this._loadingTriggered=!1,this._lazyLoadPromise=new Promise((t,n)=>{this._lazyLoadPromiseResolve=t,this._lazyLoadPromiseReject=n})}load(){return this._loadingTriggered||(this._loadingTriggered=!0,_be[this._languageId].loader().then(e=>this._lazyLoadPromiseResolve(e),e=>this._lazyLoadPromiseReject(e))),this._lazyLoadPromise}};function kt(i){const e=i.id;_be[e]=i,BL.languages.register(i);const t=Ret.getOrCreate(e);BL.languages.registerTokensProviderFactory(e,{create:async()=>(await t.load()).language}),BL.languages.onLanguageEncountered(e,async()=>{const n=await t.load();BL.languages.setLanguageConfiguration(e,n.conf)})}kt({id:"abap",extensions:[".abap"],aliases:["abap","ABAP"],loader:()=>Dt(()=>import("./abap-ad6e811d.js"),[])});kt({id:"apex",extensions:[".cls"],aliases:["Apex","apex"],mimetypes:["text/x-apex-source","text/x-apex"],loader:()=>Dt(()=>import("./apex-992ba105.js"),[])});kt({id:"azcli",extensions:[".azcli"],aliases:["Azure CLI","azcli"],loader:()=>Dt(()=>import("./azcli-2ae42e71.js"),[])});kt({id:"bat",extensions:[".bat",".cmd"],aliases:["Batch","bat"],loader:()=>Dt(()=>import("./bat-638cac0f.js"),[])});kt({id:"bicep",extensions:[".bicep"],aliases:["Bicep"],loader:()=>Dt(()=>import("./bicep-389290ac.js"),[])});kt({id:"cameligo",extensions:[".mligo"],aliases:["Cameligo"],loader:()=>Dt(()=>import("./cameligo-e2b87a47.js"),[])});kt({id:"clojure",extensions:[".clj",".cljs",".cljc",".edn"],aliases:["clojure","Clojure"],loader:()=>Dt(()=>import("./clojure-9f651a27.js"),[])});kt({id:"coffeescript",extensions:[".coffee"],aliases:["CoffeeScript","coffeescript","coffee"],mimetypes:["text/x-coffeescript","text/coffeescript"],loader:()=>Dt(()=>import("./coffee-4e075114.js"),[])});kt({id:"c",extensions:[".c",".h"],aliases:["C","c"],loader:()=>Dt(()=>import("./cpp-8ffe77ae.js"),[])});kt({id:"cpp",extensions:[".cpp",".cc",".cxx",".hpp",".hh",".hxx"],aliases:["C++","Cpp","cpp"],loader:()=>Dt(()=>import("./cpp-8ffe77ae.js"),[])});kt({id:"csharp",extensions:[".cs",".csx",".cake"],aliases:["C#","csharp"],loader:()=>Dt(()=>import("./csharp-0b267c6b.js"),[])});kt({id:"csp",extensions:[],aliases:["CSP","csp"],loader:()=>Dt(()=>import("./csp-c23415e1.js"),[])});kt({id:"css",extensions:[".css"],aliases:["CSS","css"],mimetypes:["text/css"],loader:()=>Dt(()=>import("./css-c62f5578.js"),[])});kt({id:"cypher",extensions:[".cypher",".cyp"],aliases:["Cypher","OpenCypher"],loader:()=>Dt(()=>import("./cypher-16871f29.js"),[])});kt({id:"dart",extensions:[".dart"],aliases:["Dart","dart"],mimetypes:["text/x-dart-source","text/x-dart"],loader:()=>Dt(()=>import("./dart-20618e99.js"),[])});kt({id:"dockerfile",extensions:[".dockerfile"],filenames:["Dockerfile"],aliases:["Dockerfile"],loader:()=>Dt(()=>import("./dockerfile-13942c6d.js"),[])});kt({id:"ecl",extensions:[".ecl"],aliases:["ECL","Ecl","ecl"],loader:()=>Dt(()=>import("./ecl-82a13cc7.js"),[])});kt({id:"elixir",extensions:[".ex",".exs"],aliases:["Elixir","elixir","ex"],loader:()=>Dt(()=>import("./elixir-941d33da.js"),[])});kt({id:"flow9",extensions:[".flow"],aliases:["Flow9","Flow","flow9","flow"],loader:()=>Dt(()=>import("./flow9-82e25a0d.js"),[])});kt({id:"fsharp",extensions:[".fs",".fsi",".ml",".mli",".fsx",".fsscript"],aliases:["F#","FSharp","fsharp"],loader:()=>Dt(()=>import("./fsharp-930eb6d7.js"),[])});kt({id:"freemarker2",extensions:[".ftl",".ftlh",".ftlx"],aliases:["FreeMarker2","Apache FreeMarker2"],loader:()=>Dt(()=>import("./freemarker2-56aebadc.js"),[]).then(i=>i.TagAutoInterpolationDollar)});kt({id:"freemarker2.tag-angle.interpolation-dollar",aliases:["FreeMarker2 (Angle/Dollar)","Apache FreeMarker2 (Angle/Dollar)"],loader:()=>Dt(()=>import("./freemarker2-56aebadc.js"),[]).then(i=>i.TagAngleInterpolationDollar)});kt({id:"freemarker2.tag-bracket.interpolation-dollar",aliases:["FreeMarker2 (Bracket/Dollar)","Apache FreeMarker2 (Bracket/Dollar)"],loader:()=>Dt(()=>import("./freemarker2-56aebadc.js"),[]).then(i=>i.TagBracketInterpolationDollar)});kt({id:"freemarker2.tag-angle.interpolation-bracket",aliases:["FreeMarker2 (Angle/Bracket)","Apache FreeMarker2 (Angle/Bracket)"],loader:()=>Dt(()=>import("./freemarker2-56aebadc.js"),[]).then(i=>i.TagAngleInterpolationBracket)});kt({id:"freemarker2.tag-bracket.interpolation-bracket",aliases:["FreeMarker2 (Bracket/Bracket)","Apache FreeMarker2 (Bracket/Bracket)"],loader:()=>Dt(()=>import("./freemarker2-56aebadc.js"),[]).then(i=>i.TagBracketInterpolationBracket)});kt({id:"freemarker2.tag-auto.interpolation-dollar",aliases:["FreeMarker2 (Auto/Dollar)","Apache FreeMarker2 (Auto/Dollar)"],loader:()=>Dt(()=>import("./freemarker2-56aebadc.js"),[]).then(i=>i.TagAutoInterpolationDollar)});kt({id:"freemarker2.tag-auto.interpolation-bracket",aliases:["FreeMarker2 (Auto/Bracket)","Apache FreeMarker2 (Auto/Bracket)"],loader:()=>Dt(()=>import("./freemarker2-56aebadc.js"),[]).then(i=>i.TagAutoInterpolationBracket)});kt({id:"go",extensions:[".go"],aliases:["Go"],loader:()=>Dt(()=>import("./go-ace823b2.js"),[])});kt({id:"graphql",extensions:[".graphql",".gql"],aliases:["GraphQL","graphql","gql"],mimetypes:["application/graphql"],loader:()=>Dt(()=>import("./graphql-9395e6dd.js"),[])});kt({id:"handlebars",extensions:[".handlebars",".hbs"],aliases:["Handlebars","handlebars","hbs"],mimetypes:["text/x-handlebars-template"],loader:()=>Dt(()=>import("./handlebars-5888b9b7.js"),[])});kt({id:"hcl",extensions:[".tf",".tfvars",".hcl"],aliases:["Terraform","tf","HCL","hcl"],loader:()=>Dt(()=>import("./hcl-4160620f.js"),[])});kt({id:"html",extensions:[".html",".htm",".shtml",".xhtml",".mdoc",".jsp",".asp",".aspx",".jshtm"],aliases:["HTML","htm","html","xhtml"],mimetypes:["text/html","text/x-jshtm","text/template","text/ng-template"],loader:()=>Dt(()=>import("./html-ad157992.js"),[])});kt({id:"ini",extensions:[".ini",".properties",".gitconfig"],filenames:["config",".gitattributes",".gitconfig",".editorconfig"],aliases:["Ini","ini"],loader:()=>Dt(()=>import("./ini-1cc2fa96.js"),[])});kt({id:"java",extensions:[".java",".jav"],aliases:["Java","java"],mimetypes:["text/x-java-source","text/x-java"],loader:()=>Dt(()=>import("./java-fe979474.js"),[])});kt({id:"javascript",extensions:[".js",".es6",".jsx",".mjs",".cjs"],firstLine:"^#!.*\\bnode",filenames:["jakefile"],aliases:["JavaScript","javascript","js"],mimetypes:["text/javascript"],loader:()=>Dt(()=>import("./javascript-603c281f.js"),["assets/javascript-603c281f.js","assets/typescript-54992499.js"])});kt({id:"julia",extensions:[".jl"],aliases:["julia","Julia"],loader:()=>Dt(()=>import("./julia-1a2d9387.js"),[])});kt({id:"kotlin",extensions:[".kt",".kts"],aliases:["Kotlin","kotlin"],mimetypes:["text/x-kotlin-source","text/x-kotlin"],loader:()=>Dt(()=>import("./kotlin-45b3a4f3.js"),[])});kt({id:"less",extensions:[".less"],aliases:["Less","less"],mimetypes:["text/x-less","text/less"],loader:()=>Dt(()=>import("./less-a184ed1c.js"),[])});kt({id:"lexon",extensions:[".lex"],aliases:["Lexon"],loader:()=>Dt(()=>import("./lexon-ebf376fd.js"),[])});kt({id:"lua",extensions:[".lua"],aliases:["Lua","lua"],loader:()=>Dt(()=>import("./lua-666d20d5.js"),[])});kt({id:"liquid",extensions:[".liquid",".html.liquid"],aliases:["Liquid","liquid"],mimetypes:["application/liquid"],loader:()=>Dt(()=>import("./liquid-9f7a360d.js"),[])});kt({id:"m3",extensions:[".m3",".i3",".mg",".ig"],aliases:["Modula-3","Modula3","modula3","m3"],loader:()=>Dt(()=>import("./m3-bbbbbca9.js"),[])});kt({id:"markdown",extensions:[".md",".markdown",".mdown",".mkdn",".mkd",".mdwn",".mdtxt",".mdtext"],aliases:["Markdown","markdown"],loader:()=>Dt(()=>import("./markdown-5de2301d.js"),[])});kt({id:"mdx",extensions:[".mdx"],aliases:["MDX","mdx"],loader:()=>Dt(()=>import("./mdx-da5b6492.js"),[])});kt({id:"mips",extensions:[".s"],aliases:["MIPS","MIPS-V"],mimetypes:["text/x-mips","text/mips","text/plaintext"],loader:()=>Dt(()=>import("./mips-7b46d093.js"),[])});kt({id:"msdax",extensions:[".dax",".msdax"],aliases:["DAX","MSDAX"],loader:()=>Dt(()=>import("./msdax-295c0d3c.js"),[])});kt({id:"mysql",extensions:[],aliases:["MySQL","mysql"],loader:()=>Dt(()=>import("./mysql-28fc43b5.js"),[])});kt({id:"objective-c",extensions:[".m"],aliases:["Objective-C"],loader:()=>Dt(()=>import("./objective-c-5f7f7623.js"),[])});kt({id:"pascal",extensions:[".pas",".p",".pp"],aliases:["Pascal","pas"],mimetypes:["text/x-pascal-source","text/x-pascal"],loader:()=>Dt(()=>import("./pascal-830d8a16.js"),[])});kt({id:"pascaligo",extensions:[".ligo"],aliases:["Pascaligo","ligo"],loader:()=>Dt(()=>import("./pascaligo-ff6a611d.js"),[])});kt({id:"perl",extensions:[".pl",".pm"],aliases:["Perl","pl"],loader:()=>Dt(()=>import("./perl-0c4cf450.js"),[])});kt({id:"pgsql",extensions:[],aliases:["PostgreSQL","postgres","pg","postgre"],loader:()=>Dt(()=>import("./pgsql-85eb1e14.js"),[])});kt({id:"php",extensions:[".php",".php4",".php5",".phtml",".ctp"],aliases:["PHP","php"],mimetypes:["application/x-php"],loader:()=>Dt(()=>import("./php-571f6521.js"),[])});kt({id:"pla",extensions:[".pla"],loader:()=>Dt(()=>import("./pla-5e6cd4d5.js"),[])});kt({id:"postiats",extensions:[".dats",".sats",".hats"],aliases:["ATS","ATS/Postiats"],loader:()=>Dt(()=>import("./postiats-4d02d044.js"),[])});kt({id:"powerquery",extensions:[".pq",".pqm"],aliases:["PQ","M","Power Query","Power Query M"],loader:()=>Dt(()=>import("./powerquery-c6baddff.js"),[])});kt({id:"powershell",extensions:[".ps1",".psm1",".psd1"],aliases:["PowerShell","powershell","ps","ps1"],loader:()=>Dt(()=>import("./powershell-8bfccb2f.js"),[])});kt({id:"proto",extensions:[".proto"],aliases:["protobuf","Protocol Buffers"],loader:()=>Dt(()=>import("./protobuf-7c245adb.js"),[])});kt({id:"pug",extensions:[".jade",".pug"],aliases:["Pug","Jade","jade"],loader:()=>Dt(()=>import("./pug-e0d77a81.js"),[])});kt({id:"python",extensions:[".py",".rpy",".pyw",".cpy",".gyp",".gypi"],aliases:["Python","py"],firstLine:"^#!/.*\\bpython[0-9.-]*\\b",loader:()=>Dt(()=>import("./python-289fae18.js"),[])});kt({id:"qsharp",extensions:[".qs"],aliases:["Q#","qsharp"],loader:()=>Dt(()=>import("./qsharp-560af9ec.js"),[])});kt({id:"r",extensions:[".r",".rhistory",".rmd",".rprofile",".rt"],aliases:["R","r"],loader:()=>Dt(()=>import("./r-96b98db0.js"),[])});kt({id:"razor",extensions:[".cshtml"],aliases:["Razor","razor"],mimetypes:["text/x-cshtml"],loader:()=>Dt(()=>import("./razor-97daa2a2.js"),[])});kt({id:"redis",extensions:[".redis"],aliases:["redis"],loader:()=>Dt(()=>import("./redis-2313a258.js"),[])});kt({id:"redshift",extensions:[],aliases:["Redshift","redshift"],loader:()=>Dt(()=>import("./redshift-e81279f9.js"),[])});kt({id:"restructuredtext",extensions:[".rst"],aliases:["reStructuredText","restructuredtext"],loader:()=>Dt(()=>import("./restructuredtext-23e36e2c.js"),[])});kt({id:"ruby",extensions:[".rb",".rbx",".rjs",".gemspec",".pp"],filenames:["rakefile","Gemfile"],aliases:["Ruby","rb"],loader:()=>Dt(()=>import("./ruby-6e5b4752.js"),[])});kt({id:"rust",extensions:[".rs",".rlib"],aliases:["Rust","rust"],loader:()=>Dt(()=>import("./rust-c4e1d9a9.js"),[])});kt({id:"sb",extensions:[".sb"],aliases:["Small Basic","sb"],loader:()=>Dt(()=>import("./sb-095651a8.js"),[])});kt({id:"scala",extensions:[".scala",".sc",".sbt"],aliases:["Scala","scala","SBT","Sbt","sbt","Dotty","dotty"],mimetypes:["text/x-scala-source","text/x-scala","text/x-sbt","text/x-dotty"],loader:()=>Dt(()=>import("./scala-dfd2c035.js"),[])});kt({id:"scheme",extensions:[".scm",".ss",".sch",".rkt"],aliases:["scheme","Scheme"],loader:()=>Dt(()=>import("./scheme-4bd59040.js"),[])});kt({id:"scss",extensions:[".scss"],aliases:["Sass","sass","scss"],mimetypes:["text/x-scss","text/scss"],loader:()=>Dt(()=>import("./scss-0b769ec8.js"),[])});kt({id:"shell",extensions:[".sh",".bash"],aliases:["Shell","sh"],loader:()=>Dt(()=>import("./shell-5fa60225.js"),[])});kt({id:"sol",extensions:[".sol"],aliases:["sol","solidity","Solidity"],loader:()=>Dt(()=>import("./solidity-3efd84d4.js"),[])});kt({id:"aes",extensions:[".aes"],aliases:["aes","sophia","Sophia"],loader:()=>Dt(()=>import("./sophia-156a057a.js"),[])});kt({id:"sparql",extensions:[".rq"],aliases:["sparql","SPARQL"],loader:()=>Dt(()=>import("./sparql-25a61c8a.js"),[])});kt({id:"sql",extensions:[".sql"],aliases:["SQL"],loader:()=>Dt(()=>import("./sql-ef431720.js"),[])});kt({id:"st",extensions:[".st",".iecst",".iecplc",".lc3lib",".TcPOU",".TcDUT",".TcGVL",".TcIO"],aliases:["StructuredText","scl","stl"],loader:()=>Dt(()=>import("./st-06071006.js"),[])});kt({id:"swift",aliases:["Swift","swift"],extensions:[".swift"],mimetypes:["text/swift"],loader:()=>Dt(()=>import("./swift-941c2e3c.js"),[])});kt({id:"systemverilog",extensions:[".sv",".svh"],aliases:["SV","sv","SystemVerilog","systemverilog"],loader:()=>Dt(()=>import("./systemverilog-dc0c3813.js"),[])});kt({id:"verilog",extensions:[".v",".vh"],aliases:["V","v","Verilog","verilog"],loader:()=>Dt(()=>import("./systemverilog-dc0c3813.js"),[])});kt({id:"tcl",extensions:[".tcl"],aliases:["tcl","Tcl","tcltk","TclTk","tcl/tk","Tcl/Tk"],loader:()=>Dt(()=>import("./tcl-cc963d5c.js"),[])});kt({id:"twig",extensions:[".twig"],aliases:["Twig","twig"],mimetypes:["text/x-twig"],loader:()=>Dt(()=>import("./twig-cdf47909.js"),[])});kt({id:"typescript",extensions:[".ts",".tsx",".cts",".mts"],aliases:["TypeScript","ts","typescript"],mimetypes:["text/typescript"],loader:()=>Dt(()=>import("./typescript-54992499.js"),[])});kt({id:"vb",extensions:[".vb"],aliases:["Visual Basic","vb"],loader:()=>Dt(()=>import("./vb-3ff3c116.js"),[])});kt({id:"wgsl",extensions:[".wgsl"],aliases:["WebGPU Shading Language","WGSL","wgsl"],loader:()=>Dt(()=>import("./wgsl-7be617f0.js"),[])});kt({id:"xml",extensions:[".xml",".xsd",".dtd",".ascx",".csproj",".config",".props",".targets",".wxi",".wxl",".wxs",".xaml",".svg",".svgz",".opf",".xslt",".xsl"],firstLine:"(\\<\\?xml.*)|(\\Dt(()=>import("./xml-12c779e0.js"),[])});kt({id:"yaml",extensions:[".yaml",".yml"],aliases:["YAML","yaml","YML","yml"],mimetypes:["application/x-yaml","text/x-yaml"],loader:()=>Dt(()=>import("./yaml-639752e1.js"),[])});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Met=Object.defineProperty,Aet=Object.getOwnPropertyDescriptor,Pet=Object.getOwnPropertyNames,Oet=Object.prototype.hasOwnProperty,lae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Pet(e))!Oet.call(i,r)&&r!==t&&Met(i,r,{get:()=>e[r],enumerable:!(n=Aet(e,r))||n.enumerable});return i},Fet=(i,e,t)=>(lae(i,e,"default"),t&&lae(t,e,"default")),FS={};Fet(FS,w3);var IY=class{constructor(e,t,n){this._onDidChange=new FS.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(n)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},kY={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},TY={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},Cbe=new IY("css",kY,TY),ybe=new IY("scss",kY,TY),wbe=new IY("less",kY,TY);FS.languages.css={cssDefaults:Cbe,lessDefaults:wbe,scssDefaults:ybe};function NY(){return Dt(()=>import("./cssMode-c20b4059.js"),[])}FS.languages.onLanguage("less",()=>{NY().then(i=>i.setupMode(wbe))});FS.languages.onLanguage("scss",()=>{NY().then(i=>i.setupMode(ybe))});FS.languages.onLanguage("css",()=>{NY().then(i=>i.setupMode(Cbe))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Met=Object.defineProperty,Aet=Object.getOwnPropertyDescriptor,Pet=Object.getOwnPropertyNames,Oet=Object.prototype.hasOwnProperty,lae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Pet(e))!Oet.call(i,r)&&r!==t&&Met(i,r,{get:()=>e[r],enumerable:!(n=Aet(e,r))||n.enumerable});return i},Fet=(i,e,t)=>(lae(i,e,"default"),t&&lae(t,e,"default")),FS={};Fet(FS,w3);var IY=class{constructor(e,t,n){this._onDidChange=new FS.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(n)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this.options}get options(){return this._options}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setDiagnosticsOptions(e){this.setOptions(e)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},kY={validate:!0,lint:{compatibleVendorPrefixes:"ignore",vendorPrefix:"warning",duplicateProperties:"warning",emptyRules:"warning",importStatement:"ignore",boxModel:"ignore",universalSelector:"ignore",zeroUnits:"ignore",fontFaceProperties:"warning",hexColorLength:"error",argumentsInColorFunction:"error",unknownProperties:"warning",ieHack:"ignore",unknownVendorSpecificProperties:"ignore",propertyIgnoredDueToDisplay:"warning",important:"ignore",float:"ignore",idSelector:"ignore"},data:{useDefaultDataProvider:!0},format:{newlineBetweenSelectors:!0,newlineBetweenRules:!0,spaceAroundSelectorSeparator:!1,braceStyle:"collapse",maxPreserveNewLines:void 0,preserveNewLines:!0}},TY={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0,documentFormattingEdits:!0,documentRangeFormattingEdits:!0},Cbe=new IY("css",kY,TY),ybe=new IY("scss",kY,TY),wbe=new IY("less",kY,TY);FS.languages.css={cssDefaults:Cbe,lessDefaults:wbe,scssDefaults:ybe};function NY(){return Dt(()=>import("./cssMode-67b982ab.js"),[])}FS.languages.onLanguage("less",()=>{NY().then(i=>i.setupMode(wbe))});FS.languages.onLanguage("scss",()=>{NY().then(i=>i.setupMode(ybe))});FS.languages.onLanguage("css",()=>{NY().then(i=>i.setupMode(Cbe))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Bet=Object.defineProperty,Wet=Object.getOwnPropertyDescriptor,$et=Object.getOwnPropertyNames,Het=Object.prototype.hasOwnProperty,cae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of $et(e))!Het.call(i,r)&&r!==t&&Bet(i,r,{get:()=>e[r],enumerable:!(n=Wet(e,r))||n.enumerable});return i},Vet=(i,e,t)=>(cae(i,e,"default"),t&&cae(t,e,"default")),S3={};Vet(S3,w3);var zet=class{constructor(e,t,n){this._onDidChange=new S3.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(n)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Uet={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},x3={format:Uet,suggest:{},data:{useDefaultDataProvider:!0}};function L3(i){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:i===TE,documentFormattingEdits:i===TE,documentRangeFormattingEdits:i===TE}}var TE="html",uae="handlebars",dae="razor",Sbe=E3(TE,x3,L3(TE)),jet=Sbe.defaults,xbe=E3(uae,x3,L3(uae)),Ket=xbe.defaults,Lbe=E3(dae,x3,L3(dae)),Get=Lbe.defaults;S3.languages.html={htmlDefaults:jet,razorDefaults:Get,handlebarDefaults:Ket,htmlLanguageService:Sbe,handlebarLanguageService:xbe,razorLanguageService:Lbe,registerHTMLLanguageService:E3};function qet(){return Dt(()=>import("./htmlMode-a02b4db6.js"),[])}function E3(i,e=x3,t=L3(i)){const n=new zet(i,e,t);let r;const o=S3.languages.onLanguage(i,async()=>{r=(await qet()).setupMode(n)});return{defaults:n,dispose(){o.dispose(),r==null||r.dispose(),r=void 0}}}var Xet=class{constructor(e,t,n){this._onDidChange=new DY,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(n)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Yet={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Zet={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Ebe=new Xet("json",Yet,Zet),Qet=()=>Dbe().then(i=>i.getWorker());sT.json={jsonDefaults:Ebe,getWorker:Qet};function Dbe(){return Dt(()=>import("./jsonMode-324adb46.js"),[])}sT.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});sT.onLanguage("json",()=>{Dbe().then(i=>i.setupMode(Ebe))});/*!----------------------------------------------------------------------------- + *-----------------------------------------------------------------------------*/var Bet=Object.defineProperty,Wet=Object.getOwnPropertyDescriptor,$et=Object.getOwnPropertyNames,Het=Object.prototype.hasOwnProperty,cae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of $et(e))!Het.call(i,r)&&r!==t&&Bet(i,r,{get:()=>e[r],enumerable:!(n=Wet(e,r))||n.enumerable});return i},Vet=(i,e,t)=>(cae(i,e,"default"),t&&cae(t,e,"default")),S3={};Vet(S3,w3);var zet=class{constructor(e,t,n){this._onDidChange=new S3.Emitter,this._languageId=e,this.setOptions(t),this.setModeConfiguration(n)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get options(){return this._options}get modeConfiguration(){return this._modeConfiguration}setOptions(e){this._options=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Uet={tabSize:4,insertSpaces:!1,wrapLineLength:120,unformatted:'default": "a, abbr, acronym, b, bdo, big, br, button, cite, code, dfn, em, i, img, input, kbd, label, map, object, q, samp, select, small, span, strong, sub, sup, textarea, tt, var',contentUnformatted:"pre",indentInnerHtml:!1,preserveNewLines:!0,maxPreserveNewLines:void 0,indentHandlebars:!1,endWithNewline:!1,extraLiners:"head, body, /html",wrapAttributes:"auto"},x3={format:Uet,suggest:{},data:{useDefaultDataProvider:!0}};function L3(i){return{completionItems:!0,hovers:!0,documentSymbols:!0,links:!0,documentHighlights:!0,rename:!0,colors:!0,foldingRanges:!0,selectionRanges:!0,diagnostics:i===TE,documentFormattingEdits:i===TE,documentRangeFormattingEdits:i===TE}}var TE="html",uae="handlebars",dae="razor",Sbe=E3(TE,x3,L3(TE)),jet=Sbe.defaults,xbe=E3(uae,x3,L3(uae)),Ket=xbe.defaults,Lbe=E3(dae,x3,L3(dae)),Get=Lbe.defaults;S3.languages.html={htmlDefaults:jet,razorDefaults:Get,handlebarDefaults:Ket,htmlLanguageService:Sbe,handlebarLanguageService:xbe,razorLanguageService:Lbe,registerHTMLLanguageService:E3};function qet(){return Dt(()=>import("./htmlMode-639cee69.js"),[])}function E3(i,e=x3,t=L3(i)){const n=new zet(i,e,t);let r;const o=S3.languages.onLanguage(i,async()=>{r=(await qet()).setupMode(n)});return{defaults:n,dispose(){o.dispose(),r==null||r.dispose(),r=void 0}}}var Xet=class{constructor(e,t,n){this._onDidChange=new DY,this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(n)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}},Yet={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},Zet={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},Ebe=new Xet("json",Yet,Zet),Qet=()=>Dbe().then(i=>i.getWorker());sT.json={jsonDefaults:Ebe,getWorker:Qet};function Dbe(){return Dt(()=>import("./jsonMode-9dcc9a7c.js"),[])}sT.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});sT.onLanguage("json",()=>{Dbe().then(i=>i.setupMode(Ebe))});/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var Jet=Object.defineProperty,ett=Object.getOwnPropertyDescriptor,ttt=Object.getOwnPropertyNames,ntt=Object.prototype.hasOwnProperty,hae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ttt(e))!ntt.call(i,r)&&r!==t&&Jet(i,r,{get:()=>e[r],enumerable:!(n=ett(e,r))||n.enumerable});return i},itt=(i,e,t)=>(hae(i,e,"default"),t&&hae(t,e,"default")),rtt="5.0.2",Qw={};itt(Qw,w3);var Ibe=(i=>(i[i.None=0]="None",i[i.CommonJS=1]="CommonJS",i[i.AMD=2]="AMD",i[i.UMD=3]="UMD",i[i.System=4]="System",i[i.ES2015=5]="ES2015",i[i.ESNext=99]="ESNext",i))(Ibe||{}),kbe=(i=>(i[i.None=0]="None",i[i.Preserve=1]="Preserve",i[i.React=2]="React",i[i.ReactNative=3]="ReactNative",i[i.ReactJSX=4]="ReactJSX",i[i.ReactJSXDev=5]="ReactJSXDev",i))(kbe||{}),Tbe=(i=>(i[i.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",i[i.LineFeed=1]="LineFeed",i))(Tbe||{}),Nbe=(i=>(i[i.ES3=0]="ES3",i[i.ES5=1]="ES5",i[i.ES2015=2]="ES2015",i[i.ES2016=3]="ES2016",i[i.ES2017=4]="ES2017",i[i.ES2018=5]="ES2018",i[i.ES2019=6]="ES2019",i[i.ES2020=7]="ES2020",i[i.ESNext=99]="ESNext",i[i.JSON=100]="JSON",i[i.Latest=99]="Latest",i))(Nbe||{}),Rbe=(i=>(i[i.Classic=1]="Classic",i[i.NodeJs=2]="NodeJs",i))(Rbe||{}),Mbe=class{constructor(i,e,t,n,r){this._onDidChange=new Qw.Emitter,this._onDidExtraLibsChange=new Qw.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(i),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(n),this.setModeConfiguration(r),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(i,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===i)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(n=this._extraLibs[t].version+1),this._extraLibs[t]={content:i,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let r=this._extraLibs[t];r&&r.version===n&&(delete this._extraLibs[t],this._removedExtraLibs[t]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(i){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),i&&i.length>0)for(const e of i){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=e.content;let r=1;this._removedExtraLibs[t]&&(r=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:n,version:r}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(i){this._compilerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(i){this._workerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(i){this._inlayHintsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(i){}setEagerModelSync(i){this._eagerModelSync=i}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(void 0)}},ott=rtt,Abe={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},Pbe=new Mbe({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},Abe),Obe=new Mbe({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},Abe),stt=()=>D3().then(i=>i.getTypeScriptWorker()),att=()=>D3().then(i=>i.getJavaScriptWorker());Qw.languages.typescript={ModuleKind:Ibe,JsxEmit:kbe,NewLineKind:Tbe,ScriptTarget:Nbe,ModuleResolutionKind:Rbe,typescriptVersion:ott,typescriptDefaults:Pbe,javascriptDefaults:Obe,getTypeScriptWorker:stt,getJavaScriptWorker:att};function D3(){return Dt(()=>import("./tsMode-93e6f265.js"),[])}Qw.languages.onLanguage("typescript",()=>D3().then(i=>i.setupTypeScript(Pbe)));Qw.languages.onLanguage("javascript",()=>D3().then(i=>i.setupJavaScript(Obe)));class ltt extends sl{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:$n("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Xe.map,toggled:De.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:De.has("isInDiffEditor"),menu:{when:De.has("isInDiffEditor"),id:$.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const n=e.get(gn),r=!n.getValue("diffEditor.hideUnchangedRegions.enabled");n.updateValue("diffEditor.hideUnchangedRegions.enabled",r)}}Ei(ltt);class Fbe extends sl{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:$n("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:De.has("isInDiffEditor")})}run(e,...t){const n=e.get(gn),r=!n.getValue("diffEditor.experimental.showMoves");n.updateValue("diffEditor.experimental.showMoves",r)}}Ei(Fbe);class Bbe extends sl{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:$n("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:De.has("isInDiffEditor")})}run(e,...t){const n=e.get(gn),r=!n.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");n.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",r)}}Ei(Bbe);ts.appendMenuItem($.EditorTitle,{command:{id:new Bbe().desc.id,title:w("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:De.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:De.has("isInDiffEditor")},order:11,group:"1_diff",when:De.and(j.diffEditorRenderSideBySideInlineBreakpointReached,De.has("isInDiffEditor"))});ts.appendMenuItem($.EditorTitle,{command:{id:new Fbe().desc.id,title:w("showMoves","Show Moved Code Blocks"),icon:Xe.move,toggled:LS.create("config.diffEditor.experimental.showMoves",!0),precondition:De.has("isInDiffEditor")},order:10,group:"1_diff",when:De.has("isInDiffEditor")});const I3=$n("diffEditor","Diff Editor");class ctt extends Sh{constructor(){super({id:"diffEditor.switchSide",title:$n("switchSide","Switch Side"),icon:Xe.arrowSwap,precondition:De.has("isInDiffEditor"),f1:!0,category:I3})}runEditorCommand(e,t,n){const r=WS(e);if(r instanceof t_){if(n&&n.dryRun)return{destinationSelection:r.mapToOtherSide().destinationSelection};r.switchSide()}}}Ei(ctt);class utt extends Sh{constructor(){super({id:"diffEditor.exitCompareMove",title:$n("exitCompareMove","Exit Compare Move"),icon:Xe.close,precondition:j.comparingMovedCode,f1:!1,category:I3,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){const r=WS(e);r instanceof t_&&r.exitCompareMove()}}Ei(utt);class dtt extends Sh{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:$n("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Xe.fold,precondition:De.has("isInDiffEditor"),f1:!0,category:I3})}runEditorCommand(e,t,...n){const r=WS(e);r instanceof t_&&r.collapseAllUnchangedRegions()}}Ei(dtt);class htt extends Sh{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:$n("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Xe.unfold,precondition:De.has("isInDiffEditor"),f1:!0,category:I3})}runEditorCommand(e,t,...n){const r=WS(e);r instanceof t_&&r.showAllUnchangedRegions()}}Ei(htt);const Wbe=$n("accessibleDiffViewer","Accessible Diff Viewer");class BS extends sl{constructor(){super({id:BS.id,title:$n("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:Wbe,precondition:De.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=WS(e);t==null||t.accessibleDiffViewerNext()}}BS.id="editor.action.accessibleDiffViewer.next";ts.appendMenuItem($.EditorTitle,{command:{id:BS.id,title:w("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:De.has("isInDiffEditor")},order:10,group:"2_diff",when:De.and(j.accessibleDiffViewerVisible.negate(),De.has("isInDiffEditor"))});class aT extends sl{constructor(){super({id:aT.id,title:$n("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:Wbe,precondition:De.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=WS(e);t==null||t.accessibleDiffViewerPrev()}}aT.id="editor.action.accessibleDiffViewer.prev";function WS(i){const t=i.get(Un).listDiffEditors(),n=fs();if(n)for(const r of t){const o=r.getContainerDomNode();if(ftt(o,n))return r}return null}function ftt(i,e){let t=e;for(;t;){if(t===i)return!0;t=t.parentElement}return!1}Dn.registerCommandAlias("editor.action.diffReview.next",BS.id);Ei(BS);Dn.registerCommandAlias("editor.action.diffReview.prev",aT.id);Ei(aT);var gtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ptt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Rz;const k3=new st("selectionAnchorSet",!1);let Np=Rz=class{static get(e){return e.getContribution(Rz.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=k3.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(yt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Is().appendText(w("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),kl(w("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(yt.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Np.ID="editor.contrib.selectionAnchorController";Np=Rz=gtt([ptt(1,Vt)],Np);class mtt extends gt{constructor(){super({id:"editor.action.setSelectionAnchor",label:w("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2080),weight:100}})}async run(e,t){var n;(n=Np.get(t))===null||n===void 0||n.setSelectionAnchor()}}class vtt extends gt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:w("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:k3})}async run(e,t){var n;(n=Np.get(t))===null||n===void 0||n.goToSelectionAnchor()}}class _tt extends gt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:w("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:k3,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2089),weight:100}})}async run(e,t){var n;(n=Np.get(t))===null||n===void 0||n.selectFromAnchorToCursor()}}class btt extends gt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:w("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:k3,kbOpts:{kbExpr:j.editorTextFocus,primary:9,weight:100}})}async run(e,t){var n;(n=Np.get(t))===null||n===void 0||n.cancelSelectionAnchor()}}jn(Np.ID,Np,4);Be(mtt);Be(vtt);Be(_tt);Be(btt);const Ctt=X("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},w("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class ytt extends gt{constructor(){super({id:"editor.action.jumpToBracket",label:w("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:3165,weight:100}})}run(e,t){var n;(n=Qu.get(t))===null||n===void 0||n.jumpToBracket()}}class wtt extends gt{constructor(){super({id:"editor.action.selectToBracket",label:w("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:$n("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,n){var r;let o=!0;n&&n.selectBrackets===!1&&(o=!1),(r=Qu.get(t))===null||r===void 0||r.selectToBracket(o)}}class Stt extends gt{constructor(){super({id:"editor.action.removeBrackets",label:w("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:2561,weight:100}})}run(e,t){var n;(n=Qu.get(t))===null||n===void 0||n.removeBrackets(this.id)}}class xtt{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}}class Qu extends fe{static get(e){return e.getContribution(Qu.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new pi(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(n=>{const r=n.getStartPosition(),o=e.bracketPairs.matchBracket(r);let s=null;if(o)o[0].containsPosition(r)&&!o[1].containsPosition(r)?s=o[1].getStartPosition():o[1].containsPosition(r)&&(s=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(r);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(r);l&&l.range&&(s=l.range.getStartPosition())}}return s?new yt(s.lineNumber,s.column,s.lineNumber,s.column):new yt(r.lineNumber,r.column,r.lineNumber,r.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(r=>{const o=r.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(s=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(B.compareRangesUsingStarts);const[c,u]=s;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?u.getEndPosition():u.getStartPosition(),u.containsPosition(o)){const d=a;a=l,l=d}}a&&l&&n.push(new yt(a.lineNumber,a.column,l.lineNumber,l.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(n=>{const r=n.getPosition();let o=t.bracketPairs.matchBracket(r);o||(o=t.bracketPairs.findEnclosingBrackets(r)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const n of this._lastBracketsData){const r=n.brackets;r&&(e[t++]={range:r[0],options:n.options},e[t++]={range:r[1],options:n.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),n=t.getVersionId();let r=[];this._lastVersionId===n&&(r=this._lastBracketsData);const o=[];let s=0;for(let d=0,h=e.length;d1&&o.sort(ae.compare);const a=[];let l=0,c=0;const u=r.length;for(let d=0,h=o.length;d0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}}Be(Itt);const T3=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let i;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?i=crypto.getRandomValues.bind(crypto):i=function(n){for(let r=0;ri,asFile:()=>{},value:typeof i=="string"?i:void 0}}function ktt(i,e,t){const n={id:T3(),name:i,uri:e,data:t};return{asString:async()=>"",asFile:()=>n,value:void 0}}class Hbe{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return En.some(this,([n,r])=>r.asFile())&&t.push("files"),zbe(cO(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const n=this._entries.get(e);n?n.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const n of t)yield[e,n]}toKey(e){return cO(e)}}function cO(i){return i.toLowerCase()}function Vbe(i,e){return zbe(cO(i),e.map(cO))}function zbe(i,e){if(i==="*/*")return e.length>0;if(e.includes(i))return!0;const t=i.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[n,r,o]=t;return o==="*"?e.some(s=>s.startsWith(r+"/")):!1}const N3=Object.freeze({create:i=>Ep(i.map(e=>e.toString())).join(`\r + *-----------------------------------------------------------------------------*/var Jet=Object.defineProperty,ett=Object.getOwnPropertyDescriptor,ttt=Object.getOwnPropertyNames,ntt=Object.prototype.hasOwnProperty,hae=(i,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ttt(e))!ntt.call(i,r)&&r!==t&&Jet(i,r,{get:()=>e[r],enumerable:!(n=ett(e,r))||n.enumerable});return i},itt=(i,e,t)=>(hae(i,e,"default"),t&&hae(t,e,"default")),rtt="5.0.2",Qw={};itt(Qw,w3);var Ibe=(i=>(i[i.None=0]="None",i[i.CommonJS=1]="CommonJS",i[i.AMD=2]="AMD",i[i.UMD=3]="UMD",i[i.System=4]="System",i[i.ES2015=5]="ES2015",i[i.ESNext=99]="ESNext",i))(Ibe||{}),kbe=(i=>(i[i.None=0]="None",i[i.Preserve=1]="Preserve",i[i.React=2]="React",i[i.ReactNative=3]="ReactNative",i[i.ReactJSX=4]="ReactJSX",i[i.ReactJSXDev=5]="ReactJSXDev",i))(kbe||{}),Tbe=(i=>(i[i.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",i[i.LineFeed=1]="LineFeed",i))(Tbe||{}),Nbe=(i=>(i[i.ES3=0]="ES3",i[i.ES5=1]="ES5",i[i.ES2015=2]="ES2015",i[i.ES2016=3]="ES2016",i[i.ES2017=4]="ES2017",i[i.ES2018=5]="ES2018",i[i.ES2019=6]="ES2019",i[i.ES2020=7]="ES2020",i[i.ESNext=99]="ESNext",i[i.JSON=100]="JSON",i[i.Latest=99]="Latest",i))(Nbe||{}),Rbe=(i=>(i[i.Classic=1]="Classic",i[i.NodeJs=2]="NodeJs",i))(Rbe||{}),Mbe=class{constructor(i,e,t,n,r){this._onDidChange=new Qw.Emitter,this._onDidExtraLibsChange=new Qw.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(i),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(n),this.setModeConfiguration(r),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(i,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===i)return{dispose:()=>{}};let n=1;return this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(n=this._extraLibs[t].version+1),this._extraLibs[t]={content:i,version:n},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let r=this._extraLibs[t];r&&r.version===n&&(delete this._extraLibs[t],this._removedExtraLibs[t]=n,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(i){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),i&&i.length>0)for(const e of i){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,n=e.content;let r=1;this._removedExtraLibs[t]&&(r=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:n,version:r}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(i){this._compilerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(i){this._diagnosticsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(i){this._workerOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(i){this._inlayHintsOptions=i||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(i){}setEagerModelSync(i){this._eagerModelSync=i}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(i){this._modeConfiguration=i||Object.create(null),this._onDidChange.fire(void 0)}},ott=rtt,Abe={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},Pbe=new Mbe({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},Abe),Obe=new Mbe({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},Abe),stt=()=>D3().then(i=>i.getTypeScriptWorker()),att=()=>D3().then(i=>i.getJavaScriptWorker());Qw.languages.typescript={ModuleKind:Ibe,JsxEmit:kbe,NewLineKind:Tbe,ScriptTarget:Nbe,ModuleResolutionKind:Rbe,typescriptVersion:ott,typescriptDefaults:Pbe,javascriptDefaults:Obe,getTypeScriptWorker:stt,getJavaScriptWorker:att};function D3(){return Dt(()=>import("./tsMode-59ab1782.js"),[])}Qw.languages.onLanguage("typescript",()=>D3().then(i=>i.setupTypeScript(Pbe)));Qw.languages.onLanguage("javascript",()=>D3().then(i=>i.setupJavaScript(Obe)));class ltt extends sl{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:$n("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:Xe.map,toggled:De.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:De.has("isInDiffEditor"),menu:{when:De.has("isInDiffEditor"),id:$.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const n=e.get(gn),r=!n.getValue("diffEditor.hideUnchangedRegions.enabled");n.updateValue("diffEditor.hideUnchangedRegions.enabled",r)}}Ei(ltt);class Fbe extends sl{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:$n("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:De.has("isInDiffEditor")})}run(e,...t){const n=e.get(gn),r=!n.getValue("diffEditor.experimental.showMoves");n.updateValue("diffEditor.experimental.showMoves",r)}}Ei(Fbe);class Bbe extends sl{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:$n("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:De.has("isInDiffEditor")})}run(e,...t){const n=e.get(gn),r=!n.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");n.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",r)}}Ei(Bbe);ts.appendMenuItem($.EditorTitle,{command:{id:new Bbe().desc.id,title:w("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:De.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:De.has("isInDiffEditor")},order:11,group:"1_diff",when:De.and(j.diffEditorRenderSideBySideInlineBreakpointReached,De.has("isInDiffEditor"))});ts.appendMenuItem($.EditorTitle,{command:{id:new Fbe().desc.id,title:w("showMoves","Show Moved Code Blocks"),icon:Xe.move,toggled:LS.create("config.diffEditor.experimental.showMoves",!0),precondition:De.has("isInDiffEditor")},order:10,group:"1_diff",when:De.has("isInDiffEditor")});const I3=$n("diffEditor","Diff Editor");class ctt extends Sh{constructor(){super({id:"diffEditor.switchSide",title:$n("switchSide","Switch Side"),icon:Xe.arrowSwap,precondition:De.has("isInDiffEditor"),f1:!0,category:I3})}runEditorCommand(e,t,n){const r=WS(e);if(r instanceof t_){if(n&&n.dryRun)return{destinationSelection:r.mapToOtherSide().destinationSelection};r.switchSide()}}}Ei(ctt);class utt extends Sh{constructor(){super({id:"diffEditor.exitCompareMove",title:$n("exitCompareMove","Exit Compare Move"),icon:Xe.close,precondition:j.comparingMovedCode,f1:!1,category:I3,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...n){const r=WS(e);r instanceof t_&&r.exitCompareMove()}}Ei(utt);class dtt extends Sh{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:$n("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:Xe.fold,precondition:De.has("isInDiffEditor"),f1:!0,category:I3})}runEditorCommand(e,t,...n){const r=WS(e);r instanceof t_&&r.collapseAllUnchangedRegions()}}Ei(dtt);class htt extends Sh{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:$n("showAllUnchangedRegions","Show All Unchanged Regions"),icon:Xe.unfold,precondition:De.has("isInDiffEditor"),f1:!0,category:I3})}runEditorCommand(e,t,...n){const r=WS(e);r instanceof t_&&r.showAllUnchangedRegions()}}Ei(htt);const Wbe=$n("accessibleDiffViewer","Accessible Diff Viewer");class BS extends sl{constructor(){super({id:BS.id,title:$n("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:Wbe,precondition:De.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=WS(e);t==null||t.accessibleDiffViewerNext()}}BS.id="editor.action.accessibleDiffViewer.next";ts.appendMenuItem($.EditorTitle,{command:{id:BS.id,title:w("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:De.has("isInDiffEditor")},order:10,group:"2_diff",when:De.and(j.accessibleDiffViewerVisible.negate(),De.has("isInDiffEditor"))});class aT extends sl{constructor(){super({id:aT.id,title:$n("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:Wbe,precondition:De.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=WS(e);t==null||t.accessibleDiffViewerPrev()}}aT.id="editor.action.accessibleDiffViewer.prev";function WS(i){const t=i.get(Un).listDiffEditors(),n=fs();if(n)for(const r of t){const o=r.getContainerDomNode();if(ftt(o,n))return r}return null}function ftt(i,e){let t=e;for(;t;){if(t===i)return!0;t=t.parentElement}return!1}Dn.registerCommandAlias("editor.action.diffReview.next",BS.id);Ei(BS);Dn.registerCommandAlias("editor.action.diffReview.prev",aT.id);Ei(aT);var gtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ptt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Rz;const k3=new st("selectionAnchorSet",!1);let Np=Rz=class{static get(e){return e.getContribution(Rz.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=k3.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(yt.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Is().appendText(w("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),kl(w("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(yt.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}};Np.ID="editor.contrib.selectionAnchorController";Np=Rz=gtt([ptt(1,Vt)],Np);class mtt extends gt{constructor(){super({id:"editor.action.setSelectionAnchor",label:w("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2080),weight:100}})}async run(e,t){var n;(n=Np.get(t))===null||n===void 0||n.setSelectionAnchor()}}class vtt extends gt{constructor(){super({id:"editor.action.goToSelectionAnchor",label:w("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:k3})}async run(e,t){var n;(n=Np.get(t))===null||n===void 0||n.goToSelectionAnchor()}}class _tt extends gt{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:w("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:k3,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2089),weight:100}})}async run(e,t){var n;(n=Np.get(t))===null||n===void 0||n.selectFromAnchorToCursor()}}class btt extends gt{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:w("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:k3,kbOpts:{kbExpr:j.editorTextFocus,primary:9,weight:100}})}async run(e,t){var n;(n=Np.get(t))===null||n===void 0||n.cancelSelectionAnchor()}}jn(Np.ID,Np,4);Be(mtt);Be(vtt);Be(_tt);Be(btt);const Ctt=X("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},w("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class ytt extends gt{constructor(){super({id:"editor.action.jumpToBracket",label:w("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:3165,weight:100}})}run(e,t){var n;(n=Qu.get(t))===null||n===void 0||n.jumpToBracket()}}class wtt extends gt{constructor(){super({id:"editor.action.selectToBracket",label:w("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:$n("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,n){var r;let o=!0;n&&n.selectBrackets===!1&&(o=!1),(r=Qu.get(t))===null||r===void 0||r.selectToBracket(o)}}class Stt extends gt{constructor(){super({id:"editor.action.removeBrackets",label:w("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:2561,weight:100}})}run(e,t){var n;(n=Qu.get(t))===null||n===void 0||n.removeBrackets(this.id)}}class xtt{constructor(e,t,n){this.position=e,this.brackets=t,this.options=n}}class Qu extends fe{static get(e){return e.getContribution(Qu.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new pi(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(n=>{const r=n.getStartPosition(),o=e.bracketPairs.matchBracket(r);let s=null;if(o)o[0].containsPosition(r)&&!o[1].containsPosition(r)?s=o[1].getStartPosition():o[1].containsPosition(r)&&(s=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(r);if(a)s=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(r);l&&l.range&&(s=l.range.getStartPosition())}}return s?new yt(s.lineNumber,s.column,s.lineNumber,s.column):new yt(r.lineNumber,r.column,r.lineNumber,r.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),n=[];this._editor.getSelections().forEach(r=>{const o=r.getStartPosition();let s=t.bracketPairs.matchBracket(o);if(!s&&(s=t.bracketPairs.findEnclosingBrackets(o),!s)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(s=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(s){s.sort(B.compareRangesUsingStarts);const[c,u]=s;if(a=e?c.getStartPosition():c.getEndPosition(),l=e?u.getEndPosition():u.getStartPosition(),u.containsPosition(o)){const d=a;a=l,l=d}}a&&l&&n.push(new yt(a.lineNumber,a.column,l.lineNumber,l.column))}),n.length>0&&(this._editor.setSelections(n),this._editor.revealRange(n[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(n=>{const r=n.getPosition();let o=t.bracketPairs.matchBracket(r);o||(o=t.bracketPairs.findEnclosingBrackets(r)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const n of this._lastBracketsData){const r=n.brackets;r&&(e[t++]={range:r[0],options:n.options},e[t++]={range:r[1],options:n.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),n=t.getVersionId();let r=[];this._lastVersionId===n&&(r=this._lastBracketsData);const o=[];let s=0;for(let d=0,h=e.length;d1&&o.sort(ae.compare);const a=[];let l=0,c=0;const u=r.length;for(let d=0,h=o.length;d0&&(t.pushUndoStop(),t.executeCommands(this.id,r),t.pushUndoStop())}}Be(Itt);const T3=function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let i;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?i=crypto.getRandomValues.bind(crypto):i=function(n){for(let r=0;ri,asFile:()=>{},value:typeof i=="string"?i:void 0}}function ktt(i,e,t){const n={id:T3(),name:i,uri:e,data:t};return{asString:async()=>"",asFile:()=>n,value:void 0}}class Hbe{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return En.some(this,([n,r])=>r.asFile())&&t.push("files"),zbe(cO(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))===null||t===void 0?void 0:t[0]}append(e,t){const n=this._entries.get(e);n?n.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const n of t)yield[e,n]}toKey(e){return cO(e)}}function cO(i){return i.toLowerCase()}function Vbe(i,e){return zbe(cO(i),e.map(cO))}function zbe(i,e){if(i==="*/*")return e.length>0;if(e.includes(i))return!0;const t=i.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[n,r,o]=t;return o==="*"?e.some(s=>s.startsWith(r+"/")):!1}const N3=Object.freeze({create:i=>Ep(i.map(e=>e.toString())).join(`\r `),split:i=>i.split(`\r `),parse:i=>N3.split(i).filter(e=>!e.startsWith("#"))}),fae={EDITORS:"CodeEditors",FILES:"CodeFiles"};class Ttt{}const Ntt={DragAndDropContribution:"workbench.contributions.dragAndDrop"};ar.add(Ntt.DragAndDropContribution,new Ttt);class DI{constructor(){}static getInstance(){return DI.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}DI.INSTANCE=new DI;function Ube(i){const e=new Hbe;for(const t of i.items){const n=t.type;if(t.kind==="string"){const r=new Promise(o=>t.getAsString(o));e.append(n,RY(r))}else if(t.kind==="file"){const r=t.getAsFile();r&&e.append(n,Rtt(r))}}return e}function Rtt(i){const e=i.path?At.parse(i.path):void 0;return ktt(i.name,e,async()=>new Uint8Array(await i.arrayBuffer()))}const Mtt=Object.freeze([fae.EDITORS,fae.FILES,lI.RESOURCES,lI.INTERNAL_URI_LIST]);function jbe(i,e=!1){const t=Ube(i),n=t.get(lI.INTERNAL_URI_LIST);if(n)t.replace(Cr.uriList,n);else if(e||!t.has(Cr.uriList)){const r=[];for(const o of i.items){const s=o.getAsFile();if(s){const a=s.path;try{a?r.push(At.file(a).toString()):r.push(At.parse(s.name,!0).toString())}catch{}}}r.length&&t.replace(Cr.uriList,RY(N3.create(r)))}for(const r of Mtt)t.delete(r);return t}class Pu{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,n=this.value.charCodeAt(e),r;if(r=Pu._table[n],typeof r=="number")return this.pos+=1,{type:r,pos:e,len:1};if(Pu.isDigitCharacter(n)){r=8;do t+=1,n=this.value.charCodeAt(e+t);while(Pu.isDigitCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}if(Pu.isVariableCharacter(n)){r=9;do n=this.value.charCodeAt(e+ ++t);while(Pu.isVariableCharacter(n)||Pu.isDigitCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}r=10;do t+=1,n=this.value.charCodeAt(e+t);while(!isNaN(n)&&typeof Pu._table[n]>"u"&&!Pu.isDigitCharacter(n)&&!Pu.isVariableCharacter(n));return this.pos+=t,{type:r,pos:e,len:t}}}Pu._table={[36]:0,[58]:1,[44]:2,[123]:3,[125]:4,[92]:5,[47]:6,[124]:7,[43]:11,[45]:12,[63]:13};class $S{constructor(){this._children=[]}appendChild(e){return e instanceof pa&&this._children[this._children.length-1]instanceof pa?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:n}=e,r=n.children.indexOf(e),o=n.children.slice(0);o.splice(r,1,...t),n._children=o,function s(a,l){for(const c of a)c.parent=l,s(c.children,c)}(t,n)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof lT)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}class pa extends $S{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new pa(this.value)}}class Kbe extends $S{}class Vc extends Kbe{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.indext.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof HS?this._children[0]:void 0}clone(){const e=new Vc(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class HS extends $S{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof pa&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new HS;return this.options.forEach(e.appendChild,e),e}}class MY extends $S{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let n=!1,r=e.replace(this.regexp,function(){return n=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!n&&this._children.some(o=>o instanceof Ad&&!!o.elseValue)&&(r=this._replace([])),r}_replace(e){let t="";for(const n of this._children)if(n instanceof Ad){let r=e[n.index]||"";r=n.resolve(r),t+=r}else t+=n.toString();return t}toString(){return""}clone(){const e=new MY;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Ad extends $S{constructor(e,t,n,r){super(),this.index=e,this.shorthandName=t,this.ifValue=n,this.elseValue=r}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(n=>n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((n,r)=>r===0?n.charAt(0).toLowerCase()+n.substr(1):n.charAt(0).toUpperCase()+n.substr(1)).join(""):e}clone(){return new Ad(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class II extends Kbe{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new pa(t)],!0):!1}clone(){const e=new II(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function gae(i,e){const t=[...i];for(;t.length>0;){const n=t.shift();if(!e(n))break;t.unshift(...n.children)}}class lT extends $S{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(n){return n instanceof Vc&&(e.push(n),t=!t||t.indexr===e?(n=!0,!1):(t+=r.len(),!0)),n?t:-1}fullLen(e){let t=0;return gae([e],n=>(t+=n.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:n}=e;for(;n;)n instanceof Vc&&t.push(n),n=n.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof II&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new lT;return this._children=this.children.map(t=>t.clone()),e}walk(e){gae(this.children,e)}}class Hb{constructor(){this._scanner=new Pu,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,n){const r=new lT;return this.parseFragment(e,r),this.ensureFinalTabstop(r,n??!1,t??!1),r}parseFragment(e,t){const n=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const r=new Map,o=[];t.walk(l=>(l instanceof Vc&&(l.isFinalTabstop?r.set(0,void 0):!r.has(l.index)&&l.children.length>0?r.set(l.index,l.children):o.push(l)),!0));const s=(l,c)=>{const u=r.get(l.index);if(!u)return;const d=new Vc(l.index);d.transform=l.transform;for(const h of u){const f=h.clone();d.appendChild(f),f instanceof Vc&&r.has(f.index)&&!c.has(f.index)&&(c.add(f.index),s(f,c),c.delete(f.index))}t.replace(l,[d])},a=new Set;for(const l of o)s(l,a);return t.children.slice(n)}ensureFinalTabstop(e,t,n){(t||n&&e.placeholders.length>0)&&(e.placeholders.find(o=>o.index===0)||e.appendChild(new Vc(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const n=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),n}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const r=this._scanner.next();if(r.type!==0&&r.type!==4&&r.type!==5)return!1}this._token=this._scanner.next()}const n=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),n}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new pa(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const n=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Vc(Number(t)):new II(t)),!0):this._backTo(n)}_parseComplexPlaceholder(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(n);const o=new Vc(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new pa("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){const s=new HS;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(s),this._accept(4)))return e.appendChild(o),!0}return this._backTo(n),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(n)}_parseChoiceElement(e){const t=this._token,n=[];for(;!(this._token.type===2||this._token.type===7);){let r;if((r=this._accept(5,!0))?r=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||r:r=this._accept(void 0,!0),!r)return this._backTo(t),!1;n.push(r)}return n.length===0?(this._backTo(t),!1):(e.appendChild(new pa(n.join(""))),!0)}_parseComplexVariable(e){let t;const n=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(n);const o=new II(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new pa("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(n),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(n)}_parseTransform(e){const t=new MY;let n="",r="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,n+=o;continue}if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(5,!0)||this._accept(6,!0)||o,t.appendChild(new pa(o));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){r+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(n,r)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let n=!1;this._accept(3)&&(n=!0);const r=this._accept(8,!0);if(r)if(n){if(this._accept(4))return e.appendChild(new Ad(Number(r))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Ad(Number(r))),!0;else return this._backTo(t),!1;if(this._accept(6)){const o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Ad(Number(r),o)),!0)}else if(this._accept(11)){const o=this._until(4);if(o)return e.appendChild(new Ad(Number(r),void 0,o,void 0)),!0}else if(this._accept(12)){const o=this._until(4);if(o)return e.appendChild(new Ad(Number(r),void 0,void 0,o)),!0}else if(this._accept(13)){const o=this._until(1);if(o){const s=this._until(4);if(s)return e.appendChild(new Ad(Number(r),void 0,o,s)),!0}}else{const o=this._until(4);if(o)return e.appendChild(new Ad(Number(r),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new pa(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function Gbe(i,e,t){var n,r,o,s;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:(r=(n=t.additionalEdit)===null||n===void 0?void 0:n.edits)!==null&&r!==void 0?r:[]}:{edits:[...e.map(a=>new xv(i,{range:a,text:typeof t.insertText=="string"?Hb.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...(s=(o=t.additionalEdit)===null||o===void 0?void 0:o.edits)!==null&&s!==void 0?s:[]]}}function qbe(i){var e;function t(a,l){return"providerId"in a&&a.providerId===l.providerId||"mimeType"in a&&a.mimeType===l.handledMimeType}const n=new Map;for(const a of i)for(const l of(e=a.yieldTo)!==null&&e!==void 0?e:[])for(const c of i)if(c!==a&&t(l,c)){let u=n.get(a);u||(u=[],n.set(a,u)),u.push(c)}if(!n.size)return Array.from(i);const r=new Set,o=[];function s(a){if(!a.length)return[];const l=a[0];if(o.includes(l))return console.warn(`Yield to cycle detected for ${l.providerId}`),a;if(r.has(l))return s(a.slice(1));let c=[];const u=n.get(l);return u&&(o.push(l),c=s(u),o.pop()),r.add(l),[...c,l,...s(a.slice(1))]}return s(Array.from(i))}var Att=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Ptt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Ott=sn.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:Wpe,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class R3 extends fe{constructor(e,t,n,r,o){super(),this.typeId=e,this.editor=t,this.range=n,this.delegate=o,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(r),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=He(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=He("span.icon");this.domNode.append(t),t.classList.add(...Wt.asClassNameArray(Xe.loading),"codicon-modifier-spin");const n=()=>{const r=this.editor.getOption(67);this.domNode.style.height=`${r}px`,this.domNode.style.width=`${Math.ceil(.8*r)}px`};n(),this._register(this.editor.onDidChangeConfiguration(r=>{(r.hasChanged(52)||r.hasChanged(67))&&n()})),this._register(ye(this.domNode,Ge.CLICK,r=>{this.delegate.cancel()}))}getId(){return R3.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}R3.baseId="editor.widget.inlineProgressWidget";let uO=class extends fe{constructor(e,t,n){super(),this.id=e,this._editor=t,this._instantiationService=n,this._showDelay=500,this._showPromise=this._register(new Ho),this._currentWidget=new Ho,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}async showWhile(e,t,n){const r=this._operationIdPool++;this._currentOperation=r,this.clear(),this._showPromise.value=jv(()=>{const o=B.fromPositions(e);this._currentDecorations.set([{range:o,options:Ott}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(R3,this.id,this._editor,o,t,n))},this._showDelay);try{return await n}finally{this._currentOperation===r&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};uO=Att([Ptt(2,Ot)],uO);var Xbe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},NE=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Mz;let dO=Mz=class extends fe{constructor(e,t,n,r,o,s,a,l,c,u){super(),this.typeId=e,this.editor=t,this.showCommand=r,this.range=o,this.edits=s,this.onSelectNewEdit=a,this._contextMenuService=l,this._keybindingService=u,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=n.bindTo(c),this.visibleContext.set(!0),this._register(Rt(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Rt(()=>this.editor.removeContentWidget(this))),this._register(this.editor.onDidChangeCursorPosition(d=>{o.containsPosition(d.position)||this.dispose()})),this._register(Je.runAndSubscribe(u.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var e;const t=(e=this._keybindingService.lookupKeybinding(this.showCommand.id))===null||e===void 0?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=He(".post-edit-widget"),this.button=this._register(new QP(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ye(this.domNode,Ge.CLICK,()=>this.showSelector()))}getId(){return Mz.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Br(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>My({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}};dO.baseId="editor.widget.postEditWidget";dO=Mz=Xbe([NE(7,Ol),NE(8,Vt),NE(9,ci)],dO);let hO=class extends fe{constructor(e,t,n,r,o,s){super(),this._id=e,this._editor=t,this._visibleContext=n,this._showCommand=r,this._instantiationService=o,this._bulkEditService=s,this._currentWidget=this._register(new Ho),this._register(Je.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,n,r){const o=this._editor.getModel();if(!o||!e.length)return;const s=t.allEdits[t.activeEditIndex];if(!s)return;const a=Gbe(o.uri,e,s),l=e[0],c=o.deltaDecorations([],[{range:l,options:{description:"paste-line-suffix",stickiness:0}}]);let u,d;try{u=await this._bulkEditService.apply(a,{editor:this._editor,token:r}),d=o.getDecorationRange(c[0])}finally{o.deltaDecorations(c,[])}n&&u.isApplied&&t.allEdits.length>1&&this.show(d??l,t,async h=>{const f=this._editor.getModel();f&&(await f.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:h,allEdits:t.allEdits},n,r))})}show(e,t,n){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(dO,this._id,this._editor,this._visibleContext,this._showCommand,e,t,n))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;(e=this._currentWidget.value)===null||e===void 0||e.showSelector()}};hO=Xbe([NE(4,Ot),NE(5,Xk)],hO);var Ftt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},pae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},PM;let xa=PM=class{static get(e){return e.getContribution(PM.ID)}constructor(e,t,n){this._openerService=n,this._messageWidget=new Ho,this._messageListeners=new Te,this._mouseOverMessage=!1,this._editor=e,this._visible=PM.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){kl(Mf(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Mf(e)?Y4(e,{actionHandler:{callback:r=>{this.closeMessage(),HX(this._openerService,r,Mf(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new mae(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(Je.debounce(this._editor.onDidBlurEditorText,(r,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&es(fs(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(ye(this._messageWidget.value.getDomNode(),Ge.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ye(this._messageWidget.value.getDomNode(),Ge.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let n;this._messageListeners.add(this._editor.onMouseMove(r=>{r.target.position&&(n?n.containsPosition(r.target.position)||this.closeMessage():n=new B(t.lineNumber-3,1,r.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(mae.fadeOut(this._messageWidget.value))}};xa.ID="editor.contrib.messageController";xa.MESSAGE_VISIBLE=new st("messageVisible",!1,w("messageVisible","Whether the editor is currently showing an inline message"));xa=PM=Ftt([pae(1,Vt),pae(2,al)],xa);const Btt=Vo.bindToContribution(xa.get);et(new Btt({id:"leaveEditorMessage",precondition:xa.MESSAGE_VISIBLE,handler:i=>i.closeMessage(),kbOpts:{weight:100+30,primary:9}}));let mae=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(n),e.getDomNode().removeEventListener("animationend",t)},n=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:n},r){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:n},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const o=document.createElement("div");o.classList.add("anchor","top"),this._domNode.appendChild(o);const s=document.createElement("div");typeof r=="string"?(s.classList.add("message"),s.textContent=r):(r.classList.add("message"),s.appendChild(r)),this._domNode.appendChild(s);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};jn(xa.ID,xa,4);var Wtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},n1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Az;const Ybe="editor.changePasteType",Zbe=new st("pasteWidgetVisible",!1,w("pasteWidgetVisible","Whether the paste widget is showing")),w9="application/vnd.code.copyMetadata";let Rp=Az=class extends fe{static get(e){return e.getContribution(Az.ID)}constructor(e,t,n,r,o,s,a){super(),this._bulkEditService=n,this._clipboardService=r,this._languageFeaturesService=o,this._quickInputService=s,this._progressService=a,this._editor=e;const l=e.getContainerDomNode();this._register(ye(l,"copy",c=>this.handleCopy(c))),this._register(ye(l,"cut",c=>this.handleCopy(c))),this._register(ye(l,"paste",c=>this.handlePaste(c),!0)),this._pasteProgressManager=this._register(new uO("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(hO,"pasteIntoEditor",e,Zbe,{id:Ybe,label:w("postPasteWidgetTitle","Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},xS().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(85).enabled&&!this._editor.getOption(91)}async finishedPaste(){await this._currentPasteOperation}handleCopy(e){var t,n;if(!this._editor.hasTextFocus()||(S_&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled()))return;const r=this._editor.getModel(),o=this._editor.getSelections();if(!r||!(o!=null&&o.length))return;const s=this._editor.getOption(37);let a=o;const l=o.length===1&&o[0].isEmpty();if(l){if(!s)return;a=[new B(a[0].startLineNumber,1,a[0].startLineNumber,1+r.getLineLength(a[0].startLineNumber))]}const c=(t=this._editor._getViewModel())===null||t===void 0?void 0:t.getPlainTextToCopy(o,s,Rs),d={multicursorText:Array.isArray(c)?c:null,pasteOnNewLine:l,mode:null},h=this._languageFeaturesService.documentPasteEditProvider.ordered(r).filter(m=>!!m.prepareDocumentPaste);if(!h.length){this.setCopyMetadata(e.clipboardData,{defaultPastePayload:d});return}const f=Ube(e.clipboardData),g=h.flatMap(m=>{var _;return(_=m.copyMimeTypes)!==null&&_!==void 0?_:[]}),p=T3();this.setCopyMetadata(e.clipboardData,{id:p,providerCopyMimeTypes:g,defaultPastePayload:d});const v=Io(async m=>{const _=lh(await Promise.all(h.map(async y=>{try{return await y.prepareDocumentPaste(r,a,f,m)}catch(S){console.error(S);return}})));_.reverse();for(const y of _)for(const[S,L]of y)f.replace(S,L);return f});(n=this._currentCopyOperation)===null||n===void 0||n.dataTransferPromise.cancel(),this._currentCopyOperation={handle:p,dataTransferPromise:v}}async handlePaste(e){var t,n,r,o,s;if(!e.clipboardData||!this._editor.hasTextFocus())return;(t=xa.get(this._editor))===null||t===void 0||t.closeMessage(),(n=this._currentPasteOperation)===null||n===void 0||n.cancel(),this._currentPasteOperation=void 0;const a=this._editor.getModel(),l=this._editor.getSelections();if(!(l!=null&&l.length)||!a||!this.isPasteAsEnabled()&&!this._pasteAsActionContext)return;const c=this.fetchCopyMetadata(e),u=jbe(e.clipboardData);u.delete(w9);const d=[...e.clipboardData.types,...(r=c==null?void 0:c.providerCopyMimeTypes)!==null&&r!==void 0?r:[],Cr.uriList],h=this._languageFeaturesService.documentPasteEditProvider.ordered(a).filter(f=>{var g,p;return!((g=this._pasteAsActionContext)===null||g===void 0)&&g.preferredId&&this._pasteAsActionContext.preferredId!==f.id?!1:(p=f.pasteMimeTypes)===null||p===void 0?void 0:p.some(v=>Vbe(v,d))});if(!h.length){!((o=this._pasteAsActionContext)===null||o===void 0)&&o.preferredId&&this.showPasteAsNoEditMessage(l,(s=this._pasteAsActionContext)===null||s===void 0?void 0:s.preferredId);return}e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,h,l,u,c,{trigger:"explicit",only:this._pasteAsActionContext.preferredId}):this.doPasteInline(h,l,u,c,{trigger:"implicit"})}showPasteAsNoEditMessage(e,t){var n;(n=xa.get(this._editor))===null||n===void 0||n.showMessage(w("pasteAsError","No paste edits for '{0}' found",t),e[0].getStartPosition())}doPasteInline(e,t,n,r,o){const s=Io(async a=>{const l=this._editor;if(!l.hasModel())return;const c=l.getModel(),u=new n_(l,3,void 0,a);try{if(await this.mergeInDataFromCopy(n,r,u.token),u.token.isCancellationRequested)return;const d=e.filter(f=>vae(f,n));if(!d.length||d.length===1&&d[0].id==="text"){await this.applyDefaultPasteHandler(n,r,u.token);return}const h=await this.getPasteEdits(d,n,c,t,o,u.token);if(u.token.isCancellationRequested)return;if(h.length===1&&h[0].providerId==="text"){await this.applyDefaultPasteHandler(n,r,u.token);return}if(h.length){const f=l.getOption(85).showPasteSelector==="afterPaste";return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:h},f,u.token)}await this.applyDefaultPasteHandler(n,r,u.token)}finally{u.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}});this._pasteProgressManager.showWhile(t[0].getEndPosition(),w("pasteIntoEditorProgress","Running paste handlers. Click to cancel"),s),this._currentPasteOperation=s}showPasteAsPick(e,t,n,r,o,s){const a=Io(async l=>{const c=this._editor;if(!c.hasModel())return;const u=c.getModel(),d=new n_(c,3,void 0,l);try{if(await this.mergeInDataFromCopy(r,o,d.token),d.token.isCancellationRequested)return;let h=t.filter(v=>vae(v,r));e&&(h=h.filter(v=>v.id===e));const f=await this.getPasteEdits(h,r,u,n,s,d.token);if(d.token.isCancellationRequested)return;if(!f.length){s.only&&this.showPasteAsNoEditMessage(n,s.only);return}let g;if(e)g=f.at(0);else{const v=await this._quickInputService.pick(f.map(m=>({label:m.label,description:m.providerId,detail:m.detail,edit:m})),{placeHolder:w("pasteAsPickerPlaceholder","Select Paste Action")});g=v==null?void 0:v.edit}if(!g)return;const p=Gbe(u.uri,n,g);await this._bulkEditService.apply(p,{editor:this._editor})}finally{d.dispose(),this._currentPasteOperation===a&&(this._currentPasteOperation=void 0)}});this._progressService.withProgress({location:10,title:w("pasteAsProgress","Running paste handlers")},()=>a)}setCopyMetadata(e,t){e.setData(w9,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const n=e.clipboardData.getData(w9);if(n)try{return JSON.parse(n)}catch{return}const[r,o]=MH.getTextData(e.clipboardData);if(o)return{defaultPastePayload:{mode:o.mode,multicursorText:(t=o.multicursorText)!==null&&t!==void 0?t:null,pasteOnNewLine:!!o.isFromEmptySelection}}}async mergeInDataFromCopy(e,t,n){var r;if(t!=null&&t.id&&((r=this._currentCopyOperation)===null||r===void 0?void 0:r.handle)===t.id){const o=await this._currentCopyOperation.dataTransferPromise;if(n.isCancellationRequested)return;for(const[s,a]of o)e.replace(s,a)}if(!e.has(Cr.uriList)){const o=await this._clipboardService.readResources();if(n.isCancellationRequested)return;o.length&&e.append(Cr.uriList,RY(N3.create(o)))}}async getPasteEdits(e,t,n,r,o,s){const a=await Rk(Promise.all(e.map(async c=>{var u;try{const d=await((u=c.provideDocumentPasteEdits)===null||u===void 0?void 0:u.call(c,n,r,t,o,s));if(d)return{...d,providerId:c.id}}catch(d){console.error(d)}})),s),l=lh(a??[]);return qbe(l)}async applyDefaultPasteHandler(e,t,n){var r,o,s;const a=(r=e.get(Cr.text))!==null&&r!==void 0?r:e.get("text");if(!a)return;const l=await a.asString();if(n.isCancellationRequested)return;const c={text:l,pasteOnNewLine:(o=t==null?void 0:t.defaultPastePayload.pasteOnNewLine)!==null&&o!==void 0?o:!1,multicursorText:(s=t==null?void 0:t.defaultPastePayload.multicursorText)!==null&&s!==void 0?s:null,mode:null};this._editor.trigger("keyboard","paste",c)}};Rp.ID="editor.contrib.copyPasteActionController";Rp=Az=Wtt([n1(1,Ot),n1(2,Xk),n1(3,Kp),n1(4,_t),n1(5,Eh),n1(6,P_e)],Rp);function vae(i,e){var t;return!!(!((t=i.pasteMimeTypes)===null||t===void 0)&&t.some(n=>e.matches(n)))}const Vb="9_cutcopypaste",$tt=Jd||document.queryCommandSupported("cut"),Qbe=Jd||document.queryCommandSupported("copy"),Htt=typeof navigator.clipboard>"u"||ru?document.queryCommandSupported("paste"):!0;function AY(i){return i.register(),i}const Vtt=$tt?AY(new ES({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Jd?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:$.MenubarEditMenu,group:"2_ccp",title:w({key:"miCut",comment:["&& denotes a mnemonic"]},"Cu&&t"),order:1},{menuId:$.EditorContext,group:Vb,title:w("actions.clipboard.cutLabel","Cut"),when:j.writable,order:1},{menuId:$.CommandPalette,group:"",title:w("actions.clipboard.cutLabel","Cut"),order:1},{menuId:$.SimpleEditorContext,group:Vb,title:w("actions.clipboard.cutLabel","Cut"),when:j.writable,order:1}]})):void 0,ztt=Qbe?AY(new ES({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Jd?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:$.MenubarEditMenu,group:"2_ccp",title:w({key:"miCopy",comment:["&& denotes a mnemonic"]},"&&Copy"),order:2},{menuId:$.EditorContext,group:Vb,title:w("actions.clipboard.copyLabel","Copy"),order:2},{menuId:$.CommandPalette,group:"",title:w("actions.clipboard.copyLabel","Copy"),order:1},{menuId:$.SimpleEditorContext,group:Vb,title:w("actions.clipboard.copyLabel","Copy"),order:2}]})):void 0;ts.appendMenuItem($.MenubarEditMenu,{submenu:$.MenubarCopy,title:$n("copy as","Copy As"),group:"2_ccp",order:3});ts.appendMenuItem($.EditorContext,{submenu:$.EditorContextCopy,title:$n("copy as","Copy As"),group:Vb,order:3});ts.appendMenuItem($.EditorContext,{submenu:$.EditorContextShare,title:$n("share","Share"),group:"11_share",order:-1,when:De.and(De.notEquals("resourceScheme","output"),j.editorTextFocus)});ts.appendMenuItem($.EditorTitleContext,{submenu:$.EditorTitleContextShare,title:$n("share","Share"),group:"11_share",order:-1});ts.appendMenuItem($.ExplorerContext,{submenu:$.ExplorerContextShare,title:$n("share","Share"),group:"11_share",order:-1});const S9=Htt?AY(new ES({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Jd?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:$.MenubarEditMenu,group:"2_ccp",title:w({key:"miPaste",comment:["&& denotes a mnemonic"]},"&&Paste"),order:4},{menuId:$.EditorContext,group:Vb,title:w("actions.clipboard.pasteLabel","Paste"),when:j.writable,order:4},{menuId:$.CommandPalette,group:"",title:w("actions.clipboard.pasteLabel","Paste"),order:1},{menuId:$.SimpleEditorContext,group:Vb,title:w("actions.clipboard.pasteLabel","Paste"),when:j.writable,order:4}]})):void 0;class Utt extends gt{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:w("actions.clipboard.copyWithSyntaxHighlightingLabel","Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:0,weight:100}})}run(e,t){!t.hasModel()||!t.getOption(37)&&t.getSelection().isEmpty()||(NH.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),NH.forceCopyWithSyntaxHighlighting=!1)}}function Jbe(i,e){i&&(i.addImplementation(1e4,"code-editor",(t,n)=>{const r=t.get(Un).getFocusedCodeEditor();if(r&&r.hasTextFocus()){const o=r.getOption(37),s=r.getSelection();return s&&s.isEmpty()&&!o||r.getContainerDomNode().ownerDocument.execCommand(e),!0}return!1}),i.addImplementation(0,"generic-dom",(t,n)=>(xS().execCommand(e),!0)))}Jbe(Vtt,"cut");Jbe(ztt,"copy");S9&&(S9.addImplementation(1e4,"code-editor",(i,e)=>{var t,n;const r=i.get(Un),o=i.get(Kp),s=r.getFocusedCodeEditor();return s&&s.hasTextFocus()?s.getContainerDomNode().ownerDocument.execCommand("paste")?(n=(t=Rp.get(s))===null||t===void 0?void 0:t.finishedPaste())!==null&&n!==void 0?n:Promise.resolve():S_?(async()=>{const l=await o.readText();if(l!==""){const c=jD.INSTANCE.get(l);let u=!1,d=null,h=null;c&&(u=s.getOption(37)&&!!c.isFromEmptySelection,d=typeof c.multicursorText<"u"?c.multicursorText:null,h=c.mode),s.trigger("keyboard","paste",{text:l,pasteOnNewLine:u,multicursorText:d,mode:h})}})():!0:!1}),S9.addImplementation(0,"generic-dom",(i,e)=>(xS().execCommand("paste"),!0)));Qbe&&Be(Utt);class Ut{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+Ut.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Ut(this.value+Ut.sep+e)}}Ut.sep=".";Ut.None=new Ut("@@none@@");Ut.Empty=new Ut("");Ut.QuickFix=new Ut("quickfix");Ut.Refactor=new Ut("refactor");Ut.RefactorExtract=Ut.Refactor.append("extract");Ut.RefactorInline=Ut.Refactor.append("inline");Ut.RefactorMove=Ut.Refactor.append("move");Ut.RefactorRewrite=Ut.Refactor.append("rewrite");Ut.Notebook=new Ut("notebook");Ut.Source=new Ut("source");Ut.SourceOrganizeImports=Ut.Source.append("organizeImports");Ut.SourceFixAll=Ut.Source.append("fixAll");Ut.SurroundWith=Ut.Refactor.append("surround");var Tl;(function(i){i.Refactor="refactor",i.RefactorPreview="refactor preview",i.Lightbulb="lightbulb",i.Default="other (default)",i.SourceAction="source action",i.QuickFix="quick fix action",i.FixAll="fix all",i.OrganizeImports="organize imports",i.AutoFix="auto fix",i.QuickFixHover="quick fix hover window",i.OnSave="save participants",i.ProblemsView="problems view"})(Tl||(Tl={}));function jtt(i,e){return!(i.include&&!i.include.intersects(e)||i.excludes&&i.excludes.some(t=>eCe(e,t,i.include))||!i.includeSourceActions&&Ut.Source.contains(e))}function Ktt(i,e){const t=e.kind?new Ut(e.kind):void 0;return!(i.include&&(!t||!i.include.contains(t))||i.excludes&&t&&i.excludes.some(n=>eCe(t,n,i.include))||!i.includeSourceActions&&t&&Ut.Source.contains(t)||i.onlyIncludePreferredActions&&!e.isPreferred)}function eCe(i,e,t){return!(!e.contains(i)||t&&e.contains(t))}class _f{static fromUser(e,t){return!e||typeof e!="object"?new _f(t.kind,t.apply,!1):new _f(_f.getKindFromUser(e,t.kind),_f.getApplyFromUser(e,t.apply),_f.getPreferredUser(e))}static getApplyFromUser(e,t){switch(typeof e.apply=="string"?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return typeof e.kind=="string"?new Ut(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,n){this.kind=e,this.apply=t,this.preferred=n}}class Gtt{constructor(e,t,n){this.action=e,this.provider=t,this.highlightRange=n}async resolve(e){var t;if(!((t=this.provider)===null||t===void 0)&&t.resolveCodeAction&&!this.action.edit){let n;try{n=await this.provider.resolveCodeAction(this.action,e)}catch(r){Zr(r)}n&&(this.action.edit=n.edit)}return this}}const tCe="editor.action.codeAction",PY="editor.action.quickFix",nCe="editor.action.autoFix",iCe="editor.action.refactor",rCe="editor.action.sourceAction",OY="editor.action.organizeImports",FY="editor.action.fixAll";class RE extends fe{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return e.isAI&&!t.isAI?1:!e.isAI&&t.isAI?-1:Ts(e.diagnostics)?Ts(t.diagnostics)?RE.codeActionsPreferredComparator(e,t):-1:Ts(t.diagnostics)?1:RE.codeActionsPreferredComparator(e,t)}constructor(e,t,n){super(),this.documentation=t,this._register(n),this.allActions=[...e].sort(RE.codeActionsComparator),this.validActions=this.allActions.filter(({action:r})=>!r.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&Ut.QuickFix.contains(new Ut(e.kind))&&!!e.isPreferred)}get hasAIFix(){return this.validActions.some(({action:e})=>!!e.isAI)}get allAIFixes(){return this.validActions.every(({action:e})=>!!e.isAI)}}const _ae={actions:[],documentation:void 0};async function ME(i,e,t,n,r,o){var s;const a=n.filter||{},l={...a,excludes:[...a.excludes||[],Ut.Notebook]},c={only:(s=a.include)===null||s===void 0?void 0:s.value,trigger:n.type},u=new LY(e,o),d=n.type===2,h=qtt(i,e,d?l:a),f=new Te,g=h.map(async v=>{try{r.report(v);const m=await v.provideCodeActions(e,t,c,u.token);if(m&&f.add(m),u.token.isCancellationRequested)return _ae;const _=((m==null?void 0:m.actions)||[]).filter(S=>S&&Ktt(a,S)),y=Ytt(v,_,a.include);return{actions:_.map(S=>new Gtt(S,v)),documentation:y}}catch(m){if(wh(m))throw m;return Zr(m),_ae}}),p=i.onDidChange(()=>{const v=i.all(e);or(v,h)||u.cancel()});try{const v=await Promise.all(g),m=v.map(y=>y.actions).flat(),_=[...lh(v.map(y=>y.documentation)),...Xtt(i,e,n,m)];return new RE(m,_,f)}finally{p.dispose(),u.dispose()}}function qtt(i,e,t){return i.all(e).filter(n=>n.providedCodeActionKinds?n.providedCodeActionKinds.some(r=>jtt(t,new Ut(r))):!0)}function*Xtt(i,e,t,n){var r,o,s;if(e&&n.length)for(const a of i.all(e))a._getAdditionalMenuItems&&(yield*(r=a._getAdditionalMenuItems)===null||r===void 0?void 0:r.call(a,{trigger:t.type,only:(s=(o=t.filter)===null||o===void 0?void 0:o.include)===null||s===void 0?void 0:s.value},n.map(l=>l.action)))}function Ytt(i,e,t){if(!i.documentation)return;const n=i.documentation.map(r=>({kind:new Ut(r.kind),command:r.command}));if(t){let r;for(const o of n)o.kind.contains(t)&&(r?r.kind.contains(o.kind)&&(r=o):r=o);if(r)return r==null?void 0:r.command}for(const r of e)if(r.kind){for(const o of n)if(o.kind.contains(new Ut(r.kind)))return o.command}}var Jy;(function(i){i.OnSave="onSave",i.FromProblemsView="fromProblemsView",i.FromCodeActions="fromCodeActions",i.FromAILightbulb="fromAILightbulb"})(Jy||(Jy={}));async function Ztt(i,e,t,n,r=Cn.None){var o;const s=i.get(Xk),a=i.get(sr),l=i.get(ea),c=i.get($r);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),await e.resolve(r),!r.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(await s.apply(e.action.edit,{editor:n==null?void 0:n.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Jy.OnSave,showPreview:n==null?void 0:n.preview})).isApplied)&&e.action.command)try{await a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(u){const d=Qtt(u);c.error(typeof d=="string"?d:w("applyCodeActionFailed","An unknown error occurred while applying the code action"))}}function Qtt(i){return typeof i=="string"?i:i instanceof Error&&typeof i.message=="string"?i.message:void 0}Dn.registerCommand("_executeCodeActionProvider",async function(i,e,t,n,r){if(!(e instanceof At))throw eu();const{codeActionProvider:o}=i.get(_t),s=i.get(tr).getModel(e);if(!s)throw eu();const a=yt.isISelection(t)?yt.liftSelection(t):B.isIRange(t)?s.validateRange(t):void 0;if(!a)throw eu();const l=typeof n=="string"?new Ut(n):void 0,c=await ME(o,s,a,{type:1,triggerAction:Tl.Default,filter:{includeSourceActions:!0,include:l}},mp.None,Cn.None),u=[],d=Math.min(c.validActions.length,typeof r=="number"?r:0);for(let h=0;hh.action)}finally{setTimeout(()=>c.dispose(),100)}});var Jtt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},ent=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Pz;let fO=Pz=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Qf(()=>this.keybindingService.getKeybindings().filter(t=>Pz.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let n=t.commandArgs;return t.command===OY?n={kind:Ut.SourceOrganizeImports.value}:t.command===FY&&(n={kind:Ut.SourceFixAll.value}),{resolvedKeybinding:t.resolvedKeybinding,..._f.fromUser(n,{kind:Ut.None,apply:"never"})}}));return t=>{if(t.kind){const n=this.bestKeybindingForCodeAction(t,e.value);return n==null?void 0:n.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const n=new Ut(e.kind);return t.filter(r=>r.kind.contains(n)).filter(r=>r.preferred?e.isPreferred:!0).reduceRight((r,o)=>r?r.kind.contains(o.kind)?o:r:o,void 0)}};fO.codeActionCommands=[iCe,tCe,rCe,OY,FY];fO=Pz=Jtt([ent(0,ci)],fO);X("symbolIcon.arrayForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.booleanForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.colorForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.constantForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},w("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.fileForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.folderForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.keyForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.keywordForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},w("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.moduleForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.namespaceForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.nullForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.numberForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.objectForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.operatorForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.packageForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.propertyForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.referenceForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.snippetForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.stringForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.structForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.textForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.typeParameterForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.unitForeground",{dark:qe,light:qe,hcDark:qe,hcLight:qe},w("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));X("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},w("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const oCe=Object.freeze({kind:Ut.Empty,title:w("codeAction.widget.id.more","More Actions...")}),tnt=Object.freeze([{kind:Ut.QuickFix,title:w("codeAction.widget.id.quickfix","Quick Fix")},{kind:Ut.RefactorExtract,title:w("codeAction.widget.id.extract","Extract"),icon:Xe.wrench},{kind:Ut.RefactorInline,title:w("codeAction.widget.id.inline","Inline"),icon:Xe.wrench},{kind:Ut.RefactorRewrite,title:w("codeAction.widget.id.convert","Rewrite"),icon:Xe.wrench},{kind:Ut.RefactorMove,title:w("codeAction.widget.id.move","Move"),icon:Xe.wrench},{kind:Ut.SurroundWith,title:w("codeAction.widget.id.surround","Surround With"),icon:Xe.surroundWith},{kind:Ut.Source,title:w("codeAction.widget.id.source","Source Action"),icon:Xe.symbolFile},oCe]);function nnt(i,e,t){if(!e)return i.map(o=>{var s;return{kind:"action",item:o,group:oCe,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!(!((s=o.action.edit)===null||s===void 0)&&s.edits.length)}});const n=tnt.map(o=>({group:o,actions:[]}));for(const o of i){const s=o.action.kind?new Ut(o.action.kind):Ut.None;for(const a of n)if(a.group.kind.contains(s)){a.actions.push(o);break}}const r=[];for(const o of n)if(o.actions.length){r.push({kind:"header",group:o.group});for(const s of o.actions){const a=o.group;r.push({kind:"action",item:s,group:s.action.isAI?{title:a.title,kind:a.kind,icon:Xe.sparkle}:a,label:s.action.title,disabled:!!s.action.disabled,keybinding:t(s.action)})}}return r}var int=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bae=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},Oz,_y;(function(i){i.Hidden={type:0};class e{constructor(n,r,o,s){this.actions=n,this.trigger=r,this.editorPosition=o,this.widgetPosition=s,this.type=1}}i.Showing=e})(_y||(_y={}));let zb=Oz=class extends fe{constructor(e,t,n){super(),this._editor=e,this._keybindingService=t,this._onClick=this._register(new se),this.onClick=this._onClick.event,this._state=_y.Hidden,this._iconClasses=[],this._domNode=He("div.lightBulbWidget"),this._register(wi.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(r=>{const o=this._editor.getModel();(this.state.type!==1||!o||this.state.editorPosition.lineNumber>=o.getLineCount())&&this.hide()})),this._register(GBe(this._domNode,r=>{if(this.state.type!==1)return;this._editor.focus(),r.preventDefault();const{top:o,height:s}=Br(this._domNode),a=this._editor.getOption(67);let l=Math.floor(a/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(r.buttons&1)===1&&this.hide()})),this._register(Je.runAndSubscribe(this._keybindingService.onDidUpdateKeybindings,()=>{var r,o,s,a;this._preferredKbLabel=(o=(r=this._keybindingService.lookupKeybinding(nCe))===null||r===void 0?void 0:r.getLabel())!==null&&o!==void 0?o:void 0,this._quickFixKbLabel=(a=(s=this._keybindingService.lookupKeybinding(PY))===null||s===void 0?void 0:s.getLabel())!==null&&a!==void 0?a:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,n){if(e.validActions.length<=0)return this.hide();if(!this._editor.getOptions().get(65).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:s,column:a}=o.validatePosition(n),l=o.getOptions().tabSize,c=this._editor.getOptions().get(50),u=o.getLineContent(s),d=H4(u,l),h=c.spaceWidth*d>22,f=v=>v>2&&this._editor.getTopForLineNumber(v)===this._editor.getTopForLineNumber(v-1);let g=s,p=1;if(!h){if(s>1&&!f(s-1))g-=1;else if(s=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Fz=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const aCe="acceptSelectedCodeAction",lCe="previewSelectedCodeAction";class rnt{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,n){var r,o;n.text.textContent=(o=(r=e.group)===null||r===void 0?void 0:r.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let Bz=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const n=document.createElement("span");n.className="title",e.append(n);const r=new PS(e,yl);return{container:e,icon:t,text:n,keybinding:r}}renderElement(e,t,n){var r,o,s;if(!((r=e.group)===null||r===void 0)&&r.icon?(n.icon.className=Wt.asClassName(e.group.icon),e.group.icon.color&&(n.icon.style.color=ht(e.group.icon.color.id))):(n.icon.className=Wt.asClassName(Xe.lightBulb),n.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;n.text.textContent=cCe(e.label),n.keybinding.set(e.keybinding),l8e(!!e.keybinding,n.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(aCe))===null||o===void 0?void 0:o.getLabel(),l=(s=this._keybindingService.lookupKeybinding(lCe))===null||s===void 0?void 0:s.getLabel();n.container.classList.toggle("option-disabled",e.disabled),e.disabled?n.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?n.container.title=w({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):n.container.title=w({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):n.container.title=""}disposeTemplate(e){}};Bz=sCe([Fz(1,ci)],Bz);class ont extends UIEvent{constructor(){super("acceptSelectedAction")}}class Cae extends UIEvent{constructor(){super("previewSelectedAction")}}function snt(i){if(i.kind==="action")return i.label}let Wz=class extends fe{constructor(e,t,n,r,o,s){super(),this._delegate=r,this._contextViewService=o,this._keybindingService=s,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new wr),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new wc(e,this.domNode,a,[new Bz(t,this._keybindingService),new rnt],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:snt},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?cCe(l==null?void 0:l.label):"";return l.disabled&&(c=w({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>w({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(N_),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=n,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(l=>l.kind==="header").length,r=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(r);let o=e;if(this._allMenuItems.length>=50)o=380;else{const l=this._allMenuItems.map((c,u)=>{const d=this.domNode.ownerDocument.getElementById(this._list.getElementID(u));if(d){d.style.width="auto";const h=d.getBoundingClientRect().width;return d.style.width="",h}return 0});o=Math.max(...l,e)}const s=.7,a=Math.min(r,this.domNode.ownerDocument.body.clientHeight*s);return this._list.layout(a,o),this.domNode.style.height=`${a}px`,this._list.domFocus(),o}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const n=t[0],r=this._list.element(n);if(!this.focusCondition(r))return;const o=e?new Cae:new ont;this._list.setSelection([n],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof Cae):this._list.setSelection([])}onFocus(){var e,t;const n=this._list.getFocus();if(n.length===0)return;const r=n[0],o=this._list.element(r);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,o.item)}async onListHover(e){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const n=await this._delegate.onHover(t.item,this.cts.token);t.canPreview=n?n.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};Wz=sCe([Fz(4,ng),Fz(5,ci)],Wz);function cCe(i){return i.replace(/\r\n|\r|\n/g," ")}var ant=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},x9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};X("actionBar.toggledBackground",{dark:B0,light:B0,hcDark:B0,hcLight:B0},w("actionBar.toggledBackground","Background color for toggled action items in action bar."));const Ub={Visible:new st("codeActionMenuVisible",!1,w("codeActionMenuVisible","Whether the action widget list is visible"))},CC=yn("actionWidgetService");let jb=class extends fe{get isVisible(){return Ub.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,n){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=n,this._list=this._register(new Ho)}show(e,t,n,r,o,s,a){const l=Ub.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(Wz,e,t,n,r);this._contextViewService.showContextView({getAnchor:()=>o,render:u=>(l.set(!0),this._renderWidget(u,c,a??[])),onHide:u=>{l.reset(),this._onWidgetClosed(u)}},s,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,n){var r;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const s=new Te,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),s.add(ye(l,Ge.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),u=e.appendChild(c);u.classList.add("context-view-pointerBlock"),s.add(ye(u,Ge.POINTER_MOVE,()=>u.remove())),s.add(ye(u,Ge.MOUSE_DOWN,()=>u.remove()));let d=0;if(n.length){const g=this._createActionBar(".action-widget-action-bar",n);g&&(o.appendChild(g.getContainer().parentElement),s.add(g),d=g.getContainer().offsetWidth)}const h=(r=this._list.value)===null||r===void 0?void 0:r.layout(d);o.style.width=`${h}px`;const f=s.add(dh(e));return s.add(f.onDidBlur(()=>this.hide())),s}_createActionBar(e,t){if(!t.length)return;const n=He(e),r=new au(n);return r.push(t,{icon:!1,label:!0}),r}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};jb=ant([x9(0,ng),x9(1,Vt),x9(2,Ot)],jb);In(CC,jb,1);const cT=100+1e3;Ei(class extends sl{constructor(){super({id:"hideCodeActionWidget",title:$n("hideCodeActionWidget.title","Hide action widget"),precondition:Ub.Visible,keybinding:{weight:cT,primary:9,secondary:[1033]}})}run(i){i.get(CC).hide()}});Ei(class extends sl{constructor(){super({id:"selectPrevCodeAction",title:$n("selectPrevCodeAction.title","Select previous action"),precondition:Ub.Visible,keybinding:{weight:cT,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(i){const e=i.get(CC);e instanceof jb&&e.focusPrevious()}});Ei(class extends sl{constructor(){super({id:"selectNextCodeAction",title:$n("selectNextCodeAction.title","Select next action"),precondition:Ub.Visible,keybinding:{weight:cT,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(i){const e=i.get(CC);e instanceof jb&&e.focusNext()}});Ei(class extends sl{constructor(){super({id:aCe,title:$n("acceptSelected.title","Accept selected action"),precondition:Ub.Visible,keybinding:{weight:cT,primary:3,secondary:[2137]}})}run(i){const e=i.get(CC);e instanceof jb&&e.acceptSelected()}});Ei(class extends sl{constructor(){super({id:lCe,title:$n("previewSelected.title","Preview selected action"),precondition:Ub.Visible,keybinding:{weight:cT,primary:2051}})}run(i){const e=i.get(CC);e instanceof jb&&e.acceptSelected(!0)}});const uCe=new st("supportedCodeAction",""),yae="_typescript.applyFixAllCodeAction";class lnt extends fe{constructor(e,t,n,r=250){super(),this._editor=e,this._markerService=t,this._signalChange=n,this._delay=r,this._autoTriggerTimer=this._register(new cd),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(n=>hX(n,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:Tl.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getSelection();if(e.type===1)return t;const n=this._editor.getOption(65).enabled;if(n!==Fu.Off){{if(n===Fu.On)return t;if(n===Fu.OnCode){if(!t.isEmpty())return t;const o=this._editor.getModel(),{lineNumber:s,column:a}=t.getPosition(),l=o.getLineContent(s);if(l.length===0)return;if(a===1){if(/\s/.test(l[0]))return}else if(a===o.getLineMaxColumn(s)){if(/\s/.test(l[l.length-1]))return}else if(/\s/.test(l[a-2])&&/\s/.test(l[a-1]))return}}return t}}}var T0;(function(i){i.Empty={type:0};class e{constructor(n,r,o){this.trigger=n,this.position=r,this._cancellablePromise=o,this.type=1,this.actions=o.catch(s=>{if(wh(s))return dCe;throw s})}cancel(){this._cancellablePromise.cancel()}}i.Triggered=e})(T0||(T0={}));const dCe=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1,hasAIFix:!1,allAIFixes:!1});class cnt extends fe{constructor(e,t,n,r,o,s){super(),this._editor=e,this._registry=t,this._markerService=n,this._progressService=o,this._configurationService=s,this._codeActionOracle=this._register(new Ho),this._state=T0.Empty,this._onDidChangeState=this._register(new se),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=uCe.bindTo(r),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._register(this._editor.onDidChangeConfiguration(a=>{a.hasChanged(65)&&this._update()})),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(T0.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickFixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(T0.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(91)){const t=this._registry.all(e).flatMap(n=>{var r;return(r=n.providedCodeActionKinds)!==null&&r!==void 0?r:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new lnt(this._editor,this._markerService,n=>{var r;if(!n){this.setState(T0.Empty);return}const o=n.selection.getStartPosition(),s=Io(async a=>{var l,c,u,d,h,f,g,p,v,m;if(this._settingEnabledNearbyQuickfixes()&&n.trigger.type===1&&(n.trigger.triggerAction===Tl.QuickFix||!((c=(l=n.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0)&&c.contains(Ut.QuickFix))){const _=await ME(this._registry,e,n.selection,n.trigger,mp.None,a),y=[..._.allActions];if(a.isCancellationRequested)return dCe;const S=(u=_.validActions)===null||u===void 0?void 0:u.some(E=>E.action.kind?Ut.QuickFix.contains(new Ut(E.action.kind)):!1),L=this._markerService.read({resource:e.uri});if(S){for(const E of _.validActions)!((h=(d=E.action.command)===null||d===void 0?void 0:d.arguments)===null||h===void 0)&&h.some(D=>typeof D=="string"&&D.includes(yae))&&(E.action.diagnostics=[...L.filter(D=>D.relatedInformation)]);return{validActions:_.validActions,allActions:y,documentation:_.documentation,hasAutoFix:_.hasAutoFix,hasAIFix:_.hasAIFix,allAIFixes:_.allAIFixes,dispose:()=>{_.dispose()}}}else if(!S&&L.length>0){const E=n.selection.getPosition();let D=E,k=Number.MAX_VALUE;const T=[..._.validActions];for(const A of L){const N=A.endColumn,R=A.endLineNumber,F=A.startLineNumber;if(R===E.lineNumber||F===E.lineNumber){D=new ae(R,N);const W={type:n.trigger.type,triggerAction:n.trigger.triggerAction,filter:{include:!((f=n.trigger.filter)===null||f===void 0)&&f.include?(g=n.trigger.filter)===null||g===void 0?void 0:g.include:Ut.QuickFix},autoApply:n.trigger.autoApply,context:{notAvailableMessage:((p=n.trigger.context)===null||p===void 0?void 0:p.notAvailableMessage)||"",position:D}},H=new yt(D.lineNumber,D.column,D.lineNumber,D.column),G=await ME(this._registry,e,H,W,mp.None,a);if(G.validActions.length!==0){for(const U of G.validActions)!((m=(v=U.action.command)===null||v===void 0?void 0:v.arguments)===null||m===void 0)&&m.some(K=>typeof K=="string"&&K.includes(yae))&&(U.action.diagnostics=[...L.filter(K=>K.relatedInformation)]);_.allActions.length===0&&y.push(...G.allActions),Math.abs(E.column-N)R.findIndex(F=>F.action.title===A.action.title)===N);return M.sort((A,N)=>A.action.isPreferred&&!N.action.isPreferred?-1:!A.action.isPreferred&&N.action.isPreferred||A.action.isAI&&!N.action.isAI?1:!A.action.isAI&&N.action.isAI?-1:0),{validActions:M,allActions:y,documentation:_.documentation,hasAutoFix:_.hasAutoFix,hasAIFix:_.hasAIFix,allAIFixes:_.allAIFixes,dispose:()=>{_.dispose()}}}}return ME(this._registry,e,n.selection,n.trigger,mp.None,a)});n.trigger.type===1&&((r=this._progressService)===null||r===void 0||r.showWhile(s,250)),this.setState(new T0.Triggered(n.trigger,o,s))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:Tl.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var unt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},_g=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},T1;const dnt="quickfix-edit-highlight";let i_=T1=class extends fe{static get(e){return e.getContribution(T1.ID)}constructor(e,t,n,r,o,s,a,l,c,u){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=u,this._activeCodeActions=this._register(new Ho),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new cnt(this._editor,o.codeActionProvider,t,n,s,l)),this._register(this._model.onDidChangeState(d=>this.update(d))),this._lightBulbWidget=new Qf(()=>{const d=this._editor.getContribution(zb.ID);return d&&this._register(d.onClick(h=>this.showCodeActionsFromLightbulb(h.actions,h))),d}),this._resolver=r.createInstance(fO),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}async showCodeActionsFromLightbulb(e,t){if(e.allAIFixes&&e.validActions.length===1){const n=e.validActions[0],r=n.action.command;r&&r.id==="inlineChat.start"&&r.arguments&&r.arguments.length>=1&&(r.arguments[0]={...r.arguments[0],autoSend:!1}),await this._applyCodeAction(n,!1,!1,Jy.FromAILightbulb);return}await this.showCodeActionList(e,t,{includeDisabledActions:!1,fromLightbulb:!0})}showCodeActions(e,t,n){return this.showCodeActionList(t,n,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,n,r){var o;if(!this._editor.hasModel())return;(o=xa.get(this._editor))===null||o===void 0||o.closeMessage();const s=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:n,autoApply:r,context:{notAvailableMessage:e,position:s}})}_trigger(e){return this._model.trigger(e)}async _applyCodeAction(e,t,n,r){try{await this._instantiationService.invokeFunction(Ztt,e,r,{preview:n,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:Tl.QuickFix,filter:{}})}}async update(e){var t,n,r,o,s,a,l;if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let c;try{c=await e.actions}catch(u){en(u);return}if(!this._disposed)if((n=this._lightBulbWidget.value)===null||n===void 0||n.update(c,e.trigger,e.position),e.trigger.type===1){if(!((r=e.trigger.filter)===null||r===void 0)&&r.include){const d=this.tryGetValidActionToApply(e.trigger,c);if(d){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),await this._applyCodeAction(d,!1,!1,Jy.FromCodeActions)}finally{c.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,c);if(h&&h.action.disabled){(s=xa.get(this._editor))===null||s===void 0||s.showMessage(h.action.disabled,e.trigger.context.position),c.dispose();return}}}const u=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!c.allActions.length||!u&&!c.validActions.length)){(l=xa.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=c,c.dispose();return}this._activeCodeActions.value=c,this.showCodeActionList(c,this.toCoords(e.position),{includeDisabledActions:u,fromLightbulb:!1})}else this._actionWidgetService.isVisible?c.dispose():this._activeCodeActions.value=c}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action:n})=>n.disabled)}tryGetValidActionToApply(e,t){if(t.validActions.length&&(e.autoApply==="first"&&t.validActions.length>0||e.autoApply==="ifSingle"&&t.validActions.length===1))return t.validActions[0]}async showCodeActionList(e,t,n){const r=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const s=n.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!s.length)return;const a=ae.isIPosition(t)?this.toCoords(t):t,l={onSelect:async(c,u)=>{this._applyCodeAction(c,!0,!!u,Jy.FromCodeActions),this._actionWidgetService.hide(),r.clear()},onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),r.clear()},onHover:async(c,u)=>{var d;if(!u.isCancellationRequested)return{canPreview:!!(!((d=c.action.edit)===null||d===void 0)&&d.edits.length)}},onFocus:c=>{var u,d;if(c&&c.action){const h=c.action.ranges,f=c.action.diagnostics;if(r.clear(),h&&h.length>0){const g=f&&(f==null?void 0:f.length)>1?f.map(p=>({range:p,options:T1.DECORATION})):h.map(p=>({range:p,options:T1.DECORATION}));r.set(g)}else if(f&&f.length>0){const g=f.map(v=>({range:v,options:T1.DECORATION}));r.set(g);const p=f[0];if(p.startLineNumber&&p.startColumn){const v=(d=(u=this._editor.getModel())===null||u===void 0?void 0:u.getWordAtPosition({lineNumber:p.startLineNumber,column:p.startColumn}))===null||d===void 0?void 0:d.word;Hf(w("editingNewSelection","Context: {0} at line {1} and column {2}.",v,p.startLineNumber,p.startColumn))}}}else r.clear()}};this._actionWidgetService.show("codeActionWidget",!0,nnt(s,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,o,this._getActionBarActions(e,t,n))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),n=Br(this._editor.getDomNode()),r=n.left+t.left,o=n.top+t.top+t.height;return{x:r,y:o}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,n){if(n.fromLightbulb)return[];const r=e.documentation.map(o=>{var s;return{id:o.id,label:o.title,tooltip:(s=o.tooltip)!==null&&s!==void 0?s:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(o.id,...(a=o.arguments)!==null&&a!==void 0?a:[])}}});return n.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&r.push(this._showDisabled?{id:"hideMoreActions",label:w("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,n))}:{id:"showMoreActions",label:w("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,n))}),r}};i_.ID="editor.contrib.codeActionController";i_.DECORATION=sn.register({description:"quickfix-highlight",className:dnt});i_=T1=unt([_g(1,ig),_g(2,Vt),_g(3,Ot),_g(4,_t),_g(5,k_),_g(6,sr),_g(7,gn),_g(8,CC),_g(9,Ot)],i_);fu((i,e)=>{((r,o)=>{o&&e.addRule(`.monaco-editor ${r} { background-color: ${o}; }`)})(".quickfix-edit-highlight",i.getColor(ep));const n=i.getColor(qm);n&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${ih(i.type)?"dotted":"solid"} ${n}; box-sizing: border-box; }`)});function uT(i){return De.regex(uCe.keys()[0],new RegExp("(\\s|^)"+fc(i.value)+"\\b"))}const BY={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:w("args.schema.kind","Kind of the code action to run.")},apply:{type:"string",description:w("args.schema.apply","Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[w("args.schema.apply.first","Always apply the first returned code action."),w("args.schema.apply.ifSingle","Apply the first returned code action if it is the only one."),w("args.schema.apply.never","Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:w("args.schema.preferred","Controls if only preferred code actions should be returned.")}}};function yC(i,e,t,n,r=Tl.Default){if(i.hasModel()){const o=i_.get(i);o==null||o.manualTriggerAtCurrentPosition(e,r,t,n)}}class hnt extends gt{constructor(){super({id:PY,label:w("quickfix.trigger.label","Quick Fix..."),alias:"Quick Fix...",precondition:De.and(j.writable,j.hasCodeActionsProvider),kbOpts:{kbExpr:j.textInputFocus,primary:2137,weight:100}})}run(e,t){return yC(t,w("editor.action.quickFix.noneMessage","No code actions available"),void 0,void 0,Tl.QuickFix)}}class fnt extends Vo{constructor(){super({id:tCe,precondition:De.and(j.writable,j.hasCodeActionsProvider),metadata:{description:"Trigger a code action",args:[{name:"args",schema:BY}]}})}runEditorCommand(e,t,n){const r=_f.fromUser(n,{kind:Ut.Empty,apply:"ifSingle"});return yC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.codeAction.noneMessage.preferred.kind","No preferred code actions for '{0}' available",n.kind):w("editor.action.codeAction.noneMessage.kind","No code actions for '{0}' available",n.kind):r.preferred?w("editor.action.codeAction.noneMessage.preferred","No preferred code actions available"):w("editor.action.codeAction.noneMessage","No code actions available"),{include:r.kind,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply)}}class gnt extends gt{constructor(){super({id:iCe,label:w("refactor.label","Refactor..."),alias:"Refactor...",precondition:De.and(j.writable,j.hasCodeActionsProvider),kbOpts:{kbExpr:j.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:De.and(j.writable,uT(Ut.Refactor))},metadata:{description:"Refactor...",args:[{name:"args",schema:BY}]}})}run(e,t,n){const r=_f.fromUser(n,{kind:Ut.Refactor,apply:"never"});return yC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.refactor.noneMessage.preferred.kind","No preferred refactorings for '{0}' available",n.kind):w("editor.action.refactor.noneMessage.kind","No refactorings for '{0}' available",n.kind):r.preferred?w("editor.action.refactor.noneMessage.preferred","No preferred refactorings available"):w("editor.action.refactor.noneMessage","No refactorings available"),{include:Ut.Refactor.contains(r.kind)?r.kind:Ut.None,onlyIncludePreferredActions:r.preferred},r.apply,Tl.Refactor)}}class pnt extends gt{constructor(){super({id:rCe,label:w("source.label","Source Action..."),alias:"Source Action...",precondition:De.and(j.writable,j.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:De.and(j.writable,uT(Ut.Source))},metadata:{description:"Source Action...",args:[{name:"args",schema:BY}]}})}run(e,t,n){const r=_f.fromUser(n,{kind:Ut.Source,apply:"never"});return yC(t,typeof(n==null?void 0:n.kind)=="string"?r.preferred?w("editor.action.source.noneMessage.preferred.kind","No preferred source actions for '{0}' available",n.kind):w("editor.action.source.noneMessage.kind","No source actions for '{0}' available",n.kind):r.preferred?w("editor.action.source.noneMessage.preferred","No preferred source actions available"):w("editor.action.source.noneMessage","No source actions available"),{include:Ut.Source.contains(r.kind)?r.kind:Ut.None,includeSourceActions:!0,onlyIncludePreferredActions:r.preferred},r.apply,Tl.SourceAction)}}class mnt extends gt{constructor(){super({id:OY,label:w("organizeImports.label","Organize Imports"),alias:"Organize Imports",precondition:De.and(j.writable,uT(Ut.SourceOrganizeImports)),kbOpts:{kbExpr:j.textInputFocus,primary:1581,weight:100}})}run(e,t){return yC(t,w("editor.action.organize.noneMessage","No organize imports action available"),{include:Ut.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",Tl.OrganizeImports)}}class vnt extends gt{constructor(){super({id:FY,label:w("fixAll.label","Fix All"),alias:"Fix All",precondition:De.and(j.writable,uT(Ut.SourceFixAll))})}run(e,t){return yC(t,w("fixAll.noneMessage","No fix all action available"),{include:Ut.SourceFixAll,includeSourceActions:!0},"ifSingle",Tl.FixAll)}}class _nt extends gt{constructor(){super({id:nCe,label:w("autoFix.label","Auto Fix..."),alias:"Auto Fix...",precondition:De.and(j.writable,uT(Ut.QuickFix)),kbOpts:{kbExpr:j.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return yC(t,w("editor.action.autoFix.noneMessage","No auto fixes available"),{include:Ut.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",Tl.AutoFix)}}jn(i_.ID,i_,3);jn(zb.ID,zb,4);Be(hnt);Be(gnt);Be(pnt);Be(mnt);Be(_nt);Be(vnt);et(new fnt);ar.as(xh.Configuration).registerConfiguration({...Z4,properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:w("showCodeActionHeaders","Enable/disable showing group headers in the Code Action menu."),default:!0}}});ar.as(xh.Configuration).registerConfiguration({...Z4,properties:{"editor.codeActionWidget.includeNearbyQuickFixes":{type:"boolean",scope:5,description:w("includeNearbyQuickFixes","Enable/disable showing nearest Quick Fix within a line when not currently on a diagnostic."),default:!0}}});class $z{constructor(){this.lenses=[],this._disposables=new Te}dispose(){this._disposables.dispose()}get isDisposed(){return this._disposables.isDisposed}add(e,t){this._disposables.add(e);for(const n of e.lenses)this.lenses.push({symbol:n,provider:t})}}async function hCe(i,e,t){const n=i.ordered(e),r=new Map,o=new $z,s=n.map(async(a,l)=>{r.set(a,l);try{const c=await Promise.resolve(a.provideCodeLenses(e,t));c&&o.add(c,a)}catch(c){Zr(c)}});return await Promise.all(s),o.lenses=o.lenses.sort((a,l)=>a.symbol.range.startLineNumberl.symbol.range.startLineNumber?1:r.get(a.provider)r.get(l.provider)?1:a.symbol.range.startColumnl.symbol.range.startColumn?1:0),o}Dn.registerCommand("_executeCodeLensProvider",function(i,...e){let[t,n]=e;Xn(At.isUri(t)),Xn(typeof n=="number"||!n);const{codeLensProvider:r}=i.get(_t),o=i.get(tr).getModel(t);if(!o)throw eu();const s=[],a=new Te;return hCe(r,o,Cn.None).then(l=>{a.add(l);const c=[];for(const u of l.lenses)n==null||u.symbol.command?s.push(u.symbol):n-- >0&&u.provider.resolveCodeLens&&c.push(Promise.resolve(u.provider.resolveCodeLens(o,u.symbol,Cn.None)).then(d=>s.push(d||u.symbol)));return Promise.all(c)}).then(()=>s).finally(()=>{setTimeout(()=>a.dispose(),100)})});var bnt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cnt=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const fCe=yn("ICodeLensCache");class wae{constructor(e,t){this.lineCount=e,this.data=t}}let Hz=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new E_(20,.75);const t="codelens/cache";yL(hi,()=>e.remove(t,1));const n="codelens/cache2",r=e.get(n,1,"{}");this._deserialize(r),Je.once(e.onWillSaveState)(o=>{o.reason===cI.SHUTDOWN&&e.store(n,this._serialize(),1,1)})}put(e,t){const n=t.lenses.map(s=>{var a;return{range:s.symbol.range,command:s.symbol.command&&{id:"",title:(a=s.symbol.command)===null||a===void 0?void 0:a.title}}}),r=new $z;r.add({lenses:n,dispose:()=>{}},this._fakeProvider);const o=new wae(e.getLineCount(),r);this._cache.set(e.uri.toString(),o)}get(e){const t=this._cache.get(e.uri.toString());return t&&t.lineCount===e.getLineCount()?t.data:void 0}delete(e){this._cache.delete(e.uri.toString())}_serialize(){const e=Object.create(null);for(const[t,n]of this._cache){const r=new Set;for(const o of n.data.lenses)r.add(o.symbol.range.startLineNumber);e[t]={lineCount:n.lineCount,lines:[...r.values()]}}return JSON.stringify(e)}_deserialize(e){try{const t=JSON.parse(e);for(const n in t){const r=t[n],o=[];for(const a of r.lines)o.push({range:new B(a,1,a,11)});const s=new $z;s.add({lenses:o,dispose(){}},this._fakeProvider),this._cache.set(n,new wae(r.lineCount,s))}}catch{}}};Hz=bnt([Cnt(0,dd)],Hz);In(fCe,Hz,1);class ynt{constructor(e,t,n){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=n,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){this._lastHeight===void 0?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return this._lastHeight!==0&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class kI{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id=`codelens.widget-${kI._idPool++}`,this.updatePosition(t),this._domNode=document.createElement("span"),this._domNode.className="codelens-decoration"}withCommands(e,t){this._commands.clear();const n=[];let r=!1;for(let o=0;o{c.symbol.command&&l.push(c.symbol),n.addDecoration({range:c.symbol.range,options:Sae},d=>this._decorationIds[u]=d),a?a=B.plusRange(a,c.symbol.range):a=B.lift(c.symbol.range)}),this._viewZone=new ynt(a.startLineNumber-1,o,s),this._viewZoneId=r.addZone(this._viewZone),l.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(l,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new kI(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],t==null||t.removeZone(this._viewZoneId),this._contentWidget&&(this._editor.removeContentWidget(this._contentWidget),this._contentWidget=void 0),this._isDisposed=!0}isDisposed(){return this._isDisposed}isValid(){return this._decorationIds.some((e,t)=>{const n=this._editor.getModel().getDecorationRange(e),r=this._data[t].symbol;return!!(n&&B.isEmpty(r.range)===n.isEmpty())})}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach((n,r)=>{t.addDecoration({range:n.symbol.range,options:Sae},o=>this._decorationIds[r]=o)})}updateHeight(e,t){this._viewZone.heightInPx=e,t.layoutZone(this._viewZoneId),this._contentWidget&&this._editor.layoutContentWidget(this._contentWidget)}computeIfNecessary(e){if(!this._viewZone.isVisible())return null;for(let t=0;t=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Xx=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let Jw=class{constructor(e,t,n,r,o,s){this._editor=e,this._languageFeaturesService=t,this._commandService=r,this._notificationService=o,this._codeLensCache=s,this._disposables=new Te,this._localToDispose=new Te,this._lenses=[],this._oldCodeLensModels=new Te,this._provideCodeLensDebounce=n.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=n.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new pi(()=>this._resolveCodeLensesInViewport(),this._resolveCodeLensesDebounce.default()),this._disposables.add(this._editor.onDidChangeModel(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>this._onModelChange())),this._disposables.add(this._editor.onDidChangeConfiguration(a=>{(a.hasChanged(50)||a.hasChanged(19)||a.hasChanged(18))&&this._updateLensStyle(),a.hasChanged(17)&&this._onModelChange()})),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),(e=this._currentCodeLensModel)===null||e===void 0||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(67)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=this._editor.getOption(52)*.9|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),n=this._editor.getOption(18),r=this._editor.getOption(50),{style:o}=this._editor.getContainerDomNode();o.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),o.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),o.setProperty("--vscode-editorCodeLens-fontFeatureSettings",r.fontFeatureSettings),n&&(o.setProperty("--vscode-editorCodeLens-fontFamily",n),o.setProperty("--vscode-editorCodeLens-fontFamilyDefault",Qa.fontFamily)),this._editor.changeViewZones(s=>{for(const a of this._lenses)a.updateHeight(e,s)})}_localDispose(){var e,t,n;(e=this._getCodeLensModelPromise)===null||e===void 0||e.cancel(),this._getCodeLensModelPromise=void 0,(t=this._resolveCodeLensesPromise)===null||t===void 0||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),(n=this._currentCodeLensModel)===null||n===void 0||n.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e||!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e)){t&&jv(()=>{const r=this._codeLensCache.get(e);t===r&&(this._codeLensCache.delete(e),this._onModelChange())},30*1e3,this._localToDispose);return}for(const r of this._languageFeaturesService.codeLensProvider.all(e))if(typeof r.onDidChange=="function"){const o=r.onDidChange(()=>n.schedule());this._localToDispose.add(o)}const n=new pi(()=>{var r;const o=Date.now();(r=this._getCodeLensModelPromise)===null||r===void 0||r.cancel(),this._getCodeLensModelPromise=Io(s=>hCe(this._languageFeaturesService.codeLensProvider,e,s)),this._getCodeLensModelPromise.then(s=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=s,this._codeLensCache.put(e,s);const a=this._provideCodeLensDebounce.update(e,Date.now()-o);n.delay=a,this._renderCodeLensSymbols(s),this._resolveCodeLensesInViewportSoon()},en)},this._provideCodeLensDebounce.get(e));this._localToDispose.add(n),this._localToDispose.add(Rt(()=>this._resolveCodeLensesScheduler.cancel())),this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{var r;this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{const a=[];let l=-1;this._lenses.forEach(u=>{!u.isValid()||l===u.getLineNumber()?a.push(u):(u.update(s),l=u.getLineNumber())});const c=new L9;a.forEach(u=>{u.dispose(c,s),this._lenses.splice(this._lenses.indexOf(u),1)}),c.commit(o)})}),n.schedule(),this._resolveCodeLensesScheduler.cancel(),(r=this._resolveCodeLensesPromise)===null||r===void 0||r.cancel(),this._resolveCodeLensesPromise=void 0})),this._localToDispose.add(this._editor.onDidFocusEditorWidget(()=>{n.schedule()})),this._localToDispose.add(this._editor.onDidBlurEditorText(()=>{n.cancel()})),this._localToDispose.add(this._editor.onDidScrollChange(r=>{r.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(this._editor.onDidLayoutChange(()=>{this._resolveCodeLensesInViewportSoon()})),this._localToDispose.add(Rt(()=>{if(this._editor.getModel()){const r=_h.capture(this._editor);this._editor.changeDecorations(o=>{this._editor.changeViewZones(s=>{this._disposeAllLenses(o,s)})}),r.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)})),this._localToDispose.add(this._editor.onMouseDown(r=>{if(r.target.type!==9)return;let o=r.target.element;if((o==null?void 0:o.tagName)==="SPAN"&&(o=o.parentElement),(o==null?void 0:o.tagName)==="A")for(const s of this._lenses){const a=s.getCommand(o);if(a){this._commandService.executeCommand(a.id,...a.arguments||[]).catch(l=>this._notificationService.error(l));break}}})),n.schedule()}_disposeAllLenses(e,t){const n=new L9;for(const r of this._lenses)r.dispose(n,t);e&&n.commit(e),this._lenses.length=0}_renderCodeLensSymbols(e){if(!this._editor.hasModel())return;const t=this._editor.getModel().getLineCount(),n=[];let r;for(const a of e.lenses){const l=a.symbol.range.startLineNumber;l<1||l>t||(r&&r[r.length-1].symbol.range.startLineNumber===l?r.push(a):(r=[a],n.push(r)))}if(!n.length&&!this._lenses.length)return;const o=_h.capture(this._editor),s=this._getLayoutInfo();this._editor.changeDecorations(a=>{this._editor.changeViewZones(l=>{const c=new L9;let u=0,d=0;for(;dthis._resolveCodeLensesInViewportSoon())),u++,d++)}for(;uthis._resolveCodeLensesInViewportSoon())),d++;c.commit(a)})}),o.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;(e=this._resolveCodeLensesPromise)===null||e===void 0||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const n=[],r=[];if(this._lenses.forEach(a=>{const l=a.computeIfNecessary(t);l&&(n.push(l),r.push(a))}),n.length===0)return;const o=Date.now(),s=Io(a=>{const l=n.map((c,u)=>{const d=new Array(c.length),h=c.map((f,g)=>!f.symbol.command&&typeof f.provider.resolveCodeLens=="function"?Promise.resolve(f.provider.resolveCodeLens(t,f.symbol,a)).then(p=>{d[g]=p},Zr):(d[g]=f.symbol,Promise.resolve(void 0)));return Promise.all(h).then(()=>{!a.isCancellationRequested&&!r[u].isDisposed()&&r[u].updateCommands(d)})});return Promise.all(l)});this._resolveCodeLensesPromise=s,this._resolveCodeLensesPromise.then(()=>{const a=this._resolveCodeLensesDebounce.update(t,Date.now()-o);this._resolveCodeLensesScheduler.delay=a,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)},a=>{en(a),s===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)})}async getModel(){var e;return await this._getCodeLensModelPromise,await this._resolveCodeLensesPromise,!((e=this._currentCodeLensModel)===null||e===void 0)&&e.isDisposed?void 0:this._currentCodeLensModel}};Jw.ID="css.editor.codeLens";Jw=wnt([Xx(1,_t),Xx(2,gu),Xx(3,sr),Xx(4,$r),Xx(5,fCe)],Jw);jn(Jw.ID,Jw,1);Be(class extends gt{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:j.hasCodeLensProvider,label:w("showLensOnLine","Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}async run(e,t){if(!t.hasModel())return;const n=e.get(Eh),r=e.get(sr),o=e.get($r),s=t.getSelection().positionLineNumber,a=t.getContribution(Jw.ID);if(!a)return;const l=await a.getModel();if(!l)return;const c=[];for(const h of l.lenses)h.symbol.command&&h.symbol.range.startLineNumber===s&&c.push({label:h.symbol.command.title,command:h.symbol.command});if(c.length===0)return;const u=await n.pick(c,{canPickMany:!1,placeHolder:w("placeHolder","Select a command")});if(!u)return;let d=u.command;if(l.isDisposed){const h=await a.getModel(),f=h==null?void 0:h.lenses.find(g=>{var p;return g.symbol.range.startLineNumber===s&&((p=g.symbol.command)===null||p===void 0?void 0:p.title)===d.title});if(!f||!f.symbol.command)return;d=f.symbol.command}try{await r.executeCommand(d.id,...d.arguments||[])}catch(h){o.error(h)}}});var Snt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},E9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class WY{constructor(e,t){this._editorWorkerClient=new Vq(e,!1,"editorWorkerService",t)}async provideDocumentColors(e,t){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}provideColorPresentations(e,t,n){const r=t.range,o=t.color,s=o.alpha,a=new me(new Tn(Math.round(255*o.red),Math.round(255*o.green),Math.round(255*o.blue),s)),l=s?me.Format.CSS.formatRGB(a):me.Format.CSS.formatRGBA(a),c=s?me.Format.CSS.formatHSL(a):me.Format.CSS.formatHSLA(a),u=s?me.Format.CSS.formatHex(a):me.Format.CSS.formatHexA(a),d=[];return d.push({label:l,textEdit:{range:r,text:l}}),d.push({label:c,textEdit:{range:r,text:c}}),d.push({label:u,textEdit:{range:r,text:u}}),d}}let Vz=class extends fe{constructor(e,t,n){super(),this._register(n.colorProvider.register("*",new WY(e,t)))}};Vz=Snt([E9(0,tr),E9(1,Di),E9(2,_t)],Vz);nT(Vz);async function gCe(i,e,t,n=!0){return $Y(new xnt,i,e,t,n)}function pCe(i,e,t,n){return Promise.resolve(t.provideColorPresentations(i,e,n))}class xnt{constructor(){}async compute(e,t,n,r){const o=await e.provideDocumentColors(t,n);if(Array.isArray(o))for(const s of o)r.push({colorInfo:s,provider:e});return Array.isArray(o)}}class Lnt{constructor(){}async compute(e,t,n,r){const o=await e.provideDocumentColors(t,n);if(Array.isArray(o))for(const s of o)r.push({range:s.range,color:[s.color.red,s.color.green,s.color.blue,s.color.alpha]});return Array.isArray(o)}}class Ent{constructor(e){this.colorInfo=e}async compute(e,t,n,r){const o=await e.provideColorPresentations(t,this.colorInfo,Cn.None);return Array.isArray(o)&&r.push(...o),Array.isArray(o)}}async function $Y(i,e,t,n,r){let o=!1,s;const a=[],l=e.ordered(t);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u instanceof WY)s=u;else try{await i.compute(u,t,n,a)&&(o=!0)}catch(d){Zr(d)}}return o?a:s&&r?(await i.compute(s,t,n,a),a):[]}function mCe(i,e){const{colorProvider:t}=i.get(_t),n=i.get(tr).getModel(e);if(!n)throw eu();const r=i.get(gn).getValue("editor.defaultColorDecorators",{resource:e});return{model:n,colorProviderRegistry:t,isDefaultColorDecoratorsEnabled:r}}Dn.registerCommand("_executeDocumentColorProvider",function(i,...e){const[t]=e;if(!(t instanceof At))throw eu();const{model:n,colorProviderRegistry:r,isDefaultColorDecoratorsEnabled:o}=mCe(i,t);return $Y(new Lnt,r,n,Cn.None,o)});Dn.registerCommand("_executeColorPresentationProvider",function(i,...e){const[t,n]=e,{uri:r,range:o}=n;if(!(r instanceof At)||!Array.isArray(t)||t.length!==4||!B.isIRange(o))throw eu();const{model:s,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=mCe(i,r),[c,u,d,h]=t;return $Y(new Ent({range:o,color:{red:c,green:u,blue:d,alpha:h}}),a,s,Cn.None,l)});var Dnt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},D9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},zz;const vCe=Object.create({});let r_=zz=class extends fe{constructor(e,t,n,r){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=n,this._localToDispose=this._register(new Te),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new Wk(this._editor),this._decoratorLimitReporter=new Int,this._colorDecorationClassRefs=this._register(new Te),this._debounceInformation=r.for(n.colorProvider,"Document Colors",{min:zz.RECOMPUTE_TIME}),this._register(e.onDidChangeModel(()=>{this._isColorDecoratorsEnabled=this.isEnabled(),this.updateColors()})),this._register(e.onDidChangeModelLanguage(()=>this.updateColors())),this._register(n.colorProvider.onDidChange(()=>this.updateColors())),this._register(e.onDidChangeConfiguration(o=>{const s=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(146);const a=s!==this._isColorDecoratorsEnabled||o.hasChanged(21),l=o.hasChanged(146);(a||l)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())})),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(146),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),n=this._configurationService.getValue(t);if(n&&typeof n=="object"){const r=n.colorDecorators;if(r&&r.enable!==void 0&&!r.enable)return r.enable}return this._editor.getOption(20)}static get(e){return e.getContribution(this.ID)}dispose(){this.stop(),this.removeAllDecorations(),super.dispose()}updateColors(){if(this.stop(),!this._isColorDecoratorsEnabled)return;const e=this._editor.getModel();!e||!this._languageFeaturesService.colorProvider.has(e)||(this._localToDispose.add(this._editor.onDidChangeModelContent(()=>{this._timeoutTimer||(this._timeoutTimer=new cd,this._timeoutTimer.cancelAndSet(()=>{this._timeoutTimer=null,this.beginCompute()},this._debounceInformation.get(e)))})),this.beginCompute())}async beginCompute(){this._computePromise=Io(async e=>{const t=this._editor.getModel();if(!t)return[];const n=new Ms(!1),r=await gCe(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,n.elapsed()),r});try{const e=await this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(e){en(e)}}stop(){this._timeoutTimer&&(this._timeoutTimer.cancel(),this._timeoutTimer=null),this._computePromise&&(this._computePromise.cancel(),this._computePromise=null),this._localToDispose.clear()}updateDecorations(e){const t=e.map(n=>({range:{startLineNumber:n.colorInfo.range.startLineNumber,startColumn:n.colorInfo.range.startColumn,endLineNumber:n.colorInfo.range.endLineNumber,endColumn:n.colorInfo.range.endColumn},options:sn.EMPTY}));this._editor.changeDecorations(n=>{this._decorationsIds=n.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach((r,o)=>this._colorDatas.set(r,e[o]))})}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],n=this._editor.getOption(21);for(let o=0;othis._colorDatas.has(r.id));return n.length===0?null:this._colorDatas.get(n[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};r_.ID="editor.contrib.colorDetector";r_.RECOMPUTE_TIME=1e3;r_=zz=Dnt([D9(1,gn),D9(2,_t),D9(3,gu)],r_);class Int{constructor(){this._onDidChange=new se,this._computed=0,this._limited=!1}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}jn(r_.ID,r_,1);class knt{get color(){return this._color}set color(e){this._color.equals(e)||(this._color=e,this._onDidChangeColor.fire(e))}get presentation(){return this.colorPresentations[this.presentationIndex]}get colorPresentations(){return this._colorPresentations}set colorPresentations(e){this._colorPresentations=e,this.presentationIndex>e.length-1&&(this.presentationIndex=0),this._onDidChangePresentation.fire(this.presentation)}constructor(e,t,n){this.presentationIndex=n,this._onColorFlushed=new se,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new se,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new se,this.onDidChangePresentation=this._onDidChangePresentation.event,this.originalColor=e,this._color=e,this._colorPresentations=t}selectNextColorPresentation(){this.presentationIndex=(this.presentationIndex+1)%this.colorPresentations.length,this.flushColor(),this._onDidChangePresentation.fire(this.presentation)}guessColorPresentation(e,t){let n=-1;for(let r=0;r{this.backgroundColor=s.getColor(oP)||me.white})),this._register(ye(this._pickedColorNode,Ge.CLICK,()=>this.model.selectNextColorPresentation())),this._register(ye(this._originalColorNode,Ge.CLICK,()=>{this.model.color=this.model.originalColor,this.model.flushColor()})),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this._register(t.onDidChangePresentation(this.onDidChangePresentation,this)),this._pickedColorNode.style.backgroundColor=me.Format.CSS.format(t.color)||"",this._pickedColorNode.classList.toggle("light",t.color.rgba.a<.5?this.backgroundColor.isLighter():t.color.isLighter()),this.onDidChangeColor(this.model.color),this.showingStandaloneColorPicker&&(this._domNode.classList.add("standalone-colorpicker"),this._closeButton=this._register(new Nnt(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=me.Format.CSS.format(e)||"",this._pickedColorNode.classList.toggle("light",e.rgba.a<.5?this.backgroundColor.isLighter():e.isLighter()),this.onDidChangePresentation()}onDidChangePresentation(){this._pickedColorPresentation.textContent=this.model.presentation?this.model.presentation.label:""}}class Nnt extends fe{constructor(e){super(),this._onClicked=this._register(new se),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),ke(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),ke(this._button,t),ke(t,oc(".button"+Wt.asCSSSelector(Mr("color-picker-close",Xe.close,w("closeIcon","Icon to close the color picker"))))).classList.add("close-icon"),this._register(ye(this._button,Ge.CLICK,()=>{this._onClicked.fire()}))}}class Rnt extends fe{constructor(e,t,n,r=!1){super(),this.model=t,this.pixelRatio=n,this._insertButton=null,this._domNode=oc(".colorpicker-body"),ke(e,this._domNode),this._saturationBox=new Mnt(this._domNode,this.model,this.pixelRatio),this._register(this._saturationBox),this._register(this._saturationBox.onDidChange(this.onDidSaturationValueChange,this)),this._register(this._saturationBox.onColorFlushed(this.flushColor,this)),this._opacityStrip=new Ant(this._domNode,this.model,r),this._register(this._opacityStrip),this._register(this._opacityStrip.onDidChange(this.onDidOpacityChange,this)),this._register(this._opacityStrip.onColorFlushed(this.flushColor,this)),this._hueStrip=new Pnt(this._domNode,this.model,r),this._register(this._hueStrip),this._register(this._hueStrip.onDidChange(this.onDidHueChange,this)),this._register(this._hueStrip.onColorFlushed(this.flushColor,this)),r&&(this._insertButton=this._register(new Ont(this._domNode)),this._domNode.classList.add("standalone-colorpicker"))}flushColor(){this.model.flushColor()}onDidSaturationValueChange({s:e,v:t}){const n=this.model.color.hsva;this.model.color=new me(new bf(n.h,e,t,n.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new me(new bf(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,n=(1-e)*360;this.model.color=new me(new bf(n===360?0:n,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class Mnt extends fe{constructor(e,t,n){super(),this.model=t,this.pixelRatio=n,this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new se,this.onColorFlushed=this._onColorFlushed.event,this._domNode=oc(".saturation-wrap"),ke(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",ke(this._domNode,this._canvas),this.selection=oc(".saturation-selection"),ke(this._domNode,this.selection),this.layout(),this._register(ye(this._domNode,Ge.POINTER_DOWN,r=>this.onPointerDown(r))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;this.monitor=this._register(new kS);const t=Br(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>this.onDidChangePosition(r.pageX-t.left,r.pageY-t.top),()=>null);const n=ye(e.target.ownerDocument,Ge.POINTER_UP,()=>{this._onColorFlushed.fire(),n.dispose(),this.monitor&&(this.monitor.stopMonitoring(!0),this.monitor=null)},!0)}onDidChangePosition(e,t){const n=Math.max(0,Math.min(1,e/this.width)),r=Math.max(0,Math.min(1,1-t/this.height));this.paintSelection(n,r),this._onDidChange.fire({s:n,v:r})}layout(){this.width=this._domNode.offsetWidth,this.height=this._domNode.offsetHeight,this._canvas.width=this.width*this.pixelRatio,this._canvas.height=this.height*this.pixelRatio,this.paint();const e=this.model.color.hsva;this.paintSelection(e.s,e.v)}paint(){const e=this.model.color.hsva,t=new me(new bf(e.h,1,1,1)),n=this._canvas.getContext("2d"),r=n.createLinearGradient(0,0,this._canvas.width,0);r.addColorStop(0,"rgba(255, 255, 255, 1)"),r.addColorStop(.5,"rgba(255, 255, 255, 0.5)"),r.addColorStop(1,"rgba(255, 255, 255, 0)");const o=n.createLinearGradient(0,0,0,this._canvas.height);o.addColorStop(0,"rgba(0, 0, 0, 0)"),o.addColorStop(1,"rgba(0, 0, 0, 1)"),n.rect(0,0,this._canvas.width,this._canvas.height),n.fillStyle=me.Format.CSS.format(t),n.fill(),n.fillStyle=r,n.fill(),n.fillStyle=o,n.fill()}paintSelection(e,t){this.selection.style.left=`${e*this.width}px`,this.selection.style.top=`${this.height-t*this.height}px`}onDidChangeColor(e){if(this.monitor&&this.monitor.isMonitoring())return;this.paint();const t=e.hsva;this.paintSelection(t.s,t.v)}}class _Ce extends fe{constructor(e,t,n=!1){super(),this.model=t,this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new se,this.onColorFlushed=this._onColorFlushed.event,n?(this.domNode=ke(e,oc(".standalone-strip")),this.overlay=ke(this.domNode,oc(".standalone-overlay"))):(this.domNode=ke(e,oc(".strip")),this.overlay=ke(this.domNode,oc(".overlay"))),this.slider=ke(this.domNode,oc(".slider")),this.slider.style.top="0px",this._register(ye(this.domNode,Ge.POINTER_DOWN,r=>this.onPointerDown(r))),this._register(t.onDidChangeColor(this.onDidChangeColor,this)),this.layout()}layout(){this.height=this.domNode.offsetHeight-this.slider.offsetHeight;const e=this.getValue(this.model.color);this.updateSliderPosition(e)}onDidChangeColor(e){const t=this.getValue(e);this.updateSliderPosition(t)}onPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._register(new kS),n=Br(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,o=>this.onDidChangeTop(o.pageY-n.top),()=>null);const r=ye(e.target.ownerDocument,Ge.POINTER_UP,()=>{this._onColorFlushed.fire(),r.dispose(),t.stopMonitoring(!0),this.domNode.classList.remove("grabbing")},!0)}onDidChangeTop(e){const t=Math.max(0,Math.min(1,1-e/this.height));this.updateSliderPosition(t),this._onDidChange.fire(t)}updateSliderPosition(e){this.slider.style.top=`${(1-e)*this.height}px`}}class Ant extends _Ce{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("opacity-strip"),this.onDidChangeColor(this.model.color)}onDidChangeColor(e){super.onDidChangeColor(e);const{r:t,g:n,b:r}=e.rgba,o=new me(new Tn(t,n,r,1)),s=new me(new Tn(t,n,r,0));this.overlay.style.background=`linear-gradient(to bottom, ${o} 0%, ${s} 100%)`}getValue(e){return e.hsva.a}}class Pnt extends _Ce{constructor(e,t,n=!1){super(e,t,n),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class Ont extends fe{constructor(e){super(),this._onClicked=this._register(new se),this.onClicked=this._onClicked.event,this._button=ke(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._register(ye(this._button,Ge.CLICK,()=>{this._onClicked.fire()}))}get button(){return this._button}}class Fnt extends yc{constructor(e,t,n,r,o=!1){super(),this.model=t,this.pixelRatio=n,this._register(ID.getInstance(Pt(e)).onDidChange(()=>this.layout()));const s=oc(".colorpicker-widget");e.appendChild(s),this.header=this._register(new Tnt(s,this.model,r,o)),this.body=this._register(new Rnt(s,this.model,this.pixelRatio,o))}layout(){this.body.layout()}}var bCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},CCe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Bnt{constructor(e,t,n,r){this.owner=e,this.range=t,this.model=n,this.provider=r,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let gO=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,n){return Kr.fromPromise(this._computeAsync(e,t,n))}async _computeAsync(e,t,n){if(!this._editor.hasModel())return[];const r=r_.get(this._editor);if(!r)return[];for(const o of t){if(!r.isColorDecoration(o))continue;const s=r.getColorData(o.range.getStartPosition());if(s)return[await yCe(this,this._editor.getModel(),s.colorInfo,s.provider)]}return[]}renderHoverParts(e,t){return wCe(this,this._editor,this._themeService,t,e)}};gO=bCe([CCe(1,To)],gO);class Wnt{constructor(e,t,n,r){this.owner=e,this.range=t,this.model=n,this.provider=r}}let TI=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}async createColorHover(e,t,n){if(!this._editor.hasModel()||!r_.get(this._editor))return null;const o=await gCe(n,this._editor.getModel(),Cn.None);let s=null,a=null;for(const d of o){const h=d.colorInfo;B.containsRange(h.range,e.range)&&(s=h,a=d.provider)}const l=s??e,c=a??t,u=!!s;return{colorHover:await yCe(this,this._editor.getModel(),l,c),foundInEditor:u}}async updateEditorModel(e){if(!this._editor.hasModel())return;const t=e.model;let n=new B(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(await OM(this._editor.getModel(),t,this._color,n,e),n=SCe(this._editor,n,t))}renderHoverParts(e,t){return wCe(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};TI=bCe([CCe(1,To)],TI);async function yCe(i,e,t,n){const r=e.getValueInRange(t.range),{red:o,green:s,blue:a,alpha:l}=t.color,c=new Tn(Math.round(o*255),Math.round(s*255),Math.round(a*255),l),u=new me(c),d=await pCe(e,t,n,Cn.None),h=new knt(u,[],0);return h.colorPresentations=d||[],h.guessColorPresentation(u,r),i instanceof gO?new Bnt(i,B.lift(t.range),h,n):new Wnt(i,B.lift(t.range),h,n)}function wCe(i,e,t,n,r){if(n.length===0||!e.hasModel())return fe.None;if(r.setMinimumDimensions){const h=e.getOption(67)+8;r.setMinimumDimensions(new Kn(302,h))}const o=new Te,s=n[0],a=e.getModel(),l=s.model,c=o.add(new Fnt(r.fragment,l,e.getOption(142),t,i instanceof TI));r.setColorPicker(c);let u=!1,d=new B(s.range.startLineNumber,s.range.startColumn,s.range.endLineNumber,s.range.endColumn);if(i instanceof TI){const h=n[0].model.color;i.color=h,OM(a,l,h,d,s),o.add(l.onColorFlushed(f=>{i.color=f}))}else o.add(l.onColorFlushed(async h=>{await OM(a,l,h,d,s),u=!0,d=SCe(e,d,l)}));return o.add(l.onDidChangeColor(h=>{OM(a,l,h,d,s)})),o.add(e.onDidChangeModelContent(h=>{u?u=!1:(r.hide(),e.focus())})),o}function SCe(i,e,t){var n,r;const o=[],s=(n=t.presentation.textEdit)!==null&&n!==void 0?n:{range:e,text:t.presentation.label,forceMoveMarkers:!1};o.push(s),t.presentation.additionalTextEdits&&o.push(...t.presentation.additionalTextEdits);const a=B.lift(s.range),l=i.getModel()._setTrackedRange(null,a,3);return i.executeEdits("colorpicker",o),i.pushUndoStop(),(r=i.getModel()._getTrackedRange(l))!==null&&r!==void 0?r:a}async function OM(i,e,t,n,r){const o=await pCe(i,{range:n,color:{red:t.rgba.r/255,green:t.rgba.g/255,blue:t.rgba.b/255,alpha:t.rgba.a}},r.provider,Cn.None);e.colorPresentations=o||[]}function Uz(i,e){return!!i[e]}class I9{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=Uz(e.event,t.triggerModifier),this.hasSideBySideModifier=Uz(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class Lae{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=Uz(e,t.triggerModifier)}}class KR{constructor(e,t,n,r){this.triggerKey=e,this.triggerModifier=t,this.triggerSideBySideKey=n,this.triggerSideBySideModifier=r}equals(e){return this.triggerKey===e.triggerKey&&this.triggerModifier===e.triggerModifier&&this.triggerSideBySideKey===e.triggerSideBySideKey&&this.triggerSideBySideModifier===e.triggerSideBySideModifier}}function Eae(i){return i==="altKey"?Ln?new KR(57,"metaKey",6,"altKey"):new KR(5,"ctrlKey",6,"altKey"):Ln?new KR(6,"altKey",57,"metaKey"):new KR(6,"altKey",5,"ctrlKey")}class M3 extends fe{constructor(e,t){var n;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new se),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new se),this.onExecute=this._onExecute.event,this._onCancel=this._register(new se),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=(n=t==null?void 0:t.extractLineNumberFromMouseEvent)!==null&&n!==void 0?n:r=>r.target.position?r.target.position.lineNumber:0,this._opts=Eae(this._editor.getOption(78)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(r=>{if(r.hasChanged(78)){const o=Eae(this._editor.getOption(78));if(this._opts.equals(o))return;this._opts=o,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(r=>this._onEditorMouseMove(new I9(r,this._opts)))),this._register(this._editor.onMouseDown(r=>this._onEditorMouseDown(new I9(r,this._opts)))),this._register(this._editor.onMouseUp(r=>this._onEditorMouseUp(new I9(r,this._opts)))),this._register(this._editor.onKeyDown(r=>this._onEditorKeyDown(new Lae(r,this._opts)))),this._register(this._editor.onKeyUp(r=>this._onEditorKeyUp(new Lae(r,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(r=>this._onDidChangeCursorSelection(r))),this._register(this._editor.onDidChangeModel(r=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(r=>{(r.scrollTopChanged||r.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var $nt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},bg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};let o_=class extends $w{constructor(e,t,n,r,o,s,a,l,c,u,d,h,f){super(e,{...r.getRawOptions(),overflowWidgetsDomNode:r.getOverflowWidgetsDomNode()},n,o,s,a,l,c,u,d,h,f),this._parentEditor=r,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(r.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){r4(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};o_=$nt([bg(4,Ot),bg(5,Un),bg(6,sr),bg(7,Vt),bg(8,To),bg(9,$r),bg(10,ud),bg(11,Di),bg(12,_t)],o_);const Dae=new me(new Tn(0,122,204)),Hnt={showArrow:!0,showFrame:!0,className:"",frameColor:Dae,arrowColor:Dae,keepEditorSelection:!1},Vnt="vs.editor.contrib.zoneWidget";class znt{constructor(e,t,n,r,o,s,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=n,this.heightInLines=r,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=s}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class Unt{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}let xCe=class LCe{constructor(e){this._editor=e,this._ruleName=LCe._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),aH(this._ruleName)}set color(e){this._color!==e&&(this._color=e,this._updateStyle())}set height(e){this._height!==e&&(this._height=e,this._updateStyle())}_updateStyle(){aH(this._ruleName),qA(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){e.column===1&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:B.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}};xCe._IdGenerator=new WX(".arrow-decoration-");class jnt{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new Te,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Mg(t),r4(this.options,Hnt,!1),this.domNode=document.createElement("div"),this.options.isAccessible||(this.domNode.setAttribute("aria-hidden","true"),this.domNode.setAttribute("role","presentation")),this._disposables.add(this.editor.onDidLayoutChange(n=>{const r=this._getWidth(n);this.domNode.style.width=r+"px",this.domNode.style.left=this._getLeft(n)+"px",this._onWidth(r)}))}dispose(){this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this._viewZone&&this.editor.changeViewZones(e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._viewZone=null}),this._positionMarkerId.clear(),this._disposables.dispose()}create(){this.domNode.classList.add("zone-widget"),this.options.className&&this.domNode.classList.add(this.options.className),this.container=document.createElement("div"),this.container.classList.add("zone-widget-container"),this.domNode.appendChild(this.container),this.options.showArrow&&(this._arrow=new xCe(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const n=e-this._decoratingElementsHeight();this.container.style.height=`${n}px`;const r=this.editor.getLayoutInfo();this._doLayout(n,this._getWidth(r))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const n=B.isIRange(e)?B.lift(e):B.fromPositions(e);this._isShowing=!0,this._showImpl(n,t),this._isShowing=!1,this._positionMarkerId.set([{range:n,options:sn.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(67);let t=0;if(this.options.showArrow){const n=Math.round(e/3);t+=2*n}if(this.options.showFrame){const n=Math.round(e/9);t+=2*n}return t}_showImpl(e,t){const n=e.getStartPosition(),r=this.editor.getLayoutInfo(),o=this._getWidth(r);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(r)+"px";const s=document.createElement("div");s.style.overflow="hidden";const a=this.editor.getOption(67);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(n)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new znt(s,n.lineNumber,n.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new Unt(Vnt+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const u=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=u+"px",this.container.style.overflow="hidden"),this._doLayout(u,o),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const h=d.validateRange(new B(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===d.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new Ls(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const n=(t.currentY-e.startY)/this.editor.getOption(67),r=n<0?Math.ceil(n):Math.floor(n),o=e.heightInLines+r;o>5&&o<35&&this._relayout(o)}}))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(this.domNode.style.height===null?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}var ECe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},DCe=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const ICe=yn("IPeekViewService");In(ICe,class{constructor(){this._widgets=new Map}addExclusiveWidget(i,e){const t=this._widgets.get(i);t&&(t.listener.dispose(),t.widget.dispose());const n=()=>{const r=this._widgets.get(i);r&&r.widget===e&&(r.listener.dispose(),this._widgets.delete(i))};this._widgets.set(i,{widget:e,listener:e.onDidClose(n)})}},1);var il;(function(i){i.inPeekEditor=new st("inReferenceSearchEditor",!0,w("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),i.notInPeekEditor=i.inPeekEditor.toNegated()})(il||(il={}));let NI=class{constructor(e,t){e instanceof o_&&il.inPeekEditor.bindTo(t)}dispose(){}};NI.ID="editor.contrib.referenceController";NI=ECe([DCe(1,Vt)],NI);jn(NI.ID,NI,0);function Knt(i){const e=i.get(Un).getFocusedCodeEditor();return e instanceof o_?e.getParentEditor():e}const Gnt={headerBackgroundColor:me.white,primaryHeadingColor:me.fromHex("#333333"),secondaryHeadingColor:me.fromHex("#6c6c6cb3")};let pO=class extends jnt{constructor(e,t,n){super(e,t),this.instantiationService=n,this._onDidClose=new se,this.onDidClose=this._onDidClose.event,r4(this.options,Gnt,!1)}dispose(){this.disposed||(this.disposed=!0,super.dispose(),this._onDidClose.fire(this))}style(e){const t=this.options;e.headerBackgroundColor&&(t.headerBackgroundColor=e.headerBackgroundColor),e.primaryHeadingColor&&(t.primaryHeadingColor=e.primaryHeadingColor),e.secondaryHeadingColor&&(t.secondaryHeadingColor=e.secondaryHeadingColor),super.style(e)}_applyStyles(){super._applyStyles();const e=this.options;this._headElement&&e.headerBackgroundColor&&(this._headElement.style.backgroundColor=e.headerBackgroundColor.toString()),this._primaryHeading&&e.primaryHeadingColor&&(this._primaryHeading.style.color=e.primaryHeadingColor.toString()),this._secondaryHeading&&e.secondaryHeadingColor&&(this._secondaryHeading.style.color=e.secondaryHeadingColor.toString()),this._bodyElement&&e.frameColor&&(this._bodyElement.style.borderColor=e.frameColor.toString())}_fillContainer(e){this.setCssClass("peekview-widget"),this._headElement=He(".head"),this._bodyElement=He(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=He(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Sr(this._titleElement,"click",o=>this._onTitleClick(o))),ke(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=He("span.filename"),this._secondaryHeading=He("span.dirname"),this._metaHeading=He("span.meta"),ke(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const n=He(".peekview-actions");ke(this._headElement,n);const r=this._getActionBarOptions();this._actionbarWidget=new au(n,r),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new xl("peekview.close",w("label.close","Close"),Wt.asClassName(Xe.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:q_e.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Ns(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,bl(this._metaHeading)):fa(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const n=Math.ceil(this.editor.getOption(67)*1.2),r=Math.round(e-(n+2));this._doLayoutHead(n,t),this._doLayoutBody(r,t)}_doLayoutHead(e,t){this._headElement&&(this._headElement.style.height=`${e}px`,this._headElement.style.lineHeight=this._headElement.style.height)}_doLayoutBody(e,t){this._bodyElement&&(this._bodyElement.style.height=`${e}px`)}};pO=ECe([DCe(2,Ot)],pO);const qnt=X("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},w("peekViewTitleBackground","Background color of the peek view title area.")),kCe=X("peekViewTitleLabel.foreground",{dark:me.white,light:me.black,hcDark:me.white,hcLight:Ku},w("peekViewTitleForeground","Color of the peek view title.")),TCe=X("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},w("peekViewTitleInfoForeground","Color of the peek view title info.")),Xnt=X("peekView.border",{dark:Za,light:Za,hcDark:Sn,hcLight:Sn},w("peekViewBorder","Color of the peek view borders and arrow.")),Ynt=X("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:me.black,hcLight:me.white},w("peekViewResultsBackground","Background color of the peek view result list."));X("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:me.white,hcLight:Ku},w("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));X("peekViewResult.fileForeground",{dark:me.white,light:"#1E1E1E",hcDark:me.white,hcLight:Ku},w("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));X("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},w("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));X("peekViewResult.selectionForeground",{dark:me.white,light:"#6C6C6C",hcDark:me.white,hcLight:Ku},w("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const tv=X("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:me.black,hcLight:me.white},w("peekViewEditorBackground","Background color of the peek view editor."));X("peekViewEditorGutter.background",{dark:tv,light:tv,hcDark:tv,hcLight:tv},w("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));X("peekViewEditorStickyScroll.background",{dark:tv,light:tv,hcDark:tv,hcLight:tv},w("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));X("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},w("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));X("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},w("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));X("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:zi,hcLight:zi},w("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));class s_{constructor(e,t,n,r){this.isProviderFirst=e,this.parent=t,this.link=n,this._rangeCallback=r,this.id=hV.nextId()}get uri(){return this.link.uri}get range(){var e,t;return(t=(e=this._range)!==null&&e!==void 0?e:this.link.targetSelectionRange)!==null&&t!==void 0?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=(e=this.parent.getPreview(this))===null||e===void 0?void 0:e.preview(this.range);return t?w({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,su(this.uri),this.range.startLineNumber,this.range.startColumn):w("aria.oneReference","in {0} on line {1} at column {2}",su(this.uri),this.range.startLineNumber,this.range.startColumn)}}class Znt{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const n=this._modelReference.object.textEditorModel;if(!n)return;const{startLineNumber:r,startColumn:o,endLineNumber:s,endColumn:a}=e,l=n.getWordUntilPosition({lineNumber:r,column:o-t}),c=new B(r,l.startColumn,r,o),u=new B(s,a,s,1073741824),d=n.getValueInRange(c).replace(/^\s+/,""),h=n.getValueInRange(e),f=n.getValueInRange(u).replace(/\s+$/,"");return{value:d+h+f,highlight:{start:d.length,end:d.length+h.length}}}}class RI{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Tr}dispose(){si(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?w("aria.fileReferences.1","1 symbol in {0}, full path {1}",su(this.uri),this.uri.fsPath):w("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,su(this.uri),this.uri.fsPath)}async resolve(e){if(this._previews.size!==0)return this;for(const t of this.children)if(!this._previews.has(t.uri))try{const n=await e.createModelReference(t.uri);this._previews.set(t.uri,new Znt(n))}catch(n){en(n)}return this}}class El{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new se,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[n]=e;e.sort(El._compareReferences);let r;for(const o of e)if((!r||!Ui.isEqual(r.uri,o.uri,!0))&&(r=new RI(this,o.uri),this.groups.push(r)),r.children.length===0||El._compareReferences(o,r.children[r.children.length-1])!==0){const s=new s_(n===o,r,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(s),r.children.push(s)}}dispose(){si(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new El(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?w("aria.result.0","No results found"):this.references.length===1?w("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?w("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):w("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:n}=e;let r=n.children.indexOf(e);const o=n.children.length,s=n.parent.groups.length;return s===1||t&&r+10?(t?r=(r+1)%o:r=(r+o-1)%o,n.children[r]):(r=n.parent.groups.indexOf(n),t?(r=(r+1)%s,n.parent.groups[r].children[0]):(r=(r+s-1)%s,n.parent.groups[r].children[n.parent.groups[r].children.length-1]))}nearestReference(e,t){const n=this.references.map((r,o)=>({idx:o,prefixLen:Vv(r.uri.toString(),e.toString()),offsetDist:Math.abs(r.range.startLineNumber-t.lineNumber)*100+Math.abs(r.range.startColumn-t.column)})).sort((r,o)=>r.prefixLen>o.prefixLen?-1:r.prefixLeno.offsetDist?1:0)[0];if(n)return this.references[n.idx]}referenceAt(e,t){for(const n of this.references)if(n.uri.toString()===e.toString()&&B.containsPosition(n.range,t))return n}firstReference(){for(const e of this.references)if(e.isProviderFirst)return e;return this.references[0]}static _compareReferences(e,t){return Ui.compare(e.uri,t.uri)||B.compareRangesUsingStarts(e.range,t.range)}}var A3=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},P3=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},jz;let Kz=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof El||e instanceof RI}getChildren(e){if(e instanceof El)return e.groups;if(e instanceof RI)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};Kz=A3([P3(0,ol)],Kz);class Qnt{getHeight(){return 23}getTemplateId(e){return e instanceof RI?MI.id:dT.id}}let Gz=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof s_){const n=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(n)return n.value}return su(e.uri)}};Gz=A3([P3(0,ci)],Gz);class Jnt{getId(e){return e instanceof s_?e.id:e.uri}}let qz=class extends fe{constructor(e,t){super(),this._labelService=t;const n=document.createElement("div");n.classList.add("reference-file"),this.file=this._register(new ZP(n,{supportHighlights:!0})),this.badge=new XV(ke(n,He(".count")),{},K_e),e.appendChild(n)}set(e,t){const n=z4(e.uri);this.file.setLabel(this._labelService.getUriBasenameLabel(e.uri),this._labelService.getUriLabel(n,{relative:!0}),{title:this._labelService.getUriLabel(e.uri),matches:t});const r=e.children.length;this.badge.setCount(r),r>1?this.badge.setTitleFormat(w("referencesCount","{0} references",r)):this.badge.setTitleFormat(w("referenceCount","{0} reference",r))}};qz=A3([P3(1,Vw)],qz);let MI=jz=class{constructor(e){this._instantiationService=e,this.templateId=jz.id}renderTemplate(e){return this._instantiationService.createInstance(qz,e)}renderElement(e,t,n){n.set(e.element,qk(e.filterData))}disposeTemplate(e){e.dispose()}};MI.id="FileReferencesRenderer";MI=jz=A3([P3(0,Ot)],MI);class eit{constructor(e){this.label=new Ev(e)}set(e,t){var n;const r=(n=e.parent.getPreview(e))===null||n===void 0?void 0:n.preview(e.range);if(!r||!r.value)this.label.set(`${su(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:s}=r;t&&!rh.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,qk(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[s]))}}}class dT{constructor(){this.templateId=dT.id}renderTemplate(e){return new eit(e)}renderElement(e,t,n){n.set(e.element,e.filterData)}disposeTemplate(){}}dT.id="OneReferenceRenderer";class tit{getWidgetAriaLabel(){return w("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var nit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Cg=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class O3{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new Te,this._callOnModelChange=new Te,this._callOnDispose.add(this._editor.onDidChangeModel(()=>this._onModelChanged())),this._onModelChanged()}dispose(){this._callOnModelChange.dispose(),this._callOnDispose.dispose(),this.removeDecorations()}_onModelChanged(){this._callOnModelChange.clear();const e=this._editor.getModel();if(e){for(const t of this._model.references)if(t.uri.toString()===e.uri.toString()){this._addDecorations(t.parent);return}}}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations(()=>this._onDecorationChanged()));const t=[],n=[];for(let r=0,o=e.children.length;r{const o=r.deltaDecorations([],t);for(let s=0;s{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(rit,"ReferencesWidget",this._treeContainer,new Qnt,[this._instantiationService.createInstance(MI),this._instantiationService.createInstance(dT)],this._instantiationService.createInstance(Kz),n),this._splitView.addView({onDidChange:Je.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},jP.Distribute),this._splitView.addView({onDidChange:Je.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:o=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${o}px`,this._tree.layout(this._dim.height,o)}},jP.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const r=(o,s)=>{o instanceof s_&&(s==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:s,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?r(o.element,"side"):o.editorOptions.pinned?r(o.element,"goto"):r(o.element,"show")}),fa(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Kn(t,e),this.layoutData.heightInLines=this._viewZone?this._viewZone.heightInLines:this.layoutData.heightInLines,this._splitView.layout(t),this._splitView.resizeView(0,t*this.layoutData.ratio)}setSelection(e){return this._revealReference(e,!0).then(()=>{this._model&&(this._tree.setSelection([e]),this._tree.setFocus([e]))})}setModel(e){return this._disposeOnNewModel.clear(),this._model=e,this._model?this._onNewModel():Promise.resolve()}_onNewModel(){return this._model?this._model.isEmpty?(this.setTitle(""),this._messageContainer.innerText=w("noResults","No results"),bl(this._messageContainer),Promise.resolve(void 0)):(fa(this._messageContainer),this._decorationsManager=new O3(this._preview,this._model),this._disposeOnNewModel.add(this._decorationsManager),this._disposeOnNewModel.add(this._model.onDidChangeReferenceRange(e=>this._tree.rerender(e))),this._disposeOnNewModel.add(this._preview.onMouseDown(e=>{const{event:t,target:n}=e;if(t.detail!==2)return;const r=this._getFocusedReference();r&&this._onDidSelectReference.fire({element:{uri:r.uri,range:n.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),bl(this._treeContainer),bl(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(this._model.groups.length===1?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();if(e instanceof s_)return e;if(e instanceof RI&&e.children.length>0)return e.children[0]}async revealReference(e){await this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}async _revealReference(e,t){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==an.inMemory?this.setTitle(bze(e.uri),this._uriLabel.getUriLabel(z4(e.uri))):this.setTitle(w("peekView.alternateTitle","References"));const n=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent?this._tree.reveal(e):(t&&this._tree.reveal(e.parent),await this._tree.expand(e.parent),this._tree.reveal(e));const r=await n;if(!this._model){r.dispose();return}si(this._previewModelReference);const o=r.object;if(o){const s=this._preview.getModel()===o.textEditorModel?0:1,a=B.lift(e.range).collapseToStart();this._previewModelReference=r,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,s)}else this._preview.setModel(this._previewNotAvailableMessage),r.dispose()}};Xz=nit([Cg(3,To),Cg(4,ol),Cg(5,Ot),Cg(6,ICe),Cg(7,Vw),Cg(8,U4),Cg(9,ci),Cg(10,ji),Cg(11,Di)],Xz);var oit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},i1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},FM;const wC=new st("referenceSearchVisible",!1,w("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let a_=FM=class{static get(e){return e.getContribution(FM.ID)}constructor(e,t,n,r,o,s,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=r,this._notificationService=o,this._instantiationService=s,this._storageService=a,this._configurationService=l,this._disposables=new Te,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=wC.bindTo(n)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,n){let r;if(this._widget&&(r=this._widget.position),this.closeWidget(),r&&e.containsPosition(r))return;this._peekMode=n,this._referenceSearchVisible.set(!0),this._disposables.add(this._editor.onDidChangeModelLanguage(()=>{this.closeWidget()})),this._disposables.add(this._editor.onDidChangeModel(()=>{this._ignoreModelChangeEvent||this.closeWidget()}));const o="peekViewLayout",s=iit.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(Xz,this._editor,this._defaultTreeKeyboardSupport,s),this._widget.setTitle(w("labelLoading","Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose(()=>{t.cancel(),this._widget&&(this._storageService.store(o,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()})),this._disposables.add(this._widget.onDidSelectReference(l=>{const{element:c,kind:u}=l;if(c)switch(u){case"open":(l.source!=="editor"||!this._configurationService.getValue("editor.stablePeek"))&&this.openReference(c,!1,!1);break;case"side":this.openReference(c,!0,!1);break;case"goto":n?this._gotoReference(c,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)===null||c===void 0||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(w("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const u=this._editor.getModel().uri,d=new ae(e.startLineNumber,e.startColumn),h=this._model.nearestReference(u,d);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(87)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}async goToNextOrPreviousReference(e){if(!this._editor.hasModel()||!this._model||!this._widget)return;const t=this._widget.position;if(!t)return;const n=this._model.nearestReference(this._editor.getModel().uri,t);if(!n)return;const r=this._model.nextOrPreviousReference(n,e),o=this._editor.hasTextFocus(),s=this._widget.isPreviewEditorFocused();await this._widget.setSelection(r),await this._gotoReference(r,!1),o?this._editor.focus():this._widget&&s&&this._widget.focusOnPreviewEditor()}async revealReference(e){!this._editor.hasModel()||!this._model||!this._widget||await this._widget.revealReference(e)}closeWidget(e=!0){var t,n;(t=this._widget)===null||t===void 0||t.dispose(),(n=this._model)===null||n===void 0||n.dispose(),this._referenceSearchVisible.reset(),this._disposables.clear(),this._widget=void 0,this._model=void 0,e&&this._editor.focus(),this._requestIdPool+=1}_gotoReference(e,t){var n;(n=this._widget)===null||n===void 0||n.hide(),this._ignoreModelChangeEvent=!0;const r=B.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:r,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{var s;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(r),this._widget.focusOnReferenceTree();else{const a=FM.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(r,Io(c=>Promise.resolve(l)),(s=this._peekMode)!==null&&s!==void 0?s:!1)}},o=>{this._ignoreModelChangeEvent=!1,en(o)})}openReference(e,t,n){t||this.closeWidget();const{uri:r,range:o}=e;this._editorService.openCodeEditor({resource:r,options:{selection:o,selectionSource:"code.jump",pinned:n}},this._editor,t)}};a_.ID="editor.contrib.referencesController";a_=FM=oit([i1(2,Vt),i1(3,Un),i1(4,$r),i1(5,Ot),i1(6,dd),i1(7,gn)],a_);function SC(i,e){const t=Knt(i);if(!t)return;const n=a_.get(t);n&&e(n)}nl.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:co(2089,60),when:De.or(wC,il.inPeekEditor),handler(i){SC(i,e=>{e.changeFocusBetweenPreviewAndReferences()})}});nl.registerCommandAndKeybindingRule({id:"goToNextReference",weight:100-10,primary:62,secondary:[70],when:De.or(wC,il.inPeekEditor),handler(i){SC(i,e=>{e.goToNextOrPreviousReference(!0)})}});nl.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:100-10,primary:1086,secondary:[1094],when:De.or(wC,il.inPeekEditor),handler(i){SC(i,e=>{e.goToNextOrPreviousReference(!1)})}});Dn.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Dn.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Dn.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Dn.registerCommand("closeReferenceSearch",i=>SC(i,e=>e.closeWidget()));nl.registerKeybindingRule({id:"closeReferenceSearch",weight:100-101,primary:9,secondary:[1033],when:De.and(il.inPeekEditor,De.not("config.editor.stablePeek"))});nl.registerKeybindingRule({id:"closeReferenceSearch",weight:200+50,primary:9,secondary:[1033],when:De.and(wC,De.not("config.editor.stablePeek"),De.or(j.editorTextFocus,XXe.negate()))});nl.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:De.and(wC,v0e,oY.negate(),sY.negate()),handler(i){var e;const n=(e=i.get(mu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof s_&&SC(i,r=>r.revealReference(n[0]))}});nl.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:De.and(wC,v0e,oY.negate(),sY.negate()),handler(i){var e;const n=(e=i.get(mu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof s_&&SC(i,r=>r.openReference(n[0],!0,!0))}});Dn.registerCommand("openReference",i=>{var e;const n=(e=i.get(mu).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(n)&&n[0]instanceof s_&&SC(i,r=>r.openReference(n[0],!1,!0))});var NCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},WL=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const HY=new st("hasSymbols",!1,w("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),F3=yn("ISymbolNavigationService");let Yz=class{constructor(e,t,n,r){this._editorService=t,this._notificationService=n,this._keybindingService=r,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=HY.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),(e=this._currentState)===null||e===void 0||e.dispose(),(t=this._currentMessage)===null||t===void 0||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1){this.reset();return}this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const n=new Zz(this._editorService),r=n.onDidChange(o=>{if(this._ignoreEditorChange)return;const s=this._editorService.getActiveCodeEditor();if(!s)return;const a=s.getModel(),l=s.getPosition();if(!a||!l)return;let c=!1,u=!1;for(const d of t.references)if(hX(d.uri,a.uri))c=!0,u=u||B.containsPosition(d.range,l);else if(c)break;(!c||!u)&&this.reset()});this._currentState=Zu(n,r)}revealNext(e){if(!this._currentModel)return Promise.resolve();this._currentIdx+=1,this._currentIdx%=this._currentModel.references.length;const t=this._currentModel.references[this._currentIdx];return this._showMessage(),this._ignoreEditorChange=!0,this._editorService.openCodeEditor({resource:t.uri,options:{selection:B.collapseToStart(t.range),selectionRevealType:3}},e).finally(()=>{this._ignoreEditorChange=!1})}_showMessage(){var e;(e=this._currentMessage)===null||e===void 0||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),n=t?w("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):w("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(n)}};Yz=NCe([WL(0,Vt),WL(1,Un),WL(2,$r),WL(3,ci)],Yz);In(F3,Yz,1);et(new class extends Vo{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:HY,kbOpts:{weight:100,primary:70}})}runEditorCommand(i,e){return i.get(F3).revealNext(e)}});nl.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:HY,primary:9,handler(i){i.get(F3).reset()}});let Zz=class{constructor(e){this._listener=new Map,this._disposables=new Te,this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._disposables.add(e.onCodeEditorRemove(this._onDidRemoveEditor,this)),this._disposables.add(e.onCodeEditorAdd(this._onDidAddEditor,this)),e.listCodeEditors().forEach(this._onDidAddEditor,this)}dispose(){this._disposables.dispose(),this._onDidChange.dispose(),si(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,Zu(e.onDidChangeCursorPosition(t=>this._onDidChange.fire({editor:e})),e.onDidChangeModelContent(t=>this._onDidChange.fire({editor:e}))))}_onDidRemoveEditor(e){var t;(t=this._listener.get(e))===null||t===void 0||t.dispose(),this._listener.delete(e)}};Zz=NCe([WL(0,Un)],Zz);async function hT(i,e,t,n){const o=t.ordered(i).map(a=>Promise.resolve(n(a,i,e)).then(void 0,l=>{Zr(l)})),s=await Promise.all(o);return lh(s.flat())}function B3(i,e,t,n){return hT(e,t,i,(r,o,s)=>r.provideDefinition(o,s,n))}function RCe(i,e,t,n){return hT(e,t,i,(r,o,s)=>r.provideDeclaration(o,s,n))}function MCe(i,e,t,n){return hT(e,t,i,(r,o,s)=>r.provideImplementation(o,s,n))}function ACe(i,e,t,n){return hT(e,t,i,(r,o,s)=>r.provideTypeDefinition(o,s,n))}function W3(i,e,t,n,r){return hT(e,t,i,async(o,s,a)=>{const l=await o.provideReferences(s,a,{includeDeclaration:!0},r);if(!n||!l||l.length!==2)return l;const c=await o.provideReferences(s,a,{includeDeclaration:!1},r);return c&&c.length===1?c:l})}async function fT(i){const e=await i(),t=new El(e,""),n=t.references.map(r=>r.link);return t.dispose(),n}tg("_executeDefinitionProvider",(i,e,t)=>{const n=i.get(_t),r=B3(n.definitionProvider,e,t,Cn.None);return fT(()=>r)});tg("_executeTypeDefinitionProvider",(i,e,t)=>{const n=i.get(_t),r=ACe(n.typeDefinitionProvider,e,t,Cn.None);return fT(()=>r)});tg("_executeDeclarationProvider",(i,e,t)=>{const n=i.get(_t),r=RCe(n.declarationProvider,e,t,Cn.None);return fT(()=>r)});tg("_executeReferenceProvider",(i,e,t)=>{const n=i.get(_t),r=W3(n.referenceProvider,e,t,!1,Cn.None);return fT(()=>r)});tg("_executeImplementationProvider",(i,e,t)=>{const n=i.get(_t),r=MCe(n.implementationProvider,e,t,Cn.None);return fT(()=>r)});var Yx,Zx,Qx,GR,qR,XR,YR,ZR;ts.appendMenuItem($.EditorContext,{submenu:$.EditorContextPeek,title:w("peek.submenu","Peek"),group:"navigation",order:100});class eS{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof eS||ae.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class Gs extends Sh{static all(){return Gs._allSymbolNavigationCommands.values()}static _patchConfig(e){const t={...e,f1:!0};if(t.menu)for(const n of En.wrap(t.menu))(n.id===$.EditorContext||n.id===$.EditorContextPeek)&&(n.when=De.and(e.precondition,n.when));return t}constructor(e,t){super(Gs._patchConfig(t)),this.configuration=e,Gs._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,n,r){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get($r),s=e.get(Un),a=e.get(k_),l=e.get(F3),c=e.get(_t),u=e.get(Ot),d=t.getModel(),h=t.getPosition(),f=eS.is(n)?n:new eS(d,h),g=new n_(t,5),p=Rk(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(async v=>{var m;if(!v||g.token.isCancellationRequested)return;kl(v.ariaMessage);let _;if(v.referenceAt(d.uri,h)){const S=this._getAlternativeCommand(t);!Gs._activeAlternativeCommands.has(S)&&Gs._allSymbolNavigationCommands.has(S)&&(_=Gs._allSymbolNavigationCommands.get(S))}const y=v.references.length;if(y===0){if(!this.configuration.muteMessage){const S=d.getWordAtPosition(h);(m=xa.get(t))===null||m===void 0||m.showMessage(this._getNoResultFoundMessage(S),h)}}else if(y===1&&_)Gs._activeAlternativeCommands.add(this.desc.id),u.invokeFunction(S=>_.runEditorCommand(S,t,n,r).finally(()=>{Gs._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(s,l,t,v,r)},v=>{o.error(v)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}async _onResult(e,t,n,r,o){const s=this._getGoToPreference(n);if(!(n instanceof o_)&&(this.configuration.openInPeek||s==="peek"&&r.references.length>1))this._openInPeek(n,r,o);else{const a=r.firstReference(),l=r.references.length>1&&s==="gotoAndPeek",c=await this._openReference(n,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,r,o):r.dispose(),s==="goto"&&t.put(a)}}async _openReference(e,t,n,r,o){let s;if(I5e(n)&&(s=n.targetSelectionRange),s||(s=n.range),!s)return;const a=await t.openCodeEditor({resource:n.uri,options:{selection:B.collapseToStart(s),selectionRevealType:3,selectionSource:"code.jump"}},e,r);if(a){if(o){const l=a.getModel(),c=a.createDecorationsCollection([{range:s,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}}_openInPeek(e,t,n){const r=a_.get(e);r&&e.hasModel()?r.toggleWidget(n??e.getSelection(),Io(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}Gs._allSymbolNavigationCommands=new Map;Gs._activeAlternativeCommands=new Set;class gT extends Gs{async _getLocationModel(e,t,n,r){return new El(await B3(e.definitionProvider,t,n,r),w("def.title","Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?w("noResultWord","No definition found for '{0}'",e.word):w("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}Ei((Yx=class extends gT{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Yx.id,title:{...$n("actions.goToDecl.label","Go to Definition"),mnemonicTitle:w({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:j.hasDefinitionProvider,keybinding:[{when:j.editorTextFocus,primary:70,weight:100},{when:De.and(j.editorTextFocus,f0e),primary:2118,weight:100}],menu:[{id:$.EditorContext,group:"navigation",order:1.1},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Dn.registerCommandAlias("editor.action.goToDeclaration",Yx.id)}},Yx.id="editor.action.revealDefinition",Yx));Ei((Zx=class extends gT{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:Zx.id,title:$n("actions.goToDeclToSide.label","Open Definition to the Side"),precondition:De.and(j.hasDefinitionProvider,j.isInEmbeddedEditor.toNegated()),keybinding:[{when:j.editorTextFocus,primary:co(2089,70),weight:100},{when:De.and(j.editorTextFocus,f0e),primary:co(2089,2118),weight:100}]}),Dn.registerCommandAlias("editor.action.openDeclarationToTheSide",Zx.id)}},Zx.id="editor.action.revealDefinitionAside",Zx));Ei((Qx=class extends gT{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Qx.id,title:$n("actions.previewDecl.label","Peek Definition"),precondition:De.and(j.hasDefinitionProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),keybinding:{when:j.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:$.EditorContextPeek,group:"peek",order:2}}),Dn.registerCommandAlias("editor.action.previewDeclaration",Qx.id)}},Qx.id="editor.action.peekDefinition",Qx));class PCe extends Gs{async _getLocationModel(e,t,n,r){return new El(await RCe(e.declarationProvider,t,n,r),w("decl.title","Declarations"))}_getNoResultFoundMessage(e){return e&&e.word?w("decl.noResultWord","No declaration found for '{0}'",e.word):w("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}Ei((GR=class extends PCe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:GR.id,title:{...$n("actions.goToDeclaration.label","Go to Declaration"),mnemonicTitle:w({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:De.and(j.hasDeclarationProvider,j.isInEmbeddedEditor.toNegated()),menu:[{id:$.EditorContext,group:"navigation",order:1.3},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?w("decl.noResultWord","No declaration found for '{0}'",e.word):w("decl.generic.noResults","No declaration found")}},GR.id="editor.action.revealDeclaration",GR));Ei(class extends PCe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:$n("actions.peekDecl.label","Peek Declaration"),precondition:De.and(j.hasDeclarationProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),menu:{id:$.EditorContextPeek,group:"peek",order:3}})}});class OCe extends Gs{async _getLocationModel(e,t,n,r){return new El(await ACe(e.typeDefinitionProvider,t,n,r),w("typedef.title","Type Definitions"))}_getNoResultFoundMessage(e){return e&&e.word?w("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):w("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}Ei((qR=class extends OCe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:qR.ID,title:{...$n("actions.goToTypeDefinition.label","Go to Type Definition"),mnemonicTitle:w({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:j.hasTypeDefinitionProvider,keybinding:{when:j.editorTextFocus,primary:0,weight:100},menu:[{id:$.EditorContext,group:"navigation",order:1.4},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},qR.ID="editor.action.goToTypeDefinition",qR));Ei((XR=class extends OCe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:XR.ID,title:$n("actions.peekTypeDefinition.label","Peek Type Definition"),precondition:De.and(j.hasTypeDefinitionProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),menu:{id:$.EditorContextPeek,group:"peek",order:4}})}},XR.ID="editor.action.peekTypeDefinition",XR));class FCe extends Gs{async _getLocationModel(e,t,n,r){return new El(await MCe(e.implementationProvider,t,n,r),w("impl.title","Implementations"))}_getNoResultFoundMessage(e){return e&&e.word?w("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):w("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}Ei((YR=class extends FCe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:YR.ID,title:{...$n("actions.goToImplementation.label","Go to Implementations"),mnemonicTitle:w({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:j.hasImplementationProvider,keybinding:{when:j.editorTextFocus,primary:2118,weight:100},menu:[{id:$.EditorContext,group:"navigation",order:1.45},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},YR.ID="editor.action.goToImplementation",YR));Ei((ZR=class extends FCe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:ZR.ID,title:$n("actions.peekImplementation.label","Peek Implementations"),precondition:De.and(j.hasImplementationProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),keybinding:{when:j.editorTextFocus,primary:3142,weight:100},menu:{id:$.EditorContextPeek,group:"peek",order:5}})}},ZR.ID="editor.action.peekImplementation",ZR));class BCe extends Gs{_getNoResultFoundMessage(e){return e?w("references.no","No references found for '{0}'",e.word):w("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}Ei(class extends BCe{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{...$n("goToReferences.label","Go to References"),mnemonicTitle:w({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:De.and(j.hasReferenceProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),keybinding:{when:j.editorTextFocus,primary:1094,weight:100},menu:[{id:$.EditorContext,group:"navigation",order:1.45},{id:$.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}async _getLocationModel(e,t,n,r){return new El(await W3(e.referenceProvider,t,n,!0,r),w("ref.title","References"))}});Ei(class extends BCe{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:$n("references.action.label","Peek References"),precondition:De.and(j.hasReferenceProvider,il.notInPeekEditor,j.isInEmbeddedEditor.toNegated()),menu:{id:$.EditorContextPeek,group:"peek",order:6}})}async _getLocationModel(e,t,n,r){return new El(await W3(e.referenceProvider,t,n,!1,r),w("ref.title","References"))}});class sit extends Gs{constructor(e,t,n){super(e,{id:"editor.action.goToLocation",title:$n("label.generic","Go to Any Symbol"),precondition:De.and(il.notInPeekEditor,j.isInEmbeddedEditor.toNegated())}),this._references=t,this._gotoMultipleBehaviour=n}async _getLocationModel(e,t,n,r){return new El(this._references,w("generic.title","Locations"))}_getNoResultFoundMessage(e){return e&&w("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}Dn.registerCommand({id:"editor.action.goToLocations",metadata:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:At},{name:"position",description:"The position at which to start",constraint:ae.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:async(i,e,t,n,r,o,s)=>{Xn(At.isUri(e)),Xn(ae.isIPosition(t)),Xn(Array.isArray(n)),Xn(typeof r>"u"||typeof r=="string"),Xn(typeof s>"u"||typeof s=="boolean");const a=i.get(Un),l=await a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(qf(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const u=new class extends sit{_getNoResultFoundMessage(d){return o||super._getNoResultFoundMessage(d)}}({muteMessage:!o,openInPeek:!!s,openToSide:!1},n,r);c.get(Ot).invokeFunction(u.run.bind(u),l)})}});Dn.registerCommand({id:"editor.action.peekLocations",metadata:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:At},{name:"position",description:"The position at which to start",constraint:ae.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto`"}]},handler:async(i,e,t,n,r)=>{i.get(sr).executeCommand("editor.action.goToLocations",e,t,n,r,void 0,!0)}});Dn.registerCommand({id:"editor.action.findReferences",handler:(i,e,t)=>{Xn(At.isUri(e)),Xn(ae.isIPosition(t));const n=i.get(_t),r=i.get(Un);return r.openCodeEditor({resource:e},r.getFocusedCodeEditor()).then(o=>{if(!qf(o)||!o.hasModel())return;const s=a_.get(o);if(!s)return;const a=Io(c=>W3(n.referenceProvider,o.getModel(),ae.lift(t),!1,c).then(u=>new El(u,w("ref.title","References")))),l=new B(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(s.toggleWidget(l,a,!1))})}});Dn.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var ait=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},k9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$L;let Kb=$L=class{constructor(e,t,n,r){this.textModelResolverService=t,this.languageService=n,this.languageFeaturesService=r,this.toUnhook=new Te,this.toUnhookForKeyboard=new Te,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new M3(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([s,a])=>{this.startFindDefinitionFromMouse(s,a??void 0)})),this.toUnhook.add(o.onExecute(s=>{this.isEnabled(s)&&this.gotoDefinition(s.target.position,s.hasSideBySideModifier).catch(a=>{en(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution($L.ID)}async startFindDefinitionFromCursor(e){await this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const n=e.target.position;this.startFindDefinition(n)}async startFindDefinition(e){var t;this.toUnhookForKeyboard.clear();const n=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!n){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===n.startColumn&&this.currentWordAtPosition.endColumn===n.endColumn&&this.currentWordAtPosition.word===n.word)return;this.currentWordAtPosition=n;const r=new tbe(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Io(a=>this.findDefinition(e,a));let o;try{o=await this.previousPromise}catch(a){en(a);return}if(!o||!o.length||!r.validate(this.editor)){this.removeLinkDecorations();return}const s=o[0].originSelectionRange?B.lift(o[0].originSelectionRange):new B(e.lineNumber,n.startColumn,e.lineNumber,n.endColumn);if(o.length>1){let a=s;for(const{originSelectionRange:l}of o)l&&(a=B.plusRange(a,l));this.addDecoration(a,new Is().appendText(w("multipleResults","Click to show {0} definitions.",o.length)))}else{const a=o[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:u}=a.range;if(u<1||u>c.getLineCount()){l.dispose();return}const d=this.getPreviewValue(c,u,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(s,d?new Is().appendCodeblock(h||"",d):void 0),l.dispose()})}}getPreviewValue(e,t,n){let r=n.range;return r.endLineNumber-r.startLineNumber>=$L.MAX_SOURCE_PREVIEW_LINES&&(r=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,r)}stripIndentationFromPreviewRange(e,t,n){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const r=!t&&this.editor.getOption(88)&&!this.isInPeekEditor(n);return new gT({openToSide:t,openInPeek:r,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(n)})}isInPeekEditor(e){const t=e.get(Vt);return il.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Kb.ID="editor.contrib.gotodefinitionatposition";Kb.MAX_SOURCE_PREVIEW_LINES=8;Kb=$L=ait([k9(1,ol),k9(2,ji),k9(3,_t)],Kb);jn(Kb.ID,Kb,2);let lit=class{constructor(e,t,n){this.value=e,this.isComplete=t,this.hasLoadingMessage=n}};class WCe extends fe{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new se),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new pi(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new pi(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new pi(()=>this._triggerLoadingMessage(),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=gBe(e=>this._computer.computeAsync(e)),(async()=>{try{for await(const e of this._asyncIterable)e&&(this._result.push(e),this._fireResult());this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(e){en(e)}})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){this._state===3&&this._setState(4)}_fireResult(){if(this._state===1||this._state===2)return;const e=this._state===0,t=this._state===4;this._onResult.fire(new lit(this._result.slice(0),e,t))}start(e){if(e===0)this._state===0&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}}class T9{constructor(e,t,n,r){this.priority=e,this.range=t,this.initialMousePosX=n,this.initialMousePosY=r,this.type=1}equals(e){return e.type===1&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return e.type===1&&t.lineNumber===this.range.startLineNumber}}class cb{constructor(e,t,n,r,o,s){this.priority=e,this.owner=t,this.range=n,this.initialMousePosX=r,this.initialMousePosY=o,this.supportsMarkerHover=s,this.type=2}equals(e){return e.type===2&&this.owner===e.owner}canAdoptVisibleHover(e,t){return e.type===2&&this.owner===e.owner}}const A_=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class VY{constructor(){this._onDidWillResize=new se,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new se,this.onDidResize=this._onDidResize.event,this._sashListener=new Te,this._size=new Kn(0,0),this._minSize=new Kn(0,0),this._maxSize=new Kn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Ls(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Ls(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Ls(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:zP.North}),this._southSash=new Ls(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:zP.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let e,t=0,n=0;this._sashListener.add(Je.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)(()=>{e===void 0&&(this._onDidWillResize.fire(),e=this._size,t=0,n=0)})),this._sashListener.add(Je.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)(()=>{e!==void 0&&(e=void 0,t=0,n=0,this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(this._eastSash.onDidChange(r=>{e&&(n=r.currentX-r.startX,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,east:!0}))})),this._sashListener.add(this._westSash.onDidChange(r=>{e&&(n=-(r.currentX-r.startX),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,west:!0}))})),this._sashListener.add(this._northSash.onDidChange(r=>{e&&(t=-(r.currentY-r.startY),this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,north:!0}))})),this._sashListener.add(this._southSash.onDidChange(r=>{e&&(t=r.currentY-r.startY,this.layout(e.height+t,e.width+n),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(Je.any(this._eastSash.onDidReset,this._westSash.onDidReset)(r=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(Je.any(this._northSash.onDidReset,this._southSash.onDidReset)(r=>{this._preferredSize&&(this.layout(this._preferredSize.height,this._size.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))}dispose(){this._northSash.dispose(),this._southSash.dispose(),this._eastSash.dispose(),this._westSash.dispose(),this._sashListener.dispose(),this._onDidResize.dispose(),this._onDidWillResize.dispose(),this.domNode.remove()}enableSashes(e,t,n,r){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=n?3:0,this._westSash.state=r?3:0}layout(e=this.size.height,t=this.size.width){const{height:n,width:r}=this._minSize,{height:o,width:s}=this._maxSize;e=Math.max(n,Math.min(o,e)),t=Math.max(r,Math.min(s,t));const a=new Kn(t,e);Kn.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const cit=30,uit=24;class dit extends fe{constructor(e,t=new Kn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new VY),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Kn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(n=>{this._resize(new Kn(n.dimension.width,n.dimension.height)),n.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?ae.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);return!t||!n?void 0:Br(t).top+n.top-cit}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),n=this._editor.getScrolledVisiblePosition(e);if(!t||!n)return;const r=Br(t),o=Tp(t.ownerDocument.body),s=r.top+n.top+n.height;return o.height-s-uit}_findPositionPreference(e,t){var n,r;const o=Math.min((n=this._availableVerticalSpaceBelow(t))!==null&&n!==void 0?n:1/0,e),s=Math.min((r=this._availableVerticalSpaceAbove(t))!==null&&r!==void 0?r:1/0,e),a=Math.min(Math.max(s,o),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=s?1:2:c=l<=o?2:1,c===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),c}_resize(e){this._resizableNode.layout(e.height,e.width)}}var zY=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},K0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},BM,qh;const Iae=He;let mO=BM=class extends fe{constructor(e,t,n){super(),this._editor=e,this._instantiationService=t,this._keybindingService=n,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(kv,this._editor)),this._participants=[];for(const r of A_.getAll())this._participants.push(this._instantiationService.createInstance(r,this._editor));this._participants.sort((r,o)=>r.hoverOrdinal-o.hoverOrdinal),this._computer=new _O(this._editor,this._participants),this._hoverOperation=this._register(new WCe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{if(!this._computer.anchor)return;const o=r.hasLoadingMessage?this._addLoadingMessage(r.value):r.value;this._withResult(new $Ce(this._computer.anchor,o,r.isComplete))})),this._register(Sr(this._widget.getDomNode(),"keydown",r=>{r.equals(9)&&this.hide()})),this._register(hr.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}_startShowingOrUpdateHover(e,t,n,r,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,n,r,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,n,r,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,n,r,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=r,this._computer.source=n,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const n=t.createLoadingMessage(this._computer.anchor);if(n)return e.slice(0).concat([n])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:n,showAtSecondaryPosition:r,highlightRange:o}=BM.computeHoverRanges(this._editor,e.range,t),s=new Te,a=s.add(new vO(this._keybindingService)),l=document.createDocumentFragment();let c=null;const u={fragment:l,statusBar:a,setColorPicker:h=>c=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const f=t.filter(g=>g.owner===h);f.length>0&&s.add(h.renderHoverParts(u,f))}const d=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const h=this._editor.createDecorationsCollection();h.set([{range:o,options:BM._DECORATION_OPTIONS}]),s.add(Rt(()=>{h.clear()}))}this._widget.showAt(l,new fit(e.initialMousePosX,e.initialMousePosY,c,n,r,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,d,s))}else s.dispose()}static computeHoverRanges(e,t,n){let r=1;if(e.hasModel()){const d=e._getViewModel(),h=d.coordinatesConverter,f=h.convertModelRangeToViewRange(t),g=new ae(f.startLineNumber,d.getLineMinColumn(f.startLineNumber));r=h.convertViewPositionToModelPosition(g).column}const o=t.startLineNumber;let s=t.startColumn,a=n[0].range,l=null;for(const d of n)a=B.plusRange(a,d.range),d.range.startLineNumber===o&&d.range.endLineNumber===o&&(s=Math.max(Math.min(s,d.range.startColumn),r)),d.forceShowAtRange&&(l=d.range);const c=l?l.getStartPosition():new ae(o,t.startColumn),u=l?l.getStartPosition():new ae(o,s);return{showAtPosition:c,showAtSecondaryPosition:u,highlightRange:a}}showsOrWillShow(e){if(this._widget.isResizing)return!0;const t=[];for(const r of this._participants)if(r.suggestHoverAnchor){const o=r.suggestHoverAnchor(e);o&&t.push(o)}const n=e.target;if(n.type===6&&t.push(new T9(0,n.range,e.event.posx,e.event.posy)),n.type===7){const r=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!n.detail.isAfterLines&&typeof n.detail.horizontalDistanceToText=="number"&&n.detail.horizontalDistanceToTexto.priority-r.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,n,r){this._startShowingOrUpdateHover(new T9(0,e,void 0,void 0),t,n,r,null)}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}get widget(){return this._widget}};mO._DECORATION_OPTIONS=sn.register({description:"content-hover-highlight",className:"hoverHighlight"});mO=BM=zY([K0(1,Ot),K0(2,ci)],mO);class $Ce{constructor(e,t,n){this.anchor=e,this.messages=t,this.isComplete=n}filter(e){const t=this.messages.filter(n=>n.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new hit(this,this.anchor,t,this.isComplete)}}class hit extends $Ce{constructor(e,t,n,r){super(t,n,r),this.original=e}filter(e){return this.original.filter(e)}}class fit{constructor(e,t,n,r,o,s,a,l,c,u){this.initialMousePosX=e,this.initialMousePosY=t,this.colorPicker=n,this.showAtPosition=r,this.showAtSecondaryPosition=o,this.preferAbove=s,this.stoleFocus=a,this.source=l,this.isBeforeContent=c,this.disposables=u,this.closestMouseDistance=void 0}}const kae=30,N9=10,git=6;let kv=qh=class extends dit{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,n,r,o){const s=e.getOption(67)+8,a=150,l=new Kn(a,s);super(e,l),this._configurationService=n,this._accessibilityService=r,this._keybindingService=o,this._hover=this._register(new TX),this._minimumSize=l,this._hoverVisibleKey=j.hoverVisible.bindTo(t),this._hoverFocusedKey=j.hoverFocused.bindTo(t),ke(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>{this.isVisible&&this._updateMaxDimensions()})),this._register(this._editor.onDidChangeConfiguration(u=>{u.hasChanged(50)&&this._updateFont()}));const c=this._register(dh(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return qh.ID}static _applyDimensions(e,t,n){const r=typeof t=="number"?`${t}px`:t,o=typeof n=="number"?`${n}px`:n;e.style.width=r,e.style.height=o}_setContentsDomNodeDimensions(e,t){const n=this._hover.contentsDomNode;return qh._applyDimensions(n,e,t)}_setContainerDomNodeDimensions(e,t){const n=this._hover.containerDomNode;return qh._applyDimensions(n,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,n){const r=typeof t=="number"?`${t}px`:t,o=typeof n=="number"?`${n}px`:n;e.style.maxWidth=r,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){qh._applyMaxDimensions(this._hover.contentsDomNode,e,t),qh._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,n=e.height;this._setHoverWidgetDimensions(t,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,n-N9))}_updateResizableNodeMaxDimensions(){var e,t;const n=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,r=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new Kn(n,r),this._setHoverWidgetMaxDimensions(n,r)}_resize(e){var t,n;qh._lastDimensions=new Kn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(n=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||n===void 0||n.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=git;return Array.from(this._hover.contentsDomNode.children).forEach(n=>{t+=n.clientHeight}),this._hasHorizontalScrollbar()&&(t+=N9),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const n=Br(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=Tae(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,n.left,n.top,n.width,n.height));const r=Tae(e,t,n.left,n.top,n.width,n.height);return r>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,r),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_updateFont(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),n=this._hover.contentsDomNode;n.style.fontSize=`${e}px`,n.style.lineHeight=`${t/e}`,Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(o=>this._editor.applyFontInfo(o))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,qh._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,qh._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var n,r,o,s;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=qg(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(n=this._findPositionPreference(a,l))!==null&&n!==void 0?n:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(r=t.colorPicker)===null||r===void 0||r.layout();const u=this._hover.containerDomNode.ownerDocument.activeElement===this._hover.containerDomNode&&y_e(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(s=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&s!==void 0?s:"");u&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+u)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Kn(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const n=this._hover.containerDomNode,r=this._hover.contentsDomNode,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(ua(n),Math.min(o,e)),this._setContentsDomNodeDimensions(ua(r),Math.min(o,e-N9))}setMinimumDimensions(e){this._minimumSize=new Kn(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Kn(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let n=qg(t),r=ua(t);if(this._resizableNode.layout(n,r),this._setHoverWidgetDimensions(r,n),n=qg(t),r=ua(t),this._contentWidth=r,this._updateMinimumWidth(),this._resizableNode.layout(n,r),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(n)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const o=qg(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-kae})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+kae})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};kv.ID="editor.contrib.resizableContentHoverWidget";kv._lastDimensions=new Kn(0,0);kv=qh=zY([K0(1,Vt),K0(2,gn),K0(3,ud),K0(4,ci)],kv);let vO=class extends fe{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=Iae("div.hover-row.status-bar"),this.actionsElement=ke(this.hoverElement,Iae("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),n=t?t.getLabel():null;return this._hasContent=!0,this._register(G4.render(this.actionsElement,e,n))}append(e){const t=ke(this.actionsElement,e);return this._hasContent=!0,t}};vO=zY([K0(0,ci)],vO);class _O{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const n=e.getModel(),r=t.range.startLineNumber;if(r>n.getLineCount())return[];const o=n.getLineMaxColumn(r);return e.getLineDecorations(r).filter(s=>{if(s.options.isWholeLine)return!0;const a=s.range.startLineNumber===r?s.range.startColumn:1,l=s.range.endLineNumber===r?s.range.endColumn:o;if(s.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return Kr.EMPTY;const n=_O._getLineDecorations(this._editor,t);return Kr.merge(this._participants.map(r=>r.computeAsync?r.computeAsync(t,n,e):Kr.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=_O._getLineDecorations(this._editor,this._anchor);let t=[];for(const n of this._participants)t=t.concat(n.computeSync(this._anchor,e));return lh(t)}}function Tae(i,e,t,n,r,o){const s=t+r/2,a=n+o/2,l=Math.max(Math.abs(i-s)-r/2,0),c=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+c*c)}const Nae=He;class ew extends fe{constructor(e,t,n){super(),this._renderDisposeables=this._register(new Te),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new TX),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Uf({editor:this._editor},t,n)),this._computer=new pit(this._editor),this._hoverOperation=this._register(new WCe(this._editor,this._computer)),this._register(this._hoverOperation.onResult(r=>{this._withResult(r.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return ew.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e,t){this._computer.lineNumber===e&&this._computer.lane===t||(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._computer.lane=t,this._hoverOperation.start(0))}hide(){this._computer.lineNumber=-1,this._hoverOperation.cancel(),this._isVisible&&(this._isVisible=!1,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible))}_withResult(e){this._messages=e,this._messages.length>0?this._renderMessages(this._computer.lineNumber,this._messages):this.hide()}_renderMessages(e,t){this._renderDisposeables.clear();const n=document.createDocumentFragment();for(const r of t){const o=Nae("div.hover-row.markdown-hover"),s=ke(o,Nae("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(r.value));s.appendChild(a.element),n.appendChild(o)}this._updateContents(n),this._showAt(e)}_updateContents(e){this._hover.contentsDomNode.textContent="",this._hover.contentsDomNode.appendChild(e),this._updateFont()}_showAt(e){this._isVisible||(this._isVisible=!0,this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible));const t=this._editor.getLayoutInfo(),n=this._editor.getTopForLineNumber(e),r=this._editor.getScrollTop(),o=this._editor.getOption(67),s=this._hover.containerDomNode.clientHeight,a=n-r-(s-o)/2,l=t.glyphMarginLeft+t.glyphMarginWidth+(this._computer.lane==="lineNo"?t.lineNumbersWidth:0);this._hover.containerDomNode.style.left=`${l}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}ew.ID="editor.contrib.modesGlyphHoverWidget";class pit{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}get lane(){return this._laneOrLine}set lane(e){this._laneOrLine=e}constructor(e){this._editor=e,this._lineNumber=-1,this._laneOrLine=$f.Center}computeSync(){var e,t;const n=a=>({value:a}),r=this._editor.getLineDecorations(this._lineNumber),o=[],s=this._laneOrLine==="lineNo";if(!r)return o;for(const a of r){const l=(t=(e=a.options.glyphMargin)===null||e===void 0?void 0:e.position)!==null&&t!==void 0?t:$f.Center;if(!s&&l!==this._laneOrLine)continue;const c=s?a.options.lineNumberHoverMessage:a.options.glyphMarginHoverMessage;!c||Hw(c)||o.push(...eq(c).map(n))}return o}}class mit{constructor(e,t,n){this.provider=e,this.hover=t,this.ordinal=n}}async function vit(i,e,t,n,r){try{const o=await Promise.resolve(i.provideHover(t,n,r));if(o&&bit(o))return new mit(i,o,e)}catch(o){Zr(o)}}function UY(i,e,t,n){const o=i.ordered(e).map((s,a)=>vit(s,a,e,t,n));return Kr.fromPromises(o).coalesce()}function _it(i,e,t,n){return UY(i,e,t,n).map(r=>r.hover).toPromise()}tg("_executeHoverProvider",(i,e,t)=>{const n=i.get(_t);return _it(n.hoverProvider,e,t,Cn.None)});function bit(i){const e=typeof i.range<"u",t=typeof i.contents<"u"&&i.contents&&i.contents.length>0;return e&&t}var Cit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},QR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Rae=He;class jd{constructor(e,t,n,r,o){this.owner=e,this.range=t,this.contents=n,this.isBeforeContent=r,this.ordinal=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let bO=class{constructor(e,t,n,r,o){this._editor=e,this._languageService=t,this._openerService=n,this._configurationService=r,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new jd(this,e.range,[new Is().appendText(w("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const n=this._editor.getModel(),r=e.range.startLineNumber,o=n.getLineMaxColumn(r),s=[];let a=1e3;const l=n.getLineLength(r),c=n.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),u=this._editor.getOption(117),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let h=!1;u>=0&&l>u&&e.range.startColumn>=u&&(h=!0,s.push(new jd(this,e.range,[{value:w("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof d=="number"&&l>=d&&s.push(new jd(this,e.range,[{value:w("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const p=g.range.startLineNumber===r?g.range.startColumn:1,v=g.range.endLineNumber===r?g.range.endColumn:o,m=g.options.hoverMessage;if(!m||Hw(m))continue;g.options.beforeContentClassName&&(f=!0);const _=new B(e.range.startLineNumber,p,e.range.startLineNumber,v);s.push(new jd(this,_,eq(m),f,a++))}return s}computeAsync(e,t,n){if(!this._editor.hasModel()||e.type!==1)return Kr.EMPTY;const r=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(r))return Kr.EMPTY;const o=new ae(e.range.startLineNumber,e.range.startColumn);return UY(this._languageFeaturesService.hoverProvider,r,o,n).filter(s=>!Hw(s.hover.contents)).map(s=>{const a=s.hover.range?B.lift(s.hover.range):e.range;return new jd(this,a,s.hover.contents,!1,s.ordinal)})}renderHoverParts(e,t){return HCe(e,t,this._editor,this._languageService,this._openerService)}};bO=Cit([QR(1,ji),QR(2,al),QR(3,gn),QR(4,_t)],bO);function HCe(i,e,t,n,r){e.sort((s,a)=>s.ordinal-a.ordinal);const o=new Te;for(const s of e)for(const a of s.contents){if(Hw(a))continue;const l=Rae("div.hover-row.markdown-hover"),c=ke(l,Rae("div.hover-contents")),u=o.add(new Uf({editor:t},n,r));o.add(u.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",i.onContentsChanged()}));const d=o.add(u.render(a));c.appendChild(d.element),i.fragment.appendChild(l)}return o}var VCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},CO=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};class Mae{constructor(e,t,n){this.marker=e,this.index=t,this.total=n}}let Qz=class{constructor(e,t,n){this._markerService=t,this._configService=n,this._onDidChange=new se,this.onDidChange=this._onDidChange.event,this._dispoables=new Te,this._markers=[],this._nextIdx=-1,At.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const r=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let c=LD(a.resource.toString(),l.resource.toString());return c===0&&(r==="position"?c=B.compareRangesUsingStarts(a,l)||pr.compare(a.severity,l.severity):c=pr.compare(a.severity,l.severity)||B.compareRangesUsingStarts(a,l)),c},s=()=>{this._markers=this._markerService.read({resource:At.isUri(e)?e:void 0,severities:pr.Error|pr.Warning|pr.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};s(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(s(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new Mae(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,n){let r=!1,o=this._markers.findIndex(s=>s.resource.toString()===e.uri.toString());o<0&&(o=_D(this._markers,{resource:e.uri},(s,a)=>LD(s.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let s=o;sr.resource.toString()===e.toString());if(!(n<0)){for(;n=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},r1=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},tU;class wit{constructor(e,t,n,r,o){this._openerService=r,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new Te,this._editor=t;const s=document.createElement("div");s.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),s.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),s.appendChild(this._relatedBlock),this._disposables.add(Sr(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&n(l)})),this._scrollable=new pve(s,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{s.style.left=`-${a.scrollLeft}px`,s.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){si(this._disposables)}update(e){const{source:t,message:n,relatedInformation:r,code:o}=e;let s=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?s+=o.length:s+=o.value.length);const a=Jf(n);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+s,this._longestLineLength);Ns(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=He("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=ke(this._codeLink,He("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(Ns(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Ts(r)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(67)*.66)}px`,this._lines+=1;for(const f of r){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const v=document.createElement("span");v.innerText=f.message,g.appendChild(p),g.appendChild(v),this._lines+=1,h.appendChild(g)}}const c=this._editor.getOption(50),u=Math.ceil(c.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=c.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:u,scrollHeight:d})}layout(e,t){this._scrollable.getDomNode().style.height=`${e}px`,this._scrollable.getDomNode().style.width=`${t}px`,this._scrollable.setScrollDimensions({width:t,height:e})}getHeightInLines(){return Math.min(17,this._lines)}getAriaLabel(e){let t="";switch(e.severity){case pr.Error:t=w("Error","Error");break;case pr.Warning:t=w("Warning","Warning");break;case pr.Info:t=w("Info","Info");break;case pr.Hint:t=w("Hint","Hint");break}let n=w("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const r=this._editor.getModel();return r&&e.startLineNumber<=r.getLineCount()&&e.startLineNumber>=1&&(n=`${r.getLineContent(e.startLineNumber)}, ${n}`),n}}let tS=tU=class extends pO{constructor(e,t,n,r,o,s,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=n,this._menuService=r,this._contextKeyService=s,this._labelService=a,this._callOnDispose=new Te,this._onDidSelectRelatedInformation=new se,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=pr.Warning,this._backgroundColor=me.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(Eit);let t=nU,n=Sit;this._severity===pr.Warning?(t=WM,n=xit):this._severity===pr.Info&&(t=iU,n=Lit);const r=e.getColor(t),o=e.getColor(n);this.style({arrowColor:r,frameColor:r,headerBackgroundColor:o,primaryHeadingColor:e.getColor(kCe),secondaryHeadingColor:e.getColor(TCe)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(r=>this.editor.focus()));const t=[],n=this._menuService.createMenu(tU.TitleMenu,this._contextKeyService);i3(n,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),n.dispose()}_fillTitleIcon(e){this._icon=ke(e,He(""))}_fillBody(e){this._parentContainer=e,e.classList.add("marker-widget"),this._parentContainer.tabIndex=0,this._parentContainer.setAttribute("role","tooltip"),this._container=document.createElement("div"),e.appendChild(this._container),this._message=new wit(this._container,this.editor,t=>this._onDidSelectRelatedInformation.fire(t),this._openerService,this._labelService),this._disposables.add(this._message)}show(){throw new Error("call showAtMarker")}showAtMarker(e,t,n){this._container.classList.remove("stale"),this._message.update(e),this._severity=e.severity,this._applyTheme(this._themeService.getColorTheme());const r=B.lift(e),o=this.editor.getPosition(),s=o&&r.containsPosition(o)?o:r.getStartPosition();super.show(s,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=n>1?w("problems","{0} of {1} problems",t,n):w("change","{0} of {1} problem",t,n);this.setTitle(su(a.uri),l)}this._icon.className=`codicon ${eU.className(pr.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(s,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};tS.TitleMenu=new $("gotoErrorTitleMenu");tS=tU=yit([r1(1,To),r1(2,al),r1(3,hu),r1(4,Ot),r1(5,Vt),r1(6,Vw)],tS);const Aae=VD(wf,Y7e),Pae=VD(qs,$D),Oae=VD(Za,HD),nU=X("editorMarkerNavigationError.background",{dark:Aae,light:Aae,hcDark:Sn,hcLight:Sn},w("editorMarkerNavigationError","Editor marker navigation widget error color.")),Sit=X("editorMarkerNavigationError.headerBackground",{dark:It(nU,.1),light:It(nU,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),WM=X("editorMarkerNavigationWarning.background",{dark:Pae,light:Pae,hcDark:Sn,hcLight:Sn},w("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),xit=X("editorMarkerNavigationWarning.headerBackground",{dark:It(WM,.1),light:It(WM,.1),hcDark:"#0C141F",hcLight:It(WM,.2)},w("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),iU=X("editorMarkerNavigationInfo.background",{dark:Oae,light:Oae,hcDark:Sn,hcLight:Sn},w("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),Lit=X("editorMarkerNavigationInfo.headerBackground",{dark:It(iU,.1),light:It(iU,.1),hcDark:null,hcLight:null},w("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),Eit=X("editorMarkerNavigation.background",{dark:Eo,light:Eo,hcDark:Eo,hcLight:Eo},w("editorMarkerNavigationBackground","Editor marker navigation widget background."));var Dit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},JR=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},HL;let l_=HL=class{static get(e){return e.getContribution(HL.ID)}constructor(e,t,n,r,o){this._markerNavigationService=t,this._contextKeyService=n,this._editorService=r,this._instantiationService=o,this._sessionDispoables=new Te,this._editor=e,this._widgetVisible=UCe.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(tS,this._editor),this._widget.onDidClose(()=>this.close(),this,this._sessionDispoables),this._widgetVisible.set(!0),this._sessionDispoables.add(this._model),this._sessionDispoables.add(this._widget),this._sessionDispoables.add(this._editor.onDidChangeCursorPosition(n=>{var r,o,s;(!(!((r=this._model)===null||r===void 0)&&r.selected)||!B.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,n.position))&&((s=this._model)===null||s===void 0||s.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const n=this._model.find(this._editor.getModel().uri,this._widget.position);n?this._widget.updateMarker(n.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(n=>{this._editorService.openCodeEditor({resource:n.resource,options:{pinned:!0,revealIfOpened:!0,selection:B.lift(n).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new ae(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}async nagivate(e,t){var n,r;if(this._editor.hasModel()){const o=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(o.move(e,this._editor.getModel(),this._editor.getPosition()),!o.selected)return;if(o.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const s=await this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);s&&((n=HL.get(s))===null||n===void 0||n.close(),(r=HL.get(s))===null||r===void 0||r.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}}};l_.ID="editor.contrib.markerController";l_=HL=Dit([JR(1,zCe),JR(2,Vt),JR(3,Un),JR(4,Ot)],l_);class $3 extends gt{constructor(e,t,n){super(n),this._next=e,this._multiFile=t}async run(e,t){var n;t.hasModel()&&((n=l_.get(t))===null||n===void 0||n.nagivate(this._next,this._multiFile))}}class Tv extends $3{constructor(){super(!0,!1,{id:Tv.ID,label:Tv.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:578,weight:100},menuOpts:{menuId:tS.TitleMenu,title:Tv.LABEL,icon:Mr("marker-navigation-next",Xe.arrowDown,w("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Tv.ID="editor.action.marker.next";Tv.LABEL=w("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class ub extends $3{constructor(){super(!1,!1,{id:ub.ID,label:ub.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:1602,weight:100},menuOpts:{menuId:tS.TitleMenu,title:ub.LABEL,icon:Mr("marker-navigation-previous",Xe.arrowUp,w("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}ub.ID="editor.action.marker.prev";ub.LABEL=w("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class Iit extends $3{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:w("markerAction.nextInFiles.label","Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:66,weight:100},menuOpts:{menuId:$.MenubarGoMenu,title:w({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class kit extends $3{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:w("markerAction.previousInFiles.label","Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:j.focus,primary:1090,weight:100},menuOpts:{menuId:$.MenubarGoMenu,title:w({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}jn(l_.ID,l_,4);Be(Tv);Be(ub);Be(Iit);Be(kit);const UCe=new st("markersNavigationVisible",!1),Tit=Vo.bindToContribution(l_.get);et(new Tit({id:"closeMarkersNavigation",precondition:UCe,handler:i=>i.close(),kbOpts:{weight:100+50,kbExpr:j.focus,primary:9,secondary:[1033]}}));var Nit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},R9=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const Iu=He;class Rit{constructor(e,t,n){this.owner=e,this.range=t,this.marker=n}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const Fae={type:1,filter:{include:Ut.QuickFix},triggerAction:Tl.QuickFixHover};let rU=class{constructor(e,t,n,r){this._editor=e,this._markerDecorationsService=t,this._openerService=n,this._languageFeaturesService=r,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const n=this._editor.getModel(),r=e.range.startLineNumber,o=n.getLineMaxColumn(r),s=[];for(const a of t){const l=a.range.startLineNumber===r?a.range.startColumn:1,c=a.range.endLineNumber===r?a.range.endColumn:o,u=this._markerDecorationsService.getMarker(n.uri,a);if(!u)continue;const d=new B(e.range.startLineNumber,l,e.range.startLineNumber,c);s.push(new Rit(this,d,u))}return s}renderHoverParts(e,t){if(!t.length)return fe.None;const n=new Te;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,n)));const r=t.length===1?t[0]:t.sort((o,s)=>pr.compare(o.marker.severity,s.marker.severity))[0];return this.renderMarkerStatusbar(e,r,n),n}renderMarkerHover(e,t){const n=Iu("div.hover-row"),r=ke(n,Iu("div.marker.hover-contents")),{source:o,message:s,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(r);const c=ke(r,Iu("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=s,o||a)if(a&&typeof a!="string"){const u=Iu("span");if(o){const g=ke(u,Iu("span"));g.innerText=o}const d=ke(u,Iu("a.code-link"));d.setAttribute("href",a.target.toString()),t.add(ye(d,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=ke(d,Iu("span"));h.innerText=a.value;const f=ke(r,u);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const u=ke(r,Iu("span"));u.style.opacity="0.6",u.style.paddingLeft="6px",u.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(Ts(l))for(const{message:u,resource:d,startLineNumber:h,startColumn:f}of l){const g=ke(r,Iu("div"));g.style.marginTop="8px";const p=ke(g,Iu("a"));p.innerText=`${su(d)}(${h}, ${f}): `,p.style.cursor="pointer",t.add(ye(p,"click",m=>{m.stopPropagation(),m.preventDefault(),this._openerService&&this._openerService.open(d,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(en)}));const v=ke(g,Iu("span"));v.innerText=u,this._editor.applyFontInfo(v)}return n}renderMarkerStatusbar(e,t,n){if(t.marker.severity===pr.Error||t.marker.severity===pr.Warning||t.marker.severity===pr.Info){const r=l_.get(this._editor);r&&e.statusBar.addAction({label:w("view problem","View Problem"),commandId:Tv.ID,run:()=>{e.hide(),r.showAtMarker(t.marker),this._editor.focus()}})}if(!this._editor.getOption(91)){const r=e.statusBar.append(Iu("div"));this.recentMarkerCodeActionsInfo&&(HP.makeKey(this.recentMarkerCodeActionsInfo.marker)===HP.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(r.textContent=w("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?fe.None:jv(()=>r.textContent=w("checkingForQuickFixes","Checking for quick fixes..."),200,n);r.textContent||(r.textContent=String.fromCharCode(160));const s=this.getCodeActions(t.marker);n.add(Rt(()=>s.cancel())),s.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),r.textContent=w("noQuickFixes","No quick fixes available");return}r.style.display="none";let l=!1;n.add(Rt(()=>{l||a.dispose()})),e.statusBar.addAction({label:w("quick fixes","Quick Fix..."),commandId:PY,run:c=>{l=!0;const u=i_.get(this._editor),d=Br(c);e.hide(),u==null||u.showCodeActions(Fae,a,{x:d.left,y:d.top,width:d.width,height:d.height})}})},en)}}getCodeActions(e){return Io(t=>ME(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new B(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),Fae,mp.None,t))}};rU=Nit([R9(1,Gq),R9(2,al),R9(3,_t)],rU);const jCe="editor.action.inlineSuggest.commit",KCe="editor.action.inlineSuggest.showPrevious",GCe="editor.action.inlineSuggest.showNext";var jY=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},Kd=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},$M;let oU=class extends fe{constructor(e,t,n){super(),this.editor=e,this.model=t,this.instantiationService=n,this.alwaysShowToolbar=Vi(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=Yt(this,r=>{var o,s,a;const l=(o=this.model.read(r))===null||o===void 0?void 0:o.primaryGhostText.read(r);if(!this.alwaysShowToolbar.read(r)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const u=new ae(l.lineNumber,Math.min(c,(a=(s=this.sessionPosition)===null||s===void 0?void 0:s.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=u,u}),this._register(Dh((r,o)=>{const s=this.model.read(r);if(!s||!this.alwaysShowToolbar.read(r))return;const a=o.add(this.instantiationService.createInstance(c_,this.editor,!0,this.position,s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),o.add(Rt(()=>e.removeContentWidget(a))),o.add(bn(l=>{this.position.read(l)&&s.lastTriggerKind.read(l)!==fp.Explicit&&s.triggerExplicitly()}))}))}};oU=jY([Kd(2,Ot)],oU);const Mit=Mr("inline-suggestion-hints-next",Xe.chevronRight,w("parameterHintsNextIcon","Icon for show next parameter hint.")),Ait=Mr("inline-suggestion-hints-previous",Xe.chevronLeft,w("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let c_=$M=class extends fe{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,n){const r=new xl(e,t,n,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let s=t;return o&&(s=w({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,o.getLabel())),r.tooltip=s,r}constructor(e,t,n,r,o,s,a,l,c,u,d){super(),this.editor=e,this.withBorder=t,this._position=n,this._currentSuggestionIdx=r,this._suggestionCount=o,this._extraCommands=s,this._commandService=a,this.keybindingService=c,this._contextKeyService=u,this._menuService=d,this.id=`InlineSuggestionHintsContentWidget${$M.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=gi("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[gi("div@toolBar")]),this.previousAction=this.createCommandAction(KCe,w("previous","Previous"),Wt.asClassName(Ait)),this.availableSuggestionCountAction=new xl("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(GCe,w("next","Next"),Wt.asClassName(Mit)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu($.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new pi(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new pi(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(sU,this.nodes.toolBar,$.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof pc)return l.createInstance(Oit,h,void 0);if(h===this.availableSuggestionCountAction){const g=new Pit(void 0,h,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{$M._dropDownVisible=h})),this._register(bn(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(bn(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(bn(h=>{const f=this._extraCommands.read(h);if(or(this.lastCommands,f))return;this.lastCommands=f;const g=f.map(p=>({class:void 0,id:p.id,enabled:!0,tooltip:p.tooltip||"",label:p.title,run:v=>this._commandService.executeCommand(p.id)}));for(const[p,v]of this.inlineCompletionsActionsMenus.getActions())for(const m of v)m instanceof pc&&g.push(m);g.length>0&&g.unshift(new lo),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};c_._dropDownVisible=!1;c_.id=0;c_=$M=jY([Kd(6,sr),Kd(7,Ot),Kd(8,ci),Kd(9,Vt),Kd(10,hu)],c_);class Pit extends jw{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}updateTooltip(){}}let Oit=class extends e_{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=gi("div.keybinding").root;new PS(t,yl,{disableTitle:!0,...S0e}).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}updateTooltip(){}},sU=class extends LI{constructor(e,t,n,r,o,s,a,l){super(e,{resetMenu:t,...n},r,o,s,a,l),this.menuId=t,this.options2=n,this.menuService=r,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,n,r,o,s,a;const l=[],c=[];i3(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(n=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||n===void 0?void 0:n.primaryGroup,(o=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){or(this.prependedPrimaryActions,e,(t,n)=>t===n)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){or(this.additionalActions,e,(t,n)=>t===n)||(this.additionalActions=e,this.updateToolbar())}};sU=jY([Kd(3,hu),Kd(4,Vt),Kd(5,Ol),Kd(6,ci),Kd(7,ea)],sU);var Fit=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},e2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},aU;const Bit=!1;let rl=aU=class extends fe{constructor(e,t,n,r,o){super(),this._editor=e,this._instantiationService=t,this._openerService=n,this._languageService=r,this._keybindingService=o,this._listenersStore=new Te,this._hoverState={mouseDown:!1,contentHoverFocused:!1,activatedByDecoratorClick:!1},this._reactToEditorMouseMoveRunner=this._register(new pi(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookListeners(),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(60)&&(this._unhookListeners(),this._hookListeners())}))}static get(e){return e.getContribution(aU.ID)}_hookListeners(){const e=this._editor.getOption(60);this._hoverSettings={enabled:e.enabled,sticky:e.sticky,hidingDelay:e.delay},e.enabled?(this._listenersStore.add(this._editor.onMouseDown(t=>this._onEditorMouseDown(t))),this._listenersStore.add(this._editor.onMouseUp(()=>this._onEditorMouseUp())),this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))):(this._listenersStore.add(this._editor.onMouseMove(t=>this._onEditorMouseMove(t))),this._listenersStore.add(this._editor.onKeyDown(t=>this._onKeyDown(t)))),this._listenersStore.add(this._editor.onMouseLeave(t=>this._onEditorMouseLeave(t))),this._listenersStore.add(this._editor.onDidChangeModel(()=>{this._cancelScheduler(),this._hideWidgets()})),this._listenersStore.add(this._editor.onDidChangeModelContent(()=>this._cancelScheduler())),this._listenersStore.add(this._editor.onDidScrollChange(t=>this._onEditorScrollChanged(t)))}_unhookListeners(){this._listenersStore.clear()}_cancelScheduler(){this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._hoverState.mouseDown=!0;const n=e.target;if(n.type===9&&n.detail===kv.ID){this._hoverState.contentHoverFocused=!0;return}n.type===12&&n.detail===ew.ID||(n.type!==12&&(this._hoverState.contentHoverFocused=!1),!(!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing)&&this._hideWidgets())}_onEditorMouseUp(){this._hoverState.mouseDown=!1}_onEditorMouseLeave(e){var t,n;this._cancelScheduler();const r=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((n=this._contentWidget)===null||n===void 0)&&n.containsNode(r)||this._hideWidgets()}_isMouseOverWidget(e){var t,n,r,o,s;const a=e.target,l=this._hoverSettings.sticky;return!!(l&&a.type===9&&a.detail===kv.ID||l&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((n=e.event.browserEvent.view)===null||n===void 0?void 0:n.document.activeElement))&&!(!((o=(r=e.event.browserEvent.view)===null||r===void 0?void 0:r.getSelection())===null||o===void 0)&&o.isCollapsed)||!l&&a.type===9&&a.detail===kv.ID&&(!((s=this._contentWidget)===null||s===void 0)&&s.isColorPickerVisible)||l&&a.type===12&&a.detail===ew.ID)}_onEditorMouseMove(e){var t,n,r,o;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((n=this._contentWidget)===null||n===void 0)&&n.isResizing||this._hoverState.mouseDown&&this._hoverState.contentHoverFocused)return;const s=this._hoverSettings.sticky;if(s&&(!((r=this._contentWidget)===null||r===void 0)&&r.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}const l=this._hoverSettings.hidingDelay;if(!((o=this._contentWidget)===null||o===void 0)&&o.isVisible&&s&&l>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(l);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,n,r,o;if(!e)return;const s=e.target,a=(t=s.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),l=this._editor.getOption(147),c=this._hoverSettings.enabled,u=this._hoverState.activatedByDecoratorClick;if(a&&(l==="click"&&!u||l==="hover"&&!c&&!Bit||l==="clickAndHover"&&!c&&!u)||!a&&!c&&!u){this._hideWidgets();return}if(this._getOrCreateContentWidget().showsOrWillShow(e)){(n=this._glyphWidget)===null||n===void 0||n.hide();return}if(s.type===2&&s.position&&s.detail.glyphMarginLane){(r=this._contentWidget)===null||r===void 0||r.hide(),this._getOrCreateGlyphWidget().startShowingAt(s.position.lineNumber,s.detail.glyphMarginLane);return}if(s.type===3&&s.position){(o=this._contentWidget)===null||o===void 0||o.hide(),this._getOrCreateGlyphWidget().startShowingAt(s.position.lineNumber,"lineNo");return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const n=this._keybindingService.softDispatch(e,this._editor.getDomNode()),r=n.kind===1||n.kind===2&&n.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode===5||e.keyCode===6||e.keyCode===57||e.keyCode===4||r||this._hideWidgets()}_hideWidgets(){var e,t,n;this._hoverState.mouseDown&&this._hoverState.contentHoverFocused&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||c_.dropDownVisible||(this._hoverState.activatedByDecoratorClick=!1,this._hoverState.contentHoverFocused=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(n=this._contentWidget)===null||n===void 0||n.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(mO,this._editor)),this._contentWidget}_getOrCreateGlyphWidget(){return this._glyphWidget||(this._glyphWidget=new ew(this._editor,this._languageService,this._openerService)),this._glyphWidget}showContentHover(e,t,n,r,o=!1){this._hoverState.activatedByDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,n,r)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookListeners(),this._listenersStore.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};rl.ID="editor.contrib.hover";rl=aU=Fit([e2(1,Ot),e2(2,al),e2(3,ji),e2(4,ci)],rl);var Dd;(function(i){i.NoAutoFocus="noAutoFocus",i.FocusIfVisible="focusIfVisible",i.AutoFocusImmediately="autoFocusImmediately"})(Dd||(Dd={}));class Wit extends gt{constructor(){super({id:"editor.action.showHover",label:w({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse."]},"Show or Focus Hover"),metadata:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if and when the hover should take focus upon being triggered by this action.",enum:[Dd.NoAutoFocus,Dd.FocusIfVisible,Dd.AutoFocusImmediately],enumDescriptions:[w("showOrFocusHover.focus.noAutoFocus","The hover will not automatically take focus."),w("showOrFocusHover.focus.focusIfVisible","The hover will take focus only if it is already visible."),w("showOrFocusHover.focus.autoFocusImmediately","The hover will automatically take focus when it appears.")],default:Dd.FocusIfVisible}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:j.editorTextFocus,primary:co(2089,2087),weight:100}})}run(e,t,n){if(!t.hasModel())return;const r=rl.get(t);if(!r)return;const o=n==null?void 0:n.focus;let s=Dd.FocusIfVisible;Object.values(Dd).includes(o)?s=o:typeof o=="boolean"&&o&&(s=Dd.AutoFocusImmediately);const a=c=>{const u=t.getPosition(),d=new B(u.lineNumber,u.column,u.lineNumber,u.column);r.showContentHover(d,1,1,c)},l=t.getOption(2)===2;r.isHoverVisible?s!==Dd.NoAutoFocus?r.focus():a(l):a(l||s===Dd.AutoFocusImmediately)}}class $it extends gt{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:w({key:"showDefinitionPreviewHover",comment:["Label for action that will trigger the showing of definition preview hover in the editor.","This allows for users to show the definition preview hover without using the mouse."]},"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const n=rl.get(t);if(!n)return;const r=t.getPosition();if(!r)return;const o=new B(r.lineNumber,r.column,r.lineNumber,r.column),s=Kb.get(t);if(!s)return;s.startFindDefinitionFromCursor(r).then(()=>{n.showContentHover(o,1,1,!0)})}}class Hit extends gt{constructor(){super({id:"editor.action.scrollUpHover",label:w({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:16,weight:100}})}run(e,t){const n=rl.get(t);n&&n.scrollUp()}}class Vit extends gt{constructor(){super({id:"editor.action.scrollDownHover",label:w({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:18,weight:100}})}run(e,t){const n=rl.get(t);n&&n.scrollDown()}}class zit extends gt{constructor(){super({id:"editor.action.scrollLeftHover",label:w({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:15,weight:100}})}run(e,t){const n=rl.get(t);n&&n.scrollLeft()}}class Uit extends gt{constructor(){super({id:"editor.action.scrollRightHover",label:w({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:17,weight:100}})}run(e,t){const n=rl.get(t);n&&n.scrollRight()}}class jit extends gt{constructor(){super({id:"editor.action.pageUpHover",label:w({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const n=rl.get(t);n&&n.pageUp()}}class Kit extends gt{constructor(){super({id:"editor.action.pageDownHover",label:w({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const n=rl.get(t);n&&n.pageDown()}}class Git extends gt{constructor(){super({id:"editor.action.goToTopHover",label:w({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const n=rl.get(t);n&&n.goToTop()}}class qit extends gt{constructor(){super({id:"editor.action.goToBottomHover",label:w({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:j.hoverFocused,kbOpts:{kbExpr:j.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const n=rl.get(t);n&&n.goToBottom()}}jn(rl.ID,rl,2);Be(Wit);Be($it);Be(Hit);Be(Vit);Be(zit);Be(Uit);Be(jit);Be(Kit);Be(Git);Be(qit);A_.register(bO);A_.register(rU);fu((i,e)=>{const t=i.getColor(rve);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});class lU extends fe{constructor(e){super(),this._editor=e,this._register(e.onMouseDown(t=>this.onMouseDown(t)))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(147);if(t!=="click"&&t!=="clickAndHover")return;const n=e.target;if(n.type!==6||!n.detail.injectedText||n.detail.injectedText.options.attachedData!==vCe||!n.range)return;const r=this._editor.getContribution(rl.ID);if(r&&!r.isColorPickerVisible){const o=new B(n.range.startLineNumber,n.range.startColumn+1,n.range.endLineNumber,n.range.endColumn+1);r.showContentHover(o,1,0,!1,!0)}}}lU.ID="editor.contrib.colorContribution";jn(lU.ID,lU,2);A_.register(gO);var qCe=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},$d=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},cU,uU;let u_=cU=class extends fe{constructor(e,t,n,r,o,s,a){super(),this._editor=e,this._modelService=n,this._keybindingService=r,this._instantiationService=o,this._languageFeatureService=s,this._languageConfigurationService=a,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=j.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=j.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||(e=this._standaloneColorPickerWidget)===null||e===void 0||e.focus():this._standaloneColorPickerWidget=new yO(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),(e=this._standaloneColorPickerWidget)===null||e===void 0||e.hide(),this._editor.focus()}insertColor(){var e;(e=this._standaloneColorPickerWidget)===null||e===void 0||e.updateEditor(),this.hide()}static get(e){return e.getContribution(cU.ID)}};u_.ID="editor.contrib.standaloneColorPickerController";u_=cU=qCe([$d(1,Vt),$d(2,tr),$d(3,ci),$d(4,Ot),$d(5,_t),$d(6,Di)],u_);jn(u_.ID,u_,1);const Bae=8,Xit=22;let yO=uU=class extends fe{constructor(e,t,n,r,o,s,a,l){var c;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=n,this._modelService=o,this._keybindingService=s,this._languageFeaturesService=a,this._languageConfigurationService=l,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new se),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=r.createInstance(TI,this._editor),this._position=(c=this._editor._getViewModel())===null||c===void 0?void 0:c.getPrimaryCursorState().modelState.position;const u=this._editor.getSelection(),d=u?{startLineNumber:u.startLineNumber,startColumn:u.startColumn,endLineNumber:u.endLineNumber,endColumn:u.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},h=this._register(dh(this._body));this._register(h.onDidBlur(f=>{this.hide()})),this._register(h.onDidFocus(f=>{this.focus()})),this._register(this._editor.onDidChangeCursorPosition(()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()})),this._register(this._editor.onMouseMove(f=>{var g;const p=(g=f.target.element)===null||g===void 0?void 0:g.classList;p&&p.contains("colorpicker-color-decoration")&&this.hide()})),this._register(this.onResult(f=>{this._render(f.value,f.foundInEditor)})),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return uU.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}hide(){this.dispose(),this._standaloneColorPickerVisible.set(!1),this._standaloneColorPickerFocused.set(!1),this._editor.removeContentWidget(this),this._editor.focus()}focus(){this._standaloneColorPickerFocused.set(!0),this._body.focus()}async _start(e){const t=await this._computeAsync(e);t&&this._onResult.fire(new Yit(t.result,t.foundInEditor))}async _computeAsync(e){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},n=await this._standaloneColorPickerParticipant.createColorHover(t,new WY(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return n?{result:n.colorHover,foundInEditor:n.foundInEditor}:null}_render(e,t){const n=document.createDocumentFragment(),r=this._register(new vO(this._keybindingService));let o;const s={fragment:n,statusBar:r,setColorPicker:p=>o=p,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),o===void 0)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(this._editor.getLayoutInfo().width*.66,500)+"px",this._body.tabIndex=0,this._body.appendChild(n),o.layout();const a=o.body,l=a.saturationBox.domNode.clientWidth,c=a.domNode.clientWidth-l-Xit-Bae,u=o.body.enterButton;u==null||u.onClicked(()=>{this.updateEditor(),this.hide()});const d=o.header,h=d.pickedColorNode;h.style.width=l+Bae+"px";const f=d.originalColorNode;f.style.width=c+"px";const g=o.header.closeButton;g==null||g.onClicked(()=>{this.hide()}),t&&(u&&(u.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};yO.ID="editor.contrib.standaloneColorPickerWidget";yO=uU=qCe([$d(3,Ot),$d(4,tr),$d(5,ci),$d(6,_t),$d(7,Di)],yO);class Yit{constructor(e,t){this.value=e,this.foundInEditor=t}}class Zit extends Sh{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{...$n("showOrFocusStandaloneColorPicker","Show or Focus Standalone Color Picker"),mnemonicTitle:w({key:"mishowOrFocusStandaloneColorPicker",comment:["&& denotes a mnemonic"]},"&&Show or Focus Standalone Color Picker")},precondition:void 0,menu:[{id:$.CommandPalette}]})}runEditorCommand(e,t){var n;(n=u_.get(t))===null||n===void 0||n.showOrFocus()}}class Qit extends gt{constructor(){super({id:"editor.action.hideColorPicker",label:w({key:"hideColorPicker",comment:["Action that hides the color picker"]},"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:j.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var n;(n=u_.get(t))===null||n===void 0||n.hide()}}class Jit extends gt{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:w({key:"insertColorWithStandaloneColorPicker",comment:["Action that inserts color with standalone color picker"]},"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:j.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var n;(n=u_.get(t))===null||n===void 0||n.insertColor()}}Be(Qit);Be(Jit);Ei(Zit);class nv{constructor(e,t,n){this.languageConfigurationService=n,this._selection=e,this._insertSpace=t,this._usedEndToken=null}static _haystackHasNeedleAtOffset(e,t,n){if(n<0)return!1;const r=t.length,o=e.length;if(n+r>o)return!1;for(let s=0;s=65&&a<=90&&a+32===l)&&!(l>=65&&l<=90&&l+32===a))return!1}return!0}_createOperationsForBlockComment(e,t,n,r,o,s){const a=e.startLineNumber,l=e.startColumn,c=e.endLineNumber,u=e.endColumn,d=o.getLineContent(a),h=o.getLineContent(c);let f=d.lastIndexOf(t,l-1+t.length),g=h.indexOf(n,u-1-n.length);if(f!==-1&&g!==-1)if(a===c)d.substring(f+t.length,g).indexOf(n)>=0&&(f=-1,g=-1);else{const v=d.substring(f+t.length),m=h.substring(0,g);(v.indexOf(n)>=0||m.indexOf(n)>=0)&&(f=-1,g=-1)}let p;f!==-1&&g!==-1?(r&&f+t.length0&&h.charCodeAt(g-1)===32&&(n=" "+n,g-=1),p=nv._createRemoveBlockCommentOperations(new B(a,f+t.length+1,c,g+1),t,n)):(p=nv._createAddBlockCommentOperations(e,t,n,this._insertSpace),this._usedEndToken=p.length===1?n:null);for(const v of p)s.addTrackedEditOperation(v.range,v.text)}static _createRemoveBlockCommentOperations(e,t,n){const r=[];return B.isEmpty(e)?r.push(Xi.delete(new B(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+n.length))):(r.push(Xi.delete(new B(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),r.push(Xi.delete(new B(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+n.length)))),r}static _createAddBlockCommentOperations(e,t,n,r){const o=[];return B.isEmpty(e)?o.push(Xi.replace(new B(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+n)):(o.push(Xi.insert(new ae(e.startLineNumber,e.startColumn),t+(r?" ":""))),o.push(Xi.insert(new ae(e.endLineNumber,e.endColumn),(r?" ":"")+n))),o}getEditOperations(e,t){const n=this._selection.startLineNumber,r=this._selection.startColumn;e.tokenization.tokenizeIfCheap(n);const o=e.getLanguageIdAtPosition(n,r),s=this.languageConfigurationService.getLanguageConfiguration(o).comments;!s||!s.blockCommentStartToken||!s.blockCommentEndToken||this._createOperationsForBlockComment(this._selection,s.blockCommentStartToken,s.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const n=t.getInverseEditOperations();if(n.length===2){const r=n[0],o=n[1];return new yt(r.range.endLineNumber,r.range.endColumn,o.range.startLineNumber,o.range.startColumn)}else{const r=n[0].range,o=this._usedEndToken?-this._usedEndToken.length-1:0;return new yt(r.endLineNumber,r.endColumn+o,r.endLineNumber,r.endColumn+o)}}}class Tg{constructor(e,t,n,r,o,s,a){this.languageConfigurationService=e,this._selection=t,this._tabSize=n,this._type=r,this._insertSpace=o,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=s,this._ignoreFirstLine=a||!1}static _gatherPreflightCommentStrings(e,t,n,r){e.tokenization.tokenizeIfCheap(t);const o=e.getLanguageIdAtPosition(t,1),s=r.getLanguageConfiguration(o).comments,a=s?s.lineCommentToken:null;if(!a)return null;const l=[];for(let c=0,u=n-t+1;co?t[l].commentStrOffset=s-1:t[l].commentStrOffset=s}}}class KY extends gt{constructor(e,t){super(t),this._type=e}run(e,t){const n=e.get(Di);if(!t.hasModel())return;const r=t.getModel(),o=[],s=r.getOptions(),a=t.getOption(23),l=t.getSelections().map((u,d)=>({selection:u,index:d,ignoreFirstLine:!1}));l.sort((u,d)=>B.compareRangesUsingStarts(u.selection,d.selection));let c=l[0];for(let u=1;u=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},o0=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},dU;let nS=dU=class{static get(e){return e.getContribution(dU.ID)}constructor(e,t,n,r,o,s,a,l){this._contextMenuService=t,this._contextViewService=n,this._contextKeyService=r,this._keybindingService=o,this._menuService=s,this._configurationService=a,this._workspaceContextService=l,this._toDispose=new Te,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu(c=>this._onContextMenu(c))),this._toDispose.add(this._editor.onMouseWheel(c=>{if(this._contextMenuIsBeingShownCount>0){const u=this._contextViewService.getContextViewElement(),d=c.srcElement;d.shadowRoot&&Tb(u)===d.shadowRoot||this._contextViewService.hideContextView()}})),this._toDispose.add(this._editor.onKeyDown(c=>{this._editor.getOption(24)&&c.keyCode===58&&(c.preventDefault(),c.stopPropagation(),this.showContextMenu())}))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24)){this._editor.focus(),e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position);return}if(e.target.type===12||e.target.type===6&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),e.target.type===11)return this._showScrollbarContextMenu(e.event);if(e.target.type!==6&&e.target.type!==7&&e.target.type!==1)return;if(this._editor.focus(),e.target.position){let n=!1;for(const r of this._editor.getSelections())if(r.containsPosition(e.target.position)){n=!0;break}n||this._editor.setPosition(e.target.position)}let t=null;e.target.type!==1&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24)||!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?$.SimpleEditorContext:$.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const n=[],r=this._menuService.createMenu(t,this._contextKeyService),o=r.getActions({arg:e.uri});r.dispose();for(const s of o){const[,a]=s;let l=0;for(const c of a)if(c instanceof TD){const u=this._getMenuActions(e,c.item.submenu);u.length>0&&(n.push(new Lw(c.id,c.label,u)),l++)}else n.push(c),l++;l&&n.push(new lo)}return n.length&&n.pop(),n}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const n=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let r=t;if(!r){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const s=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),a=Br(this._editor.getDomNode()),l=a.left+s.left,c=a.top+s.top+s.height;r={x:l,y:c}}const o=this._editor.getOption(127)&&!ch;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:o?this._editor.getDomNode():void 0,getAnchor:()=>r,getActions:()=>e,getActionViewItem:s=>{const a=this._keybindingFor(s);if(a)return new jw(s,s,{label:!0,keybinding:a.getLabel(),isMenu:!0});const l=s;return typeof l.getActionViewItem=="function"?l.getActionViewItem():new jw(s,s,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:s=>this._keybindingFor(s),onHide:s=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:n})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel()||RGe(this._workspaceContextService.getWorkspace()))return;const t=this._editor.getOption(73);let n=0;const r=c=>({id:`menu-action-${++n}`,label:c.label,tooltip:"",class:void 0,enabled:typeof c.enabled>"u"?!0:c.enabled,checked:c.checked,run:c.run}),o=(c,u)=>new Lw(`menu-action-${++n}`,c,u,void 0),s=(c,u,d,h,f)=>{if(!u)return r({label:c,enabled:u,run:()=>{}});const g=v=>()=>{this._configurationService.updateValue(d,v)},p=[];for(const v of f)p.push(r({label:v.label,checked:h===v.value,run:g(v.value)}));return o(c,p)},a=[];a.push(r({label:w("context.minimap.minimap","Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),a.push(new lo),a.push(r({label:w("context.minimap.renderCharacters","Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),a.push(s(w("context.minimap.size","Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:w("context.minimap.size.proportional","Proportional"),value:"proportional"},{label:w("context.minimap.size.fill","Fill"),value:"fill"},{label:w("context.minimap.size.fit","Fit"),value:"fit"}])),a.push(s(w("context.minimap.slider","Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:w("context.minimap.slider.mouseover","Mouse Over"),value:"mouseover"},{label:w("context.minimap.slider.always","Always"),value:"always"}]));const l=this._editor.getOption(127)&&!ch;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:l?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>a,onHide:c=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};nS.ID="editor.contrib.contextmenu";nS=dU=rrt([o0(1,Ol),o0(2,ng),o0(3,Vt),o0(4,ci),o0(5,hu),o0(6,gn),o0(7,Pb)],nS);class ort extends gt{constructor(){super({id:"editor.action.showContextMenu",label:w("action.showContextMenu.label","Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:1092,weight:100}})}run(e,t){var n;(n=nS.get(t))===null||n===void 0||n.showContextMenu()}}jn(nS.ID,nS,2);Be(ort);class M9{constructor(e){this.selections=e}equals(e){const t=this.selections.length,n=e.selections.length;if(t!==n)return!1;for(let r=0;r{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeModelContent(t=>{this._undoStack=[],this._redoStack=[]})),this._register(e.onDidChangeCursorSelection(t=>{if(this._isCursorUndoRedo||!t.oldSelections||t.oldModelVersionId!==t.modelVersionId)return;const n=new M9(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(n)||(this._undoStack.push(new A9(n,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())}))}cursorUndo(){!this._editor.hasModel()||this._undoStack.length===0||(this._redoStack.push(new A9(new M9(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){!this._editor.hasModel()||this._redoStack.length===0||(this._undoStack.push(new A9(new M9(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._redoStack.pop()))}_applyState(e){this._isCursorUndoRedo=!0,this._editor.setSelections(e.cursorState.selections),this._editor.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),this._isCursorUndoRedo=!1}}Gb.ID="editor.contrib.cursorUndoRedoController";class srt extends gt{constructor(){super({id:"cursorUndo",label:w("cursor.undo","Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:j.textInputFocus,primary:2099,weight:100}})}run(e,t,n){var r;(r=Gb.get(t))===null||r===void 0||r.cursorUndo()}}class art extends gt{constructor(){super({id:"cursorRedo",label:w("cursor.redo","Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,n){var r;(r=Gb.get(t))===null||r===void 0||r.cursorRedo()}}jn(Gb.ID,Gb,0);Be(srt);Be(art);class lrt{constructor(e,t,n){this.selection=e,this.targetPosition=t,this.copy=n,this.targetSelection=null}getEditOperations(e,t){const n=e.getValueInRange(this.selection);if(this.copy||t.addEditOperation(this.selection,null),t.addEditOperation(new B(this.targetPosition.lineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.targetPosition.column),n),this.selection.containsPosition(this.targetPosition)&&!(this.copy&&(this.selection.getEndPosition().equals(this.targetPosition)||this.selection.getStartPosition().equals(this.targetPosition)))){this.targetSelection=this.selection;return}if(this.copy){this.targetSelection=new yt(this.targetPosition.lineNumber,this.targetPosition.column,this.selection.endLineNumber-this.selection.startLineNumber+this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumber>this.selection.endLineNumber){this.targetSelection=new yt(this.targetPosition.lineNumber-this.selection.endLineNumber+this.selection.startLineNumber,this.targetPosition.column,this.targetPosition.lineNumber,this.selection.startLineNumber===this.selection.endLineNumber?this.targetPosition.column+this.selection.endColumn-this.selection.startColumn:this.selection.endColumn);return}if(this.targetPosition.lineNumberthis._onEditorMouseDown(t))),this._register(this._editor.onMouseUp(t=>this._onEditorMouseUp(t))),this._register(this._editor.onMouseDrag(t=>this._onEditorMouseDrag(t))),this._register(this._editor.onMouseDrop(t=>this._onEditorMouseDrop(t))),this._register(this._editor.onMouseDropCanceled(()=>this._onEditorMouseDropCanceled())),this._register(this._editor.onKeyDown(t=>this.onEditorKeyDown(t))),this._register(this._editor.onKeyUp(t=>this.onEditorKeyUp(t))),this._register(this._editor.onDidBlurEditorWidget(()=>this.onEditorBlur())),this._register(this._editor.onDidBlurEditorText(()=>this.onEditorBlur())),this._mouseDown=!1,this._modifierPressed=!1,this._dragSelection=null}onEditorBlur(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1}onEditorKeyDown(e){!this._editor.getOption(35)||this._editor.getOption(22)||(o1(e)&&(this._modifierPressed=!0),this._mouseDown&&o1(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){!this._editor.getOption(35)||this._editor.getOption(22)||(o1(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===vp.TRIGGER_KEY_VALUE&&this._editor.updateOptions({mouseStyle:"default"}))}_onEditorMouseDown(e){this._mouseDown=!0}_onEditorMouseUp(e){this._mouseDown=!1,this._editor.updateOptions({mouseStyle:"text"})}_onEditorMouseDrag(e){const t=e.target;if(this._dragSelection===null){const r=(this._editor.getSelections()||[]).filter(o=>t.position&&o.containsPosition(t.position));if(r.length===1)this._dragSelection=r[0];else return}o1(e.event)?this._editor.updateOptions({mouseStyle:"copy"}):this._editor.updateOptions({mouseStyle:"default"}),t.position&&(this._dragSelection.containsPosition(t.position)?this._removeDecoration():this.showAt(t.position))}_onEditorMouseDropCanceled(){this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}_onEditorMouseDrop(e){if(e.target&&(this._hitContent(e.target)||this._hitMargin(e.target))&&e.target.position){const t=new ae(e.target.position.lineNumber,e.target.position.column);if(this._dragSelection===null){let n=null;if(e.event.shiftKey){const r=this._editor.getSelection();if(r){const{selectionStartLineNumber:o,selectionStartColumn:s}=r;n=[new yt(o,s,t.lineNumber,t.column)]}}else n=(this._editor.getSelections()||[]).map(r=>r.containsPosition(t)?new yt(t.lineNumber,t.column,t.lineNumber,t.column):r);this._editor.setSelections(n||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(o1(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(vp.ID,new lrt(this._dragSelection,t,o1(e.event)||this._modifierPressed)),this._editor.pushUndoStop())}this._editor.updateOptions({mouseStyle:"text"}),this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1}showAt(e){this._dndDecorationIds.set([{range:new B(e.lineNumber,e.column,e.lineNumber,e.column),options:vp._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return e.type===6||e.type===7}_hitMargin(e){return e.type===2||e.type===3||e.type===4}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}vp.ID="editor.contrib.dragAndDrop";vp.TRIGGER_KEY_VALUE=Ln?6:5;vp._DECORATION_OPTIONS=sn.register({description:"dnd-target",className:"dnd-target"});jn(vp.ID,vp,2);var GY=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},AI=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}};const H3=w("builtIn","Built-in");class qY{async provideDocumentPasteEdits(e,t,n,r,o){const s=await this.getEdit(n,o);return s?{insertText:s.insertText,label:s.label,detail:s.detail,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}:void 0}async provideDocumentOnDropEdits(e,t,n,r){const o=await this.getEdit(n,r);return o?{insertText:o.insertText,label:o.label,handledMimeType:o.handledMimeType,yieldTo:o.yieldTo}:void 0}}class XCe extends qY{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[Cr.text],this.pasteMimeTypes=[Cr.text]}async getEdit(e,t){const n=e.get(Cr.text);if(!n||e.has(Cr.uriList))return;const r=await n.asString();return{handledMimeType:Cr.text,label:w("text.label","Insert Plain Text"),detail:H3,insertText:r}}}class YCe extends qY{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[Cr.uriList],this.pasteMimeTypes=[Cr.uriList]}async getEdit(e,t){const n=await ZCe(e);if(!n.length||t.isCancellationRequested)return;let r=0;const o=n.map(({uri:a,originalText:l})=>a.scheme===an.file?a.fsPath:(r++,l)).join(" ");let s;return r>0?s=n.length>1?w("defaultDropProvider.uriList.uris","Insert Uris"):w("defaultDropProvider.uriList.uri","Insert Uri"):s=n.length>1?w("defaultDropProvider.uriList.paths","Insert Paths"):w("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:Cr.uriList,insertText:o,label:s,detail:H3}}}let wO=class extends qY{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[Cr.uriList],this.pasteMimeTypes=[Cr.uriList]}async getEdit(e,t){const n=await ZCe(e);if(!n.length||t.isCancellationRequested)return;const r=lh(n.map(({uri:o})=>{const s=this._workspaceContextService.getWorkspaceFolder(o);return s?Sze(s.uri,o):void 0}));if(r.length)return{handledMimeType:Cr.uriList,insertText:r.join(" "),label:n.length>1?w("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):w("defaultDropProvider.uriList.relativePath","Insert Relative Path"),detail:H3}}};wO=GY([AI(0,Pb)],wO);class crt{constructor(){this.id="html",this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Cr.text}]}async provideDocumentPasteEdits(e,t,n,r,o){if(r.trigger!=="explicit"&&r.only!==this.id)return;const s=n.get("text/html"),a=await(s==null?void 0:s.asString());if(!(!a||o.isCancellationRequested))return{insertText:a,yieldTo:this._yieldTo,label:w("pasteHtmlLabel","Insert HTML"),detail:H3}}}async function ZCe(i){const e=i.get(Cr.uriList);if(!e)return[];const t=await e.asString(),n=[];for(const r of N3.parse(t))try{n.push({uri:At.parse(r),originalText:r})}catch{}return n}let hU=class extends fe{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new XCe)),this._register(e.documentOnDropEditProvider.register("*",new YCe)),this._register(e.documentOnDropEditProvider.register("*",new wO(t)))}};hU=GY([AI(0,_t),AI(1,Pb)],hU);let fU=class extends fe{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new XCe)),this._register(e.documentPasteEditProvider.register("*",new YCe)),this._register(e.documentPasteEditProvider.register("*",new wO(t))),this._register(e.documentPasteEditProvider.register("*",new crt))}};fU=GY([AI(0,_t),AI(1,Pb)],fU);jn(Rp.ID,Rp,0);nT(fU);et(new class extends Vo{constructor(){super({id:Ybe,precondition:Zbe,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;return(n=Rp.get(e))===null||n===void 0?void 0:n.changePasteType()}});Be(class extends gt{constructor(){super({id:"editor.action.pasteAs",label:w("pasteAs","Paste As..."),alias:"Paste As...",precondition:j.writable,metadata:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:w("pasteAs.id","The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(i,e,t){var n;const r=typeof(t==null?void 0:t.id)=="string"?t.id:void 0;return(n=Rp.get(e))===null||n===void 0?void 0:n.pasteAs(r)}});Be(class extends gt{constructor(){super({id:"editor.action.pasteAsText",label:w("pasteAsText","Paste as Text"),alias:"Paste as Text",precondition:j.writable})}run(i,e,t){var n;return(n=Rp.get(e))===null||n===void 0?void 0:n.pasteAs("text")}});class urt{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}}class Wae{constructor(e){this.identifier=e}}const QCe=yn("treeViewsDndService");In(QCe,urt,1);var drt=globalThis&&globalThis.__decorate||function(i,e,t,n){var r=arguments.length,o=r<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(i,e,t,n);else for(var a=i.length-1;a>=0;a--)(s=i[a])&&(o=(r<3?s(o):r>3?s(e,t,o):s(e,t))||o);return r>3&&o&&Object.defineProperty(e,t,o),o},t2=globalThis&&globalThis.__param||function(i,e){return function(t,n){e(t,n,i)}},gU;const JCe="editor.experimental.dropIntoEditor.defaultProvider",e1e="editor.changeDropType",t1e=new st("dropWidgetVisible",!1,w("dropWidgetVisible","Whether the drop widget is showing"));let iS=gU=class extends fe{static get(e){return e.getContribution(gU.ID)}constructor(e,t,n,r,o){super(),this._configService=n,this._languageFeaturesService=r,this._treeViewsDragAndDropService=o,this.treeItemsTransfer=DI.getInstance(),this._dropProgressManager=this._register(t.createInstance(uO,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(hO,"dropIntoEditor",e,t1e,{id:e1e,label:w("postDropWidgetTitle","Show drop options...")})),this._register(e.onDropIntoEditor(s=>this.onDropIntoEditor(e,s.position,s.event)))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}async onDropIntoEditor(e,t,n){var r;if(!n.dataTransfer||!e.hasModel())return;(r=this._currentOperation)===null||r===void 0||r.cancel(),e.focus(),e.setPosition(t);const o=Io(async s=>{const a=new n_(e,1,void 0,s);try{const l=await this.extractDataTransferData(n);if(l.size===0||a.token.isCancellationRequested)return;const c=e.getModel();if(!c)return;const u=this._languageFeaturesService.documentOnDropEditProvider.ordered(c).filter(h=>h.dropMimeTypes?h.dropMimeTypes.some(f=>l.matches(f)):!0),d=await this.getDropEdits(u,c,t,l,a);if(a.token.isCancellationRequested)return;if(d.length){const h=this.getInitialActiveEditIndex(c,d),f=e.getOption(36).showDropSelector==="afterDrop";await this._postDropWidgetManager.applyEditAndShowIfNeeded([B.fromPositions(t)],{activeEditIndex:h,allEdits:d},f,s)}}finally{a.dispose(),this._currentOperation===o&&(this._currentOperation=void 0)}});this._dropProgressManager.showWhile(t,w("dropIntoEditorProgress","Running drop handlers. Click to cancel"),o),this._currentOperation=o}async getDropEdits(e,t,n,r,o){const s=await Rk(Promise.all(e.map(async l=>{try{const c=await l.provideDocumentOnDropEdits(t,n,r,o.token);if(c)return{...c,providerId:l.id}}catch(c){console.error(c)}})),o.token),a=lh(s??[]);return qbe(a)}getInitialActiveEditIndex(e,t){const n=this._configService.getValue(JCe,{resource:e.uri});for(const[r,o]of Object.entries(n)){const s=t.findIndex(a=>o===a.providerId&&a.handledMimeType&&Vbe(r,[a.handledMimeType]));if(s>=0)return s}return 0}async extractDataTransferData(e){if(!e.dataTransfer)return new Hbe;const t=jbe(e.dataTransfer);if(this.treeItemsTransfer.hasData(Wae.prototype)){const n=this.treeItemsTransfer.getData(Wae.prototype);if(Array.isArray(n))for(const r of n){const o=await this._treeViewsDragAndDropService.removeDragOperationTransfer(r.identifier);if(o)for(const[s,a]of o)t.replace(s,a)}}return t}};iS.ID="editor.contrib.dropIntoEditorController";iS=gU=drt([t2(1,Ot),t2(2,gn),t2(3,_t),t2(4,QCe)],iS);jn(iS.ID,iS,2);et(new class extends Vo{constructor(){super({id:e1e,precondition:t1e,kbOpts:{weight:100,primary:2137}})}runEditorCommand(i,e,t){var n;(n=iS.get(e))===null||n===void 0||n.changeDropType()}});nT(hU);ar.as(xh.Configuration).registerConfiguration({...Z4,properties:{[JCe]:{type:"object",scope:5,description:w("defaultProviderDescription","Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}});class Us{constructor(e){this._editor=e,this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null,this._startPosition=this._editor.getPosition()}dispose(){this._editor.removeDecorations(this._allDecorations()),this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}reset(){this._decorations=[],this._overviewRulerApproximateDecorations=[],this._findScopeDecorationIds=[],this._rangeHighlightDecorationId=null,this._highlightedDecorationId=null}getCount(){return this._decorations.length}getFindScope(){return this._findScopeDecorationIds[0]?this._editor.getModel().getDecorationRange(this._findScopeDecorationIds[0]):null}getFindScopes(){if(this._findScopeDecorationIds.length){const e=this._findScopeDecorationIds.map(t=>this._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(r.changeDecorationOptions(this._highlightedDecorationId,Us._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,r.changeDecorationOptions(this._highlightedDecorationId,Us._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(r.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const s=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(s);o=new B(o.startLineNumber,o.startColumn,s,a)}this._rangeHighlightDecorationId=r.addDecoration(o,Us._RANGE_HIGHLIGHT_DECORATION)}}),n}set(e,t){this._editor.changeDecorations(n=>{let r=Us._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){r=Us._FIND_MATCH_NO_OVERVIEW_DECORATION;const a=this._editor.getModel().getLineCount(),c=this._editor.getLayoutInfo().height/a,u=Math.max(2,Math.ceil(3/c));let d=e[0].range.startLineNumber,h=e[0].range.endLineNumber;for(let f=1,g=e.length;f=p.startLineNumber?p.endLineNumber>h&&(h=p.endLineNumber):(o.push({range:new B(d,1,h,1),options:Us._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),d=p.startLineNumber,h=p.endLineNumber)}o.push({range:new B(d,1,h,1),options:Us._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const s=new Array(e.length);for(let a=0,l=e.length;an.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>n.addDecoration(a,Us._FIND_SCOPE_DECORATION)))})}matchBeforePosition(e){if(this._decorations.length===0)return null;for(let t=this._decorations.length-1;t>=0;t--){const n=this._decorations[t],r=this._editor.getModel().getDecorationRange(n);if(!(!r||r.endLineNumber>e.lineNumber)){if(r.endLineNumbere.column))return r}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,n=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const n=[];for(let s=0;sB.compareRangesUsingStarts(s.range,a.range));const r=[];let o=n[0];for(let s=1;s0?e[0].toUpperCase()+e.substr(1):i[0][0].toUpperCase()!==i[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function $ae(i,e,t){return i[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&i[0].split(t).length===e.split(t).length}function Hae(i,e,t){const n=e.split(t),r=i[0].split(t);let o="";return n.forEach((s,a)=>{o+=n1e([r[a]],s)+t}),o.slice(0,-1)}class Vae{constructor(e){this.staticValue=e,this.kind=0}}class frt{constructor(e){this.pieces=e,this.kind=1}}class rS{static fromStaticValue(e){return new rS([db.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new Vae(""):e.length===1&&e[0].staticValue!==null?this._state=new Vae(e[0].staticValue):this._state=new frt(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?n1e(e,this._state.staticValue):this._state.staticValue;let n="";for(let r=0,o=this._state.pieces.length;r0){const l=[],c=s.caseOps.length;let u=0;for(let d=0,h=a.length;d=c){l.push(a.slice(d));break}switch(s.caseOps[u]){case"U":l.push(a[d].toUpperCase());break;case"u":l.push(a[d].toUpperCase()),u++;break;case"L":l.push(a[d].toLowerCase());break;case"l":l.push(a[d].toLowerCase()),u++;break;default:l.push(a[d])}}a=l.join("")}n+=a}return n}static _substitute(e,t){if(t===null)return"";if(e===0)return t[0];let n="";for(;e>0;){if(e=r)break;const s=i.charCodeAt(n);switch(s){case 92:t.emitUnchanged(n-1),t.emitStatic("\\",n+1);break;case 110:t.emitUnchanged(n-1),t.emitStatic(` @@ -1207,6 +1207,6 @@ __p += '`),ki&&(Ct+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+Ct+`return __p -}`;var ui=Yee(function(){return ir(ee,dn+"return "+Ct).apply(t,ge)});if(ui.source=Ct,i8(ui))throw ui;return ui}function HRe(b){return ur(b).toLowerCase()}function VRe(b){return ur(b).toUpperCase()}function zRe(b,x,I){if(b=ur(b),b&&(I||x===t))return oJ(b);if(!b||!(x=Ic(x)))return b;var P=pd(b),V=pd(x),ee=sJ(P,V),ge=aJ(P,V)+1;return nm(P,ee,ge).join("")}function URe(b,x,I){if(b=ur(b),b&&(I||x===t))return b.slice(0,cJ(b)+1);if(!b||!(x=Ic(x)))return b;var P=pd(b),V=aJ(P,pd(x))+1;return nm(P,0,V).join("")}function jRe(b,x,I){if(b=ur(b),b&&(I||x===t))return b.replace(lr,"");if(!b||!(x=Ic(x)))return b;var P=pd(b),V=sJ(P,pd(x));return nm(P,V).join("")}function KRe(b,x){var I=M,P=A;if(yo(x)){var V="separator"in x?x.separator:V;I="length"in x?ai(x.length):I,P="omission"in x?Ic(x.omission):P}b=ur(b);var ee=b.length;if(RC(b)){var ge=pd(b);ee=ge.length}if(I>=ee)return b;var Ce=I-MC(P);if(Ce<1)return P;var Ie=ge?nm(ge,0,Ce).join(""):b.slice(0,Ce);if(V===t)return Ie+P;if(ge&&(Ce+=Ie.length-Ce),r8(V)){if(b.slice(Ce).search(V)){var pt,mt=Ie;for(V.global||(V=CB(V.source,ur($t.exec(V))+"g")),V.lastIndex=0;pt=V.exec(mt);)var Ct=pt.index;Ie=Ie.slice(0,Ct===t?Ce:Ct)}}else if(b.indexOf(Ic(V),Ce)!=Ce){var jt=Ie.lastIndexOf(V);jt>-1&&(Ie=Ie.slice(0,jt))}return Ie+P}function GRe(b){return b=ur(b),b&&nn.test(b)?b.replace(Bt,wDe):b}var qRe=$C(function(b,x,I){return b+(I?" ":"")+x.toUpperCase()}),a8=ZJ("toUpperCase");function Xee(b,x,I){return b=ur(b),x=I?t:x,x===t?vDe(b)?LDe(b):lDe(b):b.match(x)||[]}var Yee=fi(function(b,x){try{return Ec(b,t,x)}catch(I){return i8(I)?I:new ti(I)}}),XRe=ug(function(b,x){return yu(x,function(I){I=Fh(I),lg(b,I,t8(b[I],b))}),b});function YRe(b){var x=b==null?0:b.length,I=An();return b=x?uo(b,function(P){if(typeof P[1]!="function")throw new wu(s);return[I(P[0]),P[1]]}):[],fi(function(P){for(var V=-1;++VU)return[];var I=Y,P=Wa(b,Y);x=An(x),b-=Y;for(var V=vB(P,x);++I0||x<0)?new yi(I):(b<0?I=I.takeRight(-b):b&&(I=I.drop(b)),x!==t&&(x=ai(x),I=x<0?I.dropRight(-x):I.take(x-b)),I)},yi.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},yi.prototype.toArray=function(){return this.take(Y)},Ph(yi.prototype,function(b,x){var I=/^(?:filter|find|map|reject)|While$/.test(x),P=/^(?:head|last)$/.test(x),V=Z[P?"take"+(x=="last"?"Right":""):x],ee=P||/^find/.test(x);V&&(Z.prototype[x]=function(){var ge=this.__wrapped__,Ce=P?[1]:arguments,Ie=ge instanceof yi,pt=Ce[0],mt=Ie||ii(ge),Ct=function(vi){var ki=V.apply(Z,Yp([vi],Ce));return P&&jt?ki[0]:ki};mt&&I&&typeof pt=="function"&&pt.length!=1&&(Ie=mt=!1);var jt=this.__chain__,dn=!!this.__actions__.length,On=ee&&!jt,ui=Ie&&!dn;if(!ee&&mt){ge=ui?ge:new yi(this);var Fn=b.apply(ge,Ce);return Fn.__actions__.push({func:yN,args:[Ct],thisArg:t}),new Su(Fn,jt)}return On&&ui?b.apply(this,Ce):(Fn=this.thru(Ct),On?P?Fn.value()[0]:Fn.value():Fn)})}),yu(["pop","push","shift","sort","splice","unshift"],function(b){var x=GT[b],I=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",P=/^(?:pop|shift)$/.test(b);Z.prototype[b]=function(){var V=arguments;if(P&&!this.__chain__){var ee=this.value();return x.apply(ii(ee)?ee:[],V)}return this[I](function(ge){return x.apply(ii(ge)?ge:[],V)})}}),Ph(yi.prototype,function(b,x){var I=Z[x];if(I){var P=I.name+"";mr.call(FC,P)||(FC[P]=[]),FC[P].push({name:x,func:I})}}),FC[gN(t,m).name]=[{name:"wrapper",func:t}],yi.prototype.clone=GDe,yi.prototype.reverse=qDe,yi.prototype.value=XDe,Z.prototype.at=xTe,Z.prototype.chain=LTe,Z.prototype.commit=ETe,Z.prototype.next=DTe,Z.prototype.plant=kTe,Z.prototype.reverse=TTe,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=NTe,Z.prototype.first=Z.prototype.head,ox&&(Z.prototype[ox]=ITe),Z},AC=EDe();H_?((H_.exports=AC)._=AC,cB._=AC):na._=AC}).call(bx)})(Ekt,sa);var Gi=(i=>(i[i.INITIAL=0]="INITIAL",i[i.BUSY=1]="BUSY",i[i.WAIT_INPUT=2]="WAIT_INPUT",i[i.FREE=3]="FREE",i[i.STATIC_CHECK_FAILED=4]="STATIC_CHECK_FAILED",i[i.RUNTIME_ERROR=5]="RUNTIME_ERROR",i[i.MAX_STEP_REACHED=6]="MAX_STEP_REACHED",i[i.EXITED_NORMALLY=7]="EXITED_NORMALLY",i[i.EXITED_ABNORMALLY=8]="EXITED_ABNORMALLY",i[i.CLOSED=9]="CLOSED",i))(Gi||{});const Dkt={instructions:[],text:[],memory:new Uint8Array},Ude={total:0,stack:0,globalVariable:0},jde={mainFunctionAddressBefore:-1,globalVariableTable:{},variableTableStack:[],assignCallLValueStack:[]},Kde={stepCount:0,timeElapsed:0,state:0,callStack:[],staticErrors:[],runtimeErrors:[]};var Ql=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.ERROR=1]="ERROR",i[i.WARNING=2]="WARNING",i[i.INPUT=3]="INPUT",i[i.OUTPUT=4]="OUTPUT",i[i.PROMPT=5]="PROMPT",i[i.ARROW=6]="ARROW",i))(Ql||{});const zd={maxExecutionStepCount:{min:0,max:999999999},memorySize:{min:1*_b,max:32*yp},stackSize:{min:512,max:32*yp-512}},Gde={maxExecutionStepCount:5e6,memorySize:2*yp,stackSize:1*yp};class PEe{constructor(){Ss(this,"initialRegisters",{eax:0,ebx:0,ecx:0,edx:0,ebp:0,esp:Gde.memorySize,eip:0});Ss(this,"decoder",new Lkt);Ss(this,"memory",sa.cloneDeep(Dkt));Ss(this,"registers",sa.cloneDeep(this.initialRegisters));Ss(this,"tables",sa.cloneDeep(jde));Ss(this,"executionStatus",sa.cloneDeep(Kde));Ss(this,"peakMemoryUsage",sa.cloneDeep(Ude));Ss(this,"options",sa.cloneDeep(Gde));Ss(this,"executionStartTime",new Date);Ss(this,"writeBuffer",[]);Ss(this,"readConsole",()=>Promise.resolve(""));Ss(this,"entryFunctionName","main")}setReadConsoleFn(e){this.readConsole=e}getSingleVariableValues(e){const t=[];for(let n=e.address;n=this.memory.text.length?-1:this.memory.text[this.registers.eip].lineNumber}get instructions(){return this.memory.instructions}get globalVariableDetails(){return this.getSingleTableVariableDetails(this.tables.globalVariableTable)}get localVariableDetailsStack(){const e=[];for(let t=0;t(n=Math.max(n,r.min),n=Math.min(n,r.max),n);e.maxExecutionStepCount!==void 0&&(e.maxExecutionStepCount=t(e.maxExecutionStepCount,zd.maxExecutionStepCount),this.options.maxExecutionStepCount=e.maxExecutionStepCount),e.memorySize!==void 0&&(e.memorySize=t(e.memorySize,zd.memorySize),e.memorySize=t(e.memorySize,{min:this.options.stackSize,max:zd.memorySize.max}),this.options.memorySize=e.memorySize,this.initialRegisters.esp=Zl(e.memorySize),this.registers.esp=Zl(e.memorySize),this.updatePeakMemoryUsage()),e.stackSize!==void 0&&(e.stackSize=t(e.stackSize,zd.stackSize),e.stackSize=t(e.stackSize,{min:zd.stackSize.min,max:this.options.memorySize}),this.options.stackSize=e.stackSize)}reset(){this.memory.text=[],this.memory.memory=new Uint8Array,this.registers=sa.cloneDeep(this.initialRegisters),this.tables=sa.cloneDeep(jde),this.executionStatus=sa.cloneDeep(Kde),this.peakMemoryUsage=sa.cloneDeep(Ude),this.writeBuffer=[]}close(){this.executionStatus.state=9}loadNewInstructions(e){this.reset(),this.memory.instructions=e}loadAndDecodeNewInstructions(e){this.loadNewInstructions(e),this.decodeInstructions(!0)}decodeInstructions(e){const t=new Map,n=new Map;for(let r=0;rn;case C0.GE:return t>=n}}async execute(e){do{if((this.executionStatus.state===7||this.executionStatus.state===8||this.executionStatus.state===0)&&(this.reset(),this.prepareExcution()),this.executionStatus.state!==3)return;if(this.executionStatus.state=1,this.options.maxExecutionStepCount>0&&this.executionStatus.stepCount>=this.options.maxExecutionStepCount){this.executionStatus.state=6,this.writeBuffer.push([{key:"MAX_STEP_REACHED",values:{maxExecutionStepCount:this.options.maxExecutionStepCount},type:1}]);return}if(this.registers.eip>=this.memory.text.length||this.registers.eip<0){this.executionStatus.state=5,this.writeBuffer.push([{key:"RUNTIME_ERROR_PREFIX_NO_LN",type:1},{key:"INSTRUCTION_READ_OUT_OF_BOUND",values:{address:this.registers.eip},type:1}]);return}this.executionStatus.stepCount++;const t=this.memory.text[this.registers.eip];switch(t.type){case Mo.ARG:{const n=this.getSingularValue(t.value.value);if(n===null||!this.pushl(n))return;this.registers.ecx=Oc(this.registers.ecx,4);break}case Mo.ASSIGN:{const n=this.getRValue(t.value.rValue);if(n===null)return;const r=this.getLValueAddress(t.value.lValue);if(r===null||!this.storeMemory32(n,r))return;break}case Mo.ASSIGN_CALL:case Mo.CALL:{const n=t.type===Mo.CALL?t.value.id:t.value.functionId;if(this.registers.ebx=this.registers.esp,!this.pushl(this.registers.ecx)||(this.registers.ecx=0,!this.pushl(this.registers.eip))||!this.pushl(this.registers.ebp))return;this.registers.ebp=this.registers.esp,t.type===Mo.ASSIGN_CALL?this.tables.assignCallLValueStack.push(t.value.lValue):this.tables.assignCallLValueStack.push(null),this.tables.variableTableStack.push({}),this.executionStatus.callStack.push(n),this.registers.eip=t.value.functionAddressBefore;break}case Mo.DEC:{if(this.createStackVariable(t.value.id,t.value.size)===null)return;break}case Mo.GOTO:{this.registers.eip=t.value.gotoAddressBefore;break}case Mo.IF:{const n=this.getCondValue(t.value.condition);if(n===null)return;n&&(this.registers.eip=t.value.gotoAddressBefore);break}case Mo.PARAM:{const n=t.value.id;if(n in this.tables.variableTableStack[this.tables.variableTableStack.length-1]){this.writeRuntimeError({key:"DUPLICATE_PARAM_ID",values:{id:n,lastLineNumber:this.tables.variableTableStack[this.tables.variableTableStack.length-1][n].lineNumber}});return}if(this.loadMemory32(this.registers.ebx)===null)return;this.tables.variableTableStack[this.tables.variableTableStack.length-1][n]={address:this.registers.ebx,size:4,lineNumber:t.lineNumber},this.registers.ebx=Oc(this.registers.ebx,4);break}case Mo.RETURN:{const n=this.getSingularValue(t.value.value);if(n===null)return;this.registers.eax=n,this.registers.esp=this.registers.ebp,this.updatePeakMemoryUsage();const r=this.popl();if(r===null)return;this.registers.ebp=r;const o=this.popl();if(o===null)return;this.registers.eip=o;const s=this.popl();if(s===null)return;if(this.registers.esp=Oc(this.registers.esp,s),this.updatePeakMemoryUsage(),this.registers.ecx=0,this.tables.variableTableStack.length===0){this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"});return}if(this.executionStatus.callStack.pop(),this.tables.variableTableStack.pop(),this.registers.eip===this.memory.text.length){this.finalizeExcution();return}const a=this.tables.assignCallLValueStack.pop();if(a!==null){const l=this.getLValueAddress(a);if(l===null||!this.storeMemory32(this.registers.eax,l))return}break}case Mo.READ:{const n=t.value,r=this.getLValueAddress(n.lValue);if(r===null)return;const o=n.lValue.type===YL.ID?n.lValue.id:"*"+n.lValue.id;this.executionStatus.state=2;const s=await this.readConsole([{key:"READ_PROMPT",values:{name:o}}]);if(this.state!==2)return;this.executionStatus.state=1;const a=parseInt(s);if(isNaN(a)){this.writeRuntimeError({key:"INPUT_INT_ILLEGAL"});return}if(!Number.isSafeInteger(a)){this.writeRuntimeError({key:"INPUT_INT_ABS_TOO_LARGE"});return}if(!this.storeMemory32(Zl(a),r))return;break}case Mo.WRITE:{const n=this.getSingularValue(t.value.value);if(n===null)return;this.writeBuffer.push([{key:"WRITE_OUTPUT",values:{value:n},type:4}]);break}}for(this.registers.eip=Oc(this.registers.eip,1);this.registers.eip=0&&this.memory.text[this.registers.eip].type===Mo.GLOBAL_DEC;)this.registers.eip=Oc(this.registers.eip,1);this.executionStatus.state=3}while(e)}async executeSingleStep(){await this.execute(!1)}async executeContinuously(){await this.execute(!0)}}function Ikt(i,e=18){let t=0,n=0;for(let r=0;re){t=r;break}return n<=e?i:i.substring(0,t)+"..."}function kkt(i){for(let e=1;;e++){const t=`Untitled-${e}`;if(i.every(n=>n!==t))return t}}function OEe(i){return i.split(/\r\n|[\r\n]/)}function Tkt(i){return i.trim().split(/\s/).filter(e=>e.length>0)}function Nkt(i){return i<_b?{size:i,unit:"B"}:i",READ_INPUT:"{value}",PROGRAM_EXITED:"程序执行结束,返回值为{returnValue}。",EXECUTION_STEP_COUNT_TIME:"总执行步数:{stepCount, number};总执行耗时:{time, number}ms"},Pkt={APP_TITLE:"IR Virtual Machine",ADD:"New",IMPORT:"Import",DEMOS:"Demos",DEMO_SOURCES:"Sources",SAVE:"Save",THEME:"Theme",ABOUT:"About",CLOSE:"Close",CONFIRM_UNSAVED_CLOSE:"Save changes to {name} before close?",SAVE_CLOSE:"Save&Close",UNSAVE_CLOSE:"Close",OK:"OK",CANCEL:"Cancel",EMPTY_PLACEHOLDER_DESC:"An IR virtual machine for HIT/NJU Compilation Principle labs",EMPTY_PLACEHOLDER_HINT_TITLE:"You may:",EMPTY_PLACEHOLDER_HINT_1:"Add or import .ir files in left sidebar",EMPTY_PLACEHOLDER_HINT_2:"Drag one or more .ir files inside",EMPTY_PLACEHOLDER_HINT_3:"Try out Demos in left sidebar",FETCH_FAILED:"fetch() for {url} failed",NOT_AN_IR_FILE:"{fileName} is not an ir file",IR_IMPORT_FAILED:"Failed to import {fileName}",RUN:"Run",RUN_STEP:"Step",RESET:"Reset",CLEAR_CONSOLE:"Clear",STEP_COUNT:"Step Count: ",STEP_COUNT_NUMBER:"{stepCount, number}",STATE:"VM State: ",STATE_INITIAL:"Initial",STATE_BUSY:"Busy",STATE_WAIT_INPUT:"Awaiting Input",STATE_FREE:"Free",STATE_STATIC_CHECK_FAILED:"IR Static Check Error",STATE_RUNTIME_ERROR:"Runtime Error",STATE_MAX_STEP_REACHED:"Max Step Count Reached",STATE_EXITED_NORMALLY:"Exited Normally (Return value 0)",STATE_EXITED_ABNORMALLY:"Exited Abnormally (Return value not 0)",MAX_EXECUTION_STEP_COUNT:"Max Steps",SET_0_MEANS_NO_STEP_LIMIT:"No step limit if set to 0",MEMORY_SIZE:"Memory Size/B",STACK_SIZE:"Stack Size/B",TOTAL_MEMORY_USAGE:"Total Memory Usage: ",STACK_MEMORY_USAGE:"Stack Memory Usage: ",GLOBAL_VARIABLE_MEMORY_USAGE:"GlobalVar Memory Usage: ",PEAK_MEMORY_USAGE:"Peak Usage: ",PERCENTAGE_USAGE:"{percentage, number, ::.0}%",BYTE_USAGE:"{used}B/{total}B",ARBITRARY_UNIT_MEMORY_USAGE:"{used, number, ::.0}{unit}/{total, number, ::.0}{unit}",BYTE_SIZE:"{size}B",ARBITRARY_UNIT_SIZE:"{size, number, ::.0}{unit}",GLOBAL_VARIABLE_TABLE:"Global Variable Table",LOCAL_VARIABLE_TABLE:"Local Variable Table",VARIABLE_ID:"ID",ADDRESS:"Address",SIZE:"Size",VALUES:"Value",EMPTY_VATIABLE_TABLE:"(Empty)",CALL_STACK_DEPTH:"Call stack depth {depth}",STATIC_ERROR_PREFIX:"Static Check Error (Line {lineNumber}): ",STATIC_ERROR_PREFIX_NO_LINE_NUMBER:"Static Check Error: ",DECODE_ERROR_PREFIX:"IR Decoding Error (Line {lineNumber}): ",UNRECOGNIZED_INSTRUCTION:"Unrecognized IR instruction",ILLEGAL_INSTRUCTION_FORMAT:"Illegal IR format",FUNCTION_ILLEGAL_ID:"FUNCTION id illegal",ASSIGN_ILLEGAL_LEFT:"Illegal left hand side of assignment",ASSIGN_ILLEGAL_RIGHT:"Illegal right hand side of assignment",ASSIGN_RIGHT_IMM_TOO_LARGE:"Right hand side immediate number of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERATOR:"Illegal math operator on RHS of assignment",ASSIGN_ILLEGAL_RIGHT_OPERAND1:"Illegal first Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE:"First immediate number operand on RHS of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERAND2:"Illegal second Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE:"Second immediate number operand on RHS of assignment too large",DEC_ILLEGAL_ID:"DEC's id illegal",DEC_ILLEGAL_SIZE_FORMAT:"DEC's size format illegal",DEC_SIZE_TOO_LARGE:"DEC's size too large",DEC_SIZE_NOT_4_MULTIPLE:"DEC's size not a multiple of 4",GLOBAL_DEC_ILLEGAL_ID:"GLOBAL_DEC's id illegal",GLOBAL_DEC_ILLEGAL_SIZE_FORMAT:"GLOBAL_DEC's size format illegal",GLOBAL_DEC_SIZE_TOO_LARGE:"GLOBAL_DEC's size too large",GLOBAL_DEC_SIZE_NOT_4_MULTIPLE:"GLOBAL_DEC's size not a multiple of 4",LABEL_ILLEGAL_ID:"LABEL's id illegal",GOTO_ILLEGAL_ID:"GOTO's id illegal",DUPLICATE_LABEL_ID:"LABEL's label id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_FUNCTION_ID:"FUNCTION's function id ''{id}'' already declared (last declared at line {lastLineNumber})",FUNCTION_NOT_FOUND:"Can't find function ''{id}''",LABEL_NOT_FOUND:"Can't find label ''{id}''",IF_ILLEGAL_COND_OPERATOR:"IF's relop illegal",IF_ILLEGAL_COND_OPERAND1:"IF's first Singular operand in condition illegal",IF_COND_OPERAND1_IMM_TOO_LARGE:"IF's first immediate number operand in condition too large",IF_ILLEGAL_COND_OPERAND2:"IF's second Singular operand in condition illegal",IF_COND_OPERAND2_IMM_TOO_LARGE:"IF's second immediate number operand in condition too large",IF_ILLEGAL_GOTO_ID:"IF's GOTO id illegal",ARG_ILLEGAL:"ARG's Singular arg illegal",ARG_IMM_TOO_LARGE:"ARG's immediate number arg too large",CALL_ILLEGAL_ID:"CALL's function id illegal",PARAM_ILLEGAL_ID:"PARAM's param id illegal",RETURN_ILLEGAL:"RETURN's Singular return value illegal",RETURN_IMM_TOO_LARGE:"RETURN's immediate number return value too large",READ_ILLEGAL:"Illegal LValue for READ",WRITE_ILLEGAL:"Illegal Singular for WRITE",WRITE_IMM_TOO_LARGE:"Immediate number for WRITE too large",NO_MAIN_FUNCTION:"Function 'main' is not defined",RUNTIME_ERROR_PREFIX:"Runtime Error (Line {lineNumber}): ",RUNTIME_ERROR_PREFIX_NO_LN:"Runtime Error: ",GLOBAL_VARIABLE_SEGMENT_OVERFLOW:"Global variable segment overflow",STACK_OVERFLOW:"Stack overflow",VARIABLE_NOT_FOUND:"Can't find variable ''{id}''",INSTRUCTION_READ_OUT_OF_BOUND:"Reading instruction from {address} is out of bound",MEMORY_READ_OUT_OF_BOUND:"Reading 4 bytes from {address} is out of bound",MEMORY_WRITE_OUT_OF_BOUND:"Writing 4 bytes to {address} is out of bound",EMPTY_VARIABLE_TABLE_STACK:"Empty local variable stack",DUPLICATE_DEC_ID:"DEC's variable id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_GLOBAL_DEC_ID:"GLOBAL_DEC's global variable id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_PARAM_ID:"PARAM's param id ''{id}'' already declared (last declared at line {lastLineNumber})",DIVIDE_BY_ZERO:"Cannot divide by 0",MAX_STEP_REACHED:"Maximum execution step count reached ({maxExecutionStepCount, number})",INPUT_INT_ILLEGAL:"Illegal input integer",INPUT_INT_ABS_TOO_LARGE:"Absolute value of input integer too large",WRITE_OUTPUT:"{value}",READ_PROMPT:"Please enter a value for {name}:",CONSOLE_ARROW:">",READ_INPUT:"{value}",PROGRAM_EXITED:"Program exited with return value {returnValue}.",EXECUTION_STEP_COUNT_TIME:"Execution step count: {stepCount, number}; Execution time: {time, number}ms"},oA=[{name:"简体中文",locale:Akt},{name:"English",locale:Pkt}],Okt={currentLocale:oA[0].locale},FEe=UQ({name:"locale",initialState:Okt,reducers:{setLocale:(i,e)=>{i.currentLocale=e.payload}}}),{setLocale:Fkt}=FEe.actions,Bkt=FEe.reducer,KK=[{name:"Light",className:"themeLight"}],Wkt={currentClassName:KK[0].className},BEe=UQ({name:"theme",initialState:Wkt,reducers:{setTheme:(i,e)=>{i.currentClassName=e.payload}}}),{setTheme:$kt}=BEe.actions,Hkt=BEe.reducer,WEe=(i,e)=>{const t=URL.createObjectURL(new Blob([e],{type:"data:attachment/plain"})),n=document.createElement("a");n.href=t,n.download=i.endsWith(".ir")?i:`${i}.ir`,n.click(),URL.revokeObjectURL(t)},$Ee=(i,e,t,n)=>{const r=new PEe;n!==void 0&&r.configure(n),r.loadAndDecodeNewInstructions(OEe(t)),v_.add(r),i(REe({name:e,irPath:"",isIrChanged:!1,irString:t,state:r.state,globalVariableDetails:r.globalVariableDetails,localVariableDetailsStack:r.localVariableDetailsStack,options:r.currentOptions,stepCount:r.stepCount,memoryUsage:r.memoryUsage,peakMemoryUsage:r.currentPeakMemoryUsage,consoleOutputs:[],consoleInputPrompt:[],consoleInput:"",staticErrors:r.staticErrors,runtimeErrors:r.runtimeErrors,currentLineNumber:r.currentLineNumber,shouldIndicateCurrentLineNumber:!1,localVariableTablesPagination:{size:FQ,currentIndex:1}}))},HEe=(i,e,t)=>{if(!t.name.endsWith(".ir")){aF.error(e.formatMessage({id:"NOT_AN_IR_FILE"},{fileName:t.name}));return}const n=new FileReader;n.readAsText(t),n.onload=r=>{if(r.target===null){aF.error(e.formatMessage({id:"IR_IMPORT_FAILED"},{fileName:t.name})),document.getElementById("inImportIr").value="";return}$Ee(i,t.name,r.target.result)}},qde="demos.json",Vkt=({vmIndex:i})=>{const e=Cc(),t=yS(),n=Gr(h=>{var f;return(f=h.vm.vmPageStates[i])==null?void 0:f.name}),r=Gr(h=>{var f;return(f=h.vm.vmPageStates[i])==null?void 0:f.irString}),o=Gr(h=>kkt(h.vm.vmPageStates.map(f=>f.name))),[s,a]=C.useState(!1),[l,c]=C.useState(!1),[u,d]=C.useState([]);return C.useEffect(()=>{l&&fetch(qde).then(h=>h.ok?h.text():Promise.reject()).catch(()=>{aF.error(e.formatMessage({id:"FETCH_FAILED"},{url:qde}))}).then(h=>{if(!h)return;const f=JSON.parse(h);d(f.map((g,p)=>({key:`g${p}`,icon:Oe(Aft,{}),label:`${g.groupName} (${g.demos.length})`,children:[{key:`g${p}i`,label:Oe(tA,{itemLayout:"horizontal",size:"small",dataSource:g.demos,renderItem:v=>Oe(tA.Item,{onClick:()=>{fetch(v.irUrl).then(m=>m.ok?m.text():Promise.reject()).catch(()=>{aF.error(e.formatMessage({id:"FETCH_FAILED"},{url:v.irUrl}))}).then(m=>{m&&($Ee(t,v.irUrl.split("/").at(-1),m,v.vmOptions),c(!1))})},children:Oe(tA.Item.Meta,{avatar:Oe(M1t,{icon:Oe(ece,{})}),title:v.name,description:v.remark})})})}]})))})},[l]),kn("aside",{className:h1.asideSideBarWrapper,children:[kn("div",{className:h1.divIconWrapperUpper,children:[Oe(l0,{icon:Oe(jht,{}),label:e.formatMessage({id:"ADD"}),onClick:()=>{const h=new PEe;v_.add(h),t(REe({name:o,irPath:"",isIrChanged:!1,irString:"",state:h.state,globalVariableDetails:h.globalVariableDetails,localVariableDetailsStack:h.localVariableDetailsStack,options:h.currentOptions,stepCount:h.stepCount,memoryUsage:h.memoryUsage,peakMemoryUsage:h.currentPeakMemoryUsage,consoleOutputs:[],consoleInputPrompt:[],consoleInput:"",staticErrors:h.staticErrors,runtimeErrors:h.runtimeErrors,currentLineNumber:h.currentLineNumber,shouldIndicateCurrentLineNumber:!1,localVariableTablesPagination:{size:FQ,currentIndex:1}}))}}),Oe(l0,{icon:Oe(ece,{}),label:e.formatMessage({id:"DEMOS"}),onClick:()=>c(!0)}),Oe(l0,{icon:Oe(rwe,{}),label:e.formatMessage({id:"IMPORT"}),onClick:()=>{var h;(h=document.getElementById("inImportIr"))==null||h.click()}}),Oe("input",{id:"inImportIr",style:{display:"none"},type:"file",accept:".ir",multiple:!0,onChange:h=>{if(!(h.currentTarget===null||h.currentTarget.files===null||h.currentTarget.files.length===0)){for(const f of h.target.files)HEe(t,e,f);document.getElementById("inImportIr").value=""}}}),Oe(l0,{icon:Oe(kft,{}),label:e.formatMessage({id:"SAVE"}),onClick:()=>{n!==void 0&&(WEe(n,r),t(hkt(!1)))}})]}),kn("div",{className:h1.divIconWrapperLower,children:[Oe(hk,{menu:{items:oA.map((h,f)=>({key:f,label:h.name})),onClick:h=>{t(Fkt(oA[parseInt(h.key)].locale)),document.title=oA[parseInt(h.key)].locale.APP_TITLE}},placement:"topLeft",children:Oe(wK,{children:Oe(l0,{icon:Oe($ft,{}),label:"Lang"})})}),Oe(hk,{menu:{items:KK.map((h,f)=>({key:f,label:h.name})),onClick:h=>{t($kt(KK[parseInt(h.key)].className))}},placement:"topLeft",children:Oe(wK,{children:Oe(l0,{icon:Oe(Qye,{}),label:e.formatMessage({id:"THEME"})})})}),Oe(l0,{icon:Oe(dwe,{}),label:e.formatMessage({id:"ABOUT"}),onClick:()=>a(!0)})]}),Oe(IK,{open:s,title:e.formatMessage({id:"ABOUT"}),centered:!0,closable:!1,onCancel:()=>a(!1),footer:[Oe(Ju,{onClick:()=>a(!1),children:e.formatMessage({id:"OK"})})],children:kn("article",{className:h1.articleAbout,children:[Oe("p",{className:"title",children:"IR虚拟机💎IR Virtual Machine"}),kn("p",{children:[Oe("div",{children:"哈尔滨工业大学 120L021615 崔子健"}),Oe("div",{children:"Ernest Cui, Harbin Institute of Technology"})]}),kn("p",{children:[Oe("div",{children:"April 🌼 2023"}),Oe("div",{children:"V3.0 March 🌸 2024"})]}),kn("p",{children:[Oe("div",{children:"🎉 感谢陈鄞、单丽莉老师的大力支持"}),Oe("div",{children:"㊙️ 虚拟机的说明请见仓库首页的文档"}),Oe("div",{children:"⚙️ 仓库中的CLI版本可用于自动化测试"})]}),kn("p",{className:"info",children:[Oe("a",{href:"https://ernestthepoet.github.io/ir-virtual-machine/",children:"Github Pages镜像"}),"·",Oe("a",{href:"https://ecui.gitee.io/ir-virtual-machine/",children:"Gitee Pages镜像"}),"·",Oe("a",{href:"https://irvm.netlify.app/",children:"Netlify镜像"})]}),kn("p",{className:"info",children:[Oe("a",{href:"https://github.com/ErnestThePoet/ir-virtual-machine",children:"Github仓库"}),"·",Oe("a",{href:"https://gitee.com/ecui/ir-virtual-machine",children:"Gitee仓库"}),"·",Oe("a",{href:"mailto: ecuiships@126.com",children:"ecuiships@126.com"})]})]})}),Oe(IK,{open:l,title:kn("span",{children:[e.formatMessage({id:"DEMOS"}),kn("a",{className:h1.aDemoSources,href:"https://github.com/ErnestThePoet/ir-virtual-machine/tree/master/public/demos",children:["(",e.formatMessage({id:"DEMO_SOURCES"}),")"]})]}),centered:!0,closable:!0,onCancel:()=>c(!1),footer:!0,children:Oe(vQ,{className:h1.menuDemos,mode:"inline",selectable:!1,items:u})})]})},zkt="_navTabBarWrapper_nfao3_1",Ukt={navTabBarWrapper:zkt},jkt="_divTabBarItemWrapperBase_11raq_1",Kkt="_divTabBarItemWrapperActive_11raq_1",Gkt="_divTabBarItemWrapperInactive_11raq_1",qkt="_divIconTitleWrapper_11raq_23",Xkt="_divCloseWrapper_11raq_28",Ykt="_divCloseWrapperChanged_11raq_28",Zkt="_iconVm_11raq_53",Qkt="_iconClose_11raq_60",Jkt="_lblTitle_11raq_65",eTt="_iconDot_11raq_71",tTt="_inVmRename_11raq_78",jh={divTabBarItemWrapperBase:jkt,divTabBarItemWrapperActive:Kkt,divTabBarItemWrapperInactive:Gkt,divIconTitleWrapper:qkt,divCloseWrapper:Xkt,divCloseWrapperChanged:Ykt,iconVm:Zkt,iconClose:Qkt,lblTitle:Jkt,iconDot:eTt,inVmRename:tTt},nTt=i=>kn("svg",{...i,version:"1.1",id:"layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 50 50",enableBackground:"new 0 0 50 50",children:[kn("g",{children:[Oe("path",{d:"M14.16,36.09L7.2,13.91h2.06l6.27,20.5h0.19l6.27-20.5h2.06l-6.95,22.19H14.16z"}),Oe("path",{d:`M27.25,36.09V13.91h1.94v22.19H27.25z M33.31,26.2l-3.89-10.06h-0.55v-2.23h1.55l3.89,10.17h0.08l0.23,2.13H33.31z\r +}`;var ui=Yee(function(){return ir(ee,dn+"return "+Ct).apply(t,ge)});if(ui.source=Ct,i8(ui))throw ui;return ui}function HRe(b){return ur(b).toLowerCase()}function VRe(b){return ur(b).toUpperCase()}function zRe(b,x,I){if(b=ur(b),b&&(I||x===t))return oJ(b);if(!b||!(x=Ic(x)))return b;var P=pd(b),V=pd(x),ee=sJ(P,V),ge=aJ(P,V)+1;return nm(P,ee,ge).join("")}function URe(b,x,I){if(b=ur(b),b&&(I||x===t))return b.slice(0,cJ(b)+1);if(!b||!(x=Ic(x)))return b;var P=pd(b),V=aJ(P,pd(x))+1;return nm(P,0,V).join("")}function jRe(b,x,I){if(b=ur(b),b&&(I||x===t))return b.replace(lr,"");if(!b||!(x=Ic(x)))return b;var P=pd(b),V=sJ(P,pd(x));return nm(P,V).join("")}function KRe(b,x){var I=M,P=A;if(yo(x)){var V="separator"in x?x.separator:V;I="length"in x?ai(x.length):I,P="omission"in x?Ic(x.omission):P}b=ur(b);var ee=b.length;if(RC(b)){var ge=pd(b);ee=ge.length}if(I>=ee)return b;var Ce=I-MC(P);if(Ce<1)return P;var Ie=ge?nm(ge,0,Ce).join(""):b.slice(0,Ce);if(V===t)return Ie+P;if(ge&&(Ce+=Ie.length-Ce),r8(V)){if(b.slice(Ce).search(V)){var pt,mt=Ie;for(V.global||(V=CB(V.source,ur($t.exec(V))+"g")),V.lastIndex=0;pt=V.exec(mt);)var Ct=pt.index;Ie=Ie.slice(0,Ct===t?Ce:Ct)}}else if(b.indexOf(Ic(V),Ce)!=Ce){var jt=Ie.lastIndexOf(V);jt>-1&&(Ie=Ie.slice(0,jt))}return Ie+P}function GRe(b){return b=ur(b),b&&nn.test(b)?b.replace(Bt,wDe):b}var qRe=$C(function(b,x,I){return b+(I?" ":"")+x.toUpperCase()}),a8=ZJ("toUpperCase");function Xee(b,x,I){return b=ur(b),x=I?t:x,x===t?vDe(b)?LDe(b):lDe(b):b.match(x)||[]}var Yee=fi(function(b,x){try{return Ec(b,t,x)}catch(I){return i8(I)?I:new ti(I)}}),XRe=ug(function(b,x){return yu(x,function(I){I=Fh(I),lg(b,I,t8(b[I],b))}),b});function YRe(b){var x=b==null?0:b.length,I=An();return b=x?uo(b,function(P){if(typeof P[1]!="function")throw new wu(s);return[I(P[0]),P[1]]}):[],fi(function(P){for(var V=-1;++VU)return[];var I=Y,P=Wa(b,Y);x=An(x),b-=Y;for(var V=vB(P,x);++I0||x<0)?new yi(I):(b<0?I=I.takeRight(-b):b&&(I=I.drop(b)),x!==t&&(x=ai(x),I=x<0?I.dropRight(-x):I.take(x-b)),I)},yi.prototype.takeRightWhile=function(b){return this.reverse().takeWhile(b).reverse()},yi.prototype.toArray=function(){return this.take(Y)},Ph(yi.prototype,function(b,x){var I=/^(?:filter|find|map|reject)|While$/.test(x),P=/^(?:head|last)$/.test(x),V=Z[P?"take"+(x=="last"?"Right":""):x],ee=P||/^find/.test(x);V&&(Z.prototype[x]=function(){var ge=this.__wrapped__,Ce=P?[1]:arguments,Ie=ge instanceof yi,pt=Ce[0],mt=Ie||ii(ge),Ct=function(vi){var ki=V.apply(Z,Yp([vi],Ce));return P&&jt?ki[0]:ki};mt&&I&&typeof pt=="function"&&pt.length!=1&&(Ie=mt=!1);var jt=this.__chain__,dn=!!this.__actions__.length,On=ee&&!jt,ui=Ie&&!dn;if(!ee&&mt){ge=ui?ge:new yi(this);var Fn=b.apply(ge,Ce);return Fn.__actions__.push({func:yN,args:[Ct],thisArg:t}),new Su(Fn,jt)}return On&&ui?b.apply(this,Ce):(Fn=this.thru(Ct),On?P?Fn.value()[0]:Fn.value():Fn)})}),yu(["pop","push","shift","sort","splice","unshift"],function(b){var x=GT[b],I=/^(?:push|sort|unshift)$/.test(b)?"tap":"thru",P=/^(?:pop|shift)$/.test(b);Z.prototype[b]=function(){var V=arguments;if(P&&!this.__chain__){var ee=this.value();return x.apply(ii(ee)?ee:[],V)}return this[I](function(ge){return x.apply(ii(ge)?ge:[],V)})}}),Ph(yi.prototype,function(b,x){var I=Z[x];if(I){var P=I.name+"";mr.call(FC,P)||(FC[P]=[]),FC[P].push({name:x,func:I})}}),FC[gN(t,m).name]=[{name:"wrapper",func:t}],yi.prototype.clone=GDe,yi.prototype.reverse=qDe,yi.prototype.value=XDe,Z.prototype.at=xTe,Z.prototype.chain=LTe,Z.prototype.commit=ETe,Z.prototype.next=DTe,Z.prototype.plant=kTe,Z.prototype.reverse=TTe,Z.prototype.toJSON=Z.prototype.valueOf=Z.prototype.value=NTe,Z.prototype.first=Z.prototype.head,ox&&(Z.prototype[ox]=ITe),Z},AC=EDe();H_?((H_.exports=AC)._=AC,cB._=AC):na._=AC}).call(bx)})(Ekt,sa);var Gi=(i=>(i[i.INITIAL=0]="INITIAL",i[i.BUSY=1]="BUSY",i[i.WAIT_INPUT=2]="WAIT_INPUT",i[i.FREE=3]="FREE",i[i.STATIC_CHECK_FAILED=4]="STATIC_CHECK_FAILED",i[i.RUNTIME_ERROR=5]="RUNTIME_ERROR",i[i.MAX_STEP_REACHED=6]="MAX_STEP_REACHED",i[i.EXITED_NORMALLY=7]="EXITED_NORMALLY",i[i.EXITED_ABNORMALLY=8]="EXITED_ABNORMALLY",i[i.CLOSED=9]="CLOSED",i))(Gi||{});const Dkt={instructions:[],text:[],memory:new Uint8Array},Ude={total:0,stack:0,globalVariable:0},jde={mainFunctionAddressBefore:-1,globalVariableTable:{},variableTableStack:[],assignCallLValueStack:[]},Kde={stepCount:0,timeElapsed:0,state:0,callStack:[],staticErrors:[],runtimeErrors:[]};var Ql=(i=>(i[i.SUCCESS=0]="SUCCESS",i[i.ERROR=1]="ERROR",i[i.WARNING=2]="WARNING",i[i.INPUT=3]="INPUT",i[i.OUTPUT=4]="OUTPUT",i[i.PROMPT=5]="PROMPT",i[i.ARROW=6]="ARROW",i))(Ql||{});const zd={maxExecutionStepCount:{min:0,max:999999999},memorySize:{min:1*_b,max:32*yp},stackSize:{min:512,max:32*yp-512}},Gde={maxExecutionStepCount:5e6,memorySize:2*yp,stackSize:1*yp};class PEe{constructor(){Ss(this,"initialRegisters",{eax:0,ebx:0,ecx:0,edx:0,ebp:0,esp:Gde.memorySize,eip:0});Ss(this,"decoder",new Lkt);Ss(this,"memory",sa.cloneDeep(Dkt));Ss(this,"registers",sa.cloneDeep(this.initialRegisters));Ss(this,"tables",sa.cloneDeep(jde));Ss(this,"executionStatus",sa.cloneDeep(Kde));Ss(this,"peakMemoryUsage",sa.cloneDeep(Ude));Ss(this,"options",sa.cloneDeep(Gde));Ss(this,"executionStartTime",new Date);Ss(this,"writeBuffer",[]);Ss(this,"readConsole",()=>Promise.resolve(""));Ss(this,"entryFunctionName","main")}setReadConsoleFn(e){this.readConsole=e}getSingleVariableValues(e){const t=[];for(let n=e.address;n=this.memory.text.length?-1:this.memory.text[this.registers.eip].lineNumber}get instructions(){return this.memory.instructions}get globalVariableDetails(){return this.getSingleTableVariableDetails(this.tables.globalVariableTable)}get localVariableDetailsStack(){const e=[];for(let t=0;t(n=Math.max(n,r.min),n=Math.min(n,r.max),n);e.maxExecutionStepCount!==void 0&&(e.maxExecutionStepCount=t(e.maxExecutionStepCount,zd.maxExecutionStepCount),this.options.maxExecutionStepCount=e.maxExecutionStepCount),e.memorySize!==void 0&&(e.memorySize=t(e.memorySize,zd.memorySize),e.memorySize=t(e.memorySize,{min:this.options.stackSize,max:zd.memorySize.max}),this.options.memorySize=e.memorySize,this.initialRegisters.esp=Zl(e.memorySize),this.registers.esp=Zl(e.memorySize),this.updatePeakMemoryUsage()),e.stackSize!==void 0&&(e.stackSize=t(e.stackSize,zd.stackSize),e.stackSize=t(e.stackSize,{min:zd.stackSize.min,max:this.options.memorySize}),this.options.stackSize=e.stackSize)}reset(){this.memory.text=[],this.memory.memory=new Uint8Array,this.registers=sa.cloneDeep(this.initialRegisters),this.tables=sa.cloneDeep(jde),this.executionStatus=sa.cloneDeep(Kde),this.peakMemoryUsage=sa.cloneDeep(Ude),this.writeBuffer=[]}close(){this.executionStatus.state=9}loadNewInstructions(e){this.reset(),this.memory.instructions=e}loadAndDecodeNewInstructions(e){this.loadNewInstructions(e),this.decodeInstructions(!0)}decodeInstructions(e){const t=new Map,n=new Map;for(let r=0;rn;case C0.GE:return t>=n}}async execute(e){do{if((this.executionStatus.state===7||this.executionStatus.state===8||this.executionStatus.state===0)&&(this.reset(),this.prepareExcution()),this.executionStatus.state!==3)return;if(this.executionStatus.state=1,this.options.maxExecutionStepCount>0&&this.executionStatus.stepCount>=this.options.maxExecutionStepCount){this.executionStatus.state=6,this.writeBuffer.push([{key:"MAX_STEP_REACHED",values:{maxExecutionStepCount:this.options.maxExecutionStepCount},type:1}]);return}if(this.registers.eip>=this.memory.text.length||this.registers.eip<0){this.executionStatus.state=5,this.writeBuffer.push([{key:"RUNTIME_ERROR_PREFIX_NO_LN",type:1},{key:"INSTRUCTION_READ_OUT_OF_BOUND",values:{address:this.registers.eip},type:1}]);return}this.executionStatus.stepCount++;const t=this.memory.text[this.registers.eip];switch(t.type){case Mo.ARG:{const n=this.getSingularValue(t.value.value);if(n===null||!this.pushl(n))return;this.registers.ecx=Oc(this.registers.ecx,4);break}case Mo.ASSIGN:{const n=this.getRValue(t.value.rValue);if(n===null)return;const r=this.getLValueAddress(t.value.lValue);if(r===null||!this.storeMemory32(n,r))return;break}case Mo.ASSIGN_CALL:case Mo.CALL:{const n=t.type===Mo.CALL?t.value.id:t.value.functionId;if(this.registers.ebx=this.registers.esp,!this.pushl(this.registers.ecx)||(this.registers.ecx=0,!this.pushl(this.registers.eip))||!this.pushl(this.registers.ebp))return;this.registers.ebp=this.registers.esp,t.type===Mo.ASSIGN_CALL?this.tables.assignCallLValueStack.push(t.value.lValue):this.tables.assignCallLValueStack.push(null),this.tables.variableTableStack.push({}),this.executionStatus.callStack.push(n),this.registers.eip=t.value.functionAddressBefore;break}case Mo.DEC:{if(this.createStackVariable(t.value.id,t.value.size)===null)return;break}case Mo.GOTO:{this.registers.eip=t.value.gotoAddressBefore;break}case Mo.IF:{const n=this.getCondValue(t.value.condition);if(n===null)return;n&&(this.registers.eip=t.value.gotoAddressBefore);break}case Mo.PARAM:{const n=t.value.id;if(n in this.tables.variableTableStack[this.tables.variableTableStack.length-1]){this.writeRuntimeError({key:"DUPLICATE_PARAM_ID",values:{id:n,lastLineNumber:this.tables.variableTableStack[this.tables.variableTableStack.length-1][n].lineNumber}});return}if(this.loadMemory32(this.registers.ebx)===null)return;this.tables.variableTableStack[this.tables.variableTableStack.length-1][n]={address:this.registers.ebx,size:4,lineNumber:t.lineNumber},this.registers.ebx=Oc(this.registers.ebx,4);break}case Mo.RETURN:{const n=this.getSingularValue(t.value.value);if(n===null)return;this.registers.eax=n,this.registers.esp=this.registers.ebp,this.updatePeakMemoryUsage();const r=this.popl();if(r===null)return;this.registers.ebp=r;const o=this.popl();if(o===null)return;this.registers.eip=o;const s=this.popl();if(s===null)return;if(this.registers.esp=Oc(this.registers.esp,s),this.updatePeakMemoryUsage(),this.registers.ecx=0,this.tables.variableTableStack.length===0){this.writeRuntimeError({key:"EMPTY_VARIABLE_TABLE_STACK"});return}if(this.executionStatus.callStack.pop(),this.tables.variableTableStack.pop(),this.registers.eip===this.memory.text.length){this.finalizeExcution();return}const a=this.tables.assignCallLValueStack.pop();if(a!==null){const l=this.getLValueAddress(a);if(l===null||!this.storeMemory32(this.registers.eax,l))return}break}case Mo.READ:{const n=t.value,r=this.getLValueAddress(n.lValue);if(r===null)return;const o=n.lValue.type===YL.ID?n.lValue.id:"*"+n.lValue.id;this.executionStatus.state=2;const s=await this.readConsole([{key:"READ_PROMPT",values:{name:o}}]);if(this.state!==2)return;this.executionStatus.state=1;const a=parseInt(s);if(isNaN(a)){this.writeRuntimeError({key:"INPUT_INT_ILLEGAL"});return}if(!Number.isSafeInteger(a)){this.writeRuntimeError({key:"INPUT_INT_ABS_TOO_LARGE"});return}if(!this.storeMemory32(Zl(a),r))return;break}case Mo.WRITE:{const n=this.getSingularValue(t.value.value);if(n===null)return;this.writeBuffer.push([{key:"WRITE_OUTPUT",values:{value:n},type:4}]);break}}for(this.registers.eip=Oc(this.registers.eip,1);this.registers.eip=0&&this.memory.text[this.registers.eip].type===Mo.GLOBAL_DEC;)this.registers.eip=Oc(this.registers.eip,1);this.executionStatus.state=3}while(e)}async executeSingleStep(){await this.execute(!1)}async executeContinuously(){await this.execute(!0)}}function Ikt(i,e=18){let t=0,n=0;for(let r=0;re){t=r;break}return n<=e?i:i.substring(0,t)+"..."}function kkt(i){for(let e=1;;e++){const t=`Untitled-${e}`;if(i.every(n=>n!==t))return t}}function OEe(i){return i.split(/\r\n|[\r\n]/)}function Tkt(i){return i.trim().split(/\s/).filter(e=>e.length>0)}function Nkt(i){return i<_b?{size:i,unit:"B"}:i",READ_INPUT:"{value}",PROGRAM_EXITED:"程序执行结束,返回值为{returnValue}。",EXECUTION_STEP_COUNT_TIME:"总执行步数:{stepCount, number};总执行耗时:{time, number}ms"},Pkt={APP_TITLE:"IR Virtual Machine",ADD:"New",IMPORT:"Import",DEMOS:"Demos",DEMO_SOURCES:"Sources",SAVE:"Save",THEME:"Theme",ABOUT:"About",CLOSE:"Close",CONFIRM_UNSAVED_CLOSE:"Save changes to {name} before close?",SAVE_CLOSE:"Save&Close",UNSAVE_CLOSE:"Close",OK:"OK",CANCEL:"Cancel",EMPTY_PLACEHOLDER_DESC:"An IR virtual machine for HIT/NJU Compilation Principle labs",EMPTY_PLACEHOLDER_HINT_TITLE:"You may:",EMPTY_PLACEHOLDER_HINT_1:"Add or import .ir files in left sidebar",EMPTY_PLACEHOLDER_HINT_2:"Drag one or more .ir files inside",EMPTY_PLACEHOLDER_HINT_3:"Try out Demos in left sidebar",FETCH_FAILED:"fetch() for {url} failed",NOT_AN_IR_FILE:"{fileName} is not an ir file",IR_IMPORT_FAILED:"Failed to import {fileName}",RUN:"Run",RUN_STEP:"Step",RESET:"Reset",CLEAR_CONSOLE:"Clear",STEP_COUNT:"Step Count: ",STEP_COUNT_NUMBER:"{stepCount, number}",STATE:"VM State: ",STATE_INITIAL:"Initial",STATE_BUSY:"Busy",STATE_WAIT_INPUT:"Awaiting Input",STATE_FREE:"Free",STATE_STATIC_CHECK_FAILED:"IR Static Check Error",STATE_RUNTIME_ERROR:"Runtime Error",STATE_MAX_STEP_REACHED:"Max Step Count Reached",STATE_EXITED_NORMALLY:"Exited Normally (Return value 0)",STATE_EXITED_ABNORMALLY:"Exited Abnormally (Return value not 0)",MAX_EXECUTION_STEP_COUNT:"Max Steps",SET_0_MEANS_NO_STEP_LIMIT:"No step limit if set to 0",MEMORY_SIZE:"Memory Size/B",STACK_SIZE:"Stack Size/B",TOTAL_MEMORY_USAGE:"Total Memory Usage: ",STACK_MEMORY_USAGE:"Stack Memory Usage: ",GLOBAL_VARIABLE_MEMORY_USAGE:"GlobalVar Memory Usage: ",PEAK_MEMORY_USAGE:"Peak Usage: ",PERCENTAGE_USAGE:"{percentage, number, ::.0}%",BYTE_USAGE:"{used}B/{total}B",ARBITRARY_UNIT_MEMORY_USAGE:"{used, number, ::.0}{unit}/{total, number, ::.0}{unit}",BYTE_SIZE:"{size}B",ARBITRARY_UNIT_SIZE:"{size, number, ::.0}{unit}",GLOBAL_VARIABLE_TABLE:"Global Variable Table",LOCAL_VARIABLE_TABLE:"Local Variable Table",VARIABLE_ID:"ID",ADDRESS:"Address",SIZE:"Size",VALUES:"Value",EMPTY_VATIABLE_TABLE:"(Empty)",CALL_STACK_DEPTH:"Call stack depth {depth}",STATIC_ERROR_PREFIX:"Static Check Error (Line {lineNumber}): ",STATIC_ERROR_PREFIX_NO_LINE_NUMBER:"Static Check Error: ",DECODE_ERROR_PREFIX:"IR Decoding Error (Line {lineNumber}): ",UNRECOGNIZED_INSTRUCTION:"Unrecognized IR instruction",ILLEGAL_INSTRUCTION_FORMAT:"Illegal IR format",FUNCTION_ILLEGAL_ID:"FUNCTION id illegal",ASSIGN_ILLEGAL_LEFT:"Illegal left hand side of assignment",ASSIGN_ILLEGAL_RIGHT:"Illegal right hand side of assignment",ASSIGN_RIGHT_IMM_TOO_LARGE:"Right hand side immediate number of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERATOR:"Illegal math operator on RHS of assignment",ASSIGN_ILLEGAL_RIGHT_OPERAND1:"Illegal first Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND1_IMM_TOO_LARGE:"First immediate number operand on RHS of assignment too large",ASSIGN_ILLEGAL_RIGHT_OPERAND2:"Illegal second Singular operand on RHS of assignment",ASSIGN_RIGHT_OPERAND2_IMM_TOO_LARGE:"Second immediate number operand on RHS of assignment too large",DEC_ILLEGAL_ID:"DEC's id illegal",DEC_ILLEGAL_SIZE_FORMAT:"DEC's size format illegal",DEC_SIZE_TOO_LARGE:"DEC's size too large",DEC_SIZE_NOT_4_MULTIPLE:"DEC's size not a multiple of 4",GLOBAL_DEC_ILLEGAL_ID:"GLOBAL_DEC's id illegal",GLOBAL_DEC_ILLEGAL_SIZE_FORMAT:"GLOBAL_DEC's size format illegal",GLOBAL_DEC_SIZE_TOO_LARGE:"GLOBAL_DEC's size too large",GLOBAL_DEC_SIZE_NOT_4_MULTIPLE:"GLOBAL_DEC's size not a multiple of 4",LABEL_ILLEGAL_ID:"LABEL's id illegal",GOTO_ILLEGAL_ID:"GOTO's id illegal",DUPLICATE_LABEL_ID:"LABEL's label id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_FUNCTION_ID:"FUNCTION's function id ''{id}'' already declared (last declared at line {lastLineNumber})",FUNCTION_NOT_FOUND:"Can't find function ''{id}''",LABEL_NOT_FOUND:"Can't find label ''{id}''",IF_ILLEGAL_COND_OPERATOR:"IF's relop illegal",IF_ILLEGAL_COND_OPERAND1:"IF's first Singular operand in condition illegal",IF_COND_OPERAND1_IMM_TOO_LARGE:"IF's first immediate number operand in condition too large",IF_ILLEGAL_COND_OPERAND2:"IF's second Singular operand in condition illegal",IF_COND_OPERAND2_IMM_TOO_LARGE:"IF's second immediate number operand in condition too large",IF_ILLEGAL_GOTO_ID:"IF's GOTO id illegal",ARG_ILLEGAL:"ARG's Singular arg illegal",ARG_IMM_TOO_LARGE:"ARG's immediate number arg too large",CALL_ILLEGAL_ID:"CALL's function id illegal",PARAM_ILLEGAL_ID:"PARAM's param id illegal",RETURN_ILLEGAL:"RETURN's Singular return value illegal",RETURN_IMM_TOO_LARGE:"RETURN's immediate number return value too large",READ_ILLEGAL:"Illegal LValue for READ",WRITE_ILLEGAL:"Illegal Singular for WRITE",WRITE_IMM_TOO_LARGE:"Immediate number for WRITE too large",NO_MAIN_FUNCTION:"Function 'main' is not defined",RUNTIME_ERROR_PREFIX:"Runtime Error (Line {lineNumber}): ",RUNTIME_ERROR_PREFIX_NO_LN:"Runtime Error: ",GLOBAL_VARIABLE_SEGMENT_OVERFLOW:"Global variable segment overflow",STACK_OVERFLOW:"Stack overflow",VARIABLE_NOT_FOUND:"Can't find variable ''{id}''",INSTRUCTION_READ_OUT_OF_BOUND:"Reading instruction from {address} is out of bound",MEMORY_READ_OUT_OF_BOUND:"Reading 4 bytes from {address} is out of bound",MEMORY_WRITE_OUT_OF_BOUND:"Writing 4 bytes to {address} is out of bound",EMPTY_VARIABLE_TABLE_STACK:"Empty local variable stack",DUPLICATE_DEC_ID:"DEC's variable id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_GLOBAL_DEC_ID:"GLOBAL_DEC's global variable id ''{id}'' already declared (last declared at line {lastLineNumber})",DUPLICATE_PARAM_ID:"PARAM's param id ''{id}'' already declared (last declared at line {lastLineNumber})",DIVIDE_BY_ZERO:"Cannot divide by 0",MAX_STEP_REACHED:"Maximum execution step count reached ({maxExecutionStepCount, number})",INPUT_INT_ILLEGAL:"Illegal input integer",INPUT_INT_ABS_TOO_LARGE:"Absolute value of input integer too large",WRITE_OUTPUT:"{value}",READ_PROMPT:"Please enter a value for {name}:",CONSOLE_ARROW:">",READ_INPUT:"{value}",PROGRAM_EXITED:"Program exited with return value {returnValue}.",EXECUTION_STEP_COUNT_TIME:"Execution step count: {stepCount, number}; Execution time: {time, number}ms"},oA=[{name:"简体中文",locale:Akt},{name:"English",locale:Pkt}],Okt={currentLocale:oA[0].locale},FEe=UQ({name:"locale",initialState:Okt,reducers:{setLocale:(i,e)=>{i.currentLocale=e.payload}}}),{setLocale:Fkt}=FEe.actions,Bkt=FEe.reducer,KK=[{name:"Light",className:"themeLight"}],Wkt={currentClassName:KK[0].className},BEe=UQ({name:"theme",initialState:Wkt,reducers:{setTheme:(i,e)=>{i.currentClassName=e.payload}}}),{setTheme:$kt}=BEe.actions,Hkt=BEe.reducer,WEe=(i,e)=>{const t=URL.createObjectURL(new Blob([e],{type:"data:attachment/plain"})),n=document.createElement("a");n.href=t,n.download=i.endsWith(".ir")?i:`${i}.ir`,n.click(),URL.revokeObjectURL(t)},$Ee=(i,e,t,n)=>{const r=new PEe;n!==void 0&&r.configure(n),r.loadAndDecodeNewInstructions(OEe(t)),v_.add(r),i(REe({name:e,irPath:"",isIrChanged:!1,irString:t,state:r.state,globalVariableDetails:r.globalVariableDetails,localVariableDetailsStack:r.localVariableDetailsStack,options:r.currentOptions,stepCount:r.stepCount,memoryUsage:r.memoryUsage,peakMemoryUsage:r.currentPeakMemoryUsage,consoleOutputs:[],consoleInputPrompt:[],consoleInput:"",staticErrors:r.staticErrors,runtimeErrors:r.runtimeErrors,currentLineNumber:r.currentLineNumber,shouldIndicateCurrentLineNumber:!1,localVariableTablesPagination:{size:FQ,currentIndex:1}}))},HEe=(i,e,t)=>{if(!t.name.endsWith(".ir")){aF.error(e.formatMessage({id:"NOT_AN_IR_FILE"},{fileName:t.name}));return}const n=new FileReader;n.readAsText(t),n.onload=r=>{if(r.target===null){aF.error(e.formatMessage({id:"IR_IMPORT_FAILED"},{fileName:t.name})),document.getElementById("inImportIr").value="";return}$Ee(i,t.name,r.target.result)}},qde="demos.json",Vkt=({vmIndex:i})=>{const e=Cc(),t=yS(),n=Gr(h=>{var f;return(f=h.vm.vmPageStates[i])==null?void 0:f.name}),r=Gr(h=>{var f;return(f=h.vm.vmPageStates[i])==null?void 0:f.irString}),o=Gr(h=>kkt(h.vm.vmPageStates.map(f=>f.name))),[s,a]=C.useState(!1),[l,c]=C.useState(!1),[u,d]=C.useState([]);return C.useEffect(()=>{l&&fetch(qde).then(h=>h.ok?h.text():Promise.reject()).catch(()=>{aF.error(e.formatMessage({id:"FETCH_FAILED"},{url:qde}))}).then(h=>{if(!h)return;const f=JSON.parse(h);d(f.map((g,p)=>({key:`g${p}`,icon:Oe(Aft,{}),label:`${g.groupName} (${g.demos.length})`,children:[{key:`g${p}i`,label:Oe(tA,{itemLayout:"horizontal",size:"small",dataSource:g.demos,renderItem:v=>Oe(tA.Item,{onClick:()=>{fetch(v.irUrl).then(m=>m.ok?m.text():Promise.reject()).catch(()=>{aF.error(e.formatMessage({id:"FETCH_FAILED"},{url:v.irUrl}))}).then(m=>{m&&($Ee(t,v.irUrl.split("/").at(-1),m,v.vmOptions),c(!1))})},children:Oe(tA.Item.Meta,{avatar:Oe(M1t,{icon:Oe(ece,{})}),title:v.name,description:v.remark})})})}]})))})},[l]),kn("aside",{className:h1.asideSideBarWrapper,children:[kn("div",{className:h1.divIconWrapperUpper,children:[Oe(l0,{icon:Oe(jht,{}),label:e.formatMessage({id:"ADD"}),onClick:()=>{const h=new PEe;v_.add(h),t(REe({name:o,irPath:"",isIrChanged:!1,irString:"",state:h.state,globalVariableDetails:h.globalVariableDetails,localVariableDetailsStack:h.localVariableDetailsStack,options:h.currentOptions,stepCount:h.stepCount,memoryUsage:h.memoryUsage,peakMemoryUsage:h.currentPeakMemoryUsage,consoleOutputs:[],consoleInputPrompt:[],consoleInput:"",staticErrors:h.staticErrors,runtimeErrors:h.runtimeErrors,currentLineNumber:h.currentLineNumber,shouldIndicateCurrentLineNumber:!1,localVariableTablesPagination:{size:FQ,currentIndex:1}}))}}),Oe(l0,{icon:Oe(ece,{}),label:e.formatMessage({id:"DEMOS"}),onClick:()=>c(!0)}),Oe(l0,{icon:Oe(rwe,{}),label:e.formatMessage({id:"IMPORT"}),onClick:()=>{var h;(h=document.getElementById("inImportIr"))==null||h.click()}}),Oe("input",{id:"inImportIr",style:{display:"none"},type:"file",accept:".ir",multiple:!0,onChange:h=>{if(!(h.currentTarget===null||h.currentTarget.files===null||h.currentTarget.files.length===0)){for(const f of h.target.files)HEe(t,e,f);document.getElementById("inImportIr").value=""}}}),Oe(l0,{icon:Oe(kft,{}),label:e.formatMessage({id:"SAVE"}),onClick:()=>{n!==void 0&&(WEe(n,r),t(hkt(!1)))}})]}),kn("div",{className:h1.divIconWrapperLower,children:[Oe(hk,{menu:{items:oA.map((h,f)=>({key:f,label:h.name})),onClick:h=>{t(Fkt(oA[parseInt(h.key)].locale)),document.title=oA[parseInt(h.key)].locale.APP_TITLE}},placement:"topLeft",children:Oe(wK,{children:Oe(l0,{icon:Oe($ft,{}),label:"Lang"})})}),Oe(hk,{menu:{items:KK.map((h,f)=>({key:f,label:h.name})),onClick:h=>{t($kt(KK[parseInt(h.key)].className))}},placement:"topLeft",children:Oe(wK,{children:Oe(l0,{icon:Oe(Qye,{}),label:e.formatMessage({id:"THEME"})})})}),Oe(l0,{icon:Oe(dwe,{}),label:e.formatMessage({id:"ABOUT"}),onClick:()=>a(!0)})]}),Oe(IK,{open:s,title:e.formatMessage({id:"ABOUT"}),centered:!0,closable:!1,onCancel:()=>a(!1),footer:[Oe(Ju,{onClick:()=>a(!1),children:e.formatMessage({id:"OK"})})],children:kn("article",{className:h1.articleAbout,children:[Oe("p",{className:"title",children:"IR虚拟机💎IR Virtual Machine"}),kn("p",{children:[Oe("div",{children:"哈尔滨工业大学 120L021615 崔子健"}),Oe("div",{children:"Ernest Cui, Harbin Institute of Technology"})]}),kn("p",{children:[Oe("div",{children:"April 🌼 2023"}),Oe("div",{children:"V3.0 March 🌸 2024"})]}),kn("p",{children:[Oe("div",{children:"🎉 感谢陈鄞、单丽莉老师的大力支持"}),Oe("div",{children:"㊙️ 虚拟机的说明请见仓库首页的文档"}),Oe("div",{children:"⚙️ 仓库中的CLI版本可用于自动化测试"})]}),kn("p",{className:"info",children:[Oe("a",{href:"https://ernestthepoet.github.io/ir-virtual-machine/",children:"Github Pages镜像"}),"·",Oe("a",{href:"https://ecui.gitee.io/ir-virtual-machine/",children:"Gitee Pages镜像"}),"·",Oe("a",{href:"https://irvm.netlify.app/",children:"Netlify镜像"})]}),kn("p",{className:"info",children:[Oe("a",{href:"https://github.com/ErnestThePoet/ir-virtual-machine",children:"Github仓库"}),"·",Oe("a",{href:"https://gitee.com/ecui/ir-virtual-machine",children:"Gitee仓库"}),"·",Oe("a",{href:"mailto: ecuiships@126.com",children:"ecuiships@126.com"})]})]})}),Oe(IK,{open:l,title:kn("span",{children:[e.formatMessage({id:"DEMOS"}),kn("a",{className:h1.aDemoSources,href:"https://github.com/ErnestThePoet/ir-virtual-machine/tree/master/public/demos",children:["(",e.formatMessage({id:"DEMO_SOURCES"}),")"]})]}),centered:!0,closable:!0,onCancel:()=>c(!1),footer:!0,children:Oe(vQ,{className:h1.menuDemos,mode:"inline",selectable:!1,items:u})})]})},zkt="_navTabBarWrapper_nfao3_1",Ukt={navTabBarWrapper:zkt},jkt="_divTabBarItemWrapperBase_11raq_1",Kkt="_divTabBarItemWrapperActive_11raq_1",Gkt="_divTabBarItemWrapperInactive_11raq_1",qkt="_divIconTitleWrapper_11raq_23",Xkt="_divCloseWrapper_11raq_28",Ykt="_divCloseWrapperChanged_11raq_28",Zkt="_iconVm_11raq_53",Qkt="_iconClose_11raq_60",Jkt="_lblTitle_11raq_65",eTt="_iconDot_11raq_71",tTt="_inVmRename_11raq_78",jh={divTabBarItemWrapperBase:jkt,divTabBarItemWrapperActive:Kkt,divTabBarItemWrapperInactive:Gkt,divIconTitleWrapper:qkt,divCloseWrapper:Xkt,divCloseWrapperChanged:Ykt,iconVm:Zkt,iconClose:Qkt,lblTitle:Jkt,iconDot:eTt,inVmRename:tTt},nTt=i=>kn("svg",{...i,version:"1.1",id:"layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 50 50",enableBackground:"new 0 0 50 50",children:[kn("g",{children:[Oe("path",{d:"M14.16,36.09L7.2,13.91h2.06l6.27,20.5h0.19l6.27-20.5h2.06l-6.95,22.19H14.16z"}),Oe("path",{d:`M27.25,36.09V13.91h1.94v22.19H27.25z M33.31,26.2l-3.89-10.06h-0.55v-2.23h1.55l3.89,10.17h0.08l0.23,2.13H33.31z\r M34.06,26.2l0.3-2.13h0.08l3.89-10.17h1.73v2.23h-0.73L35.44,26.2H34.06z M39.56,36.09V13.91h1.94v22.19H39.56z`})]}),Oe("g",{children:Oe("path",{fill:"none",strokeWidth:"2",strokeMiterlimit:"10",d:`M1.5,36.5c0,3.87,3.13,7,7,7h33c3.87,0,7-3.13,7-7\r v-22c0-3.87-3.13-7-7-7h-33c-3.87,0-7,3.13-7,7V36.5z`})}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{})]}),iTt=i=>kn("svg",{...i,version:"1.1",id:"layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 50 50",enableBackground:"new 0 0 50 50",children:[Oe("circle",{cx:"25",cy:"25",r:"25"}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{}),Oe("g",{})]}),rTt=i=>{const e=Cc(),[t,n]=C.useState(!1),[r,o]=C.useState(i.title);return C.useEffect(()=>{if(t){const s=document.getElementById("inVmRename");s!==null&&(s.focus(),s.select())}},[t]),kn("div",{className:xe({[jh.divTabBarItemWrapperActive]:i.isActive,[jh.divTabBarItemWrapperInactive]:!i.isActive}),onClick:s=>{s.stopPropagation(),i.onClick()},title:i.title,onDoubleClick:()=>{o(i.title),n(!0)},children:[kn("div",{className:jh.divIconTitleWrapper,children:[Oe(nTt,{className:jh.iconVm}),t?Oe("input",{id:"inVmRename",className:jh.inVmRename,value:r,onChange:s=>o(s.currentTarget.value),onKeyDown:s=>{s.key==="Enter"&&(i.onRename(r),n(!1))},onBlur:()=>{i.onRename(r),n(!1)}}):Oe("label",{className:jh.lblTitle,children:Ikt(i.title)})]}),kn("div",{className:xe({[jh.divCloseWrapperChanged]:i.isChanged,[jh.divCloseWrapper]:!i.isChanged}),title:e.formatMessage({id:"CLOSE"}),onClick:s=>{s.stopPropagation(),i.onCloseClick()},children:[i.isChanged&&Oe(iTt,{className:jh.iconDot}),Oe(CT,{className:jh.iconClose})]})]})},oTt=()=>{var l;const i=Cc(),e=Gr(c=>c.vm),t=yS(),[n,r]=C.useState(!1),[o,s]=C.useState(0),a=c=>{t(dkt(c)),v_.at(c).close(),v_.delete(c)};return kn("nav",{className:Ukt.navTabBarWrapper,children:[e.vmPageStates.map((c,u)=>Oe(rTt,{title:c.name,isActive:u===e.activeVmIndex,isChanged:c.isIrChanged,onClick:()=>t(ckt(u)),onCloseClick:()=>{if(!c.isIrChanged){a(u);return}s(u),r(!0)},onRename:d=>{d!==""&&t(ukt({index:u,newName:d}))}},c.id)),Oe(IK,{open:n,title:i.formatMessage({id:"CONFIRM_UNSAVED_CLOSE"},{name:(l=e.vmPageStates[o])==null?void 0:l.name}),onCancel:()=>r(!1),footer:[Oe(Ju,{onClick:()=>r(!1),children:i.formatMessage({id:"CANCEL"})}),Oe(Ju,{danger:!0,onClick:()=>{a(o),r(!1)},children:i.formatMessage({id:"UNSAVE_CLOSE"})}),Oe(Ju,{type:"primary",onClick:()=>{WEe(e.vmPageStates[e.activeVmIndex].name,e.vmPageStates[e.activeVmIndex].irString),a(o),r(!1)},children:i.formatMessage({id:"SAVE_CLOSE"})})]})]})},sTt="_divEmptyHolder_3r6f3_11",aTt="_imgLogo_3r6f3_25",lTt="_divEmptyHolderText_3r6f3_30",cTt="_spanDesc_3r6f3_39",uTt="_divEmptyHolderHintsWrapper_3r6f3_45",fL={divEmptyHolder:sTt,"empty-holder-in":"_empty-holder-in_3r6f3_1",imgLogo:aTt,divEmptyHolderText:lTt,spanDesc:cTt,divEmptyHolderHintsWrapper:uTt};function dTt(){const i=navigator.userAgent.toLowerCase();return i.includes("android")||i.includes("harmony")||i.includes("iphone")||i.includes("ipad")||i.includes("mobile")}const hTt=()=>{const i=Cc();return kn("div",{className:fL.divEmptyHolder,children:[Oe("img",{className:fL.imgLogo,src:"logo.svg",alt:"IR Virtual Machine"}),kn("div",{className:fL.divEmptyHolderText,children:[Oe("span",{className:fL.spanDesc,children:i.formatMessage({id:"EMPTY_PLACEHOLDER_DESC"})}),kn("div",{className:fL.divEmptyHolderHintsWrapper,children:[Oe("span",{className:"hint-title",children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_TITLE"})}),Oe("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_1"})}),!dTt()&&Oe("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_2"})}),Oe("span",{children:i.formatMessage({id:"EMPTY_PLACEHOLDER_HINT_3"})})]})]})]})};const fTt="_divMonacoEditorWrapper_1a3zn_1",gTt={divMonacoEditorWrapper:fTt};let Xde=!1;const gL="ir";function pTt(i){if(Xde)return;i.languages.register({id:gL}),i.editor.defineTheme("ir-theme",{base:"vs",inherit:!0,rules:[{token:"function",foreground:"#74531f"},{token:"number.size",foreground:"#0097ff"}],colors:{}});const e="[ \\t\\r\\n]+";i.languages.setMonarchTokensProvider(gL,{keywords:rA,identifier:Vd,whitespace:e,defaultToken:"source",tokenizer:{root:[[`#${jK}`,"number"],[AEe,"number.size"],[/(:=)|(\+)|(-)|(\*)|(\/)|(==)|(!=)|(<=)|(<)|(>=)|(>)|(&)/,"operators"],[/:/,"delimiter"],[/;.*/,"comment"],[/@whitespace/,"white"],[/(FUNCTION)(@whitespace)(@identifier)/,["keyword","white","function"]],[/(CALL)(@whitespace)(@identifier)/,["keyword","white","function"]],[/@identifier/,{cases:{"@keywords":"keyword","@default":"identifier"}}]]}});const t=["FUNCTION ${1:id} :","DEC ${1:id} ${2:size}","GLOBAL_DEC ${1:id} ${2:size}","LABEL ${1:id} :","GOTO ${1:label}","IF ${1:condition} GOTO ${2:label}","ARG ${1:value}","PARAM ${1:id}","CALL ${1:id}","RETURN ${1:value}","READ ${1:id}","WRITE ${1:value}"];i.languages.registerCompletionItemProvider(gL,{provideCompletionItems:(n,r)=>{const o=n.getWordUntilPosition(r),s={startLineNumber:r.lineNumber,endLineNumber:r.lineNumber,startColumn:o.startColumn,endColumn:o.endColumn};return{suggestions:[...rA.map(a=>({label:a,kind:i.languages.CompletionItemKind.Keyword,insertText:a,range:s})),...rA.map((a,l)=>({label:`${a} Snippet`,kind:i.languages.CompletionItemKind.Snippet,insertText:t[l],insertTextRules:i.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:s}))]}}}),i.languages.registerFoldingRangeProvider(gL,{provideFoldingRanges:n=>{const r=n.getLinesContent(),o=[];let s=-1,a=-1,l=-1;for(let c=0;c{const e=Cc(),t=Gr(v=>v.vm.vmPageStates[i].staticErrors),n=Gr(v=>v.vm.vmPageStates[i].runtimeErrors),r=Gr(v=>v.vm.vmPageStates[i].currentLineNumber),o=Gr(v=>v.vm.vmPageStates[i].shouldIndicateCurrentLineNumber),s=Gr(v=>v.vm.vmPageStates[i].irString),a=C.useRef(null),l=C.useRef(null),c=C.useRef(null),u=C.useRef(null),d=C.useRef(null),h=yS(),f=v_.at(i),g=()=>{a.current!==null&&l.current!==null&&l.current.getModel()!==null&&a.current.editor.setModelMarkers(l.current.getModel(),"IR Decoder",t.map(v=>({startLineNumber:v.startLineNumber,endLineNumber:v.endLineNumber,startColumn:v.startColumn,endColumn:v.endColumn+1,message:e.formatMessage({id:v.message.key},v.message.values),severity:a.current.MarkerSeverity.Error})))};C.useEffect(g,[t,e.messages]),C.useEffect(()=>{c.current!==null&&c.current.clear(),a.current!==null&&l.current!==null&&l.current.getModel()!==null&&(n.length>0&&l.current.revealLineInCenterIfOutsideViewport(r),c.current=l.current.createDecorationsCollection(n.map(v=>({range:new a.current.Range(v.startLineNumber,v.startColumn,v.endLineNumber,v.endColumn),options:{isWholeLine:!0,className:"rangeError",marginClassName:"rangeError",hoverMessage:{value:e.formatMessage({id:v.message.key},v.message.values)}}}))))},[n,e.messages]),C.useEffect(()=>{u.current!==null&&u.current.clear(),!(!o||f.instructions[r-1]===void 0)&&a.current!==null&&l.current!==null&&(l.current.revealLineInCenterIfOutsideViewport(r),u.current=l.current.createDecorationsCollection([{range:new a.current.Range(r,1,r,f.instructions[r-1].length+1),options:{isWholeLine:!0,className:"rangeCurrentLine",marginClassName:"rangeCurrentLine"}}]))},[r,o]);const p=v=>{if(v===void 0)return;const m=new Date().getTime();(d.current===null||d.current.time{f.decodeInstructions(!0),h(cp())},Lde)}),f.loadNewInstructions(OEe(v)),h(vkt(v)),h(cp())};return Oe("div",{className:gTt.divMonacoEditorWrapper,children:Oe(T4e,{language:"ir",theme:"ir-theme",beforeMount:v=>{a.current=v,pTt(v)},onMount:v=>{l.current=v,v.setValue(s),g()},onChange:v=>p(v),options:{scrollbar:{verticalScrollbarSize:13,horizontalScrollbarSize:13},minimap:{enabled:!1}}})})},vTt="_divVmConsoleWrapper_107q9_1",_Tt="_divVmConsole_107q9_1",bTt="_divVmConsoleBoxShadow_107q9_42",CTt="_divConsoleBlankArea_107q9_46",z2={divVmConsoleWrapper:vTt,divVmConsole:_Tt,divVmConsoleBoxShadow:bTt,divConsoleBlankArea:CTt},yTt="_divInputBlockWrapper_a2tx0_1",wTt="_spanArrow_a2tx0_7",STt="_spanPrompt_a2tx0_11",U2={divInputBlockWrapper:yTt,spanArrow:wTt,spanPrompt:STt,in:"_in_a2tx0_16"},xTt=i=>{const e=Cc();return kn("div",{className:U2.divInputBlockWrapper,children:[Oe("span",{className:U2.spanArrow,children:e.formatMessage({id:"CONSOLE_ARROW"})}),Oe("span",{className:U2.spanPrompt,children:i.prompt.reduce((t,n)=>t+e.formatMessage({id:n.key},n.values),"")}),Oe("input",{ref:i.inputRef,className:U2.in,spellCheck:!1,value:i.value,onChange:t=>i.onChange(t.currentTarget.value),onKeyDown:t=>{t.key==="Enter"&&i.onEnter()}})]})},LTt="_divControlPanelWrapper_x2oa8_1",ETt="_divSide_x2oa8_11",DTt="_iconRun_x2oa8_17",ITt="_iconStep_x2oa8_21",kTt="_iconReset_x2oa8_25",TTt="_iconClear_x2oa8_29",E1={divControlPanelWrapper:LTt,divSide:ETt,iconRun:DTt,iconStep:ITt,iconReset:kTt,iconClear:TTt},NTt="_divIconWrapper_shrpr_1",RTt={divIconWrapper:NTt},j2=i=>kn("div",{className:xe(RTt.divIconWrapper,i.className),title:i.keyTooltip!==void 0?`${i.label} (${i.keyTooltip})`:i.label,onClick:e=>{e.stopPropagation(),i.onClick()},children:[i.icon,i.label!==void 0&&Oe("label",{children:i.label})]}),MTt=i=>{const e=Cc();return Oe("div",{className:E1.divControlPanelWrapper,children:kn("div",{className:E1.divSide,children:[Oe(j2,{className:E1.iconRun,icon:Oe(rft,{}),label:e.formatMessage({id:"RUN"}),keyTooltip:"F2",onClick:i.onRunClick}),Oe(j2,{className:E1.iconStep,icon:Oe(mht,{}),label:e.formatMessage({id:"RUN_STEP"}),keyTooltip:"F8",onClick:i.onRunStepClick}),Oe(j2,{className:E1.iconReset,icon:Oe(xft,{}),label:e.formatMessage({id:"RESET"}),keyTooltip:"F9",onClick:i.onResetClick}),Oe(j2,{className:E1.iconClear,icon:Oe(Fft,{}),label:e.formatMessage({id:"CLEAR_CONSOLE"}),keyTooltip:"F10",onClick:i.onClearClick})]})})},ATt="_divOutputBlocksWrapper_1nyc0_1",PTt="_divOutputBlockWrapper_1nyc0_6",OTt="_spanError_1nyc0_14",FTt="_spanWarning_1nyc0_18",BTt="_spanSuccess_1nyc0_22",WTt="_spanInput_1nyc0_26",$Tt="_spanOutput_1nyc0_30",HTt="_spanPrompt_1nyc0_34",VTt="_spanArrow_1nyc0_38",Sg={divOutputBlocksWrapper:ATt,divOutputBlockWrapper:PTt,spanError:OTt,spanWarning:FTt,spanSuccess:BTt,spanInput:WTt,spanOutput:$Tt,spanPrompt:HTt,spanArrow:VTt},zTt=C.memo(({messages:i})=>{const e=Cc();return Oe("div",{className:Sg.divOutputBlocksWrapper,children:i.map((t,n)=>Oe("div",{className:Sg.divOutputBlockWrapper,children:t.map((r,o)=>{const s=e.formatMessage({id:r.key},r.values);return Oe("span",{className:xe({[Sg.spanError]:r.type===Ql.ERROR,[Sg.spanWarning]:r.type===Ql.WARNING,[Sg.spanSuccess]:r.type===Ql.SUCCESS,[Sg.spanInput]:r.type===Ql.INPUT,[Sg.spanOutput]:r.type===Ql.OUTPUT,[Sg.spanPrompt]:r.type===Ql.PROMPT,[Sg.spanArrow]:r.type===Ql.ARROW}),children:s},o)})},n))})}),UTt=({vmIndex:i})=>{const e=yS(),[t,n]=C.useState(!1),r=Gr(_=>_.vm.vmPageStates[i].consoleInput),o=Gr(_=>_.vm.vmPageStates[i].consoleInputPrompt),s=Gr(_=>_.vm.vmPageStates[i].consoleOutputs),a=C.useRef(null),l=C.useRef({buffer:[],nextInputIndex:0}),c=()=>{l.current.buffer=[],l.current.nextInputIndex=0},u=C.useRef(null),d=C.useRef(null),h=C.useRef(!1),f=v_.at(i);C.useEffect(()=>(f.setReadConsoleFn(_=>{var y;return h.current||e(H2(!0)),e(cp()),(y=d.current)==null||y.focus(),l.current.nextInputIndex({...S,type:Ql.PROMPT})),{key:"READ_INPUT",values:{value:r},type:Ql.INPUT}]])),Promise.resolve(l.current.buffer[l.current.nextInputIndex++])):(e(fkt(_)),new Promise(S=>{a.current=S}))}),()=>{a.current!==null&&(a.current(""),a.current=null)}),[]),C.useEffect(()=>{var _;(_=u.current)==null||_.scrollTo(0,u.current.scrollHeight)},[r,o,s]);const g=async()=>{var _;if(!f.canContinueExecution){f.state===Gi.WAIT_INPUT&&((_=d.current)==null||_.focus());return}h.current=!0,e(H2(!1)),await f.executeContinuously(),f.state!==Gi.CLOSED&&(c(),e(cp()))},p=async()=>{var _;if(!f.canContinueExecution){f.state===Gi.WAIT_INPUT&&((_=d.current)==null||_.focus());return}switch(h.current=!1,await f.executeSingleStep(),f.state){case Gi.FREE:e(H2(!0));break;case Gi.EXITED_NORMALLY:case Gi.EXITED_ABNORMALLY:c(),e(H2(!1));break;case Gi.CLOSED:return}e(cp())},v=()=>{e(mkt()),f.reset(),f.decodeInstructions(!0),a.current!==null&&(a.current(""),a.current=null),c(),e(cp())},m=()=>{var _;e(bkt()),f.state===Gi.WAIT_INPUT&&((_=d.current)==null||_.focus())};return kn("div",{className:z2.divVmConsoleWrapper,tabIndex:0,onKeyDown:_=>{if(!(_.key!=="F2"&&_.key!=="F8"&&_.key!=="F9"&&_.key!=="F10"))switch(_.preventDefault(),_.key){case"F2":g();break;case"F8":p();break;case"F9":v();break;case"F10":m();break}},children:[Oe(MTt,{onRunClick:g,onRunStepClick:p,onResetClick:v,onClearClick:m}),kn("div",{ref:u,className:xe(z2.divVmConsole,t&&z2.divVmConsoleBoxShadow),onScroll:_=>{_.currentTarget.scrollTop>0&&!t?n(!0):_.currentTarget.scrollTop<=0&&t&&n(!1)},children:[Oe(zTt,{messages:s}),Oe(xTt,{inputRef:d,prompt:o,value:r,onChange:_=>e(gkt(_)),onEnter:()=>{if(f.state===Gi.WAIT_INPUT||f.state===Gi.BUSY||f.state===Gi.FREE){const _=Tkt(r);l.current.buffer.push(..._),a.current!==null&&l.current.nextInputIndex({..._,type:Ql.PROMPT})),{key:"READ_INPUT",values:{value:r},type:Ql.INPUT}]])),e(_kt())}}),Oe("div",{className:z2.divConsoleBlankArea,onClick:()=>{var _;return(_=d.current)==null?void 0:_.focus()}})]})]})},jTt="_divVmInspectorWrapper_1lk9c_1",KTt="_divVmInspectorWrapperBoxShadow_1lk9c_34",GTt="_divStepStateCard_1lk9c_38",qTt="_divStepStateWrapper_1lk9c_49",XTt="_lblStepStateLabel_1lk9c_55",YTt="_divStepCount_1lk9c_62",ZTt="_divStateBase_1lk9c_68",QTt="_divStateExitedAbnormally_1lk9c_68",JTt="_divStateExitedNormally_1lk9c_68",eNt="_divStateMaxStepReached_1lk9c_68",tNt="_divStateRuntimeError_1lk9c_68",nNt="_divStateStaticCheckFailed_1lk9c_68",iNt="_divStateFree_1lk9c_68",rNt="_divStateWaitInput_1lk9c_68",oNt="_divStateBusy_1lk9c_68",sNt="_divStateInitial_1lk9c_68",aNt="_divOptionsCard_1lk9c_109",lNt="_divOptionWrapper_1lk9c_121",cNt="_lblOption_1lk9c_128",uNt="_iconOptionInfo_1lk9c_133",dNt="_inOptionValue_1lk9c_143",hNt="_divMemoryUsageCard_1lk9c_147",fNt="_divGlobalVariableTableCard_1lk9c_162",gNt="_divLocalVariableTableCard_1lk9c_178",pNt="_divLocalVariableTableWrapper_1lk9c_198",mNt="_divLocalVariableTable_1lk9c_178",vNt="_paginationLocalVariableTable_1lk9c_225",Wi={divVmInspectorWrapper:jTt,divVmInspectorWrapperBoxShadow:KTt,divStepStateCard:GTt,divStepStateWrapper:qTt,lblStepStateLabel:XTt,divStepCount:YTt,divStateBase:ZTt,divStateExitedAbnormally:QTt,divStateExitedNormally:JTt,divStateMaxStepReached:eNt,divStateRuntimeError:tNt,divStateStaticCheckFailed:nNt,divStateFree:iNt,divStateWaitInput:rNt,divStateBusy:oNt,divStateInitial:sNt,divOptionsCard:aNt,divOptionWrapper:lNt,lblOption:cNt,iconOptionInfo:uNt,inOptionValue:dNt,divMemoryUsageCard:hNt,divGlobalVariableTableCard:fNt,divLocalVariableTableCard:gNt,divLocalVariableTableWrapper:pNt,divLocalVariableTable:mNt,paginationLocalVariableTable:vNt},_Nt="_divMemoryUsageWrapper_1rsex_1",bNt="_divUsageBlock_1rsex_7",CNt="_progress_1rsex_25",pL={divMemoryUsageWrapper:_Nt,divUsageBlock:bNt,progress:CNt},G7=i=>{const e=Cc(),t=Rkt(i.usedBytes,i.totalBytes),n=Nkt(i.peakBytes);return kn("div",{className:pL.divMemoryUsageWrapper,children:[kn("div",{className:pL.divUsageBlock,children:[Oe(rde,{className:pL.progress,percent:i.usedBytes/i.totalBytes*100,showInfo:!1,status:"normal"}),kn("div",{children:[Oe("label",{children:i.title}),Oe("label",{className:"percentageUsage",children:i.totalBytes===0?"-.-":e.formatMessage({id:"PERCENTAGE_USAGE"},{percentage:i.usedBytes/i.totalBytes*100})})]}),Oe("span",{children:t.unit==="B"?e.formatMessage({id:"BYTE_USAGE"},{used:t.used,total:t.total}):e.formatMessage({id:"ARBITRARY_UNIT_MEMORY_USAGE"},{...t})})]}),kn("div",{className:pL.divUsageBlock,children:[Oe(rde,{className:pL.progress,percent:i.peakBytes/i.totalBytes*100,showInfo:!1,status:"exception"}),kn("div",{children:[Oe("label",{children:e.formatMessage({id:"PEAK_MEMORY_USAGE"})}),Oe("label",{className:"percentageUsage",children:i.totalBytes===0?"-.-":e.formatMessage({id:"PERCENTAGE_USAGE"},{percentage:i.peakBytes/i.totalBytes*100})})]}),Oe("span",{children:n.unit==="B"?e.formatMessage({id:"BYTE_SIZE"},{size:n.size}):e.formatMessage({id:"ARBITRARY_UNIT_SIZE"},{...n})})]})]})},yNt="_divVariableTableWrapper_1pgdz_1",wNt="_divValues_1pgdz_10",Yde={divVariableTableWrapper:yNt,divValues:wNt},Zde=C.memo(i=>{const e=Cc(),t=[{title:e.formatMessage({id:"VARIABLE_ID"}),dataIndex:"id",showSorterTooltip:!1,sorter:(n,r)=>Mkt(n.id,r.id)},{title:e.formatMessage({id:"ADDRESS"}),dataIndex:"address",showSorterTooltip:!1,sorter:(n,r)=>n.address-r.address},{title:e.formatMessage({id:"SIZE"}),dataIndex:"size",showSorterTooltip:!1,sorter:(n,r)=>n.size-r.size},{title:e.formatMessage({id:"VALUES"}),dataIndex:"values",render:n=>Oe("div",{className:Yde.divValues,children:n.map((r,o)=>Oe("div",{children:n.length===1?r:kn(oMe,{children:["[",o,"]: ",r]})},`${o}${r}`))})}];return Oe("div",{className:Yde.divVariableTableWrapper,children:i.variables.length===0?Oe("div",{className:"emptyHolder",children:e.formatMessage({id:"EMPTY_VATIABLE_TABLE"})}):Oe(gIt,{rowKey:"id",columns:t,dataSource:i.variables,size:"small",pagination:{defaultPageSize:20,pageSizeOptions:[10,20,30,50,100],showSizeChanger:!0,hideOnSinglePage:!0,size:"small"}})})});function SNt(i){switch(i){case Gi.BUSY:return"STATE_BUSY";case Gi.EXITED_ABNORMALLY:return"STATE_EXITED_ABNORMALLY";case Gi.EXITED_NORMALLY:return"STATE_EXITED_NORMALLY";case Gi.FREE:return"STATE_FREE";case Gi.INITIAL:return"STATE_INITIAL";case Gi.MAX_STEP_REACHED:return"STATE_MAX_STEP_REACHED";case Gi.RUNTIME_ERROR:return"STATE_RUNTIME_ERROR";case Gi.STATIC_CHECK_FAILED:return"STATE_STATIC_CHECK_FAILED";case Gi.WAIT_INPUT:return"STATE_WAIT_INPUT"}}const xNt=({vmIndex:i})=>{const e=Cc(),t=yS(),n=Gr(p=>p.vm.vmPageStates[i].state),r=Gr(p=>p.vm.vmPageStates[i].stepCount),o=Gr(p=>p.vm.vmPageStates[i].options),s=Gr(p=>p.vm.vmPageStates[i].memoryUsage),a=Gr(p=>p.vm.vmPageStates[i].peakMemoryUsage),l=Gr(p=>p.vm.vmPageStates[i].globalVariableDetails),c=Gr(p=>p.vm.vmPageStates[i].localVariableDetailsStack),u=Gr(p=>p.vm.vmPageStates[i].localVariableTablesPagination),[d,h]=C.useState(!1),f=C.useRef(null),g=v_.at(i);return kn("div",{ref:f,className:xe(Wi.divVmInspectorWrapper,d&&Wi.divVmInspectorWrapperBoxShadow),onScroll:p=>{p.currentTarget.scrollTop>0&&!d?h(!0):p.currentTarget.scrollTop<=0&&d&&h(!1)},children:[kn("div",{className:Wi.divStepStateCard,children:[kn("div",{className:Wi.divStepStateWrapper,children:[Oe("label",{className:Wi.lblStepStateLabel,children:e.formatMessage({id:"STEP_COUNT"})}),Oe("div",{className:Wi.divStepCount,children:e.formatMessage({id:"STEP_COUNT_NUMBER"},{stepCount:r})})]}),kn("div",{className:Wi.divStepStateWrapper,children:[Oe("label",{className:Wi.lblStepStateLabel,children:e.formatMessage({id:"STATE"})}),Oe("div",{className:xe({[Wi.divStateInitial]:n===Gi.INITIAL,[Wi.divStateBusy]:n===Gi.BUSY,[Wi.divStateWaitInput]:n===Gi.WAIT_INPUT,[Wi.divStateFree]:n===Gi.FREE,[Wi.divStateStaticCheckFailed]:n===Gi.STATIC_CHECK_FAILED,[Wi.divStateRuntimeError]:n===Gi.RUNTIME_ERROR,[Wi.divStateMaxStepReached]:n===Gi.MAX_STEP_REACHED,[Wi.divStateExitedNormally]:n===Gi.EXITED_NORMALLY,[Wi.divStateExitedAbnormally]:n===Gi.EXITED_ABNORMALLY}),children:e.formatMessage({id:SNt(n)})})]})]}),kn("div",{className:Wi.divOptionsCard,children:[kn("div",{className:Wi.divOptionWrapper,children:[kn("label",{className:Wi.lblOption,children:[e.formatMessage({id:"MAX_EXECUTION_STEP_COUNT"}),Oe(NT,{title:e.formatMessage({id:"SET_0_MEANS_NO_STEP_LIMIT"}),children:Oe(dwe,{className:Wi.iconOptionInfo})})]}),Oe(O7,{className:Wi.inOptionValue,disabled:n!==Gi.INITIAL,min:zd.maxExecutionStepCount.min,max:zd.maxExecutionStepCount.max,value:o.maxExecutionStepCount,onChange:p=>{g.configure({maxExecutionStepCount:p??void 0}),t(cp())}})]}),kn("div",{className:Wi.divOptionWrapper,children:[Oe("label",{className:Wi.lblOption,children:e.formatMessage({id:"MEMORY_SIZE"})}),Oe(O7,{className:Wi.inOptionValue,disabled:n!==Gi.INITIAL,min:zd.memorySize.min,max:zd.memorySize.max,value:o.memorySize,onChange:p=>{g.configure({memorySize:p??void 0}),t(cp())}})]}),kn("div",{className:Wi.divOptionWrapper,children:[Oe("label",{className:Wi.lblOption,children:e.formatMessage({id:"STACK_SIZE"})}),Oe(O7,{className:Wi.inOptionValue,disabled:n!==Gi.INITIAL,min:zd.stackSize.min,max:zd.stackSize.max,value:o.stackSize,onChange:p=>{g.configure({stackSize:p??void 0}),t(cp())}})]})]}),kn("div",{className:Wi.divMemoryUsageCard,children:[Oe(G7,{title:e.formatMessage({id:"TOTAL_MEMORY_USAGE"}),usedBytes:s.used,totalBytes:s.total,peakBytes:a.total}),Oe(G7,{title:e.formatMessage({id:"STACK_MEMORY_USAGE"}),usedBytes:s.stackUsed,totalBytes:s.stackTotal,peakBytes:a.stack}),Oe(G7,{title:e.formatMessage({id:"GLOBAL_VARIABLE_MEMORY_USAGE"}),usedBytes:s.globalVariableUsed,totalBytes:s.globalVariableTotal,peakBytes:a.globalVariable})]}),kn("div",{className:Wi.divGlobalVariableTableCard,children:[Oe("label",{className:"title",children:e.formatMessage({id:"GLOBAL_VARIABLE_TABLE"})}),Oe(Zde,{variables:l})]}),kn("div",{className:Wi.divLocalVariableTableCard,children:[Oe("label",{className:"title",children:e.formatMessage({id:"LOCAL_VARIABLE_TABLE"})}),c.length===0?Oe("div",{className:"emptyHolder",children:e.formatMessage({id:"EMPTY_VATIABLE_TABLE"})}):kn("div",{className:Wi.divLocalVariableTableWrapper,children:[c.slice(u.size*(u.currentIndex-1),u.size*u.currentIndex).map(p=>kn("div",{className:Wi.divLocalVariableTable,children:[kn("div",{className:"titleWrapper",children:[Oe("label",{className:"functionName",children:p.functionName}),kn("label",{className:"callStackDepth",children:["(",e.formatMessage({id:"CALL_STACK_DEPTH"},{depth:p.stackDepth}),")"]})]}),Oe(Zde,{variables:p.details})]},`${p.functionName}${p.stackDepth}`)),Oe(kQ,{className:Wi.paginationLocalVariableTable,onChange:(p,v)=>t(pkt({currentIndex:p,size:v})),total:c.length,defaultCurrent:1,defaultPageSize:FQ,pageSizeOptions:[10,20,30,50,100],showSizeChanger:!0,hideOnSinglePage:!0,size:"small"})]})]})]})},LNt=()=>{const i=Cc(),e=yS(),t=Gr(l=>l.vm.vmPageStates.length),n=Gr(l=>l.vm.activeVmIndex),r=Gr(l=>l.vm.vmPageStates.map(c=>c.id),(l,c)=>l.length===c.length&&l.every((u,d)=>u===c[d])),o=Gr(l=>l.vm.vmPageStates.every(c=>!c.isIrChanged)),[s,a]=C.useState(window.innerWidth{window.onresize=()=>a(window.innerWidth{window.onbeforeunload=o?null:l=>(l.preventDefault(),l.returnValue="Your unsaved changes will be lost. Sure to leave?")},[o]),kn("main",{className:oL.main,onDragEnter:l=>l.preventDefault(),onDragOver:l=>l.preventDefault(),onDrop:l=>{for(const c of l.dataTransfer.files)HEe(e,i,c);l.preventDefault()},children:[Oe(Vkt,{vmIndex:n}),kn("div",{className:oL.divRight,children:[Oe(oTt,{}),Oe("div",{className:oL.divVmWrapper,children:t===0?Oe(hTt,{}):new Array(t).fill(null).map((l,c)=>kn("div",{className:xe({[oL.divVmContentHorizontal]:!s,[oL.divVmContentVertical]:s}),style:{display:c===n?"flex":"none"},children:[Oe("section",{className:"sectionIrEditor",children:Oe(mTt,{vmIndex:c})}),Oe("section",{className:"sectionVmConsole",children:Oe(UTt,{vmIndex:c})}),Oe("section",{className:"sectionVmInspector",children:Oe(xNt,{vmIndex:c})})]},r[c]))})]})]})};self.MonacoEnvironment={getWorker(i,e){return e==="json"?new adt:e==="css"||e==="scss"||e==="less"?new ldt:e==="html"||e==="handlebars"||e==="razor"?new cdt:e==="typescript"||e==="javascript"?new udt:new sdt}};n4.config({monaco:odt});n4.init();const ENt=()=>{const i=Gr(t=>t.locale.currentLocale),e=Gr(t=>t.theme.currentClassName);return C.useEffect(()=>{document.body.className=e},[e]),Oe(LFe,{messages:i,locale:"en",children:Oe(LNt,{})})},DNt=GIt({reducer:{locale:Bkt,theme:Hkt,vm:Ckt}});var GK={},INt={get exports(){return GK},set exports(i){GK=i}},nB={},vk={},kNt={get exports(){return vk},set exports(i){vk=i}};(function(i){function e(t){return t&&t.__esModule?t:{default:t}}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports})(kNt);var iB={};Object.defineProperty(iB,"__esModule",{value:!0});iB.default=void 0;var TNt={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"};iB.default=TNt;var rB={},$T={},oB={};Object.defineProperty(oB,"__esModule",{value:!0});oB.default=void 0;var NNt={locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",yearFormat:"YYYY年",dayFormat:"D日",dateFormat:"YYYY年M月D日",dateTimeFormat:"YYYY年M月D日 HH时mm分ss秒",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"},RNt=NNt;oB.default=RNt;var HT={};Object.defineProperty(HT,"__esModule",{value:!0});HT.default=void 0;const MNt={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]};var ANt=MNt;HT.default=ANt;var VEe=vk.default;Object.defineProperty($T,"__esModule",{value:!0});$T.default=void 0;var PNt=VEe(oB),ONt=VEe(HT);const zEe={lang:Object.assign({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},PNt.default),timePickerLocale:Object.assign({},ONt.default)};zEe.lang.ok="确定";var FNt=zEe;$T.default=FNt;var BNt=vk.default;Object.defineProperty(rB,"__esModule",{value:!0});rB.default=void 0;var WNt=BNt($T),$Nt=WNt.default;rB.default=$Nt;var sB=vk.default;Object.defineProperty(nB,"__esModule",{value:!0});nB.default=void 0;var HNt=sB(iB),VNt=sB(rB),zNt=sB($T),UNt=sB(HT);const Fc="${label}不是一个有效的${type}",jNt={locale:"zh-cn",Pagination:HNt.default,DatePicker:zNt.default,TimePicker:UNt.default,Calendar:VNt.default,global:{placeholder:"请选择"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckall:"全选",filterSearchPlaceholder:"在筛选项中搜索",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{titles:["",""],searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开"},PageHeader:{back:"返回"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:Fc,method:Fc,array:Fc,object:Fc,number:Fc,date:Fc,boolean:Fc,integer:Fc,float:Fc,regexp:Fc,email:Fc,url:Fc,hex:Fc},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},Image:{preview:"预览"},QRCode:{expired:"二维码过期",refresh:"点击刷新"}};var KNt=jNt;nB.default=KNt;(function(i){i.exports=nB})(INt);const GNt=qK(GK);q7.createRoot(document.getElementById("root")).render(Oe($e.StrictMode,{children:Oe(eOe,{store:DNt,children:Oe(LT,{locale:GNt,children:Oe(ENt,{})})})}));export{w3 as m,Pbe as t}; diff --git a/docs/assets/javascript-e355c851.js b/docs/assets/javascript-603c281f.js similarity index 89% rename from docs/assets/javascript-e355c851.js rename to docs/assets/javascript-603c281f.js index 19838e7..91fb23b 100644 --- a/docs/assets/javascript-e355c851.js +++ b/docs/assets/javascript-603c281f.js @@ -1,4 +1,4 @@ -import{conf as t,language as e}from"./typescript-0713de27.js";import"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{conf as t,language as e}from"./typescript-54992499.js";import"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/jsonMode-324adb46.js b/docs/assets/jsonMode-9dcc9a7c.js similarity index 99% rename from docs/assets/jsonMode-324adb46.js rename to docs/assets/jsonMode-9dcc9a7c.js index afdb0e9..06fb13e 100644 --- a/docs/assets/jsonMode-324adb46.js +++ b/docs/assets/jsonMode-9dcc9a7c.js @@ -1,4 +1,4 @@ -import{m as et}from"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{m as et}from"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/liquid-8ad1f6f1.js b/docs/assets/liquid-9f7a360d.js similarity index 98% rename from docs/assets/liquid-8ad1f6f1.js rename to docs/assets/liquid-9f7a360d.js index 963725d..2b7d7f6 100644 --- a/docs/assets/liquid-8ad1f6f1.js +++ b/docs/assets/liquid-9f7a360d.js @@ -1,4 +1,4 @@ -import{m as d}from"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/mdx-66407150.js b/docs/assets/mdx-da5b6492.js similarity index 98% rename from docs/assets/mdx-66407150.js rename to docs/assets/mdx-da5b6492.js index 269ea9b..c32622f 100644 --- a/docs/assets/mdx-66407150.js +++ b/docs/assets/mdx-da5b6492.js @@ -1,4 +1,4 @@ -import{m as d}from"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{m as d}from"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/python-675f20c3.js b/docs/assets/python-289fae18.js similarity index 98% rename from docs/assets/python-675f20c3.js rename to docs/assets/python-289fae18.js index 1ccf1b2..e802ed8 100644 --- a/docs/assets/python-675f20c3.js +++ b/docs/assets/python-289fae18.js @@ -1,4 +1,4 @@ -import{m as a}from"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{m as a}from"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/razor-6002a854.js b/docs/assets/razor-97daa2a2.js similarity index 99% rename from docs/assets/razor-6002a854.js rename to docs/assets/razor-97daa2a2.js index bc0f7d2..3d8d7de 100644 --- a/docs/assets/razor-6002a854.js +++ b/docs/assets/razor-97daa2a2.js @@ -1,4 +1,4 @@ -import{m as s}from"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{m as s}from"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/tsMode-93e6f265.js b/docs/assets/tsMode-59ab1782.js similarity index 99% rename from docs/assets/tsMode-93e6f265.js rename to docs/assets/tsMode-59ab1782.js index f847d56..a9ed2d4 100644 --- a/docs/assets/tsMode-93e6f265.js +++ b/docs/assets/tsMode-59ab1782.js @@ -1,4 +1,4 @@ -import{t as I,m as N}from"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{t as I,m as N}from"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/typescript-0713de27.js b/docs/assets/typescript-54992499.js similarity index 98% rename from docs/assets/typescript-0713de27.js rename to docs/assets/typescript-54992499.js index 26e6c57..78cc89a 100644 --- a/docs/assets/typescript-0713de27.js +++ b/docs/assets/typescript-54992499.js @@ -1,4 +1,4 @@ -import{m as a}from"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{m as a}from"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/xml-2867d133.js b/docs/assets/xml-12c779e0.js similarity index 97% rename from docs/assets/xml-2867d133.js rename to docs/assets/xml-12c779e0.js index 0d64511..415ffb5 100644 --- a/docs/assets/xml-2867d133.js +++ b/docs/assets/xml-12c779e0.js @@ -1,4 +1,4 @@ -import{m}from"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{m}from"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/assets/yaml-a4b03d68.js b/docs/assets/yaml-639752e1.js similarity index 98% rename from docs/assets/yaml-a4b03d68.js rename to docs/assets/yaml-639752e1.js index 976fb3b..789f2ae 100644 --- a/docs/assets/yaml-a4b03d68.js +++ b/docs/assets/yaml-639752e1.js @@ -1,4 +1,4 @@ -import{m as i}from"./index-0f719e36.js";/*!----------------------------------------------------------------------------- +import{m as i}from"./index-650b196f.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.47.0(69991d66135e4a1fc1cf0b1ac4ad25d429866a0d) * Released under the MIT license diff --git a/docs/index.html b/docs/index.html index 5532275..b80fa40 100644 --- a/docs/index.html +++ b/docs/index.html @@ -10,7 +10,7 @@ rel="stylesheet" /> IR虚拟机 - +