@luceosports/play-rendering 2.7.0 → 2.8.0
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 Xr,qr,_r=9e15,$r="0123456789abcdef",ti="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",ni="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",ei={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-_r,maxE:_r,crypto:!1},ri=!0,ii="[DecimalError] Invalid argument: ",ui="[object Decimal]",Mi=Math.floor,oi=Math.pow,ci=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Ni=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,ai=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Di=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,si=1e7,Ti=ti.length-1,gi=ni.length-1,Ii={toStringTag:ui};function li(t){var n,e,r,i=t.length-1,u="",M=t[0];if(i>0){for(u+=M,n=1;n<i;n++)(e=7-(r=t[n]+"").length)&&(u+=Ci(e)),u+=r;(e=7-(r=(M=t[n])+"").length)&&(u+=Ci(e))}else if(0===M)return"0";for(;M%10==0;)M/=10;return u+M}function yi(t,n,e){if(t!==~~t||t<n||t>e)throw Error(ii+t)}function ji(t,n,e,r){var i,u,M,o;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=oi(10,7-n),o=t[i]%u|0,null==r?n<3?(0==n?o=o/100|0:1==n&&(o=o/10|0),M=e<4&&99999==o||e>3&&49999==o||5e4==o||0==o):M=(e<4&&o+1==u||e>3&&o+1==u/2)&&(t[i+1]/u/100|0)==oi(10,n-2)-1||(o==u/2||0==o)&&0==(t[i+1]/u/100|0):n<4?(0==n?o=o/1e3|0:1==n?o=o/100|0:2==n&&(o=o/10|0),M=(r||e<4)&&9999==o||!r&&e>3&&4999==o):M=((r||e<4)&&o+1==u||!r&&e>3&&o+1==u/2)&&(t[i+1]/u/1e3|0)==oi(10,n-3)-1,M}function hi(t,n,e){for(var r,i,u=[0],M=0,o=t.length;M<o;){for(i=u.length;i--;)u[i]*=n;for(u[0]+=$r.indexOf(t.charAt(M++)),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()}Ii.absoluteValue=Ii.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),zi(t)},Ii.ceil=function(){return zi(new this.constructor(this),this.e+1,2)},Ii.clampedTo=Ii.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(ii+n);return e.cmp(t)<0?t:e.cmp(n)>0?n:new r(e)},Ii.comparedTo=Ii.cmp=function(t){var n,e,r,i,u=this,M=u.d,o=(t=new u.constructor(t)).d,c=u.s,N=t.s;if(!M||!o)return c&&N?c!==N?c:M===o?0:!M^c<0?1:-1:NaN;if(!M[0]||!o[0])return M[0]?c:o[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=M.length)<(i=o.length)?r:i;n<e;++n)if(M[n]!==o[n])return M[n]>o[n]^c<0?1:-1;return r===i?0:r>i^c<0?1:-1},Ii.cosine=Ii.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/mi(4,e)).toString()):(e=16,i="2.3283064365386962890625e-10");t.precision+=e,n=Yi(t,1,n.times(i),new t(1));for(var u=e;u--;){var M=n.times(n);n=M.times(M).minus(M).times(8).plus(1)}return t.precision-=e,n}(r,Ri(r,e)),r.precision=t,r.rounding=n,zi(2==qr||3==qr?e.neg():e,t,n,!0)):new r(1):new r(NaN)},Ii.cubeRoot=Ii.cbrt=function(){var t,n,e,r,i,u,M,o,c,N,a=this,D=a.constructor;if(!a.isFinite()||a.isZero())return new D(a);for(ri=!1,(u=a.s*oi(a.s*a,1/3))&&Math.abs(u)!=1/0?r=new D(u.toString()):(e=li(a.d),(u=((t=a.e)-e.length+1)%3)&&(e+=1==u||-2==u?"0":"00"),u=oi(e,1/3),t=Mi((t+1)/3)-(t%3==(t<0?-1:2)),(r=new D(e=u==1/0?"5e"+t:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+t)).s=a.s),M=(t=D.precision)+3;;)if(N=(c=(o=r).times(o).times(o)).plus(a),r=xi(N.plus(a).times(o),N.plus(c),M+2,1),li(o.d).slice(0,M)===(e=li(r.d)).slice(0,M)){if("9999"!=(e=e.slice(M-3,M+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(zi(r,t+1,1),n=!r.times(r).times(r).eq(a));break}if(!i&&(zi(o,t+1,0),o.times(o).times(o).eq(a))){r=o;break}M+=4,i=1}return ri=!0,zi(r,t,D.rounding,n)},Ii.decimalPlaces=Ii.dp=function(){var t,n=this.d,e=NaN;if(n){if(e=7*((t=n.length-1)-Mi(this.e/7)),t=n[t])for(;t%10==0;t/=10)e--;e<0&&(e=0)}return e},Ii.dividedBy=Ii.div=function(t){return xi(this,new this.constructor(t))},Ii.dividedToIntegerBy=Ii.divToInt=function(t){var n=this.constructor;return zi(xi(this,new n(t),0,1,1),n.precision,n.rounding)},Ii.equals=Ii.eq=function(t){return 0===this.cmp(t)},Ii.floor=function(){return zi(new this.constructor(this),this.e+1,3)},Ii.greaterThan=Ii.gt=function(t){return this.cmp(t)>0},Ii.greaterThanOrEqualTo=Ii.gte=function(t){var n=this.cmp(t);return 1==n||0===n},Ii.hyperbolicCosine=Ii.cosh=function(){var t,n,e,r,i,u=this,M=u.constructor,o=new M(1);if(!u.isFinite())return new M(u.s?1/0:NaN);if(u.isZero())return o;e=M.precision,r=M.rounding,M.precision=e+Math.max(u.e,u.sd())+4,M.rounding=1,(i=u.d.length)<32?n=(1/mi(4,t=Math.ceil(i/3))).toString():(t=16,n="2.3283064365386962890625e-10"),u=Yi(M,1,u.times(n),new M(1),!0);for(var c,N=t,a=new M(8);N--;)c=u.times(u),u=o.minus(c.times(a.minus(c.times(a))));return zi(u,M.precision=e,M.rounding=r,!0)},Ii.hyperbolicSine=Ii.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=Yi(u,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=Yi(u,2,i=i.times(1/mi(5,t)),i,!0);for(var M,o=new u(5),c=new u(16),N=new u(20);t--;)M=i.times(i),i=i.times(o.plus(M.times(c.times(M).plus(N))))}return u.precision=n,u.rounding=e,zi(i,n,e,!0)},Ii.hyperbolicTangent=Ii.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,xi(e.sinh(),e.cosh(),r.precision=t,r.rounding=n)):new r(e.s)},Ii.inverseCosine=Ii.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()?fi(e,i,u):new e(0):new e(NaN):n.isZero()?fi(e,i+4,u).times(.5):(e.precision=i+6,e.rounding=1,n=n.asin(),t=fi(e,i+4,u).times(.5),e.precision=i,e.rounding=u,t.minus(n))},Ii.inverseHyperbolicCosine=Ii.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,ri=!1,e=e.times(e).minus(1).sqrt().plus(e),ri=!0,r.precision=t,r.rounding=n,e.ln()):new r(e)},Ii.inverseHyperbolicSine=Ii.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,ri=!1,e=e.times(e).plus(1).sqrt().plus(e),ri=!0,r.precision=t,r.rounding=n,e.ln())},Ii.inverseHyperbolicTangent=Ii.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?zi(new u(i),t,n,!0):(u.precision=e=r-i.e,i=xi(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)},Ii.inverseSine=Ii.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=fi(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)))},Ii.inverseTangent=Ii.atan=function(){var t,n,e,r,i,u,M,o,c,N=this,a=N.constructor,D=a.precision,s=a.rounding;if(N.isFinite()){if(N.isZero())return new a(N);if(N.abs().eq(1)&&D+4<=gi)return(M=fi(a,D+4,s).times(.25)).s=N.s,M}else{if(!N.s)return new a(NaN);if(D+4<=gi)return(M=fi(a,D+4,s).times(.5)).s=N.s,M}for(a.precision=o=D+10,a.rounding=1,t=e=Math.min(28,o/7+2|0);t;--t)N=N.div(N.times(N).plus(1).sqrt().plus(1));for(ri=!1,n=Math.ceil(o/7),r=1,c=N.times(N),M=new a(N),i=N;-1!==t;)if(i=i.times(c),u=M.minus(i.div(r+=2)),i=i.times(c),void 0!==(M=u.plus(i.div(r+=2))).d[n])for(t=n;M.d[t]===u.d[t]&&t--;);return e&&(M=M.times(2<<e-1)),ri=!0,zi(M,a.precision=D,a.rounding=s,!0)},Ii.isFinite=function(){return!!this.d},Ii.isInteger=Ii.isInt=function(){return!!this.d&&Mi(this.e/7)>this.d.length-2},Ii.isNaN=function(){return!this.s},Ii.isNegative=Ii.isNeg=function(){return this.s<0},Ii.isPositive=Ii.isPos=function(){return this.s>0},Ii.isZero=function(){return!!this.d&&0===this.d[0]},Ii.lessThan=Ii.lt=function(t){return this.cmp(t)<0},Ii.lessThanOrEqualTo=Ii.lte=function(t){return this.cmp(t)<1},Ii.logarithm=Ii.log=function(t){var n,e,r,i,u,M,o,c,N=this.constructor,a=N.precision,D=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(ri=!1,M=Qi(this,o=a+5),r=n?Ai(N,o+10):Qi(t,o),ji((c=xi(M,r,o,1)).d,i=a,D))do{if(M=Qi(this,o+=10),r=n?Ai(N,o+10):Qi(t,o),c=xi(M,r,o,1),!u){+li(c.d).slice(i+1,i+15)+1==1e14&&(c=zi(c,a+1,0));break}}while(ji(c.d,i+=10,D));return ri=!0,zi(c,a,D)},Ii.minus=Ii.sub=function(t){var n,e,r,i,u,M,o,c,N,a,D,s,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,s=t.d,o=g.precision,c=g.rounding,!N[0]||!s[0]){if(s[0])t.s=-t.s;else{if(!N[0])return new g(3===c?-0:0);t=new g(T)}return ri?zi(t,o,c):t}if(e=Mi(t.e/7),a=Mi(T.e/7),N=N.slice(),u=a-e){for((D=u<0)?(n=N,u=-u,M=s.length):(n=s,e=a,M=N.length),u>(r=Math.max(Math.ceil(o/7),M)+2)&&(u=r,n.length=1),n.reverse(),r=u;r--;)n.push(0);n.reverse()}else{for((D=(r=N.length)<(M=s.length))&&(M=r),r=0;r<M;r++)if(N[r]!=s[r]){D=N[r]<s[r];break}u=0}for(D&&(n=N,N=s,s=n,t.s=-t.s),M=N.length,r=s.length-M;r>0;--r)N[M++]=0;for(r=s.length;r>u;){if(N[--r]<s[r]){for(i=r;i&&0===N[--i];)N[i]=si-1;--N[i],N[r]+=si}N[r]-=s[r]}for(;0===N[--M];)N.pop();for(;0===N[0];N.shift())--e;return N[0]?(t.d=N,t.e=Ei(N,e),ri?zi(t,o,c):t):new g(3===c?-0:0)},Ii.modulo=Ii.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]?zi(new r(e),r.precision,r.rounding):(ri=!1,9==r.modulo?(n=xi(e,t.abs(),0,3,1)).s*=t.s:n=xi(e,t,0,r.modulo,1),n=n.times(t),ri=!0,e.minus(n))},Ii.naturalExponential=Ii.exp=function(){return wi(this)},Ii.naturalLogarithm=Ii.ln=function(){return Qi(this)},Ii.negated=Ii.neg=function(){var t=new this.constructor(this);return t.s=-t.s,zi(t)},Ii.plus=Ii.add=function(t){var n,e,r,i,u,M,o,c,N,a,D=this,s=D.constructor;if(t=new s(t),!D.d||!t.d)return D.s&&t.s?D.d||(t=new s(t.d||D.s===t.s?D:NaN)):t=new s(NaN),t;if(D.s!=t.s)return t.s=-t.s,D.minus(t);if(N=D.d,a=t.d,o=s.precision,c=s.rounding,!N[0]||!a[0])return a[0]||(t=new s(D)),ri?zi(t,o,c):t;if(u=Mi(D.e/7),r=Mi(t.e/7),N=N.slice(),i=u-r){for(i<0?(e=N,i=-i,M=a.length):(e=a,r=u,M=N.length),i>(M=(u=Math.ceil(o/7))>M?u+1:M+1)&&(i=M,e.length=1),e.reverse();i--;)e.push(0);e.reverse()}for((M=N.length)-(i=a.length)<0&&(i=M,e=a,a=N,N=e),n=0;i;)n=(N[--i]=N[i]+a[i]+n)/si|0,N[i]%=si;for(n&&(N.unshift(n),++r),M=N.length;0==N[--M];)N.pop();return t.d=N,t.e=Ei(N,r),ri?zi(t,o,c):t},Ii.precision=Ii.sd=function(t){var n,e=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(ii+t);return e.d?(n=pi(e.d),t&&e.e+1>n&&(n=e.e+1)):n=NaN,n},Ii.round=function(){var t=this,n=t.constructor;return zi(new n(t),t.e+1,n.rounding)},Ii.sine=Ii.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:Yi(t,2,n,n);e=(e=1.4*Math.sqrt(r))>16?16:0|e,n=n.times(1/mi(5,e)),n=Yi(t,2,n,n);for(var i,u=new t(5),M=new t(16),o=new t(20);e--;)i=n.times(n),n=n.times(u.plus(i.times(M.times(i).minus(o))));return n}(r,Ri(r,e)),r.precision=t,r.rounding=n,zi(qr>2?e.neg():e,t,n,!0)):new r(NaN)},Ii.squareRoot=Ii.sqrt=function(){var t,n,e,r,i,u,M=this,o=M.d,c=M.e,N=M.s,a=M.constructor;if(1!==N||!o||!o[0])return new a(!N||N<0&&(!o||o[0])?NaN:o?M:1/0);for(ri=!1,0==(N=Math.sqrt(+M))||N==1/0?(((n=li(o)).length+c)%2==0&&(n+="0"),N=Math.sqrt(n),c=Mi((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(xi(M,u,e+2,1)).times(.5),li(u.d).slice(0,e)===(n=li(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))||(zi(r,c+1,1),t=!r.times(r).eq(M));break}if(!i&&(zi(u,c+1,0),u.times(u).eq(M))){r=u;break}e+=4,i=1}return ri=!0,zi(r,c,a.rounding,t)},Ii.tangent=Ii.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=xi(e,new r(1).minus(e.times(e)).sqrt(),t+10,0),r.precision=t,r.rounding=n,zi(2==qr||4==qr?e.neg():e,t,n,!0)):new r(NaN)},Ii.times=Ii.mul=function(t){var n,e,r,i,u,M,o,c,N,a=this,D=a.constructor,s=a.d,T=(t=new D(t)).d;if(t.s*=a.s,!(s&&s[0]&&T&&T[0]))return new D(!t.s||s&&!s[0]&&!T||T&&!T[0]&&!s?NaN:s&&T?0*t.s:t.s/0);for(e=Mi(a.e/7)+Mi(t.e/7),(c=s.length)<(N=T.length)&&(u=s,s=T,T=u,M=c,c=N,N=M),u=[],r=M=c+N;r--;)u.push(0);for(r=N;--r>=0;){for(n=0,i=c+r;i>r;)o=u[i]+T[r]*s[i-r-1]+n,u[i--]=o%si|0,n=o/si|0;u[i]=(u[i]+n)%si|0}for(;!u[--M];)u.pop();return n?++e:u.shift(),t.d=u,t.e=Ei(u,e),ri?zi(t,D.precision,D.rounding):t},Ii.toBinary=function(t,n){return Fi(this,2,t,n)},Ii.toDecimalPlaces=Ii.toDP=function(t,n){var e=this,r=e.constructor;return e=new r(e),void 0===t?e:(yi(t,0,1e9),void 0===n?n=r.rounding:yi(n,0,8),zi(e,t+e.e+1,n))},Ii.toExponential=function(t,n){var e,r=this,i=r.constructor;return void 0===t?e=Oi(r,!0):(yi(t,0,1e9),void 0===n?n=i.rounding:yi(n,0,8),e=Oi(r=zi(new i(r),t+1,n),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+e:e},Ii.toFixed=function(t,n){var e,r,i=this,u=i.constructor;return void 0===t?e=Oi(i):(yi(t,0,1e9),void 0===n?n=u.rounding:yi(n,0,8),e=Oi(r=zi(new u(i),t+i.e+1,n),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+e:e},Ii.toFraction=function(t){var n,e,r,i,u,M,o,c,N,a,D,s,T=this,g=T.d,I=T.constructor;if(!g)return new I(T);if(N=e=new I(1),r=c=new I(0),M=(u=(n=new I(r)).e=pi(g)-T.e-1)%7,n.d[0]=oi(10,M<0?7+M:M),null==t)t=u>0?n:N;else{if(!(o=new I(t)).isInt()||o.lt(N))throw Error(ii+o);t=o.gt(n)?u>0?n:N:o}for(ri=!1,o=new I(li(g)),a=I.precision,I.precision=u=7*g.length*2;D=xi(o,n,0,1,1),1!=(i=e.plus(D.times(r))).cmp(t);)e=r,r=i,i=N,N=c.plus(D.times(i)),c=i,i=n,n=o.minus(D.times(i)),o=i;return i=xi(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,s=xi(N,r,u,1).minus(T).abs().cmp(xi(c,e,u,1).minus(T).abs())<1?[N,r]:[c,e],I.precision=a,ri=!0,s},Ii.toHexadecimal=Ii.toHex=function(t,n){return Fi(this,16,t,n)},Ii.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:yi(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]?(ri=!1,e=xi(e,t,0,n,1).times(t),ri=!0,zi(e)):(t.s=e.s,e=t),e},Ii.toNumber=function(){return+this},Ii.toOctal=function(t,n){return Fi(this,8,t,n)},Ii.toPower=Ii.pow=function(t){var n,e,r,i,u,M,o=this,c=o.constructor,N=+(t=new c(t));if(!(o.d&&t.d&&o.d[0]&&t.d[0]))return new c(oi(+o,N));if((o=new c(o)).eq(1))return o;if(r=c.precision,u=c.rounding,t.eq(1))return zi(o,r,u);if((n=Mi(t.e/7))>=t.d.length-1&&(e=N<0?-N:N)<=9007199254740991)return i=Ui(c,o,e,r),t.s<0?new c(1).div(i):zi(i,r,u);if((M=o.s)<0){if(n<t.d.length-1)return new c(NaN);if(0==(1&t.d[n])&&(M=1),0==o.e&&1==o.d[0]&&1==o.d.length)return o.s=M,o}return(n=0!=(e=oi(+o,N))&&isFinite(e)?new c(e+"").e:Mi(N*(Math.log("0."+li(o.d))/Math.LN10+o.e+1)))>c.maxE+1||n<c.minE-1?new c(n>0?M/0:0):(ri=!1,c.rounding=o.s=1,e=Math.min(12,(n+"").length),(i=wi(t.times(Qi(o,r+e)),r)).d&&ji((i=zi(i,r+5,1)).d,r,u)&&(n=r+10,+li((i=zi(wi(t.times(Qi(o,n+e)),n),n+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=zi(i,r+1,0))),i.s=M,ri=!0,c.rounding=u,zi(i,r,u))},Ii.toPrecision=function(t,n){var e,r=this,i=r.constructor;return void 0===t?e=Oi(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(yi(t,1,1e9),void 0===n?n=i.rounding:yi(n,0,8),e=Oi(r=zi(new i(r),t,n),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+e:e},Ii.toSignificantDigits=Ii.toSD=function(t,n){var e=this.constructor;return void 0===t?(t=e.precision,n=e.rounding):(yi(t,1,1e9),void 0===n?n=e.rounding:yi(n,0,8)),zi(new e(this),t,n)},Ii.toString=function(){var t=this,n=t.constructor,e=Oi(t,t.e<=n.toExpNeg||t.e>=n.toExpPos);return t.isNeg()&&!t.isZero()?"-"+e:e},Ii.truncated=Ii.trunc=function(){return zi(new this.constructor(this),this.e+1,1)},Ii.valueOf=Ii.toJSON=function(){var t=this,n=t.constructor,e=Oi(t,t.e<=n.toExpNeg||t.e>=n.toExpPos);return t.isNeg()?"-"+e:e};var xi=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,M,o,c){var N,a,D,s,T,g,I,l,y,j,h,x,z,O,E,A,f,p,C,U,d=r.constructor,L=r.s==i.s?1:-1,w=r.d,Q=i.d;if(!(w&&w[0]&&Q&&Q[0]))return new d(r.s&&i.s&&(w?!Q||w[0]!=Q[0]:Q)?w&&0==w[0]||!Q?0*L:L/0:NaN);for(c?(T=1,a=r.e-i.e):(c=si,T=7,a=Mi(r.e/T)-Mi(i.e/T)),C=Q.length,f=w.length,j=(y=new d(L)).d=[],D=0;Q[D]==(w[D]||0);D++);if(Q[D]>(w[D]||0)&&a--,null==u?(O=u=d.precision,M=d.rounding):O=o?u+(r.e-i.e)+1:u,O<0)j.push(1),g=!0;else{if(O=O/T+2|0,D=0,1==C){for(s=0,Q=Q[0],O++;(D<f||s)&&O--;D++)E=s*c+(w[D]||0),j[D]=E/Q|0,s=E%Q|0;g=s||D<f}else{for((s=c/(Q[0]+1)|0)>1&&(Q=t(Q,s,c),w=t(w,s,c),C=Q.length,f=w.length),A=C,x=(h=w.slice(0,C)).length;x<C;)h[x++]=0;(U=Q.slice()).unshift(0),p=Q[0],Q[1]>=c/2&&++p;do{s=0,(N=n(Q,h,C,x))<0?(z=h[0],C!=x&&(z=z*c+(h[1]||0)),(s=z/p|0)>1?(s>=c&&(s=c-1),1==(N=n(I=t(Q,s,c),h,l=I.length,x=h.length))&&(s--,e(I,C<l?U:Q,l,c))):(0==s&&(N=s=1),I=Q.slice()),(l=I.length)<x&&I.unshift(0),e(h,I,x,c),-1==N&&(N=n(Q,h,C,x=h.length))<1&&(s++,e(h,C<x?U:Q,x,c)),x=h.length):0===N&&(s++,h=[0]),j[D++]=s,N&&h[0]?h[x++]=w[A]||0:(h=[w[A]],x=1)}while((A++<f||void 0!==h[0])&&O--);g=void 0!==h[0]}j[0]||j.shift()}if(1==T)y.e=a,Xr=g;else{for(D=1,s=j[0];s>=10;s/=10)D++;y.e=D+a*T-1,zi(y,o?u+y.e+1:u,M,g)}return y}}();function zi(t,n,e,r){var i,u,M,o,c,N,a,D,s,T=t.constructor;t:if(null!=n){if(!(D=t.d))return t;for(i=1,o=D[0];o>=10;o/=10)i++;if((u=n-i)<0)u+=7,M=n,c=(a=D[s=0])/oi(10,i-M-1)%10|0;else if((s=Math.ceil((u+1)/7))>=(o=D.length)){if(!r)break t;for(;o++<=s;)D.push(0);a=c=0,i=1,M=(u%=7)-7+1}else{for(a=o=D[s],i=1;o>=10;o/=10)i++;c=(M=(u%=7)-7+i)<0?0:a/oi(10,i-M-1)%10|0}if(r=r||n<0||void 0!==D[s+1]||(M<0?a:a%oi(10,i-M-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?M>0?a/oi(10,i-M):0:D[s-1])%10&1||e==(t.s<0?8:7)),n<1||!D[0])return D.length=0,N?(n-=t.e+1,D[0]=oi(10,(7-n%7)%7),t.e=-n||0):D[0]=t.e=0,t;if(0==u?(D.length=s,o=1,s--):(D.length=s+1,o=oi(10,7-u),D[s]=M>0?(a/oi(10,i-M)%oi(10,M)|0)*o:0),N)for(;;){if(0==s){for(u=1,M=D[0];M>=10;M/=10)u++;for(M=D[0]+=o,o=1;M>=10;M/=10)o++;u!=o&&(t.e++,D[0]==si&&(D[0]=1));break}if(D[s]+=o,D[s]!=si)break;D[s--]=0,o=1}for(u=D.length;0===D[--u];)D.pop()}return ri&&(t.e>T.maxE?(t.d=null,t.e=NaN):t.e<T.minE&&(t.e=0,t.d=[0])),t}function Oi(t,n,e){if(!t.isFinite())return Si(t);var r,i=t.e,u=li(t.d),M=u.length;return n?(e&&(r=e-M)>0?u=u.charAt(0)+"."+u.slice(1)+Ci(r):M>1&&(u=u.charAt(0)+"."+u.slice(1)),u=u+(t.e<0?"e":"e+")+t.e):i<0?(u="0."+Ci(-i-1)+u,e&&(r=e-M)>0&&(u+=Ci(r))):i>=M?(u+=Ci(i+1-M),e&&(r=e-i-1)>0&&(u=u+"."+Ci(r))):((r=i+1)<M&&(u=u.slice(0,r)+"."+u.slice(r)),e&&(r=e-M)>0&&(i+1===M&&(u+="."),u+=Ci(r))),u}function Ei(t,n){var e=t[0];for(n*=7;e>=10;e/=10)n++;return n}function Ai(t,n,e){if(n>Ti)throw ri=!0,e&&(t.precision=e),Error("[DecimalError] Precision limit exceeded");return zi(new t(ti),n,1,!0)}function fi(t,n,e){if(n>gi)throw Error("[DecimalError] Precision limit exceeded");return zi(new t(ni),n,e,!0)}function pi(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 Ci(t){for(var n="";t--;)n+="0";return n}function Ui(t,n,e,r){var i,u=new t(1),M=Math.ceil(r/7+4);for(ri=!1;;){if(e%2&&bi((u=u.times(n)).d,M)&&(i=!0),0===(e=Mi(e/2))){e=u.d.length-1,i&&0===u.d[e]&&++u.d[e];break}bi((n=n.times(n)).d,M)}return ri=!0,u}function di(t){return 1&t.d[t.d.length-1]}function Li(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 wi(t,n){var e,r,i,u,M,o,c,N=0,a=0,D=0,s=t.constructor,T=s.rounding,g=s.precision;if(!t.d||!t.d[0]||t.e>17)return new s(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==n?(ri=!1,c=g):c=n,o=new s(.03125);t.e>-2;)t=t.times(o),D+=5;for(c+=r=Math.log(oi(2,D))/Math.LN10*2+5|0,e=u=M=new s(1),s.precision=c;;){if(u=zi(u.times(t),c,1),e=e.times(++a),li((o=M.plus(xi(u,e,c,1))).d).slice(0,c)===li(M.d).slice(0,c)){for(i=D;i--;)M=zi(M.times(M),c,1);if(null!=n)return s.precision=g,M;if(!(N<3&&ji(M.d,c-r,T,N)))return zi(M,s.precision=g,T,ri=!0);s.precision=c+=10,e=u=o=new s(1),a=0,N++}M=o}}function Qi(t,n){var e,r,i,u,M,o,c,N,a,D,s,T=1,g=t,I=g.d,l=g.constructor,y=l.rounding,j=l.precision;if(g.s<0||!I||!I[0]||!g.e&&1==I[0]&&1==I.length)return new l(I&&!I[0]?-1/0:1!=g.s?NaN:I?0:g);if(null==n?(ri=!1,a=j):a=n,l.precision=a+=10,r=(e=li(I)).charAt(0),!(Math.abs(u=g.e)<15e14))return N=Ai(l,a+2,j).times(u+""),g=Qi(new l(r+"."+e.slice(1)),a-10).plus(N),l.precision=j,null==n?zi(g,j,y,ri=!0):g;for(;r<7&&1!=r||1==r&&e.charAt(1)>3;)r=(e=li((g=g.times(t)).d)).charAt(0),T++;for(u=g.e,r>1?(g=new l("0."+e),u++):g=new l(r+"."+e.slice(1)),D=g,c=M=g=xi(g.minus(1),g.plus(1),a,1),s=zi(g.times(g),a,1),i=3;;){if(M=zi(M.times(s),a,1),li((N=c.plus(xi(M,new l(i),a,1))).d).slice(0,a)===li(c.d).slice(0,a)){if(c=c.times(2),0!==u&&(c=c.plus(Ai(l,a+2,j).times(u+""))),c=xi(c,new l(T),a,1),null!=n)return l.precision=j,c;if(!ji(c.d,a-10,y,o))return zi(c,l.precision=j,y,ri=!0);l.precision=a+=10,N=M=g=xi(D.minus(1),D.plus(1),a,1),s=zi(g.times(g),a,1),i=o=1}c=N,i+=2}}function Si(t){return String(t.s*t.s/0)}function ki(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),ri&&(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 vi(t,n){var e,r,i,u,M,o,c,N,a;if(n.indexOf("_")>-1){if(n=n.replace(/(\d)_(?=\d)/g,"$1"),Di.test(n))return ki(t,n)}else if("Infinity"===n||"NaN"===n)return+n||(t.s=NaN),t.e=NaN,t.d=null,t;if(Ni.test(n))e=16,n=n.toLowerCase();else if(ci.test(n))e=2;else{if(!ai.test(n))throw Error(ii+n);e=8}for((u=n.search(/p/i))>0?(c=+n.slice(u+1),n=n.substring(2,u)):n=n.slice(2),M=(u=n.indexOf("."))>=0,r=t.constructor,M&&(u=(o=(n=n.replace(".","")).length)-u,i=Ui(r,new r(e),u,2*u)),u=a=(N=hi(n,e,si)).length-1;0===N[u];--u)N.pop();return u<0?new r(0*t.s):(t.e=Ei(N,a),t.d=N,ri=!1,M&&(t=xi(t,i,4*o)),c&&(t=t.times(Math.abs(c)<54?oi(2,c):Cu.pow(2,c))),ri=!0,t)}function Yi(t,n,e,r,i){var u,M,o,c,N=t.precision,a=Math.ceil(N/7);for(ri=!1,c=e.times(e),o=new t(r);;){if(M=xi(o.times(c),new t(n++*n++),N,1),o=i?r.plus(M):r.minus(M),r=xi(M.times(c),new t(n++*n++),N,1),void 0!==(M=o.plus(r)).d[a]){for(u=a;M.d[u]===o.d[u]&&u--;);if(-1==u)break}u=o,o=r,r=M,M=u}return ri=!0,M.d.length=a+1,M}function mi(t,n){for(var e=t;--n;)e*=t;return e}function Ri(t,n){var e,r=n.s<0,i=fi(t,t.precision,1),u=i.times(.5);if((n=n.abs()).lte(u))return qr=r?4:1,n;if((e=n.divToInt(i)).isZero())qr=r?3:2;else{if((n=n.minus(e.times(i))).lte(u))return qr=di(e)?r?2:3:r?4:1,n;qr=di(e)?r?1:4:r?3:2}return n.minus(i).abs()}function Fi(t,n,e,r){var i,u,M,o,c,N,a,D,s,T=t.constructor,g=void 0!==e;if(g?(yi(e,1,1e9),void 0===r?r=T.rounding:yi(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,(M=(a=Oi(t)).indexOf("."))>=0&&(a=a.replace(".",""),(s=new T(1)).e=a.length-M,s.d=hi(Oi(s),10,i),s.e=s.d.length),u=c=(D=hi(a,10,i)).length;0==D[--c];)D.pop();if(D[0]){if(M<0?u--:((t=new T(t)).d=D,t.e=u,D=(t=xi(t,s,e,r,0,i)).d,u=t.e,N=Xr),M=D[e],o=i/2,N=N||void 0!==D[e+1],N=r<4?(void 0!==M||N)&&(0===r||r===(t.s<0?3:2)):M>o||M===o&&(4===r||N||6===r&&1&D[e-1]||r===(t.s<0?8:7)),D.length=e,N)for(;++D[--e]>i-1;)D[e]=0,e||(++u,D.unshift(1));for(c=D.length;!D[c-1];--c);for(M=0,a="";M<c;M++)a+=$r.charAt(D[M]);if(g){if(c>1)if(16==n||8==n){for(M=16==n?4:3,--c;c%M;c++)a+="0";for(c=(D=hi(a,i,n)).length;!D[c-1];--c);for(M=1,a="1.";M<c;M++)a+=$r.charAt(D[M])}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=Si(t);return t.s<0?"-"+a:a}function bi(t,n){if(t.length>n)return t.length=n,!0}function Bi(t){return new this(t).abs()}function Zi(t){return new this(t).acos()}function Vi(t){return new this(t).acosh()}function Wi(t,n){return new this(t).plus(n)}function Gi(t){return new this(t).asin()}function Pi(t){return new this(t).asinh()}function Ji(t){return new this(t).atan()}function Hi(t){return new this(t).atanh()}function Ki(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?fi(this,r,i):new this(0)).s=t.s:!t.d||n.isZero()?(e=fi(this,u,1).times(.5)).s=t.s:n.s<0?(this.precision=u,this.rounding=1,e=this.atan(xi(t,n,u,1)),n=fi(this,u,1),this.precision=r,this.rounding=i,e=t.s<0?e.minus(n):e.plus(n)):e=this.atan(xi(t,n,u,1)):(e=fi(this,u,1).times(n.s>0?.25:.75)).s=t.s:e=new this(NaN),e}function Xi(t){return new this(t).cbrt()}function qi(t){return zi(t=new this(t),t.e+1,2)}function _i(t,n,e){return new this(t).clamp(n,e)}function $i(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",-_r,0,"toExpPos",0,_r,"maxE",0,_r,"minE",-_r,0,"modulo",0,9];for(n=0;n<u.length;n+=3)if(e=u[n],i&&(this[e]=ei[e]),void 0!==(r=t[e])){if(!(Mi(r)===r&&r>=u[n+1]&&r<=u[n+2]))throw Error(ii+e+": "+r);this[e]=r}if(e="crypto",i&&(this[e]=ei[e]),void 0!==(r=t[e])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(ii+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 tu(t){return new this(t).cos()}function nu(t){return new this(t).cosh()}function eu(t,n){return new this(t).div(n)}function ru(t){return new this(t).exp()}function iu(t){return zi(t=new this(t),t.e+1,3)}function uu(){var t,n,e=new this(0);for(ri=!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 ri=!0,new this(1/0);e=n}return ri=!0,e.sqrt()}function Mu(t){return t instanceof Cu||t&&t.toStringTag===ui||!1}function ou(t){return new this(t).ln()}function cu(t,n){return new this(t).log(n)}function Nu(t){return new this(t).log(2)}function au(t){return new this(t).log(10)}function Du(){return Li(this,arguments,"lt")}function su(){return Li(this,arguments,"gt")}function Tu(t,n){return new this(t).mod(n)}function gu(t,n){return new this(t).mul(n)}function Iu(t,n){return new this(t).pow(n)}function lu(t){var n,e,r,i,u=0,M=new this(1),o=[];if(void 0===t?t=this.precision:yi(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]:o[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):(o.push(i%1e7),u+=4);u=r/4}else for(;u<r;)o[u++]=1e7*Math.random()|0;for(t%=7,(r=o[--u])&&t&&(i=oi(10,7-t),o[u]=(r/i|0)*i);0===o[u];u--)o.pop();if(u<0)e=0,o=[0];else{for(e=-1;0===o[0];e-=7)o.shift();for(r=1,i=o[0];i>=10;i/=10)r++;r<7&&(e-=7-r)}return M.e=e,M.d=o,M}function yu(t){return zi(t=new this(t),t.e+1,this.rounding)}function ju(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function hu(t){return new this(t).sin()}function xu(t){return new this(t).sinh()}function zu(t){return new this(t).sqrt()}function Ou(t,n){return new this(t).sub(n)}function Eu(){var t=0,n=arguments,e=new this(n[t]);for(ri=!1;e.s&&++t<n.length;)e=e.plus(n[t]);return ri=!0,zi(e,this.precision,this.rounding)}function Au(t){return new this(t).tan()}function fu(t){return new this(t).tanh()}function pu(t){return zi(t=new this(t),t.e+1,1)}Ii[Symbol.for("nodejs.util.inspect.custom")]=Ii.toString,Ii[Symbol.toStringTag]="Decimal";var Cu=Ii.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,Mu(t))return i.s=t.s,void(ri?!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(ri?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)):ki(i,t.toString())}if("string"!==r)throw Error(ii+t);return 45===(e=t.charCodeAt(0))?(t=t.slice(1),i.s=-1):(43===e&&(t=t.slice(1)),i.s=1),Di.test(t)?ki(i,t):vi(i,t)}if(u.prototype=Ii,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=$i,u.clone=t,u.isDecimal=Mu,u.abs=Bi,u.acos=Zi,u.acosh=Vi,u.add=Wi,u.asin=Gi,u.asinh=Pi,u.atan=Ji,u.atanh=Hi,u.atan2=Ki,u.cbrt=Xi,u.ceil=qi,u.clamp=_i,u.cos=tu,u.cosh=nu,u.div=eu,u.exp=ru,u.floor=iu,u.hypot=uu,u.ln=ou,u.log=cu,u.log10=au,u.log2=Nu,u.max=Du,u.min=su,u.mod=Tu,u.mul=gu,u.pow=Iu,u.random=lu,u.round=yu,u.sign=ju,u.sin=hu,u.sinh=xu,u.sqrt=zu,u.sub=Ou,u.sum=Eu,u.tan=Au,u.tanh=fu,u.trunc=pu,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}(ei);ti=new Cu(ti),ni=new Cu(ni);var Uu=Cu;function du(t){return"boolean"==typeof t||!!isFinite(t)&&t===Math.round(t)}var Lu=Math.sign||function(t){return t>0?1:t<0?-1:0},wu=Math.log2||function(t){return Math.log(t)/Math.LN2},Qu=Math.log10||function(t){return Math.log(t)/Math.LN10},Su=(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}),ku=Math.expm1||function(t){return t>=2e-4||t<=-2e-4?Math.exp(t)-1:t+t*t/2+t*t*t/6};function vu(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(!du(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(!du(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 Yu(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}=mu(n);switch(e){case"fixed":return Fu(t,r);case"exponential":return bu(t,r);case"engineering":return function(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=Bu(Ru(t),n),r=e.exponent,i=e.coefficients,u=r%3==0?r:r<0?r-3-r%3:r-r%3;if(rr(n))for(;n>i.length||r-u+1>i.length;)i.push(0);else for(var M=Math.abs(r-u)-(i.length-1),o=0;o<M;o++)i.push(0);var c=Math.abs(r-u),N=1;for(;c>0;)N++,c--;var a=i.slice(N).join(""),D=rr(n)&&a.length||a.match(/[1-9]/)?"."+a:"",s=i.slice(0,N).join("")+D+"e"+(r>=0?"+":"")+u.toString();return e.sign+s}(t,r);case"bin":return vu(t,2,i);case"oct":return vu(t,8,i);case"hex":return vu(t,16,i);case"auto":return function(t,n,e){if(isNaN(t)||!isFinite(t))return String(t);var r=Xu(null==e?void 0:e.lowerExp,-3),i=Xu(null==e?void 0:e.upperExp,5),u=Ru(t),M=n?Bu(u,n):u;if(M.exponent<r||M.exponent>=i)return bu(t,n);var o=M.coefficients,c=M.exponent;o.length<n&&(o=o.concat(Zu(n-o.length))),o=o.concat(Zu(c-o.length+1+(o.length<n?n-o.length:0))),o=Zu(-c).concat(o);var N=c>0?c:0;return N<o.length-1&&o.splice(N+1,0,"."),M.sign+o.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 mu(t){var n,e,r="auto";if(void 0!==t)if(rr(t))n=t;else if(ir(t))n=t.toNumber();else{if(!Or(t))throw new Error("Unsupported type of options, number, BigNumber, or object expected");void 0!==t.precision&&(n=Ku(t.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),void 0!==t.wordSize&&(e=Ku(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 Ru(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 M=r.replace(".","").replace(/^0*/,(function(t){return i-=t.length,""})).replace(/0*$/,"").split("").map((function(t){return parseInt(t)}));return 0===M.length&&(M.push(0),i++),{sign:e,coefficients:M,exponent:i}}function Fu(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=Ru(t),r="number"==typeof n?Bu(e,e.exponent+1+n):e,i=r.coefficients,u=r.exponent+1,M=u+(n||0);return i.length<M&&(i=i.concat(Zu(M-i.length))),u<0&&(i=Zu(1-u).concat(i),u=1),u<i.length&&i.splice(u,0,0===u?"0.":"."),r.sign+i.join("")}function bu(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=Ru(t),r=n?Bu(e,n):e,i=r.coefficients,u=r.exponent;i.length<n&&(i=i.concat(Zu(n-i.length)));var M=i.shift();return r.sign+M+(i.length>0?"."+i.join(""):"")+"e"+(u>=0?"+":"")+u}function Bu(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 Zu(t){for(var n=[],e=0;e<t;e++)n.push(0);return n}var Vu=Number.EPSILON||2220446049250313e-31;function Wu(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<=Vu||r<=Math.max(Math.abs(t),Math.abs(n))*e}return!1}var Gu=Math.acosh||function(t){return Math.log(Math.sqrt(t*t-1)+t)},Pu=Math.asinh||function(t){return Math.log(Math.sqrt(t*t+1)+t)},Ju=Math.atanh||function(t){return Math.log((1+t)/(1-t))/2},Hu=(Math.cosh,Math.sinh||function(t){return(Math.exp(t)-Math.exp(-t))/2});Math.tanh;function Ku(t,n){return rr(t)?t:ir(t)?t.toNumber():void n()}function Xu(t,n){return rr(t)?t:ir(t)?t.toNumber():n}function qu(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(!du(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 _u(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}=mu(n);switch(e){case"fixed":return function(t,n){return t.toFixed(n)}(t,r);case"exponential":return $u(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 qu(t,2,i);case"oct":return qu(t,8,i);case"hex":return qu(t,16,i);case"auto":var u=tM(null==n?void 0:n.lowerExp,-3),M=tM(null==n?void 0:n.upperExp,5);if(t.isZero())return"0";var o=t.toSignificantDigits(r),c=o.e;return(c>=u&&c<M?o.toFixed():$u(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 $u(t,n){return void 0!==n?t.toExponential(n-1):t.toExponential()}function tM(t,n){return rr(t)?t:ir(t)?t.toNumber():n}function nM(t,n){var e=function(t,n){if("number"==typeof t)return Yu(t,n);if(ir(t))return _u(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 nM(n,e)}(t,n);if(cr(t))return eM(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=>eM(e)+": "+nM(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 eM(t){for(var n=String(t),e="",r=0;r<n.length;){var i=n.charAt(r);e+=i in rM?rM[i]:i,r++}return'"'+e+'"'}var rM={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};function iM(t,n){if(!cr(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Zr(t)+", index: 0)");if(!cr(n))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Zr(n)+", index: 1)");return t===n?0:t>n?1:-1}function uM(t,n,e){if(!(this instanceof uM))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 MM(t,n,e){if(!(this instanceof MM))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 oM(t){for(var n=[];Array.isArray(t);)n.push(t.length),t=t[0];return n}function cM(t,n){if(0===n.length){if(Array.isArray(t))throw new uM(t.length,0)}else!function t(n,e,r){var i,u=n.length;if(u!==e[r])throw new uM(u,e[r]);if(r<e.length-1){var M=r+1;for(i=0;i<u;i++){var o=n[i];if(!Array.isArray(o))throw new uM(e.length-1,e.length,"<");t(n[i],e,M)}}else for(i=0;i<u;i++)if(Array.isArray(n[i]))throw new uM(e.length+1,e.length,">")}(t,n,0)}function NM(t,n){if(void 0!==t){if(!rr(t)||!du(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||"number"==typeof n&&t>=n)throw new MM(t,n)}}function aM(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(!rr(t)||!du(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+nM(n)+")")})),(rr(t)||ir(t))&&(t=[t]),function t(n,e,r,i){var u,M,o=n.length,c=e[r],N=Math.min(o,c);if(n.length=c,r<e.length-1){var a=r+1;for(u=0;u<N;u++)M=n[u],Array.isArray(M)||(M=[M],n[u]=M),t(M,e,a,i);for(u=N;u<c;u++)M=[],n[u]=M,t(M,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 DM(t,n){var e=IM(t),r=e.length;if(!Array.isArray(t)||!Array.isArray(n))throw new TypeError("Array expected");if(0===n.length)throw new uM(0,r,"!=");var i=TM(n=sM(n,r));if(r!==i)throw new uM(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 M=r.length/u,o=0;o<M;o++)e.push(r.slice(o*u,(o+1)*u));r=e}return r}(e,n)}catch(t){if(t instanceof uM)throw new uM(i,r,"!=");throw t}}function sM(t,n){var e=TM(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 TM(t){return t.reduce((t,n)=>t*n,1)}function gM(t,n,e,r){var i=r||oM(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 M=r+1;for(i=0,u=n.length;i<u;i++)n[i]=t(n[i],e,M)}else for(var o=r;o<e;o++)n=[n];return n}(t,n,0);i.length<n;)i.push(1);return t}function IM(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 lM(t,n){for(var e,r=0,i=0;i<t.length;i++){var u=t[i],M=Array.isArray(u);if(0===i&&M&&(r=u.length),M&&u.length!==r)return;var o=M?lM(u,n):n(u);if(void 0===e)e=o;else if(e!==o)return"mixed"}return e}function yM(t,n,e,r){if(r<e){if(t.length!==n.length)throw new uM(t.length,n.length);for(var i=[],u=0;u<t.length;u++)i[u]=yM(t[u],n[u],e,r+1);return i}return t.concat(n)}function jM(){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 yM(t,e,n,0)}),t[0]);throw new Error("Wrong number of arguments in function concat")}function hM(){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),M=0;M<n.length;M++)for(var o=n[M],c=r[M],N=0;N<c;N++){var a=i-c+N;o[N]>u[a]&&(u[a]=o[N])}for(var D=0;D<n.length;D++)xM(n[D],u);return u}function xM(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 zM(t,n){var e=oM(t);if(Gr(e,n))return t;xM(e,n);var r,i,u,M=hM(e,n),o=M.length,c=[...Array(o-e.length).fill(1),...e],N=function(t){return nr()([],t)}(t);e.length<o&&(e=oM(N=DM(N,c)));for(var a=0;a<o;a++)e[a]<M[a]&&(r=N,i=M[a],u=a,e=oM(N=jM(...Array(i).fill(r),u)));return N}function OM(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(EM));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 EM(t){return t&&"?"===t[0]?t.slice(1):t}uM.prototype=new RangeError,uM.prototype.constructor=RangeError,uM.prototype.name="DimensionError",uM.prototype.isDimensionError=!0,MM.prototype=new RangeError,MM.prototype.constructor=RangeError,MM.prototype.name="IndexError",MM.prototype.isIndexError=!0;var AM=OM("BigNumber",["?on","config"],t=>{var{on:n,config:e}=t,r=Uu.clone({precision:e.precision,modulo:Uu.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}),fM=e(11),pM=e.n(fM),CM=OM("Complex",[],()=>(Object.defineProperty(pM.a,"name",{value:"Complex"}),pM.a.prototype.constructor=pM.a,pM.a.prototype.type="Complex",pM.a.prototype.isComplex=!0,pM.a.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},pM.a.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},pM.a.prototype.format=function(t){var n=this.im,e=this.re,r=Yu(this.re,t),i=Yu(this.im,t),u=rr(t)?t:t?t.precision:null;if(null!==u){var M=Math.pow(10,-u);Math.abs(e/n)<M&&(e=0),Math.abs(n/e)<M&&(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"},pM.a.fromPolar=function(t){switch(arguments.length){case 1:var n=arguments[0];if("object"==typeof n)return pM()(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(rr(e)){if(or(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),rr(r))return new pM.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")}},pM.a.prototype.valueOf=pM.a.prototype.toString,pM.a.fromJSON=function(t){return new pM.a(t)},pM.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},pM.a),{isClass:!0});function UM(t){var n=0,e=1,r=Object.create(null),i=Object.create(null),u=0,M=function(t){var M=i[t];if(M&&(delete r[M],delete i[t],--n,e===M)){if(!n)return u=0,void(e=1);for(;!Object.prototype.hasOwnProperty.call(r,++e););}};return t=Math.abs(t),{hit:function(o){var c=i[o],N=++u;if(r[N]=o,i[o]=N,!c){if(++n<=t)return;return o=r[e],M(o),o}if(delete r[c],e===c)for(;!Object.prototype.hasOwnProperty.call(r,++e););},delete:M,clear:function(){n=u=0,e=1,r=Object.create(null),i=Object.create(null)}}}function dM(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:UM(e||Number.POSITIVE_INFINITY)});for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];var M=n(i);if(r.cache.values.has(M))return r.cache.lru.hit(M),r.cache.values.get(M);var o=t.apply(t,i);return r.cache.values.set(M,o),r.cache.values.delete(r.cache.lru.hit(M)),o}}function LM(t){return Object.keys(t.signatures||{}).reduce((function(t,n){var e=(n.match(/,/g)||[]).length+1;return Math.max(t,e)}),-1)}dM((function(t){return new t(1).exp()}),{hasher:QM}),dM((function(t){return new t(1).plus(new t(5).sqrt()).div(2)}),{hasher:QM});var wM=dM((function(t){return t.acos(-1)}),{hasher:QM});dM((function(t){return wM(t).times(2)}),{hasher:QM});function QM(t){return t[0].precision}Math.PI,Math.PI,Math.E;SM("fineStructure",.0072973525693),SM("weakMixingAngle",.2229),SM("efimovFactor",22.7),SM("sackurTetrode",-1.16487052358);function SM(t,n){return OM(t,["config","BigNumber"],t=>{var{config:e,BigNumber:r}=t;return"BigNumber"===e.number?new r(n):n})}var kM=e(16),vM=e.n(kM),YM=OM("Fraction",[],()=>(Object.defineProperty(vM.a,"name",{value:"Fraction"}),vM.a.prototype.constructor=vM.a,vM.a.prototype.type="Fraction",vM.a.prototype.isFraction=!0,vM.a.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},vM.a.fromJSON=function(t){return new vM.a(t)},vM.a),{isClass:!0}),mM=OM("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}),RM=OM("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&&!cr(n))throw new Error("Invalid datatype: "+n);if(ar(t))"DenseMatrix"===t.type?(this._data=Vr(t._data),this._size=Vr(t._size),this._datatype=n||t._datatype):(this._data=t.toArray(),this._size=t.size(),this._datatype=n||t._datatype);else if(t&&Nr(t.data)&&Nr(t.size))this._data=t.data,this._size=t.size,cM(this._data,this._size),this._datatype=n||t.datatype;else if(Nr(t))this._data=o(t),this._size=oM(this._data),cM(this._data,this._size),this._datatype=n;else{if(t)throw new TypeError("Unsupported type of data ("+Zr(t)+")");this._data=[],this._size=[0],this._datatype=n}}function r(t,n){if(!Ir(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 uM(r.length,t._size.length);for(var i=n.min(),u=n.max(),M=0,o=t._size.length;M<o;M++)NM(i[M],t._size[M]),NM(u[M],t._size[M]);return new e(function t(n,e,r,i){var u=i===r-1,M=e.dimension(i);return u?M.map((function(t){return NM(t,n.length),n[t]})).valueOf():M.map((function(u){NM(u,n.length);var M=n[u];return t(M,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(),o=n.isScalar();if(ar(e)?(i=e.size(),e=e.valueOf()):i=oM(e),o){if(0!==i.length)throw new TypeError("Scalar expected");t.set(n.min(),e,r)}else{if(!Gr(i,u))try{i=oM(e=0===i.length?zM([e],u):zM(e,u))}catch(t){}if(u.length<t._size.length)throw new uM(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=gM(e,u.length,N,i)}if(!Gr(u,i))throw new uM(u,i,">");M(t,n.max().map((function(t){return t+1})),r);var a=u.length;!function t(n,e,r,i,u){var M=u===i-1,o=e.dimension(u);M?o.forEach((function(t,e){NM(t),n[t]=r[e[0]]})):o.forEach((function(M,o){NM(M),t(n[M],e,r[o[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;Nr(r);)r=r[0];return r}return t._size=n.slice(0),t._data=aM(t._data,t._size,e),t}function M(t,n,e){for(var r=t._size.slice(0),i=!1;r.length<n.length;)r.push(0),i=!0;for(var M=0,o=n.length;M<o;M++)n[M]>r[M]&&(r[M]=n[M],i=!0);i&&u(t,r,e)}function o(t){return ar(t)?o(t.valueOf()):Nr(t)?t.map(o):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 lM(this._data,Zr)},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(!Nr(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new uM(t.length,this._size.length);for(var n=0;n<t.length;n++)NM(t[n],this._size[n]);for(var e=this._data,r=0,i=t.length;r<i;r++){var u=t[r];NM(u,e.length),e=e[u]}return e},e.prototype.set=function(t,n,e){if(!Nr(t))throw new TypeError("Array expected");if(t.length<this._size.length)throw new uM(t.length,this._size.length,"<");var r,i,u;M(this,t.map((function(t){return t+1})),e);var o=this._data;for(r=0,i=t.length-1;r<i;r++)NM(u=t[r],o.length),o=o[u];return NM(u=t[t.length-1],o.length),o[u]=n,this},e.prototype.resize=function(t,n,e){if(!Dr(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=DM(e._data,t);var r=e._size.reduce((t,n)=>t*n);return e._size=sM(t,r),e},e.prototype.clone=function(){return new e({data:Vr(this._data),size:Vr(this._size),datatype:this._datatype})},e.prototype.size=function(){return this._size.slice(0)},e.prototype.map=function(t){var n=this,r=LM(t),i=function e(i,u){return Nr(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?lM(i,Zr):void 0)},e.prototype.forEach=function(t){var n=this;!function e(r,i){Nr(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(Nr(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))},M=0;M<r[1];M++)u(M);return n},e.prototype.toArray=function(){return Vr(this._data)},e.prototype.valueOf=function(){return this._data},e.prototype.format=function(t){return nM(this._data,t)},e.prototype.toString=function(){return nM(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(ir(t)&&(t=t.toNumber()),!rr(t)||!du(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],M=Math.min(i-r,u-n),o=[],c=0;c<M;c++)o[c]=this._data[c+r][c+n];return new e({data:o,size:[M],datatype:this._datatype})},e.diagonal=function(t,n,r,i){if(!Nr(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(ir(t)&&(t=t.toNumber()),!rr(t)||!du(t)||t<1)throw new Error("Size values must be positive integers");return t})),r){if(ir(r)&&(r=r.toNumber()),!rr(r)||!du(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var u,M=r>0?r:0,o=r<0?-r:0,c=t[0],N=t[1],a=Math.min(c-o,N-M);if(Nr(n)){if(n.length!==a)throw new Error("Invalid value array length");u=function(t){return n[t]}}else if(ar(n)){var D=n.size();if(1!==D.length||D[0]!==a)throw new Error("Invalid matrix length");u=function(t){return n.get([t])}}else u=function(){return n};i||(i=ir(u(0))?u(0).mul(0):0);var s=[];if(t.length>0){s=aM(s,t,i);for(var T=0;T<a;T++)s[T+o][T+M]=u(T)}return new e({data:s,size:[c,N]})},e.fromJSON=function(t){return new e(t)},e.prototype.swapRows=function(t,n){if(!(rr(t)&&du(t)&&rr(n)&&du(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 NM(t,this._size[0]),NM(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 FM(){return!0}function bM(){return!1}function BM(){}var ZM=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:FM,isAny:!0};let i,u,M=0,o={createCount:0};function c(t){const n=i.get(t);if(n)return n;let e='Unknown type "'+t+'"';const r=t.toLowerCase();let M;for(M of u)if(M.toLowerCase()===r){e+='. Did you mean "'+M+'" ?';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 M=u.slice(e);u=u.slice(0,e).concat(r).concat(M);for(let t=e+r.length;t<u.length;++t)i.get(u[t]).index=t}function a(){i=new Map,u=[],M=0,N([r],!1)}function D(t){const n=u.filter(n=>{const e=i.get(n);return!e.isAny&&e.test(t)});return n.length?n:["any"]}function s(t){return t&&"function"==typeof t&&"_typedFunctionData"in t}function T(t,n,e){if(!s(t))throw new TypeError("Argument is not a typed-function.");const r=e&&e.exact,i=j(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 M=i.length;let o,c;if(r){let n;for(n in o=[],t.signatures)o.push(t._typedFunctionData.signatureMap.get(n))}else o=t._typedFunctionData.signatures;for(let t=0;t<M;++t){const n=i[t],e=[];let r;for(r of o){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(o=e,0===o.length)break}for(c of o)if(c.params.length<=M)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 I(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 l(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 j(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=I(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 h(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 FM}function z(t){let n,e,r;if(h(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]:h(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 M,o=e;for(M=0;M<n.length;M++){const t=[];if(o.forEach(e=>{const r=x(O(e.params,M));(M<e.params.length||h(e.params))&&r(n[M])&&t.push(e)}),0===t.length){if(i=f(o,M),i.length>0){const t=D(n[M]);return r=new TypeError("Unexpected type of argument in function "+u+" (expected: "+i.join(" or ")+", actual: "+t.join(" | ")+", index: "+M+")"),r.data={category:"wrongType",fn:u,index:M,actual:t,expected:i},r}}else o=t}const c=o.map((function(t){return h(t.params)?1/0:t.params.length}));if(n.length<Math.min.apply(null,c))return i=f(o,M),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(D(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 C(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 U(t){let n=M+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 d(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=C(t)-C(n);if(e<0)return-1;if(e>0)return 1;const r=U(t)-U(n);return r<0?-1:r>0?1:0}function L(t,n){const e=t.params,r=n.params,i=b(e),u=b(r),M=h(e),o=h(r);if(M&&i.hasAny){if(!o||!u.hasAny)return 1}else if(o&&u.hasAny)return-1;let c,N=0,a=0;for(c of e)c.hasAny&&++N,c.hasConversion&&++a;let D=0,s=0;for(c of r)c.hasAny&&++D,c.hasConversion&&++s;if(N!==D)return N-D;if(M&&i.hasConversion){if(!o||!u.hasConversion)return 1}else if(o&&u.hasConversion)return-1;if(a!==s)return a-s;if(M){if(!o)return 1}else if(o)return-1;const T=(e.length-r.length)*(M?-1:1);if(0!==T)return T;const g=[];let I,l=0;for(let t=0;t<e.length;++t){const n=d(e[t],r[t]);g.push(n),l+=n}if(0!==l)return l;for(I of g)if(0!==I)return I;return 0}function w(t,n){let e=n;if(t.some(t=>t.hasConversion)){const r=h(t),i=t.map(Q);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(h(t)){const n=t.length-1;r=function(){return e.apply(this,B(arguments,0,n).concat([B(arguments,n)]))}}return r}function Q(t){let n,e,r,i;const u=[],M=[];switch(t.types.forEach((function(t){t.conversion&&(u.push(c(t.conversion.from).test),M.push(t.conversion.convert))})),M.length){case 0:return function(t){return t};case 1:return n=u[0],r=M[0],function(t){return n(t)?r(t):t};case 2:return n=u[0],e=u[1],r=M[0],i=M[1],function(t){return n(t)?r(t):e(t)?i(t):t};default:return function(t){for(let n=0;n<M.length;n++)if(u[n](t))return M[n](t);return t}}}function S(t){return function t(n,e,r){if(e<n.length){const M=n[e];let o=[];if(M.restParam){const t=M.types.filter(A);t.length<M.types.length&&o.push({types:t,name:"..."+t.map(t=>t.name).join("|"),hasAny:t.some(t=>t.isAny),hasConversion:!1,restParam:!0}),o.push(M)}else o=M.types.map((function(t){return{types:[t],name:t.name,hasAny:t.isAny,hasConversion:t.conversion,restParam:!1}}));return i=o,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,M=!1;for(u of i)if(e.has(u)){M=!0;break}if(!M)return!1}const r=t.length,i=n.length,u=h(t),M=h(n);return u?M?r===i:i>=r:M?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)?Z(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 M=0;M<r.length;++M){if(i[M])continue;const o=r[M];if(G(o))r[M]=o.referToSelf.callback(e),r[M].referToSelf=o.referToSelf,i[M]=!0,t=!1;else if(W(o)){const e=v(o.referTo.references,r,n);e?(r[M]=o.referTo.callback.apply(this,e),r[M].referTo=o.referTo,i[M]=!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(o.createCount++,0===Object.keys(n).length)throw new SyntaxError("No signatures provided");o.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 M;for(M in n){if(!Object.prototype.hasOwnProperty.call(n,M))continue;const t=j(M);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 o=r.length;r.push(n[M]);const c=t.map(l);let N;for(N of S(c)){const t=g(N);u.push({params:N,name:t,fn:o}),N.every(t=>!t.hasConversion)&&(i[t]=o)}}u.sort(L);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=[],D=new Map;for(N of u)D.has(N.name)||(N.fn=c[N.fn],a.push(N),D.set(N.name,N));const s=a[0]&&a[0].params.length<=2&&!h(a[0].params),T=a[1]&&a[1].params.length<=2&&!h(a[1].params),I=a[2]&&a[2].params.length<=2&&!h(a[2].params),y=a[3]&&a[3].params.length<=2&&!h(a[3].params),O=a[4]&&a[4].params.length<=2&&!h(a[4].params),E=a[5]&&a[5].params.length<=2&&!h(a[5].params),A=s&&T&&I&&y&&O&&E;for(let t=0;t<a.length;++t)a[t].test=z(a[t].params);const f=s?x(a[0].params[0]):bM,p=T?x(a[1].params[0]):bM,C=I?x(a[2].params[0]):bM,U=y?x(a[3].params[0]):bM,d=O?x(a[4].params[0]):bM,Q=E?x(a[5].params[0]):bM,v=s?x(a[0].params[1]):bM,m=T?x(a[1].params[1]):bM,R=I?x(a[2].params[1]):bM,F=y?x(a[3].params[1]):bM,b=O?x(a[4].params[1]):bM,B=E?x(a[5].params[1]):bM;for(let t=0;t<a.length;++t)a[t].implementation=w(a[t].params,a[t].fn);const Z=s?a[0].implementation:BM,V=T?a[1].implementation:BM,W=I?a[2].implementation:BM,G=y?a[3].implementation:BM,P=O?a[4].implementation:BM,J=E?a[5].implementation:BM,H=s?a[0].params.length:-1,K=T?a[1].params.length:-1,X=I?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 o.onMismatch(t,arguments,a)};function ut(t,n){return arguments.length===H&&f(t)&&v(n)?Z.apply(this,arguments):arguments.length===K&&p(t)&&m(n)?V.apply(this,arguments):arguments.length===X&&C(t)&&R(n)?W.apply(this,arguments):arguments.length===q&&U(t)&&F(n)?G.apply(this,arguments):arguments.length===_&&d(t)&&b(n)?P.apply(this,arguments):arguments.length===$&&Q(t)&&B(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:D},ut}function R(t,n,e){throw p(t,n,e)}function F(t){return B(t,0,t.length-1)}function b(t){return t[t.length-1]}function B(t,n,e){return Array.prototype.slice.call(t,n,e)}function Z(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)&&(s(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=o;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 o=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 M,o={};if("function"==typeof r?(M=r.name,"string"==typeof r.signature?o[r.signature]=r:s(r)&&(o=r.signatures)):n(r)&&(o=r,e||(M=J(r))),0===Object.keys(o).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,M)),H(u,o)}return m(i||"",u)},o.create=t,o.createCount=K.createCount,o.onMismatch=R,o.throwMismatchError=R,o.createError=p,o.clear=a,o.clearConversions=function(){let t;for(t of u)i.get(t).conversionsTo=[];M=0},o.addTypes=N,o._findType=c,o.referTo=function(){const t=F(arguments).map(t=>g(j(t))),n=b(arguments);if("function"!=typeof n)throw new TypeError("Callback function expected as last argument");return Z(t,n)},o.referToSelf=V,o.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)},o.findSignature=T,o.find=function(t,n,e){return T(t,n,e).implementation},o.isTypedFunction=s,o.warnAgainstDeprecatedThis=!0,o.addType=function(t,n){let e="any";!1!==n&&i.has("Object")&&(e="Object"),o.addTypes([t],e)},o.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:M++})},o.addConversions=function(t){t.forEach(o.addConversion)},o.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)},o.resolve=function(t,n){if(!s(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},o}();function VM(t,n){if(JM(t)&&GM(t,n))return t[n];if("function"==typeof t[n]&&PM(t,n))throw new Error('Cannot access method "'+n+'" as a property');throw new Error('No access to property "'+n+'"')}function WM(t,n,e){if(JM(t)&&GM(t,n))return t[n]=e,e;throw new Error('No access to property "'+n+'"')}function GM(t,n){return!(!t||"object"!=typeof t)&&(!!Pr(HM,n)||!(n in Object.prototype)&&!(n in Function.prototype))}function PM(t,n){return null!=t&&"function"==typeof t[n]&&(!(Pr(t,n)&&Object.getPrototypeOf&&n in Object.getPrototypeOf(t))&&(!!Pr(KM,n)||!(n in Object.prototype)&&!(n in Function.prototype)))}function JM(t){return"object"==typeof t&&t&&t.constructor===Object}var HM={length:!0,name:!0},KM={toString:!0,valueOf:!0,toLocaleString:!0};class XM{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(t){return VM(this.wrappedObject,t)}set(t,n){return WM(this.wrappedObject,t,n),this}has(t){return n=this.wrappedObject,t in n;var n}entries(){return qM(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 qM(t,n){return{next:()=>{var e=t.next();return e.done?e:{value:n(e.value),done:!1}}}}function _M(t){return!!t&&(t instanceof Map||t instanceof XM||"function"==typeof t.set&&"function"==typeof t.get&&"function"==typeof t.keys&&"function"==typeof t.has)}var $M=function(){return $M=ZM.create,ZM},to=OM("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(t){var{BigNumber:n,Complex:e,DenseMatrix:r,Fraction:i}=t,u=$M();return u.clear(),u.addTypes([{name:"number",test:rr},{name:"Complex",test:ur},{name:"BigNumber",test:ir},{name:"Fraction",test:Mr},{name:"Unit",test:or},{name:"identifier",test:t=>cr&&/^(?:[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:cr},{name:"Chain",test:Br},{name:"Array",test:Nr},{name:"Matrix",test:ar},{name:"DenseMatrix",test:sr},{name:"SparseMatrix",test:Tr},{name:"Range",test:gr},{name:"Index",test:Ir},{name:"boolean",test:lr},{name:"ResultSet",test:yr},{name:"Help",test:jr},{name:"function",test:hr},{name:"Date",test:xr},{name:"RegExp",test:zr},{name:"null",test:Er},{name:"undefined",test:Ar},{name:"AccessorNode",test:fr},{name:"ArrayNode",test:pr},{name:"AssignmentNode",test:Cr},{name:"BlockNode",test:Ur},{name:"ConditionalNode",test:dr},{name:"ConstantNode",test:Lr},{name:"FunctionNode",test:Qr},{name:"FunctionAssignmentNode",test:wr},{name:"IndexNode",test:Sr},{name:"Node",test:kr},{name:"ObjectNode",test:vr},{name:"OperatorNode",test:Yr},{name:"ParenthesisNode",test:mr},{name:"RangeNode",test:Rr},{name:"RelationalNode",test:Fr},{name:"SymbolNode",test:br},{name:"Map",test:_M},{name:"Object",test:Or}]),u.addConversions([{from:"number",to:"BigNumber",convert:function(t){if(n||no(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||ro(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||no(t);try{return new n(t)}catch(n){throw new Error('Cannot convert "'+t+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(t){i||ro(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||no(t),new n(+t)}},{from:"boolean",to:"Fraction",convert:function(t){return i||ro(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&&Dr(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&&Dr(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 no(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 ro(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}function io(t,n,e){return t&&"function"==typeof t.map?t.map((function(t){return io(t,n,e)})):n(t)}var uo="number",Mo="number, number";function oo(t){return Math.abs(t)}function co(t,n){return t+n}function No(t,n){return t-n}function ao(t,n){return t*n}function Do(t){return-t}function so(t){return t}function To(t){return Su(t)}function go(t){return t*t*t}function Io(t){return Math.exp(t)}function lo(t){return ku(t)}function yo(t,n){if(!du(t)||!du(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 jo(t){return Qu(t)}function ho(t){return wu(t)}function xo(t){return Lu(t)}function zo(t){return t*t}function Oo(t,n){var e,r,i,u=0,M=1,o=1,c=0;if(!du(t)||!du(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=M-r*u,M=e,e=o,o=c-r*o,c=e,t=n,n=i;return t<0?[-t,-M,-c]:[t,t?M:0,c]}function Eo(t,n){return t*t<1&&n===1/0||t*t>1&&n===-1/0?0:Math.pow(t,n)}oo.signature=uo,co.signature=Mo,No.signature=Mo,ao.signature=Mo,Do.signature=uo,so.signature=uo,To.signature=uo,go.signature=uo,Io.signature=uo,lo.signature=uo,yo.signature=Mo,jo.signature=uo,ho.signature=uo,xo.signature=uo,zo.signature=uo,Oo.signature=Mo,Eo.signature=Mo;function Ao(t){return Gu(t)}function fo(t){return Math.atan(1/t)}function po(t){return isFinite(t)?(Math.log((t+1)/t)+Math.log(t/(t-1)))/2:0}function Co(t){return Math.asin(1/t)}function Uo(t){var n=1/t;return Math.log(n+Math.sqrt(n*n+1))}function Lo(t){return Math.acos(1/t)}function wo(t){var n=1/t,e=Math.sqrt(n*n-1);return Math.log(e+n)}function Qo(t){return Pu(t)}function So(t){return Ju(t)}function ko(t){return 1/Math.tan(t)}function vo(t){var n=Math.exp(2*t);return(n+1)/(n-1)}function Yo(t){return 1/Math.sin(t)}function mo(t){return 0===t?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(t)-Math.exp(-t)))*Lu(t)}function Ro(t){return 1/Math.cos(t)}function Fo(t){return 2/(Math.exp(t)+Math.exp(-t))}function bo(t){return Hu(t)}Ao.signature="number",fo.signature="number",po.signature="number",Co.signature="number",Uo.signature="number",Lo.signature="number",wo.signature="number",Qo.signature="number",So.signature="number",ko.signature="number",vo.signature="number",Yo.signature="number",mo.signature="number",Ro.signature="number",Fo.signature="number",bo.signature="number";var Bo=OM("addScalar",["typed"],t=>{var{typed:n}=t;return n("addScalar",{"number, number":co,"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 Zo="number, number";function Vo(t,n){if(!du(t)||!du(n))throw new Error("Integers expected in function bitAnd");return t&n}function Wo(t){if(!du(t))throw new Error("Integer expected in function bitNot");return~t}function Go(t,n){if(!du(t)||!du(n))throw new Error("Integers expected in function bitOr");return t|n}function Po(t,n){if(!du(t)||!du(n))throw new Error("Integers expected in function bitXor");return t^n}function Jo(t,n){if(!du(t)||!du(n))throw new Error("Integers expected in function leftShift");return t<<n}function Ho(t,n){if(!du(t)||!du(n))throw new Error("Integers expected in function rightArithShift");return t>>n}function Ko(t,n){if(!du(t)||!du(n))throw new Error("Integers expected in function rightLogShift");return t>>>n}Vo.signature=Zo,Wo.signature="number",Go.signature=Zo,Po.signature=Zo,Jo.signature=Zo,Ho.signature=Zo,Ko.signature=Zo;function Xo(t,n){if(n<t)return 1;if(n===t)return n;var e=n+t>>1;return Xo(t,e)*Xo(e+1,n)}function qo(t,n){if(!du(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(!du(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,M=n<e?e+1:n+1;M<=t;++M)for(r*=M;i<=u&&r%i==0;)r/=i,++i;return i<=u&&(r/=Xo(i,u)),r}qo.signature="number, number";var _o=OM("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=>io(n,t))})});function $o(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 tc=OM("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)})}}),nc=OM("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 Wu(t,n,e.epsilon)},"BigNumber, BigNumber":function(t,n){return t.eq(n)||$o(t,n,e.epsilon)},"Fraction, Fraction":function(t,n){return t.equals(n)},"Complex, Complex":function(t,n){return function(t,n,e){return Wu(t.re,n.re,e)&&Wu(t.im,n.im,e)}(t,n,e.epsilon)}},tc({typed:n}))});OM("equalScalar",["typed","config"],t=>{var{typed:n,config:e}=t;return n("equalScalar",{"number, number":function(t,n){return Wu(t,n,e.epsilon)}})}),Math.pow(2,53);OM("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 ec(t){return t<0}function rc(t){return t>0}function ic(t){return 0===t}function uc(t){return Number.isNaN(t)}ec.signature="number",rc.signature="number",ic.signature="number",uc.signature="number";function Mc(t){var n;if(du(t))return t<=0?isFinite(t)?1/0:NaN:t>171?1/0:Xo(1,t-1);if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*Mc(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=cc[0];for(var M=1;M<cc.length;++M)n+=cc[M]/(t+M);var o=t+oc+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,t+.5)*Math.exp(-o)*n}Mc.signature="number";var oc=4.7421875,cc=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],Nc=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function ac(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))-ac(1-t);for(var n=(t-=1)+5+.5,e=Nc[0],r=6;r>=1;r--)e+=Nc[r]/(t+r);return.9189385332046728+(t+.5)*Math.log(n)-n+Math.log(e)}ac.signature="number";var Dc=OM("multiplyScalar",["typed"],t=>{var{typed:n}=t;return n("multiplyScalar",{"number, number":ao,"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 sc(t){return!t}function Tc(t,n){return!(!t&&!n)}function gc(t,n){return!!t!=!!n}function Ic(t,n){return!(!t||!n)}sc.signature="number",Tc.signature="number, number",gc.signature="number, number",Ic.signature="number, number";OM("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 lc=e(22),yc=e.n(lc);Date.now();var jc=OM("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&&!cr(n))throw new Error("Invalid datatype: "+n);if(ar(t))!function(t,n,e){"SparseMatrix"===n.type?(t._values=n._values?Vr(n._values):void 0,t._index=Vr(n._index),t._ptr=Vr(n._ptr),t._size=Vr(n._size),t._datatype=e||n._datatype):u(t,n.valueOf(),e||n._datatype)}(this,t,n);else if(t&&Nr(t.index)&&Nr(t.ptr)&&Nr(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(Nr(t))u(this,t,n);else{if(t)throw new TypeError("Unsupported type of data ("+Zr(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,M=0,o=e,c=0;if(cr(i)&&(o=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 D=r[a];if(Nr(D)){if(0===N&&M<D.length&&(M=D.length),N<D.length){var s=D[N];o(s,c)||(t._values.push(s),t._index.push(a))}}else 0===N&&M<1&&(M=1),o(D,c)||(t._values.push(D),t._index.push(a))}N++}while(N<M)}t._ptr.push(t._index.length),t._size=[u,M]}function M(t,n){if(!Ir(n))throw new TypeError("Invalid index");if(n.isScalar())return t.get(n.min());var e,r,u,M,o=n.size();if(o.length!==t._size.length)throw new uM(o.length,t._size.length);var c=n.min(),N=n.max();for(e=0,r=t._size.length;e<r;e++)NM(c[e],t._size[e]),NM(N[e],t._size[e]);var a=t._values,D=t._index,s=t._ptr,T=n.dimension(0),g=n.dimension(1),I=[],l=[];T.forEach((function(t,n){l[t]=n[0],I[t]=!0}));var y=a?[]:void 0,j=[],h=[];return g.forEach((function(t){for(h.push(j.length),u=s[t],M=s[t+1];u<M;u++)e=D[u],!0===I[e]&&(j.push(l[e]),y&&y.push(a[u]))})),h.push(j.length),new i({values:y,index:j,ptr:h,size:o,datatype:t._datatype})}function o(t,n,e,r){if(!n||!0!==n.isIndex)throw new TypeError("Invalid index");var i,u=n.size(),M=n.isScalar();if(ar(e)?(i=e.size(),e=e.toArray()):i=oM(e),M){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 uM(u.length,t._size.length,"<");if(i.length<u.length){for(var o=0,c=0;1===u[o]&&1===i[o];)o++;for(;1===u[o];)c++,o++;e=gM(e,u.length,c,i)}if(!Gr(u,i))throw new uM(u,i,">");if(1===u.length){n.dimension(0).forEach((function(n,i){NM(n),t.set([n,0],e[i[0]],r)}))}else{var N=n.dimension(0),a=n.dimension(1);N.forEach((function(n,i){NM(n),a.forEach((function(u,M){NM(u),t.set([n,u],e[i[0]][M[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,M){i.splice(t,0,r),u.splice(t,0,n);for(var o=e+1;o<M.length;o++)M[o]++}function a(t,r,i,u){var M=u||0,o=e,c=0;cr(t._datatype)&&(o=n.find(e,[t._datatype,t._datatype])||e,c=n.convert(0,t._datatype),M=n.convert(M,t._datatype));var N,a,D,s=!o(M,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,s)for(N=0;N<T;N++)t._values.push(M),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(s){var I=0;for(a=0;a<g;a++){t._ptr[a]=t._ptr[a]+I,D=t._ptr[a+1]+I;var l=0;for(N=T;N<r;N++,l++)t._values.splice(D+l,0,M),t._index.splice(D+l,0,N),I++}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 j=t._ptr[a],h=t._ptr[a+1]-y;for(D=j;D<h;D++)(N=t._index[D])>r-1&&(t._values.splice(D,1),t._index.splice(D,1),y++)}t._ptr[a]=t._values.length}return t._size[0]=r,t._size[1]=i,t}function D(t,n,e,r,i){var u,M,o=r[0],c=r[1],N=[];for(u=0;u<o;u++)for(N[u]=[],M=0;M<c;M++)N[u][M]=0;for(M=0;M<c;M++)for(var a=e[M],D=e[M+1],s=a;s<D;s++)N[u=n[s]][M]=t?i?Vr(t[s]):t[s]: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 lM(this._values,Zr)},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 M(this,t);case 2:case 3:return o(this,t,n,e);default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.get=function(t){if(!Nr(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new uM(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];NM(n,this._size[0]),NM(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(!Nr(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new uM(t.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var u=t[0],M=t[1],o=this._size[0],D=this._size[1],s=e,T=0;cr(this._datatype)&&(s=n.find(e,[this._datatype,this._datatype])||e,T=n.convert(0,this._datatype)),(u>o-1||M>D-1)&&(a(this,Math.max(u+1,o),Math.max(M+1,D),i),o=this._size[0],D=this._size[1]),NM(u,o),NM(M,D);var g=c(u,this._ptr[M],this._ptr[M+1],this._index);return g<this._ptr[M+1]&&this._index[g]===u?s(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,M,this._values,this._index,this._ptr):this._values[g]=r:s(r,T)||N(g,u,M,r,this._values,this._index,this._ptr),this},i.prototype.resize=function(t,n,e){if(!Dr(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(!rr(t)||!du(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+nM(r)+")")})),a(e?this.clone():this,r[0],r[1],n)},i.prototype.reshape=function(t,n){if(!Nr(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(!rr(n)||!du(n)||n<=-2||0===n)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+nM(t)+")")}));var e=this._size[0]*this._size[1];if(e!==(t=sM(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 M=0;M<r._ptr[u+1]-r._ptr[u];M++)i.push(u);for(var o=r._values.slice(),a=r._index.slice(),D=0;D<r._index.length;D++){var s=a[D],T=i[D],g=s*r._size[1]+T;i[D]=g%t[1],a[D]=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 I=0;I<r._ptr.length;I++)r._ptr[I]=0;for(var l=0;l<o.length;l++){var y=a[l],j=i[l],h=o[l];N(c(y,r._ptr[j],r._ptr[j+1],r._index),y,j,h,r._values,r._index,r._ptr)}return r},i.prototype.clone=function(){return new i({values:this._values?Vr(this._values):void 0,index:Vr(this._index),ptr:Vr(this._ptr),size:Vr(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,M=this._size[0],o=this._size[1],c=LM(t);return function(t,r,u,M,o,c,N){var a=[],D=[],s=[],T=e,g=0;cr(t._datatype)&&(T=n.find(e,[t._datatype,t._datatype])||e,g=n.convert(0,t._datatype));for(var I=function(t,n,e){t=c(t,n,e),T(t,g)||(a.push(t),D.push(n))},l=M;l<=o;l++){s.push(a.length);var y=t._ptr[l],j=t._ptr[l+1];if(N)for(var h=y;h<j;h++){var x=t._index[h];x>=r&&x<=u&&I(t._values[h],x-r,l-M)}else{for(var z={},O=y;O<j;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;I(f,A-r,l-M)}}}return s.push(a.length),new i({values:a,index:D,ptr:s,size:[u-r+1,o-M+1]})}(this,0,M-1,0,o-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],M=this._ptr[i+1];if(n)for(var o=u;o<M;o++){var c=this._index[o];t(this._values[o],[c,i],this)}else{for(var N={},a=u;a<M;a++){N[this._index[a]]=this._values[a]}for(var D=0;D<e;D++){t(D in N?N[D]:0,[D,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 D(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return D(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 ["+nM(n,t)+" x "+nM(e,t)+"] density: "+nM(r,t)+"\n",u=0;u<e;u++)for(var M=this._ptr[u],o=this._ptr[u+1],c=M;c<o;c++){i+="\n ("+nM(this._index[c],t)+", "+nM(u,t)+") ==> "+(this._values?nM(this._values[c],t):"X")}return i},i.prototype.toString=function(){return nM(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(ir(t)&&(t=t.toNumber()),!rr(t)||!du(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],M=Math.min(r-e,u-n),o=[],c=[],N=[];N[0]=0;for(var a=n;a<u&&o.length<M;a++)for(var D=this._ptr[a],s=this._ptr[a+1],T=D;T<s;T++){var g=this._index[T];if(g===a-n+e){o.push(this._values[T]),c[o.length-1]=g-e;break}}return N.push(o.length),new i({values:o,index:c,ptr:N,size:[M,1]})},i.fromJSON=function(t){return new i(t)},i.diagonal=function(t,r,u,M,o){if(!Nr(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(ir(t)&&(t=t.toNumber()),!rr(t)||!du(t)||t<1)throw new Error("Size values must be positive integers");return t})),u){if(ir(u)&&(u=u.toNumber()),!rr(u)||!du(u))throw new TypeError("The parameter k must be an integer number")}else u=0;var c=e,N=0;cr(o)&&(c=n.find(e,[o,o])||e,N=n.convert(0,o));var a,D=u>0?u:0,s=u<0?-u:0,T=t[0],g=t[1],I=Math.min(T-s,g-D);if(Nr(r)){if(r.length!==I)throw new Error("Invalid value array length");a=function(t){return r[t]}}else if(ar(r)){var l=r.size();if(1!==l.length||l[0]!==I)throw new Error("Invalid matrix length");a=function(t){return r.get([t])}}else a=function(){return r};for(var y=[],j=[],h=[],x=0;x<g;x++){h.push(y.length);var z=x-D;if(z>=0&&z<I){var O=a(z);c(O,N)||(j.push(z+s),y.push(O))}}return h.push(y.length),new i({values:y,index:j,ptr:h,size:[T,g]})},i.prototype.swapRows=function(t,n){if(!(rr(t)&&du(t)&&rr(n)&&du(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 NM(t,this._size[0]),NM(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],M=r[t+1],o=u;o<M;o++)i(e[o],n[o])},i._swapRows=function(t,n,e,r,i,u){for(var M=0;M<e;M++){var o=u[M],N=u[M+1],a=c(t,o,N,i),D=c(n,o,N,i);if(a<N&&D<N&&i[a]===t&&i[D]===n){if(r){var s=r[a];r[a]=r[D],r[D]=s}}else if(a<N&&i[a]===t&&(D>=N||i[D]!==n)){var T=r?r[a]:void 0;i.splice(D,0,n),r&&r.splice(D,0,T),i.splice(D<=a?a+1:a,1),r&&r.splice(D<=a?a+1:a,1)}else if(D<N&&i[D]===n&&(a>=N||i[a]!==t)){var g=r?r[D]:void 0;i.splice(a,0,t),r&&r.splice(a,0,g),i.splice(a<=D?D+1:D,1),r&&r.splice(a<=D?D+1:D,1)}}},i},{isClass:!0});OM("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 hc=OM("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 xc(){throw new Error('No "matrix" implementation available')}var zc=OM("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:oM,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([]):xc()}})}),Oc=OM("matAlgo11xS0s",["typed","equalScalar"],t=>{var{typed:n,equalScalar:e}=t;return function(t,r,i,u){var M=t._values,o=t._index,c=t._ptr,N=t._size,a=t._datatype;if(!M)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var D,s=N[0],T=N[1],g=e,I=0,l=i;"string"==typeof a&&(D=a,g=n.find(e,[D,D]),I=n.convert(0,D),r=n.convert(r,D),l=n.find(i,[D,D]));for(var y=[],j=[],h=[],x=0;x<T;x++){h[x]=j.length;for(var z=c[x],O=c[x+1],E=z;E<O;E++){var A=o[E],f=u?l(r,M[E]):l(M[E],r);g(f,I)||(j.push(A),y.push(f))}}return h[T]=j.length,t.createSparseMatrix({values:y,index:j,ptr:h,size:[s,T],datatype:D})}}),Ec=OM("matAlgo14xDs",["typed"],t=>{var{typed:n}=t;return function(t,e,r,i){var u,M=t._data,o=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=o.length>0?function t(n,e,r,i,u,M,o){var c=[];if(e===r.length-1)for(var N=0;N<i;N++)c[N]=o?n(M,u[N]):n(u[N],M);else for(var a=0;a<i;a++)c[a]=t(n,e+1,r,r[e+1],u[a],M,o);return c}(N,0,o,o[0],M,e,i):[];return t.createDenseMatrix({data:a,size:Vr(o),datatype:u})}});OM("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 Ac=OM("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){ir(t)&&(n=!0,r[e]=t.toNumber())})),n}(t)?new i(1):1;if(function(t){t.forEach((function(t){if("number"!=typeof t||!du(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 M=[];return t.length>0?aM(M,t,e):M}});function fc(t,n,e,r){if(!(this instanceof fc))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}fc.prototype=new Error,fc.prototype.constructor=Error,fc.prototype.name="ArgumentsError",fc.prototype.isArgumentsError=!0;OM("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)}})});iM.signature="any, any";var pc=OM("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=M(t,u),N=ar(t)?t._data:t,a=ar(t)?t._datatype||t.getDataType():void 0,D=ar(u)?u._data:u,s=ar(u)?u._datatype||u.getDataType():void 0,T=2===o(t).length,g=2===o(u).length,I=e,l=r;if(a&&s&&a===s&&"string"==typeof a&&"mixed"!==a){var y=a;I=n.find(e,[y,y]),l=n.find(r,[y,y])}if(!T&&!g){for(var j=l(i(N[0]),D[0]),h=1;h<c;h++)j=I(j,l(i(N[h]),D[h]));return j}if(!T&&g){for(var x=l(i(N[0]),D[0][0]),z=1;z<c;z++)x=I(x,l(i(N[z]),D[z][0]));return x}if(T&&!g){for(var O=l(i(N[0][0]),D[0]),E=1;E<c;E++)O=I(O,l(i(N[E][0]),D[E]));return O}if(T&&g){for(var A=l(i(N[0][0]),D[0][0]),f=1;f<c;f++)A=I(A,l(i(N[f][0]),D[f][0]));return A}},"SparseMatrix, SparseMatrix":function(t,n){M(t,n);var i=t._index,u=t._values,o=n._index,c=n._values,N=0,a=e,D=r,s=0,T=0;for(;s<i.length&&T<o.length;){var g=i[s],I=o[T];g<I?s++:g>I?T++:g===I&&(N=a(N,D(u[s],c[T])),s++,T++)}return N}});function M(t,n){var e,r,i=o(t),u=o(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 o(t){return ar(t)?t.size():u(t)}}),Cc="number | BigNumber | Fraction | Matrix | Array";"".concat(Cc,", ").concat(Cc,", ...").concat(Cc);var Uc=OM("multiply",["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],t=>{var{typed:n,matrix:e,addScalar:r,multiplyScalar:i,equalScalar:u,dot:M}=t,o=Oc({typed:n,equalScalar:u}),c=Ec({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,M=t._data,o=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._size,D=e._datatype||e.getDataType(),s=o[0],T=a[1],g=r,I=i;c&&D&&c===D&&"string"==typeof c&&"mixed"!==c&&(u=c,g=n.find(r,[u,u]),I=n.find(i,[u,u]));for(var l=[],y=0;y<T;y++){for(var j=I(M[0],N[0][y]),h=1;h<s;h++)j=g(j,I(M[h],N[h][y]));l[y]=j}return t.createDenseMatrix({data:l,size:[T],datatype:c===t._datatype&&D===e._datatype?u:void 0})}(t,e)}var D=n("_multiplyMatrixVector",{"DenseMatrix, any":function(t,e){var u,M=t._data,o=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._datatype||e.getDataType(),D=o[0],s=o[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 I=[],l=0;l<D;l++){for(var y=M[l],j=g(y[0],N[0]),h=1;h<s;h++)j=T(j,g(y[h],N[h]));I[l]=j}return t.createDenseMatrix({data:I,size:[D],datatype:c===t._datatype&&a===e._datatype?u:void 0})},"SparseMatrix, any":function(t,e){var M=t._values,o=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(!M)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var a,D=e._data,s=e._datatype||e.getDataType(),T=t._size[0],g=e._size[0],I=[],l=[],y=[],j=r,h=i,x=u,z=0;N&&s&&N===s&&"string"==typeof N&&"mixed"!==N&&(a=N,j=n.find(r,[a,a]),h=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=D[A];if(!x(f,z))for(var p=c[A],C=c[A+1],U=p;U<C;U++){var d=o[U];E[d]?O[d]=j(O[d],h(f,M[U])):(E[d]=!0,l.push(d),O[d]=h(f,M[U]))}}for(var L=l.length,w=0;w<L;w++){var Q=l[w];I[w]=O[Q]}return y[1]=l.length,t.createSparseMatrix({values:I,index:l,ptr:y,size:[T,1],datatype:N===t._datatype&&s===e._datatype?a:void 0})}}),s=n("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(t,e){var u,M=t._data,o=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._size,D=e._datatype||e.getDataType(),s=o[0],T=o[1],g=a[1],I=r,l=i;c&&D&&c===D&&"string"==typeof c&&"mixed"!==c&&"mixed"!==c&&(u=c,I=n.find(r,[u,u]),l=n.find(i,[u,u]));for(var y=[],j=0;j<s;j++){var h=M[j];y[j]=[];for(var x=0;x<g;x++){for(var z=l(h[0],N[0][x]),O=1;O<T;O++)z=I(z,l(h[O],N[O][x]));y[j][x]=z}}return t.createDenseMatrix({data:y,size:[s,g],datatype:c===t._datatype&&D===e._datatype?u:void 0})},"DenseMatrix, SparseMatrix":function(t,e){var M=t._data,o=t._size,c=t._datatype||t.getDataType(),N=e._values,a=e._index,D=e._ptr,s=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,I=o[0],l=s[1],y=r,j=i,h=u,x=0;c&&T&&c===T&&"string"==typeof c&&"mixed"!==c&&(g=c,y=n.find(r,[g,g]),j=n.find(i,[g,g]),h=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:[I,l],datatype:c===t._datatype&&T===e._datatype?g:void 0}),f=0;f<l;f++){E[f]=O.length;var p=D[f],C=D[f+1];if(C>p)for(var U=0,d=0;d<I;d++){for(var L=d+1,w=void 0,Q=p;Q<C;Q++){var S=a[Q];U!==L?(w=j(M[d][S],N[Q]),U=L):w=y(w,j(M[d][S],N[Q]))}U!==L||h(w,x)||(O.push(d),z.push(w))}}return E[l]=O.length,A},"SparseMatrix, DenseMatrix":function(t,e){var M=t._values,o=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(!M)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var a,D=e._data,s=e._datatype||e.getDataType(),T=t._size[0],g=e._size[0],I=e._size[1],l=r,y=i,j=u,h=0;N&&s&&N===s&&"string"==typeof N&&"mixed"!==N&&(a=N,l=n.find(r,[a,a]),y=n.find(i,[a,a]),j=n.find(u,[a,a]),h=n.convert(0,a));for(var x=[],z=[],O=[],E=t.createSparseMatrix({values:x,index:z,ptr:O,size:[T,I],datatype:N===t._datatype&&s===e._datatype?a:void 0}),A=[],f=[],p=0;p<I;p++){O[p]=z.length;for(var C=p+1,U=0;U<g;U++){var d=D[U][p];if(!j(d,h))for(var L=c[U],w=c[U+1],Q=L;Q<w;Q++){var S=o[Q];f[S]!==C?(f[S]=C,z.push(S),A[S]=y(d,M[Q])):A[S]=l(A[S],y(d,M[Q]))}}for(var k=O[p],v=z.length,Y=k;Y<v;Y++){var m=z[Y];x[Y]=A[m]}}return O[I]=z.length,E},"SparseMatrix, SparseMatrix":function(t,e){var u,M=t._values,o=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType(),a=e._values,D=e._index,s=e._ptr,T=e._datatype||void 0===e._data?e._datatype:e.getDataType(),g=t._size[0],I=e._size[1],l=M&&a,y=r,j=i;N&&T&&N===T&&"string"==typeof N&&"mixed"!==N&&(u=N,y=n.find(r,[u,u]),j=n.find(i,[u,u]));for(var h,x,z,O,E,A,f,p,C=l?[]:void 0,U=[],d=[],L=t.createSparseMatrix({values:C,index:U,ptr:d,size:[g,I],datatype:N===t._datatype&&T===e._datatype?u:void 0}),w=l?[]:void 0,Q=[],S=0;S<I;S++){d[S]=U.length;var k=S+1;for(E=s[S],A=s[S+1],O=E;O<A;O++)if(p=D[O],l)for(x=c[p],z=c[p+1],h=x;h<z;h++)f=o[h],Q[f]!==k?(Q[f]=k,U.push(f),w[f]=j(a[O],M[h])):w[f]=y(w[f],j(a[O],M[h]));else for(x=c[p],z=c[p+1],h=x;h<z;h++)f=o[h],Q[f]!==k&&(Q[f]=k,U.push(f));if(l)for(var v=d[S],Y=U.length,m=v;m<Y;m++){var R=U[m];C[m]=w[R]}}return d[I]=U.length,L}});return n("multiply",i,{"Array, Array":n.referTo("Matrix, Matrix",t=>(n,r)=>{N(oM(n),oM(r));var i=t(e(n),e(r));return ar(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 M(t,n)}(t,n,e[0]):a(t,n):1===r.length?D(t,n):s(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 o(t,n,i,!1)},"DenseMatrix, any":function(t,n){return c(t,n,i,!1)},"any, SparseMatrix":function(t,n){return o(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 dc=AM({config:Kr}),Lc=CM({}),wc=YM({}),Qc=mM({}),Sc=RM({Matrix:Qc}),kc=to({BigNumber:dc,Complex:Lc,DenseMatrix:Sc,Fraction:wc}),vc=Bo({typed:kc}),Yc=_o({typed:kc}),mc=nc({config:Kr,typed:kc}),Rc=Dc({typed:kc}),Fc=jc({Matrix:Qc,equalScalar:mc,typed:kc}),bc=hc({DenseMatrix:Sc,Matrix:Qc,SparseMatrix:Fc,typed:kc}),Bc=zc({matrix:bc,config:Kr,typed:kc}),Zc=Ac({BigNumber:dc,config:Kr,matrix:bc,typed:kc}),Vc=pc({addScalar:vc,conj:Yc,multiplyScalar:Rc,size:Bc,typed:kc}),Wc=Uc({addScalar:vc,dot:Vc,equalScalar:mc,matrix:bc,multiplyScalar:Rc,typed:kc});function Gc(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=_e()(t);if(n&&e){var M=qc(t),o=Kc(M,e,n),c=Jc(t,o);u=_e()(c).pop()}if(r&&i){var N=[].concat(u).reverse(),a=qc(N),D=Kc(a,i,r),s=1-D,T=Jc(u,s);u=T[0]}return u}function Pc(t,n){var e=t.x-n.x,r=t.y-n.y;return Math.sqrt(e*e+r*r)}function Jc(t,n){switch(t.length){case 2:return function(t,n){var e=Hc(t,n);return[[t[0],e],[e,_e()(t).pop()]]}(t,n);case 3:return function(t,n){var e=[t[0],t[1]],r=[t[1],t[2]],i=Hc(e,n),u=Hc(r,n),M=Hc([i,u],n);return[[t[0],i,M],[M,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=Hc(e,n),M=Hc(r,n),o=Hc(i,n),c=Hc([u,M],n),N=Hc([M,o],n),a=Hc([c,N],n);return[[t[0],u,c,a],[a,N,o,t[3]]]}(t,n);default:return null}}function Hc(t,n){var e=He()(t,1)[0],r=_e()(t).pop(),i=e.x+(r.x-e.x)*n;return{y:e.y+(r.y-e.y)*n,x:i}}function Kc(t,n,e){for(var r=t.size(),i=function(t){switch(t){case 1:return Wc(Xc(1e3,1),bc([[1,0],[-1,1]]));case 2:return Wc(Xc(1e3,2),bc([[1,0,0],[-2,2,0],[1,-2,1]]));case 3:return Wc(Xc(1e3,3),bc([[1,0,0,0],[-3,3,0,0],[3,-6,3,0],[-1,3,-3,1]]));default:return null}}(He()(r,1)[0]-1),u=function(t,n){var e=-t.x,r=-t.y,i=[],u=[];n.forEach((function(t,n){switch(He()(n,2)[1]){case 0:i.push(t+e);break;case 1:u.push(t+r)}}));for(var M=[],o=0;o<i.length;o++)M.push(Math.sqrt(i[o]*i[o]+u[o]*u[o]));return M}(n,Wc(i,t)),M=u.length-1,o=0;o<u.length;o++)if(u[o]>=e){M=o;break}return.001*M}function Xc(t,n){var e=1/t,r=0,i=Zc(t+1,n+1).map((function(t,n){var i=null;switch(He()(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 bc(i)}function qc(t){var n=t.map((function(t){return[t.x,t.y]}));return bc(n)}function _c(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,M,o=2===t.length?(n=t,e=He()(n,2),r=e[0],i=e[1],u=[r.x,i.x],M=[r.y,i.y],{min:{x:Math.min.apply(0,u),y:Math.min.apply(0,M)},max:{x:Math.max.apply(0,u),y:Math.max.apply(0,M)}}):function(t){for(var n,e,r,i,u,M,o,c,N=He()(t,4),a=N[0],D=N[1],s=N[2],T=N[3],g=[],I=[],l=[],y=0;y<2;++y)if(0===y?(e=6*a.x-12*D.x+6*s.x,n=-3*a.x+9*D.x-9*s.x+3*T.x,r=3*D.x-3*a.x):(e=6*a.y-12*D.y+6*s.y,n=-3*a.y+9*D.y-9*s.y+3*T.y,r=3*D.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(o=e*e-4*r*n)<0?Math.abs(o)<1e-12&&(i=-e/(2*n))>0&&i<1&&g.push(i):(c=Math.sqrt(o),(u=(-e+c)/(2*n))>0&&u<1&&g.push(u),(M=(-e-c)/(2*n))>0&&M<1&&g.push(M));var j,h=g.length;for(;h--;)i=g[h],j=1-i,I[h]=j*j*j*a.x+3*j*j*i*D.x+3*j*i*i*s.x+i*i*i*T.x,l[h]=j*j*j*a.y+3*j*j*i*D.y+3*j*i*i*s.y+i*i*i*T.y;return I.push(a.x,T.x),l.push(a.y,T.y),{min:{x:Math.min.apply(0,I),y:Math.min.apply(0,l)},max:{x:Math.max.apply(0,I),y:Math.max.apply(0,l)}}}(t),c=2===t.length?1:0;return[{x:o.min.x,y:o.min.y-c},{x:o.max.x,y:o.min.y-c},{x:o.max.x,y:o.max.y+c},{x:o.min.x,y:o.max.y+c}]}var $c=e(3),tN=e.n($c),nN=e(0),eN=e.n(nN),rN=e(4),iN=e.n(rN),uN=function(){function t(n){Qt()(this,t),Yt()(this,"ctx",void 0),Yt()(this,"playData",void 0),Yt()(this,"options",void 0),Yt()(this,"courtTypeConstants",void 0),this.ctx=n.ctx,this.playData=n.playData,this.options=n.options?n.options:{},this.courtTypeConstants=n.courtTypeConstants}return kt()(t,[{key:"apply",value:function(){this.ctx.save(),this.drawLogic(),this.ctx.restore()}},{key:"drawLogic",value:function(){}}]),t}();function MN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var oN=function(t){iN()(e,t);var n=MN(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(uN);function cN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var NN=function(t){iN()(e,t);var n=cN(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),aN=.1667,DN=1.5,sN=2.4,TN=.55,gN=!1,IN=480,lN=460,yN="#C49463",jN=60.5,hN=127.28125,xN=60,zN=1.41667,ON=26,EN=.5,AN=4,fN=6,pN=5,CN=3.58333,UN=5,dN=37,LN=15,wN=20,QN=5,SN=2,kN=.5,vN=1.5,YN=18,mN=95,RN=390,FN=330,bN=90,BN=2.5,ZN=13;function VN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var WN=function(t){iN()(e,t);var n=VN(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:xN},n={x:this.courtCenter.x,y:xN+jN},e="transparent"===this.options.lineColor?"transparent":yN;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,mN,r,i,!1);var u=GN(n,mN,i),M=GN(n,mN,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(M.x,M.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,bN-3),this.ctx.lineTo(bN-3,bN-3),this.ctx.lineTo(bN-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-vN,YN/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,ON/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(bN,0,ZN,Math.PI/4,Math.PI+Math.PI/20,!1),this.ctx.stroke(),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(bN,bN,ZN,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(0,bN,ZN,Math.PI/4,Math.PI+Math.PI/2.2,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);function GN(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function PN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var JN=function(t){iN()(e,t);var n=PN(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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:xN};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(bN,0),this.ctx.stroke(),this.drawBaseSquare(bN,0),this.drawBaseSquare(bN+BN/2,bN-BN/2),this.drawBaseSquare(BN,bN-BN),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*FN,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,RN-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,BN),this.ctx.lineTo(-BN,BN),this.ctx.lineTo(-BN,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);function HN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var KN=function(t){iN()(e,t);var n=HN(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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:xN},e={x:n.x-zN/2,y:n.y+zN},r={x:n.x+zN/2,y:n.y+zN};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-zN/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-zN/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+zN/2),t.ctx.beginPath();var r=zN/2+EN;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,zN/2),t.ctx.lineTo(e*(r+AN),zN/2),t.ctx.lineTo(e*(r+AN),zN/2-fN),t.ctx.lineTo(e*r,zN/2-fN),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+zN/2-fN+zN/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-pN),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(CN/2),0),t.ctx.lineTo(n*(CN/2),pN),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-ON/2),t.ctx.beginPath(),t.ctx.arc(e*dN,0,UN/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*bN,-(LN+QN)),t.ctx.lineTo(e*bN,-LN),t.ctx.lineTo(e*(bN-wN),-LN),t.ctx.lineTo(e*(bN-wN),-(LN+QN)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(oN);function XN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var qN=function(t){iN()(e,t);var n=XN(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:xN+jN};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(SN/2,0),this.ctx.lineTo(SN/2,kN),this.ctx.lineTo(-SN/2,kN),this.ctx.lineTo(-SN/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);function _N(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var $N=function(t){iN()(e,t);var n=_N(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),ta=.1667,na=1.5,ea=2.4,ra=.55,ia=!1,ua=280,Ma=260,oa="#C49463",ca="#E4CCB7",Na=43,aa=127.28125,Da=25,sa=1.41667,Ta=26,ga=.5,Ia=4,la=6,ya=5,ja=3.58333,ha=5,xa=37,za=8,Oa=15,Ea=3,Aa=5,fa=1,pa=0,Ca=16,Ua=60,da=220,La=190,wa=60,Qa=2.5,Sa=13;function ka(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var va=function(t){iN()(e,t);var n=ka(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Da},n={x:this.courtCenter.x,y:Da+Na},e="transparent"===this.options.lineColor?"transparent":oa;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,Ua,r,i,!1);var u=Ya(n,Ua,i),M=Ya(n,Ua,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(M.x,M.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":ca,this.ctx.beginPath(),this.ctx.arc(n.x,n.y-pa,Ca/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,Ta/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);function Ya(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function ma(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ra=function(t){iN()(e,t);var n=ma(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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:Da};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(wa,0),this.ctx.stroke(),this.drawBaseSquare(wa,0),this.drawBaseSquare(wa+Qa/2,wa-Qa/2),this.drawBaseSquare(Qa,wa-Qa),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*La,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,da-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,Qa),this.ctx.lineTo(-Qa,Qa),this.ctx.lineTo(-Qa,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ba=function(t){iN()(e,t);var n=Fa(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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:Da},e={x:n.x-sa/2,y:n.y+sa},r={x:n.x+sa/2,y:n.y+sa};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-sa/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-sa/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+sa/2),t.ctx.beginPath();var r=sa/2+ga;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,sa/2),t.ctx.lineTo(e*(r+Ia),sa/2),t.ctx.lineTo(e*(r+Ia),sa/2-la),t.ctx.lineTo(e*r,sa/2-la),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+sa/2-la+sa/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-ya),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(ja/2),0),t.ctx.lineTo(n*(ja/2),ya),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-Ta/2),t.ctx.beginPath(),t.ctx.arc(e*xa,0,ha/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*wa,-(za+Ea)),t.ctx.lineTo(e*wa,-za),t.ctx.lineTo(e*(wa-Oa),-za),t.ctx.lineTo(e*(wa-Oa),-(za+Ea)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Za=function(t){iN()(e,t);var n=Ba(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Da+Na-fa/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(Aa/2,0),this.ctx.lineTo(Aa/2,fa),this.ctx.lineTo(-Aa/2,fa),this.ctx.lineTo(-Aa/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN),Va=300,Wa=260,Ga="#C49463",Pa="#E4CCB7",Ja=40,Ha=127.28125,Ka=25,Xa=1.41667,qa=26,_a=.5,$a=4,tD=6,nD=5,eD=3.58333,rD=5,iD=37,uD=8,MD=15,oD=3,cD=5,ND=1,aD=0,DD=16,sD=60,TD=225,gD=200,ID=60,lD=2.5,yD=13;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var hD=function(t){iN()(e,t);var n=jD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Ka},n={x:this.courtCenter.x,y:Ka+Ja},e="transparent"===this.options.lineColor?"transparent":Ga;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,sD,r,i,!1);var u=xD(n,sD,i),M=xD(n,sD,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(M.x,M.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":Pa,this.ctx.beginPath(),this.ctx.arc(n.x,n.y-aD,DD/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,qa/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);function xD(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var OD=function(t){iN()(e,t);var n=zD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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:Ka};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(ID,0),this.ctx.stroke(),this.drawBaseSquare(ID,0),this.drawBaseSquare(ID+lD/2,ID-lD/2),this.drawBaseSquare(lD,ID-lD),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*gD,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,TD-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,lD),this.ctx.lineTo(-lD,lD),this.ctx.lineTo(-lD,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);function ED(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var AD=function(t){iN()(e,t);var n=ED(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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:Ka},e={x:n.x-Xa/2,y:n.y+Xa},r={x:n.x+Xa/2,y:n.y+Xa};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-Xa/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-Xa/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+Xa/2),t.ctx.beginPath();var r=Xa/2+_a;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,Xa/2),t.ctx.lineTo(e*(r+$a),Xa/2),t.ctx.lineTo(e*(r+$a),Xa/2-tD),t.ctx.lineTo(e*r,Xa/2-tD),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+Xa/2-tD+Xa/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-nD),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(eD/2),0),t.ctx.lineTo(n*(eD/2),nD),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-qa/2),t.ctx.beginPath(),t.ctx.arc(e*iD,0,rD/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*ID,-(uD+oD)),t.ctx.lineTo(e*ID,-uD),t.ctx.lineTo(e*(ID-MD),-uD),t.ctx.lineTo(e*(ID-MD),-(uD+oD)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(oN);function fD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var pD=function(t){iN()(e,t);var n=fD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Ka+Ja-ND/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(cD/2,0),this.ctx.lineTo(cD/2,ND),this.ctx.lineTo(-cD/2,ND),this.ctx.lineTo(-cD/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var UD=function(t){iN()(e,t);var n=CD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function dD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var LD=function(t){iN()(e,t);var n=dD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function wD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var QD=function(t){iN()(e,t);var n=wD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function SD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var kD=function(t){iN()(e,t);var n=SD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function vD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var YD=function(t){iN()(e,t);var n=vD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function mD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var RD=function(t){iN()(e,t);var n=mD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function FD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var bD=function(t){iN()(e,t);var n=FD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function BD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ZD=function(t){iN()(e,t);var n=BD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function VD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var WD=function(t){iN()(e,t);var n=VD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function GD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var PD=function(t){iN()(e,t);var n=GD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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},M=Math.asin((this.courtTypeConstants.THREE_POINT_ASIN_APPROX-.75-.5)/this.courtTypeConstants.THREE_POINT_ARC_RADIUS),o=Math.PI-M;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,o,M,!0),this.ctx.lineTo(i.x,i.y),this.ctx.stroke()}}]),e}(oN),JD=.1667,HD=1.5,KD=1,XD=.33,qD=!0;function _D(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var $D=function(t){iN()(e,t);var n=_D(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),ts={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 ns(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var es=function(t){iN()(e,t);var n=ns(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}}]),e}(oN);Object.assign(es.prototype,ts);var rs=50,is=94,us=22,Ms=23.6762,os=10,cs=14,Ns=12,as=16,Ds=!0,ss=!0,Ts=!0;function gs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Is=function(t){iN()(e,t);var n=gs(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),ls=49.21,ys=91.86,js=21.65,hs=22.15,xs=6,zs=8,Os=12,Es=16.08,As=!1,fs=!1,ps=!1;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Us=function(t){iN()(e,t);var n=Cs(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}}]),e}(oN);Object.assign(Us.prototype,ts);var ds=50,Ls=94,ws=22,Qs=23.6762,Ss=10,ks=14,vs=12,Ys=16,ms=!0,Rs=!0,Fs=!0,bs={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 Bs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Zs=function(t){iN()(e,t);var n=Bs(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}}]),e}(oN);Object.assign(Zs.prototype,bs);var Vs=50,Ws=94,Gs=20.75,Ps=20.75,Js=2,Hs=6,Ks=12,Xs=12,qs=!1,_s=!1,$s=!1;function tT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var nT=function(t){iN()(e,t);var n=tT(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}}]),e}(oN);Object.assign(nT.prototype,bs);var eT=50,rT=94,iT=20.75,uT=20.75,MT=2,oT=6,cT=12,NT=12,aT=!1,DT=!1,sT=!0;function TT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var gT=function(t){iN()(e,t);var n=TT(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}}]),e}(oN);Object.assign(gT.prototype,bs);var IT=50,lT=84,yT=19.75,jT=19.75,hT=2,xT=6,zT=12,OT=12,ET=!1,AT=!1,fT=!1;function pT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var CT=function(t){iN()(e,t);var n=pT(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}}]),e}(oN);Object.assign(CT.prototype,bs);var UT=42,dT=74,LT=19.75,wT=19.75,QT=2,ST=6,kT=12,vT=12,YT=!1,mT=!1,RT=!1;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var bT=function(t){iN()(e,t);var n=FT(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}}]),e}(oN);Object.assign(bT.prototype,ts);var BT=50,ZT=94,VT=21.65,WT=22.15,GT=6,PT=9,JT=12,HT=16,KT=!0,XT=!0,qT=!0;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var $T=function(t){iN()(e,t);var n=_T(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function tg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ng=function(t){iN()(e,t);var n=tg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function eg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var rg=function(t){iN()(e,t);var n=eg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function ig(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ug=function(t){iN()(e,t);var n=ig(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Mg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var og=function(t){iN()(e,t);var n=Mg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n=[3,this.courtTypeConstants.HASH_MARK_FROM_SIDELINE_DISTANCE,this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.HASH_MARK_FROM_SIDELINE_DISTANCE-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},M={x:n+3,y:e-i};t.ctx.beginPath(),t.ctx.moveTo(u.x,u.y),t.ctx.lineTo(M.x,M.y),t.ctx.stroke()}}))},r=this.courtTypeConstants.END_ZONE_HEIGHT+15;r<=this.courtCenter.y;r+=15)e(r);this.ctx.restore()}}]),e}(oN);function cg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ng=function(t){iN()(e,t);var n=cg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),ag=.32,Dg=1.5,sg=2,Tg=.55,gg=!1,Ig=160,lg=360,yg=30,jg=53,hg=160,xg=360,zg=30,Og=70.916,Eg=160,Ag=360,fg=30,pg=60;function Cg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ug=function(t){iN()(e,t);var n=Cg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function dg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Lg=function(t){iN()(e,t);var n=dg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function wg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Qg=function(t){iN()(e,t);var n=wg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Sg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var kg=function(t){iN()(e,t);var n=Sg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Yg=function(t){iN()(e,t);var n=vg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function mg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Rg=function(t){iN()(e,t);var n=mg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Fg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var bg=function(t){iN()(e,t);var n=Fg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Bg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Zg=function(t){iN()(e,t);var n=Bg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),Vg=.1667,Wg=1.5,Gg=2,Pg=.55,Jg=!0;function Hg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Kg=function(t){iN()(e,t);var n=Hg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),Xg=85,qg=200,_g="#C8102E",$g="#0032A0",tI=64,nI=25,eI=44,rI=.75,iI=15,uI=6,MI=3,oI=4;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var NI=function(t){iN()(e,t);var n=cI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),aI=100,DI=200,sI="#C8102E",TI="#0032A0",gI=58,II=29,lI=44,yI=.75,jI=15,hI=6,xI=3,zI=5.8;function OI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var EI=function(t){iN()(e,t);var n=OI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function AI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var fI=function(t){iN()(e,t);var n=AI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),pI=.1667,CI=1.5,UI=1,dI=.33,LI=!0;function wI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var QI=function(t){iN()(e,t);var n=wI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function SI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var kI=function(t){iN()(e,t);var n=SI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function vI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var YI=function(t){iN()(e,t);var n=vI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),mI=60,RI=110,FI=10,bI=20;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ZI=function(t){iN()(e,t);var n=BI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function VI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var WI=function(t){iN()(e,t);var n=VI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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 M={x:n.x,y:n.y-2.84},o=Math.PI/4,c=Math.PI/2+Math.PI/4;this.ctx.beginPath(),this.ctx.arc(M.x,M.y,14.43,o,c,!1),this.ctx.stroke();var N=GI(M,14.43,c),a=GI(M,14.43,o),D=n.x-2.84,s=n.x+2.84;this.ctx.beginPath(),this.ctx.moveTo(N.x,N.y),this.ctx.lineTo(D,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(a.x,a.y),this.ctx.lineTo(s,n.y),this.ctx.stroke();var T={x:D-8.75,y:n.y},g={x:s+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 I=GI(M,14.43,Math.PI/2);this.ctx.beginPath(),this.ctx.moveTo(I.x,I.y-1),this.ctx.lineTo(I.x,I.y+1),this.ctx.stroke();for(var l=function(n){[1,-1].forEach((function(e){var r=Math.PI/2+Math.PI/10*e*n,i=GI(M,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++)l(y);var j={x:T.x,y:T.y-5},h={x:g.x,y:g.y-5};this.ctx.beginPath(),this.ctx.arc(j.x,j.y,.5,0,2*Math.PI,!1),this.ctx.arc(h.x,h.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}(oN);function GI(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}var PI=60,JI=130,HI=20;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var XI=function(t){iN()(e,t);var n=KI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),qI=.1667,_I=1.5,$I=1,tl=.33,nl=!0;function el(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var rl=function(t){iN()(e,t);var n=el(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ul=function(t){iN()(e,t);var n=il(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ol=function(t){iN()(e,t);var n=Ml(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Nl=function(t){iN()(e,t);var n=cl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function al(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Dl=function(t){iN()(e,t);var n=al(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),sl=85,Tl=180,gl=12,Il=12,ll=42.5;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var jl=2,hl=function(t){iN()(e,t);var n=yl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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,jl,0,2*Math.PI,!0),this.ctx.stroke(),[jl,-jl].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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var zl=function(t){iN()(e,t);var n=xl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var El=function(t){iN()(e,t);var n=Ol(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Al(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var fl=function(t){iN()(e,t);var n=Al(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),pl=85,Cl=180,Ul=12,dl=12,Ll=11,wl="Concrete";function Ql(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Sl=function(t){iN()(e,t);var n=Ql(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var vl=function(t){iN()(e,t);var n=kl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ml=function(t){iN()(e,t);var n=Yl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Rl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Fl=function(t){iN()(e,t);var n=Rl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function bl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Bl=function(t){iN()(e,t);var n=bl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Zl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Vl=function(t){iN()(e,t);var n=Zl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Gl=function(t){iN()(e,t);var n=Wl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Jl=function(t){iN()(e,t);var n=Pl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),Hl=.1667,Kl=1.5,Xl=1,ql=.33,_l=!0,$l=60,ty=110,ny=10,ey=12,ry={width:44,height:18},iy={width:8,height:2.66},uy={width:20,height:6},My=60,oy=110,cy=10,Ny=12,ay={width:44,height:18},Dy={width:8,height:2.66},sy={width:20,height:6};function Ty(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var gy=function(t){iN()(e,t);var n=Ty(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Iy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ly=function(t){iN()(e,t);var n=Iy(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var jy=function(t){iN()(e,t);var n=yy(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),hy=70,xy=115,zy=10,Oy=12,Ey={width:44,height:18},Ay={width:8,height:2.66},fy={width:20,height:6};function py(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Cy=function(t){iN()(e,t);var n=py(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Uy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var dy=function(t){iN()(e,t);var n=Uy(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),Ly=60,wy=100,Qy=10,Sy=12,ky={width:44,height:18},vy={width:8,height:2.66},Yy={width:20,height:6};function my(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ry=function(t){iN()(e,t);var n=my(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Fy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var by=function(t){iN()(e,t);var n=Fy(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),By=45,Zy=65,Vy=8,Wy=10,Gy={width:24,height:12},Py={width:6,height:2},Jy={width:8,height:4};function Hy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ky=function(t){iN()(e,t);var n=Hy(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),Xy=55,qy=80,_y=8,$y=10,tj={width:36,height:14},nj={width:6.16,height:2.16},ej={width:12,height:5};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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ij=function(t){iN()(e,t);var n=rj(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function uj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Mj=function(t){iN()(e,t);var n=uj(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var cj=function(t){iN()(e,t);var n=oj(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Nj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var aj=function(t){iN()(e,t);var n=Nj(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),Dj=.1667,sj=1.5,Tj=1,gj=.33,Ij=!0,lj=29.5,yj=59.1;function jj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var hj=function(t){iN()(e,t);var n=jj(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var zj=function(t){iN()(e,t);var n=xj(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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.setColor("#b0ab9e"),this.ctx.beginPath(),this.ctx.lineWidth=6*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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ej,Aj,fj,pj,Cj,Uj,dj,Lj,wj,Qj,Sj,kj=function(t){iN()(e,t);var n=Oj(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),vj=.1667,Yj=1.5,mj=1,Rj=.33,Fj=!0,bj=26.2467,Bj=52.4934,Zj=30,Vj=60,Wj=(Ej={},Yt()(Ej,bn,M),Yt()(Ej,Bn,a),Yt()(Ej,Qn,l),Yt()(Ej,vn,k),Yt()(Ej,Fn,F),Yt()(Ej,Yn,G),Yt()(Ej,mn,q),Yt()(Ej,Rn,rt),Yt()(Ej,Sn,It),Yt()(Ej,kn,jt),Ej),Gj=(Lj={},Yt()(Lj,bn,Yt()({},Ie,N)),Yt()(Lj,Bn,(Aj={},Yt()(Aj,le,T),Yt()(Aj,ye,I),Aj)),Yt()(Lj,Qn,(fj={},Yt()(fj,Zn,j),Yt()(fj,Vn,x),Yt()(fj,Wn,O),Yt()(fj,Gn,A),Yt()(fj,Pn,p),Yt()(fj,Jn,U),Yt()(fj,Hn,L),Yt()(fj,Kn,Q),fj)),Yt()(Lj,vn,{}),Yt()(Lj,Fn,(pj={},Yt()(pj,Te,B),Yt()(pj,ge,V),pj)),Yt()(Lj,Yn,(Cj={},Yt()(Cj,re,J),Yt()(Cj,ie,K),Cj)),Yt()(Lj,mn,(Uj={},Yt()(Uj,ue,$),Yt()(Uj,Me,nt),Uj)),Yt()(Lj,Rn,(dj={},Yt()(dj,ce,ot),Yt()(dj,Ne,Nt),Yt()(dj,ae,Dt),Yt()(dj,De,Tt),dj)),Yt()(Lj,Sn,{}),Yt()(Lj,kn,{}),Lj),Pj=(wj={},Yt()(wj,bn,o),Yt()(wj,Bn,D),Yt()(wj,Qn,y),Yt()(wj,vn,v),Yt()(wj,Fn,b),Yt()(wj,Yn,P),Yt()(wj,mn,_),Yt()(wj,Rn,it),Yt()(wj,Sn,lt),Yt()(wj,kn,ht),wj),Jj=(Qj={},Yt()(Qj,Ie,c),Yt()(Qj,le,s),Yt()(Qj,ye,g),Yt()(Qj,Zn,h),Yt()(Qj,Vn,z),Yt()(Qj,Wn,E),Yt()(Qj,Gn,f),Yt()(Qj,Pn,C),Yt()(Qj,Jn,d),Yt()(Qj,Hn,w),Yt()(Qj,Kn,S),Yt()(Qj,Xn,R),Yt()(Qj,qn,m),Yt()(Qj,$n,Y),Yt()(Qj,_n,Y),Yt()(Qj,Te,Z),Yt()(Qj,ge,W),Yt()(Qj,re,H),Yt()(Qj,ie,X),Yt()(Qj,ue,tt),Yt()(Qj,Me,et),Yt()(Qj,oe,Mt),Yt()(Qj,ce,ct),Yt()(Qj,Ne,at),Yt()(Qj,ae,st),Yt()(Qj,De,gt),Yt()(Qj,se,ut),Yt()(Qj,te,yt),Yt()(Qj,ne,xt),Yt()(Qj,ee,zt),Qj),Hj=(Sj={},Yt()(Sj,bn,{courtTypes:[Ie]}),Yt()(Sj,Bn,{courtTypes:[le,ye]}),Yt()(Sj,Qn,{courtTypes:[Zn,Vn,Wn,Gn,Pn,Jn,Hn,Kn]}),Yt()(Sj,vn,{courtTypes:[_n,Xn,qn]}),Yt()(Sj,Fn,{courtTypes:[Te,ge]}),Yt()(Sj,Yn,{courtTypes:[re,ie]}),Yt()(Sj,mn,{courtTypes:[ue,Me]}),Yt()(Sj,Rn,{courtTypes:[oe,ce,Ne,ae,De,se]}),Yt()(Sj,Sn,{courtTypes:[te]}),Yt()(Sj,kn,{courtTypes:[ne,ee]}),Sj);function Kj(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 Xj=function(){function t(n,e,r){Qt()(this,t),this.ctx=n,this.playData=e,this.options=r}return kt()(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(!Pj[this.playData.sport])throw new Error("unknown sport type constants");if(!Jj[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?Kj(Object(e),!0).forEach((function(n){Yt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Kj(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},Pj[this.playData.sport],{},Jj[this.playData.court.type])}}]),t}();function qj(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 _j(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var $j=function(t){iN()(e,t);var n=_j(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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!==(Pe.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,M=(this.playData.court.courtRect.size.height-i-1)*this.scale-r.height;this.ctx.drawImage(t,0,0,t.width,t.height,u,M,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(!Wj[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?qj(Object(e),!0).forEach((function(n){Yt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):qj(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},Wj[this.playData.sport],{},(Gj[this.playData.sport]||{})[this.playData.court.type]||{})}},{key:"background",get:function(){return this.options.background||this.courtTypeConstants.BACKGROUND||this.playData.sport}}]),e}(Xj),th=e(12),nh=e.n(th);function eh(t){var n,e=t.sport,r=t.ctx,i=t.staticData,u=t.center,M=t.puckRadius,o=t.placement,c=null==i||null===(n=i.balls)||void 0===n?void 0:n.find((function(t){return t.key===e}));if(!c)return!1;var N=.5*(2*M),a=u.x-N/2,D=u.y-N/2;if("overlapBottomRight"===o){var s=.65*M;a=u.x+s-N/2,D=u.y+s-N/2}return r.save(),r.drawImage(c.image,a,D,N,N),r.restore(),!0}var rh={maybeDrawBallAtStartPoint:function(t){var n,e,r,i,u,M,o=t.linePart,c=t.controlPoints,N=t.alreadyDrawn;if(!(null===(n=this.options)||void 0===n?void 0:n.showBallMode))return N;if(N)return!0;if("active"!==o.animationSegment)return!1;if(!(null===(e=this.line)||void 0===e?void 0:e.isBallTransferLine))return!1;var a=c[0];if(!a||!this.courtTypeConstants)return!1;var D=this.courtTypeConstants.PLAYER_TOKEN_SCALE*(null!==(r=null===(i=this.options)||void 0===i?void 0:i.playerTokenScale)&&void 0!==r?r:1),s=this.courtTypeConstants.PLAYER_TOKEN_RADIUS*D,T=((null===(u=this.options)||void 0===u?void 0:u.legacyPrintStyle)?1.2:1)*s;return eh({sport:this.playData.sport,ctx:this.ctx,staticData:null===(M=this.options)||void 0===M?void 0:M.staticData,center:{x:a.x,y:a.y},puckRadius:T,placement:"center"})},drawLineFromControlPoints:function(){var t=this;this.ctx.save(),this.setLineOptions(),this.ctx.lineJoin="round";var n=!1;this.getProcessedLinePaths().forEach((function(e){t.ctx.save(),"processed"===e.animationSegment&&t.setColor(.1),t.ctx.beginPath();var r=e.controlPoints;t.ctx.moveTo(r[0].x,r[0].y),2===r.length&&("DRIBBLE"===(t.line||t.shape||{}).type&&(t.ctx.lineCap="round"),t.ctx.lineTo(r[1].x,r[1].y)),3===r.length&&t.ctx.quadraticCurveTo(r[1].x,r[1].y,r[2].x,r[2].y),4===r.length&&t.ctx.bezierCurveTo(r[1].x,r[1].y,r[2].x,r[2].y,r[3].x,r[3].y),t.ctx.stroke(),n||(n=t.maybeDrawBallAtStartPoint({linePart:e,controlPoints:r,alreadyDrawn:n})),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},M={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(M.x,M.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),M=.5*Math.sin(i),o={x:r.x+u,y:r.y+M},c={x:r.x-u,y:r.y-M};n.drawPerpendicularLineAtCourtPoint(o,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=_e()(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=_e()(this.getProcessedLinePaths()).pop().controlPoints;return t[t.length-1]},setLineOptions:function(){}};function ih(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 uh(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?ih(Object(e),!0).forEach((function(n){Yt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ih(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function Mh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var oh=function(t){iN()(e,t);var n=Mh(e);function e(t,r){var i;return Qt()(this,e),(i=n.call(this,t)).line=r,Yt()(nh()(i),"lineWidth",void 0),Yt()(nh()(i),"debugMasking",void 0),Yt()(nh()(i),"startMaskSettings",void 0),Yt()(nh()(i),"endMaskSettings",void 0),i.lineWidth=t.lineWidth,i.debugMasking=!1,i.startMaskSettings=null,i.endMaskSettings=null,i}return kt()(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}},{key:"maybeDrawBallAtStartPoint",value:function(t){return!1}}]),kt()(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)}(this.options.linesHighlightedIds||[]).includes(this.line.id)&&(n=!0);var u=this.line.color,M=u.alpha,o=u.blue,c=u.green,N=u.red,a=n?0:Math.ceil(255*N),D=n?0:Math.ceil(255*c),s=n?255:Math.ceil(255*o),T=!!this.options.showBallMode&&!!this.options.animationGlobalProgress&&!1===this.options.showPassLinesDuringPlayback&&this.line.isBallTransferLine,g=T?0:null!=t?t:M,I="rgba(".concat(a,", ").concat(D,", ").concat(s,", ").concat(g,")");this.ctx.fillStyle=I,this.ctx.strokeStyle=I}},{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=Gc(r,t.startMaskSettings.radius,t.startMaskSettings.centerPoint),t.line.setLinePartsAdjustedAtIndex(e,uh({},n,{controlPoints:r}))),t.endMaskSettings&&(r=Gc(r,null,null,t.endMaskSettings.radius,t.endMaskSettings.centerPoint),t.line.setLinePartsAdjustedAtIndex(e,uh({},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=He()(i,1)[0];if(u.lineParts.length){var M=_e()(u.lineParts).pop(),o=_e()(M.controlPoints).pop();this.startMaskSettings={centerPoint:o,radius:3}}}}}if(this.line.playerPositionTerminus&&"SCREEN"!==this.line.type){var c=3.7,N=_e()(this.line.getLineParts()).pop(),a=_e()(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}(uN);function ch(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}Object.assign(oh.prototype,rh);var Nh=function(t){iN()(e,t);var n=ch(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"allowDrawLineCap",value:function(){return!this.line.hideLineTip&&!(this.options.magnetMode&&!this.options.animationGlobalProgress)}}]),e}(oh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Dh=function(t){iN()(e,t);var n=ah(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawArrowLineCap()}}]),e}(Nh),sh={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 $e(i[0],i[1],i[2],i[3]),M=[],o=0,c=1/u.length;o<=1;)M.push({x:u.mx(o),y:u.my(o),time:o}),o+=c;for(var N=[],a=[],D=0;D<M.length;D++)a.push(M[D]),a.length>1&&(N.push(a),a=[M[D]]);N.forEach((function(e,i){var u=He()(e,2),M=u[0],o=u[1],c={x:1.2*(o.x-M.x),y:1.2*(o.y-M.y)},a=(M.x+o.x)/2,D=(M.y+o.y)/2,s={x:-c.y,y:c.x};i%2&&(s={x:c.y,y:-c.x});var T=[M,{x:a+s.x,y:D+s.y},o];1!==t.length&&r!==t.length-1||i===N.length-1&&(T=[M,o]),n.push({controlPoints:T,lpIndex:r})}))})),n}},Th=function(t){return t===pt.SEQUENTIAL?"keyTimesSeq":"keyTimes"},gh=function(t,n){var e;return"keyTimesSeq"===n&&(null===(e=t.keyTimesSeq)||void 0===e?void 0:e.length)?t.keyTimesSeq:t.keyTimes},Ih=function(t){var n=[];return t.forEach((function(e,r){r&&n.push([t[r-1],e])})),n};function lh(t,n){if(Ft(t))return wn;var e=He()(n.controlPoints,4),r=e[0],i=e[1],u=e[2],M=e[3];return new $e(r,i,null!=u?u:null,null!=M?M:null).length/100}var yh=function(t){var n,e=t.timeline,r=t.lineAnimation,i=t.lineType,u=t.lineParts,M=null!==(n=u.length)&&void 0!==n?n:0,o=Ih(gh(r,e));if(o.length===M)return o;if(!o.length)return o;if(1===o.length&&(null==u?void 0:u.length)){var c=He()(o,1),N=He()(c[0],2),a=function(t){var n=t.start,e=t.end,r=t.lineParts,i=t.lineType,u=e-n;if(!Number.isFinite(u)||u<=0)return[[n,e]];for(var M=r.map((function(t){return lh(i,t)})),o=M.reduce((function(t,n){return t+(Number.isFinite(n)?n:0)}),0),c=o>0?M.map((function(t){return Number.isFinite(t)?t/o:0})):r.map((function(){return 1/r.length})),N=[n],a=n,D=0;D<c.length;D+=1){var s=D===c.length-1;a+=s?e-a:u*c[D],N.push(s?e:a)}return Ih(N)}({start:N[0],end:N[1],lineParts:u,lineType:i});if(a.length===M)return a}return o},jh=function(t){var n,e=t.mode,r=t.line,i=(t.players,Th(e)),u=null===(n=r.animations)||void 0===n?void 0:n[0];return u?yh({timeline:i,lineAnimation:u,lineType:r.type,lineParts:r.lineParts}):[]};function hh(t,n){var e=t.hideForStatic&&!n.inDrawingState?0:1;n.animationGlobalProgress&&(e=0,t.animations.map((function(t){var n=He()(t.keyTimes,2);return[n[0],n[1]]})).forEach((function(t){var r=He()(t,2),i=r[0],u=r[1],M=i-.03,o=i,c=u,N=u+.03;Rt.a.inRange(n.animationGlobalProgress,M,o)&&(e=10*(.03-(o-n.animationGlobalProgress))),Rt.a.inRange(n.animationGlobalProgress,i,u)&&(e=1),Rt.a.inRange(n.animationGlobalProgress,c,N)&&(e=10*(N-n.animationGlobalProgress))})));return e}function xh(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 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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Oh=function(t){iN()(e,t);var n=zh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"convertLinePartsToDribble",value:function(t){return[]}},{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawArrowLineCap()}},{key:"setLineOptions",value:function(){var t,n=this,e=_e()(this.line.getLineParts()),r=this.convertLinePartsToDribble(e),i=null!==(t=this.options.animationMode)&&void 0!==t?t:pt.SEQUENTIAL,u=jh({mode:i,line:this.line.originalData,players:this.playData.players});this.line.setLinePartsAdjusted([]),r.forEach((function(t){var e=t.controlPoints,r=t.lpIndex,i=He()(e,1)[0],M=void 0;if(n.options.animationGlobalProgress&&null!=r){var o=u[r];if(o){var c=He()(o,2),N=c[0],a=c[1];Rt.a.inRange(n.options.animationGlobalProgress,N,a)?M=bt(n.options.animationGlobalProgress,N,a)>i.time?"processed":"active":n.options.animationGlobalProgress>a&&(M="processed")}}n.line.addLinePartAdjusted(function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?xh(Object(e),!0).forEach((function(n){Yt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):xh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},t,{controlPoints:e,animationSegment:M}))}))}}]),e}(Nh);function Eh(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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}Object.assign(Oh.prototype,sh);var fh=function(t){iN()(e,t);var n=Ah(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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?Eh(Object(e),!0).forEach((function(n){Yt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Eh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},t,{controlPoints:[n[0],n[n.length-1]]})}))}}]),e}(oh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ch=function(t){iN()(e,t);var n=ph(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"setLineOptions",value:function(){this.ctx.setLineDash([1,.5])}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}}]),e}(oh);function Uh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var dh=function(t){iN()(e,t);var n=Uh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawPerpendicularLineCap()}}]),e}(Nh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var wh=function(t){iN()(e,t);var n=Lh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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";var n=!1;this.getProcessedLinePaths().forEach((function(e){t.ctx.save(),"processed"===e.animationSegment&&t.setColor(.1),t.ctx.beginPath();var r=e.controlPoints;[-.3,.3].forEach((function(n){var e=r[0].x-r[r.length-1].x,i=r[0].y-r[r.length-1].y,u=n/Math.pow(e*e+i*i,.5),M=-i*u,o=e*u,c=r.map((function(t){return{x:t.x+M,y:t.y+o}}));t.ctx.moveTo(c[0].x,c[0].y),2===r.length&&t.ctx.lineTo(c[1].x,c[1].y),3===r.length&&t.ctx.quadraticCurveTo(c[1].x,c[1].y,c[2].x,c[2].y),4===r.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()})),n||(n=t.maybeDrawBallAtStartPoint({linePart:e,controlPoints:r,alreadyDrawn:n})),t.ctx.restore()})),this.ctx.restore()}}]),e}(Nh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Sh=function(t){iN()(e,t);var n=Qh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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(Rt.a.capitalize(n.type),"LineLayer");Et[e]&&new Et[e](t,n).apply()}})),this.ctx.restore())}},{key:"lineWidth",get:function(){return this.courtTypeConstants.LINE_WIDTH}}]),e}(Xj);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var vh=function(t){iN()(e,t);var n=kh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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 t===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})),M=t.staticData.playerHats.find((function(t){return!!(null==u?void 0:u.playerHatKey)&&t.key===u.playerHatKey}));if(M){!0===M.reverse&&(t.ctx.save(),t.ctx.translate(2*r,0),t.ctx.scale(-1,1));var o=M.dX,c=M.dY;t.ctx.drawImage(M.image,r-(2-4*o),i-(1.4+2*t.radius+2.8*c),4,2.8),!0===M.reverse&&t.ctx.restore()}}if(n.possession&&t.options.showBallMode)if(t.staticData.balls.find((function(t){return t.key===Qn}))){var N=(t.options.legacyPrintStyle?1.2:1)*t.radius;eh({sport:t.playData.sport,ctx:t.ctx,staticData:t.staticData,center:{x:r,y:i},puckRadius:N,placement:"overlapBottomRight"})}}})),this.ctx.restore())}},{key:"setPlayerPuckStyle",value:function(t){var n=t.color,e=n.red,r=n.green,i=n.blue,u=n.alpha,M=0===e&&0===r&&0===i&&1===u,o=this.options.position&&t.position===this.options.position,c=o?0:Math.ceil(255*e),N=o?0:Math.ceil(255*r),a=o?255:Math.ceil(255*i),D="rgba(".concat(c,", ").concat(N,", ").concat(a,", ").concat(u,")");t.isDefender&&!o&&M&&(D="#bb271b");var s=!this.options.showBallMode||this.options.highlightPlayerPuck;t.possession&&s&&(D="rgba(255, 128, 0, ".concat(u,")")),this.options.legacyPrintStyle&&(this.ctx.lineWidth=this.courtTypeConstants.LINE_WIDTH),this.ctx.fillStyle=this.options.legacyPrintStyle?"#FFFFFF":D,this.ctx.strokeStyle=this.options.legacyPrintStyle?"#000000":D}},{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 M=u.image.width<u.image.height,o=u.image.height<u.image.width,c=M?u.image.height/u.image.width:o?u.image.width/u.image.height:1,N=2*this.radius*(M?u.image.width/u.image.height:1)*c,a=2*this.radius*(o?u.image.height/u.image.width:1)*c,D=0-(o?N/2:this.radius),s=0-(M?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,D,s,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 I=g.User_Name.split(" ").map((function(t){return t[0]})).join("").slice(0,2);T=g.Initials||I,"Jersey number"===this.options.labelsOverrideType&&g.jersey_number&&(T="".concat(g.jersey_number))}}var l=t.color.alpha,y=(3-.5*T.length)*(this.options.legacyPrintStyle?1.3:1)*this.playerScale,j=(1-.15*T.length)*(this.options.legacyPrintStyle?1.4:1)*this.playerScale;if(l){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 h=e,x=r;this.options.flipPlayerLabels&&(h=0,x=0,this.ctx.save(),this.ctx.translate(e,r),this.ctx.rotate(Math.PI)),this.ctx.fillText(T,h,x+j),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}(Xj);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var mh=function(t){iN()(e,t);var n=Yh(e);function e(t,r){var i;return Qt()(this,e),i=n.call(this,t),Yt()(nh()(i),"shape",void 0),Yt()(nh()(i),"animationAlpha",void 0),i.shape=r,i.animationAlpha=hh(r,t.options),i}return kt()(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),M=Math.ceil(255*r),o=Math.ceil(255*e);this.ctx.fillStyle="rgba(".concat(u,", ").concat(M,", ").concat(o,", ").concat(n*this.animationAlpha,")"),this.ctx.strokeStyle="rgba(".concat(u,", ").concat(M,", ").concat(o,", ").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}(uN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Fh=function(t){iN()(e,t);var n=Rh(e);function e(t,r){return Qt()(this,e),n.call(this,t,r)}return kt()(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}}]),kt()(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}(mh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}Object.assign(Fh.prototype,rh);var Bh=function(t){iN()(e,t);var n=bh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}}]),e}(Fh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Vh=function(t){iN()(e,t);var n=Zh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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(_e()(this.shape.linePart?[this.shape.linePart]:[]))}}]),e}(Fh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}Object.assign(Vh.prototype,sh);var Gh=function(t){iN()(e,t);var n=Wh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.handOffLineCap(this.getProcessedLinePaths())}}]),e}(Fh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Jh=function(t){iN()(e,t);var n=Ph(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}},{key:"setLineOptions",value:function(){this.ctx.setLineDash([1,.5])}}]),e}(Fh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Kh=function(t){iN()(e,t);var n=Hh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawPerpendicularLineCap()}}]),e}(Fh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var qh=function(t){iN()(e,t);var n=Xh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(mh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var $h=function(t){iN()(e,t);var n=_h(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(mh);function tx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var nx=function(t){iN()(e,t);var n=tx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(mh);function ex(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var rx=function(t){iN()(e,t);var n=ex(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(mh);function ix(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ux=function(t){iN()(e,t);var n=ix(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(mh);function Mx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ox=function(t){iN()(e,t);var n=Mx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(mh);function cx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Nx=function(t){iN()(e,t);var n=cx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(mh);function ax(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Dx=function(t){iN()(e,t);var n=ax(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.playData.shapes.forEach((function(n){var e=n.type.match("LINE.")?"".concat(Rt.a.capitalize(n.type.replace("LINE.","")),"Line"):Rt.a.capitalize(n.type),r="".concat(e,"ShapeLayer");At[r]&&new At[r](t,n).apply()})),this.ctx.restore()}}]),e}(Xj),sx=function(){function t(n){Qt()(this,t),Yt()(this,"originalData",void 0),Yt()(this,"adjustedData",void 0),this.originalData=JSON.parse(JSON.stringify(n)),this.adjustedData=JSON.parse(JSON.stringify(n))}return kt()(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 Tx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var gx={red:.502,green:.502,blue:.502,alpha:.35},Ix=function(t){iN()(e,t);var n=Tx(e);function e(t){var r;return Qt()(this,e),r=n.call(this,t),Yt()(nh()(r),"internalCanvas",void 0),r.internalCanvas=document.createElement("canvas"),r}return kt()(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),M=this._getLineInfo(u);if(M.width<t&&i<=r.length&&!M.hasLineBreak)i++;else{1!==i&&i--;var o=r.splice(0,i),c=this._getLineInfo(o);n.push(c),i=1;var N=!r.some((function(t){return"\n"!==t}));c.width&&M.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,M){if("\n"!==u){var o=_e()(u.matchAll(/(<player=(\d*)>)/gi)),c={text:u,width:o.length?n.internalCtx.measureText(u.replace(/<player=(\d*)>/,"")).width+2*n.playerTokenRadius:n.internalCtx.measureText(u).width};e+=c.width,M!==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},M=u.y+r.height;return i.x<=n&&n<=u.x&&i.y<=e&&e<=M}},{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")||gx}},{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}(sx);function lx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var yx=function(t){iN()(e,t);var n=lx(e);function e(){var t;Qt()(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)),Yt()(nh()(t),"animationAlpha",void 0),t}return kt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.disableMirrorMode(),this.playData.notes.forEach((function(n){t.ctx.save(),t.animationAlpha=hh(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,M=Math.ceil(255*u),o=Math.ceil(255*i),c=Math.ceil(255*r);this.ctx.fillStyle="rgba(".concat(M,", ").concat(o,", ").concat(c,", ").concat(e*this.animationAlpha,")"),this.ctx.strokeStyle="rgba(".concat(M,", ").concat(o,", ").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(Ix.NOTE_WRAP_PADDING,t.fontSize+Ix.NOTE_WRAP_PADDING+t.lineHeight*r);var u=0;i.forEach((function(n,r){var M=_e()(n.text.matchAll(/(<player=(\d*)>)/gi));M.length&&0===M[0].index&&(e.drawPlayerToken(t,u,M[0][2]),u+=2*t.playerTokenRadius),e.ctx.fillStyle="rgba(0, 0, 0, ".concat(e.animationAlpha,")");var o=M.length?n.text.replace(/(<player=(\d*)>)/gi,""):n.text;e.ctx.fillText(o,u,-t.baseLineOffset),u+=n.width,M.length&&(u-=2*t.playerTokenRadius),M.length&&M[0].index>0&&(e.drawPlayerToken(t,u,M[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}(Xj);function jx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var hx=function(t){iN()(e,t);var n=jx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(Xj);function xx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var zx=function(t){iN()(e,t);var n=xx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(Xj);function Ox(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ex=function(t){iN()(e,t);var n=Ox(e);function e(t){var r;return Qt()(this,e),r=n.call(this,t),Yt()(nh()(r),"lineParts",void 0),Yt()(nh()(r),"linePartsAdjusted",void 0),r.lineParts=t.lineParts,r.linePartsAdjusted=_e()(t.lineParts),r}return kt()(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:"addLinePartAdjusted",value:function(t){this.linePartsAdjusted.push(t)}},{key:"getLineParts",value:function(){return this.linePartsAdjusted.length?this.linePartsAdjusted:this.lineParts}},{key:"animationsByEndTime",value:function(t){return this._getAttr("animations").map((function(n){return Rt.a.last(t===pt.SEQUENTIAL&&n.keyTimesSeq||n.keyTimes)}))}},{key:"lastAnimEndTime",value:function(t){return Rt.a.max(this.animationsByEndTime(t))}},{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:"isBallTransferLine",get:function(){return Ft(this.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:"firstLinePartControlPoint",get:function(){return this.lineParts[0].controlPoints[0]}},{key:"lastLinePartControlPoint",get:function(){return _e()(_e()(this.lineParts).pop().controlPoints).pop()}}]),e}(sx);function Ax(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var fx=function(t){iN()(e,t);var n=Ax(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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")}}]),e}(sx);function px(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Cx=function(t){iN()(e,t);var n=px(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"rectWrapperContains",value:function(t){var n=He()(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=He()(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=He()(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=He()(this.rectWrapPointsTranslated,3),r=e[0],i=e[1],u=e[2],M=this.computeRectWrapPointsTranslatedForPointAtIndex(t,n),o=He()(M,4),c=o[0],N=o[1],a=o[2],D=o[3];return{scale:{x:Pc(c,N)*this.scale.x/Pc(r,i),y:Pc(N,a)*this.scale.y/Pc(i,u)},location:this.computeCenterForRect([c,N,a,D])}}},{key:"computeRectWrapPointsTranslatedForPointAtIndex",value:function(t,n){var e=this,r=Bt(t.x,t.y,this.location.x,this.location.y,-this.angle),i=this.rectWrapPointsTranslated.map((function(t){return Bt(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 Bt(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 Bt(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=Bt(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=He()(this.rectWrapPointsTranslated,3),n=t[0],e=t[1],r=t[2];return+(Pc(n,e)*Pc(e,r)).toFixed(2)}}]),e}(sx);function Ux(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var dx=function(t){iN()(e,t);var n=Ux(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"rectWrapPointsPure",get:function(){return _c(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=Bt(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}(Cx);function Lx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var wx=function(t){iN()(e,t);var n=Lx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return e}(dx);function Qx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Sx=function(t){iN()(e,t);var n=Qx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return e}(dx);function kx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var vx=function(t){iN()(e,t);var n=kx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return e}(dx);function Yx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var mx=function(t){iN()(e,t);var n=Yx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return e}(dx);function Rx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Fx=function(t){iN()(e,t);var n=Rx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return e}(dx);function bx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Bx=function(t){iN()(e,t);var n=bx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(Cx);function Zx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Vx=function(t){iN()(e,t);var n=Zx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"outerCircleRadius",get:function(){return 5}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(Cx);function Wx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Gx=function(t){iN()(e,t);var n=Wx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(Cx);function Px(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Jx=function(t){iN()(e,t);var n=Px(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(Cx);function Hx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Kx=function(t){iN()(e,t);var n=Hx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(Cx);function Xx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var qx=function(t){iN()(e,t);var n=Xx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(Cx);function _x(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var $x=function(t){iN()(e,t);var n=_x(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(Cx);function tz(t,n){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return nz(t,n);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?nz(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,M=!0,o=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return M=t.done,t},e:function(t){o=!0,u=t},f:function(){try{M||null==e.return||e.return()}finally{if(o)throw u}}}}function nz(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e<n;e++)r[e]=t[e];return r}function ez(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 rz(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?ez(Object(e),!0).forEach((function(n){Yt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ez(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}var iz=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;Qt()(this,t),this.play=n,this.phase=e,this.animationGlobalProgress=r,Yt()(this,"ctx",void 0),Yt()(this,"animationGlobalProgressPrev",void 0),this.animationGlobalProgressPrev=r,this.ctx=null}return kt()(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 $j(this.ctx,t,n).apply(),new Dx(this.ctx,t,n).apply(),new Sh(this.ctx,t,n).apply(),new vh(this.ctx,t,n).apply(),new hx(this.ctx,t,n).apply(),new zx(this.ctx,t,n).apply(),new yx(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 bt(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=Xe()($e,_e()(i.controlPoints)),M=1;M<=100;M++){var o=M/100,c=e.prepareCourtPoint({x:u.x(o),y:u.y(o)});n.push({object:r,objectPoint:c,distance:Pc(c,t)})}})),n}),[]);return Rt.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:Pc(i,t)}),n.push({object:r,objectPoint:u,distance:Pc(u,t)}),n}),[]);return Rt.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:Pc(i,t)}),n}),[]);return Rt.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:Pc(i,t)}),e}),[]);return Rt.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:Pc(i,t)}),e}),[]);return e.length?Rt.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||([$n,_n].includes(n.type)?vn:Qn)}},{key:"court",get:function(){var t=this.play.playData.court;return rz({},t,{type:t.type===$n?_n: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 rz({},this.play.options,{staticData:this.play.staticData,scale:this.play.scale,animationGlobalProgress:this.animationGlobalProgress,playAnimationDuration:this.playAnimationDuration})}},{key:"playAnimationDuration",get:function(){var t=this.play.options.animationMode;return this.play.playData.lines.reduce((function(n,e){var r=new Ex(e).lastAnimEndTime(t);return n>r?n:r}),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!==ft[Zt(t.type)]})).map((function(t){return new(ft[Zt(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 Ix(t)})):[]}},{key:"currentPhasePlayers",get:function(){var t=this,n=this.currentPhaseLines,e=this.play.options,r=e.huddleMode,i=e.magnetMode,u=e.animationMode,M=r||i?this.playDataLines:this.prevPhaseLines,o=M.filter((function(t){return["PASS","HANDOFF"].includes(t.type)}));return this.play.playData.players.map((function(e){var c=new fx(e);c.setPossession(o);var N=M.filter((function(e){return!r||!(t.phase<e.phase)&&!n.find((function(t){return t.id===e.id}))})).filter((function(t){return t.playerPositionOrigin===c.position&&t.playerPositionTerminus===c.position})),a=n.filter((function(t){return i&&t.playerPositionOrigin===c.position&&t.playerPositionTerminus===c.position})),D=a.length?a:N;if(D.length){var s=Rt.a.maxBy(D,(function(t){return t.lastAnimEndTime(u)}));if(s){var T=s.lastLinePartControlPoint;T&&(c.location=T)}}return c}))}},{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=Rt.a.takeRight(n,2)),n.map((function(t){return new Ex(t)}))}},{key:"animationProgressPlayers",get:function(){var t=this,n=this.prevAnimationLines.filter((function(t){return Ft(t.type)})),e=this.play.options.animationMode,r=this.play.playData.lines.filter((function(t){return!Ft(t.type)&&(!!t.playerPositionOrigin&&t.playerPositionOrigin===t.playerPositionTerminus)})),i=Rt.a.groupBy(r,(function(t){return t.playerPositionOrigin}));return this.play.playData.players.map((function(r){var u,M=new fx(r);M.setPossession(n);var o=null!==(u=i[M.position])&&void 0!==u?u:[];if(!o.length)return M;var c,N=null,a=tz(o);try{for(a.s();!(c=a.n()).done;){var D=c.value,s=jh({mode:e,line:D,players:t.play.playData.players});if(s.length){for(var T=new Ex(D).getLineParts(),g=0;g<s.length;g+=1){var I=He()(s[g],2),l=I[0],y=I[1];if(Rt.a.inRange(t.animationGlobalProgress,l,y)){var j=T[g];if(j){var h=t.animationProgress(l,y),x=Xe()($e,_e()(j.controlPoints));N={x:x.x(h),y:x.y(h)};break}}}if(N)break}}}catch(t){a.e(t)}finally{a.f()}if(N)return M.location=N,M;var z=o.map((function(t){return new Ex(t)})).filter((function(n){return t.animationGlobalProgress>=n.lastAnimEndTime(e)})),O=Rt.a.maxBy(z,(function(t){return t.lastAnimEndTime(e)}));return(null==O?void 0:O.lastLinePartControlPoint)&&(M.location=O.lastLinePartControlPoint),M}))}},{key:"animationProgressLines",get:function(){var t=this,n=this.play.options,e=n.linesDisplayOnMoveOnly,r=n.animationMode;return this.play.playData.lines.map((function(n){var e=new Ex(n),i=jh({mode:r,line:n,players:t.play.playData.players}),u=[];return i.forEach((function(n,r){var i=He()(n,2),M=i[0],o=i[1];if(t.animationGlobalProgressPrev<o&&t.animationGlobalProgress>=o&&window.dispatchEvent(new CustomEvent("@luceosports/play-rendering:lineAnimationFinished",{detail:{id:e.id}})),Rt.a.inRange(t.animationGlobalProgress,M,o)){if("DRIBBLE"===e.type)return u.push(rz({},e.getLineParts()[r]));var c=Jc(e.getLineParts()[r].controlPoints,t.animationProgress(M,o));u.push({controlPoints:c[0],animationSegment:"processed"}),u.push({controlPoints:c[1],animationSegment:"active"})}else t.animationGlobalProgress>o?u.push(rz({},e.getLineParts()[r],{animationSegment:"processed"})):u.push(rz({},e.getLineParts()[r]))})),e.setLinePartsAdjusted(u),t.animationGlobalProgress>e.lastAnimEndTime(r)&&(e.color=rz({},e.color,{alpha:.1})),e})).filter((function(n){var i=He()(n.animations,1)[0],u=r===pt.SEQUENTIAL&&i.keyTimesSeq||i.keyTimes,M=He()(u,1)[0],o=_e()(u).reverse(),c=He()(o,1)[0],N=Rt.a.inRange(t.animationGlobalProgress,M,c);return e?N:N||t.animationGlobalProgress>c||n.phase===t.phase}))}},{key:"playDataLines",get:function(){return this.play.playData.lines.map((function(t){return new Ex(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,n=this.play.options.animationMode;return this.playDataLines.filter((function(e){return t.animationGlobalProgress>=e.lastAnimEndTime(n)}))}}]),t}();function uz(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 Mz(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?uz(Object(e),!0).forEach((function(n){Yt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):uz(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}var oz=function(){function t(n,e){Qt()(this,t),this.ctx=n,Yt()(this,"play",void 0),Yt()(this,"playBase",void 0),Yt()(this,"animationFrame",void 0),Yt()(this,"loopId",void 0),Yt()(this,"running",void 0),Yt()(this,"framesLoadTime",void 0),Yt()(this,"timeStart",void 0),Yt()(this,"timeElapsed",void 0),Yt()(this,"timeElapsedSaved",void 0),this.play=Rt.a.cloneDeep(e),this.playBase=Rt.a.cloneDeep(e),this.animationFrame=new iz(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 kt()(t,[{key:"setOptions",value:function(t){return this.play.options=Mz({},this.play.options,{},t),this.playBase.options=Mz({},this.playBase.options,{},t),this.animationFrame=new iz(this.play,this.currentPlayPhase,this.globalProgress).setContext(this.ctx),this.running||this.animationFrame.setPhase(this.currentPlayPhase).setAnimationGlobalProgress(this.globalProgress).draw(),this}},{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 iz(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=Rt.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(this.timeElapsed||0)/(1e3*this.animationDuration)}},{key:"currentPlayPhase",get:function(){var t=this,n=Object.entries(this.linesPhaseIntervals).find((function(n){var e=He()(n,2)[1];return Rt.a.inRange(t.globalProgress,e.min,e.max)}));return parseInt(n?n[0]:Object.keys(this.linesPhaseIntervals).pop())}},{key:"linesPhaseIntervals",get:function(){var t={},n=this.play.options.animationMode;return this.play.playData.lines.forEach((function(e){t[e.phase]||(t[e.phase]={min:0,max:0}),e.animations.forEach((function(r){var i="SEQUENTIAL"===n?r.keyTimesSeq||[]:r.keyTimes,u=He()(i,1)[0],M=_e()(i).pop();(u<t[e.phase].min||!t[e.phase].min&&e.phase>1)&&(t[e.phase].min=u),M>t[e.phase].max&&(t[e.phase].max=M)}))})),t}},{key:"lastLineAnimationMax",get:function(){var t=this.play.options.animationMode;return this.play.playData.lines.reduce((function(n,e){var r=new Ex(e);return n>r.lastAnimEndTime(t)?n:r.lastAnimEndTime(t)}),0)}}]),t}()}])}));
|
|
23
|
+
var Xr,qr,_r=9e15,$r="0123456789abcdef",ti="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",ni="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",ei={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-_r,maxE:_r,crypto:!1},ri=!0,ii="[DecimalError] Invalid argument: ",ui="[object Decimal]",Mi=Math.floor,oi=Math.pow,ci=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Ni=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,ai=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Di=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,si=1e7,Ti=ti.length-1,gi=ni.length-1,Ii={toStringTag:ui};function li(t){var n,e,r,i=t.length-1,u="",M=t[0];if(i>0){for(u+=M,n=1;n<i;n++)(e=7-(r=t[n]+"").length)&&(u+=Ci(e)),u+=r;(e=7-(r=(M=t[n])+"").length)&&(u+=Ci(e))}else if(0===M)return"0";for(;M%10==0;)M/=10;return u+M}function yi(t,n,e){if(t!==~~t||t<n||t>e)throw Error(ii+t)}function ji(t,n,e,r){var i,u,M,o;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=oi(10,7-n),o=t[i]%u|0,null==r?n<3?(0==n?o=o/100|0:1==n&&(o=o/10|0),M=e<4&&99999==o||e>3&&49999==o||5e4==o||0==o):M=(e<4&&o+1==u||e>3&&o+1==u/2)&&(t[i+1]/u/100|0)==oi(10,n-2)-1||(o==u/2||0==o)&&0==(t[i+1]/u/100|0):n<4?(0==n?o=o/1e3|0:1==n?o=o/100|0:2==n&&(o=o/10|0),M=(r||e<4)&&9999==o||!r&&e>3&&4999==o):M=((r||e<4)&&o+1==u||!r&&e>3&&o+1==u/2)&&(t[i+1]/u/1e3|0)==oi(10,n-3)-1,M}function hi(t,n,e){for(var r,i,u=[0],M=0,o=t.length;M<o;){for(i=u.length;i--;)u[i]*=n;for(u[0]+=$r.indexOf(t.charAt(M++)),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()}Ii.absoluteValue=Ii.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),zi(t)},Ii.ceil=function(){return zi(new this.constructor(this),this.e+1,2)},Ii.clampedTo=Ii.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(ii+n);return e.cmp(t)<0?t:e.cmp(n)>0?n:new r(e)},Ii.comparedTo=Ii.cmp=function(t){var n,e,r,i,u=this,M=u.d,o=(t=new u.constructor(t)).d,c=u.s,N=t.s;if(!M||!o)return c&&N?c!==N?c:M===o?0:!M^c<0?1:-1:NaN;if(!M[0]||!o[0])return M[0]?c:o[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=M.length)<(i=o.length)?r:i;n<e;++n)if(M[n]!==o[n])return M[n]>o[n]^c<0?1:-1;return r===i?0:r>i^c<0?1:-1},Ii.cosine=Ii.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/mi(4,e)).toString()):(e=16,i="2.3283064365386962890625e-10");t.precision+=e,n=Yi(t,1,n.times(i),new t(1));for(var u=e;u--;){var M=n.times(n);n=M.times(M).minus(M).times(8).plus(1)}return t.precision-=e,n}(r,Ri(r,e)),r.precision=t,r.rounding=n,zi(2==qr||3==qr?e.neg():e,t,n,!0)):new r(1):new r(NaN)},Ii.cubeRoot=Ii.cbrt=function(){var t,n,e,r,i,u,M,o,c,N,a=this,D=a.constructor;if(!a.isFinite()||a.isZero())return new D(a);for(ri=!1,(u=a.s*oi(a.s*a,1/3))&&Math.abs(u)!=1/0?r=new D(u.toString()):(e=li(a.d),(u=((t=a.e)-e.length+1)%3)&&(e+=1==u||-2==u?"0":"00"),u=oi(e,1/3),t=Mi((t+1)/3)-(t%3==(t<0?-1:2)),(r=new D(e=u==1/0?"5e"+t:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+t)).s=a.s),M=(t=D.precision)+3;;)if(N=(c=(o=r).times(o).times(o)).plus(a),r=xi(N.plus(a).times(o),N.plus(c),M+2,1),li(o.d).slice(0,M)===(e=li(r.d)).slice(0,M)){if("9999"!=(e=e.slice(M-3,M+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(zi(r,t+1,1),n=!r.times(r).times(r).eq(a));break}if(!i&&(zi(o,t+1,0),o.times(o).times(o).eq(a))){r=o;break}M+=4,i=1}return ri=!0,zi(r,t,D.rounding,n)},Ii.decimalPlaces=Ii.dp=function(){var t,n=this.d,e=NaN;if(n){if(e=7*((t=n.length-1)-Mi(this.e/7)),t=n[t])for(;t%10==0;t/=10)e--;e<0&&(e=0)}return e},Ii.dividedBy=Ii.div=function(t){return xi(this,new this.constructor(t))},Ii.dividedToIntegerBy=Ii.divToInt=function(t){var n=this.constructor;return zi(xi(this,new n(t),0,1,1),n.precision,n.rounding)},Ii.equals=Ii.eq=function(t){return 0===this.cmp(t)},Ii.floor=function(){return zi(new this.constructor(this),this.e+1,3)},Ii.greaterThan=Ii.gt=function(t){return this.cmp(t)>0},Ii.greaterThanOrEqualTo=Ii.gte=function(t){var n=this.cmp(t);return 1==n||0===n},Ii.hyperbolicCosine=Ii.cosh=function(){var t,n,e,r,i,u=this,M=u.constructor,o=new M(1);if(!u.isFinite())return new M(u.s?1/0:NaN);if(u.isZero())return o;e=M.precision,r=M.rounding,M.precision=e+Math.max(u.e,u.sd())+4,M.rounding=1,(i=u.d.length)<32?n=(1/mi(4,t=Math.ceil(i/3))).toString():(t=16,n="2.3283064365386962890625e-10"),u=Yi(M,1,u.times(n),new M(1),!0);for(var c,N=t,a=new M(8);N--;)c=u.times(u),u=o.minus(c.times(a.minus(c.times(a))));return zi(u,M.precision=e,M.rounding=r,!0)},Ii.hyperbolicSine=Ii.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=Yi(u,2,i,i,!0);else{t=(t=1.4*Math.sqrt(r))>16?16:0|t,i=Yi(u,2,i=i.times(1/mi(5,t)),i,!0);for(var M,o=new u(5),c=new u(16),N=new u(20);t--;)M=i.times(i),i=i.times(o.plus(M.times(c.times(M).plus(N))))}return u.precision=n,u.rounding=e,zi(i,n,e,!0)},Ii.hyperbolicTangent=Ii.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,xi(e.sinh(),e.cosh(),r.precision=t,r.rounding=n)):new r(e.s)},Ii.inverseCosine=Ii.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()?fi(e,i,u):new e(0):new e(NaN):n.isZero()?fi(e,i+4,u).times(.5):(e.precision=i+6,e.rounding=1,n=n.asin(),t=fi(e,i+4,u).times(.5),e.precision=i,e.rounding=u,t.minus(n))},Ii.inverseHyperbolicCosine=Ii.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,ri=!1,e=e.times(e).minus(1).sqrt().plus(e),ri=!0,r.precision=t,r.rounding=n,e.ln()):new r(e)},Ii.inverseHyperbolicSine=Ii.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,ri=!1,e=e.times(e).plus(1).sqrt().plus(e),ri=!0,r.precision=t,r.rounding=n,e.ln())},Ii.inverseHyperbolicTangent=Ii.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?zi(new u(i),t,n,!0):(u.precision=e=r-i.e,i=xi(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)},Ii.inverseSine=Ii.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=fi(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)))},Ii.inverseTangent=Ii.atan=function(){var t,n,e,r,i,u,M,o,c,N=this,a=N.constructor,D=a.precision,s=a.rounding;if(N.isFinite()){if(N.isZero())return new a(N);if(N.abs().eq(1)&&D+4<=gi)return(M=fi(a,D+4,s).times(.25)).s=N.s,M}else{if(!N.s)return new a(NaN);if(D+4<=gi)return(M=fi(a,D+4,s).times(.5)).s=N.s,M}for(a.precision=o=D+10,a.rounding=1,t=e=Math.min(28,o/7+2|0);t;--t)N=N.div(N.times(N).plus(1).sqrt().plus(1));for(ri=!1,n=Math.ceil(o/7),r=1,c=N.times(N),M=new a(N),i=N;-1!==t;)if(i=i.times(c),u=M.minus(i.div(r+=2)),i=i.times(c),void 0!==(M=u.plus(i.div(r+=2))).d[n])for(t=n;M.d[t]===u.d[t]&&t--;);return e&&(M=M.times(2<<e-1)),ri=!0,zi(M,a.precision=D,a.rounding=s,!0)},Ii.isFinite=function(){return!!this.d},Ii.isInteger=Ii.isInt=function(){return!!this.d&&Mi(this.e/7)>this.d.length-2},Ii.isNaN=function(){return!this.s},Ii.isNegative=Ii.isNeg=function(){return this.s<0},Ii.isPositive=Ii.isPos=function(){return this.s>0},Ii.isZero=function(){return!!this.d&&0===this.d[0]},Ii.lessThan=Ii.lt=function(t){return this.cmp(t)<0},Ii.lessThanOrEqualTo=Ii.lte=function(t){return this.cmp(t)<1},Ii.logarithm=Ii.log=function(t){var n,e,r,i,u,M,o,c,N=this.constructor,a=N.precision,D=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(ri=!1,M=Qi(this,o=a+5),r=n?Ai(N,o+10):Qi(t,o),ji((c=xi(M,r,o,1)).d,i=a,D))do{if(M=Qi(this,o+=10),r=n?Ai(N,o+10):Qi(t,o),c=xi(M,r,o,1),!u){+li(c.d).slice(i+1,i+15)+1==1e14&&(c=zi(c,a+1,0));break}}while(ji(c.d,i+=10,D));return ri=!0,zi(c,a,D)},Ii.minus=Ii.sub=function(t){var n,e,r,i,u,M,o,c,N,a,D,s,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,s=t.d,o=g.precision,c=g.rounding,!N[0]||!s[0]){if(s[0])t.s=-t.s;else{if(!N[0])return new g(3===c?-0:0);t=new g(T)}return ri?zi(t,o,c):t}if(e=Mi(t.e/7),a=Mi(T.e/7),N=N.slice(),u=a-e){for((D=u<0)?(n=N,u=-u,M=s.length):(n=s,e=a,M=N.length),u>(r=Math.max(Math.ceil(o/7),M)+2)&&(u=r,n.length=1),n.reverse(),r=u;r--;)n.push(0);n.reverse()}else{for((D=(r=N.length)<(M=s.length))&&(M=r),r=0;r<M;r++)if(N[r]!=s[r]){D=N[r]<s[r];break}u=0}for(D&&(n=N,N=s,s=n,t.s=-t.s),M=N.length,r=s.length-M;r>0;--r)N[M++]=0;for(r=s.length;r>u;){if(N[--r]<s[r]){for(i=r;i&&0===N[--i];)N[i]=si-1;--N[i],N[r]+=si}N[r]-=s[r]}for(;0===N[--M];)N.pop();for(;0===N[0];N.shift())--e;return N[0]?(t.d=N,t.e=Ei(N,e),ri?zi(t,o,c):t):new g(3===c?-0:0)},Ii.modulo=Ii.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]?zi(new r(e),r.precision,r.rounding):(ri=!1,9==r.modulo?(n=xi(e,t.abs(),0,3,1)).s*=t.s:n=xi(e,t,0,r.modulo,1),n=n.times(t),ri=!0,e.minus(n))},Ii.naturalExponential=Ii.exp=function(){return wi(this)},Ii.naturalLogarithm=Ii.ln=function(){return Qi(this)},Ii.negated=Ii.neg=function(){var t=new this.constructor(this);return t.s=-t.s,zi(t)},Ii.plus=Ii.add=function(t){var n,e,r,i,u,M,o,c,N,a,D=this,s=D.constructor;if(t=new s(t),!D.d||!t.d)return D.s&&t.s?D.d||(t=new s(t.d||D.s===t.s?D:NaN)):t=new s(NaN),t;if(D.s!=t.s)return t.s=-t.s,D.minus(t);if(N=D.d,a=t.d,o=s.precision,c=s.rounding,!N[0]||!a[0])return a[0]||(t=new s(D)),ri?zi(t,o,c):t;if(u=Mi(D.e/7),r=Mi(t.e/7),N=N.slice(),i=u-r){for(i<0?(e=N,i=-i,M=a.length):(e=a,r=u,M=N.length),i>(M=(u=Math.ceil(o/7))>M?u+1:M+1)&&(i=M,e.length=1),e.reverse();i--;)e.push(0);e.reverse()}for((M=N.length)-(i=a.length)<0&&(i=M,e=a,a=N,N=e),n=0;i;)n=(N[--i]=N[i]+a[i]+n)/si|0,N[i]%=si;for(n&&(N.unshift(n),++r),M=N.length;0==N[--M];)N.pop();return t.d=N,t.e=Ei(N,r),ri?zi(t,o,c):t},Ii.precision=Ii.sd=function(t){var n,e=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(ii+t);return e.d?(n=pi(e.d),t&&e.e+1>n&&(n=e.e+1)):n=NaN,n},Ii.round=function(){var t=this,n=t.constructor;return zi(new n(t),t.e+1,n.rounding)},Ii.sine=Ii.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:Yi(t,2,n,n);e=(e=1.4*Math.sqrt(r))>16?16:0|e,n=n.times(1/mi(5,e)),n=Yi(t,2,n,n);for(var i,u=new t(5),M=new t(16),o=new t(20);e--;)i=n.times(n),n=n.times(u.plus(i.times(M.times(i).minus(o))));return n}(r,Ri(r,e)),r.precision=t,r.rounding=n,zi(qr>2?e.neg():e,t,n,!0)):new r(NaN)},Ii.squareRoot=Ii.sqrt=function(){var t,n,e,r,i,u,M=this,o=M.d,c=M.e,N=M.s,a=M.constructor;if(1!==N||!o||!o[0])return new a(!N||N<0&&(!o||o[0])?NaN:o?M:1/0);for(ri=!1,0==(N=Math.sqrt(+M))||N==1/0?(((n=li(o)).length+c)%2==0&&(n+="0"),N=Math.sqrt(n),c=Mi((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(xi(M,u,e+2,1)).times(.5),li(u.d).slice(0,e)===(n=li(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))||(zi(r,c+1,1),t=!r.times(r).eq(M));break}if(!i&&(zi(u,c+1,0),u.times(u).eq(M))){r=u;break}e+=4,i=1}return ri=!0,zi(r,c,a.rounding,t)},Ii.tangent=Ii.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=xi(e,new r(1).minus(e.times(e)).sqrt(),t+10,0),r.precision=t,r.rounding=n,zi(2==qr||4==qr?e.neg():e,t,n,!0)):new r(NaN)},Ii.times=Ii.mul=function(t){var n,e,r,i,u,M,o,c,N,a=this,D=a.constructor,s=a.d,T=(t=new D(t)).d;if(t.s*=a.s,!(s&&s[0]&&T&&T[0]))return new D(!t.s||s&&!s[0]&&!T||T&&!T[0]&&!s?NaN:s&&T?0*t.s:t.s/0);for(e=Mi(a.e/7)+Mi(t.e/7),(c=s.length)<(N=T.length)&&(u=s,s=T,T=u,M=c,c=N,N=M),u=[],r=M=c+N;r--;)u.push(0);for(r=N;--r>=0;){for(n=0,i=c+r;i>r;)o=u[i]+T[r]*s[i-r-1]+n,u[i--]=o%si|0,n=o/si|0;u[i]=(u[i]+n)%si|0}for(;!u[--M];)u.pop();return n?++e:u.shift(),t.d=u,t.e=Ei(u,e),ri?zi(t,D.precision,D.rounding):t},Ii.toBinary=function(t,n){return Fi(this,2,t,n)},Ii.toDecimalPlaces=Ii.toDP=function(t,n){var e=this,r=e.constructor;return e=new r(e),void 0===t?e:(yi(t,0,1e9),void 0===n?n=r.rounding:yi(n,0,8),zi(e,t+e.e+1,n))},Ii.toExponential=function(t,n){var e,r=this,i=r.constructor;return void 0===t?e=Oi(r,!0):(yi(t,0,1e9),void 0===n?n=i.rounding:yi(n,0,8),e=Oi(r=zi(new i(r),t+1,n),!0,t+1)),r.isNeg()&&!r.isZero()?"-"+e:e},Ii.toFixed=function(t,n){var e,r,i=this,u=i.constructor;return void 0===t?e=Oi(i):(yi(t,0,1e9),void 0===n?n=u.rounding:yi(n,0,8),e=Oi(r=zi(new u(i),t+i.e+1,n),!1,t+r.e+1)),i.isNeg()&&!i.isZero()?"-"+e:e},Ii.toFraction=function(t){var n,e,r,i,u,M,o,c,N,a,D,s,T=this,g=T.d,I=T.constructor;if(!g)return new I(T);if(N=e=new I(1),r=c=new I(0),M=(u=(n=new I(r)).e=pi(g)-T.e-1)%7,n.d[0]=oi(10,M<0?7+M:M),null==t)t=u>0?n:N;else{if(!(o=new I(t)).isInt()||o.lt(N))throw Error(ii+o);t=o.gt(n)?u>0?n:N:o}for(ri=!1,o=new I(li(g)),a=I.precision,I.precision=u=7*g.length*2;D=xi(o,n,0,1,1),1!=(i=e.plus(D.times(r))).cmp(t);)e=r,r=i,i=N,N=c.plus(D.times(i)),c=i,i=n,n=o.minus(D.times(i)),o=i;return i=xi(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,s=xi(N,r,u,1).minus(T).abs().cmp(xi(c,e,u,1).minus(T).abs())<1?[N,r]:[c,e],I.precision=a,ri=!0,s},Ii.toHexadecimal=Ii.toHex=function(t,n){return Fi(this,16,t,n)},Ii.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:yi(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]?(ri=!1,e=xi(e,t,0,n,1).times(t),ri=!0,zi(e)):(t.s=e.s,e=t),e},Ii.toNumber=function(){return+this},Ii.toOctal=function(t,n){return Fi(this,8,t,n)},Ii.toPower=Ii.pow=function(t){var n,e,r,i,u,M,o=this,c=o.constructor,N=+(t=new c(t));if(!(o.d&&t.d&&o.d[0]&&t.d[0]))return new c(oi(+o,N));if((o=new c(o)).eq(1))return o;if(r=c.precision,u=c.rounding,t.eq(1))return zi(o,r,u);if((n=Mi(t.e/7))>=t.d.length-1&&(e=N<0?-N:N)<=9007199254740991)return i=Ui(c,o,e,r),t.s<0?new c(1).div(i):zi(i,r,u);if((M=o.s)<0){if(n<t.d.length-1)return new c(NaN);if(0==(1&t.d[n])&&(M=1),0==o.e&&1==o.d[0]&&1==o.d.length)return o.s=M,o}return(n=0!=(e=oi(+o,N))&&isFinite(e)?new c(e+"").e:Mi(N*(Math.log("0."+li(o.d))/Math.LN10+o.e+1)))>c.maxE+1||n<c.minE-1?new c(n>0?M/0:0):(ri=!1,c.rounding=o.s=1,e=Math.min(12,(n+"").length),(i=wi(t.times(Qi(o,r+e)),r)).d&&ji((i=zi(i,r+5,1)).d,r,u)&&(n=r+10,+li((i=zi(wi(t.times(Qi(o,n+e)),n),n+5,1)).d).slice(r+1,r+15)+1==1e14&&(i=zi(i,r+1,0))),i.s=M,ri=!0,c.rounding=u,zi(i,r,u))},Ii.toPrecision=function(t,n){var e,r=this,i=r.constructor;return void 0===t?e=Oi(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(yi(t,1,1e9),void 0===n?n=i.rounding:yi(n,0,8),e=Oi(r=zi(new i(r),t,n),t<=r.e||r.e<=i.toExpNeg,t)),r.isNeg()&&!r.isZero()?"-"+e:e},Ii.toSignificantDigits=Ii.toSD=function(t,n){var e=this.constructor;return void 0===t?(t=e.precision,n=e.rounding):(yi(t,1,1e9),void 0===n?n=e.rounding:yi(n,0,8)),zi(new e(this),t,n)},Ii.toString=function(){var t=this,n=t.constructor,e=Oi(t,t.e<=n.toExpNeg||t.e>=n.toExpPos);return t.isNeg()&&!t.isZero()?"-"+e:e},Ii.truncated=Ii.trunc=function(){return zi(new this.constructor(this),this.e+1,1)},Ii.valueOf=Ii.toJSON=function(){var t=this,n=t.constructor,e=Oi(t,t.e<=n.toExpNeg||t.e>=n.toExpPos);return t.isNeg()?"-"+e:e};var xi=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,M,o,c){var N,a,D,s,T,g,I,l,y,j,h,x,z,O,E,A,f,p,C,U,d=r.constructor,L=r.s==i.s?1:-1,w=r.d,Q=i.d;if(!(w&&w[0]&&Q&&Q[0]))return new d(r.s&&i.s&&(w?!Q||w[0]!=Q[0]:Q)?w&&0==w[0]||!Q?0*L:L/0:NaN);for(c?(T=1,a=r.e-i.e):(c=si,T=7,a=Mi(r.e/T)-Mi(i.e/T)),C=Q.length,f=w.length,j=(y=new d(L)).d=[],D=0;Q[D]==(w[D]||0);D++);if(Q[D]>(w[D]||0)&&a--,null==u?(O=u=d.precision,M=d.rounding):O=o?u+(r.e-i.e)+1:u,O<0)j.push(1),g=!0;else{if(O=O/T+2|0,D=0,1==C){for(s=0,Q=Q[0],O++;(D<f||s)&&O--;D++)E=s*c+(w[D]||0),j[D]=E/Q|0,s=E%Q|0;g=s||D<f}else{for((s=c/(Q[0]+1)|0)>1&&(Q=t(Q,s,c),w=t(w,s,c),C=Q.length,f=w.length),A=C,x=(h=w.slice(0,C)).length;x<C;)h[x++]=0;(U=Q.slice()).unshift(0),p=Q[0],Q[1]>=c/2&&++p;do{s=0,(N=n(Q,h,C,x))<0?(z=h[0],C!=x&&(z=z*c+(h[1]||0)),(s=z/p|0)>1?(s>=c&&(s=c-1),1==(N=n(I=t(Q,s,c),h,l=I.length,x=h.length))&&(s--,e(I,C<l?U:Q,l,c))):(0==s&&(N=s=1),I=Q.slice()),(l=I.length)<x&&I.unshift(0),e(h,I,x,c),-1==N&&(N=n(Q,h,C,x=h.length))<1&&(s++,e(h,C<x?U:Q,x,c)),x=h.length):0===N&&(s++,h=[0]),j[D++]=s,N&&h[0]?h[x++]=w[A]||0:(h=[w[A]],x=1)}while((A++<f||void 0!==h[0])&&O--);g=void 0!==h[0]}j[0]||j.shift()}if(1==T)y.e=a,Xr=g;else{for(D=1,s=j[0];s>=10;s/=10)D++;y.e=D+a*T-1,zi(y,o?u+y.e+1:u,M,g)}return y}}();function zi(t,n,e,r){var i,u,M,o,c,N,a,D,s,T=t.constructor;t:if(null!=n){if(!(D=t.d))return t;for(i=1,o=D[0];o>=10;o/=10)i++;if((u=n-i)<0)u+=7,M=n,c=(a=D[s=0])/oi(10,i-M-1)%10|0;else if((s=Math.ceil((u+1)/7))>=(o=D.length)){if(!r)break t;for(;o++<=s;)D.push(0);a=c=0,i=1,M=(u%=7)-7+1}else{for(a=o=D[s],i=1;o>=10;o/=10)i++;c=(M=(u%=7)-7+i)<0?0:a/oi(10,i-M-1)%10|0}if(r=r||n<0||void 0!==D[s+1]||(M<0?a:a%oi(10,i-M-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?M>0?a/oi(10,i-M):0:D[s-1])%10&1||e==(t.s<0?8:7)),n<1||!D[0])return D.length=0,N?(n-=t.e+1,D[0]=oi(10,(7-n%7)%7),t.e=-n||0):D[0]=t.e=0,t;if(0==u?(D.length=s,o=1,s--):(D.length=s+1,o=oi(10,7-u),D[s]=M>0?(a/oi(10,i-M)%oi(10,M)|0)*o:0),N)for(;;){if(0==s){for(u=1,M=D[0];M>=10;M/=10)u++;for(M=D[0]+=o,o=1;M>=10;M/=10)o++;u!=o&&(t.e++,D[0]==si&&(D[0]=1));break}if(D[s]+=o,D[s]!=si)break;D[s--]=0,o=1}for(u=D.length;0===D[--u];)D.pop()}return ri&&(t.e>T.maxE?(t.d=null,t.e=NaN):t.e<T.minE&&(t.e=0,t.d=[0])),t}function Oi(t,n,e){if(!t.isFinite())return Si(t);var r,i=t.e,u=li(t.d),M=u.length;return n?(e&&(r=e-M)>0?u=u.charAt(0)+"."+u.slice(1)+Ci(r):M>1&&(u=u.charAt(0)+"."+u.slice(1)),u=u+(t.e<0?"e":"e+")+t.e):i<0?(u="0."+Ci(-i-1)+u,e&&(r=e-M)>0&&(u+=Ci(r))):i>=M?(u+=Ci(i+1-M),e&&(r=e-i-1)>0&&(u=u+"."+Ci(r))):((r=i+1)<M&&(u=u.slice(0,r)+"."+u.slice(r)),e&&(r=e-M)>0&&(i+1===M&&(u+="."),u+=Ci(r))),u}function Ei(t,n){var e=t[0];for(n*=7;e>=10;e/=10)n++;return n}function Ai(t,n,e){if(n>Ti)throw ri=!0,e&&(t.precision=e),Error("[DecimalError] Precision limit exceeded");return zi(new t(ti),n,1,!0)}function fi(t,n,e){if(n>gi)throw Error("[DecimalError] Precision limit exceeded");return zi(new t(ni),n,e,!0)}function pi(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 Ci(t){for(var n="";t--;)n+="0";return n}function Ui(t,n,e,r){var i,u=new t(1),M=Math.ceil(r/7+4);for(ri=!1;;){if(e%2&&bi((u=u.times(n)).d,M)&&(i=!0),0===(e=Mi(e/2))){e=u.d.length-1,i&&0===u.d[e]&&++u.d[e];break}bi((n=n.times(n)).d,M)}return ri=!0,u}function di(t){return 1&t.d[t.d.length-1]}function Li(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 wi(t,n){var e,r,i,u,M,o,c,N=0,a=0,D=0,s=t.constructor,T=s.rounding,g=s.precision;if(!t.d||!t.d[0]||t.e>17)return new s(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==n?(ri=!1,c=g):c=n,o=new s(.03125);t.e>-2;)t=t.times(o),D+=5;for(c+=r=Math.log(oi(2,D))/Math.LN10*2+5|0,e=u=M=new s(1),s.precision=c;;){if(u=zi(u.times(t),c,1),e=e.times(++a),li((o=M.plus(xi(u,e,c,1))).d).slice(0,c)===li(M.d).slice(0,c)){for(i=D;i--;)M=zi(M.times(M),c,1);if(null!=n)return s.precision=g,M;if(!(N<3&&ji(M.d,c-r,T,N)))return zi(M,s.precision=g,T,ri=!0);s.precision=c+=10,e=u=o=new s(1),a=0,N++}M=o}}function Qi(t,n){var e,r,i,u,M,o,c,N,a,D,s,T=1,g=t,I=g.d,l=g.constructor,y=l.rounding,j=l.precision;if(g.s<0||!I||!I[0]||!g.e&&1==I[0]&&1==I.length)return new l(I&&!I[0]?-1/0:1!=g.s?NaN:I?0:g);if(null==n?(ri=!1,a=j):a=n,l.precision=a+=10,r=(e=li(I)).charAt(0),!(Math.abs(u=g.e)<15e14))return N=Ai(l,a+2,j).times(u+""),g=Qi(new l(r+"."+e.slice(1)),a-10).plus(N),l.precision=j,null==n?zi(g,j,y,ri=!0):g;for(;r<7&&1!=r||1==r&&e.charAt(1)>3;)r=(e=li((g=g.times(t)).d)).charAt(0),T++;for(u=g.e,r>1?(g=new l("0."+e),u++):g=new l(r+"."+e.slice(1)),D=g,c=M=g=xi(g.minus(1),g.plus(1),a,1),s=zi(g.times(g),a,1),i=3;;){if(M=zi(M.times(s),a,1),li((N=c.plus(xi(M,new l(i),a,1))).d).slice(0,a)===li(c.d).slice(0,a)){if(c=c.times(2),0!==u&&(c=c.plus(Ai(l,a+2,j).times(u+""))),c=xi(c,new l(T),a,1),null!=n)return l.precision=j,c;if(!ji(c.d,a-10,y,o))return zi(c,l.precision=j,y,ri=!0);l.precision=a+=10,N=M=g=xi(D.minus(1),D.plus(1),a,1),s=zi(g.times(g),a,1),i=o=1}c=N,i+=2}}function Si(t){return String(t.s*t.s/0)}function ki(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),ri&&(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 vi(t,n){var e,r,i,u,M,o,c,N,a;if(n.indexOf("_")>-1){if(n=n.replace(/(\d)_(?=\d)/g,"$1"),Di.test(n))return ki(t,n)}else if("Infinity"===n||"NaN"===n)return+n||(t.s=NaN),t.e=NaN,t.d=null,t;if(Ni.test(n))e=16,n=n.toLowerCase();else if(ci.test(n))e=2;else{if(!ai.test(n))throw Error(ii+n);e=8}for((u=n.search(/p/i))>0?(c=+n.slice(u+1),n=n.substring(2,u)):n=n.slice(2),M=(u=n.indexOf("."))>=0,r=t.constructor,M&&(u=(o=(n=n.replace(".","")).length)-u,i=Ui(r,new r(e),u,2*u)),u=a=(N=hi(n,e,si)).length-1;0===N[u];--u)N.pop();return u<0?new r(0*t.s):(t.e=Ei(N,a),t.d=N,ri=!1,M&&(t=xi(t,i,4*o)),c&&(t=t.times(Math.abs(c)<54?oi(2,c):Cu.pow(2,c))),ri=!0,t)}function Yi(t,n,e,r,i){var u,M,o,c,N=t.precision,a=Math.ceil(N/7);for(ri=!1,c=e.times(e),o=new t(r);;){if(M=xi(o.times(c),new t(n++*n++),N,1),o=i?r.plus(M):r.minus(M),r=xi(M.times(c),new t(n++*n++),N,1),void 0!==(M=o.plus(r)).d[a]){for(u=a;M.d[u]===o.d[u]&&u--;);if(-1==u)break}u=o,o=r,r=M,M=u}return ri=!0,M.d.length=a+1,M}function mi(t,n){for(var e=t;--n;)e*=t;return e}function Ri(t,n){var e,r=n.s<0,i=fi(t,t.precision,1),u=i.times(.5);if((n=n.abs()).lte(u))return qr=r?4:1,n;if((e=n.divToInt(i)).isZero())qr=r?3:2;else{if((n=n.minus(e.times(i))).lte(u))return qr=di(e)?r?2:3:r?4:1,n;qr=di(e)?r?1:4:r?3:2}return n.minus(i).abs()}function Fi(t,n,e,r){var i,u,M,o,c,N,a,D,s,T=t.constructor,g=void 0!==e;if(g?(yi(e,1,1e9),void 0===r?r=T.rounding:yi(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,(M=(a=Oi(t)).indexOf("."))>=0&&(a=a.replace(".",""),(s=new T(1)).e=a.length-M,s.d=hi(Oi(s),10,i),s.e=s.d.length),u=c=(D=hi(a,10,i)).length;0==D[--c];)D.pop();if(D[0]){if(M<0?u--:((t=new T(t)).d=D,t.e=u,D=(t=xi(t,s,e,r,0,i)).d,u=t.e,N=Xr),M=D[e],o=i/2,N=N||void 0!==D[e+1],N=r<4?(void 0!==M||N)&&(0===r||r===(t.s<0?3:2)):M>o||M===o&&(4===r||N||6===r&&1&D[e-1]||r===(t.s<0?8:7)),D.length=e,N)for(;++D[--e]>i-1;)D[e]=0,e||(++u,D.unshift(1));for(c=D.length;!D[c-1];--c);for(M=0,a="";M<c;M++)a+=$r.charAt(D[M]);if(g){if(c>1)if(16==n||8==n){for(M=16==n?4:3,--c;c%M;c++)a+="0";for(c=(D=hi(a,i,n)).length;!D[c-1];--c);for(M=1,a="1.";M<c;M++)a+=$r.charAt(D[M])}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=Si(t);return t.s<0?"-"+a:a}function bi(t,n){if(t.length>n)return t.length=n,!0}function Bi(t){return new this(t).abs()}function Zi(t){return new this(t).acos()}function Vi(t){return new this(t).acosh()}function Wi(t,n){return new this(t).plus(n)}function Gi(t){return new this(t).asin()}function Pi(t){return new this(t).asinh()}function Ji(t){return new this(t).atan()}function Hi(t){return new this(t).atanh()}function Ki(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?fi(this,r,i):new this(0)).s=t.s:!t.d||n.isZero()?(e=fi(this,u,1).times(.5)).s=t.s:n.s<0?(this.precision=u,this.rounding=1,e=this.atan(xi(t,n,u,1)),n=fi(this,u,1),this.precision=r,this.rounding=i,e=t.s<0?e.minus(n):e.plus(n)):e=this.atan(xi(t,n,u,1)):(e=fi(this,u,1).times(n.s>0?.25:.75)).s=t.s:e=new this(NaN),e}function Xi(t){return new this(t).cbrt()}function qi(t){return zi(t=new this(t),t.e+1,2)}function _i(t,n,e){return new this(t).clamp(n,e)}function $i(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",-_r,0,"toExpPos",0,_r,"maxE",0,_r,"minE",-_r,0,"modulo",0,9];for(n=0;n<u.length;n+=3)if(e=u[n],i&&(this[e]=ei[e]),void 0!==(r=t[e])){if(!(Mi(r)===r&&r>=u[n+1]&&r<=u[n+2]))throw Error(ii+e+": "+r);this[e]=r}if(e="crypto",i&&(this[e]=ei[e]),void 0!==(r=t[e])){if(!0!==r&&!1!==r&&0!==r&&1!==r)throw Error(ii+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 tu(t){return new this(t).cos()}function nu(t){return new this(t).cosh()}function eu(t,n){return new this(t).div(n)}function ru(t){return new this(t).exp()}function iu(t){return zi(t=new this(t),t.e+1,3)}function uu(){var t,n,e=new this(0);for(ri=!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 ri=!0,new this(1/0);e=n}return ri=!0,e.sqrt()}function Mu(t){return t instanceof Cu||t&&t.toStringTag===ui||!1}function ou(t){return new this(t).ln()}function cu(t,n){return new this(t).log(n)}function Nu(t){return new this(t).log(2)}function au(t){return new this(t).log(10)}function Du(){return Li(this,arguments,"lt")}function su(){return Li(this,arguments,"gt")}function Tu(t,n){return new this(t).mod(n)}function gu(t,n){return new this(t).mul(n)}function Iu(t,n){return new this(t).pow(n)}function lu(t){var n,e,r,i,u=0,M=new this(1),o=[];if(void 0===t?t=this.precision:yi(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]:o[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):(o.push(i%1e7),u+=4);u=r/4}else for(;u<r;)o[u++]=1e7*Math.random()|0;for(t%=7,(r=o[--u])&&t&&(i=oi(10,7-t),o[u]=(r/i|0)*i);0===o[u];u--)o.pop();if(u<0)e=0,o=[0];else{for(e=-1;0===o[0];e-=7)o.shift();for(r=1,i=o[0];i>=10;i/=10)r++;r<7&&(e-=7-r)}return M.e=e,M.d=o,M}function yu(t){return zi(t=new this(t),t.e+1,this.rounding)}function ju(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function hu(t){return new this(t).sin()}function xu(t){return new this(t).sinh()}function zu(t){return new this(t).sqrt()}function Ou(t,n){return new this(t).sub(n)}function Eu(){var t=0,n=arguments,e=new this(n[t]);for(ri=!1;e.s&&++t<n.length;)e=e.plus(n[t]);return ri=!0,zi(e,this.precision,this.rounding)}function Au(t){return new this(t).tan()}function fu(t){return new this(t).tanh()}function pu(t){return zi(t=new this(t),t.e+1,1)}Ii[Symbol.for("nodejs.util.inspect.custom")]=Ii.toString,Ii[Symbol.toStringTag]="Decimal";var Cu=Ii.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,Mu(t))return i.s=t.s,void(ri?!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(ri?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)):ki(i,t.toString())}if("string"!==r)throw Error(ii+t);return 45===(e=t.charCodeAt(0))?(t=t.slice(1),i.s=-1):(43===e&&(t=t.slice(1)),i.s=1),Di.test(t)?ki(i,t):vi(i,t)}if(u.prototype=Ii,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=$i,u.clone=t,u.isDecimal=Mu,u.abs=Bi,u.acos=Zi,u.acosh=Vi,u.add=Wi,u.asin=Gi,u.asinh=Pi,u.atan=Ji,u.atanh=Hi,u.atan2=Ki,u.cbrt=Xi,u.ceil=qi,u.clamp=_i,u.cos=tu,u.cosh=nu,u.div=eu,u.exp=ru,u.floor=iu,u.hypot=uu,u.ln=ou,u.log=cu,u.log10=au,u.log2=Nu,u.max=Du,u.min=su,u.mod=Tu,u.mul=gu,u.pow=Iu,u.random=lu,u.round=yu,u.sign=ju,u.sin=hu,u.sinh=xu,u.sqrt=zu,u.sub=Ou,u.sum=Eu,u.tan=Au,u.tanh=fu,u.trunc=pu,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}(ei);ti=new Cu(ti),ni=new Cu(ni);var Uu=Cu;function du(t){return"boolean"==typeof t||!!isFinite(t)&&t===Math.round(t)}var Lu=Math.sign||function(t){return t>0?1:t<0?-1:0},wu=Math.log2||function(t){return Math.log(t)/Math.LN2},Qu=Math.log10||function(t){return Math.log(t)/Math.LN10},Su=(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}),ku=Math.expm1||function(t){return t>=2e-4||t<=-2e-4?Math.exp(t)-1:t+t*t/2+t*t*t/6};function vu(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(!du(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(!du(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 Yu(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}=mu(n);switch(e){case"fixed":return Fu(t,r);case"exponential":return bu(t,r);case"engineering":return function(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=Bu(Ru(t),n),r=e.exponent,i=e.coefficients,u=r%3==0?r:r<0?r-3-r%3:r-r%3;if(rr(n))for(;n>i.length||r-u+1>i.length;)i.push(0);else for(var M=Math.abs(r-u)-(i.length-1),o=0;o<M;o++)i.push(0);var c=Math.abs(r-u),N=1;for(;c>0;)N++,c--;var a=i.slice(N).join(""),D=rr(n)&&a.length||a.match(/[1-9]/)?"."+a:"",s=i.slice(0,N).join("")+D+"e"+(r>=0?"+":"")+u.toString();return e.sign+s}(t,r);case"bin":return vu(t,2,i);case"oct":return vu(t,8,i);case"hex":return vu(t,16,i);case"auto":return function(t,n,e){if(isNaN(t)||!isFinite(t))return String(t);var r=Xu(null==e?void 0:e.lowerExp,-3),i=Xu(null==e?void 0:e.upperExp,5),u=Ru(t),M=n?Bu(u,n):u;if(M.exponent<r||M.exponent>=i)return bu(t,n);var o=M.coefficients,c=M.exponent;o.length<n&&(o=o.concat(Zu(n-o.length))),o=o.concat(Zu(c-o.length+1+(o.length<n?n-o.length:0))),o=Zu(-c).concat(o);var N=c>0?c:0;return N<o.length-1&&o.splice(N+1,0,"."),M.sign+o.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 mu(t){var n,e,r="auto";if(void 0!==t)if(rr(t))n=t;else if(ir(t))n=t.toNumber();else{if(!Or(t))throw new Error("Unsupported type of options, number, BigNumber, or object expected");void 0!==t.precision&&(n=Ku(t.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),void 0!==t.wordSize&&(e=Ku(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 Ru(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 M=r.replace(".","").replace(/^0*/,(function(t){return i-=t.length,""})).replace(/0*$/,"").split("").map((function(t){return parseInt(t)}));return 0===M.length&&(M.push(0),i++),{sign:e,coefficients:M,exponent:i}}function Fu(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=Ru(t),r="number"==typeof n?Bu(e,e.exponent+1+n):e,i=r.coefficients,u=r.exponent+1,M=u+(n||0);return i.length<M&&(i=i.concat(Zu(M-i.length))),u<0&&(i=Zu(1-u).concat(i),u=1),u<i.length&&i.splice(u,0,0===u?"0.":"."),r.sign+i.join("")}function bu(t,n){if(isNaN(t)||!isFinite(t))return String(t);var e=Ru(t),r=n?Bu(e,n):e,i=r.coefficients,u=r.exponent;i.length<n&&(i=i.concat(Zu(n-i.length)));var M=i.shift();return r.sign+M+(i.length>0?"."+i.join(""):"")+"e"+(u>=0?"+":"")+u}function Bu(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 Zu(t){for(var n=[],e=0;e<t;e++)n.push(0);return n}var Vu=Number.EPSILON||2220446049250313e-31;function Wu(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<=Vu||r<=Math.max(Math.abs(t),Math.abs(n))*e}return!1}var Gu=Math.acosh||function(t){return Math.log(Math.sqrt(t*t-1)+t)},Pu=Math.asinh||function(t){return Math.log(Math.sqrt(t*t+1)+t)},Ju=Math.atanh||function(t){return Math.log((1+t)/(1-t))/2},Hu=(Math.cosh,Math.sinh||function(t){return(Math.exp(t)-Math.exp(-t))/2});Math.tanh;function Ku(t,n){return rr(t)?t:ir(t)?t.toNumber():void n()}function Xu(t,n){return rr(t)?t:ir(t)?t.toNumber():n}function qu(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(!du(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 _u(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}=mu(n);switch(e){case"fixed":return function(t,n){return t.toFixed(n)}(t,r);case"exponential":return $u(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 qu(t,2,i);case"oct":return qu(t,8,i);case"hex":return qu(t,16,i);case"auto":var u=tM(null==n?void 0:n.lowerExp,-3),M=tM(null==n?void 0:n.upperExp,5);if(t.isZero())return"0";var o=t.toSignificantDigits(r),c=o.e;return(c>=u&&c<M?o.toFixed():$u(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 $u(t,n){return void 0!==n?t.toExponential(n-1):t.toExponential()}function tM(t,n){return rr(t)?t:ir(t)?t.toNumber():n}function nM(t,n){var e=function(t,n){if("number"==typeof t)return Yu(t,n);if(ir(t))return _u(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 nM(n,e)}(t,n);if(cr(t))return eM(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=>eM(e)+": "+nM(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 eM(t){for(var n=String(t),e="",r=0;r<n.length;){var i=n.charAt(r);e+=i in rM?rM[i]:i,r++}return'"'+e+'"'}var rM={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};function iM(t,n){if(!cr(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Zr(t)+", index: 0)");if(!cr(n))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+Zr(n)+", index: 1)");return t===n?0:t>n?1:-1}function uM(t,n,e){if(!(this instanceof uM))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 MM(t,n,e){if(!(this instanceof MM))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 oM(t){for(var n=[];Array.isArray(t);)n.push(t.length),t=t[0];return n}function cM(t,n){if(0===n.length){if(Array.isArray(t))throw new uM(t.length,0)}else!function t(n,e,r){var i,u=n.length;if(u!==e[r])throw new uM(u,e[r]);if(r<e.length-1){var M=r+1;for(i=0;i<u;i++){var o=n[i];if(!Array.isArray(o))throw new uM(e.length-1,e.length,"<");t(n[i],e,M)}}else for(i=0;i<u;i++)if(Array.isArray(n[i]))throw new uM(e.length+1,e.length,">")}(t,n,0)}function NM(t,n){if(void 0!==t){if(!rr(t)||!du(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||"number"==typeof n&&t>=n)throw new MM(t,n)}}function aM(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(!rr(t)||!du(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+nM(n)+")")})),(rr(t)||ir(t))&&(t=[t]),function t(n,e,r,i){var u,M,o=n.length,c=e[r],N=Math.min(o,c);if(n.length=c,r<e.length-1){var a=r+1;for(u=0;u<N;u++)M=n[u],Array.isArray(M)||(M=[M],n[u]=M),t(M,e,a,i);for(u=N;u<c;u++)M=[],n[u]=M,t(M,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 DM(t,n){var e=IM(t),r=e.length;if(!Array.isArray(t)||!Array.isArray(n))throw new TypeError("Array expected");if(0===n.length)throw new uM(0,r,"!=");var i=TM(n=sM(n,r));if(r!==i)throw new uM(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 M=r.length/u,o=0;o<M;o++)e.push(r.slice(o*u,(o+1)*u));r=e}return r}(e,n)}catch(t){if(t instanceof uM)throw new uM(i,r,"!=");throw t}}function sM(t,n){var e=TM(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 TM(t){return t.reduce((t,n)=>t*n,1)}function gM(t,n,e,r){var i=r||oM(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 M=r+1;for(i=0,u=n.length;i<u;i++)n[i]=t(n[i],e,M)}else for(var o=r;o<e;o++)n=[n];return n}(t,n,0);i.length<n;)i.push(1);return t}function IM(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 lM(t,n){for(var e,r=0,i=0;i<t.length;i++){var u=t[i],M=Array.isArray(u);if(0===i&&M&&(r=u.length),M&&u.length!==r)return;var o=M?lM(u,n):n(u);if(void 0===e)e=o;else if(e!==o)return"mixed"}return e}function yM(t,n,e,r){if(r<e){if(t.length!==n.length)throw new uM(t.length,n.length);for(var i=[],u=0;u<t.length;u++)i[u]=yM(t[u],n[u],e,r+1);return i}return t.concat(n)}function jM(){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 yM(t,e,n,0)}),t[0]);throw new Error("Wrong number of arguments in function concat")}function hM(){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),M=0;M<n.length;M++)for(var o=n[M],c=r[M],N=0;N<c;N++){var a=i-c+N;o[N]>u[a]&&(u[a]=o[N])}for(var D=0;D<n.length;D++)xM(n[D],u);return u}function xM(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 zM(t,n){var e=oM(t);if(Gr(e,n))return t;xM(e,n);var r,i,u,M=hM(e,n),o=M.length,c=[...Array(o-e.length).fill(1),...e],N=function(t){return nr()([],t)}(t);e.length<o&&(e=oM(N=DM(N,c)));for(var a=0;a<o;a++)e[a]<M[a]&&(r=N,i=M[a],u=a,e=oM(N=jM(...Array(i).fill(r),u)));return N}function OM(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(EM));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 EM(t){return t&&"?"===t[0]?t.slice(1):t}uM.prototype=new RangeError,uM.prototype.constructor=RangeError,uM.prototype.name="DimensionError",uM.prototype.isDimensionError=!0,MM.prototype=new RangeError,MM.prototype.constructor=RangeError,MM.prototype.name="IndexError",MM.prototype.isIndexError=!0;var AM=OM("BigNumber",["?on","config"],t=>{var{on:n,config:e}=t,r=Uu.clone({precision:e.precision,modulo:Uu.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}),fM=e(11),pM=e.n(fM),CM=OM("Complex",[],()=>(Object.defineProperty(pM.a,"name",{value:"Complex"}),pM.a.prototype.constructor=pM.a,pM.a.prototype.type="Complex",pM.a.prototype.isComplex=!0,pM.a.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},pM.a.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},pM.a.prototype.format=function(t){var n=this.im,e=this.re,r=Yu(this.re,t),i=Yu(this.im,t),u=rr(t)?t:t?t.precision:null;if(null!==u){var M=Math.pow(10,-u);Math.abs(e/n)<M&&(e=0),Math.abs(n/e)<M&&(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"},pM.a.fromPolar=function(t){switch(arguments.length){case 1:var n=arguments[0];if("object"==typeof n)return pM()(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(rr(e)){if(or(r)&&r.hasBase("ANGLE")&&(r=r.toNumber("rad")),rr(r))return new pM.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")}},pM.a.prototype.valueOf=pM.a.prototype.toString,pM.a.fromJSON=function(t){return new pM.a(t)},pM.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},pM.a),{isClass:!0});function UM(t){var n=0,e=1,r=Object.create(null),i=Object.create(null),u=0,M=function(t){var M=i[t];if(M&&(delete r[M],delete i[t],--n,e===M)){if(!n)return u=0,void(e=1);for(;!Object.prototype.hasOwnProperty.call(r,++e););}};return t=Math.abs(t),{hit:function(o){var c=i[o],N=++u;if(r[N]=o,i[o]=N,!c){if(++n<=t)return;return o=r[e],M(o),o}if(delete r[c],e===c)for(;!Object.prototype.hasOwnProperty.call(r,++e););},delete:M,clear:function(){n=u=0,e=1,r=Object.create(null),i=Object.create(null)}}}function dM(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:UM(e||Number.POSITIVE_INFINITY)});for(var i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];var M=n(i);if(r.cache.values.has(M))return r.cache.lru.hit(M),r.cache.values.get(M);var o=t.apply(t,i);return r.cache.values.set(M,o),r.cache.values.delete(r.cache.lru.hit(M)),o}}function LM(t){return Object.keys(t.signatures||{}).reduce((function(t,n){var e=(n.match(/,/g)||[]).length+1;return Math.max(t,e)}),-1)}dM((function(t){return new t(1).exp()}),{hasher:QM}),dM((function(t){return new t(1).plus(new t(5).sqrt()).div(2)}),{hasher:QM});var wM=dM((function(t){return t.acos(-1)}),{hasher:QM});dM((function(t){return wM(t).times(2)}),{hasher:QM});function QM(t){return t[0].precision}Math.PI,Math.PI,Math.E;SM("fineStructure",.0072973525693),SM("weakMixingAngle",.2229),SM("efimovFactor",22.7),SM("sackurTetrode",-1.16487052358);function SM(t,n){return OM(t,["config","BigNumber"],t=>{var{config:e,BigNumber:r}=t;return"BigNumber"===e.number?new r(n):n})}var kM=e(16),vM=e.n(kM),YM=OM("Fraction",[],()=>(Object.defineProperty(vM.a,"name",{value:"Fraction"}),vM.a.prototype.constructor=vM.a,vM.a.prototype.type="Fraction",vM.a.prototype.isFraction=!0,vM.a.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},vM.a.fromJSON=function(t){return new vM.a(t)},vM.a),{isClass:!0}),mM=OM("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}),RM=OM("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&&!cr(n))throw new Error("Invalid datatype: "+n);if(ar(t))"DenseMatrix"===t.type?(this._data=Vr(t._data),this._size=Vr(t._size),this._datatype=n||t._datatype):(this._data=t.toArray(),this._size=t.size(),this._datatype=n||t._datatype);else if(t&&Nr(t.data)&&Nr(t.size))this._data=t.data,this._size=t.size,cM(this._data,this._size),this._datatype=n||t.datatype;else if(Nr(t))this._data=o(t),this._size=oM(this._data),cM(this._data,this._size),this._datatype=n;else{if(t)throw new TypeError("Unsupported type of data ("+Zr(t)+")");this._data=[],this._size=[0],this._datatype=n}}function r(t,n){if(!Ir(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 uM(r.length,t._size.length);for(var i=n.min(),u=n.max(),M=0,o=t._size.length;M<o;M++)NM(i[M],t._size[M]),NM(u[M],t._size[M]);return new e(function t(n,e,r,i){var u=i===r-1,M=e.dimension(i);return u?M.map((function(t){return NM(t,n.length),n[t]})).valueOf():M.map((function(u){NM(u,n.length);var M=n[u];return t(M,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(),o=n.isScalar();if(ar(e)?(i=e.size(),e=e.valueOf()):i=oM(e),o){if(0!==i.length)throw new TypeError("Scalar expected");t.set(n.min(),e,r)}else{if(!Gr(i,u))try{i=oM(e=0===i.length?zM([e],u):zM(e,u))}catch(t){}if(u.length<t._size.length)throw new uM(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=gM(e,u.length,N,i)}if(!Gr(u,i))throw new uM(u,i,">");M(t,n.max().map((function(t){return t+1})),r);var a=u.length;!function t(n,e,r,i,u){var M=u===i-1,o=e.dimension(u);M?o.forEach((function(t,e){NM(t),n[t]=r[e[0]]})):o.forEach((function(M,o){NM(M),t(n[M],e,r[o[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;Nr(r);)r=r[0];return r}return t._size=n.slice(0),t._data=aM(t._data,t._size,e),t}function M(t,n,e){for(var r=t._size.slice(0),i=!1;r.length<n.length;)r.push(0),i=!0;for(var M=0,o=n.length;M<o;M++)n[M]>r[M]&&(r[M]=n[M],i=!0);i&&u(t,r,e)}function o(t){return ar(t)?o(t.valueOf()):Nr(t)?t.map(o):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 lM(this._data,Zr)},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(!Nr(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new uM(t.length,this._size.length);for(var n=0;n<t.length;n++)NM(t[n],this._size[n]);for(var e=this._data,r=0,i=t.length;r<i;r++){var u=t[r];NM(u,e.length),e=e[u]}return e},e.prototype.set=function(t,n,e){if(!Nr(t))throw new TypeError("Array expected");if(t.length<this._size.length)throw new uM(t.length,this._size.length,"<");var r,i,u;M(this,t.map((function(t){return t+1})),e);var o=this._data;for(r=0,i=t.length-1;r<i;r++)NM(u=t[r],o.length),o=o[u];return NM(u=t[t.length-1],o.length),o[u]=n,this},e.prototype.resize=function(t,n,e){if(!Dr(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=DM(e._data,t);var r=e._size.reduce((t,n)=>t*n);return e._size=sM(t,r),e},e.prototype.clone=function(){return new e({data:Vr(this._data),size:Vr(this._size),datatype:this._datatype})},e.prototype.size=function(){return this._size.slice(0)},e.prototype.map=function(t){var n=this,r=LM(t),i=function e(i,u){return Nr(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?lM(i,Zr):void 0)},e.prototype.forEach=function(t){var n=this;!function e(r,i){Nr(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(Nr(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))},M=0;M<r[1];M++)u(M);return n},e.prototype.toArray=function(){return Vr(this._data)},e.prototype.valueOf=function(){return this._data},e.prototype.format=function(t){return nM(this._data,t)},e.prototype.toString=function(){return nM(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(ir(t)&&(t=t.toNumber()),!rr(t)||!du(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],M=Math.min(i-r,u-n),o=[],c=0;c<M;c++)o[c]=this._data[c+r][c+n];return new e({data:o,size:[M],datatype:this._datatype})},e.diagonal=function(t,n,r,i){if(!Nr(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(ir(t)&&(t=t.toNumber()),!rr(t)||!du(t)||t<1)throw new Error("Size values must be positive integers");return t})),r){if(ir(r)&&(r=r.toNumber()),!rr(r)||!du(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var u,M=r>0?r:0,o=r<0?-r:0,c=t[0],N=t[1],a=Math.min(c-o,N-M);if(Nr(n)){if(n.length!==a)throw new Error("Invalid value array length");u=function(t){return n[t]}}else if(ar(n)){var D=n.size();if(1!==D.length||D[0]!==a)throw new Error("Invalid matrix length");u=function(t){return n.get([t])}}else u=function(){return n};i||(i=ir(u(0))?u(0).mul(0):0);var s=[];if(t.length>0){s=aM(s,t,i);for(var T=0;T<a;T++)s[T+o][T+M]=u(T)}return new e({data:s,size:[c,N]})},e.fromJSON=function(t){return new e(t)},e.prototype.swapRows=function(t,n){if(!(rr(t)&&du(t)&&rr(n)&&du(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 NM(t,this._size[0]),NM(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 FM(){return!0}function bM(){return!1}function BM(){}var ZM=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:FM,isAny:!0};let i,u,M=0,o={createCount:0};function c(t){const n=i.get(t);if(n)return n;let e='Unknown type "'+t+'"';const r=t.toLowerCase();let M;for(M of u)if(M.toLowerCase()===r){e+='. Did you mean "'+M+'" ?';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 M=u.slice(e);u=u.slice(0,e).concat(r).concat(M);for(let t=e+r.length;t<u.length;++t)i.get(u[t]).index=t}function a(){i=new Map,u=[],M=0,N([r],!1)}function D(t){const n=u.filter(n=>{const e=i.get(n);return!e.isAny&&e.test(t)});return n.length?n:["any"]}function s(t){return t&&"function"==typeof t&&"_typedFunctionData"in t}function T(t,n,e){if(!s(t))throw new TypeError("Argument is not a typed-function.");const r=e&&e.exact,i=j(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 M=i.length;let o,c;if(r){let n;for(n in o=[],t.signatures)o.push(t._typedFunctionData.signatureMap.get(n))}else o=t._typedFunctionData.signatures;for(let t=0;t<M;++t){const n=i[t],e=[];let r;for(r of o){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(o=e,0===o.length)break}for(c of o)if(c.params.length<=M)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 I(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 l(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 j(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=I(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 h(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 FM}function z(t){let n,e,r;if(h(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]:h(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 M,o=e;for(M=0;M<n.length;M++){const t=[];if(o.forEach(e=>{const r=x(O(e.params,M));(M<e.params.length||h(e.params))&&r(n[M])&&t.push(e)}),0===t.length){if(i=f(o,M),i.length>0){const t=D(n[M]);return r=new TypeError("Unexpected type of argument in function "+u+" (expected: "+i.join(" or ")+", actual: "+t.join(" | ")+", index: "+M+")"),r.data={category:"wrongType",fn:u,index:M,actual:t,expected:i},r}}else o=t}const c=o.map((function(t){return h(t.params)?1/0:t.params.length}));if(n.length<Math.min.apply(null,c))return i=f(o,M),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(D(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 C(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 U(t){let n=M+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 d(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=C(t)-C(n);if(e<0)return-1;if(e>0)return 1;const r=U(t)-U(n);return r<0?-1:r>0?1:0}function L(t,n){const e=t.params,r=n.params,i=b(e),u=b(r),M=h(e),o=h(r);if(M&&i.hasAny){if(!o||!u.hasAny)return 1}else if(o&&u.hasAny)return-1;let c,N=0,a=0;for(c of e)c.hasAny&&++N,c.hasConversion&&++a;let D=0,s=0;for(c of r)c.hasAny&&++D,c.hasConversion&&++s;if(N!==D)return N-D;if(M&&i.hasConversion){if(!o||!u.hasConversion)return 1}else if(o&&u.hasConversion)return-1;if(a!==s)return a-s;if(M){if(!o)return 1}else if(o)return-1;const T=(e.length-r.length)*(M?-1:1);if(0!==T)return T;const g=[];let I,l=0;for(let t=0;t<e.length;++t){const n=d(e[t],r[t]);g.push(n),l+=n}if(0!==l)return l;for(I of g)if(0!==I)return I;return 0}function w(t,n){let e=n;if(t.some(t=>t.hasConversion)){const r=h(t),i=t.map(Q);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(h(t)){const n=t.length-1;r=function(){return e.apply(this,B(arguments,0,n).concat([B(arguments,n)]))}}return r}function Q(t){let n,e,r,i;const u=[],M=[];switch(t.types.forEach((function(t){t.conversion&&(u.push(c(t.conversion.from).test),M.push(t.conversion.convert))})),M.length){case 0:return function(t){return t};case 1:return n=u[0],r=M[0],function(t){return n(t)?r(t):t};case 2:return n=u[0],e=u[1],r=M[0],i=M[1],function(t){return n(t)?r(t):e(t)?i(t):t};default:return function(t){for(let n=0;n<M.length;n++)if(u[n](t))return M[n](t);return t}}}function S(t){return function t(n,e,r){if(e<n.length){const M=n[e];let o=[];if(M.restParam){const t=M.types.filter(A);t.length<M.types.length&&o.push({types:t,name:"..."+t.map(t=>t.name).join("|"),hasAny:t.some(t=>t.isAny),hasConversion:!1,restParam:!0}),o.push(M)}else o=M.types.map((function(t){return{types:[t],name:t.name,hasAny:t.isAny,hasConversion:t.conversion,restParam:!1}}));return i=o,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,M=!1;for(u of i)if(e.has(u)){M=!0;break}if(!M)return!1}const r=t.length,i=n.length,u=h(t),M=h(n);return u?M?r===i:i>=r:M?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)?Z(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 M=0;M<r.length;++M){if(i[M])continue;const o=r[M];if(G(o))r[M]=o.referToSelf.callback(e),r[M].referToSelf=o.referToSelf,i[M]=!0,t=!1;else if(W(o)){const e=v(o.referTo.references,r,n);e?(r[M]=o.referTo.callback.apply(this,e),r[M].referTo=o.referTo,i[M]=!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(o.createCount++,0===Object.keys(n).length)throw new SyntaxError("No signatures provided");o.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 M;for(M in n){if(!Object.prototype.hasOwnProperty.call(n,M))continue;const t=j(M);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 o=r.length;r.push(n[M]);const c=t.map(l);let N;for(N of S(c)){const t=g(N);u.push({params:N,name:t,fn:o}),N.every(t=>!t.hasConversion)&&(i[t]=o)}}u.sort(L);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=[],D=new Map;for(N of u)D.has(N.name)||(N.fn=c[N.fn],a.push(N),D.set(N.name,N));const s=a[0]&&a[0].params.length<=2&&!h(a[0].params),T=a[1]&&a[1].params.length<=2&&!h(a[1].params),I=a[2]&&a[2].params.length<=2&&!h(a[2].params),y=a[3]&&a[3].params.length<=2&&!h(a[3].params),O=a[4]&&a[4].params.length<=2&&!h(a[4].params),E=a[5]&&a[5].params.length<=2&&!h(a[5].params),A=s&&T&&I&&y&&O&&E;for(let t=0;t<a.length;++t)a[t].test=z(a[t].params);const f=s?x(a[0].params[0]):bM,p=T?x(a[1].params[0]):bM,C=I?x(a[2].params[0]):bM,U=y?x(a[3].params[0]):bM,d=O?x(a[4].params[0]):bM,Q=E?x(a[5].params[0]):bM,v=s?x(a[0].params[1]):bM,m=T?x(a[1].params[1]):bM,R=I?x(a[2].params[1]):bM,F=y?x(a[3].params[1]):bM,b=O?x(a[4].params[1]):bM,B=E?x(a[5].params[1]):bM;for(let t=0;t<a.length;++t)a[t].implementation=w(a[t].params,a[t].fn);const Z=s?a[0].implementation:BM,V=T?a[1].implementation:BM,W=I?a[2].implementation:BM,G=y?a[3].implementation:BM,P=O?a[4].implementation:BM,J=E?a[5].implementation:BM,H=s?a[0].params.length:-1,K=T?a[1].params.length:-1,X=I?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 o.onMismatch(t,arguments,a)};function ut(t,n){return arguments.length===H&&f(t)&&v(n)?Z.apply(this,arguments):arguments.length===K&&p(t)&&m(n)?V.apply(this,arguments):arguments.length===X&&C(t)&&R(n)?W.apply(this,arguments):arguments.length===q&&U(t)&&F(n)?G.apply(this,arguments):arguments.length===_&&d(t)&&b(n)?P.apply(this,arguments):arguments.length===$&&Q(t)&&B(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:D},ut}function R(t,n,e){throw p(t,n,e)}function F(t){return B(t,0,t.length-1)}function b(t){return t[t.length-1]}function B(t,n,e){return Array.prototype.slice.call(t,n,e)}function Z(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)&&(s(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=o;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 o=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 M,o={};if("function"==typeof r?(M=r.name,"string"==typeof r.signature?o[r.signature]=r:s(r)&&(o=r.signatures)):n(r)&&(o=r,e||(M=J(r))),0===Object.keys(o).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,M)),H(u,o)}return m(i||"",u)},o.create=t,o.createCount=K.createCount,o.onMismatch=R,o.throwMismatchError=R,o.createError=p,o.clear=a,o.clearConversions=function(){let t;for(t of u)i.get(t).conversionsTo=[];M=0},o.addTypes=N,o._findType=c,o.referTo=function(){const t=F(arguments).map(t=>g(j(t))),n=b(arguments);if("function"!=typeof n)throw new TypeError("Callback function expected as last argument");return Z(t,n)},o.referToSelf=V,o.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)},o.findSignature=T,o.find=function(t,n,e){return T(t,n,e).implementation},o.isTypedFunction=s,o.warnAgainstDeprecatedThis=!0,o.addType=function(t,n){let e="any";!1!==n&&i.has("Object")&&(e="Object"),o.addTypes([t],e)},o.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:M++})},o.addConversions=function(t){t.forEach(o.addConversion)},o.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)},o.resolve=function(t,n){if(!s(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},o}();function VM(t,n){if(JM(t)&&GM(t,n))return t[n];if("function"==typeof t[n]&&PM(t,n))throw new Error('Cannot access method "'+n+'" as a property');throw new Error('No access to property "'+n+'"')}function WM(t,n,e){if(JM(t)&&GM(t,n))return t[n]=e,e;throw new Error('No access to property "'+n+'"')}function GM(t,n){return!(!t||"object"!=typeof t)&&(!!Pr(HM,n)||!(n in Object.prototype)&&!(n in Function.prototype))}function PM(t,n){return null!=t&&"function"==typeof t[n]&&(!(Pr(t,n)&&Object.getPrototypeOf&&n in Object.getPrototypeOf(t))&&(!!Pr(KM,n)||!(n in Object.prototype)&&!(n in Function.prototype)))}function JM(t){return"object"==typeof t&&t&&t.constructor===Object}var HM={length:!0,name:!0},KM={toString:!0,valueOf:!0,toLocaleString:!0};class XM{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(t){return VM(this.wrappedObject,t)}set(t,n){return WM(this.wrappedObject,t,n),this}has(t){return n=this.wrappedObject,t in n;var n}entries(){return qM(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 qM(t,n){return{next:()=>{var e=t.next();return e.done?e:{value:n(e.value),done:!1}}}}function _M(t){return!!t&&(t instanceof Map||t instanceof XM||"function"==typeof t.set&&"function"==typeof t.get&&"function"==typeof t.keys&&"function"==typeof t.has)}var $M=function(){return $M=ZM.create,ZM},to=OM("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],(function(t){var{BigNumber:n,Complex:e,DenseMatrix:r,Fraction:i}=t,u=$M();return u.clear(),u.addTypes([{name:"number",test:rr},{name:"Complex",test:ur},{name:"BigNumber",test:ir},{name:"Fraction",test:Mr},{name:"Unit",test:or},{name:"identifier",test:t=>cr&&/^(?:[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:cr},{name:"Chain",test:Br},{name:"Array",test:Nr},{name:"Matrix",test:ar},{name:"DenseMatrix",test:sr},{name:"SparseMatrix",test:Tr},{name:"Range",test:gr},{name:"Index",test:Ir},{name:"boolean",test:lr},{name:"ResultSet",test:yr},{name:"Help",test:jr},{name:"function",test:hr},{name:"Date",test:xr},{name:"RegExp",test:zr},{name:"null",test:Er},{name:"undefined",test:Ar},{name:"AccessorNode",test:fr},{name:"ArrayNode",test:pr},{name:"AssignmentNode",test:Cr},{name:"BlockNode",test:Ur},{name:"ConditionalNode",test:dr},{name:"ConstantNode",test:Lr},{name:"FunctionNode",test:Qr},{name:"FunctionAssignmentNode",test:wr},{name:"IndexNode",test:Sr},{name:"Node",test:kr},{name:"ObjectNode",test:vr},{name:"OperatorNode",test:Yr},{name:"ParenthesisNode",test:mr},{name:"RangeNode",test:Rr},{name:"RelationalNode",test:Fr},{name:"SymbolNode",test:br},{name:"Map",test:_M},{name:"Object",test:Or}]),u.addConversions([{from:"number",to:"BigNumber",convert:function(t){if(n||no(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||ro(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||no(t);try{return new n(t)}catch(n){throw new Error('Cannot convert "'+t+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(t){i||ro(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||no(t),new n(+t)}},{from:"boolean",to:"Fraction",convert:function(t){return i||ro(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&&Dr(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&&Dr(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 no(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 ro(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}function io(t,n,e){return t&&"function"==typeof t.map?t.map((function(t){return io(t,n,e)})):n(t)}var uo="number",Mo="number, number";function oo(t){return Math.abs(t)}function co(t,n){return t+n}function No(t,n){return t-n}function ao(t,n){return t*n}function Do(t){return-t}function so(t){return t}function To(t){return Su(t)}function go(t){return t*t*t}function Io(t){return Math.exp(t)}function lo(t){return ku(t)}function yo(t,n){if(!du(t)||!du(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 jo(t){return Qu(t)}function ho(t){return wu(t)}function xo(t){return Lu(t)}function zo(t){return t*t}function Oo(t,n){var e,r,i,u=0,M=1,o=1,c=0;if(!du(t)||!du(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=M-r*u,M=e,e=o,o=c-r*o,c=e,t=n,n=i;return t<0?[-t,-M,-c]:[t,t?M:0,c]}function Eo(t,n){return t*t<1&&n===1/0||t*t>1&&n===-1/0?0:Math.pow(t,n)}oo.signature=uo,co.signature=Mo,No.signature=Mo,ao.signature=Mo,Do.signature=uo,so.signature=uo,To.signature=uo,go.signature=uo,Io.signature=uo,lo.signature=uo,yo.signature=Mo,jo.signature=uo,ho.signature=uo,xo.signature=uo,zo.signature=uo,Oo.signature=Mo,Eo.signature=Mo;function Ao(t){return Gu(t)}function fo(t){return Math.atan(1/t)}function po(t){return isFinite(t)?(Math.log((t+1)/t)+Math.log(t/(t-1)))/2:0}function Co(t){return Math.asin(1/t)}function Uo(t){var n=1/t;return Math.log(n+Math.sqrt(n*n+1))}function Lo(t){return Math.acos(1/t)}function wo(t){var n=1/t,e=Math.sqrt(n*n-1);return Math.log(e+n)}function Qo(t){return Pu(t)}function So(t){return Ju(t)}function ko(t){return 1/Math.tan(t)}function vo(t){var n=Math.exp(2*t);return(n+1)/(n-1)}function Yo(t){return 1/Math.sin(t)}function mo(t){return 0===t?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(t)-Math.exp(-t)))*Lu(t)}function Ro(t){return 1/Math.cos(t)}function Fo(t){return 2/(Math.exp(t)+Math.exp(-t))}function bo(t){return Hu(t)}Ao.signature="number",fo.signature="number",po.signature="number",Co.signature="number",Uo.signature="number",Lo.signature="number",wo.signature="number",Qo.signature="number",So.signature="number",ko.signature="number",vo.signature="number",Yo.signature="number",mo.signature="number",Ro.signature="number",Fo.signature="number",bo.signature="number";var Bo=OM("addScalar",["typed"],t=>{var{typed:n}=t;return n("addScalar",{"number, number":co,"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 Zo="number, number";function Vo(t,n){if(!du(t)||!du(n))throw new Error("Integers expected in function bitAnd");return t&n}function Wo(t){if(!du(t))throw new Error("Integer expected in function bitNot");return~t}function Go(t,n){if(!du(t)||!du(n))throw new Error("Integers expected in function bitOr");return t|n}function Po(t,n){if(!du(t)||!du(n))throw new Error("Integers expected in function bitXor");return t^n}function Jo(t,n){if(!du(t)||!du(n))throw new Error("Integers expected in function leftShift");return t<<n}function Ho(t,n){if(!du(t)||!du(n))throw new Error("Integers expected in function rightArithShift");return t>>n}function Ko(t,n){if(!du(t)||!du(n))throw new Error("Integers expected in function rightLogShift");return t>>>n}Vo.signature=Zo,Wo.signature="number",Go.signature=Zo,Po.signature=Zo,Jo.signature=Zo,Ho.signature=Zo,Ko.signature=Zo;function Xo(t,n){if(n<t)return 1;if(n===t)return n;var e=n+t>>1;return Xo(t,e)*Xo(e+1,n)}function qo(t,n){if(!du(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(!du(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,M=n<e?e+1:n+1;M<=t;++M)for(r*=M;i<=u&&r%i==0;)r/=i,++i;return i<=u&&(r/=Xo(i,u)),r}qo.signature="number, number";var _o=OM("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=>io(n,t))})});function $o(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 tc=OM("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)})}}),nc=OM("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 Wu(t,n,e.epsilon)},"BigNumber, BigNumber":function(t,n){return t.eq(n)||$o(t,n,e.epsilon)},"Fraction, Fraction":function(t,n){return t.equals(n)},"Complex, Complex":function(t,n){return function(t,n,e){return Wu(t.re,n.re,e)&&Wu(t.im,n.im,e)}(t,n,e.epsilon)}},tc({typed:n}))});OM("equalScalar",["typed","config"],t=>{var{typed:n,config:e}=t;return n("equalScalar",{"number, number":function(t,n){return Wu(t,n,e.epsilon)}})}),Math.pow(2,53);OM("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 ec(t){return t<0}function rc(t){return t>0}function ic(t){return 0===t}function uc(t){return Number.isNaN(t)}ec.signature="number",rc.signature="number",ic.signature="number",uc.signature="number";function Mc(t){var n;if(du(t))return t<=0?isFinite(t)?1/0:NaN:t>171?1/0:Xo(1,t-1);if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*Mc(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=cc[0];for(var M=1;M<cc.length;++M)n+=cc[M]/(t+M);var o=t+oc+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,t+.5)*Math.exp(-o)*n}Mc.signature="number";var oc=4.7421875,cc=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],Nc=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function ac(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))-ac(1-t);for(var n=(t-=1)+5+.5,e=Nc[0],r=6;r>=1;r--)e+=Nc[r]/(t+r);return.9189385332046728+(t+.5)*Math.log(n)-n+Math.log(e)}ac.signature="number";var Dc=OM("multiplyScalar",["typed"],t=>{var{typed:n}=t;return n("multiplyScalar",{"number, number":ao,"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 sc(t){return!t}function Tc(t,n){return!(!t&&!n)}function gc(t,n){return!!t!=!!n}function Ic(t,n){return!(!t||!n)}sc.signature="number",Tc.signature="number, number",gc.signature="number, number",Ic.signature="number, number";OM("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 lc=e(22),yc=e.n(lc);Date.now();var jc=OM("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&&!cr(n))throw new Error("Invalid datatype: "+n);if(ar(t))!function(t,n,e){"SparseMatrix"===n.type?(t._values=n._values?Vr(n._values):void 0,t._index=Vr(n._index),t._ptr=Vr(n._ptr),t._size=Vr(n._size),t._datatype=e||n._datatype):u(t,n.valueOf(),e||n._datatype)}(this,t,n);else if(t&&Nr(t.index)&&Nr(t.ptr)&&Nr(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(Nr(t))u(this,t,n);else{if(t)throw new TypeError("Unsupported type of data ("+Zr(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,M=0,o=e,c=0;if(cr(i)&&(o=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 D=r[a];if(Nr(D)){if(0===N&&M<D.length&&(M=D.length),N<D.length){var s=D[N];o(s,c)||(t._values.push(s),t._index.push(a))}}else 0===N&&M<1&&(M=1),o(D,c)||(t._values.push(D),t._index.push(a))}N++}while(N<M)}t._ptr.push(t._index.length),t._size=[u,M]}function M(t,n){if(!Ir(n))throw new TypeError("Invalid index");if(n.isScalar())return t.get(n.min());var e,r,u,M,o=n.size();if(o.length!==t._size.length)throw new uM(o.length,t._size.length);var c=n.min(),N=n.max();for(e=0,r=t._size.length;e<r;e++)NM(c[e],t._size[e]),NM(N[e],t._size[e]);var a=t._values,D=t._index,s=t._ptr,T=n.dimension(0),g=n.dimension(1),I=[],l=[];T.forEach((function(t,n){l[t]=n[0],I[t]=!0}));var y=a?[]:void 0,j=[],h=[];return g.forEach((function(t){for(h.push(j.length),u=s[t],M=s[t+1];u<M;u++)e=D[u],!0===I[e]&&(j.push(l[e]),y&&y.push(a[u]))})),h.push(j.length),new i({values:y,index:j,ptr:h,size:o,datatype:t._datatype})}function o(t,n,e,r){if(!n||!0!==n.isIndex)throw new TypeError("Invalid index");var i,u=n.size(),M=n.isScalar();if(ar(e)?(i=e.size(),e=e.toArray()):i=oM(e),M){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 uM(u.length,t._size.length,"<");if(i.length<u.length){for(var o=0,c=0;1===u[o]&&1===i[o];)o++;for(;1===u[o];)c++,o++;e=gM(e,u.length,c,i)}if(!Gr(u,i))throw new uM(u,i,">");if(1===u.length){n.dimension(0).forEach((function(n,i){NM(n),t.set([n,0],e[i[0]],r)}))}else{var N=n.dimension(0),a=n.dimension(1);N.forEach((function(n,i){NM(n),a.forEach((function(u,M){NM(u),t.set([n,u],e[i[0]][M[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,M){i.splice(t,0,r),u.splice(t,0,n);for(var o=e+1;o<M.length;o++)M[o]++}function a(t,r,i,u){var M=u||0,o=e,c=0;cr(t._datatype)&&(o=n.find(e,[t._datatype,t._datatype])||e,c=n.convert(0,t._datatype),M=n.convert(M,t._datatype));var N,a,D,s=!o(M,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,s)for(N=0;N<T;N++)t._values.push(M),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(s){var I=0;for(a=0;a<g;a++){t._ptr[a]=t._ptr[a]+I,D=t._ptr[a+1]+I;var l=0;for(N=T;N<r;N++,l++)t._values.splice(D+l,0,M),t._index.splice(D+l,0,N),I++}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 j=t._ptr[a],h=t._ptr[a+1]-y;for(D=j;D<h;D++)(N=t._index[D])>r-1&&(t._values.splice(D,1),t._index.splice(D,1),y++)}t._ptr[a]=t._values.length}return t._size[0]=r,t._size[1]=i,t}function D(t,n,e,r,i){var u,M,o=r[0],c=r[1],N=[];for(u=0;u<o;u++)for(N[u]=[],M=0;M<c;M++)N[u][M]=0;for(M=0;M<c;M++)for(var a=e[M],D=e[M+1],s=a;s<D;s++)N[u=n[s]][M]=t?i?Vr(t[s]):t[s]: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 lM(this._values,Zr)},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 M(this,t);case 2:case 3:return o(this,t,n,e);default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.get=function(t){if(!Nr(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new uM(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];NM(n,this._size[0]),NM(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(!Nr(t))throw new TypeError("Array expected");if(t.length!==this._size.length)throw new uM(t.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var u=t[0],M=t[1],o=this._size[0],D=this._size[1],s=e,T=0;cr(this._datatype)&&(s=n.find(e,[this._datatype,this._datatype])||e,T=n.convert(0,this._datatype)),(u>o-1||M>D-1)&&(a(this,Math.max(u+1,o),Math.max(M+1,D),i),o=this._size[0],D=this._size[1]),NM(u,o),NM(M,D);var g=c(u,this._ptr[M],this._ptr[M+1],this._index);return g<this._ptr[M+1]&&this._index[g]===u?s(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,M,this._values,this._index,this._ptr):this._values[g]=r:s(r,T)||N(g,u,M,r,this._values,this._index,this._ptr),this},i.prototype.resize=function(t,n,e){if(!Dr(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(!rr(t)||!du(t)||t<0)throw new TypeError("Invalid size, must contain positive integers (size: "+nM(r)+")")})),a(e?this.clone():this,r[0],r[1],n)},i.prototype.reshape=function(t,n){if(!Nr(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(!rr(n)||!du(n)||n<=-2||0===n)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+nM(t)+")")}));var e=this._size[0]*this._size[1];if(e!==(t=sM(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 M=0;M<r._ptr[u+1]-r._ptr[u];M++)i.push(u);for(var o=r._values.slice(),a=r._index.slice(),D=0;D<r._index.length;D++){var s=a[D],T=i[D],g=s*r._size[1]+T;i[D]=g%t[1],a[D]=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 I=0;I<r._ptr.length;I++)r._ptr[I]=0;for(var l=0;l<o.length;l++){var y=a[l],j=i[l],h=o[l];N(c(y,r._ptr[j],r._ptr[j+1],r._index),y,j,h,r._values,r._index,r._ptr)}return r},i.prototype.clone=function(){return new i({values:this._values?Vr(this._values):void 0,index:Vr(this._index),ptr:Vr(this._ptr),size:Vr(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,M=this._size[0],o=this._size[1],c=LM(t);return function(t,r,u,M,o,c,N){var a=[],D=[],s=[],T=e,g=0;cr(t._datatype)&&(T=n.find(e,[t._datatype,t._datatype])||e,g=n.convert(0,t._datatype));for(var I=function(t,n,e){t=c(t,n,e),T(t,g)||(a.push(t),D.push(n))},l=M;l<=o;l++){s.push(a.length);var y=t._ptr[l],j=t._ptr[l+1];if(N)for(var h=y;h<j;h++){var x=t._index[h];x>=r&&x<=u&&I(t._values[h],x-r,l-M)}else{for(var z={},O=y;O<j;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;I(f,A-r,l-M)}}}return s.push(a.length),new i({values:a,index:D,ptr:s,size:[u-r+1,o-M+1]})}(this,0,M-1,0,o-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],M=this._ptr[i+1];if(n)for(var o=u;o<M;o++){var c=this._index[o];t(this._values[o],[c,i],this)}else{for(var N={},a=u;a<M;a++){N[this._index[a]]=this._values[a]}for(var D=0;D<e;D++){t(D in N?N[D]:0,[D,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 D(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return D(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 ["+nM(n,t)+" x "+nM(e,t)+"] density: "+nM(r,t)+"\n",u=0;u<e;u++)for(var M=this._ptr[u],o=this._ptr[u+1],c=M;c<o;c++){i+="\n ("+nM(this._index[c],t)+", "+nM(u,t)+") ==> "+(this._values?nM(this._values[c],t):"X")}return i},i.prototype.toString=function(){return nM(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(ir(t)&&(t=t.toNumber()),!rr(t)||!du(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],M=Math.min(r-e,u-n),o=[],c=[],N=[];N[0]=0;for(var a=n;a<u&&o.length<M;a++)for(var D=this._ptr[a],s=this._ptr[a+1],T=D;T<s;T++){var g=this._index[T];if(g===a-n+e){o.push(this._values[T]),c[o.length-1]=g-e;break}}return N.push(o.length),new i({values:o,index:c,ptr:N,size:[M,1]})},i.fromJSON=function(t){return new i(t)},i.diagonal=function(t,r,u,M,o){if(!Nr(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(ir(t)&&(t=t.toNumber()),!rr(t)||!du(t)||t<1)throw new Error("Size values must be positive integers");return t})),u){if(ir(u)&&(u=u.toNumber()),!rr(u)||!du(u))throw new TypeError("The parameter k must be an integer number")}else u=0;var c=e,N=0;cr(o)&&(c=n.find(e,[o,o])||e,N=n.convert(0,o));var a,D=u>0?u:0,s=u<0?-u:0,T=t[0],g=t[1],I=Math.min(T-s,g-D);if(Nr(r)){if(r.length!==I)throw new Error("Invalid value array length");a=function(t){return r[t]}}else if(ar(r)){var l=r.size();if(1!==l.length||l[0]!==I)throw new Error("Invalid matrix length");a=function(t){return r.get([t])}}else a=function(){return r};for(var y=[],j=[],h=[],x=0;x<g;x++){h.push(y.length);var z=x-D;if(z>=0&&z<I){var O=a(z);c(O,N)||(j.push(z+s),y.push(O))}}return h.push(y.length),new i({values:y,index:j,ptr:h,size:[T,g]})},i.prototype.swapRows=function(t,n){if(!(rr(t)&&du(t)&&rr(n)&&du(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 NM(t,this._size[0]),NM(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],M=r[t+1],o=u;o<M;o++)i(e[o],n[o])},i._swapRows=function(t,n,e,r,i,u){for(var M=0;M<e;M++){var o=u[M],N=u[M+1],a=c(t,o,N,i),D=c(n,o,N,i);if(a<N&&D<N&&i[a]===t&&i[D]===n){if(r){var s=r[a];r[a]=r[D],r[D]=s}}else if(a<N&&i[a]===t&&(D>=N||i[D]!==n)){var T=r?r[a]:void 0;i.splice(D,0,n),r&&r.splice(D,0,T),i.splice(D<=a?a+1:a,1),r&&r.splice(D<=a?a+1:a,1)}else if(D<N&&i[D]===n&&(a>=N||i[a]!==t)){var g=r?r[D]:void 0;i.splice(a,0,t),r&&r.splice(a,0,g),i.splice(a<=D?D+1:D,1),r&&r.splice(a<=D?D+1:D,1)}}},i},{isClass:!0});OM("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 hc=OM("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 xc(){throw new Error('No "matrix" implementation available')}var zc=OM("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:oM,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([]):xc()}})}),Oc=OM("matAlgo11xS0s",["typed","equalScalar"],t=>{var{typed:n,equalScalar:e}=t;return function(t,r,i,u){var M=t._values,o=t._index,c=t._ptr,N=t._size,a=t._datatype;if(!M)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var D,s=N[0],T=N[1],g=e,I=0,l=i;"string"==typeof a&&(D=a,g=n.find(e,[D,D]),I=n.convert(0,D),r=n.convert(r,D),l=n.find(i,[D,D]));for(var y=[],j=[],h=[],x=0;x<T;x++){h[x]=j.length;for(var z=c[x],O=c[x+1],E=z;E<O;E++){var A=o[E],f=u?l(r,M[E]):l(M[E],r);g(f,I)||(j.push(A),y.push(f))}}return h[T]=j.length,t.createSparseMatrix({values:y,index:j,ptr:h,size:[s,T],datatype:D})}}),Ec=OM("matAlgo14xDs",["typed"],t=>{var{typed:n}=t;return function(t,e,r,i){var u,M=t._data,o=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=o.length>0?function t(n,e,r,i,u,M,o){var c=[];if(e===r.length-1)for(var N=0;N<i;N++)c[N]=o?n(M,u[N]):n(u[N],M);else for(var a=0;a<i;a++)c[a]=t(n,e+1,r,r[e+1],u[a],M,o);return c}(N,0,o,o[0],M,e,i):[];return t.createDenseMatrix({data:a,size:Vr(o),datatype:u})}});OM("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 Ac=OM("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){ir(t)&&(n=!0,r[e]=t.toNumber())})),n}(t)?new i(1):1;if(function(t){t.forEach((function(t){if("number"!=typeof t||!du(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 M=[];return t.length>0?aM(M,t,e):M}});function fc(t,n,e,r){if(!(this instanceof fc))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}fc.prototype=new Error,fc.prototype.constructor=Error,fc.prototype.name="ArgumentsError",fc.prototype.isArgumentsError=!0;OM("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)}})});iM.signature="any, any";var pc=OM("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=M(t,u),N=ar(t)?t._data:t,a=ar(t)?t._datatype||t.getDataType():void 0,D=ar(u)?u._data:u,s=ar(u)?u._datatype||u.getDataType():void 0,T=2===o(t).length,g=2===o(u).length,I=e,l=r;if(a&&s&&a===s&&"string"==typeof a&&"mixed"!==a){var y=a;I=n.find(e,[y,y]),l=n.find(r,[y,y])}if(!T&&!g){for(var j=l(i(N[0]),D[0]),h=1;h<c;h++)j=I(j,l(i(N[h]),D[h]));return j}if(!T&&g){for(var x=l(i(N[0]),D[0][0]),z=1;z<c;z++)x=I(x,l(i(N[z]),D[z][0]));return x}if(T&&!g){for(var O=l(i(N[0][0]),D[0]),E=1;E<c;E++)O=I(O,l(i(N[E][0]),D[E]));return O}if(T&&g){for(var A=l(i(N[0][0]),D[0][0]),f=1;f<c;f++)A=I(A,l(i(N[f][0]),D[f][0]));return A}},"SparseMatrix, SparseMatrix":function(t,n){M(t,n);var i=t._index,u=t._values,o=n._index,c=n._values,N=0,a=e,D=r,s=0,T=0;for(;s<i.length&&T<o.length;){var g=i[s],I=o[T];g<I?s++:g>I?T++:g===I&&(N=a(N,D(u[s],c[T])),s++,T++)}return N}});function M(t,n){var e,r,i=o(t),u=o(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 o(t){return ar(t)?t.size():u(t)}}),Cc="number | BigNumber | Fraction | Matrix | Array";"".concat(Cc,", ").concat(Cc,", ...").concat(Cc);var Uc=OM("multiply",["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],t=>{var{typed:n,matrix:e,addScalar:r,multiplyScalar:i,equalScalar:u,dot:M}=t,o=Oc({typed:n,equalScalar:u}),c=Ec({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,M=t._data,o=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._size,D=e._datatype||e.getDataType(),s=o[0],T=a[1],g=r,I=i;c&&D&&c===D&&"string"==typeof c&&"mixed"!==c&&(u=c,g=n.find(r,[u,u]),I=n.find(i,[u,u]));for(var l=[],y=0;y<T;y++){for(var j=I(M[0],N[0][y]),h=1;h<s;h++)j=g(j,I(M[h],N[h][y]));l[y]=j}return t.createDenseMatrix({data:l,size:[T],datatype:c===t._datatype&&D===e._datatype?u:void 0})}(t,e)}var D=n("_multiplyMatrixVector",{"DenseMatrix, any":function(t,e){var u,M=t._data,o=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._datatype||e.getDataType(),D=o[0],s=o[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 I=[],l=0;l<D;l++){for(var y=M[l],j=g(y[0],N[0]),h=1;h<s;h++)j=T(j,g(y[h],N[h]));I[l]=j}return t.createDenseMatrix({data:I,size:[D],datatype:c===t._datatype&&a===e._datatype?u:void 0})},"SparseMatrix, any":function(t,e){var M=t._values,o=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(!M)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var a,D=e._data,s=e._datatype||e.getDataType(),T=t._size[0],g=e._size[0],I=[],l=[],y=[],j=r,h=i,x=u,z=0;N&&s&&N===s&&"string"==typeof N&&"mixed"!==N&&(a=N,j=n.find(r,[a,a]),h=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=D[A];if(!x(f,z))for(var p=c[A],C=c[A+1],U=p;U<C;U++){var d=o[U];E[d]?O[d]=j(O[d],h(f,M[U])):(E[d]=!0,l.push(d),O[d]=h(f,M[U]))}}for(var L=l.length,w=0;w<L;w++){var Q=l[w];I[w]=O[Q]}return y[1]=l.length,t.createSparseMatrix({values:I,index:l,ptr:y,size:[T,1],datatype:N===t._datatype&&s===e._datatype?a:void 0})}}),s=n("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(t,e){var u,M=t._data,o=t._size,c=t._datatype||t.getDataType(),N=e._data,a=e._size,D=e._datatype||e.getDataType(),s=o[0],T=o[1],g=a[1],I=r,l=i;c&&D&&c===D&&"string"==typeof c&&"mixed"!==c&&"mixed"!==c&&(u=c,I=n.find(r,[u,u]),l=n.find(i,[u,u]));for(var y=[],j=0;j<s;j++){var h=M[j];y[j]=[];for(var x=0;x<g;x++){for(var z=l(h[0],N[0][x]),O=1;O<T;O++)z=I(z,l(h[O],N[O][x]));y[j][x]=z}}return t.createDenseMatrix({data:y,size:[s,g],datatype:c===t._datatype&&D===e._datatype?u:void 0})},"DenseMatrix, SparseMatrix":function(t,e){var M=t._data,o=t._size,c=t._datatype||t.getDataType(),N=e._values,a=e._index,D=e._ptr,s=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,I=o[0],l=s[1],y=r,j=i,h=u,x=0;c&&T&&c===T&&"string"==typeof c&&"mixed"!==c&&(g=c,y=n.find(r,[g,g]),j=n.find(i,[g,g]),h=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:[I,l],datatype:c===t._datatype&&T===e._datatype?g:void 0}),f=0;f<l;f++){E[f]=O.length;var p=D[f],C=D[f+1];if(C>p)for(var U=0,d=0;d<I;d++){for(var L=d+1,w=void 0,Q=p;Q<C;Q++){var S=a[Q];U!==L?(w=j(M[d][S],N[Q]),U=L):w=y(w,j(M[d][S],N[Q]))}U!==L||h(w,x)||(O.push(d),z.push(w))}}return E[l]=O.length,A},"SparseMatrix, DenseMatrix":function(t,e){var M=t._values,o=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(!M)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var a,D=e._data,s=e._datatype||e.getDataType(),T=t._size[0],g=e._size[0],I=e._size[1],l=r,y=i,j=u,h=0;N&&s&&N===s&&"string"==typeof N&&"mixed"!==N&&(a=N,l=n.find(r,[a,a]),y=n.find(i,[a,a]),j=n.find(u,[a,a]),h=n.convert(0,a));for(var x=[],z=[],O=[],E=t.createSparseMatrix({values:x,index:z,ptr:O,size:[T,I],datatype:N===t._datatype&&s===e._datatype?a:void 0}),A=[],f=[],p=0;p<I;p++){O[p]=z.length;for(var C=p+1,U=0;U<g;U++){var d=D[U][p];if(!j(d,h))for(var L=c[U],w=c[U+1],Q=L;Q<w;Q++){var S=o[Q];f[S]!==C?(f[S]=C,z.push(S),A[S]=y(d,M[Q])):A[S]=l(A[S],y(d,M[Q]))}}for(var k=O[p],v=z.length,Y=k;Y<v;Y++){var m=z[Y];x[Y]=A[m]}}return O[I]=z.length,E},"SparseMatrix, SparseMatrix":function(t,e){var u,M=t._values,o=t._index,c=t._ptr,N=t._datatype||void 0===t._data?t._datatype:t.getDataType(),a=e._values,D=e._index,s=e._ptr,T=e._datatype||void 0===e._data?e._datatype:e.getDataType(),g=t._size[0],I=e._size[1],l=M&&a,y=r,j=i;N&&T&&N===T&&"string"==typeof N&&"mixed"!==N&&(u=N,y=n.find(r,[u,u]),j=n.find(i,[u,u]));for(var h,x,z,O,E,A,f,p,C=l?[]:void 0,U=[],d=[],L=t.createSparseMatrix({values:C,index:U,ptr:d,size:[g,I],datatype:N===t._datatype&&T===e._datatype?u:void 0}),w=l?[]:void 0,Q=[],S=0;S<I;S++){d[S]=U.length;var k=S+1;for(E=s[S],A=s[S+1],O=E;O<A;O++)if(p=D[O],l)for(x=c[p],z=c[p+1],h=x;h<z;h++)f=o[h],Q[f]!==k?(Q[f]=k,U.push(f),w[f]=j(a[O],M[h])):w[f]=y(w[f],j(a[O],M[h]));else for(x=c[p],z=c[p+1],h=x;h<z;h++)f=o[h],Q[f]!==k&&(Q[f]=k,U.push(f));if(l)for(var v=d[S],Y=U.length,m=v;m<Y;m++){var R=U[m];C[m]=w[R]}}return d[I]=U.length,L}});return n("multiply",i,{"Array, Array":n.referTo("Matrix, Matrix",t=>(n,r)=>{N(oM(n),oM(r));var i=t(e(n),e(r));return ar(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 M(t,n)}(t,n,e[0]):a(t,n):1===r.length?D(t,n):s(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 o(t,n,i,!1)},"DenseMatrix, any":function(t,n){return c(t,n,i,!1)},"any, SparseMatrix":function(t,n){return o(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 dc=AM({config:Kr}),Lc=CM({}),wc=YM({}),Qc=mM({}),Sc=RM({Matrix:Qc}),kc=to({BigNumber:dc,Complex:Lc,DenseMatrix:Sc,Fraction:wc}),vc=Bo({typed:kc}),Yc=_o({typed:kc}),mc=nc({config:Kr,typed:kc}),Rc=Dc({typed:kc}),Fc=jc({Matrix:Qc,equalScalar:mc,typed:kc}),bc=hc({DenseMatrix:Sc,Matrix:Qc,SparseMatrix:Fc,typed:kc}),Bc=zc({matrix:bc,config:Kr,typed:kc}),Zc=Ac({BigNumber:dc,config:Kr,matrix:bc,typed:kc}),Vc=pc({addScalar:vc,conj:Yc,multiplyScalar:Rc,size:Bc,typed:kc}),Wc=Uc({addScalar:vc,dot:Vc,equalScalar:mc,matrix:bc,multiplyScalar:Rc,typed:kc});function Gc(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=_e()(t);if(n&&e){var M=qc(t),o=Kc(M,e,n),c=Jc(t,o);u=_e()(c).pop()}if(r&&i){var N=[].concat(u).reverse(),a=qc(N),D=Kc(a,i,r),s=1-D,T=Jc(u,s);u=T[0]}return u}function Pc(t,n){var e=t.x-n.x,r=t.y-n.y;return Math.sqrt(e*e+r*r)}function Jc(t,n){switch(t.length){case 2:return function(t,n){var e=Hc(t,n);return[[t[0],e],[e,_e()(t).pop()]]}(t,n);case 3:return function(t,n){var e=[t[0],t[1]],r=[t[1],t[2]],i=Hc(e,n),u=Hc(r,n),M=Hc([i,u],n);return[[t[0],i,M],[M,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=Hc(e,n),M=Hc(r,n),o=Hc(i,n),c=Hc([u,M],n),N=Hc([M,o],n),a=Hc([c,N],n);return[[t[0],u,c,a],[a,N,o,t[3]]]}(t,n);default:return null}}function Hc(t,n){var e=He()(t,1)[0],r=_e()(t).pop(),i=e.x+(r.x-e.x)*n;return{y:e.y+(r.y-e.y)*n,x:i}}function Kc(t,n,e){for(var r=t.size(),i=function(t){switch(t){case 1:return Wc(Xc(1e3,1),bc([[1,0],[-1,1]]));case 2:return Wc(Xc(1e3,2),bc([[1,0,0],[-2,2,0],[1,-2,1]]));case 3:return Wc(Xc(1e3,3),bc([[1,0,0,0],[-3,3,0,0],[3,-6,3,0],[-1,3,-3,1]]));default:return null}}(He()(r,1)[0]-1),u=function(t,n){var e=-t.x,r=-t.y,i=[],u=[];n.forEach((function(t,n){switch(He()(n,2)[1]){case 0:i.push(t+e);break;case 1:u.push(t+r)}}));for(var M=[],o=0;o<i.length;o++)M.push(Math.sqrt(i[o]*i[o]+u[o]*u[o]));return M}(n,Wc(i,t)),M=u.length-1,o=0;o<u.length;o++)if(u[o]>=e){M=o;break}return.001*M}function Xc(t,n){var e=1/t,r=0,i=Zc(t+1,n+1).map((function(t,n){var i=null;switch(He()(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 bc(i)}function qc(t){var n=t.map((function(t){return[t.x,t.y]}));return bc(n)}function _c(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,M,o=2===t.length?(n=t,e=He()(n,2),r=e[0],i=e[1],u=[r.x,i.x],M=[r.y,i.y],{min:{x:Math.min.apply(0,u),y:Math.min.apply(0,M)},max:{x:Math.max.apply(0,u),y:Math.max.apply(0,M)}}):function(t){for(var n,e,r,i,u,M,o,c,N=He()(t,4),a=N[0],D=N[1],s=N[2],T=N[3],g=[],I=[],l=[],y=0;y<2;++y)if(0===y?(e=6*a.x-12*D.x+6*s.x,n=-3*a.x+9*D.x-9*s.x+3*T.x,r=3*D.x-3*a.x):(e=6*a.y-12*D.y+6*s.y,n=-3*a.y+9*D.y-9*s.y+3*T.y,r=3*D.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(o=e*e-4*r*n)<0?Math.abs(o)<1e-12&&(i=-e/(2*n))>0&&i<1&&g.push(i):(c=Math.sqrt(o),(u=(-e+c)/(2*n))>0&&u<1&&g.push(u),(M=(-e-c)/(2*n))>0&&M<1&&g.push(M));var j,h=g.length;for(;h--;)i=g[h],j=1-i,I[h]=j*j*j*a.x+3*j*j*i*D.x+3*j*i*i*s.x+i*i*i*T.x,l[h]=j*j*j*a.y+3*j*j*i*D.y+3*j*i*i*s.y+i*i*i*T.y;return I.push(a.x,T.x),l.push(a.y,T.y),{min:{x:Math.min.apply(0,I),y:Math.min.apply(0,l)},max:{x:Math.max.apply(0,I),y:Math.max.apply(0,l)}}}(t),c=2===t.length?1:0;return[{x:o.min.x,y:o.min.y-c},{x:o.max.x,y:o.min.y-c},{x:o.max.x,y:o.max.y+c},{x:o.min.x,y:o.max.y+c}]}var $c=e(3),tN=e.n($c),nN=e(0),eN=e.n(nN),rN=e(4),iN=e.n(rN),uN=function(){function t(n){Qt()(this,t),Yt()(this,"ctx",void 0),Yt()(this,"playData",void 0),Yt()(this,"options",void 0),Yt()(this,"courtTypeConstants",void 0),this.ctx=n.ctx,this.playData=n.playData,this.options=n.options?n.options:{},this.courtTypeConstants=n.courtTypeConstants}return kt()(t,[{key:"apply",value:function(){this.ctx.save(),this.drawLogic(),this.ctx.restore()}},{key:"drawLogic",value:function(){}}]),t}();function MN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var oN=function(t){iN()(e,t);var n=MN(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(uN);function cN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var NN=function(t){iN()(e,t);var n=cN(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),aN=.1667,DN=1.5,sN=2.4,TN=.55,gN=!1,IN=480,lN=460,yN="#C49463",jN=60.5,hN=127.28125,xN=60,zN=1.41667,ON=26,EN=.5,AN=4,fN=6,pN=5,CN=3.58333,UN=5,dN=37,LN=15,wN=20,QN=5,SN=2,kN=.5,vN=1.5,YN=18,mN=95,RN=390,FN=330,bN=90,BN=2.5,ZN=13;function VN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var WN=function(t){iN()(e,t);var n=VN(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:xN},n={x:this.courtCenter.x,y:xN+jN},e="transparent"===this.options.lineColor?"transparent":yN;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,mN,r,i,!1);var u=GN(n,mN,i),M=GN(n,mN,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(M.x,M.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,bN-3),this.ctx.lineTo(bN-3,bN-3),this.ctx.lineTo(bN-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-vN,YN/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,ON/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(bN,0,ZN,Math.PI/4,Math.PI+Math.PI/20,!1),this.ctx.stroke(),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(bN,bN,ZN,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.beginPath(),this.ctx.arc(0,bN,ZN,Math.PI/4,Math.PI+Math.PI/2.2,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);function GN(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function PN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var JN=function(t){iN()(e,t);var n=PN(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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:xN};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(bN,0),this.ctx.stroke(),this.drawBaseSquare(bN,0),this.drawBaseSquare(bN+BN/2,bN-BN/2),this.drawBaseSquare(BN,bN-BN),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*FN,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,RN-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,BN),this.ctx.lineTo(-BN,BN),this.ctx.lineTo(-BN,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);function HN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var KN=function(t){iN()(e,t);var n=HN(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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:xN},e={x:n.x-zN/2,y:n.y+zN},r={x:n.x+zN/2,y:n.y+zN};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-zN/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-zN/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+zN/2),t.ctx.beginPath();var r=zN/2+EN;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,zN/2),t.ctx.lineTo(e*(r+AN),zN/2),t.ctx.lineTo(e*(r+AN),zN/2-fN),t.ctx.lineTo(e*r,zN/2-fN),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+zN/2-fN+zN/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-pN),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(CN/2),0),t.ctx.lineTo(n*(CN/2),pN),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-ON/2),t.ctx.beginPath(),t.ctx.arc(e*dN,0,UN/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*bN,-(LN+QN)),t.ctx.lineTo(e*bN,-LN),t.ctx.lineTo(e*(bN-wN),-LN),t.ctx.lineTo(e*(bN-wN),-(LN+QN)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(oN);function XN(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var qN=function(t){iN()(e,t);var n=XN(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:xN+jN};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(SN/2,0),this.ctx.lineTo(SN/2,kN),this.ctx.lineTo(-SN/2,kN),this.ctx.lineTo(-SN/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);function _N(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var $N=function(t){iN()(e,t);var n=_N(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),ta=.1667,na=1.5,ea=2.4,ra=.55,ia=!1,ua=280,Ma=260,oa="#C49463",ca="#E4CCB7",Na=43,aa=127.28125,Da=25,sa=1.41667,Ta=26,ga=.5,Ia=4,la=6,ya=5,ja=3.58333,ha=5,xa=37,za=8,Oa=15,Ea=3,Aa=5,fa=1,pa=0,Ca=16,Ua=60,da=220,La=190,wa=60,Qa=2.5,Sa=13;function ka(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var va=function(t){iN()(e,t);var n=ka(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Da},n={x:this.courtCenter.x,y:Da+Na},e="transparent"===this.options.lineColor?"transparent":oa;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,Ua,r,i,!1);var u=Ya(n,Ua,i),M=Ya(n,Ua,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(M.x,M.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":ca,this.ctx.beginPath(),this.ctx.arc(n.x,n.y-pa,Ca/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,Ta/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);function Ya(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}function ma(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ra=function(t){iN()(e,t);var n=ma(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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:Da};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(wa,0),this.ctx.stroke(),this.drawBaseSquare(wa,0),this.drawBaseSquare(wa+Qa/2,wa-Qa/2),this.drawBaseSquare(Qa,wa-Qa),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*La,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,da-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,Qa),this.ctx.lineTo(-Qa,Qa),this.ctx.lineTo(-Qa,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ba=function(t){iN()(e,t);var n=Fa(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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:Da},e={x:n.x-sa/2,y:n.y+sa},r={x:n.x+sa/2,y:n.y+sa};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-sa/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-sa/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+sa/2),t.ctx.beginPath();var r=sa/2+ga;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,sa/2),t.ctx.lineTo(e*(r+Ia),sa/2),t.ctx.lineTo(e*(r+Ia),sa/2-la),t.ctx.lineTo(e*r,sa/2-la),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+sa/2-la+sa/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-ya),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(ja/2),0),t.ctx.lineTo(n*(ja/2),ya),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-Ta/2),t.ctx.beginPath(),t.ctx.arc(e*xa,0,ha/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*wa,-(za+Ea)),t.ctx.lineTo(e*wa,-za),t.ctx.lineTo(e*(wa-Oa),-za),t.ctx.lineTo(e*(wa-Oa),-(za+Ea)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Za=function(t){iN()(e,t);var n=Ba(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Da+Na-fa/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(Aa/2,0),this.ctx.lineTo(Aa/2,fa),this.ctx.lineTo(-Aa/2,fa),this.ctx.lineTo(-Aa/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN),Va=300,Wa=260,Ga="#C49463",Pa="#E4CCB7",Ja=40,Ha=127.28125,Ka=25,Xa=1.41667,qa=26,_a=.5,$a=4,tD=6,nD=5,eD=3.58333,rD=5,iD=37,uD=8,MD=15,oD=3,cD=5,ND=1,aD=0,DD=16,sD=60,TD=225,gD=200,ID=60,lD=2.5,yD=13;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var hD=function(t){iN()(e,t);var n=jD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Ka},n={x:this.courtCenter.x,y:Ka+Ja},e="transparent"===this.options.lineColor?"transparent":Ga;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,sD,r,i,!1);var u=xD(n,sD,i),M=xD(n,sD,r);this.ctx.moveTo(u.x,u.y),this.ctx.lineTo(t.x,t.y-Math.sqrt(18)),this.ctx.lineTo(M.x,M.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":Pa,this.ctx.beginPath(),this.ctx.arc(n.x,n.y-aD,DD/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,qa/2,0,2*Math.PI,!0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);function xD(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var OD=function(t){iN()(e,t);var n=zD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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:Ka};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(ID,0),this.ctx.stroke(),this.drawBaseSquare(ID,0),this.drawBaseSquare(ID+lD/2,ID-lD/2),this.drawBaseSquare(lD,ID-lD),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*gD,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,TD-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,lD),this.ctx.lineTo(-lD,lD),this.ctx.lineTo(-lD,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);function ED(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var AD=function(t){iN()(e,t);var n=ED(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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:Ka},e={x:n.x-Xa/2,y:n.y+Xa},r={x:n.x+Xa/2,y:n.y+Xa};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-Xa/2),this.ctx.lineTo(n.x,n.y),this.ctx.lineTo(e.x,e.y-Xa/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+Xa/2),t.ctx.beginPath();var r=Xa/2+_a;t.ctx.moveTo(e*r,0),t.ctx.lineTo(e*r,Xa/2),t.ctx.lineTo(e*(r+$a),Xa/2),t.ctx.lineTo(e*(r+$a),Xa/2-tD),t.ctx.lineTo(e*r,Xa/2-tD),t.ctx.lineTo(e*r,0),t.ctx.lineTo(e*r,0),t.ctx.stroke(),t.ctx.restore()}));var i=n.y+Xa/2-tD+Xa/2;[-1,1].forEach((function(n){t.ctx.save(),t.ctx.translate(t.courtCenter.x,i-nD),t.ctx.beginPath(),t.ctx.moveTo(0,0),t.ctx.lineTo(n*(eD/2),0),t.ctx.lineTo(n*(eD/2),nD),t.ctx.stroke(),t.ctx.restore()})),[-1,1].forEach((function(e){t.ctx.save(),t.ctx.translate(t.courtCenter.x,n.y-qa/2),t.ctx.beginPath(),t.ctx.arc(e*iD,0,rD/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*ID,-(uD+oD)),t.ctx.lineTo(e*ID,-uD),t.ctx.lineTo(e*(ID-MD),-uD),t.ctx.lineTo(e*(ID-MD),-(uD+oD)),t.ctx.stroke(),t.ctx.restore()}))}}]),e}(oN);function fD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var pD=function(t){iN()(e,t);var n=fD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"original",value:function(){return!1}},{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t={x:this.courtCenter.x,y:Ka+Ja-ND/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(cD/2,0),this.ctx.lineTo(cD/2,ND),this.ctx.lineTo(-cD/2,ND),this.ctx.lineTo(-cD/2,0),this.ctx.lineTo(0,0),this.ctx.stroke(),this.ctx.fill(),this.ctx.restore()}}]),e}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var UD=function(t){iN()(e,t);var n=CD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function dD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var LD=function(t){iN()(e,t);var n=dD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function wD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var QD=function(t){iN()(e,t);var n=wD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function SD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var kD=function(t){iN()(e,t);var n=SD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function vD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var YD=function(t){iN()(e,t);var n=vD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function mD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var RD=function(t){iN()(e,t);var n=mD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function FD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var bD=function(t){iN()(e,t);var n=FD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function BD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ZD=function(t){iN()(e,t);var n=BD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function VD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var WD=function(t){iN()(e,t);var n=VD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function GD(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var PD=function(t){iN()(e,t);var n=GD(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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},M=Math.asin((this.courtTypeConstants.THREE_POINT_ASIN_APPROX-.75-.5)/this.courtTypeConstants.THREE_POINT_ARC_RADIUS),o=Math.PI-M;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,o,M,!0),this.ctx.lineTo(i.x,i.y),this.ctx.stroke()}}]),e}(oN),JD=.1667,HD=1.5,KD=1,XD=.33,qD=!0;function _D(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var $D=function(t){iN()(e,t);var n=_D(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),ts={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 ns(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var es=function(t){iN()(e,t);var n=ns(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}}]),e}(oN);Object.assign(es.prototype,ts);var rs=50,is=94,us=22,Ms=23.6762,os=10,cs=14,Ns=12,as=16,Ds=!0,ss=!0,Ts=!0;function gs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Is=function(t){iN()(e,t);var n=gs(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),ls=49.21,ys=91.86,js=21.65,hs=22.15,xs=6,zs=8,Os=12,Es=16.08,As=!1,fs=!1,ps=!1;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Us=function(t){iN()(e,t);var n=Cs(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}}]),e}(oN);Object.assign(Us.prototype,ts);var ds=50,Ls=94,ws=22,Qs=23.6762,Ss=10,ks=14,vs=12,Ys=16,ms=!0,Rs=!0,Fs=!0,bs={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 Bs(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Zs=function(t){iN()(e,t);var n=Bs(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}}]),e}(oN);Object.assign(Zs.prototype,bs);var Vs=50,Ws=94,Gs=20.75,Ps=20.75,Js=2,Hs=6,Ks=12,Xs=12,qs=!1,_s=!1,$s=!1;function tT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var nT=function(t){iN()(e,t);var n=tT(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}}]),e}(oN);Object.assign(nT.prototype,bs);var eT=50,rT=94,iT=20.75,uT=20.75,MT=2,oT=6,cT=12,NT=12,aT=!1,DT=!1,sT=!0;function TT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var gT=function(t){iN()(e,t);var n=TT(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}}]),e}(oN);Object.assign(gT.prototype,bs);var IT=50,lT=84,yT=19.75,jT=19.75,hT=2,xT=6,zT=12,OT=12,ET=!1,AT=!1,fT=!1;function pT(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var CT=function(t){iN()(e,t);var n=pT(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}}]),e}(oN);Object.assign(CT.prototype,bs);var UT=42,dT=74,LT=19.75,wT=19.75,QT=2,ST=6,kT=12,vT=12,YT=!1,mT=!1,RT=!1;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var bT=function(t){iN()(e,t);var n=FT(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}}]),e}(oN);Object.assign(bT.prototype,ts);var BT=50,ZT=94,VT=21.65,WT=22.15,GT=6,PT=9,JT=12,HT=16,KT=!0,XT=!0,qT=!0;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var $T=function(t){iN()(e,t);var n=_T(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function tg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ng=function(t){iN()(e,t);var n=tg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function eg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var rg=function(t){iN()(e,t);var n=eg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function ig(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ug=function(t){iN()(e,t);var n=ig(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Mg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var og=function(t){iN()(e,t);var n=Mg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"reflection",value:function(){return!0}},{key:"drawLogic",value:function(){var t=this,n=[3,this.courtTypeConstants.HASH_MARK_FROM_SIDELINE_DISTANCE,this.courtTypeConstants.COURT_RECT_WIDTH-this.courtTypeConstants.HASH_MARK_FROM_SIDELINE_DISTANCE-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},M={x:n+3,y:e-i};t.ctx.beginPath(),t.ctx.moveTo(u.x,u.y),t.ctx.lineTo(M.x,M.y),t.ctx.stroke()}}))},r=this.courtTypeConstants.END_ZONE_HEIGHT+15;r<=this.courtCenter.y;r+=15)e(r);this.ctx.restore()}}]),e}(oN);function cg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ng=function(t){iN()(e,t);var n=cg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),ag=.32,Dg=1.5,sg=2,Tg=.55,gg=!1,Ig=160,lg=360,yg=30,jg=53,hg=160,xg=360,zg=30,Og=70.916,Eg=160,Ag=360,fg=30,pg=60;function Cg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ug=function(t){iN()(e,t);var n=Cg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function dg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Lg=function(t){iN()(e,t);var n=dg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function wg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Qg=function(t){iN()(e,t);var n=wg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Sg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var kg=function(t){iN()(e,t);var n=Sg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Yg=function(t){iN()(e,t);var n=vg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function mg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Rg=function(t){iN()(e,t);var n=mg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Fg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var bg=function(t){iN()(e,t);var n=Fg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Bg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Zg=function(t){iN()(e,t);var n=Bg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),Vg=.1667,Wg=1.5,Gg=2,Pg=.55,Jg=!0;function Hg(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Kg=function(t){iN()(e,t);var n=Hg(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),Xg=85,qg=200,_g="#C8102E",$g="#0032A0",tI=64,nI=25,eI=44,rI=.75,iI=15,uI=6,MI=3,oI=4;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var NI=function(t){iN()(e,t);var n=cI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),aI=100,DI=200,sI="#C8102E",TI="#0032A0",gI=58,II=29,lI=44,yI=.75,jI=15,hI=6,xI=3,zI=5.8;function OI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var EI=function(t){iN()(e,t);var n=OI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function AI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var fI=function(t){iN()(e,t);var n=AI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),pI=.1667,CI=1.5,UI=1,dI=.33,LI=!0;function wI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var QI=function(t){iN()(e,t);var n=wI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function SI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var kI=function(t){iN()(e,t);var n=SI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function vI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var YI=function(t){iN()(e,t);var n=vI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),mI=60,RI=110,FI=10,bI=20;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ZI=function(t){iN()(e,t);var n=BI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function VI(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var WI=function(t){iN()(e,t);var n=VI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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 M={x:n.x,y:n.y-2.84},o=Math.PI/4,c=Math.PI/2+Math.PI/4;this.ctx.beginPath(),this.ctx.arc(M.x,M.y,14.43,o,c,!1),this.ctx.stroke();var N=GI(M,14.43,c),a=GI(M,14.43,o),D=n.x-2.84,s=n.x+2.84;this.ctx.beginPath(),this.ctx.moveTo(N.x,N.y),this.ctx.lineTo(D,n.y),this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(a.x,a.y),this.ctx.lineTo(s,n.y),this.ctx.stroke();var T={x:D-8.75,y:n.y},g={x:s+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 I=GI(M,14.43,Math.PI/2);this.ctx.beginPath(),this.ctx.moveTo(I.x,I.y-1),this.ctx.lineTo(I.x,I.y+1),this.ctx.stroke();for(var l=function(n){[1,-1].forEach((function(e){var r=Math.PI/2+Math.PI/10*e*n,i=GI(M,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++)l(y);var j={x:T.x,y:T.y-5},h={x:g.x,y:g.y-5};this.ctx.beginPath(),this.ctx.arc(j.x,j.y,.5,0,2*Math.PI,!1),this.ctx.arc(h.x,h.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}(oN);function GI(t,n,e){return{x:t.x+Math.cos(e)*n,y:t.y+Math.sin(e)*n}}var PI=60,JI=130,HI=20;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var XI=function(t){iN()(e,t);var n=KI(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),qI=.1667,_I=1.5,$I=1,tl=.33,nl=!0;function el(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var rl=function(t){iN()(e,t);var n=el(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ul=function(t){iN()(e,t);var n=il(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ol=function(t){iN()(e,t);var n=Ml(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Nl=function(t){iN()(e,t);var n=cl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function al(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Dl=function(t){iN()(e,t);var n=al(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),sl=85,Tl=180,gl=12,Il=12,ll=42.5;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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var jl=2,hl=function(t){iN()(e,t);var n=yl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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,jl,0,2*Math.PI,!0),this.ctx.stroke(),[jl,-jl].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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var zl=function(t){iN()(e,t);var n=xl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var El=function(t){iN()(e,t);var n=Ol(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Al(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var fl=function(t){iN()(e,t);var n=Al(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),pl=85,Cl=180,Ul=12,dl=12,Ll=11,wl="Concrete";function Ql(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Sl=function(t){iN()(e,t);var n=Ql(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var vl=function(t){iN()(e,t);var n=kl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ml=function(t){iN()(e,t);var n=Yl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Rl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Fl=function(t){iN()(e,t);var n=Rl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function bl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Bl=function(t){iN()(e,t);var n=bl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Zl(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Vl=function(t){iN()(e,t);var n=Zl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Gl=function(t){iN()(e,t);var n=Wl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Jl=function(t){iN()(e,t);var n=Pl(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),Hl=.1667,Kl=1.5,Xl=1,ql=.33,_l=!0,$l=60,ty=110,ny=10,ey=12,ry={width:44,height:18},iy={width:8,height:2.66},uy={width:20,height:6},My=60,oy=110,cy=10,Ny=12,ay={width:44,height:18},Dy={width:8,height:2.66},sy={width:20,height:6};function Ty(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var gy=function(t){iN()(e,t);var n=Ty(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Iy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ly=function(t){iN()(e,t);var n=Iy(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var jy=function(t){iN()(e,t);var n=yy(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),hy=70,xy=115,zy=10,Oy=12,Ey={width:44,height:18},Ay={width:8,height:2.66},fy={width:20,height:6};function py(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Cy=function(t){iN()(e,t);var n=py(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Uy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var dy=function(t){iN()(e,t);var n=Uy(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),Ly=60,wy=100,Qy=10,Sy=12,ky={width:44,height:18},vy={width:8,height:2.66},Yy={width:20,height:6};function my(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ry=function(t){iN()(e,t);var n=my(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Fy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var by=function(t){iN()(e,t);var n=Fy(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),By=45,Zy=65,Vy=8,Wy=10,Gy={width:24,height:12},Py={width:6,height:2},Jy={width:8,height:4};function Hy(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ky=function(t){iN()(e,t);var n=Hy(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),Xy=55,qy=80,_y=8,$y=10,tj={width:36,height:14},nj={width:6.16,height:2.16},ej={width:12,height:5};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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ij=function(t){iN()(e,t);var n=rj(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function uj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Mj=function(t){iN()(e,t);var n=uj(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var cj=function(t){iN()(e,t);var n=oj(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);function Nj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var aj=function(t){iN()(e,t);var n=Nj(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),Dj=.1667,sj=1.5,Tj=1,gj=.33,Ij=!0,lj=29.5,yj=59.1;function jj(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var hj=function(t){iN()(e,t);var n=jj(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var zj=function(t){iN()(e,t);var n=xj(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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.setColor("#b0ab9e"),this.ctx.beginPath(),this.ctx.lineWidth=6*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}(oN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ej,Aj,fj,pj,Cj,Uj,dj,Lj,wj,Qj,Sj,kj=function(t){iN()(e,t);var n=Oj(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(oN),vj=.1667,Yj=1.5,mj=1,Rj=.33,Fj=!0,bj=26.2467,Bj=52.4934,Zj=30,Vj=60,Wj=(Ej={},Yt()(Ej,bn,M),Yt()(Ej,Bn,a),Yt()(Ej,Qn,l),Yt()(Ej,vn,k),Yt()(Ej,Fn,F),Yt()(Ej,Yn,G),Yt()(Ej,mn,q),Yt()(Ej,Rn,rt),Yt()(Ej,Sn,It),Yt()(Ej,kn,jt),Ej),Gj=(Lj={},Yt()(Lj,bn,Yt()({},Ie,N)),Yt()(Lj,Bn,(Aj={},Yt()(Aj,le,T),Yt()(Aj,ye,I),Aj)),Yt()(Lj,Qn,(fj={},Yt()(fj,Zn,j),Yt()(fj,Vn,x),Yt()(fj,Wn,O),Yt()(fj,Gn,A),Yt()(fj,Pn,p),Yt()(fj,Jn,U),Yt()(fj,Hn,L),Yt()(fj,Kn,Q),fj)),Yt()(Lj,vn,{}),Yt()(Lj,Fn,(pj={},Yt()(pj,Te,B),Yt()(pj,ge,V),pj)),Yt()(Lj,Yn,(Cj={},Yt()(Cj,re,J),Yt()(Cj,ie,K),Cj)),Yt()(Lj,mn,(Uj={},Yt()(Uj,ue,$),Yt()(Uj,Me,nt),Uj)),Yt()(Lj,Rn,(dj={},Yt()(dj,ce,ot),Yt()(dj,Ne,Nt),Yt()(dj,ae,Dt),Yt()(dj,De,Tt),dj)),Yt()(Lj,Sn,{}),Yt()(Lj,kn,{}),Lj),Pj=(wj={},Yt()(wj,bn,o),Yt()(wj,Bn,D),Yt()(wj,Qn,y),Yt()(wj,vn,v),Yt()(wj,Fn,b),Yt()(wj,Yn,P),Yt()(wj,mn,_),Yt()(wj,Rn,it),Yt()(wj,Sn,lt),Yt()(wj,kn,ht),wj),Jj=(Qj={},Yt()(Qj,Ie,c),Yt()(Qj,le,s),Yt()(Qj,ye,g),Yt()(Qj,Zn,h),Yt()(Qj,Vn,z),Yt()(Qj,Wn,E),Yt()(Qj,Gn,f),Yt()(Qj,Pn,C),Yt()(Qj,Jn,d),Yt()(Qj,Hn,w),Yt()(Qj,Kn,S),Yt()(Qj,Xn,R),Yt()(Qj,qn,m),Yt()(Qj,$n,Y),Yt()(Qj,_n,Y),Yt()(Qj,Te,Z),Yt()(Qj,ge,W),Yt()(Qj,re,H),Yt()(Qj,ie,X),Yt()(Qj,ue,tt),Yt()(Qj,Me,et),Yt()(Qj,oe,Mt),Yt()(Qj,ce,ct),Yt()(Qj,Ne,at),Yt()(Qj,ae,st),Yt()(Qj,De,gt),Yt()(Qj,se,ut),Yt()(Qj,te,yt),Yt()(Qj,ne,xt),Yt()(Qj,ee,zt),Qj),Hj=(Sj={},Yt()(Sj,bn,{courtTypes:[Ie]}),Yt()(Sj,Bn,{courtTypes:[le,ye]}),Yt()(Sj,Qn,{courtTypes:[Zn,Vn,Wn,Gn,Pn,Jn,Hn,Kn]}),Yt()(Sj,vn,{courtTypes:[_n,Xn,qn]}),Yt()(Sj,Fn,{courtTypes:[Te,ge]}),Yt()(Sj,Yn,{courtTypes:[re,ie]}),Yt()(Sj,mn,{courtTypes:[ue,Me]}),Yt()(Sj,Rn,{courtTypes:[oe,ce,Ne,ae,De,se]}),Yt()(Sj,Sn,{courtTypes:[te]}),Yt()(Sj,kn,{courtTypes:[ne,ee]}),Sj);function Kj(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 Xj=function(){function t(n,e,r){Qt()(this,t),this.ctx=n,this.playData=e,this.options=r}return kt()(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(!Pj[this.playData.sport])throw new Error("unknown sport type constants");if(!Jj[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?Kj(Object(e),!0).forEach((function(n){Yt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Kj(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},Pj[this.playData.sport],{},Jj[this.playData.court.type])}}]),t}();function qj(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 _j(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var $j=function(t){iN()(e,t);var n=_j(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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!==(Pe.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,M=(this.playData.court.courtRect.size.height-i-1)*this.scale-r.height;this.ctx.drawImage(t,0,0,t.width,t.height,u,M,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(!Wj[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?qj(Object(e),!0).forEach((function(n){Yt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):qj(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},Wj[this.playData.sport],{},(Gj[this.playData.sport]||{})[this.playData.court.type]||{})}},{key:"background",get:function(){return this.options.background||this.courtTypeConstants.BACKGROUND||this.playData.sport}}]),e}(Xj),th=e(12),nh=e.n(th);function eh(t){var n,e=t.sport,r=t.ctx,i=t.staticData,u=t.center,M=t.puckRadius,o=t.placement,c=null==i||null===(n=i.balls)||void 0===n?void 0:n.find((function(t){return t.key===e}));if(!c)return!1;var N=.5*(2*M),a=u.x-N/2,D=u.y-N/2;if("overlapBottomRight"===o){var s=.65*M;a=u.x+s-N/2,D=u.y+s-N/2}return r.save(),r.drawImage(c.image,a,D,N,N),r.restore(),!0}var rh={maybeDrawBallAtStartPoint:function(t){var n,e,r,i,u,M,o=t.linePart,c=t.controlPoints,N=t.alreadyDrawn;if(!(null===(n=this.options)||void 0===n?void 0:n.showBallMode))return N;if(N)return!0;if("active"!==o.animationSegment)return!1;if(!(null===(e=this.line)||void 0===e?void 0:e.isBallTransferLine))return!1;var a=c[0];if(!a||!this.courtTypeConstants)return!1;var D=this.courtTypeConstants.PLAYER_TOKEN_SCALE*(null!==(r=null===(i=this.options)||void 0===i?void 0:i.playerTokenScale)&&void 0!==r?r:1),s=this.courtTypeConstants.PLAYER_TOKEN_RADIUS*D,T=((null===(u=this.options)||void 0===u?void 0:u.legacyPrintStyle)?1.2:1)*s;return eh({sport:this.playData.sport,ctx:this.ctx,staticData:null===(M=this.options)||void 0===M?void 0:M.staticData,center:{x:a.x,y:a.y},puckRadius:T,placement:"center"})},drawLineFromControlPoints:function(){var t=this;this.ctx.save(),this.setLineOptions(),this.ctx.lineJoin="round";var n=!1;this.getProcessedLinePaths().forEach((function(e){t.ctx.save(),"processed"===e.animationSegment&&t.setColor(.1),t.ctx.beginPath();var r=e.controlPoints;t.ctx.moveTo(r[0].x,r[0].y),2===r.length&&("DRIBBLE"===(t.line||t.shape||{}).type&&(t.ctx.lineCap="round"),t.ctx.lineTo(r[1].x,r[1].y)),3===r.length&&t.ctx.quadraticCurveTo(r[1].x,r[1].y,r[2].x,r[2].y),4===r.length&&t.ctx.bezierCurveTo(r[1].x,r[1].y,r[2].x,r[2].y,r[3].x,r[3].y),t.ctx.stroke(),n||(n=t.maybeDrawBallAtStartPoint({linePart:e,controlPoints:r,alreadyDrawn:n})),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},M={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(M.x,M.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),M=.5*Math.sin(i),o={x:r.x+u,y:r.y+M},c={x:r.x-u,y:r.y-M};n.drawPerpendicularLineAtCourtPoint(o,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=_e()(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=_e()(this.getProcessedLinePaths()).pop().controlPoints;return t[t.length-1]},setLineOptions:function(){}};function ih(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 uh(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?ih(Object(e),!0).forEach((function(n){Yt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ih(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function Mh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var oh=function(t){iN()(e,t);var n=Mh(e);function e(t,r){var i;return Qt()(this,e),(i=n.call(this,t)).line=r,Yt()(nh()(i),"lineWidth",void 0),Yt()(nh()(i),"debugMasking",void 0),Yt()(nh()(i),"startMaskSettings",void 0),Yt()(nh()(i),"endMaskSettings",void 0),i.lineWidth=t.lineWidth,i.debugMasking=!1,i.startMaskSettings=null,i.endMaskSettings=null,i}return kt()(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}},{key:"maybeDrawBallAtStartPoint",value:function(t){return!1}}]),kt()(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)}(this.options.linesHighlightedIds||[]).includes(this.line.id)&&(n=!0);var u=this.line.color,M=u.alpha,o=u.blue,c=u.green,N=u.red,a=n?0:Math.ceil(255*N),D=n?0:Math.ceil(255*c),s=n?255:Math.ceil(255*o),T=!!this.options.showBallMode&&!!this.options.animationGlobalProgress&&!1===this.options.showPassLinesDuringPlayback&&this.line.isBallTransferLine,g=T?0:null!=t?t:M,I="rgba(".concat(a,", ").concat(D,", ").concat(s,", ").concat(g,")");this.ctx.fillStyle=I,this.ctx.strokeStyle=I}},{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=Gc(r,t.startMaskSettings.radius,t.startMaskSettings.centerPoint),t.line.setLinePartsAdjustedAtIndex(e,uh({},n,{controlPoints:r}))),t.endMaskSettings&&(r=Gc(r,null,null,t.endMaskSettings.radius,t.endMaskSettings.centerPoint),t.line.setLinePartsAdjustedAtIndex(e,uh({},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=He()(i,1)[0];if(u.lineParts.length){var M=_e()(u.lineParts).pop(),o=_e()(M.controlPoints).pop();this.startMaskSettings={centerPoint:o,radius:3}}}}}if(this.line.playerPositionTerminus&&"SCREEN"!==this.line.type){var c=3.7,N=_e()(this.line.getLineParts()).pop(),a=_e()(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}(uN);function ch(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}Object.assign(oh.prototype,rh);var Nh=function(t){iN()(e,t);var n=ch(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"allowDrawLineCap",value:function(){return!this.line.hideLineTip&&!(this.options.magnetMode&&!this.options.animationGlobalProgress)}}]),e}(oh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Dh=function(t){iN()(e,t);var n=ah(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawArrowLineCap()}}]),e}(Nh),sh={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 $e(i[0],i[1],i[2],i[3]),M=[],o=0,c=1/u.length;o<=1;)M.push({x:u.mx(o),y:u.my(o),time:o}),o+=c;for(var N=[],a=[],D=0;D<M.length;D++)a.push(M[D]),a.length>1&&(N.push(a),a=[M[D]]);N.forEach((function(e,i){var u=He()(e,2),M=u[0],o=u[1],c={x:1.2*(o.x-M.x),y:1.2*(o.y-M.y)},a=(M.x+o.x)/2,D=(M.y+o.y)/2,s={x:-c.y,y:c.x};i%2&&(s={x:c.y,y:-c.x});var T=[M,{x:a+s.x,y:D+s.y},o];1!==t.length&&r!==t.length-1||i===N.length-1&&(T=[M,o]),n.push({controlPoints:T,lpIndex:r})}))})),n}},Th=function(t){return t===pt.SEQUENTIAL?"keyTimesSeq":"keyTimes"},gh=function(t,n){var e;return"keyTimesSeq"===n&&(null===(e=t.keyTimesSeq)||void 0===e?void 0:e.length)?t.keyTimesSeq:t.keyTimes},Ih=function(t){var n=[];return t.forEach((function(e,r){r&&n.push([t[r-1],e])})),n};function lh(t,n){if(Ft(t))return wn;var e=He()(n.controlPoints,4),r=e[0],i=e[1],u=e[2],M=e[3];return new $e(r,i,null!=u?u:null,null!=M?M:null).length/100}var yh=function(t){var n,e=t.timeline,r=t.lineAnimation,i=t.lineType,u=t.lineParts,M=null!==(n=u.length)&&void 0!==n?n:0,o=Ih(gh(r,e));if(o.length===M)return o;if(!o.length)return o;if(1===o.length&&(null==u?void 0:u.length)){var c=He()(o,1),N=He()(c[0],2),a=function(t){var n=t.start,e=t.end,r=t.lineParts,i=t.lineType,u=e-n;if(!Number.isFinite(u)||u<=0)return[[n,e]];for(var M=r.map((function(t){return lh(i,t)})),o=M.reduce((function(t,n){return t+(Number.isFinite(n)?n:0)}),0),c=o>0?M.map((function(t){return Number.isFinite(t)?t/o:0})):r.map((function(){return 1/r.length})),N=[n],a=n,D=0;D<c.length;D+=1){var s=D===c.length-1;a+=s?e-a:u*c[D],N.push(s?e:a)}return Ih(N)}({start:N[0],end:N[1],lineParts:u,lineType:i});if(a.length===M)return a}return o},jh=function(t){var n,e=t.mode,r=t.line,i=(t.players,Th(e)),u=null===(n=r.animations)||void 0===n?void 0:n[0];return u?yh({timeline:i,lineAnimation:u,lineType:r.type,lineParts:r.lineParts}):[]};function hh(t,n){var e=t.hideForStatic&&!n.inDrawingState?0:1;n.animationGlobalProgress&&(e=0,t.animations.map((function(t){var n=He()(t.keyTimes,2);return[n[0],n[1]]})).forEach((function(t){var r=He()(t,2),i=r[0],u=r[1],M=i-.03,o=i,c=u,N=u+.03;Rt.a.inRange(n.animationGlobalProgress,M,o)&&(e=10*(.03-(o-n.animationGlobalProgress))),Rt.a.inRange(n.animationGlobalProgress,i,u)&&(e=1),Rt.a.inRange(n.animationGlobalProgress,c,N)&&(e=10*(N-n.animationGlobalProgress))})));return e}function xh(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 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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Oh=function(t){iN()(e,t);var n=zh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"convertLinePartsToDribble",value:function(t){return[]}},{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawArrowLineCap()}},{key:"setLineOptions",value:function(){var t,n=this,e=_e()(this.line.getLineParts()),r=this.convertLinePartsToDribble(e),i=null!==(t=this.options.animationMode)&&void 0!==t?t:pt.SEQUENTIAL,u=jh({mode:i,line:this.line.originalData,players:this.playData.players});this.line.setLinePartsAdjusted([]),r.forEach((function(t){var e=t.controlPoints,r=t.lpIndex,i=He()(e,1)[0],M=void 0;if(n.options.animationGlobalProgress&&null!=r){var o=u[r];if(o){var c=He()(o,2),N=c[0],a=c[1];Rt.a.inRange(n.options.animationGlobalProgress,N,a)?M=bt(n.options.animationGlobalProgress,N,a)>i.time?"processed":"active":n.options.animationGlobalProgress>a&&(M="processed")}}n.line.addLinePartAdjusted(function(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?xh(Object(e),!0).forEach((function(n){Yt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):xh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},t,{controlPoints:e,animationSegment:M}))}))}}]),e}(Nh);function Eh(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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}Object.assign(Oh.prototype,sh);var fh=function(t){iN()(e,t);var n=Ah(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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?Eh(Object(e),!0).forEach((function(n){Yt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Eh(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}({},t,{controlPoints:[n[0],n[n.length-1]]})}))}}]),e}(oh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ch=function(t){iN()(e,t);var n=ph(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"setLineOptions",value:function(){this.ctx.setLineDash([1,.5])}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}}]),e}(oh);function Uh(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var dh=function(t){iN()(e,t);var n=Uh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"drawLineCap",value:function(){this.allowDrawLineCap()&&this.drawPerpendicularLineCap()}}]),e}(Nh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var wh=function(t){iN()(e,t);var n=Lh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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";var n=!1;this.getProcessedLinePaths().forEach((function(e){t.ctx.save(),"processed"===e.animationSegment&&t.setColor(.1),t.ctx.beginPath();var r=e.controlPoints;[-.3,.3].forEach((function(n){var e=r[0].x-r[r.length-1].x,i=r[0].y-r[r.length-1].y,u=n/Math.pow(e*e+i*i,.5),M=-i*u,o=e*u,c=r.map((function(t){return{x:t.x+M,y:t.y+o}}));t.ctx.moveTo(c[0].x,c[0].y),2===r.length&&t.ctx.lineTo(c[1].x,c[1].y),3===r.length&&t.ctx.quadraticCurveTo(c[1].x,c[1].y,c[2].x,c[2].y),4===r.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()})),n||(n=t.maybeDrawBallAtStartPoint({linePart:e,controlPoints:r,alreadyDrawn:n})),t.ctx.restore()})),this.ctx.restore()}}]),e}(Nh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Sh=function(t){iN()(e,t);var n=Qh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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(Rt.a.capitalize(n.type),"LineLayer");Et[e]&&new Et[e](t,n).apply()}})),this.ctx.restore())}},{key:"lineWidth",get:function(){return this.courtTypeConstants.LINE_WIDTH}}]),e}(Xj);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var vh=function(t){iN()(e,t);var n=kh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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 t===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})),M=t.staticData.playerHats.find((function(t){return!!(null==u?void 0:u.playerHatKey)&&t.key===u.playerHatKey}));if(M){!0===M.reverse&&(t.ctx.save(),t.ctx.translate(2*r,0),t.ctx.scale(-1,1));var o=M.dX,c=M.dY;t.ctx.drawImage(M.image,r-(2-4*o),i-(1.4+2*t.radius+2.8*c),4,2.8),!0===M.reverse&&t.ctx.restore()}}if(n.possession&&t.options.showBallMode)if(t.staticData.balls.find((function(t){return t.key===Qn}))){var N=(t.options.legacyPrintStyle?1.2:1)*t.radius;eh({sport:t.playData.sport,ctx:t.ctx,staticData:t.staticData,center:{x:r,y:i},puckRadius:N,placement:"overlapBottomRight"})}}})),this.ctx.restore())}},{key:"setPlayerPuckStyle",value:function(t){var n=t.color,e=n.red,r=n.green,i=n.blue,u=n.alpha,M=0===e&&0===r&&0===i&&1===u,o=this.options.position&&t.position===this.options.position,c=o?0:Math.ceil(255*e),N=o?0:Math.ceil(255*r),a=o?255:Math.ceil(255*i),D="rgba(".concat(c,", ").concat(N,", ").concat(a,", ").concat(u,")");t.isDefender&&!o&&M&&(D="#bb271b");var s=!this.options.showBallMode||this.options.highlightPlayerPuck;t.possession&&s&&(D="rgba(255, 128, 0, ".concat(u,")")),this.options.legacyPrintStyle&&(this.ctx.lineWidth=this.courtTypeConstants.LINE_WIDTH),this.ctx.fillStyle=this.options.legacyPrintStyle?"#FFFFFF":D,this.ctx.strokeStyle=this.options.legacyPrintStyle?"#000000":D}},{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 M=u.image.width<u.image.height,o=u.image.height<u.image.width,c=M?u.image.height/u.image.width:o?u.image.width/u.image.height:1,N=2*this.radius*(M?u.image.width/u.image.height:1)*c,a=2*this.radius*(o?u.image.height/u.image.width:1)*c,D=0-(o?N/2:this.radius),s=0-(M?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,D,s,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 I=g.User_Name.split(" ").map((function(t){return t[0]})).join("").slice(0,2);T=g.Initials||I,"Jersey number"===this.options.labelsOverrideType&&g.jersey_number&&(T="".concat(g.jersey_number))}}var l=t.color.alpha,y=(3-.5*T.length)*(this.options.legacyPrintStyle?1.3:1)*this.playerScale,j=(1-.15*T.length)*(this.options.legacyPrintStyle?1.4:1)*this.playerScale;if(l){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 h=e,x=r;this.options.flipPlayerLabels&&(h=0,x=0,this.ctx.save(),this.ctx.translate(e,r),this.ctx.rotate(Math.PI)),this.ctx.fillText(T,h,x+j),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}(Xj);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var mh=function(t){iN()(e,t);var n=Yh(e);function e(t,r){var i;return Qt()(this,e),i=n.call(this,t),Yt()(nh()(i),"shape",void 0),Yt()(nh()(i),"animationAlpha",void 0),i.shape=r,i.animationAlpha=hh(r,t.options),i}return kt()(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),M=Math.ceil(255*r),o=Math.ceil(255*e);this.ctx.fillStyle="rgba(".concat(u,", ").concat(M,", ").concat(o,", ").concat(n*this.animationAlpha,")"),this.ctx.strokeStyle="rgba(".concat(u,", ").concat(M,", ").concat(o,", ").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}(uN);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Fh=function(t){iN()(e,t);var n=Rh(e);function e(t,r){return Qt()(this,e),n.call(this,t,r)}return kt()(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}}]),kt()(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}(mh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}Object.assign(Fh.prototype,rh);var Bh=function(t){iN()(e,t);var n=bh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}}]),e}(Fh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Vh=function(t){iN()(e,t);var n=Zh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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(_e()(this.shape.linePart?[this.shape.linePart]:[]))}}]),e}(Fh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}Object.assign(Vh.prototype,sh);var Gh=function(t){iN()(e,t);var n=Wh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.handOffLineCap(this.getProcessedLinePaths())}}]),e}(Fh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Jh=function(t){iN()(e,t);var n=Ph(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawArrowLineCap()}},{key:"setLineOptions",value:function(){this.ctx.setLineDash([1,.5])}}]),e}(Fh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Kh=function(t){iN()(e,t);var n=Hh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"drawLine",value:function(){this.drawLineFromControlPoints()}},{key:"drawLineCap",value:function(){this.drawPerpendicularLineCap()}}]),e}(Fh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var qh=function(t){iN()(e,t);var n=Xh(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(mh);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=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var $h=function(t){iN()(e,t);var n=_h(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(mh);function tx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var nx=function(t){iN()(e,t);var n=tx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(mh);function ex(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var rx=function(t){iN()(e,t);var n=ex(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(mh);function ix(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ux=function(t){iN()(e,t);var n=ix(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(mh);function Mx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var ox=function(t){iN()(e,t);var n=Mx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(mh);function cx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Nx=function(t){iN()(e,t);var n=cx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(mh);function ax(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Dx=function(t){iN()(e,t);var n=ax(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.playData.shapes.forEach((function(n){var e=n.type.match("LINE.")?"".concat(Rt.a.capitalize(n.type.replace("LINE.","")),"Line"):Rt.a.capitalize(n.type),r="".concat(e,"ShapeLayer");At[r]&&new At[r](t,n).apply()})),this.ctx.restore()}}]),e}(Xj),sx=function(){function t(n){Qt()(this,t),Yt()(this,"originalData",void 0),Yt()(this,"adjustedData",void 0),this.originalData=JSON.parse(JSON.stringify(n)),this.adjustedData=JSON.parse(JSON.stringify(n))}return kt()(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 Tx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var gx={red:.502,green:.502,blue:.502,alpha:.35},Ix=function(t){iN()(e,t);var n=Tx(e);function e(t){var r;return Qt()(this,e),r=n.call(this,t),Yt()(nh()(r),"internalCanvas",void 0),r.internalCanvas=document.createElement("canvas"),r}return kt()(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),M=this._getLineInfo(u);if(M.width<t&&i<=r.length&&!M.hasLineBreak)i++;else{1!==i&&i--;var o=r.splice(0,i),c=this._getLineInfo(o);n.push(c),i=1;var N=!r.some((function(t){return"\n"!==t}));c.width&&M.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,M){if("\n"!==u){var o=_e()(u.matchAll(/(<player=(\d*)>)/gi)),c={text:u,width:o.length?n.internalCtx.measureText(u.replace(/<player=(\d*)>/,"")).width+2*n.playerTokenRadius:n.internalCtx.measureText(u).width};e+=c.width,M!==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},M=u.y+r.height;return i.x<=n&&n<=u.x&&i.y<=e&&e<=M}},{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")||gx}},{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}(sx);function lx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var yx=function(t){iN()(e,t);var n=lx(e);function e(){var t;Qt()(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)),Yt()(nh()(t),"animationAlpha",void 0),t}return kt()(e,[{key:"apply",value:function(){var t=this;this.ctx.save(),this.disableMirrorMode(),this.playData.notes.forEach((function(n){t.ctx.save(),t.animationAlpha=hh(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,M=Math.ceil(255*u),o=Math.ceil(255*i),c=Math.ceil(255*r);this.ctx.fillStyle="rgba(".concat(M,", ").concat(o,", ").concat(c,", ").concat(e*this.animationAlpha,")"),this.ctx.strokeStyle="rgba(".concat(M,", ").concat(o,", ").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(Ix.NOTE_WRAP_PADDING,t.fontSize+Ix.NOTE_WRAP_PADDING+t.lineHeight*r);var u=0;i.forEach((function(n,r){var M=_e()(n.text.matchAll(/(<player=(\d*)>)/gi));M.length&&0===M[0].index&&(e.drawPlayerToken(t,u,M[0][2]),u+=2*t.playerTokenRadius),e.ctx.fillStyle="rgba(0, 0, 0, ".concat(e.animationAlpha,")");var o=M.length?n.text.replace(/(<player=(\d*)>)/gi,""):n.text;e.ctx.fillText(o,u,-t.baseLineOffset),u+=n.width,M.length&&(u-=2*t.playerTokenRadius),M.length&&M[0].index>0&&(e.drawPlayerToken(t,u,M[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}(Xj);function jx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var hx=function(t){iN()(e,t);var n=jx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(Xj);function xx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var zx=function(t){iN()(e,t);var n=xx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(Xj);function Ox(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Ex=function(t){iN()(e,t);var n=Ox(e);function e(t){var r;return Qt()(this,e),r=n.call(this,t),Yt()(nh()(r),"lineParts",void 0),Yt()(nh()(r),"linePartsAdjusted",void 0),r.lineParts=t.lineParts,r.linePartsAdjusted=_e()(t.lineParts),r}return kt()(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:"addLinePartAdjusted",value:function(t){this.linePartsAdjusted.push(t)}},{key:"getLineParts",value:function(){return this.linePartsAdjusted.length?this.linePartsAdjusted:this.lineParts}},{key:"animationsByEndTime",value:function(t){return this._getAttr("animations").map((function(n){return Rt.a.last(t===pt.SEQUENTIAL&&n.keyTimesSeq||n.keyTimes)}))}},{key:"lastAnimEndTime",value:function(t){return Rt.a.max(this.animationsByEndTime(t))}},{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:"isBallTransferLine",get:function(){return Ft(this.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:"firstLinePartControlPoint",get:function(){return this.lineParts[0].controlPoints[0]}},{key:"lastLinePartControlPoint",get:function(){return _e()(_e()(this.lineParts).pop().controlPoints).pop()}}]),e}(sx);function Ax(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var fx=function(t){iN()(e,t);var n=Ax(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"setPossession",value:function(t){var n=this,e=this.startBallsCount;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:"startBallsCount",get:function(){var t=this._getAttr("startBallsCount");return"number"==typeof t?t:this.possession?1:0},set:function(t){this._setAttr("startBallsCount",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")}}]),e}(sx);function px(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Cx=function(t){iN()(e,t);var n=px(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"rectWrapperContains",value:function(t){var n=He()(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=He()(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=He()(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=He()(this.rectWrapPointsTranslated,3),r=e[0],i=e[1],u=e[2],M=this.computeRectWrapPointsTranslatedForPointAtIndex(t,n),o=He()(M,4),c=o[0],N=o[1],a=o[2],D=o[3];return{scale:{x:Pc(c,N)*this.scale.x/Pc(r,i),y:Pc(N,a)*this.scale.y/Pc(i,u)},location:this.computeCenterForRect([c,N,a,D])}}},{key:"computeRectWrapPointsTranslatedForPointAtIndex",value:function(t,n){var e=this,r=Bt(t.x,t.y,this.location.x,this.location.y,-this.angle),i=this.rectWrapPointsTranslated.map((function(t){return Bt(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 Bt(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 Bt(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=Bt(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=He()(this.rectWrapPointsTranslated,3),n=t[0],e=t[1],r=t[2];return+(Pc(n,e)*Pc(e,r)).toFixed(2)}}]),e}(sx);function Ux(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var dx=function(t){iN()(e,t);var n=Ux(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"rectWrapPointsPure",get:function(){return _c(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=Bt(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}(Cx);function Lx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var wx=function(t){iN()(e,t);var n=Lx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return e}(dx);function Qx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Sx=function(t){iN()(e,t);var n=Qx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return e}(dx);function kx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var vx=function(t){iN()(e,t);var n=kx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return e}(dx);function Yx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var mx=function(t){iN()(e,t);var n=Yx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return e}(dx);function Rx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Fx=function(t){iN()(e,t);var n=Rx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return e}(dx);function bx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Bx=function(t){iN()(e,t);var n=bx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(Cx);function Zx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Vx=function(t){iN()(e,t);var n=Zx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"outerCircleRadius",get:function(){return 5}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(Cx);function Wx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Gx=function(t){iN()(e,t);var n=Wx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(Cx);function Px(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Jx=function(t){iN()(e,t);var n=Px(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(Cx);function Hx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var Kx=function(t){iN()(e,t);var n=Hx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(Cx);function Xx(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var qx=function(t){iN()(e,t);var n=Xx(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(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}(Cx);function _x(t){var n=function(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return function(){return!!t}()}();return function(){var e,r=eN()(t);if(n){var i=eN()(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return tN()(this,e)}}var $x=function(t){iN()(e,t);var n=_x(e);function e(){return Qt()(this,e),n.apply(this,arguments)}return kt()(e,[{key:"outerCircleRadius",get:function(){return 10}},{key:"shapeControlPoints",get:function(){return this.rectWrapPointsPure}}]),e}(Cx);function tz(t,n){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return nz(t,n);var e={}.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?nz(t,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,M=!0,o=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return M=t.done,t},e:function(t){o=!0,u=t},f:function(){try{M||null==e.return||e.return()}finally{if(o)throw u}}}}function nz(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e<n;e++)r[e]=t[e];return r}function ez(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 rz(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?ez(Object(e),!0).forEach((function(n){Yt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):ez(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}var iz=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;Qt()(this,t),this.play=n,this.phase=e,this.animationGlobalProgress=r,Yt()(this,"ctx",void 0),Yt()(this,"animationGlobalProgressPrev",void 0),this.animationGlobalProgressPrev=r,this.ctx=null}return kt()(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 $j(this.ctx,t,n).apply(),new Dx(this.ctx,t,n).apply(),new Sh(this.ctx,t,n).apply(),new vh(this.ctx,t,n).apply(),new hx(this.ctx,t,n).apply(),new zx(this.ctx,t,n).apply(),new yx(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 bt(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=Xe()($e,_e()(i.controlPoints)),M=1;M<=100;M++){var o=M/100,c=e.prepareCourtPoint({x:u.x(o),y:u.y(o)});n.push({object:r,objectPoint:c,distance:Pc(c,t)})}})),n}),[]);return Rt.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:Pc(i,t)}),n.push({object:r,objectPoint:u,distance:Pc(u,t)}),n}),[]);return Rt.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:Pc(i,t)}),n}),[]);return Rt.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:Pc(i,t)}),e}),[]);return Rt.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:Pc(i,t)}),e}),[]);return e.length?Rt.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||([$n,_n].includes(n.type)?vn:Qn)}},{key:"court",get:function(){var t=this.play.playData.court;return rz({},t,{type:t.type===$n?_n: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 rz({},this.play.options,{staticData:this.play.staticData,scale:this.play.scale,animationGlobalProgress:this.animationGlobalProgress,playAnimationDuration:this.playAnimationDuration})}},{key:"playAnimationDuration",get:function(){var t=this.play.options.animationMode;return this.play.playData.lines.reduce((function(n,e){var r=new Ex(e).lastAnimEndTime(t);return n>r?n:r}),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!==ft[Zt(t.type)]})).map((function(t){return new(ft[Zt(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 Ix(t)})):[]}},{key:"currentPhasePlayers",get:function(){var t=this,n=this.currentPhaseLines,e=this.play.options,r=e.huddleMode,i=e.magnetMode,u=e.animationMode,M=r||i?this.playDataLines:this.prevPhaseLines,o=M.filter((function(t){return["PASS","HANDOFF"].includes(t.type)}));return this.play.playData.players.map((function(e){var c=new fx(e);c.setPossession(o);var N=M.filter((function(e){return!r||!(t.phase<e.phase)&&!n.find((function(t){return t.id===e.id}))})).filter((function(t){return t.playerPositionOrigin===c.position&&t.playerPositionTerminus===c.position})),a=n.filter((function(t){return i&&t.playerPositionOrigin===c.position&&t.playerPositionTerminus===c.position})),D=a.length?a:N;if(D.length){var s=Rt.a.maxBy(D,(function(t){return t.lastAnimEndTime(u)}));if(s){var T=s.lastLinePartControlPoint;T&&(c.location=T)}}return c}))}},{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=Rt.a.takeRight(n,2)),n.map((function(t){return new Ex(t)}))}},{key:"animationProgressPlayers",get:function(){var t=this,n=this.prevAnimationLines.filter((function(t){return Ft(t.type)})),e=this.play.options.animationMode,r=this.play.playData.lines.filter((function(t){return!Ft(t.type)&&(!!t.playerPositionOrigin&&t.playerPositionOrigin===t.playerPositionTerminus)})),i=Rt.a.groupBy(r,(function(t){return t.playerPositionOrigin}));return this.play.playData.players.map((function(r){var u,M=new fx(r);M.setPossession(n);var o=null!==(u=i[M.position])&&void 0!==u?u:[];if(!o.length)return M;var c,N=null,a=tz(o);try{for(a.s();!(c=a.n()).done;){var D=c.value,s=jh({mode:e,line:D,players:t.play.playData.players});if(s.length){for(var T=new Ex(D).getLineParts(),g=0;g<s.length;g+=1){var I=He()(s[g],2),l=I[0],y=I[1];if(Rt.a.inRange(t.animationGlobalProgress,l,y)){var j=T[g];if(j){var h=t.animationProgress(l,y),x=Xe()($e,_e()(j.controlPoints));N={x:x.x(h),y:x.y(h)};break}}}if(N)break}}}catch(t){a.e(t)}finally{a.f()}if(N)return M.location=N,M;var z=o.map((function(t){return new Ex(t)})).filter((function(n){return t.animationGlobalProgress>=n.lastAnimEndTime(e)})),O=Rt.a.maxBy(z,(function(t){return t.lastAnimEndTime(e)}));return(null==O?void 0:O.lastLinePartControlPoint)&&(M.location=O.lastLinePartControlPoint),M}))}},{key:"animationProgressLines",get:function(){var t=this,n=this.play.options,e=n.linesDisplayOnMoveOnly,r=n.animationMode;return this.play.playData.lines.map((function(n){var e=new Ex(n),i=jh({mode:r,line:n,players:t.play.playData.players}),u=[];return i.forEach((function(n,r){var i=He()(n,2),M=i[0],o=i[1];if(t.animationGlobalProgressPrev<o&&t.animationGlobalProgress>=o&&window.dispatchEvent(new CustomEvent("@luceosports/play-rendering:lineAnimationFinished",{detail:{id:e.id}})),Rt.a.inRange(t.animationGlobalProgress,M,o)){if("DRIBBLE"===e.type)return u.push(rz({},e.getLineParts()[r]));var c=Jc(e.getLineParts()[r].controlPoints,t.animationProgress(M,o));u.push({controlPoints:c[0],animationSegment:"processed"}),u.push({controlPoints:c[1],animationSegment:"active"})}else t.animationGlobalProgress>o?u.push(rz({},e.getLineParts()[r],{animationSegment:"processed"})):u.push(rz({},e.getLineParts()[r]))})),e.setLinePartsAdjusted(u),t.animationGlobalProgress>e.lastAnimEndTime(r)&&(e.color=rz({},e.color,{alpha:.1})),e})).filter((function(n){var i=He()(n.animations,1)[0],u=r===pt.SEQUENTIAL&&i.keyTimesSeq||i.keyTimes,M=He()(u,1)[0],o=_e()(u).reverse(),c=He()(o,1)[0],N=Rt.a.inRange(t.animationGlobalProgress,M,c);return e?N:N||t.animationGlobalProgress>c||n.phase===t.phase}))}},{key:"playDataLines",get:function(){return this.play.playData.lines.map((function(t){return new Ex(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,n=this.play.options.animationMode;return this.playDataLines.filter((function(e){return t.animationGlobalProgress>=e.lastAnimEndTime(n)}))}}]),t}();function uz(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 Mz(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?uz(Object(e),!0).forEach((function(n){Yt()(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):uz(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}var oz=function(){function t(n,e){Qt()(this,t),this.ctx=n,Yt()(this,"play",void 0),Yt()(this,"playBase",void 0),Yt()(this,"animationFrame",void 0),Yt()(this,"loopId",void 0),Yt()(this,"running",void 0),Yt()(this,"framesLoadTime",void 0),Yt()(this,"timeStart",void 0),Yt()(this,"timeElapsed",void 0),Yt()(this,"timeElapsedSaved",void 0),this.play=Rt.a.cloneDeep(e),this.playBase=Rt.a.cloneDeep(e),this.animationFrame=new iz(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 kt()(t,[{key:"setOptions",value:function(t){return this.play.options=Mz({},this.play.options,{},t),this.playBase.options=Mz({},this.playBase.options,{},t),this.animationFrame=new iz(this.play,this.currentPlayPhase,this.globalProgress).setContext(this.ctx),this.running||this.animationFrame.setPhase(this.currentPlayPhase).setAnimationGlobalProgress(this.globalProgress).draw(),this}},{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 iz(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=Rt.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(this.timeElapsed||0)/(1e3*this.animationDuration)}},{key:"currentPlayPhase",get:function(){var t=this,n=Object.entries(this.linesPhaseIntervals).find((function(n){var e=He()(n,2)[1];return Rt.a.inRange(t.globalProgress,e.min,e.max)}));return parseInt(n?n[0]:Object.keys(this.linesPhaseIntervals).pop())}},{key:"linesPhaseIntervals",get:function(){var t={},n=this.play.options.animationMode;return this.play.playData.lines.forEach((function(e){t[e.phase]||(t[e.phase]={min:0,max:0}),e.animations.forEach((function(r){var i="SEQUENTIAL"===n?r.keyTimesSeq||[]:r.keyTimes,u=He()(i,1)[0],M=_e()(i).pop();(u<t[e.phase].min||!t[e.phase].min&&e.phase>1)&&(t[e.phase].min=u),M>t[e.phase].max&&(t[e.phase].max=M)}))})),t}},{key:"lastLineAnimationMax",get:function(){var t=this.play.options.animationMode;return this.play.playData.lines.reduce((function(n,e){var r=new Ex(e);return n>r.lastAnimEndTime(t)?n:r.lastAnimEndTime(t)}),0)}}]),t}()}])}));
|
|
24
24
|
//# sourceMappingURL=play-rendering.js.map
|