@guihz/trading-vue-editor-tes 0.1.41 → 0.1.43

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.
@@ -26981,10 +26981,12 @@ ${u}`), u;
26981
26981
  strategy;
26982
26982
  _count = 0;
26983
26983
  _alertSelects = [];
26984
- constructor(e, t, r) {
26984
+ _indiOptions = {};
26985
+ _id;
26986
+ constructor(e, t, r, i) {
26985
26987
  super(t, r);
26986
- const i = e.toString().split(".")[1]?.length || 5;
26987
- this.array = new bB(this._errorListener), this.color = new OB(), this.str = new dB(i), t.buildInTimeframeFunc = this.timeframe, this.ta = new tf(t), this._cacheData = {}, this._options = {}, this._bgColors = {}, this._alerts = /* @__PURE__ */ new Map(), this._hlines = /* @__PURE__ */ new Map(), this._fills = /* @__PURE__ */ new Map(), this._plots = /* @__PURE__ */ new Map(), this._plotshapes = /* @__PURE__ */ new Map(), this._plotbars = /* @__PURE__ */ new Map(), this._plotcandles = /* @__PURE__ */ new Map(), this._plotchars = /* @__PURE__ */ new Map(), this._plotarrows = /* @__PURE__ */ new Map(), this.line = new hB(t, this._errorListener), this.label = new fB(t, this._errorListener), this.box = new _B(t, this._errorListener), this.table = new AB(t, this._errorListener), this.strategy = new gB(this._variables, this._options, e, this._errorListener, r);
26988
+ const s = e.toString().split(".")[1]?.length || 5;
26989
+ this.array = new bB(this._errorListener), this.color = new OB(), this.str = new dB(s), t.buildInTimeframeFunc = this.timeframe, this.ta = new tf(t), this._cacheData = {}, this._options = {}, this._bgColors = {}, this._alerts = /* @__PURE__ */ new Map(), this._hlines = /* @__PURE__ */ new Map(), this._fills = /* @__PURE__ */ new Map(), this._plots = /* @__PURE__ */ new Map(), this._plotshapes = /* @__PURE__ */ new Map(), this._plotbars = /* @__PURE__ */ new Map(), this._plotcandles = /* @__PURE__ */ new Map(), this._plotchars = /* @__PURE__ */ new Map(), this._plotarrows = /* @__PURE__ */ new Map(), this.line = new hB(t, this._errorListener), this.label = new fB(t, this._errorListener), this.box = new _B(t, this._errorListener), this.table = new AB(t, this._errorListener), this.strategy = new gB(this._variables, this._options, e, this._errorListener, r), this._indiOptions = i, this._id = r;
26988
26990
  }
26989
26991
  getFuncCacheData() {
26990
26992
  return {
@@ -27095,8 +27097,14 @@ ${u}`), u;
27095
27097
  }
27096
27098
  study(e, t) {
27097
27099
  if (!this._options.scriptType) {
27098
- const { format: r, max_bars_back: i = 0, resolution: s } = e;
27099
- this._variables.max_bars_back = i, e.timeframe = s, this._paramVerfiy(r, t, "study", [C1.inherit, C1.percent, C1.price, C1.volume]), this._variables.updateMaxLength(e), this._options.scriptType = "indicator", this._options.indicator = e;
27100
+ const r = self.workerStorage.get(`indicator_${this._id}`);
27101
+ self.workerStorage.set(`indicator_${this._id}`, { ...e });
27102
+ const { format: i, max_bars_back: s = 0, calc_bars_count: o, resolution: a, resolution_gaps: c } = e;
27103
+ if (this._variables.max_bars_back = s, this._paramVerfiy(i, t, "study", [C1.inherit, C1.percent, C1.price, C1.volume]), this._variables.updateMaxLength(e), this._options.scriptType = "indicator", r) {
27104
+ const { customTimeframe: p, calcBarsCount: b, timeframeGaps: M } = this._indiOptions;
27105
+ p !== void 0 && r.resolution === a && (e.resolution = p), M !== void 0 && r.resolution_gaps === c && (e.resolution_gaps = M), b !== void 0 && r.calc_bars_count === o && (e.calc_bars_count = b);
27106
+ }
27107
+ e.timeframe = e.resolution, this._options.indicator = e;
27100
27108
  }
27101
27109
  }
27102
27110
  _paramVerfiy(e = "", t, r, i, s = "format") {
@@ -27494,8 +27502,8 @@ ${u}`), u;
27494
27502
  const v = s.mintick ? Number(s.mintick) : 1e-5;
27495
27503
  s.mintick = v;
27496
27504
  const y = /* @__PURE__ */ Object.create(null);
27497
- self.workerStorage.set(`inputs_${u}`, W?.inputCache), self.workerStorage.set(`strategy_${u}`, W?.strategyCacheArgs);
27498
- const L = new Ab(u, O), D = new qb(), R = new mb(v, L, u), w = new Function("_$_var", "_$_const", "_$_func", n);
27505
+ self.workerStorage.set(`inputs_${u}`, W?.inputCache), self.workerStorage.set(`strategy_${u}`, W?.strategyCacheArgs), self.workerStorage.set(`indicator_${u}`, W?.indicatorCacheArgs);
27506
+ const L = new Ab(u, O), D = new qb(), R = new mb(v, L, u, { customTimeframe: O, calcBarsCount: l, timeframeGaps: d }), w = new Function("_$_var", "_$_const", "_$_func", n);
27499
27507
  let B = {
27500
27508
  request: [],
27501
27509
  requestData: [],
@@ -27508,7 +27516,7 @@ ${u}`), u;
27508
27516
  const { funcCacheData: X, varCacheData: K, requestCacheData: j, customTimeframe: Q, timeframeGaps: n0, lastData: l0 } = W;
27509
27517
  if (B = j, L.setVarCacheData(K), R.setFuncCacheData(X), O = Q, d = n0, r[0]?.time > l0?.time && r.unshift(l0), L.setCustomTimeframe = O, O && O !== A) {
27510
27518
  const r0 = Re(O), G = L._currentData;
27511
- if (f = M[`${s.tickerid}--${r0}`], f?.length) {
27519
+ if (f = M?.[`${s.tickerid}--${r0}`], f?.length) {
27512
27520
  f[f.length - 1].isrealtime = !0, G?.time && (G.time < f[0].time ? f.unshift({ ...G, isrealtime: !1, barindex: G.barIndex }) : f = f.filter((_0) => _0.time >= G.time));
27513
27521
  for (const [_0, A0] of f.entries())
27514
27522
  A0.barindex || (A0.barindex = (G?.barIndex || 0) + _0);
@@ -27604,7 +27612,7 @@ ${u}`), u;
27604
27612
  errors: T
27605
27613
  };
27606
27614
  const $ = R.options(g, t);
27607
- Object.assign(y, { inputCache: self.workerStorage.get(`inputs_${u}`), strategyCacheArgs: self.workerStorage.get(`strategy_${u}`), varCacheData: L.getVarCacheData(), funcCacheData: R.getFuncCacheData() }), O && Object.assign(y, { customTimeframe: O, timeframeGaps: d, lastData: r[r.length - 1] }), ys(u);
27615
+ Object.assign(y, { inputCache: self.workerStorage.get(`inputs_${u}`), indicatorCacheArgs: self.workerStorage.get(`indicator_${u}`), strategyCacheArgs: self.workerStorage.get(`strategy_${u}`), varCacheData: L.getVarCacheData(), funcCacheData: R.getFuncCacheData() }), O && Object.assign(y, { customTimeframe: O, timeframeGaps: d, lastData: r[r.length - 1] }), ys(u);
27608
27616
  const P = O && O !== A && f?.length ? iM(f, r, $, A, O, d, t) : $;
27609
27617
  return {
27610
27618
  status: 0,
@@ -27712,7 +27720,7 @@ ${u}`), u;
27712
27720
  }
27713
27721
  }
27714
27722
  function ys(n) {
27715
- 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`);
27723
+ self?.workerStorage?.deleteStartwidthKey(n), self?.workerStorage?.delete(`indicator_${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`);
27716
27724
  }
27717
27725
  var D0 = /* @__PURE__ */ ((n) => (n.BOOL = "bool", n.INT = "int", n.FLOAT = "float", n.ARRAY = "array", n.BOX = "box", n.CHART_POINT = "chart.point", n.COLOR = "color", n.CONST = "const", n.LABEL = "label", n.LINE = "line", n.LINEFILL = "linefill", n.MAP = "map", n.MATRIX = "matrix", n.POLYLINE = "polyline", n.SERIES = "series", n.SIMPLE = "simple", n.STRING = "string", n.TABLE = "table", n.UNDETERMINED = "undetermined type", n.INPUT = "input", n.NA = "na", n.VOID = "void", n.ENUM = "enum", n))(D0 || {}), q1 = /* @__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))(q1 || {}), ka = /* @__PURE__ */ ((n) => (n.dividends = "dividends", n.none = "none", n.splits = "splits", n))(ka || {}), Wr = /* @__PURE__ */ ((n) => (n.freqAll = "freq_all", n.freqOncePerBar = "freq_once_per_bar", n.freqOncePerBarClose = "freq_once_per_bar_close", n))(Wr || {}), $r = /* @__PURE__ */ ((n) => (n.gapsOff = "gaps_off", n.gapsOn = "gaps_on", n.lookaheadOff = "lookahead_off", n.lookaheadOn = "lookahead_on", n))($r || {}), Ar = /* @__PURE__ */ ((n) => (n.all = "all", n.dataWindow = "data_window", n.none = "none", n.pane = "pane", n.priceScale = "price_scale", n.statusLine = "status_line", n))(Ar || {}), Pt = /* @__PURE__ */ ((n) => (n.both = "both", n.left = "left", n.none = "none", n.right = "right", n))(Pt || {}), E1 = /* @__PURE__ */ ((n) => (n.inherit = "inherit", n.mintick = "mintick", n.percent = "percent", n.price = "price", n.volume = "volume", n))(E1 || {}), Pa = /* @__PURE__ */ ((n) => (n.styleDashed = "style_dashed", n.styleDotted = "style_dotted", n.styleSolid = "style_solid", n))(Pa || {}), se = /* @__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))(se || {}), Ae = /* @__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))(Ae || {}), di = /* @__PURE__ */ ((n) => (n.abovebar = "abovebar", n.absolute = "absolute", n.belowbar = "belowbar", n.bottom = "bottom", n.top = "top", n))(di || {}), wn = /* @__PURE__ */ ((n) => (n.ascending = "ascending", n.descending = "descending", n))(wn || {}), nr = /* @__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))(nr || {}), Ft = /* @__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))(Ft || {}), Ha = /* @__PURE__ */ ((n) => (n.left = "left", n.none = "none", n.right = "right", n))(Ha || {}), Ji = /* @__PURE__ */ ((n) => (n.extended = "extended", n.regular = "regular", n))(Ji || {}), vt = /* @__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))(vt || {}), Ke = /* @__PURE__ */ ((n) => (n.auto = "auto", n.huge = "huge", n.large = "large", n.normal = "normal", n.small = "small", n.tiny = "tiny", n))(Ke || {}), vi = /* @__PURE__ */ ((n) => (n.familyDefault = "default", n.familyMonospace = "monospace", n))(vi || {}), Xe = /* @__PURE__ */ ((n) => (n.cash = "cash", n.fixed = "fixed", n.percentOfEquity = "percent_of_equity", n))(Xe || {}), Ot = /* @__PURE__ */ ((n) => (n.cashPerContract = "cash_per_contract", n.cashPerOrder = "cash_per_order", n.percent = "percent", n))(Ot || {}), P0 = /* @__PURE__ */ ((n) => (n.all = "all", n.long = "long", n.short = "short", n))(P0 || {}), fi = /* @__PURE__ */ ((n) => (n.cancel = "cancel", n.none = "none", n.reduce = "reduce", n))(fi || {}), r1 = /* @__PURE__ */ ((n) => (n.alignBottom = "align_bottom", n.alignCenter = "align_center", n.alignLeft = "align_left", n.alignRight = "align_right", n.alignTop = "align_top", n.wrapAuto = "wrap_auto", n.wrapNone = "wrap_none", n))(r1 || {}), G1 = /* @__PURE__ */ ((n) => (n.bar_index = "bar_index", n.bar_time = "bar_time", n))(G1 || {}), pr = /* @__PURE__ */ ((n) => (n.abovebar = "abovebar", n.belowbar = "belowbar", n.price = "price", n))(pr || {}), ja = /* @__PURE__ */ ((n) => (n.actual = "actual", n.estimate = "estimate", n.standardized = "standardized", n))(ja || {}), Ls = /* @__PURE__ */ ((n) => (n.traditional = "Traditional", n.fibonacci = "Fibonacci", n.woodie = "Woodie", n.classic = "Classic", n.dm = "DM", n.camarilla = "Camarilla", n))(Ls || {}), Mt = /* @__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.TEXT_AREA = "text_area", n.TIMEFRAME = "timeframe", n.ENUM = "enum", n))(Mt || {}), sf = /* @__PURE__ */ ((n) => (n.library = "library", n.indicator = "indicator", n.strategy = "strategy", n))(sf || {});
27718
27726
  let nf = class {
@@ -36120,9 +36128,11 @@ ${cf}`);
36120
36128
  syminfo;
36121
36129
  _count = 0;
36122
36130
  _alertSelects = [];
36123
- constructor(e, t, r) {
36124
- const i = e.toString().split(".")[1]?.length || 5;
36125
- this._variables = t, this._errorListener = new v7(), this.array = new af(this._errorListener), this.math = new wB(i), this.color = new xB(), this.str = new Cx(this._errorListener, i, t), this.map = new Ex(), this.timeframe = new xx(t), t.buildInTimeframeFunc = this.timeframe, this.matrix = new Bx(this._errorListener), this.ta = new DB(t, this.math, this.timeframe), this._cacheData = {}, this._options = {}, this._bgColors = {}, this._alerts = /* @__PURE__ */ new Map(), this._hlines = /* @__PURE__ */ new Map(), this._fills = /* @__PURE__ */ new Map(), this.input = new BB(t, this._errorListener, r), this._plots = /* @__PURE__ */ new Map(), this._plotshapes = /* @__PURE__ */ new Map(), this._plotbars = /* @__PURE__ */ new Map(), this._plotcandles = /* @__PURE__ */ new Map(), this._plotchars = /* @__PURE__ */ new Map(), this._plotarrows = /* @__PURE__ */ new Map(), this.chart = { point: new Tx(t) }, this.line = new bi(t, this._errorListener), this.label = new $x(t, this._errorListener), this.polyline = new o7(t, this._errorListener), this.box = new u7(t, this._errorListener), this.table = new O7(t, this._errorListener), this.linefill = new b7(t), this.log = new g7(t, this.str), this.runtime = new W7(this._errorListener), this.strategy = new A7(this._variables, this._options, e, this._errorListener, r), this.request = new q7(this._variables, r, this, this._errorListener), this.syminfo = new m7(), this._proxy = /* @__PURE__ */ new Map();
36131
+ _indiOptions = {};
36132
+ _id;
36133
+ constructor(e, t, r, i) {
36134
+ const s = e.toString().split(".")[1]?.length || 5;
36135
+ this._variables = t, this._errorListener = new v7(), this.array = new af(this._errorListener), this.math = new wB(s), this.color = new xB(), this.str = new Cx(this._errorListener, s, t), this.map = new Ex(), this.timeframe = new xx(t), t.buildInTimeframeFunc = this.timeframe, this.matrix = new Bx(this._errorListener), this.ta = new DB(t, this.math, this.timeframe), this._cacheData = {}, this._options = {}, this._bgColors = {}, this._alerts = /* @__PURE__ */ new Map(), this._hlines = /* @__PURE__ */ new Map(), this._fills = /* @__PURE__ */ new Map(), this.input = new BB(t, this._errorListener, r), this._plots = /* @__PURE__ */ new Map(), this._plotshapes = /* @__PURE__ */ new Map(), this._plotbars = /* @__PURE__ */ new Map(), this._plotcandles = /* @__PURE__ */ new Map(), this._plotchars = /* @__PURE__ */ new Map(), this._plotarrows = /* @__PURE__ */ new Map(), this.chart = { point: new Tx(t) }, this.line = new bi(t, this._errorListener), this.label = new $x(t, this._errorListener), this.polyline = new o7(t, this._errorListener), this.box = new u7(t, this._errorListener), this.table = new O7(t, this._errorListener), this.linefill = new b7(t), this.log = new g7(t, this.str), this.runtime = new W7(this._errorListener), this.strategy = new A7(this._variables, this._options, e, this._errorListener, r), this.request = new q7(this._variables, r, this, this._errorListener), this.syminfo = new m7(), this._proxy = /* @__PURE__ */ new Map(), this._indiOptions = i, this._id = r;
36126
36136
  }
36127
36137
  getFuncCacheData() {
36128
36138
  return {
@@ -36324,8 +36334,14 @@ ${cf}`);
36324
36334
  }
36325
36335
  indicator(e, t) {
36326
36336
  if (!this._options.scriptType) {
36327
- const { format: r, max_bars_back: i = 0 } = e;
36328
- this._variables.max_bars_back = i, this._paramVerfiy(r, t, "indicator", [E1.inherit, E1.percent, E1.price, E1.volume]), this._variables.updateMaxLength(e), this._options.scriptType = "indicator", this._options.indicator = e;
36337
+ const r = self.workerStorage.get(`indicator_${this._id}`);
36338
+ self.workerStorage.set(`indicator_${this._id}`, { ...e });
36339
+ const { format: i, max_bars_back: s = 0, calc_bars_count: o, timeframe: a, timeframe_gaps: c } = e;
36340
+ if (this._variables.max_bars_back = s, this._paramVerfiy(i, t, "indicator", [E1.inherit, E1.percent, E1.price, E1.volume]), this._variables.updateMaxLength(e), this._options.scriptType = "indicator", r) {
36341
+ const { customTimeframe: p, calcBarsCount: b, timeframeGaps: M } = this._indiOptions;
36342
+ p !== void 0 && r.timeframe === a && (e.timeframe = p), M !== void 0 && r.timeframe_gaps === c && (e.timeframe_gaps = M), b !== void 0 && r.calc_bars_count === o && (e.calc_bars_count = b);
36343
+ }
36344
+ this._options.indicator = e;
36329
36345
  }
36330
36346
  }
36331
36347
  _paramVerfiy(e = "", t, r, i, s = "format") {
@@ -38845,8 +38861,8 @@ ${u}`), u;
38845
38861
  const v = s.mintick ? Number(s.mintick) : 1e-5;
38846
38862
  s.mintick = v;
38847
38863
  const y = /* @__PURE__ */ Object.create(null);
38848
- self.workerStorage.set(`inputs_${u}`, W?.inputCache), self.workerStorage.set(`strategy_${u}`, W?.strategyCacheArgs);
38849
- const L = new Rb(O), D = new vb(), R = new yb(v, L, u), w = new Function("_$_var", "_$_const", "_$_func", n);
38864
+ self.workerStorage.set(`inputs_${u}`, W?.inputCache), self.workerStorage.set(`strategy_${u}`, W?.strategyCacheArgs), self.workerStorage.set(`indicator_${u}`, W?.indicatorCacheArgs);
38865
+ const L = new Rb(O), D = new vb(), R = new yb(v, L, u, { customTimeframe: O, calcBarsCount: l, timeframeGaps: d }), w = new Function("_$_var", "_$_const", "_$_func", n);
38850
38866
  let B = {
38851
38867
  request: [],
38852
38868
  requestData: [],
@@ -38859,7 +38875,7 @@ ${u}`), u;
38859
38875
  const { funcCacheData: X, varCacheData: K, requestCacheData: j, customTimeframe: Q, timeframeGaps: n0, lastData: l0 } = W;
38860
38876
  if (B = j, L.setVarCacheData(K), R.setFuncCacheData(X), O = Q, d = n0, r[0]?.time > l0?.time && r.unshift(l0), L.setCustomTimeframe = O, O && O !== A) {
38861
38877
  const r0 = Re(O), G = L.ta._currentData;
38862
- if (f = M[`${s.tickerid}--${r0}`], f?.length) {
38878
+ if (f = M?.[`${s.tickerid}--${r0}`], f?.length) {
38863
38879
  f[f.length - 1].isrealtime = !0, G?.time && (G.time < f[0].time ? f.unshift({ ...G, isrealtime: !1, barindex: G.barIndex }) : f = f.filter((_0) => _0.time >= G.time));
38864
38880
  for (const [_0, A0] of f.entries())
38865
38881
  A0.barindex || (A0.barindex = (G?.barIndex || 0) + _0);
@@ -38955,7 +38971,7 @@ ${u}`), u;
38955
38971
  errors: T
38956
38972
  };
38957
38973
  const $ = R.options(g, t);
38958
- Object.assign(y, { inputCache: self.workerStorage.get(`inputs_${u}`), strategyCacheArgs: self.workerStorage.get(`strategy_${u}`), varCacheData: L.getVarCacheData(), funcCacheData: R.getFuncCacheData() }), O && Object.assign(y, { customTimeframe: O, timeframeGaps: d, lastData: r[r.length - 1] }), Rs(u);
38974
+ Object.assign(y, { inputCache: self.workerStorage.get(`inputs_${u}`), indicatorCacheArgs: self.workerStorage.get(`indicator_${u}`), strategyCacheArgs: self.workerStorage.get(`strategy_${u}`), varCacheData: L.getVarCacheData(), funcCacheData: R.getFuncCacheData() }), O && Object.assign(y, { customTimeframe: O, timeframeGaps: d, lastData: r[r.length - 1] }), Rs(u);
38959
38975
  const P = O && O !== A && f?.length ? iM(f, r, $, A, O, d, t) : $;
38960
38976
  return {
38961
38977
  status: 0,
@@ -39065,7 +39081,7 @@ ${u}`), u;
39065
39081
  }
39066
39082
  }
39067
39083
  function Rs(n) {
39068
- 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`);
39084
+ self?.workerStorage?.deleteStartwidthKey(n), self?.workerStorage?.delete(`indicator_${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`);
39069
39085
  }
39070
39086
  var B0 = /* @__PURE__ */ ((n) => (n.BOOL = "bool", n.INT = "int", n.FLOAT = "float", n.ARRAY = "array", n.BOX = "box", n.CHART_POINT = "chart.point", n.COLOR = "color", n.CONST = "const", n.LABEL = "label", n.LINE = "line", n.LINEFILL = "linefill", n.MAP = "map", n.MATRIX = "matrix", n.POLYLINE = "polyline", n.SERIES = "series", n.SIMPLE = "simple", n.STRING = "string", n.TABLE = "table", n.UNDETERMINED = "undetermined type", n.INPUT = "input", n.NA = "na", n.VOID = "void", n.ENUM = "enum", n))(B0 || {}), m1 = /* @__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))(m1 || {}), Ya = /* @__PURE__ */ ((n) => (n.dividends = "dividends", n.none = "none", n.splits = "splits", n))(Ya || {}), vr = /* @__PURE__ */ ((n) => (n.freqAll = "freq_all", n.freqOncePerBar = "freq_once_per_bar", n.freqOncePerBarClose = "freq_once_per_bar_close", n))(vr || {}), Fr = /* @__PURE__ */ ((n) => (n.gapsOff = "gaps_off", n.gapsOn = "gaps_on", n.lookaheadOff = "lookahead_off", n.lookaheadOn = "lookahead_on", n))(Fr || {}), qr = /* @__PURE__ */ ((n) => (n.all = "all", n.dataWindow = "data_window", n.none = "none", n.pane = "pane", n.priceScale = "price_scale", n.statusLine = "status_line", n))(qr || {}), Ht = /* @__PURE__ */ ((n) => (n.both = "both", n.left = "left", n.none = "none", n.right = "right", n))(Ht || {}), T1 = /* @__PURE__ */ ((n) => (n.inherit = "inherit", n.mintick = "mintick", n.percent = "percent", n.price = "price", n.volume = "volume", n))(T1 || {}), Ka = /* @__PURE__ */ ((n) => (n.styleDashed = "style_dashed", n.styleDotted = "style_dotted", n.styleSolid = "style_solid", n))(Ka || {}), ne = /* @__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))(ne || {}), qe = /* @__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))(qe || {}), hi = /* @__PURE__ */ ((n) => (n.abovebar = "abovebar", n.absolute = "absolute", n.belowbar = "belowbar", n.bottom = "bottom", n.top = "top", n))(hi || {}), Dn = /* @__PURE__ */ ((n) => (n.ascending = "ascending", n.descending = "descending", n))(Dn || {}), or = /* @__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))(or || {}), St = /* @__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))(St || {}), Ga = /* @__PURE__ */ ((n) => (n.left = "left", n.none = "none", n.right = "right", n))(Ga || {}), Zi = /* @__PURE__ */ ((n) => (n.extended = "extended", n.regular = "regular", n))(Zi || {}), 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 || {}), Ge = /* @__PURE__ */ ((n) => (n.auto = "auto", n.huge = "huge", n.large = "large", n.normal = "normal", n.small = "small", n.tiny = "tiny", n))(Ge || {}), yi = /* @__PURE__ */ ((n) => (n.familyDefault = "default", n.familyMonospace = "monospace", n))(yi || {}), Ie = /* @__PURE__ */ ((n) => (n.cash = "cash", n.fixed = "fixed", n.percentOfEquity = "percent_of_equity", n))(Ie || {}), dt = /* @__PURE__ */ ((n) => (n.cashPerContract = "cash_per_contract", n.cashPerOrder = "cash_per_order", n.percent = "percent", n))(dt || {}), H0 = /* @__PURE__ */ ((n) => (n.all = "all", n.long = "long", n.short = "short", n))(H0 || {}), _i = /* @__PURE__ */ ((n) => (n.cancel = "cancel", n.none = "none", n.reduce = "reduce", n))(_i || {}), i1 = /* @__PURE__ */ ((n) => (n.alignBottom = "align_bottom", n.alignCenter = "align_center", n.alignLeft = "align_left", n.alignRight = "align_right", n.alignTop = "align_top", n.wrapAuto = "wrap_auto", n.wrapNone = "wrap_none", n))(i1 || {}), Q1 = /* @__PURE__ */ ((n) => (n.bar_index = "bar_index", n.bar_time = "bar_time", n))(Q1 || {}), br = /* @__PURE__ */ ((n) => (n.abovebar = "abovebar", n.belowbar = "belowbar", n.price = "price", n))(br || {}), Qa = /* @__PURE__ */ ((n) => (n.actual = "actual", n.estimate = "estimate", n.standardized = "standardized", n))(Qa || {}), ws = /* @__PURE__ */ ((n) => (n.traditional = "Traditional", n.fibonacci = "Fibonacci", n.woodie = "Woodie", n.classic = "Classic", n.dm = "DM", n.camarilla = "Camarilla", n))(ws || {}), lt = /* @__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.TEXT_AREA = "text_area", n.TIMEFRAME = "timeframe", n.ENUM = "enum", n))(lt || {}), _f = /* @__PURE__ */ ((n) => (n.library = "library", n.indicator = "indicator", n.strategy = "strategy", n))(_f || {}), Nb = /* @__PURE__ */ ((n) => (n.format_bold = "format_bold", n.format_italic = "format_italic", n.format_none = "format_none", n))(Nb || {});
39071
39087
  class Af {
@@ -43237,18 +43253,15 @@ ${u}`), u;
43237
43253
  const {
43238
43254
  totalChangeCapital: t,
43239
43255
  orders: r,
43240
- historyOrders: i,
43241
- pendingOrders: s,
43242
- pendingCloseOrders: o,
43243
- exitOrders: a,
43244
- maxDrawdownVerifyIndex: c,
43245
- cacheArgs: p,
43246
- useSetArgs: b,
43247
- historyOrdersShard: M,
43248
- notCloseHistoryOrders: l,
43249
- historyOrderLen: u
43256
+ pendingOrders: i,
43257
+ pendingCloseOrders: s,
43258
+ exitOrders: o,
43259
+ maxDrawdownVerifyIndex: a,
43260
+ cacheArgs: c,
43261
+ useSetArgs: p,
43262
+ notCloseHistoryOrders: b
43250
43263
  } = e;
43251
- this._totalChangeCapital = t, this._orders = r, this._pendingOrders = s, this._pendingCloseOrders = o, this._exitOrders = a, this._maxDrawdownVerifyIndex = c, this._notCloseHistoryOrders = l, this._variables.strategy.updateOrders(this._orders), Object.keys(p).length && this._updateArgToOptions(p, b), this._variables.strategy.updateHistoryOrderCalcData(), this._variables.strategy.updateHistoryOrder();
43264
+ this._totalChangeCapital = t, this._orders = r, this._pendingOrders = i, this._pendingCloseOrders = s, this._exitOrders = o, this._maxDrawdownVerifyIndex = a, this._notCloseHistoryOrders = b, this._variables.strategy.updateOrders(this._orders), Object.keys(c).length && this._updateArgToOptions(c, p), this._variables.strategy.updateHistoryOrderCalcData(), this._variables.strategy.updateHistoryOrder();
43252
43265
  }
43253
43266
  get orders() {
43254
43267
  return [...this._orders];
@@ -44517,9 +44530,11 @@ ${u}`), u;
44517
44530
  syminfo;
44518
44531
  _count = 0;
44519
44532
  _alertSelects = [];
44520
- constructor(e, t, r) {
44521
- const i = e.toString().split(".")[1]?.length || 5;
44522
- this._variables = t, this._errorListener = new XC(), this.array = new mf(this._errorListener), this.math = new F7(i), this.color = new P7(), this.str = new U7(this._errorListener, i, t), this.map = new V7(), this.timeframe = new j7(t), t.buildInTimeframeFunc = this.timeframe, this.matrix = new H7(this._errorListener), this.ta = new S7(t, this.math, this.timeframe), this._cacheData = {}, this._options = {}, this._bgColors = {}, this._alerts = /* @__PURE__ */ new Map(), this._hlines = /* @__PURE__ */ new Map(), this._fills = /* @__PURE__ */ new Map(), this.input = new k7(t, this._errorListener, r), this._plots = /* @__PURE__ */ new Map(), this._plotshapes = /* @__PURE__ */ new Map(), this._plotbars = /* @__PURE__ */ new Map(), this._plotcandles = /* @__PURE__ */ new Map(), this._plotchars = /* @__PURE__ */ new Map(), this._plotarrows = /* @__PURE__ */ new Map(), this.chart = { point: new Y7(t) }, this.line = new Mi(t, this._errorListener), this.label = new Q7(t, this._errorListener), this.polyline = new hC(t, this._errorListener), this.box = new yC(t, this._errorListener), this.table = new RC(t, this._errorListener), this.linefill = new mC(t), this.log = new EC(t, this.str), this.runtime = new TC(this._errorListener), this.strategy = new BC(this._variables, this._options, e, this._errorListener, r), this.request = new xC(this._variables, r, this, this._errorListener), this.syminfo = new CC(), this._proxy = /* @__PURE__ */ new Map();
44533
+ _indiOptions = {};
44534
+ _id;
44535
+ constructor(e, t, r, i) {
44536
+ const s = e.toString().split(".")[1]?.length || 5;
44537
+ this._variables = t, this._errorListener = new XC(), this.array = new mf(this._errorListener), this.math = new F7(s), this.color = new P7(), this.str = new U7(this._errorListener, s, t), this.map = new V7(), this.timeframe = new j7(t), t.buildInTimeframeFunc = this.timeframe, this.matrix = new H7(this._errorListener), this.ta = new S7(t, this.math, this.timeframe), this._cacheData = {}, this._options = {}, this._bgColors = {}, this._alerts = /* @__PURE__ */ new Map(), this._hlines = /* @__PURE__ */ new Map(), this._fills = /* @__PURE__ */ new Map(), this.input = new k7(t, this._errorListener, r), this._plots = /* @__PURE__ */ new Map(), this._plotshapes = /* @__PURE__ */ new Map(), this._plotbars = /* @__PURE__ */ new Map(), this._plotcandles = /* @__PURE__ */ new Map(), this._plotchars = /* @__PURE__ */ new Map(), this._plotarrows = /* @__PURE__ */ new Map(), this.chart = { point: new Y7(t) }, this.line = new Mi(t, this._errorListener), this.label = new Q7(t, this._errorListener), this.polyline = new hC(t, this._errorListener), this.box = new yC(t, this._errorListener), this.table = new RC(t, this._errorListener), this.linefill = new mC(t), this.log = new EC(t, this.str), this.runtime = new TC(this._errorListener), this.strategy = new BC(this._variables, this._options, e, this._errorListener, r), this.request = new xC(this._variables, r, this, this._errorListener), this.syminfo = new CC(), this._proxy = /* @__PURE__ */ new Map(), this._indiOptions = i, this._id = r;
44523
44538
  }
44524
44539
  getFuncCacheData() {
44525
44540
  return {
@@ -44721,8 +44736,14 @@ ${u}`), u;
44721
44736
  }
44722
44737
  indicator(e, t) {
44723
44738
  if (!this._options.scriptType) {
44724
- const { format: r, max_bars_back: i = 0 } = e;
44725
- this._variables.max_bars_back = i, this._paramVerfiy(r, t, "indicator", [T1.inherit, T1.percent, T1.price, T1.volume]), this._variables.updateMaxLength(e), this._options.scriptType = "indicator", this._options.indicator = e;
44739
+ const r = self.workerStorage.get(`indicator_${this._id}`);
44740
+ self.workerStorage.set(`indicator_${this._id}`, { ...e });
44741
+ const { format: i, max_bars_back: s = 0, calc_bars_count: o, timeframe: a, timeframe_gaps: c } = e;
44742
+ if (this._variables.max_bars_back = s, this._paramVerfiy(i, t, "indicator", [T1.inherit, T1.percent, T1.price, T1.volume]), this._variables.updateMaxLength(e), this._options.scriptType = "indicator", r) {
44743
+ const { customTimeframe: p, calcBarsCount: b, timeframeGaps: M } = this._indiOptions;
44744
+ p !== void 0 && r.timeframe === a && (e.timeframe = p), M !== void 0 && r.timeframe_gaps === c && (e.timeframe_gaps = M), b !== void 0 && r.calc_bars_count === o && (e.calc_bars_count = b);
44745
+ }
44746
+ this._options.indicator = e;
44726
44747
  }
44727
44748
  }
44728
44749
  _paramVerfiy(e = "", t, r, i, s = "format") {
@@ -47282,8 +47303,8 @@ ${u}`), u;
47282
47303
  const v = s.mintick ? Number(s.mintick) : 1e-5;
47283
47304
  s.mintick = v;
47284
47305
  const y = /* @__PURE__ */ Object.create(null);
47285
- self.workerStorage.set(`inputs_${u}`, W?.inputCache), self.workerStorage.set(`strategy_${u}`, W?.strategyCacheArgs);
47286
- const L = new Db(u, O), D = new Lb(), R = new wb(v, L, u), w = new Function("_$_var", "_$_const", "_$_func", n);
47306
+ self.workerStorage.set(`inputs_${u}`, W?.inputCache), self.workerStorage.set(`strategy_${u}`, W?.strategyCacheArgs), self.workerStorage.set(`indicator_${u}`, W?.indicatorCacheArgs);
47307
+ const L = new Db(u, O), D = new Lb(), R = new wb(v, L, u, { customTimeframe: O, calcBarsCount: l, timeframeGaps: d }), w = new Function("_$_var", "_$_const", "_$_func", n);
47287
47308
  let B = {
47288
47309
  request: [],
47289
47310
  requestData: [],
@@ -47296,7 +47317,7 @@ ${u}`), u;
47296
47317
  const { funcCacheData: X, varCacheData: K, requestCacheData: j, customTimeframe: Q, timeframeGaps: n0, lastData: l0 } = W;
47297
47318
  if (B = j, L.setVarCacheData(K), R.setFuncCacheData(X), O = Q, d = n0, r[0]?.time > l0?.time && r.unshift(l0), L.setCustomTimeframe = O, O && O !== A) {
47298
47319
  const r0 = Re(O), G = L.ta._currentData;
47299
- if (f = M[`${s.tickerid}--${r0}`], f?.length) {
47320
+ if (f = M?.[`${s.tickerid}--${r0}`], f?.length) {
47300
47321
  f[f.length - 1].isrealtime = !0, G?.time && (G.time < f[0].time ? f.unshift({ ...G, isrealtime: !1, barindex: G.barIndex }) : f = f.filter((_0) => _0.time >= G.time));
47301
47322
  for (const [_0, A0] of f.entries())
47302
47323
  A0.barindex || (A0.barindex = (G?.barIndex || 0) + _0);
@@ -47392,7 +47413,7 @@ ${u}`), u;
47392
47413
  errors: T
47393
47414
  };
47394
47415
  const $ = R.options(g, t);
47395
- Object.assign(y, { inputCache: self.workerStorage.get(`inputs_${u}`), strategyCacheArgs: self.workerStorage.get(`strategy_${u}`), varCacheData: L.getVarCacheData(), funcCacheData: R.getFuncCacheData() }), O && Object.assign(y, { customTimeframe: O, timeframeGaps: d, lastData: r[r.length - 1] }), Ns(u);
47416
+ Object.assign(y, { inputCache: self.workerStorage.get(`inputs_${u}`), indicatorCacheArgs: self.workerStorage.get(`indicator_${u}`), strategyCacheArgs: self.workerStorage.get(`strategy_${u}`), varCacheData: L.getVarCacheData(), funcCacheData: R.getFuncCacheData() }), O && Object.assign(y, { customTimeframe: O, timeframeGaps: d, lastData: r[r.length - 1] }), Ns(u);
47396
47417
  const P = O && O !== A && f?.length ? iM(f, r, $, A, O, d, t) : $;
47397
47418
  return {
47398
47419
  status: 0,
@@ -47502,7 +47523,7 @@ ${u}`), u;
47502
47523
  }
47503
47524
  }
47504
47525
  function Ns(n) {
47505
- 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`);
47526
+ self?.workerStorage?.deleteStartwidthKey(n), self?.workerStorage?.delete(`inputs_${n}`), self?.workerStorage?.delete(`strategy_${n}`), self?.workerStorage?.delete(`indicator_${n}`), self?.workerStorage?.delete(`request_${n}`), self?.workerStorage?.delete(`request_${n}_data`), self?.workerStorage?.delete(`request_${n}_list`);
47506
47527
  }
47507
47528
  var yf = {
47508
47529
  /**
@@ -9199,7 +9199,7 @@ function mr(i, n, r) {
9199
9199
  function Iy() {
9200
9200
  return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
9201
9201
  }
9202
- const Lf = new Worker(new URL("" + new URL("assets/scriptsRunWorker-D73HwiWk.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run MineScript Server" });
9202
+ const Lf = new Worker(new URL("" + new URL("assets/scriptsRunWorker-yrfYy-kF.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run MineScript Server" });
9203
9203
  Lf.onerror = (i) => {
9204
9204
  console.error(i);
9205
9205
  };
@@ -74,7 +74,7 @@ function print() { __p += __j.call(arguments, '') }
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]=Sa(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]=Sa({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 Ea=new WeakMap,Na="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const s=(Ea.get(a)||0)-1;Ea.set(a,s),s===0&&bl(a)});function ey(a,s){const r=(Ea.get(s)||0)+1;Ea.set(s,r),Na&&Na.register(a,s,a)}function ty(a){Na&&Na.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,_]=Sa(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(Sa);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 Sa(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-D73HwiWk.js").href:new URL("assets/scriptsRunWorker-D73HwiWk.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-0bHohOLX.js").href:new URL("assets/parserTccWorker-0bHohOLX.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(6);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 Or=null;const ql=()=>{if(Or!==null)return Or;try{Or=window!=="undefined"&&window.localStorage!==null;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{Or=!1}return Or};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 Pr=null;const zl=()=>{if(Pr!==null)return Pr;try{Pr=window!=="undefined"&&window.sessionStorage!==null;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{Pr=!1}return Pr};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&&(Bs(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),console.warn(...a))},El={},Jn=(...a)=>{Bs(a[0])&&El[a[0]]||(Bs(a[0])&&(El[a[0]]=new Date),vy(...a))},Nl=(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,Nl(a,r))},Sl=(a,s,r,n)=>{if(Bs(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,Nl(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}}),Bs=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={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},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},Ey=()=>Ll,Ny={type:"3rdParty",init(a){qy(a.options.react),Cy(a)}},Sy=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),By=(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(Sy)||{},l=r||n||Ey();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)=>Bs(z)?z:ky(z)&&Bs(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;_=Bs(_)?[_]:_||["translation"],l.reportNamespaces.addUsedNamespaces?.(_);const g=(l.isInitialized||l.initializedStoreOnce)&&_.every(j=>Ty(j,l,p)),x=By(l,s.lng||null,p.nsMode==="fallback"?_:_[0],u),w=()=>x,C=()=>Ml(l,s.lng||null,p.nsMode==="fallback"?_:_[0],u),[B,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?Sl(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=[B,l,g];if(se.t=B,se.i18n=l,se.ready=g,g||!g&&!d)return se;throw new Promise(j=>{s.lng?Sl(l,s.lng,_,()=>j()):ei(l,_,()=>j())})},Fy={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","new indicator":"New Indicator","new strategy":"New Strategy"},Oy={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":"“点击”关键词以获得更多帮助","new indicator":"新建指标","new strategy":"新建策略"};Be.use(Cl).use(Ny).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:Fy},zh:{translation:Oy}}}),self.MonacoEnvironment={getWorker(){return new ly({name:"Editor Worker"})}},Fn.config({paths:{vs:"https://www.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const Py=(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:B,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),B&&B()}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]=Sa(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]=Sa({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 Ea=new WeakMap,Na="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const s=(Ea.get(a)||0)-1;Ea.set(a,s),s===0&&bl(a)});function ey(a,s){const r=(Ea.get(s)||0)+1;Ea.set(s,r),Na&&Na.register(a,s,a)}function ty(a){Na&&Na.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,_]=Sa(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(Sa);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 Sa(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-yrfYy-kF.js").href:new URL("assets/scriptsRunWorker-yrfYy-kF.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-0bHohOLX.js").href:new URL("assets/parserTccWorker-0bHohOLX.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(6);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 Or=null;const ql=()=>{if(Or!==null)return Or;try{Or=window!=="undefined"&&window.localStorage!==null;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{Or=!1}return Or};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 Pr=null;const zl=()=>{if(Pr!==null)return Pr;try{Pr=window!=="undefined"&&window.sessionStorage!==null;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{Pr=!1}return Pr};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&&(Bs(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),console.warn(...a))},El={},Jn=(...a)=>{Bs(a[0])&&El[a[0]]||(Bs(a[0])&&(El[a[0]]=new Date),vy(...a))},Nl=(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,Nl(a,r))},Sl=(a,s,r,n)=>{if(Bs(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,Nl(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}}),Bs=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={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},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},Ey=()=>Ll,Ny={type:"3rdParty",init(a){qy(a.options.react),Cy(a)}},Sy=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),By=(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(Sy)||{},l=r||n||Ey();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)=>Bs(z)?z:ky(z)&&Bs(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;_=Bs(_)?[_]:_||["translation"],l.reportNamespaces.addUsedNamespaces?.(_);const g=(l.isInitialized||l.initializedStoreOnce)&&_.every(j=>Ty(j,l,p)),x=By(l,s.lng||null,p.nsMode==="fallback"?_:_[0],u),w=()=>x,C=()=>Ml(l,s.lng||null,p.nsMode==="fallback"?_:_[0],u),[B,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?Sl(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=[B,l,g];if(se.t=B,se.i18n=l,se.ready=g,g||!g&&!d)return se;throw new Promise(j=>{s.lng?Sl(l,s.lng,_,()=>j()):ei(l,_,()=>j())})},Fy={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","new indicator":"New Indicator","new strategy":"New Strategy"},Oy={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":"“点击”关键词以获得更多帮助","new indicator":"新建指标","new strategy":"新建策略"};Be.use(Cl).use(Ny).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:Fy},zh:{translation:Oy}}}),self.MonacoEnvironment={getWorker(){return new ly({name:"Editor Worker"})}},Fn.config({paths:{vs:"https://www.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const Py=(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:B,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),B&&B()}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(Py),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(Bm,{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})};M.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"}(M.VMarkerSeverity||(M.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,Bl={"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=Bl[s.format]||Bl.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=Fl(I),Xy=Fl(Wy),Vy=["text","onCopy","options","children"];function Fl(a){return a&&a.__esModule?a:{default:a}}function Ol(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 Pl(a){for(var s=1;s<arguments.length;s++){var r=arguments[s]!=null?arguments[s]:{};s%2?Ol(Object(r),!0).forEach(function(n){ai(a,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):Ol(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=Ba(a),o;if(s){var l=Ba(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 Ba(a){return Ba=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ba(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),B=(0,Xy.default)(_,w);g&&g(_,B),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,Pl(Pl({},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=Sd(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,B={name:n,orirginalName:n};if(a.length>1&&(B.overloads=`${a.length} ${Be.t("overloads")}`),l&&(B.type=l),o&&(B.name=`${n}()`,B.args=o.map(K=>{const{name:G,desc:X,displayType:q}=K;return{label:`${G} (${q})`,desc:X&&Fs(X)}})),p&&(B.desc=p.map(K=>Fs(K))),d&&(B.originalExample=d.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guihz/trading-vue-editor-tes",
3
- "version": "0.1.41",
3
+ "version": "0.1.43",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "lib"