@guihz/trading-vue-editor-tes 0.0.142 → 0.0.143

Sign up to get free protection for your applications and to get access to all the features.
@@ -73,7 +73,7 @@ ${Bf}`)}function ay(s,e,t){return(s>=0&&t?` ${Nf(s,e-1)}`:Nf(s,e)).padEnd(e)}fun
73
73
  * derived from CryptoJS.mode.CTR
74
74
  * Jan Hruby jhruby.web@gmail.com
75
75
  */return t.mode.CTRGladman=function(){var r=t.lib.BlockCipherMode.extend();function n(u){if((u>>24&255)===255){var f=u>>16&255,c=u>>8&255,h=u&255;f===255?(f=0,c===255?(c=0,h===255?h=0:++h):++c):++f,u=0,u+=f<<16,u+=c<<8,u+=h}else u+=1<<24;return u}function i(u){return(u[0]=n(u[0]))===0&&(u[1]=n(u[1])),u}var a=r.Encryptor=r.extend({processBlock:function(u,f){var c=this._cipher,h=c.blockSize,d=this._iv,p=this._counter;d&&(p=this._counter=d.slice(0),this._iv=void 0),i(p);var v=p.slice(0);c.encryptBlock(v,0);for(var x=0;x<h;x++)u[f+x]^=v[x]}});return r.Decryptor=a,r}(),t.mode.CTRGladman})}(Bu)),Bu.exports}var Mu={exports:{}},xh;function ZD(){return xh||(xh=1,function(s,e){(function(t,r,n){s.exports=r(Ve(),Yt())})(ye,function(t){return t.mode.OFB=function(){var r=t.lib.BlockCipherMode.extend(),n=r.Encryptor=r.extend({processBlock:function(i,a){var u=this._cipher,f=u.blockSize,c=this._iv,h=this._keystream;c&&(h=this._keystream=c.slice(0),this._iv=void 0),u.encryptBlock(h,0);for(var d=0;d<f;d++)i[a+d]^=h[d]}});return r.Decryptor=n,r}(),t.mode.OFB})}(Mu)),Mu.exports}var Nu={exports:{}},yh;function VD(){return yh||(yh=1,function(s,e){(function(t,r,n){s.exports=r(Ve(),Yt())})(ye,function(t){return t.mode.ECB=function(){var r=t.lib.BlockCipherMode.extend();return r.Encryptor=r.extend({processBlock:function(n,i){this._cipher.encryptBlock(n,i)}}),r.Decryptor=r.extend({processBlock:function(n,i){this._cipher.decryptBlock(n,i)}}),r}(),t.mode.ECB})}(Nu)),Nu.exports}var Su={exports:{}},Dh;function GD(){return Dh||(Dh=1,function(s,e){(function(t,r,n){s.exports=r(Ve(),Yt())})(ye,function(t){return t.pad.AnsiX923={pad:function(r,n){var i=r.sigBytes,a=n*4,u=a-i%a,f=i+u-1;r.clamp(),r.words[f>>>2]|=u<<24-f%4*8,r.sigBytes+=u},unpad:function(r){var n=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=n}},t.pad.Ansix923})}(Su)),Su.exports}var Ou={exports:{}},wh;function XD(){return wh||(wh=1,function(s,e){(function(t,r,n){s.exports=r(Ve(),Yt())})(ye,function(t){return t.pad.Iso10126={pad:function(r,n){var i=n*4,a=i-r.sigBytes%i;r.concat(t.lib.WordArray.random(a-1)).concat(t.lib.WordArray.create([a<<24],1))},unpad:function(r){var n=r.words[r.sigBytes-1>>>2]&255;r.sigBytes-=n}},t.pad.Iso10126})}(Ou)),Ou.exports}var Iu={exports:{}},bh;function QD(){return bh||(bh=1,function(s,e){(function(t,r,n){s.exports=r(Ve(),Yt())})(ye,function(t){return t.pad.Iso97971={pad:function(r,n){r.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(r,n)},unpad:function(r){t.pad.ZeroPadding.unpad(r),r.sigBytes--}},t.pad.Iso97971})}(Iu)),Iu.exports}var Tu={exports:{}},Eh;function JD(){return Eh||(Eh=1,function(s,e){(function(t,r,n){s.exports=r(Ve(),Yt())})(ye,function(t){return t.pad.ZeroPadding={pad:function(r,n){var i=n*4;r.clamp(),r.sigBytes+=i-(r.sigBytes%i||i)},unpad:function(r){for(var n=r.words,i=r.sigBytes-1,i=r.sigBytes-1;i>=0;i--)if(n[i>>>2]>>>24-i%4*8&255){r.sigBytes=i+1;break}}},t.pad.ZeroPadding})}(Tu)),Tu.exports}var $u={exports:{}},Ch;function ew(){return Ch||(Ch=1,function(s,e){(function(t,r,n){s.exports=r(Ve(),Yt())})(ye,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}($u)),$u.exports}var Lu={exports:{}},Ah;function tw(){return Ah||(Ah=1,function(s,e){(function(t,r,n){s.exports=r(Ve(),Yt())})(ye,function(t){return function(r){var n=t,i=n.lib,a=i.CipherParams,u=n.enc,f=u.Hex,c=n.format;c.Hex={stringify:function(h){return h.ciphertext.toString(f)},parse:function(h){var d=f.parse(h);return a.create({ciphertext:d})}}}(),t.format.Hex})}(Lu)),Lu.exports}var Ru={exports:{}},Fh;function rw(){return Fh||(Fh=1,function(s,e){(function(t,r,n){s.exports=r(Ve(),oi(),ai(),zn(),Yt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.BlockCipher,a=r.algo,u=[],f=[],c=[],h=[],d=[],p=[],v=[],x=[],_=[],y=[];(function(){for(var D=[],C=0;C<256;C++)C<128?D[C]=C<<1:D[C]=C<<1^283;for(var b=0,F=0,C=0;C<256;C++){var B=F^F<<1^F<<2^F<<3^F<<4;B=B>>>8^B&255^99,u[b]=B,f[B]=b;var M=D[b],O=D[M],A=D[O],N=D[B]*257^B*16843008;c[b]=N<<24|N>>>8,h[b]=N<<16|N>>>16,d[b]=N<<8|N>>>24,p[b]=N;var N=A*16843009^O*65537^M*257^b*16843008;v[B]=N<<24|N>>>8,x[B]=N<<16|N>>>16,_[B]=N<<8|N>>>24,y[B]=N,b?(b=M^D[D[D[A^M]]],F^=D[D[F]]):b=F=1}})();var m=[0,1,2,4,8,16,32,64,128,27,54],w=a.AES=i.extend({_doReset:function(){var D;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var C=this._keyPriorReset=this._key,b=C.words,F=C.sigBytes/4,B=this._nRounds=F+6,M=(B+1)*4,O=this._keySchedule=[],A=0;A<M;A++)A<F?O[A]=b[A]:(D=O[A-1],A%F?F>6&&A%F==4&&(D=u[D>>>24]<<24|u[D>>>16&255]<<16|u[D>>>8&255]<<8|u[D&255]):(D=D<<8|D>>>24,D=u[D>>>24]<<24|u[D>>>16&255]<<16|u[D>>>8&255]<<8|u[D&255],D^=m[A/F|0]<<24),O[A]=O[A-F]^D);for(var N=this._invKeySchedule=[],I=0;I<M;I++){var A=M-I;if(I%4)var D=O[A];else var D=O[A-4];I<4||A<=4?N[I]=D:N[I]=v[u[D>>>24]]^x[u[D>>>16&255]]^_[u[D>>>8&255]]^y[u[D&255]]}}},encryptBlock:function(D,C){this._doCryptBlock(D,C,this._keySchedule,c,h,d,p,u)},decryptBlock:function(D,C){var b=D[C+1];D[C+1]=D[C+3],D[C+3]=b,this._doCryptBlock(D,C,this._invKeySchedule,v,x,_,y,f);var b=D[C+1];D[C+1]=D[C+3],D[C+3]=b},_doCryptBlock:function(D,C,b,F,B,M,O,A){for(var N=this._nRounds,I=D[C]^b[0],L=D[C+1]^b[1],k=D[C+2]^b[2],z=D[C+3]^b[3],R=4,V=1;V<N;V++){var H=F[I>>>24]^B[L>>>16&255]^M[k>>>8&255]^O[z&255]^b[R++],ee=F[L>>>24]^B[k>>>16&255]^M[z>>>8&255]^O[I&255]^b[R++],te=F[k>>>24]^B[z>>>16&255]^M[I>>>8&255]^O[L&255]^b[R++],j=F[z>>>24]^B[I>>>16&255]^M[L>>>8&255]^O[k&255]^b[R++];I=H,L=ee,k=te,z=j}var H=(A[I>>>24]<<24|A[L>>>16&255]<<16|A[k>>>8&255]<<8|A[z&255])^b[R++],ee=(A[L>>>24]<<24|A[k>>>16&255]<<16|A[z>>>8&255]<<8|A[I&255])^b[R++],te=(A[k>>>24]<<24|A[z>>>16&255]<<16|A[I>>>8&255]<<8|A[L&255])^b[R++],j=(A[z>>>24]<<24|A[I>>>16&255]<<16|A[L>>>8&255]<<8|A[k&255])^b[R++];D[C]=H,D[C+1]=ee,D[C+2]=te,D[C+3]=j},keySize:256/32});r.AES=i._createHelper(w)}(),t.AES})}(Ru)),Ru.exports}var Pu={exports:{}},Bh;function nw(){return Bh||(Bh=1,function(s,e){(function(t,r,n){s.exports=r(Ve(),oi(),ai(),zn(),Yt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.WordArray,a=n.BlockCipher,u=r.algo,f=[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],c=[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],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[{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}],p=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],v=u.DES=a.extend({_doReset:function(){for(var m=this._key,w=m.words,D=[],C=0;C<56;C++){var b=f[C]-1;D[C]=w[b>>>5]>>>31-b%32&1}for(var F=this._subKeys=[],B=0;B<16;B++){for(var M=F[B]=[],O=h[B],C=0;C<24;C++)M[C/6|0]|=D[(c[C]-1+O)%28]<<31-C%6,M[4+(C/6|0)]|=D[28+(c[C+24]-1+O)%28]<<31-C%6;M[0]=M[0]<<1|M[0]>>>31;for(var C=1;C<7;C++)M[C]=M[C]>>>(C-1)*4+3;M[7]=M[7]<<5|M[7]>>>27}for(var A=this._invSubKeys=[],C=0;C<16;C++)A[C]=F[15-C]},encryptBlock:function(m,w){this._doCryptBlock(m,w,this._subKeys)},decryptBlock:function(m,w){this._doCryptBlock(m,w,this._invSubKeys)},_doCryptBlock:function(m,w,D){this._lBlock=m[w],this._rBlock=m[w+1],x.call(this,4,252645135),x.call(this,16,65535),_.call(this,2,858993459),_.call(this,8,16711935),x.call(this,1,1431655765);for(var C=0;C<16;C++){for(var b=D[C],F=this._lBlock,B=this._rBlock,M=0,O=0;O<8;O++)M|=d[O][((B^b[O])&p[O])>>>0];this._lBlock=B,this._rBlock=F^M}var A=this._lBlock;this._lBlock=this._rBlock,this._rBlock=A,x.call(this,1,1431655765),_.call(this,8,16711935),_.call(this,2,858993459),x.call(this,16,65535),x.call(this,4,252645135),m[w]=this._lBlock,m[w+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function x(m,w){var D=(this._lBlock>>>m^this._rBlock)&w;this._rBlock^=D,this._lBlock^=D<<m}function _(m,w){var D=(this._rBlock>>>m^this._lBlock)&w;this._lBlock^=D,this._rBlock^=D<<m}r.DES=a._createHelper(v);var y=u.TripleDES=a.extend({_doReset:function(){var m=this._key,w=m.words;if(w.length!==2&&w.length!==4&&w.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var D=w.slice(0,2),C=w.length<4?w.slice(0,2):w.slice(2,4),b=w.length<6?w.slice(0,2):w.slice(4,6);this._des1=v.createEncryptor(i.create(D)),this._des2=v.createEncryptor(i.create(C)),this._des3=v.createEncryptor(i.create(b))},encryptBlock:function(m,w){this._des1.encryptBlock(m,w),this._des2.decryptBlock(m,w),this._des3.encryptBlock(m,w)},decryptBlock:function(m,w){this._des3.decryptBlock(m,w),this._des2.encryptBlock(m,w),this._des1.decryptBlock(m,w)},keySize:192/32,ivSize:64/32,blockSize:64/32});r.TripleDES=a._createHelper(y)}(),t.TripleDES})}(Pu)),Pu.exports}var ku={exports:{}},Mh;function iw(){return Mh||(Mh=1,function(s,e){(function(t,r,n){s.exports=r(Ve(),oi(),ai(),zn(),Yt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.StreamCipher,a=r.algo,u=a.RC4=i.extend({_doReset:function(){for(var h=this._key,d=h.words,p=h.sigBytes,v=this._S=[],x=0;x<256;x++)v[x]=x;for(var x=0,_=0;x<256;x++){var y=x%p,m=d[y>>>2]>>>24-y%4*8&255;_=(_+v[x]+m)%256;var w=v[x];v[x]=v[_],v[_]=w}this._i=this._j=0},_doProcessBlock:function(h,d){h[d]^=f.call(this)},keySize:256/32,ivSize:0});function f(){for(var h=this._S,d=this._i,p=this._j,v=0,x=0;x<4;x++){d=(d+1)%256,p=(p+h[d])%256;var _=h[d];h[d]=h[p],h[p]=_,v|=h[(h[d]+h[p])%256]<<24-x*8}return this._i=d,this._j=p,v}r.RC4=i._createHelper(u);var c=a.RC4Drop=u.extend({cfg:u.cfg.extend({drop:192}),_doReset:function(){u._doReset.call(this);for(var h=this.cfg.drop;h>0;h--)f.call(this)}});r.RC4Drop=i._createHelper(c)}(),t.RC4})}(ku)),ku.exports}var zu={exports:{}},Nh;function sw(){return Nh||(Nh=1,function(s,e){(function(t,r,n){s.exports=r(Ve(),oi(),ai(),zn(),Yt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.StreamCipher,a=r.algo,u=[],f=[],c=[],h=a.Rabbit=i.extend({_doReset:function(){for(var p=this._key.words,v=this.cfg.iv,x=0;x<4;x++)p[x]=(p[x]<<8|p[x]>>>24)&16711935|(p[x]<<24|p[x]>>>8)&4278255360;var _=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],y=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var x=0;x<4;x++)d.call(this);for(var x=0;x<8;x++)y[x]^=_[x+4&7];if(v){var m=v.words,w=m[0],D=m[1],C=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,b=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,F=C>>>16|b&4294901760,B=b<<16|C&65535;y[0]^=C,y[1]^=F,y[2]^=b,y[3]^=B,y[4]^=C,y[5]^=F,y[6]^=b,y[7]^=B;for(var x=0;x<4;x++)d.call(this)}},_doProcessBlock:function(p,v){var x=this._X;d.call(this),u[0]=x[0]^x[5]>>>16^x[3]<<16,u[1]=x[2]^x[7]>>>16^x[5]<<16,u[2]=x[4]^x[1]>>>16^x[7]<<16,u[3]=x[6]^x[3]>>>16^x[1]<<16;for(var _=0;_<4;_++)u[_]=(u[_]<<8|u[_]>>>24)&16711935|(u[_]<<24|u[_]>>>8)&4278255360,p[v+_]^=u[_]},blockSize:128/32,ivSize:64/32});function d(){for(var p=this._X,v=this._C,x=0;x<8;x++)f[x]=v[x];v[0]=v[0]+1295307597+this._b|0,v[1]=v[1]+3545052371+(v[0]>>>0<f[0]>>>0?1:0)|0,v[2]=v[2]+886263092+(v[1]>>>0<f[1]>>>0?1:0)|0,v[3]=v[3]+1295307597+(v[2]>>>0<f[2]>>>0?1:0)|0,v[4]=v[4]+3545052371+(v[3]>>>0<f[3]>>>0?1:0)|0,v[5]=v[5]+886263092+(v[4]>>>0<f[4]>>>0?1:0)|0,v[6]=v[6]+1295307597+(v[5]>>>0<f[5]>>>0?1:0)|0,v[7]=v[7]+3545052371+(v[6]>>>0<f[6]>>>0?1:0)|0,this._b=v[7]>>>0<f[7]>>>0?1:0;for(var x=0;x<8;x++){var _=p[x]+v[x],y=_&65535,m=_>>>16,w=((y*y>>>17)+y*m>>>15)+m*m,D=((_&4294901760)*_|0)+((_&65535)*_|0);c[x]=w^D}p[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,p[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,p[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,p[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,p[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,p[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,p[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,p[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}r.Rabbit=i._createHelper(h)}(),t.Rabbit})}(zu)),zu.exports}var qu={exports:{}},Sh;function ow(){return Sh||(Sh=1,function(s,e){(function(t,r,n){s.exports=r(Ve(),oi(),ai(),zn(),Yt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.StreamCipher,a=r.algo,u=[],f=[],c=[],h=a.RabbitLegacy=i.extend({_doReset:function(){var p=this._key.words,v=this.cfg.iv,x=this._X=[p[0],p[3]<<16|p[2]>>>16,p[1],p[0]<<16|p[3]>>>16,p[2],p[1]<<16|p[0]>>>16,p[3],p[2]<<16|p[1]>>>16],_=this._C=[p[2]<<16|p[2]>>>16,p[0]&4294901760|p[1]&65535,p[3]<<16|p[3]>>>16,p[1]&4294901760|p[2]&65535,p[0]<<16|p[0]>>>16,p[2]&4294901760|p[3]&65535,p[1]<<16|p[1]>>>16,p[3]&4294901760|p[0]&65535];this._b=0;for(var y=0;y<4;y++)d.call(this);for(var y=0;y<8;y++)_[y]^=x[y+4&7];if(v){var m=v.words,w=m[0],D=m[1],C=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360,b=(D<<8|D>>>24)&16711935|(D<<24|D>>>8)&4278255360,F=C>>>16|b&4294901760,B=b<<16|C&65535;_[0]^=C,_[1]^=F,_[2]^=b,_[3]^=B,_[4]^=C,_[5]^=F,_[6]^=b,_[7]^=B;for(var y=0;y<4;y++)d.call(this)}},_doProcessBlock:function(p,v){var x=this._X;d.call(this),u[0]=x[0]^x[5]>>>16^x[3]<<16,u[1]=x[2]^x[7]>>>16^x[5]<<16,u[2]=x[4]^x[1]>>>16^x[7]<<16,u[3]=x[6]^x[3]>>>16^x[1]<<16;for(var _=0;_<4;_++)u[_]=(u[_]<<8|u[_]>>>24)&16711935|(u[_]<<24|u[_]>>>8)&4278255360,p[v+_]^=u[_]},blockSize:128/32,ivSize:64/32});function d(){for(var p=this._X,v=this._C,x=0;x<8;x++)f[x]=v[x];v[0]=v[0]+1295307597+this._b|0,v[1]=v[1]+3545052371+(v[0]>>>0<f[0]>>>0?1:0)|0,v[2]=v[2]+886263092+(v[1]>>>0<f[1]>>>0?1:0)|0,v[3]=v[3]+1295307597+(v[2]>>>0<f[2]>>>0?1:0)|0,v[4]=v[4]+3545052371+(v[3]>>>0<f[3]>>>0?1:0)|0,v[5]=v[5]+886263092+(v[4]>>>0<f[4]>>>0?1:0)|0,v[6]=v[6]+1295307597+(v[5]>>>0<f[5]>>>0?1:0)|0,v[7]=v[7]+3545052371+(v[6]>>>0<f[6]>>>0?1:0)|0,this._b=v[7]>>>0<f[7]>>>0?1:0;for(var x=0;x<8;x++){var _=p[x]+v[x],y=_&65535,m=_>>>16,w=((y*y>>>17)+y*m>>>15)+m*m,D=((_&4294901760)*_|0)+((_&65535)*_|0);c[x]=w^D}p[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,p[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,p[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,p[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,p[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,p[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,p[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,p[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}r.RabbitLegacy=i._createHelper(h)}(),t.RabbitLegacy})}(qu)),qu.exports}var Uu={exports:{}},Oh;function aw(){return Oh||(Oh=1,function(s,e){(function(t,r,n){s.exports=r(Ve(),oi(),ai(),zn(),Yt())})(ye,function(t){return function(){var r=t,n=r.lib,i=n.BlockCipher,a=r.algo;const u=16,f=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],c=[[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 h={pbox:[],sbox:[]};function d(y,m){let w=m>>24&255,D=m>>16&255,C=m>>8&255,b=m&255,F=y.sbox[0][w]+y.sbox[1][D];return F=F^y.sbox[2][C],F=F+y.sbox[3][b],F}function p(y,m,w){let D=m,C=w,b;for(let F=0;F<u;++F)D=D^y.pbox[F],C=d(y,D)^C,b=D,D=C,C=b;return b=D,D=C,C=b,C=C^y.pbox[u],D=D^y.pbox[u+1],{left:D,right:C}}function v(y,m,w){let D=m,C=w,b;for(let F=u+1;F>1;--F)D=D^y.pbox[F],C=d(y,D)^C,b=D,D=C,C=b;return b=D,D=C,C=b,C=C^y.pbox[1],D=D^y.pbox[0],{left:D,right:C}}function x(y,m,w){for(let B=0;B<4;B++){y.sbox[B]=[];for(let M=0;M<256;M++)y.sbox[B][M]=c[B][M]}let D=0;for(let B=0;B<u+2;B++)y.pbox[B]=f[B]^m[D],D++,D>=w&&(D=0);let C=0,b=0,F=0;for(let B=0;B<u+2;B+=2)F=p(y,C,b),C=F.left,b=F.right,y.pbox[B]=C,y.pbox[B+1]=b;for(let B=0;B<4;B++)for(let M=0;M<256;M+=2)F=p(y,C,b),C=F.left,b=F.right,y.sbox[B][M]=C,y.sbox[B][M+1]=b;return!0}var _=a.Blowfish=i.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var y=this._keyPriorReset=this._key,m=y.words,w=y.sigBytes/4;x(h,m,w)}},encryptBlock:function(y,m){var w=p(h,y[m],y[m+1]);y[m]=w.left,y[m+1]=w.right},decryptBlock:function(y,m){var w=v(h,y[m],y[m+1]);y[m]=w.left,y[m+1]=w.right},blockSize:64/32,keySize:128/32,ivSize:64/32});r.Blowfish=i._createHelper(_)}(),t.Blowfish})}(Uu)),Uu.exports}(function(s,e){(function(t,r,n){s.exports=r(Ve(),Mo(),RD(),PD(),oi(),kD(),ai(),ih(),_u(),zD(),uh(),qD(),UD(),WD(),wu(),HD(),zn(),Yt(),jD(),YD(),KD(),ZD(),VD(),GD(),XD(),QD(),JD(),ew(),tw(),rw(),nw(),iw(),sw(),ow(),aw())})(ye,function(t){return t})})(Vf);var No=Vf.exports;class uw{constructor(e,t){q(this,"_variables");q(this,"_scriptId");this._variables=e,this._scriptId=t}security(e,t){var C;const r=self.workerStorage.get(`request_${this._scriptId}`);let{expression:n,paramsExpr:i=[],symbol:a,timeframe:u}=e;const f=self.workerStorage.get(`request_${this._scriptId}_data`),c=`${a}--${u}`;let h;if(f!=null&&f.has(c)?h=(C=f.get(c))==null?void 0:C[this._variables.bar_index]:f==null||f.set(c,null),r!=null&&r.has(t)){const b=r.get(t);return this._runScripts(b,t,!0,i,h)}let d=[],p=1;n=No.AES.decrypt(n,"1234").toString(No.enc.Utf8);const v=JSON.parse(n),x=v.pop();let _=(x==null?void 0:x.depends)||[];if(!_.length)return this._runScripts((x==null?void 0:x.code)||"",t,!0,i);let y=[],m=[];if(this._getDependCodes(_,v,d,y,m),m.length){const b=i.length;let F=[];for(let B=b-1;B>=0;B--){const M=i[B];let O=JSON.parse(No.AES.decrypt(M,"1234").toString(No.enc.Utf8));const A=[];p!==0&&F.unshift("{"),p++,O=O.map(I=>{const{scope:L,code:k,varNames:z,dependSelf:R}=I;return L===2&&!A.includes(z)&&!R&&(I.code=`let ${k}`),z&&A.push(...z.split(", ")),I});let N=m.map(I=>({...I,isArg:!1,isPreArg:!0}));m=[],this._getDependCodes(N,O,F,y,m),d=F.concat(d),F=[]}}for(d.push(`return ${x==null?void 0:x.code}`);p>1;)d.push("}"),p--;d=y.concat(d);const w=d.join(`
76
- `),D=this._runScripts(w,t,!0,i,h);return r==null||r.set(t,w),D}_getDependCodes(e,t,r,n,i){for(const a of e){if(!a.isArg){const u=t.filter(c=>{var h;return(h=c==null?void 0:c.depends)==null?void 0:h.some(d=>d.name===a.name&&d.scope===a.scope&&d.isAgainAssign)});for(const c of u){const{code:h,depends:d}=c;r.includes(h)||(r.unshift(h),d!=null&&d.length&&this._getDependCodes(d,t,r,n,i))}const f=t.find(c=>{var h;return((h=c.varNames)==null?void 0:h.split(", ").includes(a.name))&&(!a.isPreArg||a.isPreArg&&c.methodName===a.functionName)||c.funcName===a.name});if(f){const{code:c,depends:h}=f,d=r.findIndex(p=>p===c);d!==-1&&r.splice(d,1),r.unshift(c),h!=null&&h.length&&this._getDependCodes(h,t,r,n,i);continue}}i.some(u=>u.name===a.name)||i.push(a)}}_runScripts(e,t,r,n,i){const a=`${this._scriptId}_${t}`;let{builtInGather:u,buildinConstants:f,buildInFunctions:c,tradingvueFunc:h}=self.workerStorage.get(a)||{};return r&&(u=new Ih(a),f=new Wf,c=new Zf(this._variables.mintick||1e-4,u,this._scriptId),h=new Function("$_var","$_const","$_func","$paramsExpr","$posStr",e),self.workerStorage.set(a,{builtInGather:u,buildinConstants:f,buildInFunctions:c,tradingvueFunc:h})),h(u,f,c,n||[],t)}}let lw=class{constructor(){}prefix(e){var r;const{symbol:t}=e;return((r=t==null?void 0:t.split("."))==null?void 0:r[0])||""}ticker(e){var r;const{symbol:t}=e;return((r=t==null?void 0:t.split("."))==null?void 0:r[1])||""}};class cw{constructor(e){q(this,"_logs");q(this,"_variables");q(this,"_intlFormat");this._variables=e,this._logs=[],this._intlFormat=new Intl.NumberFormat("en-US")}get logs(){return this._logs}clearLogs(){this._logs=[]}info(e,t,r){this._addLog(e,t,"info",r)}error(e,t,r){this._addLog(e,t,"error",r)}warning(e,t,r){this._addLog(e,t,"warning",r)}_addLog(e,t,r,n){if(typeof t=="string"&&(n=t),n.startsWith("export"))return;const{message:i,formatString:a}=e,{time:u,bar_index:f}=this._variables;let c=i;a&&Array.isArray(t)&&t.length&&(c=a.replace(/{(\d+)}/g,(h,d)=>{let p=t[d];return typeof p=="number"&&(p=this._intlFormat.format(parseFloat(p.toFixed(3)))),p!==void 0?p:h})),c&&this._logs.push({message:`[${ot(u).format()}]: ${c}`,time:u,barIndex:f,type:r})}}class fw{constructor(e){q(this,"_errorListener");this._errorListener=e}error({message:e},t){t.startsWith("export")||this._errorListener.addError(e,t,Ze.Error)}}class hw{constructor(){q(this,"_errors");this._errors=new Map}clear(){this._errors.clear()}get errors(){return Yr.flatMap([...this._errors.values()])}addError(e,t,r,n=0){const[i,a]=t.split("_").slice(-2),u=this._errors.get(t),f={message:e,endLineNumber:Number(i),startColumn:Number(a)+1,endColumn:Number(a)+n+1,startLineNumber:Number(i),type:r};u?u.push(f):this._errors.set(t,[f])}}class dw{constructor(){q(this,"_isMarketOpen");q(this,"_currentBarIndex");q(this,"_totalBarIndex");q(this,"_isRealTimeBar");q(this,"_preBarIndex");this._currentBarIndex=0,this._totalBarIndex=0,this._isRealTimeBar=!1,this._preBarIndex=0,this._isMarketOpen=!0}update(e,t,r,n){this._preBarIndex=this._currentBarIndex,this._currentBarIndex=e,this._totalBarIndex=t,this._isRealTimeBar=r,this._isMarketOpen=n}get isnew(){return!this._isRealTimeBar||this._preBarIndex!==this._currentBarIndex}get islast(){return this._currentBarIndex===this._totalBarIndex}get isfirst(){return this._currentBarIndex===0}get ishistory(){return!this._isRealTimeBar}get isrealtime(){return this._isRealTimeBar}get isconfirmed(){return!this._isRealTimeBar}get islastconfirmedhistory(){return this._isMarketOpen?this._currentBarIndex===this._totalBarIndex-1:this._currentBarIndex===this._totalBarIndex}}class pw{constructor(e){q(this,"_variables");this._variables=e}get isfirstbar(){return this._variables.timeframe.isdwm?!0:this._variables.time===this._variables.time_tradingday}get isfirstbar_regular(){return this._variables.timeframe.isdwm?!0:this._variables.time===this._variables.time_tradingday}get islastbar(){if(this._variables.timeframe.isdwm)return!0;const e=pn(this._variables.timeframe.period);return this._variables.time+e===this._variables.time_tradingday+24*60*60*1e3}get islastbar_regular(){if(this._variables.timeframe.isdwm)return!0;const e=pn(this._variables.timeframe.period);return this._variables.time+e===this._variables.time_tradingday+24*60*60*1e3}get ismarket(){return!0}get ispostmarket(){return!1}get ispremarket(){return!1}}class _w{constructor(e){q(this,"_orders");q(this,"_historyOrders");q(this,"_options");q(this,"_max_contracts_held_all",0);q(this,"_max_contracts_held_long",0);q(this,"_max_contracts_held_short",0);q(this,"_max_drawdown",0);q(this,"_max_runup",0);q(this,"_max_runup_percent",0);q(this,"_max_drawdown_percent",0);q(this,"_variables");q(this,"_netprofit",0);q(this,"_eventrades",0);q(this,"_avg_trade_percent");q(this,"_closedtrades",0);q(this,"_losstrades",0);q(this,"_grossloss",0);q(this,"_grossloss_percent",0);q(this,"_grossprofit",0);q(this,"_grossprofit_percent",0);q(this,"_wintrades",0);q(this,"_opentrades_capital_held",0);q(this,"_position_avg_price",0);q(this,"_position_size",0);this._orders=[],this._historyOrders=[],this._variables=e}update(){this._calcMaxDrawdownAndMaxRunup()}_calcMaxDrawdownAndMaxRunup(){let e=0,t=0;const{high:r,low:n}=this._variables;for(const c of this._orders){const{in_price:h,qty:d=0,commission:p=0,original_qty:v=0,direction:x}=c,_=x===mt.long?1:-1,y=(r-h)*d,m=(n-h)*d,w=_===1?y:-m,D=_===1?-m:y;e+=D+p*d/v,t+=w+p*d/v}const[i,a]=this._historyOrders.reduce((c,h)=>{let[d,p]=c;const{profit:v=0,commission:x=0}=h;return d+=v,p+=v-x,[d,p]},[0,0]);e-=i,t+=a;const u=e/(this.initial_capital+this.netprofit)*100;this._max_drawdown<e&&(this._max_drawdown=e),u>this._max_drawdown_percent&&(this._max_drawdown_percent=u);const f=t/(this.initial_capital+this.netprofit)*100;t>this._max_runup&&(this._max_runup=t),f>this._max_runup_percent&&(this._max_runup_percent=f)}updateOrders(e){this._orders=e,this._calcMaxContracts()}_calcMaxContracts(){const e=this._orders.length;if(!e)return;const[t,r,n,i,a,u]=this._orders.reduce(([f,c,h,d,p,v],x)=>{const{direction:_,qty:y=0,in_price:m}=x;return _===mt.long?(f+=y,c+=y,v+=y):(f+=y,h+=y,v-=y),d+=y*m,p+=m,[f,c,h,d,p,v]},[0,0,0,0,0,0]);this._position_size=u,this._position_avg_price=a/e,this._opentrades_capital_held=i,this._max_contracts_held_all=Math.max(t,this._max_contracts_held_all),this._max_contracts_held_long=Math.max(r,this._max_contracts_held_long),this._max_contracts_held_short=Math.max(n,this._max_contracts_held_short)}updateHistoryOrders(e){this._historyOrders=e;const t=this._historyOrders.length;this._closedtrades=t;const[r,n,i,a,u,f]=this._historyOrders.reduce((c,h)=>{let[d,p,v,x,_,y]=c;const{profit:m=0,profit_percent:w=0}=h;return d+=m,p+=w,m<0?(v+=m,x+=w):(_+=m,y+=w),[d,p,v,x,_,y]},[0,0,0,0,0,0]);this._avg_trade_percent=t?n/t:void 0,this._netprofit=r,this._grossloss=i,this._grossloss_percent=a,this._grossprofit=u,this._grossprofit_percent=f,this._eventrades=this._historyOrders.filter(c=>c.profit===0).length,this._losstrades=this._historyOrders.filter(c=>(c.profit||0)<0).length,this._wintrades=this._historyOrders.filter(c=>(c.profit||0)>0).length}updateStrategyOptions(e){this._options=e}get long(){return"long"}get short(){return"short"}get account_currency(){return"USD"}get closedtrades(){return this._closedtrades}get opentrades(){return{opentrades:this._orders.length,capital_held:this._opentrades_capital_held}}get avg_losing_trade(){const e=this.losstrades;return e?Math.abs(this.grossloss/e):void 0}get avg_losing_trade_percent(){const e=this.losstrades;return e?Math.abs(this.grossloss_percent/e):void 0}get avg_trade(){if(this.closedtrades)return Math.abs(this.netprofit/this.closedtrades)}get equity(){return this.initial_capital+this.netprofit+this.openprofit}get netprofit(){return this._netprofit}get eventrades(){return this._eventrades}get openprofit(){return this._orders.reduce((e,t)=>{const{profit:r=0}=t;return e+r},0)}get avg_trade_percent(){return this._avg_trade_percent}get avg_winning_trade(){const e=this.wintrades;return e?Math.abs(this.grossprofit/e):void 0}get avg_winning_trade_percent(){const e=this.wintrades;return e?Math.abs(this.grossprofit_percent/e):void 0}get initial_capital(){var e;return((e=this._options)==null?void 0:e.initial_capital)||0}get losstrades(){return this._losstrades}get grossloss(){return this._grossloss}get grossloss_percent(){return this._grossloss_percent}get grossprofit(){return this._grossprofit}get grossprofit_percent(){return this._grossprofit_percent}get wintrades(){return this._wintrades}get margin_liquidation_price(){if(!this._options)return;const{initial_capital:e,margin_long:t=0,margin_short:r=0,commission_type:n,commission_value:i=0}=this._options,a=this._orders[0].direction===mt.long?1:-1,u=(a===1?t:r)/100;if(u<=0)return;const{close:f}=this._variables,[c,h]=this._orders.reduce((d,p)=>{let[v,x]=d;const{in_price:_,qty:y=0,original_qty:m=0}=p,w=_*y;if(v+=w,i){let D=0;switch(n){case Ir.percent:D=(w+y*f)*i/100;break;case Ir.cashPerContract:D=y*i*2;break;case Ir.cashPerOrder:D=y/m*i+i;break}x+=D}return[v,x]},[0,0]);return(c-(e+this.netprofit-h))*a/this.position_size/(1-a*u)}get max_contracts_held_all(){return this._max_contracts_held_all}get max_contracts_held_long(){return this._max_contracts_held_long}get max_contracts_held_short(){return this._max_contracts_held_short}get max_drawdown(){return this._max_drawdown}get max_runup(){return this._max_runup}get max_runup_percent(){return this._max_runup_percent}get max_drawdown_percent(){return this._max_drawdown_percent}get netprofit_percent(){return this.netprofit/this.initial_capital*100}get openprofit_percent(){return this.openprofit/(this.initial_capital+this.netprofit)*100}get position_avg_price(){return this._position_avg_price}get position_entry_name(){if(this._orders.length)return this._orders[0].id}get position_size(){return this._position_size}}class vw{constructor(e){q(this,"_preAccdist");q(this,"_preNvi");q(this,"_prePvi");q(this,"_preObv");q(this,"_prePvt");q(this,"_preWad");q(this,"_preVwap");q(this,"_preValue");q(this,"_currentData");q(this,"_preData");q(this,"_id");this._preAccdist=0,this._preNvi=0,this._prePvi=0,this._preObv=0,this._prePvt=0,this._preWad=0,this._preVwap={},this._preValue={},this._currentData={},this._preData={},this._id=e}update(e){this._preValue={},e.barIndex!==this._currentData.barIndex&&(this._preData={...this._currentData}),this._currentData={...e}}get isRealTime(){return this._preData.barIndex===this._currentData.barIndex}get accdist(){if(this._preValue.accdist)return this._preValue.accdist;const{close:e,low:t,high:r,volume:n}=this._currentData;if(r===t)return this._preAccdist;const i=(e-t-(r-e))/(r-t)*n+this._preAccdist;return!this.isRealTime&&(this._preAccdist=i),this._preValue.accdist=i,i}get iii(){if(this._preValue.iii)return this._preValue.iii;const{close:e,low:t,high:r,volume:n}=this._currentData,i=(2*e-r-t)/((r-t)*n);return this._preValue.iii=i,i}get nvi(){return this._preValue.nvi?this._preValue.nvi:this._getNvi()}get wvad(){if(this._preValue.wvad)return this._preValue.wvad;const{close:e,low:t,high:r,volume:n,open:i}=this._currentData,a=(e-i)/(r-t)*n;return this._preValue.wvad=a,a}get obv(){if(this._preValue.obv)return this._preValue.obv;const{close:e,volume:t}=this._currentData,{close:r}=this._preData;if(r===void 0){this._preObv=0;return}const n=Math.sign(e-r)*t+this._preObv;return!this.isRealTime&&(this._preObv=n),this._preValue.obv=n,n}get pvi(){return this._preValue.pvi?this._preValue.pvi:this._getPvi()}get tr(){if(this._preValue.tr)return this._preValue.tr;const{low:e,high:t}=this._currentData,{close:r}=this._preData;if(r===void 0)return;const n=Math.max(t-e,Math.abs(t-r),Math.abs(e-r));return this._preValue.tr=n,n}get pvt(){if(this._preValue.pvt)return this._preValue.pvt;const{close:e,volume:t}=this._currentData,{close:r}=this._preData;if(r===void 0){this._prePvt=0;return}const n=(e-r)/r*t+this._prePvt;return!this.isRealTime&&(this._prePvt=n),this._preValue.pvt=n,n}get wad(){if(this._preValue.wad)return this._preValue.wad;const{close:e,high:t,low:r}=this._currentData,{close:n}=this._preData;if(n===void 0)return this._preWad=0,0;const i=Math.max(t,n),a=Math.min(r,n),u=e-n,c=(u>0?e-a:u<0?e-i:0)+this._preWad;return!this.isRealTime&&(this._preWad=c),this._preValue.wad=c,c}get vwap(){var h,d;if(this._preValue.vwap)return this._preValue.vwap;const{hlc3:e,volume:t}=this._currentData;let{sum:r=0,sumV:n=0,isReset:i}=this._preVwap;if(((d=(h=self.workerStorage)==null?void 0:h.get(this._id))==null?void 0:d.buildInFunctions.timeframe.change({timeframe:"1D"},"vwap_buildin"))&&(i=!0,r=n=0),!i)return;const u=e*t+r,f=t+n;!this.isRealTime&&(this._preVwap={sum:u,sumV:f,isReset:i});const c=u/f;return this._preValue.vwap=c,c}_getNvi(){const e=this._preNvi||1,{close:t=0,volume:r=0}=this._preData,{close:n,volume:i}=this._currentData;let a=1;const u=e||1;return n&&t?a=i<r?u+(n-t)/t*u:u:a=u,!this.isRealTime&&(this._preNvi=a),this._preValue.nvi=a,a}_getPvi(){const e=this._prePvi||1,{close:t=0,volume:r=0}=this._preData,{close:n,volume:i}=this._currentData;let a=1;const u=e||1;return n&&t?a=i>r?u+(n-t)/t*u:u:a=u,!this.isRealTime&&(this._prePvi=a),this._preValue.pvi=a,a}}class gw{constructor(){q(this,"_period");q(this,"_multiplier");q(this,"_unit");this._period="1",this._multiplier=1,this._unit="m"}update(e){if(!e)return;this._period=e;const[t,r]=ks(e);this._multiplier=t,this._unit=r}get isdaily(){return this._unit==="d"}get isdwm(){return["d","w","M"].includes(this._unit)}get isintraday(){return["s","m","h"].includes(this._unit)}get isminutes(){return this._unit==="m"}get ismonthly(){return this._unit==="M"}get isseconds(){return this._unit==="s"}get isweekly(){return this._unit==="w"}get multiplier(){return this._multiplier}get period(){return this._period}}class mw{constructor(e){q(this,"_variables");q(this,"_bgColor");q(this,"_fgColor");q(this,"isUseBgColor",!1);this._variables=e}updateOptions(e){e!=null&&e.bg_color&&(this._bgColor=e.bg_color,this._fgColor=this._contrastColor(e.bg_color))}get bg_color(){return this.isUseBgColor=!0,this._bgColor}get fg_color(){return this.isUseBgColor=!0,this._fgColor}get is_heikinashi(){return!1}get is_kagi(){return!1}get is_linebreak(){return!1}get is_pnf(){return!1}get is_range(){return!1}get is_renko(){return!1}get is_standard(){return!1}get left_visible_bar_time(){return this._variables.time}get right_visible_bar_time(){return this._variables.time}_parseColor(e){let t,r,n,i;if(e.startsWith("#")){t=parseInt(e.substring(1,3),16),r=parseInt(e.substring(3,5),16),n=parseInt(e.substring(5,7),16);const a=e.substring(7);a?i=parseInt(a,16)/255:i=1}else{const a=this._parserRgbColor(e);t=a[0]||0,r=a[1]||0,n=a[2]||0,i=a[3]||1}return{r:t,g:r,b:n,a:i}}_parserRgbColor(e){var t;return((t=e.match(/\d+/g))==null?void 0:t.map(Number))||[]}_contrastColor(e){const{r:t,g:r,b:n}=this._parseColor(e);return(299*t+587*r+114*n)/1e3>128?"#000000":"#ffffff"}}class xw{constructor(e){q(this,"_variables");this._variables=e}get basecurrency(){return""}get country(){}get currency(){return"CNY"}get description(){return""}get employees(){return 100}get expiration_date(){}get industry(){}get minmove(){}get mintick(){}get pointvalue(){}get prefix(){}get pricescale(){}get recommendations_buy(){}get recommendations_buy_strong(){}get recommendations_date(){}get recommendations_hold(){}get recommendations_sell(){}get recommendations_sell_strong(){}get recommendations_total(){}get root(){return""}get sector(){}get session(){return yi.regular}get shareholders(){}get shares_outstanding_float(){}get shares_outstanding_total(){}get target_price_average(){}get target_price_date(){}get target_price_estimates(){}get target_price_high(){}get target_price_low(){}get target_price_median(){}get ticker(){}get tickerid(){}get timezone(){}get type(){}get volumetype(){return"n/a"}}class yw{constructor(e){q(this,"_variables");this._variables=e}get future_amount(){}get future_ex_date(){}get future_pay_date(){}}class Dw{constructor(e){q(this,"_variables");this._variables=e}get future_eps(){}get future_period_end_time(){}get future_revenue(){}get future_time(){}}ot.extend(v1),ot.extend(Dl),ot.extend(p1);class Ih{constructor(e){q(this,"_cacheData");q(this,"_barIndex");q(this,"_isRealTimeBar");q(this,"_barstate");q(this,"_priceVariables");q(this,"_lastBarIndex");q(this,"_currentBarTime");q(this,"_lastBarTime");q(this,"_period");q(this,"_offsetTime");q(this,"_timeframe");q(this,"_ta");q(this,"_polyline");q(this,"_label");q(this,"_line");q(this,"_linefill");q(this,"_box");q(this,"_table");q(this,"_strategy");q(this,"_session");q(this,"syminfo");q(this,"chart");q(this,"earnings");q(this,"dividends");q(this,"_timeTradingday");q(this,"_mintick");this._cacheData={varData:{},varNewData:{},varipData:{}},this._barIndex=0,this._lastBarIndex=0,this._currentBarTime=0,this._lastBarTime=0,this._offsetTime=0,this._period="",this._isRealTimeBar=!1,this._barstate=new dw,this._timeframe=new gw,this._priceVariables={close:0,open:0,low:0,high:0,volume:0},this._ta=new vw(e),this._polyline=new Li,this._label=new Li,this._line=new Li,this._linefill=new Li,this._box=new Li,this._table=new Li(1),this._strategy=new _w(this),this._session=new pw(this),this.syminfo=new xw(this),this.chart=new mw(this),this.earnings=new Dw(this),this.dividends=new yw(this)}get table(){return this._table}get box(){return this._box}get linefill(){return this._linefill}get line(){return this._line}get polyline(){return this._polyline}get label(){return this._label}get ta(){return this._ta}get strategy(){return this._strategy}get session(){return this._session}get na(){}get last_bar_index(){return this._lastBarIndex}get bar_index(){return this._barIndex}get barstate(){return this._barstate}get close(){return this._priceVariables.close}get low(){return this._priceVariables.low}get open(){return this._priceVariables.open}get high(){return this._priceVariables.high}get volume(){return this._priceVariables.volume}get ohlc4(){const{close:e,open:t,high:r,low:n}=this._priceVariables;return(e+t+r+n)/4}get hl2(){const{high:e,low:t}=this._priceVariables;return(e+t)/2}get hlc3(){const{close:e,high:t,low:r}=this._priceVariables;return(e+t+r)/3}get hlcc4(){const{close:e,high:t,low:r}=this._priceVariables;return(e*2+t+r)/4}get hour(){return ot(this._currentBarTime).subtract(this._offsetTime,"hour").hour()}get minute(){return ot(this._currentBarTime).minute()}get second(){return ot(this._currentBarTime).second()}get month(){return ot(this._currentBarTime).month()+1}get year(){return ot(this._currentBarTime).year()}get dayofweek(){return ot(this._currentBarTime).day()+1}get dayofmonth(){return ot(this._currentBarTime).date()}get weekofyear(){return ot(this._currentBarTime).week()}get last_bar_time(){return this._lastBarTime}get time(){return this._currentBarTime}get time_close(){const[e,t]=ks(this._period);return this._isRealTimeBar?void 0:ot(this._currentBarTime).add(e,t).valueOf()}get timenow(){return Date.now()}get time_tradingday(){return this._timeTradingday||this.getTimeTradingday(this._currentBarTime,this._period)}get timeframe(){return this._timeframe}get mintick(){return this._mintick}updateMaxLength(e){const{max_lines_count:t,max_labels_count:r,max_boxes_count:n,max_polylines_count:i}=e;n&&this._box.setMaxLen(n),r&&this._label.setMaxLen(r),t&&this._line.setMaxLen(t),i&&this._polyline.setMaxLen(i)}getTimeTradingday(e,t){const[r,n]=ks(t),i=ot(e);return["M","w","y","d"].includes(n)?i.valueOf():(i.subtract(this._offsetTime,"h"),i.startOf("d").add(this._offsetTime,"h").valueOf())}updateOptions(e){const{interval:t="1D",offsetTime:r=5,mintick:n,chart:i}=e;this._period=t,this._mintick=n,this._offsetTime=r,this._timeframe.update(t),this.chart.updateOptions(i)}updateData(e){const{barIndex:t,c:r,o:n,h:i,l:a,volume:u,time:f,lastBarIndex:c,lastBarTime:h,complete:d,time_tradingday:p}=e;this._priceVariables={close:Number(r),open:Number(n),high:Number(i),low:Number(a),volume:Number(u)},this._isRealTimeBar=d,t>this._barIndex&&this._isRealTimeBar&&(this._cacheData.varData=this._cacheData.varNewData,this._cacheData.varNewData={}),this._timeTradingday=p,this._currentBarTime=f*1e3,this._lastBarIndex=c,this._barIndex=t,this._lastBarTime=h*1e3,this._barstate.update(t,c,d,!1),this.ta.update({...this._priceVariables,hlc3:this.hlc3,barIndex:t})}getCacheData(e,t,r){const n=this.setCacheData(e,r);return n[n.length-1-t]}setCacheData(e,t){let r=this._cacheData[e]||{barIndex:-1,data:[]};return r.barIndex>this._barIndex||(r.barIndex===this._barIndex?r.data[r.data.length-1]=t:r.data.push(t),r.barIndex=this._barIndex,this._cacheData[e]=r),r.data}getTypeInstance(e,t){return new c1(e,t)}getVarValue(e,t,r){const n=`${e}_${t}`,i=r==="var"?this._cacheData.varData[n]:this._cacheData.varipData[n];if(i)return i}setVarValue(e,t,r,n){const i=`${e}_${t}`;let a;switch(typeof r=="object"&&r&&(n="var",a=r.varipKeys),n){case"var":if(this._isRealTimeBar){const u=Yr.cloneDeep(r);if(this._cacheData.varNewData[i]=u,a&&a.length)for(const f of a)this._cacheData.varData[i][f]=u[f]}else this._cacheData.varData[i]=r;break;case"varip":this._cacheData.varipData[i]=r;break}return r}add(e,t){return Array.isArray(e)&&Array.isArray(t)?Yr.uniq([...e,...t]):typeof e=="number"||typeof t=="number"?Number(e)+Number(t):e+t}sub(e,t){return Array.isArray(e)&&Array.isArray(t)?e.filter(r=>!t.includes(r)):Number(e)-Number(t)}againAssignParse(e,t){var n;if(t)return;const r=(n=e==null?void 0:e.constructor)==null?void 0:n.name;if(r)switch(r){case ps.name:case Hf.name:case vs.name:case su.name:case _s.name:case Bo.name:e==null||e.delete();break}}}class Li{constructor(e=50){q(this,"_all");q(this,"_allInstance");q(this,"_pseudoArrayAll");q(this,"_maxLength");this._all=new Map,this._allInstance=new Map,this._pseudoArrayAll=new it,this._maxLength=e}setMaxLen(e){this._maxLength=e}get data(){return[...this._all.values()]}get all(){return this._pseudoArrayAll._value=[...this._allInstance.values()],this._pseudoArrayAll}add(e,t,r){if(this._all.set(e,t),this._allInstance.set(e,r),this._all.size>this._maxLength){const n=this._all.keys().next().value;n&&this.delete(n)}}getValOfBarIndex(e){let t=[];const r=[...this._all.keys()];for(const n of e){const i=r.filter(a=>a.endsWith(`_${n}`));for(const a of i){const u=this._all.get(a);u&&t.push(u)}}return t.length?t:void 0}get(e){return this._all.get(e)}getInstance(e){return this._allInstance.get(e)}delete(e){this._all.delete(e),this._allInstance.delete(e)}}/**
76
+ `),D=this._runScripts(w,t,!0,i,h);return r==null||r.set(t,w),D}_getDependCodes(e,t,r,n,i){for(const a of e){if(!a.isArg){const u=t.filter(c=>{var h;return(h=c==null?void 0:c.depends)==null?void 0:h.some(d=>d.name===a.name&&d.scope===a.scope&&d.isAgainAssign)});for(const c of u){const{code:h,depends:d}=c;r.includes(h)||(r.unshift(h),d!=null&&d.length&&this._getDependCodes(d,t,r,n,i))}const f=t.find(c=>{var h;return((h=c.varNames)==null?void 0:h.split(", ").includes(a.name))&&(!a.isPreArg||a.isPreArg&&c.methodName===a.functionName)||c.funcName===a.name});if(f){const{code:c,depends:h}=f,d=r.findIndex(p=>p===c);d!==-1&&r.splice(d,1),r.unshift(c),h!=null&&h.length&&this._getDependCodes(h,t,r,n,i);continue}}i.some(u=>u.name===a.name)||i.push(a)}}_runScripts(e,t,r,n,i){const a=`${this._scriptId}_${t}`;let{builtInGather:u,buildinConstants:f,buildInFunctions:c,tradingvueFunc:h}=self.workerStorage.get(a)||{};return r&&(u=new Ih(a),f=new Wf,c=new Zf(this._variables.mintick||1e-4,u,this._scriptId),h=new Function("$_var","$_const","$_func","$paramsExpr","$posStr",e),self.workerStorage.set(a,{builtInGather:u,buildinConstants:f,buildInFunctions:c,tradingvueFunc:h})),h(u,f,c,n||[],t)}}let lw=class{constructor(){}prefix(e){var r;const{symbol:t}=e;return((r=t==null?void 0:t.split("."))==null?void 0:r[0])||""}ticker(e){var r;const{symbol:t}=e;return((r=t==null?void 0:t.split("."))==null?void 0:r[1])||""}};class cw{constructor(e){q(this,"_logs");q(this,"_variables");q(this,"_intlFormat");this._variables=e,this._logs=[],this._intlFormat=new Intl.NumberFormat("en-US")}get logs(){return this._logs}clearLogs(){this._logs=[]}info(e,t,r){this._addLog(e,t,"info",r)}error(e,t,r){this._addLog(e,t,"error",r)}warning(e,t,r){this._addLog(e,t,"warning",r)}_addLog(e,t,r,n){if(typeof t=="string"&&(n=t),n.startsWith("export"))return;const{message:i,formatString:a}=e,{time:u,bar_index:f}=this._variables;let c=i;a&&Array.isArray(t)&&t.length&&(c=a.replace(/{(\d+)}/g,(h,d)=>{let p=t[d];return typeof p=="number"&&(p=this._intlFormat.format(parseFloat(p.toFixed(3)))),p!==void 0?p:h})),c&&this._logs.push({message:`[${ot(u).format()}]: ${c}`,time:u,barIndex:f,type:r})}}class fw{constructor(e){q(this,"_errorListener");this._errorListener=e}error({message:e},t){t.startsWith("export")||this._errorListener.addError(e,t,Ze.Error)}}class hw{constructor(){q(this,"_errors");this._errors=new Map}clear(){this._errors.clear()}get errors(){return Yr.flatMap([...this._errors.values()])}addError(e,t,r,n=0){const[i,a]=t.split("_").slice(-2),u=this._errors.get(t),f={message:e,endLineNumber:Number(i),startColumn:Number(a)+1,endColumn:Number(a)+n+1,startLineNumber:Number(i),type:r};u?u.push(f):this._errors.set(t,[f])}}class dw{constructor(){q(this,"_isMarketOpen");q(this,"_currentBarIndex");q(this,"_totalBarIndex");q(this,"_isRealTimeBar");q(this,"_preBarIndex");this._currentBarIndex=0,this._totalBarIndex=0,this._isRealTimeBar=!1,this._preBarIndex=0,this._isMarketOpen=!0}update(e,t,r,n){this._preBarIndex=this._currentBarIndex,this._currentBarIndex=e,this._totalBarIndex=t,this._isRealTimeBar=r,this._isMarketOpen=n}get isnew(){return!this._isRealTimeBar||this._preBarIndex!==this._currentBarIndex}get islast(){return this._currentBarIndex===this._totalBarIndex}get isfirst(){return this._currentBarIndex===0}get ishistory(){return!this._isRealTimeBar}get isrealtime(){return this._isRealTimeBar}get isconfirmed(){return!this._isRealTimeBar}get islastconfirmedhistory(){return this._isMarketOpen?this._currentBarIndex===this._totalBarIndex-1:this._currentBarIndex===this._totalBarIndex}}class pw{constructor(e){q(this,"_variables");this._variables=e}get isfirstbar(){return this._variables.timeframe.isdwm?!0:this._variables.time===this._variables.time_tradingday}get isfirstbar_regular(){return this._variables.timeframe.isdwm?!0:this._variables.time===this._variables.time_tradingday}get islastbar(){if(this._variables.timeframe.isdwm)return!0;const e=pn(this._variables.timeframe.period);return this._variables.time+e===this._variables.time_tradingday+24*60*60*1e3}get islastbar_regular(){if(this._variables.timeframe.isdwm)return!0;const e=pn(this._variables.timeframe.period);return this._variables.time+e===this._variables.time_tradingday+24*60*60*1e3}get ismarket(){return!0}get ispostmarket(){return!1}get ispremarket(){return!1}}class _w{constructor(e){q(this,"_orders");q(this,"_historyOrders");q(this,"_options");q(this,"_max_contracts_held_all",0);q(this,"_max_contracts_held_long",0);q(this,"_max_contracts_held_short",0);q(this,"_max_drawdown",0);q(this,"_max_runup",0);q(this,"_max_runup_percent",0);q(this,"_max_drawdown_percent",0);q(this,"_variables");q(this,"_netprofit",0);q(this,"_eventrades",0);q(this,"_avg_trade_percent");q(this,"_closedtrades",0);q(this,"_losstrades",0);q(this,"_grossloss",0);q(this,"_grossloss_percent",0);q(this,"_grossprofit",0);q(this,"_grossprofit_percent",0);q(this,"_wintrades",0);q(this,"_opentrades_capital_held",0);q(this,"_position_avg_price",0);q(this,"_position_size",0);this._orders=[],this._historyOrders=[],this._variables=e}update(){this._calcMaxDrawdownAndMaxRunup()}_calcMaxDrawdownAndMaxRunup(){let e=0,t=0;const{high:r,low:n}=this._variables;for(const c of this._orders){const{in_price:h,qty:d=0,commission:p=0,original_qty:v=0,direction:x}=c,_=x===mt.long?1:-1,y=(r-h)*d,m=(n-h)*d,w=_===1?y:-m,D=_===1?-m:y;e+=D+p*d/v,t+=w+p*d/v}const[i,a]=this._historyOrders.reduce((c,h)=>{let[d,p]=c;const{profit:v=0,commission:x=0}=h;return d+=v,p+=v-x,[d,p]},[0,0]);e-=i,t+=a;const u=e/(this.initial_capital+this.netprofit)*100;this._max_drawdown<e&&(this._max_drawdown=e),u>this._max_drawdown_percent&&(this._max_drawdown_percent=u);const f=t/(this.initial_capital+this.netprofit)*100;t>this._max_runup&&(this._max_runup=t),f>this._max_runup_percent&&(this._max_runup_percent=f)}updateOrders(e){this._orders=e,this._calcMaxContracts()}_calcMaxContracts(){const e=this._orders.length;if(!e)return;const[t,r,n,i,a,u]=this._orders.reduce(([f,c,h,d,p,v],x)=>{const{direction:_,qty:y=0,in_price:m}=x;return _===mt.long?(f+=y,c+=y,v+=y):(f+=y,h+=y,v-=y),d+=y*m,p+=m,[f,c,h,d,p,v]},[0,0,0,0,0,0]);this._position_size=u,this._position_avg_price=a/e,this._opentrades_capital_held=i,this._max_contracts_held_all=Math.max(t,this._max_contracts_held_all),this._max_contracts_held_long=Math.max(r,this._max_contracts_held_long),this._max_contracts_held_short=Math.max(n,this._max_contracts_held_short)}updateHistoryOrders(e){this._historyOrders=e;const t=this._historyOrders.length;this._closedtrades=t;const[r,n,i,a,u,f]=this._historyOrders.reduce((c,h)=>{let[d,p,v,x,_,y]=c;const{profit:m=0,profit_percent:w=0}=h;return d+=m,p+=w,m<0?(v+=m,x+=w):(_+=m,y+=w),[d,p,v,x,_,y]},[0,0,0,0,0,0]);this._avg_trade_percent=t?n/t:void 0,this._netprofit=r,this._grossloss=i,this._grossloss_percent=a,this._grossprofit=u,this._grossprofit_percent=f,this._eventrades=this._historyOrders.filter(c=>c.profit===0).length,this._losstrades=this._historyOrders.filter(c=>(c.profit||0)<0).length,this._wintrades=this._historyOrders.filter(c=>(c.profit||0)>0).length}updateStrategyOptions(e){this._options=e}get long(){return"long"}get short(){return"short"}get account_currency(){return"USD"}get closedtrades(){return this._closedtrades}get opentrades(){return{opentrades:this._orders.length,capital_held:this._opentrades_capital_held}}get avg_losing_trade(){const e=this.losstrades;return e?Math.abs(this.grossloss/e):void 0}get avg_losing_trade_percent(){const e=this.losstrades;return e?Math.abs(this.grossloss_percent/e):void 0}get avg_trade(){if(this.closedtrades)return Math.abs(this.netprofit/this.closedtrades)}get equity(){return this.initial_capital+this.netprofit+this.openprofit}get netprofit(){return this._netprofit}get eventrades(){return this._eventrades}get openprofit(){return this._orders.reduce((e,t)=>{const{profit:r=0}=t;return e+r},0)}get avg_trade_percent(){return this._avg_trade_percent}get avg_winning_trade(){const e=this.wintrades;return e?Math.abs(this.grossprofit/e):void 0}get avg_winning_trade_percent(){const e=this.wintrades;return e?Math.abs(this.grossprofit_percent/e):void 0}get initial_capital(){var e;return((e=this._options)==null?void 0:e.initial_capital)||0}get losstrades(){return this._losstrades}get grossloss(){return this._grossloss}get grossloss_percent(){return this._grossloss_percent}get grossprofit(){return this._grossprofit}get grossprofit_percent(){return this._grossprofit_percent}get wintrades(){return this._wintrades}get margin_liquidation_price(){if(!this._options)return;const{initial_capital:e,margin_long:t=0,margin_short:r=0,commission_type:n,commission_value:i=0}=this._options,a=this._orders[0].direction===mt.long?1:-1,u=(a===1?t:r)/100;if(u<=0)return;const{close:f}=this._variables,[c,h]=this._orders.reduce((d,p)=>{let[v,x]=d;const{in_price:_,qty:y=0,original_qty:m=0}=p,w=_*y;if(v+=w,i){let D=0;switch(n){case Ir.percent:D=(w+y*f)*i/100;break;case Ir.cashPerContract:D=y*i*2;break;case Ir.cashPerOrder:D=y/m*i+i;break}x+=D}return[v,x]},[0,0]);return(c-(e+this.netprofit-h))*a/this.position_size/(1-a*u)}get max_contracts_held_all(){return this._max_contracts_held_all}get max_contracts_held_long(){return this._max_contracts_held_long}get max_contracts_held_short(){return this._max_contracts_held_short}get max_drawdown(){return this._max_drawdown}get max_runup(){return this._max_runup}get max_runup_percent(){return this._max_runup_percent}get max_drawdown_percent(){return this._max_drawdown_percent}get netprofit_percent(){return this.netprofit/this.initial_capital*100}get openprofit_percent(){return this.openprofit/(this.initial_capital+this.netprofit)*100}get position_avg_price(){return this._position_avg_price}get position_entry_name(){if(this._orders.length)return this._orders[0].id}get position_size(){return this._position_size}}class vw{constructor(e){q(this,"_preAccdist");q(this,"_preNvi");q(this,"_prePvi");q(this,"_preObv");q(this,"_prePvt");q(this,"_preWad");q(this,"_preVwap");q(this,"_preValue");q(this,"_currentData");q(this,"_preData");q(this,"_id");this._preAccdist=0,this._preNvi=0,this._prePvi=0,this._preObv=0,this._prePvt=0,this._preWad=0,this._preVwap={},this._preValue={},this._currentData={},this._preData={},this._id=e}update(e){this._preValue={},e.barIndex!==this._currentData.barIndex&&(this._preData={...this._currentData}),this._currentData={...e}}get isRealTime(){return this._preData.barIndex===this._currentData.barIndex}get accdist(){if(this._preValue.accdist)return this._preValue.accdist;const{close:e,low:t,high:r,volume:n}=this._currentData;if(r===t)return this._preAccdist;const i=(e-t-(r-e))/(r-t)*n+this._preAccdist;return!this.isRealTime&&(this._preAccdist=i),this._preValue.accdist=i,i}get iii(){if(this._preValue.iii)return this._preValue.iii;const{close:e,low:t,high:r,volume:n}=this._currentData,i=(2*e-r-t)/((r-t)*n);return this._preValue.iii=i,i}get nvi(){return this._preValue.nvi?this._preValue.nvi:this._getNvi()}get wvad(){if(this._preValue.wvad)return this._preValue.wvad;const{close:e,low:t,high:r,volume:n,open:i}=this._currentData,a=(e-i)/(r-t)*n;return this._preValue.wvad=a,a}get obv(){if(this._preValue.obv)return this._preValue.obv;const{close:e,volume:t}=this._currentData,{close:r}=this._preData;if(r===void 0){this._preObv=0;return}const n=Math.sign(e-r)*t+this._preObv;return!this.isRealTime&&(this._preObv=n),this._preValue.obv=n,n}get pvi(){return this._preValue.pvi?this._preValue.pvi:this._getPvi()}get tr(){if(this._preValue.tr)return this._preValue.tr;const{low:e,high:t}=this._currentData,{close:r}=this._preData;if(r===void 0)return;const n=Math.max(t-e,Math.abs(t-r),Math.abs(e-r));return this._preValue.tr=n,n}get pvt(){if(this._preValue.pvt)return this._preValue.pvt;const{close:e,volume:t}=this._currentData,{close:r}=this._preData;if(r===void 0){this._prePvt=0;return}const n=(e-r)/r*t+this._prePvt;return!this.isRealTime&&(this._prePvt=n),this._preValue.pvt=n,n}get wad(){if(this._preValue.wad)return this._preValue.wad;const{close:e,high:t,low:r}=this._currentData,{close:n}=this._preData;if(n===void 0)return this._preWad=0,0;const i=Math.max(t,n),a=Math.min(r,n),u=e-n,c=(u>0?e-a:u<0?e-i:0)+this._preWad;return!this.isRealTime&&(this._preWad=c),this._preValue.wad=c,c}get vwap(){var h,d;if(this._preValue.vwap)return this._preValue.vwap;const{hlc3:e,volume:t}=this._currentData;let{sum:r=0,sumV:n=0,isReset:i}=this._preVwap;if(((d=(h=self.workerStorage)==null?void 0:h.get(this._id))==null?void 0:d.buildInFunctions.timeframe.change({timeframe:"1D"},"vwap_buildin"))&&(i=!0,r=n=0),!i)return;const u=e*t+r,f=t+n;!this.isRealTime&&(this._preVwap={sum:u,sumV:f,isReset:i});const c=u/f;return this._preValue.vwap=c,c}_getNvi(){const e=this._preNvi||1,{close:t=0,volume:r=0}=this._preData,{close:n,volume:i}=this._currentData;let a=1;const u=e||1;return n&&t?a=i<r?u+(n-t)/t*u:u:a=u,!this.isRealTime&&(this._preNvi=a),this._preValue.nvi=a,a}_getPvi(){const e=this._prePvi||1,{close:t=0,volume:r=0}=this._preData,{close:n,volume:i}=this._currentData;let a=1;const u=e||1;return n&&t?a=i>r?u+(n-t)/t*u:u:a=u,!this.isRealTime&&(this._prePvi=a),this._preValue.pvi=a,a}}class gw{constructor(){q(this,"_period");q(this,"_multiplier");q(this,"_unit");this._period="1",this._multiplier=1,this._unit="m"}update(e){if(!e)return;this._period=e;const[t,r]=ks(e);this._multiplier=t,this._unit=r}get isdaily(){return this._unit==="d"}get isdwm(){return["d","w","M"].includes(this._unit)}get isintraday(){return["s","m","h"].includes(this._unit)}get isminutes(){return this._unit==="m"}get ismonthly(){return this._unit==="M"}get isseconds(){return this._unit==="s"}get isweekly(){return this._unit==="w"}get multiplier(){return this._multiplier}get period(){return this._period}}class mw{constructor(e){q(this,"_variables");q(this,"_bgColor");q(this,"_fgColor");q(this,"isUseBgColor",!1);this._variables=e}updateOptions(e){e!=null&&e.bg_color&&(this._bgColor=e.bg_color,this._fgColor=this._contrastColor(e.bg_color))}get bg_color(){return this.isUseBgColor=!0,this._bgColor}get fg_color(){return this.isUseBgColor=!0,this._fgColor}get is_heikinashi(){return!1}get is_kagi(){return!1}get is_linebreak(){return!1}get is_pnf(){return!1}get is_range(){return!1}get is_renko(){return!1}get is_standard(){return!0}get left_visible_bar_time(){return this._variables.time}get right_visible_bar_time(){return this._variables.time}_parseColor(e){let t,r,n,i;if(e.startsWith("#")){t=parseInt(e.substring(1,3),16),r=parseInt(e.substring(3,5),16),n=parseInt(e.substring(5,7),16);const a=e.substring(7);a?i=parseInt(a,16)/255:i=1}else{const a=this._parserRgbColor(e);t=a[0]||0,r=a[1]||0,n=a[2]||0,i=a[3]||1}return{r:t,g:r,b:n,a:i}}_parserRgbColor(e){var t;return((t=e.match(/\d+/g))==null?void 0:t.map(Number))||[]}_contrastColor(e){const{r:t,g:r,b:n}=this._parseColor(e);return(299*t+587*r+114*n)/1e3>128?"#000000":"#ffffff"}}class xw{constructor(e){q(this,"_variables");this._variables=e}get basecurrency(){return""}get country(){}get currency(){return"CNY"}get description(){return""}get employees(){return 100}get expiration_date(){}get industry(){}get minmove(){}get mintick(){}get pointvalue(){}get prefix(){}get pricescale(){}get recommendations_buy(){}get recommendations_buy_strong(){}get recommendations_date(){}get recommendations_hold(){}get recommendations_sell(){}get recommendations_sell_strong(){}get recommendations_total(){}get root(){return""}get sector(){}get session(){return yi.regular}get shareholders(){}get shares_outstanding_float(){}get shares_outstanding_total(){}get target_price_average(){}get target_price_date(){}get target_price_estimates(){}get target_price_high(){}get target_price_low(){}get target_price_median(){}get ticker(){}get tickerid(){}get timezone(){}get type(){}get volumetype(){return"n/a"}}class yw{constructor(e){q(this,"_variables");this._variables=e}get future_amount(){}get future_ex_date(){}get future_pay_date(){}}class Dw{constructor(e){q(this,"_variables");this._variables=e}get future_eps(){}get future_period_end_time(){}get future_revenue(){}get future_time(){}}ot.extend(v1),ot.extend(Dl),ot.extend(p1);class Ih{constructor(e){q(this,"_cacheData");q(this,"_barIndex");q(this,"_isRealTimeBar");q(this,"_barstate");q(this,"_priceVariables");q(this,"_lastBarIndex");q(this,"_currentBarTime");q(this,"_lastBarTime");q(this,"_period");q(this,"_offsetTime");q(this,"_timeframe");q(this,"_ta");q(this,"_polyline");q(this,"_label");q(this,"_line");q(this,"_linefill");q(this,"_box");q(this,"_table");q(this,"_strategy");q(this,"_session");q(this,"syminfo");q(this,"chart");q(this,"earnings");q(this,"dividends");q(this,"_timeTradingday");q(this,"_mintick");this._cacheData={varData:{},varNewData:{},varipData:{}},this._barIndex=0,this._lastBarIndex=0,this._currentBarTime=0,this._lastBarTime=0,this._offsetTime=0,this._period="",this._isRealTimeBar=!1,this._barstate=new dw,this._timeframe=new gw,this._priceVariables={close:0,open:0,low:0,high:0,volume:0},this._ta=new vw(e),this._polyline=new Li,this._label=new Li,this._line=new Li,this._linefill=new Li,this._box=new Li,this._table=new Li(1),this._strategy=new _w(this),this._session=new pw(this),this.syminfo=new xw(this),this.chart=new mw(this),this.earnings=new Dw(this),this.dividends=new yw(this)}get table(){return this._table}get box(){return this._box}get linefill(){return this._linefill}get line(){return this._line}get polyline(){return this._polyline}get label(){return this._label}get ta(){return this._ta}get strategy(){return this._strategy}get session(){return this._session}get na(){}get last_bar_index(){return this._lastBarIndex}get bar_index(){return this._barIndex}get barstate(){return this._barstate}get close(){return this._priceVariables.close}get low(){return this._priceVariables.low}get open(){return this._priceVariables.open}get high(){return this._priceVariables.high}get volume(){return this._priceVariables.volume}get ohlc4(){const{close:e,open:t,high:r,low:n}=this._priceVariables;return(e+t+r+n)/4}get hl2(){const{high:e,low:t}=this._priceVariables;return(e+t)/2}get hlc3(){const{close:e,high:t,low:r}=this._priceVariables;return(e+t+r)/3}get hlcc4(){const{close:e,high:t,low:r}=this._priceVariables;return(e*2+t+r)/4}get hour(){return ot(this._currentBarTime).subtract(this._offsetTime,"hour").hour()}get minute(){return ot(this._currentBarTime).minute()}get second(){return ot(this._currentBarTime).second()}get month(){return ot(this._currentBarTime).month()+1}get year(){return ot(this._currentBarTime).year()}get dayofweek(){return ot(this._currentBarTime).day()+1}get dayofmonth(){return ot(this._currentBarTime).date()}get weekofyear(){return ot(this._currentBarTime).week()}get last_bar_time(){return this._lastBarTime}get time(){return this._currentBarTime}get time_close(){const[e,t]=ks(this._period);return this._isRealTimeBar?void 0:ot(this._currentBarTime).add(e,t).valueOf()}get timenow(){return Date.now()}get time_tradingday(){return this._timeTradingday||this.getTimeTradingday(this._currentBarTime,this._period)}get timeframe(){return this._timeframe}get mintick(){return this._mintick}updateMaxLength(e){const{max_lines_count:t,max_labels_count:r,max_boxes_count:n,max_polylines_count:i}=e;n&&this._box.setMaxLen(n),r&&this._label.setMaxLen(r),t&&this._line.setMaxLen(t),i&&this._polyline.setMaxLen(i)}getTimeTradingday(e,t){const[r,n]=ks(t),i=ot(e);return["M","w","y","d"].includes(n)?i.valueOf():(i.subtract(this._offsetTime,"h"),i.startOf("d").add(this._offsetTime,"h").valueOf())}updateOptions(e){const{interval:t="1D",offsetTime:r=5,mintick:n,chart:i}=e;this._period=t,this._mintick=n,this._offsetTime=r,this._timeframe.update(t),this.chart.updateOptions(i)}updateData(e){const{barIndex:t,c:r,o:n,h:i,l:a,volume:u,time:f,lastBarIndex:c,lastBarTime:h,complete:d,time_tradingday:p}=e;this._priceVariables={close:Number(r),open:Number(n),high:Number(i),low:Number(a),volume:Number(u)},this._isRealTimeBar=d,t>this._barIndex&&this._isRealTimeBar&&(this._cacheData.varData=this._cacheData.varNewData,this._cacheData.varNewData={}),this._timeTradingday=p,this._currentBarTime=f*1e3,this._lastBarIndex=c,this._barIndex=t,this._lastBarTime=h*1e3,this._barstate.update(t,c,d,!1),this.ta.update({...this._priceVariables,hlc3:this.hlc3,barIndex:t})}getCacheData(e,t,r){const n=this.setCacheData(e,r);return n[n.length-1-t]}setCacheData(e,t){let r=this._cacheData[e]||{barIndex:-1,data:[]};return r.barIndex>this._barIndex||(r.barIndex===this._barIndex?r.data[r.data.length-1]=t:r.data.push(t),r.barIndex=this._barIndex,this._cacheData[e]=r),r.data}getTypeInstance(e,t){return new c1(e,t)}getVarValue(e,t,r){const n=`${e}_${t}`,i=r==="var"?this._cacheData.varData[n]:this._cacheData.varipData[n];if(i)return i}setVarValue(e,t,r,n){const i=`${e}_${t}`;let a;switch(typeof r=="object"&&r&&(n="var",a=r.varipKeys),n){case"var":if(this._isRealTimeBar){const u=Yr.cloneDeep(r);if(this._cacheData.varNewData[i]=u,a&&a.length)for(const f of a)this._cacheData.varData[i][f]=u[f]}else this._cacheData.varData[i]=r;break;case"varip":this._cacheData.varipData[i]=r;break}return r}add(e,t){return Array.isArray(e)&&Array.isArray(t)?Yr.uniq([...e,...t]):typeof e=="number"||typeof t=="number"?Number(e)+Number(t):e+t}sub(e,t){return Array.isArray(e)&&Array.isArray(t)?e.filter(r=>!t.includes(r)):Number(e)-Number(t)}againAssignParse(e,t){var n;if(t)return;const r=(n=e==null?void 0:e.constructor)==null?void 0:n.name;if(r)switch(r){case ps.name:case Hf.name:case vs.name:case su.name:case _s.name:case Bo.name:e==null||e.delete();break}}}class Li{constructor(e=50){q(this,"_all");q(this,"_allInstance");q(this,"_pseudoArrayAll");q(this,"_maxLength");this._all=new Map,this._allInstance=new Map,this._pseudoArrayAll=new it,this._maxLength=e}setMaxLen(e){this._maxLength=e}get data(){return[...this._all.values()]}get all(){return this._pseudoArrayAll._value=[...this._allInstance.values()],this._pseudoArrayAll}add(e,t,r){if(this._all.set(e,t),this._allInstance.set(e,r),this._all.size>this._maxLength){const n=this._all.keys().next().value;n&&this.delete(n)}}getValOfBarIndex(e){let t=[];const r=[...this._all.keys()];for(const n of e){const i=r.filter(a=>a.endsWith(`_${n}`));for(const a of i){const u=this._all.get(a);u&&t.push(u)}}return t.length?t:void 0}get(e){return this._all.get(e)}getInstance(e){return this._allInstance.get(e)}delete(e){this._all.delete(e),this._allInstance.delete(e)}}/**
77
77
  * @license
78
78
  * Copyright 2019 Google LLC
79
79
  * SPDX-License-Identifier: Apache-2.0
@@ -67553,7 +67553,7 @@ function nr(a, n, r) {
67553
67553
  function oh() {
67554
67554
  return new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
67555
67555
  }
67556
- const Fp = new Worker(new URL("" + new URL("assets/scriptsRunWorker-BZF14FNK.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run TccScript Server" });
67556
+ const Fp = new Worker(new URL("" + new URL("assets/scriptsRunWorker-gOaiI2Kb.js", import.meta.url).href, import.meta.url), { type: "module", name: "Run TccScript Server" });
67557
67557
  Fp.onerror = (a) => {
67558
67558
  console.error(a);
67559
67559
  };
@@ -67590,7 +67590,9 @@ self.MonacoEnvironment = {
67590
67590
  };
67591
67591
  Ri.config({
67592
67592
  paths: {
67593
- vs: "https://cdn.staticfile.net/monaco-editor/0.45.0/min/vs"
67593
+ // vs: "https://cdn.staticfile.net/monaco-editor/0.45.0/min/vs",
67594
+ vs: "https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.45.0/min/vs"
67595
+ // vs: "https://unpkg.com/monaco-editor@0.45.0/min/vs",
67594
67596
  },
67595
67597
  "vs/nls": { availableLanguages: { "*": "zh-cn" } }
67596
67598
  });