@guihz/trading-vue-editor-tes 0.0.284 → 0.0.285

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.
@@ -21,6 +21,9 @@ interface IInputArgs {
21
21
  index?: number;
22
22
  modifyDefval?: TSimpleType;
23
23
  }
24
+ interface ICacheData {
25
+ [key: string]: IInputArgs;
26
+ }
24
27
  declare class Input {
25
28
  private _cacheData;
26
29
  private _variables;
@@ -28,6 +31,8 @@ declare class Input {
28
31
  private _historyInputs;
29
32
  private _name;
30
33
  constructor(variables: BuiltInVariables, errorListener: TccErrorListener, id: string);
34
+ get _inputCacheData(): ICacheData;
35
+ set _inputCacheData(data: ICacheData);
31
36
  update(vals?: IInputArgs[]): void;
32
37
  input(args: IInputArgs, posStr: string): TSimpleType;
33
38
  int(args: IInputArgs, posStr: string): TSimpleType;
@@ -22,6 +22,8 @@ export default class Request {
22
22
  private _funcs;
23
23
  private _errorListener;
24
24
  constructor(variables: BuiltInVariables, id: string, funcs: BuildInFunctions, errorListener: TccErrorListener);
25
+ get _requestCacheData(): IKeyObjectValue;
26
+ set _requestCacheData(val: IKeyObjectValue);
25
27
  security(args: IRequestArgs, posStr: string): any;
26
28
  security_lower_tf(args: IRequestArgs, posStr: string): any;
27
29
  private _symbolTransform;
@@ -152,6 +152,8 @@ export default class Strategy {
152
152
  private _maxDrawdownVerifyIndex;
153
153
  calcOnOrderFillsData: IFillsData;
154
154
  constructor(variables: BuiltInVariables, options: IKeyObjectValue, mintick: number, errorListener: TccErrorListener, id: string);
155
+ get _strategyCacheData(): IKeyObjectValue;
156
+ set _strategyCacheData(val: IKeyObjectValue);
155
157
  get orders(): IOrder[];
156
158
  get historyOrders(): IOrder[];
157
159
  get _freezeCapital(): number;
@@ -1,3 +1,4 @@
1
+ import { IKeyObjectValue } from "../../type";
1
2
  import { BuiltInVariables } from "../buildInVariables";
2
3
  import BuildInTimeframe from "./timeframe";
3
4
  import BuildInMath from "./math";
@@ -45,6 +46,8 @@ export default class BuildInTa {
45
46
  private _math;
46
47
  private _timeframe;
47
48
  constructor(variables: BuiltInVariables, math: BuildInMath, timeframe: BuildInTimeframe);
49
+ get _taCacheData(): IKeyObjectValue;
50
+ set _taCacheData(data: IKeyObjectValue);
48
51
  alma({ series, length, offset, sigma, floor, isSeriesLen }: ITaArgs, posStr: string): number | undefined;
49
52
  sma({ source, length, isSeriesLen }: ITaArgs, posStr: string): number | undefined;
50
53
  rma({ source, length, isSeriesLen }: ITaArgs, posStr: string): any;
@@ -1,3 +1,4 @@
1
+ import { IKeyObjectValue } from "../../type";
1
2
  import { BuiltInVariables } from "../buildInVariables";
2
3
  interface ITimeArgs {
3
4
  timeframe?: string;
@@ -11,6 +12,8 @@ export default class BuildInTimeframe {
11
12
  private _variables;
12
13
  private _cacheData;
13
14
  constructor(variables: BuiltInVariables);
15
+ get _timeframeCacheData(): IKeyObjectValue;
16
+ set _timeframeCacheData(data: IKeyObjectValue);
14
17
  change({ timeframe }: ITimeArgs, posStr: string): any;
15
18
  in_seconds({ timeframe }?: ITimeArgs): number;
16
19
  from_seconds({ seconds }: ITimeArgs): string;
@@ -12,6 +12,8 @@ export declare class Ta {
12
12
  private _preData;
13
13
  private _id;
14
14
  constructor(id: string);
15
+ get _varTaCacheData(): IKeyObjectValue;
16
+ set _varTaCacheData(data: IKeyObjectValue);
15
17
  update(currentData: IKeyObjectValue): void;
16
18
  get isRealTime(): boolean;
17
19
  get accdist(): any;
@@ -19,9 +19,7 @@ export default class ParseToJs {
19
19
  private _dependsObj;
20
20
  private _enums;
21
21
  private _preRunMembers;
22
- private _isInConditionalStmt;
23
22
  private _preRunMembersFuncs;
24
- private _preRunMemberFuncsCount;
25
23
  private __count;
26
24
  preParseCode: string;
27
25
  private _hasLeftVisibleBarTime;
@@ -69153,14 +69153,14 @@ function br(a, s, r) {
69153
69153
  function zw() {
69154
69154
  return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
69155
69155
  }
69156
- const Sd = new Worker(new URL("" + new URL("assets/scriptsRunWorker-BzJrckV5.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run TccScript Server" });
69156
+ const Sd = new Worker(new URL("" + new URL("assets/scriptsRunWorker-B3YGZcpj.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run TccScript Server" });
69157
69157
  Sd.onerror = (a) => {
69158
69158
  console.error(a);
69159
69159
  };
69160
69160
  async function Nd(a) {
69161
69161
  return await wn.setInlayHints(a);
69162
69162
  }
69163
- const zd = xo(Sd), Ed = xo(new Worker(new URL("" + new URL("assets/parserTccWorker-BpGt27P2.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser TccScript Server" }));
69163
+ const zd = xo(Sd), Ed = xo(new Worker(new URL("" + new URL("assets/parserTccWorker-COjudqMh.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser TccScript Server" }));
69164
69164
  async function Ew(a, s = !1) {
69165
69165
  const { functions: r, types: n, constants: o, variables: l, methods: c } = dt;
69166
69166
  return await Ed.parseTcc(a, s, ho(Nd), { functions: Object.fromEntries(r), methods: Object.fromEntries(c), types: Object.fromEntries(n), constants: Object.fromEntries(o), variables: Object.fromEntries(l) });
@@ -141,7 +141,7 @@ function print() { __p += __j.call(arguments, '') }
141
141
  * @license
142
142
  * Copyright 2019 Google LLC
143
143
  * SPDX-License-Identifier: Apache-2.0
144
- */const sl=Symbol("Comlink.proxy"),Im=Symbol("Comlink.endpoint"),Am=Symbol("Comlink.releaseProxy"),Bn=Symbol("Comlink.finalizer"),ba=Symbol("Comlink.thrown"),rl=a=>typeof a=="object"&&a!==null||typeof a=="function",qm={canHandle:a=>rl(a)&&a[sl],serialize(a){const{port1:s,port2:r}=new MessageChannel;return nl(a,s),[r,[r]]},deserialize(a){return a.start(),Un(a)}},Cm={canHandle:a=>rl(a)&&ba 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}},al=new Map([["proxy",qm],["throw",Cm]]);function Sm(a,s){for(const r of a)if(s===r||r==="*"||r instanceof RegExp&&r.test(s))return!0;return!1}function nl(a,s=globalThis,r=["*"]){s.addEventListener("message",function n(o){if(!o||!o.data)return;if(!Sm(r,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:l,type:c,path:u}=Object.assign({path:[]},o.data),m=(o.data.argumentList||[]).map(Is);let _;try{const g=u.slice(0,-1).reduce((h,D)=>h[D],a),x=u.reduce((h,D)=>h[D],a);switch(c){case"GET":_=x;break;case"SET":g[u.slice(-1)[0]]=Is(o.data.value),_=!0;break;case"APPLY":_=x.apply(g,m);break;case"CONSTRUCT":{const h=new x(...m);_=Kn(h)}break;case"ENDPOINT":{const{port1:h,port2:D}=new MessageChannel;nl(a,D),_=Mm(h,[h])}break;case"RELEASE":_=void 0;break;default:return}}catch(g){_={value:g,[ba]:0}}Promise.resolve(_).catch(g=>({value:g,[ba]:0})).then(g=>{const[x,h]=va(g);s.postMessage(Object.assign(Object.assign({},x),{id:l}),h),c==="RELEASE"&&(s.removeEventListener("message",n),il(s),Bn in a&&typeof a[Bn]=="function"&&a[Bn]())}).catch(g=>{const[x,h]=va({value:new TypeError("Unserializable return value"),[ba]:0});s.postMessage(Object.assign(Object.assign({},x),{id:l}),h)})}),s.start&&s.start()}function zm(a){return a.constructor.name==="MessagePort"}function il(a){zm(a)&&a.close()}function Un(a,s){return $n(a,[],s)}function xa(a){if(a)throw new Error("Proxy has been released and is not useable")}function ol(a){return Hs(a,{type:"RELEASE"}).then(()=>{il(a)})}const ha=new WeakMap,wa="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const s=(ha.get(a)||0)-1;ha.set(a,s),s===0&&ol(a)});function Nm(a,s){const r=(ha.get(s)||0)+1;ha.set(s,r),wa&&wa.register(a,s,a)}function Em(a){wa&&wa.unregister(a)}function $n(a,s=[],r=function(){}){let n=!1;const o=new Proxy(r,{get(l,c){if(xa(n),c===Am)return()=>{Em(o),ol(a),n=!0};if(c==="then"){if(s.length===0)return{then:()=>o};const u=Hs(a,{type:"GET",path:s.map(m=>m.toString())}).then(Is);return u.then.bind(u)}return $n(a,[...s,c])},set(l,c,u){xa(n);const[m,_]=va(u);return Hs(a,{type:"SET",path:[...s,c].map(g=>g.toString()),value:m},_).then(Is)},apply(l,c,u){xa(n);const m=s[s.length-1];if(m===Im)return Hs(a,{type:"ENDPOINT"}).then(Is);if(m==="bind")return $n(a,s.slice(0,-1));const[_,g]=ll(u);return Hs(a,{type:"APPLY",path:s.map(x=>x.toString()),argumentList:_},g).then(Is)},construct(l,c){xa(n);const[u,m]=ll(c);return Hs(a,{type:"CONSTRUCT",path:s.map(_=>_.toString()),argumentList:u},m).then(Is)}});return Nm(o,a),o}function Lm(a){return Array.prototype.concat.apply([],a)}function ll(a){const s=a.map(va);return[s.map(r=>r[0]),Lm(s.map(r=>r[1]))]}const cl=new WeakMap;function Mm(a,s){return cl.set(a,s),a}function Kn(a){return Object.assign(a,{[sl]:!0})}function va(a){for(const[s,r]of al)if(r.canHandle(a)){const[n,o]=r.serialize(a);return[{type:"HANDLER",name:s,value:n},o]}return[{type:"RAW",value:a},cl.get(a)||[]]}function Is(a){switch(a.type){case"HANDLER":return al.get(a.name).deserialize(a.value);case"RAW":return a.value}}function Hs(a,s,r){return new Promise(n=>{const o=Om();a.addEventListener("message",function l(c){!c.data||!c.data.id||c.data.id!==o||(a.removeEventListener("message",l),n(c.data))}),a.start&&a.start(),a.postMessage(Object.assign({id:o},s),r)})}function Om(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const pl=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-BzJrckV5.js").href:new URL("assets/scriptsRunWorker-BzJrckV5.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:ra&&ra.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Run TccScript Server"});pl.onerror=a=>{console.error(a)};async function dl(a){return await _a.setInlayHints(a)}const ul=Un(pl),ml=Un(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-BpGt27P2.js").href:new URL("assets/parserTccWorker-BpGt27P2.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:ra&&ra.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Parser TccScript Server"}));async function yl(a,s=!1){const{functions:r,types:n,constants:o,variables:l,methods:c}=nt;return await ml.parseTcc(a,s,Kn(dl),{functions:Object.fromEntries(r),methods:Object.fromEntries(c),types:Object.fromEntries(n),constants:Object.fromEntries(o),variables:Object.fromEntries(l)})}async function Pm(a,s){const{functions:r,types:n,constants:o,variables:l,methods:c}=nt;return await ml.parseLibraryCode(a,s,Kn(dl),{functions:Object.fromEntries(r),methods:Object.fromEntries(c),types:Object.fromEntries(n),constants:Object.fromEntries(o),variables:Object.fromEntries(l)})}async function Rm(a,s,r=!0){return await ul.runScript(a,s,r)}async function Fm(a){return await ul.removeScript(a)}function Bm(a){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-CT5Cb1wO.js").href:new URL("assets/editor.worker-CT5Cb1wO.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{name:a==null?void 0:a.name})}const{slice:Um,forEach:$m}=[];function Km(a){return $m.call(Um.call(arguments,1),s=>{if(s)for(const r in s)a[r]===void 0&&(a[r]=s[r])}),a}const _l=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,jm=(a,s,r)=>{const n=r||{};n.path=n.path||"/";const o=encodeURIComponent(s);let l=`${a}=${o}`;if(n.maxAge>0){const c=n.maxAge-0;if(Number.isNaN(c))throw new Error("maxAge should be a Number");l+=`; Max-Age=${Math.floor(c)}`}if(n.domain){if(!_l.test(n.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${n.domain}`}if(n.path){if(!_l.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},fl={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=jm(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 Hm={name:"cookie",lookup(a){let{lookupCookie:s}=a;if(s&&typeof document<"u")return fl.read(s)||void 0},cacheUserLanguage(a,s){let{lookupCookie:r,cookieMinutes:n,cookieDomain:o,cookieOptions:l}=s;r&&typeof document<"u"&&fl.create(r,a,n,o,l)}},Wm={name:"querystring",lookup(a){var n;let{lookupQuerystring:s}=a,r;if(typeof window<"u"){let{search:o}=window.location;!window.location.search&&((n=window.location.hash)==null?void 0:n.indexOf("?"))>-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const c=o.substring(1).split("&");for(let u=0;u<c.length;u++){const m=c[u].indexOf("=");m>0&&c[u].substring(0,m)===s&&(r=c[u].substring(m+1))}}return r}};let Cr=null;const gl=()=>{if(Cr!==null)return Cr;try{Cr=window!=="undefined"&&window.localStorage!==null;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{Cr=!1}return Cr};var Vm={name:"localStorage",lookup(a){let{lookupLocalStorage:s}=a;if(s&&gl())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupLocalStorage:r}=s;r&&gl()&&window.localStorage.setItem(r,a)}};let Sr=null;const bl=()=>{if(Sr!==null)return Sr;try{Sr=window!=="undefined"&&window.sessionStorage!==null;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{Sr=!1}return Sr};var Gm={name:"sessionStorage",lookup(a){let{lookupSessionStorage:s}=a;if(s&&bl())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupSessionStorage:r}=s;r&&bl()&&window.sessionStorage.setItem(r,a)}},Xm={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}},Ym={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}},Qm={name:"path",lookup(a){var o;let{lookupFromPathIndex:s}=a;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?(o=r[typeof s=="number"?s:0])==null?void 0:o.replace("/",""):void 0}},Zm={name:"subdomain",lookup(a){var o,l;let{lookupFromSubdomainIndex:s}=a;const r=typeof s=="number"?s+1:1,n=typeof window<"u"&&((l=(o=window.location)==null?void 0:o.hostname)==null?void 0:l.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(n)return n[r]}};function Jm(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a}}class xl{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=Km(r,this.options||{},Jm()),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(Hm),this.addDetector(Wm),this.addDetector(Vm),this.addDetector(Gm),this.addDetector(Xm),this.addDetector(Ym),this.addDetector(Qm),this.addDetector(Zm)}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)}))}}xl.type="languageDetector";const ey=(...a)=>{console!=null&&console.warn&&(As(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),console.warn(...a))},hl={},jn=(...a)=>{As(a[0])&&hl[a[0]]||(As(a[0])&&(hl[a[0]]=new Date),ey(...a))},wl=(a,s)=>()=>{if(a.isInitialized)s();else{const r=()=>{setTimeout(()=>{a.off("initialized",r)},0),s()};a.on("initialized",r)}},Hn=(a,s,r)=>{a.loadNamespaces(s,wl(a,r))},vl=(a,s,r,n)=>{if(As(r)&&(r=[r]),a.options.preload&&a.options.preload.indexOf(s)>-1)return Hn(a,r,n);r.forEach(o=>{a.options.ns.indexOf(o)<0&&a.options.ns.push(o)}),a.loadLanguages(s,wl(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)=>{var l;if(((l=r.bindI18n)==null?void 0:l.indexOf("languageChanging"))>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!o(n.isLanguageChangingTo,a))return!1}}),As=a=>typeof a=="string",sy=a=>typeof a=="object"&&a!==null,ry=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ay={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},ny=a=>ay[a];let Wn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:a=>a.replace(ry,ny)};const iy=(a={})=>{Wn={...Wn,...a}},oy=()=>Wn;let Tl;const ly=a=>{Tl=a},cy=()=>Tl,py={type:"3rdParty",init(a){iy(a.options.react),ly(a)}},dy=N.createContext();class uy{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=N.useRef();return N.useEffect(()=>{r.current=s?r.current:a},[a,s]),r.current},kl=(a,s,r,n)=>a.getFixedT(s,r,n),yy=(a,s,r,n)=>N.useCallback(kl(a,s,r,n),[a,s,r,n]),Ws=(a,s={})=>{var W,Q,C,z;const{i18n:r}=s,{i18n:n,defaultNS:o}=N.useContext(dy)||{},l=r||n||cy();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new uy),!l){jn("You will need to pass in an i18next instance by using initReactI18next");const V=(A,L)=>As(L)?L:sy(L)&&As(L.defaultValue)?L.defaultValue:Array.isArray(A)?A[A.length-1]:A,q=[V,{},!1];return q.t=V,q.i18n={},q.ready=!1,q}(W=l.options.react)!=null&&W.wait&&jn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const c={...oy(),...l.options.react,...s},{useSuspense:u,keyPrefix:m}=c;let _=a||o||((Q=l.options)==null?void 0:Q.defaultNS);_=As(_)?[_]:_||["translation"],(z=(C=l.reportNamespaces).addUsedNamespaces)==null||z.call(C,_);const g=(l.isInitialized||l.initializedStoreOnce)&&_.every(V=>ty(V,l,c)),x=yy(l,s.lng||null,c.nsMode==="fallback"?_:_[0],m),h=()=>x,D=()=>kl(l,s.lng||null,c.nsMode==="fallback"?_:_[0],m),[S,R]=N.useState(h);let U=_.join();s.lng&&(U=`${s.lng}${U}`);const K=my(U),H=N.useRef(!0);N.useEffect(()=>{const{bindI18n:V,bindI18nStore:q}=c;H.current=!0,!g&&!u&&(s.lng?vl(l,s.lng,_,()=>{H.current&&R(D)}):Hn(l,_,()=>{H.current&&R(D)})),g&&K&&K!==U&&H.current&&R(D);const A=()=>{H.current&&R(D)};return V&&(l==null||l.on(V,A)),q&&(l==null||l.store.on(q,A)),()=>{H.current=!1,l&&(V==null||V.split(" ").forEach(L=>l.off(L,A))),q&&l&&q.split(" ").forEach(L=>l.store.off(L,A))}},[l,U]),N.useEffect(()=>{H.current&&g&&R(h)},[l,m,g]);const re=[S,l,g];if(re.t=S,re.i18n=l,re.ready=g,g||!g&&!u)return re;throw new Promise(V=>{s.lng?vl(l,s.lng,_,()=>V()):Hn(l,_,()=>V())})},_y={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® v1 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"},fy={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™ v1参考手册","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":"“点击”关键词以获得更多帮助"};Me.use(xl).use(py).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:_y},zh:{translation:fy}}}),self.MonacoEnvironment={getWorker(){return new Bm({name:"Editor Worker"})}},In.config({paths:{vs:"https://my.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const gy=(a,s)=>{const{height:r,width:n,theme:o,options:l,hasDiff:c,readOnly:u,defaultValue:m,language:_,onChange:g,onLinkOpen:x,onCursorPositionChange:h,onActionTrigger:D,onEditorDidMount:S}=a,{t:R,i18n:U}=Ws(),K=N.useRef(null),H=N.useRef(null),re=N.useRef(!1),W=N.useRef(!1);N.useImperativeHandle(s,()=>({setOriginalScript(A){var L;(L=K.current)==null||L.setOriginalScript(A)},setScript(A){var L;(L=K.current)==null||L.setValue(A)},gotoLine(){var A;(A=K.current)==null||A.gotoLine()},getEditorLayout(){var A;return(A=K.current)==null?void 0:A.getEditorLayout()},setPosition(A,L){var Z;(Z=K.current)==null||Z.setPosition({column:A,lineNumber:L})},setModelMarkers(A){var L;W.current=!0,(L=K.current)==null||L.setModelMarkers(A),setTimeout(()=>{W.current=!1},2e3)},focus(){var A;(A=K.current)==null||A.focus()}})),N.useEffect(()=>{var A,L;c?(L=K.current)==null||L.addDiffDecorations():(A=K.current)==null||A.removeDiffDecorations()},[c]),N.useEffect(()=>{o&&Ne.editor.setTheme(o)},[o]),N.useEffect(()=>{_&&U.changeLanguage(_)},[_]),N.useEffect(()=>{var A;(A=K.current)==null||A.updateActionTrigger(D)},[D]),N.useEffect(()=>{var A;x&&((A=K.current)==null||A.addLinkOpenFunc(x))},[x]);function Q(A,L){var ee,ne;Pt.initBuiltinsTrees(),_a.setEditor(A),K.current=new Dm(A,L,D),x&&((ee=K.current)==null||ee.addLinkOpenFunc(x)),c&&((ne=K.current)==null||ne.addDiffDecorations()),Xu(A),requestAnimationFrame(q);const Z=A.getValue();K.current.onChangeCursorPosition(h),g&&g(Z),!u&&C(Z),S&&S()}const C=N.useCallback(async A=>{var Rt;re.current=!1;const{errors:L,functions:Z,methods:ee,types:ne,variables:Y,overloadsFuncs:le,imports:xe,enums:pe}=await yl(A),_e=new Map(Object.entries(Z)),Ee=new Map(Object.entries(ee)),te=new Map(Object.entries(ne)),de=new Map(Object.entries(Y)),Oe=new Map(Object.entries(xe)),Ge=new Map(Object.entries(pe));Ds.setUserDefined({functions:_e,methods:Ee,types:te,variables:de,imports:Oe,enums:Ge},le),Pt.setUserDefind(_e,te,de,Ee,Ge);const Qe=L.map(us=>({...us,severity:us.type||Ne.MarkerSeverity.Error}));u||!re.current&&!W.current&&Qe.length&&((Rt=K.current)==null||Rt.setModelMarkers(Qe))},[u]),z=N.useMemo(()=>Zu.debounce(C,1500),[C]);function V(A){var L;if(u){C(A||"");return}re.current=!0,_a.clearInlayHints(),(L=K.current)==null||L.setModelMarkers([]),A!==void 0&&(g&&g(A),z(A))}const q=N.useCallback(()=>{var L,Z;const A=(L=H.current)==null?void 0:L.getBoundingClientRect();(Z=K.current)==null||Z.setEditorLayout((A==null?void 0:A.height)||0,A==null?void 0:A.width)},[]);return N.useEffect(()=>{const A=()=>{window.requestAnimationFrame(q)},L=new ResizeObserver(A);return H.current&&L.observe(H.current),()=>{var Z;H.current&&L.unobserve(H.current),L.disconnect(),(Z=K.current)==null||Z.dispose()}},[]),T.jsx("div",{ref:H,children:T.jsx(yu,{height:r,width:n||"100%",defaultLanguage:Ke,defaultValue:m||`indicator("我的脚本")
144
+ */const sl=Symbol("Comlink.proxy"),Im=Symbol("Comlink.endpoint"),Am=Symbol("Comlink.releaseProxy"),Bn=Symbol("Comlink.finalizer"),ba=Symbol("Comlink.thrown"),rl=a=>typeof a=="object"&&a!==null||typeof a=="function",qm={canHandle:a=>rl(a)&&a[sl],serialize(a){const{port1:s,port2:r}=new MessageChannel;return nl(a,s),[r,[r]]},deserialize(a){return a.start(),Un(a)}},Cm={canHandle:a=>rl(a)&&ba 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}},al=new Map([["proxy",qm],["throw",Cm]]);function Sm(a,s){for(const r of a)if(s===r||r==="*"||r instanceof RegExp&&r.test(s))return!0;return!1}function nl(a,s=globalThis,r=["*"]){s.addEventListener("message",function n(o){if(!o||!o.data)return;if(!Sm(r,o.origin)){console.warn(`Invalid origin '${o.origin}' for comlink proxy`);return}const{id:l,type:c,path:u}=Object.assign({path:[]},o.data),m=(o.data.argumentList||[]).map(Is);let _;try{const g=u.slice(0,-1).reduce((h,D)=>h[D],a),x=u.reduce((h,D)=>h[D],a);switch(c){case"GET":_=x;break;case"SET":g[u.slice(-1)[0]]=Is(o.data.value),_=!0;break;case"APPLY":_=x.apply(g,m);break;case"CONSTRUCT":{const h=new x(...m);_=Kn(h)}break;case"ENDPOINT":{const{port1:h,port2:D}=new MessageChannel;nl(a,D),_=Mm(h,[h])}break;case"RELEASE":_=void 0;break;default:return}}catch(g){_={value:g,[ba]:0}}Promise.resolve(_).catch(g=>({value:g,[ba]:0})).then(g=>{const[x,h]=va(g);s.postMessage(Object.assign(Object.assign({},x),{id:l}),h),c==="RELEASE"&&(s.removeEventListener("message",n),il(s),Bn in a&&typeof a[Bn]=="function"&&a[Bn]())}).catch(g=>{const[x,h]=va({value:new TypeError("Unserializable return value"),[ba]:0});s.postMessage(Object.assign(Object.assign({},x),{id:l}),h)})}),s.start&&s.start()}function zm(a){return a.constructor.name==="MessagePort"}function il(a){zm(a)&&a.close()}function Un(a,s){return $n(a,[],s)}function xa(a){if(a)throw new Error("Proxy has been released and is not useable")}function ol(a){return Hs(a,{type:"RELEASE"}).then(()=>{il(a)})}const ha=new WeakMap,wa="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const s=(ha.get(a)||0)-1;ha.set(a,s),s===0&&ol(a)});function Nm(a,s){const r=(ha.get(s)||0)+1;ha.set(s,r),wa&&wa.register(a,s,a)}function Em(a){wa&&wa.unregister(a)}function $n(a,s=[],r=function(){}){let n=!1;const o=new Proxy(r,{get(l,c){if(xa(n),c===Am)return()=>{Em(o),ol(a),n=!0};if(c==="then"){if(s.length===0)return{then:()=>o};const u=Hs(a,{type:"GET",path:s.map(m=>m.toString())}).then(Is);return u.then.bind(u)}return $n(a,[...s,c])},set(l,c,u){xa(n);const[m,_]=va(u);return Hs(a,{type:"SET",path:[...s,c].map(g=>g.toString()),value:m},_).then(Is)},apply(l,c,u){xa(n);const m=s[s.length-1];if(m===Im)return Hs(a,{type:"ENDPOINT"}).then(Is);if(m==="bind")return $n(a,s.slice(0,-1));const[_,g]=ll(u);return Hs(a,{type:"APPLY",path:s.map(x=>x.toString()),argumentList:_},g).then(Is)},construct(l,c){xa(n);const[u,m]=ll(c);return Hs(a,{type:"CONSTRUCT",path:s.map(_=>_.toString()),argumentList:u},m).then(Is)}});return Nm(o,a),o}function Lm(a){return Array.prototype.concat.apply([],a)}function ll(a){const s=a.map(va);return[s.map(r=>r[0]),Lm(s.map(r=>r[1]))]}const cl=new WeakMap;function Mm(a,s){return cl.set(a,s),a}function Kn(a){return Object.assign(a,{[sl]:!0})}function va(a){for(const[s,r]of al)if(r.canHandle(a)){const[n,o]=r.serialize(a);return[{type:"HANDLER",name:s,value:n},o]}return[{type:"RAW",value:a},cl.get(a)||[]]}function Is(a){switch(a.type){case"HANDLER":return al.get(a.name).deserialize(a.value);case"RAW":return a.value}}function Hs(a,s,r){return new Promise(n=>{const o=Om();a.addEventListener("message",function l(c){!c.data||!c.data.id||c.data.id!==o||(a.removeEventListener("message",l),n(c.data))}),a.start&&a.start(),a.postMessage(Object.assign({id:o},s),r)})}function Om(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const pl=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-B3YGZcpj.js").href:new URL("assets/scriptsRunWorker-B3YGZcpj.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:ra&&ra.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Run TccScript Server"});pl.onerror=a=>{console.error(a)};async function dl(a){return await _a.setInlayHints(a)}const ul=Un(pl),ml=Un(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-COjudqMh.js").href:new URL("assets/parserTccWorker-COjudqMh.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:ra&&ra.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Parser TccScript Server"}));async function yl(a,s=!1){const{functions:r,types:n,constants:o,variables:l,methods:c}=nt;return await ml.parseTcc(a,s,Kn(dl),{functions:Object.fromEntries(r),methods:Object.fromEntries(c),types:Object.fromEntries(n),constants:Object.fromEntries(o),variables:Object.fromEntries(l)})}async function Pm(a,s){const{functions:r,types:n,constants:o,variables:l,methods:c}=nt;return await ml.parseLibraryCode(a,s,Kn(dl),{functions:Object.fromEntries(r),methods:Object.fromEntries(c),types:Object.fromEntries(n),constants:Object.fromEntries(o),variables:Object.fromEntries(l)})}async function Rm(a,s,r=!0){return await ul.runScript(a,s,r)}async function Fm(a){return await ul.removeScript(a)}function Bm(a){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-CT5Cb1wO.js").href:new URL("assets/editor.worker-CT5Cb1wO.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{name:a==null?void 0:a.name})}const{slice:Um,forEach:$m}=[];function Km(a){return $m.call(Um.call(arguments,1),s=>{if(s)for(const r in s)a[r]===void 0&&(a[r]=s[r])}),a}const _l=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,jm=(a,s,r)=>{const n=r||{};n.path=n.path||"/";const o=encodeURIComponent(s);let l=`${a}=${o}`;if(n.maxAge>0){const c=n.maxAge-0;if(Number.isNaN(c))throw new Error("maxAge should be a Number");l+=`; Max-Age=${Math.floor(c)}`}if(n.domain){if(!_l.test(n.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${n.domain}`}if(n.path){if(!_l.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},fl={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=jm(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 Hm={name:"cookie",lookup(a){let{lookupCookie:s}=a;if(s&&typeof document<"u")return fl.read(s)||void 0},cacheUserLanguage(a,s){let{lookupCookie:r,cookieMinutes:n,cookieDomain:o,cookieOptions:l}=s;r&&typeof document<"u"&&fl.create(r,a,n,o,l)}},Wm={name:"querystring",lookup(a){var n;let{lookupQuerystring:s}=a,r;if(typeof window<"u"){let{search:o}=window.location;!window.location.search&&((n=window.location.hash)==null?void 0:n.indexOf("?"))>-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const c=o.substring(1).split("&");for(let u=0;u<c.length;u++){const m=c[u].indexOf("=");m>0&&c[u].substring(0,m)===s&&(r=c[u].substring(m+1))}}return r}};let Cr=null;const gl=()=>{if(Cr!==null)return Cr;try{Cr=window!=="undefined"&&window.localStorage!==null;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{Cr=!1}return Cr};var Vm={name:"localStorage",lookup(a){let{lookupLocalStorage:s}=a;if(s&&gl())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupLocalStorage:r}=s;r&&gl()&&window.localStorage.setItem(r,a)}};let Sr=null;const bl=()=>{if(Sr!==null)return Sr;try{Sr=window!=="undefined"&&window.sessionStorage!==null;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{Sr=!1}return Sr};var Gm={name:"sessionStorage",lookup(a){let{lookupSessionStorage:s}=a;if(s&&bl())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupSessionStorage:r}=s;r&&bl()&&window.sessionStorage.setItem(r,a)}},Xm={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}},Ym={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}},Qm={name:"path",lookup(a){var o;let{lookupFromPathIndex:s}=a;if(typeof window>"u")return;const r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(r)?(o=r[typeof s=="number"?s:0])==null?void 0:o.replace("/",""):void 0}},Zm={name:"subdomain",lookup(a){var o,l;let{lookupFromSubdomainIndex:s}=a;const r=typeof s=="number"?s+1:1,n=typeof window<"u"&&((l=(o=window.location)==null?void 0:o.hostname)==null?void 0:l.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(n)return n[r]}};function Jm(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a}}class xl{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=Km(r,this.options||{},Jm()),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(Hm),this.addDetector(Wm),this.addDetector(Vm),this.addDetector(Gm),this.addDetector(Xm),this.addDetector(Ym),this.addDetector(Qm),this.addDetector(Zm)}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)}))}}xl.type="languageDetector";const ey=(...a)=>{console!=null&&console.warn&&(As(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),console.warn(...a))},hl={},jn=(...a)=>{As(a[0])&&hl[a[0]]||(As(a[0])&&(hl[a[0]]=new Date),ey(...a))},wl=(a,s)=>()=>{if(a.isInitialized)s();else{const r=()=>{setTimeout(()=>{a.off("initialized",r)},0),s()};a.on("initialized",r)}},Hn=(a,s,r)=>{a.loadNamespaces(s,wl(a,r))},vl=(a,s,r,n)=>{if(As(r)&&(r=[r]),a.options.preload&&a.options.preload.indexOf(s)>-1)return Hn(a,r,n);r.forEach(o=>{a.options.ns.indexOf(o)<0&&a.options.ns.push(o)}),a.loadLanguages(s,wl(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)=>{var l;if(((l=r.bindI18n)==null?void 0:l.indexOf("languageChanging"))>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!o(n.isLanguageChangingTo,a))return!1}}),As=a=>typeof a=="string",sy=a=>typeof a=="object"&&a!==null,ry=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ay={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},ny=a=>ay[a];let Wn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:a=>a.replace(ry,ny)};const iy=(a={})=>{Wn={...Wn,...a}},oy=()=>Wn;let Tl;const ly=a=>{Tl=a},cy=()=>Tl,py={type:"3rdParty",init(a){iy(a.options.react),ly(a)}},dy=N.createContext();class uy{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=N.useRef();return N.useEffect(()=>{r.current=s?r.current:a},[a,s]),r.current},kl=(a,s,r,n)=>a.getFixedT(s,r,n),yy=(a,s,r,n)=>N.useCallback(kl(a,s,r,n),[a,s,r,n]),Ws=(a,s={})=>{var W,Q,C,z;const{i18n:r}=s,{i18n:n,defaultNS:o}=N.useContext(dy)||{},l=r||n||cy();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new uy),!l){jn("You will need to pass in an i18next instance by using initReactI18next");const V=(A,L)=>As(L)?L:sy(L)&&As(L.defaultValue)?L.defaultValue:Array.isArray(A)?A[A.length-1]:A,q=[V,{},!1];return q.t=V,q.i18n={},q.ready=!1,q}(W=l.options.react)!=null&&W.wait&&jn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const c={...oy(),...l.options.react,...s},{useSuspense:u,keyPrefix:m}=c;let _=a||o||((Q=l.options)==null?void 0:Q.defaultNS);_=As(_)?[_]:_||["translation"],(z=(C=l.reportNamespaces).addUsedNamespaces)==null||z.call(C,_);const g=(l.isInitialized||l.initializedStoreOnce)&&_.every(V=>ty(V,l,c)),x=yy(l,s.lng||null,c.nsMode==="fallback"?_:_[0],m),h=()=>x,D=()=>kl(l,s.lng||null,c.nsMode==="fallback"?_:_[0],m),[S,R]=N.useState(h);let U=_.join();s.lng&&(U=`${s.lng}${U}`);const K=my(U),H=N.useRef(!0);N.useEffect(()=>{const{bindI18n:V,bindI18nStore:q}=c;H.current=!0,!g&&!u&&(s.lng?vl(l,s.lng,_,()=>{H.current&&R(D)}):Hn(l,_,()=>{H.current&&R(D)})),g&&K&&K!==U&&H.current&&R(D);const A=()=>{H.current&&R(D)};return V&&(l==null||l.on(V,A)),q&&(l==null||l.store.on(q,A)),()=>{H.current=!1,l&&(V==null||V.split(" ").forEach(L=>l.off(L,A))),q&&l&&q.split(" ").forEach(L=>l.store.off(L,A))}},[l,U]),N.useEffect(()=>{H.current&&g&&R(h)},[l,m,g]);const re=[S,l,g];if(re.t=S,re.i18n=l,re.ready=g,g||!g&&!u)return re;throw new Promise(V=>{s.lng?vl(l,s.lng,_,()=>V()):Hn(l,_,()=>V())})},_y={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® v1 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"},fy={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™ v1参考手册","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":"“点击”关键词以获得更多帮助"};Me.use(xl).use(py).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:_y},zh:{translation:fy}}}),self.MonacoEnvironment={getWorker(){return new Bm({name:"Editor Worker"})}},In.config({paths:{vs:"https://my.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const gy=(a,s)=>{const{height:r,width:n,theme:o,options:l,hasDiff:c,readOnly:u,defaultValue:m,language:_,onChange:g,onLinkOpen:x,onCursorPositionChange:h,onActionTrigger:D,onEditorDidMount:S}=a,{t:R,i18n:U}=Ws(),K=N.useRef(null),H=N.useRef(null),re=N.useRef(!1),W=N.useRef(!1);N.useImperativeHandle(s,()=>({setOriginalScript(A){var L;(L=K.current)==null||L.setOriginalScript(A)},setScript(A){var L;(L=K.current)==null||L.setValue(A)},gotoLine(){var A;(A=K.current)==null||A.gotoLine()},getEditorLayout(){var A;return(A=K.current)==null?void 0:A.getEditorLayout()},setPosition(A,L){var Z;(Z=K.current)==null||Z.setPosition({column:A,lineNumber:L})},setModelMarkers(A){var L;W.current=!0,(L=K.current)==null||L.setModelMarkers(A),setTimeout(()=>{W.current=!1},2e3)},focus(){var A;(A=K.current)==null||A.focus()}})),N.useEffect(()=>{var A,L;c?(L=K.current)==null||L.addDiffDecorations():(A=K.current)==null||A.removeDiffDecorations()},[c]),N.useEffect(()=>{o&&Ne.editor.setTheme(o)},[o]),N.useEffect(()=>{_&&U.changeLanguage(_)},[_]),N.useEffect(()=>{var A;(A=K.current)==null||A.updateActionTrigger(D)},[D]),N.useEffect(()=>{var A;x&&((A=K.current)==null||A.addLinkOpenFunc(x))},[x]);function Q(A,L){var ee,ne;Pt.initBuiltinsTrees(),_a.setEditor(A),K.current=new Dm(A,L,D),x&&((ee=K.current)==null||ee.addLinkOpenFunc(x)),c&&((ne=K.current)==null||ne.addDiffDecorations()),Xu(A),requestAnimationFrame(q);const Z=A.getValue();K.current.onChangeCursorPosition(h),g&&g(Z),!u&&C(Z),S&&S()}const C=N.useCallback(async A=>{var Rt;re.current=!1;const{errors:L,functions:Z,methods:ee,types:ne,variables:Y,overloadsFuncs:le,imports:xe,enums:pe}=await yl(A),_e=new Map(Object.entries(Z)),Ee=new Map(Object.entries(ee)),te=new Map(Object.entries(ne)),de=new Map(Object.entries(Y)),Oe=new Map(Object.entries(xe)),Ge=new Map(Object.entries(pe));Ds.setUserDefined({functions:_e,methods:Ee,types:te,variables:de,imports:Oe,enums:Ge},le),Pt.setUserDefind(_e,te,de,Ee,Ge);const Qe=L.map(us=>({...us,severity:us.type||Ne.MarkerSeverity.Error}));u||!re.current&&!W.current&&Qe.length&&((Rt=K.current)==null||Rt.setModelMarkers(Qe))},[u]),z=N.useMemo(()=>Zu.debounce(C,1500),[C]);function V(A){var L;if(u){C(A||"");return}re.current=!0,_a.clearInlayHints(),(L=K.current)==null||L.setModelMarkers([]),A!==void 0&&(g&&g(A),z(A))}const q=N.useCallback(()=>{var L,Z;const A=(L=H.current)==null?void 0:L.getBoundingClientRect();(Z=K.current)==null||Z.setEditorLayout((A==null?void 0:A.height)||0,A==null?void 0:A.width)},[]);return N.useEffect(()=>{const A=()=>{window.requestAnimationFrame(q)},L=new ResizeObserver(A);return H.current&&L.observe(H.current),()=>{var Z;H.current&&L.unobserve(H.current),L.disconnect(),(Z=K.current)==null||Z.dispose()}},[]),T.jsx("div",{ref:H,children:T.jsx(yu,{height:r,width:n||"100%",defaultLanguage:Ke,defaultValue:m||`indicator("我的脚本")
145
145
  plot(close)
146
146
  `,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,...u?nm:{},readOnlyMessage:{value:R("This script is read-only. It cannot be edited.")},...l},onMount:Q,onChange:V})})},by=N.forwardRef(gy),xy=a=>{const{theme:s,modified:r,original:n,height:o,width:l,renderSideBySide:c=!0}=a,u=N.useCallback((m,_)=>{_.languages.register({id:Ke}),_.editor.defineTheme("vs-dark",Mn),_.editor.defineTheme("vs",Ln),_.languages.setMonarchTokensProvider(Ke,js),_.languages.setLanguageConfiguration(Ke,En)},[]);return T.jsx(cu,{height:o||"90vh",width:l||"100%",theme:s||"vs-dark",options:{readOnly:!0,renderSideBySide:c,scrollBeyondLastLine:!1},language:Ke,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 Ta={},hy=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()}},wy=hy,Dl={"text/plain":"Text","text/html":"Url",default:"Text"},vy="Copy to clipboard: #{key}, Enter";function Ty(a){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return a.replace(/#{\s*key\s*}/g,s)}function ky(a,s){var r,n,o,l,c,u,m=!1;s||(s={}),r=s.debug||!1;try{o=wy(),l=document.createRange(),c=document.getSelection(),u=document.createElement("span"),u.textContent=a,u.ariaHidden="true",u.style.all="unset",u.style.position="fixed",u.style.top=0,u.style.clip="rect(0, 0, 0, 0)",u.style.whiteSpace="pre",u.style.webkitUserSelect="text",u.style.MozUserSelect="text",u.style.msUserSelect="text",u.style.userSelect="text",u.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=Dl[s.format]||Dl.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(u),l.selectNodeContents(u),c.addRange(l);var _=document.execCommand("copy");if(!_)throw new Error("copy command was unsuccessful");m=!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),m=!0}catch(x){r&&console.error("unable to copy using clipboardData: ",x),r&&console.error("falling back to prompt"),n=Ty("message"in s?s.message:vy),window.prompt(n,a)}}finally{c&&(typeof c.removeRange=="function"?c.removeRange(l):c.removeAllRanges()),u&&document.body.removeChild(u),o()}return m}var Dy=ky;function Vn(a){"@babel/helpers - typeof";return Vn=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},Vn(a)}Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.CopyToClipboard=void 0;var ka=Il(N),Iy=Il(Dy),Ay=["text","onCopy","options","children"];function Il(a){return a&&a.__esModule?a:{default:a}}function Al(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 ql(a){for(var s=1;s<arguments.length;s++){var r=arguments[s]!=null?arguments[s]:{};s%2?Al(Object(r),!0).forEach(function(n){Xn(a,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):Al(Object(r)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(r,n))})}return a}function qy(a,s){if(a==null)return{};var r=Cy(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 Cy(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 Sy(a,s){if(!(a instanceof s))throw new TypeError("Cannot call a class as a function")}function Cl(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&&Cl(a.prototype,s),r&&Cl(a,r),Object.defineProperty(a,"prototype",{writable:!1}),a}function Ny(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&&Gn(a,s)}function Gn(a,s){return Gn=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},Gn(a,s)}function Ey(a){var s=My();return function(){var n=Da(a),o;if(s){var l=Da(this).constructor;o=Reflect.construct(n,arguments,l)}else o=n.apply(this,arguments);return Ly(this,o)}}function Ly(a,s){if(s&&(Vn(s)==="object"||typeof s=="function"))return s;if(s!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sl(a)}function Sl(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function My(){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 Da(a){return Da=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Da(a)}function Xn(a,s,r){return s in a?Object.defineProperty(a,s,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[s]=r,a}var zl=function(a){Ny(r,a);var s=Ey(r);function r(){var n;Sy(this,r);for(var o=arguments.length,l=new Array(o),c=0;c<o;c++)l[c]=arguments[c];return n=s.call.apply(s,[this].concat(l)),Xn(Sl(n),"onClick",function(u){var m=n.props,_=m.text,g=m.onCopy,x=m.children,h=m.options,D=ka.default.Children.only(x),S=(0,Iy.default)(_,h);g&&g(_,S),D&&D.props&&typeof D.props.onClick=="function"&&D.props.onClick(u)}),n}return zy(r,[{key:"render",value:function(){var o=this.props;o.text,o.onCopy,o.options;var l=o.children,c=qy(o,Ay),u=ka.default.Children.only(l);return ka.default.cloneElement(u,ql(ql({},c),{},{onClick:this.onClick}))}}]),r}(ka.default.PureComponent);Ta.CopyToClipboard=zl,Xn(zl,"defaultProps",{onCopy:void 0,options:void 0});var Oy=Ta,Yn=Oy.CopyToClipboard;Yn.CopyToClipboard=Yn;var Py=Yn;const Vs=id(Py);Ne.languages.register({id:Ke}),Ne.editor.defineTheme("vs-dark",Mn),Ne.editor.defineTheme("vs",Ln),Ne.languages.setMonarchTokensProvider(Ke,js),Ne.languages.setLanguageConfiguration(Ke,En);async function Nl(a,s){return s&&Ne.editor.setTheme(s.includes("dark")?"vs-dark":"light"),await Ne.editor.colorize(a,Ke,{tabSize:4})}async function Qn(a,s=0){const r=a[s];if(!r)return;const{name:n,args:o,type:l,desc:c,examples:u,remarks:m,seeAlso:_,syntax:g,detailedDesc:x,fields:h,returns:D}=r,S={name:n,orirginalName:n};if(a.length>1&&(S.overloads=`${a.length} ${Me.t("overloads")}`),l&&(S.type=l),o&&(S.name=`${n}()`,S.args=o.map(R=>{const{name:U,desc:K,displayType:H}=R;return{label:`${U} (${H})`,desc:K&&qs(K)}})),c&&(S.desc=c.map(R=>qs(R))),u&&(S.originalExample=u.join(`
147
147
  `),S.examples=await Ne.editor.colorize(S.originalExample,Ke,{tabSize:4})),x){S.detailedDesc=[];for(const R of x){const{desc:U,examples:K}=R;let H=U.map(Q=>qs(Q)),re,W;K&&(W=K.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guihz/trading-vue-editor-tes",
3
- "version": "0.0.284",
3
+ "version": "0.0.285",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "lib"
@@ -1,240 +0,0 @@
1
- import { IKeyObjectValue } from "../type";
2
- import { VFormatType, VScale, VPlotStyle, VPlotDisplay, VLocation, VSize, VShape, VAlert, VHlineStyle } from "./enum";
3
- import { BuiltInVariables } from "./buildInVariables";
4
- import { BuildInMath, BuildInArray, BuildInInput, IColorArgs, BuildInMap, BuildInMatrix, BuildInStr, BuildInTa, BuildInTimeframe, ChartPoint, BuildInLine, BuildInLabel, BuildInPolyline, BuildInBox, BuildInLinefill, BuildInTable, Log, Runtime, Strategy, Request, Syminfo } from './buildInFuncNamespace/index';
5
- import { IError } from "./type";
6
- interface ITimeArgs {
7
- timeframe?: string;
8
- session?: string;
9
- timezone?: string;
10
- bars_back?: number;
11
- time?: number;
12
- seconds?: number;
13
- }
14
- interface ILibraryArgs {
15
- title: string;
16
- overlay?: boolean;
17
- }
18
- interface IIndicatorArgs {
19
- title: string;
20
- shorttitle?: string;
21
- overlay?: boolean;
22
- format?: VFormatType;
23
- precision?: number;
24
- scale?: VScale;
25
- max_bars_back?: number;
26
- timeframe?: string;
27
- timeframe_gaps?: boolean;
28
- explicit_plot_zorder?: boolean;
29
- max_lines_count?: number;
30
- max_labels_count?: number;
31
- max_boxes_count?: number;
32
- calc_bars_count?: number;
33
- max_polylines_count?: number;
34
- }
35
- interface IPlotArgs {
36
- id: string;
37
- open?: number;
38
- high?: number;
39
- low?: number;
40
- close?: number;
41
- series?: number;
42
- title?: string;
43
- color?: string;
44
- linewidth?: number;
45
- style?: VPlotStyle | VShape;
46
- trackprice?: boolean;
47
- histbase?: number;
48
- offset?: number;
49
- join?: boolean;
50
- editable?: boolean;
51
- show_last?: number;
52
- display?: VPlotDisplay;
53
- format?: string;
54
- precision?: number;
55
- force_overlay?: boolean;
56
- char?: string;
57
- location?: VLocation;
58
- text?: string;
59
- textcolor?: string;
60
- size?: VSize;
61
- colorup?: string;
62
- colordown?: string;
63
- minheight?: number;
64
- maxheight?: number;
65
- wickcolor?: string;
66
- bordercolor?: string;
67
- seriesColors?: string[];
68
- colors?: (string | undefined)[];
69
- data?: IKeyObjectValue[];
70
- gradientColorKeys?: string[];
71
- [key: string]: any;
72
- }
73
- interface IAlertArgs {
74
- id?: string;
75
- message: string;
76
- freq?: VAlert;
77
- condition?: boolean;
78
- title?: string;
79
- type?: string;
80
- }
81
- interface IBgColorArgs {
82
- color?: string;
83
- offset?: number;
84
- editable?: boolean;
85
- show_last?: number;
86
- title?: string;
87
- display?: VPlotDisplay | VPlotDisplay[];
88
- force_overlay?: boolean;
89
- seriesColors?: string[];
90
- }
91
- interface IHlineArgs {
92
- id?: string;
93
- price?: number;
94
- title?: string;
95
- color?: string;
96
- linestyle?: VHlineStyle;
97
- linewidth?: number;
98
- editable?: boolean;
99
- display?: VPlotDisplay | VPlotDisplay[];
100
- zIndex?: number;
101
- }
102
- interface IMaxBarsBackArgs {
103
- var: any;
104
- num: number;
105
- var_name: string;
106
- }
107
- interface IFillArgs {
108
- id?: string;
109
- hline1?: IKeyObjectValue;
110
- hline2?: IKeyObjectValue;
111
- plot1?: IKeyObjectValue;
112
- plot2?: IKeyObjectValue;
113
- top_value?: number;
114
- bottom_value?: number;
115
- top_color?: string;
116
- bottom_color?: string;
117
- color?: string;
118
- title?: string;
119
- editable?: boolean;
120
- fillgaps?: boolean;
121
- display?: VPlotDisplay | VPlotDisplay[];
122
- seriesColors?: string[];
123
- data?: IKeyObjectValue[];
124
- colors?: string[];
125
- top_colors?: string[];
126
- bottom_colors?: string[];
127
- type?: string;
128
- zIndex?: number;
129
- force_overlay?: boolean;
130
- }
131
- export declare class BuildInFunctions {
132
- array: BuildInArray;
133
- color: any;
134
- math: BuildInMath;
135
- str: BuildInStr;
136
- map: BuildInMap;
137
- matrix: BuildInMatrix;
138
- timeframe: BuildInTimeframe;
139
- ta: BuildInTa;
140
- input: BuildInInput;
141
- private _variables;
142
- private _cacheData;
143
- private _options;
144
- private _errorListener;
145
- private _plots;
146
- private _plotshapes;
147
- private _plotbars;
148
- private _plotchars;
149
- private _plotarrows;
150
- private _plotcandles;
151
- private _alerts;
152
- private _bgColors;
153
- private _hlines;
154
- private _fills;
155
- private _proxy;
156
- chart: {
157
- point: ChartPoint;
158
- };
159
- line: BuildInLine;
160
- label: BuildInLabel;
161
- polyline: BuildInPolyline;
162
- box: BuildInBox;
163
- table: BuildInTable;
164
- linefill: BuildInLinefill;
165
- log: Log;
166
- runtime: Runtime;
167
- strategy: Strategy;
168
- request: Request;
169
- syminfo: Syminfo;
170
- private _count;
171
- constructor(mintick: number, variables: BuiltInVariables, id: string);
172
- get errors(): IError[];
173
- get scriptType(): any;
174
- clearErrors(): void;
175
- addErrors(errors: IError[], key: string): void;
176
- options(barindexs: number[], isNew: boolean): IKeyObjectValue;
177
- private _getDataOfBarindex;
178
- private _getDataFromBarindex;
179
- private _getDraws;
180
- private _getDrawsFromBarindex;
181
- private _getDrawDeletes;
182
- updateOptions(options: IKeyObjectValue): void;
183
- update(data: IKeyObjectValue): void;
184
- endExecution(): void;
185
- getProxy(obj: IKeyObjectValue, id: string, options: IKeyObjectValue): any;
186
- userFuncMiddleware(obj: any, allowedTypes: string, func: Function, params: IKeyObjectValue[], posStr: string, name: string, funcName: string): any;
187
- private _getFirstArgName;
188
- private _getProxyFunc;
189
- library(args: ILibraryArgs, posStr: string): void;
190
- indicator(args: IIndicatorArgs, posStr: string): void;
191
- private _paramVerfiy;
192
- private _lineWidthVerify;
193
- plot(args: IPlotArgs, posStr: string): {
194
- type: string;
195
- offset: number;
196
- key: string;
197
- };
198
- plotbar(args: IPlotArgs, posStr: string): void;
199
- private _verfiyArgs;
200
- plotchar(args: IPlotArgs, posStr: string): void;
201
- plotarrow(args: IPlotArgs, posStr: string): void;
202
- plotshape(args: IPlotArgs, posStr: string): void;
203
- plotcandle(args: IPlotArgs, posStr: string): void;
204
- hline(args: IHlineArgs, posStr: string): {
205
- type: string;
206
- key: string;
207
- };
208
- fill(args: IFillArgs, posStr: string): void;
209
- alert({ message, freq }: IAlertArgs, posStr: string): void;
210
- alertcondition({ condition, message, title }: IAlertArgs, posStr: string): void;
211
- barcolor(args: IBgColorArgs, posStr: string): void;
212
- bgcolor(args: IBgColorArgs, posStr: string): void;
213
- private _verifyDisplay;
214
- private _setColors;
215
- max_bars_back({ num, var_name }: IMaxBarsBackArgs): void;
216
- float({ x }: IColorArgs): any;
217
- bool({ x }: IColorArgs): any;
218
- string({ x }: IColorArgs): any;
219
- int({ x }: IColorArgs): any;
220
- na({ x }: IColorArgs): boolean;
221
- fixnan({ source }: IKeyObjectValue, posStr: string): any;
222
- nz(arg: IKeyObjectValue): any;
223
- time({ timeframe, session, timezone, bars_back }: ITimeArgs, posStr: string): number;
224
- time_close({ timeframe, session, timezone, bars_back }: ITimeArgs, posStr: string): number;
225
- timestamp(args: IKeyObjectValue): number;
226
- weekofyear({ time, timezone }: ITimeArgs): number;
227
- year({ time, timezone }: ITimeArgs): number;
228
- second({ time, timezone }: ITimeArgs): number;
229
- month({ time, timezone }: ITimeArgs): number;
230
- minute({ time, timezone }: ITimeArgs): number;
231
- hour({ time, timezone }: ITimeArgs): number;
232
- dayofweek({ time, timezone }: ITimeArgs): number;
233
- dayofmonth({ time, timezone }: ITimeArgs): number;
234
- private _calcTimeOffset;
235
- private _timeHandle;
236
- private _seriesColorHandle;
237
- private _parserSession;
238
- private _processTime;
239
- }
240
- export {};