@guihz/trading-vue-editor-tes 0.1.62 → 0.1.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/{parserTccWorker-DNjcb8Nl.js → parserTccWorker-Bpuz4vCT.js} +18 -3
- package/lib/components/editor/v4/parseScript/visitorParser.d.ts +1 -1
- package/lib/components/editor/v5/parseScript/visitorParser.d.ts +1 -1
- package/lib/components/editor/v6/parseScript/visitorParser.d.ts +1 -1
- package/lib/trading-vue-editor.es.packages.js +363 -361
- package/lib/trading-vue-editor.umd.packages.mjs +2 -2
- package/package.json +1 -1
|
@@ -83,11 +83,11 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
83
83
|
* derived from CryptoJS.mode.CTR
|
|
84
84
|
* Jan Hruby jhruby.web@gmail.com
|
|
85
85
|
*/return t.mode.CTRGladman=function(){var n=t.lib.BlockCipherMode.extend();function i(p){if((p>>24&255)===255){var u=p>>16&255,d=p>>8&255,y=p&255;u===255?(u=0,d===255?(d=0,y===255?y=0:++y):++d):++u,p=0,p+=u<<16,p+=d<<8,p+=y}else p+=1<<24;return p}function l(p){return(p[0]=i(p[0]))===0&&(p[1]=i(p[1])),p}var c=n.Encryptor=n.extend({processBlock:function(p,u){var d=this._cipher,y=d.blockSize,g=this._iv,_=this._counter;g&&(_=this._counter=g.slice(0),this._iv=void 0),l(_);var h=_.slice(0);d.encryptBlock(h,0);for(var w=0;w<y;w++)p[u+w]^=h[w]}});return n.Decryptor=c,n}(),t.mode.CTRGladman})}(Bi)),Bi.exports}var Fi={exports:{}},Mc;function Y_(){return Mc||(Mc=1,function(a,s){(function(t,n,i){a.exports=n(Fe(),ct())})(Te,function(t){return t.mode.OFB=function(){var n=t.lib.BlockCipherMode.extend(),i=n.Encryptor=n.extend({processBlock:function(l,c){var p=this._cipher,u=p.blockSize,d=this._iv,y=this._keystream;d&&(y=this._keystream=d.slice(0),this._iv=void 0),p.encryptBlock(y,0);for(var g=0;g<u;g++)l[c+g]^=y[g]}});return n.Decryptor=i,n}(),t.mode.OFB})}(Fi)),Fi.exports}var Li={exports:{}},Pc;function Q_(){return Pc||(Pc=1,function(a,s){(function(t,n,i){a.exports=n(Fe(),ct())})(Te,function(t){return t.mode.ECB=function(){var n=t.lib.BlockCipherMode.extend();return n.Encryptor=n.extend({processBlock:function(i,l){this._cipher.encryptBlock(i,l)}}),n.Decryptor=n.extend({processBlock:function(i,l){this._cipher.decryptBlock(i,l)}}),n}(),t.mode.ECB})}(Li)),Li.exports}var Mi={exports:{}},Oc;function Z_(){return Oc||(Oc=1,function(a,s){(function(t,n,i){a.exports=n(Fe(),ct())})(Te,function(t){return t.pad.AnsiX923={pad:function(n,i){var l=n.sigBytes,c=i*4,p=c-l%c,u=l+p-1;n.clamp(),n.words[u>>>2]|=p<<24-u%4*8,n.sigBytes+=p},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},t.pad.Ansix923})}(Mi)),Mi.exports}var Pi={exports:{}},Rc;function J_(){return Rc||(Rc=1,function(a,s){(function(t,n,i){a.exports=n(Fe(),ct())})(Te,function(t){return t.pad.Iso10126={pad:function(n,i){var l=i*4,c=l-n.sigBytes%l;n.concat(t.lib.WordArray.random(c-1)).concat(t.lib.WordArray.create([c<<24],1))},unpad:function(n){var i=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=i}},t.pad.Iso10126})}(Pi)),Pi.exports}var Oi={exports:{}},Kc;function ef(){return Kc||(Kc=1,function(a,s){(function(t,n,i){a.exports=n(Fe(),ct())})(Te,function(t){return t.pad.Iso97971={pad:function(n,i){n.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(n,i)},unpad:function(n){t.pad.ZeroPadding.unpad(n),n.sigBytes--}},t.pad.Iso97971})}(Oi)),Oi.exports}var Ri={exports:{}},Uc;function tf(){return Uc||(Uc=1,function(a,s){(function(t,n,i){a.exports=n(Fe(),ct())})(Te,function(t){return t.pad.ZeroPadding={pad:function(n,i){var l=i*4;n.clamp(),n.sigBytes+=l-(n.sigBytes%l||l)},unpad:function(n){for(var i=n.words,l=n.sigBytes-1,l=n.sigBytes-1;l>=0;l--)if(i[l>>>2]>>>24-l%4*8&255){n.sigBytes=l+1;break}}},t.pad.ZeroPadding})}(Ri)),Ri.exports}var Ki={exports:{}},Hc;function sf(){return Hc||(Hc=1,function(a,s){(function(t,n,i){a.exports=n(Fe(),ct())})(Te,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(Ki)),Ki.exports}var Ui={exports:{}},$c;function rf(){return $c||($c=1,function(a,s){(function(t,n,i){a.exports=n(Fe(),ct())})(Te,function(t){return function(n){var i=t,l=i.lib,c=l.CipherParams,p=i.enc,u=p.Hex,d=i.format;d.Hex={stringify:function(y){return y.ciphertext.toString(u)},parse:function(y){var g=u.parse(y);return c.create({ciphertext:g})}}}(),t.format.Hex})}(Ui)),Ui.exports}var Hi={exports:{}},jc;function af(){return jc||(jc=1,function(a,s){(function(t,n,i){a.exports=n(Fe(),ir(),or(),Hs(),ct())})(Te,function(t){return function(){var n=t,i=n.lib,l=i.BlockCipher,c=n.algo,p=[],u=[],d=[],y=[],g=[],_=[],h=[],w=[],I=[],k=[];(function(){for(var D=[],T=0;T<256;T++)T<128?D[T]=T<<1:D[T]=T<<1^283;for(var E=0,q=0,T=0;T<256;T++){var A=q^q<<1^q<<2^q<<3^q<<4;A=A>>>8^A&255^99,p[E]=A,u[A]=E;var M=D[E],H=D[M],N=D[H],L=D[A]*257^A*16843008;d[E]=L<<24|L>>>8,y[E]=L<<16|L>>>16,g[E]=L<<8|L>>>24,_[E]=L;var L=N*16843009^H*65537^M*257^E*16843008;h[A]=L<<24|L>>>8,w[A]=L<<16|L>>>16,I[A]=L<<8|L>>>24,k[A]=L,E?(E=M^D[D[D[N^M]]],q^=D[D[q]]):E=q=1}})();var z=[0,1,2,4,8,16,32,64,128,27,54],x=c.AES=l.extend({_doReset:function(){var D;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var T=this._keyPriorReset=this._key,E=T.words,q=T.sigBytes/4,A=this._nRounds=q+6,M=(A+1)*4,H=this._keySchedule=[],N=0;N<M;N++)N<q?H[N]=E[N]:(D=H[N-1],N%q?q>6&&N%q==4&&(D=p[D>>>24]<<24|p[D>>>16&255]<<16|p[D>>>8&255]<<8|p[D&255]):(D=D<<8|D>>>24,D=p[D>>>24]<<24|p[D>>>16&255]<<16|p[D>>>8&255]<<8|p[D&255],D^=z[N/q|0]<<24),H[N]=H[N-q]^D);for(var L=this._invKeySchedule=[],j=0;j<M;j++){var N=M-j;if(j%4)var D=H[N];else var D=H[N-4];j<4||N<=4?L[j]=D:L[j]=h[p[D>>>24]]^w[p[D>>>16&255]]^I[p[D>>>8&255]]^k[p[D&255]]}}},encryptBlock:function(D,T){this._doCryptBlock(D,T,this._keySchedule,d,y,g,_,p)},decryptBlock:function(D,T){var E=D[T+1];D[T+1]=D[T+3],D[T+3]=E,this._doCryptBlock(D,T,this._invKeySchedule,h,w,I,k,u);var E=D[T+1];D[T+1]=D[T+3],D[T+3]=E},_doCryptBlock:function(D,T,E,q,A,M,H,N){for(var L=this._nRounds,j=D[T]^E[0],O=D[T+1]^E[1],ne=D[T+2]^E[2],Z=D[T+3]^E[3],le=4,me=1;me<L;me++){var Y=q[j>>>24]^A[O>>>16&255]^M[ne>>>8&255]^H[Z&255]^E[le++],ce=q[O>>>24]^A[ne>>>16&255]^M[Z>>>8&255]^H[j&255]^E[le++],ue=q[ne>>>24]^A[Z>>>16&255]^M[j>>>8&255]^H[O&255]^E[le++],K=q[Z>>>24]^A[j>>>16&255]^M[O>>>8&255]^H[ne&255]^E[le++];j=Y,O=ce,ne=ue,Z=K}var Y=(N[j>>>24]<<24|N[O>>>16&255]<<16|N[ne>>>8&255]<<8|N[Z&255])^E[le++],ce=(N[O>>>24]<<24|N[ne>>>16&255]<<16|N[Z>>>8&255]<<8|N[j&255])^E[le++],ue=(N[ne>>>24]<<24|N[Z>>>16&255]<<16|N[j>>>8&255]<<8|N[O&255])^E[le++],K=(N[Z>>>24]<<24|N[j>>>16&255]<<16|N[O>>>8&255]<<8|N[ne&255])^E[le++];D[T]=Y,D[T+1]=ce,D[T+2]=ue,D[T+3]=K},keySize:256/32});n.AES=l._createHelper(x)}(),t.AES})}(Hi)),Hi.exports}var $i={exports:{}},Gc;function nf(){return Gc||(Gc=1,function(a,s){(function(t,n,i){a.exports=n(Fe(),ir(),or(),Hs(),ct())})(Te,function(t){return function(){var n=t,i=n.lib,l=i.WordArray,c=i.BlockCipher,p=n.algo,u=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],d=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],y=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],g=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],_=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=p.DES=c.extend({_doReset:function(){for(var z=this._key,x=z.words,D=[],T=0;T<56;T++){var E=u[T]-1;D[T]=x[E>>>5]>>>31-E%32&1}for(var q=this._subKeys=[],A=0;A<16;A++){for(var M=q[A]=[],H=y[A],T=0;T<24;T++)M[T/6|0]|=D[(d[T]-1+H)%28]<<31-T%6,M[4+(T/6|0)]|=D[28+(d[T+24]-1+H)%28]<<31-T%6;M[0]=M[0]<<1|M[0]>>>31;for(var T=1;T<7;T++)M[T]=M[T]>>>(T-1)*4+3;M[7]=M[7]<<5|M[7]>>>27}for(var N=this._invSubKeys=[],T=0;T<16;T++)N[T]=q[15-T]},encryptBlock:function(z,x){this._doCryptBlock(z,x,this._subKeys)},decryptBlock:function(z,x){this._doCryptBlock(z,x,this._invSubKeys)},_doCryptBlock:function(z,x,D){this._lBlock=z[x],this._rBlock=z[x+1],w.call(this,4,252645135),w.call(this,16,65535),I.call(this,2,858993459),I.call(this,8,16711935),w.call(this,1,1431655765);for(var T=0;T<16;T++){for(var E=D[T],q=this._lBlock,A=this._rBlock,M=0,H=0;H<8;H++)M|=g[H][((A^E[H])&_[H])>>>0];this._lBlock=A,this._rBlock=q^M}var N=this._lBlock;this._lBlock=this._rBlock,this._rBlock=N,w.call(this,1,1431655765),I.call(this,8,16711935),I.call(this,2,858993459),w.call(this,16,65535),w.call(this,4,252645135),z[x]=this._lBlock,z[x+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function w(z,x){var D=(this._lBlock>>>z^this._rBlock)&x;this._rBlock^=D,this._lBlock^=D<<z}function I(z,x){var D=(this._rBlock>>>z^this._lBlock)&x;this._lBlock^=D,this._rBlock^=D<<z}n.DES=c._createHelper(h);var k=p.TripleDES=c.extend({_doReset:function(){var z=this._key,x=z.words;if(x.length!==2&&x.length!==4&&x.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var D=x.slice(0,2),T=x.length<4?x.slice(0,2):x.slice(2,4),E=x.length<6?x.slice(0,2):x.slice(4,6);this._des1=h.createEncryptor(l.create(D)),this._des2=h.createEncryptor(l.create(T)),this._des3=h.createEncryptor(l.create(E))},encryptBlock:function(z,x){this._des1.encryptBlock(z,x),this._des2.decryptBlock(z,x),this._des3.encryptBlock(z,x)},decryptBlock:function(z,x){this._des3.decryptBlock(z,x),this._des2.encryptBlock(z,x),this._des1.decryptBlock(z,x)},keySize:192/32,ivSize:64/32,blockSize:64/32});n.TripleDES=c._createHelper(k)}(),t.TripleDES})}($i)),$i.exports}var ji={exports:{}},Wc;function of(){return Wc||(Wc=1,function(a,s){(function(t,n,i){a.exports=n(Fe(),ir(),or(),Hs(),ct())})(Te,function(t){return function(){var n=t,i=n.lib,l=i.StreamCipher,c=n.algo,p=c.RC4=l.extend({_doReset:function(){for(var y=this._key,g=y.words,_=y.sigBytes,h=this._S=[],w=0;w<256;w++)h[w]=w;for(var w=0,I=0;w<256;w++){var k=w%_,z=g[k>>>2]>>>24-k%4*8&255;I=(I+h[w]+z)%256;var x=h[w];h[w]=h[I],h[I]=x}this._i=this._j=0},_doProcessBlock:function(y,g){y[g]^=u.call(this)},keySize:256/32,ivSize:0});function u(){for(var y=this._S,g=this._i,_=this._j,h=0,w=0;w<4;w++){g=(g+1)%256,_=(_+y[g])%256;var I=y[g];y[g]=y[_],y[_]=I,h|=y[(y[g]+y[_])%256]<<24-w*8}return this._i=g,this._j=_,h}n.RC4=l._createHelper(p);var d=c.RC4Drop=p.extend({cfg:p.cfg.extend({drop:192}),_doReset:function(){p._doReset.call(this);for(var y=this.cfg.drop;y>0;y--)u.call(this)}});n.RC4Drop=l._createHelper(d)}(),t.RC4})}(ji)),ji.exports}var Gi={exports:{}},Xc;function lf(){return Xc||(Xc=1,function(a,s){(function(t,n,i){a.exports=n(Fe(),ir(),or(),Hs(),ct())})(Te,function(t){return function(){var n=t,i=n.lib,l=i.StreamCipher,c=n.algo,p=[],u=[],d=[],y=c.Rabbit=l.extend({_doReset:function(){for(var _=this._key.words,h=this.cfg.iv,w=0;w<4;w++)_[w]=(_[w]<<8|_[w]>>>24)&16711935|(_[w]<<24|_[w]>>>8)&4278255360;var I=this._X=[_[0],_[3]<<16|_[2]>>>16,_[1],_[0]<<16|_[3]>>>16,_[2],_[1]<<16|_[0]>>>16,_[3],_[2]<<16|_[1]>>>16],k=this._C=[_[2]<<16|_[2]>>>16,_[0]&4294901760|_[1]&65535,_[3]<<16|_[3]>>>16,_[1]&4294901760|_[2]&65535,_[0]<<16|_[0]>>>16,_[2]&4294901760|_[3]&65535,_[1]<<16|_[1]>>>16,_[3]&4294901760|_[0]&65535];this._b=0;for(var w=0;w<4;w++)g.call(this);for(var w=0;w<8;w++)k[w]^=I[w+4&7];if(h){var z=h.words,x=z[0],D=z[1],T=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,E=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,q=T>>>16|E&4294901760,A=E<<16|T&65535;k[0]^=T,k[1]^=q,k[2]^=E,k[3]^=A,k[4]^=T,k[5]^=q,k[6]^=E,k[7]^=A;for(var w=0;w<4;w++)g.call(this)}},_doProcessBlock:function(_,h){var w=this._X;g.call(this),p[0]=w[0]^w[5]>>>16^w[3]<<16,p[1]=w[2]^w[7]>>>16^w[5]<<16,p[2]=w[4]^w[1]>>>16^w[7]<<16,p[3]=w[6]^w[3]>>>16^w[1]<<16;for(var I=0;I<4;I++)p[I]=(p[I]<<8|p[I]>>>24)&16711935|(p[I]<<24|p[I]>>>8)&4278255360,_[h+I]^=p[I]},blockSize:128/32,ivSize:64/32});function g(){for(var _=this._X,h=this._C,w=0;w<8;w++)u[w]=h[w];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0<u[0]>>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0<u[1]>>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0<u[2]>>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0<u[3]>>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0<u[4]>>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0<u[5]>>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0<u[6]>>>0?1:0)|0,this._b=h[7]>>>0<u[7]>>>0?1:0;for(var w=0;w<8;w++){var I=_[w]+h[w],k=I&65535,z=I>>>16,x=((k*k>>>17)+k*z>>>15)+z*z,D=((I&4294901760)*I|0)+((I&65535)*I|0);d[w]=x^D}_[0]=d[0]+(d[7]<<16|d[7]>>>16)+(d[6]<<16|d[6]>>>16)|0,_[1]=d[1]+(d[0]<<8|d[0]>>>24)+d[7]|0,_[2]=d[2]+(d[1]<<16|d[1]>>>16)+(d[0]<<16|d[0]>>>16)|0,_[3]=d[3]+(d[2]<<8|d[2]>>>24)+d[1]|0,_[4]=d[4]+(d[3]<<16|d[3]>>>16)+(d[2]<<16|d[2]>>>16)|0,_[5]=d[5]+(d[4]<<8|d[4]>>>24)+d[3]|0,_[6]=d[6]+(d[5]<<16|d[5]>>>16)+(d[4]<<16|d[4]>>>16)|0,_[7]=d[7]+(d[6]<<8|d[6]>>>24)+d[5]|0}n.Rabbit=l._createHelper(y)}(),t.Rabbit})}(Gi)),Gi.exports}var Wi={exports:{}},Vc;function cf(){return Vc||(Vc=1,function(a,s){(function(t,n,i){a.exports=n(Fe(),ir(),or(),Hs(),ct())})(Te,function(t){return function(){var n=t,i=n.lib,l=i.StreamCipher,c=n.algo,p=[],u=[],d=[],y=c.RabbitLegacy=l.extend({_doReset:function(){var _=this._key.words,h=this.cfg.iv,w=this._X=[_[0],_[3]<<16|_[2]>>>16,_[1],_[0]<<16|_[3]>>>16,_[2],_[1]<<16|_[0]>>>16,_[3],_[2]<<16|_[1]>>>16],I=this._C=[_[2]<<16|_[2]>>>16,_[0]&4294901760|_[1]&65535,_[3]<<16|_[3]>>>16,_[1]&4294901760|_[2]&65535,_[0]<<16|_[0]>>>16,_[2]&4294901760|_[3]&65535,_[1]<<16|_[1]>>>16,_[3]&4294901760|_[0]&65535];this._b=0;for(var k=0;k<4;k++)g.call(this);for(var k=0;k<8;k++)I[k]^=w[k+4&7];if(h){var z=h.words,x=z[0],D=z[1],T=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,E=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,q=T>>>16|E&4294901760,A=E<<16|T&65535;I[0]^=T,I[1]^=q,I[2]^=E,I[3]^=A,I[4]^=T,I[5]^=q,I[6]^=E,I[7]^=A;for(var k=0;k<4;k++)g.call(this)}},_doProcessBlock:function(_,h){var w=this._X;g.call(this),p[0]=w[0]^w[5]>>>16^w[3]<<16,p[1]=w[2]^w[7]>>>16^w[5]<<16,p[2]=w[4]^w[1]>>>16^w[7]<<16,p[3]=w[6]^w[3]>>>16^w[1]<<16;for(var I=0;I<4;I++)p[I]=(p[I]<<8|p[I]>>>24)&16711935|(p[I]<<24|p[I]>>>8)&4278255360,_[h+I]^=p[I]},blockSize:128/32,ivSize:64/32});function g(){for(var _=this._X,h=this._C,w=0;w<8;w++)u[w]=h[w];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0<u[0]>>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0<u[1]>>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0<u[2]>>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0<u[3]>>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0<u[4]>>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0<u[5]>>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0<u[6]>>>0?1:0)|0,this._b=h[7]>>>0<u[7]>>>0?1:0;for(var w=0;w<8;w++){var I=_[w]+h[w],k=I&65535,z=I>>>16,x=((k*k>>>17)+k*z>>>15)+z*z,D=((I&4294901760)*I|0)+((I&65535)*I|0);d[w]=x^D}_[0]=d[0]+(d[7]<<16|d[7]>>>16)+(d[6]<<16|d[6]>>>16)|0,_[1]=d[1]+(d[0]<<8|d[0]>>>24)+d[7]|0,_[2]=d[2]+(d[1]<<16|d[1]>>>16)+(d[0]<<16|d[0]>>>16)|0,_[3]=d[3]+(d[2]<<8|d[2]>>>24)+d[1]|0,_[4]=d[4]+(d[3]<<16|d[3]>>>16)+(d[2]<<16|d[2]>>>16)|0,_[5]=d[5]+(d[4]<<8|d[4]>>>24)+d[3]|0,_[6]=d[6]+(d[5]<<16|d[5]>>>16)+(d[4]<<16|d[4]>>>16)|0,_[7]=d[7]+(d[6]<<8|d[6]>>>24)+d[5]|0}n.RabbitLegacy=l._createHelper(y)}(),t.RabbitLegacy})}(Wi)),Wi.exports}var Xi={exports:{}},Yc;function pf(){return Yc||(Yc=1,function(a,s){(function(t,n,i){a.exports=n(Fe(),ir(),or(),Hs(),ct())})(Te,function(t){return function(){var n=t,i=n.lib,l=i.BlockCipher,c=n.algo;const p=16,u=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],d=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var y={pbox:[],sbox:[]};function g(k,z){let x=z>>24&255,D=z>>16&255,T=z>>8&255,E=z&255,q=k.sbox[0][x]+k.sbox[1][D];return q=q^k.sbox[2][T],q=q+k.sbox[3][E],q}function _(k,z,x){let D=z,T=x,E;for(let q=0;q<p;++q)D=D^k.pbox[q],T=g(k,D)^T,E=D,D=T,T=E;return E=D,D=T,T=E,T=T^k.pbox[p],D=D^k.pbox[p+1],{left:D,right:T}}function h(k,z,x){let D=z,T=x,E;for(let q=p+1;q>1;--q)D=D^k.pbox[q],T=g(k,D)^T,E=D,D=T,T=E;return E=D,D=T,T=E,T=T^k.pbox[1],D=D^k.pbox[0],{left:D,right:T}}function w(k,z,x){for(let A=0;A<4;A++){k.sbox[A]=[];for(let M=0;M<256;M++)k.sbox[A][M]=d[A][M]}let D=0;for(let A=0;A<p+2;A++)k.pbox[A]=u[A]^z[D],D++,D>=x&&(D=0);let T=0,E=0,q=0;for(let A=0;A<p+2;A+=2)q=_(k,T,E),T=q.left,E=q.right,k.pbox[A]=T,k.pbox[A+1]=E;for(let A=0;A<4;A++)for(let M=0;M<256;M+=2)q=_(k,T,E),T=q.left,E=q.right,k.sbox[A][M]=T,k.sbox[A][M+1]=E;return!0}var I=c.Blowfish=l.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var k=this._keyPriorReset=this._key,z=k.words,x=k.sigBytes/4;w(y,z,x)}},encryptBlock:function(k,z){var x=_(y,k[z],k[z+1]);k[z]=x.left,k[z+1]=x.right},decryptBlock:function(k,z){var x=h(y,k[z],k[z+1]);k[z]=x.left,k[z+1]=x.right},blockSize:64/32,keySize:128/32,ivSize:64/32});n.Blowfish=l._createHelper(I)}(),t.Blowfish})}(Xi)),Xi.exports}(function(a,s){(function(t,n,i){a.exports=n(Fe(),Qa(),O_(),R_(),ir(),K_(),or(),vc(),wi(),U_(),Ic(),H_(),$_(),j_(),qi(),G_(),Hs(),ct(),W_(),X_(),V_(),Y_(),Q_(),Z_(),J_(),ef(),tf(),sf(),rf(),af(),nf(),of(),lf(),cf(),pf())})(Te,function(t){return t})})(uc);var lr=uc.exports;const df=(a,s)=>{const t=lr.MD5(s).toString();return lr.AES.decrypt(a,lr.enc.Utf8.parse(t.slice(-16)),{iv:lr.enc.Utf8.parse(t.slice(0,16)),mode:lr.mode.CBC,padding:lr.pad.Pkcs7}).toString(lr.enc.Utf8)};class mf{constructor(){Object.defineProperty(this,"_inlayHints",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_importCompleteLibrary",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_funcs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_monaco",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._inlayHints=new Map,this._importCompleteLibrary=new Map,this._funcs=new Map}get inlayHints(){return[...this._inlayHints.values()]}setEditor(s,t){this._editor=s,this._monaco=t}async setInlayHints(s){const{endLine:t,endColumn:n,name:i,libraryId:l,libraryName:c,libraryVersion:p,username:u,version:d}=s;if(this._importCompleteLibrary.has(l)){const g=this._funcs.get(l),_=this._importCompleteLibrary.get(l);return _?.parserVersion!==d?{error:`脚本库${c}运行版本与当前脚本运行版本@version=${d}不一致。`}:((g?.name!==i||!i&&!this._inlayHints.has(l))&&(this._updateFuncNames(i||c,l,d),this._inlayHintsHandle(s)),_)}this._inlayHints.set(l,{label:"loading...",position:{column:n,lineNumber:t},paddingLeft:!0}),this.triggerInlayHints();let y;try{const g=y_(u.substring(1)),_=await L_({info_id:g,parser_version:d,version:`${p}.0`}).json();if(_.code===200){const{import:h,create_time:w}=_.data,I=df(h.parse,String(w));y={},Object.assign(y,h.info,{codeStr:I,parserVersion:d}),this._importCompleteLibrary.set(l,y),this._updateFuncNames(i||c,l,d)}else _.code===10079&&(y={error:`脚本库${c}运行版本与当前脚本运行版本@version=${d}不一致。`})}catch(g){console.error("getImportDetails error",g)}return this._inlayHintsHandle(s),y}deleteInlayHints(s){this._inlayHints.delete(s)}clearInlayHints(){this._inlayHints.clear()}triggerInlayHints(){this._editor&&this._editor.updateOptions({inlayHints:{fontFamily:String(Date.now())}})}_updateFuncNames(s,t,n){const i=this._importCompleteLibrary.get(t);if(!i)return;const l=i.functions.map(c=>`${s}.${c.name}`);this._funcs.set(t,{name:s,funcs:l}),this._updateMonarchTokens(n)}_setNoNameInlayHints(s){const{endLine:t,endColumn:n,libraryId:i,libraryName:l}=s;this._inlayHints.set(i,{label:`as ${l}`,position:{column:n,lineNumber:t},paddingLeft:!0})}_inlayHintsHandle(s){const{name:t,libraryId:n}=s;t?this._inlayHints.delete(n):this._setNoNameInlayHints(s),this.triggerInlayHints()}async _updateMonarchTokens(s){const t=await ja(s);if(!t)return;const n=t.LANGUAGE_MONARCH_TOKENS,i=[...this._funcs.values()].map(p=>p.funcs.join("|")),l=new RegExp("\\b("+i.map(p=>p.replace(".","\\.")).join("|")+")(?=\\s*\\()"),c=[...n.tokenizer.root];c.splice(15,0,[l,"meta.function-call"]),this._monaco?.languages.setMonarchTokensProvider(tt,{...n,tokenizer:{...n.tokenizer,root:c}})}}const Za=new mf;function uf(a,s,t){const n={startLineNumber:s.lineNumber,startColumn:1,endLineNumber:s.lineNumber,endColumn:s.column},i=a.getValueInRange(n);if(/^\/\/\s*@/.test(i))return{suggestions:ns.annotationSuggestions};if(t.triggerCharacter==="@")return{suggestions:[]};const l=i.match(/([\w.]+)$/)||[];if(!l.length)return{suggestions:[]};const c=l[0]?.match(/.*[^\w.]+([\w.]+)(?=\.)|([\w.]+)(?=\.)/),p=c?c[1]?c[1]:c[2]?c[2]:void 0:void 0,u=a.getWordUntilPosition(s),d=Us.parseCurrentInputFunc(i),y={startLineNumber:s.lineNumber,endLineNumber:s.lineNumber,startColumn:u.startColumn,endColumn:u.endColumn},g=a.getValueInRange({...y,startColumn:u.endColumn,endColumn:u.endColumn+1});ns.nextIsBracket=g==="(";let _=Qc(ns.getSuggestions(p)||[],y);if(l[0]==="."&&(_=[]),d&&!p&&!/=\s*\w+$/.test(i)){const h=Qc(ns.getArgSuggestions(d.funcName)||[],y);_=_.concat(h)}return{suggestions:_||[],dispose:()=>{}}}function yf(a){if(a.kind!==1)return a;const{originInsertText:s}=a;return ns.nextIsBracket?a.insertText=s:a.insertText=s+ns.bracketsPostfix,a}function _f(a,s){const t=Us.parseLineContentFuncVar(s.column,s.lineNumber,a,s);if(t?.libraryId)return{contents:[{value:c_(t)}]};if(t?.docValue?.length){const n=p_(t.docValue,t.index,t.isBuildIn);if(n)return{contents:[{value:n}]}}return{contents:[]}}function ff(a,s){const t={startLineNumber:s.lineNumber,endLineNumber:s.lineNumber,startColumn:1,endColumn:s.column},n=a.getValueInRange(t),i=a.findMatches(String(x_),t,!0,!1,null,!0),l=a.findMatches(String(b_),t,!0,!1,null,!0),c=i.pop()?.matches,p=l.pop()?.matches;let u=!1;i.length%2===0?c&&c[0]==='"'&&(u=!0):c&&!c[0]&&(u=!0);let d=!1;l.length%2===0?p&&p[0]==="'"&&(d=!0):p&&!p[0]&&(d=!0);const y=Us.parseCurrentInputFuncAndArg(n,d,u);if(y){const{funcName:g,args:_,startIndex:h}=y,w=nc.getSignatureHelpValues(g,_,h+1,s.lineNumber);if(w)return{value:w,dispose:()=>{}}}return null}function gf(a){let s=a.findMatches(li.colorMatchesRegStr,!0,!0,!1,null,!0);return s=s.filter(n=>{const i=a.getValueInRange({...n.range,startColumn:0});return i.indexOf("//")===-1||i.indexOf("//")>n.range.endColumn}),li.getDocumentColors(s)}function xf(a,s){return li.getDocumentColorPresentations(a,s)||[]}function bf(a,s){const t=a.getModel(),n=Us.parseLineContentFuncVar(s.startColumn+1,s.startLineNumber,t),i=n?.docValue?.[0]?.isImport;if(!n||n.isBuildIn||!n.docValue||!n.docValue[0].pos||i)return n?.isBuildIn||n?.docValue?.[0].title?.startsWith("built-in")||n?.libraryId||i?n:void 0;const{lineNumber:l,column:c}=n.docValue[0].pos,p={startLineNumber:l,endLineNumber:l,startColumn:c,endColumn:c};a.revealRangeInCenterIfOutsideViewport(p),a.setSelection(p)}function hf(a,s){return Us.parseLineContentFuncVar(s.column,s.lineNumber,a,s)?{uri:a.uri,range:{startLineNumber:s.lineNumber,endLineNumber:s.lineNumber,startColumn:s.column-1,endColumn:s.column-1}}:null}function Qc(a,s){return a.map(t=>(t.range=s,t))}function wf(){return{hints:Za.inlayHints,dispose:()=>{}}}var da={},ma=hu;if(process.env.NODE_ENV==="production")da.createRoot=ma.createRoot,da.hydrateRoot=ma.hydrateRoot;else{var Ja=ma.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;da.createRoot=function(a,s){Ja.usingClientEntryPoint=!0;try{return ma.createRoot(a,s)}finally{Ja.usingClientEntryPoint=!1}},da.hydrateRoot=function(a,s,t){Ja.usingClientEntryPoint=!0;try{return ma.hydrateRoot(a,s,t)}finally{Ja.usingClientEntryPoint=!1}}}var gt;(function(a){a.added="added",a.removed="removed",a.modified="modified"})(gt||(gt={}));const vf=(a,s)=>{const{close:t,retracement:n}=a,[i,l]=U.useState("modified");return U.useImperativeHandle(s,()=>({updateType(c){l(c)}})),F.jsxs("div",{className:`content-popup content-${i}-popup`,children:[F.jsx("div",{className:`triangle-popup triangle-${i}-popup`}),F.jsxs("div",{className:`header-popup header-${i}-popup`,children:[F.jsx("div",{className:"title-popup",children:"Local working changes"}),F.jsx("div",{className:"actions-popup",children:F.jsx("div",{onClick:t,"data-role":"button",className:"button-popup","data-name":"button-close-diff",children:F.jsx("span",{className:"icon-popup",role:"img",children:F.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",width:"12",height:"12",children:F.jsx("path",{stroke:"currentColor",strokeWidth:"1.2",d:"m1.5 1.5 9 9m0-9-9 9"})})})})})]}),F.jsx("div",{id:"diffEditorContainer",style:{height:"100%"}})]})},Tf=U.forwardRef(vf);class kf{constructor(s,t,n=!0){Object.defineProperty(this,"_domNode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_top",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._id=s,this._domNode=document.createElement("div"),this._domNode.style.display="none",this._domNode.style.width=n?"calc(100% - 134px)":"calc(100% - 14px)",this._domNode.style.height="200px",t?.onDidScrollChange(this.scrollChangeHandler.bind(this)),da.createRoot(this._domNode).render(F.jsx(Tf,{ref:i=>this._content=i,close:()=>this._close(),retracement:this._retracement})),this._top=0}_close(){this._domNode.style.display="none"}_retracement(){}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}show(s,t,n){this._top=t,this._content?.updateType(n),this._domNode.style.top=`${s}px`,this._domNode.style.display="block"}hide(){this._domNode.style.display="none"}scrollChangeHandler(s){const t=s.scrollTop;this._domNode.style.top=`${this._top-t}px`}}function $s(){}$s.prototype={diff:function(s,t){var n,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=i.callback;typeof i=="function"&&(l=i,i={}),this.options=i;var c=this;function p(T){return l?(setTimeout(function(){l(void 0,T)},0),!0):T}s=this.castInput(s),t=this.castInput(t),s=this.removeEmpty(this.tokenize(s)),t=this.removeEmpty(this.tokenize(t));var u=t.length,d=s.length,y=1,g=u+d;i.maxEditLength&&(g=Math.min(g,i.maxEditLength));var _=(n=i.timeout)!==null&&n!==void 0?n:1/0,h=Date.now()+_,w=[{oldPos:-1,lastComponent:void 0}],I=this.extractCommon(w[0],t,s,0);if(w[0].oldPos+1>=d&&I+1>=u)return p([{value:this.join(t),count:t.length}]);var k=-1/0,z=1/0;function x(){for(var T=Math.max(k,-y);T<=Math.min(z,y);T+=2){var E=void 0,q=w[T-1],A=w[T+1];q&&(w[T-1]=void 0);var M=!1;if(A){var H=A.oldPos-T;M=A&&0<=H&&H<u}var N=q&&q.oldPos+1<d;if(!M&&!N){w[T]=void 0;continue}if(!N||M&&q.oldPos+1<A.oldPos?E=c.addToPath(A,!0,void 0,0):E=c.addToPath(q,void 0,!0,1),I=c.extractCommon(E,t,s,T),E.oldPos+1>=d&&I+1>=u)return p(Df(c,E.lastComponent,t,s,c.useLongestToken));w[T]=E,E.oldPos+1>=d&&(z=Math.min(z,T-1)),I+1>=u&&(k=Math.max(k,T+1))}y++}if(l)(function T(){setTimeout(function(){if(y>g||Date.now()>h)return l();x()||T()},0)})();else for(;y<=g&&Date.now()<=h;){var D=x();if(D)return D}},addToPath:function(s,t,n,i){var l=s.lastComponent;return l&&l.added===t&&l.removed===n?{oldPos:s.oldPos+i,lastComponent:{count:l.count+1,added:t,removed:n,previousComponent:l.previousComponent}}:{oldPos:s.oldPos+i,lastComponent:{count:1,added:t,removed:n,previousComponent:l}}},extractCommon:function(s,t,n,i){for(var l=t.length,c=n.length,p=s.oldPos,u=p-i,d=0;u+1<l&&p+1<c&&this.equals(t[u+1],n[p+1]);)u++,p++,d++;return d&&(s.lastComponent={count:d,previousComponent:s.lastComponent}),s.oldPos=p,u},equals:function(s,t){return this.options.comparator?this.options.comparator(s,t):s===t||this.options.ignoreCase&&s.toLowerCase()===t.toLowerCase()},removeEmpty:function(s){for(var t=[],n=0;n<s.length;n++)s[n]&&t.push(s[n]);return t},castInput:function(s){return s},tokenize:function(s){return s.split("")},join:function(s){return s.join("")}};function Df(a,s,t,n,i){for(var l=[],c;s;)l.push(s),c=s.previousComponent,delete s.previousComponent,s=c;l.reverse();for(var p=0,u=l.length,d=0,y=0;p<u;p++){var g=l[p];if(g.removed){if(g.value=a.join(n.slice(y,y+g.count)),y+=g.count,p&&l[p-1].added){var h=l[p-1];l[p-1]=l[p],l[p]=h}}else{if(!g.added&&i){var _=t.slice(d,d+g.count);_=_.map(function(I,k){var z=n[y+k];return z.length>I.length?z:I}),g.value=a.join(_)}else g.value=a.join(t.slice(d,d+g.count));d+=g.count,g.added||(y+=g.count)}}var w=l[u-1];return u>1&&typeof w.value=="string"&&(w.added||w.removed)&&a.equals("",w.value)&&(l[u-2].value+=w.value,l.pop()),l}var Zc=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Jc=/\S/,ep=new $s;ep.equals=function(a,s){return this.options.ignoreCase&&(a=a.toLowerCase(),s=s.toLowerCase()),a===s||this.options.ignoreWhitespace&&!Jc.test(a)&&!Jc.test(s)},ep.tokenize=function(a){for(var s=a.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),t=0;t<s.length-1;t++)!s[t+1]&&s[t+2]&&Zc.test(s[t])&&Zc.test(s[t+2])&&(s[t]+=s[t+2],s.splice(t+1,2),t--);return s};var Vi=new $s;Vi.tokenize=function(a){this.options.stripTrailingCr&&(a=a.replace(/\r\n/g,`
|
|
86
|
-
`));var s=[],t=a.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(var n=0;n<t.length;n++){var i=t[n];n%2&&!this.options.newlineIsToken?s[s.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),s.push(i))}return s};function If(a,s,t){return Vi.diff(a,s,t)}var Af=new $s;Af.tokenize=function(a){return a.split(/(\S.+?[.!?])(?=\s+|$)/)};var qf=new $s;qf.tokenize=function(a){return a.split(/([{}:;,]|\s+)/)};function en(a){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?en=function(s){return typeof s}:en=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},en(a)}var Cf=Object.prototype.toString,ua=new $s;ua.useLongestToken=!0,ua.tokenize=Vi.tokenize,ua.castInput=function(a){var s=this.options,t=s.undefinedReplacement,n=s.stringifyReplacer,i=n===void 0?function(l,c){return typeof c>"u"?t:c}:n;return typeof a=="string"?a:JSON.stringify(Yi(a,null,null,i),i," ")},ua.equals=function(a,s){return $s.prototype.equals.call(ua,a.replace(/,([\r\n])/g,"$1"),s.replace(/,([\r\n])/g,"$1"))};function Yi(a,s,t,n,i){s=s||[],t=t||[],n&&(a=n(i,a));var l;for(l=0;l<s.length;l+=1)if(s[l]===a)return t[l];var c;if(Cf.call(a)==="[object Array]"){for(s.push(a),c=new Array(a.length),t.push(c),l=0;l<a.length;l+=1)c[l]=Yi(a[l],s,t,n,i);return s.pop(),t.pop(),c}if(a&&a.toJSON&&(a=a.toJSON()),en(a)==="object"&&a!==null){s.push(a),c={},t.push(c);var p=[],u;for(u in a)a.hasOwnProperty(u)&&p.push(u);for(p.sort(),l=0;l<p.length;l+=1)u=p[l],c[u]=Yi(a[u],s,t,n,u);s.pop(),t.pop()}else c=a;return c}var Qi=new $s;Qi.tokenize=function(a){return a.slice()},Qi.join=Qi.removeEmpty=function(a){return a};class Ef{constructor(s,t,n=""){Object.defineProperty(this,"_editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_monaco",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalModel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_oldDecorations",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_diffEditor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_diffPopupWidget",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_didChangeListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onMouseDownListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._editor=s,this._monaco=t,this._originalModel=this._monaco.editor.createModel(n,tt),this._oldDecorations=[],this._init(),this._eventListening()}_init(){this._changeEvent(),this._didChangeListener=this._editor.getModel()?.onDidChangeContent(()=>this._changeEvent())}update(s){if(this._originalModel=this._monaco.editor.createModel(s,tt),s!==this._editor.getModel()?.getValue()){this._changeEvent();return}this._editor.getModel()?.deltaDecorations(this._oldDecorations,[]),this._oldDecorations=[]}dispose(){this._diffPopupWidget&&(this._diffPopupWidget.hide(),this._editor.removeOverlayWidget(this._diffPopupWidget)),this._didChangeListener?.dispose(),this._onMouseDownListener?.dispose(),this._editor.getModel()?.deltaDecorations(this._oldDecorations,[]),this._oldDecorations=[],this._diffEditor?.dispose(),this._diffEditor=void 0}_changesHandle(s){let t=0,n;const i=[];let l=0;for(const c of s){const{added:p,removed:u,count:d=1,value:y}=c;p?n&&n.removed?(t=this._changeHandle(i,t,l,d,gt.modified),l=0,n=void 0):(n&&n.added&&(t=this._changeHandle(i,t,l,n.count||1,gt.added),l=0),n=c):u?n&&n.added?(t=this._changeHandle(i,t,l,n.count||1,gt.modified),l=0,n=void 0):(n&&n.removed&&this._addDecorationList(i,t,gt.removed),n=c):/^\n+$/.test(y)?n&&(n.added||n.removed)?l=d:t+=d:(n&&n.added?(t=this._changeHandle(i,t,l,n.count||1,gt.added),l=0,n=void 0):n&&n.removed&&(this._addDecorationList(i,t,gt.removed),n=void 0),t+=d)}return n&&n.added?t=this._changeHandle(i,t,l,n.count||1,gt.added):n&&n.removed&&this._addDecorationList(i,t,gt.removed),i}_changeHandle(s,t,n,i,l){for(let c=1;c<=i;c++)this._addDecorationList(s,t+c,l);return t+=i+n,t}_addDecorationList(s,t,n){s.push({range:new this._monaco.Range(t,1,t,1),options:{isWholeLine:!0,linesDecorationsClassName:`line-${n} line-decoration_${n}`}})}_changeEvent(){const s=If(this._originalModel.getValue(),this._editor.getModel()?.getValue()||""),t=this._changesHandle(s),n=this._editor.getModel()?.deltaDecorations(this._oldDecorations,t)||[];this._oldDecorations=n}_eventListening(){const s=new kf("diff.popup.widget",this._editor);this._editor.addOverlayWidget(s),this._onMouseDownListener=this._editor.onMouseDown(t=>this._onMouseDownHandle(t)),this._diffPopupWidget=s}_onMouseDownHandle(s){const t=s.target.element?.classList,n=t?.contains(`line-${gt.added}`),i=t?.contains(`line-${gt.modified}`),l=t?.contains(`line-${gt.removed}`);if(n||i||l){const c=s?.target?.position?.lineNumber||0,p=this._editor?.getTopForLineNumber(c+1)||0,u=this._editor?.getScrollTop()||0,d=n?gt.added:i?gt.modified:gt.removed;this._diffPopupWidget?.show(p-u,p,d),this._diffEditor||(this._diffEditor=this._createDiffEditor()),this._diffEditor.setModel({original:this._originalModel,modified:this._editor.getModel()}),this._diffEditor.revealLineInCenter(c+1)}}_createDiffEditor(){return this._monaco.editor.createDiffEditor(document.getElementById("diffEditorContainer"),{renderSideBySide:!1,quickSuggestions:!1,suggestOnTriggerCharacters:!1,hover:{enabled:!1},parameterHints:{enabled:!1}})}}class zf{constructor(s,t,n){Object.defineProperty(this,"_editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_monaco",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_decorations",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_changPositionListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScript",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onActionTrigger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onLinkOpen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_registerList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_version",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._editor=s,this._monaco=t,this._onActionTrigger=n,this._init()}addLinkOpenFunc(s){this._onLinkOpen=s}updateActionTrigger(s){this._onActionTrigger=s}setModelMarkers(s){this._monaco.editor.setModelMarkers(this._editor.getModel(),"owner",s)}addDiffDecorations(){this._decorations||(this._decorations=new Ef(this._editor,this._monaco,this._originalScript))}removeDiffDecorations(){this._decorations?.dispose(),this._decorations=void 0}setValue(s){this._editor.setValue(s),this._editor.setScrollTop(0),this.focus()}setPosition(s){this._editor?.setPosition(s),this._editor?.revealPositionInCenter(s),this.focus()}focus(){this._editor?.focus()}setOriginalScript(s){this._originalScript=s,this._decorations?.update(s)}getEditorLayout(){const s=this._editor.getContentHeight(),t=this._editor.getModel()?.getLineCount();return{contentHeight:s,lineCount:t}}setEditorLayout(s,t){this._editor?.layout({height:s,width:t||this._editor?.getContainerDomNode().clientWidth})}getVersion(){const s=this._editor?.getModel()?.findMatches("\\s*//\\s*@version\\s*=\\s*([0-9])",!0,!0,!1,null,!0);let t=gs;if(s&&s.length>0)for(const n of s){const i=n.matches?.[1];if(i){t=parseInt(i);break}}return t=t<3?3:t>6?6:t,this.updateOptions(t),t}async updateOptions(s){if(s===this._version)return;const t=await ja(s);if(!t)return;this._version=s;const n=t.LANGUAGE_MONARCH_TOKENS,i=t.CONFIGURATION;ns.initBuiltinsTrees(s),Us.onVersionChange(s),nc.onVersionChange(s),this._monaco.languages.setMonarchTokensProvider(tt,n),this._monaco.languages.setLanguageConfiguration(tt,i)}_init(){this._register(),this._setOptions(),this._addCommands(),this._addActions(),this._setCursorPosition(),this._onTabSizeChange()}_onTabSizeChange(){const s=this._editor.getModel();s?.onDidChangeOptions(t=>{if(t.tabSize&&!t.indentSize){const n=s?.getOptions().tabSize||4;s?.updateOptions({indentSize:n})}})}_setCursorPosition(){const s=localStorage.getItem(ni);this._editor.setPosition(s?JSON.parse(s):{lineNumber:1,column:1})}_register(){this._monaco.languages.register({id:tt});const s=this._monaco.languages.registerCompletionItemProvider(tt,{triggerCharacters:[".","@"],provideCompletionItems:uf,resolveCompletionItem:yf});this._registerList.push(s);const t=this._monaco.languages.registerHoverProvider(tt,{provideHover:_f});this._registerList.push(t);const n=this._monaco.languages.registerSignatureHelpProvider(tt,{signatureHelpTriggerCharacters:["(",","],provideSignatureHelp:ff});this._registerList.push(n);const i=this._monaco.languages.registerColorProvider(tt,{provideColorPresentations:xf,provideDocumentColors:gf});this._registerList.push(i);const l=this._monaco.editor.registerEditorOpener({openCodeEditor:(d,y,g)=>{const _=bf(d,g);if(_?.libraryId)return this._onLinkOpen&&this._onLinkOpen(_.username.substring(1),-1),!0;if(_){const{index:h,docValue:w}=_,{title:I,name:k,isImport:z,libraryInfoId:x}=w[h];if(z)return this._onLinkOpen&&this._onLinkOpen(x,-1),!0;let D="";switch(I){case Pe.keywords:D="kw";break;case Pe.methods:case Pe.functions:D="fun";break;case Pe.variables:D="var";break;case Pe.types:D="type";break;case Pe.constants:D="const";break}this._onLinkOpen&&this._onLinkOpen(`${D}_${k}`,h,this._version)}return!0}});this._registerList.push(l);const c=this._monaco.editor.registerLinkOpener({open:d=>(this._onLinkOpen&&d.fragment&&this._onLinkOpen(d.fragment,0,this._version),!!d.fragment)});this._registerList.push(c);const p=this._monaco.languages.registerDefinitionProvider(tt,{provideDefinition:hf});this._registerList.push(p);const u=this._monaco.languages.registerInlayHintsProvider(tt,{provideInlayHints:wf});this._registerList.push(u)}_setOptions(){this._monaco.editor.defineTheme("vs-dark",oi),this._monaco.editor.defineTheme("vs",ii)}_addCommands(){const s=this._monaco.editor.addCommand({id:"tcc.editor.function",run:(t,n)=>{if(ns.nextIsBracket){const i=this._editor.getPosition();i&&this._editor.setPosition(Object.assign(i,{column:i.column+1}))}this._editor.getAction(n)?.run()}});this._registerList.push(s)}_addActions(){const s=[{id:"tcc-save-script",label:He.t("save script"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyS],contextMenuGroupId:"9_modification",contextMenuOrder:1,run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.Save)}},{id:"tcc-find-replace-line",label:He.t("find/replace"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyF],contextMenuGroupId:"9_cutcopypaste",contextMenuOrder:5,run:()=>{this.openFind(),this._onActionTrigger&&this._onActionTrigger(Q.Actions.Find)}},{id:"tcc-trigger-console-script",label:He.t("toggle console"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.Backquote],contextMenuGroupId:"z_commands",contextMenuOrder:0,run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.TriggerConsole)}},{id:"tcc-run-script",label:"运行脚本",keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.Enter],run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.RunScript)}},{id:"tcc-open-script",label:He.t("open script"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyO],contextMenuGroupId:"9_modification",contextMenuOrder:2,run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.Open)}},{id:"tcc-new-window-script",label:He.t("open editor in new window"),keybindings:[this._monaco.KeyMod.Shift|this._monaco.KeyMod.Alt|this._monaco.KeyCode.KeyW],contextMenuGroupId:"9_modification",contextMenuOrder:3,run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.NewWindow)}},{id:"tcc-new-tab-script",label:He.t("open editor in new tab"),keybindings:[this._monaco.KeyMod.Shift|this._monaco.KeyMod.Alt|this._monaco.KeyCode.KeyT],contextMenuGroupId:"9_modification",contextMenuOrder:4,run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.NewTab)}},{id:"new_indicator",label:He.t("new indicator"),keybindings:[this._monaco.KeyMod.chord(this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyK,this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyI)],run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.NewIndicator)}},{id:"new_strategy",label:He.t("new strategy"),keybindings:[this._monaco.KeyMod.chord(this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyK,this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyS)],run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.NewStrategy)}}];for(const t of s){const n=this._editor.addAction(t);this._registerList.push(n)}this._editor.addCommand(this._monaco.KeyMod.Alt|this._monaco.KeyCode.KeyZ,()=>{const t=this._editor.getOption(this._monaco.editor.EditorOption.wordWrap);this._editor.updateOptions({wordWrap:t==="off"?"on":"off"})})}openFind(){this.focus(),this._editor.trigger("click","actions.find",null)}gotoLine(){this.focus(),this._editor.trigger("click","editor.action.gotoLine",null)}onChangeCursorPosition(s){this._changPositionListener&&this._changPositionListener.dispose();const t=localStorage.getItem(ni);s&&s(t?JSON.parse(t):{lineNumber:1,column:1}),this._changPositionListener=this._editor.onDidChangeCursorPosition(n=>{localStorage.setItem(ni,JSON.stringify(n.position)),s&&s(n.position)})}dispose(){for(const s of this._registerList)s.dispose();this._editor?.dispose()}}/**
|
|
86
|
+
`));var s=[],t=a.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(var n=0;n<t.length;n++){var i=t[n];n%2&&!this.options.newlineIsToken?s[s.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),s.push(i))}return s};function If(a,s,t){return Vi.diff(a,s,t)}var Af=new $s;Af.tokenize=function(a){return a.split(/(\S.+?[.!?])(?=\s+|$)/)};var qf=new $s;qf.tokenize=function(a){return a.split(/([{}:;,]|\s+)/)};function en(a){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?en=function(s){return typeof s}:en=function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},en(a)}var Cf=Object.prototype.toString,ua=new $s;ua.useLongestToken=!0,ua.tokenize=Vi.tokenize,ua.castInput=function(a){var s=this.options,t=s.undefinedReplacement,n=s.stringifyReplacer,i=n===void 0?function(l,c){return typeof c>"u"?t:c}:n;return typeof a=="string"?a:JSON.stringify(Yi(a,null,null,i),i," ")},ua.equals=function(a,s){return $s.prototype.equals.call(ua,a.replace(/,([\r\n])/g,"$1"),s.replace(/,([\r\n])/g,"$1"))};function Yi(a,s,t,n,i){s=s||[],t=t||[],n&&(a=n(i,a));var l;for(l=0;l<s.length;l+=1)if(s[l]===a)return t[l];var c;if(Cf.call(a)==="[object Array]"){for(s.push(a),c=new Array(a.length),t.push(c),l=0;l<a.length;l+=1)c[l]=Yi(a[l],s,t,n,i);return s.pop(),t.pop(),c}if(a&&a.toJSON&&(a=a.toJSON()),en(a)==="object"&&a!==null){s.push(a),c={},t.push(c);var p=[],u;for(u in a)a.hasOwnProperty(u)&&p.push(u);for(p.sort(),l=0;l<p.length;l+=1)u=p[l],c[u]=Yi(a[u],s,t,n,u);s.pop(),t.pop()}else c=a;return c}var Qi=new $s;Qi.tokenize=function(a){return a.slice()},Qi.join=Qi.removeEmpty=function(a){return a};class Ef{constructor(s,t,n=""){Object.defineProperty(this,"_editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_monaco",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalModel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_oldDecorations",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_diffEditor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_diffPopupWidget",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_didChangeListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onMouseDownListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._editor=s,this._monaco=t,this._originalModel=this._monaco.editor.createModel(n,tt),this._oldDecorations=[],this._init(),this._eventListening()}_init(){this._changeEvent(),this._didChangeListener=this._editor.getModel()?.onDidChangeContent(()=>this._changeEvent())}update(s){if(this._originalModel=this._monaco.editor.createModel(s,tt),s!==this._editor.getModel()?.getValue()){this._changeEvent();return}this._editor.getModel()?.deltaDecorations(this._oldDecorations,[]),this._oldDecorations=[]}dispose(){this._diffPopupWidget&&(this._diffPopupWidget.hide(),this._editor.removeOverlayWidget(this._diffPopupWidget)),this._didChangeListener?.dispose(),this._onMouseDownListener?.dispose(),this._editor.getModel()?.deltaDecorations(this._oldDecorations,[]),this._oldDecorations=[],this._diffEditor?.dispose(),this._diffEditor=void 0}_changesHandle(s){let t=0,n;const i=[];let l=0;for(const c of s){const{added:p,removed:u,count:d=1,value:y}=c;p?n&&n.removed?(t=this._changeHandle(i,t,l,d,gt.modified),l=0,n=void 0):(n&&n.added&&(t=this._changeHandle(i,t,l,n.count||1,gt.added),l=0),n=c):u?n&&n.added?(t=this._changeHandle(i,t,l,n.count||1,gt.modified),l=0,n=void 0):(n&&n.removed&&this._addDecorationList(i,t,gt.removed),n=c):/^\n+$/.test(y)?n&&(n.added||n.removed)?l=d:t+=d:(n&&n.added?(t=this._changeHandle(i,t,l,n.count||1,gt.added),l=0,n=void 0):n&&n.removed&&(this._addDecorationList(i,t,gt.removed),n=void 0),t+=d)}return n&&n.added?t=this._changeHandle(i,t,l,n.count||1,gt.added):n&&n.removed&&this._addDecorationList(i,t,gt.removed),i}_changeHandle(s,t,n,i,l){for(let c=1;c<=i;c++)this._addDecorationList(s,t+c,l);return t+=i+n,t}_addDecorationList(s,t,n){s.push({range:new this._monaco.Range(t,1,t,1),options:{isWholeLine:!0,linesDecorationsClassName:`line-${n} line-decoration_${n}`}})}_changeEvent(){const s=If(this._originalModel.getValue(),this._editor.getModel()?.getValue()||""),t=this._changesHandle(s),n=this._editor.getModel()?.deltaDecorations(this._oldDecorations,t)||[];this._oldDecorations=n}_eventListening(){const s=new kf("diff.popup.widget",this._editor);this._editor.addOverlayWidget(s),this._onMouseDownListener=this._editor.onMouseDown(t=>this._onMouseDownHandle(t)),this._diffPopupWidget=s}_onMouseDownHandle(s){const t=s.target.element?.classList,n=t?.contains(`line-${gt.added}`),i=t?.contains(`line-${gt.modified}`),l=t?.contains(`line-${gt.removed}`);if(n||i||l){const c=s?.target?.position?.lineNumber||0,p=this._editor?.getTopForLineNumber(c+1)||0,u=this._editor?.getScrollTop()||0,d=n?gt.added:i?gt.modified:gt.removed;this._diffPopupWidget?.show(p-u,p,d),this._diffEditor||(this._diffEditor=this._createDiffEditor()),this._diffEditor.setModel({original:this._originalModel,modified:this._editor.getModel()}),this._diffEditor.revealLineInCenter(c+1)}}_createDiffEditor(){return this._monaco.editor.createDiffEditor(document.getElementById("diffEditorContainer"),{renderSideBySide:!1,quickSuggestions:!1,suggestOnTriggerCharacters:!1,hover:{enabled:!1},parameterHints:{enabled:!1}})}}class zf{constructor(s,t,n){Object.defineProperty(this,"_editor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_monaco",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_decorations",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_changPositionListener",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_originalScript",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onActionTrigger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_onLinkOpen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_registerList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_version",{enumerable:!0,configurable:!0,writable:!0,value:0}),this._editor=s,this._monaco=t,this._onActionTrigger=n,this._init()}addLinkOpenFunc(s){this._onLinkOpen=s}updateActionTrigger(s){this._onActionTrigger=s}setModelMarkers(s){this._monaco.editor.setModelMarkers(this._editor.getModel(),"owner",s)}addDiffDecorations(){this._decorations||(this._decorations=new Ef(this._editor,this._monaco,this._originalScript))}removeDiffDecorations(){this._decorations?.dispose(),this._decorations=void 0}setValue(s){this._editor.setValue(s),this._editor.setScrollTop(0),this.focus()}setPosition(s){this._editor?.setPosition(s),this._editor?.revealPositionInCenter(s),this.focus()}focus(){this._editor?.focus()}setOriginalScript(s){this._originalScript=s,this._decorations?.update(s)}getEditorLayout(){const s=this._editor.getContentHeight(),t=this._editor.getModel()?.getLineCount();return{contentHeight:s,lineCount:t}}setEditorLayout(s,t){this._editor?.layout({height:s,width:t||this._editor?.getContainerDomNode().clientWidth})}getVersion(){const s=this._editor?.getModel()?.findMatches("\\s*//\\s*@version\\s*=\\s*([0-9])",!0,!0,!1,null,!0);let t=gs;if(s&&s.length>0)for(const n of s){const i=n.matches?.[1];if(i){t=parseInt(i);break}}return t=t<3?3:t>6?6:t,this.updateOptions(t),t}async updateOptions(s){if(s===this._version)return;const t=await ja(s);if(!t)return;this._version=s;const n=t.LANGUAGE_MONARCH_TOKENS,i=t.CONFIGURATION;ns.initBuiltinsTrees(s),Us.onVersionChange(s),nc.onVersionChange(s),this._monaco.languages.setMonarchTokensProvider(tt,n),this._monaco.languages.setLanguageConfiguration(tt,i)}_init(){this._register(),this._setOptions(),this._addCommands(),this._addActions(),this._setCursorPosition(),this._onTabSizeChange()}_onTabSizeChange(){const s=this._editor.getModel();s?.onDidChangeOptions(t=>{if(t.tabSize&&!t.indentSize){const n=s?.getOptions().tabSize||4;s?.updateOptions({indentSize:n})}})}_setCursorPosition(){const s=localStorage.getItem(ni);this._editor.setPosition(s?JSON.parse(s):{lineNumber:1,column:1})}_register(){this._monaco.languages.register({id:tt});const s=this._monaco.languages.registerCompletionItemProvider(tt,{triggerCharacters:[".","@"],provideCompletionItems:uf,resolveCompletionItem:yf});this._registerList.push(s);const t=this._monaco.languages.registerHoverProvider(tt,{provideHover:_f});this._registerList.push(t);const n=this._monaco.languages.registerSignatureHelpProvider(tt,{signatureHelpTriggerCharacters:["(",","],provideSignatureHelp:ff});this._registerList.push(n);const i=this._monaco.languages.registerColorProvider(tt,{provideColorPresentations:xf,provideDocumentColors:gf});this._registerList.push(i);const l=this._monaco.editor.registerEditorOpener({openCodeEditor:(d,y,g)=>{const _=bf(d,g);if(_?.libraryId)return this._onLinkOpen&&this._onLinkOpen(_.username.substring(1),-1),!0;if(_){const{index:h,docValue:w}=_,{title:I,name:k,isImport:z,libraryInfoId:x}=w[h];if(z)return this._onLinkOpen&&this._onLinkOpen(x,-1),!0;let D="";switch(I){case Pe.keywords:D="kw";break;case Pe.methods:case Pe.functions:D="fun";break;case Pe.variables:D="var";break;case Pe.types:D="type";break;case Pe.constants:D="const";break}this._onLinkOpen&&this._onLinkOpen(`${D}_${k}`,h,this._version)}return!0}});this._registerList.push(l);const c=this._monaco.editor.registerLinkOpener({open:d=>(this._onLinkOpen&&d.fragment&&this._onLinkOpen(d.fragment,0,this._version),!!d.fragment)});this._registerList.push(c);const p=this._monaco.languages.registerDefinitionProvider(tt,{provideDefinition:hf});this._registerList.push(p);const u=this._monaco.languages.registerInlayHintsProvider(tt,{provideInlayHints:wf});this._registerList.push(u)}_setOptions(){this._monaco.editor.defineTheme("vs-dark",oi),this._monaco.editor.defineTheme("vs",ii)}_addCommands(){const s=this._monaco.editor.addCommand({id:"tcc.editor.function",run:(t,n)=>{if(ns.nextIsBracket){const i=this._editor.getPosition();i&&this._editor.setPosition(Object.assign(i,{column:i.column+1}))}this._editor.getAction(n)?.run()}});this._registerList.push(s)}_addActions(){const s=[{id:"tcc-save-script",label:He.t("save script"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyS],contextMenuGroupId:"9_modification",contextMenuOrder:1,run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.Save)}},{id:"tcc-find-replace-line",label:He.t("find/replace"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyF],contextMenuGroupId:"9_cutcopypaste",contextMenuOrder:5,run:()=>{this.openFind(),this._onActionTrigger&&this._onActionTrigger(Q.Actions.Find)}},{id:"tcc-trigger-console-script",label:He.t("toggle console"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.Backquote],contextMenuGroupId:"z_commands",contextMenuOrder:0,run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.TriggerConsole)}},{id:"tcc-run-script",label:"运行脚本",keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.Enter],run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.RunScript)}},{id:"tcc-open-script",label:He.t("open script"),keybindings:[this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyO],contextMenuGroupId:"9_modification",contextMenuOrder:2,run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.Open)}},{id:"tcc-new-window-script",label:He.t("open editor in new window"),keybindings:[this._monaco.KeyMod.Shift|this._monaco.KeyMod.Alt|this._monaco.KeyCode.KeyW],contextMenuGroupId:"9_modification",contextMenuOrder:3,run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.NewWindow)}},{id:"tcc-new-tab-script",label:He.t("open editor in new tab"),keybindings:[this._monaco.KeyMod.Shift|this._monaco.KeyMod.Alt|this._monaco.KeyCode.KeyT],contextMenuGroupId:"9_modification",contextMenuOrder:4,run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.NewTab)}},{id:"new_indicator",label:He.t("new indicator"),keybindings:[this._monaco.KeyMod.chord(this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyK,this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyI)],run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.NewIndicator)}},{id:"new_strategy",label:He.t("new strategy"),keybindings:[this._monaco.KeyMod.chord(this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyK,this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.KeyS)],run:()=>{this._onActionTrigger&&this._onActionTrigger(Q.Actions.NewStrategy)}}];for(const t of s){const n=this._editor.addAction(t);this._registerList.push(n)}this._editor.addCommand(this._monaco.KeyMod.Alt|this._monaco.KeyCode.KeyZ,()=>{const t=this._editor.getOption(this._monaco.editor.EditorOption.wordWrap);this._editor.updateOptions({wordWrap:t==="off"?"on":"off"})}),this._editor.addCommand(this._monaco.KeyMod.CtrlCmd|this._monaco.KeyCode.NumpadDivide,()=>{this._editor.getAction("editor.action.commentLine")?.run()})}openFind(){this.focus(),this._editor.trigger("click","actions.find",null)}gotoLine(){this.focus(),this._editor.trigger("click","editor.action.gotoLine",null)}onChangeCursorPosition(s){this._changPositionListener&&this._changPositionListener.dispose();const t=localStorage.getItem(ni);s&&s(t?JSON.parse(t):{lineNumber:1,column:1}),this._changPositionListener=this._editor.onDidChangeCursorPosition(n=>{localStorage.setItem(ni,JSON.stringify(n.position)),s&&s(n.position)})}dispose(){for(const s of this._registerList)s.dispose();this._editor?.dispose()}}/**
|
|
87
87
|
* @license
|
|
88
88
|
* Copyright 2019 Google LLC
|
|
89
89
|
* SPDX-License-Identifier: Apache-2.0
|
|
90
|
-
*/const tp=Symbol("Comlink.proxy"),Nf=Symbol("Comlink.endpoint"),Sf=Symbol("Comlink.releaseProxy"),Zi=Symbol("Comlink.finalizer"),tn=Symbol("Comlink.thrown"),sp=a=>typeof a=="object"&&a!==null||typeof a=="function",Bf={canHandle:a=>sp(a)&&a[tp],serialize(a){const{port1:s,port2:t}=new MessageChannel;return ap(a,s),[t,[t]]},deserialize(a){return a.start(),Ji(a)}},Ff={canHandle:a=>sp(a)&&tn 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}},rp=new Map([["proxy",Bf],["throw",Ff]]);function Lf(a,s){for(const t of a)if(s===t||t==="*"||t instanceof RegExp&&t.test(s))return!0;return!1}function ap(a,s=globalThis,t=["*"]){s.addEventListener("message",function n(i){if(!i||!i.data)return;if(!Lf(t,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:l,type:c,path:p}=Object.assign({path:[]},i.data),u=(i.data.argumentList||[]).map(cr);let d;try{const y=p.slice(0,-1).reduce((_,h)=>_[h],a),g=p.reduce((_,h)=>_[h],a);switch(c){case"GET":d=g;break;case"SET":y[p.slice(-1)[0]]=cr(i.data.value),d=!0;break;case"APPLY":d=g.apply(y,u);break;case"CONSTRUCT":{const _=new g(...u);d=to(_)}break;case"ENDPOINT":{const{port1:_,port2:h}=new MessageChannel;ap(a,h),d=Kf(_,[_])}break;case"RELEASE":d=void 0;break;default:return}}catch(y){d={value:y,[tn]:0}}Promise.resolve(d).catch(y=>({value:y,[tn]:0})).then(y=>{const[g,_]=nn(y);s.postMessage(Object.assign(Object.assign({},g),{id:l}),_),c==="RELEASE"&&(s.removeEventListener("message",n),np(s),Zi in a&&typeof a[Zi]=="function"&&a[Zi]())}).catch(y=>{const[g,_]=nn({value:new TypeError("Unserializable return value"),[tn]:0});s.postMessage(Object.assign(Object.assign({},g),{id:l}),_)})}),s.start&&s.start()}function Mf(a){return a.constructor.name==="MessagePort"}function np(a){Mf(a)&&a.close()}function Ji(a,s){return eo(a,[],s)}function sn(a){if(a)throw new Error("Proxy has been released and is not useable")}function ip(a){return Sr(a,{type:"RELEASE"}).then(()=>{np(a)})}const rn=new WeakMap,an="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const s=(rn.get(a)||0)-1;rn.set(a,s),s===0&&ip(a)});function Pf(a,s){const t=(rn.get(s)||0)+1;rn.set(s,t),an&&an.register(a,s,a)}function Of(a){an&&an.unregister(a)}function eo(a,s=[],t=function(){}){let n=!1;const i=new Proxy(t,{get(l,c){if(sn(n),c===Sf)return()=>{Of(i),ip(a),n=!0};if(c==="then"){if(s.length===0)return{then:()=>i};const p=Sr(a,{type:"GET",path:s.map(u=>u.toString())}).then(cr);return p.then.bind(p)}return eo(a,[...s,c])},set(l,c,p){sn(n);const[u,d]=nn(p);return Sr(a,{type:"SET",path:[...s,c].map(y=>y.toString()),value:u},d).then(cr)},apply(l,c,p){sn(n);const u=s[s.length-1];if(u===Nf)return Sr(a,{type:"ENDPOINT"}).then(cr);if(u==="bind")return eo(a,s.slice(0,-1));const[d,y]=op(p);return Sr(a,{type:"APPLY",path:s.map(g=>g.toString()),argumentList:d},y).then(cr)},construct(l,c){sn(n);const[p,u]=op(c);return Sr(a,{type:"CONSTRUCT",path:s.map(d=>d.toString()),argumentList:p},u).then(cr)}});return Pf(i,a),i}function Rf(a){return Array.prototype.concat.apply([],a)}function op(a){const s=a.map(nn);return[s.map(t=>t[0]),Rf(s.map(t=>t[1]))]}const lp=new WeakMap;function Kf(a,s){return lp.set(a,s),a}function to(a){return Object.assign(a,{[tp]:!0})}function nn(a){for(const[s,t]of rp)if(t.canHandle(a)){const[n,i]=t.serialize(a);return[{type:"HANDLER",name:s,value:n},i]}return[{type:"RAW",value:a},lp.get(a)||[]]}function cr(a){switch(a.type){case"HANDLER":return rp.get(a.name).deserialize(a.value);case"RAW":return a.value}}function Sr(a,s,t){return new Promise(n=>{const i=Uf();a.addEventListener("message",function l(c){!c.data||!c.data.id||c.data.id!==i||(a.removeEventListener("message",l),n(c.data))}),a.start&&a.start(),a.postMessage(Object.assign({id:i},s),t)})}function Uf(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const cp=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-DvjQUdYy.js").href:new URL("assets/scriptsRunWorker-DvjQUdYy.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:Ba&&Ba.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Run MineScript Server"});cp.onerror=a=>{console.error(a)};async function pp(a){return await Za.setInlayHints(a)}const dp=Ji(cp),mp=Ji(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-DNjcb8Nl.js").href:new URL("assets/parserTccWorker-DNjcb8Nl.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:Ba&&Ba.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Parser MineScript Server"}));async function up(a,s=!1,t=gs){const n=a.match(/\s*\/\/\s*@version\s*=\s*([0-9])/)?.[1];n&&(t=parseInt(n),t=t<3?3:t>6?6:t);const i=await Ks(t);if(!i)return;const{functions:l,types:c,constants:p,variables:u,methods:d}=i.KEY_MAP_LIST;return await mp.parseTcc(a,s,to(pp),{functions:Object.fromEntries(l),methods:Object.fromEntries(d),types:Object.fromEntries(c),constants:Object.fromEntries(p),variables:Object.fromEntries(u)},t)}async function Hf(a,s){const t=a.match(/\s*\/\/\s*@version\s*=\s*([0-9])/)?.[1];let n=6;t&&(n=parseInt(t),n=n<5?5:n>6?6:n);const i=await Ks(n);if(!i)return;const{functions:l,types:c,constants:p,variables:u,methods:d}=i.KEY_MAP_LIST;return await mp.parseLibraryCode(a,s,to(pp),{functions:Object.fromEntries(l),methods:Object.fromEntries(d),types:Object.fromEntries(c),constants:Object.fromEntries(p),variables:Object.fromEntries(u)},n)}async function $f(a,s,t=!0,n=gs){return await dp.runScript(a,s,t,n)}async function jf(a){return await dp.removeScript(a)}function Gf(a){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-rBPieP89.js").href:new URL("assets/editor.worker-rBPieP89.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{type:"module",name:a?.name})}const{slice:Wf,forEach:Xf}=[];function Vf(a){return Xf.call(Wf.call(arguments,1),s=>{if(s)for(const t in s)a[t]===void 0&&(a[t]=s[t])}),a}const yp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Yf=(a,s,t)=>{const n=t||{};n.path=n.path||"/";const i=encodeURIComponent(s);let l=`${a}=${i}`;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(!yp.test(n.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${n.domain}`}if(n.path){if(!yp.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},_p={create(a,s,t,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+t*60*1e3)),n&&(i.domain=n),document.cookie=Yf(a,encodeURIComponent(s),i)},read(a){const s=`${a}=`,t=document.cookie.split(";");for(let n=0;n<t.length;n++){let i=t[n];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(s)===0)return i.substring(s.length,i.length)}return null},remove(a){this.create(a,"",-1)}};var Qf={name:"cookie",lookup(a){let{lookupCookie:s}=a;if(s&&typeof document<"u")return _p.read(s)||void 0},cacheUserLanguage(a,s){let{lookupCookie:t,cookieMinutes:n,cookieDomain:i,cookieOptions:l}=s;t&&typeof document<"u"&&_p.create(t,a,n,i,l)}},Zf={name:"querystring",lookup(a){let{lookupQuerystring:s}=a,t;if(typeof window<"u"){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const l=n.substring(1).split("&");for(let c=0;c<l.length;c++){const p=l[c].indexOf("=");p>0&&l[c].substring(0,p)===s&&(t=l[c].substring(p+1))}}return t}};let ya=null;const fp=()=>{if(ya!==null)return ya;try{ya=window!=="undefined"&&window.localStorage!==null;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{ya=!1}return ya};var Jf={name:"localStorage",lookup(a){let{lookupLocalStorage:s}=a;if(s&&fp())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupLocalStorage:t}=s;t&&fp()&&window.localStorage.setItem(t,a)}};let _a=null;const gp=()=>{if(_a!==null)return _a;try{_a=window!=="undefined"&&window.sessionStorage!==null;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{_a=!1}return _a};var eg={name:"sessionStorage",lookup(a){let{lookupSessionStorage:s}=a;if(s&&gp())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupSessionStorage:t}=s;t&&gp()&&window.sessionStorage.setItem(t,a)}},tg={name:"navigator",lookup(a){const s=[];if(typeof navigator<"u"){const{languages:t,userLanguage:n,language:i}=navigator;if(t)for(let l=0;l<t.length;l++)s.push(t[l]);n&&s.push(n),i&&s.push(i)}return s.length>0?s:void 0}},sg={name:"htmlTag",lookup(a){let{htmlTag:s}=a,t;const n=s||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(t=n.getAttribute("lang")),t}},rg={name:"path",lookup(a){let{lookupFromPathIndex:s}=a;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof s=="number"?s:0]?.replace("/",""):void 0}},ag={name:"subdomain",lookup(a){let{lookupFromSubdomainIndex:s}=a;const t=typeof s=="number"?s+1:1,n=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};function ng(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a}}class xp{constructor(s){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(s,t)}init(s){let t=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=Vf(t,this.options||{},ng()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Qf),this.addDetector(Zf),this.addDetector(Jf),this.addDetector(eg),this.addDetector(tg),this.addDetector(sg),this.addDetector(rg),this.addDetector(ag)}addDetector(s){return this.detectors[s.name]=s,this}detect(s){s||(s=this.options.order);let t=[];return s.forEach(n=>{if(this.detectors[n]){let i=this.detectors[n].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(t=t.concat(i))}}),t=t.map(n=>this.options.convertDetectedLanguage(n)),this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(s,t){t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(s)>-1||t.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(s,this.options)}))}}xp.type="languageDetector";const ig=(...a)=>{console?.warn&&(pr(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),console.warn(...a))},bp={},so=(...a)=>{pr(a[0])&&bp[a[0]]||(pr(a[0])&&(bp[a[0]]=new Date),ig(...a))},hp=(a,s)=>()=>{if(a.isInitialized)s();else{const t=()=>{setTimeout(()=>{a.off("initialized",t)},0),s()};a.on("initialized",t)}},ro=(a,s,t)=>{a.loadNamespaces(s,hp(a,t))},wp=(a,s,t,n)=>{if(pr(t)&&(t=[t]),a.options.preload&&a.options.preload.indexOf(s)>-1)return ro(a,t,n);t.forEach(i=>{a.options.ns.indexOf(i)<0&&a.options.ns.push(i)}),a.loadLanguages(s,hp(a,n))},og=(a,s,t={})=>!s.languages||!s.languages.length?(so("i18n.languages were undefined or empty",s.languages),!0):s.hasLoadedNamespace(a,{lng:t.lng,precheck:(n,i)=>{if(t.bindI18n?.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!i(n.isLanguageChangingTo,a))return!1}}),pr=a=>typeof a=="string",lg=a=>typeof a=="object"&&a!==null,cg=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,pg={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},dg=a=>pg[a];let ao={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:a=>a.replace(cg,dg)};const mg=(a={})=>{ao={...ao,...a}},ug=()=>ao;let vp;const yg=a=>{vp=a},_g=()=>vp,fg={type:"3rdParty",init(a){mg(a.options.react),yg(a)}},gg=U.createContext();class xg{constructor(){this.usedNamespaces={}}addUsedNamespaces(s){s.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const bg=(a,s)=>{const t=U.useRef();return U.useEffect(()=>{t.current=s?t.current:a},[a,s]),t.current},Tp=(a,s,t,n)=>a.getFixedT(s,t,n),hg=(a,s,t,n)=>U.useCallback(Tp(a,s,t,n),[a,s,t,n]),Br=(a,s={})=>{const{i18n:t}=s,{i18n:n,defaultNS:i}=U.useContext(gg)||{},l=t||n||_g();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new xg),!l){so("You will need to pass in an i18next instance by using initReactI18next");const T=(q,A)=>pr(A)?A:lg(A)&&pr(A.defaultValue)?A.defaultValue:Array.isArray(q)?q[q.length-1]:q,E=[T,{},!1];return E.t=T,E.i18n={},E.ready=!1,E}l.options.react?.wait&&so("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const c={...ug(),...l.options.react,...s},{useSuspense:p,keyPrefix:u}=c;let d=a||i||l.options?.defaultNS;d=pr(d)?[d]:d||["translation"],l.reportNamespaces.addUsedNamespaces?.(d);const y=(l.isInitialized||l.initializedStoreOnce)&&d.every(T=>og(T,l,c)),g=hg(l,s.lng||null,c.nsMode==="fallback"?d:d[0],u),_=()=>g,h=()=>Tp(l,s.lng||null,c.nsMode==="fallback"?d:d[0],u),[w,I]=U.useState(_);let k=d.join();s.lng&&(k=`${s.lng}${k}`);const z=bg(k),x=U.useRef(!0);U.useEffect(()=>{const{bindI18n:T,bindI18nStore:E}=c;x.current=!0,!y&&!p&&(s.lng?wp(l,s.lng,d,()=>{x.current&&I(h)}):ro(l,d,()=>{x.current&&I(h)})),y&&z&&z!==k&&x.current&&I(h);const q=()=>{x.current&&I(h)};return T&&l?.on(T,q),E&&l?.store.on(E,q),()=>{x.current=!1,l&&T?.split(" ").forEach(A=>l.off(A,q)),E&&l&&E.split(" ").forEach(A=>l.store.off(A,q))}},[l,k]),U.useEffect(()=>{x.current&&y&&I(_)},[l,u,y]);const D=[w,l,y];if(D.t=w,D.i18n=l,D.ready=y,y||!y&&!p)return D;throw new Promise(T=>{s.lng?wp(l,s.lng,d,()=>T()):ro(l,d,()=>T())})},wg={type:"type",syntax:"syntax",overloads:"overloads",arguments:"arguments",fields:"fields",example:"example",returns:"returns",remarks:"remarks","see also":"see also","Copy code":"Copy code","Copy link":"Copy link",Copied:"Copied","Link copied":"Link copied",variables:"Variables",constants:"Constants",functions:"Functions",keywords:"Keywords",types:"Types",operators:"Operators",annotations:"Annotations",search:"Search","Mine Script® v1 Reference Manual":"Mine Script® v{{version}} Reference Manual","This script is read-only. It cannot be edited.":"This script is read-only. It cannot be edited.","save script":"Save script","open script":"Open script","find/replace":"Find/Replace","toggle console":"Toggle console","open editor in new tab":"Open editor in new tab","open editor in new window":"Open editor in new window",keyword:"keyword","built-in function":"built-in function","built-in variable":"built-in variable","built-in method":"built-in method","built-in type":"built-in type",annotation:"annotation","built-in constant":"built-in constant",namespace:"namespace","user-defined variable":"user-defined variable","user-defined type":"user-defined type",field:"field",enum:"enum","user-defined method":"user-defined method","user-defined function":"user-defined function",parameter:"parameter","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Mine functions, variables, and methods.","to trigger parameters hint":"to trigger parameters hint",library:"library","enum member":"enum member",Returns:"Returns",Syntax:"Syntax",Remarks:"Remarks",Fields:"Fields",Description:"Description",Example:"Example","Enum members":"Enum members",statement:"statement",loop:"loop","`click` on keyword for more help":"`click` on keyword for more help","new indicator":"New Indicator","new strategy":"New Strategy"},vg={type:"类型",syntax:"语法",overloads:"重载",arguments:"参数",fields:"字段",example:"例子",returns:"返回值",remarks:"备注","see also":"另见","Copy code":"复制代码","Copy link":"复制链接",Copied:"已复制","Link copied":"链接已复制",variables:"内置变量",constants:"常量",functions:"函数",keywords:"关键词",types:"类型",operators:"运算符",annotations:"注释",search:"搜索","Mine Script® v1 Reference Manual":"Mine Script™ v{{version}} 参考手册","This script is read-only. It cannot be edited.":"该脚本是只读的。它无法被编辑。","save script":"保存脚本","open script":"打开脚本","find/replace":"寻找/替换","toggle console":"切换控制台","open editor in new tab":"在新标签页中打开","open editor in new window":"在新窗口中打开",keyword:"关键词","built-in function":"内置函数","built-in variable":"内置变量","built-in method":"内置方法","built-in type":"内置类型",annotation:"注释","built-in constant":"内置常量",namespace:"命名空间","user-defined variable":"用户自定义变量","user-defined type":"用户自定义类型",field:"字段",enum:"枚举","user-defined method":"用户自定义方法","user-defined function":"用户自定义函数",parameter:"参数","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"命名空间是不可变的术语,充当标识符组的前缀。在命名Mine函数、变量和方法时,点和另一个术语始终遵循命名空间。","to trigger parameters hint":"触发参数提示",library:"脚本库","enum member":"枚举成员",Returns:"返回值",Syntax:"语法",Remarks:"备注",Fields:"字段",Description:"描述",Example:"例子","Enum members":"枚举成员",statement:"声明",loop:"循环","`click` on keyword for more help":"“点击”关键词以获得更多帮助","new indicator":"新建指标","new strategy":"新建策略"};He.use(xp).use(fg).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:wg},zh:{translation:vg}}}),self.MonacoEnvironment={getWorker(){return new Gf({name:"Editor Worker"})}},ei.config({paths:{vs:"https://www.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const Tg=(a,s)=>{const{height:t,width:n,theme:i,options:l,hasDiff:c,readOnly:p,defaultValue:u,language:d,onChange:y,onLinkOpen:g,onCursorPositionChange:_,onActionTrigger:h,onEditorDidMount:w,onVersionChange:I}=a,{t:k,i18n:z}=Br(),x=U.useRef(null),D=U.useRef(null),T=U.useRef(!1),E=U.useRef(!1);U.useImperativeHandle(s,()=>({setOriginalScript(L){x.current?.setOriginalScript(L)},setScript(L){x.current?.setValue(L)},gotoLine(){x.current?.gotoLine()},getEditorLayout(){return x.current?.getEditorLayout()},setPosition(L,j){x.current?.setPosition({column:L,lineNumber:j})},setModelMarkers(L){E.current=!0,x.current?.setModelMarkers(L),setTimeout(()=>{E.current=!1},2e3)},focus(){x.current?.focus()}})),U.useEffect(()=>{c?x.current?.addDiffDecorations():x.current?.removeDiffDecorations()},[c]),U.useEffect(()=>{i&&je.editor.setTheme(i)},[i]),U.useEffect(()=>{d&&z.changeLanguage(d)},[d]),U.useEffect(()=>{x.current?.updateActionTrigger(h)},[h]),U.useEffect(()=>{g&&x.current?.addLinkOpenFunc(g)},[g]);function q(L,j){Za.setEditor(L,j),x.current=new zf(L,j,h),g&&x.current?.addLinkOpenFunc(g),c&&x.current?.addDiffDecorations(),u_(L),requestAnimationFrame(N);const O=L.getValue();x.current.onChangeCursorPosition(_),y&&y(O),!p&&A(O),w&&w()}const A=U.useCallback(async L=>{const j=x.current?.getVersion();I&&I(j||gs),T.current=!1;const{errors:O,functions:ne,methods:Z,types:le,variables:me,overloadsFuncs:Y,imports:ce,enums:ue}=await up(L,!1,j),K=new Map(Object.entries(ne)),ee=new Map(Object.entries(Z)),re=new Map(Object.entries(le)),te=new Map(Object.entries(me)),Ie=new Map(Object.entries(ce)),we=new Map(Object.entries(ue));Us.setUserDefined({functions:K,methods:ee,types:re,variables:te,imports:Ie,enums:we},Y),ns.setUserDefind(K,re,te,ee,we);const $e=O.map(fe=>({...fe,severity:fe.type||je.MarkerSeverity.Error}));p||!T.current&&!E.current&&$e.length&&x.current?.setModelMarkers($e)},[p]),M=U.useMemo(()=>g_.debounce(A,1500),[A]);function H(L){if(p){A(L||"");return}T.current=!0,Za.clearInlayHints(),x.current?.setModelMarkers([]),L!==void 0&&(y&&y(L),M(L))}const N=U.useCallback(()=>{const L=D.current?.getBoundingClientRect();x.current?.setEditorLayout(L?.height||0,L?.width)},[]);return U.useEffect(()=>{const L=()=>{window.requestAnimationFrame(N)},j=new ResizeObserver(L);return D.current&&j.observe(D.current),()=>{D.current&&j.unobserve(D.current),j.disconnect(),x.current?.dispose()}},[]),F.jsx("div",{ref:D,children:F.jsx(Sy,{height:t,width:n||"100%",defaultLanguage:tt,defaultValue:u||`//@version=6
|
|
90
|
+
*/const tp=Symbol("Comlink.proxy"),Nf=Symbol("Comlink.endpoint"),Sf=Symbol("Comlink.releaseProxy"),Zi=Symbol("Comlink.finalizer"),tn=Symbol("Comlink.thrown"),sp=a=>typeof a=="object"&&a!==null||typeof a=="function",Bf={canHandle:a=>sp(a)&&a[tp],serialize(a){const{port1:s,port2:t}=new MessageChannel;return ap(a,s),[t,[t]]},deserialize(a){return a.start(),Ji(a)}},Ff={canHandle:a=>sp(a)&&tn 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}},rp=new Map([["proxy",Bf],["throw",Ff]]);function Lf(a,s){for(const t of a)if(s===t||t==="*"||t instanceof RegExp&&t.test(s))return!0;return!1}function ap(a,s=globalThis,t=["*"]){s.addEventListener("message",function n(i){if(!i||!i.data)return;if(!Lf(t,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:l,type:c,path:p}=Object.assign({path:[]},i.data),u=(i.data.argumentList||[]).map(cr);let d;try{const y=p.slice(0,-1).reduce((_,h)=>_[h],a),g=p.reduce((_,h)=>_[h],a);switch(c){case"GET":d=g;break;case"SET":y[p.slice(-1)[0]]=cr(i.data.value),d=!0;break;case"APPLY":d=g.apply(y,u);break;case"CONSTRUCT":{const _=new g(...u);d=to(_)}break;case"ENDPOINT":{const{port1:_,port2:h}=new MessageChannel;ap(a,h),d=Kf(_,[_])}break;case"RELEASE":d=void 0;break;default:return}}catch(y){d={value:y,[tn]:0}}Promise.resolve(d).catch(y=>({value:y,[tn]:0})).then(y=>{const[g,_]=nn(y);s.postMessage(Object.assign(Object.assign({},g),{id:l}),_),c==="RELEASE"&&(s.removeEventListener("message",n),np(s),Zi in a&&typeof a[Zi]=="function"&&a[Zi]())}).catch(y=>{const[g,_]=nn({value:new TypeError("Unserializable return value"),[tn]:0});s.postMessage(Object.assign(Object.assign({},g),{id:l}),_)})}),s.start&&s.start()}function Mf(a){return a.constructor.name==="MessagePort"}function np(a){Mf(a)&&a.close()}function Ji(a,s){return eo(a,[],s)}function sn(a){if(a)throw new Error("Proxy has been released and is not useable")}function ip(a){return Sr(a,{type:"RELEASE"}).then(()=>{np(a)})}const rn=new WeakMap,an="FinalizationRegistry"in globalThis&&new FinalizationRegistry(a=>{const s=(rn.get(a)||0)-1;rn.set(a,s),s===0&&ip(a)});function Pf(a,s){const t=(rn.get(s)||0)+1;rn.set(s,t),an&&an.register(a,s,a)}function Of(a){an&&an.unregister(a)}function eo(a,s=[],t=function(){}){let n=!1;const i=new Proxy(t,{get(l,c){if(sn(n),c===Sf)return()=>{Of(i),ip(a),n=!0};if(c==="then"){if(s.length===0)return{then:()=>i};const p=Sr(a,{type:"GET",path:s.map(u=>u.toString())}).then(cr);return p.then.bind(p)}return eo(a,[...s,c])},set(l,c,p){sn(n);const[u,d]=nn(p);return Sr(a,{type:"SET",path:[...s,c].map(y=>y.toString()),value:u},d).then(cr)},apply(l,c,p){sn(n);const u=s[s.length-1];if(u===Nf)return Sr(a,{type:"ENDPOINT"}).then(cr);if(u==="bind")return eo(a,s.slice(0,-1));const[d,y]=op(p);return Sr(a,{type:"APPLY",path:s.map(g=>g.toString()),argumentList:d},y).then(cr)},construct(l,c){sn(n);const[p,u]=op(c);return Sr(a,{type:"CONSTRUCT",path:s.map(d=>d.toString()),argumentList:p},u).then(cr)}});return Pf(i,a),i}function Rf(a){return Array.prototype.concat.apply([],a)}function op(a){const s=a.map(nn);return[s.map(t=>t[0]),Rf(s.map(t=>t[1]))]}const lp=new WeakMap;function Kf(a,s){return lp.set(a,s),a}function to(a){return Object.assign(a,{[tp]:!0})}function nn(a){for(const[s,t]of rp)if(t.canHandle(a)){const[n,i]=t.serialize(a);return[{type:"HANDLER",name:s,value:n},i]}return[{type:"RAW",value:a},lp.get(a)||[]]}function cr(a){switch(a.type){case"HANDLER":return rp.get(a.name).deserialize(a.value);case"RAW":return a.value}}function Sr(a,s,t){return new Promise(n=>{const i=Uf();a.addEventListener("message",function l(c){!c.data||!c.data.id||c.data.id!==i||(a.removeEventListener("message",l),n(c.data))}),a.start&&a.start(),a.postMessage(Object.assign({id:i},s),t)})}function Uf(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}const cp=new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/scriptsRunWorker-DvjQUdYy.js").href:new URL("assets/scriptsRunWorker-DvjQUdYy.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:Ba&&Ba.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Run MineScript Server"});cp.onerror=a=>{console.error(a)};async function pp(a){return await Za.setInlayHints(a)}const dp=Ji(cp),mp=Ji(new Worker(new URL(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/parserTccWorker-Bpuz4vCT.js").href:new URL("assets/parserTccWorker-Bpuz4vCT.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:Ba&&Ba.src||new URL("trading-vue-editor.umd.packages.mjs",document.baseURI).href),{type:"module",name:"Parser MineScript Server"}));async function up(a,s=!1,t=gs){const n=a.match(/\s*\/\/\s*@version\s*=\s*([0-9])/)?.[1];n&&(t=parseInt(n),t=t<3?3:t>6?6:t);const i=await Ks(t);if(!i)return;const{functions:l,types:c,constants:p,variables:u,methods:d}=i.KEY_MAP_LIST;return await mp.parseTcc(a,s,to(pp),{functions:Object.fromEntries(l),methods:Object.fromEntries(d),types:Object.fromEntries(c),constants:Object.fromEntries(p),variables:Object.fromEntries(u)},t)}async function Hf(a,s){const t=a.match(/\s*\/\/\s*@version\s*=\s*([0-9])/)?.[1];let n=6;t&&(n=parseInt(t),n=n<5?5:n>6?6:n);const i=await Ks(n);if(!i)return;const{functions:l,types:c,constants:p,variables:u,methods:d}=i.KEY_MAP_LIST;return await mp.parseLibraryCode(a,s,to(pp),{functions:Object.fromEntries(l),methods:Object.fromEntries(d),types:Object.fromEntries(c),constants:Object.fromEntries(p),variables:Object.fromEntries(u)},n)}async function $f(a,s,t=!0,n=gs){return await dp.runScript(a,s,t,n)}async function jf(a){return await dp.removeScript(a)}function Gf(a){return new Worker(""+(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__dirname+"/assets/editor.worker-rBPieP89.js").href:new URL("assets/editor.worker-rBPieP89.js",typeof document>"u"?location.href:document.currentScript&&document.currentScript.src||document.baseURI).href),{type:"module",name:a?.name})}const{slice:Wf,forEach:Xf}=[];function Vf(a){return Xf.call(Wf.call(arguments,1),s=>{if(s)for(const t in s)a[t]===void 0&&(a[t]=s[t])}),a}const yp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Yf=(a,s,t)=>{const n=t||{};n.path=n.path||"/";const i=encodeURIComponent(s);let l=`${a}=${i}`;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(!yp.test(n.domain))throw new TypeError("option domain is invalid");l+=`; Domain=${n.domain}`}if(n.path){if(!yp.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},_p={create(a,s,t,n){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};t&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+t*60*1e3)),n&&(i.domain=n),document.cookie=Yf(a,encodeURIComponent(s),i)},read(a){const s=`${a}=`,t=document.cookie.split(";");for(let n=0;n<t.length;n++){let i=t[n];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(s)===0)return i.substring(s.length,i.length)}return null},remove(a){this.create(a,"",-1)}};var Qf={name:"cookie",lookup(a){let{lookupCookie:s}=a;if(s&&typeof document<"u")return _p.read(s)||void 0},cacheUserLanguage(a,s){let{lookupCookie:t,cookieMinutes:n,cookieDomain:i,cookieOptions:l}=s;t&&typeof document<"u"&&_p.create(t,a,n,i,l)}},Zf={name:"querystring",lookup(a){let{lookupQuerystring:s}=a,t;if(typeof window<"u"){let{search:n}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));const l=n.substring(1).split("&");for(let c=0;c<l.length;c++){const p=l[c].indexOf("=");p>0&&l[c].substring(0,p)===s&&(t=l[c].substring(p+1))}}return t}};let ya=null;const fp=()=>{if(ya!==null)return ya;try{ya=window!=="undefined"&&window.localStorage!==null;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{ya=!1}return ya};var Jf={name:"localStorage",lookup(a){let{lookupLocalStorage:s}=a;if(s&&fp())return window.localStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupLocalStorage:t}=s;t&&fp()&&window.localStorage.setItem(t,a)}};let _a=null;const gp=()=>{if(_a!==null)return _a;try{_a=window!=="undefined"&&window.sessionStorage!==null;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{_a=!1}return _a};var eg={name:"sessionStorage",lookup(a){let{lookupSessionStorage:s}=a;if(s&&gp())return window.sessionStorage.getItem(s)||void 0},cacheUserLanguage(a,s){let{lookupSessionStorage:t}=s;t&&gp()&&window.sessionStorage.setItem(t,a)}},tg={name:"navigator",lookup(a){const s=[];if(typeof navigator<"u"){const{languages:t,userLanguage:n,language:i}=navigator;if(t)for(let l=0;l<t.length;l++)s.push(t[l]);n&&s.push(n),i&&s.push(i)}return s.length>0?s:void 0}},sg={name:"htmlTag",lookup(a){let{htmlTag:s}=a,t;const n=s||(typeof document<"u"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(t=n.getAttribute("lang")),t}},rg={name:"path",lookup(a){let{lookupFromPathIndex:s}=a;if(typeof window>"u")return;const t=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(t)?t[typeof s=="number"?s:0]?.replace("/",""):void 0}},ag={name:"subdomain",lookup(a){let{lookupFromSubdomainIndex:s}=a;const t=typeof s=="number"?s+1:1,n=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(n)return n[t]}};function ng(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a}}class xp{constructor(s){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(s,t)}init(s){let t=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=Vf(t,this.options||{},ng()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(Qf),this.addDetector(Zf),this.addDetector(Jf),this.addDetector(eg),this.addDetector(tg),this.addDetector(sg),this.addDetector(rg),this.addDetector(ag)}addDetector(s){return this.detectors[s.name]=s,this}detect(s){s||(s=this.options.order);let t=[];return s.forEach(n=>{if(this.detectors[n]){let i=this.detectors[n].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(t=t.concat(i))}}),t=t.map(n=>this.options.convertDetectedLanguage(n)),this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(s,t){t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(s)>-1||t.forEach(n=>{this.detectors[n]&&this.detectors[n].cacheUserLanguage(s,this.options)}))}}xp.type="languageDetector";const ig=(...a)=>{console?.warn&&(pr(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),console.warn(...a))},bp={},so=(...a)=>{pr(a[0])&&bp[a[0]]||(pr(a[0])&&(bp[a[0]]=new Date),ig(...a))},hp=(a,s)=>()=>{if(a.isInitialized)s();else{const t=()=>{setTimeout(()=>{a.off("initialized",t)},0),s()};a.on("initialized",t)}},ro=(a,s,t)=>{a.loadNamespaces(s,hp(a,t))},wp=(a,s,t,n)=>{if(pr(t)&&(t=[t]),a.options.preload&&a.options.preload.indexOf(s)>-1)return ro(a,t,n);t.forEach(i=>{a.options.ns.indexOf(i)<0&&a.options.ns.push(i)}),a.loadLanguages(s,hp(a,n))},og=(a,s,t={})=>!s.languages||!s.languages.length?(so("i18n.languages were undefined or empty",s.languages),!0):s.hasLoadedNamespace(a,{lng:t.lng,precheck:(n,i)=>{if(t.bindI18n?.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!i(n.isLanguageChangingTo,a))return!1}}),pr=a=>typeof a=="string",lg=a=>typeof a=="object"&&a!==null,cg=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,pg={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},dg=a=>pg[a];let ao={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:a=>a.replace(cg,dg)};const mg=(a={})=>{ao={...ao,...a}},ug=()=>ao;let vp;const yg=a=>{vp=a},_g=()=>vp,fg={type:"3rdParty",init(a){mg(a.options.react),yg(a)}},gg=U.createContext();class xg{constructor(){this.usedNamespaces={}}addUsedNamespaces(s){s.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const bg=(a,s)=>{const t=U.useRef();return U.useEffect(()=>{t.current=s?t.current:a},[a,s]),t.current},Tp=(a,s,t,n)=>a.getFixedT(s,t,n),hg=(a,s,t,n)=>U.useCallback(Tp(a,s,t,n),[a,s,t,n]),Br=(a,s={})=>{const{i18n:t}=s,{i18n:n,defaultNS:i}=U.useContext(gg)||{},l=t||n||_g();if(l&&!l.reportNamespaces&&(l.reportNamespaces=new xg),!l){so("You will need to pass in an i18next instance by using initReactI18next");const T=(q,A)=>pr(A)?A:lg(A)&&pr(A.defaultValue)?A.defaultValue:Array.isArray(q)?q[q.length-1]:q,E=[T,{},!1];return E.t=T,E.i18n={},E.ready=!1,E}l.options.react?.wait&&so("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const c={...ug(),...l.options.react,...s},{useSuspense:p,keyPrefix:u}=c;let d=a||i||l.options?.defaultNS;d=pr(d)?[d]:d||["translation"],l.reportNamespaces.addUsedNamespaces?.(d);const y=(l.isInitialized||l.initializedStoreOnce)&&d.every(T=>og(T,l,c)),g=hg(l,s.lng||null,c.nsMode==="fallback"?d:d[0],u),_=()=>g,h=()=>Tp(l,s.lng||null,c.nsMode==="fallback"?d:d[0],u),[w,I]=U.useState(_);let k=d.join();s.lng&&(k=`${s.lng}${k}`);const z=bg(k),x=U.useRef(!0);U.useEffect(()=>{const{bindI18n:T,bindI18nStore:E}=c;x.current=!0,!y&&!p&&(s.lng?wp(l,s.lng,d,()=>{x.current&&I(h)}):ro(l,d,()=>{x.current&&I(h)})),y&&z&&z!==k&&x.current&&I(h);const q=()=>{x.current&&I(h)};return T&&l?.on(T,q),E&&l?.store.on(E,q),()=>{x.current=!1,l&&T?.split(" ").forEach(A=>l.off(A,q)),E&&l&&E.split(" ").forEach(A=>l.store.off(A,q))}},[l,k]),U.useEffect(()=>{x.current&&y&&I(_)},[l,u,y]);const D=[w,l,y];if(D.t=w,D.i18n=l,D.ready=y,y||!y&&!p)return D;throw new Promise(T=>{s.lng?wp(l,s.lng,d,()=>T()):ro(l,d,()=>T())})},wg={type:"type",syntax:"syntax",overloads:"overloads",arguments:"arguments",fields:"fields",example:"example",returns:"returns",remarks:"remarks","see also":"see also","Copy code":"Copy code","Copy link":"Copy link",Copied:"Copied","Link copied":"Link copied",variables:"Variables",constants:"Constants",functions:"Functions",keywords:"Keywords",types:"Types",operators:"Operators",annotations:"Annotations",search:"Search","Mine Script® v1 Reference Manual":"Mine Script® v{{version}} Reference Manual","This script is read-only. It cannot be edited.":"This script is read-only. It cannot be edited.","save script":"Save script","open script":"Open script","find/replace":"Find/Replace","toggle console":"Toggle console","open editor in new tab":"Open editor in new tab","open editor in new window":"Open editor in new window",keyword:"keyword","built-in function":"built-in function","built-in variable":"built-in variable","built-in method":"built-in method","built-in type":"built-in type",annotation:"annotation","built-in constant":"built-in constant",namespace:"namespace","user-defined variable":"user-defined variable","user-defined type":"user-defined type",field:"field",enum:"enum","user-defined method":"user-defined method","user-defined function":"user-defined function",parameter:"parameter","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Mine functions, variables, and methods.","to trigger parameters hint":"to trigger parameters hint",library:"library","enum member":"enum member",Returns:"Returns",Syntax:"Syntax",Remarks:"Remarks",Fields:"Fields",Description:"Description",Example:"Example","Enum members":"Enum members",statement:"statement",loop:"loop","`click` on keyword for more help":"`click` on keyword for more help","new indicator":"New Indicator","new strategy":"New Strategy"},vg={type:"类型",syntax:"语法",overloads:"重载",arguments:"参数",fields:"字段",example:"例子",returns:"返回值",remarks:"备注","see also":"另见","Copy code":"复制代码","Copy link":"复制链接",Copied:"已复制","Link copied":"链接已复制",variables:"内置变量",constants:"常量",functions:"函数",keywords:"关键词",types:"类型",operators:"运算符",annotations:"注释",search:"搜索","Mine Script® v1 Reference Manual":"Mine Script™ v{{version}} 参考手册","This script is read-only. It cannot be edited.":"该脚本是只读的。它无法被编辑。","save script":"保存脚本","open script":"打开脚本","find/replace":"寻找/替换","toggle console":"切换控制台","open editor in new tab":"在新标签页中打开","open editor in new window":"在新窗口中打开",keyword:"关键词","built-in function":"内置函数","built-in variable":"内置变量","built-in method":"内置方法","built-in type":"内置类型",annotation:"注释","built-in constant":"内置常量",namespace:"命名空间","user-defined variable":"用户自定义变量","user-defined type":"用户自定义类型",field:"字段",enum:"枚举","user-defined method":"用户自定义方法","user-defined function":"用户自定义函数",parameter:"参数","**Namespaces** are immutable terms that act as prefixes for groups of identifiers. A dot and another term always follow a namespace when naming Tcc functions, variables, and methods.":"命名空间是不可变的术语,充当标识符组的前缀。在命名Mine函数、变量和方法时,点和另一个术语始终遵循命名空间。","to trigger parameters hint":"触发参数提示",library:"脚本库","enum member":"枚举成员",Returns:"返回值",Syntax:"语法",Remarks:"备注",Fields:"字段",Description:"描述",Example:"例子","Enum members":"枚举成员",statement:"声明",loop:"循环","`click` on keyword for more help":"“点击”关键词以获得更多帮助","new indicator":"新建指标","new strategy":"新建策略"};He.use(xp).use(fg).init({debug:!1,fallbackLng:"zh",interpolation:{escapeValue:!1},resources:{en:{translation:wg},zh:{translation:vg}}}),self.MonacoEnvironment={getWorker(){return new Gf({name:"Editor Worker"})}},ei.config({paths:{vs:"https://www.tradingvue.com/vs"},"vs/nls":{availableLanguages:{"*":"zh-cn"}}});const Tg=(a,s)=>{const{height:t,width:n,theme:i,options:l,hasDiff:c,readOnly:p,defaultValue:u,language:d,onChange:y,onLinkOpen:g,onCursorPositionChange:_,onActionTrigger:h,onEditorDidMount:w,onVersionChange:I}=a,{t:k,i18n:z}=Br(),x=U.useRef(null),D=U.useRef(null),T=U.useRef(!1),E=U.useRef(!1);U.useImperativeHandle(s,()=>({setOriginalScript(L){x.current?.setOriginalScript(L)},setScript(L){x.current?.setValue(L)},gotoLine(){x.current?.gotoLine()},getEditorLayout(){return x.current?.getEditorLayout()},setPosition(L,j){x.current?.setPosition({column:L,lineNumber:j})},setModelMarkers(L){E.current=!0,x.current?.setModelMarkers(L),setTimeout(()=>{E.current=!1},2e3)},focus(){x.current?.focus()}})),U.useEffect(()=>{c?x.current?.addDiffDecorations():x.current?.removeDiffDecorations()},[c]),U.useEffect(()=>{i&&je.editor.setTheme(i)},[i]),U.useEffect(()=>{d&&z.changeLanguage(d)},[d]),U.useEffect(()=>{x.current?.updateActionTrigger(h)},[h]),U.useEffect(()=>{g&&x.current?.addLinkOpenFunc(g)},[g]);function q(L,j){Za.setEditor(L,j),x.current=new zf(L,j,h),g&&x.current?.addLinkOpenFunc(g),c&&x.current?.addDiffDecorations(),u_(L),requestAnimationFrame(N);const O=L.getValue();x.current.onChangeCursorPosition(_),y&&y(O),!p&&A(O),w&&w()}const A=U.useCallback(async L=>{const j=x.current?.getVersion();I&&I(j||gs),T.current=!1;const{errors:O,functions:ne,methods:Z,types:le,variables:me,overloadsFuncs:Y,imports:ce,enums:ue}=await up(L,!1,j),K=new Map(Object.entries(ne)),ee=new Map(Object.entries(Z)),re=new Map(Object.entries(le)),te=new Map(Object.entries(me)),Ie=new Map(Object.entries(ce)),we=new Map(Object.entries(ue));Us.setUserDefined({functions:K,methods:ee,types:re,variables:te,imports:Ie,enums:we},Y),ns.setUserDefind(K,re,te,ee,we);const $e=O.map(fe=>({...fe,severity:fe.type||je.MarkerSeverity.Error}));p||!T.current&&!E.current&&$e.length&&x.current?.setModelMarkers($e)},[p]),M=U.useMemo(()=>g_.debounce(A,1500),[A]);function H(L){if(p){A(L||"");return}T.current=!0,Za.clearInlayHints(),x.current?.setModelMarkers([]),L!==void 0&&(y&&y(L),M(L))}const N=U.useCallback(()=>{const L=D.current?.getBoundingClientRect();x.current?.setEditorLayout(L?.height||0,L?.width)},[]);return U.useEffect(()=>{const L=()=>{window.requestAnimationFrame(N)},j=new ResizeObserver(L);return D.current&&j.observe(D.current),()=>{D.current&&j.unobserve(D.current),j.disconnect(),x.current?.dispose()}},[]),F.jsx("div",{ref:D,children:F.jsx(Sy,{height:t,width:n||"100%",defaultLanguage:tt,defaultValue:u||`//@version=6
|
|
91
91
|
indicator("我的脚本")
|
|
92
92
|
plot(close)
|
|
93
93
|
`,theme:i||"vs-dark",className:`tvue-script ${i||"vs-dark"}`,options:{colorDecorators:!0,useShadowDOM:!1,matchOnWordStartOnly:!0,automaticLayout:!1,unicodeHighlight:{allowedCharacters:{" ":!0}},suggest:{filterGraceful:!0},stickyScroll:{enabled:!1},fontSize:13,...p?Fy:{},readOnlyMessage:{value:k("This script is read-only. It cannot be edited.")},...l},onMount:q,onChange:H})})},kg=U.forwardRef(Tg),Dg=a=>{const{theme:s,modified:t,original:n,height:i,width:l,renderSideBySide:c=!0,version:p=gs}=a,u=U.useCallback(async(d,y)=>{y.languages.register({id:tt}),y.editor.defineTheme("vs-dark",oi),y.editor.defineTheme("vs",ii);const g=await ja(p);g&&(y.languages.setMonarchTokensProvider(tt,g.LANGUAGE_MONARCH_TOKENS),y.languages.setLanguageConfiguration(tt,g.CONFIGURATION))},[p]);return F.jsx(qy,{height:i||"90vh",width:l||"100%",theme:s||"vs-dark",options:{readOnly:!0,renderSideBySide:c,scrollBeyondLastLine:!1},language:tt,modified:t,original:n,onMount:u})};Q.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"}(Q.VMarkerSeverity||(Q.VMarkerSeverity={}));var on={},Ig=function(){var a=document.getSelection();if(!a.rangeCount)return function(){};for(var s=document.activeElement,t=[],n=0;n<a.rangeCount;n++)t.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||t.forEach(function(i){a.addRange(i)}),s&&s.focus()}},Ag=Ig,kp={"text/plain":"Text","text/html":"Url",default:"Text"},qg="Copy to clipboard: #{key}, Enter";function Cg(a){var s=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return a.replace(/#{\s*key\s*}/g,s)}function Eg(a,s){var t,n,i,l,c,p,u=!1;s||(s={}),t=s.debug||!1;try{i=Ag(),l=document.createRange(),c=document.getSelection(),p=document.createElement("span"),p.textContent=a,p.ariaHidden="true",p.style.all="unset",p.style.position="fixed",p.style.top=0,p.style.clip="rect(0, 0, 0, 0)",p.style.whiteSpace="pre",p.style.webkitUserSelect="text",p.style.MozUserSelect="text",p.style.msUserSelect="text",p.style.userSelect="text",p.addEventListener("copy",function(y){if(y.stopPropagation(),s.format)if(y.preventDefault(),typeof y.clipboardData>"u"){t&&console.warn("unable to use e.clipboardData"),t&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var g=kp[s.format]||kp.default;window.clipboardData.setData(g,a)}else y.clipboardData.clearData(),y.clipboardData.setData(s.format,a);s.onCopy&&(y.preventDefault(),s.onCopy(y.clipboardData))}),document.body.appendChild(p),l.selectNodeContents(p),c.addRange(l);var d=document.execCommand("copy");if(!d)throw new Error("copy command was unsuccessful");u=!0}catch(y){t&&console.error("unable to copy using execCommand: ",y),t&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(s.format||"text",a),s.onCopy&&s.onCopy(window.clipboardData),u=!0}catch(g){t&&console.error("unable to copy using clipboardData: ",g),t&&console.error("falling back to prompt"),n=Cg("message"in s?s.message:qg),window.prompt(n,a)}}finally{c&&(typeof c.removeRange=="function"?c.removeRange(l):c.removeAllRanges()),p&&document.body.removeChild(p),i()}return u}var zg=Eg;function no(a){"@babel/helpers - typeof";return no=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},no(a)}Object.defineProperty(on,"__esModule",{value:!0}),on.CopyToClipboard=void 0;var ln=Dp(U),Ng=Dp(zg),Sg=["text","onCopy","options","children"];function Dp(a){return a&&a.__esModule?a:{default:a}}function Ip(a,s){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);s&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(a,i).enumerable})),t.push.apply(t,n)}return t}function Ap(a){for(var s=1;s<arguments.length;s++){var t=arguments[s]!=null?arguments[s]:{};s%2?Ip(Object(t),!0).forEach(function(n){oo(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):Ip(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function Bg(a,s){if(a==null)return{};var t=Fg(a,s),n,i;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(a);for(i=0;i<l.length;i++)n=l[i],!(s.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(a,n)&&(t[n]=a[n])}return t}function Fg(a,s){if(a==null)return{};var t={},n=Object.keys(a),i,l;for(l=0;l<n.length;l++)i=n[l],!(s.indexOf(i)>=0)&&(t[i]=a[i]);return t}function Lg(a,s){if(!(a instanceof s))throw new TypeError("Cannot call a class as a function")}function qp(a,s){for(var t=0;t<s.length;t++){var n=s[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(a,n.key,n)}}function Mg(a,s,t){return s&&qp(a.prototype,s),t&&qp(a,t),Object.defineProperty(a,"prototype",{writable:!1}),a}function Pg(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&&io(a,s)}function io(a,s){return io=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},io(a,s)}function Og(a){var s=Kg();return function(){var n=cn(a),i;if(s){var l=cn(this).constructor;i=Reflect.construct(n,arguments,l)}else i=n.apply(this,arguments);return Rg(this,i)}}function Rg(a,s){if(s&&(no(s)==="object"||typeof s=="function"))return s;if(s!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Cp(a)}function Cp(a){if(a===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return a}function Kg(){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 cn(a){return cn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},cn(a)}function oo(a,s,t){return s in a?Object.defineProperty(a,s,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[s]=t,a}var Ep=function(a){Pg(t,a);var s=Og(t);function t(){var n;Lg(this,t);for(var i=arguments.length,l=new Array(i),c=0;c<i;c++)l[c]=arguments[c];return n=s.call.apply(s,[this].concat(l)),oo(Cp(n),"onClick",function(p){var u=n.props,d=u.text,y=u.onCopy,g=u.children,_=u.options,h=ln.default.Children.only(g),w=(0,Ng.default)(d,_);y&&y(d,w),h&&h.props&&typeof h.props.onClick=="function"&&h.props.onClick(p)}),n}return Mg(t,[{key:"render",value:function(){var i=this.props;i.text,i.onCopy,i.options;var l=i.children,c=Bg(i,Sg),p=ln.default.Children.only(l);return ln.default.cloneElement(p,Ap(Ap({},c),{},{onClick:this.onClick}))}}]),t}(ln.default.PureComponent);on.CopyToClipboard=Ep,oo(Ep,"defaultProps",{onCopy:void 0,options:void 0});var Ug=on,lo=Ug.CopyToClipboard;lo.CopyToClipboard=lo;var Hg=lo;const Fr=wu(Hg);je.languages.register({id:tt}),je.editor.defineTheme("vs-dark",oi),je.editor.defineTheme("vs",ii);const zp=[{label:"版本 v3",version:3},{label:"版本 v4",version:4},{label:"版本 v5",version:5},{label:"版本 v6",version:6}];async function co(a){const s=await ja(a);s&&(je.languages.setMonarchTokensProvider(tt,s.LANGUAGE_MONARCH_TOKENS),je.languages.setLanguageConfiguration(tt,s.CONFIGURATION))}async function Np(a,s,t){return s&&je.editor.setTheme(s.includes("dark")?"vs-dark":"light"),t&&await co(t),await je.editor.colorize(a,tt,{tabSize:4})}async function po(a,s=0){const t=a[s];if(!t)return;const{name:n,args:i,type:l,desc:c,examples:p,remarks:u,seeAlso:d,syntax:y,detailedDesc:g,fields:_,returns:h}=t,w={name:n,orirginalName:n};if(a.length>1&&(w.overloads=`${a.length} ${He.t("overloads")}`),l&&(w.type=l),i&&(w.name=`${n}()`,w.args=i.map(I=>{const{name:k,desc:z,displayType:x}=I;return{label:`${k} (${x})`,desc:z&&dr(z)}})),c&&(w.desc=c.map(I=>dr(I))),p&&(w.originalExample=p.join(`
|