@guihz/trading-vue-editor-tes 0.0.48 → 0.0.49

Sign up to get free protection for your applications and to get access to all the features.
@@ -66569,11 +66569,11 @@ function rr(a, n, r) {
66569
66569
  function Qb() {
66570
66570
  return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
66571
66571
  }
66572
- const Nu = new Worker(new URL("" + new URL("assets/scriptsRunWorker-DmNu2La0.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run TccScript Server" });
66572
+ const Nu = new Worker(new URL("" + new URL("assets/scriptsRunWorker-Bz0kV3Co.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run TccScript Server" });
66573
66573
  Nu.onerror = (a) => {
66574
66574
  console.error(a);
66575
66575
  };
66576
- const Ou = Wi(Nu), Jb = Wi(new Worker(new URL("" + new URL("assets/parserTccWorker-CwSYSKEG.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser TccScript Server" }));
66576
+ const Ou = Wi(Nu), Jb = Wi(new Worker(new URL("" + new URL("assets/parserTccWorker-CSf0s1lk.js", import.meta.url).href, import.meta.url), { type: "module", name: "Parser TccScript Server" }));
66577
66577
  async function Zb(a, n = !1) {
66578
66578
  const { functions: r, types: o, constants: u, variables: c, methods: m } = Ct;
66579
66579
  return await Jb(a, n, { functions: Object.fromEntries(r), methods: Object.fromEntries(m), types: Object.fromEntries(o), constants: Object.fromEntries(u), variables: Object.fromEntries(c) });
@@ -135,7 +135,7 @@ function print() { __p += __j.call(arguments, '') }
135
135
  * @license
136
136
  * Copyright 2019 Google LLC
137
137
  * SPDX-License-Identifier: Apache-2.0
138
- */const uo=Symbol("Comlink.proxy"),Yd=Symbol("Comlink.endpoint"),Kd=Symbol("Comlink.releaseProxy"),mn=Symbol("Comlink.finalizer"),Va=Symbol("Comlink.thrown"),po=s=>typeof s=="object"&&s!==null||typeof s=="function",Qd={canHandle:s=>po(s)&&s[uo],serialize(s){const{port1:n,port2:a}=new MessageChannel;return fo(s,n),[a,[a]]},deserialize(s){return s.start(),fn(s)}},Zd={canHandle:s=>po(s)&&Va in s,serialize({value:s}){let n;return s instanceof Error?n={isError:!0,value:{message:s.message,name:s.name,stack:s.stack}}:n={isError:!1,value:s},[n,[]]},deserialize(s){throw s.isError?Object.assign(new Error(s.value.message),s.value):s.value}},mo=new Map([["proxy",Qd],["throw",Zd]]);function Jd(s,n){for(const a of s)if(n===a||a==="*"||a instanceof RegExp&&a.test(n))return!0;return!1}function fo(s,n=globalThis,a=["*"]){n.addEventListener("message",function o(u){if(!u||!u.data)return;if(!Jd(a,u.origin)){console.warn(`Invalid origin '${u.origin}' for comlink proxy`);return}const{id:c,type:m,path:h}=Object.assign({path:[]},u.data),b=(u.data.argumentList||[]).map(_r);let g;try{const w=h.slice(0,-1).reduce((L,M)=>L[M],s),T=h.reduce((L,M)=>L[M],s);switch(m){case"GET":g=T;break;case"SET":w[h.slice(-1)[0]]=_r(u.data.value),g=!0;break;case"APPLY":g=T.apply(w,b);break;case"CONSTRUCT":{const L=new T(...b);g=np(L)}break;case"ENDPOINT":{const{port1:L,port2:M}=new MessageChannel;fo(s,M),g=sp(L,[L])}break;case"RELEASE":g=void 0;break;default:return}}catch(w){g={value:w,[Va]:0}}Promise.resolve(g).catch(w=>({value:w,[Va]:0})).then(w=>{const[T,L]=Za(w);n.postMessage(Object.assign(Object.assign({},T),{id:c}),L),m==="RELEASE"&&(n.removeEventListener("message",o),yo(n),mn in s&&typeof s[mn]=="function"&&s[mn]())}).catch(w=>{const[T,L]=Za({value:new TypeError("Unserializable return value"),[Va]:0});n.postMessage(Object.assign(Object.assign({},T),{id:c}),L)})}),n.start&&n.start()}function ep(s){return s.constructor.name==="MessagePort"}function yo(s){ep(s)&&s.close()}function fn(s,n){return yn(s,[],n)}function Ya(s){if(s)throw new Error("Proxy has been released and is not useable")}function ho(s){return Or(s,{type:"RELEASE"}).then(()=>{yo(s)})}const Ka=new WeakMap,Qa="FinalizationRegistry"in globalThis&&new FinalizationRegistry(s=>{const n=(Ka.get(s)||0)-1;Ka.set(s,n),n===0&&ho(s)});function tp(s,n){const a=(Ka.get(n)||0)+1;Ka.set(n,a),Qa&&Qa.register(s,n,s)}function rp(s){Qa&&Qa.unregister(s)}function yn(s,n=[],a=function(){}){let o=!1;const u=new Proxy(a,{get(c,m){if(Ya(o),m===Kd)return()=>{rp(u),ho(s),o=!0};if(m==="then"){if(n.length===0)return{then:()=>u};const h=Or(s,{type:"GET",path:n.map(b=>b.toString())}).then(_r);return h.then.bind(h)}return yn(s,[...n,m])},set(c,m,h){Ya(o);const[b,g]=Za(h);return Or(s,{type:"SET",path:[...n,m].map(w=>w.toString()),value:b},g).then(_r)},apply(c,m,h){Ya(o);const b=n[n.length-1];if(b===Yd)return Or(s,{type:"ENDPOINT"}).then(_r);if(b==="bind")return yn(s,n.slice(0,-1));const[g,w]=_o(h);return Or(s,{type:"APPLY",path:n.map(T=>T.toString()),argumentList:g},w).then(_r)},construct(c,m){Ya(o);const[h,b]=_o(m);return Or(s,{type:"CONSTRUCT",path:n.map(g=>g.toString()),argumentList:h},b).then(_r)}});return tp(u,s),u}function ap(s){return Array.prototype.concat.apply([],s)}function _o(s){const n=s.map(Za);return[n.map(a=>a[0]),ap(n.map(a=>a[1]))]}const go=new WeakMap;function sp(s,n){return go.set(s,n),s}function np(s){return Object.assign(s,{[uo]:!0})}function Za(s){for(const[n,a]of mo)if(a.canHandle(s)){const[o,u]=a.serialize(s);return[{type:"HANDLER",name:n,value:o},u]}return[{type:"RAW",value:s},go.get(s)||[]]}function _r(s){switch(s.type){case"HANDLER":return mo.get(s.name).deserialize(s.value);case"RAW":return s.value}}function Or(s,n,a){return new Promise(o=>{const u=ip();s.addEventListener("message",function c(m){!m.data||!m.data.id||m.data.id!==u||(s.removeEventListener("message",c),o(m.data))}),s.start&&s.start(),s.postMessage(Object.assign({id:u},n),a)})}function ip(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const bo=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-DmNu2La0.js").href:new URL("assets/scriptsRunWorker-DmNu2La0.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:ja&&ja.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Run TccScript Server"});bo.onerror=s=>{console.error(s)};const xo=fn(bo),op=fn(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-CwSYSKEG.js").href:new URL("assets/parserTccWorker-CwSYSKEG.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:ja&&ja.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Parser TccScript Server"}));async function wo(s,n=!1){const{functions:a,types:o,constants:u,variables:c,methods:m}=gt;return await op(s,n,{functions:Object.fromEntries(a),methods:Object.fromEntries(m),types:Object.fromEntries(o),constants:Object.fromEntries(u),variables:Object.fromEntries(c)})}async function vo(s,n,a=!0){return await xo.runScript(s,n,a)}async function lp(s){return await xo.removeScript(s)}function cp(s){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:s==null?void 0:s.name})}q.VType=void 0,function(s){s.BOOL="bool",s.INT="int",s.FLOAT="float",s.ARRAY="array",s.BOX="box",s.CHART_POINT="chart.point",s.COLOR="color",s.CONST="const",s.LABEL="label",s.LINE="line",s.LINEFILL="linefill",s.MAP="map",s.MATRIX="matrix",s.POLYLINE="polyline",s.SERIES="series",s.SIMPLE="simple",s.STRING="string",s.TABLE="table",s.UNDETERMINED="undetermined type",s.INPUT="input",s.NA="na",s.VOID="void"}(q.VType||(q.VType={})),q.VRuleType=void 0,function(s){s.FlowStmt="FlowStmt",s.DeclareAssign="DeclareAssign",s.VarBlockStmt="VarBlockStmt",s.VarSingle="VarSingle",s.VarMultiple="VarMultiple",s.ParenthesizedExpression="ParenthesizedExpression",s.AdditiveExpression="AdditiveExpression",s.RelationalExpression="RelationalExpression",s.EqualityExpression="EqualityExpression",s.TernaryExpression="TernaryExpression",s.UnaryExpression="UnaryExpression",s.NotExpression="NotExpression",s.MemberIndexExpression="MemberIndexExpression",s.MethodExpression="MethodExpression",s.LogicalAndExpression="LogicalAndExpression",s.LogicalOrExpression="LogicalOrExpression",s.MultiplicativeExpression="MultiplicativeExpression",s.Brackethesized="Brackethesized",s.IfStatement="IfStatement",s.ForToStatement="ForToStatement",s.ForInStatement="ForInStatement",s.SwitchStatement="SwitchStatement",s.CaseClause="CaseClause",s.DefaultCaluse="DefaultCaluse",s.WhileStatement="WhileStatement",s.ImportElement="ImportElement",s.Literal="Literal",s.ArrowFunction="ArrowFunction",s.ArrowMethod="ArrowMethod",s.TypeStatement="TypeStatement",s.Name="Name",s.AgainAssign="AgainAssign"}(q.VRuleType||(q.VRuleType={})),q.VAdjustment=void 0,function(s){s.dividends="dividends",s.none="none",s.splits="splits"}(q.VAdjustment||(q.VAdjustment={})),q.VAlert=void 0,function(s){s.freqAll="freq_all",s.freqOncePerBar="freq_once_per_bar",s.freqOncePerBarClose="freq_once_per_bar_close"}(q.VAlert||(q.VAlert={})),q.VBarmergeGaps=void 0,function(s){s.gapsOff="gaps_off",s.gapsOn="gaps_on",s.lookaheadOff="lookahead_off",s.lookaheadOn="lookahead_on"}(q.VBarmergeGaps||(q.VBarmergeGaps={})),q.VPlotDisplay=void 0,function(s){s.all="all",s.dataWindow="data_window",s.none="none",s.pane="pane",s.priceScale="price_scale",s.statusLine="status_line"}(q.VPlotDisplay||(q.VPlotDisplay={})),q.VExtend=void 0,function(s){s.both="both",s.left="left",s.none="none",s.right="right"}(q.VExtend||(q.VExtend={})),q.VFormatType=void 0,function(s){s.inherit="inherit",s.mintick="mintick",s.percent="percent",s.price="price",s.volume="volume"}(q.VFormatType||(q.VFormatType={})),q.VHlineStyle=void 0,function(s){s.styleDashed="style_dashed",s.styleDotted="style_dotted",s.styleSolid="style_solid"}(q.VHlineStyle||(q.VHlineStyle={})),q.VLabelStyle=void 0,function(s){s.styleArrowdown="style_arrowdown",s.styleArrowup="style_arrowup",s.styleCircle="style_circle",s.styleCross="style_cross",s.styleDiamond="style_diamond",s.styleFlag="style_flag",s.styleLabelCenter="style_label_center",s.styleLabelDown="style_label_down",s.styleLabelLeft="style_label_left",s.styleLabelLowerLeft="style_label_lower_left",s.styleLabelLowerRight="style_label_lower_right",s.styleLabelRight="style_label_right",s.styleLabelUp="style_label_up",s.styleLabelUpperLeft="style_label_upper_left",s.styleLabelUpperRight="style_label_upper_right",s.styleNone="style_none",s.styleSquare="style_square",s.styleTextOutline="style_text_outline",s.styleTriangledown="style_triangledown",s.styleTriangleup="style_triangleup",s.styleXcross="style_xcross"}(q.VLabelStyle||(q.VLabelStyle={})),q.VLineStyle=void 0,function(s){s.styleArrowBoth="style_arrow_both",s.styleArrowLeft="style_arrow_left",s.styleArrowRight="style_arrow_right",s.styleDashed="style_dashed",s.styleDotted="style_dotted",s.styleSolid="style_solid"}(q.VLineStyle||(q.VLineStyle={})),q.VLocation=void 0,function(s){s.abovebar="abovebar",s.absolute="absolute",s.belowbar="belowbar",s.bottom="bottom",s.top="top"}(q.VLocation||(q.VLocation={})),q.VSortOrder=void 0,function(s){s.ascending="ascending",s.descending="descending"}(q.VSortOrder||(q.VSortOrder={})),q.VPlotStyle=void 0,function(s){s.styleArea="Area",s.styleAreabr="Area With Breaks",s.styleCircles="Circles",s.styleColumns="Columns",s.styleCross="Cross",s.styleHistogram="Histogram",s.styleLine="Line",s.styleLinebr="Line With Breaks",s.styleStepline="Step Line",s.styleSteplineDiamond="Step Line With Diamonds",s.styleSteplinebr="Step line with Breaks"}(q.VPlotStyle||(q.VPlotStyle={})),q.VPosition=void 0,function(s){s.bottomCenter="bottom_center",s.bottomLeft="bottom_left",s.bottomRight="bottom_right",s.middleCenter="middle_center",s.middleLeft="middle_left",s.middleRight="middle_right",s.topCenter="top_center",s.topLeft="top_left",s.topRight="top_right"}(q.VPosition||(q.VPosition={})),q.VScale=void 0,function(s){s.left="left",s.none="none",s.right="right"}(q.VScale||(q.VScale={})),q.VSession=void 0,function(s){s.extended="extended",s.regular="regular"}(q.VSession||(q.VSession={})),q.VShape=void 0,function(s){s.arrowdown="arrowdown",s.arrowup="arrowup",s.circle="circle",s.cross="cross",s.diamond="diamond",s.flag="flag",s.labeldown="labeldown",s.labelup="labelup",s.square="square",s.triangledown="triangledown",s.triangleup="triangleup",s.xcross="xcross"}(q.VShape||(q.VShape={})),q.VSize=void 0,function(s){s.auto="auto",s.huge="huge",s.large="large",s.normal="normal",s.small="small",s.tiny="tiny"}(q.VSize||(q.VSize={})),q.VStrategy=void 0,function(s){s.cash="cash",s.fixed="fixed",s.percentOfEquity="percent_of_equity"}(q.VStrategy||(q.VStrategy={})),q.VCommission=void 0,function(s){s.cashPerContract="cash_per_contract",s.cashPerOrder="cash_per_order",s.percent="percent"}(q.VCommission||(q.VCommission={})),q.VDirection=void 0,function(s){s.all="all",s.long="long",s.short="short"}(q.VDirection||(q.VDirection={})),q.VOca=void 0,function(s){s.cancel="cancel",s.none="none",s.reduce="reduce"}(q.VOca||(q.VOca={})),q.VText=void 0,function(s){s.alignBottom="align_bottom",s.alignCenter="align_center",s.alignLeft="align_left",s.alignRight="align_right",s.alignTop="align_top",s.wrapAuto="wrap_auto",s.wrapNone="wrap_none"}(q.VText||(q.VText={})),q.VXloc=void 0,function(s){s.bar_index="bar_index",s.bar_time="bar_time"}(q.VXloc||(q.VXloc={})),q.VYloc=void 0,function(s){s.abovebar="abovebar",s.belowbar="belowbar",s.price="price"}(q.VYloc||(q.VYloc={})),q.VEarnings=void 0,function(s){s.actual="actual",s.estimate="estimate",s.standardized="standardized"}(q.VEarnings||(q.VEarnings={})),q.VPivotType=void 0,function(s){s.traditional="Traditional",s.fibonacci="Fibonacci",s.woodie="Woodie",s.classic="Classic",s.dm="DM",s.camarilla="Camarilla"}(q.VPivotType||(q.VPivotType={})),q.VInputType=void 0,function(s){s.INT="int",s.BOOL="bool",s.TIME="time",s.COLOR="color",s.FLOAT="float",s.PRICE="price",s.SOURCE="source",s.STRING="string",s.SYMBOL="symbol",s.SESSION="session",s.TEXT_AREA="text_area",s.TIMEFRAME="timeframe"}(q.VInputType||(q.VInputType={})),q.VType.SERIES,q.VType.SIMPLE,q.VType.INPUT,q.VType.CONST,q.VType.INT,q.VType.FLOAT,q.VType.BOOL,q.VType.COLOR,q.VType.STRING;const up={domReadOnly:!0,scrollBeyondLastLine:!1,readOnly:!0,minimap:{enabled:!1},scrollbar:{vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1},contextmenu:!1};self.MonacoEnvironment={getWorker(){return new cp({name:"Editor Worker"})}},tn.config({monaco:su});let To={};const dp=(s,n)=>{const{height:a,width:o,theme:u,options:c,hasDiff:m,readOnly:h,defaultValue:b,onChange:g,onLinkOpen:w,onDeclareConfigChange:T,onCursorPositionChange:L,onActionTrigger:M,onEditorDidMount:B}=s,P=j.useRef(null);j.useImperativeHandle(n,()=>({setOriginalScript(k){var E;(E=P.current)==null||E.setOriginalScript(k)},setScript(k){var E;(E=P.current)==null||E.setValue(k)},gotoLine(){var k;(k=P.current)==null||k.gotoLine()},getEditorLayout(){var k;return(k=P.current)==null?void 0:k.getEditorLayout()},setPosition(k,E){var G;(G=P.current)==null||G.setPosition({column:k,lineNumber:E})},setModelMarkers(k){var E;(E=P.current)==null||E.setModelMarkers(k)}})),j.useEffect(()=>{var k,E;m?(E=P.current)==null||E.addDiffDecorations():(k=P.current)==null||k.removeDiffDecorations()},[m]),j.useEffect(()=>{var k;(k=P.current)==null||k.updateActionTrigger(M)},[M]),j.useEffect(()=>{var k;w&&((k=P.current)==null||k.addLinkOpenFunc(w))},[w]),j.useEffect(()=>{var k;a&&((k=P.current)==null||k.setEditorLayout(Number(a)))},[a,P.current]);function Y(k,E){var V,he,_e;Lt.initBuiltinsTrees(),P.current=new Vd(k,E,M),w&&((V=P.current)==null||V.addLinkOpenFunc(w)),m&&((he=P.current)==null||he.addDiffDecorations()),Td(k),(_e=P.current)==null||_e.setEditorLayout(Number(a));const G=k.getValue();P.current.onChangeCursorPosition(L),g&&g(G),!h&&F(G),B&&B()}const F=j.useCallback(async k=>{var lt;const E=Date.now(),{errors:G,functions:V,methods:he,types:_e,variables:ce,overloadsFuncs:bt,preParserCode:St}=await wo(k),Me=new Map(Object.entries(V)),Fe=new Map(Object.entries(he)),K=new Map(Object.entries(_e)),fe=new Map(Object.entries(ce));Nr.setUserDefined({functions:Me,methods:Fe,types:K,variables:fe},bt),Lt.setUserDefind(Me,K,fe,Fe);const Oe=G.map(je=>({...je,severity:je.type||Se.MarkerSeverity.Error}));if(h)return;try{if(!G.length){const je=await vo(St,{isPreParser:!0});so.isEqual(je,To)||(To=je,T&&T(je))}}catch(je){console.log(je,"==================error- Run TccScript Server"),G.push({message:`Runtime Error: ${je.message}`,startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:0})}(lt=P.current)==null||lt.setModelMarkers(Oe);const Le=Date.now();console.log((Le-E)/1e3)},[T,h]),U=j.useMemo(()=>so.debounce(F,1e3),[F]);function R(k){var E;if(h){F(k||"");return}(E=P.current)==null||E.setModelMarkers([]),k!==void 0&&(g&&g(k),U(k))}return O.jsx(md,{height:a,width:o||"100%",defaultLanguage:Re,defaultValue:b||`indicator("我的脚本")
138
+ */const uo=Symbol("Comlink.proxy"),Yd=Symbol("Comlink.endpoint"),Kd=Symbol("Comlink.releaseProxy"),mn=Symbol("Comlink.finalizer"),Va=Symbol("Comlink.thrown"),po=s=>typeof s=="object"&&s!==null||typeof s=="function",Qd={canHandle:s=>po(s)&&s[uo],serialize(s){const{port1:n,port2:a}=new MessageChannel;return fo(s,n),[a,[a]]},deserialize(s){return s.start(),fn(s)}},Zd={canHandle:s=>po(s)&&Va in s,serialize({value:s}){let n;return s instanceof Error?n={isError:!0,value:{message:s.message,name:s.name,stack:s.stack}}:n={isError:!1,value:s},[n,[]]},deserialize(s){throw s.isError?Object.assign(new Error(s.value.message),s.value):s.value}},mo=new Map([["proxy",Qd],["throw",Zd]]);function Jd(s,n){for(const a of s)if(n===a||a==="*"||a instanceof RegExp&&a.test(n))return!0;return!1}function fo(s,n=globalThis,a=["*"]){n.addEventListener("message",function o(u){if(!u||!u.data)return;if(!Jd(a,u.origin)){console.warn(`Invalid origin '${u.origin}' for comlink proxy`);return}const{id:c,type:m,path:h}=Object.assign({path:[]},u.data),b=(u.data.argumentList||[]).map(_r);let g;try{const w=h.slice(0,-1).reduce((L,M)=>L[M],s),T=h.reduce((L,M)=>L[M],s);switch(m){case"GET":g=T;break;case"SET":w[h.slice(-1)[0]]=_r(u.data.value),g=!0;break;case"APPLY":g=T.apply(w,b);break;case"CONSTRUCT":{const L=new T(...b);g=np(L)}break;case"ENDPOINT":{const{port1:L,port2:M}=new MessageChannel;fo(s,M),g=sp(L,[L])}break;case"RELEASE":g=void 0;break;default:return}}catch(w){g={value:w,[Va]:0}}Promise.resolve(g).catch(w=>({value:w,[Va]:0})).then(w=>{const[T,L]=Za(w);n.postMessage(Object.assign(Object.assign({},T),{id:c}),L),m==="RELEASE"&&(n.removeEventListener("message",o),yo(n),mn in s&&typeof s[mn]=="function"&&s[mn]())}).catch(w=>{const[T,L]=Za({value:new TypeError("Unserializable return value"),[Va]:0});n.postMessage(Object.assign(Object.assign({},T),{id:c}),L)})}),n.start&&n.start()}function ep(s){return s.constructor.name==="MessagePort"}function yo(s){ep(s)&&s.close()}function fn(s,n){return yn(s,[],n)}function Ya(s){if(s)throw new Error("Proxy has been released and is not useable")}function ho(s){return Or(s,{type:"RELEASE"}).then(()=>{yo(s)})}const Ka=new WeakMap,Qa="FinalizationRegistry"in globalThis&&new FinalizationRegistry(s=>{const n=(Ka.get(s)||0)-1;Ka.set(s,n),n===0&&ho(s)});function tp(s,n){const a=(Ka.get(n)||0)+1;Ka.set(n,a),Qa&&Qa.register(s,n,s)}function rp(s){Qa&&Qa.unregister(s)}function yn(s,n=[],a=function(){}){let o=!1;const u=new Proxy(a,{get(c,m){if(Ya(o),m===Kd)return()=>{rp(u),ho(s),o=!0};if(m==="then"){if(n.length===0)return{then:()=>u};const h=Or(s,{type:"GET",path:n.map(b=>b.toString())}).then(_r);return h.then.bind(h)}return yn(s,[...n,m])},set(c,m,h){Ya(o);const[b,g]=Za(h);return Or(s,{type:"SET",path:[...n,m].map(w=>w.toString()),value:b},g).then(_r)},apply(c,m,h){Ya(o);const b=n[n.length-1];if(b===Yd)return Or(s,{type:"ENDPOINT"}).then(_r);if(b==="bind")return yn(s,n.slice(0,-1));const[g,w]=_o(h);return Or(s,{type:"APPLY",path:n.map(T=>T.toString()),argumentList:g},w).then(_r)},construct(c,m){Ya(o);const[h,b]=_o(m);return Or(s,{type:"CONSTRUCT",path:n.map(g=>g.toString()),argumentList:h},b).then(_r)}});return tp(u,s),u}function ap(s){return Array.prototype.concat.apply([],s)}function _o(s){const n=s.map(Za);return[n.map(a=>a[0]),ap(n.map(a=>a[1]))]}const go=new WeakMap;function sp(s,n){return go.set(s,n),s}function np(s){return Object.assign(s,{[uo]:!0})}function Za(s){for(const[n,a]of mo)if(a.canHandle(s)){const[o,u]=a.serialize(s);return[{type:"HANDLER",name:n,value:o},u]}return[{type:"RAW",value:s},go.get(s)||[]]}function _r(s){switch(s.type){case"HANDLER":return mo.get(s.name).deserialize(s.value);case"RAW":return s.value}}function Or(s,n,a){return new Promise(o=>{const u=ip();s.addEventListener("message",function c(m){!m.data||!m.data.id||m.data.id!==u||(s.removeEventListener("message",c),o(m.data))}),s.start&&s.start(),s.postMessage(Object.assign({id:u},n),a)})}function ip(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const bo=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-Bz0kV3Co.js").href:new URL("assets/scriptsRunWorker-Bz0kV3Co.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:ja&&ja.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Run TccScript Server"});bo.onerror=s=>{console.error(s)};const xo=fn(bo),op=fn(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-CSf0s1lk.js").href:new URL("assets/parserTccWorker-CSf0s1lk.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:ja&&ja.src||new URL("trading-vue-editor.umd.cjs",document.baseURI).href),{type:"module",name:"Parser TccScript Server"}));async function wo(s,n=!1){const{functions:a,types:o,constants:u,variables:c,methods:m}=gt;return await op(s,n,{functions:Object.fromEntries(a),methods:Object.fromEntries(m),types:Object.fromEntries(o),constants:Object.fromEntries(u),variables:Object.fromEntries(c)})}async function vo(s,n,a=!0){return await xo.runScript(s,n,a)}async function lp(s){return await xo.removeScript(s)}function cp(s){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:s==null?void 0:s.name})}q.VType=void 0,function(s){s.BOOL="bool",s.INT="int",s.FLOAT="float",s.ARRAY="array",s.BOX="box",s.CHART_POINT="chart.point",s.COLOR="color",s.CONST="const",s.LABEL="label",s.LINE="line",s.LINEFILL="linefill",s.MAP="map",s.MATRIX="matrix",s.POLYLINE="polyline",s.SERIES="series",s.SIMPLE="simple",s.STRING="string",s.TABLE="table",s.UNDETERMINED="undetermined type",s.INPUT="input",s.NA="na",s.VOID="void"}(q.VType||(q.VType={})),q.VRuleType=void 0,function(s){s.FlowStmt="FlowStmt",s.DeclareAssign="DeclareAssign",s.VarBlockStmt="VarBlockStmt",s.VarSingle="VarSingle",s.VarMultiple="VarMultiple",s.ParenthesizedExpression="ParenthesizedExpression",s.AdditiveExpression="AdditiveExpression",s.RelationalExpression="RelationalExpression",s.EqualityExpression="EqualityExpression",s.TernaryExpression="TernaryExpression",s.UnaryExpression="UnaryExpression",s.NotExpression="NotExpression",s.MemberIndexExpression="MemberIndexExpression",s.MethodExpression="MethodExpression",s.LogicalAndExpression="LogicalAndExpression",s.LogicalOrExpression="LogicalOrExpression",s.MultiplicativeExpression="MultiplicativeExpression",s.Brackethesized="Brackethesized",s.IfStatement="IfStatement",s.ForToStatement="ForToStatement",s.ForInStatement="ForInStatement",s.SwitchStatement="SwitchStatement",s.CaseClause="CaseClause",s.DefaultCaluse="DefaultCaluse",s.WhileStatement="WhileStatement",s.ImportElement="ImportElement",s.Literal="Literal",s.ArrowFunction="ArrowFunction",s.ArrowMethod="ArrowMethod",s.TypeStatement="TypeStatement",s.Name="Name",s.AgainAssign="AgainAssign"}(q.VRuleType||(q.VRuleType={})),q.VAdjustment=void 0,function(s){s.dividends="dividends",s.none="none",s.splits="splits"}(q.VAdjustment||(q.VAdjustment={})),q.VAlert=void 0,function(s){s.freqAll="freq_all",s.freqOncePerBar="freq_once_per_bar",s.freqOncePerBarClose="freq_once_per_bar_close"}(q.VAlert||(q.VAlert={})),q.VBarmergeGaps=void 0,function(s){s.gapsOff="gaps_off",s.gapsOn="gaps_on",s.lookaheadOff="lookahead_off",s.lookaheadOn="lookahead_on"}(q.VBarmergeGaps||(q.VBarmergeGaps={})),q.VPlotDisplay=void 0,function(s){s.all="all",s.dataWindow="data_window",s.none="none",s.pane="pane",s.priceScale="price_scale",s.statusLine="status_line"}(q.VPlotDisplay||(q.VPlotDisplay={})),q.VExtend=void 0,function(s){s.both="both",s.left="left",s.none="none",s.right="right"}(q.VExtend||(q.VExtend={})),q.VFormatType=void 0,function(s){s.inherit="inherit",s.mintick="mintick",s.percent="percent",s.price="price",s.volume="volume"}(q.VFormatType||(q.VFormatType={})),q.VHlineStyle=void 0,function(s){s.styleDashed="style_dashed",s.styleDotted="style_dotted",s.styleSolid="style_solid"}(q.VHlineStyle||(q.VHlineStyle={})),q.VLabelStyle=void 0,function(s){s.styleArrowdown="style_arrowdown",s.styleArrowup="style_arrowup",s.styleCircle="style_circle",s.styleCross="style_cross",s.styleDiamond="style_diamond",s.styleFlag="style_flag",s.styleLabelCenter="style_label_center",s.styleLabelDown="style_label_down",s.styleLabelLeft="style_label_left",s.styleLabelLowerLeft="style_label_lower_left",s.styleLabelLowerRight="style_label_lower_right",s.styleLabelRight="style_label_right",s.styleLabelUp="style_label_up",s.styleLabelUpperLeft="style_label_upper_left",s.styleLabelUpperRight="style_label_upper_right",s.styleNone="style_none",s.styleSquare="style_square",s.styleTextOutline="style_text_outline",s.styleTriangledown="style_triangledown",s.styleTriangleup="style_triangleup",s.styleXcross="style_xcross"}(q.VLabelStyle||(q.VLabelStyle={})),q.VLineStyle=void 0,function(s){s.styleArrowBoth="style_arrow_both",s.styleArrowLeft="style_arrow_left",s.styleArrowRight="style_arrow_right",s.styleDashed="style_dashed",s.styleDotted="style_dotted",s.styleSolid="style_solid"}(q.VLineStyle||(q.VLineStyle={})),q.VLocation=void 0,function(s){s.abovebar="abovebar",s.absolute="absolute",s.belowbar="belowbar",s.bottom="bottom",s.top="top"}(q.VLocation||(q.VLocation={})),q.VSortOrder=void 0,function(s){s.ascending="ascending",s.descending="descending"}(q.VSortOrder||(q.VSortOrder={})),q.VPlotStyle=void 0,function(s){s.styleArea="Area",s.styleAreabr="Area With Breaks",s.styleCircles="Circles",s.styleColumns="Columns",s.styleCross="Cross",s.styleHistogram="Histogram",s.styleLine="Line",s.styleLinebr="Line With Breaks",s.styleStepline="Step Line",s.styleSteplineDiamond="Step Line With Diamonds",s.styleSteplinebr="Step line with Breaks"}(q.VPlotStyle||(q.VPlotStyle={})),q.VPosition=void 0,function(s){s.bottomCenter="bottom_center",s.bottomLeft="bottom_left",s.bottomRight="bottom_right",s.middleCenter="middle_center",s.middleLeft="middle_left",s.middleRight="middle_right",s.topCenter="top_center",s.topLeft="top_left",s.topRight="top_right"}(q.VPosition||(q.VPosition={})),q.VScale=void 0,function(s){s.left="left",s.none="none",s.right="right"}(q.VScale||(q.VScale={})),q.VSession=void 0,function(s){s.extended="extended",s.regular="regular"}(q.VSession||(q.VSession={})),q.VShape=void 0,function(s){s.arrowdown="arrowdown",s.arrowup="arrowup",s.circle="circle",s.cross="cross",s.diamond="diamond",s.flag="flag",s.labeldown="labeldown",s.labelup="labelup",s.square="square",s.triangledown="triangledown",s.triangleup="triangleup",s.xcross="xcross"}(q.VShape||(q.VShape={})),q.VSize=void 0,function(s){s.auto="auto",s.huge="huge",s.large="large",s.normal="normal",s.small="small",s.tiny="tiny"}(q.VSize||(q.VSize={})),q.VStrategy=void 0,function(s){s.cash="cash",s.fixed="fixed",s.percentOfEquity="percent_of_equity"}(q.VStrategy||(q.VStrategy={})),q.VCommission=void 0,function(s){s.cashPerContract="cash_per_contract",s.cashPerOrder="cash_per_order",s.percent="percent"}(q.VCommission||(q.VCommission={})),q.VDirection=void 0,function(s){s.all="all",s.long="long",s.short="short"}(q.VDirection||(q.VDirection={})),q.VOca=void 0,function(s){s.cancel="cancel",s.none="none",s.reduce="reduce"}(q.VOca||(q.VOca={})),q.VText=void 0,function(s){s.alignBottom="align_bottom",s.alignCenter="align_center",s.alignLeft="align_left",s.alignRight="align_right",s.alignTop="align_top",s.wrapAuto="wrap_auto",s.wrapNone="wrap_none"}(q.VText||(q.VText={})),q.VXloc=void 0,function(s){s.bar_index="bar_index",s.bar_time="bar_time"}(q.VXloc||(q.VXloc={})),q.VYloc=void 0,function(s){s.abovebar="abovebar",s.belowbar="belowbar",s.price="price"}(q.VYloc||(q.VYloc={})),q.VEarnings=void 0,function(s){s.actual="actual",s.estimate="estimate",s.standardized="standardized"}(q.VEarnings||(q.VEarnings={})),q.VPivotType=void 0,function(s){s.traditional="Traditional",s.fibonacci="Fibonacci",s.woodie="Woodie",s.classic="Classic",s.dm="DM",s.camarilla="Camarilla"}(q.VPivotType||(q.VPivotType={})),q.VInputType=void 0,function(s){s.INT="int",s.BOOL="bool",s.TIME="time",s.COLOR="color",s.FLOAT="float",s.PRICE="price",s.SOURCE="source",s.STRING="string",s.SYMBOL="symbol",s.SESSION="session",s.TEXT_AREA="text_area",s.TIMEFRAME="timeframe"}(q.VInputType||(q.VInputType={})),q.VType.SERIES,q.VType.SIMPLE,q.VType.INPUT,q.VType.CONST,q.VType.INT,q.VType.FLOAT,q.VType.BOOL,q.VType.COLOR,q.VType.STRING;const up={domReadOnly:!0,scrollBeyondLastLine:!1,readOnly:!0,minimap:{enabled:!1},scrollbar:{vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1},contextmenu:!1};self.MonacoEnvironment={getWorker(){return new cp({name:"Editor Worker"})}},tn.config({monaco:su});let To={};const dp=(s,n)=>{const{height:a,width:o,theme:u,options:c,hasDiff:m,readOnly:h,defaultValue:b,onChange:g,onLinkOpen:w,onDeclareConfigChange:T,onCursorPositionChange:L,onActionTrigger:M,onEditorDidMount:B}=s,P=j.useRef(null);j.useImperativeHandle(n,()=>({setOriginalScript(k){var E;(E=P.current)==null||E.setOriginalScript(k)},setScript(k){var E;(E=P.current)==null||E.setValue(k)},gotoLine(){var k;(k=P.current)==null||k.gotoLine()},getEditorLayout(){var k;return(k=P.current)==null?void 0:k.getEditorLayout()},setPosition(k,E){var G;(G=P.current)==null||G.setPosition({column:k,lineNumber:E})},setModelMarkers(k){var E;(E=P.current)==null||E.setModelMarkers(k)}})),j.useEffect(()=>{var k,E;m?(E=P.current)==null||E.addDiffDecorations():(k=P.current)==null||k.removeDiffDecorations()},[m]),j.useEffect(()=>{var k;(k=P.current)==null||k.updateActionTrigger(M)},[M]),j.useEffect(()=>{var k;w&&((k=P.current)==null||k.addLinkOpenFunc(w))},[w]),j.useEffect(()=>{var k;a&&((k=P.current)==null||k.setEditorLayout(Number(a)))},[a,P.current]);function Y(k,E){var V,he,_e;Lt.initBuiltinsTrees(),P.current=new Vd(k,E,M),w&&((V=P.current)==null||V.addLinkOpenFunc(w)),m&&((he=P.current)==null||he.addDiffDecorations()),Td(k),(_e=P.current)==null||_e.setEditorLayout(Number(a));const G=k.getValue();P.current.onChangeCursorPosition(L),g&&g(G),!h&&F(G),B&&B()}const F=j.useCallback(async k=>{var lt;const E=Date.now(),{errors:G,functions:V,methods:he,types:_e,variables:ce,overloadsFuncs:bt,preParserCode:St}=await wo(k),Me=new Map(Object.entries(V)),Fe=new Map(Object.entries(he)),K=new Map(Object.entries(_e)),fe=new Map(Object.entries(ce));Nr.setUserDefined({functions:Me,methods:Fe,types:K,variables:fe},bt),Lt.setUserDefind(Me,K,fe,Fe);const Oe=G.map(je=>({...je,severity:je.type||Se.MarkerSeverity.Error}));if(h)return;try{if(!G.length){const je=await vo(St,{isPreParser:!0});so.isEqual(je,To)||(To=je,T&&T(je))}}catch(je){console.log(je,"==================error- Run TccScript Server"),G.push({message:`Runtime Error: ${je.message}`,startLineNumber:0,endLineNumber:0,startColumn:0,endColumn:0})}(lt=P.current)==null||lt.setModelMarkers(Oe);const Le=Date.now();console.log((Le-E)/1e3)},[T,h]),U=j.useMemo(()=>so.debounce(F,1e3),[F]);function R(k){var E;if(h){F(k||"");return}(E=P.current)==null||E.setModelMarkers([]),k!==void 0&&(g&&g(k),U(k))}return O.jsx(md,{height:a,width:o||"100%",defaultLanguage:Re,defaultValue:b||`indicator("我的脚本")
139
139
  plot(close)
140
140
  `,theme:u||"vs-dark",className:u||"vs-dark",options:{colorDecorators:!0,matchOnWordStartOnly:!0,useShadowDOM:!1,suggest:{preview:!0,matchOnWordStartOnly:!0},fontSize:13,...h?up:{},readOnlyMessage:{value:"该脚本是只读的。它无法被编辑。"},...c},onMount:Y,onChange:R})},pp=j.forwardRef(dp),mp=s=>{const{theme:n,modified:a,original:o,height:u,width:c,renderSideBySide:m=!0}=s,h=j.useCallback((b,g)=>{g.languages.register({id:Re}),g.editor.defineTheme("vs-dark",ln),g.editor.defineTheme("vs",on),g.languages.setMonarchTokensProvider(Re,sn),g.languages.setLanguageConfiguration(Re,nn)},[]);return O.jsx(ld,{height:u||"90vh",width:c||"100%",theme:n||"vs-dark",options:{readOnly:!0,renderSideBySide:m,scrollBeyondLastLine:!1},language:Re,modified:a,original:o,onMount:h})};q.VMarkerSeverity=void 0,function(s){s[s.Hint=1]="Hint",s[s.Info=2]="Info",s[s.Warning=4]="Warning",s[s.Error=8]="Error"}(q.VMarkerSeverity||(q.VMarkerSeverity={}));var Ja={},fp=function(){var s=document.getSelection();if(!s.rangeCount)return function(){};for(var n=document.activeElement,a=[],o=0;o<s.rangeCount;o++)a.push(s.getRangeAt(o));switch(n.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":n.blur();break;default:n=null;break}return s.removeAllRanges(),function(){s.type==="Caret"&&s.removeAllRanges(),s.rangeCount||a.forEach(function(u){s.addRange(u)}),n&&n.focus()}},yp=fp,Io={"text/plain":"Text","text/html":"Url",default:"Text"},hp="Copy to clipboard: #{key}, Enter";function _p(s){var n=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return s.replace(/#{\s*key\s*}/g,n)}function gp(s,n){var a,o,u,c,m,h,b=!1;n||(n={}),a=n.debug||!1;try{u=yp(),c=document.createRange(),m=document.getSelection(),h=document.createElement("span"),h.textContent=s,h.ariaHidden="true",h.style.all="unset",h.style.position="fixed",h.style.top=0,h.style.clip="rect(0, 0, 0, 0)",h.style.whiteSpace="pre",h.style.webkitUserSelect="text",h.style.MozUserSelect="text",h.style.msUserSelect="text",h.style.userSelect="text",h.addEventListener("copy",function(w){if(w.stopPropagation(),n.format)if(w.preventDefault(),typeof w.clipboardData>"u"){a&&console.warn("unable to use e.clipboardData"),a&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var T=Io[n.format]||Io.default;window.clipboardData.setData(T,s)}else w.clipboardData.clearData(),w.clipboardData.setData(n.format,s);n.onCopy&&(w.preventDefault(),n.onCopy(w.clipboardData))}),document.body.appendChild(h),c.selectNodeContents(h),m.addRange(c);var g=document.execCommand("copy");if(!g)throw new Error("copy command was unsuccessful");b=!0}catch(w){a&&console.error("unable to copy using execCommand: ",w),a&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(n.format||"text",s),n.onCopy&&n.onCopy(window.clipboardData),b=!0}catch(T){a&&console.error("unable to copy using clipboardData: ",T),a&&console.error("falling back to prompt"),o=_p("message"in n?n.message:hp),window.prompt(o,s)}}finally{m&&(typeof m.removeRange=="function"?m.removeRange(c):m.removeAllRanges()),h&&document.body.removeChild(h),u()}return b}var bp=gp;function hn(s){"@babel/helpers - typeof";return hn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},hn(s)}Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.CopyToClipboard=void 0;var es=ko(j),xp=ko(bp),wp=["text","onCopy","options","children"];function ko(s){return s&&s.__esModule?s:{default:s}}function Do(s,n){var a=Object.keys(s);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(s);n&&(o=o.filter(function(u){return Object.getOwnPropertyDescriptor(s,u).enumerable})),a.push.apply(a,o)}return a}function Ao(s){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Do(Object(a),!0).forEach(function(o){gn(s,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(a)):Do(Object(a)).forEach(function(o){Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(a,o))})}return s}function vp(s,n){if(s==null)return{};var a=Tp(s,n),o,u;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(s);for(u=0;u<c.length;u++)o=c[u],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(s,o)&&(a[o]=s[o])}return a}function Tp(s,n){if(s==null)return{};var a={},o=Object.keys(s),u,c;for(c=0;c<o.length;c++)u=o[c],!(n.indexOf(u)>=0)&&(a[u]=s[u]);return a}function Ip(s,n){if(!(s instanceof n))throw new TypeError("Cannot call a class as a function")}function qo(s,n){for(var a=0;a<n.length;a++){var o=n[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(s,o.key,o)}}function kp(s,n,a){return n&&qo(s.prototype,n),a&&qo(s,a),Object.defineProperty(s,"prototype",{writable:!1}),s}function Dp(s,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(n&&n.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),n&&_n(s,n)}function _n(s,n){return _n=Object.setPrototypeOf||function(o,u){return o.__proto__=u,o},_n(s,n)}function Ap(s){var n=Cp();return function(){var o=ts(s),u;if(n){var c=ts(this).constructor;u=Reflect.construct(o,arguments,c)}else u=o.apply(this,arguments);return qp(this,u)}}function qp(s,n){if(n&&(hn(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Co(s)}function Co(s){if(s===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s}function Cp(){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 ts(s){return ts=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},ts(s)}function gn(s,n,a){return n in s?Object.defineProperty(s,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):s[n]=a,s}var So=function(s){Dp(a,s);var n=Ap(a);function a(){var o;Ip(this,a);for(var u=arguments.length,c=new Array(u),m=0;m<u;m++)c[m]=arguments[m];return o=n.call.apply(n,[this].concat(c)),gn(Co(o),"onClick",function(h){var b=o.props,g=b.text,w=b.onCopy,T=b.children,L=b.options,M=es.default.Children.only(T),B=(0,xp.default)(g,L);w&&w(g,B),M&&M.props&&typeof M.props.onClick=="function"&&M.props.onClick(h)}),o}return kp(a,[{key:"render",value:function(){var u=this.props;u.text,u.onCopy,u.options;var c=u.children,m=vp(u,wp),h=es.default.Children.only(c);return es.default.cloneElement(h,Ao(Ao({},m),{},{onClick:this.onClick}))}}]),a}(es.default.PureComponent);Ja.CopyToClipboard=So,gn(So,"defaultProps",{onCopy:void 0,options:void 0});var Sp=Ja,bn=Sp.CopyToClipboard;bn.CopyToClipboard=bn;var zp=bn;const xn=nu(zp);async function Np(s,n=0){const a=s[n];if(!a)return;const{name:o,args:u,type:c,desc:m,examples:h,remarks:b,seeAlso:g,syntax:w,detailedDesc:T,fields:L,returns:M}=a,B={name:o};if(s.length>1&&(B.overloads=`${s.length} overloads`),c&&(B.type=c),u&&(B.name=`${o}()`,B.args=u.map(P=>{const{name:Y,desc:F,displayType:U}=P;return{label:`${Y} (${U})`,desc:F&&gr(F)}})),m&&(B.desc=m.map(P=>gr(P))),h&&(B.originalExample=h.join(`
141
141
  `),B.examples=await Se.editor.colorize(B.originalExample,Re,{tabSize:4})),T){B.detailedDesc=[];for(const P of T){const{desc:Y,examples:F}=P;let U=Y.map(E=>gr(E)),R,k;F&&(k=F.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guihz/trading-vue-editor-tes",
3
- "version": "0.0.048",
3
+ "version": "0.0.049",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "lib"