@luceosports/play-rendering 2.4.3 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/play-rendering.js
CHANGED
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
* Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
21
21
|
* MIT Licence
|
|
22
22
|
*/
|
|
23
|
-
var yr,hr,jr=9e15,xr="0123456789abcdef",zr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Or="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Er={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-jr,maxE:jr,crypto:!1},Ar=!0,fr="[DecimalError] Invalid argument: ",pr="[object Decimal]",Ur=Math.floor,dr=Math.pow,Cr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Qr=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,wr=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Lr=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Sr=1e7,kr=zr.length-1,vr=Or.length-1,Yr={toStringTag:pr};function mr(t){var n,e,r,i=t.length-1,u="",o=t[0];if(i>0){for(u+=o,n=1;n<i;n++)(e=7-(r=t[n]+"").length)&&(u+=Hr(e)),u+=r;(e=7-(r=(o=t[n])+"").length)&&(u+=Hr(e))}else if(0===o)return"0";for(;o%10==0;)o/=10;return u+o}function Rr(t,n,e){if(t!==~~t||t<n||t>e)throw Error(fr+t)}function Fr(t,n,e,r){var i,u,o,M;for(u=t[0];u>=10;u/=10)--n;return--n<0?(n+=7,i=0):(i=Math.ceil((n+1)/7),n%=7),u=dr(10,7-n),M=t[i]%u|0,null==r?n<3?(0==n?M=M/100|0:1==n&&(M=M/10|0),o=e<4&&99999==M||e>3&&49999==M||5e4==M||0==M):o=(e<4&&M+1==u||e>3&&M+1==u/2)&&(t[i+1]/u/100|0)==dr(10,n-2)-1||(M==u/2||0==M)&&0==(t[i+1]/u/100|0):n<4?(0==n?M=M/1e3|0:1==n?M=M/100|0:2==n&&(M=M/10|0),o=(r||e<4)&&9999==M||!r&&e>3&&4999==M):o=((r||e<4)&&M+1==u||!r&&e>3&&M+1==u/2)&&(t[i+1]/u/1e3|0)==dr(10,n-3)-1,o}function br(t,n,e){for(var r,i,u=[0],o=0,M=t.length;o<M;){for(i=u.length;i--;)u[i]*=n;for(u[0]+=xr.indexOf(t.charAt(o++)),r=0;r<u.length;r++)u[r]>e-1&&(void 0===u[r+1]&&(u[r+1]=0),u[r+1]+=u[r]/e|0,u[r]%=e)}return u.reverse()}Yr.absoluteValue=Yr.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),Br(t)},Yr.ceil=function(){return Br(new this.constructor(this),this.e+1,2)},Yr.clampedTo=Yr.clamp=function(t,n){var e=this,r=e.constructor;if(t=new r(t),n=new r(n),!t.s||!n.s)return new r(NaN);if(t.gt(n))throw Error(fr+n);return e.cmp(t)<0?t:e.cmp(n)>0?n:new r(e)},Yr.comparedTo=Yr.cmp=function(t){var n,e,r,i,u=this,o=u.d,M=(t=new u.constructor(t)).d,c=u.s,N=t.s;if(!o||!M)return c&&N?c!==N?c:o===M?0:!o^c<0?1:-1:NaN;if(!o[0]||!M[0])return o[0]?c:M[0]?-N:0;if(c!==N)return c;if(u.e!==t.e)return u.e>t.e^c<0?1:-1;for(n=0,e=(r=o.length)<(i=M.length)?r:i;n<e;++n)if(o[n]!==M[n])return o[n]>M[n]^c<0?1:-1;return r===i?0:r>i^c<0?1:-1},Yr.cosine=Yr.cos=function(){var t,n,e=this,r=e.constructor;return e.d?e.d[0]?(t=r.precision,n=r.rounding,r.precision=t+Math.max(e.e,e.sd())+7,r.rounding=1,e=function(t,n){var e,r,i;if(n.isZero())return n;(r=n.d.length)<32?(e=Math.ceil(r/3),i=(1/ii(4,e)).toString()):(e=16,i="2.3283064365386962890625e-10");t.precision+=e,n=ri(t,1,n.times(i),new t(1));for(var u=e;u--;){var o=n.times(n);n=o.times(o).minus(o).times(8).plus(1)}return t.precision-=e,n}(r,ui(r,e)),r.precision=t,r.rounding=n,Br(2==hr||3==hr?e.neg():e,t,n,!0)):new r(1):new r(NaN)},Yr.cubeRoot=Yr.cbrt=function(){var t,n,e,r,i,u,o,M,c,N,a=this,s=a.constructor;if(!a.isFinite()||a.isZero())return new s(a);for(Ar=!1,(u=a.s*dr(a.s*a,1/3))&&Math.abs(u)!=1/0?r=new s(u.toString()):(e=mr(a.d),(u=((t=a.e)-e.length+1)%3)&&(e+=1==u||-2==u?"0":"00"),u=dr(e,1/3),t=Ur((t+1)/3)-(t%3==(t<0?-1:2)),(r=new s(e=u==1/0?"5e"+t:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+t)).s=a.s),o=(t=s.precision)+3;;)if(N=(c=(M=r).times(M).times(M)).plus(a),r=Zr(N.plus(a).times(M),N.plus(c),o+2,1),mr(M.d).slice(0,o)===(e=mr(r.d)).slice(0,o)){if("9999"!=(e=e.slice(o-3,o+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(Br(r,t+1,1),n=!r.times(r).times(r).eq(a));break}if(!i&&(Br(M,t+1,0),M.times(M).times(M).eq(a))){r=M;break}o+=4,i=1}return Ar=!0,Br(r,t,s.rounding,n)},Yr.decimalPlaces=Yr.dp=function(){var t,n=this.d,e=NaN;if(n){if(e=7*((t=n.length-1)-Ur(this.e/7)),t=n[t])for(;t%10==0;t/=10)e--;e<0&&(e=0)}return e},Yr.dividedBy=Yr.div=function(t){return Zr(this,new this.constructor(t))},Yr.dividedToIntegerBy=Yr.divToInt=function(t){var n=this.constructor;return Br(Zr(this,new n(t),0,1,1),n.precision,n.rounding)},Yr.equals=Yr.eq=function(t){return 0===this.cmp(t)},Yr.floor=function(){return Br(new this.constructor(this),this.e+1,3)},Yr.greaterThan=Yr.gt=function(t){return this.cmp(t)>0},Yr.greaterThanOrEqualTo=Yr.gte=function(t){var n=this.cmp(t);return 1==n||0===n},Yr.hyperbolicCosine=Yr.cosh=function(){var t,n,e,r,i,u=this,o=u.constructor,M=new o(1);if(!u.isFinite())return new o(u.s?1/0:NaN);if(u.isZero())return M;e=o.precision,r=o.rounding,o.precision=e+Math.max(u.e,u.sd())+4,o.rounding=1,(i=u.d.length)<32?n=(1/ii(4,t=Math.ceil(i/3))).toString():(t=16,n="2.3283064365386962890625e-10"),u=ri(o,1,u.times(n),new o(1),!0);for(var c,N=t,a=new o(8);N--;)c=u.times(u),u=M.minus(c.times(a.minus(c.times(a))));return Br(u,o.precision=e,o.rounding=r,!0)},Yr.hyperbolicSine=Yr.sinh=function(){var t,n,e,r,i=this,u=i.constructor;if(!i.isFinite()||i.isZero())return new u(i);if(n=u.precision,e=u.rounding,u.precision=n+Math.max(i.e,i.sd())+4,u.rounding=1,(r=i.d.length)<3)i=ri(u,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=ri(u,2,i=i.times(1/ii(5,t)),i,!0);for(var o,M=new u(5),c=new u(16),N=new u(20);t--;)o=i.times(i),i=i.times(M.plus(o.times(c.times(o).plus(N))))}return u.precision=n,u.rounding=e,Br(i,n,e,!0)},Yr.hyperbolicTangent=Yr.tanh=function(){var t,n,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+7,r.rounding=1,Zr(e.sinh(),e.cosh(),r.precision=t,r.rounding=n)):new r(e.s)},Yr.inverseCosine=Yr.acos=function(){var t,n=this,e=n.constructor,r=n.abs().cmp(1),i=e.precision,u=e.rounding;return-1!==r?0===r?n.isNeg()?Pr(e,i,u):new e(0):new e(NaN):n.isZero()?Pr(e,i+4,u).times(.5):(e.precision=i+6,e.rounding=1,n=n.asin(),t=Pr(e,i+4,u).times(.5),e.precision=i,e.rounding=u,t.minus(n))},Yr.inverseHyperbolicCosine=Yr.acosh=function(){var t,n,e=this,r=e.constructor;return e.lte(1)?new r(e.eq(1)?0:NaN):e.isFinite()?(t=r.precision,n=r.rounding,r.precision=t+Math.max(Math.abs(e.e),e.sd())+4,r.rounding=1,Ar=!1,e=e.times(e).minus(1).sqrt().plus(e),Ar=!0,r.precision=t,r.rounding=n,e.ln()):new r(e)},Yr.inverseHyperbolicSine=Yr.asinh=function(){var t,n,e=this,r=e.constructor;return!e.isFinite()||e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+2*Math.max(Math.abs(e.e),e.sd())+6,r.rounding=1,Ar=!1,e=e.times(e).plus(1).sqrt().plus(e),Ar=!0,r.precision=t,r.rounding=n,e.ln())},Yr.inverseHyperbolicTangent=Yr.atanh=function(){var t,n,e,r,i=this,u=i.constructor;return i.isFinite()?i.e>=0?new u(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=u.precision,n=u.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?Br(new u(i),t,n,!0):(u.precision=e=r-i.e,i=Zr(i.plus(1),new u(1).minus(i),e+t,1),u.precision=t+4,u.rounding=1,i=i.ln(),u.precision=t,u.rounding=n,i.times(.5))):new u(NaN)},Yr.inverseSine=Yr.asin=function(){var t,n,e,r,i=this,u=i.constructor;return i.isZero()?new u(i):(n=i.abs().cmp(1),e=u.precision,r=u.rounding,-1!==n?0===n?((t=Pr(u,e+4,r).times(.5)).s=i.s,t):new u(NaN):(u.precision=e+6,u.rounding=1,i=i.div(new u(1).minus(i.times(i)).sqrt().plus(1)).atan(),u.precision=e,u.rounding=r,i.times(2)))},Yr.inverseTangent=Yr.atan=function(){var t,n,e,r,i,u,o,M,c,N=this,a=N.constructor,s=a.precision,D=a.rounding;if(N.isFinite()){if(N.isZero())return new a(N);if(N.abs().eq(1)&&s+4<=vr)return(o=Pr(a,s+4,D).times(.25)).s=N.s,o}else{if(!N.s)return new a(NaN);if(s+4<=vr)return(o=Pr(a,s+4,D).times(.5)).s=N.s,o}for(a.precision=M=s+10,a.rounding=1,t=e=Math.min(28,M/7+2|0);t;--t)N=N.div(N.times(N).plus(1).sqrt().plus(1));for(Ar=!1,n=Math.ceil(M/7),r=1,c=N.times(N),o=new a(N),i=N;-1!==t;)if(i=i.times(c),u=o.minus(i.div(r+=2)),i=i.times(c),void 0!==(o=u.plus(i.div(r+=2))).d[n])for(t=n;o.d[t]===u.d[t]&&t--;);return e&&(o=o.times(2<<e-1)),Ar=!0,Br(o,a.precision=s,a.rounding=D,!0)},Yr.isFinite=function(){return!!this.d},Yr.isInteger=Yr.isInt=function(){return!!this.d&&Ur(this.e/7)>this.d.length-2},Yr.isNaN=function(){return!this.s},Yr.isNegative=Yr.isNeg=function(){return this.s<0},Yr.isPositive=Yr.isPos=function(){return this.s>0},Yr.isZero=function(){return!!this.d&&0===this.d[0]},Yr.lessThan=Yr.lt=function(t){return this.cmp(t)<0},Yr.lessThanOrEqualTo=Yr.lte=function(t){return this.cmp(t)<1},Yr.logarithm=Yr.log=function(t){var n,e,r,i,u,o,M,c,N=this.constructor,a=N.precision,s=N.rounding;if(null==t)t=new N(10),n=!0;else{if(e=(t=new N(t)).d,t.s<0||!e||!e[0]||t.eq(1))return new N(NaN);n=t.eq(10)}if(e=this.d,this.s<0||!e||!e[0]||this.eq(1))return new N(e&&!e[0]?-1/0:1!=this.s?NaN:e?0:1/0);if(n)if(e.length>1)u=!0;else{for(i=e[0];i%10==0;)i/=10;u=1!==i}if(Ar=!1,o=$r(this,M=a+5),r=n?Gr(N,M+10):$r(t,M),Fr((c=Zr(o,r,M,1)).d,i=a,s))do{if(o=$r(this,M+=10),r=n?Gr(N,M+10):$r(t,M),c=Zr(o,r,M,1),!u){+mr(c.d).slice(i+1,i+15)+1==1e14&&(c=Br(c,a+1,0));break}}while(Fr(c.d,i+=10,s));return Ar=!0,Br(c,a,s)},Yr.minus=Yr.sub=function(t){var n,e,r,i,u,o,M,c,N,a,s,D,T=this,g=T.constructor;if(t=new g(t),!T.d||!t.d)return T.s&&t.s?T.d?t.s=-t.s:t=new g(t.d||T.s!==t.s?T:NaN):t=new g(NaN),t;if(T.s!=t.s)return t.s=-t.s,T.plus(t);if(N=T.d,D=t.d,M=g.precision,c=g.rounding,!N[0]||!D[0]){if(D[0])t.s=-t.s;else{if(!N[0])return new g(3===c?-0:0);t=new g(T)}return Ar?Br(t,M,c):t}if(e=Ur(t.e/7),a=Ur(T.e/7),N=N.slice(),u=a-e){for((s=u<0)?(n=N,u=-u,o=D.length):(n=D,e=a,o=N.length),u>(r=Math.max(Math.ceil(M/7),o)+2)&&(u=r,n.length=1),n.reverse(),r=u;r--;)n.push(0);n.reverse()}else{for((s=(r=N.length)<(o=D.length))&&(o=r),r=0;r<o;r++)if(N[r]!=D[r]){s=N[r]<D[r];break}u=0}for(s&&(n=N,N=D,D=n,t.s=-t.s),o=N.length,r=D.length-o;r>0;--r)N[o++]=0;for(r=D.length;r>u;){if(N[--r]<D[r]){for(i=r;i&&0===N[--i];)N[i]=Sr-1;--N[i],N[r]+=Sr}N[r]-=D[r]}for(;0===N[--o];)N.pop();for(;0===N[0];N.shift())--e;return N[0]?(t.d=N,t.e=Wr(N,e),Ar?Br(t,M,c):t):new g(3===c?-0:0)},Yr.modulo=Yr.mod=function(t){var n,e=this,r=e.constructor;return t=new r(t),!e.d||!t.s||t.d&&!t.d[0]?new r(NaN):!t.d||e.d&&!e.d[0]?Br(new r(e),r.precision,r.rounding):(Ar=!1,9==r.modulo?(n=Zr(e,t.abs(),0,3,1)).s*=t.s:n=Zr(e,t,0,r.modulo,1),n=n.times(t),Ar=!0,e.minus(n))},Yr.naturalExponential=Yr.exp=function(){return _r(this)},Yr.naturalLogarithm=Yr.ln=function(){return $r(this)},Yr.negated=Yr.neg=function(){var t=new this.constructor(this);return t.s=-t.s,Br(t)},Yr.plus=Yr.add=function(t){var n,e,r,i,u,o,M,c,N,a,s=this,D=s.constructor;if(t=new D(t),!s.d||!t.d)return s.s&&t.s?s.d||(t=new D(t.d||s.s===t.s?s:NaN)):t=new D(NaN),t;if(s.s!=t.s)return t.s=-t.s,s.minus(t);if(N=s.d,a=t.d,M=D.precision,c=D.rounding,!N[0]||!a[0])return a[0]||(t=new D(s)),Ar?Br(t,M,c):t;if(u=Ur(s.e/7),r=Ur(t.e/7),N=N.slice(),i=u-r){for(i<0?(e=N,i=-i,o=a.length):(e=a,r=u,o=N.length),i>(o=(u=Math.ceil(M/7))>o?u+1:o+1)&&(i=o,e.length=1),e.reverse();i--;)e.push(0);e.reverse()}for((o=N.length)-(i=a.length)<0&&(i=o,e=a,a=N,N=e),n=0;i;)n=(N[--i]=N[i]+a[i]+n)/Sr|0,N[i]%=Sr;for(n&&(N.unshift(n),++r),o=N.length;0==N[--o];)N.pop();return t.d=N,t.e=Wr(N,r),Ar?Br(t,M,c):t},Yr.precision=Yr.sd=function(t){var n,e=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(fr+t);return e.d?(n=Jr(e.d),t&&e.e+1>n&&(n=e.e+1)):n=NaN,n},Yr.round=function(){var t=this,n=t.constructor;return Br(new n(t),t.e+1,n.rounding)},Yr.sine=Yr.sin=function(){var t,n,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+Math.max(e.e,e.sd())+7,r.rounding=1,e=function(t,n){var e,r=n.d.length;if(r<3)return n.isZero()?n:ri(t,2,n,n);e=(e=1.4*Math.sqrt(r))>16?16:0|e,n=n.times(1/ii(5,e)),n=ri(t,2,n,n);for(var i,u=new t(5),o=new t(16),M=new t(20);e--;)i=n.times(n),n=n.times(u.plus(i.times(o.times(i).minus(M))));return n}(r,ui(r,e)),r.precision=t,r.rounding=n,Br(hr>2?e.neg():e,t,n,!0)):new r(NaN)},Yr.squareRoot=Yr.sqrt=function(){var t,n,e,r,i,u,o=this,M=o.d,c=o.e,N=o.s,a=o.constructor;if(1!==N||!M||!M[0])return new a(!N||N<0&&(!M||M[0])?NaN:M?o:1/0);for(Ar=!1,0==(N=Math.sqrt(+o))||N==1/0?(((n=mr(M)).length+c)%2==0&&(n+="0"),N=Math.sqrt(n),c=Ur((c+1)/2)-(c<0||c%2),r=new a(n=N==1/0?"5e"+c:(n=N.toExponential()).slice(0,n.indexOf("e")+1)+c)):r=new a(N.toString()),e=(c=a.precision)+3;;)if(r=(u=r).plus(Zr(o,u,e+2,1)).times(.5),mr(u.d).slice(0,e)===(n=mr(r.d)).slice(0,e)){if("9999"!=(n=n.slice(e-3,e+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(Br(r,c+1,1),t=!r.times(r).eq(o));break}if(!i&&(Br(u,c+1,0),u.times(u).eq(o))){r=u;break}e+=4,i=1}return Ar=!0,Br(r,c,a.rounding,t)},Yr.tangent=Yr.tan=function(){var t,n,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+10,r.rounding=1,(e=e.sin()).s=1,e=Zr(e,new r(1).minus(e.times(e)).sqrt(),t+10,0),r.precision=t,r.rounding=n,Br(2==hr||4==hr?e.neg():e,t,n,!0)):new r(NaN)},Yr.times=Yr.mul=function(t){var n,e,r,i,u,o,M,c,N,a=this,s=a.constructor,D=a.d,T=(t=new s(t)).d;if(t.s*=a.s,!(D&&D[0]&&T&&T[0]))return new s(!t.s||D&&!D[0]&&!T||T&&!T[0]&&!D?NaN:D&&T?0*t.s:t.s/0);for(e=Ur(a.e/7)+Ur(t.e/7),(c=D.length)<(N=T.length)&&(u=D,D=T,T=u,o=c,c=N,N=o),u=[],r=o=c+N;r--;)u.push(0);for(r=N;--r>=0;){for(n=0,i=c+r;i>r;)M=u[i]+T[r]*D[i-r-1]+n,u[i--]=M%Sr|0,n=M/Sr|0;u[i]=(u[i]+n)%Sr|0}for(;!u[--o];)u.pop();return n?++e:u.shift(),t.d=u,t.e=Wr(u,e),Ar?Br(t,s.precision,s.rounding):t},Yr.toBinary=function(t,n){return oi(this,2,t,n)},Yr.toDecimalPlaces=Yr.toDP=function(t,n){var e=this,r=e.constructor;return e=new r(e),void 0===t?e:(Rr(t,0,1e9),void 0===n?n=r.rounding:Rr(n,0,8),Br(e,t+e.e+1,n))},Yr.toExponential=function(t,n){var e,r=this,i=r.constructor;return void 0===t?e=Vr(r,!0):(Rr(t,0,1e9),void 0===n?n=i.rounding:Rr(n,0,8),e=Vr(r=Br(new i(r),t+1,n),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+e:e},Yr.toFixed=function(t,n){var e,r,i=this,u=i.constructor;return void 0===t?e=Vr(i):(Rr(t,0,1e9),void 0===n?n=u.rounding:Rr(n,0,8),e=Vr(r=Br(new u(i),t+i.e+1,n),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+e:e},Yr.toFraction=function(t){var n,e,r,i,u,o,M,c,N,a,s,D,T=this,g=T.d,l=T.constructor;if(!g)return new l(T);if(N=e=new l(1),r=c=new l(0),o=(u=(n=new l(r)).e=Jr(g)-T.e-1)%7,n.d[0]=dr(10,o<0?7+o:o),null==t)t=u>0?n:N;else{if(!(M=new l(t)).isInt()||M.lt(N))throw Error(fr+M);t=M.gt(n)?u>0?n:N:M}for(Ar=!1,M=new l(mr(g)),a=l.precision,l.precision=u=7*g.length*2;s=Zr(M,n,0,1,1),1!=(i=e.plus(s.times(r))).cmp(t);)e=r,r=i,i=N,N=c.plus(s.times(i)),c=i,i=n,n=M.minus(s.times(i)),M=i;return i=Zr(t.minus(e),r,0,1,1),c=c.plus(i.times(N)),e=e.plus(i.times(r)),c.s=N.s=T.s,D=Zr(N,r,u,1).minus(T).abs().cmp(Zr(c,e,u,1).minus(T).abs())<1?[N,r]:[c,e],l.precision=a,Ar=!0,D},Yr.toHexadecimal=Yr.toHex=function(t,n){return oi(this,16,t,n)},Yr.toNearest=function(t,n){var e=this,r=e.constructor;if(e=new r(e),null==t){if(!e.d)return e;t=new r(1),n=r.rounding}else{if(t=new r(t),void 0===n?n=r.rounding:Rr(n,0,8),!e.d)return t.s?e:t;if(!t.d)return t.s&&(t.s=e.s),t}return t.d[0]?(Ar=!1,e=Zr(e,t,0,n,1).times(t),Ar=!0,Br(e)):(t.s=e.s,e=t),e},Yr.toNumber=function(){return+this},Yr.toOctal=function(t,n){return oi(this,8,t,n)},Yr.toPower=Yr.pow=function(t){var n,e,r,i,u,o,M=this,c=M.constructor,N=+(t=new c(t));if(!(M.d&&t.d&&M.d[0]&&t.d[0]))return new c(dr(+M,N));if((M=new c(M)).eq(1))return M;if(r=c.precision,u=c.rounding,t.eq(1))return Br(M,r,u);if((n=Ur(t.e/7))>=t.d.length-1&&(e=N<0?-N:N)<=9007199254740991)return i=Kr(c,M,e,r),t.s<0?new c(1).div(i):Br(i,r,u);if((o=M.s)<0){if(n<t.d.length-1)return new c(NaN);if(0==(1&t.d[n])&&(o=1),0==M.e&&1==M.d[0]&&1==M.d.length)return M.s=o,M}return(n=0!=(e=dr(+M,N))&&isFinite(e)?new c(e+"").e:Ur(N*(Math.log("0."+mr(M.d))/Math.LN10+M.e+1)))>c.maxE+1||n<c.minE-1?new c(n>0?o/0:0):(Ar=!1,c.rounding=M.s=1,e=Math.min(12,(n+"").length),(i=_r(t.times($r(M,r+e)),r)).d&&Fr((i=Br(i,r+5,1)).d,r,u)&&(n=r+10,+mr((i=Br(_r(t.times($r(M,n+e)),n),n+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=Br(i,r+1,0))),i.s=o,Ar=!0,c.rounding=u,Br(i,r,u))},Yr.toPrecision=function(t,n){var e,r=this,i=r.constructor;return void 0===t?e=Vr(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(Rr(t,1,1e9),void 0===n?n=i.rounding:Rr(n,0,8),e=Vr(r=Br(new i(r),t,n),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+e:e},Yr.toSignificantDigits=Yr.toSD=function(t,n){var e=this.constructor;return void 0===t?(t=e.precision,n=e.rounding):(Rr(t,1,1e9),void 0===n?n=e.rounding:Rr(n,0,8)),Br(new e(this),t,n)},Yr.toString=function(){var t=this,n=t.constructor,e=Vr(t,t.e<=n.toExpNeg||t.e>=n.toExpPos);return t.isNeg()&&!t.isZero()?"-"+e:e},Yr.truncated=Yr.trunc=function(){return Br(new this.constructor(this),this.e+1,1)},Yr.valueOf=Yr.toJSON=function(){var t=this,n=t.constructor,e=Vr(t,t.e<=n.toExpNeg||t.e>=n.toExpPos);return t.isNeg()?"-"+e:e};var Zr=function(){function t(t,n,e){var r,i=0,u=t.length;for(t=t.slice();u--;)r=t[u]*n+i,t[u]=r%e|0,i=r/e|0;return i&&t.unshift(i),t}function n(t,n,e,r){var i,u;if(e!=r)u=e>r?1:-1;else for(i=u=0;i<e;i++)if(t[i]!=n[i]){u=t[i]>n[i]?1:-1;break}return u}function e(t,n,e,r){for(var i=0;e--;)t[e]-=i,i=t[e]<n[e]?1:0,t[e]=i*r+t[e]-n[e];for(;!t[0]&&t.length>1;)t.shift()}return function(r,i,u,o,M,c){var N,a,s,D,T,g,l,I,y,h,j,x,z,O,E,A,f,p,U,d,C=r.constructor,Q=r.s==i.s?1:-1,w=r.d,L=i.d;if(!(w&&w[0]&&L&&L[0]))return new C(r.s&&i.s&&(w?!L||w[0]!=L[0]:L)?w&&0==w[0]||!L?0*Q:Q/0:NaN);for(c?(T=1,a=r.e-i.e):(c=Sr,T=7,a=Ur(r.e/T)-Ur(i.e/T)),U=L.length,f=w.length,h=(y=new C(Q)).d=[],s=0;L[s]==(w[s]||0);s++);if(L[s]>(w[s]||0)&&a--,null==u?(O=u=C.precision,o=C.rounding):O=M?u+(r.e-i.e)+1:u,O<0)h.push(1),g=!0;else{if(O=O/T+2|0,s=0,1==U){for(D=0,L=L[0],O++;(s<f||D)&&O--;s++)E=D*c+(w[s]||0),h[s]=E/L|0,D=E%L|0;g=D||s<f}else{for((D=c/(L[0]+1)|0)>1&&(L=t(L,D,c),w=t(w,D,c),U=L.length,f=w.length),A=U,x=(j=w.slice(0,U)).length;x<U;)j[x++]=0;(d=L.slice()).unshift(0),p=L[0],L[1]>=c/2&&++p;do{D=0,(N=n(L,j,U,x))<0?(z=j[0],U!=x&&(z=z*c+(j[1]||0)),(D=z/p|0)>1?(D>=c&&(D=c-1),1==(N=n(l=t(L,D,c),j,I=l.length,x=j.length))&&(D--,e(l,U<I?d:L,I,c))):(0==D&&(N=D=1),l=L.slice()),(I=l.length)<x&&l.unshift(0),e(j,l,x,c),-1==N&&(N=n(L,j,U,x=j.length))<1&&(D++,e(j,U<x?d:L,x,c)),x=j.length):0===N&&(D++,j=[0]),h[s++]=D,N&&j[0]?j[x++]=w[A]||0:(j=[w[A]],x=1)}while((A++<f||void 0!==j[0])&&O--);g=void 0!==j[0]}h[0]||h.shift()}if(1==T)y.e=a,yr=g;else{for(s=1,D=h[0];D>=10;D/=10)s++;y.e=s+a*T-1,Br(y,M?u+y.e+1:u,o,g)}return y}}();function Br(t,n,e,r){var i,u,o,M,c,N,a,s,D,T=t.constructor;t:if(null!=n){if(!(s=t.d))return t;for(i=1,M=s[0];M>=10;M/=10)i++;if((u=n-i)<0)u+=7,o=n,c=(a=s[D=0])/dr(10,i-o-1)%10|0;else if((D=Math.ceil((u+1)/7))>=(M=s.length)){if(!r)break t;for(;M++<=D;)s.push(0);a=c=0,i=1,o=(u%=7)-7+1}else{for(a=M=s[D],i=1;M>=10;M/=10)i++;c=(o=(u%=7)-7+i)<0?0:a/dr(10,i-o-1)%10|0}if(r=r||n<0||void 0!==s[D+1]||(o<0?a:a%dr(10,i-o-1)),N=e<4?(c||r)&&(0==e||e==(t.s<0?3:2)):c>5||5==c&&(4==e||r||6==e&&(u>0?o>0?a/dr(10,i-o):0:s[D-1])%10&1||e==(t.s<0?8:7)),n<1||!s[0])return s.length=0,N?(n-=t.e+1,s[0]=dr(10,(7-n%7)%7),t.e=-n||0):s[0]=t.e=0,t;if(0==u?(s.length=D,M=1,D--):(s.length=D+1,M=dr(10,7-u),s[D]=o>0?(a/dr(10,i-o)%dr(10,o)|0)*M:0),N)for(;;){if(0==D){for(u=1,o=s[0];o>=10;o/=10)u++;for(o=s[0]+=M,M=1;o>=10;o/=10)M++;u!=M&&(t.e++,s[0]==Sr&&(s[0]=1));break}if(s[D]+=M,s[D]!=Sr)break;s[D--]=0,M=1}for(u=s.length;0===s[--u];)s.pop()}return Ar&&(t.e>T.maxE?(t.d=null,t.e=NaN):t.e<T.minE&&(t.e=0,t.d=[0])),t}function Vr(t,n,e){if(!t.isFinite())return ti(t);var r,i=t.e,u=mr(t.d),o=u.length;return n?(e&&(r=e-o)>0?u=u.charAt(0)+"."+u.slice(1)+Hr(r):o>1&&(u=u.charAt(0)+"."+u.slice(1)),u=u+(t.e<0?"e":"e+")+t.e):i<0?(u="0."+Hr(-i-1)+u,e&&(r=e-o)>0&&(u+=Hr(r))):i>=o?(u+=Hr(i+1-o),e&&(r=e-i-1)>0&&(u=u+"."+Hr(r))):((r=i+1)<o&&(u=u.slice(0,r)+"."+u.slice(r)),e&&(r=e-o)>0&&(i+1===o&&(u+="."),u+=Hr(r))),u}function Wr(t,n){var e=t[0];for(n*=7;e>=10;e/=10)n++;return n}function Gr(t,n,e){if(n>kr)throw Ar=!0,e&&(t.precision=e),Error("[DecimalError] Precision limit exceeded");return Br(new t(zr),n,1,!0)}function Pr(t,n,e){if(n>vr)throw Error("[DecimalError] Precision limit exceeded");return Br(new t(Or),n,e,!0)}function Jr(t){var n=t.length-1,e=7*n+1;if(n=t[n]){for(;n%10==0;n/=10)e--;for(n=t[0];n>=10;n/=10)e++}return e}function Hr(t){for(var n="";t--;)n+="0";return n}function Kr(t,n,e,r){var i,u=new t(1),o=Math.ceil(r/7+4);for(Ar=!1;;){if(e%2&&Mi((u=u.times(n)).d,o)&&(i=!0),0===(e=Ur(e/2))){e=u.d.length-1,i&&0===u.d[e]&&++u.d[e];break}Mi((n=n.times(n)).d,o)}return Ar=!0,u}function Xr(t){return 1&t.d[t.d.length-1]}function qr(t,n,e){for(var r,i=new t(n[0]),u=0;++u<n.length;){if(!(r=new t(n[u])).s){i=r;break}i[e](r)&&(i=r)}return i}function _r(t,n){var e,r,i,u,o,M,c,N=0,a=0,s=0,D=t.constructor,T=D.rounding,g=D.precision;if(!t.d||!t.d[0]||t.e>17)return new D(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==n?(Ar=!1,c=g):c=n,M=new D(.03125);t.e>-2;)t=t.times(M),s+=5;for(c+=r=Math.log(dr(2,s))/Math.LN10*2+5|0,e=u=o=new D(1),D.precision=c;;){if(u=Br(u.times(t),c,1),e=e.times(++a),mr((M=o.plus(Zr(u,e,c,1))).d).slice(0,c)===mr(o.d).slice(0,c)){for(i=s;i--;)o=Br(o.times(o),c,1);if(null!=n)return D.precision=g,o;if(!(N<3&&Fr(o.d,c-r,T,N)))return Br(o,D.precision=g,T,Ar=!0);D.precision=c+=10,e=u=M=new D(1),a=0,N++}o=M}}function $r(t,n){var e,r,i,u,o,M,c,N,a,s,D,T=1,g=t,l=g.d,I=g.constructor,y=I.rounding,h=I.precision;if(g.s<0||!l||!l[0]||!g.e&&1==l[0]&&1==l.length)return new I(l&&!l[0]?-1/0:1!=g.s?NaN:l?0:g);if(null==n?(Ar=!1,a=h):a=n,I.precision=a+=10,r=(e=mr(l)).charAt(0),!(Math.abs(u=g.e)<15e14))return N=Gr(I,a+2,h).times(u+""),g=$r(new I(r+"."+e.slice(1)),a-10).plus(N),I.precision=h,null==n?Br(g,h,y,Ar=!0):g;for(;r<7&&1!=r||1==r&&e.charAt(1)>3;)r=(e=mr((g=g.times(t)).d)).charAt(0),T++;for(u=g.e,r>1?(g=new I("0."+e),u++):g=new I(r+"."+e.slice(1)),s=g,c=o=g=Zr(g.minus(1),g.plus(1),a,1),D=Br(g.times(g),a,1),i=3;;){if(o=Br(o.times(D),a,1),mr((N=c.plus(Zr(o,new I(i),a,1))).d).slice(0,a)===mr(c.d).slice(0,a)){if(c=c.times(2),0!==u&&(c=c.plus(Gr(I,a+2,h).times(u+""))),c=Zr(c,new I(T),a,1),null!=n)return I.precision=h,c;if(!Fr(c.d,a-10,y,M))return Br(c,I.precision=h,y,Ar=!0);I.precision=a+=10,N=o=g=Zr(s.minus(1),s.plus(1),a,1),D=Br(g.times(g),a,1),i=M=1}c=N,i+=2}}function ti(t){return String(t.s*t.s/0)}function ni(t,n){var e,r,i;for((e=n.indexOf("."))>-1&&(n=n.replace(".","")),(r=n.search(/e/i))>0?(e<0&&(e=r),e+=+n.slice(r+1),n=n.substring(0,r)):e<0&&(e=n.length),r=0;48===n.charCodeAt(r);r++);for(i=n.length;48===n.charCodeAt(i-1);--i);if(n=n.slice(r,i)){if(i-=r,t.e=e=e-r-1,t.d=[],r=(e+1)%7,e<0&&(r+=7),r<i){for(r&&t.d.push(+n.slice(0,r)),i-=7;r<i;)t.d.push(+n.slice(r,r+=7));r=7-(n=n.slice(r)).length}else r-=i;for(;r--;)n+="0";t.d.push(+n),Ar&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function ei(t,n){var e,r,i,u,o,M,c,N,a;if(n.indexOf("_")>-1){if(n=n.replace(/(\d)_(?=\d)/g,"$1"),Lr.test(n))return ni(t,n)}else if("Infinity"===n||"NaN"===n)return+n||(t.s=NaN),t.e=NaN,t.d=null,t;if(Qr.test(n))e=16,n=n.toLowerCase();else if(Cr.test(n))e=2;else{if(!wr.test(n))throw Error(fr+n);e=8}for((u=n.search(/p/i))>0?(c=+n.slice(u+1),n=n.substring(2,u)):n=n.slice(2),o=(u=n.indexOf("."))>=0,r=t.constructor,o&&(u=(M=(n=n.replace(".","")).length)-u,i=Kr(r,new r(e),u,2*u)),u=a=(N=br(n,e,Sr)).length-1;0===N[u];--u)N.pop();return u<0?new r(0*t.s):(t.e=Wr(N,a),t.d=N,Ar=!1,o&&(t=Zr(t,i,4*M)),c&&(t=t.times(Math.abs(c)<54?dr(2,c):Hi.pow(2,c))),Ar=!0,t)}function ri(t,n,e,r,i){var u,o,M,c,N=t.precision,a=Math.ceil(N/7);for(Ar=!1,c=e.times(e),M=new t(r);;){if(o=Zr(M.times(c),new t(n++*n++),N,1),M=i?r.plus(o):r.minus(o),r=Zr(o.times(c),new t(n++*n++),N,1),void 0!==(o=M.plus(r)).d[a]){for(u=a;o.d[u]===M.d[u]&&u--;);if(-1==u)break}u=M,M=r,r=o,o=u}return Ar=!0,o.d.length=a+1,o}function ii(t,n){for(var e=t;--n;)e*=t;return e}function ui(t,n){var e,r=n.s<0,i=Pr(t,t.precision,1),u=i.times(.5);if((n=n.abs()).lte(u))return hr=r?4:1,n;if((e=n.divToInt(i)).isZero())hr=r?3:2;else{if((n=n.minus(e.times(i))).lte(u))return hr=Xr(e)?r?2:3:r?4:1,n;hr=Xr(e)?r?1:4:r?3:2}return n.minus(i).abs()}function oi(t,n,e,r){var i,u,o,M,c,N,a,s,D,T=t.constructor,g=void 0!==e;if(g?(Rr(e,1,1e9),void 0===r?r=T.rounding:Rr(r,0,8)):(e=T.precision,r=T.rounding),t.isFinite()){for(g?(i=2,16==n?e=4*e-3:8==n&&(e=3*e-2)):i=n,(o=(a=Vr(t)).indexOf("."))>=0&&(a=a.replace(".",""),(D=new T(1)).e=a.length-o,D.d=br(Vr(D),10,i),D.e=D.d.length),u=c=(s=br(a,10,i)).length;0==s[--c];)s.pop();if(s[0]){if(o<0?u--:((t=new T(t)).d=s,t.e=u,s=(t=Zr(t,D,e,r,0,i)).d,u=t.e,N=yr),o=s[e],M=i/2,N=N||void 0!==s[e+1],N=r<4?(void 0!==o||N)&&(0===r||r===(t.s<0?3:2)):o>M||o===M&&(4===r||N||6===r&&1&s[e-1]||r===(t.s<0?8:7)),s.length=e,N)for(;++s[--e]>i-1;)s[e]=0,e||(++u,s.unshift(1));for(c=s.length;!s[c-1];--c);for(o=0,a="";o<c;o++)a+=xr.charAt(s[o]);if(g){if(c>1)if(16==n||8==n){for(o=16==n?4:3,--c;c%o;c++)a+="0";for(c=(s=br(a,i,n)).length;!s[c-1];--c);for(o=1,a="1.";o<c;o++)a+=xr.charAt(s[o])}else a=a.charAt(0)+"."+a.slice(1);a=a+(u<0?"p":"p+")+u}else if(u<0){for(;++u;)a="0"+a;a="0."+a}else if(++u>c)for(u-=c;u--;)a+="0";else u<c&&(a=a.slice(0,u)+"."+a.slice(u))}else a=g?"0p+0":"0";a=(16==n?"0x":2==n?"0b":8==n?"0o":"")+a}else a=ti(t);return t.s<0?"-"+a:a}function Mi(t,n){if(t.length>n)return t.length=n,!0}function ci(t){return new this(t).abs()}function Ni(t){return new this(t).acos()}function ai(t){return new this(t).acosh()}function si(t,n){return new this(t).plus(n)}function Di(t){return new this(t).asin()}function Ti(t){return new this(t).asinh()}function gi(t){return new this(t).atan()}function li(t){return new this(t).atanh()}function Ii(t,n){t=new this(t),n=new this(n);var e,r=this.precision,i=this.rounding,u=r+4;return t.s&&n.s?t.d||n.d?!n.d||t.isZero()?(e=n.s<0?Pr(this,r,i):new this(0)).s=t.s:!t.d||n.isZero()?(e=Pr(this,u,1).times(.5)).s=t.s:n.s<0?(this.precision=u,this.rounding=1,e=this.atan(Zr(t,n,u,1)),n=Pr(this,u,1),this.precision=r,this.rounding=i,e=t.s<0?e.minus(n):e.plus(n)):e=this.atan(Zr(t,n,u,1)):(e=Pr(this,u,1).times(n.s>0?.25:.75)).s=t.s:e=new this(NaN),e}function yi(t){return new this(t).cbrt()}function hi(t){return Br(t=new this(t),t.e+1,2)}function ji(t,n,e){return new this(t).clamp(n,e)}function xi(t){if(!t||"object"!=typeof t)throw Error("[DecimalError] Object expected");var n,e,r,i=!0===t.defaults,u=["precision",1,1e9,"rounding",0,8,"toExpNeg",-jr,0,"toExpPos",0,jr,"maxE",0,jr,"minE",-jr,0,"modulo",0,9];for(n=0;n<u.length;n+=3)if(e=u[n],i&&(this[e]=Er[e]),void 0!==(r=t[e])){if(!(Ur(r)===r&&r>=u[n+1]&&r<=u[n+2]))throw Error(fr+e+": "+r);this[e]=r}if(e="crypto",i&&(this[e]=Er[e]),void 0!==(r=t[e])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(fr+e+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");this[e]=!0}else this[e]=!1}return this}function zi(t){return new this(t).cos()}function Oi(t){return new this(t).cosh()}function Ei(t,n){return new this(t).div(n)}function Ai(t){return new this(t).exp()}function fi(t){return Br(t=new this(t),t.e+1,3)}function pi(){var t,n,e=new this(0);for(Ar=!1,t=0;t<arguments.length;)if((n=new this(arguments[t++])).d)e.d&&(e=e.plus(n.times(n)));else{if(n.s)return Ar=!0,new this(1/0);e=n}return Ar=!0,e.sqrt()}function Ui(t){return t instanceof Hi||t&&t.toStringTag===pr||!1}function di(t){return new this(t).ln()}function Ci(t,n){return new this(t).log(n)}function Qi(t){return new this(t).log(2)}function wi(t){return new this(t).log(10)}function Li(){return qr(this,arguments,"lt")}function Si(){return qr(this,arguments,"gt")}function ki(t,n){return new this(t).mod(n)}function vi(t,n){return new this(t).mul(n)}function Yi(t,n){return new this(t).pow(n)}function mi(t){var n,e,r,i,u=0,o=new this(1),M=[];if(void 0===t?t=this.precision:Rr(t,1,1e9),r=Math.ceil(t/7),this.crypto)if(crypto.getRandomValues)for(n=crypto.getRandomValues(new Uint32Array(r));u<r;)(i=n[u])>=429e7?n[u]=crypto.getRandomValues(new Uint32Array(1))[0]:M[u++]=i%1e7;else{if(!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");for(n=crypto.randomBytes(r*=4);u<r;)(i=n[u]+(n[u+1]<<8)+(n[u+2]<<16)+((127&n[u+3])<<24))>=214e7?crypto.randomBytes(4).copy(n,u):(M.push(i%1e7),u+=4);u=r/4}else for(;u<r;)M[u++]=1e7*Math.random()|0;for(t%=7,(r=M[--u])&&t&&(i=dr(10,7-t),M[u]=(r/i|0)*i);0===M[u];u--)M.pop();if(u<0)e=0,M=[0];else{for(e=-1;0===M[0];e-=7)M.shift();for(r=1,i=M[0];i>=10;i/=10)r++;r<7&&(e-=7-r)}return o.e=e,o.d=M,o}function Ri(t){return Br(t=new this(t),t.e+1,this.rounding)}function Fi(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function bi(t){return new this(t).sin()}function Zi(t){return new this(t).sinh()}function Bi(t){return new this(t).sqrt()}function Vi(t,n){return new this(t).sub(n)}function Wi(){var t=0,n=arguments,e=new this(n[t]);for(Ar=!1;e.s&&++t<n.length;)e=e.plus(n[t]);return Ar=!0,Br(e,this.precision,this.rounding)}function Gi(t){return new this(t).tan()}function Pi(t){return new this(t).tanh()}function Ji(t){return Br(t=new this(t),t.e+1,1)}Yr[Symbol.for("nodejs.util.inspect.custom")]=Yr.toString,Yr[Symbol.toStringTag]="Decimal";var Hi=Yr.constructor=function t(n){var e,r,i;function u(t){var n,e,r,i=this;if(!(i instanceof u))return new u(t);if(i.constructor=u,Ui(t))return i.s=t.s,void(Ar?!t.d||t.e>u.maxE?(i.e=NaN,i.d=null):t.e<u.minE?(i.e=0,i.d=[0]):(i.e=t.e,i.d=t.d.slice()):(i.e=t.e,i.d=t.d?t.d.slice():t.d));if("number"===(r=typeof t)){if(0===t)return i.s=1/t<0?-1:1,i.e=0,void(i.d=[0]);if(t<0?(t=-t,i.s=-1):i.s=1,t===~~t&&t<1e7){for(n=0,e=t;e>=10;e/=10)n++;return void(Ar?n>u.maxE?(i.e=NaN,i.d=null):n<u.minE?(i.e=0,i.d=[0]):(i.e=n,i.d=[t]):(i.e=n,i.d=[t]))}return 0*t!=0?(t||(i.s=NaN),i.e=NaN,void(i.d=null)):ni(i,t.toString())}if("string"!==r)throw Error(fr+t);return 45===(e=t.charCodeAt(0))?(t=t.slice(1),i.s=-1):(43===e&&(t=t.slice(1)),i.s=1),Lr.test(t)?ni(i,t):ei(i,t)}if(u.prototype=Yr,u.ROUND_UP=0,u.ROUND_DOWN=1,u.ROUND_CEIL=2,u.ROUND_FLOOR=3,u.ROUND_HALF_UP=4,u.ROUND_HALF_DOWN=5,u.ROUND_HALF_EVEN=6,u.ROUND_HALF_CEIL=7,u.ROUND_HALF_FLOOR=8,u.EUCLID=9,u.config=u.set=xi,u.clone=t,u.isDecimal=Ui,u.abs=ci,u.acos=Ni,u.acosh=ai,u.add=si,u.asin=Di,u.asinh=Ti,u.atan=gi,u.atanh=li,u.atan2=Ii,u.cbrt=yi,u.ceil=hi,u.clamp=ji,u.cos=zi,u.cosh=Oi,u.div=Ei,u.exp=Ai,u.floor=fi,u.hypot=pi,u.ln=di,u.log=Ci,u.log10=wi,u.log2=Qi,u.max=Li,u.min=Si,u.mod=ki,u.mul=vi,u.pow=Yi,u.random=mi,u.round=Ri,u.sign=Fi,u.sin=bi,u.sinh=Zi,u.sqrt=Bi,u.sub=Vi,u.sum=Wi,u.tan=Gi,u.tanh=Pi,u.trunc=Ji,void 0===n&&(n={}),n&&!0!==n.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<i.length;)n.hasOwnProperty(r=i[e++])||(n[r]=this[r]);return u.config(n),u}(Er);zr=new Hi(zr),Or=new Hi(Or);var Ki=Hi;function Xi(t){return"boolean"==typeof t||!!isFinite(t)&&t===Math.round(t)}var qi=Math.sign||function(t){return t>0?1:t<0?-1:0},_i=Math.log2||function(t){return Math.log(t)/Math.LN2},$i=Math.log10||function(t){return Math.log(t)/Math.LN10},tu=(Math.log1p,Math.cbrt||function(t){if(0===t)return t;var n,e=t<0;return e&&(t=-t),n=isFinite(t)?(t/((n=Math.exp(Math.log(t)/3))*n)+2*n)/3:t,e?-n:n}),nu=Math.expm1||function(t){return t>=2e-4||t<=-2e-4?Math.exp(t)-1:t+t*t/2+t*t*t/6};function eu(t,n,e){var r={2:"0b",8:"0o",16:"0x"}[n],i="";if(e){if(e<1)throw new Error("size must be in greater than 0");if(!Xi(e))throw new Error("size must be an integer");if(t>2**(e-1)-1||t<-(2**(e-1)))throw new Error("Value must be in range [-2^".concat(e-1,", 2^").concat(e-1,"-1]"));if(!Xi(t))throw new Error("Value must be an integer");t<0&&(t+=2**e),i="i".concat(e)}var u="";return t<0&&(t=-t,u="-"),"".concat(u).concat(r).concat(t.toString(n)).concat(i)}function ru(t,n){if("function"==typeof n)return n(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var{notation:e,precision:r,wordSize:i}=iu(n);switch(e){case"fixed":return ou(t,r);case"exponential":return Mu(t,r);case"engineering":return function(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=cu(uu(t),n),r=e.exponent,i=e.coefficients,u=r%3==0?r:r<0?r-3-r%3:r-r%3;if(Ae(n))for(;n>i.length||r-u+1>i.length;)i.push(0);else for(var o=Math.abs(r-u)-(i.length-1),M=0;M<o;M++)i.push(0);var c=Math.abs(r-u),N=1;for(;c>0;)N++,c--;var a=i.slice(N).join(""),s=Ae(n)&&a.length||a.match(/[1-9]/)?"."+a:"",D=i.slice(0,N).join("")+s+"e"+(r>=0?"+":"")+u.toString();return e.sign+D}(t,r);case"bin":return eu(t,2,i);case"oct":return eu(t,8,i);case"hex":return eu(t,16,i);case"auto":return function(t,n,e){if(isNaN(t)||!isFinite(t))return String(t);var r=yu(null==e?void 0:e.lowerExp,-3),i=yu(null==e?void 0:e.upperExp,5),u=uu(t),o=n?cu(u,n):u;if(o.exponent<r||o.exponent>=i)return Mu(t,n);var M=o.coefficients,c=o.exponent;M.length<n&&(M=M.concat(Nu(n-M.length))),M=M.concat(Nu(c-M.length+1+(M.length<n?n-M.length:0))),M=Nu(-c).concat(M);var N=c>0?c:0;return N<M.length-1&&M.splice(N+1,0,"."),o.sign+M.join("")}(t,r,n).replace(/((\.\d*?)(0+))($|e)/,(function(){var t=arguments[2],n=arguments[4];return"."!==t?t+n:n}));default:throw new Error('Unknown notation "'+e+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function iu(t){var n,e,r="auto";if(void 0!==t)if(Ae(t))n=t;else if(fe(t))n=t.toNumber();else{if(!Ve(t))throw new Error("Unsupported type of options, number, BigNumber, or object expected");void 0!==t.precision&&(n=Iu(t.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),void 0!==t.wordSize&&(e=Iu(t.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),t.notation&&(r=t.notation)}return{notation:r,precision:n,wordSize:e}}function uu(t){var n=String(t).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!n)throw new SyntaxError("Invalid number "+t);var e=n[1],r=n[2],i=parseFloat(n[4]||"0"),u=r.indexOf(".");i+=-1!==u?u-1:r.length-1;var o=r.replace(".","").replace(/^0*/,(function(t){return i-=t.length,""})).replace(/0*$/,"").split("").map((function(t){return parseInt(t)}));return 0===o.length&&(o.push(0),i++),{sign:e,coefficients:o,exponent:i}}function ou(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=uu(t),r="number"==typeof n?cu(e,e.exponent+1+n):e,i=r.coefficients,u=r.exponent+1,o=u+(n||0);return i.length<o&&(i=i.concat(Nu(o-i.length))),u<0&&(i=Nu(1-u).concat(i),u=1),u<i.length&&i.splice(u,0,0===u?"0.":"."),r.sign+i.join("")}function Mu(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=uu(t),r=n?cu(e,n):e,i=r.coefficients,u=r.exponent;i.length<n&&(i=i.concat(Nu(n-i.length)));var o=i.shift();return r.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(u>=0?"+":"")+u}function cu(t,n){for(var e={sign:t.sign,coefficients:t.coefficients,exponent:t.exponent},r=e.coefficients;n<=0;)r.unshift(0),e.exponent++,n++;if(r.length>n&&r.splice(n,r.length-n)[0]>=5){var i=n-1;for(r[i]++;10===r[i];)r.pop(),0===i&&(r.unshift(0),e.exponent++,i++),r[--i]++}return e}function Nu(t){for(var n=[],e=0;e<t;e++)n.push(0);return n}var au=Number.EPSILON||2220446049250313e-31;function su(t,n,e){if(null==e)return t===n;if(t===n)return!0;if(isNaN(t)||isNaN(n))return!1;if(isFinite(t)&&isFinite(n)){var r=Math.abs(t-n);return r<=au||r<=Math.max(Math.abs(t),Math.abs(n))*e}return!1}var Du=Math.acosh||function(t){return Math.log(Math.sqrt(t*t-1)+t)},Tu=Math.asinh||function(t){return Math.log(Math.sqrt(t*t+1)+t)},gu=Math.atanh||function(t){return Math.log((1+t)/(1-t))/2},lu=(Math.cosh,Math.sinh||function(t){return(Math.exp(t)-Math.exp(-t))/2});Math.tanh;function Iu(t,n){return Ae(t)?t:fe(t)?t.toNumber():void n()}function yu(t,n){return Ae(t)?t:fe(t)?t.toNumber():n}function hu(t,n,e){var r=new(0,t.constructor)(2),i="";if(e){if(e<1)throw new Error("size must be in greater than 0");if(!Xi(e))throw new Error("size must be an integer");if(t.greaterThan(r.pow(e-1).sub(1))||t.lessThan(r.pow(e-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(e-1,", 2^").concat(e-1,"-1]"));if(!t.isInteger())throw new Error("Value must be an integer");t.lessThan(0)&&(t=t.add(r.pow(e))),i="i".concat(e)}switch(n){case 2:return"".concat(t.toBinary()).concat(i);case 8:return"".concat(t.toOctal()).concat(i);case 16:return"".concat(t.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(n," not supported "))}}function ju(t,n){if("function"==typeof n)return n(t);if(!t.isFinite())return t.isNaN()?"NaN":t.gt(0)?"Infinity":"-Infinity";var{notation:e,precision:r,wordSize:i}=iu(n);switch(e){case"fixed":return function(t,n){return t.toFixed(n)}(t,r);case"exponential":return xu(t,r);case"engineering":return function(t,n){var e=t.e,r=e%3==0?e:e<0?e-3-e%3:e-e%3,i=t.mul(Math.pow(10,-r)).toPrecision(n);if(-1!==i.indexOf("e")){var u=t.constructor;i=new u(i).toFixed()}return i+"e"+(e>=0?"+":"")+r.toString()}(t,r);case"bin":return hu(t,2,i);case"oct":return hu(t,8,i);case"hex":return hu(t,16,i);case"auto":var u=zu(null==n?void 0:n.lowerExp,-3),o=zu(null==n?void 0:n.upperExp,5);if(t.isZero())return"0";var M=t.toSignificantDigits(r),c=M.e;return(c>=u&&c<o?M.toFixed():xu(t,r)).replace(/((\.\d*?)(0+))($|e)/,(function(){var t=arguments[2],n=arguments[4];return"."!==t?t+n:n}));default:throw new Error('Unknown notation "'+e+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function xu(t,n){return void 0!==n?t.toExponential(n-1):t.toExponential()}function zu(t,n){return Ae(t)?t:fe(t)?t.toNumber():n}function Ou(t,n){var e=function(t,n){if("number"==typeof t)return ru(t,n);if(fe(t))return ju(t,n);if(function(t){return t&&"object"==typeof t&&"number"==typeof t.s&&"number"==typeof t.n&&"number"==typeof t.d||!1}(t))return n&&"decimal"===n.fraction?t.toString():t.s*t.n+"/"+t.d;if(Array.isArray(t))return function t(n,e){if(Array.isArray(n)){for(var r="[",i=n.length,u=0;u<i;u++)0!==u&&(r+=", "),r+=t(n[u],e);return r+="]"}return Ou(n,e)}(t,n);if(Ce(t))return Eu(t);if("function"==typeof t)return t.syntax?String(t.syntax):"function";if(t&&"object"==typeof t){return"function"==typeof t.format?t.format(n):t&&t.toString(n)!=={}.toString()?t.toString(n):"{"+Object.keys(t).map(e=>Eu(e)+": "+Ou(t[e],n)).join(", ")+"}"}return String(t)}(t,n);return n&&"object"==typeof n&&"truncate"in n&&e.length>n.truncate?e.substring(0,n.truncate-3)+"...":e}function Eu(t){for(var n=String(t),e="",r=0;r<n.length;){var i=n.charAt(r);e+=i in Au?Au[i]:i,r++}return'"'+e+'"'}var Au={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};function fu(t,n){if(!Ce(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Nr(t)+", index: 0)");if(!Ce(n))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Nr(n)+", index: 1)");return t===n?0:t>n?1:-1}function pu(t,n,e){if(!(this instanceof pu))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=n,this.relation=e,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(n)?"["+n.join(", ")+"]":n)+")",this.stack=(new Error).stack}function Uu(t,n,e){if(!(this instanceof Uu))throw new SyntaxError("Constructor must be called with the new operator");this.index=t,arguments.length<3?(this.min=0,this.max=n):(this.min=n,this.max=e),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}function du(t){for(var n=[];Array.isArray(t);)n.push(t.length),t=t[0];return n}function Cu(t,n){if(0===n.length){if(Array.isArray(t))throw new pu(t.length,0)}else!function t(n,e,r){var i,u=n.length;if(u!==e[r])throw new pu(u,e[r]);if(r<e.length-1){var o=r+1;for(i=0;i<u;i++){var M=n[i];if(!Array.isArray(M))throw new pu(e.length-1,e.length,"<");t(n[i],e,o)}}else for(i=0;i<u;i++)if(Array.isArray(n[i]))throw new pu(e.length+1,e.length,">")}(t,n,0)}function Qu(t,n){if(void 0!==t){if(!Ae(t)||!Xi(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||"number"==typeof n&&t>=n)throw new Uu(t,n)}}function wu(t,n,e){if(!Array.isArray(n))throw new TypeError("Array expected");if(0===n.length)throw new Error("Resizing to scalar is not supported");return n.forEach((function(t){if(!Ae(t)||!Xi(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ou(n)+")")})),(Ae(t)||fe(t))&&(t=[t]),function t(n,e,r,i){var u,o,M=n.length,c=e[r],N=Math.min(M,c);if(n.length=c,r<e.length-1){var a=r+1;for(u=0;u<N;u++)o=n[u],Array.isArray(o)||(o=[o],n[u]=o),t(o,e,a,i);for(u=N;u<c;u++)o=[],n[u]=o,t(o,e,a,i)}else{for(u=0;u<N;u++)for(;Array.isArray(n[u]);)n[u]=n[u][0];for(u=N;u<c;u++)n[u]=i}}(t,n,0,void 0!==e?e:0),t}function Lu(t,n){var e=Yu(t),r=e.length;if(!Array.isArray(t)||!Array.isArray(n))throw new TypeError("Array expected");if(0===n.length)throw new pu(0,r,"!=");var i=ku(n=Su(n,r));if(r!==i)throw new pu(i,r,"!=");try{return function(t,n){for(var e,r=t,i=n.length-1;i>0;i--){var u=n[i];e=[];for(var o=r.length/u,M=0;M<o;M++)e.push(r.slice(M*u,(M+1)*u));r=e}return r}(e,n)}catch(t){if(t instanceof pu)throw new pu(i,r,"!=");throw t}}function Su(t,n){var e=ku(t),r=t.slice(),i=t.indexOf(-1);if(t.indexOf(-1,i+1)>=0)throw new Error("More than one wildcard in sizes");if(i>=0){if(!(n%e==0))throw new Error("Could not replace wildcard, since "+n+" is no multiple of "+-e);r[i]=-n/e}return r}function ku(t){return t.reduce((t,n)=>t*n,1)}function vu(t,n,e,r){var i=r||du(t);if(e)for(var u=0;u<e;u++)t=[t],i.unshift(1);for(t=function t(n,e,r){var i,u;if(Array.isArray(n)){var o=r+1;for(i=0,u=n.length;i<u;i++)n[i]=t(n[i],e,o)}else for(var M=r;M<e;M++)n=[n];return n}(t,n,0);i.length<n;)i.push(1);return t}function Yu(t){if(!Array.isArray(t))return t;var n=[];return t.forEach((function t(e){Array.isArray(e)?e.forEach(t):n.push(e)})),n}function mu(t,n){for(var e,r=0,i=0;i<t.length;i++){var u=t[i],o=Array.isArray(u);if(0===i&&o&&(r=u.length),o&&u.length!==r)return;var M=o?mu(u,n):n(u);if(void 0===e)e=M;else if(e!==M)return"mixed"}return e}function Ru(t,n,e,r){if(r<e){if(t.length!==n.length)throw new pu(t.length,n.length);for(var i=[],u=0;u<t.length;u++)i[u]=Ru(t[u],n[u],e,r+1);return i}return t.concat(n)}function Fu(){var t=Array.prototype.slice.call(arguments,0,-1),n=Array.prototype.slice.call(arguments,-1);if(1===t.length)return t[0];if(t.length>1)return t.slice(1).reduce((function(t,e){return Ru(t,e,n,0)}),t[0]);throw new Error("Wrong number of arguments in function concat")}function bu(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];for(var r=n.map(t=>t.length),i=Math.max(...r),u=new Array(i).fill(null),o=0;o<n.length;o++)for(var M=n[o],c=r[o],N=0;N<c;N++){var a=i-c+N;M[N]>u[a]&&(u[a]=M[N])}for(var s=0;s<n.length;s++)Zu(n[s],u);return u}function Zu(t,n){for(var e=n.length,r=t.length,i=0;i<r;i++){var u=e-r+i;if(t[i]<n[u]&&t[i]>1||t[i]>n[u])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(t,") not possible to broadcast dimension ").concat(r," with size ").concat(t[i]," to size ").concat(n[u]))}}function Bu(t,n){var e=du(t);if(Dr(e,n))return t;Zu(e,n);var r,i,u,o=bu(e,n),M=o.length,c=[...Array(M-e.length).fill(1),...e],N=function(t){return Oe()([],t)}(t);e.length<M&&(e=du(N=Lu(N,c)));for(var a=0;a<M;a++)e[a]<o[a]&&(r=N,i=o[a],u=a,e=du(N=Fu(...Array(i).fill(r),u)));return N}function Vu(t,n,e,r){function i(r){var i=function(t,n){for(var e={},r=0;r<n.length;r++){var i=n[r],u=t[i];void 0!==u&&(e[i]=u)}return e}(r,n.map(Wu));return function(t,n,e){if(!n.filter(t=>!function(t){return t&&"?"===t[0]}(t)).every(t=>void 0!==e[t])){var r=n.filter(t=>void 0===e[t]);throw new Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(r.map(t=>'"'.concat(t,'"')).join(", "),"."))}}(t,n,r),e(i)}return i.isFactory=!0,i.fn=t,i.dependencies=n.slice().sort(),r&&(i.meta=r),i}function Wu(t){return t&&"?"===t[0]?t.slice(1):t}pu.prototype=new RangeError,pu.prototype.constructor=RangeError,pu.prototype.name="DimensionError",pu.prototype.isDimensionError=!0,Uu.prototype=new RangeError,Uu.prototype.constructor=RangeError,Uu.prototype.name="IndexError",Uu.prototype.isIndexError=!0;var Gu=Vu("BigNumber",["?on","config"],t=>{var{on:n,config:e}=t,r=Ki.clone({precision:e.precision,modulo:Ki.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(t){return new r(t.value)},n&&n("config",(function(t,n){t.precision!==n.precision&&r.config({precision:t.precision})})),r},{isClass:!0}),Pu=e(10),Ju=e.n(Pu),Hu=Vu("Complex",[],()=>(Object.defineProperty(Ju.a,"name",{value:"Complex"}),Ju.a.prototype.constructor=Ju.a,Ju.a.prototype.type="Complex",Ju.a.prototype.isComplex=!0,Ju.a.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Ju.a.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Ju.a.prototype.format=function(t){var n=this.im,e=this.re,r=ru(this.re,t),i=ru(this.im,t),u=Ae(t)?t:t?t.precision:null;if(null!==u){var o=Math.pow(10,-u);Math.abs(e/n)<o&&(e=0),Math.abs(n/e)<o&&(n=0)}return 0===n?r:0===e?1===n?"i":-1===n?"-i":i+"i":n<0?-1===n?r+" - i":r+" - "+i.substring(1)+"i":1===n?r+" + i":r+" + "+i+"i"},Ju.a.fromPolar=function(t){switch(arguments.length){case 1:var n=arguments[0];if("object"==typeof n)return Ju()(n);throw new TypeError("Input has to be an object with r and phi keys.");case 2:var e=arguments[0],r=arguments[1];if(Ae(e)){if(de(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),Ae(r))return new Ju.a({r:e,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}throw new TypeError("Radius r is not a number.");default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},Ju.a.prototype.valueOf=Ju.a.prototype.toString,Ju.a.fromJSON=function(t){return new Ju.a(t)},Ju.a.compare=function(t,n){return t.re>n.re?1:t.re<n.re?-1:t.im>n.im?1:t.im<n.im?-1:0},Ju.a),{isClass:!0});function Ku(t){var n=0,e=1,r=Object.create(null),i=Object.create(null),u=0,o=function(t){var o=i[t];if(o&&(delete r[o],delete i[t],--n,e===o)){if(!n)return u=0,void(e=1);for(;!Object.prototype.hasOwnProperty.call(r,++e););}};return t=Math.abs(t),{hit:function(M){var c=i[M],N=++u;if(r[N]=M,i[M]=N,!c){if(++n<=t)return;return M=r[e],o(M),M}if(delete r[c],e===c)for(;!Object.prototype.hasOwnProperty.call(r,++e););},delete:o,clear:function(){n=u=0,e=1,r=Object.create(null),i=Object.create(null)}}}function Xu(t){var{hasher:n,limit:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e=null==e?Number.POSITIVE_INFINITY:e,n=null==n?JSON.stringify:n,function r(){"object"!=typeof r.cache&&(r.cache={values:new Map,lru:Ku(e||Number.POSITIVE_INFINITY)});for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];var o=n(i);if(r.cache.values.has(o))return r.cache.lru.hit(o),r.cache.values.get(o);var M=t.apply(t,i);return r.cache.values.set(o,M),r.cache.values.delete(r.cache.lru.hit(o)),M}}function qu(t){return Object.keys(t.signatures||{}).reduce((function(t,n){var e=(n.match(/,/g)||[]).length+1;return Math.max(t,e)}),-1)}Xu((function(t){return new t(1).exp()}),{hasher:$u}),Xu((function(t){return new t(1).plus(new t(5).sqrt()).div(2)}),{hasher:$u});var _u=Xu((function(t){return t.acos(-1)}),{hasher:$u});Xu((function(t){return _u(t).times(2)}),{hasher:$u});function $u(t){return t[0].precision}Math.PI,Math.PI,Math.E;to("fineStructure",.0072973525693),to("weakMixingAngle",.2229),to("efimovFactor",22.7),to("sackurTetrode",-1.16487052358);function to(t,n){return Vu(t,["config","BigNumber"],t=>{var{config:e,BigNumber:r}=t;return"BigNumber"===e.number?new r(n):n})}var no=e(16),eo=e.n(no),ro=Vu("Fraction",[],()=>(Object.defineProperty(eo.a,"name",{value:"Fraction"}),eo.a.prototype.constructor=eo.a,eo.a.prototype.type="Fraction",eo.a.prototype.isFraction=!0,eo.a.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},eo.a.fromJSON=function(t){return new eo.a(t)},eo.a),{isClass:!0}),io=Vu("Matrix",[],()=>{function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator")}return t.prototype.type="Matrix",t.prototype.isMatrix=!0,t.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},t.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},t.prototype.create=function(t,n){throw new Error("Cannot invoke create on a Matrix interface")},t.prototype.subset=function(t,n,e){throw new Error("Cannot invoke subset on a Matrix interface")},t.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},t.prototype.set=function(t,n,e){throw new Error("Cannot invoke set on a Matrix interface")},t.prototype.resize=function(t,n){throw new Error("Cannot invoke resize on a Matrix interface")},t.prototype.reshape=function(t,n){throw new Error("Cannot invoke reshape on a Matrix interface")},t.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},t.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},t.prototype.map=function(t,n){throw new Error("Cannot invoke map on a Matrix interface")},t.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},t.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},t.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},t.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},t.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},t.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},t},{isClass:!0}),uo=Vu("DenseMatrix",["Matrix"],t=>{var{Matrix:n}=t;function e(t,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");if(n&&!Ce(n))throw new Error("Invalid datatype: "+n);if(we(t))"DenseMatrix"===t.type?(this._data=ar(t._data),this._size=ar(t._size),this._datatype=n||t._datatype):(this._data=t.toArray(),this._size=t.size(),this._datatype=n||t._datatype);else if(t&&Qe(t.data)&&Qe(t.size))this._data=t.data,this._size=t.size,Cu(this._data,this._size),this._datatype=n||t.datatype;else if(Qe(t))this._data=M(t),this._size=du(this._data),Cu(this._data,this._size),this._datatype=n;else{if(t)throw new TypeError("Unsupported type of data ("+Nr(t)+")");this._data=[],this._size=[0],this._datatype=n}}function r(t,n){if(!Ye(n))throw new TypeError("Invalid index");if(n.isScalar())return t.get(n.min());var r=n.size();if(r.length!==t._size.length)throw new pu(r.length,t._size.length);for(var i=n.min(),u=n.max(),o=0,M=t._size.length;o<M;o++)Qu(i[o],t._size[o]),Qu(u[o],t._size[o]);return new e(function t(n,e,r,i){var u=i===r-1,o=e.dimension(i);return u?o.map((function(t){return Qu(t,n.length),n[t]})).valueOf():o.map((function(u){Qu(u,n.length);var o=n[u];return t(o,e,r,i+1)})).valueOf()}(t._data,n,r.length,0),t._datatype)}function i(t,n,e,r){if(!n||!0!==n.isIndex)throw new TypeError("Invalid index");var i,u=n.size(),M=n.isScalar();if(we(e)?(i=e.size(),e=e.valueOf()):i=du(e),M){if(0!==i.length)throw new TypeError("Scalar expected");t.set(n.min(),e,r)}else{if(!Dr(i,u))try{i=du(e=0===i.length?Bu([e],u):Bu(e,u))}catch(t){}if(u.length<t._size.length)throw new pu(u.length,t._size.length,"<");if(i.length<u.length){for(var c=0,N=0;1===u[c]&&1===i[c];)c++;for(;1===u[c];)N++,c++;e=vu(e,u.length,N,i)}if(!Dr(u,i))throw new pu(u,i,">");o(t,n.max().map((function(t){return t+1})),r);var a=u.length;!function t(n,e,r,i,u){var o=u===i-1,M=e.dimension(u);o?M.forEach((function(t,e){Qu(t),n[t]=r[e[0]]})):M.forEach((function(o,M){Qu(o),t(n[o],e,r[M[0]],i,u+1)}))}(t._data,n,e,a,0)}return t}function u(t,n,e){if(0===n.length){for(var r=t._data;Qe(r);)r=r[0];return r}return t._size=n.slice(0),t._data=wu(t._data,t._size,e),t}function o(t,n,e){for(var r=t._size.slice(0),i=!1;r.length<n.length;)r.push(0),i=!0;for(var o=0,M=n.length;o<M;o++)n[o]>r[o]&&(r[o]=n[o],i=!0);i&&u(t,r,e)}function M(t){return we(t)?M(t.valueOf()):Qe(t)?t.map(M):t}return e.prototype=new n,e.prototype.createDenseMatrix=function(t,n){return new e(t,n)},Object.defineProperty(e,"name",{value:"DenseMatrix"}),e.prototype.constructor=e,e.prototype.type="DenseMatrix",e.prototype.isDenseMatrix=!0,e.prototype.getDataType=function(){return mu(this._data,Nr)},e.prototype.storage=function(){return"dense"},e.prototype.datatype=function(){return this._datatype},e.prototype.create=function(t,n){return new e(t,n)},e.prototype.subset=function(t,n,e){switch(arguments.length){case 1:return r(this,t);case 2:case 3:return i(this,t,n,e);default:throw new SyntaxError("Wrong number of arguments")}},e.prototype.get=function(t){if(!Qe(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new pu(t.length,this._size.length);for(var n=0;n<t.length;n++)Qu(t[n],this._size[n]);for(var e=this._data,r=0,i=t.length;r<i;r++){var u=t[r];Qu(u,e.length),e=e[u]}return e},e.prototype.set=function(t,n,e){if(!Qe(t))throw new TypeError("Array expected");if(t.length<this._size.length)throw new pu(t.length,this._size.length,"<");var r,i,u;o(this,t.map((function(t){return t+1})),e);var M=this._data;for(r=0,i=t.length-1;r<i;r++)Qu(u=t[r],M.length),M=M[u];return Qu(u=t[t.length-1],M.length),M[u]=n,this},e.prototype.resize=function(t,n,e){if(!Le(t))throw new TypeError("Array or Matrix expected");var r=t.valueOf().map(t=>Array.isArray(t)&&1===t.length?t[0]:t);return u(e?this.clone():this,r,n)},e.prototype.reshape=function(t,n){var e=n?this.clone():this;e._data=Lu(e._data,t);var r=e._size.reduce((t,n)=>t*n);return e._size=Su(t,r),e},e.prototype.clone=function(){return new e({data:ar(this._data),size:ar(this._size),datatype:this._datatype})},e.prototype.size=function(){return this._size.slice(0)},e.prototype.map=function(t){var n=this,r=qu(t),i=function e(i,u){return Qe(i)?i.map((function(t,n){return e(t,u.concat(n))})):1===r?t(i):2===r?t(i,u):t(i,u,n)}(this._data,[]);return new e(i,void 0!==this._datatype?mu(i,Nr):void 0)},e.prototype.forEach=function(t){var n=this;!function e(r,i){Qe(r)?r.forEach((function(t,n){e(t,i.concat(n))})):t(r,i,n)}(this._data,[])},e.prototype[Symbol.iterator]=function*(){yield*function*t(n,e){if(Qe(n))for(var r=0;r<n.length;r++)yield*t(n[r],e.concat(r));else yield{value:n,index:e}}(this._data,[])},e.prototype.rows=function(){var t=[];if(2!==this.size().length)throw new TypeError("Rows can only be returned for a 2D matrix.");var n=this._data;for(var r of n)t.push(new e([r],this._datatype));return t},e.prototype.columns=function(){var t=this,n=[],r=this.size();if(2!==r.length)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var i=this._data,u=function(r){var u=i.map(t=>[t[r]]);n.push(new e(u,t._datatype))},o=0;o<r[1];o++)u(o);return n},e.prototype.toArray=function(){return ar(this._data)},e.prototype.valueOf=function(){return this._data},e.prototype.format=function(t){return Ou(this._data,t)},e.prototype.toString=function(){return Ou(this._data)},e.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},e.prototype.diagonal=function(t){if(t){if(fe(t)&&(t=t.toNumber()),!Ae(t)||!Xi(t))throw new TypeError("The parameter k must be an integer number")}else t=0;for(var n=t>0?t:0,r=t<0?-t:0,i=this._size[0],u=this._size[1],o=Math.min(i-r,u-n),M=[],c=0;c<o;c++)M[c]=this._data[c+r][c+n];return new e({data:M,size:[o],datatype:this._datatype})},e.diagonal=function(t,n,r,i){if(!Qe(t))throw new TypeError("Array expected, size parameter");if(2!==t.length)throw new Error("Only two dimensions matrix are supported");if(t=t.map((function(t){if(fe(t)&&(t=t.toNumber()),!Ae(t)||!Xi(t)||t<1)throw new Error("Size values must be positive integers");return t})),r){if(fe(r)&&(r=r.toNumber()),!Ae(r)||!Xi(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var u,o=r>0?r:0,M=r<0?-r:0,c=t[0],N=t[1],a=Math.min(c-M,N-o);if(Qe(n)){if(n.length!==a)throw new Error("Invalid value array length");u=function(t){return n[t]}}else if(we(n)){var s=n.size();if(1!==s.length||s[0]!==a)throw new Error("Invalid matrix length");u=function(t){return n.get([t])}}else u=function(){return n};i||(i=fe(u(0))?u(0).mul(0):0);var D=[];if(t.length>0){D=wu(D,t,i);for(var T=0;T<a;T++)D[T+M][T+o]=u(T)}return new e({data:D,size:[c,N]})},e.fromJSON=function(t){return new e(t)},e.prototype.swapRows=function(t,n){if(!(Ae(t)&&Xi(t)&&Ae(n)&&Xi(n)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return Qu(t,this._size[0]),Qu(n,this._size[0]),e._swapRows(t,n,this._data),this},e._swapRows=function(t,n,e){var r=e[t];e[t]=e[n],e[n]=r},e},{isClass:!0});function oo(){return!0}function Mo(){return!1}function co(){}var No=function t(){function n(t){return"object"==typeof t&&null!==t&&t.constructor===Object}const e=[{name:"number",test:function(t){return"number"==typeof t}},{name:"string",test:function(t){return"string"==typeof t}},{name:"boolean",test:function(t){return"boolean"==typeof t}},{name:"Function",test:function(t){return"function"==typeof t}},{name:"Array",test:Array.isArray},{name:"Date",test:function(t){return t instanceof Date}},{name:"RegExp",test:function(t){return t instanceof RegExp}},{name:"Object",test:n},{name:"null",test:function(t){return null===t}},{name:"undefined",test:function(t){return void 0===t}}],r={name:"any",test:oo,isAny:!0};let i,u,o=0,M={createCount:0};function c(t){const n=i.get(t);if(n)return n;let e='Unknown type "'+t+'"';const r=t.toLowerCase();let o;for(o of u)if(o.toLowerCase()===r){e+='. Did you mean "'+o+'" ?';break}throw new TypeError(e)}function N(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";const e=n?c(n).index:u.length,r=[];for(let n=0;n<t.length;++n){if(!t[n]||"string"!=typeof t[n].name||"function"!=typeof t[n].test)throw new TypeError("Object with properties {name: string, test: function} expected");const u=t[n].name;if(i.has(u))throw new TypeError('Duplicate type name "'+u+'"');r.push(u),i.set(u,{name:u,test:t[n].test,isAny:t[n].isAny,index:e+n,conversionsTo:[]})}const o=u.slice(e);u=u.slice(0,e).concat(r).concat(o);for(let t=e+r.length;t<u.length;++t)i.get(u[t]).index=t}function a(){i=new Map,u=[],o=0,N([r],!1)}function s(t){const n=u.filter(n=>{const e=i.get(n);return!e.isAny&&e.test(t)});return n.length?n:["any"]}function D(t){return t&&"function"==typeof t&&"_typedFunctionData"in t}function T(t,n,e){if(!D(t))throw new TypeError("Argument is not a typed-function.");const r=e&&e.exact,i=h(Array.isArray(n)?n.join(","):n),u=g(i);if(!r||u in t.signatures){const n=t._typedFunctionData.signatureMap.get(u);if(n)return n}const o=i.length;let M,c;if(r){let n;for(n in M=[],t.signatures)M.push(t._typedFunctionData.signatureMap.get(n))}else M=t._typedFunctionData.signatures;for(let t=0;t<o;++t){const n=i[t],e=[];let r;for(r of M){const i=O(r.params,t);if(i&&(!n.restParam||i.restParam)){if(!i.hasAny){const t=y(i);if(n.types.some(n=>!t.has(n.name)))continue}e.push(r)}}if(M=e,0===M.length)break}for(c of M)if(c.params.length<=o)return c;throw new TypeError("Signature not found (signature: "+(t.name||"unnamed")+"("+g(i,", ")+"))")}function g(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return t.map(t=>t.name).join(n)}function l(t){const n=0===t.indexOf("..."),e=(n?t.length>3?t.slice(3):"any":t).split("|").map(t=>c(t.trim()));let r=!1,i=n?"...":"";return{types:e.map((function(t){return r=t.isAny||r,i+=t.name+"|",{name:t.name,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:null,conversionIndex:-1}})),name:i.slice(0,-1),hasAny:r,hasConversion:!1,restParam:n}}function I(t){const n=function(t){if(0===t.length)return[];const n=t.map(c);t.length>1&&n.sort((t,n)=>t.index-n.index);let e=n[0].conversionsTo;if(1===t.length)return e;e=e.concat([]);const r=new Set(t);for(let t=1;t<n.length;++t){let i;for(i of n[t].conversionsTo)r.has(i.from)||(e.push(i),r.add(i.from))}return e}(t.types.map(t=>t.name));let e=t.hasAny,r=t.name;const i=n.map((function(t){const n=c(t.from);return e=n.isAny||e,r+="|"+t.from,{name:t.from,typeIndex:n.index,test:n.test,isAny:n.isAny,conversion:t,conversionIndex:t.index}}));return{types:t.types.concat(i),name:r,hasAny:e,hasConversion:i.length>0,restParam:t.restParam}}function y(t){return t.typeSet||(t.typeSet=new Set,t.types.forEach(n=>t.typeSet.add(n.name))),t.typeSet}function h(t){const n=[];if("string"!=typeof t)throw new TypeError("Signatures must be strings");const e=t.trim();if(""===e)return n;const r=e.split(",");for(let t=0;t<r.length;++t){const e=l(r[t].trim());if(e.restParam&&t!==r.length-1)throw new SyntaxError('Unexpected rest parameter "'+r[t]+'": only allowed for the last parameter');if(0===e.types.length)return null;n.push(e)}return n}function j(t){const n=b(t);return!!n&&n.restParam}function x(t){if(t&&0!==t.types.length){if(1===t.types.length)return c(t.types[0].name).test;if(2===t.types.length){const n=c(t.types[0].name).test,e=c(t.types[1].name).test;return function(t){return n(t)||e(t)}}{const n=t.types.map((function(t){return c(t.name).test}));return function(t){for(let e=0;e<n.length;e++)if(n[e](t))return!0;return!1}}}return oo}function z(t){let n,e,r;if(j(t)){n=F(t).map(x);const e=n.length,r=x(b(t)),i=function(t){for(let n=e;n<t.length;n++)if(!r(t[n]))return!1;return!0};return function(t){for(let e=0;e<n.length;e++)if(!n[e](t[e]))return!1;return i(t)&&t.length>=e+1}}return 0===t.length?function(t){return 0===t.length}:1===t.length?(e=x(t[0]),function(t){return e(t[0])&&1===t.length}):2===t.length?(e=x(t[0]),r=x(t[1]),function(t){return e(t[0])&&r(t[1])&&2===t.length}):(n=t.map(x),function(t){for(let e=0;e<n.length;e++)if(!n[e](t[e]))return!1;return t.length===n.length})}function O(t,n){return n<t.length?t[n]:j(t)?b(t):null}function E(t,n){const e=O(t,n);return e?y(e):new Set}function A(t){return null===t.conversion||void 0===t.conversion}function f(t,n){const e=new Set;return t.forEach(t=>{const r=E(t.params,n);let i;for(i of r)e.add(i)}),e.has("any")?["any"]:Array.from(e)}function p(t,n,e){let r,i;const u=t||"unnamed";let o,M=e;for(o=0;o<n.length;o++){const t=[];if(M.forEach(e=>{const r=x(O(e.params,o));(o<e.params.length||j(e.params))&&r(n[o])&&t.push(e)}),0===t.length){if(i=f(M,o),i.length>0){const t=s(n[o]);return r=new TypeError("Unexpected type of argument in function "+u+" (expected: "+i.join(" or ")+", actual: "+t.join(" | ")+", index: "+o+")"),r.data={category:"wrongType",fn:u,index:o,actual:t,expected:i},r}}else M=t}const c=M.map((function(t){return j(t.params)?1/0:t.params.length}));if(n.length<Math.min.apply(null,c))return i=f(M,o),r=new TypeError("Too few arguments in function "+u+" (expected: "+i.join(" or ")+", index: "+n.length+")"),r.data={category:"tooFewArgs",fn:u,index:n.length,expected:i},r;const N=Math.max.apply(null,c);if(n.length>N)return r=new TypeError("Too many arguments in function "+u+" (expected: "+N+", actual: "+n.length+")"),r.data={category:"tooManyArgs",fn:u,index:n.length,expectedLength:N},r;const a=[];for(let t=0;t<n.length;++t)a.push(s(n[t]).join("|"));return r=new TypeError('Arguments of type "'+a.join(", ")+'" do not match any of the defined signatures of function '+u+"."),r.data={category:"mismatch",actual:a},r}function U(t){let n=u.length+1;for(let e=0;e<t.types.length;e++)A(t.types[e])&&(n=Math.min(n,t.types[e].typeIndex));return n}function d(t){let n=o+1;for(let e=0;e<t.types.length;e++)A(t.types[e])||(n=Math.min(n,t.types[e].conversionIndex));return n}function C(t,n){if(t.hasAny){if(!n.hasAny)return 1}else if(n.hasAny)return-1;if(t.restParam){if(!n.restParam)return 1}else if(n.restParam)return-1;if(t.hasConversion){if(!n.hasConversion)return 1}else if(n.hasConversion)return-1;const e=U(t)-U(n);if(e<0)return-1;if(e>0)return 1;const r=d(t)-d(n);return r<0?-1:r>0?1:0}function Q(t,n){const e=t.params,r=n.params,i=b(e),u=b(r),o=j(e),M=j(r);if(o&&i.hasAny){if(!M||!u.hasAny)return 1}else if(M&&u.hasAny)return-1;let c,N=0,a=0;for(c of e)c.hasAny&&++N,c.hasConversion&&++a;let s=0,D=0;for(c of r)c.hasAny&&++s,c.hasConversion&&++D;if(N!==s)return N-s;if(o&&i.hasConversion){if(!M||!u.hasConversion)return 1}else if(M&&u.hasConversion)return-1;if(a!==D)return a-D;if(o){if(!M)return 1}else if(M)return-1;const T=(e.length-r.length)*(o?-1:1);if(0!==T)return T;const g=[];let l,I=0;for(let t=0;t<e.length;++t){const n=C(e[t],r[t]);g.push(n),I+=n}if(0!==I)return I;for(l of g)if(0!==l)return l;return 0}function w(t,n){let e=n;if(t.some(t=>t.hasConversion)){const r=j(t),i=t.map(L);e=function(){const t=[],e=r?arguments.length-1:arguments.length;for(let n=0;n<e;n++)t[n]=i[n](arguments[n]);return r&&(t[e]=arguments[e].map(i[e])),n.apply(this,t)}}let r=e;if(j(t)){const n=t.length-1;r=function(){return e.apply(this,Z(arguments,0,n).concat([Z(arguments,n)]))}}return r}function L(t){let n,e,r,i;const u=[],o=[];switch(t.types.forEach((function(t){t.conversion&&(u.push(c(t.conversion.from).test),o.push(t.conversion.convert))})),o.length){case 0:return function(t){return t};case 1:return n=u[0],r=o[0],function(t){return n(t)?r(t):t};case 2:return n=u[0],e=u[1],r=o[0],i=o[1],function(t){return n(t)?r(t):e(t)?i(t):t};default:return function(t){for(let n=0;n<o.length;n++)if(u[n](t))return o[n](t);return t}}}function S(t){return function t(n,e,r){if(e<n.length){const o=n[e];let M=[];if(o.restParam){const t=o.types.filter(A);t.length<o.types.length&&M.push({types:t,name:"..."+t.map(t=>t.name).join("|"),hasAny:t.some(t=>t.isAny),hasConversion:!1,restParam:!0}),M.push(o)}else M=o.types.map((function(t){return{types:[t],name:t.name,hasAny:t.isAny,hasConversion:t.conversion,restParam:!1}}));return i=M,u=function(i){return t(n,e+1,r.concat([i]))},Array.prototype.concat.apply([],i.map(u))}return[r];var i,u}(t,0,[])}function k(t,n){const e=Math.max(t.length,n.length);for(let r=0;r<e;r++){const e=E(t,r),i=E(n,r);let u,o=!1;for(u of i)if(e.has(u)){o=!0;break}if(!o)return!1}const r=t.length,i=n.length,u=j(t),o=j(n);return u?o?r===i:i>=r:o?r>=i:r===i}function v(t,n,e){const r=[];let i;for(i of t){let t=e[i];if("number"!=typeof t)throw new TypeError('No definition for referenced signature "'+i+'"');if(t=n[t],"function"!=typeof t)return!1;r.push(t)}return r}function Y(t,n,e){const r=function(t){return t.map(t=>G(t)?V(t.referToSelf.callback):W(t)?B(t.referTo.references,t.referTo.callback):t)}(t),i=new Array(r.length).fill(!1);let u=!0;for(;u;){u=!1;let t=!0;for(let o=0;o<r.length;++o){if(i[o])continue;const M=r[o];if(G(M))r[o]=M.referToSelf.callback(e),r[o].referToSelf=M.referToSelf,i[o]=!0,t=!1;else if(W(M)){const e=v(M.referTo.references,r,n);e?(r[o]=M.referTo.callback.apply(this,e),r[o].referTo=M.referTo,i[o]=!0,t=!1):u=!0}}if(t&&u)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return r}function m(t,n){if(M.createCount++,0===Object.keys(n).length)throw new SyntaxError("No signatures provided");M.warnAgainstDeprecatedThis&&function(t){const n=/\bthis(\(|\.signatures\b)/;Object.keys(t).forEach(e=>{const r=t[e];if(n.test(r.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}(n);const e=[],r=[],i={},u=[];let o;for(o in n){if(!Object.prototype.hasOwnProperty.call(n,o))continue;const t=h(o);if(!t)continue;e.forEach((function(n){if(k(n,t))throw new TypeError('Conflicting signatures "'+g(n)+'" and "'+g(t)+'".')})),e.push(t);const M=r.length;r.push(n[o]);const c=t.map(I);let N;for(N of S(c)){const t=g(N);u.push({params:N,name:t,fn:M}),N.every(t=>!t.hasConversion)&&(i[t]=M)}}u.sort(Q);const c=Y(r,i,ut);let N;for(N in i)Object.prototype.hasOwnProperty.call(i,N)&&(i[N]=c[i[N]]);const a=[],s=new Map;for(N of u)s.has(N.name)||(N.fn=c[N.fn],a.push(N),s.set(N.name,N));const D=a[0]&&a[0].params.length<=2&&!j(a[0].params),T=a[1]&&a[1].params.length<=2&&!j(a[1].params),l=a[2]&&a[2].params.length<=2&&!j(a[2].params),y=a[3]&&a[3].params.length<=2&&!j(a[3].params),O=a[4]&&a[4].params.length<=2&&!j(a[4].params),E=a[5]&&a[5].params.length<=2&&!j(a[5].params),A=D&&T&&l&&y&&O&&E;for(let t=0;t<a.length;++t)a[t].test=z(a[t].params);const f=D?x(a[0].params[0]):Mo,p=T?x(a[1].params[0]):Mo,U=l?x(a[2].params[0]):Mo,d=y?x(a[3].params[0]):Mo,C=O?x(a[4].params[0]):Mo,L=E?x(a[5].params[0]):Mo,v=D?x(a[0].params[1]):Mo,m=T?x(a[1].params[1]):Mo,R=l?x(a[2].params[1]):Mo,F=y?x(a[3].params[1]):Mo,b=O?x(a[4].params[1]):Mo,Z=E?x(a[5].params[1]):Mo;for(let t=0;t<a.length;++t)a[t].implementation=w(a[t].params,a[t].fn);const B=D?a[0].implementation:co,V=T?a[1].implementation:co,W=l?a[2].implementation:co,G=y?a[3].implementation:co,P=O?a[4].implementation:co,J=E?a[5].implementation:co,H=D?a[0].params.length:-1,K=T?a[1].params.length:-1,X=l?a[2].params.length:-1,q=y?a[3].params.length:-1,_=O?a[4].params.length:-1,$=E?a[5].params.length:-1,tt=A?6:0,nt=a.length,et=a.map(t=>t.test),rt=a.map(t=>t.implementation),it=function(){for(let t=tt;t<nt;t++)if(et[t](arguments))return rt[t].apply(this,arguments);return M.onMismatch(t,arguments,a)};function ut(t,n){return arguments.length===H&&f(t)&&v(n)?B.apply(this,arguments):arguments.length===K&&p(t)&&m(n)?V.apply(this,arguments):arguments.length===X&&U(t)&&R(n)?W.apply(this,arguments):arguments.length===q&&d(t)&&F(n)?G.apply(this,arguments):arguments.length===_&&C(t)&&b(n)?P.apply(this,arguments):arguments.length===$&&L(t)&&Z(n)?J.apply(this,arguments):it.apply(this,arguments)}try{Object.defineProperty(ut,"name",{value:t})}catch(t){}return ut.signatures=i,ut._typedFunctionData={signatures:a,signatureMap:s},ut}function R(t,n,e){throw p(t,n,e)}function F(t){return Z(t,0,t.length-1)}function b(t){return t[t.length-1]}function Z(t,n,e){return Array.prototype.slice.call(t,n,e)}function B(t,n){return{referTo:{references:t,callback:n}}}function V(t){if("function"!=typeof t)throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:t}}}function W(t){return t&&"object"==typeof t.referTo&&Array.isArray(t.referTo.references)&&"function"==typeof t.referTo.callback}function G(t){return t&&"object"==typeof t.referToSelf&&"function"==typeof t.referToSelf.callback}function P(t,n){if(!t)return n;if(n&&n!==t){const e=new Error("Function names do not match (expected: "+t+", actual: "+n+")");throw e.data={actual:n,expected:t},e}return t}function J(t){let n;for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(D(t[e])||"string"==typeof t[e].signature)&&(n=P(n,t[e].name));return n}function H(t,n){let e;for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){if(e in t&&n[e]!==t[e]){const r=new Error('Signature "'+e+'" is defined twice');throw r.data={signature:e,sourceFunction:n[e],destFunction:t[e]},r}t[e]=n[e]}}a(),N(e);const K=M;function X(t){if(!t||"string"!=typeof t.from||"string"!=typeof t.to||"function"!=typeof t.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(t.to===t.from)throw new SyntaxError('Illegal to define conversion from "'+t.from+'" to itself.')}return M=function(t){const e="string"==typeof t,r=e?1:0;let i=e?t:"";const u={};for(let t=r;t<arguments.length;++t){const r=arguments[t];let o,M={};if("function"==typeof r?(o=r.name,"string"==typeof r.signature?M[r.signature]=r:D(r)&&(M=r.signatures)):n(r)&&(M=r,e||(o=J(r))),0===Object.keys(M).length){const n=new TypeError("Argument to 'typed' at index "+t+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw n.data={index:t,argument:r},n}e||(i=P(i,o)),H(u,M)}return m(i||"",u)},M.create=t,M.createCount=K.createCount,M.onMismatch=R,M.throwMismatchError=R,M.createError=p,M.clear=a,M.clearConversions=function(){let t;for(t of u)i.get(t).conversionsTo=[];o=0},M.addTypes=N,M._findType=c,M.referTo=function(){const t=F(arguments).map(t=>g(h(t))),n=b(arguments);if("function"!=typeof n)throw new TypeError("Callback function expected as last argument");return B(t,n)},M.referToSelf=V,M.convert=function(t,n){const e=c(n);if(e.test(t))return t;const r=e.conversionsTo;if(0===r.length)throw new Error("There are no conversions to "+n+" defined.");for(let n=0;n<r.length;n++){if(c(r[n].from).test(t))return r[n].convert(t)}throw new Error("Cannot convert "+t+" to "+n)},M.findSignature=T,M.find=function(t,n,e){return T(t,n,e).implementation},M.isTypedFunction=D,M.warnAgainstDeprecatedThis=!0,M.addType=function(t,n){let e="any";!1!==n&&i.has("Object")&&(e="Object"),M.addTypes([t],e)},M.addConversion=function(t){X(t);const n=c(t.to);if(!n.conversionsTo.every((function(n){return n.from!==t.from})))throw new Error('There is already a conversion from "'+t.from+'" to "'+n.name+'"');n.conversionsTo.push({from:t.from,convert:t.convert,index:o++})},M.addConversions=function(t){t.forEach(M.addConversion)},M.removeConversion=function(t){X(t);const n=c(t.to),e=function(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return t[e]}(n.conversionsTo,n=>n.from===t.from);if(!e)throw new Error("Attempt to remove nonexistent conversion from "+t.from+" to "+t.to);if(e.convert!==t.convert)throw new Error("Conversion to remove does not match existing conversion");const r=n.conversionsTo.indexOf(e);n.conversionsTo.splice(r,1)},M.resolve=function(t,n){if(!D(t))throw new TypeError("Argument is not a typed-function.");const e=t._typedFunctionData.signatures;for(let t=0;t<e.length;++t)if(e[t].test(n))return e[t];return null},M}();function ao(t,n){if(go(t)&&Do(t,n))return t[n];if("function"==typeof t[n]&&To(t,n))throw new Error('Cannot access method "'+n+'" as a property');throw new Error('No access to property "'+n+'"')}function so(t,n,e){if(go(t)&&Do(t,n))return t[n]=e,e;throw new Error('No access to property "'+n+'"')}function Do(t,n){return!(!t||"object"!=typeof t)&&(!!Tr(lo,n)||!(n in Object.prototype)&&!(n in Function.prototype))}function To(t,n){return null!=t&&"function"==typeof t[n]&&(!(Tr(t,n)&&Object.getPrototypeOf&&n in Object.getPrototypeOf(t))&&(!!Tr(Io,n)||!(n in Object.prototype)&&!(n in Function.prototype)))}function go(t){return"object"==typeof t&&t&&t.constructor===Object}var lo={length:!0,name:!0},Io={toString:!0,valueOf:!0,toLocaleString:!0};class yo{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(t){return ao(this.wrappedObject,t)}set(t,n){return so(this.wrappedObject,t,n),this}has(t){return n=this.wrappedObject,t in n;var n}entries(){return ho(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var n of this.keys())t(this.get(n),n,this)}delete(t){delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}}function ho(t,n){return{next:()=>{var e=t.next();return e.done?e:{value:n(e.value),done:!1}}}}function jo(t){return!!t&&(t instanceof Map||t instanceof yo||"function"==typeof t.set&&"function"==typeof t.get&&"function"==typeof t.keys&&"function"==typeof t.has)}var xo=function(){return xo=No.create,No},zo=Vu("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(t){var{BigNumber:n,Complex:e,DenseMatrix:r,Fraction:i}=t,u=xo();return u.clear(),u.addTypes([{name:"number",test:Ae},{name:"Complex",test:pe},{name:"BigNumber",test:fe},{name:"Fraction",test:Ue},{name:"Unit",test:de},{name:"identifier",test:t=>Ce&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(t)},{name:"string",test:Ce},{name:"Chain",test:cr},{name:"Array",test:Qe},{name:"Matrix",test:we},{name:"DenseMatrix",test:Se},{name:"SparseMatrix",test:ke},{name:"Range",test:ve},{name:"Index",test:Ye},{name:"boolean",test:me},{name:"ResultSet",test:Re},{name:"Help",test:Fe},{name:"function",test:be},{name:"Date",test:Ze},{name:"RegExp",test:Be},{name:"null",test:We},{name:"undefined",test:Ge},{name:"AccessorNode",test:Pe},{name:"ArrayNode",test:Je},{name:"AssignmentNode",test:He},{name:"BlockNode",test:Ke},{name:"ConditionalNode",test:Xe},{name:"ConstantNode",test:qe},{name:"FunctionNode",test:$e},{name:"FunctionAssignmentNode",test:_e},{name:"IndexNode",test:tr},{name:"Node",test:nr},{name:"ObjectNode",test:er},{name:"OperatorNode",test:rr},{name:"ParenthesisNode",test:ir},{name:"RangeNode",test:ur},{name:"RelationalNode",test:or},{name:"SymbolNode",test:Mr},{name:"Map",test:jo},{name:"Object",test:Ve}]),u.addConversions([{from:"number",to:"BigNumber",convert:function(t){if(n||Oo(t),t.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+t+"). Use function bignumber(x) to convert to BigNumber.");return new n(t)}},{from:"number",to:"Complex",convert:function(t){return e||Eo(t),new e(t,0)}},{from:"BigNumber",to:"Complex",convert:function(t){return e||Eo(t),new e(t.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(t){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(t){return e||Eo(t),new e(t.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(t){i||Ao(t);var n=new i(t);if(n.valueOf()!==t)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+t+"). Use function fraction(x) to convert to Fraction.");return n}},{from:"string",to:"number",convert:function(t){var n=Number(t);if(isNaN(n))throw new Error('Cannot convert "'+t+'" to a number');return n}},{from:"string",to:"BigNumber",convert:function(t){n||Oo(t);try{return new n(t)}catch(n){throw new Error('Cannot convert "'+t+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(t){i||Ao(t);try{return new i(t)}catch(n){throw new Error('Cannot convert "'+t+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(t){e||Eo(t);try{return new e(t)}catch(n){throw new Error('Cannot convert "'+t+'" to Complex')}}},{from:"boolean",to:"number",convert:function(t){return+t}},{from:"boolean",to:"BigNumber",convert:function(t){return n||Oo(t),new n(+t)}},{from:"boolean",to:"Fraction",convert:function(t){return i||Ao(t),new i(+t)}},{from:"boolean",to:"string",convert:function(t){return String(t)}},{from:"Array",to:"Matrix",convert:function(t){return r||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new r(t)}},{from:"Matrix",to:"Array",convert:function(t){return t.valueOf()}}]),u.onMismatch=(t,n,e)=>{var r=u.createError(t,n,e);if(["wrongType","mismatch"].includes(r.data.category)&&1===n.length&&Le(n[0])&&e.some(t=>!t.params.includes(","))){var i=new TypeError("Function '".concat(t,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(t,")'."));throw i.data=r.data,i}throw r},u.onMismatch=(t,n,e)=>{var r=u.createError(t,n,e);if(["wrongType","mismatch"].includes(r.data.category)&&1===n.length&&Le(n[0])&&e.some(t=>!t.params.includes(","))){var i=new TypeError("Function '".concat(t,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(t,")'."));throw i.data=r.data,i}throw r},u}));function Oo(t){throw new Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function Eo(t){throw new Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function Ao(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}function fo(t,n,e){return t&&"function"==typeof t.map?t.map((function(t){return fo(t,n,e)})):n(t)}var po="number",Uo="number, number";function Co(t){return Math.abs(t)}function Qo(t,n){return t+n}function wo(t,n){return t-n}function Lo(t,n){return t*n}function So(t){return-t}function ko(t){return t}function vo(t){return tu(t)}function Yo(t){return t*t*t}function mo(t){return Math.exp(t)}function Ro(t){return nu(t)}function Fo(t,n){if(!Xi(t)||!Xi(n))throw new Error("Parameters in function lcm must be integer numbers");if(0===t||0===n)return 0;for(var e,r=t*n;0!==n;)n=t%(e=n),t=e;return Math.abs(r/t)}function bo(t){return $i(t)}function Zo(t){return _i(t)}function Bo(t){return qi(t)}function Vo(t){return t*t}function Wo(t,n){var e,r,i,u=0,o=1,M=1,c=0;if(!Xi(t)||!Xi(n))throw new Error("Parameters in function xgcd must be integer numbers");for(;n;)i=t-(r=Math.floor(t/n))*n,e=u,u=o-r*u,o=e,e=M,M=c-r*M,c=e,t=n,n=i;return t<0?[-t,-o,-c]:[t,t?o:0,c]}function Go(t,n){return t*t<1&&n===1/0||t*t>1&&n===-1/0?0:Math.pow(t,n)}Co.signature=po,Qo.signature=Uo,wo.signature=Uo,Lo.signature=Uo,So.signature=po,ko.signature=po,vo.signature=po,Yo.signature=po,mo.signature=po,Ro.signature=po,Fo.signature=Uo,bo.signature=po,Zo.signature=po,Bo.signature=po,Vo.signature=po,Wo.signature=Uo,Go.signature=Uo;function Po(t){return Du(t)}function Jo(t){return Math.atan(1/t)}function Ho(t){return isFinite(t)?(Math.log((t+1)/t)+Math.log(t/(t-1)))/2:0}function Ko(t){return Math.asin(1/t)}function Xo(t){var n=1/t;return Math.log(n+Math.sqrt(n*n+1))}function qo(t){return Math.acos(1/t)}function _o(t){var n=1/t,e=Math.sqrt(n*n-1);return Math.log(e+n)}function $o(t){return Tu(t)}function tM(t){return gu(t)}function nM(t){return 1/Math.tan(t)}function eM(t){var n=Math.exp(2*t);return(n+1)/(n-1)}function rM(t){return 1/Math.sin(t)}function iM(t){return 0===t?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(t)-Math.exp(-t)))*qi(t)}function uM(t){return 1/Math.cos(t)}function oM(t){return 2/(Math.exp(t)+Math.exp(-t))}function MM(t){return lu(t)}Po.signature="number",Jo.signature="number",Ho.signature="number",Ko.signature="number",Xo.signature="number",qo.signature="number",_o.signature="number",$o.signature="number",tM.signature="number",nM.signature="number",eM.signature="number",rM.signature="number",iM.signature="number",uM.signature="number",oM.signature="number",MM.signature="number";var cM=Vu("addScalar",["typed"],t=>{var{typed:n}=t;return n("addScalar",{"number, number":Qo,"Complex, Complex":function(t,n){return t.add(n)},"BigNumber, BigNumber":function(t,n){return t.plus(n)},"Fraction, Fraction":function(t,n){return t.add(n)},"Unit, Unit":n.referToSelf(t=>(e,r)=>{if(null===e.value||void 0===e.value)throw new Error("Parameter x contains a unit with undefined value");if(null===r.value||void 0===r.value)throw new Error("Parameter y contains a unit with undefined value");if(!e.equalBase(r))throw new Error("Units do not match");var i=e.clone();return i.value=n.find(t,[i.valueType(),r.valueType()])(i.value,r.value),i.fixPrefix=!1,i})})});var NM="number, number";function aM(t,n){if(!Xi(t)||!Xi(n))throw new Error("Integers expected in function bitAnd");return t&n}function sM(t){if(!Xi(t))throw new Error("Integer expected in function bitNot");return~t}function DM(t,n){if(!Xi(t)||!Xi(n))throw new Error("Integers expected in function bitOr");return t|n}function TM(t,n){if(!Xi(t)||!Xi(n))throw new Error("Integers expected in function bitXor");return t^n}function gM(t,n){if(!Xi(t)||!Xi(n))throw new Error("Integers expected in function leftShift");return t<<n}function lM(t,n){if(!Xi(t)||!Xi(n))throw new Error("Integers expected in function rightArithShift");return t>>n}function IM(t,n){if(!Xi(t)||!Xi(n))throw new Error("Integers expected in function rightLogShift");return t>>>n}aM.signature=NM,sM.signature="number",DM.signature=NM,TM.signature=NM,gM.signature=NM,lM.signature=NM,IM.signature=NM;function yM(t,n){if(n<t)return 1;if(n===t)return n;var e=n+t>>1;return yM(t,e)*yM(e+1,n)}function hM(t,n){if(!Xi(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(!Xi(n)||n<0)throw new TypeError("Positive integer value expected in function combinations");if(n>t)throw new TypeError("k must be less than or equal to n");for(var e=t-n,r=1,i=2,u=n<e?n:e,o=n<e?e+1:n+1;o<=t;++o)for(r*=o;i<=u&&r%i==0;)r/=i,++i;return i<=u&&(r/=yM(i,u)),r}hM.signature="number, number";var jM=Vu("conj",["typed"],t=>{var{typed:n}=t;return n("conj",{"number | BigNumber | Fraction":t=>t,Complex:t=>t.conjugate(),"Array | Matrix":n.referToSelf(t=>n=>fo(n,t))})});function xM(t,n,e){if(null==e)return t.eq(n);if(t.eq(n))return!0;if(t.isNaN()||n.isNaN())return!1;if(t.isFinite()&&n.isFinite()){var r=t.minus(n).abs();if(r.isZero())return!0;var i=t.constructor.max(t.abs(),n.abs());return r.lte(i.times(e))}return!1}var zM=Vu("compareUnits",["typed"],t=>{var{typed:n}=t;return{"Unit, Unit":n.referToSelf(t=>(e,r)=>{if(!e.equalBase(r))throw new Error("Cannot compare units with different base");return n.find(t,[e.valueType(),r.valueType()])(e.value,r.value)})}}),OM=Vu("equalScalar",["typed","config"],t=>{var{typed:n,config:e}=t;return n("equalScalar",{"boolean, boolean":function(t,n){return t===n},"number, number":function(t,n){return su(t,n,e.epsilon)},"BigNumber, BigNumber":function(t,n){return t.eq(n)||xM(t,n,e.epsilon)},"Fraction, Fraction":function(t,n){return t.equals(n)},"Complex, Complex":function(t,n){return function(t,n,e){return su(t.re,n.re,e)&&su(t.im,n.im,e)}(t,n,e.epsilon)}},zM({typed:n}))});Vu("equalScalar",["typed","config"],t=>{var{typed:n,config:e}=t;return n("equalScalar",{"number, number":function(t,n){return su(t,n,e.epsilon)}})}),Math.pow(2,53);Vu("hex",["typed","format"],t=>{var{typed:n,format:e}=t;return n("hex",{"number | BigNumber":function(t){return e(t,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(t,n){return e(t,{notation:"hex",wordSize:n})}})});function EM(t){return t<0}function AM(t){return t>0}function fM(t){return 0===t}function pM(t){return Number.isNaN(t)}EM.signature="number",AM.signature="number",fM.signature="number",pM.signature="number";function UM(t){var n;if(Xi(t))return t<=0?isFinite(t)?1/0:NaN:t>171?1/0:yM(1,t-1);if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*UM(1-t));if(t>=171.35)return 1/0;if(t>85){var e=t*t,r=e*t,i=r*t,u=i*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*e)-139/(51840*r)-571/(2488320*i)+163879/(209018880*u)+5246819/(75246796800*u*t))}--t,n=CM[0];for(var o=1;o<CM.length;++o)n+=CM[o]/(t+o);var M=t+dM+.5;return Math.sqrt(2*Math.PI)*Math.pow(M,t+.5)*Math.exp(-M)*n}UM.signature="number";var dM=4.7421875,CM=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],QM=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function wM(t){if(t<0)return NaN;if(0===t)return 1/0;if(!isFinite(t))return t;if(t<.5)return Math.log(Math.PI/Math.sin(Math.PI*t))-wM(1-t);for(var n=(t-=1)+5+.5,e=QM[0],r=6;r>=1;r--)e+=QM[r]/(t+r);return.9189385332046728+(t+.5)*Math.log(n)-n+Math.log(e)}wM.signature="number";var LM=Vu("multiplyScalar",["typed"],t=>{var{typed:n}=t;return n("multiplyScalar",{"number, number":Lo,"Complex, Complex":function(t,n){return t.mul(n)},"BigNumber, BigNumber":function(t,n){return t.times(n)},"Fraction, Fraction":function(t,n){return t.mul(n)},"number | Fraction | BigNumber | Complex, Unit":(t,n)=>n.multiply(t),"Unit, number | Fraction | BigNumber | Complex | Unit":(t,n)=>t.multiply(n)})});function SM(t){return!t}function kM(t,n){return!(!t&&!n)}function vM(t,n){return!!t!=!!n}function YM(t,n){return!(!t||!n)}SM.signature="number",kM.signature="number, number",vM.signature="number, number",YM.signature="number, number";Vu("oct",["typed","format"],t=>{var{typed:n,format:e}=t;return n("oct",{"number | BigNumber":function(t){return e(t,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(t,n){return e(t,{notation:"oct",wordSize:n})}})});var mM=e(22),RM=e.n(mM);Date.now();var FM=Vu("SparseMatrix",["typed","equalScalar","Matrix"],t=>{var{typed:n,equalScalar:e,Matrix:r}=t;function i(t,n){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(n&&!Ce(n))throw new Error("Invalid datatype: "+n);if(we(t))!function(t,n,e){"SparseMatrix"===n.type?(t._values=n._values?ar(n._values):void 0,t._index=ar(n._index),t._ptr=ar(n._ptr),t._size=ar(n._size),t._datatype=e||n._datatype):u(t,n.valueOf(),e||n._datatype)}(this,t,n);else if(t&&Qe(t.index)&&Qe(t.ptr)&&Qe(t.size))this._values=t.values,this._index=t.index,this._ptr=t.ptr,this._size=t.size,this._datatype=n||t.datatype;else if(Qe(t))u(this,t,n);else{if(t)throw new TypeError("Unsupported type of data ("+Nr(t)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=n}}function u(t,r,i){t._values=[],t._index=[],t._ptr=[],t._datatype=i;var u=r.length,o=0,M=e,c=0;if(Ce(i)&&(M=n.find(e,[i,i])||e,c=n.convert(0,i)),u>0){var N=0;do{t._ptr.push(t._index.length);for(var a=0;a<u;a++){var s=r[a];if(Qe(s)){if(0===N&&o<s.length&&(o=s.length),N<s.length){var D=s[N];M(D,c)||(t._values.push(D),t._index.push(a))}}else 0===N&&o<1&&(o=1),M(s,c)||(t._values.push(s),t._index.push(a))}N++}while(N<o)}t._ptr.push(t._index.length),t._size=[u,o]}function o(t,n){if(!Ye(n))throw new TypeError("Invalid index");if(n.isScalar())return t.get(n.min());var e,r,u,o,M=n.size();if(M.length!==t._size.length)throw new pu(M.length,t._size.length);var c=n.min(),N=n.max();for(e=0,r=t._size.length;e<r;e++)Qu(c[e],t._size[e]),Qu(N[e],t._size[e]);var a=t._values,s=t._index,D=t._ptr,T=n.dimension(0),g=n.dimension(1),l=[],I=[];T.forEach((function(t,n){I[t]=n[0],l[t]=!0}));var y=a?[]:void 0,h=[],j=[];return g.forEach((function(t){for(j.push(h.length),u=D[t],o=D[t+1];u<o;u++)e=s[u],!0===l[e]&&(h.push(I[e]),y&&y.push(a[u]))})),j.push(h.length),new i({values:y,index:h,ptr:j,size:M,datatype:t._datatype})}function M(t,n,e,r){if(!n||!0!==n.isIndex)throw new TypeError("Invalid index");var i,u=n.size(),o=n.isScalar();if(we(e)?(i=e.size(),e=e.toArray()):i=du(e),o){if(0!==i.length)throw new TypeError("Scalar expected");t.set(n.min(),e,r)}else{if(1!==u.length&&2!==u.length)throw new pu(u.length,t._size.length,"<");if(i.length<u.length){for(var M=0,c=0;1===u[M]&&1===i[M];)M++;for(;1===u[M];)c++,M++;e=vu(e,u.length,c,i)}if(!Dr(u,i))throw new pu(u,i,">");if(1===u.length){n.dimension(0).forEach((function(n,i){Qu(n),t.set([n,0],e[i[0]],r)}))}else{var N=n.dimension(0),a=n.dimension(1);N.forEach((function(n,i){Qu(n),a.forEach((function(u,o){Qu(u),t.set([n,u],e[i[0]][o[0]],r)}))}))}}return t}function c(t,n,e,r){if(e-n==0)return e;for(var i=n;i<e;i++)if(r[i]===t)return i;return n}function N(t,n,e,r,i,u,o){i.splice(t,0,r),u.splice(t,0,n);for(var M=e+1;M<o.length;M++)o[M]++}function a(t,r,i,u){var o=u||0,M=e,c=0;Ce(t._datatype)&&(M=n.find(e,[t._datatype,t._datatype])||e,c=n.convert(0,t._datatype),o=n.convert(o,t._datatype));var N,a,s,D=!M(o,c),T=t._size[0],g=t._size[1];if(i>g){for(a=g;a<i;a++)if(t._ptr[a]=t._values.length,D)for(N=0;N<T;N++)t._values.push(o),t._index.push(N);t._ptr[i]=t._values.length}else i<g&&(t._ptr.splice(i+1,g-i),t._values.splice(t._ptr[i],t._values.length),t._index.splice(t._ptr[i],t._index.length));if(g=i,r>T){if(D){var l=0;for(a=0;a<g;a++){t._ptr[a]=t._ptr[a]+l,s=t._ptr[a+1]+l;var I=0;for(N=T;N<r;N++,I++)t._values.splice(s+I,0,o),t._index.splice(s+I,0,N),l++}t._ptr[g]=t._values.length}}else if(r<T){var y=0;for(a=0;a<g;a++){t._ptr[a]=t._ptr[a]-y;var h=t._ptr[a],j=t._ptr[a+1]-y;for(s=h;s<j;s++)(N=t._index[s])>r-1&&(t._values.splice(s,1),t._index.splice(s,1),y++)}t._ptr[a]=t._values.length}return t._size[0]=r,t._size[1]=i,t}function s(t,n,e,r,i){var u,o,M=r[0],c=r[1],N=[];for(u=0;u<M;u++)for(N[u]=[],o=0;o<c;o++)N[u][o]=0;for(o=0;o<c;o++)for(var a=e[o],s=e[o+1],D=a;D<s;D++)N[u=n[D]][o]=t?i?ar(t[D]):t[D]:1;return N}return i.prototype=new r,i.prototype.createSparseMatrix=function(t,n){return new i(t,n)},Object.defineProperty(i,"name",{value:"SparseMatrix"}),i.prototype.constructor=i,i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return mu(this._values,Nr)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(t,n){return new i(t,n)},i.prototype.density=function(){var t=this._size[0],n=this._size[1];return 0!==t&&0!==n?this._index.length/(t*n):0},i.prototype.subset=function(t,n,e){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return o(this,t);case 2:case 3:return M(this,t,n,e);default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.get=function(t){if(!Qe(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new pu(t.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var n=t[0],e=t[1];Qu(n,this._size[0]),Qu(e,this._size[1]);var r=c(n,this._ptr[e],this._ptr[e+1],this._index);return r<this._ptr[e+1]&&this._index[r]===n?this._values[r]:0},i.prototype.set=function(t,r,i){if(!Qe(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new pu(t.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var u=t[0],o=t[1],M=this._size[0],s=this._size[1],D=e,T=0;Ce(this._datatype)&&(D=n.find(e,[this._datatype,this._datatype])||e,T=n.convert(0,this._datatype)),(u>M-1||o>s-1)&&(a(this,Math.max(u+1,M),Math.max(o+1,s),i),M=this._size[0],s=this._size[1]),Qu(u,M),Qu(o,s);var g=c(u,this._ptr[o],this._ptr[o+1],this._index);return g<this._ptr[o+1]&&this._index[g]===u?D(r,T)?function(t,n,e,r,i){e.splice(t,1),r.splice(t,1);for(var u=n+1;u<i.length;u++)i[u]--}(g,o,this._values,this._index,this._ptr):this._values[g]=r:D(r,T)||N(g,u,o,r,this._values,this._index,this._ptr),this},i.prototype.resize=function(t,n,e){if(!Le(t))throw new TypeError("Array or Matrix expected");var r=t.valueOf().map(t=>Array.isArray(t)&&1===t.length?t[0]:t);if(2!==r.length)throw new Error("Only two dimensions matrix are supported");return r.forEach((function(t){if(!Ae(t)||!Xi(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ou(r)+")")})),a(e?this.clone():this,r[0],r[1],n)},i.prototype.reshape=function(t,n){if(!Qe(t))throw new TypeError("Array expected");if(2!==t.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");t.forEach((function(n){if(!Ae(n)||!Xi(n)||n<=-2||0===n)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Ou(t)+")")}));var e=this._size[0]*this._size[1];if(e!==(t=Su(t,e))[0]*t[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var r=n?this.clone():this;if(this._size[0]===t[0]&&this._size[1]===t[1])return r;for(var i=[],u=0;u<r._ptr.length;u++)for(var o=0;o<r._ptr[u+1]-r._ptr[u];o++)i.push(u);for(var M=r._values.slice(),a=r._index.slice(),s=0;s<r._index.length;s++){var D=a[s],T=i[s],g=D*r._size[1]+T;i[s]=g%t[1],a[s]=Math.floor(g/t[1])}r._values.length=0,r._index.length=0,r._ptr.length=t[1]+1,r._size=t.slice();for(var l=0;l<r._ptr.length;l++)r._ptr[l]=0;for(var I=0;I<M.length;I++){var y=a[I],h=i[I],j=M[I];N(c(y,r._ptr[h],r._ptr[h+1],r._index),y,h,j,r._values,r._index,r._ptr)}return r},i.prototype.clone=function(){return new i({values:this._values?ar(this._values):void 0,index:ar(this._index),ptr:ar(this._ptr),size:ar(this._size),datatype:this._datatype})},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(t,r){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var u=this,o=this._size[0],M=this._size[1],c=qu(t);return function(t,r,u,o,M,c,N){var a=[],s=[],D=[],T=e,g=0;Ce(t._datatype)&&(T=n.find(e,[t._datatype,t._datatype])||e,g=n.convert(0,t._datatype));for(var l=function(t,n,e){t=c(t,n,e),T(t,g)||(a.push(t),s.push(n))},I=o;I<=M;I++){D.push(a.length);var y=t._ptr[I],h=t._ptr[I+1];if(N)for(var j=y;j<h;j++){var x=t._index[j];x>=r&&x<=u&&l(t._values[j],x-r,I-o)}else{for(var z={},O=y;O<h;O++){var E=t._index[O];z[E]=t._values[O]}for(var A=r;A<=u;A++){var f=A in z?z[A]:0;l(f,A-r,I-o)}}}return D.push(a.length),new i({values:a,index:s,ptr:D,size:[u-r+1,M-o+1]})}(this,0,o-1,0,M-1,(function(n,e,r){return 1===c?t(n):2===c?t(n,[e,r]):t(n,[e,r],u)}),r)},i.prototype.forEach=function(t,n){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var e=this._size[0],r=this._size[1],i=0;i<r;i++){var u=this._ptr[i],o=this._ptr[i+1];if(n)for(var M=u;M<o;M++){var c=this._index[M];t(this._values[M],[c,i],this)}else{for(var N={},a=u;a<o;a++){N[this._index[a]]=this._values[a]}for(var s=0;s<e;s++){t(s in N?N[s]:0,[s,i],this)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var t=this._size[1],n=0;n<t;n++)for(var e=this._ptr[n],r=this._ptr[n+1],i=e;i<r;i++){var u=this._index[i];yield{value:this._values[i],index:[u,n]}}},i.prototype.toArray=function(){return s(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return s(this._values,this._index,this._ptr,this._size,!1)},i.prototype.format=function(t){for(var n=this._size[0],e=this._size[1],r=this.density(),i="Sparse Matrix ["+Ou(n,t)+" x "+Ou(e,t)+"] density: "+Ou(r,t)+"\n",u=0;u<e;u++)for(var o=this._ptr[u],M=this._ptr[u+1],c=o;c<M;c++){i+="\n ("+Ou(this._index[c],t)+", "+Ou(u,t)+") ==> "+(this._values?Ou(this._values[c],t):"X")}return i},i.prototype.toString=function(){return Ou(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(t){if(t){if(fe(t)&&(t=t.toNumber()),!Ae(t)||!Xi(t))throw new TypeError("The parameter k must be an integer number")}else t=0;var n=t>0?t:0,e=t<0?-t:0,r=this._size[0],u=this._size[1],o=Math.min(r-e,u-n),M=[],c=[],N=[];N[0]=0;for(var a=n;a<u&&M.length<o;a++)for(var s=this._ptr[a],D=this._ptr[a+1],T=s;T<D;T++){var g=this._index[T];if(g===a-n+e){M.push(this._values[T]),c[M.length-1]=g-e;break}}return N.push(M.length),new i({values:M,index:c,ptr:N,size:[o,1]})},i.fromJSON=function(t){return new i(t)},i.diagonal=function(t,r,u,o,M){if(!Qe(t))throw new TypeError("Array expected, size parameter");if(2!==t.length)throw new Error("Only two dimensions matrix are supported");if(t=t.map((function(t){if(fe(t)&&(t=t.toNumber()),!Ae(t)||!Xi(t)||t<1)throw new Error("Size values must be positive integers");return t})),u){if(fe(u)&&(u=u.toNumber()),!Ae(u)||!Xi(u))throw new TypeError("The parameter k must be an integer number")}else u=0;var c=e,N=0;Ce(M)&&(c=n.find(e,[M,M])||e,N=n.convert(0,M));var a,s=u>0?u:0,D=u<0?-u:0,T=t[0],g=t[1],l=Math.min(T-D,g-s);if(Qe(r)){if(r.length!==l)throw new Error("Invalid value array length");a=function(t){return r[t]}}else if(we(r)){var I=r.size();if(1!==I.length||I[0]!==l)throw new Error("Invalid matrix length");a=function(t){return r.get([t])}}else a=function(){return r};for(var y=[],h=[],j=[],x=0;x<g;x++){j.push(y.length);var z=x-s;if(z>=0&&z<l){var O=a(z);c(O,N)||(h.push(z+D),y.push(O))}}return j.push(y.length),new i({values:y,index:h,ptr:j,size:[T,g]})},i.prototype.swapRows=function(t,n){if(!(Ae(t)&&Xi(t)&&Ae(n)&&Xi(n)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return Qu(t,this._size[0]),Qu(n,this._size[0]),i._swapRows(t,n,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(t,n,e,r,i){for(var u=r[t],o=r[t+1],M=u;M<o;M++)i(e[M],n[M])},i._swapRows=function(t,n,e,r,i,u){for(var o=0;o<e;o++){var M=u[o],N=u[o+1],a=c(t,M,N,i),s=c(n,M,N,i);if(a<N&&s<N&&i[a]===t&&i[s]===n){if(r){var D=r[a];r[a]=r[s],r[s]=D}}else if(a<N&&i[a]===t&&(s>=N||i[s]!==n)){var T=r?r[a]:void 0;i.splice(s,0,n),r&&r.splice(s,0,T),i.splice(s<=a?a+1:a,1),r&&r.splice(s<=a?a+1:a,1)}else if(s<N&&i[s]===n&&(a>=N||i[a]!==t)){var g=r?r[s]:void 0;i.splice(a,0,t),r&&r.splice(a,0,g),i.splice(a<=s?s+1:s,1),r&&r.splice(a<=s?s+1:s,1)}}},i},{isClass:!0});Vu("bin",["typed","format"],t=>{var{typed:n,format:e}=t;return n("bin",{"number | BigNumber":function(t){return e(t,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(t,n){return e(t,{notation:"bin",wordSize:n})}})});var bM=Vu("matrix",["typed","Matrix","DenseMatrix","SparseMatrix"],t=>{var{typed:n,Matrix:e,DenseMatrix:r,SparseMatrix:i}=t;return n("matrix",{"":function(){return u([])},string:function(t){return u([],t)},"string, string":function(t,n){return u([],t,n)},Array:function(t){return u(t)},Matrix:function(t){return u(t,t.storage())},"Array | Matrix, string":u,"Array | Matrix, string, string":u});function u(t,n,e){if("dense"===n||"default"===n||void 0===n)return new r(t,e);if("sparse"===n)return new i(t,e);throw new TypeError("Unknown matrix type "+JSON.stringify(n)+".")}});function ZM(){throw new Error('No "matrix" implementation available')}var BM=Vu("size",["typed","config","?matrix"],t=>{var{typed:n,config:e,matrix:r}=t;return n("size",{Matrix:function(t){return t.create(t.size())},Array:du,string:function(t){return"Array"===e.matrix?[t.length]:r([t.length])},"number | Complex | BigNumber | Unit | boolean | null":function(t){return"Array"===e.matrix?[]:r?r([]):ZM()}})}),VM=Vu("matAlgo11xS0s",["typed","equalScalar"],t=>{var{typed:n,equalScalar:e}=t;return function(t,r,i,u){var o=t._values,M=t._index,c=t._ptr,N=t._size,a=t._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var s,D=N[0],T=N[1],g=e,l=0,I=i;"string"==typeof a&&(s=a,g=n.find(e,[s,s]),l=n.convert(0,s),r=n.convert(r,s),I=n.find(i,[s,s]));for(var y=[],h=[],j=[],x=0;x<T;x++){j[x]=h.length;for(var z=c[x],O=c[x+1],E=z;E<O;E++){var A=M[E],f=u?I(r,o[E]):I(o[E],r);g(f,l)||(h.push(A),y.push(f))}}return j[T]=h.length,t.createSparseMatrix({values:y,index:h,ptr:j,size:[D,T],datatype:s})}}),WM=Vu("matAlgo14xDs",["typed"],t=>{var{typed:n}=t;return function(t,e,r,i){var u,o=t._data,M=t._size,c=t._datatype,N=r;"string"==typeof c&&(u=c,e=n.convert(e,u),N=n.find(r,[u,u]));var a=M.length>0?function t(n,e,r,i,u,o,M){var c=[];if(e===r.length-1)for(var N=0;N<i;N++)c[N]=M?n(o,u[N]):n(u[N],o);else for(var a=0;a<i;a++)c[a]=t(n,e+1,r,r[e+1],u[a],o,M);return c}(N,0,M,M[0],o,e,i):[];return t.createDenseMatrix({data:a,size:ar(M),datatype:u})}});Vu("equal",["typed","equalScalar"],t=>{var{typed:n,equalScalar:e}=t;return n("equal",{"any, any":function(t,n){return null===t?null===n:null===n?null===t:void 0===t?void 0===n:void 0===n?void 0===t:e(t,n)}})});var GM=Vu("ones",["typed","config","matrix","BigNumber"],t=>{var{typed:n,config:e,matrix:r,BigNumber:i}=t;return n("ones",{"":function(){return"Array"===e.matrix?u([]):u([],"default")},"...number | BigNumber | string":function(t){if("string"==typeof t[t.length-1]){var n=t.pop();return u(t,n)}return"Array"===e.matrix?u(t):u(t,"default")},Array:u,Matrix:function(t){var n=t.storage();return u(t.valueOf(),n)},"Array | Matrix, string":function(t,n){return u(t.valueOf(),n)}});function u(t,n){var e=function(t){var n=!1;return t.forEach((function(t,e,r){fe(t)&&(n=!0,r[e]=t.toNumber())})),n}(t)?new i(1):1;if(function(t){t.forEach((function(t){if("number"!=typeof t||!Xi(t)||t<0)throw new Error("Parameters in function ones must be positive integers")}))}(t),n){var u=r(n);return t.length>0?u.resize(t,e):u}var o=[];return t.length>0?wu(o,t,e):o}});function PM(t,n,e,r){if(!(this instanceof PM))throw new SyntaxError("Constructor must be called with the new operator");this.fn=t,this.count=n,this.min=e,this.max=r,this.message="Wrong number of arguments in function "+t+" ("+n+" provided, "+e+(null!=r?"-"+r:"")+" expected)",this.stack=(new Error).stack}PM.prototype=new Error,PM.prototype.constructor=Error,PM.prototype.name="ArgumentsError",PM.prototype.isArgumentsError=!0;Vu("unequal",["typed","equalScalar"],t=>{var{typed:n,equalScalar:e}=t;return n("unequal",{"any, any":function(t,n){return null===t?null!==n:null===n?null!==t:void 0===t?void 0!==n:void 0===n?void 0!==t:!e(t,n)}})});fu.signature="any, any";var JM=Vu("dot",["typed","addScalar","multiplyScalar","conj","size"],t=>{var{typed:n,addScalar:e,multiplyScalar:r,conj:i,size:u}=t;return n("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(t,u){var c=o(t,u),N=we(t)?t._data:t,a=we(t)?t._datatype||t.getDataType():void 0,s=we(u)?u._data:u,D=we(u)?u._datatype||u.getDataType():void 0,T=2===M(t).length,g=2===M(u).length,l=e,I=r;if(a&&D&&a===D&&"string"==typeof a&&"mixed"!==a){var y=a;l=n.find(e,[y,y]),I=n.find(r,[y,y])}if(!T&&!g){for(var h=I(i(N[0]),s[0]),j=1;j<c;j++)h=l(h,I(i(N[j]),s[j]));return h}if(!T&&g){for(var x=I(i(N[0]),s[0][0]),z=1;z<c;z++)x=l(x,I(i(N[z]),s[z][0]));return x}if(T&&!g){for(var O=I(i(N[0][0]),s[0]),E=1;E<c;E++)O=l(O,I(i(N[E][0]),s[E]));return O}if(T&&g){for(var A=I(i(N[0][0]),s[0][0]),f=1;f<c;f++)A=l(A,I(i(N[f][0]),s[f][0]));return A}},"SparseMatrix, SparseMatrix":function(t,n){o(t,n);var i=t._index,u=t._values,M=n._index,c=n._values,N=0,a=e,s=r,D=0,T=0;for(;D<i.length&&T<M.length;){var g=i[D],l=M[T];g<l?D++:g>l?T++:g===l&&(N=a(N,s(u[D],c[T])),D++,T++)}return N}});function o(t,n){var e,r,i=M(t),u=M(n);if(1===i.length)e=i[0];else{if(2!==i.length||1!==i[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+i.join(", ")+")");e=i[0]}if(1===u.length)r=u[0];else{if(2!==u.length||1!==u[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+u.join(", ")+")");r=u[0]}if(e!==r)throw new RangeError("Vectors must have equal length ("+e+" != "+r+")");if(0===e)throw new RangeError("Cannot calculate the dot product of empty vectors");return e}function M(t){return we(t)?t.size():u(t)}}),HM="number | BigNumber | Fraction | Matrix | Array";"".concat(HM,", ").concat(HM,", ...").concat(HM);var KM=Vu("multiply",["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],t=>{var{typed:n,matrix:e,addScalar:r,multiplyScalar:i,equalScalar:u,dot:o}=t,M=VM({typed:n,equalScalar:u}),c=WM({typed:n});function N(t,n){switch(t.length){case 1:switch(n.length){case 1:if(t[0]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(t[0]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+t[0]+") must match Matrix rows ("+n[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+n.length+" dimensions)")}break;case 2:switch(n.length){case 1:if(t[1]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+t[1]+") must match Vector length ("+n[0]+")");break;case 2:if(t[1]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+t[1]+") must match Matrix B rows ("+n[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+n.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+t.length+" dimensions)")}}function a(t,e){if("dense"!==e.storage())throw new Error("Support for SparseMatrix not implemented");return function(t,e){var u,o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._size,s=e._datatype||e.getDataType(),D=M[0],T=a[1],g=r,l=i;c&&s&&c===s&&"string"==typeof c&&"mixed"!==c&&(u=c,g=n.find(r,[u,u]),l=n.find(i,[u,u]));for(var I=[],y=0;y<T;y++){for(var h=l(o[0],N[0][y]),j=1;j<D;j++)h=g(h,l(o[j],N[j][y]));I[y]=h}return t.createDenseMatrix({data:I,size:[T],datatype:c===t._datatype&&s===e._datatype?u:void 0})}(t,e)}var s=n("_multiplyMatrixVector",{"DenseMatrix, any":function(t,e){var u,o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._datatype||e.getDataType(),s=M[0],D=M[1],T=r,g=i;c&&a&&c===a&&"string"==typeof c&&"mixed"!==c&&(u=c,T=n.find(r,[u,u]),g=n.find(i,[u,u]));for(var l=[],I=0;I<s;I++){for(var y=o[I],h=g(y[0],N[0]),j=1;j<D;j++)h=T(h,g(y[j],N[j]));l[I]=h}return t.createDenseMatrix({data:l,size:[s],datatype:c===t._datatype&&a===e._datatype?u:void 0})},"SparseMatrix, any":function(t,e){var o=t._values,M=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var a,s=e._data,D=e._datatype||e.getDataType(),T=t._size[0],g=e._size[0],l=[],I=[],y=[],h=r,j=i,x=u,z=0;N&&D&&N===D&&"string"==typeof N&&"mixed"!==N&&(a=N,h=n.find(r,[a,a]),j=n.find(i,[a,a]),x=n.find(u,[a,a]),z=n.convert(0,a));var O=[],E=[];y[0]=0;for(var A=0;A<g;A++){var f=s[A];if(!x(f,z))for(var p=c[A],U=c[A+1],d=p;d<U;d++){var C=M[d];E[C]?O[C]=h(O[C],j(f,o[d])):(E[C]=!0,I.push(C),O[C]=j(f,o[d]))}}for(var Q=I.length,w=0;w<Q;w++){var L=I[w];l[w]=O[L]}return y[1]=I.length,t.createSparseMatrix({values:l,index:I,ptr:y,size:[T,1],datatype:N===t._datatype&&D===e._datatype?a:void 0})}}),D=n("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(t,e){var u,o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._size,s=e._datatype||e.getDataType(),D=M[0],T=M[1],g=a[1],l=r,I=i;c&&s&&c===s&&"string"==typeof c&&"mixed"!==c&&"mixed"!==c&&(u=c,l=n.find(r,[u,u]),I=n.find(i,[u,u]));for(var y=[],h=0;h<D;h++){var j=o[h];y[h]=[];for(var x=0;x<g;x++){for(var z=I(j[0],N[0][x]),O=1;O<T;O++)z=l(z,I(j[O],N[O][x]));y[h][x]=z}}return t.createDenseMatrix({data:y,size:[D,g],datatype:c===t._datatype&&s===e._datatype?u:void 0})},"DenseMatrix, SparseMatrix":function(t,e){var o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._values,a=e._index,s=e._ptr,D=e._size,T=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!N)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var g,l=M[0],I=D[1],y=r,h=i,j=u,x=0;c&&T&&c===T&&"string"==typeof c&&"mixed"!==c&&(g=c,y=n.find(r,[g,g]),h=n.find(i,[g,g]),j=n.find(u,[g,g]),x=n.convert(0,g));for(var z=[],O=[],E=[],A=e.createSparseMatrix({values:z,index:O,ptr:E,size:[l,I],datatype:c===t._datatype&&T===e._datatype?g:void 0}),f=0;f<I;f++){E[f]=O.length;var p=s[f],U=s[f+1];if(U>p)for(var d=0,C=0;C<l;C++){for(var Q=C+1,w=void 0,L=p;L<U;L++){var S=a[L];d!==Q?(w=h(o[C][S],N[L]),d=Q):w=y(w,h(o[C][S],N[L]))}d!==Q||j(w,x)||(O.push(C),z.push(w))}}return E[I]=O.length,A},"SparseMatrix, DenseMatrix":function(t,e){var o=t._values,M=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var a,s=e._data,D=e._datatype||e.getDataType(),T=t._size[0],g=e._size[0],l=e._size[1],I=r,y=i,h=u,j=0;N&&D&&N===D&&"string"==typeof N&&"mixed"!==N&&(a=N,I=n.find(r,[a,a]),y=n.find(i,[a,a]),h=n.find(u,[a,a]),j=n.convert(0,a));for(var x=[],z=[],O=[],E=t.createSparseMatrix({values:x,index:z,ptr:O,size:[T,l],datatype:N===t._datatype&&D===e._datatype?a:void 0}),A=[],f=[],p=0;p<l;p++){O[p]=z.length;for(var U=p+1,d=0;d<g;d++){var C=s[d][p];if(!h(C,j))for(var Q=c[d],w=c[d+1],L=Q;L<w;L++){var S=M[L];f[S]!==U?(f[S]=U,z.push(S),A[S]=y(C,o[L])):A[S]=I(A[S],y(C,o[L]))}}for(var k=O[p],v=z.length,Y=k;Y<v;Y++){var m=z[Y];x[Y]=A[m]}}return O[l]=z.length,E},"SparseMatrix, SparseMatrix":function(t,e){var u,o=t._values,M=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType(),a=e._values,s=e._index,D=e._ptr,T=e._datatype||void 0===e._data?e._datatype:e.getDataType(),g=t._size[0],l=e._size[1],I=o&&a,y=r,h=i;N&&T&&N===T&&"string"==typeof N&&"mixed"!==N&&(u=N,y=n.find(r,[u,u]),h=n.find(i,[u,u]));for(var j,x,z,O,E,A,f,p,U=I?[]:void 0,d=[],C=[],Q=t.createSparseMatrix({values:U,index:d,ptr:C,size:[g,l],datatype:N===t._datatype&&T===e._datatype?u:void 0}),w=I?[]:void 0,L=[],S=0;S<l;S++){C[S]=d.length;var k=S+1;for(E=D[S],A=D[S+1],O=E;O<A;O++)if(p=s[O],I)for(x=c[p],z=c[p+1],j=x;j<z;j++)f=M[j],L[f]!==k?(L[f]=k,d.push(f),w[f]=h(a[O],o[j])):w[f]=y(w[f],h(a[O],o[j]));else for(x=c[p],z=c[p+1],j=x;j<z;j++)f=M[j],L[f]!==k&&(L[f]=k,d.push(f));if(I)for(var v=C[S],Y=d.length,m=v;m<Y;m++){var R=d[m];U[m]=w[R]}}return C[l]=d.length,Q}});return n("multiply",i,{"Array, Array":n.referTo("Matrix, Matrix",t=>(n,r)=>{N(du(n),du(r));var i=t(e(n),e(r));return we(i)?i.valueOf():i}),"Matrix, Matrix":function(t,n){var e=t.size(),r=n.size();return N(e,r),1===e.length?1===r.length?function(t,n,e){if(0===e)throw new Error("Cannot multiply two empty vectors");return o(t,n)}(t,n,e[0]):a(t,n):1===r.length?s(t,n):D(t,n)},"Matrix, Array":n.referTo("Matrix,Matrix",t=>(n,r)=>t(n,e(r))),"Array, Matrix":n.referToSelf(t=>(n,r)=>t(e(n,r.storage()),r)),"SparseMatrix, any":function(t,n){return M(t,n,i,!1)},"DenseMatrix, any":function(t,n){return c(t,n,i,!1)},"any, SparseMatrix":function(t,n){return M(n,t,i,!0)},"any, DenseMatrix":function(t,n){return c(n,t,i,!0)},"Array, any":function(t,n){return c(e(t),n,i,!1).valueOf()},"any, Array":function(t,n){return c(e(n),t,i,!0).valueOf()},"any, any":i,"any, any, ...any":n.referToSelf(t=>(n,e,r)=>{for(var i=t(n,e),u=0;u<r.length;u++)i=t(i,r[u]);return i})})});e(17);var XM=Gu({config:Ir}),qM=Hu({}),_M=ro({}),$M=io({}),tc=uo({Matrix:$M}),nc=zo({BigNumber:XM,Complex:qM,DenseMatrix:tc,Fraction:_M}),ec=cM({typed:nc}),rc=jM({typed:nc}),ic=OM({config:Ir,typed:nc}),uc=LM({typed:nc}),oc=FM({Matrix:$M,equalScalar:ic,typed:nc}),Mc=bM({DenseMatrix:tc,Matrix:$M,SparseMatrix:oc,typed:nc}),cc=BM({matrix:Mc,config:Ir,typed:nc}),Nc=GM({BigNumber:XM,config:Ir,matrix:Mc,typed:nc}),ac=JM({addScalar:ec,conj:rc,multiplyScalar:uc,size:cc,typed:nc}),sc=KM({addScalar:ec,dot:ac,equalScalar:ic,matrix:Mc,multiplyScalar:uc,typed:nc});function Dc(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,u=je()(t);if(n&&e){var o=hc(t),M=Ic(o,e,n),c=gc(t,M);u=je()(c).pop()}if(r&&i){var N=[].concat(u).reverse(),a=hc(N),s=Ic(a,i,r),D=1-s,T=gc(u,D);u=T[0]}return u}function Tc(t,n){var e=t.x-n.x,r=t.y-n.y;return Math.sqrt(e*e+r*r)}function gc(t,n){switch(t.length){case 2:return function(t,n){var e=lc(t,n);return[[t[0],e],[e,je()(t).pop()]]}(t,n);case 3:return function(t,n){var e=[t[0],t[1]],r=[t[1],t[2]],i=lc(e,n),u=lc(r,n),o=lc([i,u],n);return[[t[0],i,o],[o,u,t[2]]]}(t,n);case 4:return function(t,n){var e=[t[0],t[1]],r=[t[1],t[2]],i=[t[2],t[3]],u=lc(e,n),o=lc(r,n),M=lc(i,n),c=lc([u,o],n),N=lc([o,M],n),a=lc([c,N],n);return[[t[0],u,c,a],[a,N,M,t[3]]]}(t,n);default:return null}}function lc(t,n){var e=le()(t,1)[0],r=je()(t).pop(),i=e.x+(r.x-e.x)*n;return{y:e.y+(r.y-e.y)*n,x:i}}function Ic(t,n,e){for(var r=t.size(),i=function(t){switch(t){case 1:return sc(yc(1e3,1),Mc([[1,0],[-1,1]]));case 2:return sc(yc(1e3,2),Mc([[1,0,0],[-2,2,0],[1,-2,1]]));case 3:return sc(yc(1e3,3),Mc([[1,0,0,0],[-3,3,0,0],[3,-6,3,0],[-1,3,-3,1]]));default:return null}}(le()(r,1)[0]-1),u=function(t,n){var e=-t.x,r=-t.y,i=[],u=[];n.forEach((function(t,n){switch(le()(n,2)[1]){case 0:i.push(t+e);break;case 1:u.push(t+r)}}));for(var o=[],M=0;M<i.length;M++)o.push(Math.sqrt(i[M]*i[M]+u[M]*u[M]));return o}(n,sc(i,t)),o=u.length-1,M=0;M<u.length;M++)if(u[M]>=e){o=M;break}return.001*o}function yc(t,n){var e=1/t,r=0,i=Nc(t+1,n+1).map((function(t,n){var i=null;switch(le()(n,2)[1]){case 0:i=1;break;case 1:i=r;break;case 2:i=r*r;break;case 3:i=r*r*r}return r+=e,i}));return Mc(i)}function hc(t){var n=t.map((function(t){return[t.x,t.y]}));return Mc(n)}function jc(t){if(3===t.length)throw new Error("bezierBoundingBox function supports only linear and cubic bezier curves for now");var n,e,r,i,u,o,M=2===t.length?(n=t,e=le()(n,2),r=e[0],i=e[1],u=[r.x,i.x],o=[r.y,i.y],{min:{x:Math.min.apply(0,u),y:Math.min.apply(0,o)},max:{x:Math.max.apply(0,u),y:Math.max.apply(0,o)}}):function(t){for(var n,e,r,i,u,o,M,c,N=le()(t,4),a=N[0],s=N[1],D=N[2],T=N[3],g=[],l=[],I=[],y=0;y<2;++y)if(0===y?(e=6*a.x-12*s.x+6*D.x,n=-3*a.x+9*s.x-9*D.x+3*T.x,r=3*s.x-3*a.x):(e=6*a.y-12*s.y+6*D.y,n=-3*a.y+9*s.y-9*D.y+3*T.y,r=3*s.y-3*a.y),Math.abs(n)<1e-12){if(Math.abs(e)<1e-12)continue;(i=-r/e)>0&&i<1&&g.push(i)}else(M=e*e-4*r*n)<0?Math.abs(M)<1e-12&&(i=-e/(2*n))>0&&i<1&&g.push(i):(c=Math.sqrt(M),(u=(-e+c)/(2*n))>0&&u<1&&g.push(u),(o=(-e-c)/(2*n))>0&&o<1&&g.push(o));var h,j=g.length;for(;j--;)i=g[j],h=1-i,l[j]=h*h*h*a.x+3*h*h*i*s.x+3*h*i*i*D.x+i*i*i*T.x,I[j]=h*h*h*a.y+3*h*h*i*s.y+3*h*i*i*D.y+i*i*i*T.y;return l.push(a.x,T.x),I.push(a.y,T.y),{min:{x:Math.min.apply(0,l),y:Math.min.apply(0,I)},max:{x:Math.max.apply(0,l),y:Math.max.apply(0,I)}}}(t),c=2===t.length?1:0;return[{x:M.min.x,y:M.min.y-c},{x:M.max.x,y:M.min.y-c},{x:M.max.x,y:M.max.y+c},{x:M.min.x,y:M.max.y+c}]}var xc=e(3),zc=e.n(xc),Oc=e(0),Ec=e.n(Oc),Ac=e(4),fc=e.n(Ac),pc=function(){function t(n){At()(this,t),dt()(this,"ctx",void 0),dt()(this,"playData",void 0),dt()(this,"options",void 0),dt()(this,"courtTypeConstants",void 0),this.ctx=n.ctx,this.playData=n.playData,this.options=n.options?n.options:{},this.courtTypeConstants=n.courtTypeConstants}return pt()(t,[{key:"apply",value:function(){this.ctx.save(),this.drawLogic(),this.ctx.restore()}},{key:"drawLogic",value:function(){}}]),t}();function Uc(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var dc=function(t){fc()(e,t);var n=Uc(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"apply",value:function(){this.original()&&(this.ctx.save(),this.drawLogic(),this.ctx.restore()),this.reflection()&&(this.ctx.save(),this.verticalFlipAndRotation(),this.drawLogic(),this.ctx.restore())}},{key:"original",value:function(){return!0}},{key:"reflection",value:function(){return!1}},{key:"verticalFlipAndRotation",value:function(){var t=this.courtTypeConstants.COURT_RECT_HEIGHT;this.ctx.scale(1,-1),this.ctx.translate(0,-Math.abs(t))}},{key:"setColor",value:function(t){var n="transparent"===this.options.lineColor?"transparent":t;this.ctx.strokeStyle=n,this.ctx.fillStyle=n}},{key:"courtCenter",get:function(){return{x:this.courtTypeConstants.COURT_RECT_WIDTH/2,y:this.courtTypeConstants.COURT_RECT_HEIGHT/2}}}]),e}(pc);function Cc(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Qc=function(t){fc()(e,t);var n=Cc(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(dc),wc=.1667,Lc=1.5,Sc=2.4,kc=.55,vc=!1,Yc=480,mc=460,Rc="#C49463",Fc=60.5,bc=127.28125,Zc=60,Bc=1.41667,Vc=26,Wc=.5,Gc=4,Pc=6,Jc=5,Hc=3.58333,Kc=5,Xc=37,qc=15,_c=20,$c=5,tN=2,nN=.5,eN=1.5,rN=18,iN=95,uN=390,oN=330,MN=90,cN=2.5,NN=13;function aN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var sN=function(t){fc()(e,t);var n=aN(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Zc},n={x:this.courtCenter.x,y:Zc+Fc},e="transparent"===this.options.lineColor?"transparent":Rc;this.ctx.fillStyle=e,this.ctx.strokeStyle=e;var r=Math.PI/11,i=Math.PI-Math.PI/11;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,iN,r,i,!1);var u=DN(n,iN,i),o=DN(n,iN,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(u.x,u.y),this.ctx.translate(t.x,t.y),this.ctx.rotate(Math.PI/4),this.ctx.moveTo(3,3),this.ctx.lineTo(3,MN-3),this.ctx.lineTo(MN-3,MN-3),this.ctx.lineTo(MN-3,3),this.ctx.lineTo(3,3),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y-eN,rN/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,Vc/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.translate(t.x,t.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.arc(MN,0,NN,Math.PI/4,Math.PI+Math.PI/20,!1),this.ctx.stroke(),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(MN,MN,NN,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(0,MN,NN,Math.PI/4,Math.PI+Math.PI/2.2,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function DN(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function TN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var gN=function(t){fc()(e,t);var n=TN(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:Zc};this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.save(),this.ctx.translate(n.x,n.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(MN,0),this.ctx.stroke(),this.drawBaseSquare(MN,0),this.drawBaseSquare(MN+cN/2,MN-cN/2),this.drawBaseSquare(cN,MN-cN),this.ctx.beginPath(),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.restore(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(e*oN,0),t.ctx.stroke(),t.ctx.restore()}));var e=Math.PI/8.1,r=Math.PI-Math.PI/8.1;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y+138,uN-138,e,r,!1),this.ctx.stroke(),this.ctx.restore()}},{key:"drawBaseSquare",value:function(t,n){this.ctx.save(),this.ctx.lineCap="square",this.ctx.beginPath(),this.ctx.translate(t,n),this.ctx.moveTo(0,0),this.ctx.lineTo(0,cN),this.ctx.lineTo(-cN,cN),this.ctx.lineTo(-cN,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function lN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var IN=function(t){fc()(e,t);var n=lN(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:Zc},e={x:n.x-Bc/2,y:n.y+Bc},r={x:n.x+Bc/2,y:n.y+Bc};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(r.x,r.y-Bc/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-Bc/2),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.fill(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y+Bc/2),t.ctx.beginPath();var r=Bc/2+Wc;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,Bc/2),t.ctx.lineTo(e*(r+Gc),Bc/2),t.ctx.lineTo(e*(r+Gc),Bc/2-Pc),t.ctx.lineTo(e*r,Bc/2-Pc),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+Bc/2-Pc+Bc/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-Jc),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(Hc/2),0),t.ctx.lineTo(n*(Hc/2),Jc),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-Vc/2),t.ctx.beginPath(),t.ctx.arc(e*Xc,0,Kc/2,0,2*Math.PI,!0),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(e*MN,-(qc+$c)),t.ctx.lineTo(e*MN,-qc),t.ctx.lineTo(e*(MN-_c),-qc),t.ctx.lineTo(e*(MN-_c),-(qc+$c)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(dc);function yN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var hN=function(t){fc()(e,t);var n=yN(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Zc+Fc};this.ctx.save(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.moveTo(0,0),this.ctx.lineTo(tN/2,0),this.ctx.lineTo(tN/2,nN),this.ctx.lineTo(-tN/2,nN),this.ctx.lineTo(-tN/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function jN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var xN=function(t){fc()(e,t);var n=jN(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(dc),zN=.1667,ON=1.5,EN=2.4,AN=.55,fN=!1,pN=280,UN=260,dN="#C49463",CN="#E4CCB7",QN=43,wN=127.28125,LN=25,SN=1.41667,kN=26,vN=.5,YN=4,mN=6,RN=5,FN=3.58333,bN=5,ZN=37,BN=8,VN=15,WN=3,GN=5,PN=1,JN=0,HN=16,KN=60,XN=220,qN=190,_N=60,$N=2.5,ta=13;function na(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ea=function(t){fc()(e,t);var n=na(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:LN},n={x:this.courtCenter.x,y:LN+QN},e="transparent"===this.options.lineColor?"transparent":dN;this.ctx.fillStyle=e,this.ctx.strokeStyle=e;var r=Math.PI/15,i=Math.PI-Math.PI/15;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,KN,r,i,!1);var u=ra(n,KN,i),o=ra(n,KN,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(u.x,u.y),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.strokeStyle="transparent"===this.options.lineColor?"transparent":"#FFFFFF",this.ctx.fillStyle="transparent"===this.options.lineColor?"transparent":CN,this.ctx.beginPath(),this.ctx.arc(n.x,n.y-JN,HN/2,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,kN/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function ra(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function ia(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ua=function(t){fc()(e,t);var n=ia(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:LN};this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.save(),this.ctx.translate(n.x,n.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(_N,0),this.ctx.stroke(),this.drawBaseSquare(_N,0),this.drawBaseSquare(_N+$N/2,_N-$N/2),this.drawBaseSquare($N,_N-$N),this.ctx.beginPath(),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.restore(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(e*qN,0),t.ctx.stroke(),t.ctx.restore()}));var e=Math.PI/7.8,r=Math.PI-Math.PI/7.8;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y+77,XN-77+3,e,r,!1),this.ctx.stroke(),this.ctx.restore()}},{key:"drawBaseSquare",value:function(t,n){this.ctx.save(),this.ctx.lineCap="square",this.ctx.beginPath(),this.ctx.translate(t,n),this.ctx.moveTo(0,0),this.ctx.lineTo(0,$N),this.ctx.lineTo(-$N,$N),this.ctx.lineTo(-$N,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function oa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ma=function(t){fc()(e,t);var n=oa(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:LN},e={x:n.x-SN/2,y:n.y+SN},r={x:n.x+SN/2,y:n.y+SN};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(r.x,r.y-SN/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-SN/2),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.fill(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y+SN/2),t.ctx.beginPath();var r=SN/2+vN;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,SN/2),t.ctx.lineTo(e*(r+YN),SN/2),t.ctx.lineTo(e*(r+YN),SN/2-mN),t.ctx.lineTo(e*r,SN/2-mN),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+SN/2-mN+SN/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-RN),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(FN/2),0),t.ctx.lineTo(n*(FN/2),RN),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-kN/2),t.ctx.beginPath(),t.ctx.arc(e*ZN,0,bN/2,0,2*Math.PI,!0),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(e*_N,-(BN+WN)),t.ctx.lineTo(e*_N,-BN),t.ctx.lineTo(e*(_N-VN),-BN),t.ctx.lineTo(e*(_N-VN),-(BN+WN)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(dc);function ca(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Na=function(t){fc()(e,t);var n=ca(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:LN+QN-PN/2};this.ctx.save(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.moveTo(0,0),this.ctx.lineTo(GN/2,0),this.ctx.lineTo(GN/2,PN),this.ctx.lineTo(-GN/2,PN),this.ctx.lineTo(-GN/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc),aa=300,sa=260,Da="#C49463",Ta="#E4CCB7",ga=40,la=127.28125,Ia=25,ya=1.41667,ha=26,ja=.5,xa=4,za=6,Oa=5,Ea=3.58333,Aa=5,fa=37,pa=8,Ua=15,da=3,Ca=5,Qa=1,wa=0,La=16,Sa=60,ka=225,va=200,Ya=60,ma=2.5,Ra=13;function Fa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ba=function(t){fc()(e,t);var n=Fa(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Ia},n={x:this.courtCenter.x,y:Ia+ga},e="transparent"===this.options.lineColor?"transparent":Da;this.ctx.fillStyle=e,this.ctx.strokeStyle=e;var r=Math.PI/13,i=Math.PI-Math.PI/13;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,Sa,r,i,!1);var u=Za(n,Sa,i),o=Za(n,Sa,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(u.x,u.y),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.strokeStyle="transparent"===this.options.lineColor?"transparent":"#FFFFFF",this.ctx.fillStyle="transparent"===this.options.lineColor?"transparent":Ta,this.ctx.beginPath(),this.ctx.arc(n.x,n.y-wa,La/2,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,ha/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function Za(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function Ba(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Va=function(t){fc()(e,t);var n=Ba(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:Ia};this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.save(),this.ctx.translate(n.x,n.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(Ya,0),this.ctx.stroke(),this.drawBaseSquare(Ya,0),this.drawBaseSquare(Ya+ma/2,Ya-ma/2),this.drawBaseSquare(ma,Ya-ma),this.ctx.beginPath(),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.restore(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(e*va,0),t.ctx.stroke(),t.ctx.restore()}));var e=Math.PI/6.8,r=Math.PI-Math.PI/6.8;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y+71,ka-71+4,e,r,!1),this.ctx.stroke(),this.ctx.restore()}},{key:"drawBaseSquare",value:function(t,n){this.ctx.save(),this.ctx.lineCap="square",this.ctx.beginPath(),this.ctx.translate(t,n),this.ctx.moveTo(0,0),this.ctx.lineTo(0,ma),this.ctx.lineTo(-ma,ma),this.ctx.lineTo(-ma,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function Wa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ga=function(t){fc()(e,t);var n=Wa(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:Ia},e={x:n.x-ya/2,y:n.y+ya},r={x:n.x+ya/2,y:n.y+ya};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(r.x,r.y-ya/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-ya/2),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.fill(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y+ya/2),t.ctx.beginPath();var r=ya/2+ja;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,ya/2),t.ctx.lineTo(e*(r+xa),ya/2),t.ctx.lineTo(e*(r+xa),ya/2-za),t.ctx.lineTo(e*r,ya/2-za),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+ya/2-za+ya/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-Oa),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(Ea/2),0),t.ctx.lineTo(n*(Ea/2),Oa),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-ha/2),t.ctx.beginPath(),t.ctx.arc(e*fa,0,Aa/2,0,2*Math.PI,!0),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(e*Ya,-(pa+da)),t.ctx.lineTo(e*Ya,-pa),t.ctx.lineTo(e*(Ya-Ua),-pa),t.ctx.lineTo(e*(Ya-Ua),-(pa+da)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(dc);function Pa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ja=function(t){fc()(e,t);var n=Pa(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Ia+ga-Qa/2};this.ctx.save(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.moveTo(0,0),this.ctx.lineTo(Ca/2,0),this.ctx.lineTo(Ca/2,Qa),this.ctx.lineTo(-Ca/2,Qa),this.ctx.lineTo(-Ca/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function Ha(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ka=function(t){fc()(e,t);var n=Ha(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){if(this.courtTypeConstants.BENCH_MARKING){var t={x:this.courtCenter.x-11,y:0},n={x:this.courtCenter.x-11,y:.5},e={x:this.courtCenter.x+11,y:0},r={x:this.courtCenter.x+11,y:.5};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.stroke()}}}]),e}(dc);function Xa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var qa=function(t){fc()(e,t);var n=Xa(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=0,n=28,e=3,r=28,i={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:28},u={x:this.courtTypeConstants.COURT_RECT_WIDTH-3,y:28};this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(e,r),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(i.x,i.y),this.ctx.lineTo(u.x,u.y),this.ctx.stroke()}}]),e}(dc);function _a(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var $a=function(t){fc()(e,t);var n=_a(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(dc);function ts(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ns=function(t){fc()(e,t);var n=ts(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){if(this.options.showHalfCourtCircle){this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,6,0,2*Math.PI,!0),this.courtTypeConstants.CENTER_INNER_CIRCLE&&this.ctx.arc(this.courtCenter.x,this.courtCenter.y,2,0,2*Math.PI,!0),this.ctx.stroke()}}}]),e}(dc);function es(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var rs=function(t){fc()(e,t);var n=es(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(dc);function is(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var us=function(t){fc()(e,t);var n=is(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:19},n=this.courtTypeConstants.FREE_THROW_INNER_WIDTH/2;this.ctx.beginPath(),this.ctx.arc(t.x,t.y,n,0,Math.PI,!1),this.ctx.stroke(),this.courtTypeConstants.FREE_THROW_INNER_DASHED_CIRCLE&&(this.ctx.setLineDash([1,.5]),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,n,0,Math.PI,!0),this.ctx.stroke())}}]),e}(dc);function os(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ms=function(t){fc()(e,t);var n=os(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:5.25},n={x:t.x-3,y:4},e={x:t.x+3,y:4};this.ctx.beginPath(),this.ctx.moveTo(n.x,n.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,.75,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(dc);function cs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ns=function(t){fc()(e,t);var n=cs(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this.courtTypeConstants.FREE_THROW_INNER_WIDTH,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH,e={x:this.courtCenter.x-t/2,y:0},r={x:this.courtCenter.x-n/2,y:0};this.ctx.beginPath(),this.ctx.rect(e.x,e.y,t,19),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(r.x,r.y,n,19),this.ctx.stroke()}}]),e}(dc);function as(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ss=function(t){fc()(e,t);var n=as(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:5.25},n={x:this.courtCenter.x+4,y:4},e={x:this.courtCenter.x+4,y:5.25},r={x:this.courtCenter.x-4,y:4};this.ctx.beginPath(),this.ctx.moveTo(n.x,n.y),this.ctx.lineTo(e.x,e.y),this.ctx.arc(t.x,t.y,4,0,Math.PI,!1),this.ctx.lineTo(r.x,r.y),this.ctx.stroke()}}]),e}(dc);function Ds(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ts=function(t){fc()(e,t);var n=Ds(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this.courtCenter.x-this.courtTypeConstants.HOOP_CORNER_DISTANCE,n=this.courtTypeConstants.COURT_RECT_WIDTH-t,e={x:t,y:0},r={x:t,y:this.courtTypeConstants.THREE_POINT_OFFSET_ORIGIN_Y_APPROX},i={x:n,y:0},u={x:this.courtCenter.x,y:5.25},o=Math.asin((this.courtTypeConstants.THREE_POINT_ASIN_APPROX-.75-.5)/this.courtTypeConstants.THREE_POINT_ARC_RADIUS),M=Math.PI-o;this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.arc(u.x,u.y,this.courtTypeConstants.THREE_POINT_ARC_RADIUS,M,o,!0),this.ctx.lineTo(i.x,i.y),this.ctx.stroke()}}]),e}(dc),gs=.1667,ls=1.5,Is=1,ys=.33,hs=!0;function js(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var xs=function(t){fc()(e,t);var n=js(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t=this,n=this.courtCenter.x,e=5.25,r={x:this.courtCenter.x,y:e+30},i=[{x:n-30*Math.cos(50*Math.PI/180),y:e+30*Math.sin(50*Math.PI/180)},r,{x:n+30*Math.cos(50*Math.PI/180),y:e+30*Math.sin(50*Math.PI/180)}];this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.font="".concat(4,"px Helvetica"),i.forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,2,0,2*Math.PI,!0),t.ctx.stroke(),"transparent"!==t.options.lineColor&&(t.ctx.fillStyle="#001c4f",t.ctx.fill()),t.ctx.fillStyle=t.options.lineColor,t.ctx.fillText("4",n.x-1.1,n.y+1.4)}))}}]),e}(dc),zs={drawLogic:function(){var t=this,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH/2,e=this.courtCenter.x-n,r=this.courtCenter.x+n,i=this.courtCenter.x-5,u=this.courtCenter.x+5;[7,8,11,14].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e,n),t.ctx.lineTo(e-.667,n),t.ctx.moveTo(r,n),t.ctx.lineTo(r+.667,n),t.ctx.stroke()})),this.ctx.beginPath(),this.ctx.moveTo(i,13),this.ctx.lineTo(i+.5,13),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(u,13),this.ctx.lineTo(u-.5,13),this.ctx.stroke()}};function Os(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Es=function(t){fc()(e,t);var n=Os(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}}]),e}(dc);Object.assign(Es.prototype,zs);var As=50,fs=94,ps=22,Us=23.6762,ds=10,Cs=14,Qs=12,ws=16,Ls=!0,Ss=!0,ks=!0;function vs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ys=function(t){fc()(e,t);var n=vs(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH/2,e=this.courtCenter.x-n,r=this.courtCenter.x+n;[5.9,13.6,16.5].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e,n),t.ctx.lineTo(e-.333,n),t.ctx.moveTo(r,n),t.ctx.lineTo(r+.333,n),t.ctx.stroke()})),this.ctx.beginPath(),this.ctx.rect(e,8.8,-.333,1.9),this.ctx.fill(),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(r,8.8,.333,1.9),this.ctx.fill(),this.ctx.stroke()}}]),e}(dc),ms=49.21,Rs=91.86,Fs=21.65,bs=22.15,Zs=6,Bs=8,Vs=12,Ws=16.08,Gs=!1,Ps=!1,Js=!1;function Hs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ks=function(t){fc()(e,t);var n=Hs(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}}]),e}(dc);Object.assign(Ks.prototype,zs);var Xs=50,qs=94,_s=22,$s=23.6762,tD=10,nD=14,eD=12,rD=16,iD=!0,uD=!0,oD=!0,MD={drawLogic:function(){var t=this,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH/2,e=this.courtCenter.x-n,r=this.courtCenter.x+n;[11,14,17].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e,n),t.ctx.lineTo(e-.667,n),t.ctx.moveTo(r,n),t.ctx.lineTo(r+.667,n),t.ctx.stroke()})),this.ctx.beginPath(),this.ctx.rect(e,7,-1.2,.8),this.ctx.fill(),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(r,7,1.2,.8),this.ctx.fill(),this.ctx.stroke()}};function cD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ND=function(t){fc()(e,t);var n=cD(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}}]),e}(dc);Object.assign(ND.prototype,MD);var aD=50,sD=94,DD=20.75,TD=20.75,gD=2,lD=6,ID=12,yD=12,hD=!1,jD=!1,xD=!1;function zD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var OD=function(t){fc()(e,t);var n=zD(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}}]),e}(dc);Object.assign(OD.prototype,MD);var ED=50,AD=94,fD=20.75,pD=20.75,UD=2,dD=6,CD=12,QD=12,wD=!1,LD=!1,SD=!0;function kD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var vD=function(t){fc()(e,t);var n=kD(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}}]),e}(dc);Object.assign(vD.prototype,MD);var YD=50,mD=84,RD=19.75,FD=19.75,bD=2,ZD=6,BD=12,VD=12,WD=!1,GD=!1,PD=!1;function JD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var HD=function(t){fc()(e,t);var n=JD(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}}]),e}(dc);Object.assign(HD.prototype,MD);var KD=42,XD=74,qD=19.75,_D=19.75,$D=2,tT=6,nT=12,eT=12,rT=!1,iT=!1,uT=!1;function oT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var MT=function(t){fc()(e,t);var n=oT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}}]),e}(dc);Object.assign(MT.prototype,zs);var cT=50,NT=94,aT=21.65,sT=22.15,DT=6,TT=9,gT=12,lT=16,IT=!0,yT=!0,hT=!0;function jT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var xT=function(t){fc()(e,t);var n=jT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(dc);function zT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var OT=function(t){fc()(e,t);var n=zT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(dc);function ET(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var AT=function(t){fc()(e,t);var n=ET(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=0,n=30,e={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:30};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t,n),this.ctx.lineTo(e.x,e.y),this.ctx.stroke()}}]),e}(dc);function fT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var pT=function(t){fc()(e,t);var n=fT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t=this.courtTypeConstants.END_ZONE_HEIGHT,n=String.fromCharCode(8202);this.ctx.fillStyle=this.options.lineColor,this.ctx.translate(20,t);for(var e=1;e<10;e++){var r="".concat(e<=5?e:10-e).concat(n,"0");this.ctx.translate(0,this.courtTypeConstants.END_ZONE_HEIGHT),this.ctx.save(),this.ctx.rotate(Math.PI/2),this.ctx.fillText(r,-6,0),this.ctx.translate(0,40-this.courtTypeConstants.COURT_RECT_WIDTH),this.ctx.rotate(Math.PI),this.ctx.fillText(r,-6,0),this.ctx.restore()}}}]),e}(dc);function UT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var dT=function(t){fc()(e,t);var n=UT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n=[3,53,this.courtTypeConstants.COURT_RECT_WIDTH-53-3,this.courtTypeConstants.COURT_RECT_WIDTH-3-3];this.ctx.save(),this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH;for(var e=function(e){n.forEach((function(n){for(var r=0;r<4;r++){var i=3+3*r,u={x:n,y:e-i},o={x:n+3,y:e-i};t.ctx.beginPath(),t.ctx.moveTo(u.x,u.y),t.ctx.lineTo(o.x,o.y),t.ctx.stroke()}}))},r=this.courtTypeConstants.END_ZONE_HEIGHT+15;r<=this.courtCenter.y;r+=15)e(r);this.ctx.restore()}}]),e}(dc);function CT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var QT=function(t){fc()(e,t);var n=CT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){for(var t=this.courtTypeConstants.END_ZONE_HEIGHT;t<=this.courtCenter.y;t+=15){var n={x:0,y:t},e={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:t};this.ctx.beginPath(),this.ctx.lineWidth=t%30==0?2*this.courtTypeConstants.COURT_LINE_WIDTH:this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(n.x,n.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke()}}}]),e}(dc),wT=.32,LT=1.5,ST=2,kT=.55,vT=!1,YT=160,mT=360,RT=30;function FT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var bT=function(t){fc()(e,t);var n=FT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor("#000"),this.ctx.lineWidth=4*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH,n=(this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.FACE_OFF_SPOTS_DISTANCE)/2,e=[{x:0,y:this.courtCenter.y},{x:0,y:t}],r=[{x:n,y:0},{x:this.courtTypeConstants.COURT_RECT_WIDTH-n,y:0}],i=[{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y},{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:t}];this.ctx.beginPath(),this.ctx.moveTo(e[0].x,e[0].y),this.ctx.lineTo(e[1].x,e[1].y),this.ctx.bezierCurveTo(0,0,10,0,r[0].x,r[0].y),this.ctx.lineTo(r[1].x,r[1].y),this.ctx.bezierCurveTo(this.courtTypeConstants.COURT_RECT_WIDTH-10,0,this.courtTypeConstants.COURT_RECT_WIDTH,0,i[1].x,i[1].y),this.ctx.lineTo(i[0].x,i[0].y),this.ctx.stroke()}}]),e}(dc);function ZT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var BT=function(t){fc()(e,t);var n=ZT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_BLUE),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,15,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(dc);function VT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var WT=function(t){fc()(e,t);var n=VT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.setLineDash([2,1]),this.ctx.lineWidth=4*this.courtTypeConstants.COURT_LINE_WIDTH;var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(dc);function GT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var PT=function(t){fc()(e,t);var n=GT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_BLUE),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,1,0,2*Math.PI,!0),this.ctx.fill()}}]),e}(dc);function JT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var HT=function(t){fc()(e,t);var n=JT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this;this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var n=(this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.FACE_OFF_SPOTS_DISTANCE)/2,e=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH+22;[{x:n,y:e},{x:this.courtTypeConstants.COURT_RECT_WIDTH-n,y:e}].forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,t.courtTypeConstants.FACE_OFF_SPOT_RADIUS,0,2*Math.PI,!0),t.ctx.fill(),t.ctx.beginPath(),t.ctx.arc(n.x,n.y,t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS,0,2*Math.PI,!0),t.ctx.stroke(),[{ox:n.x-t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS,tx:n.x-(t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS+1)},{ox:n.x+t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS,tx:n.x+(t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS+1)}].forEach((function(e){[n.y-1,n.y+1].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e.ox,n),t.ctx.lineTo(e.tx,n),t.ctx.stroke()}))}))}))}}]),e}(dc);function KT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var XT=function(t){fc()(e,t);var n=KT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH;this.ctx.beginPath(),this.ctx.moveTo(0,t),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,t),this.ctx.stroke()}}]),e}(dc);function qT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var _T=function(t){fc()(e,t);var n=qT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_BLUE),this.ctx.lineWidth=4*this.courtTypeConstants.COURT_LINE_WIDTH;var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.setColor(this.courtTypeConstants.LINE_COLOR_RED);var e=(this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.FACE_OFF_SPOTS_DISTANCE)/2,r=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH+5,i={x:e,y:r},u={x:this.courtTypeConstants.COURT_RECT_WIDTH-e,y:r};this.ctx.beginPath(),this.ctx.arc(i.x,i.y,this.courtTypeConstants.FACE_OFF_SPOT_RADIUS,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(u.x,u.y,this.courtTypeConstants.FACE_OFF_SPOT_RADIUS,0,2*Math.PI,!0),this.ctx.fill()}}]),e}(dc);function $T(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var tg=function(t){fc()(e,t);var n=$T(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(0,this.courtCenter.y,10,-Math.PI/2,Math.PI/2,!1),this.ctx.stroke()}}]),e}(dc),ng=.1667,eg=1.5,rg=2,ig=.55,ug=!0;function og(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Mg=function(t){fc()(e,t);var n=og(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH;this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t),this.ctx.lineTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t),this.ctx.stroke(),this.setColor("#000"),this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.lineTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.stroke()}}]),e}(dc),cg=85,Ng=200,ag="#C8102E",sg="#0032A0",Dg=64,Tg=25,gg=44,lg=.75,Ig=15,yg=6,hg=3,jg=4;function xg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var zg=function(t){fc()(e,t);var n=xg(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH;this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,t,this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,0,Math.PI,!1),this.ctx.stroke(),this.setColor("#000"),this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.lineTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.stroke()}}]),e}(dc),Og=100,Eg=200,Ag="#C8102E",fg="#0032A0",pg=58,Ug=29,dg=44,Cg=.75,Qg=15,wg=6,Lg=3,Sg=5.8;function kg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var vg=function(t){fc()(e,t);var n=kg(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(dc);function Yg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var mg=function(t){fc()(e,t);var n=Yg(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(dc),Rg=.1667,Fg=1.5,bg=1,Zg=.33,Bg=!0;function Vg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Wg=function(t){fc()(e,t);var n=Vg(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e=[{x:this.courtCenter.x-1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y+1},{x:this.courtCenter.x-1,y:this.courtCenter.y+1}];this.ctx.beginPath(),this.ctx.moveTo(e[0].x,e[0].y),this.ctx.lineTo(e[2].x,e[2].y),this.ctx.moveTo(e[1].x,e[1].y),this.ctx.lineTo(e[3].x,e[3].y),this.ctx.stroke()}}]),e}(dc);function Gg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Pg=function(t){fc()(e,t);var n=Gg(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtTypeConstants.WING_OFFSET_X,y:0},n={x:this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:0},r={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.stroke();var i={x:this.courtCenter.x,y:15};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(i.x-1,i.y),this.ctx.lineTo(i.x+1,i.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(i.x,i.y,3,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(dc);function Jg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Hg=function(t){fc()(e,t);var n=Jg(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-10},n={x:this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-10},r={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.stroke()}}]),e}(dc),Kg=60,Xg=110,qg=10,_g=20;function $g(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var tl=function(t){fc()(e,t);var n=$g(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t={x:this.courtCenter.x-1.5,y:this.courtCenter.y},n={x:this.courtCenter.x+1.5,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,10,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(dc);function nl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var el=function(t){fc()(e,t);var n=nl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y-30};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(n.x,n.y,2.84,0,2*Math.PI,!1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,15.97,0,Math.PI,!1),this.ctx.stroke();var e={x:n.x-15.97,y:n.y},r={x:n.x-2.84,y:n.y},i={x:n.x+15.97,y:n.y},u={x:n.x+2.84,y:n.y};this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.moveTo(i.x,i.y),this.ctx.lineTo(u.x,u.y),this.ctx.stroke();var o={x:n.x,y:n.y-2.84},M=Math.PI/4,c=Math.PI/2+Math.PI/4;this.ctx.beginPath(),this.ctx.arc(o.x,o.y,14.43,M,c,!1),this.ctx.stroke();var N=rl(o,14.43,c),a=rl(o,14.43,M),s=n.x-2.84,D=n.x+2.84;this.ctx.beginPath(),this.ctx.moveTo(N.x,N.y),this.ctx.lineTo(s,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(a.x,a.y),this.ctx.lineTo(D,n.y),this.ctx.stroke();var T={x:s-8.75,y:n.y},g={x:D+8.75,y:n.y};this.ctx.beginPath(),this.ctx.moveTo(T.x,T.y),this.ctx.lineTo(T.x,T.y+1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(g.x,g.y),this.ctx.lineTo(g.x,g.y+1),this.ctx.stroke();var l=rl(o,14.43,Math.PI/2);this.ctx.beginPath(),this.ctx.moveTo(l.x,l.y-1),this.ctx.lineTo(l.x,l.y+1),this.ctx.stroke();for(var I=function(n){[1,-1].forEach((function(e){var r=Math.PI/2+Math.PI/10*e*n,i=rl(o,14.43,r);t.ctx.save(),t.ctx.translate(i.x,i.y),t.ctx.rotate(Math.PI/10*e*n),t.ctx.beginPath(),t.ctx.moveTo(0,-1),t.ctx.lineTo(0,1),t.ctx.stroke(),t.ctx.restore()}))},y=1;y<=3;y++)I(y);var h={x:T.x,y:T.y-5},j={x:g.x,y:g.y-5};this.ctx.beginPath(),this.ctx.arc(h.x,h.y,.5,0,2*Math.PI,!1),this.ctx.arc(j.x,j.y,.5,0,2*Math.PI,!1),this.ctx.fill();var x={x:n.x-1,y:n.y},z={x:n.x+1,y:n.y},O={x:n.x,y:n.y-1};this.ctx.beginPath(),this.ctx.moveTo(x.x,x.y),this.ctx.lineTo(z.x,z.y),this.ctx.lineTo(O.x,O.y),this.ctx.closePath(),this.ctx.stroke()}}]),e}(dc);function rl(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}var il=60,ul=130,ol=20;function Ml(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var cl=function(t){fc()(e,t);var n=Ml(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=[{x:0,y:this.courtCenter.y},{x:0,y:this.courtTypeConstants.GOAL_LINE_Y}],n=[{x:this.courtTypeConstants.TOP_SIDE_CURVE_OFFSET,y:0},{x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.TOP_SIDE_CURVE_OFFSET,y:0}],e=[{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y},{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtTypeConstants.GOAL_LINE_Y}];this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.bezierCurveTo(0,0,10,0,n[0].x,n[0].y),this.ctx.lineTo(n[1].x,n[1].y),this.ctx.bezierCurveTo(this.courtTypeConstants.COURT_RECT_WIDTH-10,0,this.courtTypeConstants.COURT_RECT_WIDTH,0,e[1].x,e[1].y),this.ctx.lineTo(e[0].x,e[0].y),this.ctx.stroke()}}]),e}(dc),Nl=.1667,al=1.5,sl=1,Dl=.33,Tl=!0;function gl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ll=function(t){fc()(e,t);var n=gl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,11,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.setLineDash([.8,.5]),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,1.41667,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(dc);function Il(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var yl=function(t){fc()(e,t);var n=Il(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH,this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y+5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH-5,this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y+5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH-5,this.courtCenter.y+this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y-5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,this.courtCenter.y+this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y-5),this.ctx.stroke()}}]),e}(dc);function hl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var jl=function(t){fc()(e,t);var n=hl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e=this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y/2;this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH,e-12),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e-12),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e+12),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,e+12),this.ctx.stroke()}}]),e}(dc);function xl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var zl=function(t){fc()(e,t);var n=xl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:this.courtTypeConstants.GOAL_LINE_Y};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t.x-9.25,t.y),this.ctx.lineTo(t.x+9.25,t.y),this.ctx.stroke();var n=Math.PI/4.5;this.ctx.beginPath(),this.ctx.arc(t.x,t.y,9.25,-n,Math.PI+n,!1),this.ctx.stroke();this.ctx.beginPath(),this.ctx.moveTo(t.x-7.25,t.y-6),this.ctx.lineTo(t.x+7.25,t.y-6),this.ctx.stroke();var e={x:t.x-2.375,y:t.y},r={x:t.x+2.375,y:t.y},i={x:t.x,y:t.y-2.375};this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(i.x,i.y),this.ctx.closePath(),this.ctx.stroke()}}]),e}(dc);function Ol(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var El=function(t){fc()(e,t);var n=Ol(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(0,this.courtCenter.y,10,Math.PI/2,-Math.PI/2,!0),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y-10),this.ctx.bezierCurveTo(0,this.courtCenter.y-10,-2.5,this.courtCenter.y-10,-5,this.courtCenter.y-10),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y+10),this.ctx.bezierCurveTo(0,this.courtCenter.y+10,-2.5,this.courtCenter.y+10,-5,this.courtCenter.y+10),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y-12),this.ctx.lineTo(-5,this.courtCenter.y-12),this.ctx.lineTo(-5,this.courtCenter.y+12),this.ctx.lineTo(0,this.courtCenter.y+12),this.ctx.stroke()}}]),e}(dc),Al=85,fl=180,pl=12,Ul=12,dl=42.5;function Cl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ql=2,wl=function(t){fc()(e,t);var n=Cl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t=this;this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,.5,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,Ql,0,2*Math.PI,!0),this.ctx.stroke(),[Ql,-Ql].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(t.courtCenter.x+n,t.courtCenter.y-3),t.ctx.lineTo(t.courtCenter.x+n,t.courtCenter.y+3),t.ctx.stroke()}))}}]),e}(dc);function Ll(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Sl=function(t){fc()(e,t);var n=Ll(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e=this.courtCenter.y-5;this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH,e),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e-30),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,e-30),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH-4,this.courtCenter.y),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH-4,this.courtCenter.y-30-5+.5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,this.courtCenter.y-30-5+.5),this.ctx.stroke();var r=this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y;this.ctx.beginPath(),this.ctx.moveTo(0,r),this.ctx.lineTo(-5,r),this.ctx.lineTo(-5,r-12),this.ctx.lineTo(0,r-12),this.ctx.stroke()}}]),e}(dc);function kl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var vl=function(t){fc()(e,t);var n=kl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:this.courtTypeConstants.GOAL_LINE_Y};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t.x-9.25,t.y),this.ctx.lineTo(t.x+9.25,t.y),this.ctx.stroke();var n=Math.PI/4.5;this.ctx.beginPath(),this.ctx.arc(t.x,t.y,9.25,-n,Math.PI+n,!1),this.ctx.stroke(),this.ctx.save(),this.ctx.setLineDash([1.2,.4]),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,24,0,Math.PI,!1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(t.x-9.25,t.y),this.ctx.lineTo(t.x-24,t.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(t.x+9.25,t.y),this.ctx.lineTo(t.x+24,t.y),this.ctx.stroke(),this.ctx.restore();this.ctx.beginPath(),this.ctx.moveTo(t.x-7.25,t.y-6),this.ctx.lineTo(t.x+7.25,t.y-6),this.ctx.stroke();var e={x:t.x-2.375,y:t.y},r={x:t.x+2.375,y:t.y},i={x:t.x,y:t.y-2.375};this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(i.x,i.y),this.ctx.closePath(),this.ctx.stroke()}}]),e}(dc);function Yl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ml=function(t){fc()(e,t);var n=Yl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(0,this.courtCenter.y,10,Math.PI/2,-Math.PI/2,!0),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y-10),this.ctx.lineTo(-5,this.courtCenter.y-10),this.ctx.lineTo(-5,this.courtCenter.y+10),this.ctx.lineTo(0,this.courtCenter.y+10),this.ctx.stroke()}}]),e}(dc),Rl=85,Fl=180,bl=12,Zl=12,Bl=11,Vl="Concrete";function Wl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Gl=function(t){fc()(e,t);var n=Wl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(dc);function Pl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Jl=function(t){fc()(e,t);var n=Pl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(dc);function Hl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Kl=function(t){fc()(e,t);var n=Hl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(dc);function Xl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ql=function(t){fc()(e,t);var n=Xl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,.25,0,2*Math.PI,!0),this.ctx.fill()}}]),e}(dc);function _l(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var $l=function(t){fc()(e,t);var n=_l(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=0,n=0,e={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:0};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(t,n,1,0,Math.PI/2,!1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(e.x,e.y,1,Math.PI,Math.PI/2,!0),this.ctx.stroke()}}]),e}(dc);function tI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var nI=function(t){fc()(e,t);var n=tI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,Math.PI/5,Math.PI-Math.PI/5,!1),this.ctx.stroke()}}]),e}(dc);function eI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var rI=function(t){fc()(e,t);var n=eI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.rect(this.courtCenter.x-this.courtTypeConstants.PENALTY_AREA.width/2,0,this.courtTypeConstants.PENALTY_AREA.width,this.courtTypeConstants.PENALTY_AREA.height),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(this.courtCenter.x-this.courtTypeConstants.GOAL_AREA.width/2,0,this.courtTypeConstants.GOAL_AREA.width,this.courtTypeConstants.GOAL_AREA.height),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(this.courtCenter.x-this.courtTypeConstants.GOAL.width/2,-this.courtTypeConstants.GOAL.height,this.courtTypeConstants.GOAL.width,this.courtTypeConstants.GOAL.height),this.ctx.stroke()}}]),e}(dc);function iI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var uI=function(t){fc()(e,t);var n=iI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,.25,0,2*Math.PI,!1),this.ctx.fill()}}]),e}(dc),oI=.1667,MI=1.5,cI=1,NI=.33,aI=!0,sI=60,DI=110,TI=10,gI=12,lI={width:44,height:18},II={width:8,height:2.66},yI={width:20,height:6},hI=60,jI=110,xI=10,zI=12,OI={width:44,height:18},EI={width:8,height:2.66},AI={width:20,height:6};function fI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var pI=function(t){fc()(e,t);var n=fI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t=[{x:this.courtCenter.x-1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y+1},{x:this.courtCenter.x-1,y:this.courtCenter.y+1}];this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.moveTo(t[1].x,t[1].y),this.ctx.lineTo(t[3].x,t[3].y),this.ctx.stroke()}}]),e}(dc);function UI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var dI=function(t){fc()(e,t);var n=UI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=11,n=0,e={x:this.courtTypeConstants.COURT_RECT_WIDTH-11,y:0};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(t,n-1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(e.x,e.y-1),this.ctx.stroke()}}]),e}(dc);function CI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var QI=function(t){fc()(e,t);var n=CI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-.33,12),this.ctx.lineTo(this.courtCenter.x+.33,12),this.ctx.stroke()}}]),e}(dc),wI=70,LI=115,SI=10,kI=12,vI={width:44,height:18},YI={width:8,height:2.66},mI={width:20,height:6};function RI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var FI=function(t){fc()(e,t);var n=RI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=11,n=0,e={x:this.courtTypeConstants.COURT_RECT_WIDTH-11,y:0};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(t,n-1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(e.x,e.y-1),this.ctx.stroke()}}]),e}(dc);function bI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ZI=function(t){fc()(e,t);var n=bI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-.33,12),this.ctx.lineTo(this.courtCenter.x+.33,12),this.ctx.stroke()}}]),e}(dc),BI=60,VI=100,WI=10,GI=12,PI={width:44,height:18},JI={width:8,height:2.66},HI={width:20,height:6};function KI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var XI=function(t){fc()(e,t);var n=KI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t={x:0,y:this.courtTypeConstants.COURT_RECT_HEIGHT/3},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtTypeConstants.COURT_RECT_HEIGHT/3};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(dc);function qI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var _I=function(t){fc()(e,t);var n=qI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,Math.PI/12,Math.PI-Math.PI/12,!1),this.ctx.stroke()}}]),e}(dc),$I=45,ty=65,ny=8,ey=10,ry={width:24,height:12},iy={width:6,height:2},uy={width:8,height:4};function oy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var My=function(t){fc()(e,t);var n=oy(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,Math.PI/6,Math.PI-Math.PI/6,!1),this.ctx.stroke()}}]),e}(dc),cy=55,Ny=80,ay=8,sy=10,Dy={width:36,height:14},Ty={width:6.16,height:2.16},gy={width:12,height:5};function ly(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Iy=function(t){fc()(e,t);var n=ly(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-9.8},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-9.8};this.ctx.beginPath(),this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();for(var e=.574,r=0;r<5;r++)this.ctx.beginPath(),this.ctx.moveTo(t.x-e,t.y),this.ctx.lineTo(t.x-e-.574,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(n.x+e,t.y),this.ctx.lineTo(n.x+e+.574,n.y),this.ctx.stroke(),e+=1.148}}]),e}(dc);function yy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var hy=function(t){fc()(e,t);var n=yy(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(dc);function jy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var xy=function(t){fc()(e,t);var n=jy(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath()}}]),e}(dc);function zy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Oy,Ey,Ay,fy,py,Uy,dy,Cy,Qy,wy,Ly,Sy=function(t){fc()(e,t);var n=zy(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this.courtTypeConstants.COURT_RECT_WIDTH;this.ctx.beginPath(),this.ctx.moveTo(0,-.574),this.ctx.lineTo(0,-1.148),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(t,-.574),this.ctx.lineTo(t,-1.148),this.ctx.stroke()}}]),e}(dc),ky=.1667,vy=1.5,Yy=1,my=.33,Ry=!0,Fy=29.5,by=59.1,Zy=(Oy={},dt()(Oy,yn,o),dt()(Oy,hn,a),dt()(Oy,an,I),dt()(Oy,Dn,k),dt()(Oy,In,m),dt()(Oy,Tn,V),dt()(Oy,gn,K),dt()(Oy,ln,nt),dt()(Oy,sn,Tt),Oy),By=(Cy={},dt()(Cy,yn,dt()({},Bn,N)),dt()(Cy,hn,(Ey={},dt()(Ey,Vn,T),dt()(Ey,Wn,l),Ey)),dt()(Cy,an,(Ay={},dt()(Ay,jn,h),dt()(Ay,xn,x),dt()(Ay,zn,O),dt()(Ay,On,A),dt()(Ay,En,p),dt()(Ay,An,d),dt()(Ay,fn,Q),dt()(Ay,pn,L),Ay)),dt()(Cy,Dn,{}),dt()(Cy,In,(fy={},dt()(fy,bn,F),dt()(fy,Zn,Z),fy)),dt()(Cy,Tn,(py={},dt()(py,Qn,G),dt()(py,wn,J),py)),dt()(Cy,gn,(Uy={},dt()(Uy,Ln,q),dt()(Uy,Sn,$),Uy)),dt()(Cy,ln,(dy={},dt()(dy,vn,ut),dt()(dy,Yn,Mt),dt()(dy,mn,Nt),dt()(dy,Rn,st),dy)),dt()(Cy,sn,{}),Cy),Vy=(Qy={},dt()(Qy,yn,M),dt()(Qy,hn,s),dt()(Qy,an,y),dt()(Qy,Dn,v),dt()(Qy,In,R),dt()(Qy,Tn,W),dt()(Qy,gn,X),dt()(Qy,ln,et),dt()(Qy,sn,gt),Qy),Wy=(wy={},dt()(wy,Bn,c),dt()(wy,Vn,D),dt()(wy,Wn,g),dt()(wy,jn,j),dt()(wy,xn,z),dt()(wy,zn,E),dt()(wy,On,f),dt()(wy,En,U),dt()(wy,An,C),dt()(wy,fn,w),dt()(wy,pn,S),dt()(wy,dn,Y),dt()(wy,Un,Y),dt()(wy,bn,b),dt()(wy,Zn,B),dt()(wy,Qn,P),dt()(wy,wn,H),dt()(wy,Ln,_),dt()(wy,Sn,tt),dt()(wy,kn,it),dt()(wy,vn,ot),dt()(wy,Yn,ct),dt()(wy,mn,at),dt()(wy,Rn,Dt),dt()(wy,Fn,rt),dt()(wy,Cn,lt),wy),Gy=(Ly={},dt()(Ly,yn,{courtTypes:[Bn]}),dt()(Ly,hn,{courtTypes:[Vn,Wn]}),dt()(Ly,an,{courtTypes:[jn,xn,zn,On,En,An,fn,pn]}),dt()(Ly,Dn,{courtTypes:[Un]}),dt()(Ly,In,{courtTypes:[bn,Zn]}),dt()(Ly,Tn,{courtTypes:[Qn,wn]}),dt()(Ly,gn,{courtTypes:[Ln,Sn]}),dt()(Ly,ln,{courtTypes:[kn,vn,Yn,mn,Rn,Fn]}),dt()(Ly,sn,{courtTypes:[Cn]}),Ly);function Py(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}var Jy=function(){function t(n,e,r){At()(this,t),this.ctx=n,this.playData=e,this.options=r}return pt()(t,[{key:"disableMirrorMode",value:function(){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-this.playData.court.courtRect.origin.x,-this.playData.court.courtRect.origin.y)}},{key:"courtTypeConstants",get:function(){if(!Vy[this.playData.sport])throw new Error("unknown sport type constants");if(!Wy[this.playData.court.type])throw new Error("unknown court type constants");return function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Py(Object(e),!0).forEach((function(n){dt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Py(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},Vy[this.playData.sport],{},Wy[this.playData.court.type])}}]),t}();function Hy(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function Ky(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Xy=function(t){fc()(e,t);var n=Ky(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"apply",value:function(){var t=this;this.init(),this.ctx.save(),this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH,this.setColor(),Object.values(this.courtTypeLayers).forEach((function(n){new n(t).apply()})),this.ctx.restore()}},{key:"init",value:function(){this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.setBackground(),this.setWatermark(),this.ctx.restore()}},{key:"setColor",value:function(){var t=this.options.lineColor||"#fff";this.ctx.strokeStyle=t,this.ctx.fillStyle=t}},{key:"setBackground",value:function(){var t;t=this.background,void 0!==Te.backgroundOptions[t]&&this.staticData.backgroundOptions&&this.staticData.backgroundOptions[this.background]?(this.ctx.fillStyle=this.ctx.createPattern(this.staticData.backgroundOptions[this.background],"repeat"),this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height)):0===this.background.indexOf("#")&&(this.ctx.save(),this.ctx.fillStyle=this.background,this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore())}},{key:"setWatermark",value:function(){var t=this.options.watermark?this.staticData.watermark[this.options.watermark]:null;if(t){var n=t.width/t.height,e=this.frameWidth/5,r={width:e,height:e*t.height/t.width};n<1&&(r.width=e*t.width/t.height,r.height=e);var i=this.playData.court.courtRect.size.height>this.courtTypeConstants.COURT_RECT_HEIGHT?Math.abs(this.playData.court.courtRect.origin.y):0,u=(1+Math.abs(this.playData.court.courtRect.origin.x))*this.scale,o=(this.playData.court.courtRect.size.height-i-1)*this.scale-r.height;this.ctx.drawImage(t,0,0,t.width,t.height,u,o,r.width,r.height)}}},{key:"frameWidth",get:function(){return this.options.width}},{key:"scale",get:function(){return this.options.scale}},{key:"staticData",get:function(){return this.options.staticData}},{key:"courtTypeLayers",get:function(){if(!Zy[this.playData.sport])throw new Error("unknown sport type layer");return function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Hy(Object(e),!0).forEach((function(n){dt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Hy(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},Zy[this.playData.sport],{},(By[this.playData.sport]||{})[this.playData.court.type]||{})}},{key:"background",get:function(){return this.options.background||this.courtTypeConstants.BACKGROUND||this.playData.sport}}]),e}(Jy),qy=e(11),_y=e.n(qy),$y={drawLineFromControlPoints:function(){var t=this;this.ctx.save(),this.setLineOptions(),this.ctx.lineJoin="round",this.getProcessedLinePaths().forEach((function(n){t.ctx.save(),n.alpha&&t.setColor(n.alpha),t.ctx.beginPath();var e=n.controlPoints;t.ctx.moveTo(e[0].x,e[0].y),2===e.length&&("DRIBBLE"===(t.line||t.shape||{}).type&&(t.ctx.lineCap="round"),t.ctx.lineTo(e[1].x,e[1].y)),3===e.length&&t.ctx.quadraticCurveTo(e[1].x,e[1].y,e[2].x,e[2].y),4===e.length&&t.ctx.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y),t.ctx.stroke(),t.ctx.restore()})),this.ctx.restore()},drawArrowLineCap:function(t){var n=t||this.arrowTipPoint();this.ctx.save();var e=this.angleBetweenLastTwoPoints(),r=n,i={x:r.x-1.4/1.3,y:r.y},u={x:r.x-1.4-1.4/6,y:r.y-.7},o={x:r.x-1.4-1.4/6,y:r.y+.7};this.ctx.beginPath(),this.ctx.translate(r.x,r.y),this.ctx.rotate(e),this.ctx.translate(-r.x,-r.y),this.ctx.moveTo(i.x,i.y),this.ctx.lineTo(u.x,u.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(i.x,i.y),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore()},drawPerpendicularLineCap:function(){this.drawPerpendicularLineAtCourtPoint(this.arrowTipPoint(),this.angleBetweenLastTwoPoints())},drawPerpendicularLineAtCourtPoint:function(t,n){this.ctx.save();var e={x:t.x,y:t.y-1.5},r={x:t.x,y:t.y+1.5};this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.rotate(n),this.ctx.translate(-t.x,-t.y),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore()},handOffLineCap:function(t){var n=this;this.ctx.save(),t.forEach((function(t){var e=t.controlPoints,r=n.calcMidPoint(e[0],e[e.length-1]),i=n.angleBetweenLastTwoPoints(),u=.5*Math.cos(i),o=.5*Math.sin(i),M={x:r.x+u,y:r.y+o},c={x:r.x-u,y:r.y-o};n.drawPerpendicularLineAtCourtPoint(M,i),n.drawPerpendicularLineAtCourtPoint(c,i),n.ctx.stroke()})),this.ctx.restore()},calcMidPoint:function(t,n){return{x:t.x+(n.x-t.x)/2,y:t.y+(n.y-t.y)/2}},angleBetweenLastTwoPoints:function(){var t=je()(this.getProcessedLinePaths()).pop().controlPoints,n=t[t.length-1],e=t[t.length-2];return this.angleBetweenTwoPoints(e,n)},angleBetweenTwoPoints:function(t,n){var e=n.x-t.x,r=n.y-t.y;return Math.atan2(r,e)},arrowTipPoint:function(){var t=je()(this.getProcessedLinePaths()).pop().controlPoints;return t[t.length-1]},setLineOptions:function(){}};function th(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function nh(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?th(Object(e),!0).forEach((function(n){dt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):th(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function eh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var rh=function(t){fc()(e,t);var n=eh(e);function e(t,r){var i;return At()(this,e),(i=n.call(this,t)).line=r,dt()(_y()(i),"lineWidth",void 0),dt()(_y()(i),"debugMasking",void 0),dt()(_y()(i),"startMaskSettings",void 0),dt()(_y()(i),"endMaskSettings",void 0),i.lineWidth=t.lineWidth,i.debugMasking=!1,i.startMaskSettings=null,i.endMaskSettings=null,i}return pt()(e,[{key:"drawLineFromControlPoints",value:function(){}},{key:"drawArrowLineCap",value:function(t){}},{key:"handOffLineCap",value:function(t){}},{key:"drawPerpendicularLineCap",value:function(){}},{key:"angleBetweenLastTwoPoints",value:function(){return 0}}]),pt()(e,[{key:"drawLogic",value:function(){!this.options.animationGlobalProgress&&this.courtTypeConstants.LINE_MASKING&&(this.setLineMasking(),this.applyMasking()),this.setColor(),this.drawLineFromControlPoints(),this.drawLineCap()}},{key:"setColor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=!1;if(this.options.position){var e=this.line.originalData,r=e.playerPositionOrigin,i=e.playerPositionTerminus;r!==this.options.position&&i!==this.options.position||(n=!0)}var u=this.line.color,o=u.alpha,M=u.blue,c=u.green,N=u.red,a=n?0:Math.ceil(255*N),s=n?0:Math.ceil(255*c),D=n?255:Math.ceil(255*M),T="rgba(".concat(a,", ").concat(s,", ").concat(D,", ").concat(t||o,")");this.ctx.fillStyle=T,this.ctx.strokeStyle=T}},{key:"getProcessedLinePaths",value:function(){return this.line.getLineParts()}},{key:"applyMasking",value:function(){var t=this;this.line.getLineParts().forEach((function(n,e){var r=n.controlPoints;t.startMaskSettings&&(r=Dc(r,t.startMaskSettings.radius,t.startMaskSettings.centerPoint),t.line.setLinePartsAdjustedAtIndex(e,nh({},n,{controlPoints:r}))),t.endMaskSettings&&(r=Dc(r,null,null,t.endMaskSettings.radius,t.endMaskSettings.centerPoint),t.line.setLinePartsAdjustedAtIndex(e,nh({},n,{controlPoints:r})))}))}},{key:"setLineMasking",value:function(){if(this.line.playerPositionOrigin){var t=this.line.playerPositionOrigin,n=this.line.playerLineSequence;if(0===n){var e=this.playData.players.find((function(n){return n.position===t}));if(e){var r=e.possession?1.5:1;"HANDOFF"!==this.line.type||e.possession||(r=.7),this.startMaskSettings={centerPoint:e.location,radius:r}}}else if(t){var i=this.playData.lines.filter((function(e){return e.playerPositionOrigin===t&&e.playerLineSequence===n-1&&["PASS","HANDOFF"].indexOf(e.type)<0}));if(i.length){var u=le()(i,1)[0];if(u.lineParts.length){var o=je()(u.lineParts).pop(),M=je()(o.controlPoints).pop();this.startMaskSettings={centerPoint:M,radius:3}}}}}if(this.line.playerPositionTerminus&&"SCREEN"!==this.line.type){var c=3.7,N=je()(this.line.getLineParts()).pop(),a=je()(N.controlPoints).pop();["PASS","HANDOFF"].indexOf(this.line.type)>=0&&(c=1.75),this.endMaskSettings={centerPoint:a,radius:c}}this.showMaskingDebug()}},{key:"showMaskingDebug",value:function(){if(!1!==this.debugMasking){if(this.ctx.save(),this.ctx.lineWidth=.04,null!==this.startMaskSettings){var t=this.startMaskSettings.centerPoint,n=t.x,e=t.y;this.ctx.strokeStyle="green",this.ctx.moveTo(n,e),this.ctx.beginPath(),this.ctx.arc(n,e,this.startMaskSettings.radius,0,2*Math.PI,!0),this.ctx.stroke()}if(null!==this.endMaskSettings){var r=this.endMaskSettings.centerPoint,i=r.x,u=r.y;this.ctx.strokeStyle="red",this.ctx.moveTo(i,u),this.ctx.beginPath(),this.ctx.arc(i,u,this.endMaskSettings.radius,0,2*Math.PI,!0),this.ctx.stroke()}this.ctx.restore()}}},{key:"drawLineCap",value:function(){}}]),e}(pc);function ih(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}Object.assign(rh.prototype,$y);var uh=function(t){fc()(e,t);var n=ih(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"allowDrawLineCap",value:function(){return!this.line.hideLineTip&&!(this.options.magnetMode&&!this.options.animationGlobalProgress)}}]),e}(rh);function oh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Mh=function(t){fc()(e,t);var n=oh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawArrowLineCap()}}]),e}(uh),ch={convertLinePartsToDribble:function(t){var n=[];return t.forEach((function(e,r){var i=Array(4);e.controlPoints.forEach((function(t,n){i[n]=t}));for(var u=new xe(i[0],i[1],i[2],i[3]),o=[],M=0,c=1/u.length;M<=1;)o.push({x:u.mx(M),y:u.my(M),time:M}),M+=c;for(var N=[],a=[],s=0;s<o.length;s++)a.push(o[s]),a.length>1&&(N.push(a),a=[o[s]]);N.forEach((function(e,i){var u=le()(e,2),o=u[0],M=u[1],c={x:1.2*(M.x-o.x),y:1.2*(M.y-o.y)},a=(o.x+M.x)/2,s=(o.y+M.y)/2,D={x:-c.y,y:c.x};i%2&&(D={x:c.y,y:-c.x});var T=[o,{x:a+D.x,y:s+D.y},M];1!==t.length&&r!==t.length-1||i===N.length-1&&(T=[o,M]),n.push({controlPoints:T,lpIndex:r})}))})),n}};function Nh(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function ah(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var sh=function(t){fc()(e,t);var n=ah(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"convertLinePartsToDribble",value:function(t){return[]}},{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawArrowLineCap()}},{key:"setLineOptions",value:function(){var t=this,n=je()(this.line.getLineParts()),e=this.convertLinePartsToDribble(n);this.line.setLinePartsAdjusted([]),e.forEach((function(e){var r=e.controlPoints,i=e.lpIndex,u=le()(r,1)[0],o=n[i].alpha||t.line.color.alpha;if(t.options.animationGlobalProgress){var M=le()(t.line.animationKeyTimeChunks[i],2),c=M[0],N=M[1];Qt.a.inRange(t.options.animationGlobalProgress,c,N)&&wt(t.options.animationGlobalProgress,c,N)>u.time&&(o=.1)}t.line.addLinePartAdjusted(function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Nh(Object(e),!0).forEach((function(n){dt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Nh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},e,{controlPoints:r,alpha:o}))}))}}]),e}(uh);function Dh(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function Th(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}Object.assign(sh.prototype,ch);var gh=function(t){fc()(e,t);var n=Th(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLineCap",value:function(){this.handOffLineCap(this.line.baseLineParts())}},{key:"getProcessedLinePaths",value:function(){return this.line.getLineParts().map((function(t){var n=t.controlPoints;return function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Dh(Object(e),!0).forEach((function(n){dt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Dh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},t,{controlPoints:[n[0],n[n.length-1]]})}))}}]),e}(rh);function lh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ih=function(t){fc()(e,t);var n=lh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"setLineOptions",value:function(){this.ctx.setLineDash([1,.5])}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}}]),e}(rh);function yh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var hh=function(t){fc()(e,t);var n=yh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawPerpendicularLineCap()}}]),e}(uh);function jh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var xh=function(t){fc()(e,t);var n=jh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLineCap",value:function(){if(this.allowDrawLineCap()){var t=this.line.lastLinePartControlPoint,n={x:.6,y:0},e=this.angleBetweenLastTwoPoints(),r={x:Math.cos(e)*n.x-Math.sin(e)*n.y,y:Math.sin(e)*n.x-Math.cos(e)*n.y},i={x:t.x+r.x,y:t.y+r.y};this.drawArrowLineCap(i)}}},{key:"setLineOptions",value:function(){this.ctx.lineWidth=.7*this.lineWidth}},{key:"drawLineFromControlPoints",value:function(){var t=this;this.ctx.save(),this.setLineOptions(),this.ctx.lineJoin="round",this.getProcessedLinePaths().forEach((function(n){t.ctx.save(),n.alpha&&t.setColor(n.alpha),t.ctx.beginPath();var e=n.controlPoints;[-.3,.3].forEach((function(n){var r=e[0].x-e[e.length-1].x,i=e[0].y-e[e.length-1].y,u=n/Math.pow(r*r+i*i,.5),o=-i*u,M=r*u,c=e.map((function(t){return{x:t.x+o,y:t.y+M}}));t.ctx.moveTo(c[0].x,c[0].y),2===e.length&&t.ctx.lineTo(c[1].x,c[1].y),3===e.length&&t.ctx.quadraticCurveTo(c[1].x,c[1].y,c[2].x,c[2].y),4===e.length&&t.ctx.bezierCurveTo(c[1].x,c[1].y,c[2].x,c[2].y,c[3].x,c[3].y),t.ctx.stroke()})),t.ctx.restore()})),this.ctx.restore()}}]),e}(uh);function zh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Oh=function(t){fc()(e,t);var n=zh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"apply",value:function(){var t=this;"HIDDEN"!==this.options.linesDisplay&&("START_HIDDEN"!==this.options.linesDisplay||this.options.animationGlobalProgress)&&(this.ctx.save(),this.ctx.lineWidth=this.lineWidth,this.playData.lines.forEach((function(n){if(!(t.options.linesHiddenIds.indexOf(n.id)>=0)){var e="".concat(Qt.a.capitalize(n.type),"LineLayer");It[e]&&new It[e](t,n).apply()}})),this.ctx.restore())}},{key:"lineWidth",get:function(){return this.courtTypeConstants.LINE_WIDTH}}]),e}(Jy);function Eh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ah=function(t){fc()(e,t);var n=Eh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"apply",value:function(){var t=this;this.playData.players.length&&(this.ctx.save(),this.playData.players.forEach((function(n){if(!(t.options.playersHiddenPositions.findIndex((function(t){return parseInt(t)===parseInt(n.position)}))>=0)){var e=n.location,r=e.x,i=e.y;if(t.setPlayerPuckStyle(n),t.drawPlayerPuck(n),t.setPlayerLabel(n),t.staticData.playerHats&&t.staticData.playerHats.length){var u=t.options.playersMap.find((function(t){return t.position===n.position})),o=t.staticData.playerHats.find((function(t){return!!(null==u?void 0:u.playerHatKey)&&t.key===u.playerHatKey}));if(o){!0===o.reverse&&(t.ctx.save(),t.ctx.translate(2*r,0),t.ctx.scale(-1,1));var M=o.dX,c=o.dY;t.ctx.drawImage(o.image,r-(2-4*M),i-(1.4+2*t.radius+2.8*c),4,2.8),!0===o.reverse&&t.ctx.restore()}}}})),this.ctx.restore())}},{key:"setPlayerPuckStyle",value:function(t){var n=t.color,e=n.red,r=n.green,i=n.blue,u=n.alpha,o=0===e&&0===r&&0===i&&1===u,M=this.options.position&&t.position===this.options.position,c=M?0:Math.ceil(255*e),N=M?0:Math.ceil(255*r),a=M?255:Math.ceil(255*i),s="rgba(".concat(c,", ").concat(N,", ").concat(a,", ").concat(u,")");t.isDefender&&!M&&o&&(s="#bb271b"),t.possession&&o&&(s="#ff8000"),this.options.legacyPrintStyle&&(this.ctx.lineWidth=this.courtTypeConstants.LINE_WIDTH),this.ctx.fillStyle=this.options.legacyPrintStyle?"#FFFFFF":s,this.ctx.strokeStyle=this.options.legacyPrintStyle?"#000000":s}},{key:"drawPlayerPuck",value:function(t){var n=t.location,e=n.x,r=n.y,i=this.options.legacyPrintStyle?1.2:1;this.ctx.beginPath(),this.ctx.arc(e,r,i*this.radius,0,2*Math.PI,!0),this.options.legacyPrintStyle&&t.possession&&this.ctx.stroke(),this.ctx.fill()}},{key:"setPlayerLabel",value:function(t){var n=t.location,e=n.x,r=n.y,i=this.options.playersMap.find((function(n){return n.position===t.position}));if(this.staticData.playerHeadshots&&"Headshot"===this.options.labelsOverrideType){var u=this.staticData.playerHeadshots.find((function(t){return t.id===(null==i?void 0:i.teamPlayerId)}));if(this.ctx.save(),this.ctx.translate(e,r),u){this.ctx.save();var o=u.image.width<u.image.height,M=u.image.height<u.image.width,c=o?u.image.height/u.image.width:M?u.image.width/u.image.height:1,N=2*this.radius*(o?u.image.width/u.image.height:1)*c,a=2*this.radius*(M?u.image.height/u.image.width:1)*c,s=0-(M?N/2:this.radius),D=0-(o?a/2:this.radius);this.options.flipPlayerLabels&&this.ctx.rotate(Math.PI),this.ctx.arc(0,0,this.radius,0,2*Math.PI,!0),this.ctx.clip(),this.ctx.drawImage(u.image,s,D,N,a),this.ctx.restore()}if(this.ctx.beginPath(),this.ctx.lineWidth=this.courtTypeConstants.LINE_WIDTH,this.ctx.arc(0,0,this.radius,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.restore(),u)return}var T=t.textLabel;if(i&&(i.textOverride&&(T=i.textOverride),i.teamPlayerId&&this.options.labelsOverrideType)){var g=this.staticData.teamPlayers.find((function(t){return t.id===i.teamPlayerId}));if(g){var l=g.User_Name.split(" ").map((function(t){return t[0]})).join("").slice(0,2);T=g.Initials||l,"Jersey number"===this.options.labelsOverrideType&&g.jersey_number&&(T="".concat(g.jersey_number))}}var I=t.color.alpha,y=(3-.5*T.length)*(this.options.legacyPrintStyle?1.3:1)*this.playerScale,h=(1-.15*T.length)*(this.options.legacyPrintStyle?1.4:1)*this.playerScale;if(I){this.ctx.fillStyle=this.options.legacyPrintStyle?"#000000":"#ffffff",this.ctx.textAlign="center",this.ctx.font="".concat(y,"px Helvetica"),this.options.mirror&&(this.ctx.save(),this.ctx.translate(2*e,0),this.ctx.scale(-1,1));var j=e,x=r;this.options.flipPlayerLabels&&(j=0,x=0,this.ctx.save(),this.ctx.translate(e,r),this.ctx.rotate(Math.PI)),this.ctx.fillText(T,j,x+h),this.options.flipPlayerLabels&&this.ctx.restore(),this.options.mirror&&this.ctx.restore()}}},{key:"staticData",get:function(){return this.options.staticData}},{key:"playerScale",get:function(){return this.courtTypeConstants.PLAYER_TOKEN_SCALE*this.options.playerTokenScale}},{key:"radius",get:function(){return this.courtTypeConstants.PLAYER_TOKEN_RADIUS*this.playerScale}}]),e}(Jy);function fh(t,n){var e=t.hideForStatic&&!n.inDrawingState?0:1;n.animationGlobalProgress&&(e=0,t.animations.map((function(t){var n=le()(t.keyTimes,2);return[n[0],n[1]]})).forEach((function(t){var r=le()(t,2),i=r[0],u=r[1],o=i-.03,M=i,c=u,N=u+.03;Qt.a.inRange(n.animationGlobalProgress,o,M)&&(e=10*(.03-(M-n.animationGlobalProgress))),Qt.a.inRange(n.animationGlobalProgress,i,u)&&(e=1),Qt.a.inRange(n.animationGlobalProgress,c,N)&&(e=10*(N-n.animationGlobalProgress))})));return e}function ph(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Uh=function(t){fc()(e,t);var n=ph(e);function e(t,r){var i;return At()(this,e),i=n.call(this,t),dt()(_y()(i),"shape",void 0),dt()(_y()(i),"animationAlpha",void 0),i.shape=r,i.animationAlpha=fh(r,t.options),i}return pt()(e,[{key:"drawLogic",value:function(){var t=this.shape,n=t.location,e=t.scale,r=t.angleRad;this.ctx.translate(n.x,n.y),this.ctx.rotate(r),this.ctx.scale(e.x,e.y),this.setLineWidth(),this.setColor(),this.drawShape(),this.drawShapeWrapPoints()}},{key:"setLineWidth",value:function(){this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH}},{key:"setColor",value:function(){var t=this.shape.color,n=t.alpha,e=t.blue,r=t.green,i=t.red,u=Math.ceil(255*i),o=Math.ceil(255*r),M=Math.ceil(255*e);this.ctx.fillStyle="rgba(".concat(u,", ").concat(o,", ").concat(M,", ").concat(n*this.animationAlpha,")"),this.ctx.strokeStyle="rgba(".concat(u,", ").concat(o,", ").concat(M,", ").concat(n?this.animationAlpha:0,")")}},{key:"drawShapeWrapPoints",value:function(){}},{key:"drawShape",value:function(){this.ctx.save(),this.drawShapeLogic(),this.drawShapeBorder(),this.ctx.restore()}},{key:"drawShapeBorder",value:function(){this.shape.showBorder&&this.ctx.stroke()}},{key:"drawShapeLogic",value:function(){}},{key:"staticData",get:function(){return this.options.staticData}}]),e}(pc);function dh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ch=function(t){fc()(e,t);var n=dh(e);function e(t,r){return At()(this,e),n.call(this,t,r)}return pt()(e,[{key:"drawLineFromControlPoints",value:function(){}},{key:"drawArrowLineCap",value:function(t){}},{key:"handOffLineCap",value:function(t){}},{key:"drawPerpendicularLineCap",value:function(){}},{key:"angleBetweenLastTwoPoints",value:function(){return 0}}]),pt()(e,[{key:"setLineWidth",value:function(){this.ctx.lineWidth=this.courtTypeConstants.LINE_WIDTH}},{key:"getProcessedLinePaths",value:function(){return[this.shape.linePart]}},{key:"drawShapeLogic",value:function(){this.drawLine(),this.drawLineCap()}},{key:"drawLine",value:function(){}},{key:"drawLineCap",value:function(){}}]),e}(Uh);function Qh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}Object.assign(Ch.prototype,$y);var wh=function(t){fc()(e,t);var n=Qh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}}]),e}(Ch);function Lh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Sh=function(t){fc()(e,t);var n=Lh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"convertLinePartsToDribble",value:function(t){return[]}},{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}},{key:"getProcessedLinePaths",value:function(){return this.convertLinePartsToDribble(je()(this.shape.linePart?[this.shape.linePart]:[]))}}]),e}(Ch);function kh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}Object.assign(Sh.prototype,ch);var vh=function(t){fc()(e,t);var n=kh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.handOffLineCap(this.getProcessedLinePaths())}}]),e}(Ch);function Yh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var mh=function(t){fc()(e,t);var n=Yh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}},{key:"setLineOptions",value:function(){this.ctx.setLineDash([1,.5])}}]),e}(Ch);function Rh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Fh=function(t){fc()(e,t);var n=Rh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawPerpendicularLineCap()}}]),e}(Ch);function bh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Zh=function(t){fc()(e,t);var n=bh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.outerCircleRadius;this.ctx.beginPath(),this.ctx.arc(0,0,t,0,2*Math.PI),this.ctx.fill()}}]),e}(Uh);function Bh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Vh=function(t){fc()(e,t);var n=Bh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape,n=t.color,e=t.outerCircleRadius;if(0!==n.alpha&&this.staticData.shapes&&this.staticData.shapes.length){var r=this.staticData.shapes.find((function(t){return"cone"===t.key}));r&&(this.ctx.globalAlpha=this.animationAlpha,this.ctx.drawImage(r.image,-e/2,-e/2,e,e))}}}]),e}(Uh);function Wh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Gh=function(t){fc()(e,t);var n=Wh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.rotate(Math.PI),this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(Uh);function Ph(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Jh=function(t){fc()(e,t);var n=Ph(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.outerCircleRadius;this.ctx.beginPath(),this.ctx.rect(-t/2,-t/2,t,t),this.ctx.fill()}}]),e}(Uh);function Hh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Kh=function(t){fc()(e,t);var n=Hh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[3].x,t[3].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(Uh);function Xh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var qh=function(t){fc()(e,t);var n=Xh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(Uh);function _h(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var $h=function(t){fc()(e,t);var n=_h(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[0].x+1,t[0].y),this.ctx.lineTo(0,-1),this.ctx.lineTo(t[1].x-1,t[1].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(1,0),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[2].x-1,t[2].y),this.ctx.lineTo(0,1),this.ctx.lineTo(t[3].x+1,t[2].y),this.ctx.lineTo(t[3].x,t[3].y),this.ctx.lineTo(-1,0),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(Uh);function tj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var nj=function(t){fc()(e,t);var n=tj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.playData.shapes.forEach((function(n){var e=n.type.match("LINE.")?"".concat(Qt.a.capitalize(n.type.replace("LINE.","")),"Line"):Qt.a.capitalize(n.type),r="".concat(e,"ShapeLayer");yt[r]&&new yt[r](t,n).apply()})),this.ctx.restore()}}]),e}(Jy),ej=function(){function t(n){At()(this,t),dt()(this,"originalData",void 0),dt()(this,"adjustedData",void 0),this.originalData=JSON.parse(JSON.stringify(n)),this.adjustedData=JSON.parse(JSON.stringify(n))}return pt()(t,[{key:"_getAttrOriginal",value:function(t){return this.originalData[t]}},{key:"_getAttr",value:function(t){return this.adjustedData[t]}},{key:"_setAttr",value:function(t,n){this.adjustedData[t]=n}}]),t}();function rj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ij={red:.502,green:.502,blue:.502,alpha:.35},uj=function(t){fc()(e,t);var n=rj(e);function e(t){var r;return At()(this,e),r=n.call(this,t),dt()(_y()(r),"internalCanvas",void 0),r.internalCanvas=document.createElement("canvas"),r}return pt()(e,[{key:"preProcessedTextForContext",value:function(){var t=this._getLines(),n=t.reduce((function(t,n){return t.width>n.width?t:n})).width;return{lines:t,box:{width:n+2*e.NOTE_WRAP_PADDING,height:t.length*this.lineHeight+2*e.NOTE_WRAP_PADDING}}}},{key:"_getLines",value:function(){this.internalCtx.font=this.fontComputed,this.internalCtx.textBaseline=this.textBaseline;for(var t=e.NOTE_WRAP_MAX_WIDTH-2*e.NOTE_WRAP_PADDING,n=[],r=this.text.split(" ").reduce((function(t,n){if(!n.match(/\n/))return t.push(n),t;for(var e=[],r="",i=0;i<n.length;i++){var u=n[i];"\n"!==u?r+=u:(r.length&&e.push(r),e.push(""),r="")}return r.length&&e.push(r),e.forEach((function(n,r){if(!n)return t.push("\n");t.push(n),e[r+1]&&t.push("\n")})),t}),[]),i=1;r.length>0;){var u=r.slice(0,i),o=this._getLineInfo(u);if(o.width<t&&i<=r.length&&!o.hasLineBreak)i++;else{1!==i&&i--;var M=r.splice(0,i),c=this._getLineInfo(M);n.push(c),i=1;var N=!r.some((function(t){return"\n"!==t}));c.width&&o.hasLineBreak&&!N&&r.splice(0,1)}}return n}},{key:"_getLineInfo",value:function(t){var n=this,e=0,r=!1,i=[];return t.forEach((function(u,o){if("\n"!==u){var M=je()(u.matchAll(/(<player=(\d*)>)/gi)),c={text:u,width:M.length?n.internalCtx.measureText(u.replace(/<player=(\d*)>/,"")).width+2*n.playerTokenRadius:n.internalCtx.measureText(u).width};e+=c.width,o!==t.length-1&&(e+=n.internalCtx.measureText(" ").width),i.push(c)}else r=!0})),{words:i,width:e,hasLineBreak:r}}},{key:"noteWrapperContains",value:function(t){var n=t.x,e=t.y,r=this.preProcessedTextForContext().box,i=this.location,u={x:i.x+r.width,y:i.y},o=u.y+r.height;return i.x<=n&&n<=u.x&&i.y<=e&&e<=o}},{key:"id",get:function(){return this._getAttr("id")}},{key:"text",get:function(){return this._getAttr("text")}},{key:"location",get:function(){return this._getAttr("location")}},{key:"color",get:function(){return this._getAttr("color")||ij}},{key:"showBorder",get:function(){return this._getAttr("showBorder")}},{key:"animations",get:function(){return this._getAttr("animations")||[]}},{key:"hideForStatic",get:function(){return this._getAttr("hideForStatic")}},{key:"font",get:function(){return this._getAttr("font")||{bold:!1,italic:!1,underline:!1,strikethrough:!1,fontSize:12}}},{key:"fontSize",get:function(){return this.font.fontSize/10}},{key:"lineHeight",get:function(){return this.fontSize+this.lineHeightOffset}},{key:"lineHeightOffset",get:function(){return.3*this.fontSize}},{key:"baseLineOffset",get:function(){return.1*this.fontSize}},{key:"playerTokenRadius",get:function(){return this.fontSize/2}},{key:"fontComputed",get:function(){var t=[];return this.font.bold&&t.push("bold"),this.font.italic&&t.push("italic"),t.push("".concat(this.fontSize,"px")),t.push("Arial"),t.join(" ")}},{key:"textBaseline",get:function(){return"alphabetic"}},{key:"internalCtx",get:function(){return this.internalCanvas.getContext("2d")}}],[{key:"NOTE_WRAP_MAX_WIDTH",get:function(){return 40}},{key:"NOTE_WRAP_PADDING",get:function(){return.43}}]),e}(ej);function oj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Mj=function(t){fc()(e,t);var n=oj(e);function e(){var t;At()(this,e);for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];return t=n.call.apply(n,[this].concat(i)),dt()(_y()(t),"animationAlpha",void 0),t}return pt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.disableMirrorMode(),this.playData.notes.forEach((function(n){t.ctx.save(),t.animationAlpha=fh(n,t.options),t.setColor(n);var e=n.location;t.ctx.translate(e.x,e.y);var r=n.preProcessedTextForContext(),i=r.lines,u=r.box;t.setFont(n),t.drawBubble(n,u),t.drawText(n,i),t.ctx.restore()})),this.ctx.restore()}},{key:"setColor",value:function(t){if(void 0===this.animationAlpha)throw new Error("animationAlpha is not set");var n=t.color,e=n.alpha,r=n.blue,i=n.green,u=n.red,o=Math.ceil(255*u),M=Math.ceil(255*i),c=Math.ceil(255*r);this.ctx.fillStyle="rgba(".concat(o,", ").concat(M,", ").concat(c,", ").concat(e*this.animationAlpha,")"),this.ctx.strokeStyle="rgba(".concat(o,", ").concat(M,", ").concat(c,", ").concat(this.animationAlpha,")"),this.options.noteSelectedId===t.id&&(this.ctx.setLineDash([.5,.5]),this.ctx.strokeStyle="rgba(28, 127, 181, ".concat(this.animationAlpha,")"))}},{key:"setFont",value:function(t){this.ctx.font=t.fontComputed,this.ctx.textBaseline=t.textBaseline}},{key:"drawBubble",value:function(t,n){var e=n.width,r=n.height;this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.rect(0,0,e,r),this.ctx.fill(),(t.showBorder||this.options.noteSelectedId===t.id)&&this.ctx.stroke()}},{key:"drawText",value:function(t,n){var e=this;n.forEach((function(n,r){var i=n.words;e.ctx.save(),e.ctx.translate(uj.NOTE_WRAP_PADDING,t.fontSize+uj.NOTE_WRAP_PADDING+t.lineHeight*r);var u=0;i.forEach((function(n,r){var o=je()(n.text.matchAll(/(<player=(\d*)>)/gi));o.length&&0===o[0].index&&(e.drawPlayerToken(t,u,o[0][2]),u+=2*t.playerTokenRadius),e.ctx.fillStyle="rgba(0, 0, 0, ".concat(e.animationAlpha,")");var M=o.length?n.text.replace(/(<player=(\d*)>)/gi,""):n.text;e.ctx.fillText(M,u,-t.baseLineOffset),u+=n.width,o.length&&(u-=2*t.playerTokenRadius),o.length&&o[0].index>0&&(e.drawPlayerToken(t,u,o[0][2]),u+=2*t.playerTokenRadius),r!==i.length-1&&(e.ctx.fillText(" ",u,-t.baseLineOffset),u+=e.ctx.measureText(" ").width)})),(t.font.underline||t.font.strikethrough)&&(e.ctx.lineWidth=.07*t.fontSize,e.ctx.strokeStyle="rgba(0, 0, 0, ".concat(e.animationAlpha,")"),e.ctx.beginPath(),t.font.underline&&(e.ctx.moveTo(0,t.baseLineOffset),e.ctx.lineTo(u,t.baseLineOffset)),t.font.strikethrough&&(e.ctx.moveTo(0,-t.fontSize/2+t.baseLineOffset),e.ctx.lineTo(u,-t.fontSize/2+t.baseLineOffset)),e.ctx.stroke()),e.ctx.restore()}))}},{key:"drawPlayerToken",value:function(t,n,e){this.ctx.save(),this.ctx.translate(n+t.playerTokenRadius,0),this.ctx.beginPath(),this.ctx.strokeStyle="rgba(255, 255, 255, ".concat(this.animationAlpha,")"),this.ctx.fillStyle="rgba(243, 111, 33, ".concat(this.animationAlpha,")"),this.ctx.arc(0,-t.fontSize/2,t.playerTokenRadius,0,2*Math.PI),this.ctx.fill(),this.ctx.stroke();var r=.8*t.fontSize;this.ctx.font="".concat(r,"px Arial");var i=-this.ctx.measureText(e).width/2,u=-r/4;this.ctx.fillStyle="rgba(255, 255, 255, ".concat(this.animationAlpha,")"),this.ctx.fillText(e,i,u),this.ctx.restore()}},{key:"scale",value:function(t){return t/this.options.scale}}]),e}(Jy);function cj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Nj=function(t){fc()(e,t);var n=cj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"apply",value:function(){var t=this;"HIDDEN"!==this.options.linesDisplay&&("START_HIDDEN"!==this.options.linesDisplay||this.options.animationGlobalProgress)&&(this.ctx.save(),this.playData.lines.forEach((function(n){t.options.linesSelectedIds.includes(n.id)&&n.baseLineParts().forEach((function(n){t.ctx.save(),t.ctx.fillStyle="blue",n.controlPoints.forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,.4,0,2*Math.PI,!0),t.ctx.fill()})),t.ctx.restore()}))})),this.ctx.restore())}}]),e}(Jy);function aj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var sj=function(t){fc()(e,t);var n=aj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.ctx.fillStyle="blue",this.playData.shapes.forEach((function(n){var e=n.id,r=n.color,i=n.controlPointsTranslated;t.options.shapeSelectedId===e&&0!==r.alpha&&i.forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,.4,0,2*Math.PI,!0),t.ctx.fill()}))})),this.ctx.restore()}}]),e}(Jy);function Dj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Tj=function(t){fc()(e,t);var n=Dj(e);function e(t){var r;return At()(this,e),r=n.call(this,t),dt()(_y()(r),"lineParts",void 0),dt()(_y()(r),"linePartsAdjusted",void 0),r.lineParts=t.lineParts,r.linePartsAdjusted=je()(t.lineParts),r}return pt()(e,[{key:"baseLineParts",value:function(){return this.lineParts}},{key:"setLinePartsAdjusted",value:function(t){this.linePartsAdjusted=t}},{key:"setLinePartsAdjustedAtIndex",value:function(t,n){switch(t){case"fist":this.linePartsAdjusted[0]=n;break;case"last":this.linePartsAdjusted[this.linePartsAdjusted.length-1]=n;break;default:this.linePartsAdjusted[t]=n}}},{key:"setAnimationKeyTimesChunked",value:function(t){var n=this,e=[];if(this.animations[0].keyTimes.forEach((function(t,r){r&&e.push([n.animations[0].keyTimes[r-1],t])})),e.length!==this.getLineParts().length){var r=e,i=le()(r,1),u=le()(i[0],2),o=u[0],M=u[1],c=le()(t.animations,1)[0],N=c.keyTimes.indexOf(o),a=c.keyTimes.indexOf(M);if(N>=0&&a>=0){var s=c.keyTimes.slice(N,a+1);e=[],s.forEach((function(t,n){n&&e.push([s[n-1],t])}))}}this.animationKeyTimeChunks=e}},{key:"addLinePartAdjusted",value:function(t){this.linePartsAdjusted.push(t)}},{key:"getLineParts",value:function(){return this.linePartsAdjusted.length?this.linePartsAdjusted:this.lineParts}},{key:"id",get:function(){return this._getAttr("id")}},{key:"color",get:function(){return this._getAttr("color")},set:function(t){this._setAttr("color",t)}},{key:"type",get:function(){return this._getAttr("type")}},{key:"phase",get:function(){return this._getAttr("phase")}},{key:"playerPositionOrigin",get:function(){return this._getAttr("playerPositionOrigin")}},{key:"playerPositionTerminus",get:function(){return this._getAttr("playerPositionTerminus")}},{key:"playerLineSequence",get:function(){return this._getAttr("playerLineSequence")}},{key:"hideLineTip",get:function(){return this._getAttr("hideLineTip")}},{key:"animations",get:function(){return this._getAttr("animations")}},{key:"animationsByEndTime",get:function(){return this._getAttr("animations").map((function(t){return Qt.a.last(t.keyTimes)}))}},{key:"animationKeyTimeChunks",get:function(){return this._getAttr("animationKeyTimeChunks")||[]},set:function(t){this._setAttr("animationKeyTimeChunks",t)}},{key:"lastAnimEndTime",get:function(){return Qt.a.max(this.animationsByEndTime)}},{key:"firstLinePartControlPoint",get:function(){return this.lineParts[0].controlPoints[0]}},{key:"lastLinePartControlPoint",get:function(){return je()(je()(this.lineParts).pop().controlPoints).pop()}}]),e}(ej);function gj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var lj=function(t){fc()(e,t);var n=gj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"setPossession",value:function(t){var n=this;if(t.length){var e=this.possession?1:0;e+=t.filter((function(t){return t.playerPositionTerminus===n.position})).length,e-=t.filter((function(t){return t.playerPositionOrigin===n.position})).length,this.possession=e>0}}},{key:"id",get:function(){return this._getAttr("id")}},{key:"textOverride",get:function(){return this._getAttr("textOverride")},set:function(t){this._setAttr("textOverride",t)}},{key:"textLabel",get:function(){return this._getAttr("textOverride")||this.position}},{key:"isDefender",get:function(){return this.position.indexOf("x")>=0}},{key:"possession",get:function(){return this._getAttr("possession")},set:function(t){this._setAttr("possession",t)}},{key:"position",get:function(){return this._getAttr("position")}},{key:"location",get:function(){return this._getAttr("location")},set:function(t){this._setAttr("location",t)}},{key:"color",get:function(){return this._getAttr("color")}},{key:"animations",get:function(){return this._getAttr("animations")}},{key:"animationsByEndTime",get:function(){return this._getAttr("animations").map((function(t){return Qt.a.last(t.keyTimes)}))}},{key:"lastAnimEndTime",get:function(){return Qt.a.max(this.animationsByEndTime)}},{key:"lastAnimation",get:function(){return je()(this.animations).pop()}},{key:"lastAnimationLastLinePartControlPoint",get:function(){return je()(je()(this.lastAnimation.lineParts).pop().controlPoints).pop()}}]),e}(ej);function Ij(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var yj=function(t){fc()(e,t);var n=Ij(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"rectWrapperContains",value:function(t){var n=le()(this.rectWrapPointsTranslated,4),e=n[0],r=n[1],i=n[2],u=n[3];return+[[e,t,r],[r,t,i],[i,t,u],[u,t,e]].reduce((function(t,n){var e=le()(n,3),r=e[0],i=e[1],u=e[2];return t+Math.abs(i.x*r.y-r.x*i.y+(u.x*i.y-i.x*u.y)+(r.x*u.y-u.x*r.y))/2}),0).toFixed(2)<=this.rectWrapAreaTranslated}},{key:"computeCenterForRect",value:function(t){var n=le()(t,4),e=n[0],r=n[1],i=n[2],u=n[3];return{x:(e.x+i.x)/2,y:(r.y+u.y)/2}}},{key:"computeShapeAreaForPointAtIndex",value:function(t,n){var e=le()(this.rectWrapPointsTranslated,3),r=e[0],i=e[1],u=e[2],o=this.computeRectWrapPointsTranslatedForPointAtIndex(t,n),M=le()(o,4),c=M[0],N=M[1],a=M[2],s=M[3];return{scale:{x:Tc(c,N)*this.scale.x/Tc(r,i),y:Tc(N,a)*this.scale.y/Tc(i,u)},location:this.computeCenterForRect([c,N,a,s])}}},{key:"computeRectWrapPointsTranslatedForPointAtIndex",value:function(t,n){var e=this,r=Lt(t.x,t.y,this.location.x,this.location.y,-this.angle),i=this.rectWrapPointsTranslated.map((function(t){return Lt(t.x,t.y,e.location.x,e.location.y,-e.angle)})).map((function(t,e){return n===e?r:t}));return 0===n&&(i[1].y=r.y,i[3].x=r.x),1===n&&(i[0].y=r.y,i[2].x=r.x),2===n&&(i[1].x=r.x,i[3].y=r.y),3===n&&(i[0].x=r.x,i[2].y=r.y),i.map((function(t){return Lt(t.x,t.y,e.location.x,e.location.y,e.angle)}))}},{key:"revertPointTranslation",value:function(t){var n={x:t.x-this.location.x,y:t.y-this.location.y};return Lt(n.x,n.y,0,0,-this.angle)}},{key:"id",get:function(){return this._getAttr("id")}},{key:"location",get:function(){return this._getAttr("location")}},{key:"scale",get:function(){return this._getAttr("scale")}},{key:"angle",get:function(){return this._getAttr("angle")||0}},{key:"angleRad",get:function(){return this.angle*Math.PI/180}},{key:"color",get:function(){return this._getAttr("color")}},{key:"type",get:function(){return this._getAttr("type")}},{key:"showBorder",get:function(){return this._getAttr("showBorder")}},{key:"outerCircleRadius",get:function(){return 10}},{key:"linePart",get:function(){return this._getAttr("linePart")}},{key:"animations",get:function(){return this._getAttr("animations")||[]}},{key:"hideForStatic",get:function(){return this._getAttr("hideForStatic")}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius/2,y:-this.outerCircleRadius/2},{x:this.outerCircleRadius/2,y:-this.outerCircleRadius/2},{x:this.outerCircleRadius/2,y:this.outerCircleRadius/2},{x:-this.outerCircleRadius/2,y:this.outerCircleRadius/2}]}},{key:"rectWrapPointsTranslated",get:function(){var t=this;return this.rectWrapPointsPure.map((function(n){var e={x:n.x*t.scale.x,y:n.y*t.scale.y},r=Lt(e.x,e.y,0,0,t.angle);return{x:r.x+t.location.x,y:r.y+t.location.y}}))}},{key:"controlPointsTranslated",get:function(){return this.rectWrapPointsTranslated}},{key:"rectWrapAreaTranslated",get:function(){var t=le()(this.rectWrapPointsTranslated,3),n=t[0],e=t[1],r=t[2];return+(Tc(n,e)*Tc(e,r)).toFixed(2)}}]),e}(ej);function hj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var jj=function(t){fc()(e,t);var n=hj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"rectWrapPointsPure",get:function(){return jc(this.linePart.controlPoints)}},{key:"controlPointsTranslated",get:function(){var t=this;return this.linePart.controlPoints.map((function(n){var e={x:n.x*t.scale.x,y:n.y*t.scale.y},r=Lt(e.x,e.y,0,0,t.angle);return{x:r.x+t.location.x,y:r.y+t.location.y}}))}},{key:"shapeControlPoints",get:function(){return[]}}]),e}(yj);function xj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var zj=function(t){fc()(e,t);var n=xj(e);function e(){return At()(this,e),n.apply(this,arguments)}return e}(jj);function Oj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ej=function(t){fc()(e,t);var n=Oj(e);function e(){return At()(this,e),n.apply(this,arguments)}return e}(jj);function Aj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var fj=function(t){fc()(e,t);var n=Aj(e);function e(){return At()(this,e),n.apply(this,arguments)}return e}(jj);function pj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Uj=function(t){fc()(e,t);var n=pj(e);function e(){return At()(this,e),n.apply(this,arguments)}return e}(jj);function dj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Cj=function(t){fc()(e,t);var n=dj(e);function e(){return At()(this,e),n.apply(this,arguments)}return e}(jj);function Qj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var wj=function(t){fc()(e,t);var n=Qj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"outerCircleRadius",get:function(){return 5}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:this.outerCircleRadius},{x:-this.outerCircleRadius,y:this.outerCircleRadius}]}},{key:"shapeControlPoints",get:function(){return[]}}]),e}(yj);function Lj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Sj=function(t){fc()(e,t);var n=Lj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"outerCircleRadius",get:function(){return 5}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(yj);function kj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var vj=function(t){fc()(e,t);var n=kj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"outerCircleRadius",get:function(){return 8}},{key:"shapeControlPoints",get:function(){return[{x:0,y:-this.outerCircleRadius},{x:-this.outerCircleRadius*Math.cos(220)/2,y:this.outerCircleRadius*Math.sin(240)},{x:this.outerCircleRadius*Math.cos(220)/2,y:this.outerCircleRadius*Math.sin(240)}]}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:this.outerCircleRadius},{x:-this.outerCircleRadius,y:this.outerCircleRadius}]}}]),e}(yj);function Yj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var mj=function(t){fc()(e,t);var n=Yj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(yj);function Rj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Fj=function(t){fc()(e,t);var n=Rj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-.5},{x:this.outerCircleRadius,y:-.5},{x:this.outerCircleRadius,y:.5},{x:-this.outerCircleRadius,y:.5}]}}]),e}(yj);function bj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Zj=function(t){fc()(e,t);var n=bj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return[{x:0,y:-this.outerCircleRadius},{x:this.outerCircleRadius*Math.cos(210),y:this.outerCircleRadius*Math.sin(210)},{x:-this.outerCircleRadius*Math.cos(210),y:this.outerCircleRadius*Math.sin(210)}]}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:this.outerCircleRadius},{x:-this.outerCircleRadius,y:this.outerCircleRadius}]}}]),e}(yj);function Bj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Vj=function(t){fc()(e,t);var n=Bj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(yj);function Wj(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function Gj(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Wj(Object(e),!0).forEach((function(n){dt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Wj(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}var Pj=function(){function t(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;At()(this,t),this.play=n,this.phase=e,this.animationGlobalProgress=r,dt()(this,"ctx",void 0),dt()(this,"animationGlobalProgressPrev",void 0),this.animationGlobalProgressPrev=r,this.ctx=null}return pt()(t,[{key:"draw",value:function(){if(!this.ctx)throw new Error("Canvas context is not provided. Please use setContext() method.");this.ctx.clearRect(0,0,this.frameWidth,this.frameHeight),this._init();var t=this.frameData,n=this.frameDataOptions;return new Xy(this.ctx,t,n).apply(),new nj(this.ctx,t,n).apply(),new Oh(this.ctx,t,n).apply(),new Ah(this.ctx,t,n).apply(),new Nj(this.ctx,t,n).apply(),new sj(this.ctx,t,n).apply(),new Mj(this.ctx,t,n).apply(),this}},{key:"_init",value:function(){if(!this.ctx)throw new Error("Canvas context is not provided. Please use setContext() method.");this.ctx.canvas.width=this.frameWidth,this.ctx.canvas.height=this.frameHeight,this.ctx.scale(this.play.scale,this.play.scale),this.ctx.translate(-this.court.courtRect.origin.x,-this.court.courtRect.origin.y),this.play.options.mirror&&(this.ctx.scale(-1,1),this.ctx.translate(2*Math.abs(this.court.courtRect.origin.x)-this.court.courtRect.size.width,0))}},{key:"setContext",value:function(t){return this.ctx=t,this}},{key:"setPhase",value:function(t){return this.phase=t,this}},{key:"setAnimationGlobalProgress",value:function(t){return this.animationGlobalProgressPrev=this.animationGlobalProgress,this.animationGlobalProgress=t,this}},{key:"animationProgress",value:function(t,n){return wt(this.animationGlobalProgress,t,n)}},{key:"closestObjectToPoint",value:function(t,n){var e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0,i=e?this.convertViewPointToCourtPoint(t):t;return"player"===n?this.closestPlayerToPoint(i,r):"shape"===n?this.closestShapeToPoint(i):"note"===n?this.closestNoteToPoint(i):"line"===n?this.closestLineToPoint(i,r):"lineVertex"===n?this.closestLineVertexToPoint(i,r):null}},{key:"closestLineToPoint",value:function(t,n){var e=this,r=this.lines.filter((function(t){return!n||n(t)})).reduce((function(n,r){return r.lineParts.forEach((function(i){for(var u=ye()(xe,je()(i.controlPoints)),o=1;o<=100;o++){var M=o/100,c=e.prepareCourtPoint({x:u.x(M),y:u.y(M)});n.push({object:r,objectPoint:c,distance:Tc(c,t)})}})),n}),[]);return Qt.a.minBy(r,"distance")}},{key:"closestLineVertexToPoint",value:function(t,n){var e=this,r=this.lines.filter((function(t){return!n||n(t)})).reduce((function(n,r){if(!r.id.length)return n;var i=e.prepareCourtPoint(r.firstLinePartControlPoint),u=e.prepareCourtPoint(r.lastLinePartControlPoint);return n.push({object:r,objectPoint:i,distance:Tc(i,t)}),n.push({object:r,objectPoint:u,distance:Tc(u,t)}),n}),[]);return Qt.a.minBy(r,"distance")}},{key:"closestPlayerToPoint",value:function(t,n){var e=this,r=this.players.filter((function(t){return!n||n(t)})).reduce((function(n,r){var i=e.prepareCourtPoint(r.location);return n.push({object:r,objectPoint:i,distance:Tc(i,t)}),n}),[]);return Qt.a.minBy(r,"distance")}},{key:"closestShapeToPoint",value:function(t){var n=this,e=this.shapes.filter((function(n){return n.rectWrapperContains(t)})).reduce((function(e,r){var i=n.prepareCourtPoint(r.location);return e.push({object:r,objectPoint:i,distance:Tc(i,t)}),e}),[]);return Qt.a.minBy(e,"distance")}},{key:"closestNoteToPoint",value:function(t){var n=this,e=this.notes.filter((function(n){return n.noteWrapperContains(t)})).reduce((function(e,r){var i=n.prepareCourtPoint(r.location);return e.push({object:r,objectPoint:i,distance:Tc(i,t)}),e}),[]);return e.length?Qt.a.minBy(e,"distance"):null}},{key:"prepareCourtPoint",value:function(t){var n=this.play.options.mirror,e=this.play.playData.court.courtRect.size.width,r=this.play.playData.court.courtRect.origin;return{x:n?e+r.x-(t.x-r.x):t.x,y:t.y}}},{key:"convertViewPointToCourtPoint",value:function(t){var n=this.play.playData.court.courtRect.origin,e=n.x,r=n.y;return{x:t.x/this.play.scale+e,y:t.y/this.play.scale+r}}},{key:"sport",get:function(){var t=this.play.playData,n=t.court,e=t.sport;return e||([dn,Un].includes(n.type)?Dn:an)}},{key:"court",get:function(){var t=this.play.playData.court;return Gj({},t,{type:t.type===dn?Un:t.type})}},{key:"frameWidth",get:function(){return this.play.width}},{key:"frameHeight",get:function(){return this.play.height}},{key:"frameData",get:function(){return{sport:this.sport,court:this.court,lines:this.lines,players:this.players,shapes:this.shapes,notes:this.notes}}},{key:"frameDataOptions",get:function(){return Gj({},this.play.options,{staticData:this.play.staticData,scale:this.play.scale,animationGlobalProgress:this.animationGlobalProgress,playAnimationDuration:this.playAnimationDuration})}},{key:"playAnimationDuration",get:function(){return this.play.playData.lines.reduce((function(t,n){var e=new Tj(n).lastAnimEndTime;return t>e?t:e}),0)}},{key:"lines",get:function(){return this.animationGlobalProgress?this.animationProgressLines:this.currentPhaseLines}},{key:"players",get:function(){return this.animationGlobalProgress?this.animationProgressPlayers:this.currentPhasePlayers}},{key:"shapes",get:function(){return this.play.playData.shapes?this.play.playData.shapes.filter((function(t){return void 0!==ht[St(t.type)]})).map((function(t){return new(ht[St(t.type)])(t)})):[]}},{key:"notes",get:function(){return this.play.playData.notes?this.play.playData.notes.filter((function(t){return!t.displayModes||t.displayModes.includes("onCourt")})).map((function(t){return new uj(t)})):[]}},{key:"currentPhasePlayers",get:function(){var t=this,n=this.currentPhaseLines,e=this.play.options,r=e.huddleMode,i=e.magnetMode,u=r||i?this.playDataLines:this.prevPhaseLines,o=u.filter((function(t){return["PASS","HANDOFF"].includes(t.type)}));return this.play.playData.players.map((function(e){var M=new lj(e);M.setPossession(o);var c=u.filter((function(e){return!r||!(t.phase<e.phase)&&!n.find((function(t){return t.id===e.id}))})).filter((function(t){return t.playerPositionOrigin===M.position&&t.playerPositionTerminus===M.position})),N=n.filter((function(t){return i&&t.playerPositionOrigin===M.position&&t.playerPositionTerminus===M.position})),a=N.length?N:c;if(a.length){var s=Qt.a.maxBy(a,(function(t){return t.lastAnimEndTime}));if(s){var D=s.lastLinePartControlPoint;D&&(M.location=D)}}return M}))}},{key:"currentPhaseLines",get:function(){var t=this,n=this.play.playData.lines.filter((function(n){return n.phase===t.phase}));return this.play.options.huddleMode&&(n=Qt.a.takeRight(n,2)),n.map((function(t){return new Tj(t)}))}},{key:"animationProgressPlayers",get:function(){var t=this,n=this.prevAnimationLines.filter((function(t){return["PASS","HANDOFF","SHOT"].includes(t.type)}));return this.play.playData.players.map((function(e){var r=new lj(e);return r.setPossession(n),r.animations.length?(r.animations.forEach((function(n){var e=[];n.keyTimes.forEach((function(t,r){r&&e.push([n.keyTimes[r-1],t])})),e.forEach((function(e,i){var u=le()(e,2),o=u[0],M=u[1];if(Qt.a.inRange(t.animationGlobalProgress,o,M)){var c=t.animationProgress(o,M),N=ye()(xe,je()(n.lineParts[i].controlPoints));r.location={x:N.x(c),y:N.y(c)}}}))})),t.animationGlobalProgress>=r.lastAnimEndTime&&(r.location=r.lastAnimationLastLinePartControlPoint),r):r}))}},{key:"animationProgressLines",get:function(){var t=this,n=this.play.options.linesDisplayOnMoveOnly;return this.play.playData.lines.map((function(n){var e=new Tj(n);e.setAnimationKeyTimesChunked(t.play.playData.players.find((function(t){return t.position===e.playerPositionOrigin})));var r=[];return e.animationKeyTimeChunks.forEach((function(n,i){var u=le()(n,2),o=u[0],M=u[1];if(t.animationGlobalProgressPrev<M&&t.animationGlobalProgress>=M&&window.dispatchEvent(new CustomEvent("@luceosports/play-rendering:lineAnimationFinished",{detail:{id:e.id}})),Qt.a.inRange(t.animationGlobalProgress,o,M)){if("DRIBBLE"===e.type)return r.push(Gj({},e.getLineParts()[i]));var c=gc(e.getLineParts()[i].controlPoints,t.animationProgress(o,M));r.push({controlPoints:c[0],alpha:.1}),r.push({controlPoints:c[1],alpha:e.color.alpha})}else t.animationGlobalProgress>M?r.push(Gj({},e.getLineParts()[i],{alpha:.1})):r.push(Gj({},e.getLineParts()[i]))})),e.setLinePartsAdjusted(r),t.animationGlobalProgress>e.lastAnimEndTime&&(e.color=Gj({},e.color,{alpha:.1})),e})).filter((function(e){var r=le()(e.animations,1)[0].keyTimes,i=le()(r,1)[0],u=r.reverse(),o=le()(u,1)[0],M=Qt.a.inRange(t.animationGlobalProgress,i,o);return n?M:M||t.animationGlobalProgress>o||e.phase===t.phase}))}},{key:"playDataLines",get:function(){return this.play.playData.lines.map((function(t){return new Tj(t)}))}},{key:"prevPhaseLines",get:function(){var t=this;return this.playDataLines.filter((function(n){return n.phase<t.phase}))}},{key:"prevAnimationLines",get:function(){var t=this;return this.playDataLines.filter((function(n){return t.animationGlobalProgress>=n.lastAnimEndTime}))}}]),t}(),Jj=function(){function t(n,e){At()(this,t),this.ctx=n,dt()(this,"play",void 0),dt()(this,"playBase",void 0),dt()(this,"animationFrame",void 0),dt()(this,"loopId",void 0),dt()(this,"running",void 0),dt()(this,"framesLoadTime",void 0),dt()(this,"timeStart",void 0),dt()(this,"timeElapsed",void 0),dt()(this,"timeElapsedSaved",void 0),this.play=Qt.a.cloneDeep(e),this.playBase=Qt.a.cloneDeep(e),this.animationFrame=new Pj(this.play,this.currentPlayPhase,this.globalProgress).setContext(this.ctx),this.loopId=null,this.running=!1,this.framesLoadTime=[],this.timeStart=null,this.timeElapsed=0,this.timeElapsedSaved=0}return pt()(t,[{key:"start",value:function(t,n){this.running=!0,this.loopId=requestAnimationFrame(this.drawFrame.bind(this,t,n))}},{key:"pause",value:function(){cancelAnimationFrame(this.loopId),this.running=!1,this.timeStart=null,this.timeElapsedSaved=this.timeElapsed}},{key:"setProgress",value:function(t){var n=this.countTimeElapsedFromProgress(t);return this.timeElapsed=n,this.timeElapsedSaved=n,this.refreshAnimationFrameProgress(),this}},{key:"refreshAnimationFrameProgress",value:function(){this.animationFrame.setPhase(this.currentPlayPhase).setAnimationGlobalProgress(this.globalProgress)}},{key:"drawPreviewFrame",value:function(){new Pj(this.play,this.currentPlayPhase,this.globalProgress).setContext(this.ctx).draw()}},{key:"reset",value:function(){this.timeStart=null,this.timeElapsed=null,this.timeElapsedSaved=null,this.play=Qt.a.cloneDeep(this.playBase)}},{key:"countTimeElapsedFromProgress",value:function(t){return 1e3*this.animationDuration*t}},{key:"drawFrame",value:function(t,n,e){if(this.running){if(this.globalProgress>=this.lastLineAnimationMax)return n(this.lastLineAnimationMax),this.reset(),cancelAnimationFrame(this.loopId),void setTimeout((function(){t()}),1e3);n(this.globalProgress),this.timeStart||(this.timeStart=e);var r=e-this.timeStart+(this.timeElapsedSaved||0)-(this.timeElapsed||0);this.framesLoadTime.push(r),this.timeElapsed=e-this.timeStart+(this.timeElapsedSaved||0),this.animationFrame.setPhase(this.currentPlayPhase).setAnimationGlobalProgress(this.globalProgress).draw(),requestAnimationFrame(this.drawFrame.bind(this,t,n))}}},{key:"animationDuration",get:function(){return this.play.playData.animationDuration/this.play.options.speed}},{key:"globalProgress",get:function(){return 100*(this.timeElapsed||0)/(1e3*this.animationDuration)/100}},{key:"currentPlayPhase",get:function(){var t=this,n=Object.entries(this.linesPhaseIntervals).find((function(n){var e=le()(n,2)[1];return Qt.a.inRange(t.globalProgress,e.min,e.max)}));return parseInt(n?n[0]:Object.keys(this.linesPhaseIntervals).pop())}},{key:"linesPhaseIntervals",get:function(){var t={};return this.play.playData.lines.forEach((function(n){t[n.phase]||(t[n.phase]={min:0,max:0}),n.animations.forEach((function(e){var r=e.keyTimes,i=le()(r,1)[0],u=je()(r).pop();(i<t[n.phase].min||!t[n.phase].min&&n.phase>1)&&(t[n.phase].min=i),u>t[n.phase].max&&(t[n.phase].max=u)}))})),t}},{key:"lastLineAnimationMax",get:function(){return this.play.playData.lines.reduce((function(t,n){var e=new Tj(n);return t>e.lastAnimEndTime?t:e.lastAnimEndTime}),0)}}]),t}()}])}));
|
|
23
|
+
var yr,hr,jr=9e15,xr="0123456789abcdef",zr="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Or="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Er={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-jr,maxE:jr,crypto:!1},Ar=!0,fr="[DecimalError] Invalid argument: ",pr="[object Decimal]",Ur=Math.floor,dr=Math.pow,Cr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Qr=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,wr=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Lr=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Sr=1e7,kr=zr.length-1,vr=Or.length-1,Yr={toStringTag:pr};function mr(t){var n,e,r,i=t.length-1,u="",o=t[0];if(i>0){for(u+=o,n=1;n<i;n++)(e=7-(r=t[n]+"").length)&&(u+=Hr(e)),u+=r;(e=7-(r=(o=t[n])+"").length)&&(u+=Hr(e))}else if(0===o)return"0";for(;o%10==0;)o/=10;return u+o}function Rr(t,n,e){if(t!==~~t||t<n||t>e)throw Error(fr+t)}function Fr(t,n,e,r){var i,u,o,M;for(u=t[0];u>=10;u/=10)--n;return--n<0?(n+=7,i=0):(i=Math.ceil((n+1)/7),n%=7),u=dr(10,7-n),M=t[i]%u|0,null==r?n<3?(0==n?M=M/100|0:1==n&&(M=M/10|0),o=e<4&&99999==M||e>3&&49999==M||5e4==M||0==M):o=(e<4&&M+1==u||e>3&&M+1==u/2)&&(t[i+1]/u/100|0)==dr(10,n-2)-1||(M==u/2||0==M)&&0==(t[i+1]/u/100|0):n<4?(0==n?M=M/1e3|0:1==n?M=M/100|0:2==n&&(M=M/10|0),o=(r||e<4)&&9999==M||!r&&e>3&&4999==M):o=((r||e<4)&&M+1==u||!r&&e>3&&M+1==u/2)&&(t[i+1]/u/1e3|0)==dr(10,n-3)-1,o}function br(t,n,e){for(var r,i,u=[0],o=0,M=t.length;o<M;){for(i=u.length;i--;)u[i]*=n;for(u[0]+=xr.indexOf(t.charAt(o++)),r=0;r<u.length;r++)u[r]>e-1&&(void 0===u[r+1]&&(u[r+1]=0),u[r+1]+=u[r]/e|0,u[r]%=e)}return u.reverse()}Yr.absoluteValue=Yr.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),Br(t)},Yr.ceil=function(){return Br(new this.constructor(this),this.e+1,2)},Yr.clampedTo=Yr.clamp=function(t,n){var e=this,r=e.constructor;if(t=new r(t),n=new r(n),!t.s||!n.s)return new r(NaN);if(t.gt(n))throw Error(fr+n);return e.cmp(t)<0?t:e.cmp(n)>0?n:new r(e)},Yr.comparedTo=Yr.cmp=function(t){var n,e,r,i,u=this,o=u.d,M=(t=new u.constructor(t)).d,c=u.s,N=t.s;if(!o||!M)return c&&N?c!==N?c:o===M?0:!o^c<0?1:-1:NaN;if(!o[0]||!M[0])return o[0]?c:M[0]?-N:0;if(c!==N)return c;if(u.e!==t.e)return u.e>t.e^c<0?1:-1;for(n=0,e=(r=o.length)<(i=M.length)?r:i;n<e;++n)if(o[n]!==M[n])return o[n]>M[n]^c<0?1:-1;return r===i?0:r>i^c<0?1:-1},Yr.cosine=Yr.cos=function(){var t,n,e=this,r=e.constructor;return e.d?e.d[0]?(t=r.precision,n=r.rounding,r.precision=t+Math.max(e.e,e.sd())+7,r.rounding=1,e=function(t,n){var e,r,i;if(n.isZero())return n;(r=n.d.length)<32?(e=Math.ceil(r/3),i=(1/ii(4,e)).toString()):(e=16,i="2.3283064365386962890625e-10");t.precision+=e,n=ri(t,1,n.times(i),new t(1));for(var u=e;u--;){var o=n.times(n);n=o.times(o).minus(o).times(8).plus(1)}return t.precision-=e,n}(r,ui(r,e)),r.precision=t,r.rounding=n,Br(2==hr||3==hr?e.neg():e,t,n,!0)):new r(1):new r(NaN)},Yr.cubeRoot=Yr.cbrt=function(){var t,n,e,r,i,u,o,M,c,N,a=this,s=a.constructor;if(!a.isFinite()||a.isZero())return new s(a);for(Ar=!1,(u=a.s*dr(a.s*a,1/3))&&Math.abs(u)!=1/0?r=new s(u.toString()):(e=mr(a.d),(u=((t=a.e)-e.length+1)%3)&&(e+=1==u||-2==u?"0":"00"),u=dr(e,1/3),t=Ur((t+1)/3)-(t%3==(t<0?-1:2)),(r=new s(e=u==1/0?"5e"+t:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+t)).s=a.s),o=(t=s.precision)+3;;)if(N=(c=(M=r).times(M).times(M)).plus(a),r=Zr(N.plus(a).times(M),N.plus(c),o+2,1),mr(M.d).slice(0,o)===(e=mr(r.d)).slice(0,o)){if("9999"!=(e=e.slice(o-3,o+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(Br(r,t+1,1),n=!r.times(r).times(r).eq(a));break}if(!i&&(Br(M,t+1,0),M.times(M).times(M).eq(a))){r=M;break}o+=4,i=1}return Ar=!0,Br(r,t,s.rounding,n)},Yr.decimalPlaces=Yr.dp=function(){var t,n=this.d,e=NaN;if(n){if(e=7*((t=n.length-1)-Ur(this.e/7)),t=n[t])for(;t%10==0;t/=10)e--;e<0&&(e=0)}return e},Yr.dividedBy=Yr.div=function(t){return Zr(this,new this.constructor(t))},Yr.dividedToIntegerBy=Yr.divToInt=function(t){var n=this.constructor;return Br(Zr(this,new n(t),0,1,1),n.precision,n.rounding)},Yr.equals=Yr.eq=function(t){return 0===this.cmp(t)},Yr.floor=function(){return Br(new this.constructor(this),this.e+1,3)},Yr.greaterThan=Yr.gt=function(t){return this.cmp(t)>0},Yr.greaterThanOrEqualTo=Yr.gte=function(t){var n=this.cmp(t);return 1==n||0===n},Yr.hyperbolicCosine=Yr.cosh=function(){var t,n,e,r,i,u=this,o=u.constructor,M=new o(1);if(!u.isFinite())return new o(u.s?1/0:NaN);if(u.isZero())return M;e=o.precision,r=o.rounding,o.precision=e+Math.max(u.e,u.sd())+4,o.rounding=1,(i=u.d.length)<32?n=(1/ii(4,t=Math.ceil(i/3))).toString():(t=16,n="2.3283064365386962890625e-10"),u=ri(o,1,u.times(n),new o(1),!0);for(var c,N=t,a=new o(8);N--;)c=u.times(u),u=M.minus(c.times(a.minus(c.times(a))));return Br(u,o.precision=e,o.rounding=r,!0)},Yr.hyperbolicSine=Yr.sinh=function(){var t,n,e,r,i=this,u=i.constructor;if(!i.isFinite()||i.isZero())return new u(i);if(n=u.precision,e=u.rounding,u.precision=n+Math.max(i.e,i.sd())+4,u.rounding=1,(r=i.d.length)<3)i=ri(u,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=ri(u,2,i=i.times(1/ii(5,t)),i,!0);for(var o,M=new u(5),c=new u(16),N=new u(20);t--;)o=i.times(i),i=i.times(M.plus(o.times(c.times(o).plus(N))))}return u.precision=n,u.rounding=e,Br(i,n,e,!0)},Yr.hyperbolicTangent=Yr.tanh=function(){var t,n,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+7,r.rounding=1,Zr(e.sinh(),e.cosh(),r.precision=t,r.rounding=n)):new r(e.s)},Yr.inverseCosine=Yr.acos=function(){var t,n=this,e=n.constructor,r=n.abs().cmp(1),i=e.precision,u=e.rounding;return-1!==r?0===r?n.isNeg()?Pr(e,i,u):new e(0):new e(NaN):n.isZero()?Pr(e,i+4,u).times(.5):(e.precision=i+6,e.rounding=1,n=n.asin(),t=Pr(e,i+4,u).times(.5),e.precision=i,e.rounding=u,t.minus(n))},Yr.inverseHyperbolicCosine=Yr.acosh=function(){var t,n,e=this,r=e.constructor;return e.lte(1)?new r(e.eq(1)?0:NaN):e.isFinite()?(t=r.precision,n=r.rounding,r.precision=t+Math.max(Math.abs(e.e),e.sd())+4,r.rounding=1,Ar=!1,e=e.times(e).minus(1).sqrt().plus(e),Ar=!0,r.precision=t,r.rounding=n,e.ln()):new r(e)},Yr.inverseHyperbolicSine=Yr.asinh=function(){var t,n,e=this,r=e.constructor;return!e.isFinite()||e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+2*Math.max(Math.abs(e.e),e.sd())+6,r.rounding=1,Ar=!1,e=e.times(e).plus(1).sqrt().plus(e),Ar=!0,r.precision=t,r.rounding=n,e.ln())},Yr.inverseHyperbolicTangent=Yr.atanh=function(){var t,n,e,r,i=this,u=i.constructor;return i.isFinite()?i.e>=0?new u(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(t=u.precision,n=u.rounding,r=i.sd(),Math.max(r,t)<2*-i.e-1?Br(new u(i),t,n,!0):(u.precision=e=r-i.e,i=Zr(i.plus(1),new u(1).minus(i),e+t,1),u.precision=t+4,u.rounding=1,i=i.ln(),u.precision=t,u.rounding=n,i.times(.5))):new u(NaN)},Yr.inverseSine=Yr.asin=function(){var t,n,e,r,i=this,u=i.constructor;return i.isZero()?new u(i):(n=i.abs().cmp(1),e=u.precision,r=u.rounding,-1!==n?0===n?((t=Pr(u,e+4,r).times(.5)).s=i.s,t):new u(NaN):(u.precision=e+6,u.rounding=1,i=i.div(new u(1).minus(i.times(i)).sqrt().plus(1)).atan(),u.precision=e,u.rounding=r,i.times(2)))},Yr.inverseTangent=Yr.atan=function(){var t,n,e,r,i,u,o,M,c,N=this,a=N.constructor,s=a.precision,D=a.rounding;if(N.isFinite()){if(N.isZero())return new a(N);if(N.abs().eq(1)&&s+4<=vr)return(o=Pr(a,s+4,D).times(.25)).s=N.s,o}else{if(!N.s)return new a(NaN);if(s+4<=vr)return(o=Pr(a,s+4,D).times(.5)).s=N.s,o}for(a.precision=M=s+10,a.rounding=1,t=e=Math.min(28,M/7+2|0);t;--t)N=N.div(N.times(N).plus(1).sqrt().plus(1));for(Ar=!1,n=Math.ceil(M/7),r=1,c=N.times(N),o=new a(N),i=N;-1!==t;)if(i=i.times(c),u=o.minus(i.div(r+=2)),i=i.times(c),void 0!==(o=u.plus(i.div(r+=2))).d[n])for(t=n;o.d[t]===u.d[t]&&t--;);return e&&(o=o.times(2<<e-1)),Ar=!0,Br(o,a.precision=s,a.rounding=D,!0)},Yr.isFinite=function(){return!!this.d},Yr.isInteger=Yr.isInt=function(){return!!this.d&&Ur(this.e/7)>this.d.length-2},Yr.isNaN=function(){return!this.s},Yr.isNegative=Yr.isNeg=function(){return this.s<0},Yr.isPositive=Yr.isPos=function(){return this.s>0},Yr.isZero=function(){return!!this.d&&0===this.d[0]},Yr.lessThan=Yr.lt=function(t){return this.cmp(t)<0},Yr.lessThanOrEqualTo=Yr.lte=function(t){return this.cmp(t)<1},Yr.logarithm=Yr.log=function(t){var n,e,r,i,u,o,M,c,N=this.constructor,a=N.precision,s=N.rounding;if(null==t)t=new N(10),n=!0;else{if(e=(t=new N(t)).d,t.s<0||!e||!e[0]||t.eq(1))return new N(NaN);n=t.eq(10)}if(e=this.d,this.s<0||!e||!e[0]||this.eq(1))return new N(e&&!e[0]?-1/0:1!=this.s?NaN:e?0:1/0);if(n)if(e.length>1)u=!0;else{for(i=e[0];i%10==0;)i/=10;u=1!==i}if(Ar=!1,o=$r(this,M=a+5),r=n?Gr(N,M+10):$r(t,M),Fr((c=Zr(o,r,M,1)).d,i=a,s))do{if(o=$r(this,M+=10),r=n?Gr(N,M+10):$r(t,M),c=Zr(o,r,M,1),!u){+mr(c.d).slice(i+1,i+15)+1==1e14&&(c=Br(c,a+1,0));break}}while(Fr(c.d,i+=10,s));return Ar=!0,Br(c,a,s)},Yr.minus=Yr.sub=function(t){var n,e,r,i,u,o,M,c,N,a,s,D,T=this,g=T.constructor;if(t=new g(t),!T.d||!t.d)return T.s&&t.s?T.d?t.s=-t.s:t=new g(t.d||T.s!==t.s?T:NaN):t=new g(NaN),t;if(T.s!=t.s)return t.s=-t.s,T.plus(t);if(N=T.d,D=t.d,M=g.precision,c=g.rounding,!N[0]||!D[0]){if(D[0])t.s=-t.s;else{if(!N[0])return new g(3===c?-0:0);t=new g(T)}return Ar?Br(t,M,c):t}if(e=Ur(t.e/7),a=Ur(T.e/7),N=N.slice(),u=a-e){for((s=u<0)?(n=N,u=-u,o=D.length):(n=D,e=a,o=N.length),u>(r=Math.max(Math.ceil(M/7),o)+2)&&(u=r,n.length=1),n.reverse(),r=u;r--;)n.push(0);n.reverse()}else{for((s=(r=N.length)<(o=D.length))&&(o=r),r=0;r<o;r++)if(N[r]!=D[r]){s=N[r]<D[r];break}u=0}for(s&&(n=N,N=D,D=n,t.s=-t.s),o=N.length,r=D.length-o;r>0;--r)N[o++]=0;for(r=D.length;r>u;){if(N[--r]<D[r]){for(i=r;i&&0===N[--i];)N[i]=Sr-1;--N[i],N[r]+=Sr}N[r]-=D[r]}for(;0===N[--o];)N.pop();for(;0===N[0];N.shift())--e;return N[0]?(t.d=N,t.e=Wr(N,e),Ar?Br(t,M,c):t):new g(3===c?-0:0)},Yr.modulo=Yr.mod=function(t){var n,e=this,r=e.constructor;return t=new r(t),!e.d||!t.s||t.d&&!t.d[0]?new r(NaN):!t.d||e.d&&!e.d[0]?Br(new r(e),r.precision,r.rounding):(Ar=!1,9==r.modulo?(n=Zr(e,t.abs(),0,3,1)).s*=t.s:n=Zr(e,t,0,r.modulo,1),n=n.times(t),Ar=!0,e.minus(n))},Yr.naturalExponential=Yr.exp=function(){return _r(this)},Yr.naturalLogarithm=Yr.ln=function(){return $r(this)},Yr.negated=Yr.neg=function(){var t=new this.constructor(this);return t.s=-t.s,Br(t)},Yr.plus=Yr.add=function(t){var n,e,r,i,u,o,M,c,N,a,s=this,D=s.constructor;if(t=new D(t),!s.d||!t.d)return s.s&&t.s?s.d||(t=new D(t.d||s.s===t.s?s:NaN)):t=new D(NaN),t;if(s.s!=t.s)return t.s=-t.s,s.minus(t);if(N=s.d,a=t.d,M=D.precision,c=D.rounding,!N[0]||!a[0])return a[0]||(t=new D(s)),Ar?Br(t,M,c):t;if(u=Ur(s.e/7),r=Ur(t.e/7),N=N.slice(),i=u-r){for(i<0?(e=N,i=-i,o=a.length):(e=a,r=u,o=N.length),i>(o=(u=Math.ceil(M/7))>o?u+1:o+1)&&(i=o,e.length=1),e.reverse();i--;)e.push(0);e.reverse()}for((o=N.length)-(i=a.length)<0&&(i=o,e=a,a=N,N=e),n=0;i;)n=(N[--i]=N[i]+a[i]+n)/Sr|0,N[i]%=Sr;for(n&&(N.unshift(n),++r),o=N.length;0==N[--o];)N.pop();return t.d=N,t.e=Wr(N,r),Ar?Br(t,M,c):t},Yr.precision=Yr.sd=function(t){var n,e=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(fr+t);return e.d?(n=Jr(e.d),t&&e.e+1>n&&(n=e.e+1)):n=NaN,n},Yr.round=function(){var t=this,n=t.constructor;return Br(new n(t),t.e+1,n.rounding)},Yr.sine=Yr.sin=function(){var t,n,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+Math.max(e.e,e.sd())+7,r.rounding=1,e=function(t,n){var e,r=n.d.length;if(r<3)return n.isZero()?n:ri(t,2,n,n);e=(e=1.4*Math.sqrt(r))>16?16:0|e,n=n.times(1/ii(5,e)),n=ri(t,2,n,n);for(var i,u=new t(5),o=new t(16),M=new t(20);e--;)i=n.times(n),n=n.times(u.plus(i.times(o.times(i).minus(M))));return n}(r,ui(r,e)),r.precision=t,r.rounding=n,Br(hr>2?e.neg():e,t,n,!0)):new r(NaN)},Yr.squareRoot=Yr.sqrt=function(){var t,n,e,r,i,u,o=this,M=o.d,c=o.e,N=o.s,a=o.constructor;if(1!==N||!M||!M[0])return new a(!N||N<0&&(!M||M[0])?NaN:M?o:1/0);for(Ar=!1,0==(N=Math.sqrt(+o))||N==1/0?(((n=mr(M)).length+c)%2==0&&(n+="0"),N=Math.sqrt(n),c=Ur((c+1)/2)-(c<0||c%2),r=new a(n=N==1/0?"5e"+c:(n=N.toExponential()).slice(0,n.indexOf("e")+1)+c)):r=new a(N.toString()),e=(c=a.precision)+3;;)if(r=(u=r).plus(Zr(o,u,e+2,1)).times(.5),mr(u.d).slice(0,e)===(n=mr(r.d)).slice(0,e)){if("9999"!=(n=n.slice(e-3,e+1))&&(i||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(Br(r,c+1,1),t=!r.times(r).eq(o));break}if(!i&&(Br(u,c+1,0),u.times(u).eq(o))){r=u;break}e+=4,i=1}return Ar=!0,Br(r,c,a.rounding,t)},Yr.tangent=Yr.tan=function(){var t,n,e=this,r=e.constructor;return e.isFinite()?e.isZero()?new r(e):(t=r.precision,n=r.rounding,r.precision=t+10,r.rounding=1,(e=e.sin()).s=1,e=Zr(e,new r(1).minus(e.times(e)).sqrt(),t+10,0),r.precision=t,r.rounding=n,Br(2==hr||4==hr?e.neg():e,t,n,!0)):new r(NaN)},Yr.times=Yr.mul=function(t){var n,e,r,i,u,o,M,c,N,a=this,s=a.constructor,D=a.d,T=(t=new s(t)).d;if(t.s*=a.s,!(D&&D[0]&&T&&T[0]))return new s(!t.s||D&&!D[0]&&!T||T&&!T[0]&&!D?NaN:D&&T?0*t.s:t.s/0);for(e=Ur(a.e/7)+Ur(t.e/7),(c=D.length)<(N=T.length)&&(u=D,D=T,T=u,o=c,c=N,N=o),u=[],r=o=c+N;r--;)u.push(0);for(r=N;--r>=0;){for(n=0,i=c+r;i>r;)M=u[i]+T[r]*D[i-r-1]+n,u[i--]=M%Sr|0,n=M/Sr|0;u[i]=(u[i]+n)%Sr|0}for(;!u[--o];)u.pop();return n?++e:u.shift(),t.d=u,t.e=Wr(u,e),Ar?Br(t,s.precision,s.rounding):t},Yr.toBinary=function(t,n){return oi(this,2,t,n)},Yr.toDecimalPlaces=Yr.toDP=function(t,n){var e=this,r=e.constructor;return e=new r(e),void 0===t?e:(Rr(t,0,1e9),void 0===n?n=r.rounding:Rr(n,0,8),Br(e,t+e.e+1,n))},Yr.toExponential=function(t,n){var e,r=this,i=r.constructor;return void 0===t?e=Vr(r,!0):(Rr(t,0,1e9),void 0===n?n=i.rounding:Rr(n,0,8),e=Vr(r=Br(new i(r),t+1,n),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+e:e},Yr.toFixed=function(t,n){var e,r,i=this,u=i.constructor;return void 0===t?e=Vr(i):(Rr(t,0,1e9),void 0===n?n=u.rounding:Rr(n,0,8),e=Vr(r=Br(new u(i),t+i.e+1,n),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+e:e},Yr.toFraction=function(t){var n,e,r,i,u,o,M,c,N,a,s,D,T=this,g=T.d,l=T.constructor;if(!g)return new l(T);if(N=e=new l(1),r=c=new l(0),o=(u=(n=new l(r)).e=Jr(g)-T.e-1)%7,n.d[0]=dr(10,o<0?7+o:o),null==t)t=u>0?n:N;else{if(!(M=new l(t)).isInt()||M.lt(N))throw Error(fr+M);t=M.gt(n)?u>0?n:N:M}for(Ar=!1,M=new l(mr(g)),a=l.precision,l.precision=u=7*g.length*2;s=Zr(M,n,0,1,1),1!=(i=e.plus(s.times(r))).cmp(t);)e=r,r=i,i=N,N=c.plus(s.times(i)),c=i,i=n,n=M.minus(s.times(i)),M=i;return i=Zr(t.minus(e),r,0,1,1),c=c.plus(i.times(N)),e=e.plus(i.times(r)),c.s=N.s=T.s,D=Zr(N,r,u,1).minus(T).abs().cmp(Zr(c,e,u,1).minus(T).abs())<1?[N,r]:[c,e],l.precision=a,Ar=!0,D},Yr.toHexadecimal=Yr.toHex=function(t,n){return oi(this,16,t,n)},Yr.toNearest=function(t,n){var e=this,r=e.constructor;if(e=new r(e),null==t){if(!e.d)return e;t=new r(1),n=r.rounding}else{if(t=new r(t),void 0===n?n=r.rounding:Rr(n,0,8),!e.d)return t.s?e:t;if(!t.d)return t.s&&(t.s=e.s),t}return t.d[0]?(Ar=!1,e=Zr(e,t,0,n,1).times(t),Ar=!0,Br(e)):(t.s=e.s,e=t),e},Yr.toNumber=function(){return+this},Yr.toOctal=function(t,n){return oi(this,8,t,n)},Yr.toPower=Yr.pow=function(t){var n,e,r,i,u,o,M=this,c=M.constructor,N=+(t=new c(t));if(!(M.d&&t.d&&M.d[0]&&t.d[0]))return new c(dr(+M,N));if((M=new c(M)).eq(1))return M;if(r=c.precision,u=c.rounding,t.eq(1))return Br(M,r,u);if((n=Ur(t.e/7))>=t.d.length-1&&(e=N<0?-N:N)<=9007199254740991)return i=Kr(c,M,e,r),t.s<0?new c(1).div(i):Br(i,r,u);if((o=M.s)<0){if(n<t.d.length-1)return new c(NaN);if(0==(1&t.d[n])&&(o=1),0==M.e&&1==M.d[0]&&1==M.d.length)return M.s=o,M}return(n=0!=(e=dr(+M,N))&&isFinite(e)?new c(e+"").e:Ur(N*(Math.log("0."+mr(M.d))/Math.LN10+M.e+1)))>c.maxE+1||n<c.minE-1?new c(n>0?o/0:0):(Ar=!1,c.rounding=M.s=1,e=Math.min(12,(n+"").length),(i=_r(t.times($r(M,r+e)),r)).d&&Fr((i=Br(i,r+5,1)).d,r,u)&&(n=r+10,+mr((i=Br(_r(t.times($r(M,n+e)),n),n+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=Br(i,r+1,0))),i.s=o,Ar=!0,c.rounding=u,Br(i,r,u))},Yr.toPrecision=function(t,n){var e,r=this,i=r.constructor;return void 0===t?e=Vr(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(Rr(t,1,1e9),void 0===n?n=i.rounding:Rr(n,0,8),e=Vr(r=Br(new i(r),t,n),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+e:e},Yr.toSignificantDigits=Yr.toSD=function(t,n){var e=this.constructor;return void 0===t?(t=e.precision,n=e.rounding):(Rr(t,1,1e9),void 0===n?n=e.rounding:Rr(n,0,8)),Br(new e(this),t,n)},Yr.toString=function(){var t=this,n=t.constructor,e=Vr(t,t.e<=n.toExpNeg||t.e>=n.toExpPos);return t.isNeg()&&!t.isZero()?"-"+e:e},Yr.truncated=Yr.trunc=function(){return Br(new this.constructor(this),this.e+1,1)},Yr.valueOf=Yr.toJSON=function(){var t=this,n=t.constructor,e=Vr(t,t.e<=n.toExpNeg||t.e>=n.toExpPos);return t.isNeg()?"-"+e:e};var Zr=function(){function t(t,n,e){var r,i=0,u=t.length;for(t=t.slice();u--;)r=t[u]*n+i,t[u]=r%e|0,i=r/e|0;return i&&t.unshift(i),t}function n(t,n,e,r){var i,u;if(e!=r)u=e>r?1:-1;else for(i=u=0;i<e;i++)if(t[i]!=n[i]){u=t[i]>n[i]?1:-1;break}return u}function e(t,n,e,r){for(var i=0;e--;)t[e]-=i,i=t[e]<n[e]?1:0,t[e]=i*r+t[e]-n[e];for(;!t[0]&&t.length>1;)t.shift()}return function(r,i,u,o,M,c){var N,a,s,D,T,g,l,I,y,h,j,x,z,O,E,A,f,p,U,d,C=r.constructor,Q=r.s==i.s?1:-1,w=r.d,L=i.d;if(!(w&&w[0]&&L&&L[0]))return new C(r.s&&i.s&&(w?!L||w[0]!=L[0]:L)?w&&0==w[0]||!L?0*Q:Q/0:NaN);for(c?(T=1,a=r.e-i.e):(c=Sr,T=7,a=Ur(r.e/T)-Ur(i.e/T)),U=L.length,f=w.length,h=(y=new C(Q)).d=[],s=0;L[s]==(w[s]||0);s++);if(L[s]>(w[s]||0)&&a--,null==u?(O=u=C.precision,o=C.rounding):O=M?u+(r.e-i.e)+1:u,O<0)h.push(1),g=!0;else{if(O=O/T+2|0,s=0,1==U){for(D=0,L=L[0],O++;(s<f||D)&&O--;s++)E=D*c+(w[s]||0),h[s]=E/L|0,D=E%L|0;g=D||s<f}else{for((D=c/(L[0]+1)|0)>1&&(L=t(L,D,c),w=t(w,D,c),U=L.length,f=w.length),A=U,x=(j=w.slice(0,U)).length;x<U;)j[x++]=0;(d=L.slice()).unshift(0),p=L[0],L[1]>=c/2&&++p;do{D=0,(N=n(L,j,U,x))<0?(z=j[0],U!=x&&(z=z*c+(j[1]||0)),(D=z/p|0)>1?(D>=c&&(D=c-1),1==(N=n(l=t(L,D,c),j,I=l.length,x=j.length))&&(D--,e(l,U<I?d:L,I,c))):(0==D&&(N=D=1),l=L.slice()),(I=l.length)<x&&l.unshift(0),e(j,l,x,c),-1==N&&(N=n(L,j,U,x=j.length))<1&&(D++,e(j,U<x?d:L,x,c)),x=j.length):0===N&&(D++,j=[0]),h[s++]=D,N&&j[0]?j[x++]=w[A]||0:(j=[w[A]],x=1)}while((A++<f||void 0!==j[0])&&O--);g=void 0!==j[0]}h[0]||h.shift()}if(1==T)y.e=a,yr=g;else{for(s=1,D=h[0];D>=10;D/=10)s++;y.e=s+a*T-1,Br(y,M?u+y.e+1:u,o,g)}return y}}();function Br(t,n,e,r){var i,u,o,M,c,N,a,s,D,T=t.constructor;t:if(null!=n){if(!(s=t.d))return t;for(i=1,M=s[0];M>=10;M/=10)i++;if((u=n-i)<0)u+=7,o=n,c=(a=s[D=0])/dr(10,i-o-1)%10|0;else if((D=Math.ceil((u+1)/7))>=(M=s.length)){if(!r)break t;for(;M++<=D;)s.push(0);a=c=0,i=1,o=(u%=7)-7+1}else{for(a=M=s[D],i=1;M>=10;M/=10)i++;c=(o=(u%=7)-7+i)<0?0:a/dr(10,i-o-1)%10|0}if(r=r||n<0||void 0!==s[D+1]||(o<0?a:a%dr(10,i-o-1)),N=e<4?(c||r)&&(0==e||e==(t.s<0?3:2)):c>5||5==c&&(4==e||r||6==e&&(u>0?o>0?a/dr(10,i-o):0:s[D-1])%10&1||e==(t.s<0?8:7)),n<1||!s[0])return s.length=0,N?(n-=t.e+1,s[0]=dr(10,(7-n%7)%7),t.e=-n||0):s[0]=t.e=0,t;if(0==u?(s.length=D,M=1,D--):(s.length=D+1,M=dr(10,7-u),s[D]=o>0?(a/dr(10,i-o)%dr(10,o)|0)*M:0),N)for(;;){if(0==D){for(u=1,o=s[0];o>=10;o/=10)u++;for(o=s[0]+=M,M=1;o>=10;o/=10)M++;u!=M&&(t.e++,s[0]==Sr&&(s[0]=1));break}if(s[D]+=M,s[D]!=Sr)break;s[D--]=0,M=1}for(u=s.length;0===s[--u];)s.pop()}return Ar&&(t.e>T.maxE?(t.d=null,t.e=NaN):t.e<T.minE&&(t.e=0,t.d=[0])),t}function Vr(t,n,e){if(!t.isFinite())return ti(t);var r,i=t.e,u=mr(t.d),o=u.length;return n?(e&&(r=e-o)>0?u=u.charAt(0)+"."+u.slice(1)+Hr(r):o>1&&(u=u.charAt(0)+"."+u.slice(1)),u=u+(t.e<0?"e":"e+")+t.e):i<0?(u="0."+Hr(-i-1)+u,e&&(r=e-o)>0&&(u+=Hr(r))):i>=o?(u+=Hr(i+1-o),e&&(r=e-i-1)>0&&(u=u+"."+Hr(r))):((r=i+1)<o&&(u=u.slice(0,r)+"."+u.slice(r)),e&&(r=e-o)>0&&(i+1===o&&(u+="."),u+=Hr(r))),u}function Wr(t,n){var e=t[0];for(n*=7;e>=10;e/=10)n++;return n}function Gr(t,n,e){if(n>kr)throw Ar=!0,e&&(t.precision=e),Error("[DecimalError] Precision limit exceeded");return Br(new t(zr),n,1,!0)}function Pr(t,n,e){if(n>vr)throw Error("[DecimalError] Precision limit exceeded");return Br(new t(Or),n,e,!0)}function Jr(t){var n=t.length-1,e=7*n+1;if(n=t[n]){for(;n%10==0;n/=10)e--;for(n=t[0];n>=10;n/=10)e++}return e}function Hr(t){for(var n="";t--;)n+="0";return n}function Kr(t,n,e,r){var i,u=new t(1),o=Math.ceil(r/7+4);for(Ar=!1;;){if(e%2&&Mi((u=u.times(n)).d,o)&&(i=!0),0===(e=Ur(e/2))){e=u.d.length-1,i&&0===u.d[e]&&++u.d[e];break}Mi((n=n.times(n)).d,o)}return Ar=!0,u}function Xr(t){return 1&t.d[t.d.length-1]}function qr(t,n,e){for(var r,i=new t(n[0]),u=0;++u<n.length;){if(!(r=new t(n[u])).s){i=r;break}i[e](r)&&(i=r)}return i}function _r(t,n){var e,r,i,u,o,M,c,N=0,a=0,s=0,D=t.constructor,T=D.rounding,g=D.precision;if(!t.d||!t.d[0]||t.e>17)return new D(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==n?(Ar=!1,c=g):c=n,M=new D(.03125);t.e>-2;)t=t.times(M),s+=5;for(c+=r=Math.log(dr(2,s))/Math.LN10*2+5|0,e=u=o=new D(1),D.precision=c;;){if(u=Br(u.times(t),c,1),e=e.times(++a),mr((M=o.plus(Zr(u,e,c,1))).d).slice(0,c)===mr(o.d).slice(0,c)){for(i=s;i--;)o=Br(o.times(o),c,1);if(null!=n)return D.precision=g,o;if(!(N<3&&Fr(o.d,c-r,T,N)))return Br(o,D.precision=g,T,Ar=!0);D.precision=c+=10,e=u=M=new D(1),a=0,N++}o=M}}function $r(t,n){var e,r,i,u,o,M,c,N,a,s,D,T=1,g=t,l=g.d,I=g.constructor,y=I.rounding,h=I.precision;if(g.s<0||!l||!l[0]||!g.e&&1==l[0]&&1==l.length)return new I(l&&!l[0]?-1/0:1!=g.s?NaN:l?0:g);if(null==n?(Ar=!1,a=h):a=n,I.precision=a+=10,r=(e=mr(l)).charAt(0),!(Math.abs(u=g.e)<15e14))return N=Gr(I,a+2,h).times(u+""),g=$r(new I(r+"."+e.slice(1)),a-10).plus(N),I.precision=h,null==n?Br(g,h,y,Ar=!0):g;for(;r<7&&1!=r||1==r&&e.charAt(1)>3;)r=(e=mr((g=g.times(t)).d)).charAt(0),T++;for(u=g.e,r>1?(g=new I("0."+e),u++):g=new I(r+"."+e.slice(1)),s=g,c=o=g=Zr(g.minus(1),g.plus(1),a,1),D=Br(g.times(g),a,1),i=3;;){if(o=Br(o.times(D),a,1),mr((N=c.plus(Zr(o,new I(i),a,1))).d).slice(0,a)===mr(c.d).slice(0,a)){if(c=c.times(2),0!==u&&(c=c.plus(Gr(I,a+2,h).times(u+""))),c=Zr(c,new I(T),a,1),null!=n)return I.precision=h,c;if(!Fr(c.d,a-10,y,M))return Br(c,I.precision=h,y,Ar=!0);I.precision=a+=10,N=o=g=Zr(s.minus(1),s.plus(1),a,1),D=Br(g.times(g),a,1),i=M=1}c=N,i+=2}}function ti(t){return String(t.s*t.s/0)}function ni(t,n){var e,r,i;for((e=n.indexOf("."))>-1&&(n=n.replace(".","")),(r=n.search(/e/i))>0?(e<0&&(e=r),e+=+n.slice(r+1),n=n.substring(0,r)):e<0&&(e=n.length),r=0;48===n.charCodeAt(r);r++);for(i=n.length;48===n.charCodeAt(i-1);--i);if(n=n.slice(r,i)){if(i-=r,t.e=e=e-r-1,t.d=[],r=(e+1)%7,e<0&&(r+=7),r<i){for(r&&t.d.push(+n.slice(0,r)),i-=7;r<i;)t.d.push(+n.slice(r,r+=7));r=7-(n=n.slice(r)).length}else r-=i;for(;r--;)n+="0";t.d.push(+n),Ar&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function ei(t,n){var e,r,i,u,o,M,c,N,a;if(n.indexOf("_")>-1){if(n=n.replace(/(\d)_(?=\d)/g,"$1"),Lr.test(n))return ni(t,n)}else if("Infinity"===n||"NaN"===n)return+n||(t.s=NaN),t.e=NaN,t.d=null,t;if(Qr.test(n))e=16,n=n.toLowerCase();else if(Cr.test(n))e=2;else{if(!wr.test(n))throw Error(fr+n);e=8}for((u=n.search(/p/i))>0?(c=+n.slice(u+1),n=n.substring(2,u)):n=n.slice(2),o=(u=n.indexOf("."))>=0,r=t.constructor,o&&(u=(M=(n=n.replace(".","")).length)-u,i=Kr(r,new r(e),u,2*u)),u=a=(N=br(n,e,Sr)).length-1;0===N[u];--u)N.pop();return u<0?new r(0*t.s):(t.e=Wr(N,a),t.d=N,Ar=!1,o&&(t=Zr(t,i,4*M)),c&&(t=t.times(Math.abs(c)<54?dr(2,c):Hi.pow(2,c))),Ar=!0,t)}function ri(t,n,e,r,i){var u,o,M,c,N=t.precision,a=Math.ceil(N/7);for(Ar=!1,c=e.times(e),M=new t(r);;){if(o=Zr(M.times(c),new t(n++*n++),N,1),M=i?r.plus(o):r.minus(o),r=Zr(o.times(c),new t(n++*n++),N,1),void 0!==(o=M.plus(r)).d[a]){for(u=a;o.d[u]===M.d[u]&&u--;);if(-1==u)break}u=M,M=r,r=o,o=u}return Ar=!0,o.d.length=a+1,o}function ii(t,n){for(var e=t;--n;)e*=t;return e}function ui(t,n){var e,r=n.s<0,i=Pr(t,t.precision,1),u=i.times(.5);if((n=n.abs()).lte(u))return hr=r?4:1,n;if((e=n.divToInt(i)).isZero())hr=r?3:2;else{if((n=n.minus(e.times(i))).lte(u))return hr=Xr(e)?r?2:3:r?4:1,n;hr=Xr(e)?r?1:4:r?3:2}return n.minus(i).abs()}function oi(t,n,e,r){var i,u,o,M,c,N,a,s,D,T=t.constructor,g=void 0!==e;if(g?(Rr(e,1,1e9),void 0===r?r=T.rounding:Rr(r,0,8)):(e=T.precision,r=T.rounding),t.isFinite()){for(g?(i=2,16==n?e=4*e-3:8==n&&(e=3*e-2)):i=n,(o=(a=Vr(t)).indexOf("."))>=0&&(a=a.replace(".",""),(D=new T(1)).e=a.length-o,D.d=br(Vr(D),10,i),D.e=D.d.length),u=c=(s=br(a,10,i)).length;0==s[--c];)s.pop();if(s[0]){if(o<0?u--:((t=new T(t)).d=s,t.e=u,s=(t=Zr(t,D,e,r,0,i)).d,u=t.e,N=yr),o=s[e],M=i/2,N=N||void 0!==s[e+1],N=r<4?(void 0!==o||N)&&(0===r||r===(t.s<0?3:2)):o>M||o===M&&(4===r||N||6===r&&1&s[e-1]||r===(t.s<0?8:7)),s.length=e,N)for(;++s[--e]>i-1;)s[e]=0,e||(++u,s.unshift(1));for(c=s.length;!s[c-1];--c);for(o=0,a="";o<c;o++)a+=xr.charAt(s[o]);if(g){if(c>1)if(16==n||8==n){for(o=16==n?4:3,--c;c%o;c++)a+="0";for(c=(s=br(a,i,n)).length;!s[c-1];--c);for(o=1,a="1.";o<c;o++)a+=xr.charAt(s[o])}else a=a.charAt(0)+"."+a.slice(1);a=a+(u<0?"p":"p+")+u}else if(u<0){for(;++u;)a="0"+a;a="0."+a}else if(++u>c)for(u-=c;u--;)a+="0";else u<c&&(a=a.slice(0,u)+"."+a.slice(u))}else a=g?"0p+0":"0";a=(16==n?"0x":2==n?"0b":8==n?"0o":"")+a}else a=ti(t);return t.s<0?"-"+a:a}function Mi(t,n){if(t.length>n)return t.length=n,!0}function ci(t){return new this(t).abs()}function Ni(t){return new this(t).acos()}function ai(t){return new this(t).acosh()}function si(t,n){return new this(t).plus(n)}function Di(t){return new this(t).asin()}function Ti(t){return new this(t).asinh()}function gi(t){return new this(t).atan()}function li(t){return new this(t).atanh()}function Ii(t,n){t=new this(t),n=new this(n);var e,r=this.precision,i=this.rounding,u=r+4;return t.s&&n.s?t.d||n.d?!n.d||t.isZero()?(e=n.s<0?Pr(this,r,i):new this(0)).s=t.s:!t.d||n.isZero()?(e=Pr(this,u,1).times(.5)).s=t.s:n.s<0?(this.precision=u,this.rounding=1,e=this.atan(Zr(t,n,u,1)),n=Pr(this,u,1),this.precision=r,this.rounding=i,e=t.s<0?e.minus(n):e.plus(n)):e=this.atan(Zr(t,n,u,1)):(e=Pr(this,u,1).times(n.s>0?.25:.75)).s=t.s:e=new this(NaN),e}function yi(t){return new this(t).cbrt()}function hi(t){return Br(t=new this(t),t.e+1,2)}function ji(t,n,e){return new this(t).clamp(n,e)}function xi(t){if(!t||"object"!=typeof t)throw Error("[DecimalError] Object expected");var n,e,r,i=!0===t.defaults,u=["precision",1,1e9,"rounding",0,8,"toExpNeg",-jr,0,"toExpPos",0,jr,"maxE",0,jr,"minE",-jr,0,"modulo",0,9];for(n=0;n<u.length;n+=3)if(e=u[n],i&&(this[e]=Er[e]),void 0!==(r=t[e])){if(!(Ur(r)===r&&r>=u[n+1]&&r<=u[n+2]))throw Error(fr+e+": "+r);this[e]=r}if(e="crypto",i&&(this[e]=Er[e]),void 0!==(r=t[e])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(fr+e+": "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");this[e]=!0}else this[e]=!1}return this}function zi(t){return new this(t).cos()}function Oi(t){return new this(t).cosh()}function Ei(t,n){return new this(t).div(n)}function Ai(t){return new this(t).exp()}function fi(t){return Br(t=new this(t),t.e+1,3)}function pi(){var t,n,e=new this(0);for(Ar=!1,t=0;t<arguments.length;)if((n=new this(arguments[t++])).d)e.d&&(e=e.plus(n.times(n)));else{if(n.s)return Ar=!0,new this(1/0);e=n}return Ar=!0,e.sqrt()}function Ui(t){return t instanceof Hi||t&&t.toStringTag===pr||!1}function di(t){return new this(t).ln()}function Ci(t,n){return new this(t).log(n)}function Qi(t){return new this(t).log(2)}function wi(t){return new this(t).log(10)}function Li(){return qr(this,arguments,"lt")}function Si(){return qr(this,arguments,"gt")}function ki(t,n){return new this(t).mod(n)}function vi(t,n){return new this(t).mul(n)}function Yi(t,n){return new this(t).pow(n)}function mi(t){var n,e,r,i,u=0,o=new this(1),M=[];if(void 0===t?t=this.precision:Rr(t,1,1e9),r=Math.ceil(t/7),this.crypto)if(crypto.getRandomValues)for(n=crypto.getRandomValues(new Uint32Array(r));u<r;)(i=n[u])>=429e7?n[u]=crypto.getRandomValues(new Uint32Array(1))[0]:M[u++]=i%1e7;else{if(!crypto.randomBytes)throw Error("[DecimalError] crypto unavailable");for(n=crypto.randomBytes(r*=4);u<r;)(i=n[u]+(n[u+1]<<8)+(n[u+2]<<16)+((127&n[u+3])<<24))>=214e7?crypto.randomBytes(4).copy(n,u):(M.push(i%1e7),u+=4);u=r/4}else for(;u<r;)M[u++]=1e7*Math.random()|0;for(t%=7,(r=M[--u])&&t&&(i=dr(10,7-t),M[u]=(r/i|0)*i);0===M[u];u--)M.pop();if(u<0)e=0,M=[0];else{for(e=-1;0===M[0];e-=7)M.shift();for(r=1,i=M[0];i>=10;i/=10)r++;r<7&&(e-=7-r)}return o.e=e,o.d=M,o}function Ri(t){return Br(t=new this(t),t.e+1,this.rounding)}function Fi(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function bi(t){return new this(t).sin()}function Zi(t){return new this(t).sinh()}function Bi(t){return new this(t).sqrt()}function Vi(t,n){return new this(t).sub(n)}function Wi(){var t=0,n=arguments,e=new this(n[t]);for(Ar=!1;e.s&&++t<n.length;)e=e.plus(n[t]);return Ar=!0,Br(e,this.precision,this.rounding)}function Gi(t){return new this(t).tan()}function Pi(t){return new this(t).tanh()}function Ji(t){return Br(t=new this(t),t.e+1,1)}Yr[Symbol.for("nodejs.util.inspect.custom")]=Yr.toString,Yr[Symbol.toStringTag]="Decimal";var Hi=Yr.constructor=function t(n){var e,r,i;function u(t){var n,e,r,i=this;if(!(i instanceof u))return new u(t);if(i.constructor=u,Ui(t))return i.s=t.s,void(Ar?!t.d||t.e>u.maxE?(i.e=NaN,i.d=null):t.e<u.minE?(i.e=0,i.d=[0]):(i.e=t.e,i.d=t.d.slice()):(i.e=t.e,i.d=t.d?t.d.slice():t.d));if("number"===(r=typeof t)){if(0===t)return i.s=1/t<0?-1:1,i.e=0,void(i.d=[0]);if(t<0?(t=-t,i.s=-1):i.s=1,t===~~t&&t<1e7){for(n=0,e=t;e>=10;e/=10)n++;return void(Ar?n>u.maxE?(i.e=NaN,i.d=null):n<u.minE?(i.e=0,i.d=[0]):(i.e=n,i.d=[t]):(i.e=n,i.d=[t]))}return 0*t!=0?(t||(i.s=NaN),i.e=NaN,void(i.d=null)):ni(i,t.toString())}if("string"!==r)throw Error(fr+t);return 45===(e=t.charCodeAt(0))?(t=t.slice(1),i.s=-1):(43===e&&(t=t.slice(1)),i.s=1),Lr.test(t)?ni(i,t):ei(i,t)}if(u.prototype=Yr,u.ROUND_UP=0,u.ROUND_DOWN=1,u.ROUND_CEIL=2,u.ROUND_FLOOR=3,u.ROUND_HALF_UP=4,u.ROUND_HALF_DOWN=5,u.ROUND_HALF_EVEN=6,u.ROUND_HALF_CEIL=7,u.ROUND_HALF_FLOOR=8,u.EUCLID=9,u.config=u.set=xi,u.clone=t,u.isDecimal=Ui,u.abs=ci,u.acos=Ni,u.acosh=ai,u.add=si,u.asin=Di,u.asinh=Ti,u.atan=gi,u.atanh=li,u.atan2=Ii,u.cbrt=yi,u.ceil=hi,u.clamp=ji,u.cos=zi,u.cosh=Oi,u.div=Ei,u.exp=Ai,u.floor=fi,u.hypot=pi,u.ln=di,u.log=Ci,u.log10=wi,u.log2=Qi,u.max=Li,u.min=Si,u.mod=ki,u.mul=vi,u.pow=Yi,u.random=mi,u.round=Ri,u.sign=Fi,u.sin=bi,u.sinh=Zi,u.sqrt=Bi,u.sub=Vi,u.sum=Wi,u.tan=Gi,u.tanh=Pi,u.trunc=Ji,void 0===n&&(n={}),n&&!0!==n.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<i.length;)n.hasOwnProperty(r=i[e++])||(n[r]=this[r]);return u.config(n),u}(Er);zr=new Hi(zr),Or=new Hi(Or);var Ki=Hi;function Xi(t){return"boolean"==typeof t||!!isFinite(t)&&t===Math.round(t)}var qi=Math.sign||function(t){return t>0?1:t<0?-1:0},_i=Math.log2||function(t){return Math.log(t)/Math.LN2},$i=Math.log10||function(t){return Math.log(t)/Math.LN10},tu=(Math.log1p,Math.cbrt||function(t){if(0===t)return t;var n,e=t<0;return e&&(t=-t),n=isFinite(t)?(t/((n=Math.exp(Math.log(t)/3))*n)+2*n)/3:t,e?-n:n}),nu=Math.expm1||function(t){return t>=2e-4||t<=-2e-4?Math.exp(t)-1:t+t*t/2+t*t*t/6};function eu(t,n,e){var r={2:"0b",8:"0o",16:"0x"}[n],i="";if(e){if(e<1)throw new Error("size must be in greater than 0");if(!Xi(e))throw new Error("size must be an integer");if(t>2**(e-1)-1||t<-(2**(e-1)))throw new Error("Value must be in range [-2^".concat(e-1,", 2^").concat(e-1,"-1]"));if(!Xi(t))throw new Error("Value must be an integer");t<0&&(t+=2**e),i="i".concat(e)}var u="";return t<0&&(t=-t,u="-"),"".concat(u).concat(r).concat(t.toString(n)).concat(i)}function ru(t,n){if("function"==typeof n)return n(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var{notation:e,precision:r,wordSize:i}=iu(n);switch(e){case"fixed":return ou(t,r);case"exponential":return Mu(t,r);case"engineering":return function(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=cu(uu(t),n),r=e.exponent,i=e.coefficients,u=r%3==0?r:r<0?r-3-r%3:r-r%3;if(Ae(n))for(;n>i.length||r-u+1>i.length;)i.push(0);else for(var o=Math.abs(r-u)-(i.length-1),M=0;M<o;M++)i.push(0);var c=Math.abs(r-u),N=1;for(;c>0;)N++,c--;var a=i.slice(N).join(""),s=Ae(n)&&a.length||a.match(/[1-9]/)?"."+a:"",D=i.slice(0,N).join("")+s+"e"+(r>=0?"+":"")+u.toString();return e.sign+D}(t,r);case"bin":return eu(t,2,i);case"oct":return eu(t,8,i);case"hex":return eu(t,16,i);case"auto":return function(t,n,e){if(isNaN(t)||!isFinite(t))return String(t);var r=yu(null==e?void 0:e.lowerExp,-3),i=yu(null==e?void 0:e.upperExp,5),u=uu(t),o=n?cu(u,n):u;if(o.exponent<r||o.exponent>=i)return Mu(t,n);var M=o.coefficients,c=o.exponent;M.length<n&&(M=M.concat(Nu(n-M.length))),M=M.concat(Nu(c-M.length+1+(M.length<n?n-M.length:0))),M=Nu(-c).concat(M);var N=c>0?c:0;return N<M.length-1&&M.splice(N+1,0,"."),o.sign+M.join("")}(t,r,n).replace(/((\.\d*?)(0+))($|e)/,(function(){var t=arguments[2],n=arguments[4];return"."!==t?t+n:n}));default:throw new Error('Unknown notation "'+e+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function iu(t){var n,e,r="auto";if(void 0!==t)if(Ae(t))n=t;else if(fe(t))n=t.toNumber();else{if(!Ve(t))throw new Error("Unsupported type of options, number, BigNumber, or object expected");void 0!==t.precision&&(n=Iu(t.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),void 0!==t.wordSize&&(e=Iu(t.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),t.notation&&(r=t.notation)}return{notation:r,precision:n,wordSize:e}}function uu(t){var n=String(t).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!n)throw new SyntaxError("Invalid number "+t);var e=n[1],r=n[2],i=parseFloat(n[4]||"0"),u=r.indexOf(".");i+=-1!==u?u-1:r.length-1;var o=r.replace(".","").replace(/^0*/,(function(t){return i-=t.length,""})).replace(/0*$/,"").split("").map((function(t){return parseInt(t)}));return 0===o.length&&(o.push(0),i++),{sign:e,coefficients:o,exponent:i}}function ou(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=uu(t),r="number"==typeof n?cu(e,e.exponent+1+n):e,i=r.coefficients,u=r.exponent+1,o=u+(n||0);return i.length<o&&(i=i.concat(Nu(o-i.length))),u<0&&(i=Nu(1-u).concat(i),u=1),u<i.length&&i.splice(u,0,0===u?"0.":"."),r.sign+i.join("")}function Mu(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=uu(t),r=n?cu(e,n):e,i=r.coefficients,u=r.exponent;i.length<n&&(i=i.concat(Nu(n-i.length)));var o=i.shift();return r.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(u>=0?"+":"")+u}function cu(t,n){for(var e={sign:t.sign,coefficients:t.coefficients,exponent:t.exponent},r=e.coefficients;n<=0;)r.unshift(0),e.exponent++,n++;if(r.length>n&&r.splice(n,r.length-n)[0]>=5){var i=n-1;for(r[i]++;10===r[i];)r.pop(),0===i&&(r.unshift(0),e.exponent++,i++),r[--i]++}return e}function Nu(t){for(var n=[],e=0;e<t;e++)n.push(0);return n}var au=Number.EPSILON||2220446049250313e-31;function su(t,n,e){if(null==e)return t===n;if(t===n)return!0;if(isNaN(t)||isNaN(n))return!1;if(isFinite(t)&&isFinite(n)){var r=Math.abs(t-n);return r<=au||r<=Math.max(Math.abs(t),Math.abs(n))*e}return!1}var Du=Math.acosh||function(t){return Math.log(Math.sqrt(t*t-1)+t)},Tu=Math.asinh||function(t){return Math.log(Math.sqrt(t*t+1)+t)},gu=Math.atanh||function(t){return Math.log((1+t)/(1-t))/2},lu=(Math.cosh,Math.sinh||function(t){return(Math.exp(t)-Math.exp(-t))/2});Math.tanh;function Iu(t,n){return Ae(t)?t:fe(t)?t.toNumber():void n()}function yu(t,n){return Ae(t)?t:fe(t)?t.toNumber():n}function hu(t,n,e){var r=new(0,t.constructor)(2),i="";if(e){if(e<1)throw new Error("size must be in greater than 0");if(!Xi(e))throw new Error("size must be an integer");if(t.greaterThan(r.pow(e-1).sub(1))||t.lessThan(r.pow(e-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(e-1,", 2^").concat(e-1,"-1]"));if(!t.isInteger())throw new Error("Value must be an integer");t.lessThan(0)&&(t=t.add(r.pow(e))),i="i".concat(e)}switch(n){case 2:return"".concat(t.toBinary()).concat(i);case 8:return"".concat(t.toOctal()).concat(i);case 16:return"".concat(t.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(n," not supported "))}}function ju(t,n){if("function"==typeof n)return n(t);if(!t.isFinite())return t.isNaN()?"NaN":t.gt(0)?"Infinity":"-Infinity";var{notation:e,precision:r,wordSize:i}=iu(n);switch(e){case"fixed":return function(t,n){return t.toFixed(n)}(t,r);case"exponential":return xu(t,r);case"engineering":return function(t,n){var e=t.e,r=e%3==0?e:e<0?e-3-e%3:e-e%3,i=t.mul(Math.pow(10,-r)).toPrecision(n);if(-1!==i.indexOf("e")){var u=t.constructor;i=new u(i).toFixed()}return i+"e"+(e>=0?"+":"")+r.toString()}(t,r);case"bin":return hu(t,2,i);case"oct":return hu(t,8,i);case"hex":return hu(t,16,i);case"auto":var u=zu(null==n?void 0:n.lowerExp,-3),o=zu(null==n?void 0:n.upperExp,5);if(t.isZero())return"0";var M=t.toSignificantDigits(r),c=M.e;return(c>=u&&c<o?M.toFixed():xu(t,r)).replace(/((\.\d*?)(0+))($|e)/,(function(){var t=arguments[2],n=arguments[4];return"."!==t?t+n:n}));default:throw new Error('Unknown notation "'+e+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function xu(t,n){return void 0!==n?t.toExponential(n-1):t.toExponential()}function zu(t,n){return Ae(t)?t:fe(t)?t.toNumber():n}function Ou(t,n){var e=function(t,n){if("number"==typeof t)return ru(t,n);if(fe(t))return ju(t,n);if(function(t){return t&&"object"==typeof t&&"number"==typeof t.s&&"number"==typeof t.n&&"number"==typeof t.d||!1}(t))return n&&"decimal"===n.fraction?t.toString():t.s*t.n+"/"+t.d;if(Array.isArray(t))return function t(n,e){if(Array.isArray(n)){for(var r="[",i=n.length,u=0;u<i;u++)0!==u&&(r+=", "),r+=t(n[u],e);return r+="]"}return Ou(n,e)}(t,n);if(Ce(t))return Eu(t);if("function"==typeof t)return t.syntax?String(t.syntax):"function";if(t&&"object"==typeof t){return"function"==typeof t.format?t.format(n):t&&t.toString(n)!=={}.toString()?t.toString(n):"{"+Object.keys(t).map(e=>Eu(e)+": "+Ou(t[e],n)).join(", ")+"}"}return String(t)}(t,n);return n&&"object"==typeof n&&"truncate"in n&&e.length>n.truncate?e.substring(0,n.truncate-3)+"...":e}function Eu(t){for(var n=String(t),e="",r=0;r<n.length;){var i=n.charAt(r);e+=i in Au?Au[i]:i,r++}return'"'+e+'"'}var Au={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};function fu(t,n){if(!Ce(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Nr(t)+", index: 0)");if(!Ce(n))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Nr(n)+", index: 1)");return t===n?0:t>n?1:-1}function pu(t,n,e){if(!(this instanceof pu))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=n,this.relation=e,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(n)?"["+n.join(", ")+"]":n)+")",this.stack=(new Error).stack}function Uu(t,n,e){if(!(this instanceof Uu))throw new SyntaxError("Constructor must be called with the new operator");this.index=t,arguments.length<3?(this.min=0,this.max=n):(this.min=n,this.max=e),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=(new Error).stack}function du(t){for(var n=[];Array.isArray(t);)n.push(t.length),t=t[0];return n}function Cu(t,n){if(0===n.length){if(Array.isArray(t))throw new pu(t.length,0)}else!function t(n,e,r){var i,u=n.length;if(u!==e[r])throw new pu(u,e[r]);if(r<e.length-1){var o=r+1;for(i=0;i<u;i++){var M=n[i];if(!Array.isArray(M))throw new pu(e.length-1,e.length,"<");t(n[i],e,o)}}else for(i=0;i<u;i++)if(Array.isArray(n[i]))throw new pu(e.length+1,e.length,">")}(t,n,0)}function Qu(t,n){if(void 0!==t){if(!Ae(t)||!Xi(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||"number"==typeof n&&t>=n)throw new Uu(t,n)}}function wu(t,n,e){if(!Array.isArray(n))throw new TypeError("Array expected");if(0===n.length)throw new Error("Resizing to scalar is not supported");return n.forEach((function(t){if(!Ae(t)||!Xi(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ou(n)+")")})),(Ae(t)||fe(t))&&(t=[t]),function t(n,e,r,i){var u,o,M=n.length,c=e[r],N=Math.min(M,c);if(n.length=c,r<e.length-1){var a=r+1;for(u=0;u<N;u++)o=n[u],Array.isArray(o)||(o=[o],n[u]=o),t(o,e,a,i);for(u=N;u<c;u++)o=[],n[u]=o,t(o,e,a,i)}else{for(u=0;u<N;u++)for(;Array.isArray(n[u]);)n[u]=n[u][0];for(u=N;u<c;u++)n[u]=i}}(t,n,0,void 0!==e?e:0),t}function Lu(t,n){var e=Yu(t),r=e.length;if(!Array.isArray(t)||!Array.isArray(n))throw new TypeError("Array expected");if(0===n.length)throw new pu(0,r,"!=");var i=ku(n=Su(n,r));if(r!==i)throw new pu(i,r,"!=");try{return function(t,n){for(var e,r=t,i=n.length-1;i>0;i--){var u=n[i];e=[];for(var o=r.length/u,M=0;M<o;M++)e.push(r.slice(M*u,(M+1)*u));r=e}return r}(e,n)}catch(t){if(t instanceof pu)throw new pu(i,r,"!=");throw t}}function Su(t,n){var e=ku(t),r=t.slice(),i=t.indexOf(-1);if(t.indexOf(-1,i+1)>=0)throw new Error("More than one wildcard in sizes");if(i>=0){if(!(n%e==0))throw new Error("Could not replace wildcard, since "+n+" is no multiple of "+-e);r[i]=-n/e}return r}function ku(t){return t.reduce((t,n)=>t*n,1)}function vu(t,n,e,r){var i=r||du(t);if(e)for(var u=0;u<e;u++)t=[t],i.unshift(1);for(t=function t(n,e,r){var i,u;if(Array.isArray(n)){var o=r+1;for(i=0,u=n.length;i<u;i++)n[i]=t(n[i],e,o)}else for(var M=r;M<e;M++)n=[n];return n}(t,n,0);i.length<n;)i.push(1);return t}function Yu(t){if(!Array.isArray(t))return t;var n=[];return t.forEach((function t(e){Array.isArray(e)?e.forEach(t):n.push(e)})),n}function mu(t,n){for(var e,r=0,i=0;i<t.length;i++){var u=t[i],o=Array.isArray(u);if(0===i&&o&&(r=u.length),o&&u.length!==r)return;var M=o?mu(u,n):n(u);if(void 0===e)e=M;else if(e!==M)return"mixed"}return e}function Ru(t,n,e,r){if(r<e){if(t.length!==n.length)throw new pu(t.length,n.length);for(var i=[],u=0;u<t.length;u++)i[u]=Ru(t[u],n[u],e,r+1);return i}return t.concat(n)}function Fu(){var t=Array.prototype.slice.call(arguments,0,-1),n=Array.prototype.slice.call(arguments,-1);if(1===t.length)return t[0];if(t.length>1)return t.slice(1).reduce((function(t,e){return Ru(t,e,n,0)}),t[0]);throw new Error("Wrong number of arguments in function concat")}function bu(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];for(var r=n.map(t=>t.length),i=Math.max(...r),u=new Array(i).fill(null),o=0;o<n.length;o++)for(var M=n[o],c=r[o],N=0;N<c;N++){var a=i-c+N;M[N]>u[a]&&(u[a]=M[N])}for(var s=0;s<n.length;s++)Zu(n[s],u);return u}function Zu(t,n){for(var e=n.length,r=t.length,i=0;i<r;i++){var u=e-r+i;if(t[i]<n[u]&&t[i]>1||t[i]>n[u])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(t,") not possible to broadcast dimension ").concat(r," with size ").concat(t[i]," to size ").concat(n[u]))}}function Bu(t,n){var e=du(t);if(Dr(e,n))return t;Zu(e,n);var r,i,u,o=bu(e,n),M=o.length,c=[...Array(M-e.length).fill(1),...e],N=function(t){return Oe()([],t)}(t);e.length<M&&(e=du(N=Lu(N,c)));for(var a=0;a<M;a++)e[a]<o[a]&&(r=N,i=o[a],u=a,e=du(N=Fu(...Array(i).fill(r),u)));return N}function Vu(t,n,e,r){function i(r){var i=function(t,n){for(var e={},r=0;r<n.length;r++){var i=n[r],u=t[i];void 0!==u&&(e[i]=u)}return e}(r,n.map(Wu));return function(t,n,e){if(!n.filter(t=>!function(t){return t&&"?"===t[0]}(t)).every(t=>void 0!==e[t])){var r=n.filter(t=>void 0===e[t]);throw new Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(r.map(t=>'"'.concat(t,'"')).join(", "),"."))}}(t,n,r),e(i)}return i.isFactory=!0,i.fn=t,i.dependencies=n.slice().sort(),r&&(i.meta=r),i}function Wu(t){return t&&"?"===t[0]?t.slice(1):t}pu.prototype=new RangeError,pu.prototype.constructor=RangeError,pu.prototype.name="DimensionError",pu.prototype.isDimensionError=!0,Uu.prototype=new RangeError,Uu.prototype.constructor=RangeError,Uu.prototype.name="IndexError",Uu.prototype.isIndexError=!0;var Gu=Vu("BigNumber",["?on","config"],t=>{var{on:n,config:e}=t,r=Ki.clone({precision:e.precision,modulo:Ki.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type="BigNumber",r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},r.fromJSON=function(t){return new r(t.value)},n&&n("config",(function(t,n){t.precision!==n.precision&&r.config({precision:t.precision})})),r},{isClass:!0}),Pu=e(10),Ju=e.n(Pu),Hu=Vu("Complex",[],()=>(Object.defineProperty(Ju.a,"name",{value:"Complex"}),Ju.a.prototype.constructor=Ju.a,Ju.a.prototype.type="Complex",Ju.a.prototype.isComplex=!0,Ju.a.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Ju.a.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Ju.a.prototype.format=function(t){var n=this.im,e=this.re,r=ru(this.re,t),i=ru(this.im,t),u=Ae(t)?t:t?t.precision:null;if(null!==u){var o=Math.pow(10,-u);Math.abs(e/n)<o&&(e=0),Math.abs(n/e)<o&&(n=0)}return 0===n?r:0===e?1===n?"i":-1===n?"-i":i+"i":n<0?-1===n?r+" - i":r+" - "+i.substring(1)+"i":1===n?r+" + i":r+" + "+i+"i"},Ju.a.fromPolar=function(t){switch(arguments.length){case 1:var n=arguments[0];if("object"==typeof n)return Ju()(n);throw new TypeError("Input has to be an object with r and phi keys.");case 2:var e=arguments[0],r=arguments[1];if(Ae(e)){if(de(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),Ae(r))return new Ju.a({r:e,phi:r});throw new TypeError("Phi is not a number nor an angle unit.")}throw new TypeError("Radius r is not a number.");default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},Ju.a.prototype.valueOf=Ju.a.prototype.toString,Ju.a.fromJSON=function(t){return new Ju.a(t)},Ju.a.compare=function(t,n){return t.re>n.re?1:t.re<n.re?-1:t.im>n.im?1:t.im<n.im?-1:0},Ju.a),{isClass:!0});function Ku(t){var n=0,e=1,r=Object.create(null),i=Object.create(null),u=0,o=function(t){var o=i[t];if(o&&(delete r[o],delete i[t],--n,e===o)){if(!n)return u=0,void(e=1);for(;!Object.prototype.hasOwnProperty.call(r,++e););}};return t=Math.abs(t),{hit:function(M){var c=i[M],N=++u;if(r[N]=M,i[M]=N,!c){if(++n<=t)return;return M=r[e],o(M),M}if(delete r[c],e===c)for(;!Object.prototype.hasOwnProperty.call(r,++e););},delete:o,clear:function(){n=u=0,e=1,r=Object.create(null),i=Object.create(null)}}}function Xu(t){var{hasher:n,limit:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e=null==e?Number.POSITIVE_INFINITY:e,n=null==n?JSON.stringify:n,function r(){"object"!=typeof r.cache&&(r.cache={values:new Map,lru:Ku(e||Number.POSITIVE_INFINITY)});for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];var o=n(i);if(r.cache.values.has(o))return r.cache.lru.hit(o),r.cache.values.get(o);var M=t.apply(t,i);return r.cache.values.set(o,M),r.cache.values.delete(r.cache.lru.hit(o)),M}}function qu(t){return Object.keys(t.signatures||{}).reduce((function(t,n){var e=(n.match(/,/g)||[]).length+1;return Math.max(t,e)}),-1)}Xu((function(t){return new t(1).exp()}),{hasher:$u}),Xu((function(t){return new t(1).plus(new t(5).sqrt()).div(2)}),{hasher:$u});var _u=Xu((function(t){return t.acos(-1)}),{hasher:$u});Xu((function(t){return _u(t).times(2)}),{hasher:$u});function $u(t){return t[0].precision}Math.PI,Math.PI,Math.E;to("fineStructure",.0072973525693),to("weakMixingAngle",.2229),to("efimovFactor",22.7),to("sackurTetrode",-1.16487052358);function to(t,n){return Vu(t,["config","BigNumber"],t=>{var{config:e,BigNumber:r}=t;return"BigNumber"===e.number?new r(n):n})}var no=e(16),eo=e.n(no),ro=Vu("Fraction",[],()=>(Object.defineProperty(eo.a,"name",{value:"Fraction"}),eo.a.prototype.constructor=eo.a,eo.a.prototype.type="Fraction",eo.a.prototype.isFraction=!0,eo.a.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},eo.a.fromJSON=function(t){return new eo.a(t)},eo.a),{isClass:!0}),io=Vu("Matrix",[],()=>{function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator")}return t.prototype.type="Matrix",t.prototype.isMatrix=!0,t.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},t.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},t.prototype.create=function(t,n){throw new Error("Cannot invoke create on a Matrix interface")},t.prototype.subset=function(t,n,e){throw new Error("Cannot invoke subset on a Matrix interface")},t.prototype.get=function(t){throw new Error("Cannot invoke get on a Matrix interface")},t.prototype.set=function(t,n,e){throw new Error("Cannot invoke set on a Matrix interface")},t.prototype.resize=function(t,n){throw new Error("Cannot invoke resize on a Matrix interface")},t.prototype.reshape=function(t,n){throw new Error("Cannot invoke reshape on a Matrix interface")},t.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},t.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},t.prototype.map=function(t,n){throw new Error("Cannot invoke map on a Matrix interface")},t.prototype.forEach=function(t){throw new Error("Cannot invoke forEach on a Matrix interface")},t.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},t.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},t.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},t.prototype.format=function(t){throw new Error("Cannot invoke format on a Matrix interface")},t.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},t},{isClass:!0}),uo=Vu("DenseMatrix",["Matrix"],t=>{var{Matrix:n}=t;function e(t,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");if(n&&!Ce(n))throw new Error("Invalid datatype: "+n);if(we(t))"DenseMatrix"===t.type?(this._data=ar(t._data),this._size=ar(t._size),this._datatype=n||t._datatype):(this._data=t.toArray(),this._size=t.size(),this._datatype=n||t._datatype);else if(t&&Qe(t.data)&&Qe(t.size))this._data=t.data,this._size=t.size,Cu(this._data,this._size),this._datatype=n||t.datatype;else if(Qe(t))this._data=M(t),this._size=du(this._data),Cu(this._data,this._size),this._datatype=n;else{if(t)throw new TypeError("Unsupported type of data ("+Nr(t)+")");this._data=[],this._size=[0],this._datatype=n}}function r(t,n){if(!Ye(n))throw new TypeError("Invalid index");if(n.isScalar())return t.get(n.min());var r=n.size();if(r.length!==t._size.length)throw new pu(r.length,t._size.length);for(var i=n.min(),u=n.max(),o=0,M=t._size.length;o<M;o++)Qu(i[o],t._size[o]),Qu(u[o],t._size[o]);return new e(function t(n,e,r,i){var u=i===r-1,o=e.dimension(i);return u?o.map((function(t){return Qu(t,n.length),n[t]})).valueOf():o.map((function(u){Qu(u,n.length);var o=n[u];return t(o,e,r,i+1)})).valueOf()}(t._data,n,r.length,0),t._datatype)}function i(t,n,e,r){if(!n||!0!==n.isIndex)throw new TypeError("Invalid index");var i,u=n.size(),M=n.isScalar();if(we(e)?(i=e.size(),e=e.valueOf()):i=du(e),M){if(0!==i.length)throw new TypeError("Scalar expected");t.set(n.min(),e,r)}else{if(!Dr(i,u))try{i=du(e=0===i.length?Bu([e],u):Bu(e,u))}catch(t){}if(u.length<t._size.length)throw new pu(u.length,t._size.length,"<");if(i.length<u.length){for(var c=0,N=0;1===u[c]&&1===i[c];)c++;for(;1===u[c];)N++,c++;e=vu(e,u.length,N,i)}if(!Dr(u,i))throw new pu(u,i,">");o(t,n.max().map((function(t){return t+1})),r);var a=u.length;!function t(n,e,r,i,u){var o=u===i-1,M=e.dimension(u);o?M.forEach((function(t,e){Qu(t),n[t]=r[e[0]]})):M.forEach((function(o,M){Qu(o),t(n[o],e,r[M[0]],i,u+1)}))}(t._data,n,e,a,0)}return t}function u(t,n,e){if(0===n.length){for(var r=t._data;Qe(r);)r=r[0];return r}return t._size=n.slice(0),t._data=wu(t._data,t._size,e),t}function o(t,n,e){for(var r=t._size.slice(0),i=!1;r.length<n.length;)r.push(0),i=!0;for(var o=0,M=n.length;o<M;o++)n[o]>r[o]&&(r[o]=n[o],i=!0);i&&u(t,r,e)}function M(t){return we(t)?M(t.valueOf()):Qe(t)?t.map(M):t}return e.prototype=new n,e.prototype.createDenseMatrix=function(t,n){return new e(t,n)},Object.defineProperty(e,"name",{value:"DenseMatrix"}),e.prototype.constructor=e,e.prototype.type="DenseMatrix",e.prototype.isDenseMatrix=!0,e.prototype.getDataType=function(){return mu(this._data,Nr)},e.prototype.storage=function(){return"dense"},e.prototype.datatype=function(){return this._datatype},e.prototype.create=function(t,n){return new e(t,n)},e.prototype.subset=function(t,n,e){switch(arguments.length){case 1:return r(this,t);case 2:case 3:return i(this,t,n,e);default:throw new SyntaxError("Wrong number of arguments")}},e.prototype.get=function(t){if(!Qe(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new pu(t.length,this._size.length);for(var n=0;n<t.length;n++)Qu(t[n],this._size[n]);for(var e=this._data,r=0,i=t.length;r<i;r++){var u=t[r];Qu(u,e.length),e=e[u]}return e},e.prototype.set=function(t,n,e){if(!Qe(t))throw new TypeError("Array expected");if(t.length<this._size.length)throw new pu(t.length,this._size.length,"<");var r,i,u;o(this,t.map((function(t){return t+1})),e);var M=this._data;for(r=0,i=t.length-1;r<i;r++)Qu(u=t[r],M.length),M=M[u];return Qu(u=t[t.length-1],M.length),M[u]=n,this},e.prototype.resize=function(t,n,e){if(!Le(t))throw new TypeError("Array or Matrix expected");var r=t.valueOf().map(t=>Array.isArray(t)&&1===t.length?t[0]:t);return u(e?this.clone():this,r,n)},e.prototype.reshape=function(t,n){var e=n?this.clone():this;e._data=Lu(e._data,t);var r=e._size.reduce((t,n)=>t*n);return e._size=Su(t,r),e},e.prototype.clone=function(){return new e({data:ar(this._data),size:ar(this._size),datatype:this._datatype})},e.prototype.size=function(){return this._size.slice(0)},e.prototype.map=function(t){var n=this,r=qu(t),i=function e(i,u){return Qe(i)?i.map((function(t,n){return e(t,u.concat(n))})):1===r?t(i):2===r?t(i,u):t(i,u,n)}(this._data,[]);return new e(i,void 0!==this._datatype?mu(i,Nr):void 0)},e.prototype.forEach=function(t){var n=this;!function e(r,i){Qe(r)?r.forEach((function(t,n){e(t,i.concat(n))})):t(r,i,n)}(this._data,[])},e.prototype[Symbol.iterator]=function*(){yield*function*t(n,e){if(Qe(n))for(var r=0;r<n.length;r++)yield*t(n[r],e.concat(r));else yield{value:n,index:e}}(this._data,[])},e.prototype.rows=function(){var t=[];if(2!==this.size().length)throw new TypeError("Rows can only be returned for a 2D matrix.");var n=this._data;for(var r of n)t.push(new e([r],this._datatype));return t},e.prototype.columns=function(){var t=this,n=[],r=this.size();if(2!==r.length)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var i=this._data,u=function(r){var u=i.map(t=>[t[r]]);n.push(new e(u,t._datatype))},o=0;o<r[1];o++)u(o);return n},e.prototype.toArray=function(){return ar(this._data)},e.prototype.valueOf=function(){return this._data},e.prototype.format=function(t){return Ou(this._data,t)},e.prototype.toString=function(){return Ou(this._data)},e.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},e.prototype.diagonal=function(t){if(t){if(fe(t)&&(t=t.toNumber()),!Ae(t)||!Xi(t))throw new TypeError("The parameter k must be an integer number")}else t=0;for(var n=t>0?t:0,r=t<0?-t:0,i=this._size[0],u=this._size[1],o=Math.min(i-r,u-n),M=[],c=0;c<o;c++)M[c]=this._data[c+r][c+n];return new e({data:M,size:[o],datatype:this._datatype})},e.diagonal=function(t,n,r,i){if(!Qe(t))throw new TypeError("Array expected, size parameter");if(2!==t.length)throw new Error("Only two dimensions matrix are supported");if(t=t.map((function(t){if(fe(t)&&(t=t.toNumber()),!Ae(t)||!Xi(t)||t<1)throw new Error("Size values must be positive integers");return t})),r){if(fe(r)&&(r=r.toNumber()),!Ae(r)||!Xi(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var u,o=r>0?r:0,M=r<0?-r:0,c=t[0],N=t[1],a=Math.min(c-M,N-o);if(Qe(n)){if(n.length!==a)throw new Error("Invalid value array length");u=function(t){return n[t]}}else if(we(n)){var s=n.size();if(1!==s.length||s[0]!==a)throw new Error("Invalid matrix length");u=function(t){return n.get([t])}}else u=function(){return n};i||(i=fe(u(0))?u(0).mul(0):0);var D=[];if(t.length>0){D=wu(D,t,i);for(var T=0;T<a;T++)D[T+M][T+o]=u(T)}return new e({data:D,size:[c,N]})},e.fromJSON=function(t){return new e(t)},e.prototype.swapRows=function(t,n){if(!(Ae(t)&&Xi(t)&&Ae(n)&&Xi(n)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return Qu(t,this._size[0]),Qu(n,this._size[0]),e._swapRows(t,n,this._data),this},e._swapRows=function(t,n,e){var r=e[t];e[t]=e[n],e[n]=r},e},{isClass:!0});function oo(){return!0}function Mo(){return!1}function co(){}var No=function t(){function n(t){return"object"==typeof t&&null!==t&&t.constructor===Object}const e=[{name:"number",test:function(t){return"number"==typeof t}},{name:"string",test:function(t){return"string"==typeof t}},{name:"boolean",test:function(t){return"boolean"==typeof t}},{name:"Function",test:function(t){return"function"==typeof t}},{name:"Array",test:Array.isArray},{name:"Date",test:function(t){return t instanceof Date}},{name:"RegExp",test:function(t){return t instanceof RegExp}},{name:"Object",test:n},{name:"null",test:function(t){return null===t}},{name:"undefined",test:function(t){return void 0===t}}],r={name:"any",test:oo,isAny:!0};let i,u,o=0,M={createCount:0};function c(t){const n=i.get(t);if(n)return n;let e='Unknown type "'+t+'"';const r=t.toLowerCase();let o;for(o of u)if(o.toLowerCase()===r){e+='. Did you mean "'+o+'" ?';break}throw new TypeError(e)}function N(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";const e=n?c(n).index:u.length,r=[];for(let n=0;n<t.length;++n){if(!t[n]||"string"!=typeof t[n].name||"function"!=typeof t[n].test)throw new TypeError("Object with properties {name: string, test: function} expected");const u=t[n].name;if(i.has(u))throw new TypeError('Duplicate type name "'+u+'"');r.push(u),i.set(u,{name:u,test:t[n].test,isAny:t[n].isAny,index:e+n,conversionsTo:[]})}const o=u.slice(e);u=u.slice(0,e).concat(r).concat(o);for(let t=e+r.length;t<u.length;++t)i.get(u[t]).index=t}function a(){i=new Map,u=[],o=0,N([r],!1)}function s(t){const n=u.filter(n=>{const e=i.get(n);return!e.isAny&&e.test(t)});return n.length?n:["any"]}function D(t){return t&&"function"==typeof t&&"_typedFunctionData"in t}function T(t,n,e){if(!D(t))throw new TypeError("Argument is not a typed-function.");const r=e&&e.exact,i=h(Array.isArray(n)?n.join(","):n),u=g(i);if(!r||u in t.signatures){const n=t._typedFunctionData.signatureMap.get(u);if(n)return n}const o=i.length;let M,c;if(r){let n;for(n in M=[],t.signatures)M.push(t._typedFunctionData.signatureMap.get(n))}else M=t._typedFunctionData.signatures;for(let t=0;t<o;++t){const n=i[t],e=[];let r;for(r of M){const i=O(r.params,t);if(i&&(!n.restParam||i.restParam)){if(!i.hasAny){const t=y(i);if(n.types.some(n=>!t.has(n.name)))continue}e.push(r)}}if(M=e,0===M.length)break}for(c of M)if(c.params.length<=o)return c;throw new TypeError("Signature not found (signature: "+(t.name||"unnamed")+"("+g(i,", ")+"))")}function g(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return t.map(t=>t.name).join(n)}function l(t){const n=0===t.indexOf("..."),e=(n?t.length>3?t.slice(3):"any":t).split("|").map(t=>c(t.trim()));let r=!1,i=n?"...":"";return{types:e.map((function(t){return r=t.isAny||r,i+=t.name+"|",{name:t.name,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:null,conversionIndex:-1}})),name:i.slice(0,-1),hasAny:r,hasConversion:!1,restParam:n}}function I(t){const n=function(t){if(0===t.length)return[];const n=t.map(c);t.length>1&&n.sort((t,n)=>t.index-n.index);let e=n[0].conversionsTo;if(1===t.length)return e;e=e.concat([]);const r=new Set(t);for(let t=1;t<n.length;++t){let i;for(i of n[t].conversionsTo)r.has(i.from)||(e.push(i),r.add(i.from))}return e}(t.types.map(t=>t.name));let e=t.hasAny,r=t.name;const i=n.map((function(t){const n=c(t.from);return e=n.isAny||e,r+="|"+t.from,{name:t.from,typeIndex:n.index,test:n.test,isAny:n.isAny,conversion:t,conversionIndex:t.index}}));return{types:t.types.concat(i),name:r,hasAny:e,hasConversion:i.length>0,restParam:t.restParam}}function y(t){return t.typeSet||(t.typeSet=new Set,t.types.forEach(n=>t.typeSet.add(n.name))),t.typeSet}function h(t){const n=[];if("string"!=typeof t)throw new TypeError("Signatures must be strings");const e=t.trim();if(""===e)return n;const r=e.split(",");for(let t=0;t<r.length;++t){const e=l(r[t].trim());if(e.restParam&&t!==r.length-1)throw new SyntaxError('Unexpected rest parameter "'+r[t]+'": only allowed for the last parameter');if(0===e.types.length)return null;n.push(e)}return n}function j(t){const n=b(t);return!!n&&n.restParam}function x(t){if(t&&0!==t.types.length){if(1===t.types.length)return c(t.types[0].name).test;if(2===t.types.length){const n=c(t.types[0].name).test,e=c(t.types[1].name).test;return function(t){return n(t)||e(t)}}{const n=t.types.map((function(t){return c(t.name).test}));return function(t){for(let e=0;e<n.length;e++)if(n[e](t))return!0;return!1}}}return oo}function z(t){let n,e,r;if(j(t)){n=F(t).map(x);const e=n.length,r=x(b(t)),i=function(t){for(let n=e;n<t.length;n++)if(!r(t[n]))return!1;return!0};return function(t){for(let e=0;e<n.length;e++)if(!n[e](t[e]))return!1;return i(t)&&t.length>=e+1}}return 0===t.length?function(t){return 0===t.length}:1===t.length?(e=x(t[0]),function(t){return e(t[0])&&1===t.length}):2===t.length?(e=x(t[0]),r=x(t[1]),function(t){return e(t[0])&&r(t[1])&&2===t.length}):(n=t.map(x),function(t){for(let e=0;e<n.length;e++)if(!n[e](t[e]))return!1;return t.length===n.length})}function O(t,n){return n<t.length?t[n]:j(t)?b(t):null}function E(t,n){const e=O(t,n);return e?y(e):new Set}function A(t){return null===t.conversion||void 0===t.conversion}function f(t,n){const e=new Set;return t.forEach(t=>{const r=E(t.params,n);let i;for(i of r)e.add(i)}),e.has("any")?["any"]:Array.from(e)}function p(t,n,e){let r,i;const u=t||"unnamed";let o,M=e;for(o=0;o<n.length;o++){const t=[];if(M.forEach(e=>{const r=x(O(e.params,o));(o<e.params.length||j(e.params))&&r(n[o])&&t.push(e)}),0===t.length){if(i=f(M,o),i.length>0){const t=s(n[o]);return r=new TypeError("Unexpected type of argument in function "+u+" (expected: "+i.join(" or ")+", actual: "+t.join(" | ")+", index: "+o+")"),r.data={category:"wrongType",fn:u,index:o,actual:t,expected:i},r}}else M=t}const c=M.map((function(t){return j(t.params)?1/0:t.params.length}));if(n.length<Math.min.apply(null,c))return i=f(M,o),r=new TypeError("Too few arguments in function "+u+" (expected: "+i.join(" or ")+", index: "+n.length+")"),r.data={category:"tooFewArgs",fn:u,index:n.length,expected:i},r;const N=Math.max.apply(null,c);if(n.length>N)return r=new TypeError("Too many arguments in function "+u+" (expected: "+N+", actual: "+n.length+")"),r.data={category:"tooManyArgs",fn:u,index:n.length,expectedLength:N},r;const a=[];for(let t=0;t<n.length;++t)a.push(s(n[t]).join("|"));return r=new TypeError('Arguments of type "'+a.join(", ")+'" do not match any of the defined signatures of function '+u+"."),r.data={category:"mismatch",actual:a},r}function U(t){let n=u.length+1;for(let e=0;e<t.types.length;e++)A(t.types[e])&&(n=Math.min(n,t.types[e].typeIndex));return n}function d(t){let n=o+1;for(let e=0;e<t.types.length;e++)A(t.types[e])||(n=Math.min(n,t.types[e].conversionIndex));return n}function C(t,n){if(t.hasAny){if(!n.hasAny)return 1}else if(n.hasAny)return-1;if(t.restParam){if(!n.restParam)return 1}else if(n.restParam)return-1;if(t.hasConversion){if(!n.hasConversion)return 1}else if(n.hasConversion)return-1;const e=U(t)-U(n);if(e<0)return-1;if(e>0)return 1;const r=d(t)-d(n);return r<0?-1:r>0?1:0}function Q(t,n){const e=t.params,r=n.params,i=b(e),u=b(r),o=j(e),M=j(r);if(o&&i.hasAny){if(!M||!u.hasAny)return 1}else if(M&&u.hasAny)return-1;let c,N=0,a=0;for(c of e)c.hasAny&&++N,c.hasConversion&&++a;let s=0,D=0;for(c of r)c.hasAny&&++s,c.hasConversion&&++D;if(N!==s)return N-s;if(o&&i.hasConversion){if(!M||!u.hasConversion)return 1}else if(M&&u.hasConversion)return-1;if(a!==D)return a-D;if(o){if(!M)return 1}else if(M)return-1;const T=(e.length-r.length)*(o?-1:1);if(0!==T)return T;const g=[];let l,I=0;for(let t=0;t<e.length;++t){const n=C(e[t],r[t]);g.push(n),I+=n}if(0!==I)return I;for(l of g)if(0!==l)return l;return 0}function w(t,n){let e=n;if(t.some(t=>t.hasConversion)){const r=j(t),i=t.map(L);e=function(){const t=[],e=r?arguments.length-1:arguments.length;for(let n=0;n<e;n++)t[n]=i[n](arguments[n]);return r&&(t[e]=arguments[e].map(i[e])),n.apply(this,t)}}let r=e;if(j(t)){const n=t.length-1;r=function(){return e.apply(this,Z(arguments,0,n).concat([Z(arguments,n)]))}}return r}function L(t){let n,e,r,i;const u=[],o=[];switch(t.types.forEach((function(t){t.conversion&&(u.push(c(t.conversion.from).test),o.push(t.conversion.convert))})),o.length){case 0:return function(t){return t};case 1:return n=u[0],r=o[0],function(t){return n(t)?r(t):t};case 2:return n=u[0],e=u[1],r=o[0],i=o[1],function(t){return n(t)?r(t):e(t)?i(t):t};default:return function(t){for(let n=0;n<o.length;n++)if(u[n](t))return o[n](t);return t}}}function S(t){return function t(n,e,r){if(e<n.length){const o=n[e];let M=[];if(o.restParam){const t=o.types.filter(A);t.length<o.types.length&&M.push({types:t,name:"..."+t.map(t=>t.name).join("|"),hasAny:t.some(t=>t.isAny),hasConversion:!1,restParam:!0}),M.push(o)}else M=o.types.map((function(t){return{types:[t],name:t.name,hasAny:t.isAny,hasConversion:t.conversion,restParam:!1}}));return i=M,u=function(i){return t(n,e+1,r.concat([i]))},Array.prototype.concat.apply([],i.map(u))}return[r];var i,u}(t,0,[])}function k(t,n){const e=Math.max(t.length,n.length);for(let r=0;r<e;r++){const e=E(t,r),i=E(n,r);let u,o=!1;for(u of i)if(e.has(u)){o=!0;break}if(!o)return!1}const r=t.length,i=n.length,u=j(t),o=j(n);return u?o?r===i:i>=r:o?r>=i:r===i}function v(t,n,e){const r=[];let i;for(i of t){let t=e[i];if("number"!=typeof t)throw new TypeError('No definition for referenced signature "'+i+'"');if(t=n[t],"function"!=typeof t)return!1;r.push(t)}return r}function Y(t,n,e){const r=function(t){return t.map(t=>G(t)?V(t.referToSelf.callback):W(t)?B(t.referTo.references,t.referTo.callback):t)}(t),i=new Array(r.length).fill(!1);let u=!0;for(;u;){u=!1;let t=!0;for(let o=0;o<r.length;++o){if(i[o])continue;const M=r[o];if(G(M))r[o]=M.referToSelf.callback(e),r[o].referToSelf=M.referToSelf,i[o]=!0,t=!1;else if(W(M)){const e=v(M.referTo.references,r,n);e?(r[o]=M.referTo.callback.apply(this,e),r[o].referTo=M.referTo,i[o]=!0,t=!1):u=!0}}if(t&&u)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return r}function m(t,n){if(M.createCount++,0===Object.keys(n).length)throw new SyntaxError("No signatures provided");M.warnAgainstDeprecatedThis&&function(t){const n=/\bthis(\(|\.signatures\b)/;Object.keys(t).forEach(e=>{const r=t[e];if(n.test(r.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}(n);const e=[],r=[],i={},u=[];let o;for(o in n){if(!Object.prototype.hasOwnProperty.call(n,o))continue;const t=h(o);if(!t)continue;e.forEach((function(n){if(k(n,t))throw new TypeError('Conflicting signatures "'+g(n)+'" and "'+g(t)+'".')})),e.push(t);const M=r.length;r.push(n[o]);const c=t.map(I);let N;for(N of S(c)){const t=g(N);u.push({params:N,name:t,fn:M}),N.every(t=>!t.hasConversion)&&(i[t]=M)}}u.sort(Q);const c=Y(r,i,ut);let N;for(N in i)Object.prototype.hasOwnProperty.call(i,N)&&(i[N]=c[i[N]]);const a=[],s=new Map;for(N of u)s.has(N.name)||(N.fn=c[N.fn],a.push(N),s.set(N.name,N));const D=a[0]&&a[0].params.length<=2&&!j(a[0].params),T=a[1]&&a[1].params.length<=2&&!j(a[1].params),l=a[2]&&a[2].params.length<=2&&!j(a[2].params),y=a[3]&&a[3].params.length<=2&&!j(a[3].params),O=a[4]&&a[4].params.length<=2&&!j(a[4].params),E=a[5]&&a[5].params.length<=2&&!j(a[5].params),A=D&&T&&l&&y&&O&&E;for(let t=0;t<a.length;++t)a[t].test=z(a[t].params);const f=D?x(a[0].params[0]):Mo,p=T?x(a[1].params[0]):Mo,U=l?x(a[2].params[0]):Mo,d=y?x(a[3].params[0]):Mo,C=O?x(a[4].params[0]):Mo,L=E?x(a[5].params[0]):Mo,v=D?x(a[0].params[1]):Mo,m=T?x(a[1].params[1]):Mo,R=l?x(a[2].params[1]):Mo,F=y?x(a[3].params[1]):Mo,b=O?x(a[4].params[1]):Mo,Z=E?x(a[5].params[1]):Mo;for(let t=0;t<a.length;++t)a[t].implementation=w(a[t].params,a[t].fn);const B=D?a[0].implementation:co,V=T?a[1].implementation:co,W=l?a[2].implementation:co,G=y?a[3].implementation:co,P=O?a[4].implementation:co,J=E?a[5].implementation:co,H=D?a[0].params.length:-1,K=T?a[1].params.length:-1,X=l?a[2].params.length:-1,q=y?a[3].params.length:-1,_=O?a[4].params.length:-1,$=E?a[5].params.length:-1,tt=A?6:0,nt=a.length,et=a.map(t=>t.test),rt=a.map(t=>t.implementation),it=function(){for(let t=tt;t<nt;t++)if(et[t](arguments))return rt[t].apply(this,arguments);return M.onMismatch(t,arguments,a)};function ut(t,n){return arguments.length===H&&f(t)&&v(n)?B.apply(this,arguments):arguments.length===K&&p(t)&&m(n)?V.apply(this,arguments):arguments.length===X&&U(t)&&R(n)?W.apply(this,arguments):arguments.length===q&&d(t)&&F(n)?G.apply(this,arguments):arguments.length===_&&C(t)&&b(n)?P.apply(this,arguments):arguments.length===$&&L(t)&&Z(n)?J.apply(this,arguments):it.apply(this,arguments)}try{Object.defineProperty(ut,"name",{value:t})}catch(t){}return ut.signatures=i,ut._typedFunctionData={signatures:a,signatureMap:s},ut}function R(t,n,e){throw p(t,n,e)}function F(t){return Z(t,0,t.length-1)}function b(t){return t[t.length-1]}function Z(t,n,e){return Array.prototype.slice.call(t,n,e)}function B(t,n){return{referTo:{references:t,callback:n}}}function V(t){if("function"!=typeof t)throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:t}}}function W(t){return t&&"object"==typeof t.referTo&&Array.isArray(t.referTo.references)&&"function"==typeof t.referTo.callback}function G(t){return t&&"object"==typeof t.referToSelf&&"function"==typeof t.referToSelf.callback}function P(t,n){if(!t)return n;if(n&&n!==t){const e=new Error("Function names do not match (expected: "+t+", actual: "+n+")");throw e.data={actual:n,expected:t},e}return t}function J(t){let n;for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(D(t[e])||"string"==typeof t[e].signature)&&(n=P(n,t[e].name));return n}function H(t,n){let e;for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)){if(e in t&&n[e]!==t[e]){const r=new Error('Signature "'+e+'" is defined twice');throw r.data={signature:e,sourceFunction:n[e],destFunction:t[e]},r}t[e]=n[e]}}a(),N(e);const K=M;function X(t){if(!t||"string"!=typeof t.from||"string"!=typeof t.to||"function"!=typeof t.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(t.to===t.from)throw new SyntaxError('Illegal to define conversion from "'+t.from+'" to itself.')}return M=function(t){const e="string"==typeof t,r=e?1:0;let i=e?t:"";const u={};for(let t=r;t<arguments.length;++t){const r=arguments[t];let o,M={};if("function"==typeof r?(o=r.name,"string"==typeof r.signature?M[r.signature]=r:D(r)&&(M=r.signatures)):n(r)&&(M=r,e||(o=J(r))),0===Object.keys(M).length){const n=new TypeError("Argument to 'typed' at index "+t+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw n.data={index:t,argument:r},n}e||(i=P(i,o)),H(u,M)}return m(i||"",u)},M.create=t,M.createCount=K.createCount,M.onMismatch=R,M.throwMismatchError=R,M.createError=p,M.clear=a,M.clearConversions=function(){let t;for(t of u)i.get(t).conversionsTo=[];o=0},M.addTypes=N,M._findType=c,M.referTo=function(){const t=F(arguments).map(t=>g(h(t))),n=b(arguments);if("function"!=typeof n)throw new TypeError("Callback function expected as last argument");return B(t,n)},M.referToSelf=V,M.convert=function(t,n){const e=c(n);if(e.test(t))return t;const r=e.conversionsTo;if(0===r.length)throw new Error("There are no conversions to "+n+" defined.");for(let n=0;n<r.length;n++){if(c(r[n].from).test(t))return r[n].convert(t)}throw new Error("Cannot convert "+t+" to "+n)},M.findSignature=T,M.find=function(t,n,e){return T(t,n,e).implementation},M.isTypedFunction=D,M.warnAgainstDeprecatedThis=!0,M.addType=function(t,n){let e="any";!1!==n&&i.has("Object")&&(e="Object"),M.addTypes([t],e)},M.addConversion=function(t){X(t);const n=c(t.to);if(!n.conversionsTo.every((function(n){return n.from!==t.from})))throw new Error('There is already a conversion from "'+t.from+'" to "'+n.name+'"');n.conversionsTo.push({from:t.from,convert:t.convert,index:o++})},M.addConversions=function(t){t.forEach(M.addConversion)},M.removeConversion=function(t){X(t);const n=c(t.to),e=function(t,n){for(let e=0;e<t.length;e++)if(n(t[e]))return t[e]}(n.conversionsTo,n=>n.from===t.from);if(!e)throw new Error("Attempt to remove nonexistent conversion from "+t.from+" to "+t.to);if(e.convert!==t.convert)throw new Error("Conversion to remove does not match existing conversion");const r=n.conversionsTo.indexOf(e);n.conversionsTo.splice(r,1)},M.resolve=function(t,n){if(!D(t))throw new TypeError("Argument is not a typed-function.");const e=t._typedFunctionData.signatures;for(let t=0;t<e.length;++t)if(e[t].test(n))return e[t];return null},M}();function ao(t,n){if(go(t)&&Do(t,n))return t[n];if("function"==typeof t[n]&&To(t,n))throw new Error('Cannot access method "'+n+'" as a property');throw new Error('No access to property "'+n+'"')}function so(t,n,e){if(go(t)&&Do(t,n))return t[n]=e,e;throw new Error('No access to property "'+n+'"')}function Do(t,n){return!(!t||"object"!=typeof t)&&(!!Tr(lo,n)||!(n in Object.prototype)&&!(n in Function.prototype))}function To(t,n){return null!=t&&"function"==typeof t[n]&&(!(Tr(t,n)&&Object.getPrototypeOf&&n in Object.getPrototypeOf(t))&&(!!Tr(Io,n)||!(n in Object.prototype)&&!(n in Function.prototype)))}function go(t){return"object"==typeof t&&t&&t.constructor===Object}var lo={length:!0,name:!0},Io={toString:!0,valueOf:!0,toLocaleString:!0};class yo{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(t){return ao(this.wrappedObject,t)}set(t,n){return so(this.wrappedObject,t,n),this}has(t){return n=this.wrappedObject,t in n;var n}entries(){return ho(this.keys(),t=>[t,this.get(t)])}forEach(t){for(var n of this.keys())t(this.get(n),n,this)}delete(t){delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}}function ho(t,n){return{next:()=>{var e=t.next();return e.done?e:{value:n(e.value),done:!1}}}}function jo(t){return!!t&&(t instanceof Map||t instanceof yo||"function"==typeof t.set&&"function"==typeof t.get&&"function"==typeof t.keys&&"function"==typeof t.has)}var xo=function(){return xo=No.create,No},zo=Vu("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(t){var{BigNumber:n,Complex:e,DenseMatrix:r,Fraction:i}=t,u=xo();return u.clear(),u.addTypes([{name:"number",test:Ae},{name:"Complex",test:pe},{name:"BigNumber",test:fe},{name:"Fraction",test:Ue},{name:"Unit",test:de},{name:"identifier",test:t=>Ce&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(t)},{name:"string",test:Ce},{name:"Chain",test:cr},{name:"Array",test:Qe},{name:"Matrix",test:we},{name:"DenseMatrix",test:Se},{name:"SparseMatrix",test:ke},{name:"Range",test:ve},{name:"Index",test:Ye},{name:"boolean",test:me},{name:"ResultSet",test:Re},{name:"Help",test:Fe},{name:"function",test:be},{name:"Date",test:Ze},{name:"RegExp",test:Be},{name:"null",test:We},{name:"undefined",test:Ge},{name:"AccessorNode",test:Pe},{name:"ArrayNode",test:Je},{name:"AssignmentNode",test:He},{name:"BlockNode",test:Ke},{name:"ConditionalNode",test:Xe},{name:"ConstantNode",test:qe},{name:"FunctionNode",test:$e},{name:"FunctionAssignmentNode",test:_e},{name:"IndexNode",test:tr},{name:"Node",test:nr},{name:"ObjectNode",test:er},{name:"OperatorNode",test:rr},{name:"ParenthesisNode",test:ir},{name:"RangeNode",test:ur},{name:"RelationalNode",test:or},{name:"SymbolNode",test:Mr},{name:"Map",test:jo},{name:"Object",test:Ve}]),u.addConversions([{from:"number",to:"BigNumber",convert:function(t){if(n||Oo(t),t.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+t+"). Use function bignumber(x) to convert to BigNumber.");return new n(t)}},{from:"number",to:"Complex",convert:function(t){return e||Eo(t),new e(t,0)}},{from:"BigNumber",to:"Complex",convert:function(t){return e||Eo(t),new e(t.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(t){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(t){return e||Eo(t),new e(t.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(t){i||Ao(t);var n=new i(t);if(n.valueOf()!==t)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+t+"). Use function fraction(x) to convert to Fraction.");return n}},{from:"string",to:"number",convert:function(t){var n=Number(t);if(isNaN(n))throw new Error('Cannot convert "'+t+'" to a number');return n}},{from:"string",to:"BigNumber",convert:function(t){n||Oo(t);try{return new n(t)}catch(n){throw new Error('Cannot convert "'+t+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(t){i||Ao(t);try{return new i(t)}catch(n){throw new Error('Cannot convert "'+t+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(t){e||Eo(t);try{return new e(t)}catch(n){throw new Error('Cannot convert "'+t+'" to Complex')}}},{from:"boolean",to:"number",convert:function(t){return+t}},{from:"boolean",to:"BigNumber",convert:function(t){return n||Oo(t),new n(+t)}},{from:"boolean",to:"Fraction",convert:function(t){return i||Ao(t),new i(+t)}},{from:"boolean",to:"string",convert:function(t){return String(t)}},{from:"Array",to:"Matrix",convert:function(t){return r||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new r(t)}},{from:"Matrix",to:"Array",convert:function(t){return t.valueOf()}}]),u.onMismatch=(t,n,e)=>{var r=u.createError(t,n,e);if(["wrongType","mismatch"].includes(r.data.category)&&1===n.length&&Le(n[0])&&e.some(t=>!t.params.includes(","))){var i=new TypeError("Function '".concat(t,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(t,")'."));throw i.data=r.data,i}throw r},u.onMismatch=(t,n,e)=>{var r=u.createError(t,n,e);if(["wrongType","mismatch"].includes(r.data.category)&&1===n.length&&Le(n[0])&&e.some(t=>!t.params.includes(","))){var i=new TypeError("Function '".concat(t,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(t,")'."));throw i.data=r.data,i}throw r},u}));function Oo(t){throw new Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function Eo(t){throw new Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function Ao(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}function fo(t,n,e){return t&&"function"==typeof t.map?t.map((function(t){return fo(t,n,e)})):n(t)}var po="number",Uo="number, number";function Co(t){return Math.abs(t)}function Qo(t,n){return t+n}function wo(t,n){return t-n}function Lo(t,n){return t*n}function So(t){return-t}function ko(t){return t}function vo(t){return tu(t)}function Yo(t){return t*t*t}function mo(t){return Math.exp(t)}function Ro(t){return nu(t)}function Fo(t,n){if(!Xi(t)||!Xi(n))throw new Error("Parameters in function lcm must be integer numbers");if(0===t||0===n)return 0;for(var e,r=t*n;0!==n;)n=t%(e=n),t=e;return Math.abs(r/t)}function bo(t){return $i(t)}function Zo(t){return _i(t)}function Bo(t){return qi(t)}function Vo(t){return t*t}function Wo(t,n){var e,r,i,u=0,o=1,M=1,c=0;if(!Xi(t)||!Xi(n))throw new Error("Parameters in function xgcd must be integer numbers");for(;n;)i=t-(r=Math.floor(t/n))*n,e=u,u=o-r*u,o=e,e=M,M=c-r*M,c=e,t=n,n=i;return t<0?[-t,-o,-c]:[t,t?o:0,c]}function Go(t,n){return t*t<1&&n===1/0||t*t>1&&n===-1/0?0:Math.pow(t,n)}Co.signature=po,Qo.signature=Uo,wo.signature=Uo,Lo.signature=Uo,So.signature=po,ko.signature=po,vo.signature=po,Yo.signature=po,mo.signature=po,Ro.signature=po,Fo.signature=Uo,bo.signature=po,Zo.signature=po,Bo.signature=po,Vo.signature=po,Wo.signature=Uo,Go.signature=Uo;function Po(t){return Du(t)}function Jo(t){return Math.atan(1/t)}function Ho(t){return isFinite(t)?(Math.log((t+1)/t)+Math.log(t/(t-1)))/2:0}function Ko(t){return Math.asin(1/t)}function Xo(t){var n=1/t;return Math.log(n+Math.sqrt(n*n+1))}function qo(t){return Math.acos(1/t)}function _o(t){var n=1/t,e=Math.sqrt(n*n-1);return Math.log(e+n)}function $o(t){return Tu(t)}function tM(t){return gu(t)}function nM(t){return 1/Math.tan(t)}function eM(t){var n=Math.exp(2*t);return(n+1)/(n-1)}function rM(t){return 1/Math.sin(t)}function iM(t){return 0===t?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(t)-Math.exp(-t)))*qi(t)}function uM(t){return 1/Math.cos(t)}function oM(t){return 2/(Math.exp(t)+Math.exp(-t))}function MM(t){return lu(t)}Po.signature="number",Jo.signature="number",Ho.signature="number",Ko.signature="number",Xo.signature="number",qo.signature="number",_o.signature="number",$o.signature="number",tM.signature="number",nM.signature="number",eM.signature="number",rM.signature="number",iM.signature="number",uM.signature="number",oM.signature="number",MM.signature="number";var cM=Vu("addScalar",["typed"],t=>{var{typed:n}=t;return n("addScalar",{"number, number":Qo,"Complex, Complex":function(t,n){return t.add(n)},"BigNumber, BigNumber":function(t,n){return t.plus(n)},"Fraction, Fraction":function(t,n){return t.add(n)},"Unit, Unit":n.referToSelf(t=>(e,r)=>{if(null===e.value||void 0===e.value)throw new Error("Parameter x contains a unit with undefined value");if(null===r.value||void 0===r.value)throw new Error("Parameter y contains a unit with undefined value");if(!e.equalBase(r))throw new Error("Units do not match");var i=e.clone();return i.value=n.find(t,[i.valueType(),r.valueType()])(i.value,r.value),i.fixPrefix=!1,i})})});var NM="number, number";function aM(t,n){if(!Xi(t)||!Xi(n))throw new Error("Integers expected in function bitAnd");return t&n}function sM(t){if(!Xi(t))throw new Error("Integer expected in function bitNot");return~t}function DM(t,n){if(!Xi(t)||!Xi(n))throw new Error("Integers expected in function bitOr");return t|n}function TM(t,n){if(!Xi(t)||!Xi(n))throw new Error("Integers expected in function bitXor");return t^n}function gM(t,n){if(!Xi(t)||!Xi(n))throw new Error("Integers expected in function leftShift");return t<<n}function lM(t,n){if(!Xi(t)||!Xi(n))throw new Error("Integers expected in function rightArithShift");return t>>n}function IM(t,n){if(!Xi(t)||!Xi(n))throw new Error("Integers expected in function rightLogShift");return t>>>n}aM.signature=NM,sM.signature="number",DM.signature=NM,TM.signature=NM,gM.signature=NM,lM.signature=NM,IM.signature=NM;function yM(t,n){if(n<t)return 1;if(n===t)return n;var e=n+t>>1;return yM(t,e)*yM(e+1,n)}function hM(t,n){if(!Xi(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(!Xi(n)||n<0)throw new TypeError("Positive integer value expected in function combinations");if(n>t)throw new TypeError("k must be less than or equal to n");for(var e=t-n,r=1,i=2,u=n<e?n:e,o=n<e?e+1:n+1;o<=t;++o)for(r*=o;i<=u&&r%i==0;)r/=i,++i;return i<=u&&(r/=yM(i,u)),r}hM.signature="number, number";var jM=Vu("conj",["typed"],t=>{var{typed:n}=t;return n("conj",{"number | BigNumber | Fraction":t=>t,Complex:t=>t.conjugate(),"Array | Matrix":n.referToSelf(t=>n=>fo(n,t))})});function xM(t,n,e){if(null==e)return t.eq(n);if(t.eq(n))return!0;if(t.isNaN()||n.isNaN())return!1;if(t.isFinite()&&n.isFinite()){var r=t.minus(n).abs();if(r.isZero())return!0;var i=t.constructor.max(t.abs(),n.abs());return r.lte(i.times(e))}return!1}var zM=Vu("compareUnits",["typed"],t=>{var{typed:n}=t;return{"Unit, Unit":n.referToSelf(t=>(e,r)=>{if(!e.equalBase(r))throw new Error("Cannot compare units with different base");return n.find(t,[e.valueType(),r.valueType()])(e.value,r.value)})}}),OM=Vu("equalScalar",["typed","config"],t=>{var{typed:n,config:e}=t;return n("equalScalar",{"boolean, boolean":function(t,n){return t===n},"number, number":function(t,n){return su(t,n,e.epsilon)},"BigNumber, BigNumber":function(t,n){return t.eq(n)||xM(t,n,e.epsilon)},"Fraction, Fraction":function(t,n){return t.equals(n)},"Complex, Complex":function(t,n){return function(t,n,e){return su(t.re,n.re,e)&&su(t.im,n.im,e)}(t,n,e.epsilon)}},zM({typed:n}))});Vu("equalScalar",["typed","config"],t=>{var{typed:n,config:e}=t;return n("equalScalar",{"number, number":function(t,n){return su(t,n,e.epsilon)}})}),Math.pow(2,53);Vu("hex",["typed","format"],t=>{var{typed:n,format:e}=t;return n("hex",{"number | BigNumber":function(t){return e(t,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(t,n){return e(t,{notation:"hex",wordSize:n})}})});function EM(t){return t<0}function AM(t){return t>0}function fM(t){return 0===t}function pM(t){return Number.isNaN(t)}EM.signature="number",AM.signature="number",fM.signature="number",pM.signature="number";function UM(t){var n;if(Xi(t))return t<=0?isFinite(t)?1/0:NaN:t>171?1/0:yM(1,t-1);if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*UM(1-t));if(t>=171.35)return 1/0;if(t>85){var e=t*t,r=e*t,i=r*t,u=i*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*e)-139/(51840*r)-571/(2488320*i)+163879/(209018880*u)+5246819/(75246796800*u*t))}--t,n=CM[0];for(var o=1;o<CM.length;++o)n+=CM[o]/(t+o);var M=t+dM+.5;return Math.sqrt(2*Math.PI)*Math.pow(M,t+.5)*Math.exp(-M)*n}UM.signature="number";var dM=4.7421875,CM=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],QM=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function wM(t){if(t<0)return NaN;if(0===t)return 1/0;if(!isFinite(t))return t;if(t<.5)return Math.log(Math.PI/Math.sin(Math.PI*t))-wM(1-t);for(var n=(t-=1)+5+.5,e=QM[0],r=6;r>=1;r--)e+=QM[r]/(t+r);return.9189385332046728+(t+.5)*Math.log(n)-n+Math.log(e)}wM.signature="number";var LM=Vu("multiplyScalar",["typed"],t=>{var{typed:n}=t;return n("multiplyScalar",{"number, number":Lo,"Complex, Complex":function(t,n){return t.mul(n)},"BigNumber, BigNumber":function(t,n){return t.times(n)},"Fraction, Fraction":function(t,n){return t.mul(n)},"number | Fraction | BigNumber | Complex, Unit":(t,n)=>n.multiply(t),"Unit, number | Fraction | BigNumber | Complex | Unit":(t,n)=>t.multiply(n)})});function SM(t){return!t}function kM(t,n){return!(!t&&!n)}function vM(t,n){return!!t!=!!n}function YM(t,n){return!(!t||!n)}SM.signature="number",kM.signature="number, number",vM.signature="number, number",YM.signature="number, number";Vu("oct",["typed","format"],t=>{var{typed:n,format:e}=t;return n("oct",{"number | BigNumber":function(t){return e(t,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(t,n){return e(t,{notation:"oct",wordSize:n})}})});var mM=e(22),RM=e.n(mM);Date.now();var FM=Vu("SparseMatrix",["typed","equalScalar","Matrix"],t=>{var{typed:n,equalScalar:e,Matrix:r}=t;function i(t,n){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(n&&!Ce(n))throw new Error("Invalid datatype: "+n);if(we(t))!function(t,n,e){"SparseMatrix"===n.type?(t._values=n._values?ar(n._values):void 0,t._index=ar(n._index),t._ptr=ar(n._ptr),t._size=ar(n._size),t._datatype=e||n._datatype):u(t,n.valueOf(),e||n._datatype)}(this,t,n);else if(t&&Qe(t.index)&&Qe(t.ptr)&&Qe(t.size))this._values=t.values,this._index=t.index,this._ptr=t.ptr,this._size=t.size,this._datatype=n||t.datatype;else if(Qe(t))u(this,t,n);else{if(t)throw new TypeError("Unsupported type of data ("+Nr(t)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=n}}function u(t,r,i){t._values=[],t._index=[],t._ptr=[],t._datatype=i;var u=r.length,o=0,M=e,c=0;if(Ce(i)&&(M=n.find(e,[i,i])||e,c=n.convert(0,i)),u>0){var N=0;do{t._ptr.push(t._index.length);for(var a=0;a<u;a++){var s=r[a];if(Qe(s)){if(0===N&&o<s.length&&(o=s.length),N<s.length){var D=s[N];M(D,c)||(t._values.push(D),t._index.push(a))}}else 0===N&&o<1&&(o=1),M(s,c)||(t._values.push(s),t._index.push(a))}N++}while(N<o)}t._ptr.push(t._index.length),t._size=[u,o]}function o(t,n){if(!Ye(n))throw new TypeError("Invalid index");if(n.isScalar())return t.get(n.min());var e,r,u,o,M=n.size();if(M.length!==t._size.length)throw new pu(M.length,t._size.length);var c=n.min(),N=n.max();for(e=0,r=t._size.length;e<r;e++)Qu(c[e],t._size[e]),Qu(N[e],t._size[e]);var a=t._values,s=t._index,D=t._ptr,T=n.dimension(0),g=n.dimension(1),l=[],I=[];T.forEach((function(t,n){I[t]=n[0],l[t]=!0}));var y=a?[]:void 0,h=[],j=[];return g.forEach((function(t){for(j.push(h.length),u=D[t],o=D[t+1];u<o;u++)e=s[u],!0===l[e]&&(h.push(I[e]),y&&y.push(a[u]))})),j.push(h.length),new i({values:y,index:h,ptr:j,size:M,datatype:t._datatype})}function M(t,n,e,r){if(!n||!0!==n.isIndex)throw new TypeError("Invalid index");var i,u=n.size(),o=n.isScalar();if(we(e)?(i=e.size(),e=e.toArray()):i=du(e),o){if(0!==i.length)throw new TypeError("Scalar expected");t.set(n.min(),e,r)}else{if(1!==u.length&&2!==u.length)throw new pu(u.length,t._size.length,"<");if(i.length<u.length){for(var M=0,c=0;1===u[M]&&1===i[M];)M++;for(;1===u[M];)c++,M++;e=vu(e,u.length,c,i)}if(!Dr(u,i))throw new pu(u,i,">");if(1===u.length){n.dimension(0).forEach((function(n,i){Qu(n),t.set([n,0],e[i[0]],r)}))}else{var N=n.dimension(0),a=n.dimension(1);N.forEach((function(n,i){Qu(n),a.forEach((function(u,o){Qu(u),t.set([n,u],e[i[0]][o[0]],r)}))}))}}return t}function c(t,n,e,r){if(e-n==0)return e;for(var i=n;i<e;i++)if(r[i]===t)return i;return n}function N(t,n,e,r,i,u,o){i.splice(t,0,r),u.splice(t,0,n);for(var M=e+1;M<o.length;M++)o[M]++}function a(t,r,i,u){var o=u||0,M=e,c=0;Ce(t._datatype)&&(M=n.find(e,[t._datatype,t._datatype])||e,c=n.convert(0,t._datatype),o=n.convert(o,t._datatype));var N,a,s,D=!M(o,c),T=t._size[0],g=t._size[1];if(i>g){for(a=g;a<i;a++)if(t._ptr[a]=t._values.length,D)for(N=0;N<T;N++)t._values.push(o),t._index.push(N);t._ptr[i]=t._values.length}else i<g&&(t._ptr.splice(i+1,g-i),t._values.splice(t._ptr[i],t._values.length),t._index.splice(t._ptr[i],t._index.length));if(g=i,r>T){if(D){var l=0;for(a=0;a<g;a++){t._ptr[a]=t._ptr[a]+l,s=t._ptr[a+1]+l;var I=0;for(N=T;N<r;N++,I++)t._values.splice(s+I,0,o),t._index.splice(s+I,0,N),l++}t._ptr[g]=t._values.length}}else if(r<T){var y=0;for(a=0;a<g;a++){t._ptr[a]=t._ptr[a]-y;var h=t._ptr[a],j=t._ptr[a+1]-y;for(s=h;s<j;s++)(N=t._index[s])>r-1&&(t._values.splice(s,1),t._index.splice(s,1),y++)}t._ptr[a]=t._values.length}return t._size[0]=r,t._size[1]=i,t}function s(t,n,e,r,i){var u,o,M=r[0],c=r[1],N=[];for(u=0;u<M;u++)for(N[u]=[],o=0;o<c;o++)N[u][o]=0;for(o=0;o<c;o++)for(var a=e[o],s=e[o+1],D=a;D<s;D++)N[u=n[D]][o]=t?i?ar(t[D]):t[D]:1;return N}return i.prototype=new r,i.prototype.createSparseMatrix=function(t,n){return new i(t,n)},Object.defineProperty(i,"name",{value:"SparseMatrix"}),i.prototype.constructor=i,i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return mu(this._values,Nr)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(t,n){return new i(t,n)},i.prototype.density=function(){var t=this._size[0],n=this._size[1];return 0!==t&&0!==n?this._index.length/(t*n):0},i.prototype.subset=function(t,n,e){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return o(this,t);case 2:case 3:return M(this,t,n,e);default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.get=function(t){if(!Qe(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new pu(t.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var n=t[0],e=t[1];Qu(n,this._size[0]),Qu(e,this._size[1]);var r=c(n,this._ptr[e],this._ptr[e+1],this._index);return r<this._ptr[e+1]&&this._index[r]===n?this._values[r]:0},i.prototype.set=function(t,r,i){if(!Qe(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new pu(t.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var u=t[0],o=t[1],M=this._size[0],s=this._size[1],D=e,T=0;Ce(this._datatype)&&(D=n.find(e,[this._datatype,this._datatype])||e,T=n.convert(0,this._datatype)),(u>M-1||o>s-1)&&(a(this,Math.max(u+1,M),Math.max(o+1,s),i),M=this._size[0],s=this._size[1]),Qu(u,M),Qu(o,s);var g=c(u,this._ptr[o],this._ptr[o+1],this._index);return g<this._ptr[o+1]&&this._index[g]===u?D(r,T)?function(t,n,e,r,i){e.splice(t,1),r.splice(t,1);for(var u=n+1;u<i.length;u++)i[u]--}(g,o,this._values,this._index,this._ptr):this._values[g]=r:D(r,T)||N(g,u,o,r,this._values,this._index,this._ptr),this},i.prototype.resize=function(t,n,e){if(!Le(t))throw new TypeError("Array or Matrix expected");var r=t.valueOf().map(t=>Array.isArray(t)&&1===t.length?t[0]:t);if(2!==r.length)throw new Error("Only two dimensions matrix are supported");return r.forEach((function(t){if(!Ae(t)||!Xi(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ou(r)+")")})),a(e?this.clone():this,r[0],r[1],n)},i.prototype.reshape=function(t,n){if(!Qe(t))throw new TypeError("Array expected");if(2!==t.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");t.forEach((function(n){if(!Ae(n)||!Xi(n)||n<=-2||0===n)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Ou(t)+")")}));var e=this._size[0]*this._size[1];if(e!==(t=Su(t,e))[0]*t[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var r=n?this.clone():this;if(this._size[0]===t[0]&&this._size[1]===t[1])return r;for(var i=[],u=0;u<r._ptr.length;u++)for(var o=0;o<r._ptr[u+1]-r._ptr[u];o++)i.push(u);for(var M=r._values.slice(),a=r._index.slice(),s=0;s<r._index.length;s++){var D=a[s],T=i[s],g=D*r._size[1]+T;i[s]=g%t[1],a[s]=Math.floor(g/t[1])}r._values.length=0,r._index.length=0,r._ptr.length=t[1]+1,r._size=t.slice();for(var l=0;l<r._ptr.length;l++)r._ptr[l]=0;for(var I=0;I<M.length;I++){var y=a[I],h=i[I],j=M[I];N(c(y,r._ptr[h],r._ptr[h+1],r._index),y,h,j,r._values,r._index,r._ptr)}return r},i.prototype.clone=function(){return new i({values:this._values?ar(this._values):void 0,index:ar(this._index),ptr:ar(this._ptr),size:ar(this._size),datatype:this._datatype})},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(t,r){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var u=this,o=this._size[0],M=this._size[1],c=qu(t);return function(t,r,u,o,M,c,N){var a=[],s=[],D=[],T=e,g=0;Ce(t._datatype)&&(T=n.find(e,[t._datatype,t._datatype])||e,g=n.convert(0,t._datatype));for(var l=function(t,n,e){t=c(t,n,e),T(t,g)||(a.push(t),s.push(n))},I=o;I<=M;I++){D.push(a.length);var y=t._ptr[I],h=t._ptr[I+1];if(N)for(var j=y;j<h;j++){var x=t._index[j];x>=r&&x<=u&&l(t._values[j],x-r,I-o)}else{for(var z={},O=y;O<h;O++){var E=t._index[O];z[E]=t._values[O]}for(var A=r;A<=u;A++){var f=A in z?z[A]:0;l(f,A-r,I-o)}}}return D.push(a.length),new i({values:a,index:s,ptr:D,size:[u-r+1,M-o+1]})}(this,0,o-1,0,M-1,(function(n,e,r){return 1===c?t(n):2===c?t(n,[e,r]):t(n,[e,r],u)}),r)},i.prototype.forEach=function(t,n){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var e=this._size[0],r=this._size[1],i=0;i<r;i++){var u=this._ptr[i],o=this._ptr[i+1];if(n)for(var M=u;M<o;M++){var c=this._index[M];t(this._values[M],[c,i],this)}else{for(var N={},a=u;a<o;a++){N[this._index[a]]=this._values[a]}for(var s=0;s<e;s++){t(s in N?N[s]:0,[s,i],this)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var t=this._size[1],n=0;n<t;n++)for(var e=this._ptr[n],r=this._ptr[n+1],i=e;i<r;i++){var u=this._index[i];yield{value:this._values[i],index:[u,n]}}},i.prototype.toArray=function(){return s(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return s(this._values,this._index,this._ptr,this._size,!1)},i.prototype.format=function(t){for(var n=this._size[0],e=this._size[1],r=this.density(),i="Sparse Matrix ["+Ou(n,t)+" x "+Ou(e,t)+"] density: "+Ou(r,t)+"\n",u=0;u<e;u++)for(var o=this._ptr[u],M=this._ptr[u+1],c=o;c<M;c++){i+="\n ("+Ou(this._index[c],t)+", "+Ou(u,t)+") ==> "+(this._values?Ou(this._values[c],t):"X")}return i},i.prototype.toString=function(){return Ou(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(t){if(t){if(fe(t)&&(t=t.toNumber()),!Ae(t)||!Xi(t))throw new TypeError("The parameter k must be an integer number")}else t=0;var n=t>0?t:0,e=t<0?-t:0,r=this._size[0],u=this._size[1],o=Math.min(r-e,u-n),M=[],c=[],N=[];N[0]=0;for(var a=n;a<u&&M.length<o;a++)for(var s=this._ptr[a],D=this._ptr[a+1],T=s;T<D;T++){var g=this._index[T];if(g===a-n+e){M.push(this._values[T]),c[M.length-1]=g-e;break}}return N.push(M.length),new i({values:M,index:c,ptr:N,size:[o,1]})},i.fromJSON=function(t){return new i(t)},i.diagonal=function(t,r,u,o,M){if(!Qe(t))throw new TypeError("Array expected, size parameter");if(2!==t.length)throw new Error("Only two dimensions matrix are supported");if(t=t.map((function(t){if(fe(t)&&(t=t.toNumber()),!Ae(t)||!Xi(t)||t<1)throw new Error("Size values must be positive integers");return t})),u){if(fe(u)&&(u=u.toNumber()),!Ae(u)||!Xi(u))throw new TypeError("The parameter k must be an integer number")}else u=0;var c=e,N=0;Ce(M)&&(c=n.find(e,[M,M])||e,N=n.convert(0,M));var a,s=u>0?u:0,D=u<0?-u:0,T=t[0],g=t[1],l=Math.min(T-D,g-s);if(Qe(r)){if(r.length!==l)throw new Error("Invalid value array length");a=function(t){return r[t]}}else if(we(r)){var I=r.size();if(1!==I.length||I[0]!==l)throw new Error("Invalid matrix length");a=function(t){return r.get([t])}}else a=function(){return r};for(var y=[],h=[],j=[],x=0;x<g;x++){j.push(y.length);var z=x-s;if(z>=0&&z<l){var O=a(z);c(O,N)||(h.push(z+D),y.push(O))}}return j.push(y.length),new i({values:y,index:h,ptr:j,size:[T,g]})},i.prototype.swapRows=function(t,n){if(!(Ae(t)&&Xi(t)&&Ae(n)&&Xi(n)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return Qu(t,this._size[0]),Qu(n,this._size[0]),i._swapRows(t,n,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(t,n,e,r,i){for(var u=r[t],o=r[t+1],M=u;M<o;M++)i(e[M],n[M])},i._swapRows=function(t,n,e,r,i,u){for(var o=0;o<e;o++){var M=u[o],N=u[o+1],a=c(t,M,N,i),s=c(n,M,N,i);if(a<N&&s<N&&i[a]===t&&i[s]===n){if(r){var D=r[a];r[a]=r[s],r[s]=D}}else if(a<N&&i[a]===t&&(s>=N||i[s]!==n)){var T=r?r[a]:void 0;i.splice(s,0,n),r&&r.splice(s,0,T),i.splice(s<=a?a+1:a,1),r&&r.splice(s<=a?a+1:a,1)}else if(s<N&&i[s]===n&&(a>=N||i[a]!==t)){var g=r?r[s]:void 0;i.splice(a,0,t),r&&r.splice(a,0,g),i.splice(a<=s?s+1:s,1),r&&r.splice(a<=s?s+1:s,1)}}},i},{isClass:!0});Vu("bin",["typed","format"],t=>{var{typed:n,format:e}=t;return n("bin",{"number | BigNumber":function(t){return e(t,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(t,n){return e(t,{notation:"bin",wordSize:n})}})});var bM=Vu("matrix",["typed","Matrix","DenseMatrix","SparseMatrix"],t=>{var{typed:n,Matrix:e,DenseMatrix:r,SparseMatrix:i}=t;return n("matrix",{"":function(){return u([])},string:function(t){return u([],t)},"string, string":function(t,n){return u([],t,n)},Array:function(t){return u(t)},Matrix:function(t){return u(t,t.storage())},"Array | Matrix, string":u,"Array | Matrix, string, string":u});function u(t,n,e){if("dense"===n||"default"===n||void 0===n)return new r(t,e);if("sparse"===n)return new i(t,e);throw new TypeError("Unknown matrix type "+JSON.stringify(n)+".")}});function ZM(){throw new Error('No "matrix" implementation available')}var BM=Vu("size",["typed","config","?matrix"],t=>{var{typed:n,config:e,matrix:r}=t;return n("size",{Matrix:function(t){return t.create(t.size())},Array:du,string:function(t){return"Array"===e.matrix?[t.length]:r([t.length])},"number | Complex | BigNumber | Unit | boolean | null":function(t){return"Array"===e.matrix?[]:r?r([]):ZM()}})}),VM=Vu("matAlgo11xS0s",["typed","equalScalar"],t=>{var{typed:n,equalScalar:e}=t;return function(t,r,i,u){var o=t._values,M=t._index,c=t._ptr,N=t._size,a=t._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var s,D=N[0],T=N[1],g=e,l=0,I=i;"string"==typeof a&&(s=a,g=n.find(e,[s,s]),l=n.convert(0,s),r=n.convert(r,s),I=n.find(i,[s,s]));for(var y=[],h=[],j=[],x=0;x<T;x++){j[x]=h.length;for(var z=c[x],O=c[x+1],E=z;E<O;E++){var A=M[E],f=u?I(r,o[E]):I(o[E],r);g(f,l)||(h.push(A),y.push(f))}}return j[T]=h.length,t.createSparseMatrix({values:y,index:h,ptr:j,size:[D,T],datatype:s})}}),WM=Vu("matAlgo14xDs",["typed"],t=>{var{typed:n}=t;return function(t,e,r,i){var u,o=t._data,M=t._size,c=t._datatype,N=r;"string"==typeof c&&(u=c,e=n.convert(e,u),N=n.find(r,[u,u]));var a=M.length>0?function t(n,e,r,i,u,o,M){var c=[];if(e===r.length-1)for(var N=0;N<i;N++)c[N]=M?n(o,u[N]):n(u[N],o);else for(var a=0;a<i;a++)c[a]=t(n,e+1,r,r[e+1],u[a],o,M);return c}(N,0,M,M[0],o,e,i):[];return t.createDenseMatrix({data:a,size:ar(M),datatype:u})}});Vu("equal",["typed","equalScalar"],t=>{var{typed:n,equalScalar:e}=t;return n("equal",{"any, any":function(t,n){return null===t?null===n:null===n?null===t:void 0===t?void 0===n:void 0===n?void 0===t:e(t,n)}})});var GM=Vu("ones",["typed","config","matrix","BigNumber"],t=>{var{typed:n,config:e,matrix:r,BigNumber:i}=t;return n("ones",{"":function(){return"Array"===e.matrix?u([]):u([],"default")},"...number | BigNumber | string":function(t){if("string"==typeof t[t.length-1]){var n=t.pop();return u(t,n)}return"Array"===e.matrix?u(t):u(t,"default")},Array:u,Matrix:function(t){var n=t.storage();return u(t.valueOf(),n)},"Array | Matrix, string":function(t,n){return u(t.valueOf(),n)}});function u(t,n){var e=function(t){var n=!1;return t.forEach((function(t,e,r){fe(t)&&(n=!0,r[e]=t.toNumber())})),n}(t)?new i(1):1;if(function(t){t.forEach((function(t){if("number"!=typeof t||!Xi(t)||t<0)throw new Error("Parameters in function ones must be positive integers")}))}(t),n){var u=r(n);return t.length>0?u.resize(t,e):u}var o=[];return t.length>0?wu(o,t,e):o}});function PM(t,n,e,r){if(!(this instanceof PM))throw new SyntaxError("Constructor must be called with the new operator");this.fn=t,this.count=n,this.min=e,this.max=r,this.message="Wrong number of arguments in function "+t+" ("+n+" provided, "+e+(null!=r?"-"+r:"")+" expected)",this.stack=(new Error).stack}PM.prototype=new Error,PM.prototype.constructor=Error,PM.prototype.name="ArgumentsError",PM.prototype.isArgumentsError=!0;Vu("unequal",["typed","equalScalar"],t=>{var{typed:n,equalScalar:e}=t;return n("unequal",{"any, any":function(t,n){return null===t?null!==n:null===n?null!==t:void 0===t?void 0!==n:void 0===n?void 0!==t:!e(t,n)}})});fu.signature="any, any";var JM=Vu("dot",["typed","addScalar","multiplyScalar","conj","size"],t=>{var{typed:n,addScalar:e,multiplyScalar:r,conj:i,size:u}=t;return n("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(t,u){var c=o(t,u),N=we(t)?t._data:t,a=we(t)?t._datatype||t.getDataType():void 0,s=we(u)?u._data:u,D=we(u)?u._datatype||u.getDataType():void 0,T=2===M(t).length,g=2===M(u).length,l=e,I=r;if(a&&D&&a===D&&"string"==typeof a&&"mixed"!==a){var y=a;l=n.find(e,[y,y]),I=n.find(r,[y,y])}if(!T&&!g){for(var h=I(i(N[0]),s[0]),j=1;j<c;j++)h=l(h,I(i(N[j]),s[j]));return h}if(!T&&g){for(var x=I(i(N[0]),s[0][0]),z=1;z<c;z++)x=l(x,I(i(N[z]),s[z][0]));return x}if(T&&!g){for(var O=I(i(N[0][0]),s[0]),E=1;E<c;E++)O=l(O,I(i(N[E][0]),s[E]));return O}if(T&&g){for(var A=I(i(N[0][0]),s[0][0]),f=1;f<c;f++)A=l(A,I(i(N[f][0]),s[f][0]));return A}},"SparseMatrix, SparseMatrix":function(t,n){o(t,n);var i=t._index,u=t._values,M=n._index,c=n._values,N=0,a=e,s=r,D=0,T=0;for(;D<i.length&&T<M.length;){var g=i[D],l=M[T];g<l?D++:g>l?T++:g===l&&(N=a(N,s(u[D],c[T])),D++,T++)}return N}});function o(t,n){var e,r,i=M(t),u=M(n);if(1===i.length)e=i[0];else{if(2!==i.length||1!==i[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+i.join(", ")+")");e=i[0]}if(1===u.length)r=u[0];else{if(2!==u.length||1!==u[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+u.join(", ")+")");r=u[0]}if(e!==r)throw new RangeError("Vectors must have equal length ("+e+" != "+r+")");if(0===e)throw new RangeError("Cannot calculate the dot product of empty vectors");return e}function M(t){return we(t)?t.size():u(t)}}),HM="number | BigNumber | Fraction | Matrix | Array";"".concat(HM,", ").concat(HM,", ...").concat(HM);var KM=Vu("multiply",["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],t=>{var{typed:n,matrix:e,addScalar:r,multiplyScalar:i,equalScalar:u,dot:o}=t,M=VM({typed:n,equalScalar:u}),c=WM({typed:n});function N(t,n){switch(t.length){case 1:switch(n.length){case 1:if(t[0]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(t[0]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+t[0]+") must match Matrix rows ("+n[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+n.length+" dimensions)")}break;case 2:switch(n.length){case 1:if(t[1]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+t[1]+") must match Vector length ("+n[0]+")");break;case 2:if(t[1]!==n[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+t[1]+") must match Matrix B rows ("+n[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+n.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+t.length+" dimensions)")}}function a(t,e){if("dense"!==e.storage())throw new Error("Support for SparseMatrix not implemented");return function(t,e){var u,o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._size,s=e._datatype||e.getDataType(),D=M[0],T=a[1],g=r,l=i;c&&s&&c===s&&"string"==typeof c&&"mixed"!==c&&(u=c,g=n.find(r,[u,u]),l=n.find(i,[u,u]));for(var I=[],y=0;y<T;y++){for(var h=l(o[0],N[0][y]),j=1;j<D;j++)h=g(h,l(o[j],N[j][y]));I[y]=h}return t.createDenseMatrix({data:I,size:[T],datatype:c===t._datatype&&s===e._datatype?u:void 0})}(t,e)}var s=n("_multiplyMatrixVector",{"DenseMatrix, any":function(t,e){var u,o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._datatype||e.getDataType(),s=M[0],D=M[1],T=r,g=i;c&&a&&c===a&&"string"==typeof c&&"mixed"!==c&&(u=c,T=n.find(r,[u,u]),g=n.find(i,[u,u]));for(var l=[],I=0;I<s;I++){for(var y=o[I],h=g(y[0],N[0]),j=1;j<D;j++)h=T(h,g(y[j],N[j]));l[I]=h}return t.createDenseMatrix({data:l,size:[s],datatype:c===t._datatype&&a===e._datatype?u:void 0})},"SparseMatrix, any":function(t,e){var o=t._values,M=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var a,s=e._data,D=e._datatype||e.getDataType(),T=t._size[0],g=e._size[0],l=[],I=[],y=[],h=r,j=i,x=u,z=0;N&&D&&N===D&&"string"==typeof N&&"mixed"!==N&&(a=N,h=n.find(r,[a,a]),j=n.find(i,[a,a]),x=n.find(u,[a,a]),z=n.convert(0,a));var O=[],E=[];y[0]=0;for(var A=0;A<g;A++){var f=s[A];if(!x(f,z))for(var p=c[A],U=c[A+1],d=p;d<U;d++){var C=M[d];E[C]?O[C]=h(O[C],j(f,o[d])):(E[C]=!0,I.push(C),O[C]=j(f,o[d]))}}for(var Q=I.length,w=0;w<Q;w++){var L=I[w];l[w]=O[L]}return y[1]=I.length,t.createSparseMatrix({values:l,index:I,ptr:y,size:[T,1],datatype:N===t._datatype&&D===e._datatype?a:void 0})}}),D=n("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(t,e){var u,o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._size,s=e._datatype||e.getDataType(),D=M[0],T=M[1],g=a[1],l=r,I=i;c&&s&&c===s&&"string"==typeof c&&"mixed"!==c&&"mixed"!==c&&(u=c,l=n.find(r,[u,u]),I=n.find(i,[u,u]));for(var y=[],h=0;h<D;h++){var j=o[h];y[h]=[];for(var x=0;x<g;x++){for(var z=I(j[0],N[0][x]),O=1;O<T;O++)z=l(z,I(j[O],N[O][x]));y[h][x]=z}}return t.createDenseMatrix({data:y,size:[D,g],datatype:c===t._datatype&&s===e._datatype?u:void 0})},"DenseMatrix, SparseMatrix":function(t,e){var o=t._data,M=t._size,c=t._datatype||t.getDataType(),N=e._values,a=e._index,s=e._ptr,D=e._size,T=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!N)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var g,l=M[0],I=D[1],y=r,h=i,j=u,x=0;c&&T&&c===T&&"string"==typeof c&&"mixed"!==c&&(g=c,y=n.find(r,[g,g]),h=n.find(i,[g,g]),j=n.find(u,[g,g]),x=n.convert(0,g));for(var z=[],O=[],E=[],A=e.createSparseMatrix({values:z,index:O,ptr:E,size:[l,I],datatype:c===t._datatype&&T===e._datatype?g:void 0}),f=0;f<I;f++){E[f]=O.length;var p=s[f],U=s[f+1];if(U>p)for(var d=0,C=0;C<l;C++){for(var Q=C+1,w=void 0,L=p;L<U;L++){var S=a[L];d!==Q?(w=h(o[C][S],N[L]),d=Q):w=y(w,h(o[C][S],N[L]))}d!==Q||j(w,x)||(O.push(C),z.push(w))}}return E[I]=O.length,A},"SparseMatrix, DenseMatrix":function(t,e){var o=t._values,M=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var a,s=e._data,D=e._datatype||e.getDataType(),T=t._size[0],g=e._size[0],l=e._size[1],I=r,y=i,h=u,j=0;N&&D&&N===D&&"string"==typeof N&&"mixed"!==N&&(a=N,I=n.find(r,[a,a]),y=n.find(i,[a,a]),h=n.find(u,[a,a]),j=n.convert(0,a));for(var x=[],z=[],O=[],E=t.createSparseMatrix({values:x,index:z,ptr:O,size:[T,l],datatype:N===t._datatype&&D===e._datatype?a:void 0}),A=[],f=[],p=0;p<l;p++){O[p]=z.length;for(var U=p+1,d=0;d<g;d++){var C=s[d][p];if(!h(C,j))for(var Q=c[d],w=c[d+1],L=Q;L<w;L++){var S=M[L];f[S]!==U?(f[S]=U,z.push(S),A[S]=y(C,o[L])):A[S]=I(A[S],y(C,o[L]))}}for(var k=O[p],v=z.length,Y=k;Y<v;Y++){var m=z[Y];x[Y]=A[m]}}return O[l]=z.length,E},"SparseMatrix, SparseMatrix":function(t,e){var u,o=t._values,M=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType(),a=e._values,s=e._index,D=e._ptr,T=e._datatype||void 0===e._data?e._datatype:e.getDataType(),g=t._size[0],l=e._size[1],I=o&&a,y=r,h=i;N&&T&&N===T&&"string"==typeof N&&"mixed"!==N&&(u=N,y=n.find(r,[u,u]),h=n.find(i,[u,u]));for(var j,x,z,O,E,A,f,p,U=I?[]:void 0,d=[],C=[],Q=t.createSparseMatrix({values:U,index:d,ptr:C,size:[g,l],datatype:N===t._datatype&&T===e._datatype?u:void 0}),w=I?[]:void 0,L=[],S=0;S<l;S++){C[S]=d.length;var k=S+1;for(E=D[S],A=D[S+1],O=E;O<A;O++)if(p=s[O],I)for(x=c[p],z=c[p+1],j=x;j<z;j++)f=M[j],L[f]!==k?(L[f]=k,d.push(f),w[f]=h(a[O],o[j])):w[f]=y(w[f],h(a[O],o[j]));else for(x=c[p],z=c[p+1],j=x;j<z;j++)f=M[j],L[f]!==k&&(L[f]=k,d.push(f));if(I)for(var v=C[S],Y=d.length,m=v;m<Y;m++){var R=d[m];U[m]=w[R]}}return C[l]=d.length,Q}});return n("multiply",i,{"Array, Array":n.referTo("Matrix, Matrix",t=>(n,r)=>{N(du(n),du(r));var i=t(e(n),e(r));return we(i)?i.valueOf():i}),"Matrix, Matrix":function(t,n){var e=t.size(),r=n.size();return N(e,r),1===e.length?1===r.length?function(t,n,e){if(0===e)throw new Error("Cannot multiply two empty vectors");return o(t,n)}(t,n,e[0]):a(t,n):1===r.length?s(t,n):D(t,n)},"Matrix, Array":n.referTo("Matrix,Matrix",t=>(n,r)=>t(n,e(r))),"Array, Matrix":n.referToSelf(t=>(n,r)=>t(e(n,r.storage()),r)),"SparseMatrix, any":function(t,n){return M(t,n,i,!1)},"DenseMatrix, any":function(t,n){return c(t,n,i,!1)},"any, SparseMatrix":function(t,n){return M(n,t,i,!0)},"any, DenseMatrix":function(t,n){return c(n,t,i,!0)},"Array, any":function(t,n){return c(e(t),n,i,!1).valueOf()},"any, Array":function(t,n){return c(e(n),t,i,!0).valueOf()},"any, any":i,"any, any, ...any":n.referToSelf(t=>(n,e,r)=>{for(var i=t(n,e),u=0;u<r.length;u++)i=t(i,r[u]);return i})})});e(17);var XM=Gu({config:Ir}),qM=Hu({}),_M=ro({}),$M=io({}),tc=uo({Matrix:$M}),nc=zo({BigNumber:XM,Complex:qM,DenseMatrix:tc,Fraction:_M}),ec=cM({typed:nc}),rc=jM({typed:nc}),ic=OM({config:Ir,typed:nc}),uc=LM({typed:nc}),oc=FM({Matrix:$M,equalScalar:ic,typed:nc}),Mc=bM({DenseMatrix:tc,Matrix:$M,SparseMatrix:oc,typed:nc}),cc=BM({matrix:Mc,config:Ir,typed:nc}),Nc=GM({BigNumber:XM,config:Ir,matrix:Mc,typed:nc}),ac=JM({addScalar:ec,conj:rc,multiplyScalar:uc,size:cc,typed:nc}),sc=KM({addScalar:ec,dot:ac,equalScalar:ic,matrix:Mc,multiplyScalar:uc,typed:nc});function Dc(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,u=je()(t);if(n&&e){var o=hc(t),M=Ic(o,e,n),c=gc(t,M);u=je()(c).pop()}if(r&&i){var N=[].concat(u).reverse(),a=hc(N),s=Ic(a,i,r),D=1-s,T=gc(u,D);u=T[0]}return u}function Tc(t,n){var e=t.x-n.x,r=t.y-n.y;return Math.sqrt(e*e+r*r)}function gc(t,n){switch(t.length){case 2:return function(t,n){var e=lc(t,n);return[[t[0],e],[e,je()(t).pop()]]}(t,n);case 3:return function(t,n){var e=[t[0],t[1]],r=[t[1],t[2]],i=lc(e,n),u=lc(r,n),o=lc([i,u],n);return[[t[0],i,o],[o,u,t[2]]]}(t,n);case 4:return function(t,n){var e=[t[0],t[1]],r=[t[1],t[2]],i=[t[2],t[3]],u=lc(e,n),o=lc(r,n),M=lc(i,n),c=lc([u,o],n),N=lc([o,M],n),a=lc([c,N],n);return[[t[0],u,c,a],[a,N,M,t[3]]]}(t,n);default:return null}}function lc(t,n){var e=le()(t,1)[0],r=je()(t).pop(),i=e.x+(r.x-e.x)*n;return{y:e.y+(r.y-e.y)*n,x:i}}function Ic(t,n,e){for(var r=t.size(),i=function(t){switch(t){case 1:return sc(yc(1e3,1),Mc([[1,0],[-1,1]]));case 2:return sc(yc(1e3,2),Mc([[1,0,0],[-2,2,0],[1,-2,1]]));case 3:return sc(yc(1e3,3),Mc([[1,0,0,0],[-3,3,0,0],[3,-6,3,0],[-1,3,-3,1]]));default:return null}}(le()(r,1)[0]-1),u=function(t,n){var e=-t.x,r=-t.y,i=[],u=[];n.forEach((function(t,n){switch(le()(n,2)[1]){case 0:i.push(t+e);break;case 1:u.push(t+r)}}));for(var o=[],M=0;M<i.length;M++)o.push(Math.sqrt(i[M]*i[M]+u[M]*u[M]));return o}(n,sc(i,t)),o=u.length-1,M=0;M<u.length;M++)if(u[M]>=e){o=M;break}return.001*o}function yc(t,n){var e=1/t,r=0,i=Nc(t+1,n+1).map((function(t,n){var i=null;switch(le()(n,2)[1]){case 0:i=1;break;case 1:i=r;break;case 2:i=r*r;break;case 3:i=r*r*r}return r+=e,i}));return Mc(i)}function hc(t){var n=t.map((function(t){return[t.x,t.y]}));return Mc(n)}function jc(t){if(3===t.length)throw new Error("bezierBoundingBox function supports only linear and cubic bezier curves for now");var n,e,r,i,u,o,M=2===t.length?(n=t,e=le()(n,2),r=e[0],i=e[1],u=[r.x,i.x],o=[r.y,i.y],{min:{x:Math.min.apply(0,u),y:Math.min.apply(0,o)},max:{x:Math.max.apply(0,u),y:Math.max.apply(0,o)}}):function(t){for(var n,e,r,i,u,o,M,c,N=le()(t,4),a=N[0],s=N[1],D=N[2],T=N[3],g=[],l=[],I=[],y=0;y<2;++y)if(0===y?(e=6*a.x-12*s.x+6*D.x,n=-3*a.x+9*s.x-9*D.x+3*T.x,r=3*s.x-3*a.x):(e=6*a.y-12*s.y+6*D.y,n=-3*a.y+9*s.y-9*D.y+3*T.y,r=3*s.y-3*a.y),Math.abs(n)<1e-12){if(Math.abs(e)<1e-12)continue;(i=-r/e)>0&&i<1&&g.push(i)}else(M=e*e-4*r*n)<0?Math.abs(M)<1e-12&&(i=-e/(2*n))>0&&i<1&&g.push(i):(c=Math.sqrt(M),(u=(-e+c)/(2*n))>0&&u<1&&g.push(u),(o=(-e-c)/(2*n))>0&&o<1&&g.push(o));var h,j=g.length;for(;j--;)i=g[j],h=1-i,l[j]=h*h*h*a.x+3*h*h*i*s.x+3*h*i*i*D.x+i*i*i*T.x,I[j]=h*h*h*a.y+3*h*h*i*s.y+3*h*i*i*D.y+i*i*i*T.y;return l.push(a.x,T.x),I.push(a.y,T.y),{min:{x:Math.min.apply(0,l),y:Math.min.apply(0,I)},max:{x:Math.max.apply(0,l),y:Math.max.apply(0,I)}}}(t),c=2===t.length?1:0;return[{x:M.min.x,y:M.min.y-c},{x:M.max.x,y:M.min.y-c},{x:M.max.x,y:M.max.y+c},{x:M.min.x,y:M.max.y+c}]}var xc=e(3),zc=e.n(xc),Oc=e(0),Ec=e.n(Oc),Ac=e(4),fc=e.n(Ac),pc=function(){function t(n){At()(this,t),dt()(this,"ctx",void 0),dt()(this,"playData",void 0),dt()(this,"options",void 0),dt()(this,"courtTypeConstants",void 0),this.ctx=n.ctx,this.playData=n.playData,this.options=n.options?n.options:{},this.courtTypeConstants=n.courtTypeConstants}return pt()(t,[{key:"apply",value:function(){this.ctx.save(),this.drawLogic(),this.ctx.restore()}},{key:"drawLogic",value:function(){}}]),t}();function Uc(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var dc=function(t){fc()(e,t);var n=Uc(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"apply",value:function(){this.original()&&(this.ctx.save(),this.drawLogic(),this.ctx.restore()),this.reflection()&&(this.ctx.save(),this.verticalFlipAndRotation(),this.drawLogic(),this.ctx.restore())}},{key:"original",value:function(){return!0}},{key:"reflection",value:function(){return!1}},{key:"verticalFlipAndRotation",value:function(){var t=this.courtTypeConstants.COURT_RECT_HEIGHT;this.ctx.scale(1,-1),this.ctx.translate(0,-Math.abs(t))}},{key:"setColor",value:function(t){var n="transparent"===this.options.lineColor?"transparent":t;this.ctx.strokeStyle=n,this.ctx.fillStyle=n}},{key:"courtCenter",get:function(){return{x:this.courtTypeConstants.COURT_RECT_WIDTH/2,y:this.courtTypeConstants.COURT_RECT_HEIGHT/2}}}]),e}(pc);function Cc(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Qc=function(t){fc()(e,t);var n=Cc(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(dc),wc=.1667,Lc=1.5,Sc=2.4,kc=.55,vc=!1,Yc=480,mc=460,Rc="#C49463",Fc=60.5,bc=127.28125,Zc=60,Bc=1.41667,Vc=26,Wc=.5,Gc=4,Pc=6,Jc=5,Hc=3.58333,Kc=5,Xc=37,qc=15,_c=20,$c=5,tN=2,nN=.5,eN=1.5,rN=18,iN=95,uN=390,oN=330,MN=90,cN=2.5,NN=13;function aN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var sN=function(t){fc()(e,t);var n=aN(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Zc},n={x:this.courtCenter.x,y:Zc+Fc},e="transparent"===this.options.lineColor?"transparent":Rc;this.ctx.fillStyle=e,this.ctx.strokeStyle=e;var r=Math.PI/11,i=Math.PI-Math.PI/11;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,iN,r,i,!1);var u=DN(n,iN,i),o=DN(n,iN,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(u.x,u.y),this.ctx.translate(t.x,t.y),this.ctx.rotate(Math.PI/4),this.ctx.moveTo(3,3),this.ctx.lineTo(3,MN-3),this.ctx.lineTo(MN-3,MN-3),this.ctx.lineTo(MN-3,3),this.ctx.lineTo(3,3),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y-eN,rN/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,Vc/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.translate(t.x,t.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.arc(MN,0,NN,Math.PI/4,Math.PI+Math.PI/20,!1),this.ctx.stroke(),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(MN,MN,NN,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(0,MN,NN,Math.PI/4,Math.PI+Math.PI/2.2,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function DN(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function TN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var gN=function(t){fc()(e,t);var n=TN(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:Zc};this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.save(),this.ctx.translate(n.x,n.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(MN,0),this.ctx.stroke(),this.drawBaseSquare(MN,0),this.drawBaseSquare(MN+cN/2,MN-cN/2),this.drawBaseSquare(cN,MN-cN),this.ctx.beginPath(),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.restore(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(e*oN,0),t.ctx.stroke(),t.ctx.restore()}));var e=Math.PI/8.1,r=Math.PI-Math.PI/8.1;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y+138,uN-138,e,r,!1),this.ctx.stroke(),this.ctx.restore()}},{key:"drawBaseSquare",value:function(t,n){this.ctx.save(),this.ctx.lineCap="square",this.ctx.beginPath(),this.ctx.translate(t,n),this.ctx.moveTo(0,0),this.ctx.lineTo(0,cN),this.ctx.lineTo(-cN,cN),this.ctx.lineTo(-cN,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function lN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var IN=function(t){fc()(e,t);var n=lN(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:Zc},e={x:n.x-Bc/2,y:n.y+Bc},r={x:n.x+Bc/2,y:n.y+Bc};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(r.x,r.y-Bc/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-Bc/2),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.fill(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y+Bc/2),t.ctx.beginPath();var r=Bc/2+Wc;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,Bc/2),t.ctx.lineTo(e*(r+Gc),Bc/2),t.ctx.lineTo(e*(r+Gc),Bc/2-Pc),t.ctx.lineTo(e*r,Bc/2-Pc),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+Bc/2-Pc+Bc/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-Jc),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(Hc/2),0),t.ctx.lineTo(n*(Hc/2),Jc),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-Vc/2),t.ctx.beginPath(),t.ctx.arc(e*Xc,0,Kc/2,0,2*Math.PI,!0),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(e*MN,-(qc+$c)),t.ctx.lineTo(e*MN,-qc),t.ctx.lineTo(e*(MN-_c),-qc),t.ctx.lineTo(e*(MN-_c),-(qc+$c)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(dc);function yN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var hN=function(t){fc()(e,t);var n=yN(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Zc+Fc};this.ctx.save(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.moveTo(0,0),this.ctx.lineTo(tN/2,0),this.ctx.lineTo(tN/2,nN),this.ctx.lineTo(-tN/2,nN),this.ctx.lineTo(-tN/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function jN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var xN=function(t){fc()(e,t);var n=jN(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(dc),zN=.1667,ON=1.5,EN=2.4,AN=.55,fN=!1,pN=280,UN=260,dN="#C49463",CN="#E4CCB7",QN=43,wN=127.28125,LN=25,SN=1.41667,kN=26,vN=.5,YN=4,mN=6,RN=5,FN=3.58333,bN=5,ZN=37,BN=8,VN=15,WN=3,GN=5,PN=1,JN=0,HN=16,KN=60,XN=220,qN=190,_N=60,$N=2.5,ta=13;function na(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ea=function(t){fc()(e,t);var n=na(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:LN},n={x:this.courtCenter.x,y:LN+QN},e="transparent"===this.options.lineColor?"transparent":dN;this.ctx.fillStyle=e,this.ctx.strokeStyle=e;var r=Math.PI/15,i=Math.PI-Math.PI/15;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,KN,r,i,!1);var u=ra(n,KN,i),o=ra(n,KN,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(u.x,u.y),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.strokeStyle="transparent"===this.options.lineColor?"transparent":"#FFFFFF",this.ctx.fillStyle="transparent"===this.options.lineColor?"transparent":CN,this.ctx.beginPath(),this.ctx.arc(n.x,n.y-JN,HN/2,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,kN/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function ra(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function ia(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ua=function(t){fc()(e,t);var n=ia(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:LN};this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.save(),this.ctx.translate(n.x,n.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(_N,0),this.ctx.stroke(),this.drawBaseSquare(_N,0),this.drawBaseSquare(_N+$N/2,_N-$N/2),this.drawBaseSquare($N,_N-$N),this.ctx.beginPath(),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.restore(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(e*qN,0),t.ctx.stroke(),t.ctx.restore()}));var e=Math.PI/7.8,r=Math.PI-Math.PI/7.8;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y+77,XN-77+3,e,r,!1),this.ctx.stroke(),this.ctx.restore()}},{key:"drawBaseSquare",value:function(t,n){this.ctx.save(),this.ctx.lineCap="square",this.ctx.beginPath(),this.ctx.translate(t,n),this.ctx.moveTo(0,0),this.ctx.lineTo(0,$N),this.ctx.lineTo(-$N,$N),this.ctx.lineTo(-$N,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function oa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ma=function(t){fc()(e,t);var n=oa(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:LN},e={x:n.x-SN/2,y:n.y+SN},r={x:n.x+SN/2,y:n.y+SN};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(r.x,r.y-SN/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-SN/2),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.fill(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y+SN/2),t.ctx.beginPath();var r=SN/2+vN;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,SN/2),t.ctx.lineTo(e*(r+YN),SN/2),t.ctx.lineTo(e*(r+YN),SN/2-mN),t.ctx.lineTo(e*r,SN/2-mN),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+SN/2-mN+SN/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-RN),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(FN/2),0),t.ctx.lineTo(n*(FN/2),RN),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-kN/2),t.ctx.beginPath(),t.ctx.arc(e*ZN,0,bN/2,0,2*Math.PI,!0),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(e*_N,-(BN+WN)),t.ctx.lineTo(e*_N,-BN),t.ctx.lineTo(e*(_N-VN),-BN),t.ctx.lineTo(e*(_N-VN),-(BN+WN)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(dc);function ca(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Na=function(t){fc()(e,t);var n=ca(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:LN+QN-PN/2};this.ctx.save(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.moveTo(0,0),this.ctx.lineTo(GN/2,0),this.ctx.lineTo(GN/2,PN),this.ctx.lineTo(-GN/2,PN),this.ctx.lineTo(-GN/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc),aa=300,sa=260,Da="#C49463",Ta="#E4CCB7",ga=40,la=127.28125,Ia=25,ya=1.41667,ha=26,ja=.5,xa=4,za=6,Oa=5,Ea=3.58333,Aa=5,fa=37,pa=8,Ua=15,da=3,Ca=5,Qa=1,wa=0,La=16,Sa=60,ka=225,va=200,Ya=60,ma=2.5,Ra=13;function Fa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ba=function(t){fc()(e,t);var n=Fa(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Ia},n={x:this.courtCenter.x,y:Ia+ga},e="transparent"===this.options.lineColor?"transparent":Da;this.ctx.fillStyle=e,this.ctx.strokeStyle=e;var r=Math.PI/13,i=Math.PI-Math.PI/13;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,Sa,r,i,!1);var u=Za(n,Sa,i),o=Za(n,Sa,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(u.x,u.y),this.ctx.fill(),this.ctx.restore(),this.ctx.save(),this.ctx.strokeStyle="transparent"===this.options.lineColor?"transparent":"#FFFFFF",this.ctx.fillStyle="transparent"===this.options.lineColor?"transparent":Ta,this.ctx.beginPath(),this.ctx.arc(n.x,n.y-wa,La/2,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore(),this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,ha/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function Za(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function Ba(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Va=function(t){fc()(e,t);var n=Ba(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:Ia};this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.save(),this.ctx.translate(n.x,n.y),this.ctx.rotate(Math.PI/4),this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(Ya,0),this.ctx.stroke(),this.drawBaseSquare(Ya,0),this.drawBaseSquare(Ya+ma/2,Ya-ma/2),this.drawBaseSquare(ma,Ya-ma),this.ctx.beginPath(),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.restore(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(e*va,0),t.ctx.stroke(),t.ctx.restore()}));var e=Math.PI/6.8,r=Math.PI-Math.PI/6.8;this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y+71,ka-71+4,e,r,!1),this.ctx.stroke(),this.ctx.restore()}},{key:"drawBaseSquare",value:function(t,n){this.ctx.save(),this.ctx.lineCap="square",this.ctx.beginPath(),this.ctx.translate(t,n),this.ctx.moveTo(0,0),this.ctx.lineTo(0,ma),this.ctx.lineTo(-ma,ma),this.ctx.lineTo(-ma,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function Wa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ga=function(t){fc()(e,t);var n=Wa(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:Ia},e={x:n.x-ya/2,y:n.y+ya},r={x:n.x+ya/2,y:n.y+ya};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(r.x,r.y-ya/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-ya/2),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.fill(),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y+ya/2),t.ctx.beginPath();var r=ya/2+ja;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,ya/2),t.ctx.lineTo(e*(r+xa),ya/2),t.ctx.lineTo(e*(r+xa),ya/2-za),t.ctx.lineTo(e*r,ya/2-za),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+ya/2-za+ya/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-Oa),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(Ea/2),0),t.ctx.lineTo(n*(Ea/2),Oa),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-ha/2),t.ctx.beginPath(),t.ctx.arc(e*fa,0,Aa/2,0,2*Math.PI,!0),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(n.x,n.y),t.ctx.rotate(e*(Math.PI/4)),t.ctx.beginPath(),t.ctx.moveTo(e*Ya,-(pa+da)),t.ctx.lineTo(e*Ya,-pa),t.ctx.lineTo(e*(Ya-Ua),-pa),t.ctx.lineTo(e*(Ya-Ua),-(pa+da)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(dc);function Pa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ja=function(t){fc()(e,t);var n=Pa(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Ia+ga-Qa/2};this.ctx.save(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.moveTo(0,0),this.ctx.lineTo(Ca/2,0),this.ctx.lineTo(Ca/2,Qa),this.ctx.lineTo(-Ca/2,Qa),this.ctx.lineTo(-Ca/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(dc);function Ha(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ka=function(t){fc()(e,t);var n=Ha(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){if(this.courtTypeConstants.BENCH_MARKING){var t={x:this.courtCenter.x-11,y:0},n={x:this.courtCenter.x-11,y:.5},e={x:this.courtCenter.x+11,y:0},r={x:this.courtCenter.x+11,y:.5};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.stroke()}}}]),e}(dc);function Xa(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var qa=function(t){fc()(e,t);var n=Xa(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=0,n=28,e=3,r=28,i={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:28},u={x:this.courtTypeConstants.COURT_RECT_WIDTH-3,y:28};this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(e,r),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(i.x,i.y),this.ctx.lineTo(u.x,u.y),this.ctx.stroke()}}]),e}(dc);function _a(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var $a=function(t){fc()(e,t);var n=_a(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(dc);function ts(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ns=function(t){fc()(e,t);var n=ts(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){if(this.options.showHalfCourtCircle){this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,6,0,2*Math.PI,!0),this.courtTypeConstants.CENTER_INNER_CIRCLE&&this.ctx.arc(this.courtCenter.x,this.courtCenter.y,2,0,2*Math.PI,!0),this.ctx.stroke()}}}]),e}(dc);function es(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var rs=function(t){fc()(e,t);var n=es(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(dc);function is(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var us=function(t){fc()(e,t);var n=is(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:19},n=this.courtTypeConstants.FREE_THROW_INNER_WIDTH/2;this.ctx.beginPath(),this.ctx.arc(t.x,t.y,n,0,Math.PI,!1),this.ctx.stroke(),this.courtTypeConstants.FREE_THROW_INNER_DASHED_CIRCLE&&(this.ctx.setLineDash([1,.5]),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,n,0,Math.PI,!0),this.ctx.stroke())}}]),e}(dc);function os(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ms=function(t){fc()(e,t);var n=os(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:5.25},n={x:t.x-3,y:4},e={x:t.x+3,y:4};this.ctx.beginPath(),this.ctx.moveTo(n.x,n.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,.75,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(dc);function cs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ns=function(t){fc()(e,t);var n=cs(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this.courtTypeConstants.FREE_THROW_INNER_WIDTH,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH,e={x:this.courtCenter.x-t/2,y:0},r={x:this.courtCenter.x-n/2,y:0};this.ctx.beginPath(),this.ctx.rect(e.x,e.y,t,19),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(r.x,r.y,n,19),this.ctx.stroke()}}]),e}(dc);function as(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ss=function(t){fc()(e,t);var n=as(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:5.25},n={x:this.courtCenter.x+4,y:4},e={x:this.courtCenter.x+4,y:5.25},r={x:this.courtCenter.x-4,y:4};this.ctx.beginPath(),this.ctx.moveTo(n.x,n.y),this.ctx.lineTo(e.x,e.y),this.ctx.arc(t.x,t.y,4,0,Math.PI,!1),this.ctx.lineTo(r.x,r.y),this.ctx.stroke()}}]),e}(dc);function Ds(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ts=function(t){fc()(e,t);var n=Ds(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this.courtCenter.x-this.courtTypeConstants.HOOP_CORNER_DISTANCE,n=this.courtTypeConstants.COURT_RECT_WIDTH-t,e={x:t,y:0},r={x:t,y:this.courtTypeConstants.THREE_POINT_OFFSET_ORIGIN_Y_APPROX},i={x:n,y:0},u={x:this.courtCenter.x,y:5.25},o=Math.asin((this.courtTypeConstants.THREE_POINT_ASIN_APPROX-.75-.5)/this.courtTypeConstants.THREE_POINT_ARC_RADIUS),M=Math.PI-o;this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.arc(u.x,u.y,this.courtTypeConstants.THREE_POINT_ARC_RADIUS,M,o,!0),this.ctx.lineTo(i.x,i.y),this.ctx.stroke()}}]),e}(dc),gs=.1667,ls=1.5,Is=1,ys=.33,hs=!0;function js(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var xs=function(t){fc()(e,t);var n=js(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t=this,n=this.courtCenter.x,e=5.25,r={x:this.courtCenter.x,y:e+30},i=[{x:n-30*Math.cos(50*Math.PI/180),y:e+30*Math.sin(50*Math.PI/180)},r,{x:n+30*Math.cos(50*Math.PI/180),y:e+30*Math.sin(50*Math.PI/180)}];this.ctx.lineWidth=3*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.font="".concat(4,"px Helvetica"),i.forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,2,0,2*Math.PI,!0),t.ctx.stroke(),"transparent"!==t.options.lineColor&&(t.ctx.fillStyle="#001c4f",t.ctx.fill()),t.ctx.fillStyle=t.options.lineColor,t.ctx.fillText("4",n.x-1.1,n.y+1.4)}))}}]),e}(dc),zs={drawLogic:function(){var t=this,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH/2,e=this.courtCenter.x-n,r=this.courtCenter.x+n,i=this.courtCenter.x-5,u=this.courtCenter.x+5;[7,8,11,14].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e,n),t.ctx.lineTo(e-.667,n),t.ctx.moveTo(r,n),t.ctx.lineTo(r+.667,n),t.ctx.stroke()})),this.ctx.beginPath(),this.ctx.moveTo(i,13),this.ctx.lineTo(i+.5,13),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(u,13),this.ctx.lineTo(u-.5,13),this.ctx.stroke()}};function Os(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Es=function(t){fc()(e,t);var n=Os(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}}]),e}(dc);Object.assign(Es.prototype,zs);var As=50,fs=94,ps=22,Us=23.6762,ds=10,Cs=14,Qs=12,ws=16,Ls=!0,Ss=!0,ks=!0;function vs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ys=function(t){fc()(e,t);var n=vs(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH/2,e=this.courtCenter.x-n,r=this.courtCenter.x+n;[5.9,13.6,16.5].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e,n),t.ctx.lineTo(e-.333,n),t.ctx.moveTo(r,n),t.ctx.lineTo(r+.333,n),t.ctx.stroke()})),this.ctx.beginPath(),this.ctx.rect(e,8.8,-.333,1.9),this.ctx.fill(),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(r,8.8,.333,1.9),this.ctx.fill(),this.ctx.stroke()}}]),e}(dc),ms=49.21,Rs=91.86,Fs=21.65,bs=22.15,Zs=6,Bs=8,Vs=12,Ws=16.08,Gs=!1,Ps=!1,Js=!1;function Hs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ks=function(t){fc()(e,t);var n=Hs(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}}]),e}(dc);Object.assign(Ks.prototype,zs);var Xs=50,qs=94,_s=22,$s=23.6762,tD=10,nD=14,eD=12,rD=16,iD=!0,uD=!0,oD=!0,MD={drawLogic:function(){var t=this,n=this.courtTypeConstants.FREE_THROW_OUTER_WIDTH/2,e=this.courtCenter.x-n,r=this.courtCenter.x+n;[11,14,17].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e,n),t.ctx.lineTo(e-.667,n),t.ctx.moveTo(r,n),t.ctx.lineTo(r+.667,n),t.ctx.stroke()})),this.ctx.beginPath(),this.ctx.rect(e,7,-1.2,.8),this.ctx.fill(),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(r,7,1.2,.8),this.ctx.fill(),this.ctx.stroke()}};function cD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ND=function(t){fc()(e,t);var n=cD(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}}]),e}(dc);Object.assign(ND.prototype,MD);var aD=50,sD=94,DD=20.75,TD=20.75,gD=2,lD=6,ID=12,yD=12,hD=!1,jD=!1,xD=!1;function zD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var OD=function(t){fc()(e,t);var n=zD(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}}]),e}(dc);Object.assign(OD.prototype,MD);var ED=50,AD=94,fD=20.75,pD=20.75,UD=2,dD=6,CD=12,QD=12,wD=!1,LD=!1,SD=!0;function kD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var vD=function(t){fc()(e,t);var n=kD(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}}]),e}(dc);Object.assign(vD.prototype,MD);var YD=50,mD=84,RD=19.75,FD=19.75,bD=2,ZD=6,BD=12,VD=12,WD=!1,GD=!1,PD=!1;function JD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var HD=function(t){fc()(e,t);var n=JD(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}}]),e}(dc);Object.assign(HD.prototype,MD);var KD=42,XD=74,qD=19.75,_D=19.75,$D=2,tT=6,nT=12,eT=12,rT=!1,iT=!1,uT=!1;function oT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var MT=function(t){fc()(e,t);var n=oT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}}]),e}(dc);Object.assign(MT.prototype,zs);var cT=50,NT=94,aT=21.65,sT=22.15,DT=6,TT=9,gT=12,lT=16,IT=!0,yT=!0,hT=!0;function jT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var xT=function(t){fc()(e,t);var n=jT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(dc);function zT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var OT=function(t){fc()(e,t);var n=zT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(dc);function ET(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var AT=function(t){fc()(e,t);var n=ET(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=0,n=30,e={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:30};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t,n),this.ctx.lineTo(e.x,e.y),this.ctx.stroke()}}]),e}(dc);function fT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var pT=function(t){fc()(e,t);var n=fT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t=this.courtTypeConstants.END_ZONE_HEIGHT,n=String.fromCharCode(8202);this.ctx.fillStyle=this.options.lineColor,this.ctx.translate(20,t);for(var e=1;e<10;e++){var r="".concat(e<=5?e:10-e).concat(n,"0");this.ctx.translate(0,this.courtTypeConstants.END_ZONE_HEIGHT),this.ctx.save(),this.ctx.rotate(Math.PI/2),this.ctx.fillText(r,-6,0),this.ctx.translate(0,40-this.courtTypeConstants.COURT_RECT_WIDTH),this.ctx.rotate(Math.PI),this.ctx.fillText(r,-6,0),this.ctx.restore()}}}]),e}(dc);function UT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var dT=function(t){fc()(e,t);var n=UT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n=[3,53,this.courtTypeConstants.COURT_RECT_WIDTH-53-3,this.courtTypeConstants.COURT_RECT_WIDTH-3-3];this.ctx.save(),this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH;for(var e=function(e){n.forEach((function(n){for(var r=0;r<4;r++){var i=3+3*r,u={x:n,y:e-i},o={x:n+3,y:e-i};t.ctx.beginPath(),t.ctx.moveTo(u.x,u.y),t.ctx.lineTo(o.x,o.y),t.ctx.stroke()}}))},r=this.courtTypeConstants.END_ZONE_HEIGHT+15;r<=this.courtCenter.y;r+=15)e(r);this.ctx.restore()}}]),e}(dc);function CT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var QT=function(t){fc()(e,t);var n=CT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){for(var t=this.courtTypeConstants.END_ZONE_HEIGHT;t<=this.courtCenter.y;t+=15){var n={x:0,y:t},e={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:t};this.ctx.beginPath(),this.ctx.lineWidth=t%30==0?2*this.courtTypeConstants.COURT_LINE_WIDTH:this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(n.x,n.y),this.ctx.lineTo(e.x,e.y),this.ctx.stroke()}}}]),e}(dc),wT=.32,LT=1.5,ST=2,kT=.55,vT=!1,YT=160,mT=360,RT=30;function FT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var bT=function(t){fc()(e,t);var n=FT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor("#000"),this.ctx.lineWidth=4*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH,n=(this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.FACE_OFF_SPOTS_DISTANCE)/2,e=[{x:0,y:this.courtCenter.y},{x:0,y:t}],r=[{x:n,y:0},{x:this.courtTypeConstants.COURT_RECT_WIDTH-n,y:0}],i=[{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y},{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:t}];this.ctx.beginPath(),this.ctx.moveTo(e[0].x,e[0].y),this.ctx.lineTo(e[1].x,e[1].y),this.ctx.bezierCurveTo(0,0,10,0,r[0].x,r[0].y),this.ctx.lineTo(r[1].x,r[1].y),this.ctx.bezierCurveTo(this.courtTypeConstants.COURT_RECT_WIDTH-10,0,this.courtTypeConstants.COURT_RECT_WIDTH,0,i[1].x,i[1].y),this.ctx.lineTo(i[0].x,i[0].y),this.ctx.stroke()}}]),e}(dc);function ZT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var BT=function(t){fc()(e,t);var n=ZT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_BLUE),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,15,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(dc);function VT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var WT=function(t){fc()(e,t);var n=VT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.setLineDash([2,1]),this.ctx.lineWidth=4*this.courtTypeConstants.COURT_LINE_WIDTH;var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(dc);function GT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var PT=function(t){fc()(e,t);var n=GT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_BLUE),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,1,0,2*Math.PI,!0),this.ctx.fill()}}]),e}(dc);function JT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var HT=function(t){fc()(e,t);var n=JT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this;this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var n=(this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.FACE_OFF_SPOTS_DISTANCE)/2,e=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH+22;[{x:n,y:e},{x:this.courtTypeConstants.COURT_RECT_WIDTH-n,y:e}].forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,t.courtTypeConstants.FACE_OFF_SPOT_RADIUS,0,2*Math.PI,!0),t.ctx.fill(),t.ctx.beginPath(),t.ctx.arc(n.x,n.y,t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS,0,2*Math.PI,!0),t.ctx.stroke(),[{ox:n.x-t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS,tx:n.x-(t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS+1)},{ox:n.x+t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS,tx:n.x+(t.courtTypeConstants.FACE_OFF_SPOT_CIRCLE_RADIUS+1)}].forEach((function(e){[n.y-1,n.y+1].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(e.ox,n),t.ctx.lineTo(e.tx,n),t.ctx.stroke()}))}))}))}}]),e}(dc);function KT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var XT=function(t){fc()(e,t);var n=KT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH;this.ctx.beginPath(),this.ctx.moveTo(0,t),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,t),this.ctx.stroke()}}]),e}(dc);function qT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var _T=function(t){fc()(e,t);var n=qT(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_BLUE),this.ctx.lineWidth=4*this.courtTypeConstants.COURT_LINE_WIDTH;var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.setColor(this.courtTypeConstants.LINE_COLOR_RED);var e=(this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.FACE_OFF_SPOTS_DISTANCE)/2,r=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH+5,i={x:e,y:r},u={x:this.courtTypeConstants.COURT_RECT_WIDTH-e,y:r};this.ctx.beginPath(),this.ctx.arc(i.x,i.y,this.courtTypeConstants.FACE_OFF_SPOT_RADIUS,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(u.x,u.y,this.courtTypeConstants.FACE_OFF_SPOT_RADIUS,0,2*Math.PI,!0),this.ctx.fill()}}]),e}(dc);function $T(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var tg=function(t){fc()(e,t);var n=$T(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(0,this.courtCenter.y,10,-Math.PI/2,Math.PI/2,!1),this.ctx.stroke()}}]),e}(dc),ng=.1667,eg=1.5,rg=2,ig=.55,ug=!0;function og(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Mg=function(t){fc()(e,t);var n=og(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH;this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t),this.ctx.lineTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,t),this.ctx.stroke(),this.setColor("#000"),this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.lineTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.stroke()}}]),e}(dc),cg=85,Ng=200,ag="#C8102E",sg="#0032A0",Dg=64,Tg=25,gg=44,lg=.75,Ig=15,yg=6,hg=3,jg=4;function xg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var zg=function(t){fc()(e,t);var n=xg(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.setColor(this.courtTypeConstants.LINE_COLOR_RED),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=this.courtCenter.y-this.courtTypeConstants.NEUTRAL_ZONE_LENGTH-this.courtTypeConstants.END_ZONE_LENGTH;this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,t,this.courtTypeConstants.GOAL_CREASE_ARC_RADIUS,0,Math.PI,!1),this.ctx.stroke(),this.setColor("#000"),this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.lineTo(this.courtCenter.x-this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t-this.courtTypeConstants.GOAL_CAGE_DEPTH),this.ctx.lineTo(this.courtCenter.x+this.courtTypeConstants.GOAL_CAGE_LENGTH/2,t),this.ctx.stroke()}}]),e}(dc),Og=100,Eg=200,Ag="#C8102E",fg="#0032A0",pg=58,Ug=29,dg=44,Cg=.75,Qg=15,wg=6,Lg=3,Sg=5.8;function kg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var vg=function(t){fc()(e,t);var n=kg(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(dc);function Yg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var mg=function(t){fc()(e,t);var n=Yg(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(dc),Rg=.1667,Fg=1.5,bg=1,Zg=.33,Bg=!0;function Vg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Wg=function(t){fc()(e,t);var n=Vg(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e=[{x:this.courtCenter.x-1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y+1},{x:this.courtCenter.x-1,y:this.courtCenter.y+1}];this.ctx.beginPath(),this.ctx.moveTo(e[0].x,e[0].y),this.ctx.lineTo(e[2].x,e[2].y),this.ctx.moveTo(e[1].x,e[1].y),this.ctx.lineTo(e[3].x,e[3].y),this.ctx.stroke()}}]),e}(dc);function Gg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Pg=function(t){fc()(e,t);var n=Gg(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtTypeConstants.WING_OFFSET_X,y:0},n={x:this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:0},r={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.stroke();var i={x:this.courtCenter.x,y:15};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(i.x-1,i.y),this.ctx.lineTo(i.x+1,i.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(i.x,i.y,3,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(dc);function Jg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Hg=function(t){fc()(e,t);var n=Jg(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-10},n={x:this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y-10},r={x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.WING_OFFSET_X,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.stroke()}}]),e}(dc),Kg=60,Xg=110,qg=10,_g=20;function $g(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var tl=function(t){fc()(e,t);var n=$g(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t={x:this.courtCenter.x-1.5,y:this.courtCenter.y},n={x:this.courtCenter.x+1.5,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,10,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(dc);function nl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var el=function(t){fc()(e,t);var n=nl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n={x:this.courtCenter.x,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_CENTER_OFFSET_Y-30};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(n.x,n.y,2.84,0,2*Math.PI,!1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(n.x,n.y,15.97,0,Math.PI,!1),this.ctx.stroke();var e={x:n.x-15.97,y:n.y},r={x:n.x-2.84,y:n.y},i={x:n.x+15.97,y:n.y},u={x:n.x+2.84,y:n.y};this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.moveTo(i.x,i.y),this.ctx.lineTo(u.x,u.y),this.ctx.stroke();var o={x:n.x,y:n.y-2.84},M=Math.PI/4,c=Math.PI/2+Math.PI/4;this.ctx.beginPath(),this.ctx.arc(o.x,o.y,14.43,M,c,!1),this.ctx.stroke();var N=rl(o,14.43,c),a=rl(o,14.43,M),s=n.x-2.84,D=n.x+2.84;this.ctx.beginPath(),this.ctx.moveTo(N.x,N.y),this.ctx.lineTo(s,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(a.x,a.y),this.ctx.lineTo(D,n.y),this.ctx.stroke();var T={x:s-8.75,y:n.y},g={x:D+8.75,y:n.y};this.ctx.beginPath(),this.ctx.moveTo(T.x,T.y),this.ctx.lineTo(T.x,T.y+1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(g.x,g.y),this.ctx.lineTo(g.x,g.y+1),this.ctx.stroke();var l=rl(o,14.43,Math.PI/2);this.ctx.beginPath(),this.ctx.moveTo(l.x,l.y-1),this.ctx.lineTo(l.x,l.y+1),this.ctx.stroke();for(var I=function(n){[1,-1].forEach((function(e){var r=Math.PI/2+Math.PI/10*e*n,i=rl(o,14.43,r);t.ctx.save(),t.ctx.translate(i.x,i.y),t.ctx.rotate(Math.PI/10*e*n),t.ctx.beginPath(),t.ctx.moveTo(0,-1),t.ctx.lineTo(0,1),t.ctx.stroke(),t.ctx.restore()}))},y=1;y<=3;y++)I(y);var h={x:T.x,y:T.y-5},j={x:g.x,y:g.y-5};this.ctx.beginPath(),this.ctx.arc(h.x,h.y,.5,0,2*Math.PI,!1),this.ctx.arc(j.x,j.y,.5,0,2*Math.PI,!1),this.ctx.fill();var x={x:n.x-1,y:n.y},z={x:n.x+1,y:n.y},O={x:n.x,y:n.y-1};this.ctx.beginPath(),this.ctx.moveTo(x.x,x.y),this.ctx.lineTo(z.x,z.y),this.ctx.lineTo(O.x,O.y),this.ctx.closePath(),this.ctx.stroke()}}]),e}(dc);function rl(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}var il=60,ul=130,ol=20;function Ml(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var cl=function(t){fc()(e,t);var n=Ml(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t=[{x:0,y:this.courtCenter.y},{x:0,y:this.courtTypeConstants.GOAL_LINE_Y}],n=[{x:this.courtTypeConstants.TOP_SIDE_CURVE_OFFSET,y:0},{x:this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.TOP_SIDE_CURVE_OFFSET,y:0}],e=[{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y},{x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtTypeConstants.GOAL_LINE_Y}];this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.bezierCurveTo(0,0,10,0,n[0].x,n[0].y),this.ctx.lineTo(n[1].x,n[1].y),this.ctx.bezierCurveTo(this.courtTypeConstants.COURT_RECT_WIDTH-10,0,this.courtTypeConstants.COURT_RECT_WIDTH,0,e[1].x,e[1].y),this.ctx.lineTo(e[0].x,e[0].y),this.ctx.stroke()}}]),e}(dc),Nl=.1667,al=1.5,sl=1,Dl=.33,Tl=!0;function gl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ll=function(t){fc()(e,t);var n=gl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,11,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.setLineDash([.8,.5]),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,1.41667,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(dc);function Il(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var yl=function(t){fc()(e,t);var n=Il(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH,this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y+5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH-5,this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y+5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH-5,this.courtCenter.y+this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y-5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,this.courtCenter.y+this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y-5),this.ctx.stroke()}}]),e}(dc);function hl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var jl=function(t){fc()(e,t);var n=hl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e=this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y/2;this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH,e-12),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e-12),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e+12),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,e+12),this.ctx.stroke()}}]),e}(dc);function xl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var zl=function(t){fc()(e,t);var n=xl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:this.courtTypeConstants.GOAL_LINE_Y};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t.x-9.25,t.y),this.ctx.lineTo(t.x+9.25,t.y),this.ctx.stroke();var n=Math.PI/4.5;this.ctx.beginPath(),this.ctx.arc(t.x,t.y,9.25,-n,Math.PI+n,!1),this.ctx.stroke();this.ctx.beginPath(),this.ctx.moveTo(t.x-7.25,t.y-6),this.ctx.lineTo(t.x+7.25,t.y-6),this.ctx.stroke();var e={x:t.x-2.375,y:t.y},r={x:t.x+2.375,y:t.y},i={x:t.x,y:t.y-2.375};this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(i.x,i.y),this.ctx.closePath(),this.ctx.stroke()}}]),e}(dc);function Ol(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var El=function(t){fc()(e,t);var n=Ol(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(0,this.courtCenter.y,10,Math.PI/2,-Math.PI/2,!0),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y-10),this.ctx.bezierCurveTo(0,this.courtCenter.y-10,-2.5,this.courtCenter.y-10,-5,this.courtCenter.y-10),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y+10),this.ctx.bezierCurveTo(0,this.courtCenter.y+10,-2.5,this.courtCenter.y+10,-5,this.courtCenter.y+10),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y-12),this.ctx.lineTo(-5,this.courtCenter.y-12),this.ctx.lineTo(-5,this.courtCenter.y+12),this.ctx.lineTo(0,this.courtCenter.y+12),this.ctx.stroke()}}]),e}(dc),Al=85,fl=180,pl=12,Ul=12,dl=42.5;function Cl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ql=2,wl=function(t){fc()(e,t);var n=Cl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t=this;this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,.5,0,2*Math.PI,!0),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,Ql,0,2*Math.PI,!0),this.ctx.stroke(),[Ql,-Ql].forEach((function(n){t.ctx.beginPath(),t.ctx.moveTo(t.courtCenter.x+n,t.courtCenter.y-3),t.ctx.lineTo(t.courtCenter.x+n,t.courtCenter.y+3),t.ctx.stroke()}))}}]),e}(dc);function Ll(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Sl=function(t){fc()(e,t);var n=Ll(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();var e=this.courtCenter.y-5;this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH,e),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH+5,e-30),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,e-30),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(this.courtTypeConstants.COURT_RECT_WIDTH-4,this.courtCenter.y),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH-4,this.courtCenter.y-30-5+.5),this.ctx.lineTo(this.courtTypeConstants.COURT_RECT_WIDTH,this.courtCenter.y-30-5+.5),this.ctx.stroke();var r=this.courtCenter.y-this.courtTypeConstants.RESTRAINING_LINE_OFFSET_Y;this.ctx.beginPath(),this.ctx.moveTo(0,r),this.ctx.lineTo(-5,r),this.ctx.lineTo(-5,r-12),this.ctx.lineTo(0,r-12),this.ctx.stroke()}}]),e}(dc);function kl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var vl=function(t){fc()(e,t);var n=kl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:this.courtTypeConstants.GOAL_LINE_Y};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t.x-9.25,t.y),this.ctx.lineTo(t.x+9.25,t.y),this.ctx.stroke();var n=Math.PI/4.5;this.ctx.beginPath(),this.ctx.arc(t.x,t.y,9.25,-n,Math.PI+n,!1),this.ctx.stroke(),this.ctx.save(),this.ctx.setLineDash([1.2,.4]),this.ctx.beginPath(),this.ctx.arc(t.x,t.y,24,0,Math.PI,!1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(t.x-9.25,t.y),this.ctx.lineTo(t.x-24,t.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(t.x+9.25,t.y),this.ctx.lineTo(t.x+24,t.y),this.ctx.stroke(),this.ctx.restore();this.ctx.beginPath(),this.ctx.moveTo(t.x-7.25,t.y-6),this.ctx.lineTo(t.x+7.25,t.y-6),this.ctx.stroke();var e={x:t.x-2.375,y:t.y},r={x:t.x+2.375,y:t.y},i={x:t.x,y:t.y-2.375};this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(i.x,i.y),this.ctx.closePath(),this.ctx.stroke()}}]),e}(dc);function Yl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ml=function(t){fc()(e,t);var n=Yl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(0,this.courtCenter.y,10,Math.PI/2,-Math.PI/2,!0),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(0,this.courtCenter.y-10),this.ctx.lineTo(-5,this.courtCenter.y-10),this.ctx.lineTo(-5,this.courtCenter.y+10),this.ctx.lineTo(0,this.courtCenter.y+10),this.ctx.stroke()}}]),e}(dc),Rl=85,Fl=180,bl=12,Zl=12,Bl=11,Vl="Concrete";function Wl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Gl=function(t){fc()(e,t);var n=Wl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(dc);function Pl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Jl=function(t){fc()(e,t);var n=Pl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,0,2*Math.PI,!0),this.ctx.stroke()}}]),e}(dc);function Hl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Kl=function(t){fc()(e,t);var n=Hl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(dc);function Xl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ql=function(t){fc()(e,t);var n=Xl(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtCenter.y,.25,0,2*Math.PI,!0),this.ctx.fill()}}]),e}(dc);function _l(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var $l=function(t){fc()(e,t);var n=_l(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=0,n=0,e={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:0};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(t,n,1,0,Math.PI/2,!1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.arc(e.x,e.y,1,Math.PI,Math.PI/2,!0),this.ctx.stroke()}}]),e}(dc);function tI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var nI=function(t){fc()(e,t);var n=tI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,Math.PI/5,Math.PI-Math.PI/5,!1),this.ctx.stroke()}}]),e}(dc);function eI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var rI=function(t){fc()(e,t);var n=eI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.rect(this.courtCenter.x-this.courtTypeConstants.PENALTY_AREA.width/2,0,this.courtTypeConstants.PENALTY_AREA.width,this.courtTypeConstants.PENALTY_AREA.height),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(this.courtCenter.x-this.courtTypeConstants.GOAL_AREA.width/2,0,this.courtTypeConstants.GOAL_AREA.width,this.courtTypeConstants.GOAL_AREA.height),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.rect(this.courtCenter.x-this.courtTypeConstants.GOAL.width/2,-this.courtTypeConstants.GOAL.height,this.courtTypeConstants.GOAL.width,this.courtTypeConstants.GOAL.height),this.ctx.stroke()}}]),e}(dc);function iI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var uI=function(t){fc()(e,t);var n=iI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,.25,0,2*Math.PI,!1),this.ctx.fill()}}]),e}(dc),oI=.1667,MI=1.5,cI=1,NI=.33,aI=!0,sI=60,DI=110,TI=10,gI=12,lI={width:44,height:18},II={width:8,height:2.66},yI={width:20,height:6},hI=60,jI=110,xI=10,zI=12,OI={width:44,height:18},EI={width:8,height:2.66},AI={width:20,height:6};function fI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var pI=function(t){fc()(e,t);var n=fI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t=[{x:this.courtCenter.x-1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y-1},{x:this.courtCenter.x+1,y:this.courtCenter.y+1},{x:this.courtCenter.x-1,y:this.courtCenter.y+1}];this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.moveTo(t[1].x,t[1].y),this.ctx.lineTo(t[3].x,t[3].y),this.ctx.stroke()}}]),e}(dc);function UI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var dI=function(t){fc()(e,t);var n=UI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=11,n=0,e={x:this.courtTypeConstants.COURT_RECT_WIDTH-11,y:0};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(t,n-1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(e.x,e.y-1),this.ctx.stroke()}}]),e}(dc);function CI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var QI=function(t){fc()(e,t);var n=CI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-.33,12),this.ctx.lineTo(this.courtCenter.x+.33,12),this.ctx.stroke()}}]),e}(dc),wI=70,LI=115,SI=10,kI=12,vI={width:44,height:18},YI={width:8,height:2.66},mI={width:20,height:6};function RI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var FI=function(t){fc()(e,t);var n=RI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=11,n=0,e={x:this.courtTypeConstants.COURT_RECT_WIDTH-11,y:0};this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(t,n),this.ctx.lineTo(t,n-1),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(e.x,e.y-1),this.ctx.stroke()}}]),e}(dc);function bI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ZI=function(t){fc()(e,t);var n=bI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.moveTo(this.courtCenter.x-.33,12),this.ctx.lineTo(this.courtCenter.x+.33,12),this.ctx.stroke()}}]),e}(dc),BI=60,VI=100,WI=10,GI=12,PI={width:44,height:18},JI={width:8,height:2.66},HI={width:20,height:6};function KI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var XI=function(t){fc()(e,t);var n=KI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH;var t={x:0,y:this.courtTypeConstants.COURT_RECT_HEIGHT/3},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtTypeConstants.COURT_RECT_HEIGHT/3};this.ctx.beginPath(),this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke()}}]),e}(dc);function qI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var _I=function(t){fc()(e,t);var n=qI(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,Math.PI/12,Math.PI-Math.PI/12,!1),this.ctx.stroke()}}]),e}(dc),$I=45,ty=65,ny=8,ey=10,ry={width:24,height:12},iy={width:6,height:2},uy={width:8,height:4};function oy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var My=function(t){fc()(e,t);var n=oy(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.arc(this.courtCenter.x,this.courtTypeConstants.PENALTY_SPOT_OFFSET_Y,this.courtTypeConstants.CENTER_CIRCLE_RADIUS,Math.PI/6,Math.PI-Math.PI/6,!1),this.ctx.stroke()}}]),e}(dc),cy=55,Ny=80,ay=8,sy=10,Dy={width:36,height:14},Ty={width:6.16,height:2.16},gy={width:12,height:5};function ly(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Iy=function(t){fc()(e,t);var n=ly(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y-9.8},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y-9.8};this.ctx.beginPath(),this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke();for(var e=.574,r=0;r<5;r++)this.ctx.beginPath(),this.ctx.moveTo(t.x-e,t.y),this.ctx.lineTo(t.x-e-.574,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(n.x+e,t.y),this.ctx.lineTo(n.x+e+.574,n.y),this.ctx.stroke(),e+=1.148}}]),e}(dc);function yy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var hy=function(t){fc()(e,t);var n=yy(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.rect(0,0,this.courtTypeConstants.COURT_RECT_WIDTH,this.courtTypeConstants.COURT_RECT_HEIGHT),this.ctx.stroke()}}]),e}(dc);function jy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var xy=function(t){fc()(e,t);var n=jy(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLogic",value:function(){var t={x:0,y:this.courtCenter.y},n={x:this.courtTypeConstants.COURT_RECT_WIDTH,y:this.courtCenter.y};this.ctx.beginPath(),this.ctx.lineWidth=2*this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.moveTo(t.x,t.y),this.ctx.lineTo(n.x,n.y),this.ctx.stroke(),this.ctx.beginPath()}}]),e}(dc);function zy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Oy,Ey,Ay,fy,py,Uy,dy,Cy,Qy,wy,Ly,Sy=function(t){fc()(e,t);var n=zy(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this.courtTypeConstants.COURT_RECT_WIDTH;this.ctx.beginPath(),this.ctx.moveTo(0,-.574),this.ctx.lineTo(0,-1.148),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(t,-.574),this.ctx.lineTo(t,-1.148),this.ctx.stroke()}}]),e}(dc),ky=.1667,vy=1.5,Yy=1,my=.33,Ry=!0,Fy=29.5,by=59.1,Zy=(Oy={},dt()(Oy,yn,o),dt()(Oy,hn,a),dt()(Oy,an,I),dt()(Oy,Dn,k),dt()(Oy,In,m),dt()(Oy,Tn,V),dt()(Oy,gn,K),dt()(Oy,ln,nt),dt()(Oy,sn,Tt),Oy),By=(Cy={},dt()(Cy,yn,dt()({},Bn,N)),dt()(Cy,hn,(Ey={},dt()(Ey,Vn,T),dt()(Ey,Wn,l),Ey)),dt()(Cy,an,(Ay={},dt()(Ay,jn,h),dt()(Ay,xn,x),dt()(Ay,zn,O),dt()(Ay,On,A),dt()(Ay,En,p),dt()(Ay,An,d),dt()(Ay,fn,Q),dt()(Ay,pn,L),Ay)),dt()(Cy,Dn,{}),dt()(Cy,In,(fy={},dt()(fy,bn,F),dt()(fy,Zn,Z),fy)),dt()(Cy,Tn,(py={},dt()(py,Qn,G),dt()(py,wn,J),py)),dt()(Cy,gn,(Uy={},dt()(Uy,Ln,q),dt()(Uy,Sn,$),Uy)),dt()(Cy,ln,(dy={},dt()(dy,vn,ut),dt()(dy,Yn,Mt),dt()(dy,mn,Nt),dt()(dy,Rn,st),dy)),dt()(Cy,sn,{}),Cy),Vy=(Qy={},dt()(Qy,yn,M),dt()(Qy,hn,s),dt()(Qy,an,y),dt()(Qy,Dn,v),dt()(Qy,In,R),dt()(Qy,Tn,W),dt()(Qy,gn,X),dt()(Qy,ln,et),dt()(Qy,sn,gt),Qy),Wy=(wy={},dt()(wy,Bn,c),dt()(wy,Vn,D),dt()(wy,Wn,g),dt()(wy,jn,j),dt()(wy,xn,z),dt()(wy,zn,E),dt()(wy,On,f),dt()(wy,En,U),dt()(wy,An,C),dt()(wy,fn,w),dt()(wy,pn,S),dt()(wy,dn,Y),dt()(wy,Un,Y),dt()(wy,bn,b),dt()(wy,Zn,B),dt()(wy,Qn,P),dt()(wy,wn,H),dt()(wy,Ln,_),dt()(wy,Sn,tt),dt()(wy,kn,it),dt()(wy,vn,ot),dt()(wy,Yn,ct),dt()(wy,mn,at),dt()(wy,Rn,Dt),dt()(wy,Fn,rt),dt()(wy,Cn,lt),wy),Gy=(Ly={},dt()(Ly,yn,{courtTypes:[Bn]}),dt()(Ly,hn,{courtTypes:[Vn,Wn]}),dt()(Ly,an,{courtTypes:[jn,xn,zn,On,En,An,fn,pn]}),dt()(Ly,Dn,{courtTypes:[Un]}),dt()(Ly,In,{courtTypes:[bn,Zn]}),dt()(Ly,Tn,{courtTypes:[Qn,wn]}),dt()(Ly,gn,{courtTypes:[Ln,Sn]}),dt()(Ly,ln,{courtTypes:[kn,vn,Yn,mn,Rn,Fn]}),dt()(Ly,sn,{courtTypes:[Cn]}),Ly);function Py(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}var Jy=function(){function t(n,e,r){At()(this,t),this.ctx=n,this.playData=e,this.options=r}return pt()(t,[{key:"disableMirrorMode",value:function(){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.scale(this.options.scale,this.options.scale),this.ctx.translate(-this.playData.court.courtRect.origin.x,-this.playData.court.courtRect.origin.y)}},{key:"courtTypeConstants",get:function(){if(!Vy[this.playData.sport])throw new Error("unknown sport type constants");if(!Wy[this.playData.court.type])throw new Error("unknown court type constants");return function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Py(Object(e),!0).forEach((function(n){dt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Py(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},Vy[this.playData.sport],{},Wy[this.playData.court.type])}}]),t}();function Hy(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function Ky(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Xy=function(t){fc()(e,t);var n=Ky(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"apply",value:function(){var t=this;this.init(),this.ctx.save(),this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH,this.setColor(),Object.values(this.courtTypeLayers).forEach((function(n){new n(t).apply()})),this.ctx.restore()}},{key:"init",value:function(){this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.setBackground(),this.setWatermark(),this.ctx.restore()}},{key:"setColor",value:function(){var t=this.options.lineColor||"#fff";this.ctx.strokeStyle=t,this.ctx.fillStyle=t}},{key:"setBackground",value:function(){var t;t=this.background,void 0!==(Te.backgroundOptions||{})[t]&&this.staticData.backgroundOptions&&this.staticData.backgroundOptions[this.background]?(this.ctx.fillStyle=this.ctx.createPattern(this.staticData.backgroundOptions[this.background],"repeat"),this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height)):0===this.background.indexOf("#")&&(this.ctx.save(),this.ctx.fillStyle=this.background,this.ctx.fillRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore())}},{key:"setWatermark",value:function(){var t=this.options.watermark?this.staticData.watermark[this.options.watermark]:null;if(t){var n=t.width/t.height,e=this.frameWidth/5,r={width:e,height:e*t.height/t.width};n<1&&(r.width=e*t.width/t.height,r.height=e);var i=this.playData.court.courtRect.size.height>this.courtTypeConstants.COURT_RECT_HEIGHT?Math.abs(this.playData.court.courtRect.origin.y):0,u=(1+Math.abs(this.playData.court.courtRect.origin.x))*this.scale,o=(this.playData.court.courtRect.size.height-i-1)*this.scale-r.height;this.ctx.drawImage(t,0,0,t.width,t.height,u,o,r.width,r.height)}}},{key:"frameWidth",get:function(){return this.options.width}},{key:"scale",get:function(){return this.options.scale}},{key:"staticData",get:function(){return this.options.staticData}},{key:"courtTypeLayers",get:function(){if(!Zy[this.playData.sport])throw new Error("unknown sport type layer");return function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Hy(Object(e),!0).forEach((function(n){dt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Hy(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},Zy[this.playData.sport],{},(By[this.playData.sport]||{})[this.playData.court.type]||{})}},{key:"background",get:function(){return this.options.background||this.courtTypeConstants.BACKGROUND||this.playData.sport}}]),e}(Jy),qy=e(11),_y=e.n(qy),$y={drawLineFromControlPoints:function(){var t=this;this.ctx.save(),this.setLineOptions(),this.ctx.lineJoin="round",this.getProcessedLinePaths().forEach((function(n){t.ctx.save(),n.alpha&&t.setColor(n.alpha),t.ctx.beginPath();var e=n.controlPoints;t.ctx.moveTo(e[0].x,e[0].y),2===e.length&&("DRIBBLE"===(t.line||t.shape||{}).type&&(t.ctx.lineCap="round"),t.ctx.lineTo(e[1].x,e[1].y)),3===e.length&&t.ctx.quadraticCurveTo(e[1].x,e[1].y,e[2].x,e[2].y),4===e.length&&t.ctx.bezierCurveTo(e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y),t.ctx.stroke(),t.ctx.restore()})),this.ctx.restore()},drawArrowLineCap:function(t){var n=t||this.arrowTipPoint();this.ctx.save();var e=this.angleBetweenLastTwoPoints(),r=n,i={x:r.x-1.4/1.3,y:r.y},u={x:r.x-1.4-1.4/6,y:r.y-.7},o={x:r.x-1.4-1.4/6,y:r.y+.7};this.ctx.beginPath(),this.ctx.translate(r.x,r.y),this.ctx.rotate(e),this.ctx.translate(-r.x,-r.y),this.ctx.moveTo(i.x,i.y),this.ctx.lineTo(u.x,u.y),this.ctx.lineTo(r.x,r.y),this.ctx.lineTo(o.x,o.y),this.ctx.lineTo(i.x,i.y),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore()},drawPerpendicularLineCap:function(){this.drawPerpendicularLineAtCourtPoint(this.arrowTipPoint(),this.angleBetweenLastTwoPoints())},drawPerpendicularLineAtCourtPoint:function(t,n){this.ctx.save();var e={x:t.x,y:t.y-1.5},r={x:t.x,y:t.y+1.5};this.ctx.beginPath(),this.ctx.translate(t.x,t.y),this.ctx.rotate(n),this.ctx.translate(-t.x,-t.y),this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(r.x,r.y),this.ctx.fill(),this.ctx.stroke(),this.ctx.restore()},handOffLineCap:function(t){var n=this;this.ctx.save(),t.forEach((function(t){var e=t.controlPoints,r=n.calcMidPoint(e[0],e[e.length-1]),i=n.angleBetweenLastTwoPoints(),u=.5*Math.cos(i),o=.5*Math.sin(i),M={x:r.x+u,y:r.y+o},c={x:r.x-u,y:r.y-o};n.drawPerpendicularLineAtCourtPoint(M,i),n.drawPerpendicularLineAtCourtPoint(c,i),n.ctx.stroke()})),this.ctx.restore()},calcMidPoint:function(t,n){return{x:t.x+(n.x-t.x)/2,y:t.y+(n.y-t.y)/2}},angleBetweenLastTwoPoints:function(){var t=je()(this.getProcessedLinePaths()).pop().controlPoints,n=t[t.length-1],e=t[t.length-2];return this.angleBetweenTwoPoints(e,n)},angleBetweenTwoPoints:function(t,n){var e=n.x-t.x,r=n.y-t.y;return Math.atan2(r,e)},arrowTipPoint:function(){var t=je()(this.getProcessedLinePaths()).pop().controlPoints;return t[t.length-1]},setLineOptions:function(){}};function th(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function nh(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?th(Object(e),!0).forEach((function(n){dt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):th(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function eh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var rh=function(t){fc()(e,t);var n=eh(e);function e(t,r){var i;return At()(this,e),(i=n.call(this,t)).line=r,dt()(_y()(i),"lineWidth",void 0),dt()(_y()(i),"debugMasking",void 0),dt()(_y()(i),"startMaskSettings",void 0),dt()(_y()(i),"endMaskSettings",void 0),i.lineWidth=t.lineWidth,i.debugMasking=!1,i.startMaskSettings=null,i.endMaskSettings=null,i}return pt()(e,[{key:"drawLineFromControlPoints",value:function(){}},{key:"drawArrowLineCap",value:function(t){}},{key:"handOffLineCap",value:function(t){}},{key:"drawPerpendicularLineCap",value:function(){}},{key:"angleBetweenLastTwoPoints",value:function(){return 0}}]),pt()(e,[{key:"drawLogic",value:function(){!this.options.animationGlobalProgress&&this.courtTypeConstants.LINE_MASKING&&(this.setLineMasking(),this.applyMasking()),this.setColor(),this.drawLineFromControlPoints(),this.drawLineCap()}},{key:"setColor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=!1;if(this.options.position){var e=this.line.originalData,r=e.playerPositionOrigin,i=e.playerPositionTerminus;r!==this.options.position&&i!==this.options.position||(n=!0)}var u=this.line.color,o=u.alpha,M=u.blue,c=u.green,N=u.red,a=n?0:Math.ceil(255*N),s=n?0:Math.ceil(255*c),D=n?255:Math.ceil(255*M),T="rgba(".concat(a,", ").concat(s,", ").concat(D,", ").concat(t||o,")");this.ctx.fillStyle=T,this.ctx.strokeStyle=T}},{key:"getProcessedLinePaths",value:function(){return this.line.getLineParts()}},{key:"applyMasking",value:function(){var t=this;this.line.getLineParts().forEach((function(n,e){var r=n.controlPoints;t.startMaskSettings&&(r=Dc(r,t.startMaskSettings.radius,t.startMaskSettings.centerPoint),t.line.setLinePartsAdjustedAtIndex(e,nh({},n,{controlPoints:r}))),t.endMaskSettings&&(r=Dc(r,null,null,t.endMaskSettings.radius,t.endMaskSettings.centerPoint),t.line.setLinePartsAdjustedAtIndex(e,nh({},n,{controlPoints:r})))}))}},{key:"setLineMasking",value:function(){if(this.line.playerPositionOrigin){var t=this.line.playerPositionOrigin,n=this.line.playerLineSequence;if(0===n){var e=this.playData.players.find((function(n){return n.position===t}));if(e){var r=e.possession?1.5:1;"HANDOFF"!==this.line.type||e.possession||(r=.7),this.startMaskSettings={centerPoint:e.location,radius:r}}}else if(t){var i=this.playData.lines.filter((function(e){return e.playerPositionOrigin===t&&e.playerLineSequence===n-1&&["PASS","HANDOFF"].indexOf(e.type)<0}));if(i.length){var u=le()(i,1)[0];if(u.lineParts.length){var o=je()(u.lineParts).pop(),M=je()(o.controlPoints).pop();this.startMaskSettings={centerPoint:M,radius:3}}}}}if(this.line.playerPositionTerminus&&"SCREEN"!==this.line.type){var c=3.7,N=je()(this.line.getLineParts()).pop(),a=je()(N.controlPoints).pop();["PASS","HANDOFF"].indexOf(this.line.type)>=0&&(c=1.75),this.endMaskSettings={centerPoint:a,radius:c}}this.showMaskingDebug()}},{key:"showMaskingDebug",value:function(){if(!1!==this.debugMasking){if(this.ctx.save(),this.ctx.lineWidth=.04,null!==this.startMaskSettings){var t=this.startMaskSettings.centerPoint,n=t.x,e=t.y;this.ctx.strokeStyle="green",this.ctx.moveTo(n,e),this.ctx.beginPath(),this.ctx.arc(n,e,this.startMaskSettings.radius,0,2*Math.PI,!0),this.ctx.stroke()}if(null!==this.endMaskSettings){var r=this.endMaskSettings.centerPoint,i=r.x,u=r.y;this.ctx.strokeStyle="red",this.ctx.moveTo(i,u),this.ctx.beginPath(),this.ctx.arc(i,u,this.endMaskSettings.radius,0,2*Math.PI,!0),this.ctx.stroke()}this.ctx.restore()}}},{key:"drawLineCap",value:function(){}}]),e}(pc);function ih(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}Object.assign(rh.prototype,$y);var uh=function(t){fc()(e,t);var n=ih(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"allowDrawLineCap",value:function(){return!this.line.hideLineTip&&!(this.options.magnetMode&&!this.options.animationGlobalProgress)}}]),e}(rh);function oh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Mh=function(t){fc()(e,t);var n=oh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawArrowLineCap()}}]),e}(uh),ch={convertLinePartsToDribble:function(t){var n=[];return t.forEach((function(e,r){var i=Array(4);e.controlPoints.forEach((function(t,n){i[n]=t}));for(var u=new xe(i[0],i[1],i[2],i[3]),o=[],M=0,c=1/u.length;M<=1;)o.push({x:u.mx(M),y:u.my(M),time:M}),M+=c;for(var N=[],a=[],s=0;s<o.length;s++)a.push(o[s]),a.length>1&&(N.push(a),a=[o[s]]);N.forEach((function(e,i){var u=le()(e,2),o=u[0],M=u[1],c={x:1.2*(M.x-o.x),y:1.2*(M.y-o.y)},a=(o.x+M.x)/2,s=(o.y+M.y)/2,D={x:-c.y,y:c.x};i%2&&(D={x:c.y,y:-c.x});var T=[o,{x:a+D.x,y:s+D.y},M];1!==t.length&&r!==t.length-1||i===N.length-1&&(T=[o,M]),n.push({controlPoints:T,lpIndex:r})}))})),n}};function Nh(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function ah(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var sh=function(t){fc()(e,t);var n=ah(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"convertLinePartsToDribble",value:function(t){return[]}},{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawArrowLineCap()}},{key:"setLineOptions",value:function(){var t=this,n=je()(this.line.getLineParts()),e=this.convertLinePartsToDribble(n);this.line.setLinePartsAdjusted([]),e.forEach((function(e){var r=e.controlPoints,i=e.lpIndex,u=le()(r,1)[0],o=n[i].alpha||t.line.color.alpha;if(t.options.animationGlobalProgress){var M=le()(t.line.animationKeyTimeChunks[i],2),c=M[0],N=M[1];Qt.a.inRange(t.options.animationGlobalProgress,c,N)&&wt(t.options.animationGlobalProgress,c,N)>u.time&&(o=.1)}t.line.addLinePartAdjusted(function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Nh(Object(e),!0).forEach((function(n){dt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Nh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},e,{controlPoints:r,alpha:o}))}))}}]),e}(uh);function Dh(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function Th(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}Object.assign(sh.prototype,ch);var gh=function(t){fc()(e,t);var n=Th(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLineCap",value:function(){this.handOffLineCap(this.line.baseLineParts())}},{key:"getProcessedLinePaths",value:function(){return this.line.getLineParts().map((function(t){var n=t.controlPoints;return function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Dh(Object(e),!0).forEach((function(n){dt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Dh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},t,{controlPoints:[n[0],n[n.length-1]]})}))}}]),e}(rh);function lh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ih=function(t){fc()(e,t);var n=lh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"setLineOptions",value:function(){this.ctx.setLineDash([1,.5])}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}}]),e}(rh);function yh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var hh=function(t){fc()(e,t);var n=yh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawPerpendicularLineCap()}}]),e}(uh);function jh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var xh=function(t){fc()(e,t);var n=jh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLineCap",value:function(){if(this.allowDrawLineCap()){var t=this.line.lastLinePartControlPoint,n={x:.6,y:0},e=this.angleBetweenLastTwoPoints(),r={x:Math.cos(e)*n.x-Math.sin(e)*n.y,y:Math.sin(e)*n.x-Math.cos(e)*n.y},i={x:t.x+r.x,y:t.y+r.y};this.drawArrowLineCap(i)}}},{key:"setLineOptions",value:function(){this.ctx.lineWidth=.7*this.lineWidth}},{key:"drawLineFromControlPoints",value:function(){var t=this;this.ctx.save(),this.setLineOptions(),this.ctx.lineJoin="round",this.getProcessedLinePaths().forEach((function(n){t.ctx.save(),n.alpha&&t.setColor(n.alpha),t.ctx.beginPath();var e=n.controlPoints;[-.3,.3].forEach((function(n){var r=e[0].x-e[e.length-1].x,i=e[0].y-e[e.length-1].y,u=n/Math.pow(r*r+i*i,.5),o=-i*u,M=r*u,c=e.map((function(t){return{x:t.x+o,y:t.y+M}}));t.ctx.moveTo(c[0].x,c[0].y),2===e.length&&t.ctx.lineTo(c[1].x,c[1].y),3===e.length&&t.ctx.quadraticCurveTo(c[1].x,c[1].y,c[2].x,c[2].y),4===e.length&&t.ctx.bezierCurveTo(c[1].x,c[1].y,c[2].x,c[2].y,c[3].x,c[3].y),t.ctx.stroke()})),t.ctx.restore()})),this.ctx.restore()}}]),e}(uh);function zh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Oh=function(t){fc()(e,t);var n=zh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"apply",value:function(){var t=this;"HIDDEN"!==this.options.linesDisplay&&("START_HIDDEN"!==this.options.linesDisplay||this.options.animationGlobalProgress)&&(this.ctx.save(),this.ctx.lineWidth=this.lineWidth,this.playData.lines.forEach((function(n){if(!(t.options.linesHiddenIds.indexOf(n.id)>=0)){var e="".concat(Qt.a.capitalize(n.type),"LineLayer");It[e]&&new It[e](t,n).apply()}})),this.ctx.restore())}},{key:"lineWidth",get:function(){return this.courtTypeConstants.LINE_WIDTH}}]),e}(Jy);function Eh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ah=function(t){fc()(e,t);var n=Eh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"apply",value:function(){var t=this;this.playData.players.length&&(this.ctx.save(),this.playData.players.forEach((function(n){if(!(t.options.playersHiddenPositions.findIndex((function(t){return parseInt(t)===parseInt(n.position)}))>=0)){var e=n.location,r=e.x,i=e.y;if(t.setPlayerPuckStyle(n),t.drawPlayerPuck(n),t.setPlayerLabel(n),t.staticData.playerHats&&t.staticData.playerHats.length){var u=t.options.playersMap.find((function(t){return t.position===n.position})),o=t.staticData.playerHats.find((function(t){return!!(null==u?void 0:u.playerHatKey)&&t.key===u.playerHatKey}));if(o){!0===o.reverse&&(t.ctx.save(),t.ctx.translate(2*r,0),t.ctx.scale(-1,1));var M=o.dX,c=o.dY;t.ctx.drawImage(o.image,r-(2-4*M),i-(1.4+2*t.radius+2.8*c),4,2.8),!0===o.reverse&&t.ctx.restore()}}}})),this.ctx.restore())}},{key:"setPlayerPuckStyle",value:function(t){var n=t.color,e=n.red,r=n.green,i=n.blue,u=n.alpha,o=0===e&&0===r&&0===i&&1===u,M=this.options.position&&t.position===this.options.position,c=M?0:Math.ceil(255*e),N=M?0:Math.ceil(255*r),a=M?255:Math.ceil(255*i),s="rgba(".concat(c,", ").concat(N,", ").concat(a,", ").concat(u,")");t.isDefender&&!M&&o&&(s="#bb271b"),t.possession&&o&&(s="#ff8000"),this.options.legacyPrintStyle&&(this.ctx.lineWidth=this.courtTypeConstants.LINE_WIDTH),this.ctx.fillStyle=this.options.legacyPrintStyle?"#FFFFFF":s,this.ctx.strokeStyle=this.options.legacyPrintStyle?"#000000":s}},{key:"drawPlayerPuck",value:function(t){var n=t.location,e=n.x,r=n.y,i=this.options.legacyPrintStyle?1.2:1;this.ctx.beginPath(),this.ctx.arc(e,r,i*this.radius,0,2*Math.PI,!0),this.options.legacyPrintStyle&&t.possession&&this.ctx.stroke(),this.ctx.fill()}},{key:"setPlayerLabel",value:function(t){var n=t.location,e=n.x,r=n.y,i=this.options.playersMap.find((function(n){return n.position===t.position}));if(this.staticData.playerHeadshots&&"Headshot"===this.options.labelsOverrideType){var u=this.staticData.playerHeadshots.find((function(t){return t.id===(null==i?void 0:i.teamPlayerId)}));if(this.ctx.save(),this.ctx.translate(e,r),u){this.ctx.save();var o=u.image.width<u.image.height,M=u.image.height<u.image.width,c=o?u.image.height/u.image.width:M?u.image.width/u.image.height:1,N=2*this.radius*(o?u.image.width/u.image.height:1)*c,a=2*this.radius*(M?u.image.height/u.image.width:1)*c,s=0-(M?N/2:this.radius),D=0-(o?a/2:this.radius);this.options.flipPlayerLabels&&this.ctx.rotate(Math.PI),this.ctx.arc(0,0,this.radius,0,2*Math.PI,!0),this.ctx.clip(),this.ctx.drawImage(u.image,s,D,N,a),this.ctx.restore()}if(this.ctx.beginPath(),this.ctx.lineWidth=this.courtTypeConstants.LINE_WIDTH,this.ctx.arc(0,0,this.radius,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.restore(),u)return}var T=t.textLabel;if(i&&(i.textOverride&&(T=i.textOverride),i.teamPlayerId&&this.options.labelsOverrideType)){var g=this.staticData.teamPlayers.find((function(t){return t.id===i.teamPlayerId}));if(g){var l=g.User_Name.split(" ").map((function(t){return t[0]})).join("").slice(0,2);T=g.Initials||l,"Jersey number"===this.options.labelsOverrideType&&g.jersey_number&&(T="".concat(g.jersey_number))}}var I=t.color.alpha,y=(3-.5*T.length)*(this.options.legacyPrintStyle?1.3:1)*this.playerScale,h=(1-.15*T.length)*(this.options.legacyPrintStyle?1.4:1)*this.playerScale;if(I){this.ctx.fillStyle=this.options.legacyPrintStyle?"#000000":"#ffffff",this.ctx.textAlign="center",this.ctx.font="".concat(y,"px Helvetica"),this.options.mirror&&(this.ctx.save(),this.ctx.translate(2*e,0),this.ctx.scale(-1,1));var j=e,x=r;this.options.flipPlayerLabels&&(j=0,x=0,this.ctx.save(),this.ctx.translate(e,r),this.ctx.rotate(Math.PI)),this.ctx.fillText(T,j,x+h),this.options.flipPlayerLabels&&this.ctx.restore(),this.options.mirror&&this.ctx.restore()}}},{key:"staticData",get:function(){return this.options.staticData}},{key:"playerScale",get:function(){return this.courtTypeConstants.PLAYER_TOKEN_SCALE*this.options.playerTokenScale}},{key:"radius",get:function(){return this.courtTypeConstants.PLAYER_TOKEN_RADIUS*this.playerScale}}]),e}(Jy);function fh(t,n){var e=t.hideForStatic&&!n.inDrawingState?0:1;n.animationGlobalProgress&&(e=0,t.animations.map((function(t){var n=le()(t.keyTimes,2);return[n[0],n[1]]})).forEach((function(t){var r=le()(t,2),i=r[0],u=r[1],o=i-.03,M=i,c=u,N=u+.03;Qt.a.inRange(n.animationGlobalProgress,o,M)&&(e=10*(.03-(M-n.animationGlobalProgress))),Qt.a.inRange(n.animationGlobalProgress,i,u)&&(e=1),Qt.a.inRange(n.animationGlobalProgress,c,N)&&(e=10*(N-n.animationGlobalProgress))})));return e}function ph(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Uh=function(t){fc()(e,t);var n=ph(e);function e(t,r){var i;return At()(this,e),i=n.call(this,t),dt()(_y()(i),"shape",void 0),dt()(_y()(i),"animationAlpha",void 0),i.shape=r,i.animationAlpha=fh(r,t.options),i}return pt()(e,[{key:"drawLogic",value:function(){var t=this.shape,n=t.location,e=t.scale,r=t.angleRad;this.ctx.translate(n.x,n.y),this.ctx.rotate(r),this.ctx.scale(e.x,e.y),this.setLineWidth(),this.setColor(),this.drawShape(),this.drawShapeWrapPoints()}},{key:"setLineWidth",value:function(){this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH}},{key:"setColor",value:function(){var t=this.shape.color,n=t.alpha,e=t.blue,r=t.green,i=t.red,u=Math.ceil(255*i),o=Math.ceil(255*r),M=Math.ceil(255*e);this.ctx.fillStyle="rgba(".concat(u,", ").concat(o,", ").concat(M,", ").concat(n*this.animationAlpha,")"),this.ctx.strokeStyle="rgba(".concat(u,", ").concat(o,", ").concat(M,", ").concat(n?this.animationAlpha:0,")")}},{key:"drawShapeWrapPoints",value:function(){}},{key:"drawShape",value:function(){this.ctx.save(),this.drawShapeLogic(),this.drawShapeBorder(),this.ctx.restore()}},{key:"drawShapeBorder",value:function(){this.shape.showBorder&&this.ctx.stroke()}},{key:"drawShapeLogic",value:function(){}},{key:"staticData",get:function(){return this.options.staticData}}]),e}(pc);function dh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ch=function(t){fc()(e,t);var n=dh(e);function e(t,r){return At()(this,e),n.call(this,t,r)}return pt()(e,[{key:"drawLineFromControlPoints",value:function(){}},{key:"drawArrowLineCap",value:function(t){}},{key:"handOffLineCap",value:function(t){}},{key:"drawPerpendicularLineCap",value:function(){}},{key:"angleBetweenLastTwoPoints",value:function(){return 0}}]),pt()(e,[{key:"setLineWidth",value:function(){this.ctx.lineWidth=this.courtTypeConstants.LINE_WIDTH}},{key:"getProcessedLinePaths",value:function(){return[this.shape.linePart]}},{key:"drawShapeLogic",value:function(){this.drawLine(),this.drawLineCap()}},{key:"drawLine",value:function(){}},{key:"drawLineCap",value:function(){}}]),e}(Uh);function Qh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}Object.assign(Ch.prototype,$y);var wh=function(t){fc()(e,t);var n=Qh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}}]),e}(Ch);function Lh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Sh=function(t){fc()(e,t);var n=Lh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"convertLinePartsToDribble",value:function(t){return[]}},{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}},{key:"getProcessedLinePaths",value:function(){return this.convertLinePartsToDribble(je()(this.shape.linePart?[this.shape.linePart]:[]))}}]),e}(Ch);function kh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}Object.assign(Sh.prototype,ch);var vh=function(t){fc()(e,t);var n=kh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.handOffLineCap(this.getProcessedLinePaths())}}]),e}(Ch);function Yh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var mh=function(t){fc()(e,t);var n=Yh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}},{key:"setLineOptions",value:function(){this.ctx.setLineDash([1,.5])}}]),e}(Ch);function Rh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Fh=function(t){fc()(e,t);var n=Rh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawPerpendicularLineCap()}}]),e}(Ch);function bh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Zh=function(t){fc()(e,t);var n=bh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.outerCircleRadius;this.ctx.beginPath(),this.ctx.arc(0,0,t,0,2*Math.PI),this.ctx.fill()}}]),e}(Uh);function Bh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Vh=function(t){fc()(e,t);var n=Bh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape,n=t.color,e=t.outerCircleRadius;if(0!==n.alpha&&this.staticData.shapes&&this.staticData.shapes.length){var r=this.staticData.shapes.find((function(t){return"cone"===t.key}));r&&(this.ctx.globalAlpha=this.animationAlpha,this.ctx.drawImage(r.image,-e/2,-e/2,e,e))}}}]),e}(Uh);function Wh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Gh=function(t){fc()(e,t);var n=Wh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.rotate(Math.PI),this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(Uh);function Ph(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Jh=function(t){fc()(e,t);var n=Ph(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.outerCircleRadius;this.ctx.beginPath(),this.ctx.rect(-t/2,-t/2,t,t),this.ctx.fill()}}]),e}(Uh);function Hh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Kh=function(t){fc()(e,t);var n=Hh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[3].x,t[3].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(Uh);function Xh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var qh=function(t){fc()(e,t);var n=Xh(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(Uh);function _h(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var $h=function(t){fc()(e,t);var n=_h(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"drawShapeLogic",value:function(){var t=this.shape.shapeControlPoints;this.ctx.beginPath(),this.ctx.moveTo(t[0].x,t[0].y),this.ctx.lineTo(t[0].x+1,t[0].y),this.ctx.lineTo(0,-1),this.ctx.lineTo(t[1].x-1,t[1].y),this.ctx.lineTo(t[1].x,t[1].y),this.ctx.lineTo(1,0),this.ctx.lineTo(t[2].x,t[2].y),this.ctx.lineTo(t[2].x-1,t[2].y),this.ctx.lineTo(0,1),this.ctx.lineTo(t[3].x+1,t[2].y),this.ctx.lineTo(t[3].x,t[3].y),this.ctx.lineTo(-1,0),this.ctx.lineTo(t[0].x,t[0].y),this.ctx.fill()}}]),e}(Uh);function tj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var nj=function(t){fc()(e,t);var n=tj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.playData.shapes.forEach((function(n){var e=n.type.match("LINE.")?"".concat(Qt.a.capitalize(n.type.replace("LINE.","")),"Line"):Qt.a.capitalize(n.type),r="".concat(e,"ShapeLayer");yt[r]&&new yt[r](t,n).apply()})),this.ctx.restore()}}]),e}(Jy),ej=function(){function t(n){At()(this,t),dt()(this,"originalData",void 0),dt()(this,"adjustedData",void 0),this.originalData=JSON.parse(JSON.stringify(n)),this.adjustedData=JSON.parse(JSON.stringify(n))}return pt()(t,[{key:"_getAttrOriginal",value:function(t){return this.originalData[t]}},{key:"_getAttr",value:function(t){return this.adjustedData[t]}},{key:"_setAttr",value:function(t,n){this.adjustedData[t]=n}}]),t}();function rj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var ij={red:.502,green:.502,blue:.502,alpha:.35},uj=function(t){fc()(e,t);var n=rj(e);function e(t){var r;return At()(this,e),r=n.call(this,t),dt()(_y()(r),"internalCanvas",void 0),r.internalCanvas=document.createElement("canvas"),r}return pt()(e,[{key:"preProcessedTextForContext",value:function(){var t=this._getLines(),n=t.reduce((function(t,n){return t.width>n.width?t:n})).width;return{lines:t,box:{width:n+2*e.NOTE_WRAP_PADDING,height:t.length*this.lineHeight+2*e.NOTE_WRAP_PADDING}}}},{key:"_getLines",value:function(){this.internalCtx.font=this.fontComputed,this.internalCtx.textBaseline=this.textBaseline;for(var t=e.NOTE_WRAP_MAX_WIDTH-2*e.NOTE_WRAP_PADDING,n=[],r=this.text.split(" ").reduce((function(t,n){if(!n.match(/\n/))return t.push(n),t;for(var e=[],r="",i=0;i<n.length;i++){var u=n[i];"\n"!==u?r+=u:(r.length&&e.push(r),e.push(""),r="")}return r.length&&e.push(r),e.forEach((function(n,r){if(!n)return t.push("\n");t.push(n),e[r+1]&&t.push("\n")})),t}),[]),i=1;r.length>0;){var u=r.slice(0,i),o=this._getLineInfo(u);if(o.width<t&&i<=r.length&&!o.hasLineBreak)i++;else{1!==i&&i--;var M=r.splice(0,i),c=this._getLineInfo(M);n.push(c),i=1;var N=!r.some((function(t){return"\n"!==t}));c.width&&o.hasLineBreak&&!N&&r.splice(0,1)}}return n}},{key:"_getLineInfo",value:function(t){var n=this,e=0,r=!1,i=[];return t.forEach((function(u,o){if("\n"!==u){var M=je()(u.matchAll(/(<player=(\d*)>)/gi)),c={text:u,width:M.length?n.internalCtx.measureText(u.replace(/<player=(\d*)>/,"")).width+2*n.playerTokenRadius:n.internalCtx.measureText(u).width};e+=c.width,o!==t.length-1&&(e+=n.internalCtx.measureText(" ").width),i.push(c)}else r=!0})),{words:i,width:e,hasLineBreak:r}}},{key:"noteWrapperContains",value:function(t){var n=t.x,e=t.y,r=this.preProcessedTextForContext().box,i=this.location,u={x:i.x+r.width,y:i.y},o=u.y+r.height;return i.x<=n&&n<=u.x&&i.y<=e&&e<=o}},{key:"id",get:function(){return this._getAttr("id")}},{key:"text",get:function(){return this._getAttr("text")}},{key:"location",get:function(){return this._getAttr("location")}},{key:"color",get:function(){return this._getAttr("color")||ij}},{key:"showBorder",get:function(){return this._getAttr("showBorder")}},{key:"animations",get:function(){return this._getAttr("animations")||[]}},{key:"hideForStatic",get:function(){return this._getAttr("hideForStatic")}},{key:"font",get:function(){return this._getAttr("font")||{bold:!1,italic:!1,underline:!1,strikethrough:!1,fontSize:12}}},{key:"fontSize",get:function(){return this.font.fontSize/10}},{key:"lineHeight",get:function(){return this.fontSize+this.lineHeightOffset}},{key:"lineHeightOffset",get:function(){return.3*this.fontSize}},{key:"baseLineOffset",get:function(){return.1*this.fontSize}},{key:"playerTokenRadius",get:function(){return this.fontSize/2}},{key:"fontComputed",get:function(){var t=[];return this.font.bold&&t.push("bold"),this.font.italic&&t.push("italic"),t.push("".concat(this.fontSize,"px")),t.push("Arial"),t.join(" ")}},{key:"textBaseline",get:function(){return"alphabetic"}},{key:"internalCtx",get:function(){return this.internalCanvas.getContext("2d")}}],[{key:"NOTE_WRAP_MAX_WIDTH",get:function(){return 40}},{key:"NOTE_WRAP_PADDING",get:function(){return.43}}]),e}(ej);function oj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Mj=function(t){fc()(e,t);var n=oj(e);function e(){var t;At()(this,e);for(var r=arguments.length,i=new Array(r),u=0;u<r;u++)i[u]=arguments[u];return t=n.call.apply(n,[this].concat(i)),dt()(_y()(t),"animationAlpha",void 0),t}return pt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.disableMirrorMode(),this.playData.notes.forEach((function(n){t.ctx.save(),t.animationAlpha=fh(n,t.options),t.setColor(n);var e=n.location;t.ctx.translate(e.x,e.y);var r=n.preProcessedTextForContext(),i=r.lines,u=r.box;t.setFont(n),t.drawBubble(n,u),t.drawText(n,i),t.ctx.restore()})),this.ctx.restore()}},{key:"setColor",value:function(t){if(void 0===this.animationAlpha)throw new Error("animationAlpha is not set");var n=t.color,e=n.alpha,r=n.blue,i=n.green,u=n.red,o=Math.ceil(255*u),M=Math.ceil(255*i),c=Math.ceil(255*r);this.ctx.fillStyle="rgba(".concat(o,", ").concat(M,", ").concat(c,", ").concat(e*this.animationAlpha,")"),this.ctx.strokeStyle="rgba(".concat(o,", ").concat(M,", ").concat(c,", ").concat(this.animationAlpha,")"),this.options.noteSelectedId===t.id&&(this.ctx.setLineDash([.5,.5]),this.ctx.strokeStyle="rgba(28, 127, 181, ".concat(this.animationAlpha,")"))}},{key:"setFont",value:function(t){this.ctx.font=t.fontComputed,this.ctx.textBaseline=t.textBaseline}},{key:"drawBubble",value:function(t,n){var e=n.width,r=n.height;this.ctx.lineWidth=this.courtTypeConstants.COURT_LINE_WIDTH,this.ctx.beginPath(),this.ctx.rect(0,0,e,r),this.ctx.fill(),(t.showBorder||this.options.noteSelectedId===t.id)&&this.ctx.stroke()}},{key:"drawText",value:function(t,n){var e=this;n.forEach((function(n,r){var i=n.words;e.ctx.save(),e.ctx.translate(uj.NOTE_WRAP_PADDING,t.fontSize+uj.NOTE_WRAP_PADDING+t.lineHeight*r);var u=0;i.forEach((function(n,r){var o=je()(n.text.matchAll(/(<player=(\d*)>)/gi));o.length&&0===o[0].index&&(e.drawPlayerToken(t,u,o[0][2]),u+=2*t.playerTokenRadius),e.ctx.fillStyle="rgba(0, 0, 0, ".concat(e.animationAlpha,")");var M=o.length?n.text.replace(/(<player=(\d*)>)/gi,""):n.text;e.ctx.fillText(M,u,-t.baseLineOffset),u+=n.width,o.length&&(u-=2*t.playerTokenRadius),o.length&&o[0].index>0&&(e.drawPlayerToken(t,u,o[0][2]),u+=2*t.playerTokenRadius),r!==i.length-1&&(e.ctx.fillText(" ",u,-t.baseLineOffset),u+=e.ctx.measureText(" ").width)})),(t.font.underline||t.font.strikethrough)&&(e.ctx.lineWidth=.07*t.fontSize,e.ctx.strokeStyle="rgba(0, 0, 0, ".concat(e.animationAlpha,")"),e.ctx.beginPath(),t.font.underline&&(e.ctx.moveTo(0,t.baseLineOffset),e.ctx.lineTo(u,t.baseLineOffset)),t.font.strikethrough&&(e.ctx.moveTo(0,-t.fontSize/2+t.baseLineOffset),e.ctx.lineTo(u,-t.fontSize/2+t.baseLineOffset)),e.ctx.stroke()),e.ctx.restore()}))}},{key:"drawPlayerToken",value:function(t,n,e){this.ctx.save(),this.ctx.translate(n+t.playerTokenRadius,0),this.ctx.beginPath(),this.ctx.strokeStyle="rgba(255, 255, 255, ".concat(this.animationAlpha,")"),this.ctx.fillStyle="rgba(243, 111, 33, ".concat(this.animationAlpha,")"),this.ctx.arc(0,-t.fontSize/2,t.playerTokenRadius,0,2*Math.PI),this.ctx.fill(),this.ctx.stroke();var r=.8*t.fontSize;this.ctx.font="".concat(r,"px Arial");var i=-this.ctx.measureText(e).width/2,u=-r/4;this.ctx.fillStyle="rgba(255, 255, 255, ".concat(this.animationAlpha,")"),this.ctx.fillText(e,i,u),this.ctx.restore()}},{key:"scale",value:function(t){return t/this.options.scale}}]),e}(Jy);function cj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Nj=function(t){fc()(e,t);var n=cj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"apply",value:function(){var t=this;"HIDDEN"!==this.options.linesDisplay&&("START_HIDDEN"!==this.options.linesDisplay||this.options.animationGlobalProgress)&&(this.ctx.save(),this.playData.lines.forEach((function(n){t.options.linesSelectedIds.includes(n.id)&&n.baseLineParts().forEach((function(n){t.ctx.save(),t.ctx.fillStyle="blue",n.controlPoints.forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,.4,0,2*Math.PI,!0),t.ctx.fill()})),t.ctx.restore()}))})),this.ctx.restore())}}]),e}(Jy);function aj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var sj=function(t){fc()(e,t);var n=aj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.ctx.fillStyle="blue",this.playData.shapes.forEach((function(n){var e=n.id,r=n.color,i=n.controlPointsTranslated;t.options.shapeSelectedId===e&&0!==r.alpha&&i.forEach((function(n){t.ctx.beginPath(),t.ctx.arc(n.x,n.y,.4,0,2*Math.PI,!0),t.ctx.fill()}))})),this.ctx.restore()}}]),e}(Jy);function Dj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Tj=function(t){fc()(e,t);var n=Dj(e);function e(t){var r;return At()(this,e),r=n.call(this,t),dt()(_y()(r),"lineParts",void 0),dt()(_y()(r),"linePartsAdjusted",void 0),r.lineParts=t.lineParts,r.linePartsAdjusted=je()(t.lineParts),r}return pt()(e,[{key:"baseLineParts",value:function(){return this.lineParts}},{key:"setLinePartsAdjusted",value:function(t){this.linePartsAdjusted=t}},{key:"setLinePartsAdjustedAtIndex",value:function(t,n){switch(t){case"fist":this.linePartsAdjusted[0]=n;break;case"last":this.linePartsAdjusted[this.linePartsAdjusted.length-1]=n;break;default:this.linePartsAdjusted[t]=n}}},{key:"setAnimationKeyTimesChunked",value:function(t){var n=this,e=[];if(this.animations[0].keyTimes.forEach((function(t,r){r&&e.push([n.animations[0].keyTimes[r-1],t])})),e.length!==this.getLineParts().length){var r=e,i=le()(r,1),u=le()(i[0],2),o=u[0],M=u[1],c=le()(t.animations,1)[0],N=c.keyTimes.indexOf(o),a=c.keyTimes.indexOf(M);if(N>=0&&a>=0){var s=c.keyTimes.slice(N,a+1);e=[],s.forEach((function(t,n){n&&e.push([s[n-1],t])}))}}this.animationKeyTimeChunks=e}},{key:"addLinePartAdjusted",value:function(t){this.linePartsAdjusted.push(t)}},{key:"getLineParts",value:function(){return this.linePartsAdjusted.length?this.linePartsAdjusted:this.lineParts}},{key:"id",get:function(){return this._getAttr("id")}},{key:"color",get:function(){return this._getAttr("color")},set:function(t){this._setAttr("color",t)}},{key:"type",get:function(){return this._getAttr("type")}},{key:"phase",get:function(){return this._getAttr("phase")}},{key:"playerPositionOrigin",get:function(){return this._getAttr("playerPositionOrigin")}},{key:"playerPositionTerminus",get:function(){return this._getAttr("playerPositionTerminus")}},{key:"playerLineSequence",get:function(){return this._getAttr("playerLineSequence")}},{key:"hideLineTip",get:function(){return this._getAttr("hideLineTip")}},{key:"animations",get:function(){return this._getAttr("animations")}},{key:"animationsByEndTime",get:function(){return this._getAttr("animations").map((function(t){return Qt.a.last(t.keyTimes)}))}},{key:"animationKeyTimeChunks",get:function(){return this._getAttr("animationKeyTimeChunks")||[]},set:function(t){this._setAttr("animationKeyTimeChunks",t)}},{key:"lastAnimEndTime",get:function(){return Qt.a.max(this.animationsByEndTime)}},{key:"firstLinePartControlPoint",get:function(){return this.lineParts[0].controlPoints[0]}},{key:"lastLinePartControlPoint",get:function(){return je()(je()(this.lineParts).pop().controlPoints).pop()}}]),e}(ej);function gj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var lj=function(t){fc()(e,t);var n=gj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"setPossession",value:function(t){var n=this;if(t.length){var e=this.possession?1:0;e+=t.filter((function(t){return t.playerPositionTerminus===n.position})).length,e-=t.filter((function(t){return t.playerPositionOrigin===n.position})).length,this.possession=e>0}}},{key:"id",get:function(){return this._getAttr("id")}},{key:"textOverride",get:function(){return this._getAttr("textOverride")},set:function(t){this._setAttr("textOverride",t)}},{key:"textLabel",get:function(){return this._getAttr("textOverride")||this.position}},{key:"isDefender",get:function(){return this.position.indexOf("x")>=0}},{key:"possession",get:function(){return this._getAttr("possession")},set:function(t){this._setAttr("possession",t)}},{key:"position",get:function(){return this._getAttr("position")}},{key:"location",get:function(){return this._getAttr("location")},set:function(t){this._setAttr("location",t)}},{key:"color",get:function(){return this._getAttr("color")}},{key:"animations",get:function(){return this._getAttr("animations")}},{key:"animationsByEndTime",get:function(){return this._getAttr("animations").map((function(t){return Qt.a.last(t.keyTimes)}))}},{key:"lastAnimEndTime",get:function(){return Qt.a.max(this.animationsByEndTime)}},{key:"lastAnimation",get:function(){return je()(this.animations).pop()}},{key:"lastAnimationLastLinePartControlPoint",get:function(){return je()(je()(this.lastAnimation.lineParts).pop().controlPoints).pop()}}]),e}(ej);function Ij(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var yj=function(t){fc()(e,t);var n=Ij(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"rectWrapperContains",value:function(t){var n=le()(this.rectWrapPointsTranslated,4),e=n[0],r=n[1],i=n[2],u=n[3];return+[[e,t,r],[r,t,i],[i,t,u],[u,t,e]].reduce((function(t,n){var e=le()(n,3),r=e[0],i=e[1],u=e[2];return t+Math.abs(i.x*r.y-r.x*i.y+(u.x*i.y-i.x*u.y)+(r.x*u.y-u.x*r.y))/2}),0).toFixed(2)<=this.rectWrapAreaTranslated}},{key:"computeCenterForRect",value:function(t){var n=le()(t,4),e=n[0],r=n[1],i=n[2],u=n[3];return{x:(e.x+i.x)/2,y:(r.y+u.y)/2}}},{key:"computeShapeAreaForPointAtIndex",value:function(t,n){var e=le()(this.rectWrapPointsTranslated,3),r=e[0],i=e[1],u=e[2],o=this.computeRectWrapPointsTranslatedForPointAtIndex(t,n),M=le()(o,4),c=M[0],N=M[1],a=M[2],s=M[3];return{scale:{x:Tc(c,N)*this.scale.x/Tc(r,i),y:Tc(N,a)*this.scale.y/Tc(i,u)},location:this.computeCenterForRect([c,N,a,s])}}},{key:"computeRectWrapPointsTranslatedForPointAtIndex",value:function(t,n){var e=this,r=Lt(t.x,t.y,this.location.x,this.location.y,-this.angle),i=this.rectWrapPointsTranslated.map((function(t){return Lt(t.x,t.y,e.location.x,e.location.y,-e.angle)})).map((function(t,e){return n===e?r:t}));return 0===n&&(i[1].y=r.y,i[3].x=r.x),1===n&&(i[0].y=r.y,i[2].x=r.x),2===n&&(i[1].x=r.x,i[3].y=r.y),3===n&&(i[0].x=r.x,i[2].y=r.y),i.map((function(t){return Lt(t.x,t.y,e.location.x,e.location.y,e.angle)}))}},{key:"revertPointTranslation",value:function(t){var n={x:t.x-this.location.x,y:t.y-this.location.y};return Lt(n.x,n.y,0,0,-this.angle)}},{key:"id",get:function(){return this._getAttr("id")}},{key:"location",get:function(){return this._getAttr("location")}},{key:"scale",get:function(){return this._getAttr("scale")}},{key:"angle",get:function(){return this._getAttr("angle")||0}},{key:"angleRad",get:function(){return this.angle*Math.PI/180}},{key:"color",get:function(){return this._getAttr("color")}},{key:"type",get:function(){return this._getAttr("type")}},{key:"showBorder",get:function(){return this._getAttr("showBorder")}},{key:"outerCircleRadius",get:function(){return 10}},{key:"linePart",get:function(){return this._getAttr("linePart")}},{key:"animations",get:function(){return this._getAttr("animations")||[]}},{key:"hideForStatic",get:function(){return this._getAttr("hideForStatic")}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius/2,y:-this.outerCircleRadius/2},{x:this.outerCircleRadius/2,y:-this.outerCircleRadius/2},{x:this.outerCircleRadius/2,y:this.outerCircleRadius/2},{x:-this.outerCircleRadius/2,y:this.outerCircleRadius/2}]}},{key:"rectWrapPointsTranslated",get:function(){var t=this;return this.rectWrapPointsPure.map((function(n){var e={x:n.x*t.scale.x,y:n.y*t.scale.y},r=Lt(e.x,e.y,0,0,t.angle);return{x:r.x+t.location.x,y:r.y+t.location.y}}))}},{key:"controlPointsTranslated",get:function(){return this.rectWrapPointsTranslated}},{key:"rectWrapAreaTranslated",get:function(){var t=le()(this.rectWrapPointsTranslated,3),n=t[0],e=t[1],r=t[2];return+(Tc(n,e)*Tc(e,r)).toFixed(2)}}]),e}(ej);function hj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var jj=function(t){fc()(e,t);var n=hj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"rectWrapPointsPure",get:function(){return jc(this.linePart.controlPoints)}},{key:"controlPointsTranslated",get:function(){var t=this;return this.linePart.controlPoints.map((function(n){var e={x:n.x*t.scale.x,y:n.y*t.scale.y},r=Lt(e.x,e.y,0,0,t.angle);return{x:r.x+t.location.x,y:r.y+t.location.y}}))}},{key:"shapeControlPoints",get:function(){return[]}}]),e}(yj);function xj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var zj=function(t){fc()(e,t);var n=xj(e);function e(){return At()(this,e),n.apply(this,arguments)}return e}(jj);function Oj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Ej=function(t){fc()(e,t);var n=Oj(e);function e(){return At()(this,e),n.apply(this,arguments)}return e}(jj);function Aj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var fj=function(t){fc()(e,t);var n=Aj(e);function e(){return At()(this,e),n.apply(this,arguments)}return e}(jj);function pj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Uj=function(t){fc()(e,t);var n=pj(e);function e(){return At()(this,e),n.apply(this,arguments)}return e}(jj);function dj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Cj=function(t){fc()(e,t);var n=dj(e);function e(){return At()(this,e),n.apply(this,arguments)}return e}(jj);function Qj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var wj=function(t){fc()(e,t);var n=Qj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"outerCircleRadius",get:function(){return 5}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:this.outerCircleRadius},{x:-this.outerCircleRadius,y:this.outerCircleRadius}]}},{key:"shapeControlPoints",get:function(){return[]}}]),e}(yj);function Lj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Sj=function(t){fc()(e,t);var n=Lj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"outerCircleRadius",get:function(){return 5}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(yj);function kj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var vj=function(t){fc()(e,t);var n=kj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"outerCircleRadius",get:function(){return 8}},{key:"shapeControlPoints",get:function(){return[{x:0,y:-this.outerCircleRadius},{x:-this.outerCircleRadius*Math.cos(220)/2,y:this.outerCircleRadius*Math.sin(240)},{x:this.outerCircleRadius*Math.cos(220)/2,y:this.outerCircleRadius*Math.sin(240)}]}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:this.outerCircleRadius},{x:-this.outerCircleRadius,y:this.outerCircleRadius}]}}]),e}(yj);function Yj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var mj=function(t){fc()(e,t);var n=Yj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(yj);function Rj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Fj=function(t){fc()(e,t);var n=Rj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-.5},{x:this.outerCircleRadius,y:-.5},{x:this.outerCircleRadius,y:.5},{x:-this.outerCircleRadius,y:.5}]}}]),e}(yj);function bj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Zj=function(t){fc()(e,t);var n=bj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return[{x:0,y:-this.outerCircleRadius},{x:this.outerCircleRadius*Math.cos(210),y:this.outerCircleRadius*Math.sin(210)},{x:-this.outerCircleRadius*Math.cos(210),y:this.outerCircleRadius*Math.sin(210)}]}},{key:"rectWrapPointsPure",get:function(){return[{x:-this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:-this.outerCircleRadius},{x:this.outerCircleRadius,y:this.outerCircleRadius},{x:-this.outerCircleRadius,y:this.outerCircleRadius}]}}]),e}(yj);function Bj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=Ec()(t);if(n){var i=Ec()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return zc()(this,e)}}var Vj=function(t){fc()(e,t);var n=Bj(e);function e(){return At()(this,e),n.apply(this,arguments)}return pt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(yj);function Wj(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function Gj(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?Wj(Object(e),!0).forEach((function(n){dt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Wj(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}var Pj=function(){function t(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;At()(this,t),this.play=n,this.phase=e,this.animationGlobalProgress=r,dt()(this,"ctx",void 0),dt()(this,"animationGlobalProgressPrev",void 0),this.animationGlobalProgressPrev=r,this.ctx=null}return pt()(t,[{key:"draw",value:function(){if(!this.ctx)throw new Error("Canvas context is not provided. Please use setContext() method.");this.ctx.clearRect(0,0,this.frameWidth,this.frameHeight),this._init();var t=this.frameData,n=this.frameDataOptions;return new Xy(this.ctx,t,n).apply(),new nj(this.ctx,t,n).apply(),new Oh(this.ctx,t,n).apply(),new Ah(this.ctx,t,n).apply(),new Nj(this.ctx,t,n).apply(),new sj(this.ctx,t,n).apply(),new Mj(this.ctx,t,n).apply(),this}},{key:"_init",value:function(){if(!this.ctx)throw new Error("Canvas context is not provided. Please use setContext() method.");this.ctx.canvas.width=this.frameWidth,this.ctx.canvas.height=this.frameHeight,this.ctx.scale(this.play.scale,this.play.scale),this.ctx.translate(-this.court.courtRect.origin.x,-this.court.courtRect.origin.y),this.play.options.mirror&&(this.ctx.scale(-1,1),this.ctx.translate(2*Math.abs(this.court.courtRect.origin.x)-this.court.courtRect.size.width,0))}},{key:"setContext",value:function(t){return this.ctx=t,this}},{key:"setPhase",value:function(t){return this.phase=t,this}},{key:"setAnimationGlobalProgress",value:function(t){return this.animationGlobalProgressPrev=this.animationGlobalProgress,this.animationGlobalProgress=t,this}},{key:"animationProgress",value:function(t,n){return wt(this.animationGlobalProgress,t,n)}},{key:"closestObjectToPoint",value:function(t,n){var e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0,i=e?this.convertViewPointToCourtPoint(t):t;return"player"===n?this.closestPlayerToPoint(i,r):"shape"===n?this.closestShapeToPoint(i):"note"===n?this.closestNoteToPoint(i):"line"===n?this.closestLineToPoint(i,r):"lineVertex"===n?this.closestLineVertexToPoint(i,r):null}},{key:"closestLineToPoint",value:function(t,n){var e=this,r=this.lines.filter((function(t){return!n||n(t)})).reduce((function(n,r){return r.lineParts.forEach((function(i){for(var u=ye()(xe,je()(i.controlPoints)),o=1;o<=100;o++){var M=o/100,c=e.prepareCourtPoint({x:u.x(M),y:u.y(M)});n.push({object:r,objectPoint:c,distance:Tc(c,t)})}})),n}),[]);return Qt.a.minBy(r,"distance")}},{key:"closestLineVertexToPoint",value:function(t,n){var e=this,r=this.lines.filter((function(t){return!n||n(t)})).reduce((function(n,r){if(!r.id.length)return n;var i=e.prepareCourtPoint(r.firstLinePartControlPoint),u=e.prepareCourtPoint(r.lastLinePartControlPoint);return n.push({object:r,objectPoint:i,distance:Tc(i,t)}),n.push({object:r,objectPoint:u,distance:Tc(u,t)}),n}),[]);return Qt.a.minBy(r,"distance")}},{key:"closestPlayerToPoint",value:function(t,n){var e=this,r=this.players.filter((function(t){return!n||n(t)})).reduce((function(n,r){var i=e.prepareCourtPoint(r.location);return n.push({object:r,objectPoint:i,distance:Tc(i,t)}),n}),[]);return Qt.a.minBy(r,"distance")}},{key:"closestShapeToPoint",value:function(t){var n=this,e=this.shapes.filter((function(n){return n.rectWrapperContains(t)})).reduce((function(e,r){var i=n.prepareCourtPoint(r.location);return e.push({object:r,objectPoint:i,distance:Tc(i,t)}),e}),[]);return Qt.a.minBy(e,"distance")}},{key:"closestNoteToPoint",value:function(t){var n=this,e=this.notes.filter((function(n){return n.noteWrapperContains(t)})).reduce((function(e,r){var i=n.prepareCourtPoint(r.location);return e.push({object:r,objectPoint:i,distance:Tc(i,t)}),e}),[]);return e.length?Qt.a.minBy(e,"distance"):null}},{key:"prepareCourtPoint",value:function(t){var n=this.play.options.mirror,e=this.play.playData.court.courtRect.size.width,r=this.play.playData.court.courtRect.origin;return{x:n?e+r.x-(t.x-r.x):t.x,y:t.y}}},{key:"convertViewPointToCourtPoint",value:function(t){var n=this.play.playData.court.courtRect.origin,e=n.x,r=n.y;return{x:t.x/this.play.scale+e,y:t.y/this.play.scale+r}}},{key:"sport",get:function(){var t=this.play.playData,n=t.court,e=t.sport;return e||([dn,Un].includes(n.type)?Dn:an)}},{key:"court",get:function(){var t=this.play.playData.court;return Gj({},t,{type:t.type===dn?Un:t.type})}},{key:"frameWidth",get:function(){return this.play.width}},{key:"frameHeight",get:function(){return this.play.height}},{key:"frameData",get:function(){return{sport:this.sport,court:this.court,lines:this.lines,players:this.players,shapes:this.shapes,notes:this.notes}}},{key:"frameDataOptions",get:function(){return Gj({},this.play.options,{staticData:this.play.staticData,scale:this.play.scale,animationGlobalProgress:this.animationGlobalProgress,playAnimationDuration:this.playAnimationDuration})}},{key:"playAnimationDuration",get:function(){return this.play.playData.lines.reduce((function(t,n){var e=new Tj(n).lastAnimEndTime;return t>e?t:e}),0)}},{key:"lines",get:function(){return this.animationGlobalProgress?this.animationProgressLines:this.currentPhaseLines}},{key:"players",get:function(){return this.animationGlobalProgress?this.animationProgressPlayers:this.currentPhasePlayers}},{key:"shapes",get:function(){return this.play.playData.shapes?this.play.playData.shapes.filter((function(t){return void 0!==ht[St(t.type)]})).map((function(t){return new(ht[St(t.type)])(t)})):[]}},{key:"notes",get:function(){return this.play.playData.notes?this.play.playData.notes.filter((function(t){return!t.displayModes||t.displayModes.includes("onCourt")})).map((function(t){return new uj(t)})):[]}},{key:"currentPhasePlayers",get:function(){var t=this,n=this.currentPhaseLines,e=this.play.options,r=e.huddleMode,i=e.magnetMode,u=r||i?this.playDataLines:this.prevPhaseLines,o=u.filter((function(t){return["PASS","HANDOFF"].includes(t.type)}));return this.play.playData.players.map((function(e){var M=new lj(e);M.setPossession(o);var c=u.filter((function(e){return!r||!(t.phase<e.phase)&&!n.find((function(t){return t.id===e.id}))})).filter((function(t){return t.playerPositionOrigin===M.position&&t.playerPositionTerminus===M.position})),N=n.filter((function(t){return i&&t.playerPositionOrigin===M.position&&t.playerPositionTerminus===M.position})),a=N.length?N:c;if(a.length){var s=Qt.a.maxBy(a,(function(t){return t.lastAnimEndTime}));if(s){var D=s.lastLinePartControlPoint;D&&(M.location=D)}}return M}))}},{key:"currentPhaseLines",get:function(){var t=this,n=this.play.playData.lines.filter((function(n){return n.phase===t.phase}));return this.play.options.huddleMode&&(n=Qt.a.takeRight(n,2)),n.map((function(t){return new Tj(t)}))}},{key:"animationProgressPlayers",get:function(){var t=this,n=this.prevAnimationLines.filter((function(t){return["PASS","HANDOFF","SHOT"].includes(t.type)}));return this.play.playData.players.map((function(e){var r=new lj(e);return r.setPossession(n),r.animations.length?(r.animations.forEach((function(n){var e=[];n.keyTimes.forEach((function(t,r){r&&e.push([n.keyTimes[r-1],t])})),e.forEach((function(e,i){var u=le()(e,2),o=u[0],M=u[1];if(Qt.a.inRange(t.animationGlobalProgress,o,M)){var c=t.animationProgress(o,M),N=ye()(xe,je()(n.lineParts[i].controlPoints));r.location={x:N.x(c),y:N.y(c)}}}))})),t.animationGlobalProgress>=r.lastAnimEndTime&&(r.location=r.lastAnimationLastLinePartControlPoint),r):r}))}},{key:"animationProgressLines",get:function(){var t=this,n=this.play.options.linesDisplayOnMoveOnly;return this.play.playData.lines.map((function(n){var e=new Tj(n);e.setAnimationKeyTimesChunked(t.play.playData.players.find((function(t){return t.position===e.playerPositionOrigin})));var r=[];return e.animationKeyTimeChunks.forEach((function(n,i){var u=le()(n,2),o=u[0],M=u[1];if(t.animationGlobalProgressPrev<M&&t.animationGlobalProgress>=M&&window.dispatchEvent(new CustomEvent("@luceosports/play-rendering:lineAnimationFinished",{detail:{id:e.id}})),Qt.a.inRange(t.animationGlobalProgress,o,M)){if("DRIBBLE"===e.type)return r.push(Gj({},e.getLineParts()[i]));var c=gc(e.getLineParts()[i].controlPoints,t.animationProgress(o,M));r.push({controlPoints:c[0],alpha:.1}),r.push({controlPoints:c[1],alpha:e.color.alpha})}else t.animationGlobalProgress>M?r.push(Gj({},e.getLineParts()[i],{alpha:.1})):r.push(Gj({},e.getLineParts()[i]))})),e.setLinePartsAdjusted(r),t.animationGlobalProgress>e.lastAnimEndTime&&(e.color=Gj({},e.color,{alpha:.1})),e})).filter((function(e){var r=le()(e.animations,1)[0].keyTimes,i=le()(r,1)[0],u=r.reverse(),o=le()(u,1)[0],M=Qt.a.inRange(t.animationGlobalProgress,i,o);return n?M:M||t.animationGlobalProgress>o||e.phase===t.phase}))}},{key:"playDataLines",get:function(){return this.play.playData.lines.map((function(t){return new Tj(t)}))}},{key:"prevPhaseLines",get:function(){var t=this;return this.playDataLines.filter((function(n){return n.phase<t.phase}))}},{key:"prevAnimationLines",get:function(){var t=this;return this.playDataLines.filter((function(n){return t.animationGlobalProgress>=n.lastAnimEndTime}))}}]),t}(),Jj=function(){function t(n,e){At()(this,t),this.ctx=n,dt()(this,"play",void 0),dt()(this,"playBase",void 0),dt()(this,"animationFrame",void 0),dt()(this,"loopId",void 0),dt()(this,"running",void 0),dt()(this,"framesLoadTime",void 0),dt()(this,"timeStart",void 0),dt()(this,"timeElapsed",void 0),dt()(this,"timeElapsedSaved",void 0),this.play=Qt.a.cloneDeep(e),this.playBase=Qt.a.cloneDeep(e),this.animationFrame=new Pj(this.play,this.currentPlayPhase,this.globalProgress).setContext(this.ctx),this.loopId=null,this.running=!1,this.framesLoadTime=[],this.timeStart=null,this.timeElapsed=0,this.timeElapsedSaved=0}return pt()(t,[{key:"start",value:function(t,n){this.running=!0,this.loopId=requestAnimationFrame(this.drawFrame.bind(this,t,n))}},{key:"pause",value:function(){cancelAnimationFrame(this.loopId),this.running=!1,this.timeStart=null,this.timeElapsedSaved=this.timeElapsed}},{key:"setProgress",value:function(t){var n=this.countTimeElapsedFromProgress(t);return this.timeElapsed=n,this.timeElapsedSaved=n,this.refreshAnimationFrameProgress(),this}},{key:"refreshAnimationFrameProgress",value:function(){this.animationFrame.setPhase(this.currentPlayPhase).setAnimationGlobalProgress(this.globalProgress)}},{key:"drawPreviewFrame",value:function(){new Pj(this.play,this.currentPlayPhase,this.globalProgress).setContext(this.ctx).draw()}},{key:"reset",value:function(){this.timeStart=null,this.timeElapsed=null,this.timeElapsedSaved=null,this.play=Qt.a.cloneDeep(this.playBase)}},{key:"countTimeElapsedFromProgress",value:function(t){return 1e3*this.animationDuration*t}},{key:"drawFrame",value:function(t,n,e){if(this.running){if(this.globalProgress>=this.lastLineAnimationMax)return n(this.lastLineAnimationMax),this.reset(),cancelAnimationFrame(this.loopId),void setTimeout((function(){t()}),1e3);n(this.globalProgress),this.timeStart||(this.timeStart=e);var r=e-this.timeStart+(this.timeElapsedSaved||0)-(this.timeElapsed||0);this.framesLoadTime.push(r),this.timeElapsed=e-this.timeStart+(this.timeElapsedSaved||0),this.animationFrame.setPhase(this.currentPlayPhase).setAnimationGlobalProgress(this.globalProgress).draw(),requestAnimationFrame(this.drawFrame.bind(this,t,n))}}},{key:"animationDuration",get:function(){return this.play.playData.animationDuration/this.play.options.speed}},{key:"globalProgress",get:function(){return 100*(this.timeElapsed||0)/(1e3*this.animationDuration)/100}},{key:"currentPlayPhase",get:function(){var t=this,n=Object.entries(this.linesPhaseIntervals).find((function(n){var e=le()(n,2)[1];return Qt.a.inRange(t.globalProgress,e.min,e.max)}));return parseInt(n?n[0]:Object.keys(this.linesPhaseIntervals).pop())}},{key:"linesPhaseIntervals",get:function(){var t={};return this.play.playData.lines.forEach((function(n){t[n.phase]||(t[n.phase]={min:0,max:0}),n.animations.forEach((function(e){var r=e.keyTimes,i=le()(r,1)[0],u=je()(r).pop();(i<t[n.phase].min||!t[n.phase].min&&n.phase>1)&&(t[n.phase].min=i),u>t[n.phase].max&&(t[n.phase].max=u)}))})),t}},{key:"lastLineAnimationMax",get:function(){return this.play.playData.lines.reduce((function(t,n){var e=new Tj(n);return t>e.lastAnimEndTime?t:e.lastAnimEndTime}),0)}}]),t}()}])}));
|
|
24
24
|
//# sourceMappingURL=play-rendering.js.map
|