@guihz/trading-vue-editor-tes 0.1.33 → 0.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/{parserTccWorker-CNzNddjG.js → parserTccWorker-BvDdoR3P.js} +3888 -3894
- package/lib/assets/{scriptsRunWorker-CO6t0Tv4.js → scriptsRunWorker-8a33SSnQ.js} +3 -3
- package/lib/components/editor/utils/importLibrary.d.ts +1 -1
- package/lib/components/editor/utils/parserTccWorker.d.ts +2 -2
- package/lib/components/editor/v6/parseScript/visitorParser.d.ts +1 -1
- package/lib/components/editor/v6/parserTccWorker.d.ts +2 -2
- package/lib/trading-vue-editor.es.packages.js +7 -2
- package/lib/trading-vue-editor.umd.packages.mjs +2 -2
- package/package.json +1 -1
@@ -21273,7 +21273,7 @@ ${u}`), u;
|
|
21273
21273
|
}
|
21274
21274
|
}
|
21275
21275
|
function xs(n) {
|
21276
|
-
self?.workerStorage?.deleteStartwidthKey(n), self?.workerStorage?.delete(`inputs_${n}`), self?.workerStorage?.delete(`strategy_${n}`), self?.workerStorage?.delete(`request_${n}`), self?.workerStorage?.delete(`request_${n}_data`), self?.workerStorage?.delete(`request_${n}_list`);
|
21276
|
+
self?.workerStorage?.deleteStartwidthKey(n), self?.workerStorage?.delete(`request_${n}_tmp`), self?.workerStorage?.delete(`inputs_${n}`), self?.workerStorage?.delete(`strategy_${n}`), self?.workerStorage?.delete(`request_${n}`), self?.workerStorage?.delete(`request_${n}_data`), self?.workerStorage?.delete(`request_${n}_list`);
|
21277
21277
|
}
|
21278
21278
|
var W1 = /* @__PURE__ */ ((n) => (n.BOOL = "bool", n.INT = "int", n.FLOAT = "float", n.ARRAY = "array", n.BOX = "box", n.COLOR = "color", n.CONST = "const", n.LABEL = "label", n.LINE = "line", n.SERIES = "series", n.SIMPLE = "", n.STRING = "string", n.TABLE = "table", n.UNDETERMINED = "undetermined type", n.INPUT = "input", n.NA = "na", n.VOID = "void", n.symbol = "symbol", n))(W1 || {}), jn = /* @__PURE__ */ ((n) => (n.TYPE = "type", n.ARRAY = "array", n.BOX = "box", n.CHART_POINT = "chart.point", n.LABEL = "label", n.LINE = "line", n.LINEFILL = "linefill", n.MAP = "map", n.MATRIX = "matrix", n.POLYLINE = "polyline", n.TABLE = "table", n))(jn || {}), rc = /* @__PURE__ */ ((n) => (n.dividends = "dividends", n.none = "none", n.splits = "splits", n))(rc || {}), Bb = /* @__PURE__ */ ((n) => (n.gross = "gross", n.net = "net", n))(Bb || {}), Nr = /* @__PURE__ */ ((n) => (n.freqAll = "freq_all", n.freqOncePerBar = "freq_once_per_bar", n.freqOncePerBarClose = "freq_once_per_bar_close", n))(Nr || {}), fo = /* @__PURE__ */ ((n) => (n.all = "all", n.dataWindow = "data_window", n.none = "none", n.pane = "pane", n.priceScale = "price_scale", n.statusLine = "status_line", n))(fo || {}), Er = /* @__PURE__ */ ((n) => (n.both = "both", n.left = "left", n.none = "none", n.right = "right", n))(Er || {}), w1 = /* @__PURE__ */ ((n) => (n.inherit = "inherit", n.mintick = "mintick", n.percent = "percent", n.price = "price", n.volume = "volume", n))(w1 || {}), ic = /* @__PURE__ */ ((n) => (n.styleDashed = "style_dashed", n.styleDotted = "style_dotted", n.styleSolid = "style_solid", n))(ic || {}), oe = /* @__PURE__ */ ((n) => (n.styleArrowdown = "style_arrowdown", n.styleArrowup = "style_arrowup", n.styleCircle = "style_circle", n.styleCross = "style_cross", n.styleDiamond = "style_diamond", n.styleFlag = "style_flag", n.styleLabelCenter = "style_label_center", n.styleLabelDown = "style_label_down", n.styleLabelLeft = "style_label_left", n.styleLabelLowerLeft = "style_label_lower_left", n.styleLabelLowerRight = "style_label_lower_right", n.styleLabelRight = "style_label_right", n.styleLabelUp = "style_label_up", n.styleLabelUpperLeft = "style_label_upper_left", n.styleLabelUpperRight = "style_label_upper_right", n.styleNone = "style_none", n.styleSquare = "style_square", n.styleTextOutline = "style_text_outline", n.styleTriangledown = "style_triangledown", n.styleTriangleup = "style_triangleup", n.styleXcross = "style_xcross", n))(oe || {}), Ge = /* @__PURE__ */ ((n) => (n.styleArrowBoth = "style_arrow_both", n.styleArrowLeft = "style_arrow_left", n.styleArrowRight = "style_arrow_right", n.styleDashed = "style_dashed", n.styleDotted = "style_dotted", n.styleSolid = "style_solid", n))(Ge || {}), Wi = /* @__PURE__ */ ((n) => (n.abovebar = "abovebar", n.absolute = "absolute", n.belowbar = "belowbar", n.bottom = "bottom", n.top = "top", n))(Wi || {}), cr = /* @__PURE__ */ ((n) => (n.styleArea = "Area", n.styleAreabr = "Area With Breaks", n.styleCircles = "Circles", n.styleColumns = "Columns", n.styleCross = "Cross", n.styleHistogram = "Histogram", n.styleLine = "Line", n.styleLinebr = "Line With Breaks", n.styleStepline = "Step Line", n.styleSteplineDiamond = "Step Line With Diamonds", n.styleSteplinebr = "Step line with Breaks", n))(cr || {}), kt = /* @__PURE__ */ ((n) => (n.bottomCenter = "bottom_center", n.bottomLeft = "bottom_left", n.bottomRight = "bottom_right", n.middleCenter = "middle_center", n.middleLeft = "middle_left", n.middleRight = "middle_right", n.topCenter = "top_center", n.topLeft = "top_left", n.topRight = "top_right", n))(kt || {}), sc = /* @__PURE__ */ ((n) => (n.left = "left", n.none = "none", n.right = "right", n))(sc || {}), ns = /* @__PURE__ */ ((n) => (n.extended = "extended", n.regular = "regular", n))(ns || {}), yt = /* @__PURE__ */ ((n) => (n.arrowdown = "arrowdown", n.arrowup = "arrowup", n.circle = "circle", n.cross = "cross", n.diamond = "diamond", n.flag = "flag", n.labeldown = "labeldown", n.labelup = "labelup", n.square = "square", n.triangledown = "triangledown", n.triangleup = "triangleup", n.xcross = "xcross", n))(yt || {}), dr = /* @__PURE__ */ ((n) => (n.auto = "auto", n.huge = "huge", n.large = "large", n.normal = "normal", n.small = "small", n.tiny = "tiny", n))(dr || {}), Ie = /* @__PURE__ */ ((n) => (n.cash = "cash", n.fixed = "fixed", n.percentOfEquity = "percent_of_equity", n))(Ie || {}), ut = /* @__PURE__ */ ((n) => (n.cashPerContract = "cash_per_contract", n.cashPerOrder = "cash_per_order", n.percent = "percent", n))(ut || {}), f1 = /* @__PURE__ */ ((n) => (n.all = "all", n.long = "long", n.short = "short", n))(f1 || {}), vi = /* @__PURE__ */ ((n) => (n.cancel = "cancel", n.none = "none", n.reduce = "reduce", n))(vi || {}), ft = /* @__PURE__ */ ((n) => (n.alignBottom = "align_bottom", n.alignCenter = "align_center", n.alignLeft = "align_left", n.alignRight = "align_right", n.alignTop = "align_top", n))(ft || {}), fr = /* @__PURE__ */ ((n) => (n.bar_index = "bar_index", n.bar_time = "bar_time", n))(fr || {}), Lr = /* @__PURE__ */ ((n) => (n.abovebar = "abovebar", n.belowbar = "belowbar", n.price = "price", n))(Lr || {}), xb = /* @__PURE__ */ ((n) => (n.actual = "actual", n.estimate = "estimate", n.standardized = "standardized", n))(xb || {}), De = /* @__PURE__ */ ((n) => (n.INT = "int", n.BOOL = "bool", n.TIME = "time", n.COLOR = "color", n.FLOAT = "float", n.PRICE = "price", n.SOURCE = "source", n.STRING = "string", n.SYMBOL = "symbol", n.SESSION = "session", n.TIMEFRAME = "timeframe", n))(De || {}), Ef = /* @__PURE__ */ ((n) => (n.indicator = "indicator", n.strategy = "strategy", n.study = "study", n))(Ef || {});
|
21279
21279
|
const ve = {
|
@@ -37165,7 +37165,7 @@ ${u}`), u;
|
|
37165
37165
|
const l = i.length - 1, { interval: u, symbol: O = "", mintick: d } = s;
|
37166
37166
|
let { syminfo: _ } = this._variables;
|
37167
37167
|
const f = self.workerStorage.get(`request_${this._scriptId}_tmp`), A = self.workerStorage.get(`request_${this._scriptId}_data`), q = self.workerStorage.get(`request_${this._scriptId}`), g = self.workerStorage.get(`request_${this._scriptId}_list`), [W, v] = O.split(":");
|
37168
|
-
c.updateOptions({ interval: u, mintick: d, syminfo: { ..._.__syminfo, mintick: d, tickerid: O || _.tickerid, ticker: v || W || _.ticker } });
|
37168
|
+
c.__isFirstRun = r, c.updateOptions({ interval: u, mintick: d, syminfo: { ..._.__syminfo, mintick: d, tickerid: O || _.tickerid, ticker: v || W || _.ticker } });
|
37169
37169
|
let y;
|
37170
37170
|
const L = {};
|
37171
37171
|
for (const [w, x] of i.entries()) {
|
@@ -47682,7 +47682,7 @@ ${u}`), u;
|
|
47682
47682
|
fh.add("@alwatr/polyfill-has-own", "5.5.3");
|
47683
47683
|
Object.prototype.hasOwnProperty.call(Object, "hasOwn") === !1 && (Object.hasOwn = Object.call.bind(Object.prototype.hasOwnProperty));
|
47684
47684
|
async function aT(n, e, t, r) {
|
47685
|
-
return r === 3 ?
|
47685
|
+
return r === 3 ? await vB(n, e, t) : r === 4 ? await Rx(n, e, t) : r === 5 ? await kC(n, e, t) : await nT(n, e, t);
|
47686
47686
|
}
|
47687
47687
|
function cT(n) {
|
47688
47688
|
self?.workerStorage?.deleteStartwidthKey(n), self?.workerStorage?.delete(`inputs_${n}`), self?.workerStorage?.delete(`strategy_${n}`), self?.workerStorage?.delete(`request_${n}`), self?.workerStorage?.delete(`request_${n}_data`), self?.workerStorage?.delete(`request_${n}_list`);
|
@@ -8,7 +8,7 @@ declare class ImportLibrary {
|
|
8
8
|
constructor();
|
9
9
|
get inlayHints(): languages.InlayHint[];
|
10
10
|
setEditor(editor: editor.IStandaloneCodeEditor): void;
|
11
|
-
setInlayHints(params: IKeyObjectValue): Promise<
|
11
|
+
setInlayHints(params: IKeyObjectValue): Promise<any>;
|
12
12
|
deleteInlayHints(name: string): void;
|
13
13
|
clearInlayHints(): void;
|
14
14
|
triggerInlayHints(): void;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { IKeyObjectValue } from "../type";
|
2
|
-
export declare function parseTcc(program: string, hasTranscoding: boolean, getImportLibraryFunc: (obj: IKeyObjectValue) => IKeyObjectValue
|
3
|
-
export declare function parseLibraryCode(program: string, libTitle: string, getImportLibraryFunc: (obj: IKeyObjectValue) => IKeyObjectValue
|
2
|
+
export declare function parseTcc(program: string, hasTranscoding: boolean, getImportLibraryFunc: (obj: IKeyObjectValue) => Promise<IKeyObjectValue>, keyObjs: IKeyObjectValue, version: number): Promise<IKeyObjectValue>;
|
3
|
+
export declare function parseLibraryCode(program: string, libTitle: string, getImportLibraryFunc: (obj: IKeyObjectValue) => Promise<IKeyObjectValue>, keyObjs: IKeyObjectValue): Promise<{
|
4
4
|
description: string;
|
5
5
|
codeStr: string;
|
6
6
|
functions: import("../type").IDocValue[];
|
@@ -41,7 +41,7 @@ export default class ParserVisitor extends ParserUtils {
|
|
41
41
|
private _strategyFuncName?;
|
42
42
|
private _strategyVarName?;
|
43
43
|
private _isSeriesCondition?;
|
44
|
-
constructor(props: IKeyObjectValue, comments: IKeyObjectValue[], getImportLibraryFunc: (obj: IKeyObjectValue) => IKeyObjectValue);
|
44
|
+
constructor(props: IKeyObjectValue, comments: IKeyObjectValue[], getImportLibraryFunc: (obj: IKeyObjectValue) => Promise<IKeyObjectValue>);
|
45
45
|
get overloadsFuncs(): IKeyValue[];
|
46
46
|
get errors(): IError[];
|
47
47
|
get userEnums(): Map<string, IDocValue[]>;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference path="../../../../src/vite-env.d.ts" />
|
2
2
|
import { ErrorListener } from "antlr4";
|
3
3
|
import { IKeyObjectValue } from "../type";
|
4
|
-
export declare function parseTcc(program: string, hasTranscoding: boolean, getImportLibraryFunc: (obj: IKeyObjectValue) => IKeyObjectValue
|
4
|
+
export declare function parseTcc(program: string, hasTranscoding: boolean, getImportLibraryFunc: (obj: IKeyObjectValue) => Promise<IKeyObjectValue>, keyObjs: IKeyObjectValue): Promise<{
|
5
5
|
errors: any[];
|
6
6
|
functions: {
|
7
7
|
[k: string]: import("../type").IDocValue[];
|
@@ -26,7 +26,7 @@ export declare function parseTcc(program: string, hasTranscoding: boolean, getIm
|
|
26
26
|
preParserCode: string | undefined;
|
27
27
|
config: IKeyObjectValue;
|
28
28
|
}>;
|
29
|
-
export declare function parseLibraryCode(program: string, libTitle: string, getImportLibraryFunc: (obj: IKeyObjectValue) => IKeyObjectValue
|
29
|
+
export declare function parseLibraryCode(program: string, libTitle: string, getImportLibraryFunc: (obj: IKeyObjectValue) => Promise<IKeyObjectValue>, keyObjs: IKeyObjectValue): Promise<{
|
30
30
|
description: string;
|
31
31
|
codeStr: string;
|
32
32
|
functions: import("../type").IDocValue[];
|
@@ -8912,6 +8912,11 @@ class m1 {
|
|
8912
8912
|
run: () => {
|
8913
8913
|
this._onActionTrigger && this._onActionTrigger(dn.NewTab);
|
8914
8914
|
}
|
8915
|
+
}), this._editor.addCommand(this._monaco.KeyMod.Alt | this._monaco.KeyCode.KeyZ, () => {
|
8916
|
+
const n = this._editor.getOption(this._monaco.editor.EditorOption.wordWrap);
|
8917
|
+
this._editor.updateOptions({
|
8918
|
+
wordWrap: n === "off" ? "on" : "off"
|
8919
|
+
});
|
8915
8920
|
});
|
8916
8921
|
}
|
8917
8922
|
openFind() {
|
@@ -9170,14 +9175,14 @@ function mr(i, n, r) {
|
|
9170
9175
|
function I1() {
|
9171
9176
|
return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
|
9172
9177
|
}
|
9173
|
-
const Lf = new Worker(new URL("" + new URL("assets/scriptsRunWorker-
|
9178
|
+
const Lf = new Worker(new URL("" + new URL("assets/scriptsRunWorker-8a33SSnQ.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run MineScript Server" });
|
9174
9179
|
Lf.onerror = (i) => {
|
9175
9180
|
console.error(i);
|
9176
9181
|
};
|
9177
9182
|
async function Tf(i) {
|
9178
9183
|
return await bo.setInlayHints(i);
|
9179
9184
|
}
|
9180
|
-
const Nf = ma(Lf), Rf = ma(new Worker(new URL("" + new URL("assets/parserTccWorker-
|
9185
|
+
const Nf = ma(Lf), Rf = ma(new Worker(new URL("" + new URL("assets/parserTccWorker-BvDdoR3P.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser MineScript Server" }));
|
9181
9186
|
async function A1(i, n = !1, r = Xt) {
|
9182
9187
|
const s = i.match(/\s*\/\/\s*@version\s*=\s*([0-9])/)?.[1];
|
9183
9188
|
s && (r = parseInt(s), r = r < 3 ? 3 : r > 6 ? 6 : r);
|
@@ -70,11 +70,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
70
70
|
}`;var he=zd(function(){return Ne(f,ae+"return "+U).apply(r,b)});if(he.source=U,ho(he))throw he;return he}function Rv(e){return Ee(e).toLowerCase()}function Kv(e){return Ee(e).toUpperCase()}function Uv(e,t,i){if(e=Ee(e),e&&(i||t===r))return Pc(e);if(!e||!(t=It(t)))return e;var c=Gt(e),m=Gt(t),f=Bc(c,m),b=Rc(c,m)+1;return Es(c,f,b).join("")}function $v(e,t,i){if(e=Ee(e),e&&(i||t===r))return e.slice(0,Uc(e)+1);if(!e||!(t=It(t)))return e;var c=Gt(e),m=Rc(c,Gt(t))+1;return Es(c,0,m).join("")}function Hv(e,t,i){if(e=Ee(e),e&&(i||t===r))return e.replace(Yr,"");if(!e||!(t=It(t)))return e;var c=Gt(e),m=Bc(c,Gt(t));return Es(c,m).join("")}function jv(e,t){var i=te,c=ne;if($e(t)){var m="separator"in t?t.separator:m;i="length"in t?be(t.length):i,c="omission"in t?It(t.omission):c}e=Ee(e);var f=e.length;if(ur(e)){var b=Gt(e);f=b.length}if(i>=f)return e;var v=i-yr(c);if(v<1)return c;var D=b?Es(b,0,v).join(""):e.slice(0,v);if(m===r)return D+c;if(b&&(v+=D.length-v),wo(m)){if(e.slice(v).search(m)){var P,B=D;for(m.global||(m=Fi(m.source,Ee(Se.exec(m))+"g")),m.lastIndex=0;P=m.exec(B);)var U=P.index;D=D.slice(0,U===r?v:U)}}else if(e.indexOf(It(m),v)!=v){var Q=D.lastIndexOf(m);Q>-1&&(D=D.slice(0,Q))}return D+c}function Gv(e){return e=Ee(e),e&&Xr.test(e)?e.replace(ls,wg):e}var Wv=wr(function(e,t,i){return e+(i?" ":"")+t.toUpperCase()}),ko=Cp("toUpperCase");function qd(e,t,i){return e=Ee(e),t=i?r:t,t===r?fg(e)?kg(e):og(e):e.match(t)||[]}var zd=ve(function(e,t){try{return kt(e,r,t)}catch(i){return ho(i)?i:new fe(i)}}),Xv=us(function(e,t){return Ft(t,function(i){i=ns(i),ds(e,i,bo(e[i],e))}),e});function Vv(e){var t=e==null?0:e.length,i=le();return e=t?Re(e,function(c){if(typeof c[1]!="function")throw new Ot(p);return[i(c[0]),c[1]]}):[],ve(function(c){for(var m=-1;++m<t;){var f=e[m];if(kt(f[0],this,c))return kt(f[1],this,c)}})}function Yv(e){return wb(Bt(e,x))}function Do(e){return function(){return e}}function Qv(e,t){return e==null||e!==e?t:e}var Zv=Sp(),Jv=Sp(!0);function bt(e){return e}function Io(e){return lp(typeof e=="function"?e:Bt(e,x))}function eT(e){return pp(Bt(e,x))}function tT(e,t){return dp(e,Bt(t,x))}var sT=ve(function(e,t){return function(i){return na(i,e,t)}}),rT=ve(function(e,t){return function(i){return na(e,i,t)}});function Ao(e,t,i){var c=et(t),m=yn(t,c);i==null&&!($e(t)&&(m.length||!c.length))&&(i=t,t=e,e=this,m=yn(t,et(t)));var f=!($e(i)&&"chain"in i)||!!i.chain,b=_s(e);return Ft(m,function(v){var D=t[v];e[v]=D,b&&(e.prototype[v]=function(){var P=this.__chain__;if(f||P){var B=e(this.__wrapped__),U=B.__actions__=_t(this.__actions__);return U.push({func:D,args:arguments,thisArg:e}),B.__chain__=P,B}return D.apply(e,As([this.value()],arguments))})}),e}function aT(){return rt._===this&&(rt._=Cg),this}function qo(){}function nT(e){return e=be(e),ve(function(t){return mp(t,e)})}var iT=ao(Re),oT=ao(Ec),lT=ao(zi);function Cd(e){return mo(e)?Ci(ns(e)):Pb(e)}function cT(e){return function(t){return e==null?r:Ws(e,t)}}var pT=Lp(),dT=Lp(!0);function zo(){return[]}function Co(){return!1}function mT(){return{}}function uT(){return""}function yT(){return!0}function _T(e,t){if(e=be(e),e<1||e>$)return[];var i=_e,c=ot(e,_e);t=le(t),e-=_e;for(var m=Ei(c,t);++i<e;)t(i);return m}function fT(e){return ge(e)?Re(e,ns):At(e)?[e]:_t(Yp(Ee(e)))}function gT(e){var t=++qg;return Ee(e)+t}var bT=hn(function(e,t){return e+t},0),xT=no("ceil"),hT=hn(function(e,t){return e/t},1),wT=no("floor");function vT(e){return e&&e.length?un(e,bt,Hi):r}function TT(e,t){return e&&e.length?un(e,le(t,2),Hi):r}function kT(e){return Fc(e,bt)}function DT(e,t){return Fc(e,le(t,2))}function IT(e){return e&&e.length?un(e,bt,Xi):r}function AT(e,t){return e&&e.length?un(e,le(t,2),Xi):r}var qT=hn(function(e,t){return e*t},1),zT=no("round"),CT=hn(function(e,t){return e-t},0);function NT(e){return e&&e.length?Si(e,bt):0}function ST(e,t){return e&&e.length?Si(e,le(t,2)):0}return y.after=ew,y.ary=od,y.assign=Kw,y.assignIn=wd,y.assignInWith=En,y.assignWith=Uw,y.at=$w,y.before=ld,y.bind=bo,y.bindAll=Xv,y.bindKey=cd,y.castArray=mw,y.chain=ad,y.chunk=wx,y.compact=vx,y.concat=Tx,y.cond=Vv,y.conforms=Yv,y.constant=Do,y.countBy=Nh,y.create=Hw,y.curry=pd,y.curryRight=dd,y.debounce=md,y.defaults=jw,y.defaultsDeep=Gw,y.defer=tw,y.delay=sw,y.difference=kx,y.differenceBy=Dx,y.differenceWith=Ix,y.drop=Ax,y.dropRight=qx,y.dropRightWhile=zx,y.dropWhile=Cx,y.fill=Nx,y.filter=Eh,y.flatMap=Fh,y.flatMapDeep=Oh,y.flatMapDepth=Ph,y.flatten=ed,y.flattenDeep=Sx,y.flattenDepth=Ex,y.flip=rw,y.flow=Zv,y.flowRight=Jv,y.fromPairs=Lx,y.functions=Jw,y.functionsIn=ev,y.groupBy=Bh,y.initial=Fx,y.intersection=Ox,y.intersectionBy=Px,y.intersectionWith=Bx,y.invert=sv,y.invertBy=rv,y.invokeMap=Kh,y.iteratee=Io,y.keyBy=Uh,y.keys=et,y.keysIn=gt,y.map=An,y.mapKeys=nv,y.mapValues=iv,y.matches=eT,y.matchesProperty=tT,y.memoize=zn,y.merge=ov,y.mergeWith=vd,y.method=sT,y.methodOf=rT,y.mixin=Ao,y.negate=Cn,y.nthArg=nT,y.omit=lv,y.omitBy=cv,y.once=aw,y.orderBy=$h,y.over=iT,y.overArgs=nw,y.overEvery=oT,y.overSome=lT,y.partial=xo,y.partialRight=ud,y.partition=Hh,y.pick=pv,y.pickBy=Td,y.property=Cd,y.propertyOf=cT,y.pull=$x,y.pullAll=sd,y.pullAllBy=Hx,y.pullAllWith=jx,y.pullAt=Gx,y.range=pT,y.rangeRight=dT,y.rearg=iw,y.reject=Wh,y.remove=Wx,y.rest=ow,y.reverse=fo,y.sampleSize=Vh,y.set=mv,y.setWith=uv,y.shuffle=Yh,y.slice=Xx,y.sortBy=Jh,y.sortedUniq=th,y.sortedUniqBy=sh,y.split=Fv,y.spread=lw,y.tail=rh,y.take=ah,y.takeRight=nh,y.takeRightWhile=ih,y.takeWhile=oh,y.tap=vh,y.throttle=cw,y.thru=In,y.toArray=bd,y.toPairs=kd,y.toPairsIn=Dd,y.toPath=fT,y.toPlainObject=hd,y.transform=yv,y.unary=pw,y.union=lh,y.unionBy=ch,y.unionWith=ph,y.uniq=dh,y.uniqBy=mh,y.uniqWith=uh,y.unset=_v,y.unzip=go,y.unzipWith=rd,y.update=fv,y.updateWith=gv,y.values=kr,y.valuesIn=bv,y.without=yh,y.words=qd,y.wrap=dw,y.xor=_h,y.xorBy=fh,y.xorWith=gh,y.zip=bh,y.zipObject=xh,y.zipObjectDeep=hh,y.zipWith=wh,y.entries=kd,y.entriesIn=Dd,y.extend=wd,y.extendWith=En,Ao(y,y),y.add=bT,y.attempt=zd,y.camelCase=vv,y.capitalize=Id,y.ceil=xT,y.clamp=xv,y.clone=uw,y.cloneDeep=_w,y.cloneDeepWith=fw,y.cloneWith=yw,y.conformsTo=gw,y.deburr=Ad,y.defaultTo=Qv,y.divide=hT,y.endsWith=Tv,y.eq=Xt,y.escape=kv,y.escapeRegExp=Dv,y.every=Sh,y.find=Lh,y.findIndex=Zp,y.findKey=Ww,y.findLast=Mh,y.findLastIndex=Jp,y.findLastKey=Xw,y.floor=wT,y.forEach=nd,y.forEachRight=id,y.forIn=Vw,y.forInRight=Yw,y.forOwn=Qw,y.forOwnRight=Zw,y.get=vo,y.gt=bw,y.gte=xw,y.has=tv,y.hasIn=To,y.head=td,y.identity=bt,y.includes=Rh,y.indexOf=Mx,y.inRange=hv,y.invoke=av,y.isArguments=Ys,y.isArray=ge,y.isArrayBuffer=hw,y.isArrayLike=ft,y.isArrayLikeObject=Ve,y.isBoolean=ww,y.isBuffer=Ls,y.isDate=vw,y.isElement=Tw,y.isEmpty=kw,y.isEqual=Dw,y.isEqualWith=Iw,y.isError=ho,y.isFinite=Aw,y.isFunction=_s,y.isInteger=yd,y.isLength=Nn,y.isMap=_d,y.isMatch=qw,y.isMatchWith=zw,y.isNaN=Cw,y.isNative=Nw,y.isNil=Ew,y.isNull=Sw,y.isNumber=fd,y.isObject=$e,y.isObjectLike=We,y.isPlainObject=da,y.isRegExp=wo,y.isSafeInteger=Lw,y.isSet=gd,y.isString=Sn,y.isSymbol=At,y.isTypedArray=Tr,y.isUndefined=Mw,y.isWeakMap=Fw,y.isWeakSet=Ow,y.join=Rx,y.kebabCase=Iv,y.last=Kt,y.lastIndexOf=Kx,y.lowerCase=Av,y.lowerFirst=qv,y.lt=Pw,y.lte=Bw,y.max=vT,y.maxBy=TT,y.mean=kT,y.meanBy=DT,y.min=IT,y.minBy=AT,y.stubArray=zo,y.stubFalse=Co,y.stubObject=mT,y.stubString=uT,y.stubTrue=yT,y.multiply=qT,y.nth=Ux,y.noConflict=aT,y.noop=qo,y.now=qn,y.pad=zv,y.padEnd=Cv,y.padStart=Nv,y.parseInt=Sv,y.random=wv,y.reduce=jh,y.reduceRight=Gh,y.repeat=Ev,y.replace=Lv,y.result=dv,y.round=zT,y.runInContext=k,y.sample=Xh,y.size=Qh,y.snakeCase=Mv,y.some=Zh,y.sortedIndex=Vx,y.sortedIndexBy=Yx,y.sortedIndexOf=Qx,y.sortedLastIndex=Zx,y.sortedLastIndexBy=Jx,y.sortedLastIndexOf=eh,y.startCase=Ov,y.startsWith=Pv,y.subtract=CT,y.sum=NT,y.sumBy=ST,y.template=Bv,y.times=_T,y.toFinite=fs,y.toInteger=be,y.toLength=xd,y.toLower=Rv,y.toNumber=Ut,y.toSafeInteger=Rw,y.toString=Ee,y.toUpper=Kv,y.trim=Uv,y.trimEnd=$v,y.trimStart=Hv,y.truncate=jv,y.unescape=Gv,y.uniqueId=gT,y.upperCase=Wv,y.upperFirst=ko,y.each=nd,y.eachRight=id,y.first=td,Ao(y,function(){var e={};return rs(y,function(t,i){Le.call(y.prototype,i)||(e[i]=t)}),e}(),{chain:!1}),y.VERSION=n,Ft(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){y[e].placeholder=y}),Ft(["drop","take"],function(e,t){Ae.prototype[e]=function(i){i=i===r?1:Je(be(i),0);var c=this.__filtered__&&!t?new Ae(this):this.clone();return c.__filtered__?c.__takeCount__=ot(i,c.__takeCount__):c.__views__.push({size:ot(i,_e),type:e+(c.__dir__<0?"Right":"")}),c},Ae.prototype[e+"Right"]=function(i){return this.reverse()[e](i).reverse()}}),Ft(["filter","map","takeWhile"],function(e,t){var i=t+1,c=i==ie||i==ce;Ae.prototype[e]=function(m){var f=this.clone();return f.__iteratees__.push({iteratee:le(m,3),type:i}),f.__filtered__=f.__filtered__||c,f}}),Ft(["head","last"],function(e,t){var i="take"+(t?"Right":"");Ae.prototype[e]=function(){return this[i](1).value()[0]}}),Ft(["initial","tail"],function(e,t){var i="drop"+(t?"":"Right");Ae.prototype[e]=function(){return this.__filtered__?new Ae(this):this[i](1)}}),Ae.prototype.compact=function(){return this.filter(bt)},Ae.prototype.find=function(e){return this.filter(e).head()},Ae.prototype.findLast=function(e){return this.reverse().find(e)},Ae.prototype.invokeMap=ve(function(e,t){return typeof e=="function"?new Ae(this):this.map(function(i){return na(i,e,t)})}),Ae.prototype.reject=function(e){return this.filter(Cn(le(e)))},Ae.prototype.slice=function(e,t){e=be(e);var i=this;return i.__filtered__&&(e>0||t<0)?new Ae(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==r&&(t=be(t),i=t<0?i.dropRight(-t):i.take(t-e)),i)},Ae.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Ae.prototype.toArray=function(){return this.take(_e)},rs(Ae.prototype,function(e,t){var i=/^(?:filter|find|map|reject)|While$/.test(t),c=/^(?:head|last)$/.test(t),m=y[c?"take"+(t=="last"?"Right":""):t],f=c||/^find/.test(t);m&&(y.prototype[t]=function(){var b=this.__wrapped__,v=c?[1]:arguments,D=b instanceof Ae,P=v[0],B=D||ge(b),U=function(ke){var qe=m.apply(y,As([ke],v));return c&&Q?qe[0]:qe};B&&i&&typeof P=="function"&&P.length!=1&&(D=B=!1);var Q=this.__chain__,ae=!!this.__actions__.length,pe=f&&!Q,he=D&&!ae;if(!f&&B){b=he?b:new Ae(this);var de=e.apply(b,v);return de.__actions__.push({func:In,args:[U],thisArg:r}),new Pt(de,Q)}return pe&&he?e.apply(this,v):(de=this.thru(U),pe?c?de.value()[0]:de.value():de)})}),Ft(["pop","push","shift","sort","splice","unshift"],function(e){var t=Qa[e],i=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",c=/^(?:pop|shift)$/.test(e);y.prototype[e]=function(){var m=arguments;if(c&&!this.__chain__){var f=this.value();return t.apply(ge(f)?f:[],m)}return this[i](function(b){return t.apply(ge(b)?b:[],m)})}}),rs(Ae.prototype,function(e,t){var i=y[t];if(i){var c=i.name+"";Le.call(br,c)||(br[c]=[]),br[c].push({name:t,func:i})}}),br[xn(r,X).name]=[{name:"wrapper",func:r}],Ae.prototype.clone=Gg,Ae.prototype.reverse=Wg,Ae.prototype.value=Xg,y.prototype.at=Th,y.prototype.chain=kh,y.prototype.commit=Dh,y.prototype.next=Ih,y.prototype.plant=qh,y.prototype.reverse=zh,y.prototype.toJSON=y.prototype.valueOf=y.prototype.value=Ch,y.prototype.first=y.prototype.head,Zr&&(y.prototype[Zr]=Ah),y},_r=Dg();Us?((Us.exports=_r)._=_r,Di._=_r):rt._=_r}).call(Dr)}(Da,Da.exports);var vu=Da.exports;const je="mineScript",L={"color-white":"#ffffff","color-black":"#000000","color-transparent":"#00000000","color-cold-gray-50":"#F8F9FD","color-cold-gray-100":"#F0F3FA","color-cold-gray-150":"#E0E3EB","color-cold-gray-200":"#D1D4DC","color-cold-gray-250":"#C1C4CD","color-cold-gray-300":"#B2B5BE","color-cold-gray-350":"#A3A6AF","color-cold-gray-400":"#9598A1","color-cold-gray-450":"#868993","color-cold-gray-500":"#787B86","color-cold-gray-550":"#6A6D78","color-cold-gray-600":"#5D606B","color-cold-gray-650":"#50535E","color-cold-gray-700":"#434651","color-cold-gray-750":"#363A45","color-cold-gray-800":"#2A2E39","color-cold-gray-850":"#1E222D","color-cold-gray-900":"#131722","color-cold-gray-950":"#0C0E15","color-ripe-red-50":"#FFEBEC","color-ripe-red-100":"#FCCBCD","color-ripe-red-200":"#FAA1A4","color-ripe-red-300":"#F77C80","color-ripe-red-400":"#F7525F","color-ripe-red-500":"#F23645","color-ripe-red-600":"#CC2F3C","color-ripe-red-700":"#B22833","color-ripe-red-800":"#991F29","color-ripe-red-900":"#801922","color-ripe-red-a100":"#FF8080","color-ripe-red-a200":"#FF5252","color-ripe-red-a400":"#FF3333","color-ripe-red-a600":"#CC2929","color-ripe-red-a700":"#802028","color-ripe-red-a800":"#4D191D","color-ripe-red-a900":"#331F20","color-tan-orange-50":"#FFF3E0","color-tan-orange-100":"#FFE0B2","color-tan-orange-200":"#FFCC80","color-tan-orange-300":"#ffb74d","color-tan-orange-400":"#FFA726","color-tan-orange-500":"#FF9800","color-tan-orange-600":"#FB8C00","color-tan-orange-700":"#F57C00","color-tan-orange-800":"#EF6C00","color-tan-orange-900":"#e65100","color-tan-orange-a200":"#ffab40","color-tan-orange-a400":"#FF9100","color-tan-orange-a600":"#CC7014","color-tan-orange-a700":"#8C541C","color-tan-orange-a800":"#593A1B","color-tan-orange-a900":"#33261A","color-iguana-green-100":"#C8E6C9","color-iguana-green-200":"#A5D6A7","color-iguana-green-300":"#81c784","color-iguana-green-400":"#66BB6A","color-iguana-green-500":"#4caf50","color-iguana-green-600":"#43a047","color-iguana-green-700":"#388e3c","color-iguana-green-800":"#2E7D32","color-iguana-green-900":"#1B5E20","color-iguana-green-a700":"#00c853","color-banana-yellow-100":"#FFF9C4","color-banana-yellow-200":"#FFF59D","color-banana-yellow-300":"#FFF176","color-banana-yellow-400":"#ffee58","color-banana-yellow-500":"#ffeb3b","color-banana-yellow-600":"#fdd835","color-banana-yellow-700":"#fbc02d","color-banana-yellow-800":"#f9a825","color-banana-yellow-900":"#F57F17","color-banana-yellow-a400":"#ffea00","color-banana-yellow-a700":"#EEDA01","color-tv-blue-50":"#E3EFFD","color-tv-blue-100":"#BBD9FB","color-tv-blue-200":"#90BFF9","color-tv-blue-300":"#5B9CF6","color-tv-blue-400":"#3179F5","color-tv-blue-500":"#2962FF","color-tv-blue-600":"#1E53E5","color-tv-blue-700":"#1848CC","color-tv-blue-800":"#143EB3","color-tv-blue-900":"#0C3299","color-tv-blue-a100":"#82b1ff","color-tv-blue-a200":"#448aff","color-tv-blue-a400":"#2979ff","color-tv-blue-a600":"#2962FF","color-tv-blue-a700":"#143A87","color-tv-blue-a800":"#142E61","color-tv-blue-a900":"#132042","color-deep-blue-50":"#EDE7F6","color-deep-blue-100":"#D1C4E9","color-deep-blue-200":"#B39DDB","color-deep-blue-300":"#9575cd","color-deep-blue-400":"#7e57c2","color-deep-blue-500":"#673ab7","color-deep-blue-700":"#512da8","color-deep-blue-800":"#4527A0","color-deep-blue-900":"#311B92","color-deep-blue-a100":"#b388ff","color-deep-blue-a200":"#7C4DFF","color-deep-blue-a400":"#651FFF","color-deep-blue-a700":"#6200EA","color-minty-green-50":"#DAF2EE","color-minty-green-100":"#ACE5DC","color-minty-green-200":"#70CCBD","color-minty-green-300":"#42BDA8","color-minty-green-400":"#22AB94","color-minty-green-500":"#089981","color-minty-green-600":"#06806B","color-minty-green-700":"#056656","color-minty-green-800":"#004D40","color-minty-green-900":"#00332A","color-minty-green-a400":"#2BD9BC","color-minty-green-a600":"#24B29B","color-minty-green-a700":"#1B7667","color-minty-green-a800":"#10443B","color-minty-green-a900":"#082621","color-grapes-purple-50":"#F3E5F5","color-grapes-purple-100":"#E1BEE7","color-grapes-purple-200":"#CE93D8","color-grapes-purple-300":"#ba68c8","color-grapes-purple-400":"#ab47bc","color-grapes-purple-500":"#9c27b0","color-grapes-purple-600":"#8e24aa","color-grapes-purple-700":"#7b1fa2","color-grapes-purple-800":"#6A1B9A","color-grapes-purple-900":"#4A148C","color-grapes-purple-a100":"#EA80FC","color-grapes-purple-a200":"#E040FB","color-grapes-purple-a400":"#D500F9","color-grapes-purple-a700":"#aa00ff","color-berry-pink-100":"#F8BBD0","color-berry-pink-200":"#f48fb1","color-berry-pink-300":"#f06292","color-berry-pink-400":"#ec407a","color-berry-pink-500":"#e91e63","color-berry-pink-600":"#D81B60","color-berry-pink-700":"#C2185B","color-berry-pink-800":"#AD1457","color-berry-pink-900":"#880E4F","color-berry-pink-a100":"#ff80ab","color-berry-pink-a200":"#ff4081","color-berry-pink-a400":"#f50057","color-sky-blue-100":"#B2EBF2","color-sky-blue-200":"#80DEEA","color-sky-blue-300":"#4dd0e1","color-sky-blue-400":"#26c6da","color-sky-blue-500":"#00bcd4","color-sky-blue-600":"#00acc1","color-sky-blue-700":"#0097A7","color-sky-blue-800":"#00838F","color-sky-blue-900":"#006064","color-sky-blue-a400":"#00e5ff","color-sky-blue-a700":"#00B8D4","color-deep-blue-600":"#5E35B1","color-forest-green-50":"#DAF2E6","color-forest-green-100":"#ACE5C9","color-forest-green-200":"#70CC9E","color-forest-green-300":"#42BD7F","color-forest-green-400":"#22AB67","color-forest-green-500":"#089950","color-forest-green-600":"#068043","color-forest-green-700":"#056636","color-forest-green-800":"#004D27","color-forest-green-900":"#1A3326","color-facebook":"#1877F2","color-deep-facebook":"#1564CA","color-twitter":"#1DA1F2","color-deep-twitter":"#188CD3","color-youtube":"#FF0000","color-linkedin":"#007BB5","color-seeking-alpha-brand":"#ff7200"};function Zt(a,s=1){return a+Math.round(255*Math.min(Math.max(s,0),1)).toString(16).toUpperCase().padStart(2,"0")}const $n={base:"vs",inherit:!0,rules:[{token:"comment",foreground:L["color-cold-gray-400"]},{token:"comment.annotation",fontStyle:"bold"},{token:"text",foreground:L["color-cold-gray-900"]},{token:"string",foreground:L["color-iguana-green-700"]},{token:"constant.numeric",foreground:L["color-banana-yellow-900"]},{token:"constant.language",foreground:L["color-ripe-red-a600"]},{token:"constant.other.color",foreground:L["color-ripe-red-a600"]},{token:"constant.other",foreground:L["color-ripe-red-a600"]},{token:"support.variable",foreground:L["color-ripe-red-a600"]},{token:"support.function",foreground:L["color-tv-blue-a600"]},{token:"support.type",foreground:L["color-minty-green-400"],fontStyle:"bold"},{token:"entity.name.type",foreground:L["color-minty-green-400"],fontStyle:"bold"},{token:"support.method",foreground:L["color-tv-blue-a600"]},{token:"keyword.equals",foreground:L["color-minty-green-400"]},{token:"keyword.operator",foreground:L["color-minty-green-400"]},{token:"keyword.other",foreground:L["color-minty-green-400"]},{token:"keyword",foreground:L["color-minty-green-400"]},{token:"variable.other",foreground:L["color-cold-gray-800"]},{token:"variable.other.property",foreground:L["color-cold-gray-800"]},{token:"paren",foreground:L["color-black"]},{token:"entity.name.function",foreground:L["color-tv-blue-900"]},{token:"entity.name.method",foreground:L["color-tv-blue-900"]},{token:"meta.function-call",foreground:L["color-grapes-purple-600"]},{token:"entity.name.module.name",foreground:L["color-grapes-purple-600"]},{token:"entity.name.module",foreground:L["color-tv-blue-a600"]},{token:"",background:L["color-white"]}],colors:{"editor.foreground":L["color-cold-gray-900"],"editor.background":"#00000000","editorLineNumber.foreground":L["color-cold-gray-400"],"editorLineNumber.activeForeground":L["color-cold-gray-700"],"editorHoverWidget.background":L["color-white"],"editorHoverWidget.statusBarBackground":L["color-cold-gray-150"],"editorHoverWidget.foreground":L["color-cold-gray-900"],"editorWidget.background":L["color-white"],"editorWidget.foreground":L["color-cold-gray-900"],"editorGutter.background":"#00000000","editor.foldBackground":Zt(L["color-cold-gray-200"],.5),"editor.lineHighlightBackground":L["color-tv-blue-50"],"editor.lineHighlightBorder":L["color-tv-blue-50"],"editor.rangeHighlightBackground":L["color-tv-blue-100"],"editorBracketMatch.background":L["color-cold-gray-150"],"editor.selectionBackground":L["color-tv-blue-100"],"editor.selectionHighlightBackground":L["color-tv-blue-50"],"editor.findMatchBackground":L["color-tan-orange-100"],"editor.findMatchHighlightBackground":L["color-tan-orange-100"],"editor.findMatchBorder":L["color-tan-orange-500"],"list.foreground":L["color-cold-gray-900"],"list.hoverForeground":L["color-cold-gray-900"],"list.activeSelectionBackground":L["color-tv-blue-500"],"list.hoverBackground":L["color-tv-blue-50"],"list.focusHighlightForeground":L["color-tv-blue-100"],"list.inactiveSelectionBackground":L["color-tv-blue-500"],"keybindingLabel.background":L["color-white"],"keybindingLabel.foreground":L["color-cold-gray-900"],"keybindingLabel.border":L["color-cold-gray-150"],"input.foreground":L["color-cold-gray-900"],"textLink.foreground":L["color-tv-blue-500"],"textLink.activeForeground":L["color-tv-blue-600"],"peekViewEditor.matchHighlightBackground":L["color-tan-orange-100"],"peekViewResult.lineForeground":L["color-cold-gray-900"],"editorMarkerNavigationWarning.background":L["color-banana-yellow-800"],"inputValidation.warningBackground":L["color-banana-yellow-800"],"diffEditor.insertedTextBackground":Zt(L["color-forest-green-500"],.3),"diffEditor.insertedLineBackground":Zt(L["color-forest-green-500"],.15),"diffEditor.removedTextBackground":Zt(L["color-ripe-red-500"],.3),"diffEditor.removedLineBackground":Zt(L["color-ripe-red-500"],.15),"editorInlayHint.background":L["color-cold-gray-150"],"editorInlayHint.foreground":L["color-cold-gray-550"],"editorError.foreground":L["color-ripe-red-500"],"editorWarning.foreground":L["color-tan-orange-500"]}},Hn={base:"vs-dark",inherit:!0,rules:[{token:"comment",foreground:L["color-cold-gray-500"]},{token:"comment.annotation",fontStyle:"bold"},{token:"text",foreground:L["color-white"]},{token:"string",foreground:L["color-iguana-green-700"]},{token:"constant.numeric",foreground:L["color-banana-yellow-900"]},{token:"constant.language",foreground:L["color-ripe-red-300"]},{token:"constant.other.color",foreground:L["color-ripe-red-300"]},{token:"constant.other",foreground:L["color-ripe-red-300"]},{token:"support.variable",foreground:L["color-ripe-red-300"]},{token:"support.function",foreground:L["color-tv-blue-300"]},{token:"support.method",foreground:L["color-tv-blue-300"]},{token:"support.type",foreground:L["color-minty-green-300"],fontStyle:"bold"},{token:"entity.name.type",foreground:L["color-minty-green-300"],fontStyle:"bold"},{token:"keyword.equals",foreground:L["color-minty-green-300"]},{token:"keyword.operator",foreground:L["color-minty-green-300"]},{token:"keyword.other",foreground:L["color-minty-green-300"]},{token:"keyword",foreground:L["color-minty-green-300"]},{token:"variable.other",foreground:L["color-cold-gray-200"]},{token:"variable.other.property",foreground:L["color-cold-gray-200"]},{token:"paren",foreground:L["color-white"]},{token:"entity.name.function",foreground:L["color-tv-blue-400"]},{token:"entity.name.method",foreground:L["color-tv-blue-400"]},{token:"meta.function-call",foreground:L["color-grapes-purple-300"]},{token:"entity.name.module.name",foreground:L["color-grapes-purple-300"]},{token:"entity.name.module",foreground:L["color-tv-blue-300"]},{token:"",background:L["color-cold-gray-900"]}],colors:{"editor.foreground":L["color-white"],"editor.background":L["color-cold-gray-900"],"editorLineNumber.foreground":L["color-cold-gray-500"],"editorLineNumber.activeForeground":L["color-cold-gray-300"],"editorWidget.background":L["color-cold-gray-850"],"editorHoverWidget.background":L["color-cold-gray-850"],"editorHoverWidget.foreground":L["color-cold-gray-300"],"editorHoverWidget.statusBarBackground":L["color-cold-gray-900"],"editorWidget.foreground":L["color-cold-gray-300"],"editorGutter.background":L["color-cold-gray-900"],"editor.foldBackground":Zt(L["color-cold-gray-700"],.5),"editor.lineHighlightBackground":L["color-tv-blue-a900"],"editor.lineHighlightBorder":L["color-tv-blue-a900"],"editor.rangeHighlightBackground":L["color-tv-blue-a800"],"editorBracketMatch.background":L["color-cold-gray-750"],"editor.selectionBackground":L["color-tv-blue-a800"],"editor.selectionHighlightBackground":L["color-cold-gray-800"],"list.foreground":L["color-cold-gray-350"],"list.hoverForeground":L["color-cold-gray-350"],"list.activeSelectionBackground":L["color-tv-blue-500"],"list.hoverBackground":L["color-tv-blue-900"],"list.focusHighlightForeground":L["color-tv-blue-300"],"list.inactiveSelectionBackground":L["color-tv-blue-500"],"keybindingLabel.background":L["color-cold-gray-800"],"keybindingLabel.foreground":L["color-cold-gray-300"],"keybindingLabel.border":L["color-cold-gray-700"],"input.foreground":L["color-cold-gray-350"],"textLink.foreground":L["color-tv-blue-500"],"textLink.activeForeground":L["color-tv-blue-600"],"peekViewEditor.matchHighlightBackground":L["color-tan-orange-a800"],"peekViewResult.lineForeground":L["color-cold-gray-350"],"diffEditor.insertedTextBackground":Zt(L["color-iguana-green-a700"],.3),"diffEditor.insertedLineBackground":Zt(L["color-iguana-green-a700"],.15),"diffEditor.removedTextBackground":Zt(L["color-ripe-red-a400"],.3),"diffEditor.removedLineBackground":Zt(L["color-ripe-red-a400"],.15),"editorInlayHint.background":L["color-cold-gray-800"],"editorInlayHint.foreground":L["color-cold-gray-400"],"editorError.foreground":L["color-ripe-red-500"],"editorWarning.foreground":L["color-tan-orange-700"]}},Tu=/(\\(?:[\\'"]))|(\\$)|("|$)|($)/g,ku=/(\\(?:[\\'"]))|(\\$)|('|$)|($)/g,ol={"color.aqua":"#00BCD4","color.black":"#363A45","color.blue":"#2962ff","color.fuchsia":"#E040FB","color.gray":"#787B86","color.green":"#4CAF50","color.lime":"#00E676","color.maroon":"#880E4F","color.navy":"#311B92","color.olive":"#808000","color.orange":"#FF9800","color.purple":"#9C27B0","color.red":"#FF5252","color.silver":"#B2B5BE","color.teal":"#00897B","color.white":"#FFFFFF","color.yellow":"#FFEB3B"},{t:Du}=Oe;class Iu{constructor(s){Object.defineProperty(this,"_formatter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isMac",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_keyMaps",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"_getSignatureParams",{enumerable:!0,configurable:!0,writable:!0,value:(r=[],n)=>{const o=new Map,l=n.indexOf("(");for(let p=l+1,d=l;p<n.length;p++)n[p]!==","&&n[p]!==")"||(d++,o.set(n.slice(d,p),d),d=p+1);return r.map(({name:p="",displayType:d,desc:u})=>{const _=[],g=o.get(p),x=g+p.length;return _.push(this._formatter.paragraph(this._formatter.bold(p),this._formatter.italic(d||""))),u&&_.push(Array.isArray(u)?u.join(this._formatter.lineBreak):u),{label:[g,x],documentation:{value:_.join(this._formatter.lineBreak)}}})}}),this._formatter=xe,this._isMac=/(Mac|iPhone|iPod|iPad)/i.test(s)}async onVersionChange(s){const r=await xs(s);r&&(this._keyMaps=r.KEY_MAP_LIST)}getSignatureHelpValues(s,r,n=0,o=0){const l=this._getFuncItems(s);if(!l?.length)return null;const p=this._getSequentialSignatures(s,l),d=this._getActiveIndex(l,r),u=hs.overloadsFuncs?.find(_=>_.name===s&&_.startColumn===n&&o===_.line);return u&&(d.activeSignature=Number(u.index)),{signatures:p,...d}}_getActiveIndex(s,r=[]){let n=0,o=-1;r.some(p=>!!p)||(o=r.length-1);const l=r.pop();if(l)for(const[p,d]of s.entries()){const{args:u}=d;if(u&&u.length){const _=u.findIndex(g=>g.name===l);if(_!=-1){o=_,n=p;break}}}return{activeParameter:o,activeSignature:n}}_getFuncItems(s){return this._keyMaps.functions.get(s)||$t.userFuncs.get(s)||$t.methodFuncs.get(s)}_getSequentialSignatures(s,r){return r.map(n=>{const o=this._getSignatureLabel(s,n);return{label:o,documentation:this._getFormattedSignatureDocumentation(n),parameters:this._getSignatureParams(n.args,o)}})}_getSignatureLabel(s,r,n=!1){const o=[s];return n&&o.push("<type>"),r.args&&(o.push("("),o.push(r.args.map(({name:l})=>l).join(", ")),o.push(")")),o.join("")}_getFormattedSignatureDocumentation(s){const{desc:r}=s,n=[];r&&n.push(Array.isArray(r)?r.join(this._formatter.lineBreak):r);const o=`${this._formatter.code(this._isMac?"⌘":"Ctrl")} +
|
71
71
|
${this._formatter.code("Shift")} +
|
72
72
|
${this._formatter.code("Space")}`;return n.push(this._formatter.lineBreak),n.push(this._formatter.italic(`${o} ${Du(Ce.toTriggerParameterHints)}`)),{value:this._formatter.paragraph(...n)}}}const ll=new Iu(window.navigator.userAgent);class Au{constructor(){Object.defineProperty(this,"_colors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_count",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._colors=ol}getDocumentColors(s){this._count++;const r=[];return s.forEach(n=>{const{range:o}=n;let{matches:l}=n;l=l||[];const p=l[0]||"";let d=null;this._isHexToken(p)?d=this._hexToColor(p):this._isRgbColor(p)?d=this._rgbToColor(p):this._colors[p]?d=this._hexToColor(this._colors[p]):this._isColorExpression(p)&&l[1]&&l[6]&&(d=this._extractNewExpression(l[1],Number(l[6]))),d&&r.push({color:d,range:o})}),r}get _defultColorsRegStr(){return Object.keys(ol).reduce((s,r)=>`${s}|${r}`,"")}get colorMatchesRegStr(){const s=`#[0-9a-fA-F]{6,8}|(\\b(color.rgb\\s*\\((\\s*\\d+\\s*,\\s*){2}(\\s*\\d+\\s*,{0,1}){1,2}\\s*\\)${this._defultColorsRegStr}))`;return`color.new\\s*\\(\\s*(${s})\\s*,\\s*(\\d+)\\s*\\)|${s}`}getDocumentColorPresentations(s,{color:r,range:n}){const o=s.getValueInRange(n);if(this._isHexToken(o)||this._colors[o])return[{label:this._colorRgbRepresentation(r)},{label:this._colorHexRepresentation(r)}];if(this._isColorExpression(o)||this._isRgbColor(o)){const l=this._isColorExpression(o)?this._colorNewRepresentation(r):this._colorRgbRepresentation(r);if(!l)return[];const p=this._colorHexRepresentation(r);return[{label:l,textEdit:{text:l,range:n}},{label:p,textEdit:{text:p,range:n}}]}return null}_hexFromNumber(s){const r=this._denormalize(s).toString(16);return r.length===1?`0${r}`:r}_normalize(s){return s/255}_denormalize(s){return Math.round(255*s)}_normalizeAlpha(s){return(100-s)/100}_denormalizeAlpha(s){return 100-Math.round(100*s)}_extractNewExpression(s,r){let n=null;return this._isHexToken(s)?n=this._hexToColor(s):this._isRgbColor(s)?n=this._rgbToColor(s):this._colors[s]&&(n=this._hexToColor(this._colors[s])),n&&!Number.isNaN(r)?{...n,alpha:this._normalizeAlpha(r)}:null}_colorHexRepresentation(s){const r=this._hexFromNumber(s.red),n=this._hexFromNumber(s.green),o=this._hexFromNumber(s.blue),l=this._hexFromNumber(s.alpha);return`#${r}${n}${o}${s.alpha===1?"":l}`}_colorRgbRepresentation(s){const r=this._denormalize(s.red),n=this._denormalize(s.green),o=this._denormalize(s.blue),l=this._denormalizeAlpha(s.alpha),p=[r,n,o];return l>0&&p.push(l),`color.rgb(${p.join(", ")})`}_colorNewRepresentation(s){const r={...s,alpha:1};return`color.new(${this._colorHexRepresentation(r)}, ${this._denormalizeAlpha(s.alpha)})`}_hexToColor(s){const r=(s=this._isHexToken(s)?s.slice(1):s).length===3||s.length===4,n=r?`${s.slice(0,1)}${s.slice(0,1)}`:s.slice(0,2),o=r?`${s.slice(1,2)}${s.slice(1,2)}`:s.slice(2,4),l=r?`${s.slice(2,3)}${s.slice(2,3)}`:s.slice(4,6),p=(r?`${s.slice(3,4)}${s.slice(3,4)}`:s.slice(6,8))||"ff";return{red:this._normalize(parseInt(n,16)),green:this._normalize(parseInt(o,16)),blue:this._normalize(parseInt(l,16)),alpha:this._normalize(parseInt(p,16))}}_rgbToColor(s){const r=s.replace(/[^\d,]/g,"").split(","),n=this._normalize(Number(r[0])),o=this._normalize(Number(r[1])),l=this._normalize(Number(r[2])),p=this._normalizeAlpha(Number(r[3]))||1;return isNaN(n)||isNaN(o)||isNaN(l)?null:{red:n,green:o,blue:l,alpha:p}}_isHexToken(s){return s.charAt(0)==="#"}_isRgbColor(s){return s.startsWith("color.rgb")}_isColorExpression(s){return s.startsWith("color.new")}}const jn=new Au;class qu{constructor(){Object.defineProperty(this,"_inlayHints",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_importCompleteLibrary",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_funcs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._inlayHints=new Map,this._importCompleteLibrary=new Map,this._funcs=new Map}get inlayHints(){return[...this._inlayHints.values()]}setEditor(s){this._editor=s}async setInlayHints(s){const{endLine:r,endColumn:n,name:o,libraryId:l,libraryName:p}=s;return this._importCompleteLibrary.has(l)?((this._funcs.get(l)?.name!==o||!o&&!this._inlayHints.has(l))&&(this._updateFuncNames(o||p,l),this._inlayHintsHandle(s)),this._importCompleteLibrary.get(l)):(this._inlayHints.set(l,{label:"loading...",position:{column:n,lineNumber:r},paddingLeft:!0}),this.triggerInlayHints(),this._updateFuncNames(o||p,l),setTimeout(()=>{this._inlayHints.has(l)&&this._inlayHintsHandle(s)},2e3),{})}deleteInlayHints(s){this._inlayHints.delete(s)}clearInlayHints(){this._inlayHints.clear()}triggerInlayHints(){this._editor&&this._editor.updateOptions({inlayHints:{fontFamily:String(Date.now())}})}_updateFuncNames(s,r){const n=this._importCompleteLibrary.get(r);if(!n)return;const o=n.functions.map(l=>`${s}.${l.name}`);this._funcs.set(r,{name:s,funcs:o}),this._updateMonarchTokens()}_setNoNameInlayHints(s){const{endLine:r,endColumn:n,libraryId:o,libraryName:l}=s;this._inlayHints.set(o,{label:`as ${l}`,position:{column:n,lineNumber:r},paddingLeft:!0})}_inlayHintsHandle(s){const{name:r,libraryId:n}=s;r?this._inlayHints.delete(n):this._setNoNameInlayHints(s),this.triggerInlayHints()}async _updateMonarchTokens(){const s=await Ta(5);if(!s)return;const r=s.LANGUAGE_MONARCH_TOKENS,n=[...this._funcs.values()].map(p=>p.funcs.join("|")),o=new RegExp("\\b("+n.join("|")+")(?=\\s*\\()"),l=[...r.tokenizer.root];l.splice(15,0,[o,"meta.function-call"]),Me.languages.setMonarchTokensProvider(je,{...r,tokenizer:{...r.tokenizer,root:l}})}}const Ia=new qu;function zu(a,s,r){const n={startLineNumber:s.lineNumber,startColumn:1,endLineNumber:s.lineNumber,endColumn:s.column},o=a.getValueInRange(n);if(/^\/\/\s*@/.test(o))return{suggestions:$t.annotationSuggestions};if(r.triggerCharacter==="@")return{suggestions:[]};const l=o.match(/([\w.]+)$/)||[];if(!l.length)return{suggestions:[]};const p=l[0]?.match(/.*[^\w.]+([\w.]+)(?=\.)|([\w.]+)(?=\.)/),d=p?p[1]?p[1]:p[2]?p[2]:void 0:void 0,u=a.getWordUntilPosition(s),_=hs.parseCurrentInputFunc(o),g={startLineNumber:s.lineNumber,endLineNumber:s.lineNumber,startColumn:u.startColumn,endColumn:u.endColumn},x=a.getValueInRange({...g,startColumn:u.endColumn,endColumn:u.endColumn+1});$t.nextIsBracket=x==="(";let w=cl($t.getSuggestions(d)||[],g);if(l[0]==="."&&(w=[]),_&&!d&&!/=\s*\w+$/.test(o)){const C=cl($t.getArgSuggestions(_.funcName)||[],g);w=w.concat(C)}return{suggestions:w||[],dispose:()=>{}}}function Cu(a){if(a.kind!==1)return a;const{originInsertText:s}=a;return $t.nextIsBracket?a.insertText=s:a.insertText=s+$t.bracketsPostfix,a}function Nu(a,s){const r=hs.parseLineContentFuncVar(s.column,s.lineNumber,a,s);if(r?.libraryId)return{contents:[{value:_u(r)}]};if(r?.docValue?.length){const n=fu(r.docValue,r.index,r.isBuildIn);if(n)return{contents:[{value:n}]}}return{contents:[]}}function Su(a,s){const r={startLineNumber:s.lineNumber,endLineNumber:s.lineNumber,startColumn:1,endColumn:s.column},n=a.getValueInRange(r),o=a.findMatches(String(Tu),r,!0,!1,null,!0),l=a.findMatches(String(ku),r,!0,!1,null,!0),p=o.pop()?.matches,d=l.pop()?.matches;let u=!1;o.length%2===0?p&&p[0]==='"'&&(u=!0):p&&!p[0]&&(u=!0);let _=!1;l.length%2===0?d&&d[0]==="'"&&(_=!0):d&&!d[0]&&(_=!0);const g=hs.parseCurrentInputFuncAndArg(n,_,u);if(g){const{funcName:x,args:w,startIndex:C}=g,M=ll.getSignatureHelpValues(x,w,C+1,s.lineNumber);if(M)return{value:M,dispose:()=>{}}}return null}function Eu(a){let s=a.findMatches(jn.colorMatchesRegStr,!0,!0,!1,null,!0);return s=s.filter(n=>{const o=a.getValueInRange({...n.range,startColumn:0});return o.indexOf("//")===-1||o.indexOf("//")>n.range.endColumn}),jn.getDocumentColors(s)}function Lu(a,s){return jn.getDocumentColorPresentations(a,s)||[]}function Mu(a,s){const r=a.getModel(),n=hs.parseLineContentFuncVar(s.startColumn+1,s.startLineNumber,r);if(!n||n.isBuildIn||!n.docValue||!n.docValue[0].pos)return n?.isBuildIn||n?.docValue?.[0].title?.startsWith("built-in")?n:void 0;const{lineNumber:o,column:l}=n.docValue[0].pos,p={startLineNumber:o,endLineNumber:o,startColumn:l,endColumn:l};a.revealRangeInCenterIfOutsideViewport(p),a.setSelection(p)}function Fu(a,s){return hs.parseLineContentFuncVar(s.column,s.lineNumber,a,s)?{uri:a.uri,range:{startLineNumber:s.lineNumber,endLineNumber:s.lineNumber,startColumn:s.column-1,endColumn:s.column-1}}:null}function cl(a,s){return a.map(r=>(r.range=s,r))}function Ou(){return{hints:Ia.inlayHints,dispose:()=>{}}}var Mr={},Fr=Sd;if(process.env.NODE_ENV==="production")Mr.createRoot=Fr.createRoot,Mr.hydrateRoot=Fr.hydrateRoot;else{var Aa=Fr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Mr.createRoot=function(a,s){Aa.usingClientEntryPoint=!0;try{return Fr.createRoot(a,s)}finally{Aa.usingClientEntryPoint=!1}},Mr.hydrateRoot=function(a,s,r){Aa.usingClientEntryPoint=!0;try{return Fr.hydrateRoot(a,s,r)}finally{Aa.usingClientEntryPoint=!1}}}var nt;(function(a){a.added="added",a.removed="removed",a.modified="modified"})(nt||(nt={}));const Pu=(a,s)=>{const{close:r,retracement:n}=a,[o,l]=I.useState("modified");return I.useImperativeHandle(s,()=>({updateType(p){l(p)}})),T.jsxs("div",{className:`content-popup content-${o}-popup`,children:[T.jsx("div",{className:`triangle-popup triangle-${o}-popup`}),T.jsxs("div",{className:`header-popup header-${o}-popup`,children:[T.jsx("div",{className:"title-popup",children:"Local working changes"}),T.jsx("div",{className:"actions-popup",children:T.jsx("div",{onClick:r,"data-role":"button",className:"button-popup","data-name":"button-close-diff",children:T.jsx("span",{className:"icon-popup",role:"img",children:T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",width:"12",height:"12",children:T.jsx("path",{stroke:"currentColor",strokeWidth:"1.2",d:"m1.5 1.5 9 9m0-9-9 9"})})})})})]}),T.jsx("div",{id:"diffEditorContainer",style:{height:"100%"}})]})},Bu=I.forwardRef(Pu);class Ru{constructor(s,r,n=!0){Object.defineProperty(this,"_domNode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_top",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._id=s,this._domNode=document.createElement("div"),this._domNode.style.display="none",this._domNode.style.width=n?"calc(100% - 134px)":"calc(100% - 14px)",this._domNode.style.height="200px",r?.onDidScrollChange(this.scrollChangeHandler.bind(this)),Mr.createRoot(this._domNode).render(T.jsx(Bu,{ref:o=>this._content=o,close:()=>this._close(),retracement:this._retracement})),this._top=0}_close(){this._domNode.style.display="none"}_retracement(){}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}show(s,r,n){this._top=r,this._content?.updateType(n),this._domNode.style.top=`${s}px`,this._domNode.style.display="block"}hide(){this._domNode.style.display="none"}scrollChangeHandler(s){const r=s.scrollTop;this._domNode.style.top=`${this._top-r}px`}}function ws(){}ws.prototype={diff:function(s,r){var n,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=o.callback;typeof o=="function"&&(l=o,o={}),this.options=o;var p=this;function d(j){return l?(setTimeout(function(){l(void 0,j)},0),!0):j}s=this.castInput(s),r=this.castInput(r),s=this.removeEmpty(this.tokenize(s)),r=this.removeEmpty(this.tokenize(r));var u=r.length,_=s.length,g=1,x=u+_;o.maxEditLength&&(x=Math.min(x,o.maxEditLength));var w=(n=o.timeout)!==null&&n!==void 0?n:1/0,C=Date.now()+w,M=[{oldPos:-1,lastComponent:void 0}],K=this.extractCommon(M[0],r,s,0);if(M[0].oldPos+1>=_&&K+1>=u)return d([{value:this.join(r),count:r.length}]);var G=-1/0,X=1/0;function q(){for(var j=Math.max(G,-g);j<=Math.min(X,g);j+=2){var W=void 0,R=M[j-1],z=M[j+1];R&&(M[j-1]=void 0);var J=!1;if(z){var re=z.oldPos-j;J=z&&0<=re&&re<u}var te=R&&R.oldPos+1<_;if(!J&&!te){M[j]=void 0;continue}if(!te||J&&R.oldPos+1<z.oldPos?W=p.addToPath(z,!0,void 0,0):W=p.addToPath(R,void 0,!0,1),K=p.extractCommon(W,r,s,j),W.oldPos+1>=_&&K+1>=u)return d(Ku(p,W.lastComponent,r,s,p.useLongestToken));M[j]=W,W.oldPos+1>=_&&(X=Math.min(X,j-1)),K+1>=u&&(G=Math.max(G,j+1))}g++}if(l)(function j(){setTimeout(function(){if(g>x||Date.now()>C)return l();q()||j()},0)})();else for(;g<=x&&Date.now()<=C;){var se=q();if(se)return se}},addToPath:function(s,r,n,o){var l=s.lastComponent;return l&&l.added===r&&l.removed===n?{oldPos:s.oldPos+o,lastComponent:{count:l.count+1,added:r,removed:n,previousComponent:l.previousComponent}}:{oldPos:s.oldPos+o,lastComponent:{count:1,added:r,removed:n,previousComponent:l}}},extractCommon:function(s,r,n,o){for(var l=r.length,p=n.length,d=s.oldPos,u=d-o,_=0;u+1<l&&d+1<p&&this.equals(r[u+1],n[d+1]);)u++,d++,_++;return _&&(s.lastComponent={count:_,previousComponent:s.lastComponent}),s.oldPos=d,u},equals:function(s,r){return this.options.comparator?this.options.comparator(s,r):s===r||this.options.ignoreCase&&s.toLowerCase()===r.toLowerCase()},removeEmpty:function(s){for(var r=[],n=0;n<s.length;n++)s[n]&&r.push(s[n]);return r},castInput:function(s){return s},tokenize:function(s){return s.split("")},join:function(s){return s.join("")}};function Ku(a,s,r,n,o){for(var l=[],p;s;)l.push(s),p=s.previousComponent,delete s.previousComponent,s=p;l.reverse();for(var d=0,u=l.length,_=0,g=0;d<u;d++){var x=l[d];if(x.removed){if(x.value=a.join(n.slice(g,g+x.count)),g+=x.count,d&&l[d-1].added){var C=l[d-1];l[d-1]=l[d],l[d]=C}}else{if(!x.added&&o){var w=r.slice(_,_+x.count);w=w.map(function(K,G){var X=n[g+G];return X.length>K.length?X:K}),x.value=a.join(w)}else x.value=a.join(r.slice(_,_+x.count));_+=x.count,x.added||(g+=x.count)}}var M=l[u-1];return u>1&&typeof M.value=="string"&&(M.added||M.removed)&&a.equals("",M.value)&&(l[u-2].value+=M.value,l.pop()),l}var pl=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,dl=/\S/,ml=new ws;ml.equals=function(a,s){return this.options.ignoreCase&&(a=a.toLowerCase(),s=s.toLowerCase()),a===s||this.options.ignoreWhitespace&&!dl.test(a)&&!dl.test(s)},ml.tokenize=function(a){for(var s=a.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),r=0;r<s.length-1;r++)!s[r+1]&&s[r+2]&&pl.test(s[r])&&pl.test(s[r+2])&&(s[r]+=s[r+2],s.splice(r+1,2),r--);return s};var Gn=new ws;Gn.tokenize=function(a){this.options.stripTrailingCr&&(a=a.replace(/\r\n/g,`
|
73
|
-
`));var s=[],r=a.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var n=0;n<r.length;n++){var o=r[n];n%2&&!this.options.newlineIsToken?s[s.length-1]+=o:(this.options.ignoreWhitespace&&(o=o.trim()),s.push(o))}return s};function Uu(a,s,r){return Gn.diff(a,s,r)}var $u=new ws;$u.tokenize=function(a){return a.split(/(\S.+?[.!?])(?=\s+|$)/)};var Hu=new ws;Hu.tokenize=function(a){return a.split(/([{}:;,]|\s+)/)};function qa(a){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?qa=function(s){return typeof s}:qa=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},qa(a)}var ju=Object.prototype.toString,Or=new ws;Or.useLongestToken=!0,Or.tokenize=Gn.tokenize,Or.castInput=function(a){var s=this.options,r=s.undefinedReplacement,n=s.stringifyReplacer,o=n===void 0?function(l,p){return typeof p>"u"?r:p}:n;return typeof a=="string"?a:JSON.stringify(Wn(a,null,null,o),o," ")},Or.equals=function(a,s){return ws.prototype.equals.call(Or,a.replace(/,([\r\n])/g,"$1"),s.replace(/,([\r\n])/g,"$1"))};function Wn(a,s,r,n,o){s=s||[],r=r||[],n&&(a=n(o,a));var l;for(l=0;l<s.length;l+=1)if(s[l]===a)return r[l];var p;if(ju.call(a)==="[object Array]"){for(s.push(a),p=new Array(a.length),r.push(p),l=0;l<a.length;l+=1)p[l]=Wn(a[l],s,r,n,o);return s.pop(),r.pop(),p}if(a&&a.toJSON&&(a=a.toJSON()),qa(a)==="object"&&a!==null){s.push(a),p={},r.push(p);var d=[],u;for(u in a)a.hasOwnProperty(u)&&d.push(u);for(d.sort(),l=0;l<d.length;l+=1)u=d[l],p[u]=Wn(a[u],s,r,n,u);s.pop(),r.pop()}else p=a;return p}var Xn=new ws;Xn.tokenize=function(a){return a.slice()},Xn.join=Xn.removeEmpty=function(a){return a};class Gu{constructor(s,r,n=""){Object.defineProperty(this,"_editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_monaco",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalModel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_oldDecorations",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_diffEditor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_diffPopupWidget",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_didChangeListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onMouseDownListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._editor=s,this._monaco=r,this._originalModel=this._monaco.editor.createModel(n,je),this._oldDecorations=[],this._init(),this._eventListening()}_init(){this._changeEvent(),this._didChangeListener=this._editor.getModel()?.onDidChangeContent(()=>this._changeEvent())}update(s){if(this._originalModel=this._monaco.editor.createModel(s,je),s!==this._editor.getModel()?.getValue()){this._changeEvent();return}this._editor.getModel()?.deltaDecorations(this._oldDecorations,[]),this._oldDecorations=[]}dispose(){this._diffPopupWidget&&(this._diffPopupWidget.hide(),this._editor.removeOverlayWidget(this._diffPopupWidget)),this._didChangeListener?.dispose(),this._onMouseDownListener?.dispose(),this._editor.getModel()?.deltaDecorations(this._oldDecorations,[]),this._oldDecorations=[],this._diffEditor?.dispose(),this._diffEditor=void 0}_changesHandle(s){let r=0,n;const o=[];let l=0;for(const p of s){const{added:d,removed:u,count:_=1,value:g}=p;d?n&&n.removed?(r=this._changeHandle(o,r,l,_,nt.modified),l=0,n=void 0):(n&&n.added&&(r=this._changeHandle(o,r,l,n.count||1,nt.added),l=0),n=p):u?n&&n.added?(r=this._changeHandle(o,r,l,n.count||1,nt.modified),l=0,n=void 0):(n&&n.removed&&this._addDecorationList(o,r,nt.removed),n=p):/^\n+$/.test(g)?n&&(n.added||n.removed)?l=_:r+=_:(n&&n.added?(r=this._changeHandle(o,r,l,n.count||1,nt.added),l=0,n=void 0):n&&n.removed&&(this._addDecorationList(o,r,nt.removed),n=void 0),r+=_)}return n&&n.added?r=this._changeHandle(o,r,l,n.count||1,nt.added):n&&n.removed&&this._addDecorationList(o,r,nt.removed),o}_changeHandle(s,r,n,o,l){for(let p=1;p<=o;p++)this._addDecorationList(s,r+p,l);return r+=o+n,r}_addDecorationList(s,r,n){s.push({range:new this._monaco.Range(r,1,r,1),options:{isWholeLine:!0,linesDecorationsClassName:`line-${n} line-decoration_${n}`}})}_changeEvent(){const s=Uu(this._originalModel.getValue(),this._editor.getModel()?.getValue()||""),r=this._changesHandle(s),n=this._editor.getModel()?.deltaDecorations(this._oldDecorations,r)||[];this._oldDecorations=n}_eventListening(){const s=new Ru("diff.popup.widget",this._editor);this._editor.addOverlayWidget(s),this._onMouseDownListener=this._editor.onMouseDown(r=>this._onMouseDownHandle(r)),this._diffPopupWidget=s}_onMouseDownHandle(s){const r=s.target.element?.classList,n=r?.contains(`line-${nt.added}`),o=r?.contains(`line-${nt.modified}`),l=r?.contains(`line-${nt.removed}`);if(n||o||l){const p=s?.target?.position?.lineNumber||0,d=this._editor?.getTopForLineNumber(p+1)||0,u=this._editor?.getScrollTop()||0,_=n?nt.added:o?nt.modified:nt.removed;this._diffPopupWidget?.show(d-u,d,_),this._diffEditor||(this._diffEditor=this._createDiffEditor()),this._diffEditor.setModel({original:this._originalModel,modified:this._editor.getModel()}),this._diffEditor.revealLineInCenter(p+1)}}_createDiffEditor(){return this._monaco.editor.createDiffEditor(document.getElementById("diffEditorContainer"),{renderSideBySide:!1,quickSuggestions:!1,suggestOnTriggerCharacters:!1,hover:{enabled:!1},parameterHints:{enabled:!1}})}}class Wu{constructor(s,r,n){Object.defineProperty(this,"_editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_monaco",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_decorations",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_changPositionListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScript",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onActionTrigger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onLinkOpen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_registerList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_version",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._editor=s,this._monaco=r,this._onActionTrigger=n,this._init()}addLinkOpenFunc(s){this._onLinkOpen=s}updateActionTrigger(s){this._onActionTrigger=s}setModelMarkers(s){this._monaco.editor.setModelMarkers(this._editor.getModel(),"owner",s)}addDiffDecorations(){this._decorations||(this._decorations=new Gu(this._editor,this._monaco,this._originalScript))}removeDiffDecorations(){this._decorations?.dispose(),this._decorations=void 0}setValue(s){this._editor.setValue(s),this._editor.setScrollTop(0),this.focus()}setPosition(s){this._editor?.setPosition(s),this._editor?.revealPositionInCenter(s),this.focus()}focus(){this._editor?.focus()}setOriginalScript(s){this._originalScript=s,this._decorations?.update(s)}getEditorLayout(){const s=this._editor.getContentHeight(),r=this._editor.getModel()?.getLineCount();return{contentHeight:s,lineCount:r}}setEditorLayout(s,r){this._editor?.layout({height:s,width:r||this._editor?.getContainerDomNode().clientWidth})}getVersion(){const s=this._editor?.getModel()?.findMatches("\\s*//\\s*@version\\s*=\\s*([0-9])",!0,!0,!1,null,!0);let r=Qt;if(s&&s.length>0)for(const n of s){const o=n.matches?.[1];if(o){r=parseInt(o);break}}return r=r<3?3:r>6?6:r,this.updateOptions(r),r}async updateOptions(s){if(s===this._version)return;const r=await Ta(s);if(!r)return;this._version=s;const n=r.LANGUAGE_MONARCH_TOKENS,o=r.CONFIGURATION;$t.initBuiltinsTrees(s),hs.onVersionChange(s),ll.onVersionChange(s),this._monaco.languages.setMonarchTokensProvider(je,n),this._monaco.languages.setLanguageConfiguration(je,o)}_init(){this._register(),this._setOptions(),this._addCommands(),this._addActions(),this._setCursorPosition(),this._onTabSizeChange()}_onTabSizeChange(){const s=this._editor.getModel();s?.onDidChangeOptions(r=>{if(r.tabSize&&!r.indentSize){const n=s?.getOptions().tabSize||4;s?.updateOptions({indentSize:n})}})}_setCursorPosition(){const s=localStorage.getItem(Un);this._editor.setPosition(s?JSON.parse(s):{lineNumber:1,column:1})}_register(){this._monaco.languages.register({id:je});const s=this._monaco.languages.registerCompletionItemProvider(je,{triggerCharacters:[".","@"],provideCompletionItems:zu,resolveCompletionItem:Cu});this._registerList.push(s);const r=this._monaco.languages.registerHoverProvider(je,{provideHover:Nu});this._registerList.push(r);const n=this._monaco.languages.registerSignatureHelpProvider(je,{signatureHelpTriggerCharacters:["(",","],provideSignatureHelp:Su});this._registerList.push(n);const o=this._monaco.languages.registerColorProvider(je,{provideColorPresentations:Lu,provideDocumentColors:Eu});this._registerList.push(o);const l=this._monaco.editor.registerEditorOpener({openCodeEditor:(_,g,x)=>{const w=Mu(_,x);if(w){const{index:C,docValue:M}=w,{title:K,name:G}=M[C];let X="";switch(K){case Ce.keywords:X="kw";break;case Ce.methods:case Ce.functions:X="fun";break;case Ce.variables:X="var";break;case Ce.types:X="type";break;case Ce.constants:X="const";break}this._onLinkOpen&&this._onLinkOpen(`${X}_${G}`,C,this._version)}return!0}});this._registerList.push(l);const p=this._monaco.editor.registerLinkOpener({open:_=>(this._onLinkOpen&&_.fragment&&this._onLinkOpen(_.fragment,0,this._version),!!_.fragment)});this._registerList.push(p);const d=this._monaco.languages.registerDefinitionProvider(je,{provideDefinition:Fu});this._registerList.push(d);const u=this._monaco.languages.registerInlayHintsProvider(je,{provideInlayHints:Ou});this._registerList.push(u)}_setOptions(){this._monaco.editor.defineTheme("vs-dark",Hn),this._monaco.editor.defineTheme("vs",$n)}_addCommands(){this._monaco.editor.addCommand({id:"tcc.editor.function",run:(s,r)=>{if($t.nextIsBracket){const n=this._editor.getPosition();n&&this._editor.setPosition(Object.assign(n,{column:n.column+1}))}this._editor.getAction(r)?.run()}})}_addActions(){this._editor.addAction({id:"tcc-save-script",label:Oe.t("save script"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyS],contextMenuGroupId:"9_modification",contextMenuOrder:1,run:()=>{this._onActionTrigger&&this._onActionTrigger(F.Actions.Save)}}),this._editor.addAction({id:"tcc-find-replace-line",label:Oe.t("find/replace"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyF],contextMenuGroupId:"9_cutcopypaste",contextMenuOrder:5,run:()=>{this.openFind(),this._onActionTrigger&&this._onActionTrigger(F.Actions.Find)}}),this._editor.addAction({id:"tcc-trigger-console-script",label:Oe.t("toggle console"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.Backquote],contextMenuGroupId:"z_commands",contextMenuOrder:0,run:()=>{this._onActionTrigger&&this._onActionTrigger(F.Actions.TriggerConsole)}}),this._editor.addAction({id:"tcc-run-script",label:"运行脚本",keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.Enter],run:()=>{this._onActionTrigger&&this._onActionTrigger(F.Actions.RunScript)}}),this._editor.addAction({id:"tcc-open-script",label:Oe.t("open script"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyO],contextMenuGroupId:"9_modification",contextMenuOrder:2,run:()=>{this._onActionTrigger&&this._onActionTrigger(F.Actions.Open)}}),this._editor.addAction({id:"tcc-new-window-script",label:Oe.t("open editor in new window"),keybindings:[this._monaco.KeyMod.Shift|this._monaco.KeyMod.Alt|this._monaco.KeyCode.KeyW],contextMenuGroupId:"9_modification",contextMenuOrder:3,run:()=>{this._onActionTrigger&&this._onActionTrigger(F.Actions.NewWindow)}}),this._editor.addAction({id:"tcc-new-tab-script",label:Oe.t("open editor in new tab"),keybindings:[this._monaco.KeyMod.Shift|this._monaco.KeyMod.Alt|this._monaco.KeyCode.KeyT],contextMenuGroupId:"9_modification",contextMenuOrder:4,run:()=>{this._onActionTrigger&&this._onActionTrigger(F.Actions.NewTab)}})}openFind(){this.focus(),this._editor.trigger("click","actions.find",null)}gotoLine(){this.focus(),this._editor.trigger("click","editor.action.gotoLine",null)}onChangeCursorPosition(s){this._changPositionListener&&this._changPositionListener.dispose();const r=localStorage.getItem(Un);s&&s(r?JSON.parse(r):{lineNumber:1,column:1}),this._changPositionListener=this._editor.onDidChangeCursorPosition(n=>{localStorage.setItem(Un,JSON.stringify(n.position)),s&&s(n.position)})}dispose(){for(const s of this._registerList)s.dispose();this._editor?.dispose()}}/**
|
73
|
+
`));var s=[],r=a.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var n=0;n<r.length;n++){var o=r[n];n%2&&!this.options.newlineIsToken?s[s.length-1]+=o:(this.options.ignoreWhitespace&&(o=o.trim()),s.push(o))}return s};function Uu(a,s,r){return Gn.diff(a,s,r)}var $u=new ws;$u.tokenize=function(a){return a.split(/(\S.+?[.!?])(?=\s+|$)/)};var Hu=new ws;Hu.tokenize=function(a){return a.split(/([{}:;,]|\s+)/)};function qa(a){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?qa=function(s){return typeof s}:qa=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},qa(a)}var ju=Object.prototype.toString,Or=new ws;Or.useLongestToken=!0,Or.tokenize=Gn.tokenize,Or.castInput=function(a){var s=this.options,r=s.undefinedReplacement,n=s.stringifyReplacer,o=n===void 0?function(l,p){return typeof p>"u"?r:p}:n;return typeof a=="string"?a:JSON.stringify(Wn(a,null,null,o),o," ")},Or.equals=function(a,s){return ws.prototype.equals.call(Or,a.replace(/,([\r\n])/g,"$1"),s.replace(/,([\r\n])/g,"$1"))};function Wn(a,s,r,n,o){s=s||[],r=r||[],n&&(a=n(o,a));var l;for(l=0;l<s.length;l+=1)if(s[l]===a)return r[l];var p;if(ju.call(a)==="[object Array]"){for(s.push(a),p=new Array(a.length),r.push(p),l=0;l<a.length;l+=1)p[l]=Wn(a[l],s,r,n,o);return s.pop(),r.pop(),p}if(a&&a.toJSON&&(a=a.toJSON()),qa(a)==="object"&&a!==null){s.push(a),p={},r.push(p);var d=[],u;for(u in a)a.hasOwnProperty(u)&&d.push(u);for(d.sort(),l=0;l<d.length;l+=1)u=d[l],p[u]=Wn(a[u],s,r,n,u);s.pop(),r.pop()}else p=a;return p}var Xn=new ws;Xn.tokenize=function(a){return a.slice()},Xn.join=Xn.removeEmpty=function(a){return a};class Gu{constructor(s,r,n=""){Object.defineProperty(this,"_editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_monaco",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalModel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_oldDecorations",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_diffEditor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_diffPopupWidget",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_didChangeListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onMouseDownListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._editor=s,this._monaco=r,this._originalModel=this._monaco.editor.createModel(n,je),this._oldDecorations=[],this._init(),this._eventListening()}_init(){this._changeEvent(),this._didChangeListener=this._editor.getModel()?.onDidChangeContent(()=>this._changeEvent())}update(s){if(this._originalModel=this._monaco.editor.createModel(s,je),s!==this._editor.getModel()?.getValue()){this._changeEvent();return}this._editor.getModel()?.deltaDecorations(this._oldDecorations,[]),this._oldDecorations=[]}dispose(){this._diffPopupWidget&&(this._diffPopupWidget.hide(),this._editor.removeOverlayWidget(this._diffPopupWidget)),this._didChangeListener?.dispose(),this._onMouseDownListener?.dispose(),this._editor.getModel()?.deltaDecorations(this._oldDecorations,[]),this._oldDecorations=[],this._diffEditor?.dispose(),this._diffEditor=void 0}_changesHandle(s){let r=0,n;const o=[];let l=0;for(const p of s){const{added:d,removed:u,count:_=1,value:g}=p;d?n&&n.removed?(r=this._changeHandle(o,r,l,_,nt.modified),l=0,n=void 0):(n&&n.added&&(r=this._changeHandle(o,r,l,n.count||1,nt.added),l=0),n=p):u?n&&n.added?(r=this._changeHandle(o,r,l,n.count||1,nt.modified),l=0,n=void 0):(n&&n.removed&&this._addDecorationList(o,r,nt.removed),n=p):/^\n+$/.test(g)?n&&(n.added||n.removed)?l=_:r+=_:(n&&n.added?(r=this._changeHandle(o,r,l,n.count||1,nt.added),l=0,n=void 0):n&&n.removed&&(this._addDecorationList(o,r,nt.removed),n=void 0),r+=_)}return n&&n.added?r=this._changeHandle(o,r,l,n.count||1,nt.added):n&&n.removed&&this._addDecorationList(o,r,nt.removed),o}_changeHandle(s,r,n,o,l){for(let p=1;p<=o;p++)this._addDecorationList(s,r+p,l);return r+=o+n,r}_addDecorationList(s,r,n){s.push({range:new this._monaco.Range(r,1,r,1),options:{isWholeLine:!0,linesDecorationsClassName:`line-${n} line-decoration_${n}`}})}_changeEvent(){const s=Uu(this._originalModel.getValue(),this._editor.getModel()?.getValue()||""),r=this._changesHandle(s),n=this._editor.getModel()?.deltaDecorations(this._oldDecorations,r)||[];this._oldDecorations=n}_eventListening(){const s=new Ru("diff.popup.widget",this._editor);this._editor.addOverlayWidget(s),this._onMouseDownListener=this._editor.onMouseDown(r=>this._onMouseDownHandle(r)),this._diffPopupWidget=s}_onMouseDownHandle(s){const r=s.target.element?.classList,n=r?.contains(`line-${nt.added}`),o=r?.contains(`line-${nt.modified}`),l=r?.contains(`line-${nt.removed}`);if(n||o||l){const p=s?.target?.position?.lineNumber||0,d=this._editor?.getTopForLineNumber(p+1)||0,u=this._editor?.getScrollTop()||0,_=n?nt.added:o?nt.modified:nt.removed;this._diffPopupWidget?.show(d-u,d,_),this._diffEditor||(this._diffEditor=this._createDiffEditor()),this._diffEditor.setModel({original:this._originalModel,modified:this._editor.getModel()}),this._diffEditor.revealLineInCenter(p+1)}}_createDiffEditor(){return this._monaco.editor.createDiffEditor(document.getElementById("diffEditorContainer"),{renderSideBySide:!1,quickSuggestions:!1,suggestOnTriggerCharacters:!1,hover:{enabled:!1},parameterHints:{enabled:!1}})}}class Wu{constructor(s,r,n){Object.defineProperty(this,"_editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_monaco",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_decorations",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_changPositionListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScript",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onActionTrigger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onLinkOpen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_registerList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_version",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._editor=s,this._monaco=r,this._onActionTrigger=n,this._init()}addLinkOpenFunc(s){this._onLinkOpen=s}updateActionTrigger(s){this._onActionTrigger=s}setModelMarkers(s){this._monaco.editor.setModelMarkers(this._editor.getModel(),"owner",s)}addDiffDecorations(){this._decorations||(this._decorations=new Gu(this._editor,this._monaco,this._originalScript))}removeDiffDecorations(){this._decorations?.dispose(),this._decorations=void 0}setValue(s){this._editor.setValue(s),this._editor.setScrollTop(0),this.focus()}setPosition(s){this._editor?.setPosition(s),this._editor?.revealPositionInCenter(s),this.focus()}focus(){this._editor?.focus()}setOriginalScript(s){this._originalScript=s,this._decorations?.update(s)}getEditorLayout(){const s=this._editor.getContentHeight(),r=this._editor.getModel()?.getLineCount();return{contentHeight:s,lineCount:r}}setEditorLayout(s,r){this._editor?.layout({height:s,width:r||this._editor?.getContainerDomNode().clientWidth})}getVersion(){const s=this._editor?.getModel()?.findMatches("\\s*//\\s*@version\\s*=\\s*([0-9])",!0,!0,!1,null,!0);let r=Qt;if(s&&s.length>0)for(const n of s){const o=n.matches?.[1];if(o){r=parseInt(o);break}}return r=r<3?3:r>6?6:r,this.updateOptions(r),r}async updateOptions(s){if(s===this._version)return;const r=await Ta(s);if(!r)return;this._version=s;const n=r.LANGUAGE_MONARCH_TOKENS,o=r.CONFIGURATION;$t.initBuiltinsTrees(s),hs.onVersionChange(s),ll.onVersionChange(s),this._monaco.languages.setMonarchTokensProvider(je,n),this._monaco.languages.setLanguageConfiguration(je,o)}_init(){this._register(),this._setOptions(),this._addCommands(),this._addActions(),this._setCursorPosition(),this._onTabSizeChange()}_onTabSizeChange(){const s=this._editor.getModel();s?.onDidChangeOptions(r=>{if(r.tabSize&&!r.indentSize){const n=s?.getOptions().tabSize||4;s?.updateOptions({indentSize:n})}})}_setCursorPosition(){const s=localStorage.getItem(Un);this._editor.setPosition(s?JSON.parse(s):{lineNumber:1,column:1})}_register(){this._monaco.languages.register({id:je});const s=this._monaco.languages.registerCompletionItemProvider(je,{triggerCharacters:[".","@"],provideCompletionItems:zu,resolveCompletionItem:Cu});this._registerList.push(s);const r=this._monaco.languages.registerHoverProvider(je,{provideHover:Nu});this._registerList.push(r);const n=this._monaco.languages.registerSignatureHelpProvider(je,{signatureHelpTriggerCharacters:["(",","],provideSignatureHelp:Su});this._registerList.push(n);const o=this._monaco.languages.registerColorProvider(je,{provideColorPresentations:Lu,provideDocumentColors:Eu});this._registerList.push(o);const l=this._monaco.editor.registerEditorOpener({openCodeEditor:(_,g,x)=>{const w=Mu(_,x);if(w){const{index:C,docValue:M}=w,{title:K,name:G}=M[C];let X="";switch(K){case Ce.keywords:X="kw";break;case Ce.methods:case Ce.functions:X="fun";break;case Ce.variables:X="var";break;case Ce.types:X="type";break;case Ce.constants:X="const";break}this._onLinkOpen&&this._onLinkOpen(`${X}_${G}`,C,this._version)}return!0}});this._registerList.push(l);const p=this._monaco.editor.registerLinkOpener({open:_=>(this._onLinkOpen&&_.fragment&&this._onLinkOpen(_.fragment,0,this._version),!!_.fragment)});this._registerList.push(p);const d=this._monaco.languages.registerDefinitionProvider(je,{provideDefinition:Fu});this._registerList.push(d);const u=this._monaco.languages.registerInlayHintsProvider(je,{provideInlayHints:Ou});this._registerList.push(u)}_setOptions(){this._monaco.editor.defineTheme("vs-dark",Hn),this._monaco.editor.defineTheme("vs",$n)}_addCommands(){this._monaco.editor.addCommand({id:"tcc.editor.function",run:(s,r)=>{if($t.nextIsBracket){const n=this._editor.getPosition();n&&this._editor.setPosition(Object.assign(n,{column:n.column+1}))}this._editor.getAction(r)?.run()}})}_addActions(){this._editor.addAction({id:"tcc-save-script",label:Oe.t("save script"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyS],contextMenuGroupId:"9_modification",contextMenuOrder:1,run:()=>{this._onActionTrigger&&this._onActionTrigger(F.Actions.Save)}}),this._editor.addAction({id:"tcc-find-replace-line",label:Oe.t("find/replace"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyF],contextMenuGroupId:"9_cutcopypaste",contextMenuOrder:5,run:()=>{this.openFind(),this._onActionTrigger&&this._onActionTrigger(F.Actions.Find)}}),this._editor.addAction({id:"tcc-trigger-console-script",label:Oe.t("toggle console"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.Backquote],contextMenuGroupId:"z_commands",contextMenuOrder:0,run:()=>{this._onActionTrigger&&this._onActionTrigger(F.Actions.TriggerConsole)}}),this._editor.addAction({id:"tcc-run-script",label:"运行脚本",keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.Enter],run:()=>{this._onActionTrigger&&this._onActionTrigger(F.Actions.RunScript)}}),this._editor.addAction({id:"tcc-open-script",label:Oe.t("open script"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyO],contextMenuGroupId:"9_modification",contextMenuOrder:2,run:()=>{this._onActionTrigger&&this._onActionTrigger(F.Actions.Open)}}),this._editor.addAction({id:"tcc-new-window-script",label:Oe.t("open editor in new window"),keybindings:[this._monaco.KeyMod.Shift|this._monaco.KeyMod.Alt|this._monaco.KeyCode.KeyW],contextMenuGroupId:"9_modification",contextMenuOrder:3,run:()=>{this._onActionTrigger&&this._onActionTrigger(F.Actions.NewWindow)}}),this._editor.addAction({id:"tcc-new-tab-script",label:Oe.t("open editor in new tab"),keybindings:[this._monaco.KeyMod.Shift|this._monaco.KeyMod.Alt|this._monaco.KeyCode.KeyT],contextMenuGroupId:"9_modification",contextMenuOrder:4,run:()=>{this._onActionTrigger&&this._onActionTrigger(F.Actions.NewTab)}}),this._editor.addCommand(this._monaco.KeyMod.Alt|this._monaco.KeyCode.KeyZ,()=>{const s=this._editor.getOption(this._monaco.editor.EditorOption.wordWrap);this._editor.updateOptions({wordWrap:s==="off"?"on":"off"})})}openFind(){this.focus(),this._editor.trigger("click","actions.find",null)}gotoLine(){this.focus(),this._editor.trigger("click","editor.action.gotoLine",null)}onChangeCursorPosition(s){this._changPositionListener&&this._changPositionListener.dispose();const r=localStorage.getItem(Un);s&&s(r?JSON.parse(r):{lineNumber:1,column:1}),this._changPositionListener=this._editor.onDidChangeCursorPosition(n=>{localStorage.setItem(Un,JSON.stringify(n.position)),s&&s(n.position)})}dispose(){for(const s of this._registerList)s.dispose();this._editor?.dispose()}}/**
|
74
74
|
* @license
|
75
75
|
* Copyright 2019 Google LLC
|
76
76
|
* SPDX-License-Identifier: Apache-2.0
|
77
|
-
*/const ul=Symbol("Comlink.proxy"),Xu=Symbol("Comlink.endpoint"),Vu=Symbol("Comlink.releaseProxy"),Vn=Symbol("Comlink.finalizer"),za=Symbol("Comlink.thrown"),yl=a=>typeof a=="object"&&a!==null||typeof a=="function",Yu={canHandle:a=>yl(a)&&a[ul],serialize(a){const{port1:s,port2:r}=new MessageChannel;return fl(a,s),[r,[r]]},deserialize(a){return a.start(),Yn(a)}},Qu={canHandle:a=>yl(a)&&za in a,serialize({value:a}){let s;return a instanceof Error?s={isError:!0,value:{message:a.message,name:a.name,stack:a.stack}}:s={isError:!1,value:a},[s,[]]},deserialize(a){throw a.isError?Object.assign(new Error(a.value.message),a.value):a.value}},_l=new Map([["proxy",Yu],["throw",Qu]]);function Zu(a,s){for(const r of a)if(s===r||r==="*"||r instanceof RegExp&&r.test(s))return!0;return!1}function fl(a,s=globalThis,r=["*"]){s.addEventListener("message",function n(o){if(!o||!o.data)return;if(!Zu(r,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:l,type:p,path:d}=Object.assign({path:[]},o.data),u=(o.data.argumentList||[]).map(Ms);let _;try{const g=d.slice(0,-1).reduce((w,C)=>w[C],a),x=d.reduce((w,C)=>w[C],a);switch(p){case"GET":_=x;break;case"SET":g[d.slice(-1)[0]]=Ms(o.data.value),_=!0;break;case"APPLY":_=x.apply(g,u);break;case"CONSTRUCT":{const w=new x(...u);_=Zn(w)}break;case"ENDPOINT":{const{port1:w,port2:C}=new MessageChannel;fl(a,C),_=ry(w,[w])}break;case"RELEASE":_=void 0;break;default:return}}catch(g){_={value:g,[za]:0}}Promise.resolve(_).catch(g=>({value:g,[za]:0})).then(g=>{const[x,w]=Ea(g);s.postMessage(Object.assign(Object.assign({},x),{id:l}),w),p==="RELEASE"&&(s.removeEventListener("message",n),gl(s),Vn in a&&typeof a[Vn]=="function"&&a[Vn]())}).catch(g=>{const[x,w]=Ea({value:new TypeError("Unserializable return value"),[za]:0});s.postMessage(Object.assign(Object.assign({},x),{id:l}),w)})}),s.start&&s.start()}function Ju(a){return a.constructor.name==="MessagePort"}function gl(a){Ju(a)&&a.close()}function Yn(a,s){return Qn(a,[],s)}function Ca(a){if(a)throw new Error("Proxy has been released and is not useable")}function bl(a){return er(a,{type:"RELEASE"}).then(()=>{gl(a)})}const Na=new WeakMap,Sa="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const s=(Na.get(a)||0)-1;Na.set(a,s),s===0&&bl(a)});function ey(a,s){const r=(Na.get(s)||0)+1;Na.set(s,r),Sa&&Sa.register(a,s,a)}function ty(a){Sa&&Sa.unregister(a)}function Qn(a,s=[],r=function(){}){let n=!1;const o=new Proxy(r,{get(l,p){if(Ca(n),p===Vu)return()=>{ty(o),bl(a),n=!0};if(p==="then"){if(s.length===0)return{then:()=>o};const d=er(a,{type:"GET",path:s.map(u=>u.toString())}).then(Ms);return d.then.bind(d)}return Qn(a,[...s,p])},set(l,p,d){Ca(n);const[u,_]=Ea(d);return er(a,{type:"SET",path:[...s,p].map(g=>g.toString()),value:u},_).then(Ms)},apply(l,p,d){Ca(n);const u=s[s.length-1];if(u===Xu)return er(a,{type:"ENDPOINT"}).then(Ms);if(u==="bind")return Qn(a,s.slice(0,-1));const[_,g]=xl(d);return er(a,{type:"APPLY",path:s.map(x=>x.toString()),argumentList:_},g).then(Ms)},construct(l,p){Ca(n);const[d,u]=xl(p);return er(a,{type:"CONSTRUCT",path:s.map(_=>_.toString()),argumentList:d},u).then(Ms)}});return ey(o,a),o}function sy(a){return Array.prototype.concat.apply([],a)}function xl(a){const s=a.map(Ea);return[s.map(r=>r[0]),sy(s.map(r=>r[1]))]}const hl=new WeakMap;function ry(a,s){return hl.set(a,s),a}function Zn(a){return Object.assign(a,{[ul]:!0})}function Ea(a){for(const[s,r]of _l)if(r.canHandle(a)){const[n,o]=r.serialize(a);return[{type:"HANDLER",name:s,value:n},o]}return[{type:"RAW",value:a},hl.get(a)||[]]}function Ms(a){switch(a.type){case"HANDLER":return _l.get(a.name).deserialize(a.value);case"RAW":return a.value}}function er(a,s,r){return new Promise(n=>{const o=ay();a.addEventListener("message",function l(p){!p.data||!p.data.id||p.data.id!==o||(a.removeEventListener("message",l),n(p.data))}),a.start&&a.start(),a.postMessage(Object.assign({id:o},s),r)})}function ay(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const wl=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-CO6t0Tv4.js").href:new URL("assets/scriptsRunWorker-CO6t0Tv4.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ma&&ma.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Run MineScript Server"});wl.onerror=a=>{console.error(a)};async function vl(a){return await Ia.setInlayHints(a)}const Tl=Yn(wl),kl=Yn(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-CNzNddjG.js").href:new URL("assets/parserTccWorker-CNzNddjG.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ma&&ma.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Parser MineScript Server"}));async function Dl(a,s=!1,r=Qt){const n=a.match(/\s*\/\/\s*@version\s*=\s*([0-9])/)?.[1];n&&(r=parseInt(n),r=r<3?3:r>6?6:r);const o=await xs(r);if(!o)return;const{functions:l,types:p,constants:d,variables:u,methods:_}=o.KEY_MAP_LIST;return await kl.parseTcc(a,s,Zn(vl),{functions:Object.fromEntries(l),methods:Object.fromEntries(_),types:Object.fromEntries(p),constants:Object.fromEntries(d),variables:Object.fromEntries(u)},r)}async function ny(a,s){const r=await xs(5);if(!r)return;const{functions:n,types:o,constants:l,variables:p,methods:d}=r.KEY_MAP_LIST;return await kl.parseLibraryCode(a,s,Zn(vl),{functions:Object.fromEntries(n),methods:Object.fromEntries(d),types:Object.fromEntries(o),constants:Object.fromEntries(l),variables:Object.fromEntries(p)})}async function iy(a,s,r=!0,n=Qt){return await Tl.runScript(a,s,r,n)}async function oy(a){return await Tl.removeScript(a)}function ly(a){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-BxEYBjj-.js").href:new URL("assets/editor.worker-BxEYBjj-.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{type:"module",name:a?.name})}const{slice:cy,forEach:py}=[];function dy(a){return py.call(cy.call(arguments,1),s=>{if(s)for(const r in s)a[r]===void 0&&(a[r]=s[r])}),a}const Il=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,my=(a,s,r)=>{const n=r||{};n.path=n.path||"/";const o=encodeURIComponent(s);let l=`${a}=${o}`;if(n.maxAge>0){const p=n.maxAge-0;if(Number.isNaN(p))throw new Error("maxAge should be a Number");l+=`; Max-Age=${Math.floor(p)}`}if(n.domain){if(!Il.test(n.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${n.domain}`}if(n.path){if(!Il.test(n.path))throw new TypeError("option path is invalid");l+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");l+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(l+="; HttpOnly"),n.secure&&(l+="; Secure"),n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return l},Al={create(a,s,r,n){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),n&&(o.domain=n),document.cookie=my(a,encodeURIComponent(s),o)},read(a){const s=`${a}=`,r=document.cookie.split(";");for(let n=0;n<r.length;n++){let o=r[n];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(s)===0)return o.substring(s.length,o.length)}return null},remove(a){this.create(a,"",-1)}};var uy={name:"cookie",lookup(a){let{lookupCookie:s}=a;if(s&&typeof document<"u")return Al.read(s)||void 0},cacheUserLanguage(a,s){let{lookupCookie:r,cookieMinutes:n,cookieDomain:o,cookieOptions:l}=s;r&&typeof document<"u"&&Al.create(r,a,n,o,l)}},yy={name:"querystring",lookup(a){let{lookupQuerystring:s}=a,r;if(typeof window<"u"){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const l=n.substring(1).split("&");for(let p=0;p<l.length;p++){const d=l[p].indexOf("=");d>0&&l[p].substring(0,d)===s&&(r=l[p].substring(d+1))}}return r}};let Pr=null;const ql=()=>{if(Pr!==null)return Pr;try{Pr=window!=="undefined"&&window.localStorage!==null;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{Pr=!1}return Pr};var _y={name:"localStorage",lookup(a){let{lookupLocalStorage:s}=a;if(s&&ql())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupLocalStorage:r}=s;r&&ql()&&window.localStorage.setItem(r,a)}};let Br=null;const zl=()=>{if(Br!==null)return Br;try{Br=window!=="undefined"&&window.sessionStorage!==null;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{Br=!1}return Br};var fy={name:"sessionStorage",lookup(a){let{lookupSessionStorage:s}=a;if(s&&zl())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupSessionStorage:r}=s;r&&zl()&&window.sessionStorage.setItem(r,a)}},gy={name:"navigator",lookup(a){const s=[];if(typeof navigator<"u"){const{languages:r,userLanguage:n,language:o}=navigator;if(r)for(let l=0;l<r.length;l++)s.push(r[l]);n&&s.push(n),o&&s.push(o)}return s.length>0?s:void 0}},by={name:"htmlTag",lookup(a){let{htmlTag:s}=a,r;const n=s||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},xy={name:"path",lookup(a){let{lookupFromPathIndex:s}=a;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof s=="number"?s:0]?.replace("/",""):void 0}},hy={name:"subdomain",lookup(a){let{lookupFromSubdomainIndex:s}=a;const r=typeof s=="number"?s+1:1,n=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[r]}};function wy(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a}}class Cl{constructor(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(s,r)}init(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=s||{languageUtils:{}},this.options=dy(r,this.options||{},wy()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(uy),this.addDetector(yy),this.addDetector(_y),this.addDetector(fy),this.addDetector(gy),this.addDetector(by),this.addDetector(xy),this.addDetector(hy)}addDetector(s){return this.detectors[s.name]=s,this}detect(s){s||(s=this.options.order);let r=[];return s.forEach(n=>{if(this.detectors[n]){let o=this.detectors[n].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(r=r.concat(o))}}),r=r.map(n=>this.options.convertDetectedLanguage(n)),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(s,r){r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(s)>-1||r.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(s,this.options)}))}}Cl.type="languageDetector";const vy=(...a)=>{console?.warn&&(Fs(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),console.warn(...a))},Nl={},Jn=(...a)=>{Fs(a[0])&&Nl[a[0]]||(Fs(a[0])&&(Nl[a[0]]=new Date),vy(...a))},Sl=(a,s)=>()=>{if(a.isInitialized)s();else{const r=()=>{setTimeout(()=>{a.off("initialized",r)},0),s()};a.on("initialized",r)}},ei=(a,s,r)=>{a.loadNamespaces(s,Sl(a,r))},El=(a,s,r,n)=>{if(Fs(r)&&(r=[r]),a.options.preload&&a.options.preload.indexOf(s)>-1)return ei(a,r,n);r.forEach(o=>{a.options.ns.indexOf(o)<0&&a.options.ns.push(o)}),a.loadLanguages(s,Sl(a,n))},Ty=(a,s,r={})=>!s.languages||!s.languages.length?(Jn("i18n.languages were undefined or empty",s.languages),!0):s.hasLoadedNamespace(a,{lng:r.lng,precheck:(n,o)=>{if(r.bindI18n?.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!o(n.isLanguageChangingTo,a))return!1}}),Fs=a=>typeof a=="string",ky=a=>typeof a=="object"&&a!==null,Dy=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Iy={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Ay=a=>Iy[a];let ti={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:a=>a.replace(Dy,Ay)};const qy=(a={})=>{ti={...ti,...a}},zy=()=>ti;let Ll;const Cy=a=>{Ll=a},Ny=()=>Ll,Sy={type:"3rdParty",init(a){qy(a.options.react),Cy(a)}},Ey=I.createContext();class Ly{constructor(){this.usedNamespaces={}}addUsedNamespaces(s){s.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const My=(a,s)=>{const r=I.useRef();return I.useEffect(()=>{r.current=s?r.current:a},[a,s]),r.current},Ml=(a,s,r,n)=>a.getFixedT(s,r,n),Fy=(a,s,r,n)=>I.useCallback(Ml(a,s,r,n),[a,s,r,n]),tr=(a,s={})=>{const{i18n:r}=s,{i18n:n,defaultNS:o}=I.useContext(Ey)||{},l=r||n||Ny();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new Ly),!l){Jn("You will need to pass in an i18next instance by using initReactI18next");const j=(R,z)=>Fs(z)?z:ky(z)&&Fs(z.defaultValue)?z.defaultValue:Array.isArray(R)?R[R.length-1]:R,W=[j,{},!1];return W.t=j,W.i18n={},W.ready=!1,W}l.options.react?.wait&&Jn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const p={...zy(),...l.options.react,...s},{useSuspense:d,keyPrefix:u}=p;let _=a||o||l.options?.defaultNS;_=Fs(_)?[_]:_||["translation"],l.reportNamespaces.addUsedNamespaces?.(_);const g=(l.isInitialized||l.initializedStoreOnce)&&_.every(j=>Ty(j,l,p)),x=Fy(l,s.lng||null,p.nsMode==="fallback"?_:_[0],u),w=()=>x,C=()=>Ml(l,s.lng||null,p.nsMode==="fallback"?_:_[0],u),[M,K]=I.useState(w);let G=_.join();s.lng&&(G=`${s.lng}${G}`);const X=My(G),q=I.useRef(!0);I.useEffect(()=>{const{bindI18n:j,bindI18nStore:W}=p;q.current=!0,!g&&!d&&(s.lng?El(l,s.lng,_,()=>{q.current&&K(C)}):ei(l,_,()=>{q.current&&K(C)})),g&&X&&X!==G&&q.current&&K(C);const R=()=>{q.current&&K(C)};return j&&l?.on(j,R),W&&l?.store.on(W,R),()=>{q.current=!1,l&&j?.split(" ").forEach(z=>l.off(z,R)),W&&l&&W.split(" ").forEach(z=>l.store.off(z,R))}},[l,G]),I.useEffect(()=>{q.current&&g&&K(w)},[l,u,g]);const se=[M,l,g];if(se.t=M,se.i18n=l,se.ready=g,g||!g&&!d)return se;throw new Promise(j=>{s.lng?El(l,s.lng,_,()=>j()):ei(l,_,()=>j())})},Oy={type:"type",syntax:"syntax",overloads:"overloads",arguments:"arguments",fields:"fields",example:"example",returns:"returns",remarks:"remarks","see also":"see also","Copy code":"Copy code","Copy link":"Copy link",Copied:"Copied","Link copied":"Link copied",variables:"Variables",constants:"Constants",functions:"Functions",keywords:"Keywords",types:"Types",operators:"Operators",annotations:"Annotations",search:"Search","Mine Script® v1 Reference Manual":"Mine Script® v{{version}} Reference Manual","This script is read-only. It cannot be edited.":"This script is read-only. It cannot be edited.","save script":"Save script","open script":"Open script","find/replace":"Find/Replace","toggle console":"Toggle console","open editor in new tab":"Open editor in new tab","open editor in new window":"Open editor in new window",keyword:"keyword","built-in function":"built-in function","built-in variable":"built-in variable","built-in method":"built-in method","built-in type":"built-in type",annotation:"annotation","built-in constant":"built-in constant",namespace:"namespace","user-defined variable":"user-defined variable","user-defined type":"user-defined type",field:"field",enum:"enum","user-defined method":"user-defined method","user-defined function":"user-defined function",parameter:"parameter","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Mine functions, variables, and methods.","to trigger parameters hint":"to trigger parameters hint",library:"library","enum member":"enum member",Returns:"Returns",Syntax:"Syntax",Remarks:"Remarks",Fields:"Fields",Description:"Description",Example:"Example","Enum members":"Enum members",statement:"statement",loop:"loop","`click` on keyword for more help":"`click` on keyword for more help"},Py={type:"类型",syntax:"语法",overloads:"重载",arguments:"参数",fields:"字段",example:"例子",returns:"返回值",remarks:"备注","see also":"另见","Copy code":"复制代码","Copy link":"复制链接",Copied:"已复制","Link copied":"链接已复制",variables:"内置变量",constants:"常量",functions:"函数",keywords:"关键词",types:"类型",operators:"运算符",annotations:"注释",search:"搜索","Mine Script® v1 Reference Manual":"Mine Script™ v{{version}} 参考手册","This script is read-only. It cannot be edited.":"该脚本是只读的。它无法被编辑。","save script":"保存脚本","open script":"打开脚本","find/replace":"寻找/替换","toggle console":"切换控制台","open editor in new tab":"在新标签页中打开","open editor in new window":"在新窗口中打开",keyword:"关键词","built-in function":"内置函数","built-in variable":"内置变量","built-in method":"内置方法","built-in type":"内置类型",annotation:"注释","built-in constant":"内置常量",namespace:"命名空间","user-defined variable":"用户自定义变量","user-defined type":"用户自定义类型",field:"字段",enum:"枚举","user-defined method":"用户自定义方法","user-defined function":"用户自定义函数",parameter:"参数","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"命名空间是不可变的术语,充当标识符组的前缀。在命名Mine函数、变量和方法时,点和另一个术语始终遵循命名空间。","to trigger parameters hint":"触发参数提示",library:"脚本库","enum member":"枚举成员",Returns:"返回值",Syntax:"语法",Remarks:"备注",Fields:"字段",Description:"描述",Example:"例子","Enum members":"枚举成员",statement:"声明",loop:"循环","`click` on keyword for more help":"“点击”关键词以获得更多帮助"};Oe.use(Cl).use(Sy).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:Oy},zh:{translation:Py}}}),self.MonacoEnvironment={getWorker(){return new ly({name:"Editor Worker"})}},On.config({paths:{vs:"https://www.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const By=(a,s)=>{const{height:r,width:n,theme:o,options:l,hasDiff:p,readOnly:d,defaultValue:u,language:_,onChange:g,onLinkOpen:x,onCursorPositionChange:w,onActionTrigger:C,onEditorDidMount:M,onVersionChange:K}=a,{t:G,i18n:X}=tr(),q=I.useRef(null),se=I.useRef(null),j=I.useRef(!1),W=I.useRef(!1);I.useImperativeHandle(s,()=>({setOriginalScript(ne){q.current?.setOriginalScript(ne)},setScript(ne){q.current?.setValue(ne)},gotoLine(){q.current?.gotoLine()},getEditorLayout(){return q.current?.getEditorLayout()},setPosition(ne,De){q.current?.setPosition({column:ne,lineNumber:De})},setModelMarkers(ne){W.current=!0,q.current?.setModelMarkers(ne),setTimeout(()=>{W.current=!1},2e3)},focus(){q.current?.focus()}})),I.useEffect(()=>{p?q.current?.addDiffDecorations():q.current?.removeDiffDecorations()},[p]),I.useEffect(()=>{o&&Me.editor.setTheme(o)},[o]),I.useEffect(()=>{_&&X.changeLanguage(_)},[_]),I.useEffect(()=>{q.current?.updateActionTrigger(C)},[C]),I.useEffect(()=>{x&&q.current?.addLinkOpenFunc(x)},[x]);function R(ne,De){Ia.setEditor(ne),q.current=new Wu(ne,De,C),x&&q.current?.addLinkOpenFunc(x),p&&q.current?.addDiffDecorations(),xu(ne),requestAnimationFrame(te);const V=ne.getValue();q.current.onChangeCursorPosition(w),g&&g(V),!d&&z(V),M&&M()}const z=I.useCallback(async ne=>{const De=q.current?.getVersion();K&&K(De||Qt),j.current=!1;const{errors:V,functions:ie,methods:Z,types:ce,variables:ue,overloadsFuncs:$,imports:oe,enums:we}=await Dl(ne,!1,De),_e=new Map(Object.entries(ie)),Ke=new Map(Object.entries(Z)),Xe=new Map(Object.entries(ce)),it=new Map(Object.entries(ue)),tt=new Map(Object.entries(oe)),Qe=new Map(Object.entries(we));hs.setUserDefined({functions:_e,methods:Ke,types:Xe,variables:it,imports:tt,enums:Qe},$),$t.setUserDefind(_e,Xe,it,Ke,Qe);const ht=V.map(wt=>({...wt,severity:wt.type||Me.MarkerSeverity.Error}));d||!j.current&&!W.current&&ht.length&&q.current?.setModelMarkers(ht)},[d]),J=I.useMemo(()=>vu.debounce(z,1500),[z]);function re(ne){if(d){z(ne||"");return}j.current=!0,Ia.clearInlayHints(),q.current?.setModelMarkers([]),ne!==void 0&&(g&&g(ne),J(ne))}const te=I.useCallback(()=>{const ne=se.current?.getBoundingClientRect();q.current?.setEditorLayout(ne?.height||0,ne?.width)},[]);return I.useEffect(()=>{const ne=()=>{window.requestAnimationFrame(te)},De=new ResizeObserver(ne);return se.current&&De.observe(se.current),()=>{se.current&&De.unobserve(se.current),De.disconnect(),q.current?.dispose()}},[]),T.jsx("div",{ref:se,children:T.jsx(Km,{height:r,width:n||"100%",defaultLanguage:je,defaultValue:u||`//@version=6
|
77
|
+
*/const ul=Symbol("Comlink.proxy"),Xu=Symbol("Comlink.endpoint"),Vu=Symbol("Comlink.releaseProxy"),Vn=Symbol("Comlink.finalizer"),za=Symbol("Comlink.thrown"),yl=a=>typeof a=="object"&&a!==null||typeof a=="function",Yu={canHandle:a=>yl(a)&&a[ul],serialize(a){const{port1:s,port2:r}=new MessageChannel;return fl(a,s),[r,[r]]},deserialize(a){return a.start(),Yn(a)}},Qu={canHandle:a=>yl(a)&&za in a,serialize({value:a}){let s;return a instanceof Error?s={isError:!0,value:{message:a.message,name:a.name,stack:a.stack}}:s={isError:!1,value:a},[s,[]]},deserialize(a){throw a.isError?Object.assign(new Error(a.value.message),a.value):a.value}},_l=new Map([["proxy",Yu],["throw",Qu]]);function Zu(a,s){for(const r of a)if(s===r||r==="*"||r instanceof RegExp&&r.test(s))return!0;return!1}function fl(a,s=globalThis,r=["*"]){s.addEventListener("message",function n(o){if(!o||!o.data)return;if(!Zu(r,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:l,type:p,path:d}=Object.assign({path:[]},o.data),u=(o.data.argumentList||[]).map(Ms);let _;try{const g=d.slice(0,-1).reduce((w,C)=>w[C],a),x=d.reduce((w,C)=>w[C],a);switch(p){case"GET":_=x;break;case"SET":g[d.slice(-1)[0]]=Ms(o.data.value),_=!0;break;case"APPLY":_=x.apply(g,u);break;case"CONSTRUCT":{const w=new x(...u);_=Zn(w)}break;case"ENDPOINT":{const{port1:w,port2:C}=new MessageChannel;fl(a,C),_=ry(w,[w])}break;case"RELEASE":_=void 0;break;default:return}}catch(g){_={value:g,[za]:0}}Promise.resolve(_).catch(g=>({value:g,[za]:0})).then(g=>{const[x,w]=Ea(g);s.postMessage(Object.assign(Object.assign({},x),{id:l}),w),p==="RELEASE"&&(s.removeEventListener("message",n),gl(s),Vn in a&&typeof a[Vn]=="function"&&a[Vn]())}).catch(g=>{const[x,w]=Ea({value:new TypeError("Unserializable return value"),[za]:0});s.postMessage(Object.assign(Object.assign({},x),{id:l}),w)})}),s.start&&s.start()}function Ju(a){return a.constructor.name==="MessagePort"}function gl(a){Ju(a)&&a.close()}function Yn(a,s){return Qn(a,[],s)}function Ca(a){if(a)throw new Error("Proxy has been released and is not useable")}function bl(a){return er(a,{type:"RELEASE"}).then(()=>{gl(a)})}const Na=new WeakMap,Sa="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const s=(Na.get(a)||0)-1;Na.set(a,s),s===0&&bl(a)});function ey(a,s){const r=(Na.get(s)||0)+1;Na.set(s,r),Sa&&Sa.register(a,s,a)}function ty(a){Sa&&Sa.unregister(a)}function Qn(a,s=[],r=function(){}){let n=!1;const o=new Proxy(r,{get(l,p){if(Ca(n),p===Vu)return()=>{ty(o),bl(a),n=!0};if(p==="then"){if(s.length===0)return{then:()=>o};const d=er(a,{type:"GET",path:s.map(u=>u.toString())}).then(Ms);return d.then.bind(d)}return Qn(a,[...s,p])},set(l,p,d){Ca(n);const[u,_]=Ea(d);return er(a,{type:"SET",path:[...s,p].map(g=>g.toString()),value:u},_).then(Ms)},apply(l,p,d){Ca(n);const u=s[s.length-1];if(u===Xu)return er(a,{type:"ENDPOINT"}).then(Ms);if(u==="bind")return Qn(a,s.slice(0,-1));const[_,g]=xl(d);return er(a,{type:"APPLY",path:s.map(x=>x.toString()),argumentList:_},g).then(Ms)},construct(l,p){Ca(n);const[d,u]=xl(p);return er(a,{type:"CONSTRUCT",path:s.map(_=>_.toString()),argumentList:d},u).then(Ms)}});return ey(o,a),o}function sy(a){return Array.prototype.concat.apply([],a)}function xl(a){const s=a.map(Ea);return[s.map(r=>r[0]),sy(s.map(r=>r[1]))]}const hl=new WeakMap;function ry(a,s){return hl.set(a,s),a}function Zn(a){return Object.assign(a,{[ul]:!0})}function Ea(a){for(const[s,r]of _l)if(r.canHandle(a)){const[n,o]=r.serialize(a);return[{type:"HANDLER",name:s,value:n},o]}return[{type:"RAW",value:a},hl.get(a)||[]]}function Ms(a){switch(a.type){case"HANDLER":return _l.get(a.name).deserialize(a.value);case"RAW":return a.value}}function er(a,s,r){return new Promise(n=>{const o=ay();a.addEventListener("message",function l(p){!p.data||!p.data.id||p.data.id!==o||(a.removeEventListener("message",l),n(p.data))}),a.start&&a.start(),a.postMessage(Object.assign({id:o},s),r)})}function ay(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const wl=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-8a33SSnQ.js").href:new URL("assets/scriptsRunWorker-8a33SSnQ.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ma&&ma.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Run MineScript Server"});wl.onerror=a=>{console.error(a)};async function vl(a){return await Ia.setInlayHints(a)}const Tl=Yn(wl),kl=Yn(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-BvDdoR3P.js").href:new URL("assets/parserTccWorker-BvDdoR3P.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ma&&ma.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Parser MineScript Server"}));async function Dl(a,s=!1,r=Qt){const n=a.match(/\s*\/\/\s*@version\s*=\s*([0-9])/)?.[1];n&&(r=parseInt(n),r=r<3?3:r>6?6:r);const o=await xs(r);if(!o)return;const{functions:l,types:p,constants:d,variables:u,methods:_}=o.KEY_MAP_LIST;return await kl.parseTcc(a,s,Zn(vl),{functions:Object.fromEntries(l),methods:Object.fromEntries(_),types:Object.fromEntries(p),constants:Object.fromEntries(d),variables:Object.fromEntries(u)},r)}async function ny(a,s){const r=await xs(5);if(!r)return;const{functions:n,types:o,constants:l,variables:p,methods:d}=r.KEY_MAP_LIST;return await kl.parseLibraryCode(a,s,Zn(vl),{functions:Object.fromEntries(n),methods:Object.fromEntries(d),types:Object.fromEntries(o),constants:Object.fromEntries(l),variables:Object.fromEntries(p)})}async function iy(a,s,r=!0,n=Qt){return await Tl.runScript(a,s,r,n)}async function oy(a){return await Tl.removeScript(a)}function ly(a){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-BxEYBjj-.js").href:new URL("assets/editor.worker-BxEYBjj-.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{type:"module",name:a?.name})}const{slice:cy,forEach:py}=[];function dy(a){return py.call(cy.call(arguments,1),s=>{if(s)for(const r in s)a[r]===void 0&&(a[r]=s[r])}),a}const Il=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,my=(a,s,r)=>{const n=r||{};n.path=n.path||"/";const o=encodeURIComponent(s);let l=`${a}=${o}`;if(n.maxAge>0){const p=n.maxAge-0;if(Number.isNaN(p))throw new Error("maxAge should be a Number");l+=`; Max-Age=${Math.floor(p)}`}if(n.domain){if(!Il.test(n.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${n.domain}`}if(n.path){if(!Il.test(n.path))throw new TypeError("option path is invalid");l+=`; Path=${n.path}`}if(n.expires){if(typeof n.expires.toUTCString!="function")throw new TypeError("option expires is invalid");l+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(l+="; HttpOnly"),n.secure&&(l+="; Secure"),n.sameSite)switch(typeof n.sameSite=="string"?n.sameSite.toLowerCase():n.sameSite){case!0:l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"strict":l+="; SameSite=Strict";break;case"none":l+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return l},Al={create(a,s,r,n){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+r*60*1e3)),n&&(o.domain=n),document.cookie=my(a,encodeURIComponent(s),o)},read(a){const s=`${a}=`,r=document.cookie.split(";");for(let n=0;n<r.length;n++){let o=r[n];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(s)===0)return o.substring(s.length,o.length)}return null},remove(a){this.create(a,"",-1)}};var uy={name:"cookie",lookup(a){let{lookupCookie:s}=a;if(s&&typeof document<"u")return Al.read(s)||void 0},cacheUserLanguage(a,s){let{lookupCookie:r,cookieMinutes:n,cookieDomain:o,cookieOptions:l}=s;r&&typeof document<"u"&&Al.create(r,a,n,o,l)}},yy={name:"querystring",lookup(a){let{lookupQuerystring:s}=a,r;if(typeof window<"u"){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const l=n.substring(1).split("&");for(let p=0;p<l.length;p++){const d=l[p].indexOf("=");d>0&&l[p].substring(0,d)===s&&(r=l[p].substring(d+1))}}return r}};let Pr=null;const ql=()=>{if(Pr!==null)return Pr;try{Pr=window!=="undefined"&&window.localStorage!==null;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{Pr=!1}return Pr};var _y={name:"localStorage",lookup(a){let{lookupLocalStorage:s}=a;if(s&&ql())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupLocalStorage:r}=s;r&&ql()&&window.localStorage.setItem(r,a)}};let Br=null;const zl=()=>{if(Br!==null)return Br;try{Br=window!=="undefined"&&window.sessionStorage!==null;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{Br=!1}return Br};var fy={name:"sessionStorage",lookup(a){let{lookupSessionStorage:s}=a;if(s&&zl())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupSessionStorage:r}=s;r&&zl()&&window.sessionStorage.setItem(r,a)}},gy={name:"navigator",lookup(a){const s=[];if(typeof navigator<"u"){const{languages:r,userLanguage:n,language:o}=navigator;if(r)for(let l=0;l<r.length;l++)s.push(r[l]);n&&s.push(n),o&&s.push(o)}return s.length>0?s:void 0}},by={name:"htmlTag",lookup(a){let{htmlTag:s}=a,r;const n=s||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},xy={name:"path",lookup(a){let{lookupFromPathIndex:s}=a;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?r[typeof s=="number"?s:0]?.replace("/",""):void 0}},hy={name:"subdomain",lookup(a){let{lookupFromSubdomainIndex:s}=a;const r=typeof s=="number"?s+1:1,n=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[r]}};function wy(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a}}class Cl{constructor(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(s,r)}init(s){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=s||{languageUtils:{}},this.options=dy(r,this.options||{},wy()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(uy),this.addDetector(yy),this.addDetector(_y),this.addDetector(fy),this.addDetector(gy),this.addDetector(by),this.addDetector(xy),this.addDetector(hy)}addDetector(s){return this.detectors[s.name]=s,this}detect(s){s||(s=this.options.order);let r=[];return s.forEach(n=>{if(this.detectors[n]){let o=this.detectors[n].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(r=r.concat(o))}}),r=r.map(n=>this.options.convertDetectedLanguage(n)),this.services.languageUtils.getBestMatchFromCodes?r:r.length>0?r[0]:null}cacheUserLanguage(s,r){r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(s)>-1||r.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(s,this.options)}))}}Cl.type="languageDetector";const vy=(...a)=>{console?.warn&&(Fs(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),console.warn(...a))},Nl={},Jn=(...a)=>{Fs(a[0])&&Nl[a[0]]||(Fs(a[0])&&(Nl[a[0]]=new Date),vy(...a))},Sl=(a,s)=>()=>{if(a.isInitialized)s();else{const r=()=>{setTimeout(()=>{a.off("initialized",r)},0),s()};a.on("initialized",r)}},ei=(a,s,r)=>{a.loadNamespaces(s,Sl(a,r))},El=(a,s,r,n)=>{if(Fs(r)&&(r=[r]),a.options.preload&&a.options.preload.indexOf(s)>-1)return ei(a,r,n);r.forEach(o=>{a.options.ns.indexOf(o)<0&&a.options.ns.push(o)}),a.loadLanguages(s,Sl(a,n))},Ty=(a,s,r={})=>!s.languages||!s.languages.length?(Jn("i18n.languages were undefined or empty",s.languages),!0):s.hasLoadedNamespace(a,{lng:r.lng,precheck:(n,o)=>{if(r.bindI18n?.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!o(n.isLanguageChangingTo,a))return!1}}),Fs=a=>typeof a=="string",ky=a=>typeof a=="object"&&a!==null,Dy=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Iy={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},Ay=a=>Iy[a];let ti={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:a=>a.replace(Dy,Ay)};const qy=(a={})=>{ti={...ti,...a}},zy=()=>ti;let Ll;const Cy=a=>{Ll=a},Ny=()=>Ll,Sy={type:"3rdParty",init(a){qy(a.options.react),Cy(a)}},Ey=I.createContext();class Ly{constructor(){this.usedNamespaces={}}addUsedNamespaces(s){s.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const My=(a,s)=>{const r=I.useRef();return I.useEffect(()=>{r.current=s?r.current:a},[a,s]),r.current},Ml=(a,s,r,n)=>a.getFixedT(s,r,n),Fy=(a,s,r,n)=>I.useCallback(Ml(a,s,r,n),[a,s,r,n]),tr=(a,s={})=>{const{i18n:r}=s,{i18n:n,defaultNS:o}=I.useContext(Ey)||{},l=r||n||Ny();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new Ly),!l){Jn("You will need to pass in an i18next instance by using initReactI18next");const j=(R,z)=>Fs(z)?z:ky(z)&&Fs(z.defaultValue)?z.defaultValue:Array.isArray(R)?R[R.length-1]:R,W=[j,{},!1];return W.t=j,W.i18n={},W.ready=!1,W}l.options.react?.wait&&Jn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const p={...zy(),...l.options.react,...s},{useSuspense:d,keyPrefix:u}=p;let _=a||o||l.options?.defaultNS;_=Fs(_)?[_]:_||["translation"],l.reportNamespaces.addUsedNamespaces?.(_);const g=(l.isInitialized||l.initializedStoreOnce)&&_.every(j=>Ty(j,l,p)),x=Fy(l,s.lng||null,p.nsMode==="fallback"?_:_[0],u),w=()=>x,C=()=>Ml(l,s.lng||null,p.nsMode==="fallback"?_:_[0],u),[M,K]=I.useState(w);let G=_.join();s.lng&&(G=`${s.lng}${G}`);const X=My(G),q=I.useRef(!0);I.useEffect(()=>{const{bindI18n:j,bindI18nStore:W}=p;q.current=!0,!g&&!d&&(s.lng?El(l,s.lng,_,()=>{q.current&&K(C)}):ei(l,_,()=>{q.current&&K(C)})),g&&X&&X!==G&&q.current&&K(C);const R=()=>{q.current&&K(C)};return j&&l?.on(j,R),W&&l?.store.on(W,R),()=>{q.current=!1,l&&j?.split(" ").forEach(z=>l.off(z,R)),W&&l&&W.split(" ").forEach(z=>l.store.off(z,R))}},[l,G]),I.useEffect(()=>{q.current&&g&&K(w)},[l,u,g]);const se=[M,l,g];if(se.t=M,se.i18n=l,se.ready=g,g||!g&&!d)return se;throw new Promise(j=>{s.lng?El(l,s.lng,_,()=>j()):ei(l,_,()=>j())})},Oy={type:"type",syntax:"syntax",overloads:"overloads",arguments:"arguments",fields:"fields",example:"example",returns:"returns",remarks:"remarks","see also":"see also","Copy code":"Copy code","Copy link":"Copy link",Copied:"Copied","Link copied":"Link copied",variables:"Variables",constants:"Constants",functions:"Functions",keywords:"Keywords",types:"Types",operators:"Operators",annotations:"Annotations",search:"Search","Mine Script® v1 Reference Manual":"Mine Script® v{{version}} Reference Manual","This script is read-only. It cannot be edited.":"This script is read-only. It cannot be edited.","save script":"Save script","open script":"Open script","find/replace":"Find/Replace","toggle console":"Toggle console","open editor in new tab":"Open editor in new tab","open editor in new window":"Open editor in new window",keyword:"keyword","built-in function":"built-in function","built-in variable":"built-in variable","built-in method":"built-in method","built-in type":"built-in type",annotation:"annotation","built-in constant":"built-in constant",namespace:"namespace","user-defined variable":"user-defined variable","user-defined type":"user-defined type",field:"field",enum:"enum","user-defined method":"user-defined method","user-defined function":"user-defined function",parameter:"parameter","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Mine functions, variables, and methods.","to trigger parameters hint":"to trigger parameters hint",library:"library","enum member":"enum member",Returns:"Returns",Syntax:"Syntax",Remarks:"Remarks",Fields:"Fields",Description:"Description",Example:"Example","Enum members":"Enum members",statement:"statement",loop:"loop","`click` on keyword for more help":"`click` on keyword for more help"},Py={type:"类型",syntax:"语法",overloads:"重载",arguments:"参数",fields:"字段",example:"例子",returns:"返回值",remarks:"备注","see also":"另见","Copy code":"复制代码","Copy link":"复制链接",Copied:"已复制","Link copied":"链接已复制",variables:"内置变量",constants:"常量",functions:"函数",keywords:"关键词",types:"类型",operators:"运算符",annotations:"注释",search:"搜索","Mine Script® v1 Reference Manual":"Mine Script™ v{{version}} 参考手册","This script is read-only. It cannot be edited.":"该脚本是只读的。它无法被编辑。","save script":"保存脚本","open script":"打开脚本","find/replace":"寻找/替换","toggle console":"切换控制台","open editor in new tab":"在新标签页中打开","open editor in new window":"在新窗口中打开",keyword:"关键词","built-in function":"内置函数","built-in variable":"内置变量","built-in method":"内置方法","built-in type":"内置类型",annotation:"注释","built-in constant":"内置常量",namespace:"命名空间","user-defined variable":"用户自定义变量","user-defined type":"用户自定义类型",field:"字段",enum:"枚举","user-defined method":"用户自定义方法","user-defined function":"用户自定义函数",parameter:"参数","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"命名空间是不可变的术语,充当标识符组的前缀。在命名Mine函数、变量和方法时,点和另一个术语始终遵循命名空间。","to trigger parameters hint":"触发参数提示",library:"脚本库","enum member":"枚举成员",Returns:"返回值",Syntax:"语法",Remarks:"备注",Fields:"字段",Description:"描述",Example:"例子","Enum members":"枚举成员",statement:"声明",loop:"循环","`click` on keyword for more help":"“点击”关键词以获得更多帮助"};Oe.use(Cl).use(Sy).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:Oy},zh:{translation:Py}}}),self.MonacoEnvironment={getWorker(){return new ly({name:"Editor Worker"})}},On.config({paths:{vs:"https://www.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const By=(a,s)=>{const{height:r,width:n,theme:o,options:l,hasDiff:p,readOnly:d,defaultValue:u,language:_,onChange:g,onLinkOpen:x,onCursorPositionChange:w,onActionTrigger:C,onEditorDidMount:M,onVersionChange:K}=a,{t:G,i18n:X}=tr(),q=I.useRef(null),se=I.useRef(null),j=I.useRef(!1),W=I.useRef(!1);I.useImperativeHandle(s,()=>({setOriginalScript(ne){q.current?.setOriginalScript(ne)},setScript(ne){q.current?.setValue(ne)},gotoLine(){q.current?.gotoLine()},getEditorLayout(){return q.current?.getEditorLayout()},setPosition(ne,De){q.current?.setPosition({column:ne,lineNumber:De})},setModelMarkers(ne){W.current=!0,q.current?.setModelMarkers(ne),setTimeout(()=>{W.current=!1},2e3)},focus(){q.current?.focus()}})),I.useEffect(()=>{p?q.current?.addDiffDecorations():q.current?.removeDiffDecorations()},[p]),I.useEffect(()=>{o&&Me.editor.setTheme(o)},[o]),I.useEffect(()=>{_&&X.changeLanguage(_)},[_]),I.useEffect(()=>{q.current?.updateActionTrigger(C)},[C]),I.useEffect(()=>{x&&q.current?.addLinkOpenFunc(x)},[x]);function R(ne,De){Ia.setEditor(ne),q.current=new Wu(ne,De,C),x&&q.current?.addLinkOpenFunc(x),p&&q.current?.addDiffDecorations(),xu(ne),requestAnimationFrame(te);const V=ne.getValue();q.current.onChangeCursorPosition(w),g&&g(V),!d&&z(V),M&&M()}const z=I.useCallback(async ne=>{const De=q.current?.getVersion();K&&K(De||Qt),j.current=!1;const{errors:V,functions:ie,methods:Z,types:ce,variables:ue,overloadsFuncs:$,imports:oe,enums:we}=await Dl(ne,!1,De),_e=new Map(Object.entries(ie)),Ke=new Map(Object.entries(Z)),Xe=new Map(Object.entries(ce)),it=new Map(Object.entries(ue)),tt=new Map(Object.entries(oe)),Qe=new Map(Object.entries(we));hs.setUserDefined({functions:_e,methods:Ke,types:Xe,variables:it,imports:tt,enums:Qe},$),$t.setUserDefind(_e,Xe,it,Ke,Qe);const ht=V.map(wt=>({...wt,severity:wt.type||Me.MarkerSeverity.Error}));d||!j.current&&!W.current&&ht.length&&q.current?.setModelMarkers(ht)},[d]),J=I.useMemo(()=>vu.debounce(z,1500),[z]);function re(ne){if(d){z(ne||"");return}j.current=!0,Ia.clearInlayHints(),q.current?.setModelMarkers([]),ne!==void 0&&(g&&g(ne),J(ne))}const te=I.useCallback(()=>{const ne=se.current?.getBoundingClientRect();q.current?.setEditorLayout(ne?.height||0,ne?.width)},[]);return I.useEffect(()=>{const ne=()=>{window.requestAnimationFrame(te)},De=new ResizeObserver(ne);return se.current&&De.observe(se.current),()=>{se.current&&De.unobserve(se.current),De.disconnect(),q.current?.dispose()}},[]),T.jsx("div",{ref:se,children:T.jsx(Km,{height:r,width:n||"100%",defaultLanguage:je,defaultValue:u||`//@version=6
|
78
78
|
indicator("我的脚本")
|
79
79
|
plot(close)
|
80
80
|
`,theme:o||"vs-dark",className:`tvue-script ${o||"vs-dark"}`,options:{colorDecorators:!0,useShadowDOM:!1,matchOnWordStartOnly:!0,automaticLayout:!1,unicodeHighlight:{allowedCharacters:{" ":!0}},suggest:{filterGraceful:!0},fontSize:13,...d?$m:{},readOnlyMessage:{value:G("This script is read-only. It cannot be edited.")},...l},onMount:R,onChange:re})})},Ry=I.forwardRef(By),Ky=a=>{const{theme:s,modified:r,original:n,height:o,width:l,renderSideBySide:p=!0,version:d=Qt}=a,u=I.useCallback(async(_,g)=>{g.languages.register({id:je}),g.editor.defineTheme("vs-dark",Hn),g.editor.defineTheme("vs",$n);const x=await Ta(d);x&&(g.languages.setMonarchTokensProvider(je,x.LANGUAGE_MONARCH_TOKENS),g.languages.setLanguageConfiguration(je,x.CONFIGURATION))},[d]);return T.jsx(Fm,{height:o||"90vh",width:l||"100%",theme:s||"vs-dark",options:{readOnly:!0,renderSideBySide:p,scrollBeyondLastLine:!1},language:je,modified:r,original:n,onMount:u})};F.VMarkerSeverity=void 0,function(a){a[a.Hint=1]="Hint",a[a.Info=2]="Info",a[a.Warning=4]="Warning",a[a.Error=8]="Error"}(F.VMarkerSeverity||(F.VMarkerSeverity={}));var La={},Uy=function(){var a=document.getSelection();if(!a.rangeCount)return function(){};for(var s=document.activeElement,r=[],n=0;n<a.rangeCount;n++)r.push(a.getRangeAt(n));switch(s.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":s.blur();break;default:s=null;break}return a.removeAllRanges(),function(){a.type==="Caret"&&a.removeAllRanges(),a.rangeCount||r.forEach(function(o){a.addRange(o)}),s&&s.focus()}},$y=Uy,Fl={"text/plain":"Text","text/html":"Url",default:"Text"},Hy="Copy to clipboard: #{key}, Enter";function jy(a){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return a.replace(/#{\s*key\s*}/g,s)}function Gy(a,s){var r,n,o,l,p,d,u=!1;s||(s={}),r=s.debug||!1;try{o=$y(),l=document.createRange(),p=document.getSelection(),d=document.createElement("span"),d.textContent=a,d.ariaHidden="true",d.style.all="unset",d.style.position="fixed",d.style.top=0,d.style.clip="rect(0, 0, 0, 0)",d.style.whiteSpace="pre",d.style.webkitUserSelect="text",d.style.MozUserSelect="text",d.style.msUserSelect="text",d.style.userSelect="text",d.addEventListener("copy",function(g){if(g.stopPropagation(),s.format)if(g.preventDefault(),typeof g.clipboardData>"u"){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var x=Fl[s.format]||Fl.default;window.clipboardData.setData(x,a)}else g.clipboardData.clearData(),g.clipboardData.setData(s.format,a);s.onCopy&&(g.preventDefault(),s.onCopy(g.clipboardData))}),document.body.appendChild(d),l.selectNodeContents(d),p.addRange(l);var _=document.execCommand("copy");if(!_)throw new Error("copy command was unsuccessful");u=!0}catch(g){r&&console.error("unable to copy using execCommand: ",g),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",a),s.onCopy&&s.onCopy(window.clipboardData),u=!0}catch(x){r&&console.error("unable to copy using clipboardData: ",x),r&&console.error("falling back to prompt"),n=jy("message"in s?s.message:Hy),window.prompt(n,a)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(l):p.removeAllRanges()),d&&document.body.removeChild(d),o()}return u}var Wy=Gy;function si(a){"@babel/helpers - typeof";return si=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},si(a)}Object.defineProperty(La,"__esModule",{value:!0}),La.CopyToClipboard=void 0;var Ma=Ol(I),Xy=Ol(Wy),Vy=["text","onCopy","options","children"];function Ol(a){return a&&a.__esModule?a:{default:a}}function Pl(a,s){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);s&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),r.push.apply(r,n)}return r}function Bl(a){for(var s=1;s<arguments.length;s++){var r=arguments[s]!=null?arguments[s]:{};s%2?Pl(Object(r),!0).forEach(function(n){ai(a,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):Pl(Object(r)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(r,n))})}return a}function Yy(a,s){if(a==null)return{};var r=Qy(a,s),n,o;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(a);for(o=0;o<l.length;o++)n=l[o],!(s.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(a,n)&&(r[n]=a[n])}return r}function Qy(a,s){if(a==null)return{};var r={},n=Object.keys(a),o,l;for(l=0;l<n.length;l++)o=n[l],!(s.indexOf(o)>=0)&&(r[o]=a[o]);return r}function Zy(a,s){if(!(a instanceof s))throw new TypeError("Cannot call a class as a function")}function Rl(a,s){for(var r=0;r<s.length;r++){var n=s[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(a,n.key,n)}}function Jy(a,s,r){return s&&Rl(a.prototype,s),r&&Rl(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}function e_(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(s&&s.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),s&&ri(a,s)}function ri(a,s){return ri=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},ri(a,s)}function t_(a){var s=r_();return function(){var n=Fa(a),o;if(s){var l=Fa(this).constructor;o=Reflect.construct(n,arguments,l)}else o=n.apply(this,arguments);return s_(this,o)}}function s_(a,s){if(s&&(si(s)==="object"||typeof s=="function"))return s;if(s!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Kl(a)}function Kl(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function r_(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Fa(a){return Fa=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Fa(a)}function ai(a,s,r){return s in a?Object.defineProperty(a,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[s]=r,a}var Ul=function(a){e_(r,a);var s=t_(r);function r(){var n;Zy(this,r);for(var o=arguments.length,l=new Array(o),p=0;p<o;p++)l[p]=arguments[p];return n=s.call.apply(s,[this].concat(l)),ai(Kl(n),"onClick",function(d){var u=n.props,_=u.text,g=u.onCopy,x=u.children,w=u.options,C=Ma.default.Children.only(x),M=(0,Xy.default)(_,w);g&&g(_,M),C&&C.props&&typeof C.props.onClick=="function"&&C.props.onClick(d)}),n}return Jy(r,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var l=o.children,p=Yy(o,Vy),d=Ma.default.Children.only(l);return Ma.default.cloneElement(d,Bl(Bl({},p),{},{onClick:this.onClick}))}}]),r}(Ma.default.PureComponent);La.CopyToClipboard=Ul,ai(Ul,"defaultProps",{onCopy:void 0,options:void 0});var a_=La,ni=a_.CopyToClipboard;ni.CopyToClipboard=ni;var n_=ni;const sr=Ed(n_);Me.languages.register({id:je}),Me.editor.defineTheme("vs-dark",Hn),Me.editor.defineTheme("vs",$n);const $l=[{label:"版本 v3",version:3},{label:"版本 v4",version:4},{label:"版本 v5",version:5},{label:"版本 v6",version:6}];async function ii(a){const s=await Ta(a);s&&(Me.languages.setMonarchTokensProvider(je,s.LANGUAGE_MONARCH_TOKENS),Me.languages.setLanguageConfiguration(je,s.CONFIGURATION))}async function Hl(a,s,r){return s&&Me.editor.setTheme(s.includes("dark")?"vs-dark":"light"),r&&await ii(r),await Me.editor.colorize(a,je,{tabSize:4})}async function oi(a,s=0){const r=a[s];if(!r)return;const{name:n,args:o,type:l,desc:p,examples:d,remarks:u,seeAlso:_,syntax:g,detailedDesc:x,fields:w,returns:C}=r,M={name:n,orirginalName:n};if(a.length>1&&(M.overloads=`${a.length} ${Oe.t("overloads")}`),l&&(M.type=l),o&&(M.name=`${n}()`,M.args=o.map(K=>{const{name:G,desc:X,displayType:q}=K;return{label:`${G} (${q})`,desc:X&&Os(X)}})),p&&(M.desc=p.map(K=>Os(K))),d&&(M.originalExample=d.join(`
|