@guihz/trading-vue-editor-tes 0.1.17 → 0.1.19

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.
@@ -90,6 +90,7 @@ export interface IDocValue {
90
90
  disallowedInTemplate?: boolean;
91
91
  expectsTemplate?: boolean;
92
92
  realName?: string;
93
+ isUserFields?: boolean;
93
94
  }
94
95
  export interface IDetailedDesc {
95
96
  desc: string[];
@@ -1,29 +1,5 @@
1
1
  import { IKeyObjectValue } from "../type";
2
- export declare function parseTcc(program: string, hasTranscoding: boolean, getImportLibraryFunc: (obj: IKeyObjectValue) => IKeyObjectValue, keyObjs: IKeyObjectValue, version: number): Promise<{
3
- errors: any[];
4
- functions: {
5
- [k: string]: import("../type").IDocValue[];
6
- };
7
- variables: {
8
- [k: string]: import("../type").IDocValue[];
9
- };
10
- types: {
11
- [k: string]: import("../type").IDocValue[];
12
- };
13
- methods: {
14
- [k: string]: import("../type").IDocValue[];
15
- };
16
- overloadsFuncs: import("../type").IKeyValue[];
17
- imports: {
18
- [k: string]: IKeyObjectValue;
19
- };
20
- enums: {
21
- [k: string]: import("../type").IDocValue[];
22
- };
23
- codeStr: string;
24
- preParserCode: string | undefined;
25
- config: IKeyObjectValue;
26
- } | undefined>;
2
+ export declare function parseTcc(program: string, hasTranscoding: boolean, getImportLibraryFunc: (obj: IKeyObjectValue) => IKeyObjectValue, keyObjs: IKeyObjectValue, version: number): Promise<IKeyObjectValue>;
27
3
  export declare function parseLibraryCode(program: string, libTitle: string, getImportLibraryFunc: (obj: IKeyObjectValue) => IKeyObjectValue, keyObjs: IKeyObjectValue): Promise<{
28
4
  description: string;
29
5
  codeStr: string;
@@ -93,6 +93,8 @@ export declare const ERRORS_TIPS: {
93
93
  optionsRepeatErr: string;
94
94
  scriptLongTimeErr: string;
95
95
  plotFillForceOverlayErr: string;
96
+ constModifyErr: string;
97
+ maxOpenOrdersErr: string;
96
98
  };
97
99
  export declare const WARNING_TIPS: {
98
100
  repeatVar: string;
@@ -93,6 +93,8 @@ export declare const ERRORS_TIPS: {
93
93
  optionsRepeatErr: string;
94
94
  scriptLongTimeErr: string;
95
95
  plotFillForceOverlayErr: string;
96
+ constModifyErr: string;
97
+ maxOpenOrdersErr: string;
96
98
  };
97
99
  export declare const WARNING_TIPS: {
98
100
  repeatVar: string;
@@ -102,6 +102,8 @@ export declare const ERRORS_TIPS: {
102
102
  matrixSetValueErr: string;
103
103
  matrixRowsColsEqErr: string;
104
104
  matrixMultErr: string;
105
+ maxOpenOrdersErr: string;
106
+ historyReferencingOperatorErr: string;
105
107
  };
106
108
  export declare const WARNING_TIPS: {
107
109
  repeatVar: string;
@@ -0,0 +1,134 @@
1
+ import { VType } from "./enum";
2
+ export declare const ERRORS_TIPS: {
3
+ onlyInLoop: string;
4
+ invalidType: string;
5
+ typeUseError: string;
6
+ notTypeKeyword: string;
7
+ undeclared: string;
8
+ repeatVar: string;
9
+ typeRepeatErr: string;
10
+ typeMismatch: string;
11
+ assignTypeMismatch: string;
12
+ voidNotVar: string;
13
+ declareTypeErr: string;
14
+ mapKeyValErr: string;
15
+ inputSourceErr: string;
16
+ buildInUseErr: string;
17
+ argsLenErr: string;
18
+ requiredParamErr: string;
19
+ argsSyntaxErr: string;
20
+ requestArgsErr: string;
21
+ mapKeyErr: string;
22
+ templateErr: string;
23
+ templateNoSupportErr: string;
24
+ ifOrSwitchTypeErr: string;
25
+ argsNameErr: string;
26
+ noFiledErr: string;
27
+ methodNotExistErr: string;
28
+ tupleVarErr: string;
29
+ tupleLeftVarErr: string;
30
+ tupleRightVarErr: string;
31
+ tempateTypeErr: string;
32
+ qualifierErr: string;
33
+ notFindFuncErr: string;
34
+ naVarErr: string;
35
+ notHistoryErr: string;
36
+ defaultValueErr: string;
37
+ defaultValueTypeErr: string;
38
+ typeFieldErr: string;
39
+ unaryErr: string;
40
+ funcArgAssignErr: string;
41
+ declaredErr: string;
42
+ globalFuncErr: string;
43
+ onlyStatementErr: string;
44
+ modifyGlobalVarErr: string;
45
+ inputDefvalErr: string;
46
+ objectIsNaErr: string;
47
+ buidinAssignErr: string;
48
+ buidinVarErr: string;
49
+ useNaErr: string;
50
+ libraryTitleErr: string;
51
+ exportFuncArgErr: string;
52
+ indiRunErr: string;
53
+ libraryExportErr: string;
54
+ strategyRunErr: string;
55
+ exportUseErr: string;
56
+ funcRepeatErr: string;
57
+ importMultipleErr: string;
58
+ importNotExitErr: string;
59
+ importNameRepeatErr: string;
60
+ exportFuncHasInputErr: string;
61
+ libraryTitleIsKeywordErr: string;
62
+ exportFuncUseGlobalVarErr: string;
63
+ loopRuntimeErr: string;
64
+ paramsErr: string;
65
+ displayErr: string;
66
+ exportFuncUseReqErr: string;
67
+ requestExprErr: string;
68
+ argDefaultErr: string;
69
+ overloadFuncErr: string;
70
+ againAssignErr: string;
71
+ requestUserInLoopErr: string;
72
+ enumVarNameErr: string;
73
+ enumVarNameBuiltinErr: string;
74
+ typeNameErr: string;
75
+ enumUseErr: string;
76
+ conditionalErr: string;
77
+ fortoErr: string;
78
+ indicatorUseStrategyFuncErr: string;
79
+ arrEmptyErr: string;
80
+ arrLengthDiffErr: string;
81
+ arrTypeErr: string;
82
+ inputOptErr: string;
83
+ mathRandomErr: string;
84
+ matrixRehapeErr: string;
85
+ strategyExitErr: string;
86
+ arrLenErr: string;
87
+ mergeCellErr: string;
88
+ minOrMaxErr: string;
89
+ requestsNumErr: string;
90
+ undeterminedTypeMethodErr: string;
91
+ requestUseFuncErr: string;
92
+ requestLowerTfPeriodErr: string;
93
+ optionsRepeatErr: string;
94
+ scriptLongTimeErr: string;
95
+ plotFillForceOverlayErr: string;
96
+ constModifyErr: string;
97
+ arrMaxLenErr: string;
98
+ arrSetValueErr: string;
99
+ matrixMaxLenErr: string;
100
+ matrixToFromErr: string;
101
+ matrixAddRowColErr: string;
102
+ matrixSetValueErr: string;
103
+ matrixRowsColsEqErr: string;
104
+ matrixMultErr: string;
105
+ };
106
+ export declare const WARNING_TIPS: {
107
+ repeatVar: string;
108
+ typeMismatch: string;
109
+ moreSameArg: string;
110
+ localScopeGetHistory: string;
111
+ localScopeWarning: string;
112
+ strategyCalcTickWarn: string;
113
+ conditionWarning: string;
114
+ lineWidthWarning: string;
115
+ boolVarNumWarning: string;
116
+ transpDeprecatedTips: string;
117
+ };
118
+ export declare const DRAW_TYPES: VType[];
119
+ export declare const QUALIFIERS: VType[];
120
+ export declare const BASE_TYPE: VType[];
121
+ export declare const PLOT_DISPLAY_TYPES: string[];
122
+ export declare const ONLY_STATEMENTS: string[];
123
+ export declare const GLOBAL_DRAW_FUNCS: string[];
124
+ export declare const GLOBAL_FUNCS: string[];
125
+ export declare const INDICATOR_NEED_DRAW_FUNCS: string[];
126
+ export declare const STRATEGY_NEED_FUNCS: string[];
127
+ export declare const NAMESPACE_CALL_SELF_FUNCS: string[];
128
+ export declare const SOURCE_TYPE_BUILTIN: string[];
129
+ export declare const COMMENTS_DESC_REG: RegExp;
130
+ export declare const JS_KEYWORDS: string[];
131
+ export declare const TCC_KEYWORDS: string[];
132
+ export declare const TCC_NAMESAPCES: string[];
133
+ export declare const CHANGE_VALUE_FUNCS: string[];
134
+ export declare const TRANSP_FUNCS: string[];
@@ -25,7 +25,7 @@ export declare function parseTcc(program: string, hasTranscoding: boolean, getIm
25
25
  codeStr: string;
26
26
  preParserCode: string | undefined;
27
27
  config: IKeyObjectValue;
28
- } | undefined>;
28
+ }>;
29
29
  export declare function parseLibraryCode(program: string, libTitle: string, getImportLibraryFunc: (obj: IKeyObjectValue) => IKeyObjectValue, keyObjs: IKeyObjectValue): Promise<{
30
30
  description: string;
31
31
  codeStr: string;
@@ -46,7 +46,7 @@ export declare class Strategy {
46
46
  private _calcMaxDrawdownAndMaxRunup;
47
47
  updateOrders(orders: IOrder[], isRemove?: boolean): void;
48
48
  private _calcMaxContracts;
49
- private _updateHistoryOrderCalcData;
49
+ updateHistoryOrderCalcData(): void;
50
50
  private _createBalanceByInterval;
51
51
  updateHistoryOrder(order?: IOrder): void;
52
52
  updateStrategyOptions(options: IStrategy): void;
@@ -103,6 +103,10 @@ export declare const ERRORS_TIPS: {
103
103
  matrixRowsColsEqErr: string;
104
104
  matrixMultErr: string;
105
105
  maxOpenOrdersErr: string;
106
+ historyReferencingOperatorErr: string;
107
+ historyReferencingOperatorUseFieldErr: string;
108
+ moreSameArgErr: string;
109
+ lineWidthErr: string;
106
110
  };
107
111
  export declare const WARNING_TIPS: {
108
112
  repeatVar: string;
@@ -25,7 +25,7 @@ export declare function parseTcc(program: string, hasTranscoding: boolean, getIm
25
25
  codeStr: string;
26
26
  preParserCode: string | undefined;
27
27
  config: IKeyObjectValue;
28
- } | undefined>;
28
+ }>;
29
29
  export declare function parseLibraryCode(program: string, libTitle: string, getImportLibraryFunc: (obj: IKeyObjectValue) => IKeyObjectValue, keyObjs: IKeyObjectValue): Promise<{
30
30
  description: string;
31
31
  codeStr: string;
@@ -9160,14 +9160,14 @@ function mr(i, n, r) {
9160
9160
  function E1() {
9161
9161
  return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
9162
9162
  }
9163
- const kf = new Worker(new URL("" + new URL("assets/scriptsRunWorker-CWAx2DV5.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run MineScript Server" });
9163
+ const kf = new Worker(new URL("" + new URL("assets/scriptsRunWorker-AjKVFLY2.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run MineScript Server" });
9164
9164
  kf.onerror = (i) => {
9165
9165
  console.error(i);
9166
9166
  };
9167
9167
  async function Lf(i) {
9168
9168
  return await _o.setInlayHints(i);
9169
9169
  }
9170
- const Tf = pa(kf), Nf = pa(new Worker(new URL("" + new URL("assets/parserTccWorker-CXp94-Z9.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser MineScript Server" }));
9170
+ const Tf = pa(kf), Nf = pa(new Worker(new URL("" + new URL("assets/parserTccWorker-BCWxJvBi.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser MineScript Server" }));
9171
9171
  async function I1(i, n = !1, r = Xt) {
9172
9172
  const s = await An(r);
9173
9173
  if (!s)
@@ -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 ml=Symbol("Comlink.proxy"),Wu=Symbol("Comlink.endpoint"),Xu=Symbol("Comlink.releaseProxy"),Xn=Symbol("Comlink.finalizer"),qa=Symbol("Comlink.thrown"),ul=a=>typeof a=="object"&&a!==null||typeof a=="function",Vu={canHandle:a=>ul(a)&&a[ml],serialize(a){const{port1:s,port2:r}=new MessageChannel;return _l(a,s),[r,[r]]},deserialize(a){return a.start(),Vn(a)}},Yu={canHandle:a=>ul(a)&&qa 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}},yl=new Map([["proxy",Vu],["throw",Yu]]);function Qu(a,s){for(const r of a)if(s===r||r==="*"||r instanceof RegExp&&r.test(s))return!0;return!1}function _l(a,s=globalThis,r=["*"]){s.addEventListener("message",function n(o){if(!o||!o.data)return;if(!Qu(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);_=Qn(w)}break;case"ENDPOINT":{const{port1:w,port2:C}=new MessageChannel;_l(a,C),_=sy(w,[w])}break;case"RELEASE":_=void 0;break;default:return}}catch(g){_={value:g,[qa]:0}}Promise.resolve(_).catch(g=>({value:g,[qa]:0})).then(g=>{const[x,w]=Sa(g);s.postMessage(Object.assign(Object.assign({},x),{id:l}),w),p==="RELEASE"&&(s.removeEventListener("message",n),fl(s),Xn in a&&typeof a[Xn]=="function"&&a[Xn]())}).catch(g=>{const[x,w]=Sa({value:new TypeError("Unserializable return value"),[qa]:0});s.postMessage(Object.assign(Object.assign({},x),{id:l}),w)})}),s.start&&s.start()}function Zu(a){return a.constructor.name==="MessagePort"}function fl(a){Zu(a)&&a.close()}function Vn(a,s){return Yn(a,[],s)}function za(a){if(a)throw new Error("Proxy has been released and is not useable")}function gl(a){return er(a,{type:"RELEASE"}).then(()=>{fl(a)})}const Ca=new WeakMap,Na="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const s=(Ca.get(a)||0)-1;Ca.set(a,s),s===0&&gl(a)});function Ju(a,s){const r=(Ca.get(s)||0)+1;Ca.set(s,r),Na&&Na.register(a,s,a)}function ey(a){Na&&Na.unregister(a)}function Yn(a,s=[],r=function(){}){let n=!1;const o=new Proxy(r,{get(l,p){if(za(n),p===Xu)return()=>{ey(o),gl(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 Yn(a,[...s,p])},set(l,p,d){za(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){za(n);const u=s[s.length-1];if(u===Wu)return er(a,{type:"ENDPOINT"}).then(Ms);if(u==="bind")return Yn(a,s.slice(0,-1));const[_,g]=bl(d);return er(a,{type:"APPLY",path:s.map(x=>x.toString()),argumentList:_},g).then(Ms)},construct(l,p){za(n);const[d,u]=bl(p);return er(a,{type:"CONSTRUCT",path:s.map(_=>_.toString()),argumentList:d},u).then(Ms)}});return Ju(o,a),o}function ty(a){return Array.prototype.concat.apply([],a)}function bl(a){const s=a.map(Sa);return[s.map(r=>r[0]),ty(s.map(r=>r[1]))]}const xl=new WeakMap;function sy(a,s){return xl.set(a,s),a}function Qn(a){return Object.assign(a,{[ml]:!0})}function Sa(a){for(const[s,r]of yl)if(r.canHandle(a)){const[n,o]=r.serialize(a);return[{type:"HANDLER",name:s,value:n},o]}return[{type:"RAW",value:a},xl.get(a)||[]]}function Ms(a){switch(a.type){case"HANDLER":return yl.get(a.name).deserialize(a.value);case"RAW":return a.value}}function er(a,s,r){return new Promise(n=>{const o=ry();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 ry(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const hl=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-CWAx2DV5.js").href:new URL("assets/scriptsRunWorker-CWAx2DV5.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"});hl.onerror=a=>{console.error(a)};async function wl(a){return await Da.setInlayHints(a)}const vl=Vn(hl),Tl=Vn(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-CXp94-Z9.js").href:new URL("assets/parserTccWorker-CXp94-Z9.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 kl(a,s=!1,r=Qt){const n=await xs(r);if(!n)return;const{functions:o,types:l,constants:p,variables:d,methods:u}=n.KEY_MAP_LIST;return await Tl.parseTcc(a,s,Qn(wl),{functions:Object.fromEntries(o),methods:Object.fromEntries(u),types:Object.fromEntries(l),constants:Object.fromEntries(p),variables:Object.fromEntries(d)},r)}async function ay(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 Tl.parseLibraryCode(a,s,Qn(wl),{functions:Object.fromEntries(n),methods:Object.fromEntries(d),types:Object.fromEntries(o),constants:Object.fromEntries(l),variables:Object.fromEntries(p)})}async function ny(a,s,r=!0,n=Qt){return await vl.runScript(a,s,r,n)}async function iy(a){return await vl.removeScript(a)}function oy(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:ly,forEach:cy}=[];function py(a){return cy.call(ly.call(arguments,1),s=>{if(s)for(const r in s)a[r]===void 0&&(a[r]=s[r])}),a}const Dl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,dy=(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(!Dl.test(n.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${n.domain}`}if(n.path){if(!Dl.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},Il={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=dy(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 my={name:"cookie",lookup(a){let{lookupCookie:s}=a;if(s&&typeof document<"u")return Il.read(s)||void 0},cacheUserLanguage(a,s){let{lookupCookie:r,cookieMinutes:n,cookieDomain:o,cookieOptions:l}=s;r&&typeof document<"u"&&Il.create(r,a,n,o,l)}},uy={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 Al=()=>{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 yy={name:"localStorage",lookup(a){let{lookupLocalStorage:s}=a;if(s&&Al())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupLocalStorage:r}=s;r&&Al()&&window.localStorage.setItem(r,a)}};let Br=null;const ql=()=>{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 _y={name:"sessionStorage",lookup(a){let{lookupSessionStorage:s}=a;if(s&&ql())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupSessionStorage:r}=s;r&&ql()&&window.sessionStorage.setItem(r,a)}},fy={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}},gy={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}},by={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}},xy={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 hy(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a}}class zl{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=py(r,this.options||{},hy()),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(my),this.addDetector(uy),this.addDetector(yy),this.addDetector(_y),this.addDetector(fy),this.addDetector(gy),this.addDetector(by),this.addDetector(xy)}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)}))}}zl.type="languageDetector";const wy=(...a)=>{console?.warn&&(Fs(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),console.warn(...a))},Cl={},Zn=(...a)=>{Fs(a[0])&&Cl[a[0]]||(Fs(a[0])&&(Cl[a[0]]=new Date),wy(...a))},Nl=(a,s)=>()=>{if(a.isInitialized)s();else{const r=()=>{setTimeout(()=>{a.off("initialized",r)},0),s()};a.on("initialized",r)}},Jn=(a,s,r)=>{a.loadNamespaces(s,Nl(a,r))},Sl=(a,s,r,n)=>{if(Fs(r)&&(r=[r]),a.options.preload&&a.options.preload.indexOf(s)>-1)return Jn(a,r,n);r.forEach(o=>{a.options.ns.indexOf(o)<0&&a.options.ns.push(o)}),a.loadLanguages(s,Nl(a,n))},vy=(a,s,r={})=>!s.languages||!s.languages.length?(Zn("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",Ty=a=>typeof a=="object"&&a!==null,ky=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Dy={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Iy=a=>Dy[a];let ei={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:a=>a.replace(ky,Iy)};const Ay=(a={})=>{ei={...ei,...a}},qy=()=>ei;let El;const zy=a=>{El=a},Cy=()=>El,Ny={type:"3rdParty",init(a){Ay(a.options.react),zy(a)}},Sy=I.createContext();class Ey{constructor(){this.usedNamespaces={}}addUsedNamespaces(s){s.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Ly=(a,s)=>{const r=I.useRef();return I.useEffect(()=>{r.current=s?r.current:a},[a,s]),r.current},Ll=(a,s,r,n)=>a.getFixedT(s,r,n),My=(a,s,r,n)=>I.useCallback(Ll(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||Cy();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new Ey),!l){Zn("You will need to pass in an i18next instance by using initReactI18next");const j=(R,z)=>Fs(z)?z:Ty(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&&Zn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const p={...qy(),...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=>vy(j,l,p)),x=My(l,s.lng||null,p.nsMode==="fallback"?_:_[0],u),w=()=>x,C=()=>Ll(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=Ly(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)}):Jn(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?Sl(l,s.lng,_,()=>j()):Jn(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"},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":"“点击”关键词以获得更多帮助"};Pe.use(zl).use(Ny).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:Fy},zh:{translation:Py}}}),self.MonacoEnvironment={getWorker(){return new oy({name:"Editor Worker"})}},Fn.config({paths:{vs:"https://www.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const Oy=(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){Da.setEditor(ne),q.current=new Gu(ne,De,C),x&&q.current?.addLinkOpenFunc(x),p&&q.current?.addDiffDecorations(),bu(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 kl(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(()=>wu.debounce(z,1500),[z]);function re(ne){if(d){z(ne||"");return}j.current=!0,Da.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(Rm,{height:r,width:n||"100%",defaultLanguage:je,defaultValue:u||`indicator("我的脚本")
77
+ */const ml=Symbol("Comlink.proxy"),Wu=Symbol("Comlink.endpoint"),Xu=Symbol("Comlink.releaseProxy"),Xn=Symbol("Comlink.finalizer"),qa=Symbol("Comlink.thrown"),ul=a=>typeof a=="object"&&a!==null||typeof a=="function",Vu={canHandle:a=>ul(a)&&a[ml],serialize(a){const{port1:s,port2:r}=new MessageChannel;return _l(a,s),[r,[r]]},deserialize(a){return a.start(),Vn(a)}},Yu={canHandle:a=>ul(a)&&qa 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}},yl=new Map([["proxy",Vu],["throw",Yu]]);function Qu(a,s){for(const r of a)if(s===r||r==="*"||r instanceof RegExp&&r.test(s))return!0;return!1}function _l(a,s=globalThis,r=["*"]){s.addEventListener("message",function n(o){if(!o||!o.data)return;if(!Qu(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);_=Qn(w)}break;case"ENDPOINT":{const{port1:w,port2:C}=new MessageChannel;_l(a,C),_=sy(w,[w])}break;case"RELEASE":_=void 0;break;default:return}}catch(g){_={value:g,[qa]:0}}Promise.resolve(_).catch(g=>({value:g,[qa]:0})).then(g=>{const[x,w]=Sa(g);s.postMessage(Object.assign(Object.assign({},x),{id:l}),w),p==="RELEASE"&&(s.removeEventListener("message",n),fl(s),Xn in a&&typeof a[Xn]=="function"&&a[Xn]())}).catch(g=>{const[x,w]=Sa({value:new TypeError("Unserializable return value"),[qa]:0});s.postMessage(Object.assign(Object.assign({},x),{id:l}),w)})}),s.start&&s.start()}function Zu(a){return a.constructor.name==="MessagePort"}function fl(a){Zu(a)&&a.close()}function Vn(a,s){return Yn(a,[],s)}function za(a){if(a)throw new Error("Proxy has been released and is not useable")}function gl(a){return er(a,{type:"RELEASE"}).then(()=>{fl(a)})}const Ca=new WeakMap,Na="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const s=(Ca.get(a)||0)-1;Ca.set(a,s),s===0&&gl(a)});function Ju(a,s){const r=(Ca.get(s)||0)+1;Ca.set(s,r),Na&&Na.register(a,s,a)}function ey(a){Na&&Na.unregister(a)}function Yn(a,s=[],r=function(){}){let n=!1;const o=new Proxy(r,{get(l,p){if(za(n),p===Xu)return()=>{ey(o),gl(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 Yn(a,[...s,p])},set(l,p,d){za(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){za(n);const u=s[s.length-1];if(u===Wu)return er(a,{type:"ENDPOINT"}).then(Ms);if(u==="bind")return Yn(a,s.slice(0,-1));const[_,g]=bl(d);return er(a,{type:"APPLY",path:s.map(x=>x.toString()),argumentList:_},g).then(Ms)},construct(l,p){za(n);const[d,u]=bl(p);return er(a,{type:"CONSTRUCT",path:s.map(_=>_.toString()),argumentList:d},u).then(Ms)}});return Ju(o,a),o}function ty(a){return Array.prototype.concat.apply([],a)}function bl(a){const s=a.map(Sa);return[s.map(r=>r[0]),ty(s.map(r=>r[1]))]}const xl=new WeakMap;function sy(a,s){return xl.set(a,s),a}function Qn(a){return Object.assign(a,{[ml]:!0})}function Sa(a){for(const[s,r]of yl)if(r.canHandle(a)){const[n,o]=r.serialize(a);return[{type:"HANDLER",name:s,value:n},o]}return[{type:"RAW",value:a},xl.get(a)||[]]}function Ms(a){switch(a.type){case"HANDLER":return yl.get(a.name).deserialize(a.value);case"RAW":return a.value}}function er(a,s,r){return new Promise(n=>{const o=ry();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 ry(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const hl=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-AjKVFLY2.js").href:new URL("assets/scriptsRunWorker-AjKVFLY2.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"});hl.onerror=a=>{console.error(a)};async function wl(a){return await Da.setInlayHints(a)}const vl=Vn(hl),Tl=Vn(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-BCWxJvBi.js").href:new URL("assets/parserTccWorker-BCWxJvBi.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 kl(a,s=!1,r=Qt){const n=await xs(r);if(!n)return;const{functions:o,types:l,constants:p,variables:d,methods:u}=n.KEY_MAP_LIST;return await Tl.parseTcc(a,s,Qn(wl),{functions:Object.fromEntries(o),methods:Object.fromEntries(u),types:Object.fromEntries(l),constants:Object.fromEntries(p),variables:Object.fromEntries(d)},r)}async function ay(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 Tl.parseLibraryCode(a,s,Qn(wl),{functions:Object.fromEntries(n),methods:Object.fromEntries(d),types:Object.fromEntries(o),constants:Object.fromEntries(l),variables:Object.fromEntries(p)})}async function ny(a,s,r=!0,n=Qt){return await vl.runScript(a,s,r,n)}async function iy(a){return await vl.removeScript(a)}function oy(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:ly,forEach:cy}=[];function py(a){return cy.call(ly.call(arguments,1),s=>{if(s)for(const r in s)a[r]===void 0&&(a[r]=s[r])}),a}const Dl=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,dy=(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(!Dl.test(n.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${n.domain}`}if(n.path){if(!Dl.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},Il={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=dy(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 my={name:"cookie",lookup(a){let{lookupCookie:s}=a;if(s&&typeof document<"u")return Il.read(s)||void 0},cacheUserLanguage(a,s){let{lookupCookie:r,cookieMinutes:n,cookieDomain:o,cookieOptions:l}=s;r&&typeof document<"u"&&Il.create(r,a,n,o,l)}},uy={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 Al=()=>{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 yy={name:"localStorage",lookup(a){let{lookupLocalStorage:s}=a;if(s&&Al())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupLocalStorage:r}=s;r&&Al()&&window.localStorage.setItem(r,a)}};let Br=null;const ql=()=>{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 _y={name:"sessionStorage",lookup(a){let{lookupSessionStorage:s}=a;if(s&&ql())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupSessionStorage:r}=s;r&&ql()&&window.sessionStorage.setItem(r,a)}},fy={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}},gy={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}},by={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}},xy={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 hy(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a}}class zl{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=py(r,this.options||{},hy()),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(my),this.addDetector(uy),this.addDetector(yy),this.addDetector(_y),this.addDetector(fy),this.addDetector(gy),this.addDetector(by),this.addDetector(xy)}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)}))}}zl.type="languageDetector";const wy=(...a)=>{console?.warn&&(Fs(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),console.warn(...a))},Cl={},Zn=(...a)=>{Fs(a[0])&&Cl[a[0]]||(Fs(a[0])&&(Cl[a[0]]=new Date),wy(...a))},Nl=(a,s)=>()=>{if(a.isInitialized)s();else{const r=()=>{setTimeout(()=>{a.off("initialized",r)},0),s()};a.on("initialized",r)}},Jn=(a,s,r)=>{a.loadNamespaces(s,Nl(a,r))},Sl=(a,s,r,n)=>{if(Fs(r)&&(r=[r]),a.options.preload&&a.options.preload.indexOf(s)>-1)return Jn(a,r,n);r.forEach(o=>{a.options.ns.indexOf(o)<0&&a.options.ns.push(o)}),a.loadLanguages(s,Nl(a,n))},vy=(a,s,r={})=>!s.languages||!s.languages.length?(Zn("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",Ty=a=>typeof a=="object"&&a!==null,ky=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Dy={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Iy=a=>Dy[a];let ei={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:a=>a.replace(ky,Iy)};const Ay=(a={})=>{ei={...ei,...a}},qy=()=>ei;let El;const zy=a=>{El=a},Cy=()=>El,Ny={type:"3rdParty",init(a){Ay(a.options.react),zy(a)}},Sy=I.createContext();class Ey{constructor(){this.usedNamespaces={}}addUsedNamespaces(s){s.forEach(r=>{this.usedNamespaces[r]||(this.usedNamespaces[r]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const Ly=(a,s)=>{const r=I.useRef();return I.useEffect(()=>{r.current=s?r.current:a},[a,s]),r.current},Ll=(a,s,r,n)=>a.getFixedT(s,r,n),My=(a,s,r,n)=>I.useCallback(Ll(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||Cy();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new Ey),!l){Zn("You will need to pass in an i18next instance by using initReactI18next");const j=(R,z)=>Fs(z)?z:Ty(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&&Zn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const p={...qy(),...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=>vy(j,l,p)),x=My(l,s.lng||null,p.nsMode==="fallback"?_:_[0],u),w=()=>x,C=()=>Ll(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=Ly(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)}):Jn(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?Sl(l,s.lng,_,()=>j()):Jn(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"},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":"“点击”关键词以获得更多帮助"};Pe.use(zl).use(Ny).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:Fy},zh:{translation:Py}}}),self.MonacoEnvironment={getWorker(){return new oy({name:"Editor Worker"})}},Fn.config({paths:{vs:"https://www.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const Oy=(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){Da.setEditor(ne),q.current=new Gu(ne,De,C),x&&q.current?.addLinkOpenFunc(x),p&&q.current?.addDiffDecorations(),bu(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 kl(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(()=>wu.debounce(z,1500),[z]);function re(ne){if(d){z(ne||"");return}j.current=!0,Da.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(Rm,{height:r,width:n||"100%",defaultLanguage:je,defaultValue:u||`indicator("我的脚本")
78
78
  plot(close)
79
79
  `,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?Um:{},readOnlyMessage:{value:G("This script is read-only. It cannot be edited.")},...l},onMount:R,onChange:re})})},By=I.forwardRef(Oy),Ry=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",$n),g.editor.defineTheme("vs",Un);const x=await Ta(d);x&&(g.languages.setMonarchTokensProvider(je,x.LANGUAGE_MONARCH_TOKENS),g.languages.setLanguageConfiguration(je,x.CONFIGURATION))},[d]);return T.jsx(Mm,{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 Ea={},Ky=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()}},Uy=Ky,Ml={"text/plain":"Text","text/html":"Url",default:"Text"},$y="Copy to clipboard: #{key}, Enter";function Hy(a){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return a.replace(/#{\s*key\s*}/g,s)}function jy(a,s){var r,n,o,l,p,d,u=!1;s||(s={}),r=s.debug||!1;try{o=Uy(),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=Ml[s.format]||Ml.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=Hy("message"in s?s.message:$y),window.prompt(n,a)}}finally{p&&(typeof p.removeRange=="function"?p.removeRange(l):p.removeAllRanges()),d&&document.body.removeChild(d),o()}return u}var Gy=jy;function ti(a){"@babel/helpers - typeof";return ti=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},ti(a)}Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.CopyToClipboard=void 0;var La=Fl(I),Wy=Fl(Gy),Xy=["text","onCopy","options","children"];function Fl(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 Ol(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){ri(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 Vy(a,s){if(a==null)return{};var r=Yy(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 Yy(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 Qy(a,s){if(!(a instanceof s))throw new TypeError("Cannot call a class as a function")}function Bl(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 Zy(a,s,r){return s&&Bl(a.prototype,s),r&&Bl(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}function Jy(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&&si(a,s)}function si(a,s){return si=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},si(a,s)}function e_(a){var s=s_();return function(){var n=Ma(a),o;if(s){var l=Ma(this).constructor;o=Reflect.construct(n,arguments,l)}else o=n.apply(this,arguments);return t_(this,o)}}function t_(a,s){if(s&&(ti(s)==="object"||typeof s=="function"))return s;if(s!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rl(a)}function Rl(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function s_(){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 Ma(a){return Ma=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ma(a)}function ri(a,s,r){return s in a?Object.defineProperty(a,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[s]=r,a}var Kl=function(a){Jy(r,a);var s=e_(r);function r(){var n;Qy(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)),ri(Rl(n),"onClick",function(d){var u=n.props,_=u.text,g=u.onCopy,x=u.children,w=u.options,C=La.default.Children.only(x),M=(0,Wy.default)(_,w);g&&g(_,M),C&&C.props&&typeof C.props.onClick=="function"&&C.props.onClick(d)}),n}return Zy(r,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var l=o.children,p=Vy(o,Xy),d=La.default.Children.only(l);return La.default.cloneElement(d,Ol(Ol({},p),{},{onClick:this.onClick}))}}]),r}(La.default.PureComponent);Ea.CopyToClipboard=Kl,ri(Kl,"defaultProps",{onCopy:void 0,options:void 0});var r_=Ea,ai=r_.CopyToClipboard;ai.CopyToClipboard=ai;var a_=ai;const sr=Sd(a_);Me.languages.register({id:je}),Me.editor.defineTheme("vs-dark",$n),Me.editor.defineTheme("vs",Un);const Ul=[{label:"版本 v3",version:3},{label:"版本 v4",version:4},{label:"版本 v5",version:5},{label:"版本 v6",version:6}];async function ni(a){const s=await Ta(a);s&&(Me.languages.setMonarchTokensProvider(je,s.LANGUAGE_MONARCH_TOKENS),Me.languages.setLanguageConfiguration(je,s.CONFIGURATION))}async function $l(a,s,r){return s&&Me.editor.setTheme(s.includes("dark")?"vs-dark":"light"),r&&await ni(r),await Me.editor.colorize(a,je,{tabSize:4})}async function ii(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} ${Pe.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&&Ps(X)}})),p&&(M.desc=p.map(K=>Ps(K))),d&&(M.originalExample=d.join(`
80
80
  `),M.examples=await Me.editor.colorize(M.originalExample,je,{tabSize:4})),x){M.detailedDesc=[];for(const K of x){const{desc:G,examples:X}=K;let q=G.map(W=>Ps(W)),se,j;X&&(j=X.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guihz/trading-vue-editor-tes",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "lib"