kline-orderbook-chart 2.1.0 → 2.2.1

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.
@@ -0,0 +1,19 @@
1
+ /*!
2
+ * chart-engine / kline-orderbook-chart
3
+ * Copyright (c) 2025-2026 Tape Delta. All rights reserved.
4
+ *
5
+ * Proprietary and confidential. Licensed, not sold. Unauthorized
6
+ * copying, redistribution, modification, reverse-engineering, or
7
+ * removal of this notice is strictly prohibited. See the LICENSE
8
+ * file shipped with this package for the full terms.
9
+ *
10
+ * Contact: support@tapedelta.com
11
+ * Web: https://tapedelta.com
12
+ * NPM: https://www.npmjs.com/package/kline-orderbook-chart
13
+ */
14
+ var $=C0;function Lt(){let e=["9494oYyjij","Unterminated comment","57cYrqxc","tokens","9lpOFmc","exec","has","424816MepFWm","name","directives","111725PINxVI"," (line ","let","else","Script is longer than ","false","const","num","===","102NIaJFo"," characters","1594616ODRYju","slice","true","1488426dycOqq","string","push","Script source must be text","isFinite","length","col","eof","TapeScriptError","Bad number","replace","find","230GjxRvo","for","Unterminated string","continue","351nLfjxn","str","211608LFAqlc","startsWith","**=","Unexpected character '","line","!==","indexOf","break","135366RKIUyl","trim","null","4fqbqJx"];return Lt=function(){return e},Lt()}(function(e,n){let t=C0,x=e();for(;;)try{if(-parseInt(t(295))/1*(parseInt(t(293))/2)+parseInt(t(317))/3+parseInt(t(292))/4*(parseInt(t(303))/5)+parseInt(t(312))/6*(parseInt(t(300))/7)+parseInt(t(314))/8*(parseInt(t(297))/9)+-parseInt(t(275))/10*(parseInt(t(289))/11)+parseInt(t(281))/12*(-parseInt(t(279))/13)===n)break;x.push(x.shift())}catch{x.push(x.shift())}})(Lt,719775);var Te=new Set([$(309),$(305),"function","if",$(306),$(276),"while","return",$(288),$(278),$(316),$(308),$(291)]),Ee=[$(311),$(286),$(283),"==","!=","<=",">=","&&","||","??","**","+=","-=","*=","/=","%=","++","--","=>","+","-","*","/","%","<",">","=","!","?",":",".",",",";","(",")","[","]","{","}"],D=class extends Error{constructor(n,t=0,x=0){let o=$;super(t?n+o(304)+t+":"+x+")":n),this[o(301)]=o(271),this[o(285)]=t,this[o(269)]=x}},N0=e=>e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"||e==="$",_t=e=>e>="0"&&e<="9",Oe=e=>N0(e)||_t(e),R0=2e5;function C0(e,n){return e=e-268,Lt()[e]}function P0(e){let n=$;if(typeof e!==n(318))throw new D(n(320));if(e[n(268)]>R0)throw new D(n(307)+R0+n(313));let t=[],x=[],o=0,h=1,r=0,f=e.length,m=()=>[h,o-r+1];for(;o<f;){let b=e[o];if(b===`
15
+ `){h++,o++,r=o;continue}if(b===" "||b===" "||b==="\r"){o++;continue}if(b==="/"&&e[o+1]==="/"){let s=e[n(287)](`
16
+ `,o),w=e.slice(o+2,s===-1?f:s)[n(290)](),u=/^@([a-zA-Z]+)\s*(.*)$/[n(298)](w);u&&x[n(319)]({name:u[1],text:u[2][n(290)](),line:h}),o=s===-1?f:s;continue}if(b==="/"&&e[o+1]==="*"){let s=e[n(287)]("*/",o+2);if(s===-1)throw new D(n(294),...m());for(let w=o;w<s;w++)e[w]===`
17
+ `&&(h++,r=w+1);o=s+2;continue}let[_,R]=m();if(_t(b)||b==="."&&_t(e[o+1])){let s=o;for(;s<f&&(_t(e[s])||e[s]==="."||e[s]==="_");)s++;if(e[s]==="e"||e[s]==="E")for(s++,(e[s]==="+"||e[s]==="-")&&s++;s<f&&_t(e[s]);)s++;let w=Number(e[n(315)](o,s)[n(273)](/_/g,""));if(!Number[n(321)](w))throw new D(n(272),_,R);let u={};u.t=n(310),u.v=w,u.line=_,u[n(269)]=R,t.push(u),o=s;continue}if(N0(b)){let s=o+1;for(;s<f&&Oe(e[s]);)s++;let w=e[n(315)](o,s);t.push({t:Te[n(299)](w)?"kw":"id",v:w,line:_,col:R}),o=s;continue}if(b==='"'||b==="'"){let s=o+1,w="";for(;s<f&&e[s]!==b;){if(e[s]===`
18
+ `)throw new D(n(277),_,R);if(e[s]==="\\"&&s+1<f){let I=e[s+1];w+=I==="n"?`
19
+ `:I==="t"?" ":I,s+=2;continue}w+=e[s++]}if(s>=f)throw new D(n(277),_,R);let u={};u.t=n(280),u.v=w,u[n(285)]=_,u[n(269)]=R,t[n(319)](u),o=s+1;continue}let T=Ee[n(274)](s=>e[n(282)](s,o));if(!T)throw new D(n(284)+b+"'",_,R);let y={};y.t="op",y.v=T,y[n(285)]=_,y[n(269)]=R,t[n(319)](y),o+=T[n(268)]}let c={};c.t=n(270),c.v="",c.line=h,c[n(269)]=o-r+1,t[n(319)](c);let d={};return d[n(296)]=t,d[n(302)]=x,d}var l0=F0;function Kt(){let e=["Index","Expected a key","**=","elems","test","null","' but found '","arg","Array","Unary","Expected a property name","while","Object","Cond","props","push","20SEPNvS","body","5750052HITQGt","7lWbSEo","986712vfAirG","end of file","ExprStmt","str","16ymVFRE","Expected a name but found '","' needs a value","===","Block","Invalid assignment target","break","Break","207513LIGbvI","FuncDecl","false","includes","Update","'const ","Empty","continue","6NIMhev","While","Invalid increment target","472605lDiiBS","col","const","Logical","VarDecl","1034781APwkvq","Program","148LwBXpy","name","for","12890RTNjcC","decls","Missing '}'","line","Lit","alt","Continue","expr","kind","eof","Ident","else","Functions can only be declared at the top level","cons","43037TPxpMC","Expected '","true","Member","Unexpected '","type","init"];return Kt=function(){return e},Kt()}(function(e,n){let t=F0,x=e();for(;;)try{if(parseInt(t(331))/1*(parseInt(t(378))/2)+parseInt(t(381))/3+-parseInt(t(388))/4*(parseInt(t(317))/5)+parseInt(t(358))/6*(parseInt(t(357))/7)+-parseInt(t(362))/8*(-parseInt(t(370))/9)+parseInt(t(354))/10*(parseInt(t(386))/11)+-parseInt(t(356))/12===n)break;x.push(x.shift())}catch{x.push(x.shift())}})(Kt,110797);var Y={};Y["??"]=1,Y["||"]=2,Y["&&"]=3,Y["=="]=4,Y["!="]=4,Y[l0(365)]=4,Y["!=="]=4,Y["<"]=5,Y[">"]=5,Y["<="]=5,Y[">="]=5,Y["+"]=6,Y["-"]=6,Y["*"]=7,Y["/"]=7,Y["%"]=7,Y["**"]=8;var ve=Y,Re=new Set(["=","+=","-=","*=","/=","%=",l0(340)]),B0=200;function F0(e,n){return e=e-316,Kt()[e]}function L0(e){let n=l0,{tokens:t,directives:x}=P0(e),o=0,h=(l=0)=>t[o+l],r=(l,p=h())=>new D(l,p[n(320)],p.col),f=(l,p=0)=>h(p).t==="op"&&h(p).v===l,m=l=>h().t==="kw"&&h().v===l,c=()=>t[o++],d=l=>{let p=n;if(!f(l))throw r(p(332)+l+p(344)+(h().v||"end of file")+"'");return c()},b=()=>{let l=n;if(h().t!=="id")throw r(l(363)+(h().v||"end of file")+"'");return c().v},_=()=>{f(";")&&c()},R=0,T=l=>(...p)=>{if(++R>B0)throw r("Code is nested more than "+B0+" levels deep");try{return l(...p)}finally{R--}};function y(){let l=n,p=[];for(;h().t!==l(326);)p[l(353)](s(!0));let a={};return a[l(336)]=l(387),a[l(355)]=p,a}let s=T(u),w=T(N);function u(l=!1){let p=n,a=h(),i=a[p(320)];if(a.t==="kw")switch(a.v){case p(383):case"let":{let U=S();return _(),U}case"function":if(!l)throw r(p(329));return M();case"if":{c(),d("(");let U=B();d(")");let z=s(),W=null;m(p(328))&&(c(),W=s());let X={};return X.type="If",X[p(342)]=U,X[p(330)]=z,X[p(322)]=W,X[p(320)]=i,X}case p(349):{c(),d("(");let U=B();return d(")"),{type:p(379),test:U,body:s(),line:i}}case p(316):return E();case"return":{c();let U=f(";")||f("}")||h().t===p(326)||h().line!==i?null:B();_();let z={};return z.type="Return",z[p(345)]=U,z[p(320)]=i,z}case p(368):c(),_();let P={};return P[p(336)]=p(369),P.line=i,P;case p(377):c(),_();let q={};return q.type=p(323),q[p(320)]=i,q;default:break}if(f("{"))return I();if(f(";")){c();let P={};return P[p(336)]=p(376),P[p(320)]=i,P}let k=B();_();let C={};return C[p(336)]="ExprStmt",C[p(324)]=k,C[p(320)]=i,C}function I(){let l=n,p=d("{")[l(320)],a=[];for(;!f("}");){if(h().t==="eof")throw r(l(319));a[l(353)](s())}c();let i={};return i[l(336)]=l(366),i[l(355)]=a,i[l(320)]=p,i}function S(){let l=n,p=c(),a=[];do{let k=h(),C=b(),P=null;if(f("="))c(),P=v();else if(p.v===l(383))throw r(l(375)+C+l(364),k);let q={};q[l(389)]=C,q[l(337)]=P,q[l(320)]=k.line,a[l(353)](q)}while(f(",")&&c());let i={};return i[l(336)]=l(385),i[l(325)]=p.v,i[l(318)]=a,i[l(320)]=p.line,i}function M(){let l=n,p=c()[l(320)],a=b();d("(");let i=[];for(;!f(")");)i[l(353)](b()),f(")")||d(",");return c(),{type:l(371),name:a,params:i,body:I(),line:p}}function E(){let l=n,p=c().line;d("(");let a=null;m("let")||m(l(383))?a=S():f(";")||(a={type:l(360),expr:B(),line:p}),d(";");let i=f(";")?null:B();d(";");let k=f(")")?null:B();return d(")"),{type:"For",init:a,test:i,update:k,body:s(),line:p}}let B=()=>v();function v(){let l=n,p=g();if(h().t==="op"&&Re.has(h().v)){let a=c();if(![l(327),l(334),l(338)][l(373)](p[l(336)]))throw r(l(367),a);return{type:"Assign",op:a.v,target:p,value:v(),line:a[l(320)]}}if(f("=>"))throw r("Arrow functions are not supported");return p}function g(){let l=n,p=A(1);if(!f("?"))return p;let a=c()[l(320)],i=v();return d(":"),{type:l(351),test:p,cons:i,alt:v(),line:a}}function A(l){let p=n,a=w();for(;;){let i=h(),k=i.t==="op"?ve[i.v]:void 0;if(k===void 0||k<l)return a;c();let C=A(i.v==="**"?k:k+1);a={type:i.v==="&&"||i.v==="||"||i.v==="??"?p(384):"Binary",op:i.v,l:a,r:C,line:i.line}}}function N(){let l=n,p=h();if(p.t==="op"&&(p.v==="!"||p.v==="-"||p.v==="+"))return c(),{type:l(347),op:p.v,arg:w(),line:p[l(320)]};if(p.t==="op"&&(p.v==="++"||p.v==="--"))return c(),{type:"Update",op:p.v,prefix:!0,target:O(L()),line:p.line};let a=L();if(f("++")||f("--")){let i=c();return{type:l(374),op:i.v,prefix:!1,target:O(a),line:i[l(320)]}}return a}function O(l){let p=n;if(![p(327),p(334),p(338)][p(373)](l[p(336)]))throw r(p(380));return l}function L(){let l=n,p=F();for(;;)if(f(".")){let a=c().line,i=h();if(i.t!=="id"&&i.t!=="kw")throw r(l(348));c(),p={type:l(334),obj:p,prop:i.v,line:a}}else if(f("[")){let a=c()[l(320)],i=B();d("]"),p={type:l(338),obj:p,index:i,line:a}}else if(f("(")){let a=c()[l(320)],i=[];for(;!f(")");)i[l(353)](v()),f(")")||d(",");c(),p={type:"Call",callee:p,args:i,line:a}}else return p}function F(){let l=n,p=c(),a=p[l(320)];switch(p.t){case"num":let i={};return i[l(336)]=l(321),i.v=p.v,i[l(320)]=a,i;case l(361):let k={};return k[l(336)]=l(321),k.v=p.v,k[l(320)]=a,k;case"id":let C={};return C[l(336)]=l(327),C[l(389)]=p.v,C[l(320)]=a,C;case"kw":let P={};if(P[l(336)]="Lit",P.v=!0,P[l(320)]=a,p.v===l(333))return P;let q={};if(q[l(336)]=l(321),q.v=!1,q[l(320)]=a,p.v===l(372))return q;let U={};if(U.type=l(321),U.v=null,U[l(320)]=a,p.v===l(343))return U;break;case"op":if(p.v==="("){let z=B();return d(")"),z}if(p.v==="["){let z=[];for(;!f("]");)z[l(353)](v()),f("]")||d(",");c();let W={};return W[l(336)]=l(346),W[l(341)]=z,W[l(320)]=a,W}if(p.v==="{"){let z=[];for(;!f("}");){let X=c();if(X.t!=="id"&&X.t!==l(361)&&X.t!=="kw")throw r(l(339),X);d(":"),z[l(353)]({key:String(X.v),value:v()}),f("}")||d(",")}c();let W={};return W[l(336)]=l(350),W[l(352)]=z,W[l(320)]=a,W}break;default:break}throw new D(l(335)+(p.v||l(359))+"'",p[l(320)],p[l(382)])}return{ast:y(),directives:x}}var K=U0;(function(e,n){let t=U0,x=e();for(;;)try{if(parseInt(t(291))/1*(parseInt(t(325))/2)+-parseInt(t(343))/3+parseInt(t(292))/4*(parseInt(t(302))/5)+parseInt(t(334))/6*(parseInt(t(342))/7)+parseInt(t(346))/8*(-parseInt(t(366))/9)+parseInt(t(332))/10+-parseInt(t(326))/11===n)break;x.push(x.shift())}catch{x.push(x.shift())}})(Ut,615580);var rt={};rt[K(316)]=2e6,rt.allocPerBatch=5e5,rt[K(352)]=2e6,rt[K(333)]=64,rt[K(321)]=1e4,rt[K(295)]=1e4,rt[K(354)]=1e4,rt[K(341)]=2e5,rt[K(361)]=200;var V=Object[K(348)](rt),Dt=new Set([K(355),K(297),K(303),"caller",K(298),K(336),K(287),K(324),K(293),K(338)]),G=class extends D{constructor(n,t){let x=K;super(n,t),this[x(349)]=x(363)}},et=class extends D{constructor(n,t,x){let o=K;super("'"+n+o(315)+t[o(322)]+o(319),x),this[o(349)]="TapeScriptPlanError",this[o(313)]=t.id,this.minPlan=t.minPlan}};function ot(e,n){let t=K;if(e[t(365)]-=n,e.alloc<0)throw new G(t(347),e[t(296)])}function Ut(){let e=["54oDtlak"," has no method '","arguments","methods","__lookupSetter__","Array is full ("," characters","sourceChars","500605PxGDKt","1301265dQFrMp","object","length","379792HglWmW","Script allocated too much memory in one batch","freeze","name","Cannot index ","Bad array index '","stateWeight","getters","stringLen","__proto__","array","assign","Key '","get","size","nestDepth","number","TapeScriptLimit","null","alloc","9VDIOAh","__defineGetter__","pop","create","Object is full (","1ohcXff","4ErIbAs","__lookupGetter__","kind","objectKeys","line","constructor","callee","has","includes","String longer than ","1291580nWuKwx","prototype","nParams","isInteger","' on ","function","Cannot set '","' of ","string","frame","' is not allowed","feature","Cannot read '","' needs the ","opsPerBatch","indexOf","shift"," plan","busy","arrayLen","minPlan","push","__defineSetter__","1979554PvQeDp","19300226RKsUSi","Array index ","slice","weight","undefined","isArray","9596470PqPohB","callDepth"];return Ut=function(){return e},Ut()}function K0(e,n){let t=K;if(typeof n===t(310)&&n[t(345)]>V[t(354)])throw new G(t(301)+V[t(354)]+t(340),e.line);return n}var p0=e=>Object[K(357)](Object[K(289)](null),e),J=class{constructor(n,t,x){let o=K;this[o(294)]=n,this[o(353)]=p0(t),this[o(337)]=p0(x),this[o(329)]=1}};function U0(e,n){return e=e-287,Ut()[e]}var ct=class{constructor(n,t){let x=K;this[x(349)]=n,this[x(304)]=t,this.nSlots=t,this.body=null,this[x(311)]=null,this[x(320)]=!1,this[x(296)]=0}};function tt(e){let n=K;return e===null?n(364):e===void 0?n(330):Array[n(331)](e)?n(356):e instanceof Map?n(344):e instanceof J?e[n(294)]:e instanceof ct?n(307):typeof e}var st=(e,n)=>{let t=K;throw new D(n,e[t(296)])};function h0(e,n,t){let x=K;if(t===x(345)&&Array[x(331)](n))return n.length;if(n instanceof J){let o=n[x(353)][t];return o?o():st(e,n[x(294)]+" has no property '"+t+"'")}return n instanceof Map?n[x(359)](t):t===x(345)&&(Array[x(331)](n)||typeof n===x(310))?n.length:st(e,x(314)+t+x(309)+tt(n))}function b0(e,n,t,x){let o=K;if(!(n instanceof Map))return st(e,o(308)+t+o(306)+tt(n));if(!n.has(t)){if(n[o(360)]>=V[o(295)])throw new G(o(290)+V[o(295)]+" keys)",e[o(296)]);ot(e,1)}return n.set(t,x),x}function d0(e,n){let t=K;return(typeof n!==t(362)||!Number[t(305)](n)||n<0)&&st(e,t(351)+n+"'"),n}function m0(e,n,t){let x=K;return Array[x(331)](n)?n[d0(e,t)]:n instanceof Map?(Dt.has(t)&&st(e,x(358)+t+x(312)),n[x(359)](t)):typeof n===x(310)?n[d0(e,t)]:st(e,x(350)+tt(n))}function D0(e,n,t,x){let o=K;if(Array[o(331)](n)){let h=d0(e,t);if(h>=V.arrayLen||h>n.length)throw new G(o(327)+h+" out of range (max "+V[o(321)]+")",e.line);return h===n[o(345)]&&ot(e,1),n[h]=x,x}return n instanceof Map?(Dt[o(299)](t)&&st(e,o(358)+t+o(312)),b0(e,n,t,x)):st(e,"Cannot index "+tt(n))}var Ne=p0({push(e,n,t){let x=K;if(n[x(345)]+t[x(345)]>V[x(321)])throw new G(x(339)+V[x(321)]+")",e.line);ot(e,t[x(345)]);for(let o=0;o<t[x(345)];o++)n[x(323)](t[o]);return n[x(345)]},pop:(e,n)=>n[K(288)](),shift:(e,n)=>n[K(318)](),indexOf:(e,n,t)=>n[K(317)](t[0]),includes:(e,n,t)=>n[K(300)](t[0]),slice:(e,n,t)=>{let x=K,o=n[x(328)](t[0],t[1]);return ot(e,o[x(345)]),o}});function H0(e,n){let t=K,x=new Set,o=e.slice(),h=0;for(;o[t(345)]&&h<=n;){let r=o[t(288)]();if(typeof r===t(310)){h+=1+(r.length>>3);continue}if(!(r===null||typeof r!="object"||x[t(299)](r)))if(x.add(r),Array[t(331)](r)){h+=1+r[t(345)];for(let f=0;f<r[t(345)];f++)o[t(323)](r[f])}else if(r instanceof Map){h+=1+r[t(360)];for(let[f,m]of r)o[t(323)](f),o[t(323)](m)}else h+=r instanceof J?r[t(329)]:1}return h}function q0(e,n,t,x){let o=K;if(n instanceof J){let h=n.methods[t];return h?h(x):st(e,n[o(294)]+o(335)+t+"'")}if(Array[o(331)](n)){let h=Ne[t];if(h)return h(e,n,x)}return st(e,tt(n)+o(335)+t+"'")}var w0=ut;(function(e,n){let t=ut,x=e();for(;;)try{if(-parseInt(t(388))/1+parseInt(t(400))/2*(parseInt(t(416))/3)+-parseInt(t(379))/4+parseInt(t(375))/5*(-parseInt(t(395))/6)+parseInt(t(374))/7*(-parseInt(t(401))/8)+-parseInt(t(419))/9+parseInt(t(367))/10===n)break;x.push(x.shift())}catch{x.push(x.shift())}})(Ht,468133);function ut(e,n){return e=e-363,Ht()[e]}var Z={};function Ht(){let e=["obj","Member","resolve","line","Built-in '","6fzxArf","read","Unary","Cannot assign to '","Assign","214TzJGCO","8xcaNMP","' is not allowed","global","slice","Cannot add ","Binary","index","invoke","write","value","prop","length"," is not a function","object","Call","1254Aunjyn","' can only be called","prefix","5428530vejQlg","Property '","local","target","!==","arg","kind","key","Ident","Unknown operator '","31818470CSCPdC","cons","number","args","Update","type","name","783342wWJUsK","4146315HaOqwr","map","has","slot","2582724Iynyfq","isConst","Logical","host","Object"," and ","===","Lit","' on ","568420cuvaYo","Cannot use '"];return Ht=function(){return e},Ht()}Z["+"]=(e,n)=>e+n,Z["-"]=(e,n)=>e-n,Z["*"]=(e,n)=>e*n,Z["/"]=(e,n)=>e/n,Z["%"]=(e,n)=>e%n,Z["**"]=(e,n)=>e**n,Z["=="]=(e,n)=>e===n,Z["!="]=(e,n)=>e!==n,Z[w0(385)]=(e,n)=>e===n,Z[w0(423)]=(e,n)=>e!==n,Z["<"]=(e,n)=>e<n,Z[">"]=(e,n)=>e>n,Z["<="]=(e,n)=>e<=n,Z[">="]=(e,n)=>e>=n;var z0=Z;function W0(e){let n=w0,{rt:t,G:x}=e,o=(y,s)=>new D(y,s[n(393)]);function h(y,s){let w=n;if(Dt[w(377)](y))throw o(w(420)+y+w(402),s)}function r(y){let s=n;switch(y[s(372)]){case s(386):{let w=y.v;return()=>w}case s(365):return d(y);case"Array":{let w=y.elems[s(376)](r),u=w[s(412)]+1;return I=>{let S=s;return ot(t,u),w[S(376)](M=>M(I))}}case s(383):{let w=y.props[s(376)](I=>{let S=s;return h(I[S(364)],y),[I[S(364)],r(I.value)]}),u=w[s(412)]+1;return I=>{let S=s;ot(t,u);let M=new Map;for(let E=0;E<w[S(412)];E++)M.set(w[E][0],w[E][1](I));return M}}case s(397):{let w=r(y[s(424)]);if(y.op==="!")return I=>!w(I);let u=y.op==="-";return I=>{let S=s,M=w(I);if(M!==null&&typeof M===S(414))throw new D(S(389)+y.op+"' on "+tt(M),t[S(393)]);return u?-M:+M}}case s(406):return c(y.op,r(y.l),r(y.r));case s(381):{let w=r(y.l),u=r(y.r);return y.op==="&&"?I=>w(I)&&u(I):y.op==="||"?I=>w(I)||u(I):I=>w(I)??u(I)}case"Cond":{let w=r(y.test),u=r(y[s(368)]),I=r(y.alt);return S=>w(S)?u(S):I(S)}case s(391):{h(y.prop,y);let w=r(y[s(390)]),u=y[s(411)];return I=>h0(t,w(I),u)}case"Index":{let w=r(y[s(390)]),u=r(y[s(407)]);return I=>m0(t,w(I),u(I))}case s(399):return _(y);case s(371):return R(y);case s(415):return T(y);default:throw o("Unsupported expression '"+y[s(372)]+"'",y)}}function f(y,s){let w=n;if(y!==null&&typeof y===w(414)||s!==null&&typeof s===w(414))throw new D(w(405)+tt(y)+w(384)+tt(s),t[w(393)]);return K0(t,y+s)}function m(y,s,w){let u=n;if(s!==null&&typeof s===u(414)||w!==null&&typeof w===u(414))throw new D(u(389)+y+u(387)+tt(s)+u(384)+tt(w),t[u(393)]);return z0[y](s,w)}function c(y,s,w){let u=n;switch(y){case"+":return I=>{let S=s(I),M=w(I);return typeof S=="number"&&typeof M=="number"?S+M:f(S,M)};case"-":return I=>{let S=ut,M=s(I),E=w(I);return typeof M===S(369)&&typeof E===S(369)?M-E:m(y,M,E)};case"*":return I=>{let S=ut,M=s(I),E=w(I);return typeof M===S(369)&&typeof E===S(369)?M*E:m(y,M,E)};case"/":return I=>{let S=ut,M=s(I),E=w(I);return typeof M===S(369)&&typeof E=="number"?M/E:m(y,M,E)};case"%":return I=>{let S=ut,M=s(I),E=w(I);return typeof M===S(369)&&typeof E===S(369)?M%E:m(y,M,E)};case"**":return I=>{let S=ut,M=s(I),E=w(I);return typeof M===S(369)&&typeof E=="number"?M**E:m(y,M,E)};case"==":case u(385):return I=>s(I)===w(I);case"!=":case u(423):return I=>s(I)!==w(I);case"<":return I=>{let S=u,M=s(I),E=w(I);return typeof M===S(369)&&typeof E===S(369)?M<E:m(y,M,E)};case">":return I=>{let S=u,M=s(I),E=w(I);return typeof M===S(369)&&typeof E===S(369)?M>E:m(y,M,E)};case"<=":return I=>{let S=u,M=s(I),E=w(I);return typeof M===S(369)&&typeof E===S(369)?M<=E:m(y,M,E)};case">=":return I=>{let S=u,M=s(I),E=w(I);return typeof M===S(369)&&typeof E===S(369)?M>=E:m(y,M,E)};default:throw new D(u(366)+y+"'",t[u(393)])}}function d(y){let s=n,w=e.resolve(y.name,y);switch(w[s(363)]){case s(421):{let u=w[s(378)];return I=>I[u]}case s(403):{let u=w[s(378)];return()=>x[u]}case"fn":{let u=w.fn;return()=>u}case s(382):{let u=w.v;return()=>u}default:throw o(s(394)+y[s(373)]+s(417),y)}}function b(y){let s=n;if(y.type===s(365)){let w=e[s(392)](y.name,y);if(w[s(363)]!==s(421)&&w[s(363)]!==s(403))throw o(s(398)+y[s(373)]+"'",y);if(w[s(380)])throw o("'"+y[s(373)]+"' is const",y);let u=w.slot,I={};if(I.read=M=>M[u],I[s(409)]=(M,E)=>M[u]=E,w[s(363)]===s(421))return I;let S={};return S[s(396)]=()=>x[u],S[s(409)]=(M,E)=>x[u]=E,S}if(y.type===s(391)){h(y[s(411)],y);let w=y[s(411)];return{objOf:r(y[s(390)]),keyOf:()=>w,read:(u,I)=>h0(t,I,w),write:(u,I,S)=>b0(t,S,w,I)}}return{objOf:r(y[s(390)]),keyOf:r(y[s(407)]),read:(w,u,I)=>m0(t,u,I),write:(w,u,I,S)=>D0(t,I,S,u)}}function _(y){let s=n,{read:w,write:u,objOf:I,keyOf:S}=b(y[s(422)]),M=r(y[s(410)]),E=y.op[s(404)](0,-1),B=y.op==="="?null:E==="+"?(v,g)=>typeof v=="number"&&typeof g===s(369)?v+g:f(v,g):(v,g)=>typeof v=="number"&&typeof g===s(369)?z0[E](v,g):m(E,v,g);if(!I){if(!B)return g=>u(g,M(g));let v=c(y.op[s(404)](0,-1),w,M);return g=>u(g,v(g))}return B?v=>{let g=I(v),A=S(v);return u(v,B(w(v,g,A),M(v)),g,A)}:v=>{let g=I(v),A=S(v);return u(v,M(v),g,A)}}function R(y){let s=n,{read:w,write:u,objOf:I,keyOf:S}=b(y[s(422)]),M=y.op==="++"?1:-1,E=y[s(418)],B=v=>{let g=s;if(v!==null&&typeof v===g(414))throw new D("Cannot use '"+y.op+g(387)+tt(v),t.line);return+v};return I?v=>{let g=I(v),A=S(v),N=B(w(v,g,A));return u(v,N+M,g,A),E?N+M:N}:v=>{let g=B(w(v));return u(v,g+M),E?g+M:g}}function T(y){let s=n,w=y[s(370)][s(376)](r),u=w[s(412)],I=B=>{let v=new Array(u);for(let g=0;g<u;g++)v[g]=w[g](B);return v},{callee:S}=y,M=y[s(393)];if(S.type===s(391)){h(S[s(411)],S);let B=r(S[s(390)]),v=S.prop;return g=>{let A=s,N=B(g);return t[A(393)]=M,q0(t,N,v,I(g))}}if(S[s(372)]===s(365)){let B=e[s(392)](S.name,S);if(B[s(363)]==="fn"){let v=B.fn;return g=>e[s(408)](v,w,g)}if(B[s(363)]==="hostfn"){let v=B.fn;return u===0?()=>{let g=s;return t[g(393)]=M,v()}:u===1?g=>{let A=s,N=w[0](g);return t[A(393)]=M,v(N)}:u===2?g=>{let A=s,N=w[0](g),O=w[1](g);return t[A(393)]=M,v(N,O)}:g=>{let A=I(g);return t.line=M,v(...A)}}}let E=r(S);return B=>{let v=s,g=E(B);if(!(g instanceof ct))throw new D(tt(g)+v(413),M);return e[v(408)](g,w,B)}}return r}(function(e,n){let t=G0,x=e();for(;;)try{if(parseInt(t(368))/1*(parseInt(t(411))/2)+parseInt(t(400))/3*(parseInt(t(412))/4)+parseInt(t(434))/5*(parseInt(t(403))/6)+-parseInt(t(426))/7+parseInt(t(369))/8+parseInt(t(413))/9*(parseInt(t(423))/10)+-parseInt(t(398))/11===n)break;x.push(x.shift())}catch{x.push(x.shift())}})(qt,237755);function G0(e,n){return e=e-366,qt()[e]}function qt(){let e=["type","6gbROCd","ExprStmt","update","For","map","params","global","VarDecl","4616XfhGus","12EOlzbu","1071XGKIRK","busy","Duplicate parameter '","pending","frame","arg","init","alt","fill","While","4340MwdfbU","nested","' is already declared","2928058sTtYqC","const","nSlots","get","body","cons","isConst","Script used too much CPU in one batch","398635aFSVWE","name","local","Calls nested too deep","Unsupported statement '","75xEjbpb","2165040NjRMND","Continue","expr","kind","line","'return' outside a function","test","locked","length","size","alloc","nParams","opsPerBatch","forEach","ops","allocPerBatch","scopes","' is a built-in name","has","Block","callDepth","depth","FuncDecl","ret","push","Unknown name '","slot","decls","set","3224067UXPudN","pop","374043OKSvnz","Return"];return qt=function(){return e},qt()}var it=0,y0=1,Ce=2,Mt=3;function Y0(e,n){let t=G0,{ast:x,directives:o}=L0(e),h={};h[t(373)]=0,h[t(383)]=V[t(381)],h[t(379)]=V[t(384)],h[t(390)]=0,h[t(392)]=void 0;let r=h,f=[],m=new Map,c=new Map,d=null,b=(g,A)=>new D(g,A[t(373)]);function _(g,A,N){let O=t;if(n[O(387)](g))throw b("'"+g+O(386),N);if(d){let a=d[O(385)][d.scopes[O(377)]-1];if(a[O(387)](g))throw b("'"+g+O(425),N);let i={};i[O(372)]=O(436),i[O(395)]=d.fn[O(428)]++,i.isConst=A;let k=i;return a[O(397)](g,k),k}let L=m[O(429)](g),F=I>0;if(L&&!L.pending&&!(F&&L[O(424)]))throw b("'"+g+O(425),N);let l={};l.kind=O(409),l[O(395)]=f[O(377)],l[O(432)]=A,l.nested=F;let p=L||l;return!L&&(f[O(393)](void 0),m[O(397)](g,p)),p[O(416)]=!1,p[O(432)]=A,p}function R(g,A){let N=t;if(d)for(let l=d[N(385)][N(377)]-1;l>=0;l--){let p=d[N(385)][l][N(429)](g);if(p)return p}let O=c[N(429)](g);if(O)return{kind:"fn",fn:O};let L=m[N(429)](g);if(L)return L;let F=n[N(429)](g);if(F&&F[N(372)]===N(376))throw new et(g,F.feature,A[N(373)]);if(F)return F;throw b(N(394)+g+"'",A)}function T(g,A,N){let O=t;if(--r[O(383)]<0)throw new G("Script used too much CPU in one batch",r[O(373)]);if(r[O(390)]>=V.callDepth)throw new G(O(366),r.line);let L=A[O(377)],F=L>0?A[0](N):void 0,l=L>1?A[1](N):void 0,p=L>2?A[2](N):void 0,a=L>3?A[3](N):void 0,i=null;if(L>4){i=[];for(let P=4;P<L;P++)i[O(393)](A[P](N))}let k=y(g),C=g[O(380)];C>0&&(k[0]=F),C>1&&(k[1]=l),C>2&&(k[2]=p),C>3&&(k[3]=a);for(let P=4;P<C;P++)k[P]=i&&P-4<i.length?i[P-4]:void 0;return s(g,k)}function y(g){let A=t;if(g.busy)return new Array(g[A(428)]);let N=g[A(417)]||(g[A(417)]=new Array(g.nSlots));return N[A(421)](void 0),N}function s(g,A){let N=t,O=g.busy;g.busy=!0,r[N(390)]++,r[N(392)]=void 0;try{g.body(A);let L=r[N(392)];return r[N(392)]=void 0,L}finally{r[N(390)]--,g[N(414)]=O}}let w={};w.rt=r,w.G=f,w.resolve=R,w.invoke=T;let u=W0(w),I=0;function S(g){let A=t;if(!d){I++;try{return g()}finally{I--}}d.scopes[A(393)](new Map);try{return g()}finally{d[A(385)][A(399)]()}}function M(g){let A=t,N=g[A(407)](B),O=N[A(377)];return O===1?N[0]:L=>{for(let F=0;F<O;F++){let l=N[F](L);if(l!==it)return l}return it}}function E(g){let A=t;if(--r.ops<0)throw new G(A(433),g)}function B(g){let A=t,N=g[A(373)];switch(g.type){case"Empty":return()=>it;case A(404):{let O=u(g[A(371)]);return L=>(r.line=N,O(L),it)}case A(410):{let O=g[A(396)].map(L=>{let F=A,l=L[F(419)]?u(L[F(419)]):null,p=_(L[F(435)],g[F(372)]===F(427),L),a=p[F(395)];return p[F(372)]==="local"?l?i=>{i[a]=l(i)}:i=>{i[a]=void 0}:l?i=>{f[a]=l(i)}:()=>{f[a]=void 0}});return L=>{let F=A;r[F(373)]=N;for(let l=0;l<O[F(377)];l++)O[l](L);return it}}case A(388):return S(()=>M(g[A(430)]));case"If":{let O=u(g[A(375)]),L=S(()=>B(g[A(431)])),F=g.alt?S(()=>B(g[A(420)])):null;return F?l=>{let p=A;return r[p(373)]=N,O(l)?L(l):F(l)}:l=>{let p=A;return r[p(373)]=N,O(l)?L(l):it}}case A(422):{let O=u(g.test),L=S(()=>B(g[A(430)]));return F=>{let l=A;for(r[l(373)]=N;O(F);){E(N);let p=L(F);if(p===y0)break;if(p===Mt)return Mt}return it}}case A(406):return S(()=>{let O=A,L=g.init?B(g[O(419)]):null,F=g[O(375)]?u(g[O(375)]):null,l=g.update?u(g[O(405)]):null,p=S(()=>B(g[O(430)]));return a=>{for(r.line=N,L&&L(a);!F||F(a);l&&l(a)){E(N);let i=p(a);if(i===y0)break;if(i===Mt)return Mt}return it}});case A(401):{if(!d)throw b(A(374),g);let O=g[A(418)]?u(g[A(418)]):null;return L=>{let F=A;return r[F(392)]=O?O(L):void 0,Mt}}case"Break":return()=>y0;case A(370):return()=>Ce;case A(391):return()=>it;default:throw b(A(367)+g[A(402)]+"'",g)}}for(let g of x[t(430)])if(g[t(402)]===t(391)){if(c.has(g[t(435)])||n[t(387)](g[t(435)]))throw b("'"+g[t(435)]+t(425),g);let A=new ct(g.name,g[t(408)].length);A[t(373)]=g[t(373)],c[t(397)](g[t(435)],A)}else if(g[t(402)]==="VarDecl")for(let A of g[t(396)]){if(m[t(387)](A[t(435)])||c[t(387)](A.name))throw b("'"+A[t(435)]+t(425),A);if(n[t(387)](A[t(435)]))throw b("'"+A[t(435)]+t(386),A);let N={};N[t(372)]=t(409),N.slot=f[t(377)],N[t(432)]=g[t(372)]===t(427),N.pending=!0,m[t(397)](A[t(435)],N),f[t(393)](void 0)}for(let g of x[t(430)]){if(g[t(402)]!==t(391))continue;let A=c[t(429)](g[t(435)]);d={fn:A,scopes:[new Map]},g[t(408)][t(382)](N=>{let O=t;if(d[O(385)][0][O(387)](N))throw b(O(415)+N+"'",g);d.scopes[0][O(397)](N,{kind:O(436),slot:d[O(385)][0][O(378)],isConst:!1})}),A[t(430)]=M(g[t(430)][t(430)]),d=null}let v=M(x[t(430)]);return{rt:r,G:f,directives:o,functions:c,init(){v(f)},call(g,A,N,O,L,F,l,p){let a=t;if(r.depth>=V[a(389)])throw new G(a(366),r[a(373)]);if(--r[a(383)]<0)throw new G("Script used too much CPU in one batch",r[a(373)]);let i=y(g),k=g.nParams;return k>0&&(i[0]=A),k>1&&(i[1]=N),k>2&&(i[2]=O),k>3&&(i[3]=L),k>4&&(i[4]=F),k>5&&(i[5]=l),k>6&&(i[6]=p),s(g,i)}}}var ht=j0;function Wt(){let e=["trim","text","token","4291350JQcXXd","8iGeKRS","9204057CUcIth","inputs","Bad @history \u2014 use: 30m or 2h","some","int","float","name","3vdrrrO","label","telegram","intervalMs","endsWith","error","string","15843PRCgAb","input","621022XgImqW","Untitled","split","bool","3747530CgrkCt","type","max","push","1503580TSVbys","test","Duplicate @input '","5859476vwQXVm","Bad @interval \u2014 use: 250ms or 1s","historyMs","line","slice","dflt","exec","true","history","chat","startsWith","844HyrqBj","isFinite","min"];return Wt=function(){return e},Wt()}(function(e,n){let t=j0,x=e();for(;;)try{if(-parseInt(t(323))/1*(parseInt(t(332))/2)+-parseInt(t(330))/3*(-parseInt(t(354))/4)+-parseInt(t(340))/5+-parseInt(t(314))/6+parseInt(t(343))/7*(parseInt(t(315))/8)+parseInt(t(316))/9+-parseInt(t(336))/10===n)break;x.push(x.shift())}catch{x.push(x.shift())}})(Wt,651805);var Pe=/^([A-Za-z_]\w*)\s*:\s*(float|int|bool|string|color)\s*=\s*("(?:[^"\\]|\\.)*"|\S+)\s*(?:"([^"]*)")?$/,Be=50,Fe=6e4,Le=6e4,Ke=4*36e5,zt={};zt.s=1e3,zt.m=6e4,zt.h=36e5;function j0(e,n){return e=e-311,Wt()[e]}var Ue=zt,De=/^\d{5,12}:[A-Za-z0-9_-]{30,64}$/,He=/^(-?\d{1,20}|@[A-Za-z0-9_]{5,32})$/,V0=e=>e[ht(353)]('"')&&e[ht(327)]('"')?e[ht(347)](1,-1):e;function qe(e){let n=ht,[t="",x=""]=e[n(311)]()[n(334)](/\s+/),o={};if(o[n(313)]="",o.chat="",o.error=n(313),!De[n(341)](t))return o;let h={};if(h[n(313)]="",h.chat="",h[n(328)]=n(352),x&&!He.test(x))return h;let r={};return r.token=t,r[n(352)]=x,r[n(328)]="",r}function g0(e,n){let t=ht;switch(e[t(337)]){case"float":{let x=Number(n);return Number[t(355)](x)?x:e[t(348)]}case t(320):{let x=Math.trunc(Number(n));return Number.isFinite(x)?x:e[t(348)]}case t(335):return n===!0||n===t(350);default:return typeof n===t(329)?n:e[t(348)]}}function X0(e){let n=ht,t={};t.name=n(333),t[n(317)]=[],t[n(326)]=0,t[n(345)]=0,t[n(325)]=null;let x=t;for(let o of e)if(o[n(322)]===n(322))x[n(322)]=V0(o[n(312)])[n(347)](0,80)||x[n(322)];else if(o[n(322)]===n(331)){let h=Pe[n(349)](o[n(312)]);if(!h)throw new D('Bad @input \u2014 use: name: float = 1 "Label"',o[n(346)]);let r={};r[n(322)]=h[1],r[n(337)]=h[2],r[n(324)]=h[4]||h[1],r[n(348)]=void 0;let f=r;if(x[n(317)][n(319)](c=>c.name===f[n(322)]))throw new D(n(342)+f.name+"'",o.line);let m=V0(h[3]);f[n(348)]=g0({type:f.type,dflt:f[n(337)]===n(335)?!1:f[n(337)]===n(321)||f.type===n(320)?0:""},m),x.inputs[n(339)](f)}else if(o[n(322)]==="interval"){let h=/^(\d+(?:\.\d+)?)\s*(ms|s)?$/[n(349)](o.text);if(!h)throw new D(n(344),o[n(346)]);let r=Number(h[1])*(h[2]==="s"?1e3:1);x.intervalMs=Math.min(Fe,Math[n(338)](Be,r))}else if(o[n(322)]===n(351)){let h=/^(\d+(?:\.\d+)?)\s*(s|m|h)$/.exec(o[n(312)]);if(!h)throw new D(n(318),o[n(346)]);let r=Number(h[1])*Ue[h[2]];x[n(345)]=Math[n(356)](Ke,Math.max(Le,r))}else o.name===n(325)&&(x.telegram=qe(o[n(312)]));return x}var bt=te;function te(e,n){return e=e-161,Yt()[e]}(function(e,n){let t=te,x=e();for(;;)try{if(parseInt(t(164))/1*(-parseInt(t(171))/2)+-parseInt(t(167))/3*(-parseInt(t(174))/4)+-parseInt(t(176))/5*(-parseInt(t(184))/6)+parseInt(t(180))/7+parseInt(t(187))/8+parseInt(t(165))/9+-parseInt(t(169))/10*(parseInt(t(186))/11)===n)break;x.push(x.shift())}catch{x.push(x.shift())}})(Yt,365572);var Gt=e=>Math[bt(182)](e*1e8);function Yt(){let e=["mid","round","bestBid","532692XJJawT","sort","22HiLMGi","4818520WdFIgq","bestAsk","isFinite","length","8XjnEHj","4154364UPQNFC","bestAskSize","419277CdBRDe","time","9722950AFmWSX","abs","142444icJFEH","asks","rowTick","20KYEjVw","push","40sQHieA","forEach","bestBidSize","bids","2848832tXbThx"];return Yt=function(){return e},Yt()}function J0(e,n){let t=bt,x=!0;for(let r=2;r<e[t(163)];r+=2)if(n?e[r]>=e[r-2]:e[r]<=e[r-2]){x=!1;break}if(x)return e;let o=[];for(let r=0;r+1<e[t(163)];r+=2)e[r]>0&&o[t(175)](r);o[t(185)]((r,f)=>n?e[f]-e[r]:e[r]-e[f]);let h=new Float64Array(o[t(163)]*2);return o[t(177)]((r,f)=>{h[2*f]=e[r],h[2*f+1]=e[r+1]}),h}function Z0(e){let n=bt,t=1/0;for(let x=2;x<e[n(163)]&&x<34;x+=2){let o=Math[n(170)](e[x]-e[x-2]);o>0&&o<t&&(t=o)}return Number[n(162)](t)?t:0}function $0(e,n,t,x,o,h,r){let f=bt,m=0,c=0;for(;m<e[f(163)]||c<n[f(163)];){let d=m<e[f(163)]?Gt(e[m]):null,b=c<n.length?Gt(n[c]):null;d!==null&&b!==null&&d===b?(e[m+1]!==n[c+1]&&r(x,n[c],n[c+1]),m+=2,c+=2):d===null||b!==null&&(t?b>d:b<d)?(r(x,n[c],n[c+1]),c+=2):(e[m+1]>0&&d>=o&&d<=h&&r(x,e[m],0),m+=2)}}function Q0(e,n,t,x){let o=bt,h=0,r=(e[o(163)]>>1)-1;for(;h<=r;){let f=h+r>>1,m=e[2*f];if(Math.abs(m-t)<=x)return e[2*f+1];(n?m>t:m<t)?h=f+1:r=f-1}return 0}function ee(){let e=bt,n=new Float64Array(0),t={};t[e(179)]=n,t[e(172)]=n,t[e(173)]=0,t[e(168)]=0,t[e(181)]=0,t.bestBid=0,t[e(161)]=0,t[e(178)]=0,t[e(166)]=0;let x=t;return{state:x,apply(o,h,r,f,m){let c=e,d=J0(h,!0),b=J0(r,!1);if(x[c(168)]=o,x[c(181)]=f,x.rowTick=Z0(d)||Z0(b)||x[c(173)],m){let w=d[c(163)]?Gt(d[d[c(163)]-2]):0,u=b[c(163)]?Gt(b[b.length-2]):0;$0(x.bids,d,!0,0,w,u,m),$0(x[c(172)],b,!1,1,w,u,m)}x.bids=d,x[c(172)]=b;let _=d[c(163)]?d[0]:0,R=d[c(163)]?d[1]:0,T=b[c(163)]?b[0]:0,y=b[c(163)]?b[1]:0,s=_!==x[c(183)]||T!==x.bestAsk||R!==x[c(178)]||y!==x.bestAskSize;return x[c(183)]=_,x[c(178)]=R,x.bestAsk=T,x.bestAskSize=y,s},sizeAt(o){let h=e,r=x.rowTick>0?x[h(173)]/2:1e-9;return x[h(179)].length&&o<=x[h(179)][0]+r?Q0(x[h(179)],!0,o,r):x[h(172)].length&&o>=x[h(172)][0]-r?Q0(x.asks,!1,o,r):0}}}var H=ne;(function(e,n){let t=ne,x=e();for(;;)try{if(-parseInt(t(441))/1+parseInt(t(427))/2+-parseInt(t(443))/3*(-parseInt(t(430))/4)+parseInt(t(425))/5+-parseInt(t(424))/6*(-parseInt(t(432))/7)+parseInt(t(421))/8+-parseInt(t(417))/9*(parseInt(t(440))/10)===n)break;x.push(x.shift())}catch{x.push(x.shift())}})(Vt,580937);var Tt={};function ne(e,n){return e=e-412,Vt()[e]}Tt.id=H(434),Tt[H(446)]=H(442),Tt.handlers=[H(438),H(415),H(412)],Tt.builtins=[];var Et={};Et.id="tapeScript.depth",Et[H(446)]="premium",Et[H(431)]=["onDepth"],Et[H(423)]=[];var Ot={};Ot.id=H(436),Ot.minPlan="premium",Ot[H(431)]=[H(428),H(426)],Ot.builtins=[H(414)];var vt={};vt.id=H(445),vt[H(446)]=H(435),vt[H(431)]=[],vt[H(423)]=[H(422)];var Rt={};function Vt(){let e=["9099384ywjSGK","speak","builtins","2490eHbSmF","4480525yaVrYT","onIceberg","1338042pYyPMO","onOrder","find","293596xEyval","handlers","4151PzLiOM","includes","tapeScript","premium","tapeScript.orders","slots","onTrade","max","23710qCEbUR","1008308kRWWxx","basic","24nitFLP","filter","tapeScript.voice","minPlan","onInterval","isFinite","orders","onBbo","ultimate","7389DEnWuQ","freeze","map","features"];return Vt=function(){return e},Vt()}Rt.id="tapeScript.history",Rt[H(446)]=H(416),Rt.handlers=[],Rt[H(423)]=[];var mt=Object[H(418)]([Tt,Et,Ot,vt,Rt]),I0={};I0[H(446)]=H(442),I0[H(437)]=2;var k0={};k0[H(446)]="premium",k0[H(437)]=5;var S0={};S0[H(446)]=H(416),S0[H(437)]=12;var tx=Object[H(418)]([I0,k0,S0]);function xe(e){let n=H;return mt[n(429)](t=>t[n(431)][n(433)](e)||t.builtins[n(433)](e))||null}(function(e,n){let t=Nt,x=e();for(;;)try{if(parseInt(t(461))/1*(-parseInt(t(483))/2)+-parseInt(t(486))/3+parseInt(t(477))/4*(-parseInt(t(474))/5)+parseInt(t(471))/6*(-parseInt(t(475))/7)+parseInt(t(470))/8*(parseInt(t(487))/9)+parseInt(t(468))/10+parseInt(t(453))/11*(parseInt(t(472))/12)===n)break;x.push(x.shift())}catch{x.push(x.shift())}})(jt,646569);var A0=1e4,ze=65536;function We(e){let n=new Float64Array(e),t=new Float64Array(e),x=new Float64Array(e),o=0,h=0,r=0,f=0,m=0,c=0,d=0,b=0,_=y=>n[y%e];function R(y){let s=m%e;if(c===e){let u=n[s];d-=u,b-=u*u}else c++;n[s]=y,d+=y,b+=y*y;let w=m-e+1;for(;h&&t[o]<w;)o=(o+1)%e,h--;for(;f&&x[r]<w;)r=(r+1)%e,f--;for(;h&&_(t[(o+h-1)%e])<=y;)h--;for(t[(o+h)%e]=m,h++;f&&_(x[(r+f-1)%e])>=y;)f--;if(x[(r+f)%e]=m,f++,m++,m%ze===0){d=0,b=0;for(let u=0;u<c;u++){let I=n[u];d+=I,b+=I*I}}}function T(){m=0,c=0,d=0,b=0,o=h=r=f=0}return{add:R,clear:T,get:{sum:()=>d,mean:()=>c?d/c:NaN,min:()=>f?_(x[r]):NaN,max:()=>h?_(t[o]):NaN,std:()=>c?Math.sqrt(Math.max(0,b/c-(d/c)**2)):NaN,count:()=>c,full:()=>c===e,last:()=>c?_(m-1):NaN}}}function Ge(e,n){let t=new Float64Array(n),x=new Float64Array(n),o=0,h=0,r=0,f=-1/0,m=c=>{for(;h&&t[o]<=c-e;)r-=x[o],o=(o+1)%n,h--};return{add(c,d){c>f&&(f=c),h===n&&(r-=x[o],o=(o+1)%n,h--);let b=(o+h)%n;t[b]=c,x[b]=d,h++,r+=d,m(f)},advance(c){c>f&&(f=c),m(f)},clear(){o=0,h=0,r=0,f=-1/0},get:{sum:()=>r,count:()=>h,mean:()=>h?r/h:NaN}}}function jt(){let e=["42430KSykxE","7557172PnCPxh","vwap.add(price)","496HEANJW","timeWindow capacity","timeWindow(ms)","add","timeWindow.add(time)","ema(period) needs period >= 1","111794YlPLBq","weight","advance","1726350TDszRK","215523qQBpvi","timeWindow(ms) needs ms > 0","ema.add()","28481288ITDjeM"," must be a whole number 1..","ema","clear","vwap","isInteger","isNaN","timeWindow.add(value)","17UxHbCv","timeWindow","volume","timeWindow.advance(time)","value","rolling","get","9965100HllbEd","ema(period)","240ZADgnx","6OtlWje","12xmISKW","vwap.add(size)"];return jt=function(){return e},jt()}function Nt(e,n){return e=e-451,jt()[e]}function re({fn:e,num:n,fail:t,charge:x}){let o=Nt,h=(f,m)=>{let c=Nt,d=n(f,m);return(!Number[c(458)](d)||d<1||d>A0)&&t(m+c(454)+A0),d},r=(f,m,c,d)=>{let b=Nt,_=new J(f,m[b(467)],c);return _[b(484)]=d,_};e("rolling",f=>{let m=Nt,c=h(f,"rolling(n)");x(c);let d=We(c);return r(m(466),d,{add:([b])=>{d[m(480)](n(b,"rolling.add()"))},clear:()=>{d[m(456)]()}},c)}),e(o(455),f=>{let m=o,c=n(f,m(469));c>=1||t(m(482));let d=2/(c+1),b=NaN,_={};_[m(465)]=()=>b;let R={};return R[m(467)]=_,r(m(455),R,{add:([T])=>{let y=m,s=n(T,y(452));return b=Number[y(459)](b)?s:b+d*(s-b),b},clear:()=>{b=NaN}},1)}),e(o(462),(f,m)=>{let c=o,d=n(f,c(479));d>0||t(c(451));let b=m===void 0?A0:h(m,c(478));x(b*2);let _=Ge(d,b);return r(c(462),_,{add:([R,T])=>{let y=c;_[y(480)](n(R,y(481)),n(T,y(460)))},advance:([R])=>{let T=c;_[T(485)](n(R,T(464)))},clear:()=>{_.clear()}},b*2)}),e(o(457),()=>{let f=o,m=0,c=0,d={};d[f(465)]=()=>c?m/c:NaN,d[f(463)]=()=>c;let b={};return b.get=d,r(f(457),b,{add:([_,R])=>{let T=f,y=n(_,T(476)),s=n(R,T(473));s>0&&(m+=y*s,c+=s)},reset:()=>{m=0,c=0}},1)})}var j=oe;(function(e,n){let t=oe,x=e();for(;;)try{if(-parseInt(t(197))/1*(parseInt(t(223))/2)+parseInt(t(222))/3+parseInt(t(205))/4+-parseInt(t(240))/5*(-parseInt(t(234))/6)+parseInt(t(220))/7*(-parseInt(t(211))/8)+parseInt(t(201))/9*(-parseInt(t(230))/10)+parseInt(t(202))/11===n)break;x.push(x.shift())}catch{x.push(x.shift())}})(Zt,423497);var wt={};wt[j(219)]="add",wt[j(217)]=j(213),wt[j(237)]=j(200),wt[j(218)]=j(216),wt.RESET=j(238);function oe(e,n){return e=e-195,Zt()[e]}var at=Object[j(196)](wt);function Zt(){let e=["exhausted","27160NNKWYv","isArray","onOrderEvent","apply","6EYJDCM","length","size","FILL","reset","delete","319610YydVjD","ice","add","freeze","502143MUurXa","REFILLED","onTrades","fill","1053pMJUuT","6059273IaPziC","detected","seed","426376vjMbSB","set","DETECTED","get","hidden","EXHAUSTED","53360EaZPIz","type","modify","price","order","cancel","MODIFY","CANCEL","ADD","112iXYOMn","side","1886319zpZstm","2NuJOUJ","round","clear","change","refilled","RESET"];return Zt=function(){return e},Zt()}var Jt={};Jt[j(207)]=j(203),Jt.REFILLED=j(227),Jt[j(210)]=j(229);var yt=Object[j(196)](Jt),$t=7,Ye=15e4,Xt=e=>Math[j(224)](e*1e8),_0=-1;function Qt(){let e=j,n=new Map,t=new Map,x=0,o={};o[e(215)]=!0,o[e(212)]="",o.id="",o[e(221)]=_0,o.price=0,o[e(236)]=0,o.ts=0,o.hidden=0;let h=o;function r(s,w,u,I,S,M,E,B=0){let v=e;return h[v(215)]=s,h[v(212)]=w,h.id=u,h[v(221)]=I,h.price=S,h.size=M,h.ts=E,h[v(209)]=B,h}function f(s,w){let u=e,I=Xt(w),S=t[u(208)](I);S||t[u(206)](I,S=new Set),S[u(195)](s)}function m(s,w){let u=e,I=Xt(w),S=t[u(208)](I);S&&(S[u(239)](s),S[u(236)]||t.delete(I))}function c(s,w,u,I,S,M){let E=e;if(n[E(236)]>=Ye)return x++,!1;let B={};return B[E(221)]=w,B[E(214)]=u,B[E(236)]=I,B.pr=S,B.at=M,B[E(241)]=!1,n.set(s,B),f(s,u),!0}function d(s,w){n.delete(s),m(s,w.price)}function b(s,w,u,I,S,M){let E=e;return u>0&&u!==w.price&&(m(s,w[E(214)]),w[E(214)]=u,f(s,u)),w[E(236)]=I,S>=0&&(w.pr=S),r(!0,at[E(217)],s,w.side,w[E(214)],I,M)}function _(){n[e(225)](),t.clear()}function R(s){let w=e;_();for(let u=0;u+$t<=s[w(235)];u+=$t){let I=s[u];if(I===w(195))c(s[u+1],s[u+2],s[u+3],s[u+4],s[u+6]<0?void 0:s[u+6],s[u+5]);else if(I===w(241)){let S=n.get(s[u+1]);S&&(S[w(241)]=!0)}}return r(!0,at[w(228)],"",_0,0,0,0)}function T(s,w){let u=e,I=s[w],S=s[w+1],M=s[w+2],E=s[w+3],B=s[w+4],v=s[w+5],g=s[w+6];switch(I){case u(195):case u(226):{let A=n[u(208)](S);return A?b(S,A,E,B,g,v):c(S,M,E,B,g<0?void 0:g,v)?r(!0,at.ADD,S,M,E,B,v):null}case"execute":{let A=n[u(208)](S);return A?(A[u(236)]-=B,A[u(236)]<=1e-9&&d(S,A),r(!0,at.FILL,S,A[u(221)],A[u(214)],B,v)):r(!0,at[u(237)],S,M,E,B,v)}case u(200):return r(!0,at[u(237)],S,M,E,B,v);case u(239):{let A=n[u(208)](S);return A?(d(S,A),r(!0,at[u(218)],S,A[u(221)],A.price,A[u(236)],v)):null}case u(238):return _(),r(!0,at[u(228)],"",_0,0,0,v);case yt[u(207)]:case yt[u(198)]:case yt[u(210)]:{let A=n[u(208)](S);return A&&(A[u(241)]=I!==yt[u(210)]),r(!1,I,S,M,E,B,v,g)}default:return null}}let y=(s,w)=>s.pr!==void 0&&w.pr!==void 0?s.pr<w.pr:s.at<w.at;return{seed:R,apply:T,clear:_,get:s=>n[e(208)](s),count:()=>n[e(236)],overflow:()=>x,countAt:s=>t[e(208)](Xt(s))?.[e(236)]||0,queueAhead(s,w){let u=e,I=n[u(208)](s);if(!I)return 0;let S=t[u(208)](Xt(I[u(214)]));if(!S)return 0;w?.(S[u(236)]);let M=0;for(let E of S){if(E===s)continue;let B=n[u(208)](E);B&&B[u(221)]===I[u(221)]&&y(B,I)&&(M+=B[u(236)])}return M}}}function se(e,n,t,x){let o=j,h=x?x[o(235)]:0,r=0,f=m=>{let c=o,d=r;for(;d+3<h&&x[d]<=m;)d+=4;if(d!==r){for(let b of e)b[c(199)](x,r,d);r=d}};for(let m of t){if(!Array[o(231)](m)){let c=n.seed(m[o(204)]);for(let d of e)d.onOrderEvent(c);continue}for(let c=0;c+$t<=m[o(235)];c+=$t){f(m[c+5]);let d=n[o(233)](m,c);if(d)for(let b of e)b[o(232)](d)}}if(r<h)for(let m of e)m[o(199)](x,r,h)}var Q=ie;(function(e,n){let t=ie,x=e();for(;;)try{if(parseInt(t(247))/1+-parseInt(t(285))/2*(parseInt(t(160))/3)+parseInt(t(266))/4+-parseInt(t(197))/5+parseInt(t(224))/6*(-parseInt(t(230))/7)+parseInt(t(165))/8+-parseInt(t(271))/9===n)break;x.push(x.shift())}catch{x.push(x.shift())}})(e0,701791);var gt={};gt.BUY=0,gt[Q(176)]=1,gt[Q(172)]=-1,gt.BID=0,gt[Q(171)]=1;var It=Object[Q(257)](gt),Ve=5e4,je=5e3,Xe=2e3,ae=200,Je=200,Ze=20,$e=30,Qe=140,tn=1e3,en=150,nn=2e3,xn=5e3,rn=1e3,on=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\p{Cc}]/gu;function t0(e){let n=Q;return typeof e===n(215)?e[n(179)]>500?e[n(282)](0,500)+"\u2026":e:Array[n(190)](e)?n(196)+e[n(179)]+"]":e instanceof Map?n(163)+e[n(183)]+"}":e instanceof J?"["+e[n(194)]+"]":e instanceof ct?n(280)+e.name+"]":String(e)}var lt=(e,n)=>t0(e)[Q(270)](on,"")[Q(168)]()[Q(282)](0,n),sn=/[\p{Emoji_Presentation}\p{Extended_Pictographic}\u0000-\u0009\u000B-\u001F\u007F]/gu,an=(e,n)=>t0(e)[Q(270)](sn,"")[Q(168)]()[Q(282)](0,n);function cn(e,n){let t=Q;return e===void 0||e===!0?null:e===!1?!1:(typeof e!="string"&&n(t(199)),an(e,tn)||null)}function ce({getRt:e,bookCore:n,orderBook:t=Qt(),caps:x,granted:o,soundKinds:h}){let r=Q,f=n[r(286)],m=new Set(h||[]),c={};c[r(241)]=[],c[r(238)]=[],c[r(232)]=[],c[r(208)]=[],c[r(211)]=[],c[r(278)]=[],c[r(193)]=0;let d=c,b={now:0,initPhase:!0,history:!1,lastSound:-1/0,lastSpeak:-1/0,alertKeys:new Map,minuteStart:0,minuteCount:0,batchAlerts:0},_=()=>e()?.[r(236)]||0,R=a=>{throw new D(a,_())},T=(a,i)=>{let k=r;return(typeof a!="number"||Number[k(269)](a))&&R(i+k(198)),a},y=(a,i)=>a instanceof Map?a.get(i):void 0,s=new Map,w=(a,i)=>s.set(a,{kind:r(205),v:i}),u=(a,i)=>s[r(234)](a,{kind:r(187),fn:i});for(let[a,i]of Object[r(189)](It))w(a,i);for(let[a,i]of Object[r(189)](at))w(a,i);for(let[a,i]of Object[r(189)](yt))w(a,i);let I={};I.id=()=>x.id||"",I[r(264)]=()=>x[r(287)]===!0,I[r(202)]=()=>x[r(263)]===!0,I[r(276)]=()=>x[r(218)]===!0,w("venue",new J(r(219),I));let S={};S[r(262)]=()=>f[r(262)],S[r(274)]=()=>f[r(274)],S[r(254)]=()=>f.bestBidSize,S[r(222)]=()=>f[r(222)],S.mid=()=>f[r(277)],S[r(162)]=()=>f[r(162)],S[r(200)]=()=>f.rowTick,w(r(177),new J(r(177),S,{sizeAt:([a])=>n[r(284)](T(a,"price"))}));let M=a=>typeof a=="string"?a:R(r(170)),E=a=>{let i=r,k=e();if(k[i(221)]-=a,k[i(221)]<0)throw new G(i(158),_())};w(r(279),new J(r(279),{count:()=>t[r(191)]()},{has:([a])=>t.get(M(a))!==void 0,size:([a])=>t[r(175)](M(a))?.[r(183)]??0,price:([a])=>t[r(175)](M(a))?.[r(242)]??0,side:([a])=>t[r(175)](M(a))?.[r(260)]??It[r(172)],placedAt:([a])=>t[r(175)](M(a))?.at??0,isIceberg:([a])=>t[r(175)](M(a))?.[r(220)]===!0,queueAhead:([a])=>t[r(253)](M(a),E),countAt:([a])=>t[r(248)](T(a,r(242)))}));let B=new J(r(169),{},null);w(r(169),B);for(let a of[r(186),r(256),r(239),r(265),r(206),"exp","sign"]){let i=Math[a];u(a,k=>i(T(k,a+"()")))}u("ln",a=>Math.log(T(a,r(159))));let v=(a,i)=>{for(let k of a)T(k,i);return a};u(r(181),(...a)=>Math[r(181)](...v(a,"min()"))),u(r(288),(...a)=>Math[r(288)](...v(a,r(233)))),u(r(201),(a,i)=>T(a,r(268))**T(i,r(268))),u(r(227),a=>typeof a===r(251)&&Number[r(281)](a)),u(r(212),a=>{let i=r;return a instanceof Map||R(i(275)),ot(e(),a[i(183)]),[...a[i(212)]()]}),u(r(173),(a,i)=>a instanceof Map?a[r(173)](i):R(r(214))),u("remove",(a,i)=>a instanceof Map?a[r(209)](i):R("remove() needs an object")),u(r(183),a=>a instanceof Map?a[r(183)]:Array[r(190)](a)?a[r(179)]:R("size() needs an object or array")),u(r(272),()=>b[r(272)]),u(r(178),()=>b[r(180)]),re({fn:u,num:T,fail:R,charge:a=>ot(e(),a)}),u(r(213),(...a)=>{let i=r;d[i(211)].length<Je&&d[i(211)][i(192)](a[i(249)](t0)[i(273)](" "))}),u(r(241),(a,i)=>{let k=r;b[k(226)]||R(k(235));let C=y(i,k(240)),P=y(i,k(161)),q={name:lt(a??k(290)+(d[k(241)].length+1),60),pane:C===k(283)?k(283):k(217),color:typeof P===k(215)?P[k(282)](0,32):"",points:[]};return d[k(241)].push(q),new J(k(241),null,{add:([U,z])=>{let W=k;if(q[W(244)].length>=Ve*2)throw new G(W(289),_());q[W(244)][W(192)](T(U,W(162)),T(z,"value"))}})}),u(r(250),(a,i,k,C)=>{let P=r;if(d[P(238)][P(179)]>=je)throw new G(P(188),_());d.markers[P(192)]({t:T(a,P(162)),p:T(i,P(242)),text:lt(k??"",24),color:typeof C===P(215)?C.slice(0,32):""})});let g=a=>typeof a===r(215)?a[r(282)](0,40):"";u(r(195),(a,i,k,C,P,q)=>{let U=r;if(d[U(232)].length>=Xe)throw new G(U(228),_());let z=T(a,U(162)),W=T(k,U(162)),X=T(i,U(242)),Ft=T(C,U(242));d.boxes[U(192)]({t0:Math[U(181)](z,W),t1:Math[U(288)](z,W),p0:Math[U(181)](X,Ft),p1:Math[U(288)](X,Ft),text:lt(P??"",24),color:g(q)})});let A=new Map,N=1,O=(a,i=!1)=>d[r(208)][r(192)]({id:a.id,price:a[r(242)],t0:a.t0,t1:a.t1,text:a[r(229)],color:a[r(161)],gone:i});u(r(237),(a,i,k)=>{let C=r;if(A.size>=ae)throw new G(C(259)+ae+C(207),_());let P={id:N++,price:T(a,C(242)),t0:b[C(272)],t1:NaN,text:lt(i??"",24),color:g(k),gone:!1};return A[C(234)](P.id,P),O(P),new J(C(237),{price:()=>P[C(242)],active:()=>A[C(173)](P.id)},{move:([q])=>{let U=C;return A[U(173)](P.id)?(P[U(242)]=T(q,U(242)),O(P),!0):!1},stop:([q])=>{let U=C;return A[U(209)](P.id)?(P.t1=q===void 0?b.now:T(q,U(162)),O(P),!0):!1},remove:()=>{let q=C;return P.gone?!1:(P.gone=!0,A[q(209)](P.id),O(P,!0),!0)}})});let L=a=>{let i=r;return(typeof a!==i(215)||!m[i(173)](a))&&R(i(223)+t0(a)+i(231)+[...m][i(273)](", ")),a};function F(a){let i=r;return b[i(272)]-b[i(182)]<en?null:(b[i(182)]=b[i(272)],a)}function l(a){let i=r;return!a||b[i(272)]-b.lastSpeak<nn?"":(b[i(216)]=b[i(272)],a)}function p(a){let i=r;return b[i(180)]?!1:(b[i(272)]-b[i(243)]>=6e4&&(b[i(243)]=b.now,b[i(258)]=0),b[i(164)]>=Ze||b[i(258)]>=$e?(d.dropped++,!1):(b[i(164)]++,b[i(258)]++,d[i(278)][i(192)](a),!0))}u(r(185),a=>{let i=r,k=L(a);b[i(180)]||F(k)&&p({t:b.now,text:"",sound:k,speak:""})}),u(r(261),(a,i)=>{let k=r,C=lt(a??"",Qe);C||R(k(184));let P=typeof y(i,k(267))===k(215)?y(i,k(267)):C,q=Math[k(288)](rn,Number(y(i,k(225)))||xn),U=b[k(166)][k(175)](P);if(U!==void 0&&b.now-U<q)return!1;let z=y(i,k(204));if(z&&!o[k(173)](k(246)))throw new et("alert({ speak })",fn(k(246)),_());let W=cn(y(i,k(245)),R);if(b[k(180)])return!1;let X=y(i,k(185))===void 0?null:F(L(y(i,"sound"))),Ft=z?l(typeof z=="string"?lt(z,100):C[k(282)](0,100)):"";b[k(166)][k(183)]>=500&&!b[k(166)][k(173)](P)&&b[k(166)][k(203)](),b[k(166)].set(P,b[k(272)]);let dt={};return dt.t=b[k(272)],dt.text=C,dt.sound=X,dt[k(204)]=Ft,dt.tg=W,p(dt)}),u(r(204),a=>{let i=r;if(b[i(180)])return;let k=l(lt(a??"",100));k&&p({t:b[i(272)],text:"",sound:null,speak:k})});for(let a of mt)if(!o.has(a.id))for(let i of a[r(210)])s[r(234)](i,{kind:r(252),feature:a});return{host:s,inputObj:B,clock:b,beginBatch(){b.batchAlerts=0},drain(){let a=r,i={series:d[a(241)][a(249)](k=>({name:k[a(174)],pane:k[a(240)],color:k[a(161)],points:Float64Array.from(k.points)})),markers:d[a(238)].splice(0),boxes:d[a(232)][a(167)](0),lines:d[a(208)][a(167)](0),logs:d[a(211)][a(167)](0),alerts:d[a(278)].splice(0),alertsDropped:d[a(193)]};for(let k of d[a(241)])k[a(244)][a(179)]=0;return d.dropped=0,i}}}function e0(){let e=["length","history","min","lastSound","size","alert() needs a message","sound","abs","hostfn","Too many markers in one batch","entries","isArray","count","push","dropped","kind","box","[array ","2015970Vizxrw"," must be a number","alert() telegram must be true, false or a string","tick","pow","hasDepth","clear","speak","host","sqrt",") \u2014 stop() or remove() old ones","lines","delete","builtins","logs","keys","log","has() needs an object","string","lastSpeak","main","orderIds","venue","ice","ops","bestAskSize","Unknown sound '","1374uNmLXR","cooldown","initPhase","isNum","Too many boxes in one batch","text","32676bICIVv","' \u2014 use one of: ","boxes","max()","set","series() must be created at the top level","line","hline","markers","ceil","pane","series","price","minuteStart","points","telegram","tapeScript.voice","877888lVYHOr","countAt","map","marker","number","locked","queueAhead","bestBidSize","find","floor","freeze","minuteCount","Too many lines (","side","alert","bestBid","depth","hasAggressor","round","5485800ptoVCk","key","pow()","isNaN","replace","5401575anrzns","now","join","bestAsk","keys() needs an object","hasOrders","mid","alerts","orders","[function ","isFinite","slice","bottom","sizeAt","34130VJOdij","state","aggressor","max","Too many points in one batch","Series ","Script used too much CPU in one batch","ln()","24AwxIqe","color","time","{object ","batchAlerts","5290512mPWFSu","alertKeys","splice","trim","input","order id must be a string","ASK","NONE","has","name","get","SELL","book","isHistory"];return e0=function(){return e},e0()}function ie(e,n){return e=e-158,e0()[e]}function fn(e){return mt[Q(255)](t=>t.id===e)}var n0=M0;function x0(){let e=["262531KTJqmk","1512324MmgQpm","type","test","features","plan","NONE","bind","onIceberg","orderIds","919566tdXKts","dflt","orderBook","opsPerBatch","keys","params","order","TapeScript","onOrder","has","apply","price","side","max","minPlan","1295694TtynCn","bestBid","size","beginBatch","onInterval","inputs","SELL","feature","allocPerBatch","ops","initPhase","24rYXLRB","100988TIXqSe","find","name","stateWeight","error","depth","6631506nzsNZs","tapeScript","drain","message","bestBidSize","call","freeze","clock","inputObj","functions","getRt","orders","host","init","history","directives","caps","BUY","now","add","get","granted","intervalMs","line","1967654cVxYjp","aggressor","bookCore"," (line ","30nbtxGA","Script state grew too large \u2014 clear old entries with remove()","state","hasOwn","alloc","ceil","onDepth","soundKinds","getters"];return x0=function(){return e},x0()}(function(e,n){let t=M0,x=e();for(;;)try{if(-parseInt(t(452))/1+parseInt(t(439))/2+parseInt(t(453))/3+-parseInt(t(489))/4+parseInt(t(443))/5*(parseInt(t(462))/6)+-parseInt(t(495))/7+-parseInt(t(488))/8*(parseInt(t(477))/9)===n)break;x.push(x.shift())}catch{x.push(x.shift())}})(x0,740467);var un=100,ln=32,Ct={};Ct.id="",Ct[n0(440)]=!1,Ct[n0(494)]=!1,Ct.orderIds=!1;var pn=Object[n0(421)](Ct);function M0(e,n){return e=e-421,x0()[e]}function fe(e,n={}){let t=n0,x=n[t(467)]||{},o=new Set(n[t(456)]||[]),h={...pn,...n[t(431)]||{}},r=h;if(!o[t(471)]("tapeScript"))throw new et(t(469),mt[t(490)](p=>p.id===t(496)),0);let f=ee(),m=f[t(445)],c=null,d={};d[t(425)]=()=>c,d[t(441)]=f,d[t(464)]=n[t(426)]||void 0,d[t(431)]=r,d[t(436)]=o,d[t(450)]=n[t(450)];let b=ce(d),_=new Set,R=b.host.get[t(459)](b[t(427)]);b[t(427)].get=p=>(_[t(434)](p),R(p));let T=Y0(e,b[t(427)]);c=T.rt;for(let[p,a]of T[t(424)]){let i=xe(p);if(i&&!o[t(471)](i.id))throw new et(p,i,a[t(438)])}let y={name:"Untitled",inputs:[],intervalMs:0,...X0(T[t(430)])},s=new Map;for(let p of y[t(482)])s.set(p[t(491)],Object[t(446)](x,p[t(491)])?g0(p,x[p[t(491)]]):p[t(463)]),b[t(423)][t(451)][p[t(491)]]=()=>s[t(435)](p[t(491)]);let w=p=>T[t(424)].get(p)||null,u=w("onTrade"),I=r[t(494)]?w(t(449)):null,S=r[t(494)]?w("onBbo"):null,M=w(t(481)),E=r[t(461)]?w(t(470)):null,B=r[t(461)]?w(t(460)):null;y.handlers=[...T[t(424)][t(466)]()].filter(p=>/^on[A-Z]/[t(455)](p)),y[t(426)]=!!(E||B||r.orderIds&&_[t(471)](t(426)));let v={};v.error=null;let g=v,A=0,N=0;function O(p){let a=t;if(!g[a(493)])try{p()}catch(i){let k=i instanceof D&&i[a(438)]||c[a(438)],C={};C[a(498)]=i instanceof D?i[a(498)]:(i?.[a(491)]||"Error")+": "+i?.[a(498)]+a(442)+k+")",C[a(438)]=k,C.limit=i instanceof G,C[a(457)]=i instanceof et?{feature:i[a(484)],minPlan:i[a(476)]}:null,g[a(493)]=C}}O(()=>{T[t(428)]()}),b.clock[t(487)]=!1;let L=0,F=I?(p,a,i)=>T.call(I,p,a,i,L):null,l=r.aggressor?p=>p===0?It[t(432)]:It[t(483)]:()=>It[t(458)];return{meta:y,caps:r,get error(){return g[t(493)]},beginBatch(p=V[t(465)]){let a=t;c[a(486)]=p,c[a(447)]=V[a(485)],b[a(480)](),++A%ln===0&&O(()=>{let i=a;if(H0(T.G,V[i(492)])>V.stateWeight)throw new G(i(444),c[i(438)])})},onBook(p,a,i,k){let C=t;r[C(494)]&&O(()=>{let P=C;L=p,p>b[P(422)].now&&(b[P(422)][P(433)]=p),f[P(472)](p,a,i,k,F)&&S&&T.call(S,m[P(478)],m[P(499)],m.bestAsk,m.bestAskSize,p)})},onTrades(p,a=0,i=p.length){u&&O(()=>{let k=M0;for(let C=a;C+3<i;C+=4){let P=p[C];P>b[k(422)][k(433)]&&(b.clock[k(433)]=P),T[k(500)](u,p[C+1],p[C+2],l(p[C+3]),P)}})},onOrderEvent(p){let a=t,i=p[a(468)]?E:B;i&&O(()=>{let k=a,C=p.ts||b[k(422)][k(433)];C>b.clock[k(433)]&&(b.clock.now=C),p[k(468)]?T[k(500)](i,p[k(454)],p.id,p[k(474)],p[k(473)],p[k(479)],C):T[k(500)](i,p[k(454)],p.id,p.side,p[k(473)],p[k(479)],p.hidden,C)})},setHistory(p){let a=t;b[a(422)][a(429)]=!!p},advance(p){let a=t;p>b[a(422)][a(433)]&&(b.clock.now=p),!(!M||!y.intervalMs)&&O(()=>{let i=a;N||(N=Math[i(448)](p/y[i(437)])*y[i(437)]);let k=0;for(;p>=N&&k<un;)b[i(422)][i(433)]=Math[i(475)](b.clock.now,N),T[i(500)](M,N),N+=y[i(437)],k++;p>=N&&(N=Math[i(448)](p/y[i(437)])*y.intervalMs)})},drain(){return b[t(497)]()}}}var pt=Object.freeze({BOOK_KEY:1,BOOK_DELTA:2,TRADES:3,TICK:4,SIGNALS:5}),r0=9;var yx=r0*8;var gx=4*8192;var o0=12;function hn(e){let n=[];if(!e||!e.byteLength)return n;let t=new DataView(e.buffer,e.byteOffset,e.byteLength),x=0;for(;x+40<=e.byteLength&&t.getUint32(x,!0)===827475028;){let o=t.getUint32(x+4,!0),h=x+40;if(h+o>e.byteLength)break;n.push({flags:t.getUint8(x+12),t0:t.getFloat64(x+16,!0),t1:t.getFloat64(x+24,!0),session:t.getUint32(x+32,!0),seq:t.getUint32(x+36,!0),off:h,len:o}),x=h+o}return n}function le(){return{a:new Float64Array(4096),b:new Float64Array(4096),n:0}}function Ie(e,n){if(e.a.length>=n*2&&e.b.length>=n*2)return;let t=Math.max(n*2,e.a.length*2),x=new Float64Array(t);x.set(e.a.subarray(0,e.n*2)),e.a=x,e.b=new Float64Array(t)}function pe(e,n,t,x){Ie(x,t);let o=x.a;for(let h=0;h<t;h++,n+=o0)o[2*h]=e.getFloat64(n,!0),o[2*h+1]=e.getFloat32(n+8,!0);return x.n=t,n}function de(e,n,t,x,o){Ie(x,x.n+t);let h=x.a,r=x.b,f=x.n,m=0,c=0;for(let d=0;d<t;d++,n+=o0){let b=e.getFloat64(n,!0),_=e.getFloat32(n+8,!0);for(;m<f&&o*h[2*m]<o*b;)r[2*c]=h[2*m],r[2*c+1]=h[2*m+1],c++,m++;m<f&&h[2*m]===b&&m++,_>0&&(r[2*c]=b,r[2*c+1]=_,c++)}for(;m<f;)r[2*c]=h[2*m],r[2*c+1]=h[2*m+1],c++,m++;return x.a=r,x.b=h,x.n=c,n}function he(e,n){let t=()=>new Float64Array(8192),x=()=>new Float32Array(8192);return{isBid:e,tick:n,ck:t(),cq:x(),cp:t(),cn:0,pk:t(),pq:x(),pp:t(),pn:0,out:new Float64Array(16384)}}function bn(e,n){if(e.ck.length>=n)return;let t=Math.max(n,e.ck.length*2);for(let x of["ck","cp","pk","pp"]){let o=new Float64Array(t);o.set(e[x]),e[x]=o}for(let x of["cq","pq"]){let o=new Float32Array(t);o.set(e[x]),e[x]=o}}function be(e,n,t){bn(e,t);let{ck:x,cq:o,cp:h,tick:r,isBid:f}=e,m=-1,c=NaN;for(let d=0;d<t;d++){let b=n[2*d],_=n[2*d+1];if(!(b>0)||_<0)continue;let R=b/r,T=f?Math.floor(R):Math.ceil(R);T===c?o[m]+=_:(m++,x[m]=T,o[m]=_,h[m]=b,c=T)}e.cn=m+1}function me(e){let n=(e.cn+e.pn)*2;e.out.length<n&&(e.out=new Float64Array(n*2));let{ck:t,cq:x,cp:o,cn:h,pk:r,pq:f,pp:m,pn:c,out:d,isBid:b}=e,_=0,R=0,T=0;for(;_<h||R<c;)_<h&&R<c&&t[_]===r[R]?(x[_]!==f[R]&&(d[T++]=o[_],d[T++]=x[_]),_++,R++):R>=c||_<h&&(b?t[_]>r[R]:t[_]<r[R])?(d[T++]=o[_],d[T++]=x[_],_++):(d[T++]=m[R],d[T++]=0,R++);return[e.ck,e.pk]=[e.pk,e.ck],[e.cq,e.pq]=[e.pq,e.cq],[e.cp,e.pp]=[e.pp,e.cp],e.pn=h,d.subarray(0,T)}var kt=null,T0=[];function mn(){return typeof MessageChannel>"u"?new Promise(e=>setTimeout(e,0)):(kt||(kt=new MessageChannel,kt.port1.onmessage=()=>{T0.shift()?.(),T0.length||kt.port1.unref?.()}),kt.port1.ref?.(),new Promise(e=>{T0.push(e),kt.port2.postMessage(0)}))}var wn=100;async function ke(e,n,t={}){if(!t.prepend){let h=await ge(e,n,t);return we(e,h),h}if(!e.begin_prepend)return{frames:0,trades:0,firstT:0,lastT:0,tick:0,aborted:!0,merged:!1};+t.stageStepMs>0&&e.begin_prepend_step?e.begin_prepend_step(+t.stageStepMs):e.begin_prepend();let x={push_book:(h,r,f,m)=>e.prepend_push_book(h,r,f,m),push_book_delta:e.prepend_push_book_delta?(h,r,f,m)=>e.prepend_push_book_delta(h,r,f,m):void 0,rowTick:e.staged_tick_size?e.staged_tick_size():0,push_trade:(h,r,f,m)=>e.prepend_push_trade(h,r,f,m),set_tick_size(){}},o=null;try{o=await ge(x,n,{...t,applyTick:!1})}finally{(!o||o.aborted)&&e.cancel_prepend()}return o.merged=!o.aborted&&e.end_prepend(),o.merged&&we(e,o),o}function we(e,n){let t=n?.signalRows;if(n.signalRows=null,!(n?.aborted||!t?.length||!e.import_signal_history))try{n.signals=e.import_signal_history(new Float64Array(t))||0}catch{}}var E0=[];function yn(){return E0.pop()||{bids:le(),asks:le(),rb:he(!0,0),ra:he(!1,0)}}function gn(e){E0.length<2&&E0.push(e)}function ye(e,n){return e.tick=n,e.cn=0,e.pn=0,e}async function ge(e,n,t){let x=yn();try{return await In(e,n,t,x)}finally{gn(x)}}async function In(e,n,t,x){let o=+t.fromMs||0,h=Number.isFinite(+t.toMs)&&+t.toMs>0?+t.toMs:1/0,r=Math.max(0,Number.isFinite(+t.stepMs)?+t.stepMs:250),f=Math.max(2,+t.sliceMs||8),m=typeof t.isAlive=="function"?t.isAlive:()=>!0,c=typeof t.yieldFn=="function"?t.yieldFn:mn,d=typeof t.onProgress=="function"?t.onProgress:null,b=typeof t.pace=="function"?t.pace:null,_={frames:0,trades:0,firstT:0,lastT:0,tick:0,aborted:!1,signals:0,signalRows:null},R=hn(n).filter(F=>F.session!==t.excludeSession);if(!R.length)return _;let T=R.reduce((F,l)=>F+l.len,0),y=0,s=0,w=new Map;for(let F of R){let l=w.get(F.session);(l===void 0||F.t0<l)&&w.set(F.session,F.t0)}R.sort((F,l)=>w.get(F.session)-w.get(l.session)||F.session-l.session||F.seq-l.seq);let u=new DataView(n.buffer,n.byteOffset,n.byteLength),I=x.bids,S=x.asks;I.n=0,S.n=0;let M=+e.rowTick>0&&typeof e.push_book_delta=="function"?+e.rowTick:0,E=M?ye(x.rb,M):null,B=M?ye(x.ra,M):null,v=!1,g=-1,A=-1,N=-1/0,O=!t.applyTick,L=performance.now();for(let F of R){(F.session!==g||F.seq!==A+1)&&(v=!1),g=F.session,A=F.seq;let l=F.off,p=F.off+F.len;for(;l<p;){let a=u.getUint8(l);if(l+=1,a===pt.TICK){let i=u.getFloat64(l,!0);l+=8,!O&&i>0&&(e.set_tick_size(i),O=!0,_.tick=i)}else if(a===pt.BOOK_KEY||a===pt.BOOK_DELTA){let i=u.getFloat64(l,!0),k=u.getFloat64(l+8,!0),C=u.getUint32(l+16,!0),P=u.getUint32(l+20,!0);if(l+=24,l+(C+P)*o0>p){l=p;break}if(a===pt.BOOK_KEY)l=pe(u,l,C,I),l=pe(u,l,P,S),v=!0;else if(v)l=de(u,l,C,I,-1),l=de(u,l,P,S,1);else{l+=(C+P)*o0;continue}if(i>h)return d?.(1),_;let q=r>0?Math.floor(i/r):i;if(i>=o&&q!==N&&k>0){if(b){let z=b(i);if(z){if(await z,!m())return _.aborted=!0,_;L=performance.now()}}let U=!1;E&&(be(E,I.a,I.n),be(B,S.a,S.n),U=e.push_book_delta(i,me(E),me(B),k)),U||e.push_book(i,I.a.subarray(0,I.n*2),S.a.subarray(0,S.n*2),k),N=q,_.frames++,_.firstT||(_.firstT=i),i>_.lastT&&(_.lastT=i)}}else if(a===pt.TRADES){let i=u.getUint32(l,!0);if(l+=4,l+i*21>p){l=p;break}for(let k=0;k<i;k++,l+=21){let C=u.getFloat64(l,!0);if(!(C<o||C>h)){if(b){let P=b(C);if(P){if(await P,!m())return _.aborted=!0,_;L=performance.now()}}e.push_trade(C,u.getFloat64(l+8,!0),u.getFloat32(l+16,!0),u.getUint8(l+20)),_.trades++,C>_.lastT&&(_.lastT=C)}}}else if(a===pt.SIGNALS){let i=u.getUint32(l,!0);l+=4;let k=i*r0*8;if(l+k>p){l=p;break}_.signalRows||(_.signalRows=[]);for(let C=0;C<i*r0;C++)_.signalRows.push(u.getFloat64(l+C*8,!0));l+=k}else{v=!1;break}if(performance.now()-L>f){if(d&&L-s>=wn&&(s=L,d(Math.min(1,(y+l-F.off)/T))),await c(),!m())return _.aborted=!0,_;L=performance.now()}}y+=F.len}return d?.(1),_}function s0(){let e=["8wKXmTO","len","2498061CyDWQm","parts","values","tMs","color","5932105MkiRBD","books","toMs","nowMs","alertsDropped","delete","warn","setHistory","markers","push_trade","set","frames","get","pane","drain","beginBatch","fromMs","got","1020678CBVtwv","advance","asks","lines","chain","end","88934wgqeiR","push","resolve","lastT","trades","name","map","byteLength","done","none","length","postedAt","points","onBook","alerts","error","backlog","warmId","then","inst","series","11018360FtDXht","logs","[tapeScript] history replay failed:","catch","acc","2907065WzJnXF","8075634FptPAF","onTrades","hist","boxes","now","bids","9PLkryy"];return s0=function(){return e},s0()}(function(e,n){let t=nt,x=e();for(;;)try{if(parseInt(t(345))/1+-parseInt(t(351))/2+-parseInt(t(322))/3*(parseInt(t(320))/4)+parseInt(t(327))/5+-parseInt(t(378))/6+parseInt(t(377))/7+-parseInt(t(372))/8*(-parseInt(t(319))/9)===n)break;x.push(x.shift())}catch{x.push(x.shift())}})(s0,943909);function nt(e,n){return e=e-319,s0()[e]}var kn=250,Sn=250,An=100,_n=600,Mn=200,Tn=8,En=()=>new Promise(e=>setTimeout(e,0));async function On(e,n,t,x,o){let h=nt,r=0,f=performance[h(382)]();for(let m=0;m+3<n[h(361)];m+=4){let c=n[m];if(!(c<t||c>=x)&&(e[h(336)](c,n[m+1],n[m+2],n[m+3]),r++,!(r&255)&&performance[h(382)]()-f>Tn)){if(await En(),!o())return r;f=performance[h(382)]()}}return r}function Se(){return{series:new Map,markers:[],boxes:[],lines:[],logs:[],alerts:[],alertsDropped:0,n:0}}function Ae(e,n){let t=nt;for(let x of n[t(371)]){if(!x[t(363)][t(361)])continue;let o=x[t(340)]+"\0"+x[t(356)],h=e[t(371)][t(339)](o),r={};r[t(356)]=x[t(356)],r.pane=x.pane,r.color=x[t(326)],r[t(323)]=[],r[t(321)]=0,h||e[t(371)][t(337)](o,h=r),h[t(323)][t(352)](x[t(363)]),h[t(321)]+=x[t(363)].length,e.n++}for(let x of[t(335),"boxes",t(348),t(365)]){for(let o of n[x])e[x].push(o);e.n+=n[x][t(361)]}for(let x of n[t(373)])e[t(373)].length<Mn&&e[t(373)][t(352)](x);e.n+=n[t(373)][t(361)],e[t(331)]+=n.alertsDropped||0}function vn(e){let n=nt,t=[];for(let o of e.series[n(324)]()){let h=new Float64Array(o[n(321)]),r=0;for(let m of o[n(323)])h.set(m,r),r+=m[n(361)];let f={};f.name=o[n(356)],f[n(340)]=o.pane,f[n(326)]=o[n(326)],f[n(363)]=h,t[n(352)](f)}let x={};return x.series=t,x[n(335)]=e.markers,x[n(381)]=e[n(381)],x[n(348)]=e[n(348)],x[n(373)]=e.logs,x[n(365)]=e.alerts,x[n(331)]=e[n(331)],x}function _e(e){let n=new Map,t=1;function x(f,m){let c=nt,d=f[c(376)];if(!d.n&&!m)return;f[c(376)]=Se(),f[c(362)]=Date[c(382)]();let b=vn(d),_={};_.t=c(380),_.id=f.id,_.warmId=f[c(368)],_.out=b,_.error=f[c(370)][c(366)],_[c(359)]=m||"",e(_,b[c(371)][c(357)](R=>R[c(363)].buffer))}function o(f){let m=nt,c=f[m(370)],d=new Float64Array(4),b=!1,_=0;function R(y){let s=m;c[s(346)](y),Ae(f[s(376)],c[s(341)]()),b=!1,Date[s(382)]()-f[s(362)]>=An&&x(f,"")}let T=y=>{let s=m;b&&y-_<kn||(b&&R(y),c[s(342)](),b=!0,_=y)};return{set_tick_size(){},push_book(y,s,w,u){let I=m;T(y),c[I(364)](y,Float64Array.from(s),Float64Array.from(w),u),y>f[I(354)]&&(f[I(354)]=y)},push_trade(y,s,w,u){let I=m;T(y),d[0]=y,d[1]=s,d[2]=w,d[3]=u,c[I(379)](d),y>f[I(354)]&&(f.lastT=y)},end(){b&&R(f[m(354)])}}}function h(f,m,c){let d=nt;if(n[d(339)](f.id)!==f)return;n.delete(f.id);let b=f[d(370)];b.setHistory(!1);for(let _ of c?f.backlog:[]){if(b.error)break;b[d(342)]();for(let T of _[d(328)])T.tMs>f.lastT&&b.onBook(T[d(325)],T[d(383)],T[d(347)],T.mid);let R=_[d(355)];if(R){let T=0;for(;T+3<R.length&&R[T]<=f[d(354)];)T+=4;b[d(379)](R,T,R[d(361)])}b.advance(_[d(330)]),Ae(f[d(376)],b.drain())}f.backlog=[],x(f,b[d(366)]?d(366):m)}async function r(f,m){let c=nt,d=()=>n[c(339)](f.id)===f&&!f[c(370)][c(366)];if(d()){if(m.u8?.[c(358)]){let b=o(f),_=await ke(b,m.u8,{fromMs:m[c(343)],toMs:m[c(329)]-1,stepMs:Sn,isAlive:d});d()&&b.end(),_[c(338)]+_[c(355)]>0&&(f[c(344)]=!0)}else if(m[c(355)]?.[c(361)]){let b=o(f),_=await On(b,m[c(355)],m[c(343)],m[c(329)],d);d()&&b[c(350)](),_>0&&(f[c(344)]=!0)}n[c(339)](f.id)===f&&(f[c(370)][c(366)]?h(f,"error",!1):m[c(359)]?h(f,f[c(344)]?c(359):c(360),!0):x(f,""))}}return{begin(f,m){let c=nt,d={id:f,inst:m,warmId:t++,chain:Promise[c(353)](),backlog:[],lastT:0,got:!1,acc:Se(),postedAt:0};return m[c(334)](!0),n[c(337)](f,d),d[c(368)]},drop(f){n[nt(332)](f)},clear(){n.clear()},hold(f,m){let c=nt,d=n[c(339)](f);return d?d[c(367)][c(361)]>=_n?(h(d,"slow",!1),!1):(d[c(367)][c(352)](m),!0):!1},chunk(f){let m=nt,c=n[m(339)](f.id);!c||c[m(368)]!==f.warmId||(c.chain=c[m(349)][m(369)](()=>r(c,f))[m(375)](d=>{let b=m;console[b(333)](b(374),d?.message||d),h(c,b(366),!0)}))}}}var xt=Me;(function(e,n){let t=Me,x=e();for(;;)try{if(parseInt(t(293))/1*(parseInt(t(279))/2)+parseInt(t(303))/3*(parseInt(t(287))/4)+parseInt(t(276))/5*(parseInt(t(317))/6)+parseInt(t(273))/7+-parseInt(t(312))/8+-parseInt(t(307))/9+parseInt(t(267))/10*(-parseInt(t(258))/11)===n)break;x.push(x.shift())}catch{x.push(x.shift())}})(u0,118627);var Rn=14e5,f0=new Map,a0={};a0[xt(265)]=[],a0[xt(270)]=null,a0[xt(315)]=[];var c0=a0,v0=Qt(),ft=null,At=[],St=0,i0=!1,O0=!1,Pt=(e,n)=>{let t=xt;try{self[t(274)](e,n||[])}catch{}},Bt=_e(Pt);function Me(e,n){return e=e-255,u0()[e]}function Nn(e){let n=xt;if(e instanceof et)return{message:e[n(290)],line:e.line,limit:!1,plan:{feature:e[n(255)],minPlan:e[n(257)]}};if(e instanceof D)return{message:e[n(290)],line:e[n(282)],limit:!1,plan:null};let t={};return t[n(290)]=(e?.name||n(283))+": "+(e?.[n(290)]||e),t[n(282)]=0,t[n(286)]=!1,t[n(302)]=null,t}function Cn({id:e,source:n,params:t}){let x=xt;f0[x(288)](e),Bt[x(281)](e);try{let o={};o.params=t,o[x(265)]=c0[x(265)],o[x(270)]=c0[x(270)],o.soundKinds=c0[x(315)],o[x(261)]=v0;let h=fe(n,o);f0[x(263)](e,h);let r=h[x(313)][x(301)]>0&&!h[x(280)]?Bt[x(309)](e,h):0,f={};f.t=x(262),f.id=e,f[x(313)]=h[x(313)],f.error=h.error,f[x(305)]=r,Pt(f)}catch(o){Pt({t:x(262),id:e,meta:null,error:Nn(o)})}}function Pn(){let e=xt;if(O0)return;O0=!0;let n={};n.t=e(299),Pt(n)}function Bn(e){let n=xt;if(e){if(e.t==="seed"){let t={};t[n(292)]=e[n(291)],At=[t],St=e.list[n(264)],i0=!1}else if(e.t==="ev"){if(i0)return;if(St+e[n(291)].length>Rn){At=[],St=0,i0=!0;try{let t={};t.t=n(260),ft?.[n(274)](t)}catch{}return}At.push(e.list),St+=e[n(291)][n(264)]}else return;Pn()}}function Fn(e){let n=xt;if(ft){ft[n(294)]=null;try{ft.close()}catch{}}ft=e||null,At=[],St=0,i0=!!ft,ft?ft[n(294)]=t=>Bn(t[n(275)]):v0.clear()}function Ln({seq:e,books:n,trades:t,nowMs:x}){let o=xt;O0=!1;let h=At;At=[],St=0;let r=[],f=[],m={};m.books=n,m[o(310)]=t&&t[o(264)]?t:null,m[o(285)]=x;let c=m;for(let[R,T]of f0)if(!(T[o(280)]||Bt[o(311)](R,c))){T[o(296)]();for(let y of n)T[o(277)](y.tMs,y[o(308)],y[o(300)],y[o(284)]);r[o(269)](R),f.push(T)}se(f,v0,h,c[o(310)]);let d=[],b=[];for(let R=0;R<f[o(264)];R++){let T=f[R];T[o(295)](x);let y=T.drain();for(let w of y[o(272)])b[o(269)](w[o(297)].buffer);let s={};s.id=r[R],s.out=y,s[o(280)]=T.error,d[o(269)](s)}let _={};_.t=o(289),_[o(298)]=e,_[o(306)]=d,Pt(_,b)}function u0(){let e=["results","892602MNzBeK","bids","begin","trades","hold","856336nGXpQA","meta","config","soundKinds","isArray","306EbayeO","feature","chunk","minPlan","320958NBTppc","port","reseed","orders","loaded","set","length","features","load","80iVYvbX","object","push","caps","history","series","1106007XqUOCE","postMessage","data","18565rYwlHy","onBook","unload","136KTyAUD","error","drop","line","Error","mid","nowMs","limit","852iuoKHc","delete","out","message","list","seed","1526syDcjX","onmessage","advance","beginBatch","points","seq","wake","asks","historyMs","plan","1509FCELAn","batch","warmId"];return u0=function(){return e},u0()}self[xt(294)]=e=>{let n=xt,t=e.data;if(!(!t||typeof t!==n(268)))switch(t.t){case n(314):c0={features:Array.isArray(t[n(265)])?t.features:[],caps:t[n(270)]||null,soundKinds:Array[n(316)](t[n(315)])?t[n(315)]:[]};return;case n(266):Cn(t);return;case n(278):f0[n(288)](t.id),Bt[n(281)](t.id);return;case n(304):Ln(t);return;case"orders":Fn(t[n(259)]);return;case n(271):Bt[n(256)](t);return;default:return}};