diff --git a/d3/d3.min.js b/d3/d3.min.js index 2856dd2..33bb880 100755 --- a/d3/d3.min.js +++ b/d3/d3.min.js @@ -1,5 +1,2 @@ -!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:NaN}function r(n){return null===n?NaN:+n}function u(n){return!isNaN(n)}function i(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function a(n){return n.length}function o(n){for(var t=1;n*t%1;)t*=10;return t}function l(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function c(){this._=Object.create(null)}function s(n){return(n+="")===xa||n[0]===ba?ba+n:n}function f(n){return(n+="")[0]===ba?n.slice(1):n}function h(n){return s(n)in this._}function g(n){return(n=s(n))in this._&&delete this._[n]}function p(){var n=[];for(var t in this._)n.push(f(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function m(){this._=Object.create(null)}function y(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=_a.length;r>e;++e){var u=_a[e]+t;if(u in n)return u}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,u=-1,i=r.length;++ue;e++)for(var u,i=n[e],a=0,o=i.length;o>a;a++)(u=i[a])&&t(u,a,e);return n}function Z(n){return Sa(n,La),n}function V(n){var t,e;return function(r,u,i){var a,o=n[i].update,l=o.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(a=o[t])&&++t0&&(n=n.slice(0,o));var c=qa.get(n);return c&&(n=c,l=B),o?t?u:r:t?b:i}function $(n,t){return function(e){var r=oa.event;oa.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{oa.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Ra,u="click"+r,i=oa.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==Ta&&(Ta="onselectstart"in e?!1:x(e.style,"userSelect")),Ta){var a=n(e).style,o=a[Ta];a[Ta]="none"}return function(n){if(i.on(r,null),Ta&&(a[Ta]=o),n){var t=function(){i.on(u,null)};i.on(u,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var u=r.createSVGPoint();if(0>Da){var i=t(n);if(i.scrollX||i.scrollY){r=oa.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var a=r[0][0].getScreenCTM();Da=!(a.f||a.e),r.remove()}}return Da?(u.x=e.pageX,u.y=e.pageY):(u.x=e.clientX,u.y=e.clientY),u=u.matrixTransform(n.getScreenCTM().inverse()),[u.x,u.y]}var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}function G(){return oa.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nn(n){return n>1?0:-1>n?ja:Math.acos(n)}function tn(n){return n>1?Oa:-1>n?-Oa:Math.asin(n)}function en(n){return((n=Math.exp(n))-1/n)/2}function rn(n){return((n=Math.exp(n))+1/n)/2}function un(n){return((n=Math.exp(2*n))-1)/(n+1)}function an(n){return(n=Math.sin(n/2))*n}function on(){}function ln(n,t,e){return this instanceof ln?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof ln?new ln(n.h,n.s,n.l):_n(""+n,wn,ln):new ln(n,t,e)}function cn(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(a-i)*n/60:180>n?a:240>n?i+(a-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,a;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,a=.5>=e?e*(1+t):e+t-e*t,i=2*e-a,new yn(u(n+120),u(n),u(n-120))}function sn(n,t,e){return this instanceof sn?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof sn?new sn(n.h,n.c,n.l):n instanceof hn?pn(n.l,n.a,n.b):pn((n=Sn((n=oa.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new sn(n,t,e)}function fn(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new hn(e,Math.cos(n*=Ia)*t,Math.sin(n)*t)}function hn(n,t,e){return this instanceof hn?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof hn?new hn(n.l,n.a,n.b):n instanceof sn?fn(n.h,n.c,n.l):Sn((n=yn(n)).r,n.g,n.b):new hn(n,t,e)}function gn(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=vn(u)*Qa,r=vn(r)*no,i=vn(i)*to,new yn(mn(3.2404542*u-1.5371385*r-.4985314*i),mn(-.969266*u+1.8760108*r+.041556*i),mn(.0556434*u-.2040259*r+1.0572252*i))}function pn(n,t,e){return n>0?new sn(Math.atan2(e,t)*Ya,Math.sqrt(t*t+e*e),n):new sn(NaN,NaN,n)}function vn(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function dn(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function mn(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function yn(n,t,e){return this instanceof yn?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof yn?new yn(n.r,n.g,n.b):_n(""+n,yn,cn):new yn(n,t,e)}function Mn(n){return new yn(n>>16,n>>8&255,255&n)}function xn(n){return Mn(n)+""}function bn(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function _n(n,t,e){var r,u,i,a=0,o=0,l=0;if(r=/([a-z]+)\((.*)\)/.exec(n=n.toLowerCase()))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(Nn(u[0]),Nn(u[1]),Nn(u[2]))}return(i=uo.get(n))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.slice(1),16))||(4===n.length?(a=(3840&i)>>4,a=a>>4|a,o=240&i,o=o>>4|o,l=15&i,l=l<<4|l):7===n.length&&(a=(16711680&i)>>16,o=(65280&i)>>8,l=255&i)),t(a,o,l))}function wn(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),a=Math.max(n,t,e),o=a-i,l=(a+i)/2;return o?(u=.5>l?o/(a+i):o/(2-a-i),r=n==a?(t-e)/o+(e>t?6:0):t==a?(e-n)/o+2:(n-t)/o+4,r*=60):(r=NaN,u=l>0&&1>l?0:r),new ln(r,u,l)}function Sn(n,t,e){n=kn(n),t=kn(t),e=kn(e);var r=dn((.4124564*n+.3575761*t+.1804375*e)/Qa),u=dn((.2126729*n+.7151522*t+.072175*e)/no),i=dn((.0193339*n+.119192*t+.9503041*e)/to);return hn(116*u-16,500*(r-u),200*(u-i))}function kn(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function Nn(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function En(n){return"function"==typeof n?n:function(){return n}}function An(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Cn(t,e,n,r)}}function Cn(n,t,e,r){function u(){var n,t=l.status;if(!t&&Ln(l)||t>=200&&300>t||304===t){try{n=e.call(i,l)}catch(r){return void a.error.call(i,r)}a.load.call(i,n)}else a.error.call(i,l)}var i={},a=oa.dispatch("beforesend","progress","load","error"),o={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(n)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=u:l.onreadystatechange=function(){l.readyState>3&&u()},l.onprogress=function(n){var t=oa.event;oa.event=n;try{a.progress.call(i,l)}finally{oa.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?o[n]:(null==t?delete o[n]:o[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(c=n,i):c},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(ca(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),l.open(e,n,!0),null==t||"accept"in o||(o.accept=t+",*/*"),l.setRequestHeader)for(var s in o)l.setRequestHeader(s,o[s]);return null!=t&&l.overrideMimeType&&l.overrideMimeType(t),null!=c&&(l.responseType=c),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),a.beforesend.call(i,l),l.send(null==r?null:r),i},i.abort=function(){return l.abort(),i},oa.rebind(i,a,"on"),null==r?i:i.get(zn(r))}function zn(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function Ln(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qn(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,n:null};return ao?ao.n=i:io=i,ao=i,oo||(lo=clearTimeout(lo),oo=1,co(Tn)),i}function Tn(){var n=Rn(),t=Dn()-n;t>24?(isFinite(t)&&(clearTimeout(lo),lo=setTimeout(Tn,t)),oo=0):(oo=1,co(Tn))}function Rn(){for(var n=Date.now(),t=io;t;)n>=t.t&&t.c(n-t.t)&&(t.c=null),t=t.n;return n}function Dn(){for(var n,t=io,e=1/0;t;)t.c?(t.t8?function(n){return n/e}:function(n){return n*e},symbol:n}}function jn(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r&&e?function(n,t){for(var u=n.length,i=[],a=0,o=r[0],l=0;u>0&&o>0&&(l+o+1>t&&(o=Math.max(1,t-l)),i.push(n.substring(u-=o,u+o)),!((l+=o+1)>t));)o=r[a=(a+1)%r.length];return i.reverse().join(e)}:y;return function(n){var e=fo.exec(n),r=e[1]||" ",a=e[2]||">",o=e[3]||"-",l=e[4]||"",c=e[5],s=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1,y=!0;switch(h&&(h=+h.substring(1)),(c||"0"===r&&"="===a)&&(c=r="0",a="="),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===l&&(v="0"+g.toLowerCase());case"c":y=!1;case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===l&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=ho.get(g)||Fn;var M=c&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===o?"":o;if(0>p){var l=oa.formatPrefix(n,h);n=l.scale(n),e=l.symbol+d}else n*=p;n=g(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=y?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!c&&f&&(x=i(x,1/0));var S=v.length+x.length+b.length+(M?0:u.length),k=s>S?new Array(S=s-S+1).join(r):"";return M&&(x=i(k+x,k.length?s-b.length:1/0)),u+=v,n=x+b,("<"===a?u+n+k:">"===a?k+u+n:"^"===a?k.substring(0,S>>=1)+u+n+k.substring(S):u+(M?n:k+n))+e}}}function Fn(n){return n+""}function Hn(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function On(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new po(e-1)),1),e}function i(n,e){return t(n=new po(+n),e),n}function a(n,r,i){var a=u(n),o=[];if(i>1)for(;r>a;)e(a)%i||o.push(new Date(+a)),t(a,1);else for(;r>a;)o.push(new Date(+a)),t(a,1);return o}function o(n,t,e){try{po=Hn;var r=new Hn;return r._=n,a(r,t,e)}finally{po=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=a;var l=n.utc=In(n);return l.floor=l,l.round=In(r),l.ceil=In(u),l.offset=In(i),l.range=o,n}function In(n){return function(t,e){try{po=Hn;var r=new Hn;return r._=t,n(r,e)._}finally{po=Date}}}function Yn(n){function t(n){function t(t){for(var e,u,i,a=[],o=-1,l=0;++oo;){if(r>=c)return-1;if(u=t.charCodeAt(o++),37===u){if(a=t.charAt(o++),i=C[a in mo?t.charAt(o++):a],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){N.lastIndex=0;var r=N.exec(t.slice(e));return r?(n.m=E.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,r){return e(n,A.c.toString(),t,r)}function l(n,t,r){return e(n,A.x.toString(),t,r)}function c(n,t,r){return e(n,A.X.toString(),t,r)}function s(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{po=Hn;var t=new po;return t._=n,r(t)}finally{po=Date}}var r=t(n);return e.parse=function(n){try{po=Hn;var t=r.parse(n);return t&&t._}finally{po=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ct;var M=oa.map(),x=Vn(v),b=Xn(v),_=Vn(d),w=Xn(d),S=Vn(m),k=Xn(m),N=Vn(y),E=Xn(y);p.forEach(function(n,t){M.set(n.toLowerCase(),t)});var A={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return Zn(n.getDate(),t,2)},e:function(n,t){return Zn(n.getDate(),t,2)},H:function(n,t){return Zn(n.getHours(),t,2)},I:function(n,t){return Zn(n.getHours()%12||12,t,2)},j:function(n,t){return Zn(1+go.dayOfYear(n),t,3)},L:function(n,t){return Zn(n.getMilliseconds(),t,3)},m:function(n,t){return Zn(n.getMonth()+1,t,2)},M:function(n,t){return Zn(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return Zn(n.getSeconds(),t,2)},U:function(n,t){return Zn(go.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return Zn(go.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return Zn(n.getFullYear()%100,t,2)},Y:function(n,t){return Zn(n.getFullYear()%1e4,t,4)},Z:ot,"%":function(){return"%"}},C={a:r,A:u,b:i,B:a,c:o,d:tt,e:tt,H:rt,I:rt,j:et,L:at,m:nt,M:ut,p:s,S:it,U:Bn,w:$n,W:Wn,x:l,X:c,y:Gn,Y:Jn,Z:Kn,"%":lt};return t}function Zn(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Vn(n){return new RegExp("^(?:"+n.map(oa.requote).join("|")+")","i")}function Xn(n){for(var t=new c,e=-1,r=n.length;++e68?1900:2e3)}function nt(n,t,e){yo.lastIndex=0;var r=yo.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function tt(n,t,e){yo.lastIndex=0;var r=yo.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function et(n,t,e){yo.lastIndex=0;var r=yo.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function rt(n,t,e){yo.lastIndex=0;var r=yo.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function ut(n,t,e){yo.lastIndex=0;var r=yo.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function it(n,t,e){yo.lastIndex=0;var r=yo.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function at(n,t,e){yo.lastIndex=0;var r=yo.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function ot(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=Ma(t)/60|0,u=Ma(t)%60;return e+Zn(r,"0",2)+Zn(u,"0",2)}function lt(n,t,e){Mo.lastIndex=0;var r=Mo.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ct(n){for(var t=n.length,e=-1;++e=0?1:-1,o=a*e,l=Math.cos(t),c=Math.sin(t),s=i*c,f=u*l+s*Math.cos(o),h=s*a*Math.sin(o);ko.add(Math.atan2(h,f)),r=n,u=l,i=c}var t,e,r,u,i;No.point=function(a,o){No.point=n,r=(t=a)*Ia,u=Math.cos(o=(e=o)*Ia/2+ja/4),i=Math.sin(o)},No.lineEnd=function(){n(t,e)}}function dt(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function mt(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function yt(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function Mt(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function xt(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function bt(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function _t(n){return[Math.atan2(n[1],n[0]),tn(n[2])]}function wt(n,t){return Ma(n[0]-t[0])o;++o)u.point((e=n[o])[0],e[1]);return void u.lineEnd()}var l=new Tt(e,n,null,!0),c=new Tt(e,null,l,!1);l.o=c,i.push(l),a.push(c),l=new Tt(r,n,null,!1),c=new Tt(r,null,l,!0),l.o=c,i.push(l),a.push(c)}}),a.sort(t),qt(i),qt(a),i.length){for(var o=0,l=e,c=a.length;c>o;++o)a[o].e=l=!l;for(var s,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;s=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var o=0,c=s.length;c>o;++o)u.point((f=s[o])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){s=g.p.z;for(var o=s.length-1;o>=0;--o)u.point((f=s[o])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,s=g.z,p=!p}while(!g.v);u.lineEnd()}}}function qt(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r0){for(b||(i.polygonStart(),b=!0),i.lineStart();++a1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Dt))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:a,lineStart:l,lineEnd:c,polygonStart:function(){y.point=s,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=a,y.lineStart=l,y.lineEnd=c,g=oa.merge(g);var n=Ot(m,p);g.length?(b||(i.polygonStart(),b=!0),Lt(g,Ut,n,e,i)):n&&(b||(i.polygonStart(),b=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},M=Pt(),x=t(M),b=!1;return y}}function Dt(n){return n.length>1}function Pt(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Ut(n,t){return((n=n.x)[0]<0?n[1]-Oa-Pa:Oa-n[1])-((t=t.x)[0]<0?t[1]-Oa-Pa:Oa-t[1])}function jt(n){var t,e=NaN,r=NaN,u=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(i,a){var o=i>0?ja:-ja,l=Ma(i-e);Ma(l-ja)0?Oa:-Oa),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(o,r),n.point(i,r),t=0):u!==o&&l>=ja&&(Ma(e-u)Pa?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*a)):(t+r)/2}function Ht(n,t,e,r){var u;if(null==n)u=e*Oa,r.point(-ja,u),r.point(0,u),r.point(ja,u),r.point(ja,0),r.point(ja,-u),r.point(0,-u),r.point(-ja,-u),r.point(-ja,0),r.point(-ja,u);else if(Ma(n[0]-t[0])>Pa){var i=n[0]o;++o){var c=t[o],s=c.length;if(s)for(var f=c[0],h=f[0],g=f[1]/2+ja/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===s&&(d=0),n=c[d];var m=n[0],y=n[1]/2+ja/4,M=Math.sin(y),x=Math.cos(y),b=m-h,_=b>=0?1:-1,w=_*b,S=w>ja,k=p*M;if(ko.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),i+=S?b+_*Fa:b,S^h>=e^m>=e){var N=yt(dt(f),dt(n));bt(N);var E=yt(u,N);bt(E);var A=(S^b>=0?-1:1)*tn(E[2]);(r>A||r===A&&(N[0]||N[1]))&&(a+=S^b>=0?1:-1)}if(!d++)break;h=m,p=M,v=x,f=n}}return(-Pa>i||Pa>i&&0>ko)^1&a}function It(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function e(n){var e,i,l,c,s;return{lineStart:function(){c=l=!1,s=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=a?v?0:u(f,h):v?u(f+(0>f?ja:-ja),h):0;if(!e&&(c=l=v)&&n.lineStart(),v!==l&&(g=r(e,p),(wt(e,g)||wt(p,g))&&(p[0]+=Pa,p[1]+=Pa,v=t(p[0],p[1]))),v!==l)s=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(o&&e&&a^v){var m;d&i||!(m=r(p,e,!0))||(s=0,a?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&wt(e,p)||n.point(p[0],p[1]),e=p,l=v,i=d},lineEnd:function(){l&&n.lineEnd(),e=null},clean:function(){return s|(c&&l)<<1}}}function r(n,t,e){var r=dt(n),u=dt(t),a=[1,0,0],o=yt(r,u),l=mt(o,o),c=o[0],s=l-c*c;if(!s)return!e&&n;var f=i*l/s,h=-i*c/s,g=yt(a,o),p=xt(a,f),v=xt(o,h);Mt(p,v);var d=g,m=mt(p,d),y=mt(d,d),M=m*m-y*(mt(p,p)-1);if(!(0>M)){var x=Math.sqrt(M),b=xt(d,(-m-x)/y);if(Mt(b,p),b=_t(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],N=t[1];w>S&&(_=w,w=S,S=_);var E=S-w,A=Ma(E-ja)E;if(!A&&k>N&&(_=k,k=N,N=_),C?A?k+N>0^b[1]<(Ma(b[0]-w)ja^(w<=b[0]&&b[0]<=S)){var z=xt(d,(-m+x)/y);return Mt(z,p),[b,_t(z)]}}}function u(t,e){var r=a?n:ja-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),a=i>0,o=Ma(i)>Pa,l=ve(n,6*Ia);return Rt(t,e,l,a?[0,-n]:[-ja,n-ja])}function Yt(n,t,e,r){return function(u){var i,a=u.a,o=u.b,l=a.x,c=a.y,s=o.x,f=o.y,h=0,g=1,p=s-l,v=f-c;if(i=n-l,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-l,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-c,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-c,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:l+h*p,y:c+h*v}),1>g&&(u.b={x:l+g*p,y:c+g*v}),u}}}}}}function Zt(n,t,e,r){function u(r,u){return Ma(r[0]-n)0?0:3:Ma(r[0]-e)0?2:1:Ma(r[1]-t)0?1:0:u>0?3:2}function i(n,t){return a(n.x,t.x)}function a(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(o){function l(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,a=1,o=d[u],l=o.length,c=o[0];l>a;++a)i=o[a],c[1]<=r?i[1]>r&&Q(c,i,n)>0&&++t:i[1]<=r&&Q(c,i,n)<0&&--t,c=i;return 0!==t}function c(i,o,l,c){var s=0,f=0;if(null==i||(s=u(i,l))!==(f=u(o,l))||a(i,o)<0^l>0){do c.point(0===s||3===s?n:e,s>1?r:t);while((s=(s+l+4)%4)!==f)}else c.point(o[0],o[1])}function s(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){s(n,t)&&o.point(n,t)}function h(){C.point=p,d&&d.push(m=[]),S=!0,w=!1,b=_=NaN}function g(){v&&(p(y,M),x&&w&&E.rejoin(),v.push(E.buffer())),C.point=f,w&&o.lineEnd()}function p(n,t){n=Math.max(-Ho,Math.min(Ho,n)),t=Math.max(-Ho,Math.min(Ho,t));var e=s(n,t);if(d&&m.push([n,t]),S)y=n,M=t,x=e,S=!1,e&&(o.lineStart(),o.point(n,t));else if(e&&w)o.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};A(r)?(w||(o.lineStart(),o.point(r.a.x,r.a.y)),o.point(r.b.x,r.b.y),e||o.lineEnd(),k=!1):e&&(o.lineStart(),o.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,m,y,M,x,b,_,w,S,k,N=o,E=Pt(),A=Yt(n,t,e,r),C={point:f,lineStart:h,lineEnd:g,polygonStart:function(){o=E,v=[],d=[],k=!0},polygonEnd:function(){o=N,v=oa.merge(v);var t=l([n,r]),e=k&&t,u=v.length;(e||u)&&(o.polygonStart(),e&&(o.lineStart(),c(null,null,1,o),o.lineEnd()),u&&Lt(v,i,t,c,o),o.polygonEnd()),v=d=m=null}};return C}}function Vt(n){var t=0,e=ja/3,r=oe(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*ja/180,e=n[1]*ja/180):[t/ja*180,e/ja*180]},u}function Xt(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),a-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),a=Math.sqrt(i)/u;return e.invert=function(n,t){var e=a-t;return[Math.atan2(n,e)/u,tn((i-(n*n+e*e)*u*u)/(2*u))]},e}function $t(){function n(n,t){Io+=u*n-r*t,r=n,u=t}var t,e,r,u;$o.point=function(i,a){$o.point=n,t=r=i,e=u=a},$o.lineEnd=function(){n(t,e)}}function Bt(n,t){Yo>n&&(Yo=n),n>Vo&&(Vo=n),Zo>t&&(Zo=t),t>Xo&&(Xo=t)}function Wt(){function n(n,t){a.push("M",n,",",t,i)}function t(n,t){a.push("M",n,",",t),o.point=e}function e(n,t){a.push("L",n,",",t)}function r(){o.point=n}function u(){a.push("Z")}var i=Jt(4.5),a=[],o={point:n,lineStart:function(){o.point=t},lineEnd:r,polygonStart:function(){o.lineEnd=u},polygonEnd:function(){o.lineEnd=r,o.point=n},pointRadius:function(n){return i=Jt(n),o},result:function(){if(a.length){var n=a.join("");return a=[],n}}};return o}function Jt(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Gt(n,t){Co+=n,zo+=t,++Lo}function Kt(){function n(n,r){var u=n-t,i=r-e,a=Math.sqrt(u*u+i*i);qo+=a*(t+n)/2,To+=a*(e+r)/2,Ro+=a,Gt(t=n,e=r)}var t,e;Wo.point=function(r,u){Wo.point=n,Gt(t=r,e=u)}}function Qt(){Wo.point=Gt}function ne(){function n(n,t){var e=n-r,i=t-u,a=Math.sqrt(e*e+i*i);qo+=a*(r+n)/2,To+=a*(u+t)/2,Ro+=a,a=u*n-r*t,Do+=a*(r+n),Po+=a*(u+t),Uo+=3*a,Gt(r=n,u=t)}var t,e,r,u;Wo.point=function(i,a){Wo.point=n,Gt(t=r=i,e=u=a)},Wo.lineEnd=function(){n(t,e)}}function te(n){function t(t,e){n.moveTo(t+a,e),n.arc(t,e,a,0,Fa)}function e(t,e){n.moveTo(t,e),o.point=r}function r(t,e){n.lineTo(t,e)}function u(){o.point=t}function i(){n.closePath()}var a=4.5,o={point:t,lineStart:function(){o.point=e},lineEnd:u,polygonStart:function(){o.lineEnd=i},polygonEnd:function(){o.lineEnd=u,o.point=t},pointRadius:function(n){return a=n,o},result:b};return o}function ee(n){function t(n){return(o?r:e)(n)}function e(t){return ie(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=NaN,S.point=i,t.lineStart()}function i(e,r){var i=dt([e,r]),a=n(e,r);u(M,x,y,b,_,w,M=a[0],x=a[1],y=e,b=i[0],_=i[1],w=i[2],o,t),t.point(M,x)}function a(){S.point=e,t.lineEnd()}function l(){ -r(),S.point=c,S.lineEnd=s}function c(n,t){i(f=n,h=t),g=M,p=x,v=b,d=_,m=w,S.point=i}function s(){u(M,x,y,b,_,w,g,p,f,v,d,m,o,t),S.lineEnd=a,a()}var f,h,g,p,v,d,m,y,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:a,polygonStart:function(){t.polygonStart(),S.lineStart=l},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,o,l,c,s,f,h,g,p,v,d,m){var y=s-t,M=f-e,x=y*y+M*M;if(x>4*i&&d--){var b=o+g,_=l+p,w=c+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),N=Ma(Ma(w)-1)i||Ma((y*z+M*L)/x-.5)>.3||a>o*g+l*p+c*v)&&(u(t,e,r,o,l,c,A,C,N,b/=S,_/=S,w,d,m),m.point(A,C),u(A,C,N,b,_,w,s,f,h,g,p,v,d,m))}}var i=.5,a=Math.cos(30*Ia),o=16;return t.precision=function(n){return arguments.length?(o=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function re(n){var t=ee(function(t,e){return n([t*Ya,e*Ya])});return function(n){return le(t(n))}}function ue(n){this.stream=n}function ie(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function ae(n){return oe(function(){return n})()}function oe(n){function t(n){return n=o(n[0]*Ia,n[1]*Ia),[n[0]*h+l,c-n[1]*h]}function e(n){return n=o.invert((n[0]-l)/h,(c-n[1])/h),n&&[n[0]*Ya,n[1]*Ya]}function r(){o=Ct(a=fe(m,M,x),i);var n=i(v,d);return l=g-n[0]*h,c=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,a,o,l,c,s,f=ee(function(n,t){return n=i(n,t),[n[0]*h+l,c-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,M=0,x=0,b=Fo,_=y,w=null,S=null;return t.stream=function(n){return s&&(s.valid=!1),s=le(b(a,f(_(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Fo):It((w=+n)*Ia),u()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Zt(n[0][0],n[0][1],n[1][0],n[1][1]):y,u()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Ia,d=n[1]%360*Ia,r()):[v*Ya,d*Ya]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Ia,M=n[1]%360*Ia,x=n.length>2?n[2]%360*Ia:0,r()):[m*Ya,M*Ya,x*Ya]},oa.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function le(n){return ie(n,function(t,e){n.point(t*Ia,e*Ia)})}function ce(n,t){return[n,t]}function se(n,t){return[n>ja?n-Fa:-ja>n?n+Fa:n,t]}function fe(n,t,e){return n?t||e?Ct(ge(n),pe(t,e)):ge(n):t||e?pe(t,e):se}function he(n){return function(t,e){return t+=n,[t>ja?t-Fa:-ja>t?t+Fa:t,e]}}function ge(n){var t=he(n);return t.invert=he(-n),t}function pe(n,t){function e(n,t){var e=Math.cos(t),o=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),s=c*r+o*u;return[Math.atan2(l*i-s*a,o*r-c*u),tn(s*i+l*a)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),a=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),o=Math.cos(n)*e,l=Math.sin(n)*e,c=Math.sin(t),s=c*i-l*a;return[Math.atan2(l*i+c*a,o*r+s*u),tn(s*r-o*u)]},e}function ve(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,a,o){var l=a*t;null!=u?(u=de(e,u),i=de(e,i),(a>0?i>u:u>i)&&(u+=a*Fa)):(u=n+a*Fa,i=n-.5*l);for(var c,s=u;a>0?s>i:i>s;s-=l)o.point((c=_t([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],c[1])}}function de(n,t){var e=dt(t);e[0]-=n,bt(e);var r=nn(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Pa)%(2*Math.PI)}function me(n,t,e){var r=oa.range(n,t-Pa,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function ye(n,t,e){var r=oa.range(n,t-Pa,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function Me(n){return n.source}function xe(n){return n.target}function be(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),a=Math.cos(r),o=Math.sin(r),l=u*Math.cos(n),c=u*Math.sin(n),s=a*Math.cos(e),f=a*Math.sin(e),h=2*Math.asin(Math.sqrt(an(r-t)+u*a*an(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*l+t*s,u=e*c+t*f,a=e*i+t*o;return[Math.atan2(u,r)*Ya,Math.atan2(a,Math.sqrt(r*r+u*u))*Ya]}:function(){return[n*Ya,t*Ya]};return p.distance=h,p}function _e(){function n(n,u){var i=Math.sin(u*=Ia),a=Math.cos(u),o=Ma((n*=Ia)-t),l=Math.cos(o);Jo+=Math.atan2(Math.sqrt((o=a*Math.sin(o))*o+(o=r*i-e*a*l)*o),e*i+r*a*l),t=n,e=i,r=a}var t,e,r;Go.point=function(u,i){t=u*Ia,e=Math.sin(i*=Ia),r=Math.cos(i),Go.point=n},Go.lineEnd=function(){Go.point=Go.lineEnd=b}}function we(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),a=Math.cos(u);return[Math.atan2(n*i,r*a),Math.asin(r&&e*i/r)]},e}function Se(n,t){function e(n,t){a>0?-Oa+Pa>t&&(t=-Oa+Pa):t>Oa-Pa&&(t=Oa-Pa);var e=a/Math.pow(u(t),i);return[e*Math.sin(i*n),a-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(ja/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),a=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=a-t,r=K(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(a/r,1/i))-Oa]},e):Ne}function ke(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return Ma(u)u;u++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function qe(n,t){return n[0]-t[0]||n[1]-t[1]}function Te(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Re(n,t,e,r){var u=n[0],i=e[0],a=t[0]-u,o=r[0]-i,l=n[1],c=e[1],s=t[1]-l,f=r[1]-c,h=(o*(l-c)-f*(u-i))/(f*a-o*s);return[u+h*a,l+h*s]}function De(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Pe(){rr(this),this.edge=this.site=this.circle=null}function Ue(n){var t=cl.pop()||new Pe;return t.site=n,t}function je(n){Be(n),al.remove(n),cl.push(n),rr(n)}function Fe(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,a=n.N,o=[n];je(n);for(var l=i;l.circle&&Ma(e-l.circle.x)s;++s)c=o[s],l=o[s-1],nr(c.edge,l.site,c.site,u);l=o[0],c=o[f-1],c.edge=Ke(l.site,c.site,null,u),$e(l),$e(c)}function He(n){for(var t,e,r,u,i=n.x,a=n.y,o=al._;o;)if(r=Oe(o,a)-i,r>Pa)o=o.L;else{if(u=i-Ie(o,a),!(u>Pa)){r>-Pa?(t=o.P,e=o):u>-Pa?(t=o,e=o.N):t=e=o;break}if(!o.R){t=o;break}o=o.R}var l=Ue(n);if(al.insert(t,l),t||e){if(t===e)return Be(t),e=Ue(t.site),al.insert(l,e),l.edge=e.edge=Ke(t.site,l.site),$e(t),void $e(e);if(!e)return void(l.edge=Ke(t.site,l.site));Be(t),Be(e);var c=t.site,s=c.x,f=c.y,h=n.x-s,g=n.y-f,p=e.site,v=p.x-s,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,M=v*v+d*d,x={x:(d*y-g*M)/m+s,y:(h*M-v*y)/m+f};nr(e.edge,c,p,x),l.edge=Ke(c,n,null,x),e.edge=Ke(n,p,null,x),$e(t),$e(e)}}function Oe(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var a=n.P;if(!a)return-(1/0);e=a.site;var o=e.x,l=e.y,c=l-t;if(!c)return o;var s=o-r,f=1/i-1/c,h=s/c;return f?(-h+Math.sqrt(h*h-2*f*(s*s/(-2*c)-l+c/2+u-i/2)))/f+r:(r+o)/2}function Ie(n,t){var e=n.N;if(e)return Oe(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ye(n){this.site=n,this.edges=[]}function Ze(n){for(var t,e,r,u,i,a,o,l,c,s,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=il,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(o=i.edges,l=o.length,a=0;l>a;)s=o[a].end(),r=s.x,u=s.y,c=o[++a%l].start(),t=c.x,e=c.y,(Ma(r-t)>Pa||Ma(u-e)>Pa)&&(o.splice(a,0,new tr(Qe(i.site,s,Ma(r-f)Pa?{x:f,y:Ma(t-f)Pa?{x:Ma(e-p)Pa?{x:h,y:Ma(t-h)Pa?{x:Ma(e-g)=-Ua)){var g=l*l+c*c,p=s*s+f*f,v=(f*g-c*p)/h,d=(l*p-s*g)/h,f=d+o,m=sl.pop()||new Xe;m.arc=n,m.site=u,m.x=v+a,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,M=ll._;M;)if(m.yd||d>=o)return;if(h>p){if(i){if(i.y>=c)return}else i={x:d,y:l};e={x:d,y:c}}else{if(i){if(i.yr||r>1)if(h>p){if(i){if(i.y>=c)return}else i={x:(l-u)/r,y:l};e={x:(c-u)/r,y:c}}else{if(i){if(i.yg){if(i){if(i.x>=o)return}else i={x:a,y:r*a+u};e={x:o,y:r*o+u}}else{if(i){if(i.xi||f>a||r>h||u>g)){if(p=n.point){var p,v=t-n.x,d=e-n.y,m=v*v+d*d;if(l>m){var y=Math.sqrt(l=m);r=t-y,u=e-y,i=t+y,a=e+y,o=p}}for(var M=n.nodes,x=.5*(s+h),b=.5*(f+g),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:c(n,s,f,x,b);break;case 1:c(n,x,f,h,b);break;case 2:c(n,s,b,x,g);break;case 3:c(n,x,b,h,g)}}}(n,r,u,i,a),o}function vr(n,t){n=oa.rgb(n),t=oa.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,a=t.g-r,o=t.b-u;return function(n){return"#"+bn(Math.round(e+i*n))+bn(Math.round(r+a*n))+bn(Math.round(u+o*n))}}function dr(n,t){var e,r={},u={};for(e in n)e in t?r[e]=Mr(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function mr(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function yr(n,t){var e,r,u,i=hl.lastIndex=gl.lastIndex=0,a=-1,o=[],l=[];for(n+="",t+="";(e=hl.exec(n))&&(r=gl.exec(t));)(u=r.index)>i&&(u=t.slice(i,u),o[a]?o[a]+=u:o[++a]=u),(e=e[0])===(r=r[0])?o[a]?o[a]+=r:o[++a]=r:(o[++a]=null,l.push({i:a,x:mr(e,r)})),i=gl.lastIndex;return ir;++r)o[(e=l[r]).i]=e.x(n);return o.join("")})}function Mr(n,t){for(var e,r=oa.interpolators.length;--r>=0&&!(e=oa.interpolators[r](n,t)););return e}function xr(n,t){var e,r=[],u=[],i=n.length,a=t.length,o=Math.min(n.length,t.length);for(e=0;o>e;++e)r.push(Mr(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;a>e;++e)u[e]=t[e];return function(n){for(e=0;o>e;++e)u[e]=r[e](n);return u}}function br(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function _r(n){return function(t){return 1-n(1-t)}}function wr(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function Sr(n){return n*n}function kr(n){return n*n*n}function Nr(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Er(n){return function(t){return Math.pow(t,n)}}function Ar(n){return 1-Math.cos(n*Oa)}function Cr(n){return Math.pow(2,10*(n-1))}function zr(n){return 1-Math.sqrt(1-n*n)}function Lr(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/Fa*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*Fa/t)}}function qr(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Tr(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Rr(n,t){n=oa.hcl(n),t=oa.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,a=t.c-r,o=t.l-u;return isNaN(a)&&(a=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return fn(e+i*n,r+a*n,u+o*n)+""}}function Dr(n,t){n=oa.hsl(n),t=oa.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,a=t.s-r,o=t.l-u;return isNaN(a)&&(a=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return cn(e+i*n,r+a*n,u+o*n)+""}}function Pr(n,t){n=oa.lab(n),t=oa.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,a=t.a-r,o=t.b-u;return function(n){return gn(e+i*n,r+a*n,u+o*n)+""}}function Ur(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function jr(n){var t=[n.a,n.b],e=[n.c,n.d],r=Hr(t),u=Fr(t,e),i=Hr(Or(e,t,-u))||0;t[0]*e[1]180?t+=360:t-n>180&&(n+=360),r.push({i:e.push(Ir(e)+"rotate(",null,")")-2,x:mr(n,t)})):t&&e.push(Ir(e)+"rotate("+t+")")}function Vr(n,t,e,r){n!==t?r.push({i:e.push(Ir(e)+"skewX(",null,")")-2,x:mr(n,t)}):t&&e.push(Ir(e)+"skewX("+t+")")}function Xr(n,t,e,r){if(n[0]!==t[0]||n[1]!==t[1]){var u=e.push(Ir(e)+"scale(",null,",",null,")");r.push({i:u-4,x:mr(n[0],t[0])},{i:u-2,x:mr(n[1],t[1])})}else(1!==t[0]||1!==t[1])&&e.push(Ir(e)+"scale("+t+")")}function $r(n,t){var e=[],r=[];return n=oa.transform(n),t=oa.transform(t),Yr(n.translate,t.translate,e,r),Zr(n.rotate,t.rotate,e,r),Vr(n.skew,t.skew,e,r),Xr(n.scale,t.scale,e,r),n=t=null,function(n){for(var t,u=-1,i=r.length;++u=0;)e.push(u[r])}function au(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,a=-1;++ae;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function mu(n){return n.reduce(yu,0)}function yu(n,t){return n+t[1]}function Mu(n,t){return xu(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function xu(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function bu(n){return[oa.min(n),oa.max(n)]}function _u(n,t){return n.value-t.value}function wu(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function Su(n,t){n._pack_next=t,t._pack_prev=n}function ku(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function Nu(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(c=e.length)){var e,r,u,i,a,o,l,c,s=1/0,f=-(1/0),h=1/0,g=-(1/0);if(e.forEach(Eu),r=e[0],r.x=-r.r,r.y=0,t(r),c>1&&(u=e[1],u.x=u.r,u.y=0,t(u),c>2))for(i=e[2],zu(r,u,i),t(i),wu(r,i),r._pack_prev=i,wu(i,u),u=r._pack_next,a=3;c>a;a++){zu(r,u,i=e[a]);var p=0,v=1,d=1;for(o=u._pack_next;o!==u;o=o._pack_next,v++)if(ku(o,i)){p=1;break}if(1==p)for(l=r._pack_prev;l!==o._pack_prev&&!ku(l,i);l=l._pack_prev,d++);p?(d>v||v==d&&u.ra;a++)i=e[a],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,e.forEach(Au)}}function Eu(n){n._pack_next=n._pack_prev=n}function Au(n){delete n._pack_next,delete n._pack_prev}function Cu(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,a=u.length;++i=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Pu(n,t,e){return n.a.parent===t.parent?n.a:e}function Uu(n){return 1+oa.max(n,function(n){return n.y})}function ju(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Fu(n){var t=n.children;return t&&t.length?Fu(t[0]):n}function Hu(n){var t,e=n.children;return e&&(t=e.length)?Hu(e[t-1]):n}function Ou(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Iu(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Yu(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Zu(n){return n.rangeExtent?n.rangeExtent():Yu(n.range())}function Vu(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Xu(n,t){var e,r=0,u=n.length-1,i=n[r],a=n[u];return i>a&&(e=r,r=u,u=e,e=i,i=a,a=e),n[r]=t.floor(i),n[u]=t.ceil(a),n}function $u(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:Sl}function Bu(n,t,e,r){var u=[],i=[],a=0,o=Math.min(n.length,t.length)-1;for(n[o]2?Bu:Vu,l=r?Wr:Br;return a=u(n,t,l,e),o=u(t,n,l,Mr),i}function i(n){return a(n)}var a,o;return i.invert=function(n){return o(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(Ur)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return Qu(n,t)},i.tickFormat=function(t,e){return ni(n,t,e)},i.nice=function(t){return Gu(n,t),u()},i.copy=function(){return Wu(n,t,e,r)},u()}function Ju(n,t){return oa.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Gu(n,t){return Xu(n,$u(Ku(n,t)[2])),Xu(n,$u(Ku(n,t)[2])),n}function Ku(n,t){null==t&&(t=10);var e=Yu(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function Qu(n,t){return oa.range.apply(oa,Ku(n,t))}function ni(n,t,e){var r=Ku(n,t);if(e){var u=fo.exec(e);if(u.shift(),"s"===u[8]){var i=oa.formatPrefix(Math.max(Ma(r[0]),Ma(r[1])));return u[7]||(u[7]="."+ti(i.scale(r[2]))),u[8]="f",e=oa.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+ei(u[8],r)),e=u.join("")}else e=",."+ti(r[2])+"f";return oa.format(e)}function ti(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function ei(n,t){var e=ti(t[2]);return n in kl?Math.abs(e-ti(Math.max(Ma(t[0]),Ma(t[1]))))+ +("e"!==n):e-2*("%"===n)}function ri(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function a(t){return n(u(t))}return a.invert=function(t){return i(n.invert(t))},a.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),a):r},a.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),a):t},a.nice=function(){var t=Xu(r.map(u),e?Math:El);return n.domain(t),r=t.map(i),a},a.ticks=function(){var n=Yu(r),a=[],o=n[0],l=n[1],c=Math.floor(u(o)),s=Math.ceil(u(l)),f=t%1?2:t;if(isFinite(s-c)){if(e){for(;s>c;c++)for(var h=1;f>h;h++)a.push(i(c)*h);a.push(i(c))}else for(a.push(i(c));c++0;h--)a.push(i(c)*h);for(c=0;a[c]l;s--);a=a.slice(c,s)}return a},a.tickFormat=function(n,e){if(!arguments.length)return Nl;arguments.length<2?e=Nl:"function"!=typeof e&&(e=oa.format(e));var r=Math.max(1,t*n/a.ticks().length);return function(n){var a=n/i(Math.round(u(n)));return t-.5>a*t&&(a*=t),r>=a?e(n):""}},a.copy=function(){return ri(n.copy(),t,e,r)},Ju(a,n)}function ui(n,t,e){function r(t){return n(u(t))}var u=ii(t),i=ii(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return Qu(e,n)},r.tickFormat=function(n,t){return ni(e,n,t)},r.nice=function(n){return r.domain(Gu(e,n))},r.exponent=function(a){return arguments.length?(u=ii(t=a),i=ii(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return ui(n.copy(),t,e)},Ju(r,n)}function ii(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function ai(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):NaN))-1)%i.length]}function r(t,e){return oa.range(n.length).map(function(n){return t+e*n})}var u,i,a;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new c;for(var i,a=-1,o=r.length;++ae?[NaN,NaN]:[e>0?o[e-1]:n[0],et?NaN:t/i+n,[t,t+1/i]},r.copy=function(){return li(n,t,e)},u()}function ci(n,t){function e(e){return e>=e?t[oa.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return ci(n,t)},e}function si(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Qu(n,t)},t.tickFormat=function(t,e){return ni(n,t,e)},t.copy=function(){return si(n)},t}function fi(){return 0}function hi(n){return n.innerRadius}function gi(n){return n.outerRadius}function pi(n){return n.startAngle}function vi(n){return n.endAngle}function di(n){return n&&n.padAngle}function mi(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function yi(n,t,e,r,u){var i=n[0]-t[0],a=n[1]-t[1],o=(u?r:-r)/Math.sqrt(i*i+a*a),l=o*a,c=-o*i,s=n[0]+l,f=n[1]+c,h=t[0]+l,g=t[1]+c,p=(s+h)/2,v=(f+g)/2,d=h-s,m=g-f,y=d*d+m*m,M=e-r,x=s*g-h*f,b=(0>m?-1:1)*Math.sqrt(Math.max(0,M*M*y-x*x)),_=(x*m-d*b)/y,w=(-x*d-m*b)/y,S=(x*m+d*b)/y,k=(-x*d+m*b)/y,N=_-p,E=w-v,A=S-p,C=k-v;return N*N+E*E>A*A+C*C&&(_=S,w=k),[[_-l,w-c],[_*e/M,w*e/M]]}function Mi(n){function t(t){function a(){c.push("M",i(n(s),o))}for(var l,c=[],s=[],f=-1,h=t.length,g=En(e),p=En(r);++f1?n.join("L"):n+"Z"}function bi(n){return n.join("L")+"Z"}function _i(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t1&&u.push("H",r[0]),u.join("")}function wi(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t1){o=t[1],i=n[l],l++,r+="C"+(u[0]+a[0])+","+(u[1]+a[1])+","+(i[0]-o[0])+","+(i[1]-o[1])+","+i[0]+","+i[1];for(var c=2;c9&&(u=3*t/Math.sqrt(u),a[o]=u*e,a[o+1]=u*r));for(o=-1;++o<=l;)u=(n[Math.min(l,o+1)][0]-n[Math.max(0,o-1)][0])/(6*(1+a[o]*a[o])),i.push([u||0,a[o]*u||0]);return i}function Fi(n){return n.length<3?xi(n):n[0]+Ai(n,ji(n))}function Hi(n){for(var t,e,r,u=-1,i=n.length;++u=t?a(n-t):void(s.c=a)}function a(e){var u=p.active,i=p[u];i&&(i.timer.c=null,i.timer.t=NaN,--p.count,delete p[u],i.event&&i.event.interrupt.call(n,n.__data__,i.index));for(var a in p)if(r>+a){var c=p[a];c.timer.c=null,c.timer.t=NaN,--p.count,delete p[a]}s.c=o,qn(function(){return s.c&&o(e||1)&&(s.c=null,s.t=NaN),1},0,l),p.active=r,v.event&&v.event.start.call(n,n.__data__,t),g=[],v.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&g.push(r)}),h=v.ease,f=v.duration}function o(u){for(var i=u/f,a=h(i),o=g.length;o>0;)g[--o].call(n,a);return i>=1?(v.event&&v.event.end.call(n,n.__data__,t),--p.count?delete p[r]:delete n[e],1):void 0}var l,s,f,h,g,p=n[e]||(n[e]={active:0,count:0}),v=p[r];v||(l=u.time,s=qn(i,0,l),v=p[r]={tween:new c,time:l,timer:s,delay:u.delay,duration:u.duration,ease:u.ease,index:t},u=null,++p.count)}function na(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function ta(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function ea(n){return n.toISOString()}function ra(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=oa.bisect(Kl,u);return i==Kl.length?[t.year,Ku(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Kl[i-1]1?{floor:function(t){for(;e(t=n.floor(t));)t=ua(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=ua(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Yu(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],ua(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return ra(n.copy(),t,e)},Ju(r,n)}function ua(n){return new Date(n)}function ia(n){return JSON.parse(n.responseText)}function aa(n){var t=sa.createRange();return t.selectNode(sa.body),t.createContextualFragment(n.responseText)}var oa={version:"3.5.16"},la=[].slice,ca=function(n){return la.call(n)},sa=this.document;if(sa)try{ca(sa.documentElement.childNodes)[0].nodeType}catch(fa){ca=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),sa)try{sa.createElement("DIV").style.setProperty("opacity",0,"")}catch(ha){var ga=this.Element.prototype,pa=ga.setAttribute,va=ga.setAttributeNS,da=this.CSSStyleDeclaration.prototype,ma=da.setProperty;ga.setAttribute=function(n,t){pa.call(this,n,t+"")},ga.setAttributeNS=function(n,t,e){va.call(this,n,t,e+"")},da.setProperty=function(n,t,e){ma.call(this,n,t+"",e)}}oa.ascending=e,oa.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:NaN},oa.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u=r){e=r;break}for(;++ur&&(e=r)}else{for(;++u=r){e=r;break}for(;++ur&&(e=r)}return e},oa.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u=r){e=r;break}for(;++ue&&(e=r)}else{for(;++u=r){e=r;break}for(;++ue&&(e=r)}return e},oa.extent=function(n,t){var e,r,u,i=-1,a=n.length;if(1===arguments.length){for(;++i=r){e=u=r;break}for(;++ir&&(e=r),r>u&&(u=r))}else{for(;++i=r){e=u=r;break}for(;++ir&&(e=r),r>u&&(u=r))}return[e,u]},oa.sum=function(n,t){var e,r=0,i=n.length,a=-1;if(1===arguments.length)for(;++a1?l/(s-1):void 0},oa.deviation=function(){var n=oa.variance.apply(this,arguments);return n?Math.sqrt(n):n};var ya=i(e);oa.bisectLeft=ya.left,oa.bisect=oa.bisectRight=ya.right,oa.bisector=function(n){return i(1===n.length?function(t,r){return e(n(t),r)}:n)},oa.shuffle=function(n,t,e){(i=arguments.length)<3&&(e=n.length,2>i&&(t=0));for(var r,u,i=e-t;i;)u=Math.random()*i--|0,r=n[i+t],n[i+t]=n[u+t],n[u+t]=r;return n},oa.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},oa.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},oa.transpose=function(n){if(!(u=n.length))return[];for(var t=-1,e=oa.min(n,a),r=new Array(e);++t=0;)for(r=n[u],t=r.length;--t>=0;)e[--a]=r[t];return e};var Ma=Math.abs;oa.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,u=[],i=o(Ma(e)),a=-1;if(n*=i,t*=i,e*=i,0>e)for(;(r=n+e*++a)>t;)u.push(r/i);else for(;(r=n+e*++a)=i.length)return r?r.call(u,a):e?a.sort(e):a;for(var l,s,f,h,g=-1,p=a.length,v=i[o++],d=new c;++g=i.length)return n;var r=[],u=a[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],a=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(oa.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return a[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},oa.set=function(n){var t=new m;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},l(m,{has:h,add:function(n){return this._[s(n+="")]=!0,n},remove:g,values:p,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t))}}),oa.behavior={},oa.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},oa.event=null,oa.requote=function(n){return n.replace(wa,"\\$&")};var wa=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Sa={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},ka=function(n,t){return t.querySelector(n)},Na=function(n,t){return t.querySelectorAll(n)},Ea=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(Ea=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(ka=function(n,t){return Sizzle(n,t)[0]||null},Na=Sizzle,Ea=Sizzle.matchesSelector),oa.selection=function(){return oa.select(sa.documentElement)};var Aa=oa.selection.prototype=[];Aa.select=function(n){var t,e,r,u,i=[];n=A(n);for(var a=-1,o=this.length;++a=0&&"xmlns"!==(e=n.slice(0,t))&&(n=n.slice(t+1)),za.hasOwnProperty(e)?{space:za[e],local:n}:n}},Aa.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=oa.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},Aa.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,u=-1;if(t=e.classList){for(;++uu){if("string"!=typeof n){2>u&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>u){var i=this.node();return t(i).getComputedStyle(i,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},Aa.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},Aa.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},Aa.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},Aa.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},Aa.insert=function(n,t){return n=j(n),t=A(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},Aa.remove=function(){return this.each(F)},Aa.data=function(n,t){function e(n,e){var r,u,i,a=n.length,f=e.length,h=Math.min(a,f),g=new Array(f),p=new Array(f),v=new Array(a);if(t){var d,m=new c,y=new Array(a);for(r=-1;++rr;++r)p[r]=H(e[r]);for(;a>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,o.push(p),l.push(g),s.push(v)}var r,u,i=-1,a=this.length;if(!arguments.length){for(n=new Array(a=(r=this[0]).length);++ii;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var o=0,l=e.length;l>o;o++)(r=e[o])&&n.call(r,r.__data__,o,i)&&t.push(r)}return E(u)},Aa.order=function(){for(var n=-1,t=this.length;++n=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},Aa.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++tn;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},Aa.size=function(){var n=0;return Y(this,function(){++n}),n};var La=[];oa.selection.enter=Z,oa.selection.enter.prototype=La,La.append=Aa.append,La.empty=Aa.empty,La.node=Aa.node,La.call=Aa.call,La.size=Aa.size,La.select=function(n){for(var t,e,r,u,i,a=[],o=-1,l=this.length;++or){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var qa=oa.map({mouseenter:"mouseover",mouseleave:"mouseout"});sa&&qa.forEach(function(n){"on"+n in sa&&qa.remove(n)});var Ta,Ra=0;oa.mouse=function(n){return J(n,k())};var Da=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;oa.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return J(n,r)},oa.behavior.drag=function(){function n(){this.on("mousedown.drag",i).on("touchstart.drag",a)}function e(n,t,e,i,a){return function(){function o(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],p|=n|e,M=r,g({type:"drag",x:r[0]+c[0],y:r[1]+c[1],dx:n,dy:e}))}function l(){t(h,v)&&(m.on(i+d,null).on(a+d,null),y(p),g({type:"dragend"}))}var c,s=this,f=oa.event.target.correspondingElement||oa.event.target,h=s.parentNode,g=r.of(s,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=oa.select(e(f)).on(i+d,o).on(a+d,l),y=W(f),M=t(h,v);u?(c=u.apply(s,arguments),c=[c.x-M[0],c.y-M[1]]):c=[0,0],g({type:"dragstart"})}}var r=N(n,"drag","dragstart","dragend"),u=null,i=e(b,oa.mouse,t,"mousemove","mouseup"),a=e(G,oa.touch,y,"touchmove","touchend");return n.origin=function(t){return arguments.length?(u=t,n):u},oa.rebind(n,r,"on")},oa.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?ca(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Pa=1e-6,Ua=Pa*Pa,ja=Math.PI,Fa=2*ja,Ha=Fa-Pa,Oa=ja/2,Ia=ja/180,Ya=180/ja,Za=Math.SQRT2,Va=2,Xa=4;oa.interpolateZoom=function(n,t){var e,r,u=n[0],i=n[1],a=n[2],o=t[0],l=t[1],c=t[2],s=o-u,f=l-i,h=s*s+f*f;if(Ua>h)r=Math.log(c/a)/Za,e=function(n){return[u+n*s,i+n*f,a*Math.exp(Za*n*r)]};else{var g=Math.sqrt(h),p=(c*c-a*a+Xa*h)/(2*a*Va*g),v=(c*c-a*a-Xa*h)/(2*c*Va*g),d=Math.log(Math.sqrt(p*p+1)-p),m=Math.log(Math.sqrt(v*v+1)-v);r=(m-d)/Za,e=function(n){var t=n*r,e=rn(d),o=a/(Va*g)*(e*un(Za*t+d)-en(d));return[u+o*s,i+o*f,a*e/rn(Za*t+d)]}}return e.duration=1e3*r,e},oa.behavior.zoom=function(){function n(n){n.on(L,f).on(Ba+".zoom",g).on("dblclick.zoom",p).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function u(n){k.k=Math.max(A[0],Math.min(A[1],n))}function i(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function a(t,e,r,a){t.__chart__={x:k.x,y:k.y,k:k.k},u(Math.pow(2,a)),i(d=e,r),t=oa.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function o(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function l(n){z++||n({type:"zoomstart"})}function c(n){o(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function s(n){--z||(n({type:"zoomend"}),d=null)}function f(){function n(){o=1,i(oa.mouse(u),h),c(a)}function r(){f.on(q,null).on(T,null),g(o),s(a)}var u=this,a=D.of(u,arguments),o=0,f=oa.select(t(u)).on(q,n).on(T,r),h=e(oa.mouse(u)),g=W(u);Il.call(u),l(a)}function h(){function n(){var n=oa.touches(p);return g=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=oa.event.target;oa.select(t).on(x,r).on(b,o),_.push(t);for(var e=oa.event.changedTouches,u=0,i=e.length;i>u;++u)d[e[u].identifier]=null;var l=n(),c=Date.now();if(1===l.length){if(500>c-M){var s=l[0];a(p,s,d[s.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=c}else if(l.length>1){var s=l[0],f=l[1],h=s[0]-f[0],g=s[1]-f[1];m=h*h+g*g}}function r(){var n,t,e,r,a=oa.touches(p);Il.call(p);for(var o=0,l=a.length;l>o;++o,r=null)if(e=a[o],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var s=(s=e[0]-n[0])*s+(s=e[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],u(f*g)}M=null,i(n,t),c(v)}function o(){if(oa.event.touches.length){for(var t=oa.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var u in d)return void n()}oa.selectAll(_).on(y,null),w.on(L,f).on(R,h),N(),s(v)}var g,p=this,v=D.of(p,arguments),d={},m=0,y=".zoom-"+oa.event.changedTouches[0].identifier,x="touchmove"+y,b="touchend"+y,_=[],w=oa.select(p),N=W(p);t(),l(v),w.on(L,null).on(R,t)}function g(){var n=D.of(this,arguments);y?clearTimeout(y):(Il.call(this),v=e(d=m||oa.mouse(this)),l(n)),y=setTimeout(function(){y=null,s(n)},50),S(),u(Math.pow(2,.002*$a())*k.k),i(d,v),c(n)}function p(){var n=oa.mouse(this),t=Math.log(k.k)/Math.LN2;a(this,n,e(n),oa.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,m,y,M,x,b,_,w,k={x:0,y:0,k:1},E=[960,500],A=Wa,C=250,z=0,L="mousedown.zoom",q="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=N(n,"zoomstart","zoom","zoomend");return Ba||(Ba="onwheel"in sa?($a=function(){return-oa.event.deltaY*(oa.event.deltaMode?120:1)},"wheel"):"onmousewheel"in sa?($a=function(){return oa.event.wheelDelta},"mousewheel"):($a=function(){return-oa.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Hl?oa.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},l(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],u=d?d[0]:e/2,i=d?d[1]:r/2,a=oa.interpolateZoom([(u-k.x)/k.k,(i-k.y)/k.k,e/k.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=a(t),o=e/r[2];this.__chart__=k={x:u-r[0]*o,y:i-r[1]*o,k:o},c(n)}}).each("interrupt.zoom",function(){s(n)}).each("end.zoom",function(){s(n)}):(this.__chart__=k,l(n),c(n),s(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},o(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:null},u(+t),o(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Wa:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(m=t&&[+t[0],+t[1]],n):m},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},oa.rebind(n,D,"on")};var $a,Ba,Wa=[0,1/0];oa.color=on,on.prototype.toString=function(){return this.rgb()+""},oa.hsl=ln;var Ja=ln.prototype=new on;Ja.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,this.l/n)},Ja.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new ln(this.h,this.s,n*this.l)},Ja.rgb=function(){return cn(this.h,this.s,this.l)},oa.hcl=sn;var Ga=sn.prototype=new on;Ga.brighter=function(n){return new sn(this.h,this.c,Math.min(100,this.l+Ka*(arguments.length?n:1)))},Ga.darker=function(n){return new sn(this.h,this.c,Math.max(0,this.l-Ka*(arguments.length?n:1)))},Ga.rgb=function(){return fn(this.h,this.c,this.l).rgb()},oa.lab=hn;var Ka=18,Qa=.95047,no=1,to=1.08883,eo=hn.prototype=new on;eo.brighter=function(n){return new hn(Math.min(100,this.l+Ka*(arguments.length?n:1)),this.a,this.b)},eo.darker=function(n){return new hn(Math.max(0,this.l-Ka*(arguments.length?n:1)),this.a,this.b)},eo.rgb=function(){return gn(this.l,this.a,this.b)},oa.rgb=yn;var ro=yn.prototype=new on;ro.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new yn(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new yn(u,u,u)},ro.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new yn(n*this.r,n*this.g,n*this.b)},ro.hsl=function(){return wn(this.r,this.g,this.b)},ro.toString=function(){return"#"+bn(this.r)+bn(this.g)+bn(this.b)};var uo=oa.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});uo.forEach(function(n,t){uo.set(n,Mn(t))}),oa.functor=En,oa.xhr=An(y),oa.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var a=Cn(n,t,null==e?r:u(e),i);return a.row=function(n){return arguments.length?a.response(null==(e=n)?r:u(n)):e},a}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(a).join(n)}function a(n){return o.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var o=new RegExp('["'+n+"\n]"),l=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(s>=c)return a;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var e=t;e++s;){var r=n.charCodeAt(s++),o=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(s)&&(++s,++o);else if(r!==l)continue;return n.slice(t,s-o)}return n.slice(t)}for(var r,u,i={},a={},o=[],c=n.length,s=0,f=0;(r=e())!==a;){for(var h=[];r!==i&&r!==a;)h.push(r),r=e();t&&null==(h=t(h,f++))||o.push(h)}return o},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new m,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(a).join(n)].concat(t.map(function(t){return u.map(function(n){return a(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},oa.csv=oa.dsv(",","text/csv"),oa.tsv=oa.dsv(" ","text/tab-separated-values");var io,ao,oo,lo,co=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};oa.timer=function(){qn.apply(this,arguments)},oa.timer.flush=function(){Rn(),Dn()},oa.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var so=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Un);oa.formatPrefix=function(n,t){var e=0;return(n=+n)&&(0>n&&(n*=-1),t&&(n=oa.round(n,Pn(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),so[8+e/3]};var fo=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,ho=oa.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=oa.round(n,Pn(n,t))).toFixed(Math.max(0,Math.min(20,Pn(n*(1+1e-15),t))))}}),go=oa.time={},po=Date;Hn.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){vo.setUTCDate.apply(this._,arguments)},setDay:function(){vo.setUTCDay.apply(this._,arguments)},setFullYear:function(){vo.setUTCFullYear.apply(this._,arguments)},setHours:function(){vo.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){vo.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){vo.setUTCMinutes.apply(this._,arguments)},setMonth:function(){vo.setUTCMonth.apply(this._,arguments)},setSeconds:function(){vo.setUTCSeconds.apply(this._,arguments)},setTime:function(){vo.setTime.apply(this._,arguments)}};var vo=Date.prototype;go.year=On(function(n){return n=go.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),go.years=go.year.range,go.years.utc=go.year.utc.range,go.day=On(function(n){var t=new po(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),go.days=go.day.range,go.days.utc=go.day.utc.range,go.dayOfYear=function(n){var t=go.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=go[n]=On(function(n){return(n=go.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=go.year(n).getDay();return Math.floor((go.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});go[n+"s"]=e.range,go[n+"s"].utc=e.utc.range,go[n+"OfYear"]=function(n){var e=go.year(n).getDay();return Math.floor((go.dayOfYear(n)+(e+t)%7)/7)}}),go.week=go.sunday,go.weeks=go.sunday.range,go.weeks.utc=go.sunday.utc.range,go.weekOfYear=go.sundayOfYear;var mo={"-":"",_:" ",0:"0"},yo=/^\s*\d+/,Mo=/^%/;oa.locale=function(n){return{numberFormat:jn(n),timeFormat:Yn(n)}};var xo=oa.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"], -shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});oa.format=xo.numberFormat,oa.geo={},st.prototype={s:0,t:0,add:function(n){ft(n,this.t,bo),ft(bo.s,this.s,this),this.s?this.t+=bo.t:this.s=bo.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var bo=new st;oa.geo.stream=function(n,t){n&&_o.hasOwnProperty(n.type)?_o[n.type](n,t):ht(n,t)};var _o={Feature:function(n,t){ht(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++rn?4*ja+n:n,No.lineStart=No.lineEnd=No.point=b}};oa.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=dt([t*Ia,e*Ia]);if(m){var u=yt(m,r),i=[u[1],-u[0],0],a=yt(i,u);bt(a),a=_t(a);var l=t-p,c=l>0?1:-1,v=a[0]*Ya*c,d=Ma(l)>180;if(d^(v>c*p&&c*t>v)){var y=a[1]*Ya;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>c*p&&c*t>v)){var y=-a[1]*Ya;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?o(s,t)>o(s,h)&&(h=t):o(t,h)>o(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?o(s,t)>o(s,h)&&(h=t):o(t,h)>o(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=Ma(r)>180?r+(r>0?360:-360):r}else v=n,d=e;No.point(n,e),t(n,e)}function i(){No.lineStart()}function a(){u(v,d),No.lineEnd(),Ma(y)>Pa&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function o(n,t){return(t-=n)<0?t+360:t}function l(n,t){return n[0]-t[0]}function c(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nko?(s=-(h=180),f=-(g=90)):y>Pa?g=90:-Pa>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],oa.geo.stream(n,b);var t=M.length;if(t){M.sort(l);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],c(e[0],u)||c(e[1],u)?(o(u[0],e[1])>o(u[0],u[1])&&(u[1]=e[1]),o(e[0],u[1])>o(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var a,e,p=-(1/0),t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(a=o(u[1],e[0]))>p&&(p=a,s=e[0],h=u[1])}return M=x=null,s===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[s,f],[h,g]]}}(),oa.geo.centroid=function(n){Eo=Ao=Co=zo=Lo=qo=To=Ro=Do=Po=Uo=0,oa.geo.stream(n,jo);var t=Do,e=Po,r=Uo,u=t*t+e*e+r*r;return Ua>u&&(t=qo,e=To,r=Ro,Pa>Ao&&(t=Co,e=zo,r=Lo),u=t*t+e*e+r*r,Ua>u)?[NaN,NaN]:[Math.atan2(e,t)*Ya,tn(r/Math.sqrt(u))*Ya]};var Eo,Ao,Co,zo,Lo,qo,To,Ro,Do,Po,Uo,jo={sphere:b,point:St,lineStart:Nt,lineEnd:Et,polygonStart:function(){jo.lineStart=At},polygonEnd:function(){jo.lineStart=Nt}},Fo=Rt(zt,jt,Ht,[-ja,-ja/2]),Ho=1e9;oa.geo.clipExtent=function(){var n,t,e,r,u,i,a={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(o){return arguments.length?(i=Zt(n=+o[0][0],t=+o[0][1],e=+o[1][0],r=+o[1][1]),u&&(u.valid=!1,u=null),a):[[n,t],[e,r]]}};return a.extent([[0,0],[960,500]])},(oa.geo.conicEqualArea=function(){return Vt(Xt)}).raw=Xt,oa.geo.albers=function(){return oa.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},oa.geo.albersUsa=function(){function n(n){var i=n[0],a=n[1];return t=null,e(i,a),t||(r(i,a),t)||u(i,a),t}var t,e,r,u,i=oa.geo.albers(),a=oa.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),o=oa.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),l={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?a:u>=.166&&.234>u&&r>=-.214&&-.115>r?o:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=a.stream(n),r=o.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),a.precision(t),o.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),a.scale(.35*t),o.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var c=i.scale(),s=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[s-.455*c,f-.238*c],[s+.455*c,f+.238*c]]).stream(l).point,r=a.translate([s-.307*c,f+.201*c]).clipExtent([[s-.425*c+Pa,f+.12*c+Pa],[s-.214*c-Pa,f+.234*c-Pa]]).stream(l).point,u=o.translate([s-.205*c,f+.212*c]).clipExtent([[s-.214*c+Pa,f+.166*c+Pa],[s-.115*c-Pa,f+.234*c-Pa]]).stream(l).point,n},n.scale(1070)};var Oo,Io,Yo,Zo,Vo,Xo,$o={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Io=0,$o.lineStart=$t},polygonEnd:function(){$o.lineStart=$o.lineEnd=$o.point=b,Oo+=Ma(Io/2)}},Bo={point:Bt,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Wo={point:Gt,lineStart:Kt,lineEnd:Qt,polygonStart:function(){Wo.lineStart=ne},polygonEnd:function(){Wo.point=Gt,Wo.lineStart=Kt,Wo.lineEnd=Qt}};oa.geo.path=function(){function n(n){return n&&("function"==typeof o&&i.pointRadius(+o.apply(this,arguments)),a&&a.valid||(a=u(i)),oa.geo.stream(n,a)),i.result()}function t(){return a=null,n}var e,r,u,i,a,o=4.5;return n.area=function(n){return Oo=0,oa.geo.stream(n,u($o)),Oo},n.centroid=function(n){return Co=zo=Lo=qo=To=Ro=Do=Po=Uo=0,oa.geo.stream(n,u(Wo)),Uo?[Do/Uo,Po/Uo]:Ro?[qo/Ro,To/Ro]:Lo?[Co/Lo,zo/Lo]:[NaN,NaN]},n.bounds=function(n){return Vo=Xo=-(Yo=Zo=1/0),oa.geo.stream(n,u(Bo)),[[Yo,Zo],[Vo,Xo]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||re(n):y,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new Wt:new te(n),"function"!=typeof o&&i.pointRadius(o),t()):r},n.pointRadius=function(t){return arguments.length?(o="function"==typeof t?t:(i.pointRadius(+t),+t),n):o},n.projection(oa.geo.albersUsa()).context(null)},oa.geo.transform=function(n){return{stream:function(t){var e=new ue(t);for(var r in n)e[r]=n[r];return e}}},ue.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},oa.geo.projection=ae,oa.geo.projectionMutator=oe,(oa.geo.equirectangular=function(){return ae(ce)}).raw=ce.invert=ce,oa.geo.rotation=function(n){function t(t){return t=n(t[0]*Ia,t[1]*Ia),t[0]*=Ya,t[1]*=Ya,t}return n=fe(n[0]%360*Ia,n[1]*Ia,n.length>2?n[2]*Ia:0),t.invert=function(t){return t=n.invert(t[0]*Ia,t[1]*Ia),t[0]*=Ya,t[1]*=Ya,t},t},se.invert=ce,oa.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=fe(-n[0]*Ia,-n[1]*Ia,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Ya,n[1]*=Ya}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=ve((t=+r)*Ia,u*Ia),n):t},n.precision=function(r){return arguments.length?(e=ve(t*Ia,(u=+r)*Ia),n):u},n.angle(90)},oa.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Ia,u=n[1]*Ia,i=t[1]*Ia,a=Math.sin(r),o=Math.cos(r),l=Math.sin(u),c=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*a)*e+(e=c*s-l*f*o)*e),l*s+c*f*o)},oa.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return oa.range(Math.ceil(i/d)*d,u,d).map(h).concat(oa.range(Math.ceil(c/m)*m,l,m).map(g)).concat(oa.range(Math.ceil(r/p)*p,e,p).filter(function(n){return Ma(n%d)>Pa}).map(s)).concat(oa.range(Math.ceil(o/v)*v,a,v).filter(function(n){return Ma(n%m)>Pa}).map(f))}var e,r,u,i,a,o,l,c,s,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(l).slice(1),h(u).reverse().slice(1),g(c).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],c=+t[0][1],l=+t[1][1],i>u&&(t=i,i=u,u=t),c>l&&(t=c,c=l,l=t),n.precision(y)):[[i,c],[u,l]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],o=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),o>a&&(t=o,o=a,a=t),n.precision(y)):[[r,o],[e,a]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,s=me(o,a,90),f=ye(r,e,y),h=me(c,l,90),g=ye(i,u,y),n):y},n.majorExtent([[-180,-90+Pa],[180,90-Pa]]).minorExtent([[-180,-80-Pa],[180,80+Pa]])},oa.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=Me,u=xe;return n.distance=function(){return oa.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},oa.geo.interpolate=function(n,t){return be(n[0]*Ia,n[1]*Ia,t[0]*Ia,t[1]*Ia)},oa.geo.length=function(n){return Jo=0,oa.geo.stream(n,Go),Jo};var Jo,Go={sphere:b,point:b,lineStart:_e,lineEnd:b,polygonStart:b,polygonEnd:b},Ko=we(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(oa.geo.azimuthalEqualArea=function(){return ae(Ko)}).raw=Ko;var Qo=we(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},y);(oa.geo.azimuthalEquidistant=function(){return ae(Qo)}).raw=Qo,(oa.geo.conicConformal=function(){return Vt(Se)}).raw=Se,(oa.geo.conicEquidistant=function(){return Vt(ke)}).raw=ke;var nl=we(function(n){return 1/n},Math.atan);(oa.geo.gnomonic=function(){return ae(nl)}).raw=nl,Ne.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Oa]},(oa.geo.mercator=function(){return Ee(Ne)}).raw=Ne;var tl=we(function(){return 1},Math.asin);(oa.geo.orthographic=function(){return ae(tl)}).raw=tl;var el=we(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(oa.geo.stereographic=function(){return ae(el)}).raw=el,Ae.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Oa]},(oa.geo.transverseMercator=function(){var n=Ee(Ae),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Ae,oa.geom={},oa.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=En(e),i=En(r),a=n.length,o=[],l=[];for(t=0;a>t;t++)o.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(o.sort(qe),t=0;a>t;t++)l.push([o[t][0],-o[t][1]]);var c=Le(o),s=Le(l),f=s[0]===c[0],h=s[s.length-1]===c[c.length-1],g=[];for(t=c.length-1;t>=0;--t)g.push(n[o[c[t]][2]]);for(t=+f;t=r&&c.x<=i&&c.y>=u&&c.y<=a?[[r,a],[i,a],[i,u],[r,u]]:[];s.point=n[o]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/Pa)*Pa,y:Math.round(a(n,t)/Pa)*Pa,i:t}})}var r=Ce,u=ze,i=r,a=u,o=fl;return n?t(n):(t.links=function(n){return or(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return or(e(n)).cells.forEach(function(e,r){for(var u,i,a=e.site,o=e.edges.sort(Ve),l=-1,c=o.length,s=o[c-1].edge,f=s.l===a?s.r:s.l;++l=c,h=r>=s,g=h<<1|f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=hr()),f?u=c:o=c,h?a=s:l=s,i(n,t,e,r,u,a,o,l)}var s,f,h,g,p,v,d,m,y,M=En(o),x=En(l);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,a)for(g=0;p>g;++g)s=n[g],s.xm&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);v>b&&(v=b),d>_&&(d=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=hr();if(k.add=function(n){i(k,n,+M(n,++g),+x(n,g),v,d,m,y)},k.visit=function(n){gr(n,k,v,d,m,y)},k.find=function(n){return pr(k,n[0],n[1],v,d,m,y)},g=-1,null==t){for(;++g=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=vl.get(e)||pl,r=dl.get(r)||y,br(r(e.apply(null,la.call(arguments,1))))},oa.interpolateHcl=Rr,oa.interpolateHsl=Dr,oa.interpolateLab=Pr,oa.interpolateRound=Ur,oa.transform=function(n){var t=sa.createElementNS(oa.ns.prefix.svg,"g");return(oa.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new jr(e?e.matrix:ml)})(n)},jr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ml={a:1,b:0,c:0,d:1,e:0,f:0};oa.interpolateTransform=$r,oa.layout={},oa.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++eo*o/m){if(v>l){var c=t.charge/l;n.px-=i*c,n.py-=a*c}return!0}if(t.point&&l&&v>l){var c=t.pointCharge/l;n.px-=i*c,n.py-=a*c}}return!t.charge}}function t(n){n.px=oa.event.x,n.py=oa.event.y,l.resume()}var e,r,u,i,a,o,l={},c=oa.dispatch("start","tick","end"),s=[1,1],f=.9,h=yl,g=Ml,p=-30,v=xl,d=.1,m=.64,M=[],x=[];return l.tick=function(){if((u*=.99)<.005)return e=null,c.end({type:"end",alpha:u=0}),!0;var t,r,l,h,g,v,m,y,b,_=M.length,w=x.length;for(r=0;w>r;++r)l=x[r],h=l.source,g=l.target,y=g.x-h.x,b=g.y-h.y,(v=y*y+b*b)&&(v=u*a[r]*((v=Math.sqrt(v))-i[r])/v,y*=v,b*=v,g.x-=y*(m=h.weight+g.weight?h.weight/(h.weight+g.weight):.5),g.y-=b*m,h.x+=y*(m=1-m),h.y+=b*m);if((m=u*d)&&(y=s[0]/2,b=s[1]/2,r=-1,m))for(;++r<_;)l=M[r],l.x+=(y-l.x)*m,l.y+=(b-l.y)*m;if(p)for(ru(t=oa.geom.quadtree(M),u,o),r=-1;++r<_;)(l=M[r]).fixed||t.visit(n(l));for(r=-1;++r<_;)l=M[r],l.fixed?(l.x=l.px,l.y=l.py):(l.x-=(l.px-(l.px=l.x))*f,l.y-=(l.py-(l.py=l.y))*f);c.tick({type:"tick",alpha:u})},l.nodes=function(n){return arguments.length?(M=n,l):M},l.links=function(n){return arguments.length?(x=n,l):x},l.size=function(n){return arguments.length?(s=n,l):s},l.linkDistance=function(n){return arguments.length?(h="function"==typeof n?n:+n,l):h},l.distance=l.linkDistance,l.linkStrength=function(n){return arguments.length?(g="function"==typeof n?n:+n,l):g},l.friction=function(n){return arguments.length?(f=+n,l):f},l.charge=function(n){return arguments.length?(p="function"==typeof n?n:+n,l):p},l.chargeDistance=function(n){return arguments.length?(v=n*n,l):Math.sqrt(v)},l.gravity=function(n){return arguments.length?(d=+n,l):d},l.theta=function(n){return arguments.length?(m=n*n,l):Math.sqrt(m)},l.alpha=function(n){return arguments.length?(n=+n,u?n>0?u=n:(e.c=null,e.t=NaN,e=null,c.end({type:"end",alpha:u=0})):n>0&&(c.start({type:"start",alpha:u=n}),e=qn(l.tick)),l):u},l.start=function(){function n(n,r){if(!e){for(e=new Array(u),l=0;u>l;++l)e[l]=[];for(l=0;c>l;++l){var i=x[l];e[i.source.index].push(i.target),e[i.target.index].push(i.source)}}for(var a,o=e[t],l=-1,s=o.length;++lt;++t)(r=M[t]).index=t,r.weight=0;for(t=0;c>t;++t)r=x[t],"number"==typeof r.source&&(r.source=M[r.source]),"number"==typeof r.target&&(r.target=M[r.target]),++r.source.weight,++r.target.weight;for(t=0;u>t;++t)r=M[t],isNaN(r.x)&&(r.x=n("x",f)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"==typeof h)for(t=0;c>t;++t)i[t]=+h.call(this,x[t],t);else for(t=0;c>t;++t)i[t]=h;if(a=[],"function"==typeof g)for(t=0;c>t;++t)a[t]=+g.call(this,x[t],t);else for(t=0;c>t;++t)a[t]=g;if(o=[],"function"==typeof p)for(t=0;u>t;++t)o[t]=+p.call(this,M[t],t);else for(t=0;u>t;++t)o[t]=p;return l.resume()},l.resume=function(){return l.alpha(.1)},l.stop=function(){return l.alpha(0)},l.drag=function(){return r||(r=oa.behavior.drag().origin(y).on("dragstart.force",Qr).on("drag.force",t).on("dragend.force",nu)),arguments.length?void this.on("mouseover.force",tu).on("mouseout.force",eu).call(r):r},oa.rebind(l,c,"on")};var yl=20,Ml=1,xl=1/0;oa.layout.hierarchy=function(){function n(u){var i,a=[u],o=[];for(u.depth=0;null!=(i=a.pop());)if(o.push(i),(c=e.call(n,i,i.depth))&&(l=c.length)){for(var l,c,s;--l>=0;)a.push(s=c[l]),s.parent=i,s.depth=i.depth+1;r&&(i.value=0),i.children=c}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return au(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),o}var t=cu,e=ou,r=lu;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(iu(t,function(n){n.children&&(n.value=0)}),au(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},oa.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(a=i.length)){var a,o,l,c=-1;for(r=t.value?r/t.value:0;++cf?-1:1),p=oa.sum(c),v=p?(f-l*g)/p:0,d=oa.range(l),m=[];return null!=e&&d.sort(e===bl?function(n,t){return c[t]-c[n]}:function(n,t){return e(a[n],a[t])}),d.forEach(function(n){m[n]={data:a[n],value:o=c[n],startAngle:s,endAngle:s+=o*v+g,padAngle:h}}),m}var t=Number,e=bl,r=0,u=Fa,i=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n.padAngle=function(t){return arguments.length?(i=t,n):i},n};var bl={};oa.layout.stack=function(){function n(o,l){if(!(h=o.length))return o;var c=o.map(function(e,r){return t.call(n,e,r)}),s=c.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),a.call(n,t,e)]})}),f=e.call(n,s,l);c=oa.permute(c,f),s=oa.permute(s,f);var h,g,p,v,d=r.call(n,s,l),m=c[0].length;for(p=0;m>p;++p)for(u.call(n,c[0][p],v=d[p],s[0][p][1]),g=1;h>g;++g)u.call(n,c[g][p],v+=s[g-1][p][1],s[g][p][1]);return o}var t=y,e=pu,r=vu,u=gu,i=fu,a=hu;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:_l.get(t)||pu,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:wl.get(t)||vu,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(a=t,n):a},n.out=function(t){return arguments.length?(u=t,n):u},n};var _l=oa.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(du),i=n.map(mu),a=oa.range(r).sort(function(n,t){return u[n]-u[t]}),o=0,l=0,c=[],s=[];for(t=0;r>t;++t)e=a[t],l>o?(o+=i[e],c.push(e)):(l+=i[e],s.push(e));return s.reverse().concat(c)},reverse:function(n){return oa.range(n.length).reverse()},"default":pu}),wl=oa.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,a=[],o=0,l=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>o&&(o=r),a.push(r)}for(e=0;i>e;++e)l[e]=(o-a[e])/2;return l},wiggle:function(n){var t,e,r,u,i,a,o,l,c,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=l=c=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,o=f[e][0]-f[e-1][0];s>t;++t){for(r=0,a=(n[t][e][1]-n[t][e-1][1])/(2*o);t>r;++r)a+=(n[r][e][1]-n[r][e-1][1])/o;i+=a*n[t][e][1]}g[e]=l-=u?i/u*o:0,c>l&&(c=l)}for(e=0;h>e;++e)g[e]-=c;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,a=1/u,o=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=a}for(e=0;i>e;++e)o[e]=0;return o},zero:vu});oa.layout.histogram=function(){function n(n,i){for(var a,o,l=[],c=n.map(e,this),s=r.call(this,c,i),f=u.call(this,s,c,i),i=-1,h=c.length,g=f.length-1,p=t?1:1/h;++i0)for(i=-1;++i=s[0]&&o<=s[1]&&(a=l[oa.bisect(f,o,1,g)-1],a.y+=p,a.push(n[i]));return l}var t=!0,e=Number,r=bu,u=Mu;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=En(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return xu(n,t)}:En(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},oa.layout.pack=function(){function n(n,i){var a=e.call(this,n,i),o=a[0],l=u[0],c=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(o.x=o.y=0,au(o,function(n){n.r=+s(n.value)}),au(o,Nu),r){var f=r*(t?1:Math.max(2*o.r/l,2*o.r/c))/2;au(o,function(n){n.r+=f}),au(o,Nu),au(o,function(n){n.r-=f})}return Cu(o,l/2,c/2,t?1:1/Math.max(2*o.r/l,2*o.r/c)),a}var t,e=oa.layout.hierarchy().sort(_u),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},uu(n,e)},oa.layout.tree=function(){function n(n,u){var s=a.call(this,n,u),f=s[0],h=t(f);if(au(h,e),h.parent.m=-h.z,iu(h,r),c)iu(f,i);else{var g=f,p=f,v=f;iu(f,function(n){n.xp.x&&(p=n),n.depth>v.depth&&(v=n)});var d=o(g,p)/2-g.x,m=l[0]/(p.x+o(p,g)/2+d),y=l[1]/(v.depth||1);iu(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return s}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,a=0,o=i.length;o>a;++a)r.push((i[a]=u={_:i[a],parent:t,children:(u=i[a].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:a}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Du(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+o(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+o(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,a=t,l=u.parent.children[0],c=u.m,s=i.m,f=a.m,h=l.m;a=Tu(a),u=qu(u),a&&u;)l=qu(l),i=Tu(i),i.a=n,r=a.z+f-u.z-c+o(a._,u._),r>0&&(Ru(Pu(a,n,e),n,r),c+=r,s+=r),f+=a.m,c+=u.m,h+=l.m,s+=i.m;a&&!Tu(i)&&(i.t=a,i.m+=f-s),u&&!qu(l)&&(l.t=u,l.m+=c-h,e=n)}return e}function i(n){n.x*=l[0],n.y=n.depth*l[1]}var a=oa.layout.hierarchy().sort(null).value(null),o=Lu,l=[1,1],c=null;return n.separation=function(t){return arguments.length?(o=t,n):o},n.size=function(t){return arguments.length?(c=null==(l=t)?i:null,n):c?null:l},n.nodeSize=function(t){return arguments.length?(c=null==(l=t)?null:i,n):c?l:null},uu(n,a)},oa.layout.cluster=function(){function n(n,i){var a,o=t.call(this,n,i),l=o[0],c=0;au(l,function(n){var t=n.children;t&&t.length?(n.x=ju(t),n.y=Uu(t)):(n.x=a?c+=e(n,a):0,n.y=0,a=n)});var s=Fu(l),f=Hu(l),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return au(l,u?function(n){n.x=(n.x-l.x)*r[0],n.y=(l.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(l.y?n.y/l.y:1))*r[1]}),o}var t=oa.layout.hierarchy().sort(null).value(null),e=Lu,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},uu(n,t)},oa.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++ut?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var a,o,l,c=f(e),s=[],h=i.slice(),p=1/0,v="slice"===g?c.dx:"dice"===g?c.dy:"slice-dice"===g?1&e.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(n(h,c.dx*c.dy/e.value),s.area=0;(l=h.length)>0;)s.push(a=h[l-1]),s.area+=a.area,"squarify"!==g||(o=r(s,v))<=p?(h.pop(),p=o):(s.area-=s.pop().area,u(s,v,c,!1),v=Math.min(c.dx,c.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,v,c,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,a=f(t),o=r.slice(),l=[];for(n(o,a.dx*a.dy/t.value),l.area=0;i=o.pop();)l.push(i),l.area+=i.area,null!=i.z&&(u(l,i.z?a.dx:a.dy,a,!o.length),l.length=l.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,a=-1,o=n.length;++ae&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,a=n.length,o=e.x,c=e.y,s=t?l(n.area/t):0; -if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++ie.dx)&&(s=e.dx);++ie&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=oa.random.normal.apply(oa,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=oa.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},oa.scale={};var Sl={floor:y,ceil:y};oa.scale.linear=function(){return Wu([0,1],[0,1],Mr,!1)};var kl={s:1,g:1,p:1,r:1,e:1};oa.scale.log=function(){return ri(oa.scale.linear().domain([0,1]),10,!0,[1,10])};var Nl=oa.format(".0e"),El={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};oa.scale.pow=function(){return ui(oa.scale.linear(),1,[0,1])},oa.scale.sqrt=function(){return oa.scale.pow().exponent(.5)},oa.scale.ordinal=function(){return ai([],{t:"range",a:[[]]})},oa.scale.category10=function(){return oa.scale.ordinal().range(Al)},oa.scale.category20=function(){return oa.scale.ordinal().range(Cl)},oa.scale.category20b=function(){return oa.scale.ordinal().range(zl)},oa.scale.category20c=function(){return oa.scale.ordinal().range(Ll)};var Al=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(xn),Cl=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(xn),zl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(xn),Ll=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(xn);oa.scale.quantile=function(){return oi([],[])},oa.scale.quantize=function(){return li(0,1,[0,1])},oa.scale.threshold=function(){return ci([.5],[0,1])},oa.scale.identity=function(){return si([0,1])},oa.svg={},oa.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+r.apply(this,arguments)),s=a.apply(this,arguments)-Oa,f=o.apply(this,arguments)-Oa,h=Math.abs(f-s),g=s>f?0:1;if(n>c&&(p=c,c=n,n=p),h>=Ha)return t(c,g)+(n?t(n,1-g):"")+"Z";var p,v,d,m,y,M,x,b,_,w,S,k,N=0,E=0,A=[];if((m=(+l.apply(this,arguments)||0)/2)&&(d=i===ql?Math.sqrt(n*n+c*c):+i.apply(this,arguments),g||(E*=-1),c&&(E=tn(d/c*Math.sin(m))),n&&(N=tn(d/n*Math.sin(m)))),c){y=c*Math.cos(s+E),M=c*Math.sin(s+E),x=c*Math.cos(f-E),b=c*Math.sin(f-E);var C=Math.abs(f-s-2*E)<=ja?0:1;if(E&&mi(y,M,x,b)===g^C){var z=(s+f)/2;y=c*Math.cos(z),M=c*Math.sin(z),x=b=null}}else y=M=0;if(n){_=n*Math.cos(f-N),w=n*Math.sin(f-N),S=n*Math.cos(s+N),k=n*Math.sin(s+N);var L=Math.abs(s-f+2*N)<=ja?0:1;if(N&&mi(_,w,S,k)===1-g^L){var q=(s+f)/2;_=n*Math.cos(q),w=n*Math.sin(q),S=k=null}}else _=w=0;if(h>Pa&&(p=Math.min(Math.abs(c-n)/2,+u.apply(this,arguments)))>.001){v=c>n^g?0:1;var T=p,R=p;if(ja>h){var D=null==S?[_,w]:null==x?[y,M]:Re([y,M],[S,k],[x,b],[_,w]),P=y-D[0],U=M-D[1],j=x-D[0],F=b-D[1],H=1/Math.sin(Math.acos((P*j+U*F)/(Math.sqrt(P*P+U*U)*Math.sqrt(j*j+F*F)))/2),O=Math.sqrt(D[0]*D[0]+D[1]*D[1]);R=Math.min(p,(n-O)/(H-1)),T=Math.min(p,(c-O)/(H+1))}if(null!=x){var I=yi(null==S?[_,w]:[S,k],[y,M],c,T,g),Y=yi([x,b],[_,w],c,T,g);p===T?A.push("M",I[0],"A",T,",",T," 0 0,",v," ",I[1],"A",c,",",c," 0 ",1-g^mi(I[1][0],I[1][1],Y[1][0],Y[1][1]),",",g," ",Y[1],"A",T,",",T," 0 0,",v," ",Y[0]):A.push("M",I[0],"A",T,",",T," 0 1,",v," ",Y[0])}else A.push("M",y,",",M);if(null!=S){var Z=yi([y,M],[S,k],n,-R,g),V=yi([_,w],null==x?[y,M]:[x,b],n,-R,g);p===R?A.push("L",V[0],"A",R,",",R," 0 0,",v," ",V[1],"A",n,",",n," 0 ",g^mi(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-g," ",Z[1],"A",R,",",R," 0 0,",v," ",Z[0]):A.push("L",V[0],"A",R,",",R," 0 0,",v," ",Z[0])}else A.push("L",_,",",w)}else A.push("M",y,",",M),null!=x&&A.push("A",c,",",c," 0 ",C,",",g," ",x,",",b),A.push("L",_,",",w),null!=S&&A.push("A",n,",",n," 0 ",L,",",1-g," ",S,",",k);return A.push("Z"),A.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=hi,r=gi,u=fi,i=ql,a=pi,o=vi,l=di;return n.innerRadius=function(t){return arguments.length?(e=En(t),n):e},n.outerRadius=function(t){return arguments.length?(r=En(t),n):r},n.cornerRadius=function(t){return arguments.length?(u=En(t),n):u},n.padRadius=function(t){return arguments.length?(i=t==ql?ql:En(t),n):i},n.startAngle=function(t){return arguments.length?(a=En(t),n):a},n.endAngle=function(t){return arguments.length?(o=En(t),n):o},n.padAngle=function(t){return arguments.length?(l=En(t),n):l},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+a.apply(this,arguments)+ +o.apply(this,arguments))/2-Oa;return[Math.cos(t)*n,Math.sin(t)*n]},n};var ql="auto";oa.svg.line=function(){return Mi(y)};var Tl=oa.map({linear:xi,"linear-closed":bi,step:_i,"step-before":wi,"step-after":Si,basis:zi,"basis-open":Li,"basis-closed":qi,bundle:Ti,cardinal:Ei,"cardinal-open":ki,"cardinal-closed":Ni,monotone:Fi});Tl.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Rl=[0,2/3,1/3,0],Dl=[0,1/3,2/3,0],Pl=[0,1/6,2/3,1/6];oa.svg.line.radial=function(){var n=Mi(Hi);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},wi.reverse=Si,Si.reverse=wi,oa.svg.area=function(){return Oi(y)},oa.svg.area.radial=function(){var n=Oi(Hi);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},oa.svg.chord=function(){function n(n,o){var l=t(this,i,n,o),c=t(this,a,n,o);return"M"+l.p0+r(l.r,l.p1,l.a1-l.a0)+(e(l,c)?u(l.r,l.p1,l.r,l.p0):u(l.r,l.p1,c.r,c.p0)+r(c.r,c.p1,c.a1-c.a0)+u(c.r,c.p1,l.r,l.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=o.call(n,u,r),a=l.call(n,u,r)-Oa,s=c.call(n,u,r)-Oa;return{r:i,a0:a,a1:s,p0:[i*Math.cos(a),i*Math.sin(a)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>ja)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=Me,a=xe,o=Ii,l=pi,c=vi;return n.radius=function(t){return arguments.length?(o=En(t),n):o},n.source=function(t){return arguments.length?(i=En(t),n):i},n.target=function(t){return arguments.length?(a=En(t),n):a},n.startAngle=function(t){return arguments.length?(l=En(t),n):l},n.endAngle=function(t){return arguments.length?(c=En(t),n):c},n},oa.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),a=e.call(this,n,u),o=(i.y+a.y)/2,l=[i,{x:i.x,y:o},{x:a.x,y:o},a];return l=l.map(r),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var t=Me,e=xe,r=Yi;return n.source=function(e){return arguments.length?(t=En(e),n):t},n.target=function(t){return arguments.length?(e=En(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},oa.svg.diagonal.radial=function(){var n=oa.svg.diagonal(),t=Yi,e=n.projection;return n.projection=function(n){return arguments.length?e(Zi(t=n)):t},n},oa.svg.symbol=function(){function n(n,r){return(Ul.get(t.call(this,n,r))||$i)(e.call(this,n,r))}var t=Xi,e=Vi;return n.type=function(e){return arguments.length?(t=En(e),n):t},n.size=function(t){return arguments.length?(e=En(t),n):e},n};var Ul=oa.map({circle:$i,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Fl)),e=t*Fl;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/jl),e=t*jl/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});oa.svg.symbolTypes=Ul.keys();var jl=Math.sqrt(3),Fl=Math.tan(30*Ia);Aa.transition=function(n){for(var t,e,r=Hl||++Zl,u=Ki(n),i=[],a=Ol||{time:Date.now(),ease:Nr,delay:0,duration:250},o=-1,l=this.length;++oi;i++){u.push(t=[]);for(var e=this[i],o=0,l=e.length;l>o;o++)(r=e[o])&&n.call(r,r.__data__,o,i)&&t.push(r)}return Wi(u,this.namespace,this.id)},Yl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(u){u[r][e].tween.set(n,t)})},Yl.attr=function(n,t){function e(){this.removeAttribute(o)}function r(){this.removeAttributeNS(o.space,o.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(o);return e!==n&&(t=a(e,n),function(n){this.setAttribute(o,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(o.space,o.local);return e!==n&&(t=a(e,n),function(n){this.setAttributeNS(o.space,o.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var a="transform"==n?$r:Mr,o=oa.ns.qualify(n);return Ji(this,"attr."+n,t,o.local?i:u)},Yl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=oa.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Yl.style=function(n,e,r){function u(){this.style.removeProperty(n)}function i(e){return null==e?u:(e+="",function(){var u,i=t(this).getComputedStyle(this,null).getPropertyValue(n);return i!==e&&(u=Mr(i,e),function(t){this.style.setProperty(n,u(t),r)})})}var a=arguments.length;if(3>a){if("string"!=typeof n){2>a&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Ji(this,"style."+n,e,i)},Yl.styleTween=function(n,e,r){function u(u,i){var a=e.call(this,u,i,t(this).getComputedStyle(this,null).getPropertyValue(n));return a&&function(t){this.style.setProperty(n,a(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,u)},Yl.text=function(n){return Ji(this,"text",n,Gi)},Yl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Yl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=oa.ease.apply(oa,arguments)),Y(this,function(r){r[e][t].ease=n}))},Yl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,u,i){r[e][t].delay=+n.call(r,r.__data__,u,i)}:(n=+n,function(r){r[e][t].delay=n}))},Yl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,u,i){r[e][t].duration=Math.max(1,n.call(r,r.__data__,u,i))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Yl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var u=Ol,i=Hl;try{Hl=e,Y(this,function(t,u,i){Ol=t[r][e],n.call(t,t.__data__,u,i)})}finally{Ol=u,Hl=i}}else Y(this,function(u){var i=u[r][e];(i.event||(i.event=oa.dispatch("start","end","interrupt"))).on(n,t)});return this},Yl.transition=function(){for(var n,t,e,r,u=this.id,i=++Zl,a=this.namespace,o=[],l=0,c=this.length;c>l;l++){o.push(n=[]);for(var t=this[l],s=0,f=t.length;f>s;s++)(e=t[s])&&(r=e[a][u],Qi(e,s,a,i,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Wi(o,a,i)},oa.svg.axis=function(){function n(n){n.each(function(){var n,c=oa.select(this),s=this.__chart__||e,f=this.__chart__=e.copy(),h=null==l?f.ticks?f.ticks.apply(f,o):f.domain():l,g=null==t?f.tickFormat?f.tickFormat.apply(f,o):y:t,p=c.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Pa),d=oa.transition(p.exit()).style("opacity",Pa).remove(),m=oa.transition(p.order()).style("opacity",1),M=Math.max(u,0)+a,x=Zu(f),b=c.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),oa.transition(b));v.append("line"),v.append("text");var w,S,k,N,E=v.select("line"),A=m.select("line"),C=p.select("text").text(g),z=v.select("text"),L=m.select("text"),q="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=na,w="x",k="y",S="x2",N="y2",C.attr("dy",0>q?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+q*i+"V0H"+x[1]+"V"+q*i)):(n=ta,w="y",k="x",S="y2",N="x2",C.attr("dy",".32em").style("text-anchor",0>q?"end":"start"),_.attr("d","M"+q*i+","+x[0]+"H0V"+x[1]+"H"+q*i)),E.attr(N,q*u),z.attr(k,q*M),A.attr(S,0).attr(N,q*u),L.attr(w,0).attr(k,q*M),f.rangeBand){var T=f,R=T.rangeBand()/2;s=f=function(n){return T(n)+R}}else s.rangeBand?s=f:d.call(n,f,s);v.call(n,s,f),m.call(n,f,f)})}var t,e=oa.scale.linear(),r=Vl,u=6,i=6,a=3,o=[10],l=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Xl?t+"":Vl,n):r},n.ticks=function(){return arguments.length?(o=ca(arguments),n):o},n.tickValues=function(t){return arguments.length?(l=t,n):l},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(a=+t,n):a},n.tickSubdivide=function(){return arguments.length&&n},n};var Vl="bottom",Xl={top:1,right:1,bottom:1,left:1};oa.svg.brush=function(){function n(t){t.each(function(){var t=oa.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),a=t.selectAll(".background").data([0]);a.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var o=t.selectAll(".resize").data(v,y);o.exit().remove(),o.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return $l[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),o.style("display",n.empty()?"none":null);var l,f=oa.transition(t),h=oa.transition(a);c&&(l=Zu(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),r(f)),s&&(l=Zu(s),h.attr("y",l[0]).attr("height",l[1]-l[0]),u(f)),e(f)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+f[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",f[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function u(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function i(){function i(){32==oa.event.keyCode&&(C||(M=null,L[0]-=f[1],L[1]-=h[1],C=2),S())}function v(){32==oa.event.keyCode&&2==C&&(L[0]+=f[1],L[1]+=h[1],C=0,S())}function d(){var n=oa.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(oa.event.altKey?(M||(M=[(f[0]+f[1])/2,(h[0]+h[1])/2]),L[0]=f[+(n[0]s?(u=r,r=s):u=s),v[0]!=r||v[1]!=u?(e?o=null:a=null,v[0]=r,v[1]=u,!0):void 0}function y(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),oa.select("body").style("cursor",null),q.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=oa.select(oa.event.target),w=l.of(b,arguments),k=oa.select(b),N=_.datum(),E=!/^(n|s)$/.test(N)&&c,A=!/^(e|w)$/.test(N)&&s,C=_.classed("extent"),z=W(b),L=oa.mouse(b),q=oa.select(t(b)).on("keydown.brush",i).on("keyup.brush",v);if(oa.event.changedTouches?q.on("touchmove.brush",d).on("touchend.brush",y):q.on("mousemove.brush",d).on("mouseup.brush",y),k.interrupt().selectAll("*").interrupt(),C)L[0]=f[0]-L[0],L[1]=h[0]-L[1];else if(N){var T=+/w$/.test(N),R=+/^n/.test(N);x=[f[1-T]-L[0],h[1-R]-L[1]],L[0]=f[T],L[1]=h[R]}else oa.event.altKey&&(M=L.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),oa.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var a,o,l=N(n,"brushstart","brush","brushend"),c=null,s=null,f=[0,0],h=[0,0],g=!0,p=!0,v=Bl[0];return n.event=function(n){n.each(function(){var n=l.of(this,arguments),t={x:f,y:h,i:a,j:o},e=this.__chart__||t;this.__chart__=t,Hl?oa.select(this).transition().each("start.brush",function(){a=e.i,o=e.j,f=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=xr(f,t.x),r=xr(h,t.y);return a=o=null,function(u){f=t.x=e(u),h=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){a=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,v=Bl[!c<<1|!s],n):c},n.y=function(t){return arguments.length?(s=t,v=Bl[!c<<1|!s],n):s},n.clamp=function(t){return arguments.length?(c&&s?(g=!!t[0],p=!!t[1]):c?g=!!t:s&&(p=!!t),n):c&&s?[g,p]:c?g:s?p:null},n.extent=function(t){var e,r,u,i,l;return arguments.length?(c&&(e=t[0],r=t[1],s&&(e=e[0],r=r[0]),a=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(l=e,e=r,r=l),(e!=f[0]||r!=f[1])&&(f=[e,r])),s&&(u=t[0],i=t[1],c&&(u=u[1],i=i[1]),o=[u,i],s.invert&&(u=s(u),i=s(i)),u>i&&(l=u,u=i,i=l),(u!=h[0]||i!=h[1])&&(h=[u,i])),n):(c&&(a?(e=a[0],r=a[1]):(e=f[0],r=f[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(l=e,e=r,r=l))),s&&(o?(u=o[0],i=o[1]):(u=h[0],i=h[1],s.invert&&(u=s.invert(u),i=s.invert(i)),u>i&&(l=u,u=i,i=l))),c&&s?[[e,u],[r,i]]:c?[e,r]:s&&[u,i])},n.clear=function(){return n.empty()||(f=[0,0],h=[0,0],a=o=null),n},n.empty=function(){return!!c&&f[0]==f[1]||!!s&&h[0]==h[1]},oa.rebind(n,l,"on")};var $l={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Bl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Wl=go.format=xo.timeFormat,Jl=Wl.utc,Gl=Jl("%Y-%m-%dT%H:%M:%S.%LZ");Wl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?ea:Gl,ea.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},ea.toString=Gl.toString,go.second=On(function(n){return new po(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),go.seconds=go.second.range,go.seconds.utc=go.second.utc.range,go.minute=On(function(n){return new po(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),go.minutes=go.minute.range,go.minutes.utc=go.minute.utc.range,go.hour=On(function(n){var t=n.getTimezoneOffset()/60;return new po(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),go.hours=go.hour.range,go.hours.utc=go.hour.utc.range,go.month=On(function(n){return n=go.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),go.months=go.month.range,go.months.utc=go.month.utc.range;var Kl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ql=[[go.second,1],[go.second,5],[go.second,15],[go.second,30],[go.minute,1],[go.minute,5],[go.minute,15],[go.minute,30],[go.hour,1],[go.hour,3],[go.hour,6],[go.hour,12],[go.day,1],[go.day,2],[go.week,1],[go.month,1],[go.month,3],[go.year,1]],nc=Wl.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",zt]]),tc={range:function(n,t,e){return oa.range(Math.ceil(n/e)*e,+t,e).map(ua)},floor:y,ceil:y};Ql.year=go.year,go.scale=function(){return ra(oa.scale.linear(),Ql,nc)};var ec=Ql.map(function(n){return[n[0].utc,n[1]]}),rc=Jl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",zt]]);ec.year=go.year.utc,go.scale.utc=function(){return ra(oa.scale.linear(),ec,rc)},oa.text=An(function(n){return n.responseText}),oa.json=function(n,t){return Cn(n,"application/json",ia,t)},oa.html=function(n,t){return Cn(n,"text/html",aa,t)},oa.xml=An(function(n){return n.responseXML}),"function"==typeof define&&define.amd?(this.d3=oa,define(oa)):"object"==typeof module&&module.exports?module.exports=oa:this.d3=oa}(); \ No newline at end of file +// https://d3js.org v7.9.0 Copyright 2010-2023 Mike Bostock +!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).d3=t.d3||{})}(this,(function(t){"use strict";function n(t,n){return null==t||null==n?NaN:tn?1:t>=n?0:NaN}function e(t,n){return null==t||null==n?NaN:nt?1:n>=t?0:NaN}function r(t){let r,o,a;function u(t,n,e=0,i=t.length){if(e>>1;o(t[r],n)<0?e=r+1:i=r}while(en(t(e),r),a=(n,e)=>t(n)-e):(r=t===n||t===e?t:i,o=t,a=t),{left:u,center:function(t,n,e=0,r=t.length){const i=u(t,n,e,r-1);return i>e&&a(t[i-1],n)>-a(t[i],n)?i-1:i},right:function(t,n,e=0,i=t.length){if(e>>1;o(t[r],n)<=0?e=r+1:i=r}while(e{n(t,e,(r<<=2)+0,(i<<=2)+0,o<<=2),n(t,e,r+1,i+1,o),n(t,e,r+2,i+2,o),n(t,e,r+3,i+3,o)}}));function d(t){return function(n,e,r=e){if(!((e=+e)>=0))throw new RangeError("invalid rx");if(!((r=+r)>=0))throw new RangeError("invalid ry");let{data:i,width:o,height:a}=n;if(!((o=Math.floor(o))>=0))throw new RangeError("invalid width");if(!((a=Math.floor(void 0!==a?a:i.length/o))>=0))throw new RangeError("invalid height");if(!o||!a||!e&&!r)return n;const u=e&&t(e),c=r&&t(r),f=i.slice();return u&&c?(p(u,f,i,o,a),p(u,i,f,o,a),p(u,f,i,o,a),g(c,i,f,o,a),g(c,f,i,o,a),g(c,i,f,o,a)):u?(p(u,i,f,o,a),p(u,f,i,o,a),p(u,i,f,o,a)):c&&(g(c,i,f,o,a),g(c,f,i,o,a),g(c,i,f,o,a)),n}}function p(t,n,e,r,i){for(let o=0,a=r*i;o{if(!((o-=a)>=i))return;let u=t*r[i];const c=a*t;for(let t=i,n=i+c;t{if(!((a-=u)>=o))return;let c=n*i[o];const f=u*n,s=f+u;for(let t=o,n=o+f;t=n&&++e;else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(i=+i)>=i&&++e}return e}function _(t){return 0|t.length}function b(t){return!(t>0)}function m(t){return"object"!=typeof t||"length"in t?t:Array.from(t)}function x(t,n){let e,r=0,i=0,o=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(e=n-i,i+=e/++r,o+=e*(n-i));else{let a=-1;for(let u of t)null!=(u=n(u,++a,t))&&(u=+u)>=u&&(e=u-i,i+=e/++r,o+=e*(u-i))}if(r>1)return o/(r-1)}function w(t,n){const e=x(t,n);return e?Math.sqrt(e):e}function M(t,n){let e,r;if(void 0===n)for(const n of t)null!=n&&(void 0===e?n>=n&&(e=r=n):(e>n&&(e=n),r=o&&(e=r=o):(e>o&&(e=o),r0){for(o=t[--i];i>0&&(n=o,e=t[--i],o=n+e,r=e-(o-n),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(e=2*r,n=o+e,e==n-o&&(o=n))}return o}}class InternMap extends Map{constructor(t,n=N){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),null!=t)for(const[n,e]of t)this.set(n,e)}get(t){return super.get(A(this,t))}has(t){return super.has(A(this,t))}set(t,n){return super.set(S(this,t),n)}delete(t){return super.delete(E(this,t))}}class InternSet extends Set{constructor(t,n=N){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),null!=t)for(const n of t)this.add(n)}has(t){return super.has(A(this,t))}add(t){return super.add(S(this,t))}delete(t){return super.delete(E(this,t))}}function A({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):e}function S({_intern:t,_key:n},e){const r=n(e);return t.has(r)?t.get(r):(t.set(r,e),e)}function E({_intern:t,_key:n},e){const r=n(e);return t.has(r)&&(e=t.get(r),t.delete(r)),e}function N(t){return null!==t&&"object"==typeof t?t.valueOf():t}function k(t){return t}function C(t,...n){return F(t,k,k,n)}function P(t,...n){return F(t,Array.from,k,n)}function z(t,n){for(let e=1,r=n.length;et.pop().map((([n,e])=>[...t,n,e]))));return t}function $(t,n,...e){return F(t,k,n,e)}function D(t,n,...e){return F(t,Array.from,n,e)}function R(t){if(1!==t.length)throw new Error("duplicate key");return t[0]}function F(t,n,e,r){return function t(i,o){if(o>=r.length)return e(i);const a=new InternMap,u=r[o++];let c=-1;for(const t of i){const n=u(t,++c,i),e=a.get(n);e?e.push(t):a.set(n,[t])}for(const[n,e]of a)a.set(n,t(e,o));return n(a)}(t,0)}function q(t,n){return Array.from(n,(n=>t[n]))}function U(t,...n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");t=Array.from(t);let[e]=n;if(e&&2!==e.length||n.length>1){const r=Uint32Array.from(t,((t,n)=>n));return n.length>1?(n=n.map((n=>t.map(n))),r.sort(((t,e)=>{for(const r of n){const n=O(r[t],r[e]);if(n)return n}}))):(e=t.map(e),r.sort(((t,n)=>O(e[t],e[n])))),q(t,r)}return t.sort(I(e))}function I(t=n){if(t===n)return O;if("function"!=typeof t)throw new TypeError("compare is not a function");return(n,e)=>{const r=t(n,e);return r||0===r?r:(0===t(e,e))-(0===t(n,n))}}function O(t,n){return(null==t||!(t>=t))-(null==n||!(n>=n))||(tn?1:0)}var B=Array.prototype.slice;function Y(t){return()=>t}const L=Math.sqrt(50),j=Math.sqrt(10),H=Math.sqrt(2);function X(t,n,e){const r=(n-t)/Math.max(0,e),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=L?10:o>=j?5:o>=H?2:1;let u,c,f;return i<0?(f=Math.pow(10,-i)/a,u=Math.round(t*f),c=Math.round(n*f),u/fn&&--c,f=-f):(f=Math.pow(10,i)*a,u=Math.round(t/f),c=Math.round(n/f),u*fn&&--c),c0))return[];if((t=+t)===(n=+n))return[t];const r=n=i))return[];const u=o-i+1,c=new Array(u);if(r)if(a<0)for(let t=0;t0?(t=Math.floor(t/i)*i,n=Math.ceil(n/i)*i):i<0&&(t=Math.ceil(t*i)/i,n=Math.floor(n*i)/i),r=i}}function K(t){return Math.max(1,Math.ceil(Math.log(v(t))/Math.LN2)+1)}function Q(){var t=k,n=M,e=K;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a,u=r.length,c=new Array(u);for(i=0;i=h)if(t>=h&&n===M){const t=V(l,h,e);isFinite(t)&&(t>0?h=(Math.floor(h/t)+1)*t:t<0&&(h=(Math.ceil(h*-t)+1)/-t))}else d.pop()}for(var p=d.length,g=0,y=p;d[g]<=l;)++g;for(;d[y-1]>h;)--y;(g||y0?d[i-1]:l,v.x1=i0)for(i=0;i=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e=i)&&(e=i)}return e}function tt(t,n){let e,r=-1,i=-1;if(void 0===n)for(const n of t)++i,null!=n&&(e=n)&&(e=n,r=i);else for(let o of t)null!=(o=n(o,++i,t))&&(e=o)&&(e=o,r=i);return r}function nt(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&(e>i||void 0===e&&i>=i)&&(e=i)}return e}function et(t,n){let e,r=-1,i=-1;if(void 0===n)for(const n of t)++i,null!=n&&(e>n||void 0===e&&n>=n)&&(e=n,r=i);else for(let o of t)null!=(o=n(o,++i,t))&&(e>o||void 0===e&&o>=o)&&(e=o,r=i);return r}function rt(t,n,e=0,r=1/0,i){if(n=Math.floor(n),e=Math.floor(Math.max(0,e)),r=Math.floor(Math.min(t.length-1,r)),!(e<=n&&n<=r))return t;for(i=void 0===i?O:I(i);r>e;){if(r-e>600){const o=r-e+1,a=n-e+1,u=Math.log(o),c=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*c*(o-c)/o)*(a-o/2<0?-1:1);rt(t,n,Math.max(e,Math.floor(n-a*c/o+f)),Math.min(r,Math.floor(n+(o-a)*c/o+f)),i)}const o=t[n];let a=e,u=r;for(it(t,e,n),i(t[r],o)>0&&it(t,e,r);a0;)--u}0===i(t[e],o)?it(t,e,u):(++u,it(t,u,r)),u<=n&&(e=u+1),n<=u&&(r=u-1)}return t}function it(t,n,e){const r=t[n];t[n]=t[e],t[e]=r}function ot(t,e=n){let r,i=!1;if(1===e.length){let o;for(const a of t){const t=e(a);(i?n(t,o)>0:0===n(t,t))&&(r=a,o=t,i=!0)}}else for(const n of t)(i?e(n,r)>0:0===e(n,n))&&(r=n,i=!0);return r}function at(t,n,e){if(t=Float64Array.from(function*(t,n){if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(yield n);else{let e=-1;for(let r of t)null!=(r=n(r,++e,t))&&(r=+r)>=r&&(yield r)}}(t,e)),(r=t.length)&&!isNaN(n=+n)){if(n<=0||r<2)return nt(t);if(n>=1)return J(t);var r,i=(r-1)*n,o=Math.floor(i),a=J(rt(t,o).subarray(0,o+1));return a+(nt(t.subarray(o+1))-a)*(i-o)}}function ut(t,n,e=o){if((r=t.length)&&!isNaN(n=+n)){if(n<=0||r<2)return+e(t[0],0,t);if(n>=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,a=Math.floor(i),u=+e(t[a],a,t);return u+(+e(t[a+1],a+1,t)-u)*(i-a)}}function ct(t,n,e=o){if(!isNaN(n=+n)){if(r=Float64Array.from(t,((n,r)=>o(e(t[r],r,t)))),n<=0)return et(r);if(n>=1)return tt(r);var r,i=Uint32Array.from(t,((t,n)=>n)),a=r.length-1,u=Math.floor(a*n);return rt(i,u,0,a,((t,n)=>O(r[t],r[n]))),(u=ot(i.subarray(0,u+1),(t=>r[t])))>=0?u:-1}}function ft(t){return Array.from(function*(t){for(const n of t)yield*n}(t))}function st(t,n){return[t,n]}function lt(t,n,e){t=+t,n=+n,e=(i=arguments.length)<2?(n=t,t=0,1):i<3?1:+e;for(var r=-1,i=0|Math.max(0,Math.ceil((n-t)/e)),o=new Array(i);++r+t(n)}function kt(t,n){return n=Math.max(0,t.bandwidth()-2*n)/2,t.round()&&(n=Math.round(n)),e=>+t(e)+n}function Ct(){return!this.__axis}function Pt(t,n){var e=[],r=null,i=null,o=6,a=6,u=3,c="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,f=t===xt||t===Tt?-1:1,s=t===Tt||t===wt?"x":"y",l=t===xt||t===Mt?St:Et;function h(h){var d=null==r?n.ticks?n.ticks.apply(n,e):n.domain():r,p=null==i?n.tickFormat?n.tickFormat.apply(n,e):mt:i,g=Math.max(o,0)+u,y=n.range(),v=+y[0]+c,_=+y[y.length-1]+c,b=(n.bandwidth?kt:Nt)(n.copy(),c),m=h.selection?h.selection():h,x=m.selectAll(".domain").data([null]),w=m.selectAll(".tick").data(d,n).order(),M=w.exit(),T=w.enter().append("g").attr("class","tick"),A=w.select("line"),S=w.select("text");x=x.merge(x.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),w=w.merge(T),A=A.merge(T.append("line").attr("stroke","currentColor").attr(s+"2",f*o)),S=S.merge(T.append("text").attr("fill","currentColor").attr(s,f*g).attr("dy",t===xt?"0em":t===Mt?"0.71em":"0.32em")),h!==m&&(x=x.transition(h),w=w.transition(h),A=A.transition(h),S=S.transition(h),M=M.transition(h).attr("opacity",At).attr("transform",(function(t){return isFinite(t=b(t))?l(t+c):this.getAttribute("transform")})),T.attr("opacity",At).attr("transform",(function(t){var n=this.parentNode.__axis;return l((n&&isFinite(n=n(t))?n:b(t))+c)}))),M.remove(),x.attr("d",t===Tt||t===wt?a?"M"+f*a+","+v+"H"+c+"V"+_+"H"+f*a:"M"+c+","+v+"V"+_:a?"M"+v+","+f*a+"V"+c+"H"+_+"V"+f*a:"M"+v+","+c+"H"+_),w.attr("opacity",1).attr("transform",(function(t){return l(b(t)+c)})),A.attr(s+"2",f*o),S.attr(s,f*g).text(p),m.filter(Ct).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===wt?"start":t===Tt?"end":"middle"),m.each((function(){this.__axis=b}))}return h.scale=function(t){return arguments.length?(n=t,h):n},h.ticks=function(){return e=Array.from(arguments),h},h.tickArguments=function(t){return arguments.length?(e=null==t?[]:Array.from(t),h):e.slice()},h.tickValues=function(t){return arguments.length?(r=null==t?null:Array.from(t),h):r&&r.slice()},h.tickFormat=function(t){return arguments.length?(i=t,h):i},h.tickSize=function(t){return arguments.length?(o=a=+t,h):o},h.tickSizeInner=function(t){return arguments.length?(o=+t,h):o},h.tickSizeOuter=function(t){return arguments.length?(a=+t,h):a},h.tickPadding=function(t){return arguments.length?(u=+t,h):u},h.offset=function(t){return arguments.length?(c=+t,h):c},h}var zt={value:()=>{}};function $t(){for(var t,n=0,e=arguments.length,r={};n=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))),a=-1,u=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++a0)for(var e,r,i=new Array(e),o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Ut.hasOwnProperty(n)?{space:Ut[n],local:t}:t}function Ot(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===qt&&n.documentElement.namespaceURI===qt?n.createElement(t):n.createElementNS(e,t)}}function Bt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Yt(t){var n=It(t);return(n.local?Bt:Ot)(n)}function Lt(){}function jt(t){return null==t?Lt:function(){return this.querySelector(t)}}function Ht(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}function Xt(){return[]}function Gt(t){return null==t?Xt:function(){return this.querySelectorAll(t)}}function Vt(t){return function(){return this.matches(t)}}function Wt(t){return function(n){return n.matches(t)}}var Zt=Array.prototype.find;function Kt(){return this.firstElementChild}var Qt=Array.prototype.filter;function Jt(){return Array.from(this.children)}function tn(t){return new Array(t.length)}function nn(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function en(t,n,e,r,i,o){for(var a,u=0,c=n.length,f=o.length;un?1:t>=n?0:NaN}function cn(t){return function(){this.removeAttribute(t)}}function fn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function sn(t,n){return function(){this.setAttribute(t,n)}}function ln(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function hn(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function dn(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function pn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function gn(t){return function(){this.style.removeProperty(t)}}function yn(t,n,e){return function(){this.style.setProperty(t,n,e)}}function vn(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function _n(t,n){return t.style.getPropertyValue(n)||pn(t).getComputedStyle(t,null).getPropertyValue(n)}function bn(t){return function(){delete this[t]}}function mn(t,n){return function(){this[t]=n}}function xn(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function wn(t){return t.trim().split(/^|\s+/)}function Mn(t){return t.classList||new Tn(t)}function Tn(t){this._node=t,this._names=wn(t.getAttribute("class")||"")}function An(t,n){for(var e=Mn(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Gn=[null];function Vn(t,n){this._groups=t,this._parents=n}function Wn(){return new Vn([[document.documentElement]],Gn)}function Zn(t){return"string"==typeof t?new Vn([[document.querySelector(t)]],[document.documentElement]):new Vn([[t]],Gn)}Vn.prototype=Wn.prototype={constructor:Vn,select:function(t){"function"!=typeof t&&(t=jt(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i=m&&(m=b+1);!(_=y[m])&&++m=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=un);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?gn:"function"==typeof n?vn:yn)(t,n,null==e?"":e)):_n(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?bn:"function"==typeof n?xn:mn)(t,n)):this.node()[t]},classed:function(t,n){var e=wn(t+"");if(arguments.length<2){for(var r=Mn(this.node()),i=-1,o=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?Ln:Yn,r=0;r()=>t;function fe(t,{sourceEvent:n,subject:e,target:r,identifier:i,active:o,x:a,y:u,dx:c,dy:f,dispatch:s}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:s}})}function se(t){return!t.ctrlKey&&!t.button}function le(){return this.parentNode}function he(t,n){return null==n?{x:t.x,y:t.y}:n}function de(){return navigator.maxTouchPoints||"ontouchstart"in this}function pe(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function ge(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function ye(){}fe.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var ve=.7,_e=1/ve,be="\\s*([+-]?\\d+)\\s*",me="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",xe="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",we=/^#([0-9a-f]{3,8})$/,Me=new RegExp(`^rgb\\(${be},${be},${be}\\)$`),Te=new RegExp(`^rgb\\(${xe},${xe},${xe}\\)$`),Ae=new RegExp(`^rgba\\(${be},${be},${be},${me}\\)$`),Se=new RegExp(`^rgba\\(${xe},${xe},${xe},${me}\\)$`),Ee=new RegExp(`^hsl\\(${me},${xe},${xe}\\)$`),Ne=new RegExp(`^hsla\\(${me},${xe},${xe},${me}\\)$`),ke={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ce(){return this.rgb().formatHex()}function Pe(){return this.rgb().formatRgb()}function ze(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=we.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?$e(n):3===e?new qe(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?De(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?De(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=Me.exec(t))?new qe(n[1],n[2],n[3],1):(n=Te.exec(t))?new qe(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Ae.exec(t))?De(n[1],n[2],n[3],n[4]):(n=Se.exec(t))?De(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Ee.exec(t))?Le(n[1],n[2]/100,n[3]/100,1):(n=Ne.exec(t))?Le(n[1],n[2]/100,n[3]/100,n[4]):ke.hasOwnProperty(t)?$e(ke[t]):"transparent"===t?new qe(NaN,NaN,NaN,0):null}function $e(t){return new qe(t>>16&255,t>>8&255,255&t,1)}function De(t,n,e,r){return r<=0&&(t=n=e=NaN),new qe(t,n,e,r)}function Re(t){return t instanceof ye||(t=ze(t)),t?new qe((t=t.rgb()).r,t.g,t.b,t.opacity):new qe}function Fe(t,n,e,r){return 1===arguments.length?Re(t):new qe(t,n,e,null==r?1:r)}function qe(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function Ue(){return`#${Ye(this.r)}${Ye(this.g)}${Ye(this.b)}`}function Ie(){const t=Oe(this.opacity);return`${1===t?"rgb(":"rgba("}${Be(this.r)}, ${Be(this.g)}, ${Be(this.b)}${1===t?")":`, ${t})`}`}function Oe(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Be(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ye(t){return((t=Be(t))<16?"0":"")+t.toString(16)}function Le(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new Xe(t,n,e,r)}function je(t){if(t instanceof Xe)return new Xe(t.h,t.s,t.l,t.opacity);if(t instanceof ye||(t=ze(t)),!t)return new Xe;if(t instanceof Xe)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,c=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e0&&c<1?0:a,new Xe(a,u,c,t.opacity)}function He(t,n,e,r){return 1===arguments.length?je(t):new Xe(t,n,e,null==r?1:r)}function Xe(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Ge(t){return(t=(t||0)%360)<0?t+360:t}function Ve(t){return Math.max(0,Math.min(1,t||0))}function We(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}pe(ye,ze,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Ce,formatHex:Ce,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return je(this).formatHsl()},formatRgb:Pe,toString:Pe}),pe(qe,Fe,ge(ye,{brighter(t){return t=null==t?_e:Math.pow(_e,t),new qe(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?ve:Math.pow(ve,t),new qe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new qe(Be(this.r),Be(this.g),Be(this.b),Oe(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Ue,formatHex:Ue,formatHex8:function(){return`#${Ye(this.r)}${Ye(this.g)}${Ye(this.b)}${Ye(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ie,toString:Ie})),pe(Xe,He,ge(ye,{brighter(t){return t=null==t?_e:Math.pow(_e,t),new Xe(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?ve:Math.pow(ve,t),new Xe(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new qe(We(t>=240?t-240:t+120,i,r),We(t,i,r),We(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new Xe(Ge(this.h),Ve(this.s),Ve(this.l),Oe(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Oe(this.opacity);return`${1===t?"hsl(":"hsla("}${Ge(this.h)}, ${100*Ve(this.s)}%, ${100*Ve(this.l)}%${1===t?")":`, ${t})`}`}}));const Ze=Math.PI/180,Ke=180/Math.PI,Qe=.96422,Je=1,tr=.82521,nr=4/29,er=6/29,rr=3*er*er,ir=er*er*er;function or(t){if(t instanceof ur)return new ur(t.l,t.a,t.b,t.opacity);if(t instanceof pr)return gr(t);t instanceof qe||(t=Re(t));var n,e,r=lr(t.r),i=lr(t.g),o=lr(t.b),a=cr((.2225045*r+.7168786*i+.0606169*o)/Je);return r===i&&i===o?n=e=a:(n=cr((.4360747*r+.3850649*i+.1430804*o)/Qe),e=cr((.0139322*r+.0971045*i+.7141733*o)/tr)),new ur(116*a-16,500*(n-a),200*(a-e),t.opacity)}function ar(t,n,e,r){return 1===arguments.length?or(t):new ur(t,n,e,null==r?1:r)}function ur(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function cr(t){return t>ir?Math.pow(t,1/3):t/rr+nr}function fr(t){return t>er?t*t*t:rr*(t-nr)}function sr(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function lr(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function hr(t){if(t instanceof pr)return new pr(t.h,t.c,t.l,t.opacity);if(t instanceof ur||(t=or(t)),0===t.a&&0===t.b)return new pr(NaN,0=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r()=>t;function Cr(t,n){return function(e){return t+e*n}}function Pr(t,n){var e=n-t;return e?Cr(t,e>180||e<-180?e-360*Math.round(e/360):e):kr(isNaN(t)?n:t)}function zr(t){return 1==(t=+t)?$r:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):kr(isNaN(n)?e:n)}}function $r(t,n){var e=n-t;return e?Cr(t,e):kr(isNaN(t)?n:t)}var Dr=function t(n){var e=zr(n);function r(t,n){var r=e((t=Fe(t)).r,(n=Fe(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=$r(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function Rr(t){return function(n){var e,r,i=n.length,o=new Array(i),a=new Array(i),u=new Array(i);for(e=0;eo&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:Yr(e,r)})),o=Hr.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:Yr(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,c),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:Yr(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,c),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:Yr(t,e)},{i:u-2,x:Yr(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(void 0,t),n=n._next;--yi}function Ci(){xi=(mi=Mi.now())+wi,yi=vi=0;try{ki()}finally{yi=0,function(){var t,n,e=pi,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:pi=n);gi=t,zi(r)}(),xi=0}}function Pi(){var t=Mi.now(),n=t-mi;n>bi&&(wi-=n,mi=t)}function zi(t){yi||(vi&&(vi=clearTimeout(vi)),t-xi>24?(t<1/0&&(vi=setTimeout(Ci,t-Mi.now()-wi)),_i&&(_i=clearInterval(_i))):(_i||(mi=Mi.now(),_i=setInterval(Pi,bi)),yi=1,Ti(Ci)))}function $i(t,n,e){var r=new Ei;return n=null==n?0:+n,r.restart((e=>{r.stop(),t(e+n)}),n,e),r}Ei.prototype=Ni.prototype={constructor:Ei,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?Ai():+e)+(null==n?0:+n),this._next||gi===this||(gi?gi._next=this:pi=this,gi=this),this._call=t,this._time=e,zi()},stop:function(){this._call&&(this._call=null,this._time=1/0,zi())}};var Di=$t("start","end","cancel","interrupt"),Ri=[],Fi=0,qi=1,Ui=2,Ii=3,Oi=4,Bi=5,Yi=6;function Li(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(t){e.state=qi,e.timer.restart(a,e.delay,e.time),e.delay<=t&&a(t-e.delay)}function a(o){var f,s,l,h;if(e.state!==qi)return c();for(f in i)if((h=i[f]).name===e.name){if(h.state===Ii)return $i(a);h.state===Oi?(h.state=Yi,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+fFi)throw new Error("too late; already scheduled");return e}function Hi(t,n){var e=Xi(t,n);if(e.state>Ii)throw new Error("too late; already running");return e}function Xi(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Gi(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>Ui&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?ji:Hi;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var e=It(t),r="transform"===e?ni:Ki;return this.attrTween(t,"function"==typeof n?(e.local?ro:eo)(e,r,Zi(this,"attr."+t,n)):null==n?(e.local?Ji:Qi)(e):(e.local?no:to)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=It(t);return this.tween(e,(r.local?io:oo)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?ti:Ki;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=_n(this,t),a=(this.style.removeProperty(t),_n(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(t,r)).on("end.style."+t,lo(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var a=_n(this,t),u=e(this),c=u+"";return null==u&&(this.style.removeProperty(t),c=u=_n(this,t)),a===c?null:a===r&&c===i?o:(i=c,o=n(r=a,u))}}(t,r,Zi(this,"style."+t,n))).each(function(t,n){var e,r,i,o,a="style."+n,u="end."+a;return function(){var c=Hi(this,t),f=c.on,s=null==c.value[a]?o||(o=lo(n)):void 0;f===e&&i===s||(r=(e=f).copy()).on(u,i=s),c.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var a=_n(this,t);return a===o?null:a===r?i:i=n(r=a,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Zi(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&function(t){return function(n){this.textContent=t.call(this,n)}}(r)),n}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Xi(this.node(),e).tween,o=0,a=i.length;o()=>t;function Qo(t,{sourceEvent:n,target:e,selection:r,mode:i,dispatch:o}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},selection:{value:r,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Jo(t){t.preventDefault(),t.stopImmediatePropagation()}var ta={name:"drag"},na={name:"space"},ea={name:"handle"},ra={name:"center"};const{abs:ia,max:oa,min:aa}=Math;function ua(t){return[+t[0],+t[1]]}function ca(t){return[ua(t[0]),ua(t[1])]}var fa={name:"x",handles:["w","e"].map(va),input:function(t,n){return null==t?null:[[+t[0],n[0][1]],[+t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},sa={name:"y",handles:["n","s"].map(va),input:function(t,n){return null==t?null:[[n[0][0],+t[0]],[n[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},la={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(va),input:function(t){return null==t?null:ca(t)},output:function(t){return t}},ha={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},da={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},pa={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},ga={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},ya={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function va(t){return{type:t}}function _a(t){return!t.ctrlKey&&!t.button}function ba(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function ma(){return navigator.maxTouchPoints||"ontouchstart"in this}function xa(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function wa(t){var n,e=ba,r=_a,i=ma,o=!0,a=$t("start","brush","end"),u=6;function c(n){var e=n.property("__brush",g).selectAll(".overlay").data([va("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",ha.overlay).merge(e).each((function(){var t=xa(this).extent;Zn(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),n.selectAll(".selection").data([va("selection")]).enter().append("rect").attr("class","selection").attr("cursor",ha.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return ha[t.type]})),n.each(f).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(){var t=Zn(this),n=xa(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-u/2:n[0][0]-u/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-u/2:n[0][1]-u/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+u:u})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+u:u}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function s(t,n,e){var r=t.__brush.emitter;return!r||e&&r.clean?new l(t,n,e):r}function l(t,n,e){this.that=t,this.args=n,this.state=t.__brush,this.active=0,this.clean=e}function h(e){if((!n||e.touches)&&r.apply(this,arguments)){var i,a,u,c,l,h,d,p,g,y,v,_=this,b=e.target.__data__.type,m="selection"===(o&&e.metaKey?b="overlay":b)?ta:o&&e.altKey?ra:ea,x=t===sa?null:ga[b],w=t===fa?null:ya[b],M=xa(_),T=M.extent,A=M.selection,S=T[0][0],E=T[0][1],N=T[1][0],k=T[1][1],C=0,P=0,z=x&&w&&o&&e.shiftKey,$=Array.from(e.touches||[e],(t=>{const n=t.identifier;return(t=ne(t,_)).point0=t.slice(),t.identifier=n,t}));Gi(_);var D=s(_,arguments,!0).beforestart();if("overlay"===b){A&&(g=!0);const n=[$[0],$[1]||$[0]];M.selection=A=[[i=t===sa?S:aa(n[0][0],n[1][0]),u=t===fa?E:aa(n[0][1],n[1][1])],[l=t===sa?N:oa(n[0][0],n[1][0]),d=t===fa?k:oa(n[0][1],n[1][1])]],$.length>1&&I(e)}else i=A[0][0],u=A[0][1],l=A[1][0],d=A[1][1];a=i,c=u,h=l,p=d;var R=Zn(_).attr("pointer-events","none"),F=R.selectAll(".overlay").attr("cursor",ha[b]);if(e.touches)D.moved=U,D.ended=O;else{var q=Zn(e.view).on("mousemove.brush",U,!0).on("mouseup.brush",O,!0);o&&q.on("keydown.brush",(function(t){switch(t.keyCode){case 16:z=x&&w;break;case 18:m===ea&&(x&&(l=h-C*x,i=a+C*x),w&&(d=p-P*w,u=c+P*w),m=ra,I(t));break;case 32:m!==ea&&m!==ra||(x<0?l=h-C:x>0&&(i=a-C),w<0?d=p-P:w>0&&(u=c-P),m=na,F.attr("cursor",ha.selection),I(t));break;default:return}Jo(t)}),!0).on("keyup.brush",(function(t){switch(t.keyCode){case 16:z&&(y=v=z=!1,I(t));break;case 18:m===ra&&(x<0?l=h:x>0&&(i=a),w<0?d=p:w>0&&(u=c),m=ea,I(t));break;case 32:m===na&&(t.altKey?(x&&(l=h-C*x,i=a+C*x),w&&(d=p-P*w,u=c+P*w),m=ra):(x<0?l=h:x>0&&(i=a),w<0?d=p:w>0&&(u=c),m=ea),F.attr("cursor",ha[b]),I(t));break;default:return}Jo(t)}),!0),ae(e.view)}f.call(_),D.start(e,m.name)}function U(t){for(const n of t.changedTouches||[t])for(const t of $)t.identifier===n.identifier&&(t.cur=ne(n,_));if(z&&!y&&!v&&1===$.length){const t=$[0];ia(t.cur[0]-t[0])>ia(t.cur[1]-t[1])?v=!0:y=!0}for(const t of $)t.cur&&(t[0]=t.cur[0],t[1]=t.cur[1]);g=!0,Jo(t),I(t)}function I(t){const n=$[0],e=n.point0;var r;switch(C=n[0]-e[0],P=n[1]-e[1],m){case na:case ta:x&&(C=oa(S-i,aa(N-l,C)),a=i+C,h=l+C),w&&(P=oa(E-u,aa(k-d,P)),c=u+P,p=d+P);break;case ea:$[1]?(x&&(a=oa(S,aa(N,$[0][0])),h=oa(S,aa(N,$[1][0])),x=1),w&&(c=oa(E,aa(k,$[0][1])),p=oa(E,aa(k,$[1][1])),w=1)):(x<0?(C=oa(S-i,aa(N-i,C)),a=i+C,h=l):x>0&&(C=oa(S-l,aa(N-l,C)),a=i,h=l+C),w<0?(P=oa(E-u,aa(k-u,P)),c=u+P,p=d):w>0&&(P=oa(E-d,aa(k-d,P)),c=u,p=d+P));break;case ra:x&&(a=oa(S,aa(N,i-C*x)),h=oa(S,aa(N,l+C*x))),w&&(c=oa(E,aa(k,u-P*w)),p=oa(E,aa(k,d+P*w)))}ht+e))}function za(t,n){var e=0,r=null,i=null,o=null;function a(a){var u,c=a.length,f=new Array(c),s=Pa(0,c),l=new Array(c*c),h=new Array(c),d=0;a=Float64Array.from({length:c*c},n?(t,n)=>a[n%c][n/c|0]:(t,n)=>a[n/c|0][n%c]);for(let n=0;nr(f[t],f[n])));for(const e of s){const r=n;if(t){const t=Pa(1+~c,c).filter((t=>t<0?a[~t*c+e]:a[e*c+t]));i&&t.sort(((t,n)=>i(t<0?-a[~t*c+e]:a[e*c+t],n<0?-a[~n*c+e]:a[e*c+n])));for(const r of t)if(r<0){(l[~r*c+e]||(l[~r*c+e]={source:null,target:null})).target={index:e,startAngle:n,endAngle:n+=a[~r*c+e]*d,value:a[~r*c+e]}}else{(l[e*c+r]||(l[e*c+r]={source:null,target:null})).source={index:e,startAngle:n,endAngle:n+=a[e*c+r]*d,value:a[e*c+r]}}h[e]={index:e,startAngle:r,endAngle:n,value:f[e]}}else{const t=Pa(0,c).filter((t=>a[e*c+t]||a[t*c+e]));i&&t.sort(((t,n)=>i(a[e*c+t],a[e*c+n])));for(const r of t){let t;if(e=0))throw new Error(`invalid digits: ${t}`);if(n>15)return qa;const e=10**n;return function(t){this._+=t[0];for(let n=1,r=t.length;nRa)if(Math.abs(s*u-c*f)>Ra&&i){let h=e-o,d=r-a,p=u*u+c*c,g=h*h+d*d,y=Math.sqrt(p),v=Math.sqrt(l),_=i*Math.tan(($a-Math.acos((p+l-g)/(2*y*v)))/2),b=_/v,m=_/y;Math.abs(b-1)>Ra&&this._append`L${t+b*f},${n+b*s}`,this._append`A${i},${i},0,0,${+(s*h>f*d)},${this._x1=t+m*u},${this._y1=n+m*c}`}else this._append`L${this._x1=t},${this._y1=n}`;else;}arc(t,n,e,r,i,o){if(t=+t,n=+n,o=!!o,(e=+e)<0)throw new Error(`negative radius: ${e}`);let a=e*Math.cos(r),u=e*Math.sin(r),c=t+a,f=n+u,s=1^o,l=o?r-i:i-r;null===this._x1?this._append`M${c},${f}`:(Math.abs(this._x1-c)>Ra||Math.abs(this._y1-f)>Ra)&&this._append`L${c},${f}`,e&&(l<0&&(l=l%Da+Da),l>Fa?this._append`A${e},${e},0,1,${s},${t-a},${n-u}A${e},${e},0,1,${s},${this._x1=c},${this._y1=f}`:l>Ra&&this._append`A${e},${e},0,${+(l>=$a)},${s},${this._x1=t+e*Math.cos(i)},${this._y1=n+e*Math.sin(i)}`)}rect(t,n,e,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${e=+e}v${+r}h${-e}Z`}toString(){return this._}};function Ia(){return new Ua}Ia.prototype=Ua.prototype;var Oa=Array.prototype.slice;function Ba(t){return function(){return t}}function Ya(t){return t.source}function La(t){return t.target}function ja(t){return t.radius}function Ha(t){return t.startAngle}function Xa(t){return t.endAngle}function Ga(){return 0}function Va(){return 10}function Wa(t){var n=Ya,e=La,r=ja,i=ja,o=Ha,a=Xa,u=Ga,c=null;function f(){var f,s=n.apply(this,arguments),l=e.apply(this,arguments),h=u.apply(this,arguments)/2,d=Oa.call(arguments),p=+r.apply(this,(d[0]=s,d)),g=o.apply(this,d)-Ea,y=a.apply(this,d)-Ea,v=+i.apply(this,(d[0]=l,d)),_=o.apply(this,d)-Ea,b=a.apply(this,d)-Ea;if(c||(c=f=Ia()),h>Ca&&(Ma(y-g)>2*h+Ca?y>g?(g+=h,y-=h):(g-=h,y+=h):g=y=(g+y)/2,Ma(b-_)>2*h+Ca?b>_?(_+=h,b-=h):(_-=h,b+=h):_=b=(_+b)/2),c.moveTo(p*Ta(g),p*Aa(g)),c.arc(0,0,p,g,y),g!==_||y!==b)if(t){var m=v-+t.apply(this,arguments),x=(_+b)/2;c.quadraticCurveTo(0,0,m*Ta(_),m*Aa(_)),c.lineTo(v*Ta(x),v*Aa(x)),c.lineTo(m*Ta(b),m*Aa(b))}else c.quadraticCurveTo(0,0,v*Ta(_),v*Aa(_)),c.arc(0,0,v,_,b);if(c.quadraticCurveTo(0,0,p*Ta(g),p*Aa(g)),c.closePath(),f)return c=null,f+""||null}return t&&(f.headRadius=function(n){return arguments.length?(t="function"==typeof n?n:Ba(+n),f):t}),f.radius=function(t){return arguments.length?(r=i="function"==typeof t?t:Ba(+t),f):r},f.sourceRadius=function(t){return arguments.length?(r="function"==typeof t?t:Ba(+t),f):r},f.targetRadius=function(t){return arguments.length?(i="function"==typeof t?t:Ba(+t),f):i},f.startAngle=function(t){return arguments.length?(o="function"==typeof t?t:Ba(+t),f):o},f.endAngle=function(t){return arguments.length?(a="function"==typeof t?t:Ba(+t),f):a},f.padAngle=function(t){return arguments.length?(u="function"==typeof t?t:Ba(+t),f):u},f.source=function(t){return arguments.length?(n=t,f):n},f.target=function(t){return arguments.length?(e=t,f):e},f.context=function(t){return arguments.length?(c=null==t?null:t,f):c},f}var Za=Array.prototype.slice;function Ka(t,n){return t-n}var Qa=t=>()=>t;function Ja(t,n){for(var e,r=-1,i=n.length;++rr!=d>r&&e<(h-f)*(r-s)/(d-s)+f&&(i=-i)}return i}function nu(t,n,e){var r,i,o,a;return function(t,n,e){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])}(t,n,e)&&(i=t[r=+(t[0]===n[0])],o=e[r],a=n[r],i<=o&&o<=a||a<=o&&o<=i)}function eu(){}var ru=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function iu(){var t=1,n=1,e=K,r=u;function i(t){var n=e(t);if(Array.isArray(n))n=n.slice().sort(Ka);else{const e=M(t,ou);for(n=G(...Z(e[0],e[1],n),n);n[n.length-1]>=e[1];)n.pop();for(;n[1]o(t,n)))}function o(e,i){const o=null==i?NaN:+i;if(isNaN(o))throw new Error(`invalid value: ${i}`);var u=[],c=[];return function(e,r,i){var o,u,c,f,s,l,h=new Array,d=new Array;o=u=-1,f=au(e[0],r),ru[f<<1].forEach(p);for(;++o=r,ru[s<<2].forEach(p);for(;++o0?u.push([t]):c.push(t)})),c.forEach((function(t){for(var n,e=0,r=u.length;e0&&o0&&a=0&&o>=0))throw new Error("invalid size");return t=r,n=o,i},i.thresholds=function(t){return arguments.length?(e="function"==typeof t?t:Array.isArray(t)?Qa(Za.call(t)):Qa(t),i):e},i.smooth=function(t){return arguments.length?(r=t?u:eu,i):r===u},i}function ou(t){return isFinite(t)?t:NaN}function au(t,n){return null!=t&&+t>=n}function uu(t){return null==t||isNaN(t=+t)?-1/0:t}function cu(t,n,e,r){const i=r-n,o=e-n,a=isFinite(i)||isFinite(o)?i/o:Math.sign(i)/Math.sign(o);return isNaN(a)?t:t+a-.5}function fu(t){return t[0]}function su(t){return t[1]}function lu(){return 1}const hu=134217729,du=33306690738754706e-32;function pu(t,n,e,r,i){let o,a,u,c,f=n[0],s=r[0],l=0,h=0;s>f==s>-f?(o=f,f=n[++l]):(o=s,s=r[++h]);let d=0;if(lf==s>-f?(a=f+o,u=o-(a-f),f=n[++l]):(a=s+o,u=o-(a-s),s=r[++h]),o=a,0!==u&&(i[d++]=u);lf==s>-f?(a=o+f,c=a-o,u=o-(a-c)+(f-c),f=n[++l]):(a=o+s,c=a-o,u=o-(a-c)+(s-c),s=r[++h]),o=a,0!==u&&(i[d++]=u);for(;l=33306690738754716e-32*f?c:-function(t,n,e,r,i,o,a){let u,c,f,s,l,h,d,p,g,y,v,_,b,m,x,w,M,T;const A=t-i,S=e-i,E=n-o,N=r-o;m=A*N,h=hu*A,d=h-(h-A),p=A-d,h=hu*N,g=h-(h-N),y=N-g,x=p*y-(m-d*g-p*g-d*y),w=E*S,h=hu*E,d=h-(h-E),p=E-d,h=hu*S,g=h-(h-S),y=S-g,M=p*y-(w-d*g-p*g-d*y),v=x-M,l=x-v,_u[0]=x-(v+l)+(l-M),_=m+v,l=_-m,b=m-(_-l)+(v-l),v=b-w,l=b-v,_u[1]=b-(v+l)+(l-w),T=_+v,l=T-_,_u[2]=_-(T-l)+(v-l),_u[3]=T;let k=function(t,n){let e=n[0];for(let r=1;r=C||-k>=C)return k;if(l=t-A,u=t-(A+l)+(l-i),l=e-S,f=e-(S+l)+(l-i),l=n-E,c=n-(E+l)+(l-o),l=r-N,s=r-(N+l)+(l-o),0===u&&0===c&&0===f&&0===s)return k;if(C=vu*a+du*Math.abs(k),k+=A*s+N*u-(E*f+S*c),k>=C||-k>=C)return k;m=u*N,h=hu*u,d=h-(h-u),p=u-d,h=hu*N,g=h-(h-N),y=N-g,x=p*y-(m-d*g-p*g-d*y),w=c*S,h=hu*c,d=h-(h-c),p=c-d,h=hu*S,g=h-(h-S),y=S-g,M=p*y-(w-d*g-p*g-d*y),v=x-M,l=x-v,wu[0]=x-(v+l)+(l-M),_=m+v,l=_-m,b=m-(_-l)+(v-l),v=b-w,l=b-v,wu[1]=b-(v+l)+(l-w),T=_+v,l=T-_,wu[2]=_-(T-l)+(v-l),wu[3]=T;const P=pu(4,_u,4,wu,bu);m=A*s,h=hu*A,d=h-(h-A),p=A-d,h=hu*s,g=h-(h-s),y=s-g,x=p*y-(m-d*g-p*g-d*y),w=E*f,h=hu*E,d=h-(h-E),p=E-d,h=hu*f,g=h-(h-f),y=f-g,M=p*y-(w-d*g-p*g-d*y),v=x-M,l=x-v,wu[0]=x-(v+l)+(l-M),_=m+v,l=_-m,b=m-(_-l)+(v-l),v=b-w,l=b-v,wu[1]=b-(v+l)+(l-w),T=_+v,l=T-_,wu[2]=_-(T-l)+(v-l),wu[3]=T;const z=pu(P,bu,4,wu,mu);m=u*s,h=hu*u,d=h-(h-u),p=u-d,h=hu*s,g=h-(h-s),y=s-g,x=p*y-(m-d*g-p*g-d*y),w=c*f,h=hu*c,d=h-(h-c),p=c-d,h=hu*f,g=h-(h-f),y=f-g,M=p*y-(w-d*g-p*g-d*y),v=x-M,l=x-v,wu[0]=x-(v+l)+(l-M),_=m+v,l=_-m,b=m-(_-l)+(v-l),v=b-w,l=b-v,wu[1]=b-(v+l)+(l-w),T=_+v,l=T-_,wu[2]=_-(T-l)+(v-l),wu[3]=T;const $=pu(z,mu,4,wu,xu);return xu[$-1]}(t,n,e,r,i,o,f)}const Tu=Math.pow(2,-52),Au=new Uint32Array(512);class Su{static from(t,n=zu,e=$u){const r=t.length,i=new Float64Array(2*r);for(let o=0;o>1;if(n>0&&"number"!=typeof t[0])throw new Error("Expected coords to contain numbers.");this.coords=t;const e=Math.max(2*n-5,0);this._triangles=new Uint32Array(3*e),this._halfedges=new Int32Array(3*e),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}update(){const{coords:t,_hullPrev:n,_hullNext:e,_hullTri:r,_hullHash:i}=this,o=t.length>>1;let a=1/0,u=1/0,c=-1/0,f=-1/0;for(let n=0;nc&&(c=e),r>f&&(f=r),this._ids[n]=n}const s=(a+c)/2,l=(u+f)/2;let h,d,p;for(let n=0,e=1/0;n0&&(d=n,e=r)}let v=t[2*d],_=t[2*d+1],b=1/0;for(let n=0;nr&&(n[e++]=i,r=o)}return this.hull=n.subarray(0,e),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Mu(g,y,v,_,m,x)<0){const t=d,n=v,e=_;d=p,v=m,_=x,p=t,m=n,x=e}const w=function(t,n,e,r,i,o){const a=e-t,u=r-n,c=i-t,f=o-n,s=a*a+u*u,l=c*c+f*f,h=.5/(a*f-u*c),d=t+(f*s-u*l)*h,p=n+(a*l-c*s)*h;return{x:d,y:p}}(g,y,v,_,m,x);this._cx=w.x,this._cy=w.y;for(let n=0;n0&&Math.abs(f-o)<=Tu&&Math.abs(s-a)<=Tu)continue;if(o=f,a=s,c===h||c===d||c===p)continue;let l=0;for(let t=0,n=this._hashKey(f,s);t=0;)if(y=g,y===l){y=-1;break}if(-1===y)continue;let v=this._addTriangle(y,c,e[y],-1,-1,r[y]);r[c]=this._legalize(v+2),r[y]=v,M++;let _=e[y];for(;g=e[_],Mu(f,s,t[2*_],t[2*_+1],t[2*g],t[2*g+1])<0;)v=this._addTriangle(_,c,g,r[c],-1,r[_]),r[c]=this._legalize(v+2),e[_]=_,M--,_=g;if(y===l)for(;g=n[y],Mu(f,s,t[2*g],t[2*g+1],t[2*y],t[2*y+1])<0;)v=this._addTriangle(g,c,y,-1,r[y],r[g]),this._legalize(v+2),r[g]=v,e[y]=y,M--,y=g;this._hullStart=n[c]=y,e[y]=n[_]=c,e[c]=_,i[this._hashKey(f,s)]=c,i[this._hashKey(t[2*y],t[2*y+1])]=y}this.hull=new Uint32Array(M);for(let t=0,n=this._hullStart;t0?3-e:1+e)/4}(t-this._cx,n-this._cy)*this._hashSize)%this._hashSize}_legalize(t){const{_triangles:n,_halfedges:e,coords:r}=this;let i=0,o=0;for(;;){const a=e[t],u=t-t%3;if(o=u+(t+2)%3,-1===a){if(0===i)break;t=Au[--i];continue}const c=a-a%3,f=u+(t+1)%3,s=c+(a+2)%3,l=n[o],h=n[t],d=n[f],p=n[s];if(Nu(r[2*l],r[2*l+1],r[2*h],r[2*h+1],r[2*d],r[2*d+1],r[2*p],r[2*p+1])){n[t]=p,n[a]=l;const r=e[s];if(-1===r){let n=this._hullStart;do{if(this._hullTri[n]===s){this._hullTri[n]=t;break}n=this._hullPrev[n]}while(n!==this._hullStart)}this._link(t,r),this._link(a,e[o]),this._link(o,s);const u=c+(a+1)%3;i=e&&n[t[a]]>o;)t[a+1]=t[a--];t[a+1]=r}else{let i=e+1,o=r;Pu(t,e+r>>1,i),n[t[e]]>n[t[r]]&&Pu(t,e,r),n[t[i]]>n[t[r]]&&Pu(t,i,r),n[t[e]]>n[t[i]]&&Pu(t,e,i);const a=t[i],u=n[a];for(;;){do{i++}while(n[t[i]]u);if(o=o-e?(Cu(t,n,i,r),Cu(t,n,e,o-1)):(Cu(t,n,e,o-1),Cu(t,n,i,r))}}function Pu(t,n,e){const r=t[n];t[n]=t[e],t[e]=r}function zu(t){return t[0]}function $u(t){return t[1]}const Du=1e-6;class Ru{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(t,n){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(t,n){this._+=`L${this._x1=+t},${this._y1=+n}`}arc(t,n,e){const r=(t=+t)+(e=+e),i=n=+n;if(e<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},${i}`:(Math.abs(this._x1-r)>Du||Math.abs(this._y1-i)>Du)&&(this._+="L"+r+","+i),e&&(this._+=`A${e},${e},0,1,1,${t-e},${n}A${e},${e},0,1,1,${this._x1=r},${this._y1=i}`)}rect(t,n,e,r){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${+e}v${+r}h${-e}Z`}value(){return this._||null}}class Fu{constructor(){this._=[]}moveTo(t,n){this._.push([t,n])}closePath(){this._.push(this._[0].slice())}lineTo(t,n){this._.push([t,n])}value(){return this._.length?this._:null}}class qu{constructor(t,[n,e,r,i]=[0,0,960,500]){if(!((r=+r)>=(n=+n)&&(i=+i)>=(e=+e)))throw new Error("invalid bounds");this.delaunay=t,this._circumcenters=new Float64Array(2*t.points.length),this.vectors=new Float64Array(2*t.points.length),this.xmax=r,this.xmin=n,this.ymax=i,this.ymin=e,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:t,hull:n,triangles:e},vectors:r}=this;let i,o;const a=this.circumcenters=this._circumcenters.subarray(0,e.length/3*2);for(let r,u,c=0,f=0,s=e.length;c1;)i-=2;for(let t=2;t0){if(n>=this.ymax)return null;(i=(this.ymax-n)/r)0){if(t>=this.xmax)return null;(i=(this.xmax-t)/e)this.xmax?2:0)|(nthis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let n=0;n2&&function(t){const{triangles:n,coords:e}=t;for(let t=0;t1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:n.length/2},((t,n)=>n)).sort(((t,e)=>n[2*t]-n[2*e]||n[2*t+1]-n[2*e+1]));const t=this.collinear[0],e=this.collinear[this.collinear.length-1],r=[n[2*t],n[2*t+1],n[2*e],n[2*e+1]],i=1e-8*Math.hypot(r[3]-r[1],r[2]-r[0]);for(let t=0,e=n.length/2;t0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=r[0],o[r[0]]=1,2===r.length&&(o[r[1]]=0,this.triangles[1]=r[1],this.triangles[2]=r[1]))}voronoi(t){return new qu(this,t)}*neighbors(t){const{inedges:n,hull:e,_hullIndex:r,halfedges:i,triangles:o,collinear:a}=this;if(a){const n=a.indexOf(t);return n>0&&(yield a[n-1]),void(n=0&&i!==e&&i!==r;)e=i;return i}_step(t,n,e){const{inedges:r,hull:i,_hullIndex:o,halfedges:a,triangles:u,points:c}=this;if(-1===r[t]||!c.length)return(t+1)%(c.length>>1);let f=t,s=Iu(n-c[2*t],2)+Iu(e-c[2*t+1],2);const l=r[t];let h=l;do{let r=u[h];const l=Iu(n-c[2*r],2)+Iu(e-c[2*r+1],2);if(l9999?"+"+Ku(n,6):Ku(n,4))+"-"+Ku(t.getUTCMonth()+1,2)+"-"+Ku(t.getUTCDate(),2)+(o?"T"+Ku(e,2)+":"+Ku(r,2)+":"+Ku(i,2)+"."+Ku(o,3)+"Z":i?"T"+Ku(e,2)+":"+Ku(r,2)+":"+Ku(i,2)+"Z":r||e?"T"+Ku(e,2)+":"+Ku(r,2)+"Z":"")}function Ju(t){var n=new RegExp('["'+t+"\n\r]"),e=t.charCodeAt(0);function r(t,n){var r,i=[],o=t.length,a=0,u=0,c=o<=0,f=!1;function s(){if(c)return Hu;if(f)return f=!1,ju;var n,r,i=a;if(t.charCodeAt(i)===Xu){for(;a++=o?c=!0:(r=t.charCodeAt(a++))===Gu?f=!0:r===Vu&&(f=!0,t.charCodeAt(a)===Gu&&++a),t.slice(i+1,n-1).replace(/""/g,'"')}for(;amc(n,e).then((n=>(new DOMParser).parseFromString(n,t)))}var Sc=Ac("application/xml"),Ec=Ac("text/html"),Nc=Ac("image/svg+xml");function kc(t,n,e,r){if(isNaN(n)||isNaN(e))return t;var i,o,a,u,c,f,s,l,h,d=t._root,p={data:r},g=t._x0,y=t._y0,v=t._x1,_=t._y1;if(!d)return t._root=p,t;for(;d.length;)if((f=n>=(o=(g+v)/2))?g=o:v=o,(s=e>=(a=(y+_)/2))?y=a:_=a,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(u=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===u&&e===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=n>=(o=(g+v)/2))?g=o:v=o,(s=e>=(a=(y+_)/2))?y=a:_=a}while((l=s<<1|f)==(h=(c>=a)<<1|u>=o));return i[h]=d,i[l]=p,t}function Cc(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function Pc(t){return t[0]}function zc(t){return t[1]}function $c(t,n,e){var r=new Dc(null==n?Pc:n,null==e?zc:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function Dc(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Rc(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var Fc=$c.prototype=Dc.prototype;function qc(t){return function(){return t}}function Uc(t){return 1e-6*(t()-.5)}function Ic(t){return t.x+t.vx}function Oc(t){return t.y+t.vy}function Bc(t){return t.index}function Yc(t,n){var e=t.get(n);if(!e)throw new Error("node not found: "+n);return e}Fc.copy=function(){var t,n,e=new Dc(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=Rc(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=Rc(n));return e},Fc.add=function(t){const n=+this._x.call(null,t),e=+this._y.call(null,t);return kc(this.cover(n,e),n,e,t)},Fc.addAll=function(t){var n,e,r,i,o=t.length,a=new Array(o),u=new Array(o),c=1/0,f=1/0,s=-1/0,l=-1/0;for(e=0;es&&(s=r),il&&(l=i));if(c>s||f>l)return this;for(this.cover(c,f).cover(s,l),e=0;et||t>=i||r>n||n>=o;)switch(u=(nh||(o=c.y0)>d||(a=c.x1)=v)<<1|t>=y)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var _=t-+this._x.call(null,g.data),b=n-+this._y.call(null,g.data),m=_*_+b*b;if(m=(u=(p+y)/2))?p=u:y=u,(s=a>=(c=(g+v)/2))?g=c:v=c,n=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},Fc.removeAll=function(t){for(var n=0,e=t.length;n1?r[0]+r.slice(2):r,+t.slice(e+1)]}function Zc(t){return(t=Wc(Math.abs(t)))?t[1]:NaN}var Kc,Qc=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Jc(t){if(!(n=Qc.exec(t)))throw new Error("invalid format: "+t);var n;return new tf({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function tf(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function nf(t,n){var e=Wc(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Jc.prototype=tf.prototype,tf.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var ef={"%":(t,n)=>(100*t).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>nf(100*t,n),r:nf,s:function(t,n){var e=Wc(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(Kc=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Wc(t,Math.max(0,n+o-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function rf(t){return t}var of,af=Array.prototype.map,uf=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function cf(t){var n,e,r=void 0===t.grouping||void 0===t.thousands?rf:(n=af.call(t.grouping,Number),e=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=n[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),o.push(t.substring(i-=u,i+u)),!((c+=u+1)>r));)u=n[a=(a+1)%n.length];return o.reverse().join(e)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?rf:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(af.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",f=void 0===t.minus?"−":t.minus+"",s=void 0===t.nan?"NaN":t.nan+"";function l(t){var n=(t=Jc(t)).fill,e=t.align,l=t.sign,h=t.symbol,d=t.zero,p=t.width,g=t.comma,y=t.precision,v=t.trim,_=t.type;"n"===_?(g=!0,_="g"):ef[_]||(void 0===y&&(y=12),v=!0,_="g"),(d||"0"===n&&"="===e)&&(d=!0,n="0",e="=");var b="$"===h?i:"#"===h&&/[boxX]/.test(_)?"0"+_.toLowerCase():"",m="$"===h?o:/[%p]/.test(_)?c:"",x=ef[_],w=/[defgprs%]/.test(_);function M(t){var i,o,c,h=b,M=m;if("c"===_)M=x(t)+M,t="";else{var T=(t=+t)<0||1/t<0;if(t=isNaN(t)?s:x(Math.abs(t),y),v&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),T&&0==+t&&"+"!==l&&(T=!1),h=(T?"("===l?l:f:"-"===l||"("===l?"":l)+h,M=("s"===_?uf[8+Kc/3]:"")+M+(T&&"("===l?")":""),w)for(i=-1,o=t.length;++i(c=t.charCodeAt(i))||c>57){M=(46===c?a+t.slice(i+1):t.slice(i))+M,t=t.slice(0,i);break}}g&&!d&&(t=r(t,1/0));var A=h.length+t.length+M.length,S=A>1)+h+t+M+S.slice(A);break;default:t=S+h+t+M}return u(t)}return y=void 0===y?6:/[gprs]/.test(_)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),M.toString=function(){return t+""},M}return{format:l,formatPrefix:function(t,n){var e=l(((t=Jc(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(Zc(n)/3))),i=Math.pow(10,-r),o=uf[8+r/3];return function(t){return e(i*t)+o}}}}function ff(n){return of=cf(n),t.format=of.format,t.formatPrefix=of.formatPrefix,of}function sf(t){return Math.max(0,-Zc(Math.abs(t)))}function lf(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Zc(n)/3)))-Zc(Math.abs(t)))}function hf(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,Zc(n)-Zc(t))+1}t.format=void 0,t.formatPrefix=void 0,ff({thousands:",",grouping:[3],currency:["$",""]});var df=1e-6,pf=1e-12,gf=Math.PI,yf=gf/2,vf=gf/4,_f=2*gf,bf=180/gf,mf=gf/180,xf=Math.abs,wf=Math.atan,Mf=Math.atan2,Tf=Math.cos,Af=Math.ceil,Sf=Math.exp,Ef=Math.hypot,Nf=Math.log,kf=Math.pow,Cf=Math.sin,Pf=Math.sign||function(t){return t>0?1:t<0?-1:0},zf=Math.sqrt,$f=Math.tan;function Df(t){return t>1?0:t<-1?gf:Math.acos(t)}function Rf(t){return t>1?yf:t<-1?-yf:Math.asin(t)}function Ff(t){return(t=Cf(t/2))*t}function qf(){}function Uf(t,n){t&&Of.hasOwnProperty(t.type)&&Of[t.type](t,n)}var If={Feature:function(t,n){Uf(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,o=Tf(n=(n*=mf)/2+vf),a=Cf(n),u=Vf*a,c=Gf*o+u*Tf(i),f=u*r*Cf(i);as.add(Mf(f,c)),Xf=t,Gf=o,Vf=a}function ds(t){return[Mf(t[1],t[0]),Rf(t[2])]}function ps(t){var n=t[0],e=t[1],r=Tf(e);return[r*Tf(n),r*Cf(n),Cf(e)]}function gs(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function ys(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function vs(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function _s(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function bs(t){var n=zf(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var ms,xs,ws,Ms,Ts,As,Ss,Es,Ns,ks,Cs,Ps,zs,$s,Ds,Rs,Fs={point:qs,lineStart:Is,lineEnd:Os,polygonStart:function(){Fs.point=Bs,Fs.lineStart=Ys,Fs.lineEnd=Ls,rs=new T,cs.polygonStart()},polygonEnd:function(){cs.polygonEnd(),Fs.point=qs,Fs.lineStart=Is,Fs.lineEnd=Os,as<0?(Wf=-(Kf=180),Zf=-(Qf=90)):rs>df?Qf=90:rs<-df&&(Zf=-90),os[0]=Wf,os[1]=Kf},sphere:function(){Wf=-(Kf=180),Zf=-(Qf=90)}};function qs(t,n){is.push(os=[Wf=t,Kf=t]),nQf&&(Qf=n)}function Us(t,n){var e=ps([t*mf,n*mf]);if(es){var r=ys(es,e),i=ys([r[1],-r[0],0],r);bs(i),i=ds(i);var o,a=t-Jf,u=a>0?1:-1,c=i[0]*bf*u,f=xf(a)>180;f^(u*JfQf&&(Qf=o):f^(u*Jf<(c=(c+360)%360-180)&&cQf&&(Qf=n)),f?tjs(Wf,Kf)&&(Kf=t):js(t,Kf)>js(Wf,Kf)&&(Wf=t):Kf>=Wf?(tKf&&(Kf=t)):t>Jf?js(Wf,t)>js(Wf,Kf)&&(Kf=t):js(t,Kf)>js(Wf,Kf)&&(Wf=t)}else is.push(os=[Wf=t,Kf=t]);nQf&&(Qf=n),es=e,Jf=t}function Is(){Fs.point=Us}function Os(){os[0]=Wf,os[1]=Kf,Fs.point=qs,es=null}function Bs(t,n){if(es){var e=t-Jf;rs.add(xf(e)>180?e+(e>0?360:-360):e)}else ts=t,ns=n;cs.point(t,n),Us(t,n)}function Ys(){cs.lineStart()}function Ls(){Bs(ts,ns),cs.lineEnd(),xf(rs)>df&&(Wf=-(Kf=180)),os[0]=Wf,os[1]=Kf,es=null}function js(t,n){return(n-=t)<0?n+360:n}function Hs(t,n){return t[0]-n[0]}function Xs(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:ngf&&(t-=Math.round(t/_f)*_f),[t,n]}function ul(t,n,e){return(t%=_f)?n||e?ol(fl(t),sl(n,e)):fl(t):n||e?sl(n,e):al}function cl(t){return function(n,e){return xf(n+=t)>gf&&(n-=Math.round(n/_f)*_f),[n,e]}}function fl(t){var n=cl(t);return n.invert=cl(-t),n}function sl(t,n){var e=Tf(t),r=Cf(t),i=Tf(n),o=Cf(n);function a(t,n){var a=Tf(n),u=Tf(t)*a,c=Cf(t)*a,f=Cf(n),s=f*e+u*r;return[Mf(c*i-s*o,u*e-f*r),Rf(s*i+c*o)]}return a.invert=function(t,n){var a=Tf(n),u=Tf(t)*a,c=Cf(t)*a,f=Cf(n),s=f*i-c*o;return[Mf(c*i+f*o,u*e+s*r),Rf(s*e-u*r)]},a}function ll(t){function n(n){return(n=t(n[0]*mf,n[1]*mf))[0]*=bf,n[1]*=bf,n}return t=ul(t[0]*mf,t[1]*mf,t.length>2?t[2]*mf:0),n.invert=function(n){return(n=t.invert(n[0]*mf,n[1]*mf))[0]*=bf,n[1]*=bf,n},n}function hl(t,n,e,r,i,o){if(e){var a=Tf(n),u=Cf(n),c=r*e;null==i?(i=n+r*_f,o=n-c/2):(i=dl(a,i),o=dl(a,o),(r>0?io)&&(i+=r*_f));for(var f,s=i;r>0?s>o:s1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function gl(t,n){return xf(t[0]-n[0])=0;--o)i.point((s=f[o])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function _l(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,E=S*A,N=E>gf,k=y*w;if(c.add(Mf(k*S*Cf(E),v*M+k*Tf(E))),a+=N?A+S*_f:A,N^p>=e^m>=e){var C=ys(ps(d),ps(b));bs(C);var P=ys(o,C);bs(P);var z=(N^A>=0?-1:1)*Rf(P[2]);(r>z||r===z&&(C[0]||C[1]))&&(u+=N^A>=0?1:-1)}}return(a<-df||a0){for(l||(i.polygonStart(),l=!0),i.lineStart(),t=0;t1&&2&c&&h.push(h.pop().concat(h.shift())),a.push(h.filter(wl))}return h}}function wl(t){return t.length>1}function Ml(t,n){return((t=t.x)[0]<0?t[1]-yf-df:yf-t[1])-((n=n.x)[0]<0?n[1]-yf-df:yf-n[1])}al.invert=al;var Tl=xl((function(){return!0}),(function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,a){var u=o>0?gf:-gf,c=xf(o-e);xf(c-gf)0?yf:-yf),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),n=0):i!==u&&c>=gf&&(xf(e-i)df?wf((Cf(n)*(o=Tf(r))*Cf(e)-Cf(r)*(i=Tf(n))*Cf(t))/(i*o*a)):(n+r)/2}(e,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),n=0),t.point(e=o,r=a),i=u},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}}),(function(t,n,e,r){var i;if(null==t)i=e*yf,r.point(-gf,i),r.point(0,i),r.point(gf,i),r.point(gf,0),r.point(gf,-i),r.point(0,-i),r.point(-gf,-i),r.point(-gf,0),r.point(-gf,i);else if(xf(t[0]-n[0])>df){var o=t[0]0,i=xf(n)>df;function o(t,e){return Tf(t)*Tf(e)>n}function a(t,e,r){var i=[1,0,0],o=ys(ps(t),ps(e)),a=gs(o,o),u=o[0],c=a-u*u;if(!c)return!r&&t;var f=n*a/c,s=-n*u/c,l=ys(i,o),h=_s(i,f);vs(h,_s(o,s));var d=l,p=gs(h,d),g=gs(d,d),y=p*p-g*(gs(h,h)-1);if(!(y<0)){var v=zf(y),_=_s(d,(-p-v)/g);if(vs(_,h),_=ds(_),!r)return _;var b,m=t[0],x=e[0],w=t[1],M=e[1];x0^_[1]<(xf(_[0]-m)gf^(m<=_[0]&&_[0]<=x)){var S=_s(d,(-p+v)/g);return vs(S,h),[_,ds(S)]}}}function u(n,e){var i=r?t:gf-t,o=0;return n<-i?o|=1:n>i&&(o|=2),e<-i?o|=4:e>i&&(o|=8),o}return xl(o,(function(t){var n,e,c,f,s;return{lineStart:function(){f=c=!1,s=1},point:function(l,h){var d,p=[l,h],g=o(l,h),y=r?g?0:u(l,h):g?u(l+(l<0?gf:-gf),h):0;if(!n&&(f=c=g)&&t.lineStart(),g!==c&&(!(d=a(n,p))||gl(n,d)||gl(p,d))&&(p[2]=1),g!==c)s=0,g?(t.lineStart(),d=a(p,n),t.point(d[0],d[1])):(d=a(n,p),t.point(d[0],d[1],2),t.lineEnd()),n=d;else if(i&&n&&r^g){var v;y&e||!(v=a(p,n,!0))||(s=0,r?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1],3)))}!g||n&&gl(n,p)||t.point(p[0],p[1]),n=p,c=g,e=y},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return s|(f&&c)<<1}}}),(function(n,r,i,o){hl(o,t,e,i,n,r)}),r?[0,-t]:[-gf,t-gf])}var Sl,El,Nl,kl,Cl=1e9,Pl=-Cl;function zl(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,u,f){var s=0,l=0;if(null==i||(s=a(i,u))!==(l=a(o,u))||c(i,o)<0^u>0)do{f.point(0===s||3===s?t:e,s>1?r:n)}while((s=(s+u+4)%4)!==l);else f.point(o[0],o[1])}function a(r,i){return xf(r[0]-t)0?0:3:xf(r[0]-e)0?2:1:xf(r[1]-n)0?1:0:i>0?3:2}function u(t,n){return c(t.x,n.x)}function c(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var c,f,s,l,h,d,p,g,y,v,_,b=a,m=pl(),x={point:w,lineStart:function(){x.point=M,f&&f.push(s=[]);v=!0,y=!1,p=g=NaN},lineEnd:function(){c&&(M(l,h),d&&y&&m.rejoin(),c.push(m.result()));x.point=w,y&&b.lineEnd()},polygonStart:function(){b=m,c=[],f=[],_=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,i=f.length;er&&(h-o)*(r-a)>(d-a)*(t-o)&&++n:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--n;return n}(),e=_&&n,i=(c=ft(c)).length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&vl(c,u,n,o,a),a.polygonEnd());b=a,c=f=s=null}};function w(t,n){i(t,n)&&b.point(t,n)}function M(o,a){var u=i(o,a);if(f&&s.push([o,a]),v)l=o,h=a,d=u,v=!1,u&&(b.lineStart(),b.point(o,a));else if(u&&y)b.point(o,a);else{var c=[p=Math.max(Pl,Math.min(Cl,p)),g=Math.max(Pl,Math.min(Cl,g))],m=[o=Math.max(Pl,Math.min(Cl,o)),a=Math.max(Pl,Math.min(Cl,a))];!function(t,n,e,r,i,o){var a,u=t[0],c=t[1],f=0,s=1,l=n[0]-u,h=n[1]-c;if(a=e-u,l||!(a>0)){if(a/=l,l<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=i-u,l||!(a<0)){if(a/=l,l<0){if(a>s)return;a>f&&(f=a)}else if(l>0){if(a0)){if(a/=h,h<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>s)return;a>f&&(f=a)}else if(h>0){if(a0&&(t[0]=u+f*l,t[1]=c+f*h),s<1&&(n[0]=u+s*l,n[1]=c+s*h),!0}}}}}(c,m,t,n,e,r)?u&&(b.lineStart(),b.point(o,a),_=!1):(y||(b.lineStart(),b.point(c[0],c[1])),b.point(m[0],m[1]),u||b.lineEnd(),_=!1)}p=o,g=a,y=u}return x}}var $l={sphere:qf,point:qf,lineStart:function(){$l.point=Rl,$l.lineEnd=Dl},lineEnd:qf,polygonStart:qf,polygonEnd:qf};function Dl(){$l.point=$l.lineEnd=qf}function Rl(t,n){El=t*=mf,Nl=Cf(n*=mf),kl=Tf(n),$l.point=Fl}function Fl(t,n){t*=mf;var e=Cf(n*=mf),r=Tf(n),i=xf(t-El),o=Tf(i),a=r*Cf(i),u=kl*e-Nl*r*o,c=Nl*e+kl*r*o;Sl.add(Mf(zf(a*a+u*u),c)),El=t,Nl=e,kl=r}function ql(t){return Sl=new T,Lf(t,$l),+Sl}var Ul=[null,null],Il={type:"LineString",coordinates:Ul};function Ol(t,n){return Ul[0]=t,Ul[1]=n,ql(Il)}var Bl={Feature:function(t,n){return Ll(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r0&&(i=Ol(t[o],t[o-1]))>0&&e<=i&&r<=i&&(e+r-i)*(1-Math.pow((e-r)/i,2))df})).map(c)).concat(lt(Af(o/d)*d,i,d).filter((function(t){return xf(t%g)>df})).map(f))}return v.lines=function(){return _().map((function(t){return{type:"LineString",coordinates:t}}))},v.outline=function(){return{type:"Polygon",coordinates:[s(r).concat(l(a).slice(1),s(e).reverse().slice(1),l(u).reverse().slice(1))]}},v.extent=function(t){return arguments.length?v.extentMajor(t).extentMinor(t):v.extentMinor()},v.extentMajor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],u=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),u>a&&(t=u,u=a,a=t),v.precision(y)):[[r,u],[e,a]]},v.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],n>t&&(e=n,n=t,t=e),o>i&&(e=o,o=i,i=e),v.precision(y)):[[n,o],[t,i]]},v.step=function(t){return arguments.length?v.stepMajor(t).stepMinor(t):v.stepMinor()},v.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],v):[p,g]},v.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],v):[h,d]},v.precision=function(h){return arguments.length?(y=+h,c=Wl(o,i,90),f=Zl(n,t,y),s=Wl(u,a,90),l=Zl(r,e,y),v):y},v.extentMajor([[-180,-90+df],[180,90-df]]).extentMinor([[-180,-80-df],[180,80+df]])}var Ql,Jl,th,nh,eh=t=>t,rh=new T,ih=new T,oh={point:qf,lineStart:qf,lineEnd:qf,polygonStart:function(){oh.lineStart=ah,oh.lineEnd=fh},polygonEnd:function(){oh.lineStart=oh.lineEnd=oh.point=qf,rh.add(xf(ih)),ih=new T},result:function(){var t=rh/2;return rh=new T,t}};function ah(){oh.point=uh}function uh(t,n){oh.point=ch,Ql=th=t,Jl=nh=n}function ch(t,n){ih.add(nh*t-th*n),th=t,nh=n}function fh(){ch(Ql,Jl)}var sh=oh,lh=1/0,hh=lh,dh=-lh,ph=dh,gh={point:function(t,n){tdh&&(dh=t);nph&&(ph=n)},lineStart:qf,lineEnd:qf,polygonStart:qf,polygonEnd:qf,result:function(){var t=[[lh,hh],[dh,ph]];return dh=ph=-(hh=lh=1/0),t}};var yh,vh,_h,bh,mh=gh,xh=0,wh=0,Mh=0,Th=0,Ah=0,Sh=0,Eh=0,Nh=0,kh=0,Ch={point:Ph,lineStart:zh,lineEnd:Rh,polygonStart:function(){Ch.lineStart=Fh,Ch.lineEnd=qh},polygonEnd:function(){Ch.point=Ph,Ch.lineStart=zh,Ch.lineEnd=Rh},result:function(){var t=kh?[Eh/kh,Nh/kh]:Sh?[Th/Sh,Ah/Sh]:Mh?[xh/Mh,wh/Mh]:[NaN,NaN];return xh=wh=Mh=Th=Ah=Sh=Eh=Nh=kh=0,t}};function Ph(t,n){xh+=t,wh+=n,++Mh}function zh(){Ch.point=$h}function $h(t,n){Ch.point=Dh,Ph(_h=t,bh=n)}function Dh(t,n){var e=t-_h,r=n-bh,i=zf(e*e+r*r);Th+=i*(_h+t)/2,Ah+=i*(bh+n)/2,Sh+=i,Ph(_h=t,bh=n)}function Rh(){Ch.point=Ph}function Fh(){Ch.point=Uh}function qh(){Ih(yh,vh)}function Uh(t,n){Ch.point=Ih,Ph(yh=_h=t,vh=bh=n)}function Ih(t,n){var e=t-_h,r=n-bh,i=zf(e*e+r*r);Th+=i*(_h+t)/2,Ah+=i*(bh+n)/2,Sh+=i,Eh+=(i=bh*t-_h*n)*(_h+t),Nh+=i*(bh+n),kh+=3*i,Ph(_h=t,bh=n)}var Oh=Ch;function Bh(t){this._context=t}Bh.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,_f)}},result:qf};var Yh,Lh,jh,Hh,Xh,Gh=new T,Vh={point:qf,lineStart:function(){Vh.point=Wh},lineEnd:function(){Yh&&Zh(Lh,jh),Vh.point=qf},polygonStart:function(){Yh=!0},polygonEnd:function(){Yh=null},result:function(){var t=+Gh;return Gh=new T,t}};function Wh(t,n){Vh.point=Zh,Lh=Hh=t,jh=Xh=n}function Zh(t,n){Hh-=t,Xh-=n,Gh.add(zf(Hh*Hh+Xh*Xh)),Hh=t,Xh=n}var Kh=Vh;let Qh,Jh,td,nd;class ed{constructor(t){this._append=null==t?rd:function(t){const n=Math.floor(t);if(!(n>=0))throw new RangeError(`invalid digits: ${t}`);if(n>15)return rd;if(n!==Qh){const t=10**n;Qh=n,Jh=function(n){let e=1;this._+=n[0];for(const r=n.length;e4*n&&g--){var m=a+h,x=u+d,w=c+p,M=zf(m*m+x*x+w*w),T=Rf(w/=M),A=xf(xf(w)-1)n||xf((v*k+_*C)/b-.5)>.3||a*h+u*d+c*p2?t[2]%360*mf:0,k()):[y*bf,v*bf,_*bf]},E.angle=function(t){return arguments.length?(b=t%360*mf,k()):b*bf},E.reflectX=function(t){return arguments.length?(m=t?-1:1,k()):m<0},E.reflectY=function(t){return arguments.length?(x=t?-1:1,k()):x<0},E.precision=function(t){return arguments.length?(a=dd(u,S=t*t),C()):zf(S)},E.fitExtent=function(t,n){return ud(E,t,n)},E.fitSize=function(t,n){return cd(E,t,n)},E.fitWidth=function(t,n){return fd(E,t,n)},E.fitHeight=function(t,n){return sd(E,t,n)},function(){return n=t.apply(this,arguments),E.invert=n.invert&&N,k()}}function _d(t){var n=0,e=gf/3,r=vd(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*mf,e=t[1]*mf):[n*bf,e*bf]},i}function bd(t,n){var e=Cf(t),r=(e+Cf(n))/2;if(xf(r)0?n<-yf+df&&(n=-yf+df):n>yf-df&&(n=yf-df);var e=i/kf(Nd(n),r);return[e*Cf(r*t),i-e*Tf(r*t)]}return o.invert=function(t,n){var e=i-n,o=Pf(r)*zf(t*t+e*e),a=Mf(t,xf(e))*Pf(e);return e*r<0&&(a-=gf*Pf(t)*Pf(e)),[a/r,2*wf(kf(i/o,1/r))-yf]},o}function Cd(t,n){return[t,n]}function Pd(t,n){var e=Tf(t),r=t===n?Cf(t):(e-Tf(n))/(n-t),i=e/r+t;if(xf(r)=0;)n+=e[r].value;else n=1;t.value=n}function Gd(t,n){t instanceof Map?(t=[void 0,t],void 0===n&&(n=Wd)):void 0===n&&(n=Vd);for(var e,r,i,o,a,u=new Qd(t),c=[u];e=c.pop();)if((i=n(e.data))&&(a=(i=Array.from(i)).length))for(e.children=i,o=a-1;o>=0;--o)c.push(r=i[o]=new Qd(i[o])),r.parent=e,r.depth=e.depth+1;return u.eachBefore(Kd)}function Vd(t){return t.children}function Wd(t){return Array.isArray(t)?t[1]:null}function Zd(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function Kd(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function Qd(t){this.data=t,this.depth=this.height=0,this.parent=null}function Jd(t){return null==t?null:tp(t)}function tp(t){if("function"!=typeof t)throw new Error;return t}function np(){return 0}function ep(t){return function(){return t}}qd.invert=function(t,n){for(var e,r=n,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=e=(r*(zd+$d*i+o*(Dd+Rd*i))-n)/(zd+3*$d*i+o*(7*Dd+9*Rd*i)))*r)*i*i,!(xf(e)df&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},Od.invert=Md(Rf),Bd.invert=Md((function(t){return 2*wf(t)})),Yd.invert=function(t,n){return[-n,2*wf(Sf(t))-yf]},Qd.prototype=Gd.prototype={constructor:Qd,count:function(){return this.eachAfter(Xd)},each:function(t,n){let e=-1;for(const r of this)t.call(n,r,++e,this);return this},eachAfter:function(t,n){for(var e,r,i,o=this,a=[o],u=[],c=-1;o=a.pop();)if(u.push(o),e=o.children)for(r=0,i=e.length;r=0;--r)o.push(e[r]);return this},find:function(t,n){let e=-1;for(const r of this)if(t.call(n,r,++e,this))return r},sum:function(t){return this.eachAfter((function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e}))},sort:function(t){return this.eachBefore((function(n){n.children&&n.children.sort(t)}))},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;t=e.pop(),n=r.pop();for(;t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(n){n.children||t.push(n)})),t},links:function(){var t=this,n=[];return t.each((function(e){e!==t&&n.push({source:e.parent,target:e})})),n},copy:function(){return Gd(this).eachBefore(Zd)},[Symbol.iterator]:function*(){var t,n,e,r,i=this,o=[i];do{for(t=o.reverse(),o=[];i=t.pop();)if(yield i,n=i.children)for(e=0,r=n.length;e(t=(rp*t+ip)%op)/op}function up(t,n){for(var e,r,i=0,o=(t=function(t,n){let e,r,i=t.length;for(;i;)r=n()*i--|0,e=t[i],t[i]=t[r],t[r]=e;return t}(Array.from(t),n)).length,a=[];i0&&e*e>r*r+i*i}function lp(t,n){for(var e=0;e1e-6?(E+Math.sqrt(E*E-4*S*N))/(2*S):N/E);return{x:r+w+M*k,y:i+T+A*k,r:k}}function gp(t,n,e){var r,i,o,a,u=t.x-n.x,c=t.y-n.y,f=u*u+c*c;f?(i=n.r+e.r,i*=i,a=t.r+e.r,i>(a*=a)?(r=(f+a-i)/(2*f),o=Math.sqrt(Math.max(0,a/f-r*r)),e.x=t.x-r*u-o*c,e.y=t.y-r*c+o*u):(r=(f+i-a)/(2*f),o=Math.sqrt(Math.max(0,i/f-r*r)),e.x=n.x+r*u-o*c,e.y=n.y+r*c+o*u)):(e.x=n.x+e.r,e.y=n.y)}function yp(t,n){var e=t.r+n.r-1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function vp(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function _p(t){this._=t,this.next=null,this.previous=null}function bp(t,n){if(!(o=(t=function(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}(t)).length))return 0;var e,r,i,o,a,u,c,f,s,l,h;if((e=t[0]).x=0,e.y=0,!(o>1))return e.r;if(r=t[1],e.x=-r.r,r.x=e.r,r.y=0,!(o>2))return e.r+r.r;gp(r,e,i=t[2]),e=new _p(e),r=new _p(r),i=new _p(i),e.next=i.previous=r,r.next=e.previous=i,i.next=r.previous=e;t:for(c=3;c1&&!zp(t,n););return t.slice(0,n)}function zp(t,n){if("/"===t[n]){let e=0;for(;n>0&&"\\"===t[--n];)++e;if(!(1&e))return!0}return!1}function $p(t,n){return t.parent===n.parent?1:2}function Dp(t){var n=t.children;return n?n[0]:t.t}function Rp(t){var n=t.children;return n?n[n.length-1]:t.t}function Fp(t,n,e){var r=e/(n.i-t.i);n.c-=r,n.s+=e,t.c+=r,n.z+=e,n.m+=e}function qp(t,n,e){return t.a.parent===n.parent?t.a:e}function Up(t,n){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=n}function Ip(t,n,e,r,i){for(var o,a=t.children,u=-1,c=a.length,f=t.value&&(i-e)/t.value;++uh&&(h=u),y=s*s*g,(d=Math.max(h/y,y/l))>p){s-=u;break}p=d}v.push(a={value:s,dice:c1?n:1)},e}(Op);var Lp=function t(n){function e(t,e,r,i,o){if((a=t._squarify)&&a.ratio===n)for(var a,u,c,f,s,l=-1,h=a.length,d=t.value;++l1?n:1)},e}(Op);function jp(t,n,e){return(n[0]-t[0])*(e[1]-t[1])-(n[1]-t[1])*(e[0]-t[0])}function Hp(t,n){return t[0]-n[0]||t[1]-n[1]}function Xp(t){const n=t.length,e=[0,1];let r,i=2;for(r=2;r1&&jp(t[e[i-2]],t[e[i-1]],t[r])<=0;)--i;e[i++]=r}return e.slice(0,i)}var Gp=Math.random,Vp=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(Gp),Wp=function t(n){function e(t,e){return arguments.length<2&&(e=t,t=0),t=Math.floor(t),e=Math.floor(e)-t,function(){return Math.floor(n()*e+t)}}return e.source=t,e}(Gp),Zp=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(Gp),Kp=function t(n){var e=Zp.source(n);function r(){var t=e.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(Gp),Qp=function t(n){function e(t){return(t=+t)<=0?()=>0:function(){for(var e=0,r=t;r>1;--r)e+=n();return e+r*n()}}return e.source=t,e}(Gp),Jp=function t(n){var e=Qp.source(n);function r(t){if(0==(t=+t))return n;var r=e(t);return function(){return r()/t}}return r.source=t,r}(Gp),tg=function t(n){function e(t){return function(){return-Math.log1p(-n())/t}}return e.source=t,e}(Gp),ng=function t(n){function e(t){if((t=+t)<0)throw new RangeError("invalid alpha");return t=1/-t,function(){return Math.pow(1-n(),t)}}return e.source=t,e}(Gp),eg=function t(n){function e(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return function(){return Math.floor(n()+t)}}return e.source=t,e}(Gp),rg=function t(n){function e(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return 0===t?()=>1/0:1===t?()=>1:(t=Math.log1p(-t),function(){return 1+Math.floor(Math.log1p(-n())/t)})}return e.source=t,e}(Gp),ig=function t(n){var e=Zp.source(n)();function r(t,r){if((t=+t)<0)throw new RangeError("invalid k");if(0===t)return()=>0;if(r=null==r?1:+r,1===t)return()=>-Math.log1p(-n())*r;var i=(t<1?t+1:t)-1/3,o=1/(3*Math.sqrt(i)),a=t<1?()=>Math.pow(n(),1/t):()=>1;return function(){do{do{var t=e(),u=1+o*t}while(u<=0);u*=u*u;var c=1-n()}while(c>=1-.0331*t*t*t*t&&Math.log(c)>=.5*t*t+i*(1-u+Math.log(u)));return i*u*a()*r}}return r.source=t,r}(Gp),og=function t(n){var e=ig.source(n);function r(t,n){var r=e(t),i=e(n);return function(){var t=r();return 0===t?0:t/(t+i())}}return r.source=t,r}(Gp),ag=function t(n){var e=rg.source(n),r=og.source(n);function i(t,n){return t=+t,(n=+n)>=1?()=>t:n<=0?()=>0:function(){for(var i=0,o=t,a=n;o*a>16&&o*(1-a)>16;){var u=Math.floor((o+1)*a),c=r(u,o-u+1)();c<=a?(i+=u,o-=u,a=(a-c)/(1-c)):(o=u-1,a/=c)}for(var f=a<.5,s=e(f?a:1-a),l=s(),h=0;l<=o;++h)l+=s();return i+(f?h:o-h)}}return i.source=t,i}(Gp),ug=function t(n){function e(t,e,r){var i;return 0==(t=+t)?i=t=>-Math.log(t):(t=1/t,i=n=>Math.pow(n,t)),e=null==e?0:+e,r=null==r?1:+r,function(){return e+r*i(-Math.log1p(-n()))}}return e.source=t,e}(Gp),cg=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,function(){return t+e*Math.tan(Math.PI*n())}}return e.source=t,e}(Gp),fg=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,function(){var r=n();return t+e*Math.log(r/(1-r))}}return e.source=t,e}(Gp),sg=function t(n){var e=ig.source(n),r=ag.source(n);function i(t){return function(){for(var i=0,o=t;o>16;){var a=Math.floor(.875*o),u=e(a)();if(u>o)return i+r(a-1,o/u)();i+=a,o-=u}for(var c=-Math.log1p(-n()),f=0;c<=o;++f)c-=Math.log1p(-n());return i+f}}return i.source=t,i}(Gp);const lg=1/4294967296;function hg(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}function dg(t,n){switch(arguments.length){case 0:break;case 1:"function"==typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"==typeof n?this.interpolator(n):this.range(n)}return this}const pg=Symbol("implicit");function gg(){var t=new InternMap,n=[],e=[],r=pg;function i(i){let o=t.get(i);if(void 0===o){if(r!==pg)return r;t.set(i,o=n.push(i)-1)}return e[o%e.length]}return i.domain=function(e){if(!arguments.length)return n.slice();n=[],t=new InternMap;for(const r of e)t.has(r)||t.set(r,n.push(r)-1);return i},i.range=function(t){return arguments.length?(e=Array.from(t),i):e.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return gg(n,e).unknown(r)},hg.apply(i,arguments),i}function yg(){var t,n,e=gg().unknown(void 0),r=e.domain,i=e.range,o=0,a=1,u=!1,c=0,f=0,s=.5;function l(){var e=r().length,l=an&&(e=t,t=n,n=e),function(e){return Math.max(t,Math.min(n,e))}}(a[0],a[t-1])),r=t>2?Mg:wg,i=o=null,l}function l(n){return null==n||isNaN(n=+n)?e:(i||(i=r(a.map(t),u,c)))(t(f(n)))}return l.invert=function(e){return f(n((o||(o=r(u,a.map(t),Yr)))(e)))},l.domain=function(t){return arguments.length?(a=Array.from(t,_g),s()):a.slice()},l.range=function(t){return arguments.length?(u=Array.from(t),s()):u.slice()},l.rangeRound=function(t){return u=Array.from(t),c=Vr,s()},l.clamp=function(t){return arguments.length?(f=!!t||mg,s()):f!==mg},l.interpolate=function(t){return arguments.length?(c=t,s()):c},l.unknown=function(t){return arguments.length?(e=t,l):e},function(e,r){return t=e,n=r,s()}}function Sg(){return Ag()(mg,mg)}function Eg(n,e,r,i){var o,a=W(n,e,r);switch((i=Jc(null==i?",f":i)).type){case"s":var u=Math.max(Math.abs(n),Math.abs(e));return null!=i.precision||isNaN(o=lf(a,u))||(i.precision=o),t.formatPrefix(i,u);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=hf(a,Math.max(Math.abs(n),Math.abs(e))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=sf(a))||(i.precision=o-2*("%"===i.type))}return t.format(i)}function Ng(t){var n=t.domain;return t.ticks=function(t){var e=n();return G(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return Eg(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,i,o=n(),a=0,u=o.length-1,c=o[a],f=o[u],s=10;for(f0;){if((i=V(c,f,e))===r)return o[a]=c,o[u]=f,n(o);if(i>0)c=Math.floor(c/i)*i,f=Math.ceil(f/i)*i;else{if(!(i<0))break;c=Math.ceil(c*i)/i,f=Math.floor(f*i)/i}r=i}return t},t}function kg(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a-t(-n,e)}function Fg(n){const e=n(Cg,Pg),r=e.domain;let i,o,a=10;function u(){return i=function(t){return t===Math.E?Math.log:10===t&&Math.log10||2===t&&Math.log2||(t=Math.log(t),n=>Math.log(n)/t)}(a),o=function(t){return 10===t?Dg:t===Math.E?Math.exp:n=>Math.pow(t,n)}(a),r()[0]<0?(i=Rg(i),o=Rg(o),n(zg,$g)):n(Cg,Pg),e}return e.base=function(t){return arguments.length?(a=+t,u()):a},e.domain=function(t){return arguments.length?(r(t),u()):r()},e.ticks=t=>{const n=r();let e=n[0],u=n[n.length-1];const c=u0){for(;l<=h;++l)for(f=1;fu)break;p.push(s)}}else for(;l<=h;++l)for(f=a-1;f>=1;--f)if(s=l>0?f/o(-l):f*o(l),!(su)break;p.push(s)}2*p.length{if(null==n&&(n=10),null==r&&(r=10===a?"s":","),"function"!=typeof r&&(a%1||null!=(r=Jc(r)).precision||(r.trim=!0),r=t.format(r)),n===1/0)return r;const u=Math.max(1,a*n/e.ticks().length);return t=>{let n=t/o(Math.round(i(t)));return n*ar(kg(r(),{floor:t=>o(Math.floor(i(t))),ceil:t=>o(Math.ceil(i(t)))})),e}function qg(t){return function(n){return Math.sign(n)*Math.log1p(Math.abs(n/t))}}function Ug(t){return function(n){return Math.sign(n)*Math.expm1(Math.abs(n))*t}}function Ig(t){var n=1,e=t(qg(n),Ug(n));return e.constant=function(e){return arguments.length?t(qg(n=+e),Ug(n)):n},Ng(e)}function Og(t){return function(n){return n<0?-Math.pow(-n,t):Math.pow(n,t)}}function Bg(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function Yg(t){return t<0?-t*t:t*t}function Lg(t){var n=t(mg,mg),e=1;return n.exponent=function(n){return arguments.length?1===(e=+n)?t(mg,mg):.5===e?t(Bg,Yg):t(Og(e),Og(1/e)):e},Ng(n)}function jg(){var t=Lg(Ag());return t.copy=function(){return Tg(t,jg()).exponent(t.exponent())},hg.apply(t,arguments),t}function Hg(t){return Math.sign(t)*t*t}const Xg=new Date,Gg=new Date;function Vg(t,n,e,r){function i(n){return t(n=0===arguments.length?new Date:new Date(+n)),n}return i.floor=n=>(t(n=new Date(+n)),n),i.ceil=e=>(t(e=new Date(e-1)),n(e,1),t(e),e),i.round=t=>{const n=i(t),e=i.ceil(t);return t-n(n(t=new Date(+t),null==e?1:Math.floor(e)),t),i.range=(e,r,o)=>{const a=[];if(e=i.ceil(e),o=null==o?1:Math.floor(o),!(e0))return a;let u;do{a.push(u=new Date(+e)),n(e,o),t(e)}while(uVg((n=>{if(n>=n)for(;t(n),!e(n);)n.setTime(n-1)}),((t,r)=>{if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););})),e&&(i.count=(n,r)=>(Xg.setTime(+n),Gg.setTime(+r),t(Xg),t(Gg),Math.floor(e(Xg,Gg))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?n=>r(n)%t==0:n=>i.count(0,n)%t==0):i:null)),i}const Wg=Vg((()=>{}),((t,n)=>{t.setTime(+t+n)}),((t,n)=>n-t));Wg.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?Vg((n=>{n.setTime(Math.floor(n/t)*t)}),((n,e)=>{n.setTime(+n+e*t)}),((n,e)=>(e-n)/t)):Wg:null);const Zg=Wg.range,Kg=1e3,Qg=6e4,Jg=36e5,ty=864e5,ny=6048e5,ey=2592e6,ry=31536e6,iy=Vg((t=>{t.setTime(t-t.getMilliseconds())}),((t,n)=>{t.setTime(+t+n*Kg)}),((t,n)=>(n-t)/Kg),(t=>t.getUTCSeconds())),oy=iy.range,ay=Vg((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Kg)}),((t,n)=>{t.setTime(+t+n*Qg)}),((t,n)=>(n-t)/Qg),(t=>t.getMinutes())),uy=ay.range,cy=Vg((t=>{t.setUTCSeconds(0,0)}),((t,n)=>{t.setTime(+t+n*Qg)}),((t,n)=>(n-t)/Qg),(t=>t.getUTCMinutes())),fy=cy.range,sy=Vg((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Kg-t.getMinutes()*Qg)}),((t,n)=>{t.setTime(+t+n*Jg)}),((t,n)=>(n-t)/Jg),(t=>t.getHours())),ly=sy.range,hy=Vg((t=>{t.setUTCMinutes(0,0,0)}),((t,n)=>{t.setTime(+t+n*Jg)}),((t,n)=>(n-t)/Jg),(t=>t.getUTCHours())),dy=hy.range,py=Vg((t=>t.setHours(0,0,0,0)),((t,n)=>t.setDate(t.getDate()+n)),((t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Qg)/ty),(t=>t.getDate()-1)),gy=py.range,yy=Vg((t=>{t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCDate(t.getUTCDate()+n)}),((t,n)=>(n-t)/ty),(t=>t.getUTCDate()-1)),vy=yy.range,_y=Vg((t=>{t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCDate(t.getUTCDate()+n)}),((t,n)=>(n-t)/ty),(t=>Math.floor(t/ty))),by=_y.range;function my(t){return Vg((n=>{n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)}),((t,n)=>{t.setDate(t.getDate()+7*n)}),((t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Qg)/ny))}const xy=my(0),wy=my(1),My=my(2),Ty=my(3),Ay=my(4),Sy=my(5),Ey=my(6),Ny=xy.range,ky=wy.range,Cy=My.range,Py=Ty.range,zy=Ay.range,$y=Sy.range,Dy=Ey.range;function Ry(t){return Vg((n=>{n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCDate(t.getUTCDate()+7*n)}),((t,n)=>(n-t)/ny))}const Fy=Ry(0),qy=Ry(1),Uy=Ry(2),Iy=Ry(3),Oy=Ry(4),By=Ry(5),Yy=Ry(6),Ly=Fy.range,jy=qy.range,Hy=Uy.range,Xy=Iy.range,Gy=Oy.range,Vy=By.range,Wy=Yy.range,Zy=Vg((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,n)=>{t.setMonth(t.getMonth()+n)}),((t,n)=>n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())),(t=>t.getMonth())),Ky=Zy.range,Qy=Vg((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCMonth(t.getUTCMonth()+n)}),((t,n)=>n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth())),Jy=Qy.range,tv=Vg((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n)}),((t,n)=>n.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));tv.every=t=>isFinite(t=Math.floor(t))&&t>0?Vg((n=>{n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)}),((n,e)=>{n.setFullYear(n.getFullYear()+e*t)})):null;const nv=tv.range,ev=Vg((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n)}),((t,n)=>n.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));ev.every=t=>isFinite(t=Math.floor(t))&&t>0?Vg((n=>{n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)}),((n,e)=>{n.setUTCFullYear(n.getUTCFullYear()+e*t)})):null;const rv=ev.range;function iv(t,n,e,i,o,a){const u=[[iy,1,Kg],[iy,5,5e3],[iy,15,15e3],[iy,30,3e4],[a,1,Qg],[a,5,3e5],[a,15,9e5],[a,30,18e5],[o,1,Jg],[o,3,108e5],[o,6,216e5],[o,12,432e5],[i,1,ty],[i,2,1728e5],[e,1,ny],[n,1,ey],[n,3,7776e6],[t,1,ry]];function c(n,e,i){const o=Math.abs(e-n)/i,a=r((([,,t])=>t)).right(u,o);if(a===u.length)return t.every(W(n/ry,e/ry,i));if(0===a)return Wg.every(Math.max(W(n,e,i),1));const[c,f]=u[o/u[a-1][2]=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:k_,s:C_,S:Zv,u:Kv,U:Qv,V:t_,w:n_,W:e_,x:null,X:null,y:r_,Y:o_,Z:u_,"%":N_},m={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:c_,e:c_,f:d_,g:T_,G:S_,H:f_,I:s_,j:l_,L:h_,m:p_,M:g_,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:k_,s:C_,S:y_,u:v_,U:__,V:m_,w:x_,W:w_,x:null,X:null,y:M_,Y:A_,Z:E_,"%":N_},x={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p.get(r[0].toLowerCase()),e+r[0].length):-1},A:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.w=h.get(r[0].toLowerCase()),e+r[0].length):-1},b:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=_.get(r[0].toLowerCase()),e+r[0].length):-1},B:function(t,n,e){var r=g.exec(n.slice(e));return r?(t.m=y.get(r[0].toLowerCase()),e+r[0].length):-1},c:function(t,e,r){return T(t,n,e,r)},d:zv,e:zv,f:Uv,g:Nv,G:Ev,H:Dv,I:Dv,j:$v,L:qv,m:Pv,M:Rv,p:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.p=s.get(r[0].toLowerCase()),e+r[0].length):-1},q:Cv,Q:Ov,s:Bv,S:Fv,u:Mv,U:Tv,V:Av,w:wv,W:Sv,x:function(t,n,r){return T(t,e,n,r)},X:function(t,n,e){return T(t,r,n,e)},y:Nv,Y:Ev,Z:kv,"%":Iv};function w(t,n){return function(e){var r,i,o,a=[],u=-1,c=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=sv(lv(o.y,0,1))).getUTCDay(),r=i>4||0===i?qy.ceil(r):qy(r),r=yy.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=fv(lv(o.y,0,1))).getDay(),r=i>4||0===i?wy.ceil(r):wy(r),r=py.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?sv(lv(o.y,0,1)).getUTCDay():fv(lv(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,sv(o)):fv(o)}}function T(t,n,e,r){for(var i,o,a=0,u=n.length,c=e.length;a=c)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=x[i in pv?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return b.x=w(e,b),b.X=w(r,b),b.c=w(n,b),m.x=w(e,m),m.X=w(r,m),m.c=w(n,m),{format:function(t){var n=w(t+="",b);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",!1);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",m);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t+="",!0);return n.toString=function(){return t},n}}}var dv,pv={"-":"",_:" ",0:"0"},gv=/^\s*\d+/,yv=/^%/,vv=/[\\^$*+?|[\]().{}]/g;function _v(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o[t.toLowerCase(),n])))}function wv(t,n,e){var r=gv.exec(n.slice(e,e+1));return r?(t.w=+r[0],e+r[0].length):-1}function Mv(t,n,e){var r=gv.exec(n.slice(e,e+1));return r?(t.u=+r[0],e+r[0].length):-1}function Tv(t,n,e){var r=gv.exec(n.slice(e,e+2));return r?(t.U=+r[0],e+r[0].length):-1}function Av(t,n,e){var r=gv.exec(n.slice(e,e+2));return r?(t.V=+r[0],e+r[0].length):-1}function Sv(t,n,e){var r=gv.exec(n.slice(e,e+2));return r?(t.W=+r[0],e+r[0].length):-1}function Ev(t,n,e){var r=gv.exec(n.slice(e,e+4));return r?(t.y=+r[0],e+r[0].length):-1}function Nv(t,n,e){var r=gv.exec(n.slice(e,e+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),e+r[0].length):-1}function kv(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function Cv(t,n,e){var r=gv.exec(n.slice(e,e+1));return r?(t.q=3*r[0]-3,e+r[0].length):-1}function Pv(t,n,e){var r=gv.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function zv(t,n,e){var r=gv.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function $v(t,n,e){var r=gv.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function Dv(t,n,e){var r=gv.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function Rv(t,n,e){var r=gv.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function Fv(t,n,e){var r=gv.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function qv(t,n,e){var r=gv.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Uv(t,n,e){var r=gv.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function Iv(t,n,e){var r=yv.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Ov(t,n,e){var r=gv.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function Bv(t,n,e){var r=gv.exec(n.slice(e));return r?(t.s=+r[0],e+r[0].length):-1}function Yv(t,n){return _v(t.getDate(),n,2)}function Lv(t,n){return _v(t.getHours(),n,2)}function jv(t,n){return _v(t.getHours()%12||12,n,2)}function Hv(t,n){return _v(1+py.count(tv(t),t),n,3)}function Xv(t,n){return _v(t.getMilliseconds(),n,3)}function Gv(t,n){return Xv(t,n)+"000"}function Vv(t,n){return _v(t.getMonth()+1,n,2)}function Wv(t,n){return _v(t.getMinutes(),n,2)}function Zv(t,n){return _v(t.getSeconds(),n,2)}function Kv(t){var n=t.getDay();return 0===n?7:n}function Qv(t,n){return _v(xy.count(tv(t)-1,t),n,2)}function Jv(t){var n=t.getDay();return n>=4||0===n?Ay(t):Ay.ceil(t)}function t_(t,n){return t=Jv(t),_v(Ay.count(tv(t),t)+(4===tv(t).getDay()),n,2)}function n_(t){return t.getDay()}function e_(t,n){return _v(wy.count(tv(t)-1,t),n,2)}function r_(t,n){return _v(t.getFullYear()%100,n,2)}function i_(t,n){return _v((t=Jv(t)).getFullYear()%100,n,2)}function o_(t,n){return _v(t.getFullYear()%1e4,n,4)}function a_(t,n){var e=t.getDay();return _v((t=e>=4||0===e?Ay(t):Ay.ceil(t)).getFullYear()%1e4,n,4)}function u_(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+_v(n/60|0,"0",2)+_v(n%60,"0",2)}function c_(t,n){return _v(t.getUTCDate(),n,2)}function f_(t,n){return _v(t.getUTCHours(),n,2)}function s_(t,n){return _v(t.getUTCHours()%12||12,n,2)}function l_(t,n){return _v(1+yy.count(ev(t),t),n,3)}function h_(t,n){return _v(t.getUTCMilliseconds(),n,3)}function d_(t,n){return h_(t,n)+"000"}function p_(t,n){return _v(t.getUTCMonth()+1,n,2)}function g_(t,n){return _v(t.getUTCMinutes(),n,2)}function y_(t,n){return _v(t.getUTCSeconds(),n,2)}function v_(t){var n=t.getUTCDay();return 0===n?7:n}function __(t,n){return _v(Fy.count(ev(t)-1,t),n,2)}function b_(t){var n=t.getUTCDay();return n>=4||0===n?Oy(t):Oy.ceil(t)}function m_(t,n){return t=b_(t),_v(Oy.count(ev(t),t)+(4===ev(t).getUTCDay()),n,2)}function x_(t){return t.getUTCDay()}function w_(t,n){return _v(qy.count(ev(t)-1,t),n,2)}function M_(t,n){return _v(t.getUTCFullYear()%100,n,2)}function T_(t,n){return _v((t=b_(t)).getUTCFullYear()%100,n,2)}function A_(t,n){return _v(t.getUTCFullYear()%1e4,n,4)}function S_(t,n){var e=t.getUTCDay();return _v((t=e>=4||0===e?Oy(t):Oy.ceil(t)).getUTCFullYear()%1e4,n,4)}function E_(){return"+0000"}function N_(){return"%"}function k_(t){return+t}function C_(t){return Math.floor(+t/1e3)}function P_(n){return dv=hv(n),t.timeFormat=dv.format,t.timeParse=dv.parse,t.utcFormat=dv.utcFormat,t.utcParse=dv.utcParse,dv}t.timeFormat=void 0,t.timeParse=void 0,t.utcFormat=void 0,t.utcParse=void 0,P_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var z_="%Y-%m-%dT%H:%M:%S.%LZ";var $_=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat(z_),D_=$_;var R_=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:t.utcParse(z_),F_=R_;function q_(t){return new Date(t)}function U_(t){return t instanceof Date?+t:+new Date(+t)}function I_(t,n,e,r,i,o,a,u,c,f){var s=Sg(),l=s.invert,h=s.domain,d=f(".%L"),p=f(":%S"),g=f("%I:%M"),y=f("%I %p"),v=f("%a %d"),_=f("%b %d"),b=f("%B"),m=f("%Y");function x(t){return(c(t)Fr(t[t.length-1]),ib=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(H_),ob=rb(ib),ab=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(H_),ub=rb(ab),cb=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(H_),fb=rb(cb),sb=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(H_),lb=rb(sb),hb=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(H_),db=rb(hb),pb=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(H_),gb=rb(pb),yb=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(H_),vb=rb(yb),_b=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(H_),bb=rb(_b),mb=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(H_),xb=rb(mb),wb=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(H_),Mb=rb(wb),Tb=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(H_),Ab=rb(Tb),Sb=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(H_),Eb=rb(Sb),Nb=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(H_),kb=rb(Nb),Cb=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(H_),Pb=rb(Cb),zb=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(H_),$b=rb(zb),Db=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(H_),Rb=rb(Db),Fb=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(H_),qb=rb(Fb),Ub=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(H_),Ib=rb(Ub),Ob=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(H_),Bb=rb(Ob),Yb=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(H_),Lb=rb(Yb),jb=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(H_),Hb=rb(jb),Xb=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(H_),Gb=rb(Xb),Vb=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(H_),Wb=rb(Vb),Zb=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(H_),Kb=rb(Zb),Qb=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(H_),Jb=rb(Qb),tm=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(H_),nm=rb(tm),em=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(H_),rm=rb(em);var im=hi(Tr(300,.5,0),Tr(-240,.5,1)),om=hi(Tr(-100,.75,.35),Tr(80,1.5,.8)),am=hi(Tr(260,.75,.35),Tr(80,1.5,.8)),um=Tr();var cm=Fe(),fm=Math.PI/3,sm=2*Math.PI/3;function lm(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var hm=lm(H_("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),dm=lm(H_("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),pm=lm(H_("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),gm=lm(H_("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function ym(t){return function(){return t}}const vm=Math.abs,_m=Math.atan2,bm=Math.cos,mm=Math.max,xm=Math.min,wm=Math.sin,Mm=Math.sqrt,Tm=1e-12,Am=Math.PI,Sm=Am/2,Em=2*Am;function Nm(t){return t>=1?Sm:t<=-1?-Sm:Math.asin(t)}function km(t){let n=3;return t.digits=function(e){if(!arguments.length)return n;if(null==e)n=null;else{const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);n=t}return t},()=>new Ua(n)}function Cm(t){return t.innerRadius}function Pm(t){return t.outerRadius}function zm(t){return t.startAngle}function $m(t){return t.endAngle}function Dm(t){return t&&t.padAngle}function Rm(t,n,e,r,i,o,a){var u=t-e,c=n-r,f=(a?o:-o)/Mm(u*u+c*c),s=f*c,l=-f*u,h=t+s,d=n+l,p=e+s,g=r+l,y=(h+p)/2,v=(d+g)/2,_=p-h,b=g-d,m=_*_+b*b,x=i-o,w=h*g-p*d,M=(b<0?-1:1)*Mm(mm(0,x*x*m-w*w)),T=(w*b-_*M)/m,A=(-w*_-b*M)/m,S=(w*b+_*M)/m,E=(-w*_+b*M)/m,N=T-y,k=A-v,C=S-y,P=E-v;return N*N+k*k>C*C+P*P&&(T=S,A=E),{cx:T,cy:A,x01:-s,y01:-l,x11:T*(i/x-1),y11:A*(i/x-1)}}var Fm=Array.prototype.slice;function qm(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function Um(t){this._context=t}function Im(t){return new Um(t)}function Om(t){return t[0]}function Bm(t){return t[1]}function Ym(t,n){var e=ym(!0),r=null,i=Im,o=null,a=km(u);function u(u){var c,f,s,l=(u=qm(u)).length,h=!1;for(null==r&&(o=i(s=a())),c=0;c<=l;++c)!(c=l;--h)u.point(v[h],_[h]);u.lineEnd(),u.areaEnd()}y&&(v[s]=+t(d,s,f),_[s]=+n(d,s,f),u.point(r?+r(d,s,f):v[s],e?+e(d,s,f):_[s]))}if(p)return u=null,p+""||null}function s(){return Ym().defined(i).curve(a).context(o)}return t="function"==typeof t?t:void 0===t?Om:ym(+t),n="function"==typeof n?n:ym(void 0===n?0:+n),e="function"==typeof e?e:void 0===e?Bm:ym(+e),f.x=function(n){return arguments.length?(t="function"==typeof n?n:ym(+n),r=null,f):t},f.x0=function(n){return arguments.length?(t="function"==typeof n?n:ym(+n),f):t},f.x1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:ym(+t),f):r},f.y=function(t){return arguments.length?(n="function"==typeof t?t:ym(+t),e=null,f):n},f.y0=function(t){return arguments.length?(n="function"==typeof t?t:ym(+t),f):n},f.y1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:ym(+t),f):e},f.lineX0=f.lineY0=function(){return s().x(t).y(n)},f.lineY1=function(){return s().x(t).y(e)},f.lineX1=function(){return s().x(r).y(n)},f.defined=function(t){return arguments.length?(i="function"==typeof t?t:ym(!!t),f):i},f.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),f):a},f.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),f):o},f}function jm(t,n){return nt?1:n>=t?0:NaN}function Hm(t){return t}Um.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var Xm=Vm(Im);function Gm(t){this._curve=t}function Vm(t){function n(n){return new Gm(t(n))}return n._curve=t,n}function Wm(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(Vm(t)):n()._curve},t}function Zm(){return Wm(Ym().curve(Xm))}function Km(){var t=Lm().curve(Xm),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Wm(e())},delete t.lineX0,t.lineEndAngle=function(){return Wm(r())},delete t.lineX1,t.lineInnerRadius=function(){return Wm(i())},delete t.lineY0,t.lineOuterRadius=function(){return Wm(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(Vm(t)):n()._curve},t}function Qm(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}Gm.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};class Jm{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n)}this._x0=t,this._y0=n}}class tx{constructor(t){this._context=t}lineStart(){this._point=0}lineEnd(){}point(t,n){if(t=+t,n=+n,0===this._point)this._point=1;else{const e=Qm(this._x0,this._y0),r=Qm(this._x0,this._y0=(this._y0+n)/2),i=Qm(t,this._y0),o=Qm(t,n);this._context.moveTo(...e),this._context.bezierCurveTo(...r,...i,...o)}this._x0=t,this._y0=n}}function nx(t){return new Jm(t,!0)}function ex(t){return new Jm(t,!1)}function rx(t){return new tx(t)}function ix(t){return t.source}function ox(t){return t.target}function ax(t){let n=ix,e=ox,r=Om,i=Bm,o=null,a=null,u=km(c);function c(){let c;const f=Fm.call(arguments),s=n.apply(this,f),l=e.apply(this,f);if(null==o&&(a=t(c=u())),a.lineStart(),f[0]=s,a.point(+r.apply(this,f),+i.apply(this,f)),f[0]=l,a.point(+r.apply(this,f),+i.apply(this,f)),a.lineEnd(),c)return a=null,c+""||null}return c.source=function(t){return arguments.length?(n=t,c):n},c.target=function(t){return arguments.length?(e=t,c):e},c.x=function(t){return arguments.length?(r="function"==typeof t?t:ym(+t),c):r},c.y=function(t){return arguments.length?(i="function"==typeof t?t:ym(+t),c):i},c.context=function(n){return arguments.length?(null==n?o=a=null:a=t(o=n),c):o},c}const ux=Mm(3);var cx={draw(t,n){const e=.59436*Mm(n+xm(n/28,.75)),r=e/2,i=r*ux;t.moveTo(0,e),t.lineTo(0,-e),t.moveTo(-i,-r),t.lineTo(i,r),t.moveTo(-i,r),t.lineTo(i,-r)}},fx={draw(t,n){const e=Mm(n/Am);t.moveTo(e,0),t.arc(0,0,e,0,Em)}},sx={draw(t,n){const e=Mm(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}};const lx=Mm(1/3),hx=2*lx;var dx={draw(t,n){const e=Mm(n/hx),r=e*lx;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},px={draw(t,n){const e=.62625*Mm(n);t.moveTo(0,-e),t.lineTo(e,0),t.lineTo(0,e),t.lineTo(-e,0),t.closePath()}},gx={draw(t,n){const e=.87559*Mm(n-xm(n/7,2));t.moveTo(-e,0),t.lineTo(e,0),t.moveTo(0,e),t.lineTo(0,-e)}},yx={draw(t,n){const e=Mm(n),r=-e/2;t.rect(r,r,e,e)}},vx={draw(t,n){const e=.4431*Mm(n);t.moveTo(e,e),t.lineTo(e,-e),t.lineTo(-e,-e),t.lineTo(-e,e),t.closePath()}};const _x=wm(Am/10)/wm(7*Am/10),bx=wm(Em/10)*_x,mx=-bm(Em/10)*_x;var xx={draw(t,n){const e=Mm(.8908130915292852*n),r=bx*e,i=mx*e;t.moveTo(0,-e),t.lineTo(r,i);for(let n=1;n<5;++n){const o=Em*n/5,a=bm(o),u=wm(o);t.lineTo(u*e,-a*e),t.lineTo(a*r-u*i,u*r+a*i)}t.closePath()}};const wx=Mm(3);var Mx={draw(t,n){const e=-Mm(n/(3*wx));t.moveTo(0,2*e),t.lineTo(-wx*e,-e),t.lineTo(wx*e,-e),t.closePath()}};const Tx=Mm(3);var Ax={draw(t,n){const e=.6824*Mm(n),r=e/2,i=e*Tx/2;t.moveTo(0,-e),t.lineTo(i,r),t.lineTo(-i,r),t.closePath()}};const Sx=-.5,Ex=Mm(3)/2,Nx=1/Mm(12),kx=3*(Nx/2+1);var Cx={draw(t,n){const e=Mm(n/kx),r=e/2,i=e*Nx,o=r,a=e*Nx+e,u=-o,c=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,c),t.lineTo(Sx*r-Ex*i,Ex*r+Sx*i),t.lineTo(Sx*o-Ex*a,Ex*o+Sx*a),t.lineTo(Sx*u-Ex*c,Ex*u+Sx*c),t.lineTo(Sx*r+Ex*i,Sx*i-Ex*r),t.lineTo(Sx*o+Ex*a,Sx*a-Ex*o),t.lineTo(Sx*u+Ex*c,Sx*c-Ex*u),t.closePath()}},Px={draw(t,n){const e=.6189*Mm(n-xm(n/6,1.7));t.moveTo(-e,-e),t.lineTo(e,e),t.moveTo(-e,e),t.lineTo(e,-e)}};const zx=[fx,sx,dx,yx,xx,Mx,Cx],$x=[fx,gx,Px,Ax,cx,vx,px];function Dx(){}function Rx(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function Fx(t){this._context=t}function qx(t){this._context=t}function Ux(t){this._context=t}function Ix(t,n){this._basis=new Fx(t),this._beta=n}Fx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Rx(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Rx(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},qx.prototype={areaStart:Dx,areaEnd:Dx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:Rx(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},Ux.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:Rx(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},Ix.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],a=t[e]-i,u=n[e]-o,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*a),this._beta*n[c]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var Ox=function t(n){function e(t){return 1===n?new Fx(t):new Ix(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function Bx(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function Yx(t,n){this._context=t,this._k=(1-n)/6}Yx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:Bx(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:Bx(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Lx=function t(n){function e(t){return new Yx(t,n)}return e.tension=function(n){return t(+n)},e}(0);function jx(t,n){this._context=t,this._k=(1-n)/6}jx.prototype={areaStart:Dx,areaEnd:Dx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Bx(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Hx=function t(n){function e(t){return new jx(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Xx(t,n){this._context=t,this._k=(1-n)/6}Xx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Bx(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Gx=function t(n){function e(t){return new Xx(t,n)}return e.tension=function(n){return t(+n)},e}(0);function Vx(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>Tm){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>Tm){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*f+t._x1*t._l23_2a-n*t._l12_2a)/s,a=(a*f+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function Wx(t,n){this._context=t,this._alpha=n}Wx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:Vx(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Zx=function t(n){function e(t){return n?new Wx(t,n):new Yx(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Kx(t,n){this._context=t,this._alpha=n}Kx.prototype={areaStart:Dx,areaEnd:Dx,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:Vx(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var Qx=function t(n){function e(t){return n?new Kx(t,n):new jx(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function Jx(t,n){this._context=t,this._alpha=n}Jx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:Vx(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var tw=function t(n){function e(t){return n?new Jx(t,n):new Xx(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function nw(t){this._context=t}function ew(t){return t<0?-1:1}function rw(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(ew(o)+ew(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function iw(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function ow(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*n,o-u,a-u*e,o,a)}function aw(t){this._context=t}function uw(t){this._context=new cw(t)}function cw(t){this._context=t}function fw(t){this._context=t}function sw(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(a[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n1)for(var e,r,i,o=1,a=t[n[0]],u=a.length;o=0;)e[n]=n;return e}function pw(t,n){return t[n]}function gw(t){const n=[];return n.key=t,n}function yw(t){var n=t.map(vw);return dw(t).sort((function(t,e){return n[t]-n[e]}))}function vw(t){for(var n,e=-1,r=0,i=t.length,o=-1/0;++eo&&(o=n,r=e);return r}function _w(t){var n=t.map(bw);return dw(t).sort((function(t,e){return n[t]-n[e]}))}function bw(t){for(var n,e=0,r=-1,i=t.length;++r=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,n),this._context.lineTo(t,n);else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y),this._context.lineTo(e,n)}}this._x=t,this._y=n}};var mw=t=>()=>t;function xw(t,{sourceEvent:n,target:e,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function ww(t,n,e){this.k=t,this.x=n,this.y=e}ww.prototype={constructor:ww,scale:function(t){return 1===t?this:new ww(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new ww(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Mw=new ww(1,0,0);function Tw(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Mw;return t.__zoom}function Aw(t){t.stopImmediatePropagation()}function Sw(t){t.preventDefault(),t.stopImmediatePropagation()}function Ew(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Nw(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function kw(){return this.__zoom||Mw}function Cw(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Pw(){return navigator.maxTouchPoints||"ontouchstart"in this}function zw(t,n,e){var r=t.invertX(n[0][0])-e[0][0],i=t.invertX(n[1][0])-e[1][0],o=t.invertY(n[0][1])-e[0][1],a=t.invertY(n[1][1])-e[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}Tw.prototype=ww.prototype,t.Adder=T,t.Delaunay=Lu,t.FormatSpecifier=tf,t.InternMap=InternMap,t.InternSet=InternSet,t.Node=Qd,t.Path=Ua,t.Voronoi=qu,t.ZoomTransform=ww,t.active=function(t,n){var e,r,i=t.__transition;if(i)for(r in n=null==n?null:n+"",i)if((e=i[r]).state>qi&&e.name===n)return new po([[t]],Zo,n,+r);return null},t.arc=function(){var t=Cm,n=Pm,e=ym(0),r=null,i=zm,o=$m,a=Dm,u=null,c=km(f);function f(){var f,s,l=+t.apply(this,arguments),h=+n.apply(this,arguments),d=i.apply(this,arguments)-Sm,p=o.apply(this,arguments)-Sm,g=vm(p-d),y=p>d;if(u||(u=f=c()),hTm)if(g>Em-Tm)u.moveTo(h*bm(d),h*wm(d)),u.arc(0,0,h,d,p,!y),l>Tm&&(u.moveTo(l*bm(p),l*wm(p)),u.arc(0,0,l,p,d,y));else{var v,_,b=d,m=p,x=d,w=p,M=g,T=g,A=a.apply(this,arguments)/2,S=A>Tm&&(r?+r.apply(this,arguments):Mm(l*l+h*h)),E=xm(vm(h-l)/2,+e.apply(this,arguments)),N=E,k=E;if(S>Tm){var C=Nm(S/l*wm(A)),P=Nm(S/h*wm(A));(M-=2*C)>Tm?(x+=C*=y?1:-1,w-=C):(M=0,x=w=(d+p)/2),(T-=2*P)>Tm?(b+=P*=y?1:-1,m-=P):(T=0,b=m=(d+p)/2)}var z=h*bm(b),$=h*wm(b),D=l*bm(w),R=l*wm(w);if(E>Tm){var F,q=h*bm(m),U=h*wm(m),I=l*bm(x),O=l*wm(x);if(g1?0:t<-1?Am:Math.acos(t)}((B*L+Y*j)/(Mm(B*B+Y*Y)*Mm(L*L+j*j)))/2),X=Mm(F[0]*F[0]+F[1]*F[1]);N=xm(E,(l-X)/(H-1)),k=xm(E,(h-X)/(H+1))}else N=k=0}T>Tm?k>Tm?(v=Rm(I,O,z,$,h,k,y),_=Rm(q,U,D,R,h,k,y),u.moveTo(v.cx+v.x01,v.cy+v.y01),kTm&&M>Tm?N>Tm?(v=Rm(D,R,q,U,l,-N,y),_=Rm(z,$,I,O,l,-N,y),u.lineTo(v.cx+v.x01,v.cy+v.y01),N=0))throw new RangeError("invalid r");let e=t.length;if(!((e=Math.floor(e))>=0))throw new RangeError("invalid length");if(!e||!n)return t;const r=y(n),i=t.slice();return r(t,i,0,e,1),r(i,t,0,e,1),r(t,i,0,e,1),t},t.blur2=l,t.blurImage=h,t.brush=function(){return wa(la)},t.brushSelection=function(t){var n=t.__brush;return n?n.dim.output(n.selection):null},t.brushX=function(){return wa(fa)},t.brushY=function(){return wa(sa)},t.buffer=function(t,n){return fetch(t,n).then(_c)},t.chord=function(){return za(!1,!1)},t.chordDirected=function(){return za(!0,!1)},t.chordTranspose=function(){return za(!1,!0)},t.cluster=function(){var t=Ld,n=1,e=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(n){var e=n.children;e?(n.x=function(t){return t.reduce(jd,0)/t.length}(e),n.y=function(t){return 1+t.reduce(Hd,0)}(e)):(n.x=o?a+=t(n,o):0,n.y=0,o=n)}));var u=function(t){for(var n;n=t.children;)t=n[0];return t}(i),c=function(t){for(var n;n=t.children;)t=n[n.length-1];return t}(i),f=u.x-t(u,c)/2,s=c.x+t(c,u)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*n,t.y=(i.y-t.y)*e}:function(t){t.x=(t.x-f)/(s-f)*n,t.y=(1-(i.y?t.y/i.y:1))*e})}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},t.color=ze,t.contourDensity=function(){var t=fu,n=su,e=lu,r=960,i=500,o=20,a=2,u=3*o,c=r+2*u>>a,f=i+2*u>>a,s=Qa(20);function h(r){var i=new Float32Array(c*f),s=Math.pow(2,-a),h=-1;for(const o of r){var d=(t(o,++h,r)+u)*s,p=(n(o,h,r)+u)*s,g=+e(o,h,r);if(g&&d>=0&&d=0&&pt*r)))(n).map(((t,n)=>(t.value=+e[n],p(t))))}function p(t){return t.coordinates.forEach(g),t}function g(t){t.forEach(y)}function y(t){t.forEach(v)}function v(t){t[0]=t[0]*Math.pow(2,a)-u,t[1]=t[1]*Math.pow(2,a)-u}function _(){return c=r+2*(u=3*o)>>a,f=i+2*u>>a,d}return d.contours=function(t){var n=h(t),e=iu().size([c,f]),r=Math.pow(2,2*a),i=t=>{t=+t;var i=p(e.contour(n,t*r));return i.value=t,i};return Object.defineProperty(i,"max",{get:()=>J(n)/r}),i},d.x=function(n){return arguments.length?(t="function"==typeof n?n:Qa(+n),d):t},d.y=function(t){return arguments.length?(n="function"==typeof t?t:Qa(+t),d):n},d.weight=function(t){return arguments.length?(e="function"==typeof t?t:Qa(+t),d):e},d.size=function(t){if(!arguments.length)return[r,i];var n=+t[0],e=+t[1];if(!(n>=0&&e>=0))throw new Error("invalid size");return r=n,i=e,_()},d.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(t)/Math.LN2),_()},d.thresholds=function(t){return arguments.length?(s="function"==typeof t?t:Array.isArray(t)?Qa(Za.call(t)):Qa(t),d):s},d.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=(Math.sqrt(4*t*t+1)-1)/2,_()},d},t.contours=iu,t.count=v,t.create=function(t){return Zn(Yt(t).call(document.documentElement))},t.creator=Yt,t.cross=function(...t){const n="function"==typeof t[t.length-1]&&function(t){return n=>t(...n)}(t.pop()),e=(t=t.map(m)).map(_),r=t.length-1,i=new Array(r+1).fill(0),o=[];if(r<0||e.some(b))return o;for(;;){o.push(i.map(((n,e)=>t[e][n])));let a=r;for(;++i[a]===e[a];){if(0===a)return n?o.map(n):o;i[a--]=0}}},t.csv=wc,t.csvFormat=rc,t.csvFormatBody=ic,t.csvFormatRow=ac,t.csvFormatRows=oc,t.csvFormatValue=uc,t.csvParse=nc,t.csvParseRows=ec,t.cubehelix=Tr,t.cumsum=function(t,n){var e=0,r=0;return Float64Array.from(t,void 0===n?t=>e+=+t||0:i=>e+=+n(i,r++,t)||0)},t.curveBasis=function(t){return new Fx(t)},t.curveBasisClosed=function(t){return new qx(t)},t.curveBasisOpen=function(t){return new Ux(t)},t.curveBumpX=nx,t.curveBumpY=ex,t.curveBundle=Ox,t.curveCardinal=Lx,t.curveCardinalClosed=Hx,t.curveCardinalOpen=Gx,t.curveCatmullRom=Zx,t.curveCatmullRomClosed=Qx,t.curveCatmullRomOpen=tw,t.curveLinear=Im,t.curveLinearClosed=function(t){return new nw(t)},t.curveMonotoneX=function(t){return new aw(t)},t.curveMonotoneY=function(t){return new uw(t)},t.curveNatural=function(t){return new fw(t)},t.curveStep=function(t){return new lw(t,.5)},t.curveStepAfter=function(t){return new lw(t,1)},t.curveStepBefore=function(t){return new lw(t,0)},t.descending=e,t.deviation=w,t.difference=function(t,...n){t=new InternSet(t);for(const e of n)for(const n of e)t.delete(n);return t},t.disjoint=function(t,n){const e=n[Symbol.iterator](),r=new InternSet;for(const n of t){if(r.has(n))return!1;let t,i;for(;({value:t,done:i}=e.next())&&!i;){if(Object.is(n,t))return!1;r.add(t)}}return!0},t.dispatch=$t,t.drag=function(){var t,n,e,r,i=se,o=le,a=he,u=de,c={},f=$t("start","drag","end"),s=0,l=0;function h(t){t.on("mousedown.drag",d).filter(u).on("touchstart.drag",y).on("touchmove.drag",v,ee).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(a,u){if(!r&&i.call(this,a,u)){var c=b(this,o.call(this,a,u),a,u,"mouse");c&&(Zn(a.view).on("mousemove.drag",p,re).on("mouseup.drag",g,re),ae(a.view),ie(a),e=!1,t=a.clientX,n=a.clientY,c("start",a))}}function p(r){if(oe(r),!e){var i=r.clientX-t,o=r.clientY-n;e=i*i+o*o>l}c.mouse("drag",r)}function g(t){Zn(t.view).on("mousemove.drag mouseup.drag",null),ue(t.view,e),oe(t),c.mouse("end",t)}function y(t,n){if(i.call(this,t,n)){var e,r,a=t.changedTouches,u=o.call(this,t,n),c=a.length;for(e=0;e+t,t.easePoly=wo,t.easePolyIn=mo,t.easePolyInOut=wo,t.easePolyOut=xo,t.easeQuad=_o,t.easeQuadIn=function(t){return t*t},t.easeQuadInOut=_o,t.easeQuadOut=function(t){return t*(2-t)},t.easeSin=Ao,t.easeSinIn=function(t){return 1==+t?1:1-Math.cos(t*To)},t.easeSinInOut=Ao,t.easeSinOut=function(t){return Math.sin(t*To)},t.every=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");let e=-1;for(const r of t)if(!n(r,++e,t))return!1;return!0},t.extent=M,t.fcumsum=function(t,n){const e=new T;let r=-1;return Float64Array.from(t,void 0===n?t=>e.add(+t||0):i=>e.add(+n(i,++r,t)||0))},t.filter=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");const e=[];let r=-1;for(const i of t)n(i,++r,t)&&e.push(i);return e},t.flatGroup=function(t,...n){return z(P(t,...n),n)},t.flatRollup=function(t,n,...e){return z(D(t,n,...e),e)},t.forceCenter=function(t,n){var e,r=1;function i(){var i,o,a=e.length,u=0,c=0;for(i=0;if+p||os+p||ac.index){var g=f-u.x-u.vx,y=s-u.y-u.vy,v=g*g+y*y;vt.r&&(t.r=t[n].r)}function c(){if(n){var r,i,o=n.length;for(e=new Array(o),r=0;r[u(t,n,r),t])));for(a=0,i=new Array(f);a=u)){(t.data!==n||t.next)&&(0===l&&(p+=(l=Uc(e))*l),0===h&&(p+=(h=Uc(e))*h),p(t=(Lc*t+jc)%Hc)/Hc}();function l(){h(),f.call("tick",n),e1?(null==e?u.delete(t):u.set(t,p(e)),n):u.get(t)},find:function(n,e,r){var i,o,a,u,c,f=0,s=t.length;for(null==r?r=1/0:r*=r,f=0;f1?(f.on(t,e),n):f.on(t)}}},t.forceX=function(t){var n,e,r,i=qc(.1);function o(t){for(var i,o=0,a=n.length;o=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?c:a).invert(t)},s.stream=function(e){return t&&n===e?t:(r=[a.stream(n=e),u.stream(e),c.stream(e)],i=r.length,t={point:function(t,n){for(var e=-1;++ejs(r[0],r[1])&&(r[1]=i[1]),js(i[0],r[1])>js(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,n=0,r=o[e=o.length-1];n<=e;r=i,++n)i=o[n],(u=js(r[1],i[0]))>a&&(a=u,Wf=i[0],Kf=r[1])}return is=os=null,Wf===1/0||Zf===1/0?[[NaN,NaN],[NaN,NaN]]:[[Wf,Zf],[Kf,Qf]]},t.geoCentroid=function(t){ms=xs=ws=Ms=Ts=As=Ss=Es=0,Ns=new T,ks=new T,Cs=new T,Lf(t,Gs);var n=+Ns,e=+ks,r=+Cs,i=Ef(n,e,r);return i=0))throw new RangeError(`invalid digits: ${t}`);i=n}return null===n&&(r=new ed(i)),a},a.projection(t).digits(i).context(n)},t.geoProjection=yd,t.geoProjectionMutator=vd,t.geoRotation=ll,t.geoStereographic=function(){return yd(Bd).scale(250).clipAngle(142)},t.geoStereographicRaw=Bd,t.geoStream=Lf,t.geoTransform=function(t){return{stream:id(t)}},t.geoTransverseMercator=function(){var t=Ed(Yd),n=t.center,e=t.rotate;return t.center=function(t){return arguments.length?n([-t[1],t[0]]):[(t=n())[1],-t[0]]},t.rotate=function(t){return arguments.length?e([t[0],t[1],t.length>2?t[2]+90:90]):[(t=e())[0],t[1],t[2]-90]},e([0,0,90]).scale(159.155)},t.geoTransverseMercatorRaw=Yd,t.gray=function(t,n){return new ur(t,0,0,null==n?1:n)},t.greatest=ot,t.greatestIndex=function(t,e=n){if(1===e.length)return tt(t,e);let r,i=-1,o=-1;for(const n of t)++o,(i<0?0===e(n,n):e(n,r)>0)&&(r=n,i=o);return i},t.group=C,t.groupSort=function(t,e,r){return(2!==e.length?U($(t,e,r),(([t,e],[r,i])=>n(e,i)||n(t,r))):U(C(t,r),(([t,r],[i,o])=>e(r,o)||n(t,i)))).map((([t])=>t))},t.groups=P,t.hcl=dr,t.hierarchy=Gd,t.histogram=Q,t.hsl=He,t.html=Ec,t.image=function(t,n){return new Promise((function(e,r){var i=new Image;for(var o in n)i[o]=n[o];i.onerror=r,i.onload=function(){e(i)},i.src=t}))},t.index=function(t,...n){return F(t,k,R,n)},t.indexes=function(t,...n){return F(t,Array.from,R,n)},t.interpolate=Gr,t.interpolateArray=function(t,n){return(Ir(n)?Ur:Or)(t,n)},t.interpolateBasis=Er,t.interpolateBasisClosed=Nr,t.interpolateBlues=Gb,t.interpolateBrBG=ob,t.interpolateBuGn=Mb,t.interpolateBuPu=Ab,t.interpolateCividis=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-t*(35.34-t*(2381.73-t*(6402.7-t*(7024.72-2710.57*t)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+t*(170.73+t*(52.82-t*(131.46-t*(176.58-67.37*t)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+t*(442.36-t*(2482.43-t*(6167.24-t*(6614.94-2475.67*t)))))))+")"},t.interpolateCool=am,t.interpolateCubehelix=li,t.interpolateCubehelixDefault=im,t.interpolateCubehelixLong=hi,t.interpolateDate=Br,t.interpolateDiscrete=function(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}},t.interpolateGnBu=Eb,t.interpolateGreens=Wb,t.interpolateGreys=Kb,t.interpolateHcl=ci,t.interpolateHclLong=fi,t.interpolateHsl=oi,t.interpolateHslLong=ai,t.interpolateHue=function(t,n){var e=Pr(+t,+n);return function(t){var n=e(t);return n-360*Math.floor(n/360)}},t.interpolateInferno=pm,t.interpolateLab=function(t,n){var e=$r((t=ar(t)).l,(n=ar(n)).l),r=$r(t.a,n.a),i=$r(t.b,n.b),o=$r(t.opacity,n.opacity);return function(n){return t.l=e(n),t.a=r(n),t.b=i(n),t.opacity=o(n),t+""}},t.interpolateMagma=dm,t.interpolateNumber=Yr,t.interpolateNumberArray=Ur,t.interpolateObject=Lr,t.interpolateOrRd=kb,t.interpolateOranges=rm,t.interpolatePRGn=ub,t.interpolatePiYG=fb,t.interpolatePlasma=gm,t.interpolatePuBu=$b,t.interpolatePuBuGn=Pb,t.interpolatePuOr=lb,t.interpolatePuRd=Rb,t.interpolatePurples=Jb,t.interpolateRainbow=function(t){(t<0||t>1)&&(t-=Math.floor(t));var n=Math.abs(t-.5);return um.h=360*t-100,um.s=1.5-1.5*n,um.l=.8-.9*n,um+""},t.interpolateRdBu=db,t.interpolateRdGy=gb,t.interpolateRdPu=qb,t.interpolateRdYlBu=vb,t.interpolateRdYlGn=bb,t.interpolateReds=nm,t.interpolateRgb=Dr,t.interpolateRgbBasis=Fr,t.interpolateRgbBasisClosed=qr,t.interpolateRound=Vr,t.interpolateSinebow=function(t){var n;return t=(.5-t)*Math.PI,cm.r=255*(n=Math.sin(t))*n,cm.g=255*(n=Math.sin(t+fm))*n,cm.b=255*(n=Math.sin(t+sm))*n,cm+""},t.interpolateSpectral=xb,t.interpolateString=Xr,t.interpolateTransformCss=ti,t.interpolateTransformSvg=ni,t.interpolateTurbo=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"},t.interpolateViridis=hm,t.interpolateWarm=om,t.interpolateYlGn=Bb,t.interpolateYlGnBu=Ib,t.interpolateYlOrBr=Lb,t.interpolateYlOrRd=Hb,t.interpolateZoom=ri,t.interrupt=Gi,t.intersection=function(t,...n){t=new InternSet(t),n=n.map(vt);t:for(const e of t)for(const r of n)if(!r.has(e)){t.delete(e);continue t}return t},t.interval=function(t,n,e){var r=new Ei,i=n;return null==n?(r.restart(t,n,e),r):(r._restart=r.restart,r.restart=function(t,n,e){n=+n,e=null==e?Ai():+e,r._restart((function o(a){a+=i,r._restart(o,i+=n,e),t(a)}),n,e)},r.restart(t,n,e),r)},t.isoFormat=D_,t.isoParse=F_,t.json=function(t,n){return fetch(t,n).then(Tc)},t.lab=ar,t.lch=function(t,n,e,r){return 1===arguments.length?hr(t):new pr(e,n,t,null==r?1:r)},t.least=function(t,e=n){let r,i=!1;if(1===e.length){let o;for(const a of t){const t=e(a);(i?n(t,o)<0:0===n(t,t))&&(r=a,o=t,i=!0)}}else for(const n of t)(i?e(n,r)<0:0===e(n,n))&&(r=n,i=!0);return r},t.leastIndex=ht,t.line=Ym,t.lineRadial=Zm,t.link=ax,t.linkHorizontal=function(){return ax(nx)},t.linkRadial=function(){const t=ax(rx);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t},t.linkVertical=function(){return ax(ex)},t.local=Qn,t.map=function(t,n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");if("function"!=typeof n)throw new TypeError("mapper is not a function");return Array.from(t,((e,r)=>n(e,r,t)))},t.matcher=Vt,t.max=J,t.maxIndex=tt,t.mean=function(t,n){let e=0,r=0;if(void 0===n)for(let n of t)null!=n&&(n=+n)>=n&&(++e,r+=n);else{let i=-1;for(let o of t)null!=(o=n(o,++i,t))&&(o=+o)>=o&&(++e,r+=o)}if(e)return r/e},t.median=function(t,n){return at(t,.5,n)},t.medianIndex=function(t,n){return ct(t,.5,n)},t.merge=ft,t.min=nt,t.minIndex=et,t.mode=function(t,n){const e=new InternMap;if(void 0===n)for(let n of t)null!=n&&n>=n&&e.set(n,(e.get(n)||0)+1);else{let r=-1;for(let i of t)null!=(i=n(i,++r,t))&&i>=i&&e.set(i,(e.get(i)||0)+1)}let r,i=0;for(const[t,n]of e)n>i&&(i=n,r=t);return r},t.namespace=It,t.namespaces=Ut,t.nice=Z,t.now=Ai,t.pack=function(){var t=null,n=1,e=1,r=np;function i(i){const o=ap();return i.x=n/2,i.y=e/2,t?i.eachBefore(xp(t)).eachAfter(wp(r,.5,o)).eachBefore(Mp(1)):i.eachBefore(xp(mp)).eachAfter(wp(np,1,o)).eachAfter(wp(r,i.r/Math.min(n,e),o)).eachBefore(Mp(Math.min(n,e)/(2*i.r))),i}return i.radius=function(n){return arguments.length?(t=Jd(n),i):t},i.size=function(t){return arguments.length?(n=+t[0],e=+t[1],i):[n,e]},i.padding=function(t){return arguments.length?(r="function"==typeof t?t:ep(+t),i):r},i},t.packEnclose=function(t){return up(t,ap())},t.packSiblings=function(t){return bp(t,ap()),t},t.pairs=function(t,n=st){const e=[];let r,i=!1;for(const o of t)i&&e.push(n(r,o)),r=o,i=!0;return e},t.partition=function(){var t=1,n=1,e=0,r=!1;function i(i){var o=i.height+1;return i.x0=i.y0=e,i.x1=t,i.y1=n/o,i.eachBefore(function(t,n){return function(r){r.children&&Ap(r,r.x0,t*(r.depth+1)/n,r.x1,t*(r.depth+2)/n);var i=r.x0,o=r.y0,a=r.x1-e,u=r.y1-e;a0&&(d+=l);for(null!=n?p.sort((function(t,e){return n(g[t],g[e])})):null!=e&&p.sort((function(t,n){return e(a[t],a[n])})),u=0,f=d?(v-h*b)/d:0;u0?l*f:0)+b,g[c]={data:a[c],index:u,value:l,startAngle:y,endAngle:s,padAngle:_};return g}return a.value=function(n){return arguments.length?(t="function"==typeof n?n:ym(+n),a):t},a.sortValues=function(t){return arguments.length?(n=t,e=null,a):n},a.sort=function(t){return arguments.length?(e=t,n=null,a):e},a.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:ym(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:ym(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"==typeof t?t:ym(+t),a):o},a},t.piecewise=di,t.pointRadial=Qm,t.pointer=ne,t.pointers=function(t,n){return t.target&&(t=te(t),void 0===n&&(n=t.currentTarget),t=t.touches||[t]),Array.from(t,(t=>ne(t,n)))},t.polygonArea=function(t){for(var n,e=-1,r=t.length,i=t[r-1],o=0;++eu!=f>u&&a<(c-e)*(u-r)/(f-r)+e&&(s=!s),c=e,f=r;return s},t.polygonHull=function(t){if((e=t.length)<3)return null;var n,e,r=new Array(e),i=new Array(e);for(n=0;n=0;--n)f.push(t[r[o[n]][2]]);for(n=+u;n(n=1664525*n+1013904223|0,lg*(n>>>0))},t.randomLogNormal=Kp,t.randomLogistic=fg,t.randomNormal=Zp,t.randomPareto=ng,t.randomPoisson=sg,t.randomUniform=Vp,t.randomWeibull=ug,t.range=lt,t.rank=function(t,e=n){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");let r=Array.from(t);const i=new Float64Array(r.length);2!==e.length&&(r=r.map(e),e=n);const o=(t,n)=>e(r[t],r[n]);let a,u;return(t=Uint32Array.from(r,((t,n)=>n))).sort(e===n?(t,n)=>O(r[t],r[n]):I(o)),t.forEach(((t,n)=>{const e=o(t,void 0===a?t:a);e>=0?((void 0===a||e>0)&&(a=t,u=n),i[t]=u):i[t]=NaN})),i},t.reduce=function(t,n,e){if("function"!=typeof n)throw new TypeError("reducer is not a function");const r=t[Symbol.iterator]();let i,o,a=-1;if(arguments.length<3){if(({done:i,value:e}=r.next()),i)return;++a}for(;({done:i,value:o}=r.next()),!i;)e=n(e,o,++a,t);return e},t.reverse=function(t){if("function"!=typeof t[Symbol.iterator])throw new TypeError("values is not iterable");return Array.from(t).reverse()},t.rgb=Fe,t.ribbon=function(){return Wa()},t.ribbonArrow=function(){return Wa(Va)},t.rollup=$,t.rollups=D,t.scaleBand=yg,t.scaleDiverging=function t(){var n=Ng(L_()(mg));return n.copy=function(){return B_(n,t())},dg.apply(n,arguments)},t.scaleDivergingLog=function t(){var n=Fg(L_()).domain([.1,1,10]);return n.copy=function(){return B_(n,t()).base(n.base())},dg.apply(n,arguments)},t.scaleDivergingPow=j_,t.scaleDivergingSqrt=function(){return j_.apply(null,arguments).exponent(.5)},t.scaleDivergingSymlog=function t(){var n=Ig(L_());return n.copy=function(){return B_(n,t()).constant(n.constant())},dg.apply(n,arguments)},t.scaleIdentity=function t(n){var e;function r(t){return null==t||isNaN(t=+t)?e:t}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(n=Array.from(t,_g),r):n.slice()},r.unknown=function(t){return arguments.length?(e=t,r):e},r.copy=function(){return t(n).unknown(e)},n=arguments.length?Array.from(n,_g):[0,1],Ng(r)},t.scaleImplicit=pg,t.scaleLinear=function t(){var n=Sg();return n.copy=function(){return Tg(n,t())},hg.apply(n,arguments),Ng(n)},t.scaleLog=function t(){const n=Fg(Ag()).domain([1,10]);return n.copy=()=>Tg(n,t()).base(n.base()),hg.apply(n,arguments),n},t.scaleOrdinal=gg,t.scalePoint=function(){return vg(yg.apply(null,arguments).paddingInner(1))},t.scalePow=jg,t.scaleQuantile=function t(){var e,r=[],i=[],o=[];function a(){var t=0,n=Math.max(1,i.length);for(o=new Array(n-1);++t0?o[n-1]:r[0],n=i?[o[i-1],r]:[o[n-1],o[n]]},u.unknown=function(t){return arguments.length?(n=t,u):u},u.thresholds=function(){return o.slice()},u.copy=function(){return t().domain([e,r]).range(a).unknown(n)},hg.apply(Ng(u),arguments)},t.scaleRadial=function t(){var n,e=Sg(),r=[0,1],i=!1;function o(t){var r=function(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}(e(t));return isNaN(r)?n:i?Math.round(r):r}return o.invert=function(t){return e.invert(Hg(t))},o.domain=function(t){return arguments.length?(e.domain(t),o):e.domain()},o.range=function(t){return arguments.length?(e.range((r=Array.from(t,_g)).map(Hg)),o):r.slice()},o.rangeRound=function(t){return o.range(t).round(!0)},o.round=function(t){return arguments.length?(i=!!t,o):i},o.clamp=function(t){return arguments.length?(e.clamp(t),o):e.clamp()},o.unknown=function(t){return arguments.length?(n=t,o):n},o.copy=function(){return t(e.domain(),r).round(i).clamp(e.clamp()).unknown(n)},hg.apply(o,arguments),Ng(o)},t.scaleSequential=function t(){var n=Ng(O_()(mg));return n.copy=function(){return B_(n,t())},dg.apply(n,arguments)},t.scaleSequentialLog=function t(){var n=Fg(O_()).domain([1,10]);return n.copy=function(){return B_(n,t()).base(n.base())},dg.apply(n,arguments)},t.scaleSequentialPow=Y_,t.scaleSequentialQuantile=function t(){var e=[],r=mg;function i(t){if(null!=t&&!isNaN(t=+t))return r((s(e,t,1)-1)/(e.length-1))}return i.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(n),i},i.interpolator=function(t){return arguments.length?(r=t,i):r},i.range=function(){return e.map(((t,n)=>r(n/(e.length-1))))},i.quantiles=function(t){return Array.from({length:t+1},((n,r)=>at(e,r/t)))},i.copy=function(){return t(r).domain(e)},dg.apply(i,arguments)},t.scaleSequentialSqrt=function(){return Y_.apply(null,arguments).exponent(.5)},t.scaleSequentialSymlog=function t(){var n=Ig(O_());return n.copy=function(){return B_(n,t()).constant(n.constant())},dg.apply(n,arguments)},t.scaleSqrt=function(){return jg.apply(null,arguments).exponent(.5)},t.scaleSymlog=function t(){var n=Ig(Ag());return n.copy=function(){return Tg(n,t()).constant(n.constant())},hg.apply(n,arguments)},t.scaleThreshold=function t(){var n,e=[.5],r=[0,1],i=1;function o(t){return null!=t&&t<=t?r[s(e,t,0,i)]:n}return o.domain=function(t){return arguments.length?(e=Array.from(t),i=Math.min(e.length,r.length-1),o):e.slice()},o.range=function(t){return arguments.length?(r=Array.from(t),i=Math.min(e.length,r.length-1),o):r.slice()},o.invertExtent=function(t){var n=r.indexOf(t);return[e[n-1],e[n]]},o.unknown=function(t){return arguments.length?(n=t,o):n},o.copy=function(){return t().domain(e).range(r).unknown(n)},hg.apply(o,arguments)},t.scaleTime=function(){return hg.apply(I_(uv,cv,tv,Zy,xy,py,sy,ay,iy,t.timeFormat).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)},t.scaleUtc=function(){return hg.apply(I_(ov,av,ev,Qy,Fy,yy,hy,cy,iy,t.utcFormat).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)},t.scan=function(t,n){const e=ht(t,n);return e<0?void 0:e},t.schemeAccent=G_,t.schemeBlues=Xb,t.schemeBrBG=ib,t.schemeBuGn=wb,t.schemeBuPu=Tb,t.schemeCategory10=X_,t.schemeDark2=V_,t.schemeGnBu=Sb,t.schemeGreens=Vb,t.schemeGreys=Zb,t.schemeObservable10=W_,t.schemeOrRd=Nb,t.schemeOranges=em,t.schemePRGn=ab,t.schemePaired=Z_,t.schemePastel1=K_,t.schemePastel2=Q_,t.schemePiYG=cb,t.schemePuBu=zb,t.schemePuBuGn=Cb,t.schemePuOr=sb,t.schemePuRd=Db,t.schemePurples=Qb,t.schemeRdBu=hb,t.schemeRdGy=pb,t.schemeRdPu=Fb,t.schemeRdYlBu=yb,t.schemeRdYlGn=_b,t.schemeReds=tm,t.schemeSet1=J_,t.schemeSet2=tb,t.schemeSet3=nb,t.schemeSpectral=mb,t.schemeTableau10=eb,t.schemeYlGn=Ob,t.schemeYlGnBu=Ub,t.schemeYlOrBr=Yb,t.schemeYlOrRd=jb,t.select=Zn,t.selectAll=function(t){return"string"==typeof t?new Vn([document.querySelectorAll(t)],[document.documentElement]):new Vn([Ht(t)],Gn)},t.selection=Wn,t.selector=jt,t.selectorAll=Gt,t.shuffle=dt,t.shuffler=pt,t.some=function(t,n){if("function"!=typeof n)throw new TypeError("test is not a function");let e=-1;for(const r of t)if(n(r,++e,t))return!0;return!1},t.sort=U,t.stack=function(){var t=ym([]),n=dw,e=hw,r=pw;function i(i){var o,a,u=Array.from(t.apply(this,arguments),gw),c=u.length,f=-1;for(const t of i)for(o=0,++f;o0)for(var e,r,i,o,a,u,c=0,f=t[n[0]].length;c0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)},t.stackOffsetExpand=function(t,n){if((r=t.length)>0){for(var e,r,i,o=0,a=t[0].length;o0){for(var e,r=0,i=t[n[0]],o=i.length;r0&&(r=(e=t[n[0]]).length)>0){for(var e,r,i,o=0,a=1;afunction(t){t=`${t}`;let n=t.length;zp(t,n-1)&&!zp(t,n-2)&&(t=t.slice(0,-1));return"/"===t[0]?t:`/${t}`}(t(n,e,r)))),e=n.map(Pp),i=new Set(n).add("");for(const t of e)i.has(t)||(i.add(t),n.push(t),e.push(Pp(t)),h.push(Np));d=(t,e)=>n[e],p=(t,n)=>e[n]}for(a=0,i=h.length;a=0&&(f=h[t]).data===Np;--t)f.data=null}if(u.parent=Sp,u.eachBefore((function(t){t.depth=t.parent.depth+1,--i})).eachBefore(Kd),u.parent=null,i>0)throw new Error("cycle");return u}return r.id=function(t){return arguments.length?(n=Jd(t),r):n},r.parentId=function(t){return arguments.length?(e=Jd(t),r):e},r.path=function(n){return arguments.length?(t=Jd(n),r):t},r},t.style=_n,t.subset=function(t,n){return _t(n,t)},t.sum=function(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let r=-1;for(let i of t)(i=+n(i,++r,t))&&(e+=i)}return e},t.superset=_t,t.svg=Nc,t.symbol=function(t,n){let e=null,r=km(i);function i(){let i;if(e||(e=i=r()),t.apply(this,arguments).draw(e,+n.apply(this,arguments)),i)return e=null,i+""||null}return t="function"==typeof t?t:ym(t||fx),n="function"==typeof n?n:ym(void 0===n?64:+n),i.type=function(n){return arguments.length?(t="function"==typeof n?n:ym(n),i):t},i.size=function(t){return arguments.length?(n="function"==typeof t?t:ym(+t),i):n},i.context=function(t){return arguments.length?(e=null==t?null:t,i):e},i},t.symbolAsterisk=cx,t.symbolCircle=fx,t.symbolCross=sx,t.symbolDiamond=dx,t.symbolDiamond2=px,t.symbolPlus=gx,t.symbolSquare=yx,t.symbolSquare2=vx,t.symbolStar=xx,t.symbolTimes=Px,t.symbolTriangle=Mx,t.symbolTriangle2=Ax,t.symbolWye=Cx,t.symbolX=Px,t.symbols=zx,t.symbolsFill=zx,t.symbolsStroke=$x,t.text=mc,t.thresholdFreedmanDiaconis=function(t,n,e){const r=v(t),i=at(t,.75)-at(t,.25);return r&&i?Math.ceil((e-n)/(2*i*Math.pow(r,-1/3))):1},t.thresholdScott=function(t,n,e){const r=v(t),i=w(t);return r&&i?Math.ceil((e-n)*Math.cbrt(r)/(3.49*i)):1},t.thresholdSturges=K,t.tickFormat=Eg,t.tickIncrement=V,t.tickStep=W,t.ticks=G,t.timeDay=py,t.timeDays=gy,t.timeFormatDefaultLocale=P_,t.timeFormatLocale=hv,t.timeFriday=Sy,t.timeFridays=$y,t.timeHour=sy,t.timeHours=ly,t.timeInterval=Vg,t.timeMillisecond=Wg,t.timeMilliseconds=Zg,t.timeMinute=ay,t.timeMinutes=uy,t.timeMonday=wy,t.timeMondays=ky,t.timeMonth=Zy,t.timeMonths=Ky,t.timeSaturday=Ey,t.timeSaturdays=Dy,t.timeSecond=iy,t.timeSeconds=oy,t.timeSunday=xy,t.timeSundays=Ny,t.timeThursday=Ay,t.timeThursdays=zy,t.timeTickInterval=cv,t.timeTicks=uv,t.timeTuesday=My,t.timeTuesdays=Cy,t.timeWednesday=Ty,t.timeWednesdays=Py,t.timeWeek=xy,t.timeWeeks=Ny,t.timeYear=tv,t.timeYears=nv,t.timeout=$i,t.timer=Ni,t.timerFlush=ki,t.transition=go,t.transpose=gt,t.tree=function(){var t=$p,n=1,e=1,r=null;function i(i){var c=function(t){for(var n,e,r,i,o,a=new Up(t,0),u=[a];n=u.pop();)if(r=n._.children)for(n.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(e=n.children[i]=new Up(r[i],i)),e.parent=n;return(a.parent=new Up(null,0)).children=[a],a}(i);if(c.eachAfter(o),c.parent.m=-c.z,c.eachBefore(a),r)i.eachBefore(u);else{var f=i,s=i,l=i;i.eachBefore((function(t){t.xs.x&&(s=t),t.depth>l.depth&&(l=t)}));var h=f===s?1:t(f,s)/2,d=h-f.x,p=n/(s.x+h+d),g=e/(l.depth||1);i.eachBefore((function(t){t.x=(t.x+d)*p,t.y=t.depth*g}))}return i}function o(n){var e=n.children,r=n.parent.children,i=n.i?r[n.i-1]:null;if(e){!function(t){for(var n,e=0,r=0,i=t.children,o=i.length;--o>=0;)(n=i[o]).z+=e,n.m+=e,e+=n.s+(r+=n.c)}(n);var o=(e[0].z+e[e.length-1].z)/2;i?(n.z=i.z+t(n._,i._),n.m=n.z-o):n.z=o}else i&&(n.z=i.z+t(n._,i._));n.parent.A=function(n,e,r){if(e){for(var i,o=n,a=n,u=e,c=o.parent.children[0],f=o.m,s=a.m,l=u.m,h=c.m;u=Rp(u),o=Dp(o),u&&o;)c=Dp(c),(a=Rp(a)).a=n,(i=u.z+l-o.z-f+t(u._,o._))>0&&(Fp(qp(u,n,r),n,i),f+=i,s+=i),l+=u.m,f+=o.m,h+=c.m,s+=a.m;u&&!Rp(a)&&(a.t=u,a.m+=l-s),o&&!Dp(c)&&(c.t=o,c.m+=f-h,r=n)}return r}(n,i,n.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=n,t.y=t.depth*e}return i.separation=function(n){return arguments.length?(t=n,i):t},i.size=function(t){return arguments.length?(r=!1,n=+t[0],e=+t[1],i):r?null:[n,e]},i.nodeSize=function(t){return arguments.length?(r=!0,n=+t[0],e=+t[1],i):r?[n,e]:null},i},t.treemap=function(){var t=Yp,n=!1,e=1,r=1,i=[0],o=np,a=np,u=np,c=np,f=np;function s(t){return t.x0=t.y0=0,t.x1=e,t.y1=r,t.eachBefore(l),i=[0],n&&t.eachBefore(Tp),t}function l(n){var e=i[n.depth],r=n.x0+e,s=n.y0+e,l=n.x1-e,h=n.y1-e;l=e-1){var s=u[n];return s.x0=i,s.y0=o,s.x1=a,void(s.y1=c)}var l=f[n],h=r/2+l,d=n+1,p=e-1;for(;d>>1;f[g]c-o){var _=r?(i*v+a*y)/r:a;t(n,d,y,i,o,_,c),t(d,e,v,_,o,a,c)}else{var b=r?(o*v+c*y)/r:c;t(n,d,y,i,o,a,b),t(d,e,v,i,b,a,c)}}(0,c,t.value,n,e,r,i)},t.treemapDice=Ap,t.treemapResquarify=Lp,t.treemapSlice=Ip,t.treemapSliceDice=function(t,n,e,r,i){(1&t.depth?Ip:Ap)(t,n,e,r,i)},t.treemapSquarify=Yp,t.tsv=Mc,t.tsvFormat=lc,t.tsvFormatBody=hc,t.tsvFormatRow=pc,t.tsvFormatRows=dc,t.tsvFormatValue=gc,t.tsvParse=fc,t.tsvParseRows=sc,t.union=function(...t){const n=new InternSet;for(const e of t)for(const t of e)n.add(t);return n},t.unixDay=_y,t.unixDays=by,t.utcDay=yy,t.utcDays=vy,t.utcFriday=By,t.utcFridays=Vy,t.utcHour=hy,t.utcHours=dy,t.utcMillisecond=Wg,t.utcMilliseconds=Zg,t.utcMinute=cy,t.utcMinutes=fy,t.utcMonday=qy,t.utcMondays=jy,t.utcMonth=Qy,t.utcMonths=Jy,t.utcSaturday=Yy,t.utcSaturdays=Wy,t.utcSecond=iy,t.utcSeconds=oy,t.utcSunday=Fy,t.utcSundays=Ly,t.utcThursday=Oy,t.utcThursdays=Gy,t.utcTickInterval=av,t.utcTicks=ov,t.utcTuesday=Uy,t.utcTuesdays=Hy,t.utcWednesday=Iy,t.utcWednesdays=Xy,t.utcWeek=Fy,t.utcWeeks=Ly,t.utcYear=ev,t.utcYears=rv,t.variance=x,t.version="7.9.0",t.window=pn,t.xml=Sc,t.zip=function(){return gt(arguments)},t.zoom=function(){var t,n,e,r=Ew,i=Nw,o=zw,a=Cw,u=Pw,c=[0,1/0],f=[[-1/0,-1/0],[1/0,1/0]],s=250,l=ri,h=$t("start","zoom","end"),d=500,p=150,g=0,y=10;function v(t){t.property("__zoom",kw).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",A).on("dblclick.zoom",S).filter(u).on("touchstart.zoom",E).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",k).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(t,n){return(n=Math.max(c[0],Math.min(c[1],n)))===t.k?t:new ww(n,t.x,t.y)}function b(t,n,e){var r=n[0]-e[0]*t.k,i=n[1]-e[1]*t.k;return r===t.x&&i===t.y?t:new ww(t.k,r,i)}function m(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function x(t,n,e,r){t.on("start.zoom",(function(){w(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=w(t,o).event(r),u=i.apply(t,o),c=null==e?m(u):"function"==typeof e?e.apply(t,o):e,f=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),s=t.__zoom,h="function"==typeof n?n.apply(t,o):n,d=l(s.invert(c).concat(f/s.k),h.invert(c).concat(f/h.k));return function(t){if(1===t)t=h;else{var n=d(t),e=f/n[2];t=new ww(e,c[0]-n[0]*e,c[1]-n[1]*e)}a.zoom(null,t)}}))}function w(t,n,e){return!e&&t.__zooming||new M(t,n)}function M(t,n){this.that=t,this.args=n,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,n),this.taps=0}function T(t,...n){if(r.apply(this,arguments)){var e=w(this,n).event(t),i=this.__zoom,u=Math.max(c[0],Math.min(c[1],i.k*Math.pow(2,a.apply(this,arguments)))),s=ne(t);if(e.wheel)e.mouse[0][0]===s[0]&&e.mouse[0][1]===s[1]||(e.mouse[1]=i.invert(e.mouse[0]=s)),clearTimeout(e.wheel);else{if(i.k===u)return;e.mouse=[s,i.invert(s)],Gi(this),e.start()}Sw(t),e.wheel=setTimeout((function(){e.wheel=null,e.end()}),p),e.zoom("mouse",o(b(_(i,u),e.mouse[0],e.mouse[1]),e.extent,f))}}function A(t,...n){if(!e&&r.apply(this,arguments)){var i=t.currentTarget,a=w(this,n,!0).event(t),u=Zn(t.view).on("mousemove.zoom",(function(t){if(Sw(t),!a.moved){var n=t.clientX-s,e=t.clientY-l;a.moved=n*n+e*e>g}a.event(t).zoom("mouse",o(b(a.that.__zoom,a.mouse[0]=ne(t,i),a.mouse[1]),a.extent,f))}),!0).on("mouseup.zoom",(function(t){u.on("mousemove.zoom mouseup.zoom",null),ue(t.view,a.moved),Sw(t),a.event(t).end()}),!0),c=ne(t,i),s=t.clientX,l=t.clientY;ae(t.view),Aw(t),a.mouse=[c,this.__zoom.invert(c)],Gi(this),a.start()}}function S(t,...n){if(r.apply(this,arguments)){var e=this.__zoom,a=ne(t.changedTouches?t.changedTouches[0]:t,this),u=e.invert(a),c=e.k*(t.shiftKey?.5:2),l=o(b(_(e,c),a,u),i.apply(this,n),f);Sw(t),s>0?Zn(this).transition().duration(s).call(x,l,a,t):Zn(this).call(v.transform,l,a,t)}}function E(e,...i){if(r.apply(this,arguments)){var o,a,u,c,f=e.touches,s=f.length,l=w(this,i,e.changedTouches.length===s).event(e);for(Aw(e),a=0;ali{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-vcard:before,.fa-address-card:before{content:"\f2bb"}.fa-vcard-o:before,.fa-address-card-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} diff --git a/fonts/fontawesome/fonts/FontAwesome.otf b/fonts/fontawesome/fonts/FontAwesome.otf deleted file mode 100755 index 401ec0f..0000000 Binary files a/fonts/fontawesome/fonts/FontAwesome.otf and /dev/null differ diff --git a/fonts/fontawesome/fonts/fontawesome-webfont.eot b/fonts/fontawesome/fonts/fontawesome-webfont.eot deleted file mode 100755 index e9f60ca..0000000 Binary files a/fonts/fontawesome/fonts/fontawesome-webfont.eot and /dev/null differ diff --git a/fonts/fontawesome/fonts/fontawesome-webfont.svg b/fonts/fontawesome/fonts/fontawesome-webfont.svg deleted file mode 100755 index 855c845..0000000 --- a/fonts/fontawesome/fonts/fontawesome-webfont.svg +++ /dev/null @@ -1,2671 +0,0 @@ - - - - -Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 - By ,,, -Copyright Dave Gandy 2016. All rights reserved. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/fonts/fontawesome/fonts/fontawesome-webfont.ttf b/fonts/fontawesome/fonts/fontawesome-webfont.ttf deleted file mode 100755 index 35acda2..0000000 Binary files a/fonts/fontawesome/fonts/fontawesome-webfont.ttf and /dev/null differ diff --git a/fonts/fontawesome/fonts/fontawesome-webfont.woff b/fonts/fontawesome/fonts/fontawesome-webfont.woff deleted file mode 100755 index 400014a..0000000 Binary files a/fonts/fontawesome/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/fonts/fontawesome/fonts/fontawesome-webfont.woff2 b/fonts/fontawesome/fonts/fontawesome-webfont.woff2 deleted file mode 100755 index 4d13fc6..0000000 Binary files a/fonts/fontawesome/fonts/fontawesome-webfont.woff2 and /dev/null differ diff --git a/fonts/fontawesome/license.jpg b/fonts/fontawesome/license.jpg deleted file mode 100644 index a0ef7ad..0000000 Binary files a/fonts/fontawesome/license.jpg and /dev/null differ diff --git a/fonts/linearicons/License.txt b/fonts/linearicons/License.txt deleted file mode 100755 index 0ea7162..0000000 --- a/fonts/linearicons/License.txt +++ /dev/null @@ -1,2 +0,0 @@ -Please refer to https://linearicons.com/free/license for the license. -If you have any questions regarding the license, please feel free to email me@perxis.com diff --git a/fonts/linearicons/css/style.css b/fonts/linearicons/css/style.css deleted file mode 100755 index be88a82..0000000 --- a/fonts/linearicons/css/style.css +++ /dev/null @@ -1,537 +0,0 @@ -@font-face { - font-family: 'Linearicons-Free'; - font-display: swap; - src:url('../fonts/Linearicons-Free.eot?w118d'); - src:url('../fonts/Linearicons-Free.eot?#iefixw118d') format('embedded-opentype'), - url('../fonts/Linearicons-Free.woff2?w118d') format('woff2'), - url('../fonts/Linearicons-Free.woff?w118d') format('woff'), - url('../fonts/Linearicons-Free.ttf?w118d') format('truetype'), - url('../fonts/Linearicons-Free.svg?w118d#Linearicons-Free') format('svg'); - font-weight: normal; - font-style: normal; -} - -.lnr { - font-family: 'Linearicons-Free'; - speak: none; - font-style: normal; - font-weight: normal; - font-variant: normal; - text-transform: none; - line-height: 1; - - /* Better Font Rendering =========== */ - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -.lnr-home:before { - content: "\e800"; -} -.lnr-apartment:before { - content: "\e801"; -} -.lnr-pencil:before { - content: "\e802"; -} -.lnr-magic-wand:before { - content: "\e803"; -} -.lnr-drop:before { - content: "\e804"; -} -.lnr-lighter:before { - content: "\e805"; -} -.lnr-poop:before { - content: "\e806"; -} -.lnr-sun:before { - content: "\e807"; -} -.lnr-moon:before { - content: "\e808"; -} -.lnr-cloud:before { - content: "\e809"; -} -.lnr-cloud-upload:before { - content: "\e80a"; -} -.lnr-cloud-download:before { - content: "\e80b"; -} -.lnr-cloud-sync:before { - content: "\e80c"; -} -.lnr-cloud-check:before { - content: "\e80d"; -} -.lnr-database:before { - content: "\e80e"; -} -.lnr-lock:before { - content: "\e80f"; -} -.lnr-cog:before { - content: "\e810"; -} -.lnr-trash:before { - content: "\e811"; -} -.lnr-dice:before { - content: "\e812"; -} -.lnr-heart:before { - content: "\e813"; -} -.lnr-star:before { - content: "\e814"; -} -.lnr-star-half:before { - content: "\e815"; -} -.lnr-star-empty:before { - content: "\e816"; -} -.lnr-flag:before { - content: "\e817"; -} -.lnr-envelope:before { - content: "\e818"; -} -.lnr-paperclip:before { - content: "\e819"; -} -.lnr-inbox:before { - content: "\e81a"; -} -.lnr-eye:before { - content: "\e81b"; -} -.lnr-printer:before { - content: "\e81c"; -} -.lnr-file-empty:before { - content: "\e81d"; -} -.lnr-file-add:before { - content: "\e81e"; -} -.lnr-enter:before { - content: "\e81f"; -} -.lnr-exit:before { - content: "\e820"; -} -.lnr-graduation-hat:before { - content: "\e821"; -} -.lnr-license:before { - content: "\e822"; -} -.lnr-music-note:before { - content: "\e823"; -} -.lnr-film-play:before { - content: "\e824"; -} -.lnr-camera-video:before { - content: "\e825"; -} -.lnr-camera:before { - content: "\e826"; -} -.lnr-picture:before { - content: "\e827"; -} -.lnr-book:before { - content: "\e828"; -} -.lnr-bookmark:before { - content: "\e829"; -} -.lnr-user:before { - content: "\e82a"; -} -.lnr-users:before { - content: "\e82b"; -} -.lnr-shirt:before { - content: "\e82c"; -} -.lnr-store:before { - content: "\e82d"; -} -.lnr-cart:before { - content: "\e82e"; -} -.lnr-tag:before { - content: "\e82f"; -} -.lnr-phone-handset:before { - content: "\e830"; -} -.lnr-phone:before { - content: "\e831"; -} -.lnr-pushpin:before { - content: "\e832"; -} -.lnr-map-marker:before { - content: "\e833"; -} -.lnr-map:before { - content: "\e834"; -} -.lnr-location:before { - content: "\e835"; -} -.lnr-calendar-full:before { - content: "\e836"; -} -.lnr-keyboard:before { - content: "\e837"; -} -.lnr-spell-check:before { - content: "\e838"; -} -.lnr-screen:before { - content: "\e839"; -} -.lnr-smartphone:before { - content: "\e83a"; -} -.lnr-tablet:before { - content: "\e83b"; -} -.lnr-laptop:before { - content: "\e83c"; -} -.lnr-laptop-phone:before { - content: "\e83d"; -} -.lnr-power-switch:before { - content: "\e83e"; -} -.lnr-bubble:before { - content: "\e83f"; -} -.lnr-heart-pulse:before { - content: "\e840"; -} -.lnr-construction:before { - content: "\e841"; -} -.lnr-pie-chart:before { - content: "\e842"; -} -.lnr-chart-bars:before { - content: "\e843"; -} -.lnr-gift:before { - content: "\e844"; -} -.lnr-diamond:before { - content: "\e845"; -} -.lnr-linearicons:before { - content: "\e846"; -} -.lnr-dinner:before { - content: "\e847"; -} -.lnr-coffee-cup:before { - content: "\e848"; -} -.lnr-leaf:before { - content: "\e849"; -} -.lnr-paw:before { - content: "\e84a"; -} -.lnr-rocket:before { - content: "\e84b"; -} -.lnr-briefcase:before { - content: "\e84c"; -} -.lnr-bus:before { - content: "\e84d"; -} -.lnr-car:before { - content: "\e84e"; -} -.lnr-train:before { - content: "\e84f"; -} -.lnr-bicycle:before { - content: "\e850"; -} -.lnr-wheelchair:before { - content: "\e851"; -} -.lnr-select:before { - content: "\e852"; -} -.lnr-earth:before { - content: "\e853"; -} -.lnr-smile:before { - content: "\e854"; -} -.lnr-sad:before { - content: "\e855"; -} -.lnr-neutral:before { - content: "\e856"; -} -.lnr-mustache:before { - content: "\e857"; -} -.lnr-alarm:before { - content: "\e858"; -} -.lnr-bullhorn:before { - content: "\e859"; -} -.lnr-volume-high:before { - content: "\e85a"; -} -.lnr-volume-medium:before { - content: "\e85b"; -} -.lnr-volume-low:before { - content: "\e85c"; -} -.lnr-volume:before { - content: "\e85d"; -} -.lnr-mic:before { - content: "\e85e"; -} -.lnr-hourglass:before { - content: "\e85f"; -} -.lnr-undo:before { - content: "\e860"; -} -.lnr-redo:before { - content: "\e861"; -} -.lnr-sync:before { - content: "\e862"; -} -.lnr-history:before { - content: "\e863"; -} -.lnr-clock:before { - content: "\e864"; -} -.lnr-download:before { - content: "\e865"; -} -.lnr-upload:before { - content: "\e866"; -} -.lnr-enter-down:before { - content: "\e867"; -} -.lnr-exit-up:before { - content: "\e868"; -} -.lnr-bug:before { - content: "\e869"; -} -.lnr-code:before { - content: "\e86a"; -} -.lnr-link:before { - content: "\e86b"; -} -.lnr-unlink:before { - content: "\e86c"; -} -.lnr-thumbs-up:before { - content: "\e86d"; -} -.lnr-thumbs-down:before { - content: "\e86e"; -} -.lnr-magnifier:before { - content: "\e86f"; -} -.lnr-cross:before { - content: "\e870"; -} -.lnr-menu:before { - content: "\e871"; -} -.lnr-list:before { - content: "\e872"; -} -.lnr-chevron-up:before { - content: "\e873"; -} -.lnr-chevron-down:before { - content: "\e874"; -} -.lnr-chevron-left:before { - content: "\e875"; -} -.lnr-chevron-right:before { - content: "\e876"; -} -.lnr-arrow-up:before { - content: "\e877"; -} -.lnr-arrow-down:before { - content: "\e878"; -} -.lnr-arrow-left:before { - content: "\e879"; -} -.lnr-arrow-right:before { - content: "\e87a"; -} -.lnr-move:before { - content: "\e87b"; -} -.lnr-warning:before { - content: "\e87c"; -} -.lnr-question-circle:before { - content: "\e87d"; -} -.lnr-menu-circle:before { - content: "\e87e"; -} -.lnr-checkmark-circle:before { - content: "\e87f"; -} -.lnr-cross-circle:before { - content: "\e880"; -} -.lnr-plus-circle:before { - content: "\e881"; -} -.lnr-circle-minus:before { - content: "\e882"; -} -.lnr-arrow-up-circle:before { - content: "\e883"; -} -.lnr-arrow-down-circle:before { - content: "\e884"; -} -.lnr-arrow-left-circle:before { - content: "\e885"; -} -.lnr-arrow-right-circle:before { - content: "\e886"; -} -.lnr-chevron-up-circle:before { - content: "\e887"; -} -.lnr-chevron-down-circle:before { - content: "\e888"; -} -.lnr-chevron-left-circle:before { - content: "\e889"; -} -.lnr-chevron-right-circle:before { - content: "\e88a"; -} -.lnr-crop:before { - content: "\e88b"; -} -.lnr-frame-expand:before { - content: "\e88c"; -} -.lnr-frame-contract:before { - content: "\e88d"; -} -.lnr-layers:before { - content: "\e88e"; -} -.lnr-funnel:before { - content: "\e88f"; -} -.lnr-text-format:before { - content: "\e890"; -} -.lnr-text-format-remove:before { - content: "\e891"; -} -.lnr-text-size:before { - content: "\e892"; -} -.lnr-bold:before { - content: "\e893"; -} -.lnr-italic:before { - content: "\e894"; -} -.lnr-underline:before { - content: "\e895"; -} -.lnr-strikethrough:before { - content: "\e896"; -} -.lnr-highlight:before { - content: "\e897"; -} -.lnr-text-align-left:before { - content: "\e898"; -} -.lnr-text-align-center:before { - content: "\e899"; -} -.lnr-text-align-right:before { - content: "\e89a"; -} -.lnr-text-align-justify:before { - content: "\e89b"; -} -.lnr-line-spacing:before { - content: "\e89c"; -} -.lnr-indent-increase:before { - content: "\e89d"; -} -.lnr-indent-decrease:before { - content: "\e89e"; -} -.lnr-pilcrow:before { - content: "\e89f"; -} -.lnr-direction-ltr:before { - content: "\e8a0"; -} -.lnr-direction-rtl:before { - content: "\e8a1"; -} -.lnr-page-break:before { - content: "\e8a2"; -} -.lnr-sort-alpha-asc:before { - content: "\e8a3"; -} -.lnr-sort-amount-asc:before { - content: "\e8a4"; -} -.lnr-hand:before { - content: "\e8a5"; -} -.lnr-pointer-up:before { - content: "\e8a6"; -} -.lnr-pointer-right:before { - content: "\e8a7"; -} -.lnr-pointer-down:before { - content: "\e8a8"; -} -.lnr-pointer-left:before { - content: "\e8a9"; -} diff --git a/fonts/linearicons/fonts/Linearicons-Free.eot b/fonts/linearicons/fonts/Linearicons-Free.eot deleted file mode 100755 index e531c22..0000000 Binary files a/fonts/linearicons/fonts/Linearicons-Free.eot and /dev/null differ diff --git a/fonts/linearicons/fonts/Linearicons-Free.svg b/fonts/linearicons/fonts/Linearicons-Free.svg deleted file mode 100755 index f498bf4..0000000 --- a/fonts/linearicons/fonts/Linearicons-Free.svg +++ /dev/null @@ -1,199 +0,0 @@ - - - - - -{ - "fontFamily": "Linearicons-Free", - "majorVersion": 1, - "minorVersion": 0, - "description": "Designed by Perxis (https://perxis.com).\nFont generated by IcoMoon.", - "copyright": "Copyright © 2015 Perxis.com. All Rights Reserved.", - "designerURL": "https://perxis.com", - "license": "https://linearicons.com/free/license", - "fontURL": "https://linearicons.com", - "licenseURL": "https://linearicons.com/free/license", - "version": "Version 1.0", - "fontId": "Linearicons-Free", - "psName": "Linearicons-Free", - "subFamily": "Regular", - "fullName": "Linearicons-Free" -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/fonts/linearicons/fonts/Linearicons-Free.ttf b/fonts/linearicons/fonts/Linearicons-Free.ttf deleted file mode 100755 index 73d6783..0000000 Binary files a/fonts/linearicons/fonts/Linearicons-Free.ttf and /dev/null differ diff --git a/fonts/linearicons/fonts/Linearicons-Free.woff b/fonts/linearicons/fonts/Linearicons-Free.woff deleted file mode 100755 index 63b5b75..0000000 Binary files a/fonts/linearicons/fonts/Linearicons-Free.woff and /dev/null differ diff --git a/fonts/linearicons/fonts/Linearicons-Free.woff2 b/fonts/linearicons/fonts/Linearicons-Free.woff2 deleted file mode 100755 index d4c5dda..0000000 Binary files a/fonts/linearicons/fonts/Linearicons-Free.woff2 and /dev/null differ diff --git a/paypal/PayPal/Api/Address.php b/paypal/PayPal/Api/Address.php deleted file mode 100644 index 56d95e8..0000000 --- a/paypal/PayPal/Api/Address.php +++ /dev/null @@ -1,62 +0,0 @@ -phone = $phone; - return $this; - } - - /** - * Phone number in E.123 format. 50 characters max. - * - * @return string - */ - public function getPhone() - { - return $this->phone; - } - - /** - * Type of address (e.g., HOME_OR_WORK, GIFT etc). - * - * @param string $type - * - * @return $this - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * Type of address (e.g., HOME_OR_WORK, GIFT etc). - * - * @return string - */ - public function getType() - { - return $this->type; - } -} diff --git a/paypal/PayPal/Api/Agreement.php b/paypal/PayPal/Api/Agreement.php deleted file mode 100644 index 810dde2..0000000 --- a/paypal/PayPal/Api/Agreement.php +++ /dev/null @@ -1,647 +0,0 @@ -id = $id; - return $this; - } - - /** - * Identifier of the agreement. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * State of the agreement. - * - * @param string $state - * - * @return $this - */ - public function setState($state) - { - $this->state = $state; - return $this; - } - - /** - * State of the agreement. - * - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Name of the agreement. - * - * @param string $name - * - * @return $this - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * Name of the agreement. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Description of the agreement. - * - * @param string $description - * - * @return $this - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * Description of the agreement. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Start date of the agreement. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $start_date - * - * @return $this - */ - public function setStartDate($start_date) - { - $this->start_date = $start_date; - return $this; - } - - /** - * Start date of the agreement. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getStartDate() - { - return $this->start_date; - } - - /** - * Details of the buyer who is enrolling in this agreement. This information is gathered from execution of the approval URL. - * - * @param \PayPal\Api\Payer $payer - * - * @return $this - */ - public function setPayer($payer) - { - $this->payer = $payer; - return $this; - } - - /** - * Details of the buyer who is enrolling in this agreement. This information is gathered from execution of the approval URL. - * - * @return \PayPal\Api\Payer - */ - public function getPayer() - { - return $this->payer; - } - - /** - * Shipping address object of the agreement, which should be provided if it is different from the default address. - * - * @param \PayPal\Api\Address $shipping_address - * - * @return $this - */ - public function setShippingAddress($shipping_address) - { - $this->shipping_address = $shipping_address; - return $this; - } - - /** - * Shipping address object of the agreement, which should be provided if it is different from the default address. - * - * @return \PayPal\Api\Address - */ - public function getShippingAddress() - { - return $this->shipping_address; - } - - /** - * Default merchant preferences from the billing plan are used, unless override preferences are provided here. - * - * @param \PayPal\Api\MerchantPreferences $override_merchant_preferences - * - * @return $this - */ - public function setOverrideMerchantPreferences($override_merchant_preferences) - { - $this->override_merchant_preferences = $override_merchant_preferences; - return $this; - } - - /** - * Default merchant preferences from the billing plan are used, unless override preferences are provided here. - * - * @return \PayPal\Api\MerchantPreferences - */ - public function getOverrideMerchantPreferences() - { - return $this->override_merchant_preferences; - } - - /** - * Array of override_charge_model for this agreement if needed to change the default models from the billing plan. - * - * @param \PayPal\Api\OverrideChargeModel[] $override_charge_models - * - * @return $this - */ - public function setOverrideChargeModels($override_charge_models) - { - $this->override_charge_models = $override_charge_models; - return $this; - } - - /** - * Array of override_charge_model for this agreement if needed to change the default models from the billing plan. - * - * @return \PayPal\Api\OverrideChargeModel[] - */ - public function getOverrideChargeModels() - { - return $this->override_charge_models; - } - - /** - * Append OverrideChargeModels to the list. - * - * @param \PayPal\Api\OverrideChargeModel $overrideChargeModel - * @return $this - */ - public function addOverrideChargeModel($overrideChargeModel) - { - if (!$this->getOverrideChargeModels()) { - return $this->setOverrideChargeModels(array($overrideChargeModel)); - } else { - return $this->setOverrideChargeModels( - array_merge($this->getOverrideChargeModels(), array($overrideChargeModel)) - ); - } - } - - /** - * Remove OverrideChargeModels from the list. - * - * @param \PayPal\Api\OverrideChargeModel $overrideChargeModel - * @return $this - */ - public function removeOverrideChargeModel($overrideChargeModel) - { - return $this->setOverrideChargeModels( - array_diff($this->getOverrideChargeModels(), array($overrideChargeModel)) - ); - } - - /** - * Plan details for this agreement. - * - * @param \PayPal\Api\Plan $plan - * - * @return $this - */ - public function setPlan($plan) - { - $this->plan = $plan; - return $this; - } - - /** - * Plan details for this agreement. - * - * @return \PayPal\Api\Plan - */ - public function getPlan() - { - return $this->plan; - } - - /** - * Date and time that this resource was created. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $create_time - * - * @return $this - */ - public function setCreateTime($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Date and time that this resource was created. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getCreateTime() - { - return $this->create_time; - } - - /** - * Date and time that this resource was updated. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $update_time - * - * @return $this - */ - public function setUpdateTime($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Date and time that this resource was updated. Date format yyyy-MM-dd z, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getUpdateTime() - { - return $this->update_time; - } - - /** - * Agreement Details - * - * @param \PayPal\Api\AgreementDetails $agreement_details - * - * @return $this - */ - public function setAgreementDetails($agreement_details) - { - $this->agreement_details = $agreement_details; - return $this; - } - - /** - * Agreement Details - * - * @return \PayPal\Api\AgreementDetails - */ - public function getAgreementDetails() - { - return $this->agreement_details; - } - - /** - * Get Approval Link - * - * @return null|string - */ - public function getApprovalLink() - { - return $this->getLink(PayPalConstants::APPROVAL_URL); - } - - /** - * Create a new billing agreement by passing the details for the agreement, including the name, description, start date, payer, and billing plan in the request JSON. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Agreement - */ - public function create($apiContext = null, $restCall = null) - { - $payLoad = $this->toJSON(); - $json = self::executeCall( - "/v1/payments/billing-agreements/", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Execute a billing agreement after buyer approval by passing the payment token to the request URI. - * - * @param $paymentToken - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Agreement - */ - public function execute($paymentToken, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($paymentToken, 'paymentToken'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/billing-agreements/$paymentToken/agreement-execute", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Retrieve details for a particular billing agreement by passing the ID of the agreement to the request URI. - * - * @param string $agreementId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Agreement - */ - public static function get($agreementId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($agreementId, 'agreementId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/billing-agreements/$agreementId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Agreement(); - $ret->fromJson($json); - return $ret; - } - - /** - * Update details of a billing agreement, such as the description, shipping address, and start date, by passing the ID of the agreement to the request URI. - * - * @param PatchRequest $patchRequest - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function update($patchRequest, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($patchRequest, 'patchRequest'); - $payLoad = $patchRequest->toJSON(); - self::executeCall( - "/v1/payments/billing-agreements/{$this->getId()}", - "PATCH", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Suspend a particular billing agreement by passing the ID of the agreement to the request URI. - * - * @param AgreementStateDescriptor $agreementStateDescriptor - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function suspend($agreementStateDescriptor, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($agreementStateDescriptor, 'agreementStateDescriptor'); - $payLoad = $agreementStateDescriptor->toJSON(); - self::executeCall( - "/v1/payments/billing-agreements/{$this->getId()}/suspend", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Reactivate a suspended billing agreement by passing the ID of the agreement to the appropriate URI. In addition, pass an agreement_state_descriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement. - * - * @param AgreementStateDescriptor $agreementStateDescriptor - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function reActivate($agreementStateDescriptor, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($agreementStateDescriptor, 'agreementStateDescriptor'); - $payLoad = $agreementStateDescriptor->toJSON(); - self::executeCall( - "/v1/payments/billing-agreements/{$this->getId()}/re-activate", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Cancel a billing agreement by passing the ID of the agreement to the request URI. In addition, pass an agreement_state_descriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement. - * - * @param AgreementStateDescriptor $agreementStateDescriptor - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function cancel($agreementStateDescriptor, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($agreementStateDescriptor, 'agreementStateDescriptor'); - $payLoad = $agreementStateDescriptor->toJSON(); - self::executeCall( - "/v1/payments/billing-agreements/{$this->getId()}/cancel", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Bill an outstanding amount for an agreement by passing the ID of the agreement to the request URI. In addition, pass an agreement_state_descriptor object in the request JSON that includes a note about the reason for changing the state of the agreement and the amount and currency for the agreement. - * - * @param AgreementStateDescriptor $agreementStateDescriptor - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function billBalance($agreementStateDescriptor, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($agreementStateDescriptor, 'agreementStateDescriptor'); - $payLoad = $agreementStateDescriptor->toJSON(); - self::executeCall( - "/v1/payments/billing-agreements/{$this->getId()}/bill-balance", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Set the balance for an agreement by passing the ID of the agreement to the request URI. In addition, pass a common_currency object in the request JSON that specifies the currency type and value of the balance. - * - * @param Currency $currency - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function setBalance($currency, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($currency, 'currency'); - $payLoad = $currency->toJSON(); - self::executeCall( - "/v1/payments/billing-agreements/{$this->getId()}/set-balance", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * List transactions for a billing agreement by passing the ID of the agreement, as well as the start and end dates of the range of transactions to list, to the request URI. - * - * @deprecated Please use searchTransactions Instead - * @param string $agreementId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return AgreementTransactions - */ - public static function transactions($agreementId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($agreementId, 'agreementId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/billing-agreements/$agreementId/transactions", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new AgreementTransactions(); - $ret->fromJson($json); - return $ret; - } - - /** - * List transactions for a billing agreement by passing the ID of the agreement, as well as the start and end dates of the range of transactions to list, to the request URI. - * - * @param string $agreementId - * @param array $params Parameters for search string. Options: start_date, and end_date - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return AgreementTransactions - */ - public static function searchTransactions($agreementId, $params = array(), $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($agreementId, 'agreementId'); - ArgumentValidator::validate($params, 'params'); - - $allowedParams = array( - 'start_date' => 1, - 'end_date' => 1, - ); - - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/billing-agreements/$agreementId/transactions?" . http_build_query(array_intersect_key($params, $allowedParams)), - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new AgreementTransactions(); - $ret->fromJson($json); - return $ret; - } - -} diff --git a/paypal/PayPal/Api/AgreementDetails.php b/paypal/PayPal/Api/AgreementDetails.php deleted file mode 100644 index 94e90cd..0000000 --- a/paypal/PayPal/Api/AgreementDetails.php +++ /dev/null @@ -1,209 +0,0 @@ -outstanding_balance = $outstanding_balance; - return $this; - } - - /** - * The outstanding balance for this agreement. - * - * @return \PayPal\Api\Currency - */ - public function getOutstandingBalance() - { - return $this->outstanding_balance; - } - - /** - * Number of cycles remaining for this agreement. - * - * @param string $cycles_remaining - * - * @return $this - */ - public function setCyclesRemaining($cycles_remaining) - { - $this->cycles_remaining = $cycles_remaining; - return $this; - } - - /** - * Number of cycles remaining for this agreement. - * - * @return string - */ - public function getCyclesRemaining() - { - return $this->cycles_remaining; - } - - /** - * Number of cycles completed for this agreement. - * - * @param string $cycles_completed - * - * @return $this - */ - public function setCyclesCompleted($cycles_completed) - { - $this->cycles_completed = $cycles_completed; - return $this; - } - - /** - * Number of cycles completed for this agreement. - * - * @return string - */ - public function getCyclesCompleted() - { - return $this->cycles_completed; - } - - /** - * The next billing date for this agreement, represented as 2014-02-19T10:00:00Z format. - * - * @param string $next_billing_date - * - * @return $this - */ - public function setNextBillingDate($next_billing_date) - { - $this->next_billing_date = $next_billing_date; - return $this; - } - - /** - * The next billing date for this agreement, represented as 2014-02-19T10:00:00Z format. - * - * @return string - */ - public function getNextBillingDate() - { - return $this->next_billing_date; - } - - /** - * Last payment date for this agreement, represented as 2014-06-09T09:42:31Z format. - * - * @param string $last_payment_date - * - * @return $this - */ - public function setLastPaymentDate($last_payment_date) - { - $this->last_payment_date = $last_payment_date; - return $this; - } - - /** - * Last payment date for this agreement, represented as 2014-06-09T09:42:31Z format. - * - * @return string - */ - public function getLastPaymentDate() - { - return $this->last_payment_date; - } - - /** - * Last payment amount for this agreement. - * - * @param \PayPal\Api\Currency $last_payment_amount - * - * @return $this - */ - public function setLastPaymentAmount($last_payment_amount) - { - $this->last_payment_amount = $last_payment_amount; - return $this; - } - - /** - * Last payment amount for this agreement. - * - * @return \PayPal\Api\Currency - */ - public function getLastPaymentAmount() - { - return $this->last_payment_amount; - } - - /** - * Last payment date for this agreement, represented as 2015-02-19T10:00:00Z format. - * - * @param string $final_payment_date - * - * @return $this - */ - public function setFinalPaymentDate($final_payment_date) - { - $this->final_payment_date = $final_payment_date; - return $this; - } - - /** - * Last payment date for this agreement, represented as 2015-02-19T10:00:00Z format. - * - * @return string - */ - public function getFinalPaymentDate() - { - return $this->final_payment_date; - } - - /** - * Total number of failed payments for this agreement. - * - * @param string $failed_payment_count - * - * @return $this - */ - public function setFailedPaymentCount($failed_payment_count) - { - $this->failed_payment_count = $failed_payment_count; - return $this; - } - - /** - * Total number of failed payments for this agreement. - * - * @return string - */ - public function getFailedPaymentCount() - { - return $this->failed_payment_count; - } - -} diff --git a/paypal/PayPal/Api/AgreementStateDescriptor.php b/paypal/PayPal/Api/AgreementStateDescriptor.php deleted file mode 100644 index 619da31..0000000 --- a/paypal/PayPal/Api/AgreementStateDescriptor.php +++ /dev/null @@ -1,65 +0,0 @@ -note = $note; - return $this; - } - - /** - * Reason for changing the state of the agreement. - * - * @return string - */ - public function getNote() - { - return $this->note; - } - - /** - * The amount and currency of the agreement. - * - * @param \PayPal\Api\Currency $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * The amount and currency of the agreement. - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - -} diff --git a/paypal/PayPal/Api/AgreementTransaction.php b/paypal/PayPal/Api/AgreementTransaction.php deleted file mode 100644 index 12cad0e..0000000 --- a/paypal/PayPal/Api/AgreementTransaction.php +++ /dev/null @@ -1,257 +0,0 @@ -transaction_id = $transaction_id; - return $this; - } - - /** - * Id corresponding to this transaction. - * - * @return string - */ - public function getTransactionId() - { - return $this->transaction_id; - } - - /** - * State of the subscription at this time. - * - * @param string $status - * - * @return $this - */ - public function setStatus($status) - { - $this->status = $status; - return $this; - } - - /** - * State of the subscription at this time. - * - * @return string - */ - public function getStatus() - { - return $this->status; - } - - /** - * Type of transaction, usually Recurring Payment. - * - * @param string $transaction_type - * - * @return $this - */ - public function setTransactionType($transaction_type) - { - $this->transaction_type = $transaction_type; - return $this; - } - - /** - * Type of transaction, usually Recurring Payment. - * - * @return string - */ - public function getTransactionType() - { - return $this->transaction_type; - } - - /** - * Amount for this transaction. - * - * @param \PayPal\Api\Currency $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * Amount for this transaction. - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Fee amount for this transaction. - * - * @param \PayPal\Api\Currency $fee_amount - * - * @return $this - */ - public function setFeeAmount($fee_amount) - { - $this->fee_amount = $fee_amount; - return $this; - } - - /** - * Fee amount for this transaction. - * - * @return \PayPal\Api\Currency - */ - public function getFeeAmount() - { - return $this->fee_amount; - } - - /** - * Net amount for this transaction. - * - * @param \PayPal\Api\Currency $net_amount - * - * @return $this - */ - public function setNetAmount($net_amount) - { - $this->net_amount = $net_amount; - return $this; - } - - /** - * Net amount for this transaction. - * - * @return \PayPal\Api\Currency - */ - public function getNetAmount() - { - return $this->net_amount; - } - - /** - * Email id of payer. - * - * @param string $payer_email - * - * @return $this - */ - public function setPayerEmail($payer_email) - { - $this->payer_email = $payer_email; - return $this; - } - - /** - * Email id of payer. - * - * @return string - */ - public function getPayerEmail() - { - return $this->payer_email; - } - - /** - * Business name of payer. - * - * @param string $payer_name - * - * @return $this - */ - public function setPayerName($payer_name) - { - $this->payer_name = $payer_name; - return $this; - } - - /** - * Business name of payer. - * - * @return string - */ - public function getPayerName() - { - return $this->payer_name; - } - - /** - * Time at which this transaction happened. - * - * @param string $time_stamp - * - * @return $this - */ - public function setTimeStamp($time_stamp) - { - $this->time_stamp = $time_stamp; - return $this; - } - - /** - * Time at which this transaction happened. - * - * @return string - */ - public function getTimeStamp() - { - return $this->time_stamp; - } - - /** - * Time zone of time_updated field. - * - * @param string $time_zone - * - * @return $this - */ - public function setTimeZone($time_zone) - { - $this->time_zone = $time_zone; - return $this; - } - - /** - * Time zone of time_updated field. - * - * @return string - */ - public function getTimeZone() - { - return $this->time_zone; - } - -} diff --git a/paypal/PayPal/Api/AgreementTransactions.php b/paypal/PayPal/Api/AgreementTransactions.php deleted file mode 100644 index 30d4527..0000000 --- a/paypal/PayPal/Api/AgreementTransactions.php +++ /dev/null @@ -1,71 +0,0 @@ -agreement_transaction_list = $agreement_transaction_list; - return $this; - } - - /** - * Array of agreement_transaction object. - * - * @return \PayPal\Api\AgreementTransaction[] - */ - public function getAgreementTransactionList() - { - return $this->agreement_transaction_list; - } - - /** - * Append AgreementTransactionList to the list. - * - * @param \PayPal\Api\AgreementTransaction $agreementTransaction - * @return $this - */ - public function addAgreementTransactionList($agreementTransaction) - { - if (!$this->getAgreementTransactionList()) { - return $this->setAgreementTransactionList(array($agreementTransaction)); - } else { - return $this->setAgreementTransactionList( - array_merge($this->getAgreementTransactionList(), array($agreementTransaction)) - ); - } - } - - /** - * Remove AgreementTransactionList from the list. - * - * @param \PayPal\Api\AgreementTransaction $agreementTransaction - * @return $this - */ - public function removeAgreementTransactionList($agreementTransaction) - { - return $this->setAgreementTransactionList( - array_diff($this->getAgreementTransactionList(), array($agreementTransaction)) - ); - } - -} diff --git a/paypal/PayPal/Api/AlternatePayment.php b/paypal/PayPal/Api/AlternatePayment.php deleted file mode 100644 index 7999c5f..0000000 --- a/paypal/PayPal/Api/AlternatePayment.php +++ /dev/null @@ -1,91 +0,0 @@ -alternate_payment_account_id = $alternate_payment_account_id; - return $this; - } - - /** - * The unique identifier of the alternate payment account. - * - * @return string - */ - public function getAlternatePaymentAccountId() - { - return $this->alternate_payment_account_id; - } - - /** - * The unique identifier of the payer - * - * @param string $external_customer_id - * - * @return $this - */ - public function setExternalCustomerId($external_customer_id) - { - $this->external_customer_id = $external_customer_id; - return $this; - } - - /** - * The unique identifier of the payer - * - * @return string - */ - public function getExternalCustomerId() - { - return $this->external_customer_id; - } - - /** - * Alternate Payment provider id. This is an optional attribute needed only for certain alternate providers e.g Ideal - * - * @param string $alternate_payment_provider_id - * - * @return $this - */ - public function setAlternatePaymentProviderId($alternate_payment_provider_id) - { - $this->alternate_payment_provider_id = $alternate_payment_provider_id; - return $this; - } - - /** - * Alternate Payment provider id. This is an optional attribute needed only for certain alternate providers e.g Ideal - * - * @return string - */ - public function getAlternatePaymentProviderId() - { - return $this->alternate_payment_provider_id; - } - -} diff --git a/paypal/PayPal/Api/Amount.php b/paypal/PayPal/Api/Amount.php deleted file mode 100644 index 82fd6c8..0000000 --- a/paypal/PayPal/Api/Amount.php +++ /dev/null @@ -1,93 +0,0 @@ -currency = $currency; - return $this; - } - - /** - * 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). PayPal does not support all currencies. - * - * @return string - */ - public function getCurrency() - { - return $this->currency; - } - - /** - * Total amount charged from the payer to the payee. In case of a refund, this is the refunded amount to the original payer from the payee. 10 characters max with support for 2 decimal places. - * - * @param string|double $total - * - * @return $this - */ - public function setTotal($total) - { - NumericValidator::validate($total, "Total"); - $total = FormatConverter::formatToPrice($total, $this->getCurrency()); - $this->total = $total; - return $this; - } - - /** - * Total amount charged from the payer to the payee. In case of a refund, this is the refunded amount to the original payer from the payee. 10 characters max with support for 2 decimal places. - * - * @return string - */ - public function getTotal() - { - return $this->total; - } - - /** - * Additional details of the payment amount. - * - * @param \PayPal\Api\Details $details - * - * @return $this - */ - public function setDetails($details) - { - $this->details = $details; - return $this; - } - - /** - * Additional details of the payment amount. - * - * @return \PayPal\Api\Details - */ - public function getDetails() - { - return $this->details; - } - -} diff --git a/paypal/PayPal/Api/Authorization.php b/paypal/PayPal/Api/Authorization.php deleted file mode 100644 index 5da9d45..0000000 --- a/paypal/PayPal/Api/Authorization.php +++ /dev/null @@ -1,507 +0,0 @@ -id = $id; - return $this; - } - - /** - * ID of the authorization transaction. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Amount being authorized. - * - * @param \PayPal\Api\Amount $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * Amount being authorized. - * - * @return \PayPal\Api\Amount - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Specifies the payment mode of the transaction. - * Valid Values: ["INSTANT_TRANSFER"] - * - * @param string $payment_mode - * - * @return $this - */ - public function setPaymentMode($payment_mode) - { - $this->payment_mode = $payment_mode; - return $this; - } - - /** - * Specifies the payment mode of the transaction. - * - * @return string - */ - public function getPaymentMode() - { - return $this->payment_mode; - } - - /** - * State of the authorization. - * Valid Values: ["pending", "authorized", "partially_captured", "captured", "expired", "voided"] - * - * @param string $state - * - * @return $this - */ - public function setState($state) - { - $this->state = $state; - return $this; - } - - /** - * State of the authorization. - * - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Reason code, `AUTHORIZATION`, for a transaction state of `pending`. - * Valid Values: ["AUTHORIZATION"] - * - * @param string $reason_code - * - * @return $this - */ - public function setReasonCode($reason_code) - { - $this->reason_code = $reason_code; - return $this; - } - - /** - * Reason code, `AUTHORIZATION`, for a transaction state of `pending`. - * - * @return string - */ - public function getReasonCode() - { - return $this->reason_code; - } - - /** - * [DEPRECATED] Reason code for the transaction state being Pending.Obsolete. use reason_code field instead. - * Valid Values: ["AUTHORIZATION"] - * - * @param string $pending_reason - * - * @return $this - */ - public function setPendingReason($pending_reason) - { - $this->pending_reason = $pending_reason; - return $this; - } - - /** - * @deprecated [DEPRECATED] Reason code for the transaction state being Pending.Obsolete. use reason_code field instead. - * - * @return string - */ - public function getPendingReason() - { - return $this->pending_reason; - } - - /** - * The level of seller protection in force for the transaction. Only supported when the `payment_method` is set to `paypal`. Allowed values:
`ELIGIBLE`- Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received.
`PARTIALLY_ELIGIBLE`- Merchant is protected by PayPal's Seller Protection Policy for Item Not Received or Unauthorized Payments. Refer to `protection_eligibility_type` for specifics.
`INELIGIBLE`- Merchant is not protected under the Seller Protection Policy. - * Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"] - * - * @param string $protection_eligibility - * - * @return $this - */ - public function setProtectionEligibility($protection_eligibility) - { - $this->protection_eligibility = $protection_eligibility; - return $this; - } - - /** - * The level of seller protection in force for the transaction. Only supported when the `payment_method` is set to `paypal`. Allowed values:
`ELIGIBLE`- Merchant is protected by PayPal's Seller Protection Policy for Unauthorized Payments and Item Not Received.
`PARTIALLY_ELIGIBLE`- Merchant is protected by PayPal's Seller Protection Policy for Item Not Received or Unauthorized Payments. Refer to `protection_eligibility_type` for specifics.
`INELIGIBLE`- Merchant is not protected under the Seller Protection Policy. - * - * @return string - */ - public function getProtectionEligibility() - { - return $this->protection_eligibility; - } - - /** - * The kind of seller protection in force for the transaction. This property is returned only when the `protection_eligibility` property is set to `ELIGIBLE`or `PARTIALLY_ELIGIBLE`. Only supported when the `payment_method` is set to `paypal`. Allowed values:
`ITEM_NOT_RECEIVED_ELIGIBLE`- Sellers are protected against claims for items not received.
`UNAUTHORIZED_PAYMENT_ELIGIBLE`- Sellers are protected against claims for unauthorized payments.
One or both of the allowed values can be returned. - * Valid Values: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"] - * - * @param string $protection_eligibility_type - * - * @return $this - */ - public function setProtectionEligibilityType($protection_eligibility_type) - { - $this->protection_eligibility_type = $protection_eligibility_type; - return $this; - } - - /** - * The kind of seller protection in force for the transaction. This property is returned only when the `protection_eligibility` property is set to `ELIGIBLE`or `PARTIALLY_ELIGIBLE`. Only supported when the `payment_method` is set to `paypal`. Allowed values:
`ITEM_NOT_RECEIVED_ELIGIBLE`- Sellers are protected against claims for items not received.
`UNAUTHORIZED_PAYMENT_ELIGIBLE`- Sellers are protected against claims for unauthorized payments.
One or both of the allowed values can be returned. - * - * @return string - */ - public function getProtectionEligibilityType() - { - return $this->protection_eligibility_type; - } - - /** - * Fraud Management Filter (FMF) details applied for the payment that could result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. See [Fraud Management Filters Summary](https://developer.paypal.com/docs/classic/fmf/integration-guide/FMFSummary/) for more information. - * - * @param \PayPal\Api\FmfDetails $fmf_details - * - * @return $this - */ - public function setFmfDetails($fmf_details) - { - $this->fmf_details = $fmf_details; - return $this; - } - - /** - * Fraud Management Filter (FMF) details applied for the payment that could result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. See [Fraud Management Filters Summary](https://developer.paypal.com/docs/classic/fmf/integration-guide/FMFSummary/) for more information. - * - * @return \PayPal\Api\FmfDetails - */ - public function getFmfDetails() - { - return $this->fmf_details; - } - - /** - * ID of the Payment resource that this transaction is based on. - * - * @param string $parent_payment - * - * @return $this - */ - public function setParentPayment($parent_payment) - { - $this->parent_payment = $parent_payment; - return $this; - } - - /** - * ID of the Payment resource that this transaction is based on. - * - * @return string - */ - public function getParentPayment() - { - return $this->parent_payment; - } - - /** - * Response codes returned by the processor concerning the submitted payment. Only supported when the `payment_method` is set to `credit_card`. - * - * @param \PayPal\Api\ProcessorResponse $processor_response - * - * @return $this - */ - public function setProcessorResponse($processor_response) - { - $this->processor_response = $processor_response; - return $this; - } - - /** - * Response codes returned by the processor concerning the submitted payment. Only supported when the `payment_method` is set to `credit_card`. - * - * @return \PayPal\Api\ProcessorResponse - */ - public function getProcessorResponse() - { - return $this->processor_response; - } - - /** - * Authorization expiration time and date as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $valid_until - * - * @return $this - */ - public function setValidUntil($valid_until) - { - $this->valid_until = $valid_until; - return $this; - } - - /** - * Authorization expiration time and date as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getValidUntil() - { - return $this->valid_until; - } - - /** - * Time of authorization as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $create_time - * - * @return $this - */ - public function setCreateTime($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time of authorization as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getCreateTime() - { - return $this->create_time; - } - - /** - * Time that the resource was last updated. - * - * @param string $update_time - * - * @return $this - */ - public function setUpdateTime($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time that the resource was last updated. - * - * @return string - */ - public function getUpdateTime() - { - return $this->update_time; - } - - /** - * Identifier to the purchase or transaction unit corresponding to this authorization transaction. - * - * @param string $reference_id - * - * @return $this - */ - public function setReferenceId($reference_id) - { - $this->reference_id = $reference_id; - return $this; - } - - /** - * Identifier to the purchase or transaction unit corresponding to this authorization transaction. - * - * @return string - */ - public function getReferenceId() - { - return $this->reference_id; - } - - /** - * Receipt id is 16 digit number payment identification number returned for guest users to identify the payment. - * - * @param string $receipt_id - * - * @return $this - */ - public function setReceiptId($receipt_id) - { - $this->receipt_id = $receipt_id; - return $this; - } - - /** - * Receipt id is 16 digit number payment identification number returned for guest users to identify the payment. - * - * @return string - */ - public function getReceiptId() - { - return $this->receipt_id; - } - - /** - * Shows details for an authorization, by ID. - * - * @param string $authorizationId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Authorization - */ - public static function get($authorizationId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($authorizationId, 'authorizationId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/authorization/$authorizationId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Authorization(); - $ret->fromJson($json); - return $ret; - } - - /** - * Captures and processes an authorization, by ID. To use this call, the original payment call must specify an intent of `authorize`. - * - * @param Capture $capture - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Capture - */ - public function capture($capture, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($capture, 'capture'); - $payLoad = $capture->toJSON(); - $json = self::executeCall( - "/v1/payments/authorization/{$this->getId()}/capture", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Capture(); - $ret->fromJson($json); - return $ret; - } - - /** - * Voids, or cancels, an authorization, by ID. You cannot void a fully captured authorization. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Authorization - */ - public function void($apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/authorization/{$this->getId()}/void", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Reauthorizes a PayPal account payment, by authorization ID. To ensure that funds are still available, reauthorize a payment after the initial three-day honor period. Supports only the `amount` request parameter. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Authorization - */ - public function reauthorize($apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - $payLoad = $this->toJSON(); - $json = self::executeCall( - "/v1/payments/authorization/{$this->getId()}/reauthorize", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - -} diff --git a/paypal/PayPal/Api/BankAccount.php b/paypal/PayPal/Api/BankAccount.php deleted file mode 100644 index 1ac63cf..0000000 --- a/paypal/PayPal/Api/BankAccount.php +++ /dev/null @@ -1,629 +0,0 @@ -id = $id; - return $this; - } - - /** - * ID of the bank account being saved for later use. - * @deprecated Not publicly available - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Account number in either IBAN (max length 34) or BBAN (max length 17) format. - * - * @param string $account_number - * - * @return $this - */ - public function setAccountNumber($account_number) - { - $this->account_number = $account_number; - return $this; - } - - /** - * Account number in either IBAN (max length 34) or BBAN (max length 17) format. - * - * @return string - */ - public function getAccountNumber() - { - return $this->account_number; - } - - /** - * Type of the bank account number (International or Basic Bank Account Number). For more information refer to http://en.wikipedia.org/wiki/International_Bank_Account_Number. - * Valid Values: ["BBAN", "IBAN"] - * - * @param string $account_number_type - * - * @return $this - */ - public function setAccountNumberType($account_number_type) - { - $this->account_number_type = $account_number_type; - return $this; - } - - /** - * Type of the bank account number (International or Basic Bank Account Number). For more information refer to http://en.wikipedia.org/wiki/International_Bank_Account_Number. - * - * @return string - */ - public function getAccountNumberType() - { - return $this->account_number_type; - } - - /** - * Routing transit number (aka Bank Code) of the bank (typically for domestic use only - for international use, IBAN includes bank code). For more information refer to http://en.wikipedia.org/wiki/Bank_code. - * - * @param string $routing_number - * - * @return $this - */ - public function setRoutingNumber($routing_number) - { - $this->routing_number = $routing_number; - return $this; - } - - /** - * Routing transit number (aka Bank Code) of the bank (typically for domestic use only - for international use, IBAN includes bank code). For more information refer to http://en.wikipedia.org/wiki/Bank_code. - * - * @return string - */ - public function getRoutingNumber() - { - return $this->routing_number; - } - - /** - * Type of the bank account. - * Valid Values: ["CHECKING", "SAVINGS"] - * - * @param string $account_type - * - * @return $this - */ - public function setAccountType($account_type) - { - $this->account_type = $account_type; - return $this; - } - - /** - * Type of the bank account. - * - * @return string - */ - public function getAccountType() - { - return $this->account_type; - } - - /** - * A customer designated name. - * - * @param string $account_name - * - * @return $this - */ - public function setAccountName($account_name) - { - $this->account_name = $account_name; - return $this; - } - - /** - * A customer designated name. - * - * @return string - */ - public function getAccountName() - { - return $this->account_name; - } - - /** - * Type of the check when this information was obtained through a check by the facilitator or merchant. - * Valid Values: ["PERSONAL", "COMPANY"] - * - * @param string $check_type - * - * @return $this - */ - public function setCheckType($check_type) - { - $this->check_type = $check_type; - return $this; - } - - /** - * Type of the check when this information was obtained through a check by the facilitator or merchant. - * - * @return string - */ - public function getCheckType() - { - return $this->check_type; - } - - /** - * How the check was obtained from the customer, if check was the source of the information provided. - * Valid Values: ["CCD", "PPD", "TEL", "POP", "ARC", "RCK", "WEB"] - * - * @param string $auth_type - * - * @return $this - */ - public function setAuthType($auth_type) - { - $this->auth_type = $auth_type; - return $this; - } - - /** - * How the check was obtained from the customer, if check was the source of the information provided. - * - * @return string - */ - public function getAuthType() - { - return $this->auth_type; - } - - /** - * Time at which the authorization (or check) was captured. Use this field if the user authorization needs to be captured due to any privacy requirements. - * - * @param string $auth_capture_timestamp - * - * @return $this - */ - public function setAuthCaptureTimestamp($auth_capture_timestamp) - { - $this->auth_capture_timestamp = $auth_capture_timestamp; - return $this; - } - - /** - * Time at which the authorization (or check) was captured. Use this field if the user authorization needs to be captured due to any privacy requirements. - * - * @return string - */ - public function getAuthCaptureTimestamp() - { - return $this->auth_capture_timestamp; - } - - /** - * Name of the bank. - * - * @param string $bank_name - * - * @return $this - */ - public function setBankName($bank_name) - { - $this->bank_name = $bank_name; - return $this; - } - - /** - * Name of the bank. - * - * @return string - */ - public function getBankName() - { - return $this->bank_name; - } - - /** - * 2 letter country code of the Bank. - * - * @param string $country_code - * - * @return $this - */ - public function setCountryCode($country_code) - { - $this->country_code = $country_code; - return $this; - } - - /** - * 2 letter country code of the Bank. - * - * @return string - */ - public function getCountryCode() - { - return $this->country_code; - } - - /** - * Account holder's first name. - * - * @param string $first_name - * - * @return $this - */ - public function setFirstName($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * Account holder's first name. - * - * @return string - */ - public function getFirstName() - { - return $this->first_name; - } - - /** - * Account holder's last name. - * - * @param string $last_name - * - * @return $this - */ - public function setLastName($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * Account holder's last name. - * - * @return string - */ - public function getLastName() - { - return $this->last_name; - } - - /** - * Birth date of the bank account holder. - * - * @param string $birth_date - * - * @return $this - */ - public function setBirthDate($birth_date) - { - $this->birth_date = $birth_date; - return $this; - } - - /** - * Birth date of the bank account holder. - * - * @return string - */ - public function getBirthDate() - { - return $this->birth_date; - } - - /** - * Billing address. - * - * @param \PayPal\Api\Address $billing_address - * - * @return $this - */ - public function setBillingAddress($billing_address) - { - $this->billing_address = $billing_address; - return $this; - } - - /** - * Billing address. - * - * @return \PayPal\Api\Address - */ - public function getBillingAddress() - { - return $this->billing_address; - } - - /** - * State of this funding instrument. - * Valid Values: ["ACTIVE", "INACTIVE", "DELETED"] - * - * @param string $state - * - * @return $this - */ - public function setState($state) - { - $this->state = $state; - return $this; - } - - /** - * State of this funding instrument. - * - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Confirmation status of a bank account. - * Valid Values: ["UNCONFIRMED", "CONFIRMED"] - * - * @param string $confirmation_status - * - * @return $this - */ - public function setConfirmationStatus($confirmation_status) - { - $this->confirmation_status = $confirmation_status; - return $this; - } - - /** - * Confirmation status of a bank account. - * - * @return string - */ - public function getConfirmationStatus() - { - return $this->confirmation_status; - } - - /** - * [DEPRECATED] Use external_customer_id instead. - * - * @param string $payer_id - * - * @return $this - */ - public function setPayerId($payer_id) - { - $this->payer_id = $payer_id; - return $this; - } - - /** - * @deprecated [DEPRECATED] Use external_customer_id instead. - * - * @return string - */ - public function getPayerId() - { - return $this->payer_id; - } - - /** - * A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault. - * - * @param string $external_customer_id - * - * @return $this - */ - public function setExternalCustomerId($external_customer_id) - { - $this->external_customer_id = $external_customer_id; - return $this; - } - - /** - * A unique identifier of the customer to whom this bank account belongs to. Generated and provided by the facilitator. This is required when creating or using a stored funding instrument in vault. - * - * @return string - */ - public function getExternalCustomerId() - { - return $this->external_customer_id; - } - - /** - * A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant. - * - * @param string $merchant_id - * - * @return $this - */ - public function setMerchantId($merchant_id) - { - $this->merchant_id = $merchant_id; - return $this; - } - - /** - * A unique identifier of the merchant for which this bank account has been stored for. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant. - * - * @return string - */ - public function getMerchantId() - { - return $this->merchant_id; - } - - /** - * Time the resource was created. - * - * @param string $create_time - * - * @return $this - */ - public function setCreateTime($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time the resource was created. - * - * @return string - */ - public function getCreateTime() - { - return $this->create_time; - } - - /** - * Time the resource was last updated. - * - * @param string $update_time - * - * @return $this - */ - public function setUpdateTime($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time the resource was last updated. - * - * @return string - */ - public function getUpdateTime() - { - return $this->update_time; - } - - /** - * Date/Time until this resource can be used to fund a payment. - * - * @param string $valid_until - * - * @return $this - */ - public function setValidUntil($valid_until) - { - $this->valid_until = $valid_until; - return $this; - } - - /** - * Date/Time until this resource can be used to fund a payment. - * - * @return string - */ - public function getValidUntil() - { - return $this->valid_until; - } - - /** - * Sets Links - * - * @param \PayPal\Api\Links[] $links - * - * @return $this - */ - public function setLinks($links) - { - $this->links = $links; - return $this; - } - - /** - * Gets Links - * - * @return \PayPal\Api\Links[] - */ - public function getLinks() - { - return $this->links; - } - - /** - * Append Links to the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function addLink($links) - { - if (!$this->getLinks()) { - return $this->setLinks(array($links)); - } else { - return $this->setLinks( - array_merge($this->getLinks(), array($links)) - ); - } - } - - /** - * Remove Links from the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function removeLink($links) - { - return $this->setLinks( - array_diff($this->getLinks(), array($links)) - ); - } - -} diff --git a/paypal/PayPal/Api/BankAccountsList.php b/paypal/PayPal/Api/BankAccountsList.php deleted file mode 100644 index 9120941..0000000 --- a/paypal/PayPal/Api/BankAccountsList.php +++ /dev/null @@ -1,119 +0,0 @@ -{"bank-accounts"} = $bank_accounts; - return $this; - } - - /** - * A list of bank account resources - * - * @return \PayPal\Api\BankAccount[] - */ - public function getBankAccounts() - { - return $this->{"bank-accounts"}; - } - - /** - * Append BankAccounts to the list. - * - * @param \PayPal\Api\BankAccount $bankAccount - * @return $this - */ - public function addBankAccount($bankAccount) - { - if (!$this->getBankAccounts()) { - return $this->setBankAccounts(array($bankAccount)); - } else { - return $this->setBankAccounts( - array_merge($this->getBankAccounts(), array($bankAccount)) - ); - } - } - - /** - * Remove BankAccounts from the list. - * - * @param \PayPal\Api\BankAccount $bankAccount - * @return $this - */ - public function removeBankAccount($bankAccount) - { - return $this->setBankAccounts( - array_diff($this->getBankAccounts(), array($bankAccount)) - ); - } - - /** - * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. - * - * @param int $count - * - * @return $this - */ - public function setCount($count) - { - $this->count = $count; - return $this; - } - - /** - * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. - * - * @return int - */ - public function getCount() - { - return $this->count; - } - - /** - * Identifier of the next element to get the next range of results. - * - * @param string $next_id - * - * @return $this - */ - public function setNextId($next_id) - { - $this->next_id = $next_id; - return $this; - } - - /** - * Identifier of the next element to get the next range of results. - * - * @return string - */ - public function getNextId() - { - return $this->next_id; - } - -} diff --git a/paypal/PayPal/Api/BankToken.php b/paypal/PayPal/Api/BankToken.php deleted file mode 100644 index 6cbee49..0000000 --- a/paypal/PayPal/Api/BankToken.php +++ /dev/null @@ -1,89 +0,0 @@ -bank_id = $bank_id; - return $this; - } - - /** - * ID of a previously saved Bank resource using /vault/bank API. - * - * @return string - */ - public function getBankId() - { - return $this->bank_id; - } - - /** - * The unique identifier of the payer used when saving this bank using /vault/bank API. - * - * @param string $external_customer_id - * - * @return $this - */ - public function setExternalCustomerId($external_customer_id) - { - $this->external_customer_id = $external_customer_id; - return $this; - } - - /** - * The unique identifier of the payer used when saving this bank using /vault/bank API. - * - * @return string - */ - public function getExternalCustomerId() - { - return $this->external_customer_id; - } - - /** - * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). - * - * @param string $mandate_reference_number - * - * @return $this - */ - public function setMandateReferenceNumber($mandate_reference_number) - { - $this->mandate_reference_number = $mandate_reference_number; - return $this; - } - - /** - * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). - * - * @return string - */ - public function getMandateReferenceNumber() - { - return $this->mandate_reference_number; - } - -} diff --git a/paypal/PayPal/Api/BaseAddress.php b/paypal/PayPal/Api/BaseAddress.php deleted file mode 100644 index 41900f6..0000000 --- a/paypal/PayPal/Api/BaseAddress.php +++ /dev/null @@ -1,211 +0,0 @@ -line1 = $line1; - return $this; - } - - /** - * Line 1 of the Address (eg. number, street, etc). - * - * @return string - */ - public function getLine1() - { - return $this->line1; - } - - /** - * Optional line 2 of the Address (eg. suite, apt #, etc.). - * - * @param string $line2 - * - * @return $this - */ - public function setLine2($line2) - { - $this->line2 = $line2; - return $this; - } - - /** - * Optional line 2 of the Address (eg. suite, apt #, etc.). - * - * @return string - */ - public function getLine2() - { - return $this->line2; - } - - /** - * City name. - * - * @param string $city - * - * @return $this - */ - public function setCity($city) - { - $this->city = $city; - return $this; - } - - /** - * City name. - * - * @return string - */ - public function getCity() - { - return $this->city; - } - - /** - * 2 letter country code. - * - * @param string $country_code - * - * @return $this - */ - public function setCountryCode($country_code) - { - $this->country_code = $country_code; - return $this; - } - - /** - * 2 letter country code. - * - * @return string - */ - public function getCountryCode() - { - return $this->country_code; - } - - /** - * Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code. - * - * @param string $postal_code - * - * @return $this - */ - public function setPostalCode($postal_code) - { - $this->postal_code = $postal_code; - return $this; - } - - /** - * Zip code or equivalent is usually required for countries that have them. For list of countries that do not have postal codes please refer to http://en.wikipedia.org/wiki/Postal_code. - * - * @return string - */ - public function getPostalCode() - { - return $this->postal_code; - } - - /** - * 2 letter code for US states, and the equivalent for other countries. - * - * @param string $state - * - * @return $this - */ - public function setState($state) - { - $this->state = $state; - return $this; - } - - /** - * 2 letter code for US states, and the equivalent for other countries. - * - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Address normalization status - * Valid Values: ["UNKNOWN", "UNNORMALIZED_USER_PREFERRED", "NORMALIZED", "UNNORMALIZED"] - * - * @param string $normalization_status - * - * @return $this - */ - public function setNormalizationStatus($normalization_status) - { - $this->normalization_status = $normalization_status; - return $this; - } - - /** - * Address normalization status - * - * @return string - */ - public function getNormalizationStatus() - { - return $this->normalization_status; - } - - /** - * Address status - * Valid Values: ["CONFIRMED", "UNCONFIRMED"] - * - * @param string $status - * - * @return $this - */ - public function setStatus($status) - { - $this->status = $status; - return $this; - } - - /** - * Address status - * - * @return string - */ - public function getStatus() - { - return $this->status; - } - -} diff --git a/paypal/PayPal/Api/Billing.php b/paypal/PayPal/Api/Billing.php deleted file mode 100644 index 727f907..0000000 --- a/paypal/PayPal/Api/Billing.php +++ /dev/null @@ -1,43 +0,0 @@ -billing_agreement_id = $billing_agreement_id; - return $this; - } - - /** - * Identifier of the instrument in PayPal Wallet - * - * @return string - */ - public function getBillingAgreementId() - { - return $this->billing_agreement_id; - } - -} diff --git a/paypal/PayPal/Api/BillingAgreementToken.php b/paypal/PayPal/Api/BillingAgreementToken.php deleted file mode 100644 index ca5ef6b..0000000 --- a/paypal/PayPal/Api/BillingAgreementToken.php +++ /dev/null @@ -1,17 +0,0 @@ -email = $email; - return $this; - } - - /** - * The invoice recipient email address. Maximum length is 260 characters. - * - * @return string - */ - public function getEmail() - { - return $this->email; - } - - /** - * The invoice recipient first name. Maximum length is 30 characters. - * - * @param string $first_name - * - * @return $this - */ - public function setFirstName($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * The invoice recipient first name. Maximum length is 30 characters. - * - * @return string - */ - public function getFirstName() - { - return $this->first_name; - } - - /** - * The invoice recipient last name. Maximum length is 30 characters. - * - * @param string $last_name - * - * @return $this - */ - public function setLastName($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * The invoice recipient last name. Maximum length is 30 characters. - * - * @return string - */ - public function getLastName() - { - return $this->last_name; - } - - /** - * The invoice recipient company business name. Maximum length is 100 characters. - * - * @param string $business_name - * - * @return $this - */ - public function setBusinessName($business_name) - { - $this->business_name = $business_name; - return $this; - } - - /** - * The invoice recipient company business name. Maximum length is 100 characters. - * - * @return string - */ - public function getBusinessName() - { - return $this->business_name; - } - - /** - * The invoice recipient address. - * - * @param \PayPal\Api\InvoiceAddress $address - * - * @return $this - */ - public function setAddress($address) - { - $this->address = $address; - return $this; - } - - /** - * The invoice recipient address. - * - * @return \PayPal\Api\InvoiceAddress - */ - public function getAddress() - { - return $this->address; - } - - /** - * The language in which the email was sent to the payer. Used only when the payer does not have a PayPal account. - * Valid Values: ["da_DK", "de_DE", "en_AU", "en_GB", "en_US", "es_ES", "es_XC", "fr_CA", "fr_FR", "fr_XC", "he_IL", "id_ID", "it_IT", "ja_JP", "nl_NL", "no_NO", "pl_PL", "pt_BR", "pt_PT", "ru_RU", "sv_SE", "th_TH", "tr_TR", "zh_CN", "zh_HK", "zh_TW", "zh_XC"] - * - * @param string $language - * - * @return $this - */ - public function setLanguage($language) - { - $this->language = $language; - return $this; - } - - /** - * The language in which the email was sent to the payer. Used only when the payer does not have a PayPal account. - * - * @return string - */ - public function getLanguage() - { - return $this->language; - } - - /** - * Additional information, such as business hours. Maximum length is 40 characters. - * - * @param string $additional_info - * - * @return $this - */ - public function setAdditionalInfo($additional_info) - { - $this->additional_info = $additional_info; - return $this; - } - - /** - * Additional information, such as business hours. Maximum length is 40 characters. - * - * @return string - */ - public function getAdditionalInfo() - { - return $this->additional_info; - } - - /** - * Preferred notification channel of the payer. Email by default. - * Valid Values: ["SMS", "EMAIL"] - * - * @param string $notification_channel - * - * @return $this - */ - public function setNotificationChannel($notification_channel) - { - $this->notification_channel = $notification_channel; - return $this; - } - - /** - * Preferred notification channel of the payer. Email by default. - * - * @return string - */ - public function getNotificationChannel() - { - return $this->notification_channel; - } - - /** - * Mobile Phone number of the recipient to which SMS will be sent if notification_channel is SMS. - * - * @param \PayPal\Api\Phone $phone - * - * @return $this - */ - public function setPhone($phone) - { - $this->phone = $phone; - return $this; - } - - /** - * Mobile Phone number of the recipient to which SMS will be sent if notification_channel is SMS. - * - * @return \PayPal\Api\Phone - */ - public function getPhone() - { - return $this->phone; - } - -} diff --git a/paypal/PayPal/Api/CancelNotification.php b/paypal/PayPal/Api/CancelNotification.php deleted file mode 100644 index ccbea45..0000000 --- a/paypal/PayPal/Api/CancelNotification.php +++ /dev/null @@ -1,167 +0,0 @@ -subject = $subject; - return $this; - } - - /** - * Subject of the notification. - * - * @return string - */ - public function getSubject() - { - return $this->subject; - } - - /** - * Note to the payer. - * - * @param string $note - * - * @return $this - */ - public function setNote($note) - { - $this->note = $note; - return $this; - } - - /** - * Note to the payer. - * - * @return string - */ - public function getNote() - { - return $this->note; - } - - /** - * Indicates whether to send a copy of the notification to the merchant. - * - * @param bool $send_to_merchant - * - * @return $this - */ - public function setSendToMerchant($send_to_merchant) - { - $this->send_to_merchant = $send_to_merchant; - return $this; - } - - /** - * Indicates whether to send a copy of the notification to the merchant. - * - * @return bool - */ - public function getSendToMerchant() - { - return $this->send_to_merchant; - } - - /** - * Indicates whether to send a copy of the notification to the payer. - * - * @param bool $send_to_payer - * - * @return $this - */ - public function setSendToPayer($send_to_payer) - { - $this->send_to_payer = $send_to_payer; - return $this; - } - - /** - * Indicates whether to send a copy of the notification to the payer. - * - * @return bool - */ - public function getSendToPayer() - { - return $this->send_to_payer; - } - - /** - * Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported. - * - * @param string[] $cc_emails - * - * @return $this - */ - public function setCcEmails($cc_emails) - { - $this->cc_emails = $cc_emails; - return $this; - } - - /** - * Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported. - * - * @return string[] - */ - public function getCcEmails() - { - return $this->cc_emails; - } - - /** - * Append CcEmails to the list. - * - * @param string $string - * @return $this - */ - public function addCcEmail($string) - { - if (!$this->getCcEmails()) { - return $this->setCcEmails(array($string)); - } else { - return $this->setCcEmails( - array_merge($this->getCcEmails(), array($string)) - ); - } - } - - /** - * Remove CcEmails from the list. - * - * @param string $string - * @return $this - */ - public function removeCcEmail($string) - { - return $this->setCcEmails( - array_diff($this->getCcEmails(), array($string)) - ); - } - -} diff --git a/paypal/PayPal/Api/Capture.php b/paypal/PayPal/Api/Capture.php deleted file mode 100644 index 8358bfd..0000000 --- a/paypal/PayPal/Api/Capture.php +++ /dev/null @@ -1,341 +0,0 @@ -id = $id; - return $this; - } - - /** - * The ID of the capture transaction. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * The amount to capture. If the amount matches the orginally authorized amount, the state of the authorization changes to `captured`. If not, the state of the authorization changes to `partially_captured`. - * - * @param \PayPal\Api\Amount $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * The amount to capture. If the amount matches the orginally authorized amount, the state of the authorization changes to `captured`. If not, the state of the authorization changes to `partially_captured`. - * - * @return \PayPal\Api\Amount - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Indicates whether to release all remaining funds that the authorization holds in the funding instrument. Default is `false`. - * - * @param bool $is_final_capture - * - * @return $this - */ - public function setIsFinalCapture($is_final_capture) - { - $this->is_final_capture = $is_final_capture; - return $this; - } - - /** - * Indicates whether to release all remaining funds that the authorization holds in the funding instrument. Default is `false`. - * - * @return bool - */ - public function getIsFinalCapture() - { - return $this->is_final_capture; - } - - /** - * The state of the capture. - * Valid Values: ["pending", "completed", "refunded", "partially_refunded"] - * - * @param string $state - * - * @return $this - */ - public function setState($state) - { - $this->state = $state; - return $this; - } - - /** - * The state of the capture. - * - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * The reason code that describes why the transaction state is pending or reversed. - * Valid Values: ["CHARGEBACK", "GUARANTEE", "BUYER_COMPLAINT", "REFUND", "UNCONFIRMED_SHIPPING_ADDRESS", "ECHECK", "INTERNATIONAL_WITHDRAWAL", "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION", "PAYMENT_REVIEW", "REGULATORY_REVIEW", "UNILATERAL", "VERIFICATION_REQUIRED", "TRANSACTION_APPROVED_AWAITING_FUNDING"] - * - * @param string $reason_code - * - * @return $this - */ - public function setReasonCode($reason_code) - { - $this->reason_code = $reason_code; - return $this; - } - - /** - * The reason code that describes why the transaction state is pending or reversed. - * - * @return string - */ - public function getReasonCode() - { - return $this->reason_code; - } - - /** - * The ID of the payment on which this transaction is based. - * - * @param string $parent_payment - * - * @return $this - */ - public function setParentPayment($parent_payment) - { - $this->parent_payment = $parent_payment; - return $this; - } - - /** - * The ID of the payment on which this transaction is based. - * - * @return string - */ - public function getParentPayment() - { - return $this->parent_payment; - } - - /** - * The invoice number to track this payment. - * - * @param string $invoice_number - * - * @return $this - */ - public function setInvoiceNumber($invoice_number) - { - $this->invoice_number = $invoice_number; - return $this; - } - - /** - * The invoice number to track this payment. - * - * @return string - */ - public function getInvoiceNumber() - { - return $this->invoice_number; - } - - /** - * The transaction fee for this payment. - * - * @param \PayPal\Api\Currency $transaction_fee - * - * @return $this - */ - public function setTransactionFee($transaction_fee) - { - $this->transaction_fee = $transaction_fee; - return $this; - } - - /** - * The transaction fee for this payment. - * - * @return \PayPal\Api\Currency - */ - public function getTransactionFee() - { - return $this->transaction_fee; - } - - /** - * The date and time of capture, as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $create_time - * - * @return $this - */ - public function setCreateTime($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * The date and time of capture, as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getCreateTime() - { - return $this->create_time; - } - - /** - * The date and time when the resource was last updated. - * - * @param string $update_time - * - * @return $this - */ - public function setUpdateTime($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * The date and time when the resource was last updated. - * - * @return string - */ - public function getUpdateTime() - { - return $this->update_time; - } - - /** - * Shows details for a captured payment, by ID. - * - * @param string $captureId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Capture - */ - public static function get($captureId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($captureId, 'captureId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/capture/$captureId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Capture(); - $ret->fromJson($json); - return $ret; - } - - /** - * Refund a captured payment by passing the capture_id in the request URI. In addition, include an amount object in the body of the request JSON. - * - * @deprecated Please use #refundCapturedPayment instead. - * @param Refund $refund - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Refund - */ - public function refund($refund, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($refund, 'refund'); - $payLoad = $refund->toJSON(); - $json = self::executeCall( - "/v1/payments/capture/{$this->getId()}/refund", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Refund(); - $ret->fromJson($json); - return $ret; - } - - /** - * Refunds a captured payment, by ID. Include an `amount` object in the JSON request body. - * - * @param RefundRequest $refundRequest - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return DetailedRefund - */ - public function refundCapturedPayment($refundRequest, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($refundRequest, 'refundRequest'); - $payLoad = $refundRequest->toJSON(); - $json = self::executeCall( - "/v1/payments/capture/{$this->getId()}/refund", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new DetailedRefund(); - $ret->fromJson($json); - return $ret; - } - -} diff --git a/paypal/PayPal/Api/CarrierAccount.php b/paypal/PayPal/Api/CarrierAccount.php deleted file mode 100644 index 7f245b0..0000000 --- a/paypal/PayPal/Api/CarrierAccount.php +++ /dev/null @@ -1,138 +0,0 @@ -id = $id; - return $this; - } - - /** - * The ID of the carrier account of the payer. Use in subsequent REST API calls. For example, to make payments. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * The phone number of the payer, in E.164 format. - * - * @param string $phone_number - * - * @return $this - */ - public function setPhoneNumber($phone_number) - { - $this->phone_number = $phone_number; - return $this; - } - - /** - * The phone number of the payer, in E.164 format. - * - * @return string - */ - public function getPhoneNumber() - { - return $this->phone_number; - } - - /** - * The ID of the customer, as created by the merchant. - * - * @param string $external_customer_id - * - * @return $this - */ - public function setExternalCustomerId($external_customer_id) - { - $this->external_customer_id = $external_customer_id; - return $this; - } - - /** - * The ID of the customer, as created by the merchant. - * - * @return string - */ - public function getExternalCustomerId() - { - return $this->external_customer_id; - } - - /** - * The method used to obtain the phone number. Value is `READ_FROM_DEVICE` or `USER_PROVIDED`. - * Valid Values: ["READ_FROM_DEVICE", "USER_PROVIDED"] - * - * @param string $phone_source - * - * @return $this - */ - public function setPhoneSource($phone_source) - { - $this->phone_source = $phone_source; - return $this; - } - - /** - * The method used to obtain the phone number. Value is `READ_FROM_DEVICE` or `USER_PROVIDED`. - * - * @return string - */ - public function getPhoneSource() - { - return $this->phone_source; - } - - /** - * The ISO 3166-1 alpha-2 country code where the phone number is registered. - * - * @param \PayPal\Api\CountryCode $country_code - * - * @return $this - */ - public function setCountryCode($country_code) - { - $this->country_code = $country_code; - return $this; - } - - /** - * The ISO 3166-1 alpha-2 country code where the phone number is registered. - * - * @return \PayPal\Api\CountryCode - */ - public function getCountryCode() - { - return $this->country_code; - } - -} diff --git a/paypal/PayPal/Api/CarrierAccountToken.php b/paypal/PayPal/Api/CarrierAccountToken.php deleted file mode 100644 index 9fc987b..0000000 --- a/paypal/PayPal/Api/CarrierAccountToken.php +++ /dev/null @@ -1,65 +0,0 @@ -carrier_account_id = $carrier_account_id; - return $this; - } - - /** - * ID of a previously saved carrier account resource. - * - * @return string - */ - public function getCarrierAccountId() - { - return $this->carrier_account_id; - } - - /** - * The unique identifier of the payer used when saving this carrier account instrument. - * - * @param string $external_customer_id - * - * @return $this - */ - public function setExternalCustomerId($external_customer_id) - { - $this->external_customer_id = $external_customer_id; - return $this; - } - - /** - * The unique identifier of the payer used when saving this carrier account instrument. - * - * @return string - */ - public function getExternalCustomerId() - { - return $this->external_customer_id; - } - -} diff --git a/paypal/PayPal/Api/CartBase.php b/paypal/PayPal/Api/CartBase.php deleted file mode 100644 index 1f7ef1e..0000000 --- a/paypal/PayPal/Api/CartBase.php +++ /dev/null @@ -1,408 +0,0 @@ -reference_id = $reference_id; - return $this; - } - - /** - * Merchant identifier to the purchase unit. Optional parameter - * - * @return string - */ - public function getReferenceId() - { - return $this->reference_id; - } - - /** - * Amount being collected. - * - * @param \PayPal\Api\Amount $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * Amount being collected. - * - * @return \PayPal\Api\Amount - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Recipient of the funds in this transaction. - * - * @param \PayPal\Api\Payee $payee - * - * @return $this - */ - public function setPayee($payee) - { - $this->payee = $payee; - return $this; - } - - /** - * Recipient of the funds in this transaction. - * - * @return \PayPal\Api\Payee - */ - public function getPayee() - { - return $this->payee; - } - - /** - * Description of what is being paid for. - * - * @param string $description - * - * @return $this - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * Description of what is being paid for. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Note to the recipient of the funds in this transaction. - * - * @param string $note_to_payee - * - * @return $this - */ - public function setNoteToPayee($note_to_payee) - { - $this->note_to_payee = $note_to_payee; - return $this; - } - - /** - * Note to the recipient of the funds in this transaction. - * - * @return string - */ - public function getNoteToPayee() - { - return $this->note_to_payee; - } - - /** - * free-form field for the use of clients - * - * @param string $custom - * - * @return $this - */ - public function setCustom($custom) - { - $this->custom = $custom; - return $this; - } - - /** - * free-form field for the use of clients - * - * @return string - */ - public function getCustom() - { - return $this->custom; - } - - /** - * invoice number to track this payment - * - * @param string $invoice_number - * - * @return $this - */ - public function setInvoiceNumber($invoice_number) - { - $this->invoice_number = $invoice_number; - return $this; - } - - /** - * invoice number to track this payment - * - * @return string - */ - public function getInvoiceNumber() - { - return $this->invoice_number; - } - - /** - * purchase order is number or id specific to this payment - * - * @param string $purchase_order - * - * @return $this - */ - public function setPurchaseOrder($purchase_order) - { - $this->purchase_order = $purchase_order; - return $this; - } - - /** - * purchase order is number or id specific to this payment - * - * @return string - */ - public function getPurchaseOrder() - { - return $this->purchase_order; - } - - /** - * Soft descriptor used when charging this funding source. If length exceeds max length, the value will be truncated - * - * @param string $soft_descriptor - * - * @return $this - */ - public function setSoftDescriptor($soft_descriptor) - { - $this->soft_descriptor = $soft_descriptor; - return $this; - } - - /** - * Soft descriptor used when charging this funding source. If length exceeds max length, the value will be truncated - * - * @return string - */ - public function getSoftDescriptor() - { - return $this->soft_descriptor; - } - - /** - * Soft descriptor city used when charging this funding source. If length exceeds max length, the value will be truncated. Only supported when the `payment_method` is set to `credit_card` - * @deprecated Not publicly available - * @param string $soft_descriptor_city - * - * @return $this - */ - public function setSoftDescriptorCity($soft_descriptor_city) - { - $this->soft_descriptor_city = $soft_descriptor_city; - return $this; - } - - /** - * Soft descriptor city used when charging this funding source. If length exceeds max length, the value will be truncated. Only supported when the `payment_method` is set to `credit_card` - * @deprecated Not publicly available - * @return string - */ - public function getSoftDescriptorCity() - { - return $this->soft_descriptor_city; - } - - /** - * Payment options requested for this purchase unit - * - * @param \PayPal\Api\PaymentOptions $payment_options - * - * @return $this - */ - public function setPaymentOptions($payment_options) - { - $this->payment_options = $payment_options; - return $this; - } - - /** - * Payment options requested for this purchase unit - * - * @return \PayPal\Api\PaymentOptions - */ - public function getPaymentOptions() - { - return $this->payment_options; - } - - /** - * List of items being paid for. - * - * @param \PayPal\Api\ItemList $item_list - * - * @return $this - */ - public function setItemList($item_list) - { - $this->item_list = $item_list; - return $this; - } - - /** - * List of items being paid for. - * - * @return \PayPal\Api\ItemList - */ - public function getItemList() - { - return $this->item_list; - } - - /** - * URL to send payment notifications - * - * @param string $notify_url - * @throws \InvalidArgumentException - * @return $this - */ - public function setNotifyUrl($notify_url) - { - UrlValidator::validate($notify_url, "NotifyUrl"); - $this->notify_url = $notify_url; - return $this; - } - - /** - * URL to send payment notifications - * - * @return string - */ - public function getNotifyUrl() - { - return $this->notify_url; - } - - /** - * Url on merchant site pertaining to this payment. - * - * @param string $order_url - * @throws \InvalidArgumentException - * @return $this - */ - public function setOrderUrl($order_url) - { - UrlValidator::validate($order_url, "OrderUrl"); - $this->order_url = $order_url; - return $this; - } - - /** - * Url on merchant site pertaining to this payment. - * - * @return string - */ - public function getOrderUrl() - { - return $this->order_url; - } - - /** - * List of external funding being applied to the purchase unit. Each external_funding unit should have a unique reference_id - * @deprecated Not publicly available - * @param \PayPal\Api\ExternalFunding[] $external_funding - * - * @return $this - */ - public function setExternalFunding($external_funding) - { - $this->external_funding = $external_funding; - return $this; - } - - /** - * List of external funding being applied to the purchase unit. Each external_funding unit should have a unique reference_id - * @deprecated Not publicly available - * @return \PayPal\Api\ExternalFunding[] - */ - public function getExternalFunding() - { - return $this->external_funding; - } - - /** - * Append ExternalFunding to the list. - * @deprecated Not publicly available - * @param \PayPal\Api\ExternalFunding $externalFunding - * @return $this - */ - public function addExternalFunding($externalFunding) - { - if (!$this->getExternalFunding()) { - return $this->setExternalFunding(array($externalFunding)); - } else { - return $this->setExternalFunding( - array_merge($this->getExternalFunding(), array($externalFunding)) - ); - } - } - - /** - * Remove ExternalFunding from the list. - * @deprecated Not publicly available - * @param \PayPal\Api\ExternalFunding $externalFunding - * @return $this - */ - public function removeExternalFunding($externalFunding) - { - return $this->setExternalFunding( - array_diff($this->getExternalFunding(), array($externalFunding)) - ); - } - -} diff --git a/paypal/PayPal/Api/ChargeModel.php b/paypal/PayPal/Api/ChargeModel.php deleted file mode 100644 index de486fe..0000000 --- a/paypal/PayPal/Api/ChargeModel.php +++ /dev/null @@ -1,89 +0,0 @@ -id = $id; - return $this; - } - - /** - * Identifier of the charge model. 128 characters max. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Type of charge model. Allowed values: `SHIPPING`, `TAX`. - * - * @param string $type - * - * @return $this - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * Type of charge model. Allowed values: `SHIPPING`, `TAX`. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Specific amount for this charge model. - * - * @param \PayPal\Api\Currency $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * Specific amount for this charge model. - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - -} diff --git a/paypal/PayPal/Api/Cost.php b/paypal/PayPal/Api/Cost.php deleted file mode 100644 index 5a96fba..0000000 --- a/paypal/PayPal/Api/Cost.php +++ /dev/null @@ -1,69 +0,0 @@ -percent = $percent; - return $this; - } - - /** - * Cost in percent. Range of 0 to 100. - * - * @return string - */ - public function getPercent() - { - return $this->percent; - } - - /** - * The cost, as an amount. Valid range is from 0 to 1,000,000. - * - * @param \PayPal\Api\Currency $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * The cost, as an amount. Valid range is from 0 to 1,000,000. - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - -} diff --git a/paypal/PayPal/Api/CountryCode.php b/paypal/PayPal/Api/CountryCode.php deleted file mode 100644 index 48ef51d..0000000 --- a/paypal/PayPal/Api/CountryCode.php +++ /dev/null @@ -1,41 +0,0 @@ -country_code = $country_code; - return $this; - } - - /** - * ISO country code based on 2-character IS0-3166-1 codes. - * - * @return string - */ - public function getCountryCode() - { - return $this->country_code; - } - -} diff --git a/paypal/PayPal/Api/CreateProfileResponse.php b/paypal/PayPal/Api/CreateProfileResponse.php deleted file mode 100644 index 1b36faf..0000000 --- a/paypal/PayPal/Api/CreateProfileResponse.php +++ /dev/null @@ -1,40 +0,0 @@ -id = $id; - return $this; - } - - /** - * ID of the payment web experience profile. - * - * @return string - */ - public function getId() - { - return $this->id; - } - -} diff --git a/paypal/PayPal/Api/Credit.php b/paypal/PayPal/Api/Credit.php deleted file mode 100644 index 14fca8d..0000000 --- a/paypal/PayPal/Api/Credit.php +++ /dev/null @@ -1,66 +0,0 @@ -id = $id; - return $this; - } - - /** - * Unique identifier of credit resource. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * specifies type of credit - * Valid Values: ["BILL_ME_LATER", "PAYPAL_EXTRAS_MASTERCARD", "EBAY_MASTERCARD", "PAYPAL_SMART_CONNECT"] - * - * @param string $type - * - * @return $this - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * specifies type of credit - * - * @return string - */ - public function getType() - { - return $this->type; - } - -} diff --git a/paypal/PayPal/Api/CreditCard.php b/paypal/PayPal/Api/CreditCard.php deleted file mode 100644 index ad00bb0..0000000 --- a/paypal/PayPal/Api/CreditCard.php +++ /dev/null @@ -1,560 +0,0 @@ -id = $id; - return $this; - } - - /** - * ID of the credit card. This ID is provided in the response when storing credit cards. **Required if using a stored credit card.** - * - * @deprecated Not publicly available - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Credit card number. Numeric characters only with no spaces or punctuation. The string must conform with modulo and length required by each credit card type. *Redacted in responses.* - * - * @param string $number - * - * @return $this - */ - public function setNumber($number) - { - $this->number = $number; - return $this; - } - - /** - * Credit card number. Numeric characters only with no spaces or punctuation. The string must conform with modulo and length required by each credit card type. *Redacted in responses.* - * - * @return string - */ - public function getNumber() - { - return $this->number; - } - - /** - * Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex` - * - * @param string $type - * - * @return $this - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex` - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Expiration month with no leading zero. Acceptable values are 1 through 12. - * - * @param int $expire_month - * - * @return $this - */ - public function setExpireMonth($expire_month) - { - $this->expire_month = $expire_month; - return $this; - } - - /** - * Expiration month with no leading zero. Acceptable values are 1 through 12. - * - * @return int - */ - public function getExpireMonth() - { - return $this->expire_month; - } - - /** - * 4-digit expiration year. - * - * @param int $expire_year - * - * @return $this - */ - public function setExpireYear($expire_year) - { - $this->expire_year = $expire_year; - return $this; - } - - /** - * 4-digit expiration year. - * - * @return int - */ - public function getExpireYear() - { - return $this->expire_year; - } - - /** - * 3-4 digit card validation code. - * - * @param string $cvv2 - * - * @return $this - */ - public function setCvv2($cvv2) - { - $this->cvv2 = $cvv2; - return $this; - } - - /** - * 3-4 digit card validation code. - * - * @return string - */ - public function getCvv2() - { - return $this->cvv2; - } - - /** - * Cardholder's first name. - * - * @param string $first_name - * - * @return $this - */ - public function setFirstName($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * Cardholder's first name. - * - * @return string - */ - public function getFirstName() - { - return $this->first_name; - } - - /** - * Cardholder's last name. - * - * @param string $last_name - * - * @return $this - */ - public function setLastName($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * Cardholder's last name. - * - * @return string - */ - public function getLastName() - { - return $this->last_name; - } - - /** - * Billing Address associated with this card. - * - * @param \PayPal\Api\Address $billing_address - * - * @return $this - */ - public function setBillingAddress($billing_address) - { - $this->billing_address = $billing_address; - return $this; - } - - /** - * Billing Address associated with this card. - * - * @return \PayPal\Api\Address - */ - public function getBillingAddress() - { - return $this->billing_address; - } - - /** - * A unique identifier of the customer to whom this bank account belongs. Generated and provided by the facilitator. **This is now used in favor of `payer_id` when creating or using a stored funding instrument in the vault.** - * - * @param string $external_customer_id - * - * @return $this - */ - public function setExternalCustomerId($external_customer_id) - { - $this->external_customer_id = $external_customer_id; - return $this; - } - - /** - * A unique identifier of the customer to whom this bank account belongs. Generated and provided by the facilitator. **This is now used in favor of `payer_id` when creating or using a stored funding instrument in the vault.** - * - * @return string - */ - public function getExternalCustomerId() - { - return $this->external_customer_id; - } - - /** - * A user provided, optional convenvience field that functions as a unique identifier for the merchant on behalf of whom this credit card is being stored for. Note that this has no relation to PayPal merchant id - * - * @param string $merchant_id - * - * @return $this - */ - public function setMerchantId($merchant_id) - { - $this->merchant_id = $merchant_id; - return $this; - } - - /** - * A user provided, optional convenvience field that functions as a unique identifier for the merchant on behalf of whom this credit card is being stored for. Note that this has no relation to PayPal merchant id - * - * @return string - */ - public function getMerchantId() - { - return $this->merchant_id; - } - - /** - * A unique identifier that you can assign and track when storing a credit card or using a stored credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, username, or email address. Required when using a stored credit card if a payer_id was originally provided when storing the credit card in vault. - * - * @deprecated This is being deprecated in favor of the `external_customer_id` property. - * @param string $payer_id - * - * @return $this - */ - public function setPayerId($payer_id) - { - $this->payer_id = $payer_id; - return $this; - } - - /** - * A unique identifier that you can assign and track when storing a credit card or using a stored credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, username, or email address. Required when using a stored credit card if a payer_id was originally provided when storing the credit card in vault. - * - * @deprecated This is being deprecated in favor of the `external_customer_id` property. - * @return string - */ - public function getPayerId() - { - return $this->payer_id; - } - - /** - * A unique identifier of the bank account resource. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant. - * - * @param string $external_card_id - * - * @return $this - */ - public function setExternalCardId($external_card_id) - { - $this->external_card_id = $external_card_id; - return $this; - } - - /** - * A unique identifier of the bank account resource. Generated and provided by the facilitator so it can be used to restrict the usage of the bank account to the specific merchant. - * - * @return string - */ - public function getExternalCardId() - { - return $this->external_card_id; - } - - /** - * State of the credit card funding instrument. - * Valid Values: ["expired", "ok"] - * - * @param string $state - * - * @return $this - */ - public function setState($state) - { - $this->state = $state; - return $this; - } - - /** - * State of the credit card funding instrument. - * - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Funding instrument expiration date. - * - * @param string $create_time - * - * @return $this - */ - public function setCreateTime($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates creation time. - * - * @return string - */ - public function getCreateTime() - { - return $this->create_time; - } - - /** - * Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates the updation time. - * - * @param string $update_time - * - * @return $this - */ - public function setUpdateTime($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates the updation time. - * - * @return string - */ - public function getUpdateTime() - { - return $this->update_time; - } - - /** - * Date/Time until this resource can be used fund a payment. - * - * @param string $valid_until - * - * @return $this - */ - public function setValidUntil($valid_until) - { - $this->valid_until = $valid_until; - return $this; - } - - /** - * Funding instrument expiration date. - * - * @return string - */ - public function getValidUntil() - { - return $this->valid_until; - } - - /** - * Creates a new Credit Card Resource (aka Tokenize). - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return CreditCard - */ - public function create($apiContext = null, $restCall = null) - { - $payLoad = $this->toJSON(); - $json = self::executeCall( - "/v1/vault/credit-cards", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Obtain the Credit Card resource for the given identifier. - * - * @param string $creditCardId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return CreditCard - */ - public static function get($creditCardId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($creditCardId, 'creditCardId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/vault/credit-cards/$creditCardId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new CreditCard(); - $ret->fromJson($json); - return $ret; - } - - /** - * Delete the Credit Card resource for the given identifier. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function delete($apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - $payLoad = ""; - self::executeCall( - "/v1/vault/credit-cards/{$this->getId()}", - "DELETE", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Update information in a previously saved card. Only the modified fields need to be passed in the request. - * - * @param PatchRequest $patchRequest - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return CreditCard - */ - public function update($patchRequest, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($patchRequest, 'patch'); - $payload = $patchRequest->toJSON(); - $json = self::executeCall( - "/v1/vault/credit-cards/{$this->getId()}", - "PATCH", - $payload, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Retrieves a list of Credit Card resources. - * - * @param array $params - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return CreditCardList - */ - public static function all($params, $apiContext = null, $restCall = null) - { - if (is_null($params)) { - $params = array(); - } - ArgumentValidator::validate($params, 'params'); - $payLoad = ""; - $allowedParams = array( - 'page_size' => 1, - 'page' => 1, - 'start_time' => 1, - 'end_time' => 1, - 'sort_order' => 1, - 'sort_by' => 1, - 'merchant_id' => 1, - 'external_card_id' => 1, - 'external_customer_id' => 1, - 'total_required' => 1 - ); - $json = self::executeCall( - "/v1/vault/credit-cards" . "?" . http_build_query(array_intersect_key($params, $allowedParams)), - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new CreditCardList(); - $ret->fromJson($json); - return $ret; - } - -} diff --git a/paypal/PayPal/Api/CreditCardHistory.php b/paypal/PayPal/Api/CreditCardHistory.php deleted file mode 100644 index f8d0a94..0000000 --- a/paypal/PayPal/Api/CreditCardHistory.php +++ /dev/null @@ -1,91 +0,0 @@ -{"credit-cards"} = $credit_cards; - return $this; - } - - /** - * A list of credit card resources - * - * @return \PayPal\Api\CreditCard - */ - public function getCreditCards() - { - return $this->{"credit-cards"}; - } - - /** - * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. - * - * - * @param int $count - * - * @return $this - */ - public function setCount($count) - { - $this->count = $count; - return $this; - } - - /** - * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. - * - * @return int - */ - public function getCount() - { - return $this->count; - } - - /** - * Identifier of the next element to get the next range of results. - * - * - * @param string $next_id - * - * @return $this - */ - public function setNextId($next_id) - { - $this->next_id = $next_id; - return $this; - } - - /** - * Identifier of the next element to get the next range of results. - * - * @return string - */ - public function getNextId() - { - return $this->next_id; - } - -} diff --git a/paypal/PayPal/Api/CreditCardList.php b/paypal/PayPal/Api/CreditCardList.php deleted file mode 100644 index 97ba6aa..0000000 --- a/paypal/PayPal/Api/CreditCardList.php +++ /dev/null @@ -1,120 +0,0 @@ -items = $items; - return $this; - } - - /** - * A list of credit card resources - * - * @return \PayPal\Api\CreditCard[] - */ - public function getItems() - { - return $this->items; - } - - /** - * Append Items to the list. - * - * @param \PayPal\Api\CreditCard $creditCard - * @return $this - */ - public function addItem($creditCard) - { - if (!$this->getItems()) { - return $this->setItems(array($creditCard)); - } else { - return $this->setItems( - array_merge($this->getItems(), array($creditCard)) - ); - } - } - - /** - * Remove Items from the list. - * - * @param \PayPal\Api\CreditCard $creditCard - * @return $this - */ - public function removeItem($creditCard) - { - return $this->setItems( - array_diff($this->getItems(), array($creditCard)) - ); - } - - /** - * Total number of items present in the given list. Note that the number of items might be larger than the records in the current page. - * - * @param int $total_items - * - * @return $this - */ - public function setTotalItems($total_items) - { - $this->total_items = $total_items; - return $this; - } - - /** - * Total number of items present in the given list. Note that the number of items might be larger than the records in the current page. - * - * @return int - */ - public function getTotalItems() - { - return $this->total_items; - } - - /** - * Total number of pages that exist, for the total number of items, with the given page size. - * - * @param int $total_pages - * - * @return $this - */ - public function setTotalPages($total_pages) - { - $this->total_pages = $total_pages; - return $this; - } - - /** - * Total number of pages that exist, for the total number of items, with the given page size. - * - * @return int - */ - public function getTotalPages() - { - return $this->total_pages; - } - -} diff --git a/paypal/PayPal/Api/CreditCardToken.php b/paypal/PayPal/Api/CreditCardToken.php deleted file mode 100644 index 301e9dd..0000000 --- a/paypal/PayPal/Api/CreditCardToken.php +++ /dev/null @@ -1,161 +0,0 @@ -credit_card_id = $credit_card_id; - return $this; - } - - /** - * ID of credit card previously stored using `/vault/credit-card`. - * - * @return string - */ - public function getCreditCardId() - { - return $this->credit_card_id; - } - - /** - * A unique identifier that you can assign and track when storing a credit card or using a stored credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, username, or email address. **Required when using a stored credit card if a payer_id was originally provided when storing the credit card in vault.** - * - * @param string $payer_id - * - * @return $this - */ - public function setPayerId($payer_id) - { - $this->payer_id = $payer_id; - return $this; - } - - /** - * A unique identifier that you can assign and track when storing a credit card or using a stored credit card. This ID can help to avoid unintentional use or misuse of credit cards. This ID can be any value you would like to associate with the saved card, such as a UUID, username, or email address. **Required when using a stored credit card if a payer_id was originally provided when storing the credit card in vault.** - * - * @return string - */ - public function getPayerId() - { - return $this->payer_id; - } - - /** - * Last four digits of the stored credit card number. - * - * @param string $last4 - * - * @return $this - */ - public function setLast4($last4) - { - $this->last4 = $last4; - return $this; - } - - /** - * Last four digits of the stored credit card number. - * - * @return string - */ - public function getLast4() - { - return $this->last4; - } - - /** - * Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex`. Values are presented in lowercase and not should not be used for display. - * - * @param string $type - * - * @return $this - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * Credit card type. Valid types are: `visa`, `mastercard`, `discover`, `amex`. Values are presented in lowercase and not should not be used for display. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Expiration month with no leading zero. Acceptable values are 1 through 12. - * - * @param int $expire_month - * - * @return $this - */ - public function setExpireMonth($expire_month) - { - $this->expire_month = $expire_month; - return $this; - } - - /** - * Expiration month with no leading zero. Acceptable values are 1 through 12. - * - * @return int - */ - public function getExpireMonth() - { - return $this->expire_month; - } - - /** - * 4-digit expiration year. - * - * @param int $expire_year - * - * @return $this - */ - public function setExpireYear($expire_year) - { - $this->expire_year = $expire_year; - return $this; - } - - /** - * 4-digit expiration year. - * - * @return int - */ - public function getExpireYear() - { - return $this->expire_year; - } - -} diff --git a/paypal/PayPal/Api/CreditFinancingOffered.php b/paypal/PayPal/Api/CreditFinancingOffered.php deleted file mode 100644 index bb24617..0000000 --- a/paypal/PayPal/Api/CreditFinancingOffered.php +++ /dev/null @@ -1,161 +0,0 @@ -total_cost = $total_cost; - return $this; - } - - /** - * This is the estimated total payment amount including interest and fees the user will pay during the lifetime of the loan. - * - * @return \PayPal\Api\Currency - */ - public function getTotalCost() - { - return $this->total_cost; - } - - /** - * Length of financing terms in month - * - * @param \PayPal\Api\number $term - * - * @return $this - */ - public function setTerm($term) - { - $this->term = $term; - return $this; - } - - /** - * Length of financing terms in month - * - * @return \PayPal\Api\number - */ - public function getTerm() - { - return $this->term; - } - - /** - * This is the estimated amount per month that the customer will need to pay including fees and interest. - * - * @param \PayPal\Api\Currency $monthly_payment - * - * @return $this - */ - public function setMonthlyPayment($monthly_payment) - { - $this->monthly_payment = $monthly_payment; - return $this; - } - - /** - * This is the estimated amount per month that the customer will need to pay including fees and interest. - * - * @return \PayPal\Api\Currency - */ - public function getMonthlyPayment() - { - return $this->monthly_payment; - } - - /** - * Estimated interest or fees amount the payer will have to pay during the lifetime of the loan. - * - * @param \PayPal\Api\Currency $total_interest - * - * @return $this - */ - public function setTotalInterest($total_interest) - { - $this->total_interest = $total_interest; - return $this; - } - - /** - * Estimated interest or fees amount the payer will have to pay during the lifetime of the loan. - * - * @return \PayPal\Api\Currency - */ - public function getTotalInterest() - { - return $this->total_interest; - } - - /** - * Status on whether the customer ultimately was approved for and chose to make the payment using the approved installment credit. - * - * @param bool $payer_acceptance - * - * @return $this - */ - public function setPayerAcceptance($payer_acceptance) - { - $this->payer_acceptance = $payer_acceptance; - return $this; - } - - /** - * Status on whether the customer ultimately was approved for and chose to make the payment using the approved installment credit. - * - * @return bool - */ - public function getPayerAcceptance() - { - return $this->payer_acceptance; - } - - /** - * Indicates whether the cart amount is editable after payer's acceptance on PayPal side - * - * @param bool $cart_amount_immutable - * - * @return $this - */ - public function setCartAmountImmutable($cart_amount_immutable) - { - $this->cart_amount_immutable = $cart_amount_immutable; - return $this; - } - - /** - * Indicates whether the cart amount is editable after payer's acceptance on PayPal side - * - * @return bool - */ - public function getCartAmountImmutable() - { - return $this->cart_amount_immutable; - } - -} diff --git a/paypal/PayPal/Api/Currency.php b/paypal/PayPal/Api/Currency.php deleted file mode 100644 index eb53eb9..0000000 --- a/paypal/PayPal/Api/Currency.php +++ /dev/null @@ -1,69 +0,0 @@ -currency = $currency; - return $this; - } - - /** - * 3 letter currency code as defined by ISO 4217. - * - * @return string - */ - public function getCurrency() - { - return $this->currency; - } - - /** - * amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code. - * - * @param string|double $value - * - * @return $this - */ - public function setValue($value) - { - NumericValidator::validate($value, "Value"); - $value = FormatConverter::formatToPrice($value, $this->getCurrency()); - $this->value = $value; - return $this; - } - - /** - * amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code. - * - * @return string - */ - public function getValue() - { - return $this->value; - } - -} diff --git a/paypal/PayPal/Api/CurrencyConversion.php b/paypal/PayPal/Api/CurrencyConversion.php deleted file mode 100644 index 5347986..0000000 --- a/paypal/PayPal/Api/CurrencyConversion.php +++ /dev/null @@ -1,266 +0,0 @@ -conversion_date = $conversion_date; - return $this; - } - - /** - * Date of validity for the conversion rate. - * - * @return string - */ - public function getConversionDate() - { - return $this->conversion_date; - } - - /** - * 3 letter currency code - * - * @param string $from_currency - * - * @return $this - */ - public function setFromCurrency($from_currency) - { - $this->from_currency = $from_currency; - return $this; - } - - /** - * 3 letter currency code - * - * @return string - */ - public function getFromCurrency() - { - return $this->from_currency; - } - - /** - * Amount participating in currency conversion, set to 1 as default - * - * @param string $from_amount - * - * @return $this - */ - public function setFromAmount($from_amount) - { - $this->from_amount = $from_amount; - return $this; - } - - /** - * Amount participating in currency conversion, set to 1 as default - * - * @return string - */ - public function getFromAmount() - { - return $this->from_amount; - } - - /** - * 3 letter currency code - * - * @param string $to_currency - * - * @return $this - */ - public function setToCurrency($to_currency) - { - $this->to_currency = $to_currency; - return $this; - } - - /** - * 3 letter currency code - * - * @return string - */ - public function getToCurrency() - { - return $this->to_currency; - } - - /** - * Amount resulting from currency conversion. - * - * @param string $to_amount - * - * @return $this - */ - public function setToAmount($to_amount) - { - $this->to_amount = $to_amount; - return $this; - } - - /** - * Amount resulting from currency conversion. - * - * @return string - */ - public function getToAmount() - { - return $this->to_amount; - } - - /** - * Field indicating conversion type applied. - * Valid Values: ["PAYPAL", "VENDOR"] - * - * @param string $conversion_type - * - * @return $this - */ - public function setConversionType($conversion_type) - { - $this->conversion_type = $conversion_type; - return $this; - } - - /** - * Field indicating conversion type applied. - * - * @return string - */ - public function getConversionType() - { - return $this->conversion_type; - } - - /** - * Allow Payer to change conversion type. - * - * @param bool $conversion_type_changeable - * - * @return $this - */ - public function setConversionTypeChangeable($conversion_type_changeable) - { - $this->conversion_type_changeable = $conversion_type_changeable; - return $this; - } - - /** - * Allow Payer to change conversion type. - * - * @return bool - */ - public function getConversionTypeChangeable() - { - return $this->conversion_type_changeable; - } - - /** - * Base URL to web applications endpoint - * Valid Values: ["https://www.paypal.com/{country_code}/webapps/xocspartaweb/webflow/sparta/proxwebflow", "https://www.paypal.com/{country_code}/proxflow"] - * @deprecated Not publicly available - * @param string $web_url - * @throws \InvalidArgumentException - * @return $this - */ - public function setWebUrl($web_url) - { - UrlValidator::validate($web_url, "WebUrl"); - $this->web_url = $web_url; - return $this; - } - - /** - * Base URL to web applications endpoint - * @deprecated Not publicly available - * @return string - */ - public function getWebUrl() - { - return $this->web_url; - } - - /** - * Sets Links - * - * @param \PayPal\Api\Links[] $links - * - * @return $this - */ - public function setLinks($links) - { - $this->links = $links; - return $this; - } - - /** - * Gets Links - * - * @return \PayPal\Api\Links[] - */ - public function getLinks() - { - return $this->links; - } - - /** - * Append Links to the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function addLink($links) - { - if (!$this->getLinks()) { - return $this->setLinks(array($links)); - } else { - return $this->setLinks( - array_merge($this->getLinks(), array($links)) - ); - } - } - - /** - * Remove Links from the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function removeLink($links) - { - return $this->setLinks( - array_diff($this->getLinks(), array($links)) - ); - } - -} diff --git a/paypal/PayPal/Api/CustomAmount.php b/paypal/PayPal/Api/CustomAmount.php deleted file mode 100644 index e61146c..0000000 --- a/paypal/PayPal/Api/CustomAmount.php +++ /dev/null @@ -1,65 +0,0 @@ -label = $label; - return $this; - } - - /** - * The custom amount label. Maximum length is 25 characters. - * - * @return string - */ - public function getLabel() - { - return $this->label; - } - - /** - * The custom amount value. Valid range is from -999999.99 to 999999.99. - * - * @param \PayPal\Api\Currency $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * The custom amount value. Valid range is from -999999.99 to 999999.99. - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - -} diff --git a/paypal/PayPal/Api/DetailedRefund.php b/paypal/PayPal/Api/DetailedRefund.php deleted file mode 100644 index e010a1d..0000000 --- a/paypal/PayPal/Api/DetailedRefund.php +++ /dev/null @@ -1,160 +0,0 @@ -custom = $custom; - return $this; - } - - /** - * free-form field for the use of clients - * - * @return string - */ - public function getCustom() - { - return $this->custom; - } - - /** - * Amount refunded to payer of the original transaction, in the current Refund call - * - * @param \PayPal\Api\Currency $refund_to_payer - * - * @return $this - */ - public function setRefundToPayer($refund_to_payer) - { - $this->refund_to_payer = $refund_to_payer; - return $this; - } - - /** - * Amount refunded to payer of the original transaction, in the current Refund call - * - * @return \PayPal\Api\Currency - */ - public function getRefundToPayer() - { - return $this->refund_to_payer; - } - - /** - * List of external funding that were refunded by the Refund call. Each external_funding unit should have a unique reference_id - * - * @param \PayPal\Api\ExternalFunding[] $refund_to_external_funding - * - * @return $this - */ - public function setRefundToExternalFunding($refund_to_external_funding) - { - $this->refund_to_external_funding = $refund_to_external_funding; - return $this; - } - - /** - * List of external funding that were refunded by the Refund call. Each external_funding unit should have a unique reference_id - * - * @return \PayPal\Api\ExternalFunding[] - */ - public function getRefundToExternalFunding() - { - return $this->refund_to_external_funding; - } - - /** - * Transaction fee refunded to original recipient of payment. - * - * @param \PayPal\Api\Currency $refund_from_transaction_fee - * - * @return $this - */ - public function setRefundFromTransactionFee($refund_from_transaction_fee) - { - $this->refund_from_transaction_fee = $refund_from_transaction_fee; - return $this; - } - - /** - * Transaction fee refunded to original recipient of payment. - * - * @return \PayPal\Api\Currency - */ - public function getRefundFromTransactionFee() - { - return $this->refund_from_transaction_fee; - } - - /** - * Amount subtracted from PayPal balance of the original recipient of payment, to make this refund. - * - * @param \PayPal\Api\Currency $refund_from_received_amount - * - * @return $this - */ - public function setRefundFromReceivedAmount($refund_from_received_amount) - { - $this->refund_from_received_amount = $refund_from_received_amount; - return $this; - } - - /** - * Amount subtracted from PayPal balance of the original recipient of payment, to make this refund. - * - * @return \PayPal\Api\Currency - */ - public function getRefundFromReceivedAmount() - { - return $this->refund_from_received_amount; - } - - /** - * Total amount refunded so far from the original purchase. Say, for example, a buyer makes $100 purchase, the buyer was refunded $20 a week ago and is refunded $30 in this transaction. The gross refund amount is $30 (in this transaction). The total refunded amount is $50. - * - * @param \PayPal\Api\Currency $total_refunded_amount - * - * @return $this - */ - public function setTotalRefundedAmount($total_refunded_amount) - { - $this->total_refunded_amount = $total_refunded_amount; - return $this; - } - - /** - * Total amount refunded so far from the original purchase. Say, for example, a buyer makes $100 purchase, the buyer was refunded $20 a week ago and is refunded $30 in this transaction. The gross refund amount is $30 (in this transaction). The total refunded amount is $50. - * - * @return \PayPal\Api\Currency - */ - public function getTotalRefundedAmount() - { - return $this->total_refunded_amount; - } - -} diff --git a/paypal/PayPal/Api/Details.php b/paypal/PayPal/Api/Details.php deleted file mode 100644 index 53212b7..0000000 --- a/paypal/PayPal/Api/Details.php +++ /dev/null @@ -1,227 +0,0 @@ -subtotal = $subtotal; - return $this; - } - - /** - * Amount of the subtotal of the items. **Required** if line items are specified. 10 characters max, with support for 2 decimal places. - * - * @return string - */ - public function getSubtotal() - { - return $this->subtotal; - } - - /** - * Amount charged for shipping. 10 characters max with support for 2 decimal places. - * - * @param string|double $shipping - * - * @return $this - */ - public function setShipping($shipping) - { - NumericValidator::validate($shipping, "Shipping"); - $shipping = FormatConverter::formatToPrice($shipping); - $this->shipping = $shipping; - return $this; - } - - /** - * Amount charged for shipping. 10 characters max with support for 2 decimal places. - * - * @return string - */ - public function getShipping() - { - return $this->shipping; - } - - /** - * Amount charged for tax. 10 characters max with support for 2 decimal places. - * - * @param string|double $tax - * - * @return $this - */ - public function setTax($tax) - { - NumericValidator::validate($tax, "Tax"); - $tax = FormatConverter::formatToPrice($tax); - $this->tax = $tax; - return $this; - } - - /** - * Amount charged for tax. 10 characters max with support for 2 decimal places. - * - * @return string - */ - public function getTax() - { - return $this->tax; - } - - /** - * Amount being charged for the handling fee. Only supported when the `payment_method` is set to `paypal`. - * - * @param string|double $handling_fee - * - * @return $this - */ - public function setHandlingFee($handling_fee) - { - NumericValidator::validate($handling_fee, "Handling Fee"); - $handling_fee = FormatConverter::formatToPrice($handling_fee); - $this->handling_fee = $handling_fee; - return $this; - } - - /** - * Amount being charged for the handling fee. Only supported when the `payment_method` is set to `paypal`. - * - * @return string - */ - public function getHandlingFee() - { - return $this->handling_fee; - } - - /** - * Amount being discounted for the shipping fee. Only supported when the `payment_method` is set to `paypal`. - * - * @param string|double $shipping_discount - * - * @return $this - */ - public function setShippingDiscount($shipping_discount) - { - NumericValidator::validate($shipping_discount, "Shipping Discount"); - $shipping_discount = FormatConverter::formatToPrice($shipping_discount); - $this->shipping_discount = $shipping_discount; - return $this; - } - - /** - * Amount being discounted for the shipping fee. Only supported when the `payment_method` is set to `paypal`. - * - * @return string - */ - public function getShippingDiscount() - { - return $this->shipping_discount; - } - - /** - * Amount being charged for the insurance fee. Only supported when the `payment_method` is set to `paypal`. - * - * @param string|double $insurance - * - * @return $this - */ - public function setInsurance($insurance) - { - NumericValidator::validate($insurance, "Insurance"); - $insurance = FormatConverter::formatToPrice($insurance); - $this->insurance = $insurance; - return $this; - } - - /** - * Amount being charged for the insurance fee. Only supported when the `payment_method` is set to `paypal`. - * - * @return string - */ - public function getInsurance() - { - return $this->insurance; - } - - /** - * Amount being charged as gift wrap fee. - * - * @param string|double $gift_wrap - * - * @return $this - */ - public function setGiftWrap($gift_wrap) - { - NumericValidator::validate($gift_wrap, "Gift Wrap"); - $gift_wrap = FormatConverter::formatToPrice($gift_wrap); - $this->gift_wrap = $gift_wrap; - return $this; - } - - /** - * Amount being charged as gift wrap fee. - * - * @return string - */ - public function getGiftWrap() - { - return $this->gift_wrap; - } - - /** - * Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment. - * - * @param string|double $fee - * - * @return $this - */ - public function setFee($fee) - { - NumericValidator::validate($fee, "Fee"); - $fee = FormatConverter::formatToPrice($fee); - $this->fee = $fee; - return $this; - } - - /** - * Fee charged by PayPal. In case of a refund, this is the fee amount refunded to the original receipient of the payment. - * - * @return string - */ - public function getFee() - { - return $this->fee; - } - -} diff --git a/paypal/PayPal/Api/Error.php b/paypal/PayPal/Api/Error.php deleted file mode 100644 index 574dddc..0000000 --- a/paypal/PayPal/Api/Error.php +++ /dev/null @@ -1,320 +0,0 @@ -name = $name; - return $this; - } - - /** - * Human readable, unique name of the error. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Reference ID of the purchase_unit associated with this error - * - * @deprecated Not publicly available - * @param string $purchase_unit_reference_id - * - * @return $this - */ - public function setPurchaseUnitReferenceId($purchase_unit_reference_id) - { - $this->purchase_unit_reference_id = $purchase_unit_reference_id; - return $this; - } - - /** - * Reference ID of the purchase_unit associated with this error - * - * @deprecated Not publicly available - * @return string - */ - public function getPurchaseUnitReferenceId() - { - return $this->purchase_unit_reference_id; - } - - /** - * PayPal internal error code. - * - * @deprecated Not publicly available - * @param string $code - * - * @return $this - */ - public function setCode($code) - { - $this->code = $code; - return $this; - } - - /** - * PayPal internal error code. - * - * @deprecated Not publicly available - * @return string - */ - public function getCode() - { - return $this->code; - } - - /** - * PayPal internal identifier used for correlation purposes. - * - * @param string $debug_id - * - * @return $this - */ - public function setDebugId($debug_id) - { - $this->debug_id = $debug_id; - return $this; - } - - /** - * PayPal internal identifier used for correlation purposes. - * - * @return string - */ - public function getDebugId() - { - return $this->debug_id; - } - - /** - * Message describing the error. - * - * @param string $message - * - * @return $this - */ - public function setMessage($message) - { - $this->message = $message; - return $this; - } - - /** - * Message describing the error. - * - * @return string - */ - public function getMessage() - { - return $this->message; - } - - /** - * URI for detailed information related to this error for the developer. - * - * @param string $information_link - * - * @return $this - */ - public function setInformationLink($information_link) - { - $this->information_link = $information_link; - return $this; - } - - /** - * URI for detailed information related to this error for the developer. - * - * @return string - */ - public function getInformationLink() - { - return $this->information_link; - } - - /** - * Additional details of the error - * - * @param \PayPal\Api\ErrorDetails[] $details - * - * @return $this - */ - public function setDetails($details) - { - $this->details = $details; - return $this; - } - - /** - * Additional details of the error - * - * @return \PayPal\Api\ErrorDetails[] - */ - public function getDetails() - { - return $this->details; - } - - /** - * Append Details to the list. - * - * @param \PayPal\Api\ErrorDetails $errorDetails - * @return $this - */ - public function addDetail($errorDetails) - { - if (!$this->getDetails()) { - return $this->setDetails(array($errorDetails)); - } else { - return $this->setDetails( - array_merge($this->getDetails(), array($errorDetails)) - ); - } - } - - /** - * Remove Details from the list. - * - * @param \PayPal\Api\ErrorDetails $errorDetails - * @return $this - */ - public function removeDetail($errorDetails) - { - return $this->setDetails( - array_diff($this->getDetails(), array($errorDetails)) - ); - } - - /** - * response codes returned from a payment processor such as avs, cvv, etc. Only supported when the `payment_method` is set to `credit_card`. - * - * @deprecated Not publicly available - * @param \PayPal\Api\ProcessorResponse $processor_response - * - * @return $this - */ - public function setProcessorResponse($processor_response) - { - $this->processor_response = $processor_response; - return $this; - } - - /** - * response codes returned from a payment processor such as avs, cvv, etc. Only supported when the `payment_method` is set to `credit_card`. - * - * @deprecated Not publicly available - * @return \PayPal\Api\ProcessorResponse - */ - public function getProcessorResponse() - { - return $this->processor_response; - } - - /** - * Fraud filter details. Only supported when the `payment_method` is set to `credit_card` - * - * @deprecated Not publicly available - * @param \PayPal\Api\FmfDetails $fmf_details - * - * @return $this - */ - public function setFmfDetails($fmf_details) - { - $this->fmf_details = $fmf_details; - return $this; - } - - /** - * Fraud filter details. Only supported when the `payment_method` is set to `credit_card` - * - * @deprecated Not publicly available - * @return \PayPal\Api\FmfDetails - */ - public function getFmfDetails() - { - return $this->fmf_details; - } - - /** - * Sets Links - * - * @param \PayPal\Api\Links[] $links - * - * @return $this - */ - public function setLinks($links) - { - $this->links = $links; - return $this; - } - - /** - * Gets Links - * - * @return \PayPal\Api\Links[] - */ - public function getLinks() - { - return $this->links; - } - - /** - * Append Links to the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function addLink($links) - { - if (!$this->getLinks()) { - return $this->setLinks(array($links)); - } else { - return $this->setLinks( - array_merge($this->getLinks(), array($links)) - ); - } - } - - /** - * Remove Links from the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function removeLink($links) - { - return $this->setLinks( - array_diff($this->getLinks(), array($links)) - ); - } -} diff --git a/paypal/PayPal/Api/ErrorDetails.php b/paypal/PayPal/Api/ErrorDetails.php deleted file mode 100644 index d120b0a..0000000 --- a/paypal/PayPal/Api/ErrorDetails.php +++ /dev/null @@ -1,111 +0,0 @@ -field = $field; - return $this; - } - - /** - * Name of the field that caused the error. - * - * @return string - */ - public function getField() - { - return $this->field; - } - - /** - * Reason for the error. - * - * @param string $issue - * - * @return $this - */ - public function setIssue($issue) - { - $this->issue = $issue; - return $this; - } - - /** - * Reason for the error. - * - * @return string - */ - public function getIssue() - { - return $this->issue; - } - - /** - * Reference ID of the purchase_unit associated with this error - * @deprecated Not publicly available - * @param string $purchase_unit_reference_id - * - * @return $this - */ - public function setPurchaseUnitReferenceId($purchase_unit_reference_id) - { - $this->purchase_unit_reference_id = $purchase_unit_reference_id; - return $this; - } - - /** - * Reference ID of the purchase_unit associated with this error - * @deprecated Not publicly available - * @return string - */ - public function getPurchaseUnitReferenceId() - { - return $this->purchase_unit_reference_id; - } - - /** - * PayPal internal error code. - * @deprecated Not publicly available - * @param string $code - * - * @return $this - */ - public function setCode($code) - { - $this->code = $code; - return $this; - } - - /** - * PayPal internal error code. - * @deprecated Not publicly available - * @return string - */ - public function getCode() - { - return $this->code; - } - -} diff --git a/paypal/PayPal/Api/ExtendedBankAccount.php b/paypal/PayPal/Api/ExtendedBankAccount.php deleted file mode 100644 index 3206c9d..0000000 --- a/paypal/PayPal/Api/ExtendedBankAccount.php +++ /dev/null @@ -1,38 +0,0 @@ -mandate_reference_number = $mandate_reference_number; - return $this; - } - - /** - * Identifier of the direct debit mandate to validate. Currently supported only for EU bank accounts(SEPA). - * @deprecated Not publicly available - * @return string - */ - public function getMandateReferenceNumber() - { - return $this->mandate_reference_number; - } - -} diff --git a/paypal/PayPal/Api/ExternalFunding.php b/paypal/PayPal/Api/ExternalFunding.php deleted file mode 100644 index e03335b..0000000 --- a/paypal/PayPal/Api/ExternalFunding.php +++ /dev/null @@ -1,161 +0,0 @@ -reference_id = $reference_id; - return $this; - } - - /** - * Unique identifier for the external funding - * - * @return string - */ - public function getReferenceId() - { - return $this->reference_id; - } - - /** - * Generic identifier for the external funding - * - * @param string $code - * - * @return $this - */ - public function setCode($code) - { - $this->code = $code; - return $this; - } - - /** - * Generic identifier for the external funding - * - * @return string - */ - public function getCode() - { - return $this->code; - } - - /** - * Encrypted PayPal Account identifier for the funding account - * - * @param string $funding_account_id - * - * @return $this - */ - public function setFundingAccountId($funding_account_id) - { - $this->funding_account_id = $funding_account_id; - return $this; - } - - /** - * Encrypted PayPal Account identifier for the funding account - * - * @return string - */ - public function getFundingAccountId() - { - return $this->funding_account_id; - } - - /** - * Description of the external funding being applied - * - * @param string $display_text - * - * @return $this - */ - public function setDisplayText($display_text) - { - $this->display_text = $display_text; - return $this; - } - - /** - * Description of the external funding being applied - * - * @return string - */ - public function getDisplayText() - { - return $this->display_text; - } - - /** - * Amount being funded by the external funding account - * - * @param \PayPal\Api\Amount $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * Amount being funded by the external funding account - * - * @return \PayPal\Api\Amount - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Indicates that the Payment should be fully funded by External Funded Incentive - * Valid Values: ["FULLY_FUNDED"] - * - * @param string $funding_instruction - * - * @return $this - */ - public function setFundingInstruction($funding_instruction) - { - $this->funding_instruction = $funding_instruction; - return $this; - } - - /** - * Indicates that the Payment should be fully funded by External Funded Incentive - * - * @return string - */ - public function getFundingInstruction() - { - return $this->funding_instruction; - } -} diff --git a/paypal/PayPal/Api/FileAttachment.php b/paypal/PayPal/Api/FileAttachment.php deleted file mode 100644 index 23b9055..0000000 --- a/paypal/PayPal/Api/FileAttachment.php +++ /dev/null @@ -1,67 +0,0 @@ -name = $name; - return $this; - } - - /** - * Name of the file attached. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * URL of the attached file that can be downloaded. - * - * @param string $url - * @throws \InvalidArgumentException - * @return $this - */ - public function setUrl($url) - { - UrlValidator::validate($url, "Url"); - $this->url = $url; - return $this; - } - - /** - * URL of the attached file that can be downloaded. - * - * @return string - */ - public function getUrl() - { - return $this->url; - } - -} diff --git a/paypal/PayPal/Api/FlowConfig.php b/paypal/PayPal/Api/FlowConfig.php deleted file mode 100644 index 975217c..0000000 --- a/paypal/PayPal/Api/FlowConfig.php +++ /dev/null @@ -1,115 +0,0 @@ -landing_page_type = $landing_page_type; - return $this; - } - - /** - * The type of landing page to display on the PayPal site for user checkout. Set to `Billing` to use the non-PayPal account landing page. Set to `Login` to use the PayPal account login landing page. - * - * @return string - */ - public function getLandingPageType() - { - return $this->landing_page_type; - } - - /** - * The merchant site URL to display after a bank transfer payment. Valid for only the Giropay or bank transfer payment method in Germany. - * - * @param string $bank_txn_pending_url - * @throws \InvalidArgumentException - * @return $this - */ - public function setBankTxnPendingUrl($bank_txn_pending_url) - { - UrlValidator::validate($bank_txn_pending_url, "BankTxnPendingUrl"); - $this->bank_txn_pending_url = $bank_txn_pending_url; - return $this; - } - - /** - * The merchant site URL to display after a bank transfer payment. Valid for only the Giropay or bank transfer payment method in Germany. - * - * @return string - */ - public function getBankTxnPendingUrl() - { - return $this->bank_txn_pending_url; - } - - /** - * Defines whether buyers can complete purchases on the PayPal or merchant website. - * - * @param string $user_action - * - * @return $this - */ - public function setUserAction($user_action) - { - $this->user_action = $user_action; - return $this; - } - - /** - * Defines whether buyers can complete purchases on the PayPal or merchant website. - * - * @return string - */ - public function getUserAction() - { - return $this->user_action; - } - - /** - * Defines the HTTP method to use to redirect the user to a return URL. A valid value is `GET` or `POST`. - * - * @param string $return_uri_http_method - * - * @return $this - */ - public function setReturnUriHttpMethod($return_uri_http_method) - { - $this->return_uri_http_method = $return_uri_http_method; - return $this; - } - - /** - * Defines the HTTP method to use to redirect the user to a return URL. A valid value is `GET` or `POST`. - * - * @return string - */ - public function getReturnUriHttpMethod() - { - return $this->return_uri_http_method; - } - -} diff --git a/paypal/PayPal/Api/FmfDetails.php b/paypal/PayPal/Api/FmfDetails.php deleted file mode 100644 index c5681c8..0000000 --- a/paypal/PayPal/Api/FmfDetails.php +++ /dev/null @@ -1,115 +0,0 @@ -filter_type = $filter_type; - return $this; - } - - /** - * Type of filter. - * - * @return string - */ - public function getFilterType() - { - return $this->filter_type; - } - - /** - * Filter Identifier. - * Valid Values: ["AVS_NO_MATCH", "AVS_PARTIAL_MATCH", "AVS_UNAVAILABLE_OR_UNSUPPORTED", "CARD_SECURITY_CODE_MISMATCH", "MAXIMUM_TRANSACTION_AMOUNT", "UNCONFIRMED_ADDRESS", "COUNTRY_MONITOR", "LARGE_ORDER_NUMBER", "BILLING_OR_SHIPPING_ADDRESS_MISMATCH", "RISKY_ZIP_CODE", "SUSPECTED_FREIGHT_FORWARDER_CHECK", "TOTAL_PURCHASE_PRICE_MINIMUM", "IP_ADDRESS_VELOCITY", "RISKY_EMAIL_ADDRESS_DOMAIN_CHECK", "RISKY_BANK_IDENTIFICATION_NUMBER_CHECK", "RISKY_IP_ADDRESS_RANGE", "PAYPAL_FRAUD_MODEL"] - * - * @param string $filter_id - * - * @return $this - */ - public function setFilterId($filter_id) - { - $this->filter_id = $filter_id; - return $this; - } - - /** - * Filter Identifier. - * - * @return string - */ - public function getFilterId() - { - return $this->filter_id; - } - - /** - * Name of the filter - * - * @param string $name - * - * @return $this - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * Name of the filter - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Description of the filter. - * - * @param string $description - * - * @return $this - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * Description of the filter. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - -} diff --git a/paypal/PayPal/Api/FundingDetail.php b/paypal/PayPal/Api/FundingDetail.php deleted file mode 100644 index 66cc1f3..0000000 --- a/paypal/PayPal/Api/FundingDetail.php +++ /dev/null @@ -1,114 +0,0 @@ -clearing_time = $clearing_time; - return $this; - } - - /** - * Expected clearing time - * - * @return string - */ - public function getClearingTime() - { - return $this->clearing_time; - } - - /** - * [DEPRECATED] Hold-off duration of the payment. payment_debit_date should be used instead. - * - * @param string $payment_hold_date - * - * @return $this - */ - public function setPaymentHoldDate($payment_hold_date) - { - $this->payment_hold_date = $payment_hold_date; - return $this; - } - - /** - * @deprecated [DEPRECATED] Hold-off duration of the payment. payment_debit_date should be used instead. - * - * @return string - */ - public function getPaymentHoldDate() - { - return $this->payment_hold_date; - } - - /** - * Date when funds will be debited from the payer's account - * - * @param string $payment_debit_date - * - * @return $this - */ - public function setPaymentDebitDate($payment_debit_date) - { - $this->payment_debit_date = $payment_debit_date; - return $this; - } - - /** - * Date when funds will be debited from the payer's account - * - * @return string - */ - public function getPaymentDebitDate() - { - return $this->payment_debit_date; - } - - /** - * Processing type of the payment card - * Valid Values: ["CUP_SECURE", "PINLESS_DEBIT"] - * - * @param string $processing_type - * - * @return $this - */ - public function setProcessingType($processing_type) - { - $this->processing_type = $processing_type; - return $this; - } - - /** - * Processing type of the payment card - * - * @return string - */ - public function getProcessingType() - { - return $this->processing_type; - } - -} diff --git a/paypal/PayPal/Api/FundingInstrument.php b/paypal/PayPal/Api/FundingInstrument.php deleted file mode 100644 index da311f4..0000000 --- a/paypal/PayPal/Api/FundingInstrument.php +++ /dev/null @@ -1,321 +0,0 @@ -credit_card = $credit_card; - return $this; - } - - /** - * Credit Card instrument. - * - * @return \PayPal\Api\CreditCard - */ - public function getCreditCard() - { - return $this->credit_card; - } - - /** - * PayPal vaulted credit Card instrument. - * - * @param \PayPal\Api\CreditCardToken $credit_card_token - * - * @return $this - */ - public function setCreditCardToken($credit_card_token) - { - $this->credit_card_token = $credit_card_token; - return $this; - } - - /** - * PayPal vaulted credit Card instrument. - * - * @return \PayPal\Api\CreditCardToken - */ - public function getCreditCardToken() - { - return $this->credit_card_token; - } - - /** - * Payment Card information. - * - * @param \PayPal\Api\PaymentCard $payment_card - * - * @return $this - */ - public function setPaymentCard($payment_card) - { - $this->payment_card = $payment_card; - return $this; - } - - /** - * Payment Card information. - * - * @return \PayPal\Api\PaymentCard - */ - public function getPaymentCard() - { - return $this->payment_card; - } - - /** - * Bank Account information. - * @deprecated Not publicly available - * @param \PayPal\Api\ExtendedBankAccount $bank_account - * - * @return $this - */ - public function setBankAccount($bank_account) - { - $this->bank_account = $bank_account; - return $this; - } - - /** - * Bank Account information. - * @deprecated Not publicly available - * @return \PayPal\Api\ExtendedBankAccount - */ - public function getBankAccount() - { - return $this->bank_account; - } - - /** - * Vaulted bank account instrument. - * @deprecated Not publicly available - * @param \PayPal\Api\BankToken $bank_account_token - * - * @return $this - */ - public function setBankAccountToken($bank_account_token) - { - $this->bank_account_token = $bank_account_token; - return $this; - } - - /** - * Vaulted bank account instrument. - * @deprecated Not publicly available - * @return \PayPal\Api\BankToken - */ - public function getBankAccountToken() - { - return $this->bank_account_token; - } - - /** - * PayPal credit funding instrument. - * @deprecated Not publicly available - * @param \PayPal\Api\Credit $credit - * - * @return $this - */ - public function setCredit($credit) - { - $this->credit = $credit; - return $this; - } - - /** - * PayPal credit funding instrument. - * @deprecated Not publicly available - * @return \PayPal\Api\Credit - */ - public function getCredit() - { - return $this->credit; - } - - /** - * Incentive funding instrument. - * @deprecated Not publicly available - * @param \PayPal\Api\Incentive $incentive - * - * @return $this - */ - public function setIncentive($incentive) - { - $this->incentive = $incentive; - return $this; - } - - /** - * Incentive funding instrument. - * @deprecated Not publicly available - * @return \PayPal\Api\Incentive - */ - public function getIncentive() - { - return $this->incentive; - } - - /** - * External funding instrument. - * @deprecated Not publicly available - * @param \PayPal\Api\ExternalFunding $external_funding - * - * @return $this - */ - public function setExternalFunding($external_funding) - { - $this->external_funding = $external_funding; - return $this; - } - - /** - * External funding instrument. - * @deprecated Not publicly available - * @return \PayPal\Api\ExternalFunding - */ - public function getExternalFunding() - { - return $this->external_funding; - } - - /** - * Carrier account token instrument. - * @deprecated Not publicly available - * @param \PayPal\Api\CarrierAccountToken $carrier_account_token - * - * @return $this - */ - public function setCarrierAccountToken($carrier_account_token) - { - $this->carrier_account_token = $carrier_account_token; - return $this; - } - - /** - * Carrier account token instrument. - * @deprecated Not publicly available - * @return \PayPal\Api\CarrierAccountToken - */ - public function getCarrierAccountToken() - { - return $this->carrier_account_token; - } - - /** - * Carrier account instrument - * @deprecated Not publicly available - * @param \PayPal\Api\CarrierAccount $carrier_account - * - * @return $this - */ - public function setCarrierAccount($carrier_account) - { - $this->carrier_account = $carrier_account; - return $this; - } - - /** - * Carrier account instrument - * @deprecated Not publicly available - * @return \PayPal\Api\CarrierAccount - */ - public function getCarrierAccount() - { - return $this->carrier_account; - } - - /** - * Private Label Card funding instrument. These are store cards provided by merchants to drive business with value to customer with convenience and rewards. - * @deprecated Not publicly available - * @param \PayPal\Api\PrivateLabelCard $private_label_card - * - * @return $this - */ - public function setPrivateLabelCard($private_label_card) - { - $this->private_label_card = $private_label_card; - return $this; - } - - /** - * Private Label Card funding instrument. These are store cards provided by merchants to drive business with value to customer with convenience and rewards. - * @deprecated Not publicly available - * @return \PayPal\Api\PrivateLabelCard - */ - public function getPrivateLabelCard() - { - return $this->private_label_card; - } - - /** - * Billing instrument that references pre-approval information for the payment - * - * @param \PayPal\Api\Billing $billing - * - * @return $this - */ - public function setBilling($billing) - { - $this->billing = $billing; - return $this; - } - - /** - * Billing instrument that references pre-approval information for the payment - * - * @return \PayPal\Api\Billing - */ - public function getBilling() - { - return $this->billing; - } - - /** - * Alternate Payment information - Mostly regional payment providers. For e.g iDEAL in Netherlands - * - * @deprecated Not publicly available - * @param \PayPal\Api\AlternatePayment $alternate_payment - * - * @return $this - */ - public function setAlternatePayment($alternate_payment) - { - $this->alternate_payment = $alternate_payment; - return $this; - } - - /** - * Alternate Payment information - Mostly regional payment providers. For e.g iDEAL in Netherlands - * - * @deprecated Not publicly available - * @return \PayPal\Api\AlternatePayment - */ - public function getAlternatePayment() - { - return $this->alternate_payment; - } - -} diff --git a/paypal/PayPal/Api/FundingOption.php b/paypal/PayPal/Api/FundingOption.php deleted file mode 100644 index 9848a0c..0000000 --- a/paypal/PayPal/Api/FundingOption.php +++ /dev/null @@ -1,221 +0,0 @@ -id = $id; - return $this; - } - - /** - * id of the funding option. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * List of funding sources that contributes to a payment. - * - * @param \PayPal\Api\FundingSource[] $funding_sources - * - * @return $this - */ - public function setFundingSources($funding_sources) - { - $this->funding_sources = $funding_sources; - return $this; - } - - /** - * List of funding sources that contributes to a payment. - * - * @return \PayPal\Api\FundingSource[] - */ - public function getFundingSources() - { - return $this->funding_sources; - } - - /** - * Append FundingSources to the list. - * - * @param \PayPal\Api\FundingSource $fundingSource - * @return $this - */ - public function addFundingSource($fundingSource) - { - if (!$this->getFundingSources()) { - return $this->setFundingSources(array($fundingSource)); - } else { - return $this->setFundingSources( - array_merge($this->getFundingSources(), array($fundingSource)) - ); - } - } - - /** - * Remove FundingSources from the list. - * - * @param \PayPal\Api\FundingSource $fundingSource - * @return $this - */ - public function removeFundingSource($fundingSource) - { - return $this->setFundingSources( - array_diff($this->getFundingSources(), array($fundingSource)) - ); - } - - /** - * Backup funding instrument which will be used for payment if primary fails. - * - * @param \PayPal\Api\FundingInstrument $backup_funding_instrument - * - * @return $this - */ - public function setBackupFundingInstrument($backup_funding_instrument) - { - $this->backup_funding_instrument = $backup_funding_instrument; - return $this; - } - - /** - * Backup funding instrument which will be used for payment if primary fails. - * - * @return \PayPal\Api\FundingInstrument - */ - public function getBackupFundingInstrument() - { - return $this->backup_funding_instrument; - } - - /** - * Currency conversion applicable to this funding option. - * - * @param \PayPal\Api\CurrencyConversion $currency_conversion - * - * @return $this - */ - public function setCurrencyConversion($currency_conversion) - { - $this->currency_conversion = $currency_conversion; - return $this; - } - - /** - * Currency conversion applicable to this funding option. - * - * @return \PayPal\Api\CurrencyConversion - */ - public function getCurrencyConversion() - { - return $this->currency_conversion; - } - - /** - * Installment options available for a funding option. - * - * @param \PayPal\Api\InstallmentInfo $installment_info - * - * @return $this - */ - public function setInstallmentInfo($installment_info) - { - $this->installment_info = $installment_info; - return $this; - } - - /** - * Installment options available for a funding option. - * - * @return \PayPal\Api\InstallmentInfo - */ - public function getInstallmentInfo() - { - return $this->installment_info; - } - - /** - * Sets Links - * - * @param \PayPal\Api\Links[] $links - * - * @return $this - */ - public function setLinks($links) - { - $this->links = $links; - return $this; - } - - /** - * Gets Links - * - * @return \PayPal\Api\Links[] - */ - public function getLinks() - { - return $this->links; - } - - /** - * Append Links to the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function addLink($links) - { - if (!$this->getLinks()) { - return $this->setLinks(array($links)); - } else { - return $this->setLinks( - array_merge($this->getLinks(), array($links)) - ); - } - } - - /** - * Remove Links from the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function removeLink($links) - { - return $this->setLinks( - array_diff($this->getLinks(), array($links)) - ); - } - -} diff --git a/paypal/PayPal/Api/FundingSource.php b/paypal/PayPal/Api/FundingSource.php deleted file mode 100644 index 95f1799..0000000 --- a/paypal/PayPal/Api/FundingSource.php +++ /dev/null @@ -1,292 +0,0 @@ -funding_mode = $funding_mode; - return $this; - } - - /** - * specifies funding mode of the instrument - * - * @return string - */ - public function getFundingMode() - { - return $this->funding_mode; - } - - /** - * Instrument type for this funding source - * Valid Values: ["BALANCE", "PAYMENT_CARD", "BANK_ACCOUNT", "CREDIT", "INCENTIVE", "EXTERNAL_FUNDING", "TAB"] - * - * @param string $funding_instrument_type - * - * @return $this - */ - public function setFundingInstrumentType($funding_instrument_type) - { - $this->funding_instrument_type = $funding_instrument_type; - return $this; - } - - /** - * Instrument type for this funding source - * - * @return string - */ - public function getFundingInstrumentType() - { - return $this->funding_instrument_type; - } - - /** - * Soft descriptor used when charging this funding source. - * - * @param string $soft_descriptor - * - * @return $this - */ - public function setSoftDescriptor($soft_descriptor) - { - $this->soft_descriptor = $soft_descriptor; - return $this; - } - - /** - * Soft descriptor used when charging this funding source. - * - * @return string - */ - public function getSoftDescriptor() - { - return $this->soft_descriptor; - } - - /** - * Total anticipated amount of money to be pulled from instrument. - * - * @param \PayPal\Api\Currency $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * Total anticipated amount of money to be pulled from instrument. - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Additional amount to be pulled from the instrument to recover a negative balance on the buyer's account that is owed to PayPal. - * - * @param \PayPal\Api\Currency $negative_balance_amount - * - * @return $this - */ - public function setNegativeBalanceAmount($negative_balance_amount) - { - $this->negative_balance_amount = $negative_balance_amount; - return $this; - } - - /** - * Additional amount to be pulled from the instrument to recover a negative balance on the buyer's account that is owed to PayPal. - * - * @return \PayPal\Api\Currency - */ - public function getNegativeBalanceAmount() - { - return $this->negative_balance_amount; - } - - /** - * Localized legal text relevant to funding source. - * - * @param string $legal_text - * - * @return $this - */ - public function setLegalText($legal_text) - { - $this->legal_text = $legal_text; - return $this; - } - - /** - * Localized legal text relevant to funding source. - * - * @return string - */ - public function getLegalText() - { - return $this->legal_text; - } - - /** - * Additional detail of the funding. - * - * @param \PayPal\Api\FundingDetail $funding_detail - * - * @return $this - */ - public function setFundingDetail($funding_detail) - { - $this->funding_detail = $funding_detail; - return $this; - } - - /** - * Additional detail of the funding. - * - * @return \PayPal\Api\FundingDetail - */ - public function getFundingDetail() - { - return $this->funding_detail; - } - - /** - * Additional text relevant to funding source. - * - * @param string $additional_text - * - * @return $this - */ - public function setAdditionalText($additional_text) - { - $this->additional_text = $additional_text; - return $this; - } - - /** - * Additional text relevant to funding source. - * - * @return string - */ - public function getAdditionalText() - { - return $this->additional_text; - } - - /** - * Sets Extends - * - * @param \PayPal\Api\FundingInstrument $extends - * - * @deprecated Unused - * - * @return $this - */ - public function setExtends($extends) - { - $this->extends = $extends; - return $this; - } - - /** - * Gets Extends - * - * @deprecated Unused - * - * @return \PayPal\Api\FundingInstrument - */ - public function getExtends() - { - return $this->extends; - } - - /** - * Sets Links - * - * @param \PayPal\Api\Links[] $links - * - * @return $this - */ - public function setLinks($links) - { - $this->links = $links; - return $this; - } - - /** - * Gets Links - * - * @return \PayPal\Api\Links[] - */ - public function getLinks() - { - return $this->links; - } - - /** - * Append Links to the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function addLink($links) - { - if (!$this->getLinks()) { - return $this->setLinks(array($links)); - } else { - return $this->setLinks( - array_merge($this->getLinks(), array($links)) - ); - } - } - - /** - * Remove Links from the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function removeLink($links) - { - return $this->setLinks( - array_diff($this->getLinks(), array($links)) - ); - } - -} diff --git a/paypal/PayPal/Api/FuturePayment.php b/paypal/PayPal/Api/FuturePayment.php deleted file mode 100644 index 9744808..0000000 --- a/paypal/PayPal/Api/FuturePayment.php +++ /dev/null @@ -1,59 +0,0 @@ - $clientMetadataId - ); - } - $payLoad = $this->toJSON(); - $json = self::executeCall( - "/v1/payments/payment", - "POST", - $payLoad, - $headers, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Get a Refresh Token from Authorization Code - * - * @param $authorizationCode - * @param ApiContext $apiContext - * @return string|null refresh token - */ - public static function getRefreshToken($authorizationCode, $apiContext = null) - { - $apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential); - $credential = $apiContext->getCredential(); - return $credential->getRefreshToken($apiContext->getConfig(), $authorizationCode); - } - -} diff --git a/paypal/PayPal/Api/HyperSchema.php b/paypal/PayPal/Api/HyperSchema.php deleted file mode 100644 index 7ef5dbb..0000000 --- a/paypal/PayPal/Api/HyperSchema.php +++ /dev/null @@ -1,191 +0,0 @@ -links = $links; - return $this; - } - - /** - * Gets Links - * - * @return \PayPal\Api\Links[] - */ - public function getLinks() - { - return $this->links; - } - - /** - * Append Links to the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function addLink($links) - { - if (!$this->getLinks()) { - return $this->setLinks(array($links)); - } else { - return $this->setLinks( - array_merge($this->getLinks(), array($links)) - ); - } - } - - /** - * Remove Links from the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function removeLink($links) - { - return $this->setLinks( - array_diff($this->getLinks(), array($links)) - ); - } - - /** - * Sets FragmentResolution - * - * @param string $fragmentResolution - * - * @return $this - */ - public function setFragmentResolution($fragmentResolution) - { - $this->fragmentResolution = $fragmentResolution; - return $this; - } - - /** - * Gets FragmentResolution - * - * @return string - */ - public function getFragmentResolution() - { - return $this->fragmentResolution; - } - - /** - * Sets Readonly - * - * @param bool $readonly - * - * @return $this - */ - public function setReadonly($readonly) - { - $this->readonly = $readonly; - return $this; - } - - /** - * Gets Readonly - * - * @return bool - */ - public function getReadonly() - { - return $this->readonly; - } - - /** - * Sets ContentEncoding - * - * @param string $contentEncoding - * - * @return $this - */ - public function setContentEncoding($contentEncoding) - { - $this->contentEncoding = $contentEncoding; - return $this; - } - - /** - * Gets ContentEncoding - * - * @return string - */ - public function getContentEncoding() - { - return $this->contentEncoding; - } - - /** - * Sets PathStart - * - * @param string $pathStart - * - * @return $this - */ - public function setPathStart($pathStart) - { - $this->pathStart = $pathStart; - return $this; - } - - /** - * Gets PathStart - * - * @return string - */ - public function getPathStart() - { - return $this->pathStart; - } - - /** - * Sets MediaType - * - * @param string $mediaType - * - * @return $this - */ - public function setMediaType($mediaType) - { - $this->mediaType = $mediaType; - return $this; - } - - /** - * Gets MediaType - * - * @return string - */ - public function getMediaType() - { - return $this->mediaType; - } - -} diff --git a/paypal/PayPal/Api/Image.php b/paypal/PayPal/Api/Image.php deleted file mode 100644 index 71c7d15..0000000 --- a/paypal/PayPal/Api/Image.php +++ /dev/null @@ -1,56 +0,0 @@ -image = $imageBase64String; - return $this; - } - - /** - * Get Image as Base-64 encoded String - * - * @return string - */ - public function getImage() - { - return $this->image; - } - - /** - * Stores the Image to file - * - * @param string $name File Name - * @return string File name - */ - public function saveToFile($name = null) - { - // Self Generate File Location - if (!$name) { - $name = uniqid() . '.png'; - } - // Save to File - file_put_contents($name, base64_decode($this->getImage())); - return $name; - } - -} diff --git a/paypal/PayPal/Api/Incentive.php b/paypal/PayPal/Api/Incentive.php deleted file mode 100644 index 7493a65..0000000 --- a/paypal/PayPal/Api/Incentive.php +++ /dev/null @@ -1,236 +0,0 @@ -id = $id; - return $this; - } - - /** - * Identifier of the instrument in PayPal Wallet - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Code that identifies the incentive. - * - * @param string $code - * - * @return $this - */ - public function setCode($code) - { - $this->code = $code; - return $this; - } - - /** - * Code that identifies the incentive. - * - * @return string - */ - public function getCode() - { - return $this->code; - } - - /** - * Name of the incentive. - * - * @param string $name - * - * @return $this - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * Name of the incentive. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Description of the incentive. - * - * @param string $description - * - * @return $this - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * Description of the incentive. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Indicates incentive is applicable for this minimum purchase amount. - * - * @param \PayPal\Api\Currency $minimum_purchase_amount - * - * @return $this - */ - public function setMinimumPurchaseAmount($minimum_purchase_amount) - { - $this->minimum_purchase_amount = $minimum_purchase_amount; - return $this; - } - - /** - * Indicates incentive is applicable for this minimum purchase amount. - * - * @return \PayPal\Api\Currency - */ - public function getMinimumPurchaseAmount() - { - return $this->minimum_purchase_amount; - } - - /** - * Logo image url for the incentive. - * - * @param string $logo_image_url - * @throws \InvalidArgumentException - * @return $this - */ - public function setLogoImageUrl($logo_image_url) - { - UrlValidator::validate($logo_image_url, "LogoImageUrl"); - $this->logo_image_url = $logo_image_url; - return $this; - } - - /** - * Logo image url for the incentive. - * - * @return string - */ - public function getLogoImageUrl() - { - return $this->logo_image_url; - } - - /** - * expiry date of the incentive. - * - * @param string $expiry_date - * - * @return $this - */ - public function setExpiryDate($expiry_date) - { - $this->expiry_date = $expiry_date; - return $this; - } - - /** - * expiry date of the incentive. - * - * @return string - */ - public function getExpiryDate() - { - return $this->expiry_date; - } - - /** - * Specifies type of incentive - * Valid Values: ["COUPON", "GIFT_CARD", "MERCHANT_SPECIFIC_BALANCE", "VOUCHER"] - * - * @param string $type - * - * @return $this - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * Specifies type of incentive - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * URI to the associated terms - * - * @param string $terms - * - * @return $this - */ - public function setTerms($terms) - { - $this->terms = $terms; - return $this; - } - - /** - * URI to the associated terms - * - * @return string - */ - public function getTerms() - { - return $this->terms; - } - -} diff --git a/paypal/PayPal/Api/InputFields.php b/paypal/PayPal/Api/InputFields.php deleted file mode 100644 index 1b8c088..0000000 --- a/paypal/PayPal/Api/InputFields.php +++ /dev/null @@ -1,89 +0,0 @@ -allow_note = $allow_note; - return $this; - } - - /** - * Indicates whether the buyer can enter a note to the merchant on the PayPal page during checkout. - * - * @return bool - */ - public function getAllowNote() - { - return $this->allow_note; - } - - /** - * Indicates whether PayPal displays shipping address fields on the experience pages. Valid value is `0`, `1`, or `2`. Set to `0` to display the shipping address on the PayPal pages. Set to `1` to redact shipping address fields from the PayPal pages. Set to `2` to not pass the shipping address but instead get it from the buyer's account profile. For digital goods, this field is required and value must be `1`. - * - * @param int $no_shipping - * - * @return $this - */ - public function setNoShipping($no_shipping) - { - $this->no_shipping = $no_shipping; - return $this; - } - - /** - * Indicates whether PayPal displays shipping address fields on the experience pages. Valid value is `0`, `1`, or `2`. Set to `0` to display the shipping address on the PayPal pages. Set to `1` to redact shipping address fields from the PayPal pages. Set to `2` to not pass the shipping address but instead get it from the buyer's account profile. For digital goods, this field is required and value must be `1`. - * - * @return int - */ - public function getNoShipping() - { - return $this->no_shipping; - } - - /** - * Indicates whether to display the shipping address that is passed to this call rather than the one on file with PayPal for this buyer on the PayPal experience pages. Valid value is `0` or `1`. Set to `0` to display the shipping address on file. Set to `1` to display the shipping address supplied to this call; the buyer cannot edit this shipping address. - * - * @param int $address_override - * - * @return $this - */ - public function setAddressOverride($address_override) - { - $this->address_override = $address_override; - return $this; - } - - /** - * Indicates whether to display the shipping address that is passed to this call rather than the one on file with PayPal for this buyer on the PayPal experience pages. Valid value is `0` or `1`. Set to `0` to display the shipping address on file. Set to `1` to display the shipping address supplied to this call; the buyer cannot edit this shipping address. - * - * @return int - */ - public function getAddressOverride() - { - return $this->address_override; - } - -} diff --git a/paypal/PayPal/Api/InstallmentInfo.php b/paypal/PayPal/Api/InstallmentInfo.php deleted file mode 100644 index d0cbc51..0000000 --- a/paypal/PayPal/Api/InstallmentInfo.php +++ /dev/null @@ -1,144 +0,0 @@ -installment_id = $installment_id; - return $this; - } - - /** - * Installment id. - * - * @return string - */ - public function getInstallmentId() - { - return $this->installment_id; - } - - /** - * Credit card network. - * Valid Values: ["VISA", "MASTERCARD"] - * - * @param string $network - * - * @return $this - */ - public function setNetwork($network) - { - $this->network = $network; - return $this; - } - - /** - * Credit card network. - * - * @return string - */ - public function getNetwork() - { - return $this->network; - } - - /** - * Credit card issuer. - * - * @param string $issuer - * - * @return $this - */ - public function setIssuer($issuer) - { - $this->issuer = $issuer; - return $this; - } - - /** - * Credit card issuer. - * - * @return string - */ - public function getIssuer() - { - return $this->issuer; - } - - /** - * List of available installment options and the cost associated with each one. - * - * @param \PayPal\Api\InstallmentOption[] $installment_options - * - * @return $this - */ - public function setInstallmentOptions($installment_options) - { - $this->installment_options = $installment_options; - return $this; - } - - /** - * List of available installment options and the cost associated with each one. - * - * @return \PayPal\Api\InstallmentOption[] - */ - public function getInstallmentOptions() - { - return $this->installment_options; - } - - /** - * Append InstallmentOptions to the list. - * - * @param \PayPal\Api\InstallmentOption $installmentOption - * @return $this - */ - public function addInstallmentOption($installmentOption) - { - if (!$this->getInstallmentOptions()) { - return $this->setInstallmentOptions(array($installmentOption)); - } else { - return $this->setInstallmentOptions( - array_merge($this->getInstallmentOptions(), array($installmentOption)) - ); - } - } - - /** - * Remove InstallmentOptions from the list. - * - * @param \PayPal\Api\InstallmentOption $installmentOption - * @return $this - */ - public function removeInstallmentOption($installmentOption) - { - return $this->setInstallmentOptions( - array_diff($this->getInstallmentOptions(), array($installmentOption)) - ); - } - -} diff --git a/paypal/PayPal/Api/InstallmentOption.php b/paypal/PayPal/Api/InstallmentOption.php deleted file mode 100644 index 58e1b92..0000000 --- a/paypal/PayPal/Api/InstallmentOption.php +++ /dev/null @@ -1,113 +0,0 @@ -term = $term; - return $this; - } - - /** - * Number of installments - * - * @return int - */ - public function getTerm() - { - return $this->term; - } - - /** - * Monthly payment - * - * @param \PayPal\Api\Currency $monthly_payment - * - * @return $this - */ - public function setMonthlyPayment($monthly_payment) - { - $this->monthly_payment = $monthly_payment; - return $this; - } - - /** - * Monthly payment - * - * @return \PayPal\Api\Currency - */ - public function getMonthlyPayment() - { - return $this->monthly_payment; - } - - /** - * Discount amount applied to the payment, if any - * - * @param \PayPal\Api\Currency $discount_amount - * - * @return $this - */ - public function setDiscountAmount($discount_amount) - { - $this->discount_amount = $discount_amount; - return $this; - } - - /** - * Discount amount applied to the payment, if any - * - * @return \PayPal\Api\Currency - */ - public function getDiscountAmount() - { - return $this->discount_amount; - } - - /** - * Discount percentage applied to the payment, if any - * - * @param string $discount_percentage - * - * @return $this - */ - public function setDiscountPercentage($discount_percentage) - { - $this->discount_percentage = $discount_percentage; - return $this; - } - - /** - * Discount percentage applied to the payment, if any - * - * @return string - */ - public function getDiscountPercentage() - { - return $this->discount_percentage; - } - -} diff --git a/paypal/PayPal/Api/Invoice.php b/paypal/PayPal/Api/Invoice.php deleted file mode 100644 index 37efa26..0000000 --- a/paypal/PayPal/Api/Invoice.php +++ /dev/null @@ -1,1340 +0,0 @@ -id = $id; - return $this; - } - - /** - * The unique invoice resource identifier. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Unique number that appears on the invoice. If left blank will be auto-incremented from the last number. 25 characters max. - * - * @param string $number - * - * @return $this - */ - public function setNumber($number) - { - $this->number = $number; - return $this; - } - - /** - * Unique number that appears on the invoice. If left blank will be auto-incremented from the last number. 25 characters max. - * - * @return string - */ - public function getNumber() - { - return $this->number; - } - - /** - * The template ID used for the invoice. Useful for copy functionality. - * - * @param string $template_id - * - * @return $this - */ - public function setTemplateId($template_id) - { - $this->template_id = $template_id; - return $this; - } - - /** - * The template ID used for the invoice. Useful for copy functionality. - * - * @return string - */ - public function getTemplateId() - { - return $this->template_id; - } - - /** - * URI of the invoice resource. - * - * @param string $uri - * - * @return $this - */ - public function setUri($uri) - { - $this->uri = $uri; - return $this; - } - - /** - * URI of the invoice resource. - * - * @return string - */ - public function getUri() - { - return $this->uri; - } - - /** - * Status of the invoice. - * Valid Values: ["DRAFT", "SENT", "PAID", "MARKED_AS_PAID", "CANCELLED", "REFUNDED", "PARTIALLY_REFUNDED", "MARKED_AS_REFUNDED", "UNPAID", "PAYMENT_PENDING"] - * - * @param string $status - * - * @return $this - */ - public function setStatus($status) - { - $this->status = $status; - return $this; - } - - /** - * Status of the invoice. - * - * @return string - */ - public function getStatus() - { - return $this->status; - } - - /** - * Information about the merchant who is sending the invoice. - * - * @param \PayPal\Api\MerchantInfo $merchant_info - * - * @return $this - */ - public function setMerchantInfo($merchant_info) - { - $this->merchant_info = $merchant_info; - return $this; - } - - /** - * Information about the merchant who is sending the invoice. - * - * @return \PayPal\Api\MerchantInfo - */ - public function getMerchantInfo() - { - return $this->merchant_info; - } - - /** - * The required invoice recipient email address and any optional billing information. One recipient is supported. - * - * @param \PayPal\Api\BillingInfo[] $billing_info - * - * @return $this - */ - public function setBillingInfo($billing_info) - { - $this->billing_info = $billing_info; - return $this; - } - - /** - * The required invoice recipient email address and any optional billing information. One recipient is supported. - * - * @return \PayPal\Api\BillingInfo[] - */ - public function getBillingInfo() - { - return $this->billing_info; - } - - /** - * Append BillingInfo to the list. - * - * @param \PayPal\Api\BillingInfo $billingInfo - * @return $this - */ - public function addBillingInfo($billingInfo) - { - if (!$this->getBillingInfo()) { - return $this->setBillingInfo(array($billingInfo)); - } else { - return $this->setBillingInfo( - array_merge($this->getBillingInfo(), array($billingInfo)) - ); - } - } - - /** - * Remove BillingInfo from the list. - * - * @param \PayPal\Api\BillingInfo $billingInfo - * @return $this - */ - public function removeBillingInfo($billingInfo) - { - return $this->setBillingInfo( - array_diff($this->getBillingInfo(), array($billingInfo)) - ); - } - - /** - * For invoices sent by email, one or more email addresses to which to send a Cc: copy of the notification. Supports only email addresses under participant. - * - * @param \PayPal\Api\Participant[] $cc_info - * - * @return $this - */ - public function setCcInfo($cc_info) - { - $this->cc_info = $cc_info; - return $this; - } - - /** - * For invoices sent by email, one or more email addresses to which to send a Cc: copy of the notification. Supports only email addresses under participant. - * - * @return \PayPal\Api\Participant[] - */ - public function getCcInfo() - { - return $this->cc_info; - } - - /** - * Append CcInfo to the list. - * - * @param \PayPal\Api\Participant $participant - * @return $this - */ - public function addCcInfo($participant) - { - if (!$this->getCcInfo()) { - return $this->setCcInfo(array($participant)); - } else { - return $this->setCcInfo( - array_merge($this->getCcInfo(), array($participant)) - ); - } - } - - /** - * Remove CcInfo from the list. - * - * @param \PayPal\Api\Participant $participant - * @return $this - */ - public function removeCcInfo($participant) - { - return $this->setCcInfo( - array_diff($this->getCcInfo(), array($participant)) - ); - } - - /** - * The shipping information for entities to whom items are being shipped. - * - * @param \PayPal\Api\ShippingInfo $shipping_info - * - * @return $this - */ - public function setShippingInfo($shipping_info) - { - $this->shipping_info = $shipping_info; - return $this; - } - - /** - * The shipping information for entities to whom items are being shipped. - * - * @return \PayPal\Api\ShippingInfo - */ - public function getShippingInfo() - { - return $this->shipping_info; - } - - /** - * The list of items to include in the invoice. Maximum value is 100 items per invoice. - * - * @param \PayPal\Api\InvoiceItem[] $items - * - * @return $this - */ - public function setItems($items) - { - $this->items = $items; - return $this; - } - - /** - * The list of items to include in the invoice. Maximum value is 100 items per invoice. - * - * @return \PayPal\Api\InvoiceItem[] - */ - public function getItems() - { - return $this->items; - } - - /** - * Append Items to the list. - * - * @param \PayPal\Api\InvoiceItem $invoiceItem - * @return $this - */ - public function addItem($invoiceItem) - { - if (!$this->getItems()) { - return $this->setItems(array($invoiceItem)); - } else { - return $this->setItems( - array_merge($this->getItems(), array($invoiceItem)) - ); - } - } - - /** - * Remove Items from the list. - * - * @param \PayPal\Api\InvoiceItem $invoiceItem - * @return $this - */ - public function removeItem($invoiceItem) - { - return $this->setItems( - array_diff($this->getItems(), array($invoiceItem)) - ); - } - - /** - * The date when the invoice was enabled. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $invoice_date - * - * @return $this - */ - public function setInvoiceDate($invoice_date) - { - $this->invoice_date = $invoice_date; - return $this; - } - - /** - * The date when the invoice was enabled. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getInvoiceDate() - { - return $this->invoice_date; - } - - /** - * Optional. The payment deadline for the invoice. Value is either `term_type` or `due_date` but not both. - * - * @param \PayPal\Api\PaymentTerm $payment_term - * - * @return $this - */ - public function setPaymentTerm($payment_term) - { - $this->payment_term = $payment_term; - return $this; - } - - /** - * Optional. The payment deadline for the invoice. Value is either `term_type` or `due_date` but not both. - * - * @return \PayPal\Api\PaymentTerm - */ - public function getPaymentTerm() - { - return $this->payment_term; - } - - /** - * Reference data, such as PO number, to add to the invoice. Maximum length is 60 characters. - * - * @param string $reference - * - * @return $this - */ - public function setReference($reference) - { - $this->reference = $reference; - return $this; - } - - /** - * Reference data, such as PO number, to add to the invoice. Maximum length is 60 characters. - * - * @return string - */ - public function getReference() - { - return $this->reference; - } - - /** - * The invoice level discount, as a percent or an amount value. - * - * @param \PayPal\Api\Cost $discount - * - * @return $this - */ - public function setDiscount($discount) - { - $this->discount = $discount; - return $this; - } - - /** - * The invoice level discount, as a percent or an amount value. - * - * @return \PayPal\Api\Cost - */ - public function getDiscount() - { - return $this->discount; - } - - /** - * The shipping cost, as a percent or an amount value. - * - * @param \PayPal\Api\ShippingCost $shipping_cost - * - * @return $this - */ - public function setShippingCost($shipping_cost) - { - $this->shipping_cost = $shipping_cost; - return $this; - } - - /** - * The shipping cost, as a percent or an amount value. - * - * @return \PayPal\Api\ShippingCost - */ - public function getShippingCost() - { - return $this->shipping_cost; - } - - /** - * The custom amount to apply on an invoice. If you include a label, the amount cannot be empty. - * - * @param \PayPal\Api\CustomAmount $custom - * - * @return $this - */ - public function setCustom($custom) - { - $this->custom = $custom; - return $this; - } - - /** - * The custom amount to apply on an invoice. If you include a label, the amount cannot be empty. - * - * @return \PayPal\Api\CustomAmount - */ - public function getCustom() - { - return $this->custom; - } - - /** - * Indicates whether the invoice allows a partial payment. If set to `false`, invoice must be paid in full. If set to `true`, the invoice allows partial payments. Default is `false`. - * - * @param bool $allow_partial_payment - * - * @return $this - */ - public function setAllowPartialPayment($allow_partial_payment) - { - $this->allow_partial_payment = $allow_partial_payment; - return $this; - } - - /** - * Indicates whether the invoice allows a partial payment. If set to `false`, invoice must be paid in full. If set to `true`, the invoice allows partial payments. Default is `false`. - * - * @return bool - */ - public function getAllowPartialPayment() - { - return $this->allow_partial_payment; - } - - /** - * If `allow_partial_payment` is set to `true`, the minimum amount allowed for a partial payment. - * - * @param \PayPal\Api\Currency $minimum_amount_due - * - * @return $this - */ - public function setMinimumAmountDue($minimum_amount_due) - { - $this->minimum_amount_due = $minimum_amount_due; - return $this; - } - - /** - * If `allow_partial_payment` is set to `true`, the minimum amount allowed for a partial payment. - * - * @return \PayPal\Api\Currency - */ - public function getMinimumAmountDue() - { - return $this->minimum_amount_due; - } - - /** - * Indicates whether tax is calculated before or after a discount. If set to `false`, the tax is calculated before a discount. If set to `true`, the tax is calculated after a discount. Default is `false`. - * - * @param bool $tax_calculated_after_discount - * - * @return $this - */ - public function setTaxCalculatedAfterDiscount($tax_calculated_after_discount) - { - $this->tax_calculated_after_discount = $tax_calculated_after_discount; - return $this; - } - - /** - * Indicates whether tax is calculated before or after a discount. If set to `false`, the tax is calculated before a discount. If set to `true`, the tax is calculated after a discount. Default is `false`. - * - * @return bool - */ - public function getTaxCalculatedAfterDiscount() - { - return $this->tax_calculated_after_discount; - } - - /** - * Indicates whether the unit price includes tax. Default is `false`. - * - * @param bool $tax_inclusive - * - * @return $this - */ - public function setTaxInclusive($tax_inclusive) - { - $this->tax_inclusive = $tax_inclusive; - return $this; - } - - /** - * Indicates whether the unit price includes tax. Default is `false`. - * - * @return bool - */ - public function getTaxInclusive() - { - return $this->tax_inclusive; - } - - /** - * General terms of the invoice. 4000 characters max. - * - * @param string $terms - * - * @return $this - */ - public function setTerms($terms) - { - $this->terms = $terms; - return $this; - } - - /** - * General terms of the invoice. 4000 characters max. - * - * @return string - */ - public function getTerms() - { - return $this->terms; - } - - /** - * Note to the payer. 4000 characters max. - * - * @param string $note - * - * @return $this - */ - public function setNote($note) - { - $this->note = $note; - return $this; - } - - /** - * Note to the payer. 4000 characters max. - * - * @return string - */ - public function getNote() - { - return $this->note; - } - - /** - * A private bookkeeping memo for the merchant. Maximum length is 150 characters. - * - * @param string $merchant_memo - * - * @return $this - */ - public function setMerchantMemo($merchant_memo) - { - $this->merchant_memo = $merchant_memo; - return $this; - } - - /** - * A private bookkeeping memo for the merchant. Maximum length is 150 characters. - * - * @return string - */ - public function getMerchantMemo() - { - return $this->merchant_memo; - } - - /** - * Full URL of an external image to use as the logo. Maximum length is 4000 characters. - * - * @param string $logo_url - * @throws \InvalidArgumentException - * @return $this - */ - public function setLogoUrl($logo_url) - { - UrlValidator::validate($logo_url, "LogoUrl"); - $this->logo_url = $logo_url; - return $this; - } - - /** - * Full URL of an external image to use as the logo. Maximum length is 4000 characters. - * - * @return string - */ - public function getLogoUrl() - { - return $this->logo_url; - } - - /** - * The total amount of the invoice. - * - * @param \PayPal\Api\Currency $total_amount - * - * @return $this - */ - public function setTotalAmount($total_amount) - { - $this->total_amount = $total_amount; - return $this; - } - - /** - * The total amount of the invoice. - * - * @return \PayPal\Api\Currency - */ - public function getTotalAmount() - { - return $this->total_amount; - } - - /** - * List of payment details for the invoice. - * - * @param \PayPal\Api\PaymentDetail[] $payments - * - * @return $this - */ - public function setPayments($payments) - { - $this->payments = $payments; - return $this; - } - - /** - * List of payment details for the invoice. - * - * @return \PayPal\Api\PaymentDetail[] - */ - public function getPayments() - { - return $this->payments; - } - - /** - * Append Payments to the list. - * - * @param \PayPal\Api\PaymentDetail $paymentDetail - * @return $this - */ - public function addPayment($paymentDetail) - { - if (!$this->getPayments()) { - return $this->setPayments(array($paymentDetail)); - } else { - return $this->setPayments( - array_merge($this->getPayments(), array($paymentDetail)) - ); - } - } - - /** - * Remove Payments from the list. - * - * @param \PayPal\Api\PaymentDetail $paymentDetail - * @return $this - */ - public function removePayment($paymentDetail) - { - return $this->setPayments( - array_diff($this->getPayments(), array($paymentDetail)) - ); - } - - /** - * List of refund details for the invoice. - * - * @param \PayPal\Api\RefundDetail[] $refunds - * - * @return $this - */ - public function setRefunds($refunds) - { - $this->refunds = $refunds; - return $this; - } - - /** - * List of refund details for the invoice. - * - * @return \PayPal\Api\RefundDetail[] - */ - public function getRefunds() - { - return $this->refunds; - } - - /** - * Append Refunds to the list. - * - * @param \PayPal\Api\RefundDetail $refundDetail - * @return $this - */ - public function addRefund($refundDetail) - { - if (!$this->getRefunds()) { - return $this->setRefunds(array($refundDetail)); - } else { - return $this->setRefunds( - array_merge($this->getRefunds(), array($refundDetail)) - ); - } - } - - /** - * Remove Refunds from the list. - * - * @param \PayPal\Api\RefundDetail $refundDetail - * @return $this - */ - public function removeRefund($refundDetail) - { - return $this->setRefunds( - array_diff($this->getRefunds(), array($refundDetail)) - ); - } - - /** - * Audit information for the invoice. - * - * @param \PayPal\Api\Metadata $metadata - * - * @return $this - */ - public function setMetadata($metadata) - { - $this->metadata = $metadata; - return $this; - } - - /** - * Audit information for the invoice. - * - * @return \PayPal\Api\Metadata - */ - public function getMetadata() - { - return $this->metadata; - } - - /** - * Any miscellaneous invoice data. Maximum length is 4000 characters. - * @deprecated Not publicly available - * @param string $additional_data - * - * @return $this - */ - public function setAdditionalData($additional_data) - { - $this->additional_data = $additional_data; - return $this; - } - - /** - * Any miscellaneous invoice data. Maximum length is 4000 characters. - * @deprecated Not publicly available - * @return string - */ - public function getAdditionalData() - { - return $this->additional_data; - } - - /** - * Payment summary of the invoice including amount paid through PayPal and other sources. - * - * @param \PayPal\Api\PaymentSummary $paid_amount - * - * @return $this - */ - public function setPaidAmount($paid_amount) - { - $this->paid_amount = $paid_amount; - return $this; - } - - /** - * Payment summary of the invoice including amount paid through PayPal and other sources. - * - * @return \PayPal\Api\PaymentSummary - */ - public function getPaidAmount() - { - return $this->paid_amount; - } - - /** - * Payment summary of the invoice including amount refunded through PayPal and other sources. - * - * @param \PayPal\Api\PaymentSummary $refunded_amount - * - * @return $this - */ - public function setRefundedAmount($refunded_amount) - { - $this->refunded_amount = $refunded_amount; - return $this; - } - - /** - * Payment summary of the invoice including amount refunded through PayPal and other sources. - * - * @return \PayPal\Api\PaymentSummary - */ - public function getRefundedAmount() - { - return $this->refunded_amount; - } - - /** - * List of files attached to the invoice. - * - * @param \PayPal\Api\FileAttachment[] $attachments - * - * @return $this - */ - public function setAttachments($attachments) - { - $this->attachments = $attachments; - return $this; - } - - /** - * List of files attached to the invoice. - * - * @return \PayPal\Api\FileAttachment[] - */ - public function getAttachments() - { - return $this->attachments; - } - - /** - * Append Attachments to the list. - * - * @param \PayPal\Api\FileAttachment $fileAttachment - * @return $this - */ - public function addAttachment($fileAttachment) - { - if (!$this->getAttachments()) { - return $this->setAttachments(array($fileAttachment)); - } else { - return $this->setAttachments( - array_merge($this->getAttachments(), array($fileAttachment)) - ); - } - } - - /** - * Remove Attachments from the list. - * - * @param \PayPal\Api\FileAttachment $fileAttachment - * @return $this - */ - public function removeAttachment($fileAttachment) - { - return $this->setAttachments( - array_diff($this->getAttachments(), array($fileAttachment)) - ); - } - - /** - * Creates an invoice. Include invoice details including merchant information in the request. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Invoice - */ - public function create($apiContext = null, $restCall = null) - { - $payLoad = $this->toJSON(); - $json = self::executeCall( - "/v1/invoicing/invoices", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Searches for an invoice or invoices. Include a search object that specifies your search criteria in the request. - * - * @param Search $search - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return InvoiceSearchResponse - */ - public static function search($search, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($search, 'search'); - $payLoad = $search->toJSON(); - $json = self::executeCall( - "/v1/invoicing/search", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new InvoiceSearchResponse(); - $ret->fromJson($json); - return $ret; - } - - /** - * Sends an invoice, by ID, to a recipient. Optionally, set the `notify_merchant` query parameter to send the merchant an invoice update notification. By default, `notify_merchant` is `true`. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function send($apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - $payLoad = ""; - self::executeCall( - "/v1/invoicing/invoices/{$this->getId()}/send", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Sends a reminder about a specific invoice, by ID, to a recipient. Include a notification object that defines the reminder subject and other details in the JSON request body. - * - * @param Notification $notification - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function remind($notification, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($notification, 'notification'); - $payLoad = $notification->toJSON(); - self::executeCall( - "/v1/invoicing/invoices/{$this->getId()}/remind", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Cancels an invoice, by ID. - * - * @param CancelNotification $cancelNotification - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function cancel($cancelNotification, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($cancelNotification, 'cancelNotification'); - $payLoad = $cancelNotification->toJSON(); - self::executeCall( - "/v1/invoicing/invoices/{$this->getId()}/cancel", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Marks the status of a specified invoice, by ID, as paid. Include a payment detail object that defines the payment method and other details in the JSON request body. - * - * @param PaymentDetail $paymentDetail - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function recordPayment($paymentDetail, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($paymentDetail, 'paymentDetail'); - $payLoad = $paymentDetail->toJSON(); - self::executeCall( - "/v1/invoicing/invoices/{$this->getId()}/record-payment", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Marks the status of a specified invoice, by ID, as refunded. Include a refund detail object that defines the refund type and other details in the JSON request body. - * - * @param RefundDetail $refundDetail - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function recordRefund($refundDetail, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($refundDetail, 'refundDetail'); - $payLoad = $refundDetail->toJSON(); - self::executeCall( - "/v1/invoicing/invoices/{$this->getId()}/record-refund", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Gets the details for a specified invoice, by ID. - * - * @param string $invoiceId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Invoice - */ - public static function get($invoiceId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($invoiceId, 'invoiceId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/invoicing/invoices/$invoiceId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Invoice(); - $ret->fromJson($json); - return $ret; - } - - /** - * Lists some or all merchant invoices. Filters the response by any specified optional query string parameters. - * - * @param array $params - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return InvoiceSearchResponse - */ - public static function getAll($params = array(), $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($params, 'params'); - - $allowedParams = array( - 'page' => 1, - 'page_size' => 1, - 'total_count_required' => 1 - ); - - $payLoad = ""; - $json = self::executeCall( - "/v1/invoicing/invoices/?" . http_build_query(array_intersect_key($params, $allowedParams)), - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new InvoiceSearchResponse(); - $ret->fromJson($json); - return $ret; - } - - /** - * Fully updates an invoice by passing the invoice ID to the request URI. In addition, pass a complete invoice object in the request JSON. Partial updates are not supported. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Invoice - */ - public function update($apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - $payLoad = $this->toJSON(); - $json = self::executeCall( - "/v1/invoicing/invoices/{$this->getId()}", - "PUT", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Delete a particular invoice by passing the invoice ID to the request URI. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function delete($apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - $payLoad = ""; - self::executeCall( - "/v1/invoicing/invoices/{$this->getId()}", - "DELETE", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Delete external payment. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function deleteExternalPayment($transactionId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($transactionId, "TransactionId"); - $payLoad = ""; - self::executeCall( - "/v1/invoicing/invoices/{$this->getId()}/payment-records/{$transactionId}", - "DELETE", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Delete external refund. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function deleteExternalRefund($transactionId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($transactionId, "TransactionId"); - $payLoad = ""; - self::executeCall( - "/v1/invoicing/invoices/{$this->getId()}/refund-records/{$transactionId}", - "DELETE", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Generate a QR code for an invoice by passing the invoice ID to the request URI. The request generates a QR code that is 500 pixels in width and height. You can change the dimensions of the returned code by specifying optional query parameters. - * - * @param array $params - * @param string $invoiceId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Image - */ - public static function qrCode($invoiceId, $params = array(), $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($invoiceId, 'invoiceId'); - ArgumentValidator::validate($params, 'params'); - - $allowedParams = array( - 'width' => 1, - 'height' => 1, - 'action' => 1 - ); - - $payLoad = ""; - $json = self::executeCall( - "/v1/invoicing/invoices/$invoiceId/qr-code?" . http_build_query(array_intersect_key($params, $allowedParams)), - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Image(); - $ret->fromJson($json); - return $ret; - } - - /** - * Generates the successive invoice number. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return InvoiceNumber - */ - public static function generateNumber($apiContext = null, $restCall = null) - { - $payLoad = ""; - $json = self::executeCall( - "/v1/invoicing/invoices/next-invoice-number", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new InvoiceNumber(); - $ret->fromJson($json); - return $ret; - } - -} diff --git a/paypal/PayPal/Api/InvoiceAddress.php b/paypal/PayPal/Api/InvoiceAddress.php deleted file mode 100644 index 8529df9..0000000 --- a/paypal/PayPal/Api/InvoiceAddress.php +++ /dev/null @@ -1,39 +0,0 @@ -phone = $phone; - return $this; - } - - /** - * Phone number in E.123 format. - * - * @return \PayPal\Api\Phone - */ - public function getPhone() - { - return $this->phone; - } - -} diff --git a/paypal/PayPal/Api/InvoiceItem.php b/paypal/PayPal/Api/InvoiceItem.php deleted file mode 100644 index ee93e3c..0000000 --- a/paypal/PayPal/Api/InvoiceItem.php +++ /dev/null @@ -1,239 +0,0 @@ -name = $name; - return $this; - } - - /** - * Name of the item. 200 characters max. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Description of the item. 1000 characters max. - * - * @param string $description - * - * @return $this - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * Description of the item. 1000 characters max. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Quantity of the item. Range of -10000 to 10000. - * - * @param string|double $quantity - * - * @return $this - */ - public function setQuantity($quantity) - { - NumericValidator::validate($quantity, "Quantity"); - $quantity = FormatConverter::formatToPrice($quantity); - $this->quantity = $quantity; - return $this; - } - - /** - * Quantity of the item. Range of -10000 to 10000. - * - * @return string - */ - public function getQuantity() - { - return $this->quantity; - } - - /** - * Unit price of the item. Range of -1,000,000 to 1,000,000. - * - * @param \PayPal\Api\Currency $unit_price - * - * @return $this - */ - public function setUnitPrice($unit_price) - { - $this->unit_price = $unit_price; - return $this; - } - - /** - * Unit price of the item. Range of -1,000,000 to 1,000,000. - * - * @return \PayPal\Api\Currency - */ - public function getUnitPrice() - { - return $this->unit_price; - } - - /** - * Tax associated with the item. - * - * @param \PayPal\Api\Tax $tax - * - * @return $this - */ - public function setTax($tax) - { - $this->tax = $tax; - return $this; - } - - /** - * Tax associated with the item. - * - * @return \PayPal\Api\Tax - */ - public function getTax() - { - return $this->tax; - } - - /** - * The date when the item or service was provided. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $date - * - * @return $this - */ - public function setDate($date) - { - $this->date = $date; - return $this; - } - - /** - * The date when the item or service was provided. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getDate() - { - return $this->date; - } - - /** - * The item discount, as a percent or an amount value. - * - * @param \PayPal\Api\Cost $discount - * - * @return $this - */ - public function setDiscount($discount) - { - $this->discount = $discount; - return $this; - } - - /** - * The item discount, as a percent or an amount value. - * - * @return \PayPal\Api\Cost - */ - public function getDiscount() - { - return $this->discount; - } - - /** - * The image URL. Maximum length is 4000 characters. - * @deprecated Not publicly available - * @param string $image_url - * @throws \InvalidArgumentException - * @return $this - */ - public function setImageUrl($image_url) - { - UrlValidator::validate($image_url, "ImageUrl"); - $this->image_url = $image_url; - return $this; - } - - /** - * The image URL. Maximum length is 4000 characters. - * @deprecated Not publicly available - * @return string - */ - public function getImageUrl() - { - return $this->image_url; - } - - /** - * The unit of measure of the item being invoiced. - * Valid Values: ["QUANTITY", "HOURS", "AMOUNT"] - * - * @param string $unit_of_measure - * - * @return $this - */ - public function setUnitOfMeasure($unit_of_measure) - { - $this->unit_of_measure = $unit_of_measure; - return $this; - } - - /** - * The unit of measure of the item being invoiced. - * - * @return string - */ - public function getUnitOfMeasure() - { - return $this->unit_of_measure; - } - -} diff --git a/paypal/PayPal/Api/InvoiceNumber.php b/paypal/PayPal/Api/InvoiceNumber.php deleted file mode 100644 index a3cd2e2..0000000 --- a/paypal/PayPal/Api/InvoiceNumber.php +++ /dev/null @@ -1,38 +0,0 @@ -number = $number; - return $this; - } - - /** - * The next invoice number. - * - * @return string - */ - public function getNumber() { - return $this->number; - } -} diff --git a/paypal/PayPal/Api/InvoiceSearchResponse.php b/paypal/PayPal/Api/InvoiceSearchResponse.php deleted file mode 100644 index 0634eb6..0000000 --- a/paypal/PayPal/Api/InvoiceSearchResponse.php +++ /dev/null @@ -1,95 +0,0 @@ -total_count = $total_count; - return $this; - } - - /** - * Total number of invoices. - * - * @return int - */ - public function getTotalCount() - { - return $this->total_count; - } - - /** - * List of invoices belonging to a merchant. - * - * @param \PayPal\Api\Invoice[] $invoices - * - * @return $this - */ - public function setInvoices($invoices) - { - $this->invoices = $invoices; - return $this; - } - - /** - * List of invoices belonging to a merchant. - * - * @return \PayPal\Api\Invoice[] - */ - public function getInvoices() - { - return $this->invoices; - } - - /** - * Append Invoices to the list. - * - * @param \PayPal\Api\Invoice $invoice - * @return $this - */ - public function addInvoice($invoice) - { - if (!$this->getInvoices()) { - return $this->setInvoices(array($invoice)); - } else { - return $this->setInvoices( - array_merge($this->getInvoices(), array($invoice)) - ); - } - } - - /** - * Remove Invoices from the list. - * - * @param \PayPal\Api\Invoice $invoice - * @return $this - */ - public function removeInvoice($invoice) - { - return $this->setInvoices( - array_diff($this->getInvoices(), array($invoice)) - ); - } - -} diff --git a/paypal/PayPal/Api/Item.php b/paypal/PayPal/Api/Item.php deleted file mode 100644 index 75056ba..0000000 --- a/paypal/PayPal/Api/Item.php +++ /dev/null @@ -1,439 +0,0 @@ -sku = $sku; - return $this; - } - - /** - * Stock keeping unit corresponding (SKU) to item. - * - * @return string - */ - public function getSku() - { - return $this->sku; - } - - /** - * Item name. 127 characters max. - * - * @param string $name - * - * @return $this - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * Item name. 127 characters max. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Description of the item. Only supported when the `payment_method` is set to `paypal`. - * - * @param string $description - * - * @return $this - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * Description of the item. Only supported when the `payment_method` is set to `paypal`. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Number of a particular item. 10 characters max. - * - * @param string $quantity - * - * @return $this - */ - public function setQuantity($quantity) - { - $this->quantity = $quantity; - return $this; - } - - /** - * Number of a particular item. 10 characters max. - * - * @return string - */ - public function getQuantity() - { - return $this->quantity; - } - - /** - * Item cost. 10 characters max. - * - * @param string|double $price - * - * @return $this - */ - public function setPrice($price) - { - NumericValidator::validate($price, "Price"); - $price = FormatConverter::formatToPrice($price, $this->getCurrency()); - $this->price = $price; - return $this; - } - - /** - * Item cost. 10 characters max. - * - * @return string - */ - public function getPrice() - { - return $this->price; - } - - /** - * 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). - * - * @param string $currency - * - * @return $this - */ - public function setCurrency($currency) - { - $this->currency = $currency; - return $this; - } - - /** - * 3-letter [currency code](https://developer.paypal.com/docs/integration/direct/rest_api_payment_country_currency_support/). - * - * @return string - */ - public function getCurrency() - { - return $this->currency; - } - - /** - * Tax of the item. Only supported when the `payment_method` is set to `paypal`. - * - * @param string|double $tax - * - * @return $this - */ - public function setTax($tax) - { - NumericValidator::validate($tax, "Tax"); - $tax = FormatConverter::formatToPrice($tax, $this->getCurrency()); - $this->tax = $tax; - return $this; - } - - /** - * Tax of the item. Only supported when the `payment_method` is set to `paypal`. - * - * @return string - */ - public function getTax() - { - return $this->tax; - } - - /** - * URL linking to item information. Available to payer in transaction history. - * - * @param string $url - * @throws \InvalidArgumentException - * @return $this - */ - public function setUrl($url) - { - UrlValidator::validate($url, "Url"); - $this->url = $url; - return $this; - } - - /** - * URL linking to item information. Available to payer in transaction history. - * - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * Category type of the item. - * Valid Values: ["DIGITAL", "PHYSICAL"] - * @deprecated Not publicly available - * @param string $category - * - * @return $this - */ - public function setCategory($category) - { - $this->category = $category; - return $this; - } - - /** - * Category type of the item. - * @deprecated Not publicly available - * @return string - */ - public function getCategory() - { - return $this->category; - } - - /** - * Weight of the item. - * @deprecated Not publicly available - * @param \PayPal\Api\Measurement $weight - * - * @return $this - */ - public function setWeight($weight) - { - $this->weight = $weight; - return $this; - } - - /** - * Weight of the item. - * @deprecated Not publicly available - * @return \PayPal\Api\Measurement - */ - public function getWeight() - { - return $this->weight; - } - - /** - * Length of the item. - * @deprecated Not publicly available - * @param \PayPal\Api\Measurement $length - * - * @return $this - */ - public function setLength($length) - { - $this->length = $length; - return $this; - } - - /** - * Length of the item. - * @deprecated Not publicly available - * @return \PayPal\Api\Measurement - */ - public function getLength() - { - return $this->length; - } - - /** - * Height of the item. - * @deprecated Not publicly available - * @param \PayPal\Api\Measurement $height - * - * @return $this - */ - public function setHeight($height) - { - $this->height = $height; - return $this; - } - - /** - * Height of the item. - * @deprecated Not publicly available - * @return \PayPal\Api\Measurement - */ - public function getHeight() - { - return $this->height; - } - - /** - * Width of the item. - * @deprecated Not publicly available - * @param \PayPal\Api\Measurement $width - * - * @return $this - */ - public function setWidth($width) - { - $this->width = $width; - return $this; - } - - /** - * Width of the item. - * @deprecated Not publicly available - * @return \PayPal\Api\Measurement - */ - public function getWidth() - { - return $this->width; - } - - /** - * Set of optional data used for PayPal risk determination. - * @deprecated Not publicly available - * @param \PayPal\Api\NameValuePair[] $supplementary_data - * - * @return $this - */ - public function setSupplementaryData($supplementary_data) - { - $this->supplementary_data = $supplementary_data; - return $this; - } - - /** - * Set of optional data used for PayPal risk determination. - * @deprecated Not publicly available - * @return \PayPal\Api\NameValuePair[] - */ - public function getSupplementaryData() - { - return $this->supplementary_data; - } - - /** - * Append SupplementaryData to the list. - * @deprecated Not publicly available - * @param \PayPal\Api\NameValuePair $nameValuePair - * @return $this - */ - public function addSupplementaryData($nameValuePair) - { - if (!$this->getSupplementaryData()) { - return $this->setSupplementaryData(array($nameValuePair)); - } else { - return $this->setSupplementaryData( - array_merge($this->getSupplementaryData(), array($nameValuePair)) - ); - } - } - - /** - * Remove SupplementaryData from the list. - * @deprecated Not publicly available - * @param \PayPal\Api\NameValuePair $nameValuePair - * @return $this - */ - public function removeSupplementaryData($nameValuePair) - { - return $this->setSupplementaryData( - array_diff($this->getSupplementaryData(), array($nameValuePair)) - ); - } - - /** - * Set of optional data used for PayPal post-transaction notifications. - * @deprecated Not publicly available - * @param \PayPal\Api\NameValuePair[] $postback_data - * - * @return $this - */ - public function setPostbackData($postback_data) - { - $this->postback_data = $postback_data; - return $this; - } - - /** - * Set of optional data used for PayPal post-transaction notifications. - * @deprecated Not publicly available - * @return \PayPal\Api\NameValuePair[] - */ - public function getPostbackData() - { - return $this->postback_data; - } - - /** - * Append PostbackData to the list. - * @deprecated Not publicly available - * @param \PayPal\Api\NameValuePair $nameValuePair - * @return $this - */ - public function addPostbackData($nameValuePair) - { - if (!$this->getPostbackData()) { - return $this->setPostbackData(array($nameValuePair)); - } else { - return $this->setPostbackData( - array_merge($this->getPostbackData(), array($nameValuePair)) - ); - } - } - - /** - * Remove PostbackData from the list. - * @deprecated Not publicly available - * @param \PayPal\Api\NameValuePair $nameValuePair - * @return $this - */ - public function removePostbackData($nameValuePair) - { - return $this->setPostbackData( - array_diff($this->getPostbackData(), array($nameValuePair)) - ); - } - -} diff --git a/paypal/PayPal/Api/ItemList.php b/paypal/PayPal/Api/ItemList.php deleted file mode 100644 index 63ff054..0000000 --- a/paypal/PayPal/Api/ItemList.php +++ /dev/null @@ -1,143 +0,0 @@ -items = array_values($items); - return $this; - } - - /** - * List of items. - * - * @return \PayPal\Api\Item[] - */ - public function getItems() - { - return $this->items; - } - - /** - * Append Items to the list. - * - * @param \PayPal\Api\Item $item - * @return $this - */ - public function addItem($item) - { - if (!$this->getItems()) { - return $this->setItems(array($item)); - } else { - return $this->setItems( - array_merge($this->getItems(), array($item)) - ); - } - } - - /** - * Remove Items from the list. - * - * @param \PayPal\Api\Item $item - * @return $this - */ - public function removeItem($item) - { - return $this->setItems( - array_diff($this->getItems(), array($item)) - ); - } - - /** - * Shipping address. - * - * @param \PayPal\Api\ShippingAddress $shipping_address - * - * @return $this - */ - public function setShippingAddress($shipping_address) - { - $this->shipping_address = $shipping_address; - return $this; - } - - /** - * Shipping address. - * - * @return \PayPal\Api\ShippingAddress - */ - public function getShippingAddress() - { - return $this->shipping_address; - } - - /** - * Shipping method used for this payment like USPSParcel etc. - * - * @param string $shipping_method - * - * @return $this - */ - public function setShippingMethod($shipping_method) - { - $this->shipping_method = $shipping_method; - return $this; - } - - /** - * Shipping method used for this payment like USPSParcel etc. - * - * @return string - */ - public function getShippingMethod() - { - return $this->shipping_method; - } - - /** - * Allows merchant's to share payer’s contact number with PayPal for the current payment. Final contact number of payer associated with the transaction might be same as shipping_phone_number or different based on Payer’s action on PayPal. The phone number must be represented in its canonical international format, as defined by the E.164 numbering plan - * - * @param string $shipping_phone_number - * - * @return $this - */ - public function setShippingPhoneNumber($shipping_phone_number) - { - $this->shipping_phone_number = $shipping_phone_number; - return $this; - } - - /** - * Allows merchant's to share payer’s contact number with PayPal for the current payment. Final contact number of payer associated with the transaction might be same as shipping_phone_number or different based on Payer’s action on PayPal. The phone number must be represented in its canonical international format, as defined by the E.164 numbering plan - * - * @return string - */ - public function getShippingPhoneNumber() - { - return $this->shipping_phone_number; - } - -} diff --git a/paypal/PayPal/Api/Links.php b/paypal/PayPal/Api/Links.php deleted file mode 100644 index 7e00880..0000000 --- a/paypal/PayPal/Api/Links.php +++ /dev/null @@ -1,161 +0,0 @@ -href = $href; - return $this; - } - - /** - * Gets Href - * - * @return string - */ - public function getHref() - { - return $this->href; - } - - /** - * Sets Rel - * - * @param string $rel - * - * @return $this - */ - public function setRel($rel) - { - $this->rel = $rel; - return $this; - } - - /** - * Gets Rel - * - * @return string - */ - public function getRel() - { - return $this->rel; - } - - /** - * Sets TargetSchema - * - * @param \PayPal\Api\HyperSchema $targetSchema - * - * @return $this - */ - public function setTargetSchema($targetSchema) - { - $this->targetSchema = $targetSchema; - return $this; - } - - /** - * Gets TargetSchema - * - * @return \PayPal\Api\HyperSchema - */ - public function getTargetSchema() - { - return $this->targetSchema; - } - - /** - * Sets Method - * - * @param string $method - * - * @return $this - */ - public function setMethod($method) - { - $this->method = $method; - return $this; - } - - /** - * Gets Method - * - * @return string - */ - public function getMethod() - { - return $this->method; - } - - /** - * Sets Enctype - * - * @param string $enctype - * - * @return $this - */ - public function setEnctype($enctype) - { - $this->enctype = $enctype; - return $this; - } - - /** - * Gets Enctype - * - * @return string - */ - public function getEnctype() - { - return $this->enctype; - } - - /** - * Sets Schema - * - * @param \PayPal\Api\HyperSchema $schema - * - * @return $this - */ - public function setSchema($schema) - { - $this->schema = $schema; - return $this; - } - - /** - * Gets Schema - * - * @return \PayPal\Api\HyperSchema - */ - public function getSchema() - { - return $this->schema; - } - -} diff --git a/paypal/PayPal/Api/Measurement.php b/paypal/PayPal/Api/Measurement.php deleted file mode 100644 index 5ae9ace..0000000 --- a/paypal/PayPal/Api/Measurement.php +++ /dev/null @@ -1,65 +0,0 @@ -value = $value; - return $this; - } - - /** - * Value this measurement represents. - * - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * Unit in which the value is represented. - * - * @param string $unit - * - * @return $this - */ - public function setUnit($unit) - { - $this->unit = $unit; - return $this; - } - - /** - * Unit in which the value is represented. - * - * @return string - */ - public function getUnit() - { - return $this->unit; - } - -} diff --git a/paypal/PayPal/Api/MerchantInfo.php b/paypal/PayPal/Api/MerchantInfo.php deleted file mode 100644 index 72c561e..0000000 --- a/paypal/PayPal/Api/MerchantInfo.php +++ /dev/null @@ -1,281 +0,0 @@ -email = $email; - return $this; - } - - /** - * The merchant email address. Maximum length is 260 characters. - * - * @return string - */ - public function getEmail() - { - return $this->email; - } - - /** - * The merchant first name. Maximum length is 30 characters. - * - * @param string $first_name - * - * @return $this - */ - public function setFirstName($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * The merchant first name. Maximum length is 30 characters. - * - * @return string - */ - public function getFirstName() - { - return $this->first_name; - } - - /** - * The merchant last name. Maximum length is 30 characters. - * - * @param string $last_name - * - * @return $this - */ - public function setLastName($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * The merchant last name. Maximum length is 30 characters. - * - * @return string - */ - public function getLastName() - { - return $this->last_name; - } - - /** - * The merchant address. - * - * @param \PayPal\Api\InvoiceAddress $address - * - * @return $this - */ - public function setAddress($address) - { - $this->address = $address; - return $this; - } - - /** - * The merchant address. - * - * @return \PayPal\Api\InvoiceAddress - */ - public function getAddress() - { - return $this->address; - } - - /** - * The merchant company business name. Maximum length is 100 characters. - * - * @param string $business_name - * - * @return $this - */ - public function setBusinessName($business_name) - { - $this->business_name = $business_name; - return $this; - } - - /** - * The merchant company business name. Maximum length is 100 characters. - * - * @return string - */ - public function getBusinessName() - { - return $this->business_name; - } - - /** - * The merchant phone number. - * - * @param \PayPal\Api\Phone $phone - * - * @return $this - */ - public function setPhone($phone) - { - $this->phone = $phone; - return $this; - } - - /** - * The merchant phone number. - * - * @return \PayPal\Api\Phone - */ - public function getPhone() - { - return $this->phone; - } - - /** - * The merchant fax number. - * - * @param \PayPal\Api\Phone $fax - * - * @return $this - */ - public function setFax($fax) - { - $this->fax = $fax; - return $this; - } - - /** - * The merchant fax number. - * - * @return \PayPal\Api\Phone - */ - public function getFax() - { - return $this->fax; - } - - /** - * The merchant website. Maximum length is 2048 characters. - * - * @param string $website - * - * @return $this - */ - public function setWebsite($website) - { - $this->website = $website; - return $this; - } - - /** - * The merchant website. Maximum length is 2048 characters. - * - * @return string - */ - public function getWebsite() - { - return $this->website; - } - - /** - * The merchant tax ID. Maximum length is 100 characters. - * - * @param string $tax_id - * - * @return $this - */ - public function setTaxId($tax_id) - { - $this->tax_id = $tax_id; - return $this; - } - - /** - * The merchant tax ID. Maximum length is 100 characters. - * - * @return string - */ - public function getTaxId() - { - return $this->tax_id; - } - - /** - * Option to provide a label to the additional_info field. 40 characters max. - * - * @param string $additional_info_label - * - * @return $this - */ - public function setAdditionalInfoLabel($additional_info_label) - { - $this->additional_info_label = $additional_info_label; - return $this; - } - - /** - * Option to provide a label to the additional_info field. 40 characters max. - * - * @return string - */ - public function getAdditionalInfoLabel() - { - return $this->additional_info_label; - } - - /** - * Additional information, such as business hours. Maximum length is 40 characters. - * - * @param string $additional_info - * - * @return $this - */ - public function setAdditionalInfo($additional_info) - { - $this->additional_info = $additional_info; - return $this; - } - - /** - * Additional information, such as business hours. Maximum length is 40 characters. - * - * @return string - */ - public function getAdditionalInfo() - { - return $this->additional_info; - } - -} diff --git a/paypal/PayPal/Api/MerchantPreferences.php b/paypal/PayPal/Api/MerchantPreferences.php deleted file mode 100644 index b51d604..0000000 --- a/paypal/PayPal/Api/MerchantPreferences.php +++ /dev/null @@ -1,261 +0,0 @@ -id = $id; - return $this; - } - - /** - * Identifier of the merchant_preferences. 128 characters max. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Setup fee amount. Default is 0. - * - * @param \PayPal\Api\Currency $setup_fee - * - * @return $this - */ - public function setSetupFee($setup_fee) - { - $this->setup_fee = $setup_fee; - return $this; - } - - /** - * Setup fee amount. Default is 0. - * - * @return \PayPal\Api\Currency - */ - public function getSetupFee() - { - return $this->setup_fee; - } - - /** - * Redirect URL on cancellation of agreement request. 1000 characters max. - * - * @param string $cancel_url - * @throws \InvalidArgumentException - * @return $this - */ - public function setCancelUrl($cancel_url) - { - UrlValidator::validate($cancel_url, "CancelUrl"); - $this->cancel_url = $cancel_url; - return $this; - } - - /** - * Redirect URL on cancellation of agreement request. 1000 characters max. - * - * @return string - */ - public function getCancelUrl() - { - return $this->cancel_url; - } - - /** - * Redirect URL on creation of agreement request. 1000 characters max. - * - * @param string $return_url - * @throws \InvalidArgumentException - * @return $this - */ - public function setReturnUrl($return_url) - { - UrlValidator::validate($return_url, "ReturnUrl"); - $this->return_url = $return_url; - return $this; - } - - /** - * Redirect URL on creation of agreement request. 1000 characters max. - * - * @return string - */ - public function getReturnUrl() - { - return $this->return_url; - } - - /** - * Notify URL on agreement creation. 1000 characters max. - * - * @param string $notify_url - * @throws \InvalidArgumentException - * @return $this - */ - public function setNotifyUrl($notify_url) - { - UrlValidator::validate($notify_url, "NotifyUrl"); - $this->notify_url = $notify_url; - return $this; - } - - /** - * Notify URL on agreement creation. 1000 characters max. - * - * @return string - */ - public function getNotifyUrl() - { - return $this->notify_url; - } - - /** - * Total number of failed attempts allowed. Default is 0, representing an infinite number of failed attempts. - * - * @param string $max_fail_attempts - * - * @return $this - */ - public function setMaxFailAttempts($max_fail_attempts) - { - $this->max_fail_attempts = $max_fail_attempts; - return $this; - } - - /** - * Total number of failed attempts allowed. Default is 0, representing an infinite number of failed attempts. - * - * @return string - */ - public function getMaxFailAttempts() - { - return $this->max_fail_attempts; - } - - /** - * Allow auto billing for the outstanding amount of the agreement in the next cycle. Allowed values: `YES`, `NO`. Default is `NO`. - * - * @param string $auto_bill_amount - * - * @return $this - */ - public function setAutoBillAmount($auto_bill_amount) - { - $this->auto_bill_amount = $auto_bill_amount; - return $this; - } - - /** - * Allow auto billing for the outstanding amount of the agreement in the next cycle. Allowed values: `YES`, `NO`. Default is `NO`. - * - * @return string - */ - public function getAutoBillAmount() - { - return $this->auto_bill_amount; - } - - /** - * Action to take if a failure occurs during initial payment. Allowed values: `CONTINUE`, `CANCEL`. Default is continue. - * - * @param string $initial_fail_amount_action - * - * @return $this - */ - public function setInitialFailAmountAction($initial_fail_amount_action) - { - $this->initial_fail_amount_action = $initial_fail_amount_action; - return $this; - } - - /** - * Action to take if a failure occurs during initial payment. Allowed values: `CONTINUE`, `CANCEL`. Default is continue. - * - * @return string - */ - public function getInitialFailAmountAction() - { - return $this->initial_fail_amount_action; - } - - /** - * Payment types that are accepted for this plan. - * - * @param string $accepted_payment_type - * - * @return $this - */ - public function setAcceptedPaymentType($accepted_payment_type) - { - $this->accepted_payment_type = $accepted_payment_type; - return $this; - } - - /** - * Payment types that are accepted for this plan. - * - * @return string - */ - public function getAcceptedPaymentType() - { - return $this->accepted_payment_type; - } - - /** - * char_set for this plan. - * - * @param string $char_set - * - * @return $this - */ - public function setCharSet($char_set) - { - $this->char_set = $char_set; - return $this; - } - - /** - * char_set for this plan. - * - * @return string - */ - public function getCharSet() - { - return $this->char_set; - } - -} diff --git a/paypal/PayPal/Api/Metadata.php b/paypal/PayPal/Api/Metadata.php deleted file mode 100644 index 8cddb02..0000000 --- a/paypal/PayPal/Api/Metadata.php +++ /dev/null @@ -1,259 +0,0 @@ -created_date = $created_date; - return $this; - } - - /** - * The date and time when the resource was created. - * - * @return string - */ - public function getCreatedDate() - { - return $this->created_date; - } - - /** - * The email address of the account that created the resource. - * - * @param string $created_by - * - * @return $this - */ - public function setCreatedBy($created_by) - { - $this->created_by = $created_by; - return $this; - } - - /** - * The email address of the account that created the resource. - * - * @return string - */ - public function getCreatedBy() - { - return $this->created_by; - } - - /** - * The date and time when the resource was cancelled. - * - * @param string $cancelled_date - * - * @return $this - */ - public function setCancelledDate($cancelled_date) - { - $this->cancelled_date = $cancelled_date; - return $this; - } - - /** - * The date and time when the resource was cancelled. - * - * @return string - */ - public function getCancelledDate() - { - return $this->cancelled_date; - } - - /** - * The actor who cancelled the resource. - * - * @param string $cancelled_by - * - * @return $this - */ - public function setCancelledBy($cancelled_by) - { - $this->cancelled_by = $cancelled_by; - return $this; - } - - /** - * The actor who cancelled the resource. - * - * @return string - */ - public function getCancelledBy() - { - return $this->cancelled_by; - } - - /** - * The date and time when the resource was last edited. - * - * @param string $last_updated_date - * - * @return $this - */ - public function setLastUpdatedDate($last_updated_date) - { - $this->last_updated_date = $last_updated_date; - return $this; - } - - /** - * The date and time when the resource was last edited. - * - * @return string - */ - public function getLastUpdatedDate() - { - return $this->last_updated_date; - } - - /** - * The email address of the account that last edited the resource. - * - * @param string $last_updated_by - * - * @return $this - */ - public function setLastUpdatedBy($last_updated_by) - { - $this->last_updated_by = $last_updated_by; - return $this; - } - - /** - * The email address of the account that last edited the resource. - * - * @return string - */ - public function getLastUpdatedBy() - { - return $this->last_updated_by; - } - - /** - * The date and time when the resource was first sent. - * - * @param string $first_sent_date - * - * @return $this - */ - public function setFirstSentDate($first_sent_date) - { - $this->first_sent_date = $first_sent_date; - return $this; - } - - /** - * The date and time when the resource was first sent. - * - * @return string - */ - public function getFirstSentDate() - { - return $this->first_sent_date; - } - - /** - * The date and time when the resource was last sent. - * - * @param string $last_sent_date - * - * @return $this - */ - public function setLastSentDate($last_sent_date) - { - $this->last_sent_date = $last_sent_date; - return $this; - } - - /** - * The date and time when the resource was last sent. - * - * @return string - */ - public function getLastSentDate() - { - return $this->last_sent_date; - } - - /** - * The email address of the account that last sent the resource. - * - * @param string $last_sent_by - * - * @return $this - */ - public function setLastSentBy($last_sent_by) - { - $this->last_sent_by = $last_sent_by; - return $this; - } - - /** - * The email address of the account that last sent the resource. - * - * @return string - */ - public function getLastSentBy() - { - return $this->last_sent_by; - } - - /** - * URL representing the payer's view of the invoice. - * - * @param string $payer_view_url - * @throws \InvalidArgumentException - * @return $this - */ - public function setPayerViewUrl($payer_view_url) - { - UrlValidator::validate($payer_view_url, "PayerViewUrl"); - $this->payer_view_url = $payer_view_url; - return $this; - } - - /** - * URL representing the payer's view of the invoice. - * - * @return string - */ - public function getPayerViewUrl() - { - return $this->payer_view_url; - } - -} diff --git a/paypal/PayPal/Api/NameValuePair.php b/paypal/PayPal/Api/NameValuePair.php deleted file mode 100644 index 4e32720..0000000 --- a/paypal/PayPal/Api/NameValuePair.php +++ /dev/null @@ -1,65 +0,0 @@ -name = $name; - return $this; - } - - /** - * Key for the name value pair. The value name types should be correlated - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Value for the name value pair. - * - * @param string $value - * - * @return $this - */ - public function setValue($value) - { - $this->value = $value; - return $this; - } - - /** - * Value for the name value pair. - * - * @return string - */ - public function getValue() - { - return $this->value; - } - -} diff --git a/paypal/PayPal/Api/Notification.php b/paypal/PayPal/Api/Notification.php deleted file mode 100644 index 9b5a772..0000000 --- a/paypal/PayPal/Api/Notification.php +++ /dev/null @@ -1,143 +0,0 @@ -subject = $subject; - return $this; - } - - /** - * Subject of the notification. - * - * @return string - */ - public function getSubject() - { - return $this->subject; - } - - /** - * Note to the payer. - * - * @param string $note - * - * @return $this - */ - public function setNote($note) - { - $this->note = $note; - return $this; - } - - /** - * Note to the payer. - * - * @return string - */ - public function getNote() - { - return $this->note; - } - - /** - * Indicates whether to send a copy of the email to the merchant. - * - * @param bool $send_to_merchant - * - * @return $this - */ - public function setSendToMerchant($send_to_merchant) - { - $this->send_to_merchant = $send_to_merchant; - return $this; - } - - /** - * Indicates whether to send a copy of the email to the merchant. - * - * @return bool - */ - public function getSendToMerchant() - { - return $this->send_to_merchant; - } - - /** - * Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported. - * - * @param string[] $cc_emails - * - * @return $this - */ - public function setCcEmails($cc_emails) - { - $this->cc_emails = $cc_emails; - return $this; - } - - /** - * Applicable for invoices created with Cc emails. If this field is not in the body, all the cc email addresses added as part of the invoice shall be notified else this field can be used to limit the list of email addresses. Note: additional email addresses are not supported. - * - * @return string[] - */ - public function getCcEmails() - { - return $this->cc_emails; - } - - /** - * Append CcEmails to the list. - * - * @param string $string - * @return $this - */ - public function addCcEmail($string) - { - if (!$this->getCcEmails()) { - return $this->setCcEmails(array($string)); - } else { - return $this->setCcEmails( - array_merge($this->getCcEmails(), array($string)) - ); - } - } - - /** - * Remove CcEmails from the list. - * - * @param string $string - * @return $this - */ - public function removeCcEmail($string) - { - return $this->setCcEmails( - array_diff($this->getCcEmails(), array($string)) - ); - } - -} diff --git a/paypal/PayPal/Api/OpenIdAddress.php b/paypal/PayPal/Api/OpenIdAddress.php deleted file mode 100644 index 306abf6..0000000 --- a/paypal/PayPal/Api/OpenIdAddress.php +++ /dev/null @@ -1,133 +0,0 @@ -street_address = $street_address; - return $this; - } - - /** - * Full street address component, which may include house number, street name. - * - * @return string - */ - public function getStreetAddress() - { - return $this->street_address; - } - - /** - * City or locality component. - * - * @param string $locality - * @return self - */ - public function setLocality($locality) - { - $this->locality = $locality; - return $this; - } - - /** - * City or locality component. - * - * @return string - */ - public function getLocality() - { - return $this->locality; - } - - /** - * State, province, prefecture or region component. - * - * @param string $region - * @return self - */ - public function setRegion($region) - { - $this->region = $region; - return $this; - } - - /** - * State, province, prefecture or region component. - * - * @return string - */ - public function getRegion() - { - return $this->region; - } - - /** - * Zip code or postal code component. - * - * @param string $postal_code - * @return self - */ - public function setPostalCode($postal_code) - { - $this->postal_code = $postal_code; - return $this; - } - - /** - * Zip code or postal code component. - * - * @return string - */ - public function getPostalCode() - { - return $this->postal_code; - } - - /** - * Country name component. - * - * @param string $country - * @return self - */ - public function setCountry($country) - { - $this->country = $country; - return $this; - } - - /** - * Country name component. - * - * @return string - */ - public function getCountry() - { - return $this->country; - } - - -} diff --git a/paypal/PayPal/Api/OpenIdError.php b/paypal/PayPal/Api/OpenIdError.php deleted file mode 100644 index 4b9b956..0000000 --- a/paypal/PayPal/Api/OpenIdError.php +++ /dev/null @@ -1,85 +0,0 @@ -error = $error; - return $this; - } - - /** - * A single ASCII error code from the following enum. - * - * @return string - */ - public function getError() - { - return $this->error; - } - - /** - * A resource ID that indicates the starting resource in the returned results. - * - * @param string $error_description - * @return self - */ - public function setErrorDescription($error_description) - { - $this->error_description = $error_description; - return $this; - } - - /** - * A resource ID that indicates the starting resource in the returned results. - * - * @return string - */ - public function getErrorDescription() - { - return $this->error_description; - } - - /** - * A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error. - * - * @param string $error_uri - * @return self - */ - public function setErrorUri($error_uri) - { - $this->error_uri = $error_uri; - return $this; - } - - /** - * A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error. - * - * @return string - */ - public function getErrorUri() - { - return $this->error_uri; - } - - -} diff --git a/paypal/PayPal/Api/OpenIdSession.php b/paypal/PayPal/Api/OpenIdSession.php deleted file mode 100644 index ad26af6..0000000 --- a/paypal/PayPal/Api/OpenIdSession.php +++ /dev/null @@ -1,107 +0,0 @@ -getConfig(); - - if ($apiContext->get($clientId)) { - $clientId = $apiContext->get($clientId); - } - - $clientId = $clientId ? $clientId : $apiContext->getCredential()->getClientId(); - - $scope = count($scope) != 0 ? $scope : array('openid', 'profile', 'address', 'email', 'phone', - 'https://uri.paypal.com/services/paypalattributes', 'https://uri.paypal.com/services/expresscheckout'); - if (!in_array('openid', $scope)) { - $scope[] = 'openid'; - } - - $params = array( - 'client_id' => $clientId, - 'response_type' => 'code', - 'scope' => implode(" ", $scope), - 'redirect_uri' => $redirectUri - ); - - if ($nonce) { - $params['nonce'] = $nonce; - } - if ($state) { - $params['state'] = $state; - } - return sprintf("%s/signin/authorize?%s", self::getBaseUrl($config), http_build_query($params)); - } - - - /** - * Returns the URL to which the user must be redirected to - * logout from the OpenID provider (i.e. PayPal) - * - * @param string $redirectUri Uri on merchant website to where - * the user must be redirected to post logout - * @param string $idToken id_token from the TokenInfo object - * @param ApiContext $apiContext Optional API Context - * @return string logout URL - */ - public static function getLogoutUrl($redirectUri, $idToken, $apiContext = null) - { - - if (is_null($apiContext)) { - $apiContext = new ApiContext(); - } - $config = $apiContext->getConfig(); - - $params = array( - 'id_token' => $idToken, - 'redirect_uri' => $redirectUri, - 'logout' => 'true' - ); - return sprintf("%s/webapps/auth/protocol/openidconnect/v1/endsession?%s", self::getBaseUrl($config), http_build_query($params)); - } - - /** - * Gets the base URL for the Redirect URI - * - * @param $config - * @return null|string - */ - private static function getBaseUrl($config) - { - - if (array_key_exists('openid.RedirectUri', $config)) { - return $config['openid.RedirectUri']; - } else if (array_key_exists('mode', $config)) { - switch (strtoupper($config['mode'])) { - case 'SANDBOX': - return PayPalConstants::OPENID_REDIRECT_SANDBOX_URL; - case 'LIVE': - return PayPalConstants::OPENID_REDIRECT_LIVE_URL; - } - } - return null; - } -} diff --git a/paypal/PayPal/Api/OpenIdTokeninfo.php b/paypal/PayPal/Api/OpenIdTokeninfo.php deleted file mode 100644 index ccd23da..0000000 --- a/paypal/PayPal/Api/OpenIdTokeninfo.php +++ /dev/null @@ -1,255 +0,0 @@ -scope = $scope; - return $this; - } - - /** - * OPTIONAL, if identical to the scope requested by the client; otherwise, REQUIRED. - * - * @return string - */ - public function getScope() - { - return $this->scope; - } - - /** - * The access token issued by the authorization server. - * - * @param string $access_token - * @return self - */ - public function setAccessToken($access_token) - { - $this->access_token = $access_token; - return $this; - } - - /** - * The access token issued by the authorization server. - * - * @return string - */ - public function getAccessToken() - { - return $this->access_token; - } - - /** - * The refresh token, which can be used to obtain new access tokens using the same authorization grant as described in OAuth2.0 RFC6749 in Section 6. - * - * @param string $refresh_token - * @return self - */ - public function setRefreshToken($refresh_token) - { - $this->refresh_token = $refresh_token; - return $this; - } - - /** - * The refresh token, which can be used to obtain new access tokens using the same authorization grant as described in OAuth2.0 RFC6749 in Section 6. - * - * @return string - */ - public function getRefreshToken() - { - return $this->refresh_token; - } - - /** - * The type of the token issued as described in OAuth2.0 RFC6749 (Section 7.1). Value is case insensitive. - * - * @param string $token_type - * @return self - */ - public function setTokenType($token_type) - { - $this->token_type = $token_type; - return $this; - } - - /** - * The type of the token issued as described in OAuth2.0 RFC6749 (Section 7.1). Value is case insensitive. - * - * @return string - */ - public function getTokenType() - { - return $this->token_type; - } - - /** - * The id_token is a session token assertion that denotes the user's authentication status - * - * @param string $id_token - * @return self - */ - public function setIdToken($id_token) - { - $this->id_token = $id_token; - return $this; - } - - /** - * The id_token is a session token assertion that denotes the user's authentication status - * - * @return string - */ - public function getIdToken() - { - return $this->id_token; - } - - /** - * The lifetime in seconds of the access token. - * - * @param integer $expires_in - * @return self - */ - public function setExpiresIn($expires_in) - { - $this->expires_in = $expires_in; - return $this; - } - - /** - * The lifetime in seconds of the access token. - * - * @return integer - */ - public function getExpiresIn() - { - return $this->expires_in; - } - - - /** - * Creates an Access Token from an Authorization Code. - * - * @path /v1/identity/openidconnect/tokenservice - * @method POST - * @param array $params (allowed values are client_id, client_secret, grant_type, code and redirect_uri) - * (required) client_id from developer portal - * (required) client_secret from developer portal - * (required) code is Authorization code previously received from the authorization server - * (required) redirect_uri Redirection endpoint that must match the one provided during the - * authorization request that ended in receiving the authorization code. - * (optional) grant_type is the Token grant type. Defaults to authorization_code - * @param string $clientId - * @param string $clientSecret - * @param ApiContext $apiContext Optional API Context - * @param PayPalRestCall $restCall - * @return OpenIdTokeninfo - */ - public static function createFromAuthorizationCode($params, $clientId = null, $clientSecret = null, $apiContext = null, $restCall = null) - { - static $allowedParams = array('grant_type' => 1, 'code' => 1, 'redirect_uri' => 1); - - if (!array_key_exists('grant_type', $params)) { - $params['grant_type'] = 'authorization_code'; - } - $apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential); - - if (sizeof($apiContext->get($clientId)) > 0) { - $clientId = $apiContext->get($clientId); - } - - if (sizeof($apiContext->get($clientSecret)) > 0) { - $clientSecret = $apiContext->get($clientSecret); - } - - $clientId = $clientId ? $clientId : $apiContext->getCredential()->getClientId(); - $clientSecret = $clientSecret ? $clientSecret : $apiContext->getCredential()->getClientSecret(); - - $json = self::executeCall( - "/v1/identity/openidconnect/tokenservice", - "POST", - http_build_query(array_intersect_key($params, $allowedParams)), - array( - 'Content-Type' => 'application/x-www-form-urlencoded', - 'Authorization' => 'Basic ' . base64_encode($clientId . ":" . $clientSecret) - ), - $apiContext, - $restCall - ); - $token = new OpenIdTokeninfo(); - $token->fromJson($json); - return $token; - } - - /** - * Creates an Access Token from an Refresh Token. - * - * @path /v1/identity/openidconnect/tokenservice - * @method POST - * @param array $params (allowed values are grant_type and scope) - * (required) client_id from developer portal - * (required) client_secret from developer portal - * (optional) refresh_token refresh token. If one is not passed, refresh token from the current object is used. - * (optional) grant_type is the Token grant type. Defaults to refresh_token - * (optional) scope is an array that either the same or a subset of the scope passed to the authorization request - * @param APIContext $apiContext Optional API Context - * @param PayPalRestCall $restCall - * @return OpenIdTokeninfo - */ - public function createFromRefreshToken($params, $apiContext = null, $restCall = null) - { - static $allowedParams = array('grant_type' => 1, 'refresh_token' => 1, 'scope' => 1); - $apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential); - - if (!array_key_exists('grant_type', $params)) { - $params['grant_type'] = 'refresh_token'; - } - if (!array_key_exists('refresh_token', $params)) { - $params['refresh_token'] = $this->getRefreshToken(); - } - - $clientId = isset($params['client_id']) ? $params['client_id'] : $apiContext->getCredential()->getClientId(); - $clientSecret = isset($params['client_secret']) ? $params['client_secret'] : $apiContext->getCredential()->getClientSecret(); - - $json = self::executeCall( - "/v1/identity/openidconnect/tokenservice", - "POST", - http_build_query(array_intersect_key($params, $allowedParams)), - array( - 'Content-Type' => 'application/x-www-form-urlencoded', - 'Authorization' => 'Basic ' . base64_encode($clientId . ":" . $clientSecret) - ), - $apiContext, - $restCall - ); - - $this->fromJson($json); - return $this; - } -} diff --git a/paypal/PayPal/Api/OpenIdUserinfo.php b/paypal/PayPal/Api/OpenIdUserinfo.php deleted file mode 100644 index b6d1f6e..0000000 --- a/paypal/PayPal/Api/OpenIdUserinfo.php +++ /dev/null @@ -1,540 +0,0 @@ -user_id = $user_id; - return $this; - } - - /** - * Subject - Identifier for the End-User at the Issuer. - * - * @return string - */ - public function getUserId() - { - return $this->user_id; - } - - /** - * Subject - Identifier for the End-User at the Issuer. - * - * @param string $sub - * @return self - */ - public function setSub($sub) - { - $this->sub = $sub; - return $this; - } - - /** - * Subject - Identifier for the End-User at the Issuer. - * - * @return string - */ - public function getSub() - { - return $this->sub; - } - - /** - * End-User's full name in displayable form including all name parts, possibly including titles and suffixes, ordered according to the End-User's locale and preferences. - * - * @param string $name - * @return self - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * End-User's full name in displayable form including all name parts, possibly including titles and suffixes, ordered according to the End-User's locale and preferences. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Given name(s) or first name(s) of the End-User - * - * @param string $given_name - * @return self - */ - public function setGivenName($given_name) - { - $this->given_name = $given_name; - return $this; - } - - /** - * Given name(s) or first name(s) of the End-User - * - * @return string - */ - public function getGivenName() - { - return $this->given_name; - } - - /** - * Surname(s) or last name(s) of the End-User. - * - * @param string $family_name - * @return self - */ - public function setFamilyName($family_name) - { - $this->family_name = $family_name; - return $this; - } - - /** - * Surname(s) or last name(s) of the End-User. - * - * @return string - */ - public function getFamilyName() - { - return $this->family_name; - } - - /** - * Middle name(s) of the End-User. - * - * @param string $middle_name - * @return self - */ - public function setMiddleName($middle_name) - { - $this->middle_name = $middle_name; - return $this; - } - - /** - * Middle name(s) of the End-User. - * - * @return string - */ - public function getMiddleName() - { - return $this->middle_name; - } - - /** - * URL of the End-User's profile picture. - * - * @param string $picture - * @return self - */ - public function setPicture($picture) - { - $this->picture = $picture; - return $this; - } - - /** - * URL of the End-User's profile picture. - * - * @return string - */ - public function getPicture() - { - return $this->picture; - } - - /** - * End-User's preferred e-mail address. - * - * @param string $email - * @return self - */ - public function setEmail($email) - { - $this->email = $email; - return $this; - } - - /** - * End-User's preferred e-mail address. - * - * @return string - */ - public function getEmail() - { - return $this->email; - } - - /** - * True if the End-User's e-mail address has been verified; otherwise false. - * - * @param boolean $email_verified - * @return self - */ - public function setEmailVerified($email_verified) - { - $this->email_verified = $email_verified; - return $this; - } - - /** - * True if the End-User's e-mail address has been verified; otherwise false. - * - * @return boolean - */ - public function getEmailVerified() - { - return $this->email_verified; - } - - /** - * End-User's gender. - * - * @param string $gender - * @return self - */ - public function setGender($gender) - { - $this->gender = $gender; - return $this; - } - - /** - * End-User's gender. - * - * @return string - */ - public function getGender() - { - return $this->gender; - } - - /** - * End-User's birthday, represented as an YYYY-MM-DD format. They year MAY be 0000, indicating it is omited. To represent only the year, YYYY format would be used. - * - * @param string $birthday - * @return self - */ - public function setBirthday($birthday) - { - $this->birthday = $birthday; - return $this; - } - - /** - * End-User's birthday, represented as an YYYY-MM-DD format. They year MAY be 0000, indicating it is omited. To represent only the year, YYYY format would be used. - * - * @return string - */ - public function getBirthday() - { - return $this->birthday; - } - - /** - * Time zone database representing the End-User's time zone - * - * @param string $zoneinfo - * @return self - */ - public function setZoneinfo($zoneinfo) - { - $this->zoneinfo = $zoneinfo; - return $this; - } - - /** - * Time zone database representing the End-User's time zone - * - * @return string - */ - public function getZoneinfo() - { - return $this->zoneinfo; - } - - /** - * End-User's locale. - * - * @param string $locale - * @return self - */ - public function setLocale($locale) - { - $this->locale = $locale; - return $this; - } - - /** - * End-User's locale. - * - * @return string - */ - public function getLocale() - { - return $this->locale; - } - - /** - * End-User's language. - * - * @param string $language - * @return self - */ - public function setLanguage($language) - { - $this->language = $language; - return $this; - } - - /** - * End-User's language. - * - * @return string - */ - public function getLanguage() - { - return $this->language; - } - - /** - * End-User's verified status. - * - * @param boolean $verified - * @return self - */ - public function setVerified($verified) - { - $this->verified = $verified; - return $this; - } - - /** - * End-User's verified status. - * - * @return boolean - */ - public function getVerified() - { - return $this->verified; - } - - /** - * End-User's preferred telephone number. - * - * @param string $phone_number - * @return self - */ - public function setPhoneNumber($phone_number) - { - $this->phone_number = $phone_number; - return $this; - } - - /** - * End-User's preferred telephone number. - * - * @return string - */ - public function getPhoneNumber() - { - return $this->phone_number; - } - - /** - * End-User's preferred address. - * - * @param \PayPal\Api\OpenIdAddress $address - * @return self - */ - public function setAddress($address) - { - $this->address = $address; - return $this; - } - - /** - * End-User's preferred address. - * - * @return \PayPal\Api\OpenIdAddress - */ - public function getAddress() - { - return $this->address; - } - - /** - * Verified account status. - * - * @param boolean $verified_account - * @return self - */ - public function setVerifiedAccount($verified_account) - { - $this->verified_account = $verified_account; - return $this; - } - - /** - * Verified account status. - * - * @return boolean - */ - public function getVerifiedAccount() - { - return $this->verified_account; - } - - /** - * Account type. - * - * @param string $account_type - * @return self - */ - public function setAccountType($account_type) - { - $this->account_type = $account_type; - return $this; - } - - /** - * Account type. - * - * @return string - */ - public function getAccountType() - { - return $this->account_type; - } - - /** - * Account holder age range. - * - * @param string $age_range - * @return self - */ - public function setAgeRange($age_range) - { - $this->age_range = $age_range; - return $this; - } - - /** - * Account holder age range. - * - * @return string - */ - public function getAgeRange() - { - return $this->age_range; - } - - /** - * Account payer identifier. - * - * @param string $payer_id - * @return self - */ - public function setPayerId($payer_id) - { - $this->payer_id = $payer_id; - return $this; - } - - /** - * Account payer identifier. - * - * @return string - */ - public function getPayerId() - { - return $this->payer_id; - } - - - /** - * returns user details - * - * @path /v1/identity/openidconnect/userinfo - * @method GET - * @param array $params (allowed values are access_token) - * access_token - access token from the createFromAuthorizationCode / createFromRefreshToken calls - * @param ApiContext $apiContext Optional API Context - * @param PayPalRestCall $restCall - * @return OpenIdUserinfo - */ - public static function getUserinfo($params, $apiContext = null, $restCall = null) - { - static $allowedParams = array('schema' => 1); - - $params = is_array($params) ? $params : array(); - - if (!array_key_exists('schema', $params)) { - $params['schema'] = 'openid'; - } - $requestUrl = "/v1/identity/openidconnect/userinfo?" - . http_build_query(array_intersect_key($params, $allowedParams)); - - $json = self::executeCall( - $requestUrl, - "GET", - "", - array( - 'Authorization' => "Bearer " . $params['access_token'], - 'Content-Type' => 'x-www-form-urlencoded' - ), - $apiContext, - $restCall - ); - - $ret = new OpenIdUserinfo(); - $ret->fromJson($json); - - return $ret; - } -} diff --git a/paypal/PayPal/Api/Order.php b/paypal/PayPal/Api/Order.php deleted file mode 100644 index 13312cc..0000000 --- a/paypal/PayPal/Api/Order.php +++ /dev/null @@ -1,464 +0,0 @@ -id = $id; - return $this; - } - - /** - * Identifier of the order transaction. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base. - * - * @deprecated Use #setReferenceId instead - * - * @param string $purchase_unit_reference_id - * - * @return $this - */ - public function setPurchaseUnitReferenceId($purchase_unit_reference_id) - { - $this->purchase_unit_reference_id = $purchase_unit_reference_id; - return $this; - } - - /** - * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base. - * @deprecated Use #getReferenceId instead - * - * @return string - */ - public function getPurchaseUnitReferenceId() - { - return $this->purchase_unit_reference_id; - } - - /** - * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base. - * - * @param string $reference_id - * - * @return $this - */ - public function setReferenceId($reference_id) - { - $this->reference_id = $reference_id; - return $this; - } - - /** - * Identifier to the purchase unit associated with this object. Obsolete. Use one in cart_base. - * - * @return string - */ - public function getReferenceId() - { - return $this->reference_id; - } - - /** - * Amount being collected. - * - * @param \PayPal\Api\Amount $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * Amount being collected. - * - * @return \PayPal\Api\Amount - */ - public function getAmount() - { - return $this->amount; - } - - /** - * specifies payment mode of the transaction - * Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"] - * - * @param string $payment_mode - * - * @return $this - */ - public function setPaymentMode($payment_mode) - { - $this->payment_mode = $payment_mode; - return $this; - } - - /** - * specifies payment mode of the transaction - * - * @return string - */ - public function getPaymentMode() - { - return $this->payment_mode; - } - - /** - * State of the order transaction. - * Valid Values: ["pending", "completed", "voided", "authorized", "captured"] - * - * @param string $state - * - * @return $this - */ - public function setState($state) - { - $this->state = $state; - return $this; - } - - /** - * State of the order transaction. - * - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Reason code for the transaction state being Pending or Reversed. This field will replace pending_reason field eventually. Only supported when the `payment_method` is set to `paypal`. - * Valid Values: ["PAYER_SHIPPING_UNCONFIRMED", "MULTI_CURRENCY", "RISK_REVIEW", "REGULATORY_REVIEW", "VERIFICATION_REQUIRED", "ORDER", "OTHER"] - * - * @param string $reason_code - * - * @return $this - */ - public function setReasonCode($reason_code) - { - $this->reason_code = $reason_code; - return $this; - } - - /** - * Reason code for the transaction state being Pending or Reversed. This field will replace pending_reason field eventually. Only supported when the `payment_method` is set to `paypal`. - * - * @return string - */ - public function getReasonCode() - { - return $this->reason_code; - } - - /** - * [DEPRECATED] Reason code for the transaction state being Pending. Obsolete. Retained for backward compatability. Use reason_code field above instead. - * Valid Values: ["payer_shipping_unconfirmed", "multi_currency", "risk_review", "regulatory_review", "verification_required", "order", "other"] - * - * @param string $pending_reason - * - * @return $this - */ - public function setPendingReason($pending_reason) - { - $this->pending_reason = $pending_reason; - return $this; - } - - /** - * @deprecated [DEPRECATED] Reason code for the transaction state being Pending. Obsolete. Retained for backward compatability. Use reason_code field above instead. - * - * @return string - */ - public function getPendingReason() - { - return $this->pending_reason; - } - - /** - * The level of seller protection in force for the transaction. - * Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"] - * - * @param string $protection_eligibility - * - * @return $this - */ - public function setProtectionEligibility($protection_eligibility) - { - $this->protection_eligibility = $protection_eligibility; - return $this; - } - - /** - * The level of seller protection in force for the transaction. - * - * @return string - */ - public function getProtectionEligibility() - { - return $this->protection_eligibility; - } - - /** - * The kind of seller protection in force for the transaction. This property is returned only when the `protection_eligibility` property is set to `ELIGIBLE`or `PARTIALLY_ELIGIBLE`. Only supported when the `payment_method` is set to `paypal`. Allowed values:
`ITEM_NOT_RECEIVED_ELIGIBLE`- Sellers are protected against claims for items not received.
`UNAUTHORIZED_PAYMENT_ELIGIBLE`- Sellers are protected against claims for unauthorized payments.
One or both of the allowed values can be returned. - * Valid Values: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"] - * - * @param string $protection_eligibility_type - * - * @return $this - */ - public function setProtectionEligibilityType($protection_eligibility_type) - { - $this->protection_eligibility_type = $protection_eligibility_type; - return $this; - } - - /** - * The kind of seller protection in force for the transaction. This property is returned only when the `protection_eligibility` property is set to `ELIGIBLE`or `PARTIALLY_ELIGIBLE`. Only supported when the `payment_method` is set to `paypal`. Allowed values:
`ITEM_NOT_RECEIVED_ELIGIBLE`- Sellers are protected against claims for items not received.
`UNAUTHORIZED_PAYMENT_ELIGIBLE`- Sellers are protected against claims for unauthorized payments.
One or both of the allowed values can be returned. - * - * @return string - */ - public function getProtectionEligibilityType() - { - return $this->protection_eligibility_type; - } - - /** - * ID of the Payment resource that this transaction is based on. - * - * @param string $parent_payment - * - * @return $this - */ - public function setParentPayment($parent_payment) - { - $this->parent_payment = $parent_payment; - return $this; - } - - /** - * ID of the Payment resource that this transaction is based on. - * - * @return string - */ - public function getParentPayment() - { - return $this->parent_payment; - } - - /** - * Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action. - * - * @param \PayPal\Api\FmfDetails $fmf_details - * - * @return $this - */ - public function setFmfDetails($fmf_details) - { - $this->fmf_details = $fmf_details; - return $this; - } - - /** - * Fraud Management Filter (FMF) details applied for the payment that could result in accept/deny/pending action. - * - * @return \PayPal\Api\FmfDetails - */ - public function getFmfDetails() - { - return $this->fmf_details; - } - - /** - * Time the resource was created in UTC ISO8601 format. - * - * @param string $create_time - * - * @return $this - */ - public function setCreateTime($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time the resource was created in UTC ISO8601 format. - * - * @return string - */ - public function getCreateTime() - { - return $this->create_time; - } - - /** - * Time the resource was last updated in UTC ISO8601 format. - * - * @param string $update_time - * - * @return $this - */ - public function setUpdateTime($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time the resource was last updated in UTC ISO8601 format. - * - * @return string - */ - public function getUpdateTime() - { - return $this->update_time; - } - - /** - * Shows details for an order, by ID. - * - * @param string $orderId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Order - */ - public static function get($orderId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($orderId, 'orderId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/orders/$orderId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Order(); - $ret->fromJson($json); - return $ret; - } - - /** - * Captures a payment for an order, by ID. To use this call, the original payment call must specify an intent of `order`. In the JSON request body, include the payment amount and indicate whether this capture is the final capture for the authorization. - * - * @param Capture $capture - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Capture - */ - public function capture($capture, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($capture, 'capture'); - $payLoad = $capture->toJSON(); - $json = self::executeCall( - "/v1/payments/orders/{$this->getId()}/capture", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Capture(); - $ret->fromJson($json); - return $ret; - } - - /** - * Voids, or cancels, an order, by ID. You cannot void an order if a payment has already been partially or fully captured. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Order - */ - public function void($apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/orders/{$this->getId()}/do-void", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Authorizes an order, by ID. Include an `amount` object in the JSON request body. - * - * @param Authorization $authorization Authorization Object with Amount value to be authorized - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Authorization - */ - public function authorize($authorization, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($authorization, 'Authorization'); - $payLoad = $authorization->toJSON(); - $json = self::executeCall( - "/v1/payments/orders/{$this->getId()}/authorize", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Authorization(); - $ret->fromJson($json); - return $ret; - } - -} diff --git a/paypal/PayPal/Api/OverrideChargeModel.php b/paypal/PayPal/Api/OverrideChargeModel.php deleted file mode 100644 index b911c17..0000000 --- a/paypal/PayPal/Api/OverrideChargeModel.php +++ /dev/null @@ -1,65 +0,0 @@ -charge_id = $charge_id; - return $this; - } - - /** - * ID of charge model. - * - * @return string - */ - public function getChargeId() - { - return $this->charge_id; - } - - /** - * Updated Amount to be associated with this charge model. - * - * @param \PayPal\Api\Currency $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * Updated Amount to be associated with this charge model. - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - -} diff --git a/paypal/PayPal/Api/Participant.php b/paypal/PayPal/Api/Participant.php deleted file mode 100644 index 0f8e6d0..0000000 --- a/paypal/PayPal/Api/Participant.php +++ /dev/null @@ -1,233 +0,0 @@ -email = $email; - return $this; - } - - /** - * The participant email address. - * - * @return string - */ - public function getEmail() - { - return $this->email; - } - - /** - * The participant first name. - * - * @param string $first_name - * - * @return $this - */ - public function setFirstName($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * The participant first name. - * - * @return string - */ - public function getFirstName() - { - return $this->first_name; - } - - /** - * The participant last name. - * - * @param string $last_name - * - * @return $this - */ - public function setLastName($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * The participant last name. - * - * @return string - */ - public function getLastName() - { - return $this->last_name; - } - - /** - * The participant company business name. - * - * @param string $business_name - * - * @return $this - */ - public function setBusinessName($business_name) - { - $this->business_name = $business_name; - return $this; - } - - /** - * The participant company business name. - * - * @return string - */ - public function getBusinessName() - { - return $this->business_name; - } - - /** - * The participant phone number. - * - * @param \PayPal\Api\Phone $phone - * - * @return $this - */ - public function setPhone($phone) - { - $this->phone = $phone; - return $this; - } - - /** - * The participant phone number. - * - * @return \PayPal\Api\Phone - */ - public function getPhone() - { - return $this->phone; - } - - /** - * The participant fax number. - * - * @param \PayPal\Api\Phone $fax - * - * @return $this - */ - public function setFax($fax) - { - $this->fax = $fax; - return $this; - } - - /** - * The participant fax number. - * - * @return \PayPal\Api\Phone - */ - public function getFax() - { - return $this->fax; - } - - /** - * The participant website. - * - * @param string $website - * - * @return $this - */ - public function setWebsite($website) - { - $this->website = $website; - return $this; - } - - /** - * The participant website. - * - * @return string - */ - public function getWebsite() - { - return $this->website; - } - - /** - * Additional information, such as business hours. - * - * @param string $additional_info - * - * @return $this - */ - public function setAdditionalInfo($additional_info) - { - $this->additional_info = $additional_info; - return $this; - } - - /** - * Additional information, such as business hours. - * - * @return string - */ - public function getAdditionalInfo() - { - return $this->additional_info; - } - - /** - * The participant address. - * - * @param \PayPal\Api\Address $address - * - * @return $this - */ - public function setAddress($address) - { - $this->address = $address; - return $this; - } - - /** - * The participant address. - * - * @return \PayPal\Api\Address - */ - public function getAddress() - { - return $this->address; - } - -} diff --git a/paypal/PayPal/Api/Patch.php b/paypal/PayPal/Api/Patch.php deleted file mode 100644 index 68a6fa8..0000000 --- a/paypal/PayPal/Api/Patch.php +++ /dev/null @@ -1,114 +0,0 @@ -op = $op; - return $this; - } - - /** - * The operation to perform. - * - * @return string - */ - public function getOp() - { - return $this->op; - } - - /** - * A JSON pointer that references a location in the target document where the operation is performed. A `string` value. - * - * @param string $path - * - * @return $this - */ - public function setPath($path) - { - $this->path = $path; - return $this; - } - - /** - * A JSON pointer that references a location in the target document where the operation is performed. A `string` value. - * - * @return string - */ - public function getPath() - { - return $this->path; - } - - /** - * New value to apply based on the operation. - * - * @param mixed $value - * - * @return $this - */ - public function setValue($value) - { - $this->value = $value; - return $this; - } - - /** - * New value to apply based on the operation. - * - * @return mixed - */ - public function getValue() - { - return $this->value; - } - - /** - * A string containing a JSON Pointer value that references the location in the target document to move the value from. - * - * @param string $from - * - * @return $this - */ - public function setFrom($from) - { - $this->from = $from; - return $this; - } - - /** - * A string containing a JSON Pointer value that references the location in the target document to move the value from. - * - * @return string - */ - public function getFrom() - { - return $this->from; - } - -} diff --git a/paypal/PayPal/Api/PatchRequest.php b/paypal/PayPal/Api/PatchRequest.php deleted file mode 100644 index 2f44686..0000000 --- a/paypal/PayPal/Api/PatchRequest.php +++ /dev/null @@ -1,86 +0,0 @@ -patches = $patches; - return $this; - } - - /** - * Placeholder for holding array of patch objects - * - * @return \PayPal\Api\Patch[] - */ - public function getPatches() - { - return $this->patches; - } - - /** - * Append Patches to the list. - * - * @param \PayPal\Api\Patch $patch - * @return $this - */ - public function addPatch($patch) - { - if (!$this->getPatches()) { - return $this->setPatches(array($patch)); - } else { - return $this->setPatches( - array_merge($this->getPatches(), array($patch)) - ); - } - } - - /** - * Remove Patches from the list. - * - * @param \PayPal\Api\Patch $patch - * @return $this - */ - public function removePatch($patch) - { - return $this->setPatches( - array_diff($this->getPatches(), array($patch)) - ); - } - - /** - * As PatchRequest holds the array of Patch object, we would override the json conversion to return - * a json representation of array of Patch objects. - * - * @param int $options - * @return mixed|string - */ - public function toJSON($options = 0) - { - $json = array(); - foreach ($this->getPatches() as $patch) { - $json[] = $patch->toArray(); - } - return str_replace('\\/', '/', json_encode($json, $options)); - } -} diff --git a/paypal/PayPal/Api/Payee.php b/paypal/PayPal/Api/Payee.php deleted file mode 100644 index 22594b9..0000000 --- a/paypal/PayPal/Api/Payee.php +++ /dev/null @@ -1,157 +0,0 @@ -email = $email; - return $this; - } - - /** - * Email Address associated with the Payee's PayPal Account. If the provided email address is not associated with any PayPal Account, the payee can only receive PayPal Wallet Payments. Direct Credit Card Payments will be denied due to card compliance requirements. - * - * @return string - */ - public function getEmail() - { - return $this->email; - } - - /** - * Encrypted PayPal account identifier for the Payee. - * - * @param string $merchant_id - * - * @return $this - */ - public function setMerchantId($merchant_id) - { - $this->merchant_id = $merchant_id; - return $this; - } - - /** - * Encrypted PayPal account identifier for the Payee. - * - * @return string - */ - public function getMerchantId() - { - return $this->merchant_id; - } - - /** - * First Name of the Payee. - * @deprecated Not publicly available - * @param string $first_name - * - * @return $this - */ - public function setFirstName($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * First Name of the Payee. - * @deprecated Not publicly available - * @return string - */ - public function getFirstName() - { - return $this->first_name; - } - - /** - * Last Name of the Payee. - * @deprecated Not publicly available - * @param string $last_name - * - * @return $this - */ - public function setLastName($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * Last Name of the Payee. - * @deprecated Not publicly available - * @return string - */ - public function getLastName() - { - return $this->last_name; - } - - /** - * Unencrypted PayPal account Number of the Payee - * @deprecated Not publicly available - * @param string $account_number - * - * @return $this - */ - public function setAccountNumber($account_number) - { - $this->account_number = $account_number; - return $this; - } - - /** - * Unencrypted PayPal account Number of the Payee - * @deprecated Not publicly available - * @return string - */ - public function getAccountNumber() - { - return $this->account_number; - } - - /** - * Information related to the Payee. - * @deprecated Not publicly available - * @param \PayPal\Api\Phone $phone - * - * @return $this - */ - public function setPhone($phone) - { - $this->phone = $phone; - return $this; - } - - /** - * Information related to the Payee. - * @deprecated Not publicly available - * @return \PayPal\Api\Phone - */ - public function getPhone() - { - return $this->phone; - } - -} diff --git a/paypal/PayPal/Api/Payer.php b/paypal/PayPal/Api/Payer.php deleted file mode 100644 index 1b36887..0000000 --- a/paypal/PayPal/Api/Payer.php +++ /dev/null @@ -1,288 +0,0 @@ -payment_method = $payment_method; - return $this; - } - - /** - * Payment method being used - PayPal Wallet payment, Bank Direct Debit or Direct Credit card. - * - * @return string - */ - public function getPaymentMethod() - { - return $this->payment_method; - } - - /** - * Status of payer's PayPal Account. - * Valid Values: ["VERIFIED", "UNVERIFIED"] - * - * @param string $status - * - * @return $this - */ - public function setStatus($status) - { - $this->status = $status; - return $this; - } - - /** - * Status of payer's PayPal Account. - * - * @return string - */ - public function getStatus() - { - return $this->status; - } - - /** - * Type of account relationship payer has with PayPal. - * Valid Values: ["BUSINESS", "PERSONAL", "PREMIER"] - * @deprecated Not publicly available - * @param string $account_type - * - * @return $this - */ - public function setAccountType($account_type) - { - $this->account_type = $account_type; - return $this; - } - - /** - * Type of account relationship payer has with PayPal. - * @deprecated Not publicly available - * @return string - */ - public function getAccountType() - { - return $this->account_type; - } - - /** - * Duration since the payer established account relationship with PayPal in days. - * @deprecated Not publicly available - * @param string $account_age - * - * @return $this - */ - public function setAccountAge($account_age) - { - $this->account_age = $account_age; - return $this; - } - - /** - * Duration since the payer established account relationship with PayPal in days. - * @deprecated Not publicly available - * @return string - */ - public function getAccountAge() - { - return $this->account_age; - } - - /** - * List of funding instruments to fund the payment. 'OneOf' funding_instruments,funding_option_id to be used to identify the specifics of payment method passed. - * - * @param \PayPal\Api\FundingInstrument[] $funding_instruments - * - * @return $this - */ - public function setFundingInstruments($funding_instruments) - { - $this->funding_instruments = $funding_instruments; - return $this; - } - - /** - * List of funding instruments to fund the payment. 'OneOf' funding_instruments,funding_option_id to be used to identify the specifics of payment method passed. - * - * @return \PayPal\Api\FundingInstrument[] - */ - public function getFundingInstruments() - { - return $this->funding_instruments; - } - - /** - * Append FundingInstruments to the list. - * - * @param \PayPal\Api\FundingInstrument $fundingInstrument - * @return $this - */ - public function addFundingInstrument($fundingInstrument) - { - if (!$this->getFundingInstruments()) { - return $this->setFundingInstruments(array($fundingInstrument)); - } else { - return $this->setFundingInstruments( - array_merge($this->getFundingInstruments(), array($fundingInstrument)) - ); - } - } - - /** - * Remove FundingInstruments from the list. - * - * @param \PayPal\Api\FundingInstrument $fundingInstrument - * @return $this - */ - public function removeFundingInstrument($fundingInstrument) - { - return $this->setFundingInstruments( - array_diff($this->getFundingInstruments(), array($fundingInstrument)) - ); - } - - /** - * Id of user selected funding option for the payment.'OneOf' funding_instruments,funding_option_id to be used to identify the specifics of payment method passed. - * @deprecated Not publicly available - * @param string $funding_option_id - * - * @return $this - */ - public function setFundingOptionId($funding_option_id) - { - $this->funding_option_id = $funding_option_id; - return $this; - } - - /** - * Id of user selected funding option for the payment.'OneOf' funding_instruments,funding_option_id to be used to identify the specifics of payment method passed. - * @deprecated Not publicly available - * @return string - */ - public function getFundingOptionId() - { - return $this->funding_option_id; - } - - /** - * Default funding option available for the payment - * @deprecated Not publicly available - * @param \PayPal\Api\FundingOption $funding_option - * - * @return $this - */ - public function setFundingOption($funding_option) - { - $this->funding_option = $funding_option; - return $this; - } - - /** - * Default funding option available for the payment - * @deprecated Not publicly available - * @return \PayPal\Api\FundingOption - */ - public function getFundingOption() - { - return $this->funding_option; - } - - /** - * Instrument type pre-selected by the user outside of PayPal and passed along the payment creation. This param is used in cases such as PayPal Credit Second Button - * Valid Values: ["CREDIT", "PAY_UPON_INVOICE"] - * - * @param string $external_selected_funding_instrument_type - * - * @return $this - */ - public function setExternalSelectedFundingInstrumentType($external_selected_funding_instrument_type) - { - $this->external_selected_funding_instrument_type = $external_selected_funding_instrument_type; - return $this; - } - - /** - * Instrument type pre-selected by the user outside of PayPal and passed along the payment creation. This param is used in cases such as PayPal Credit Second Button - * - * @return string - */ - public function getExternalSelectedFundingInstrumentType() - { - return $this->external_selected_funding_instrument_type; - } - - /** - * Funding option related to default funding option. - * @deprecated Not publicly available - * @param \PayPal\Api\FundingOption $related_funding_option - * - * @return $this - */ - public function setRelatedFundingOption($related_funding_option) - { - $this->related_funding_option = $related_funding_option; - return $this; - } - - /** - * Funding option related to default funding option. - * @deprecated Not publicly available - * @return \PayPal\Api\FundingOption - */ - public function getRelatedFundingOption() - { - return $this->related_funding_option; - } - - /** - * Information related to the Payer. - * - * @param \PayPal\Api\PayerInfo $payer_info - * - * @return $this - */ - public function setPayerInfo($payer_info) - { - $this->payer_info = $payer_info; - return $this; - } - - /** - * Information related to the Payer. - * - * @return \PayPal\Api\PayerInfo - */ - public function getPayerInfo() - { - return $this->payer_info; - } - -} diff --git a/paypal/PayPal/Api/PayerInfo.php b/paypal/PayPal/Api/PayerInfo.php deleted file mode 100644 index ae70c65..0000000 --- a/paypal/PayPal/Api/PayerInfo.php +++ /dev/null @@ -1,453 +0,0 @@ -email = $email; - return $this; - } - - /** - * Email address representing the payer. 127 characters max. - * - * @return string - */ - public function getEmail() - { - return $this->email; - } - - /** - * External Remember Me id representing the payer - * - * @param string $external_remember_me_id - * - * @return $this - */ - public function setExternalRememberMeId($external_remember_me_id) - { - $this->external_remember_me_id = $external_remember_me_id; - return $this; - } - - /** - * External Remember Me id representing the payer - * - * @return string - */ - public function getExternalRememberMeId() - { - return $this->external_remember_me_id; - } - - /** - * Account Number representing the Payer - * - * @deprecated Use #setBuyerAccountNumberInstead - * @param string $account_number - * - * @return $this - */ - public function setAccountNumber($account_number) - { - $this->account_number = $account_number; - return $this; - } - - /** - * Account Number representing the Payer - * - * @deprecated Use #getBuyerAccountNumberInstead - * - * @deprecated Not publicly available - * @return string - */ - public function getAccountNumber() - { - return $this->account_number; - } - - /** - * Account Number representing the Payer - * - * @param string $buyer_account_number - * - * @return $this - */ - public function setBuyerAccountNumber($buyer_account_number) - { - $this->buyer_account_number = $buyer_account_number; - return $this; - } - - /** - * Account Number representing the Payer - * - * @return string - */ - public function getBuyerAccountNumber() - { - return $this->buyer_account_number; - } - - /** - * Salutation of the payer. - * - * @param string $salutation - * - * @return $this - */ - public function setSalutation($salutation) - { - $this->salutation = $salutation; - return $this; - } - - /** - * Salutation of the payer. - * - * @return string - */ - public function getSalutation() - { - return $this->salutation; - } - - /** - * First name of the payer. - * - * @param string $first_name - * - * @return $this - */ - public function setFirstName($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * First name of the payer. - * - * @return string - */ - public function getFirstName() - { - return $this->first_name; - } - - /** - * Middle name of the payer. - * - * @param string $middle_name - * - * @return $this - */ - public function setMiddleName($middle_name) - { - $this->middle_name = $middle_name; - return $this; - } - - /** - * Middle name of the payer. - * - * @return string - */ - public function getMiddleName() - { - return $this->middle_name; - } - - /** - * Last name of the payer. - * - * @param string $last_name - * - * @return $this - */ - public function setLastName($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * Last name of the payer. - * - * @return string - */ - public function getLastName() - { - return $this->last_name; - } - - /** - * Suffix of the payer. - * - * @param string $suffix - * - * @return $this - */ - public function setSuffix($suffix) - { - $this->suffix = $suffix; - return $this; - } - - /** - * Suffix of the payer. - * - * @return string - */ - public function getSuffix() - { - return $this->suffix; - } - - /** - * PayPal assigned encrypted Payer ID. - * - * @param string $payer_id - * - * @return $this - */ - public function setPayerId($payer_id) - { - $this->payer_id = $payer_id; - return $this; - } - - /** - * PayPal assigned encrypted Payer ID. - * - * @return string - */ - public function getPayerId() - { - return $this->payer_id; - } - - /** - * Phone number representing the payer. 20 characters max. - * - * @param string $phone - * - * @return $this - */ - public function setPhone($phone) - { - $this->phone = $phone; - return $this; - } - - /** - * Phone number representing the payer. 20 characters max. - * - * @return string - */ - public function getPhone() - { - return $this->phone; - } - - /** - * Phone type - * Valid Values: ["HOME", "WORK", "MOBILE", "OTHER"] - * - * @param string $phone_type - * - * @return $this - */ - public function setPhoneType($phone_type) - { - $this->phone_type = $phone_type; - return $this; - } - - /** - * Phone type - * - * @return string - */ - public function getPhoneType() - { - return $this->phone_type; - } - - /** - * Birth date of the Payer in ISO8601 format (yyyy-mm-dd). - * - * @param string $birth_date - * - * @return $this - */ - public function setBirthDate($birth_date) - { - $this->birth_date = $birth_date; - return $this; - } - - /** - * Birth date of the Payer in ISO8601 format (yyyy-mm-dd). - * - * @return string - */ - public function getBirthDate() - { - return $this->birth_date; - } - - /** - * Payer’s tax ID. Only supported when the `payment_method` is set to `paypal`. - * - * @param string $tax_id - * - * @return $this - */ - public function setTaxId($tax_id) - { - $this->tax_id = $tax_id; - return $this; - } - - /** - * Payer’s tax ID. Only supported when the `payment_method` is set to `paypal`. - * - * @return string - */ - public function getTaxId() - { - return $this->tax_id; - } - - /** - * Payer’s tax ID type. Allowed values: `BR_CPF` or `BR_CNPJ`. Only supported when the `payment_method` is set to `paypal`. - * Valid Values: ["BR_CPF", "BR_CNPJ"] - * - * @param string $tax_id_type - * - * @return $this - */ - public function setTaxIdType($tax_id_type) - { - $this->tax_id_type = $tax_id_type; - return $this; - } - - /** - * Payer’s tax ID type. Allowed values: `BR_CPF` or `BR_CNPJ`. Only supported when the `payment_method` is set to `paypal`. - * - * @return string - */ - public function getTaxIdType() - { - return $this->tax_id_type; - } - - /** - * Two-letter registered country code of the payer to identify the buyer country. - * - * @param string $country_code - * - * @return $this - */ - public function setCountryCode($country_code) - { - $this->country_code = $country_code; - return $this; - } - - /** - * Two-letter registered country code of the payer to identify the buyer country. - * - * @return string - */ - public function getCountryCode() - { - return $this->country_code; - } - - /** - * Billing address of the Payer. - * - * @param \PayPal\Api\Address $billing_address - * - * @return $this - */ - public function setBillingAddress($billing_address) - { - $this->billing_address = $billing_address; - return $this; - } - - /** - * Billing address of the Payer. - * - * @return \PayPal\Api\Address - */ - public function getBillingAddress() - { - return $this->billing_address; - } - - /** - * @deprecated [DEPRECATED] Use shipping address present in purchase unit or at root level of checkout Session. - * - * @param \PayPal\Api\ShippingAddress $shipping_address - * - * @return $this - */ - public function setShippingAddress($shipping_address) - { - $this->shipping_address = $shipping_address; - return $this; - } - - /** - * @deprecated [DEPRECATED] Use shipping address present in purchase unit or at root level of checkout Session. - * - * @return \PayPal\Api\ShippingAddress - */ - public function getShippingAddress() - { - return $this->shipping_address; - } - -} diff --git a/paypal/PayPal/Api/Payment.php b/paypal/PayPal/Api/Payment.php deleted file mode 100644 index 3197485..0000000 --- a/paypal/PayPal/Api/Payment.php +++ /dev/null @@ -1,691 +0,0 @@ -id = $id; - return $this; - } - - /** - * Identifier of the payment resource created. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Payment intent. - * Valid Values: ["sale", "authorize", "order"] - * - * @param string $intent - * - * @return $this - */ - public function setIntent($intent) - { - $this->intent = $intent; - return $this; - } - - /** - * Payment intent. - * - * @return string - */ - public function getIntent() - { - return $this->intent; - } - - /** - * Source of the funds for this payment represented by a PayPal account or a direct credit card. - * - * @param \PayPal\Api\Payer $payer - * - * @return $this - */ - public function setPayer($payer) - { - $this->payer = $payer; - return $this; - } - - /** - * Source of the funds for this payment represented by a PayPal account or a direct credit card. - * - * @return \PayPal\Api\Payer - */ - public function getPayer() - { - return $this->payer; - } - - /** - * Information that the merchant knows about the payer. This information is not definitive and only serves as a hint to the UI or any pre-processing logic. - * @deprecated Not publicly available - * @param \PayPal\Api\PotentialPayerInfo $potential_payer_info - * - * @return $this - */ - public function setPotentialPayerInfo($potential_payer_info) - { - $this->potential_payer_info = $potential_payer_info; - return $this; - } - - /** - * Information that the merchant knows about the payer. This information is not definitive and only serves as a hint to the UI or any pre-processing logic. - * @deprecated Not publicly available - * @return \PayPal\Api\PotentialPayerInfo - */ - public function getPotentialPayerInfo() - { - return $this->potential_payer_info; - } - - /** - * Receiver of funds for this payment. - * @param \PayPal\Api\Payee $payee - * - * @return $this - */ - public function setPayee($payee) - { - $this->payee = $payee; - return $this; - } - - /** - * Receiver of funds for this payment. - * @return \PayPal\Api\Payee - */ - public function getPayee() - { - return $this->payee; - } - - /** - * ID of the cart to execute the payment. - * @deprecated Not publicly available - * @param string $cart - * - * @return $this - */ - public function setCart($cart) - { - $this->cart = $cart; - return $this; - } - - /** - * ID of the cart to execute the payment. - * @deprecated Not publicly available - * @return string - */ - public function getCart() - { - return $this->cart; - } - - /** - * Transactional details including the amount and item details. - * - * @param \PayPal\Api\Transaction[] $transactions - * - * @return $this - */ - public function setTransactions($transactions) - { - $this->transactions = $transactions; - return $this; - } - - /** - * Transactional details including the amount and item details. - * - * @return \PayPal\Api\Transaction[] - */ - public function getTransactions() - { - return $this->transactions; - } - - /** - * Append Transactions to the list. - * - * @param \PayPal\Api\Transaction $transaction - * @return $this - */ - public function addTransaction($transaction) - { - if (!$this->getTransactions()) { - return $this->setTransactions(array($transaction)); - } else { - return $this->setTransactions( - array_merge($this->getTransactions(), array($transaction)) - ); - } - } - - /** - * Remove Transactions from the list. - * - * @param \PayPal\Api\Transaction $transaction - * @return $this - */ - public function removeTransaction($transaction) - { - return $this->setTransactions( - array_diff($this->getTransactions(), array($transaction)) - ); - } - - /** - * Applicable for advanced payments like multi seller payment (MSP) to support partial failures - * @deprecated Not publicly available - * @param \PayPal\Api\Error[] $failed_transactions - * - * @return $this - */ - public function setFailedTransactions($failed_transactions) - { - $this->failed_transactions = $failed_transactions; - return $this; - } - - /** - * Applicable for advanced payments like multi seller payment (MSP) to support partial failures - * @deprecated Not publicly available - * @return \PayPal\Api\Error[] - */ - public function getFailedTransactions() - { - return $this->failed_transactions; - } - - /** - * Append FailedTransactions to the list. - * @deprecated Not publicly available - * @param \PayPal\Api\Error $error - * @return $this - */ - public function addFailedTransaction($error) - { - if (!$this->getFailedTransactions()) { - return $this->setFailedTransactions(array($error)); - } else { - return $this->setFailedTransactions( - array_merge($this->getFailedTransactions(), array($error)) - ); - } - } - - /** - * Remove FailedTransactions from the list. - * @deprecated Not publicly available - * @param \PayPal\Api\Error $error - * @return $this - */ - public function removeFailedTransaction($error) - { - return $this->setFailedTransactions( - array_diff($this->getFailedTransactions(), array($error)) - ); - } - - /** - * Collection of PayPal generated billing agreement tokens. - * @deprecated Not publicly available - * @param string[] $billing_agreement_tokens - * - * @return $this - */ - public function setBillingAgreementTokens($billing_agreement_tokens) - { - $this->billing_agreement_tokens = $billing_agreement_tokens; - return $this; - } - - /** - * Collection of PayPal generated billing agreement tokens. - * @deprecated Not publicly available - * @return string[] - */ - public function getBillingAgreementTokens() - { - return $this->billing_agreement_tokens; - } - - /** - * Append BillingAgreementTokens to the list. - * @deprecated Not publicly available - * @param string $billingAgreementToken - * @return $this - */ - public function addBillingAgreementToken($billingAgreementToken) - { - if (!$this->getBillingAgreementTokens()) { - return $this->setBillingAgreementTokens(array($billingAgreementToken)); - } else { - return $this->setBillingAgreementTokens( - array_merge($this->getBillingAgreementTokens(), array($billingAgreementToken)) - ); - } - } - - /** - * Remove BillingAgreementTokens from the list. - * @deprecated Not publicly available - * @param string $billingAgreementToken - * @return $this - */ - public function removeBillingAgreementToken($billingAgreementToken) - { - return $this->setBillingAgreementTokens( - array_diff($this->getBillingAgreementTokens(), array($billingAgreementToken)) - ); - } - - /** - * Credit financing offered to payer on PayPal side. Returned in payment after payer opts-in - * @deprecated Not publicly available - * @param \PayPal\Api\CreditFinancingOffered $credit_financing_offered - * - * @return $this - */ - public function setCreditFinancingOffered($credit_financing_offered) - { - $this->credit_financing_offered = $credit_financing_offered; - return $this; - } - - /** - * Credit financing offered to payer on PayPal side. Returned in payment after payer opts-in - * @deprecated Not publicly available - * @return \PayPal\Api\CreditFinancingOffered - */ - public function getCreditFinancingOffered() - { - return $this->credit_financing_offered; - } - - /** - * Instructions for the payer to complete this payment. - * @deprecated Not publicly available - * @param \PayPal\Api\PaymentInstruction $payment_instruction - * - * @return $this - */ - public function setPaymentInstruction($payment_instruction) - { - $this->payment_instruction = $payment_instruction; - return $this; - } - - /** - * Instructions for the payer to complete this payment. - * @deprecated Not publicly available - * @return \PayPal\Api\PaymentInstruction - */ - public function getPaymentInstruction() - { - return $this->payment_instruction; - } - - /** - * The state of the payment, authorization, or order transaction. The value is:
  • created. The transaction was successfully created.
  • approved. The buyer approved the transaction.
  • failed. The transaction request failed.
- * Valid Values: ["created", "approved", "failed", "partially_completed", "in_progress"] - * - * @param string $state - * - * @return $this - */ - public function setState($state) - { - $this->state = $state; - return $this; - } - - /** - * The state of the payment, authorization, or order transaction. The value is:
  • created. The transaction was successfully created.
  • approved. The buyer approved the transaction.
  • failed. The transaction request failed.
- * - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * PayPal generated identifier for the merchant's payment experience profile. Refer to [this](https://developer.paypal.com/docs/api/#payment-experience) link to create experience profile ID. - * - * @param string $experience_profile_id - * - * @return $this - */ - public function setExperienceProfileId($experience_profile_id) - { - $this->experience_profile_id = $experience_profile_id; - return $this; - } - - /** - * PayPal generated identifier for the merchant's payment experience profile. Refer to [this](https://developer.paypal.com/docs/api/#payment-experience) link to create experience profile ID. - * - * @return string - */ - public function getExperienceProfileId() - { - return $this->experience_profile_id; - } - - /** - * free-form field for the use of clients to pass in a message to the payer - * - * @param string $note_to_payer - * - * @return $this - */ - public function setNoteToPayer($note_to_payer) - { - $this->note_to_payer = $note_to_payer; - return $this; - } - - /** - * free-form field for the use of clients to pass in a message to the payer - * - * @return string - */ - public function getNoteToPayer() - { - return $this->note_to_payer; - } - - /** - * Set of redirect URLs you provide only for PayPal-based payments. - * - * @param \PayPal\Api\RedirectUrls $redirect_urls - * - * @return $this - */ - public function setRedirectUrls($redirect_urls) - { - $this->redirect_urls = $redirect_urls; - return $this; - } - - /** - * Set of redirect URLs you provide only for PayPal-based payments. - * - * @return \PayPal\Api\RedirectUrls - */ - public function getRedirectUrls() - { - return $this->redirect_urls; - } - - /** - * Failure reason code returned when the payment failed for some valid reasons. - * Valid Values: ["UNABLE_TO_COMPLETE_TRANSACTION", "INVALID_PAYMENT_METHOD", "PAYER_CANNOT_PAY", "CANNOT_PAY_THIS_PAYEE", "REDIRECT_REQUIRED", "PAYEE_FILTER_RESTRICTIONS"] - * - * @param string $failure_reason - * - * @return $this - */ - public function setFailureReason($failure_reason) - { - $this->failure_reason = $failure_reason; - return $this; - } - - /** - * Failure reason code returned when the payment failed for some valid reasons. - * - * @return string - */ - public function getFailureReason() - { - return $this->failure_reason; - } - - /** - * Payment creation time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $create_time - * - * @return $this - */ - public function setCreateTime($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Payment creation time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getCreateTime() - { - return $this->create_time; - } - - /** - * Payment update time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $update_time - * - * @return $this - */ - public function setUpdateTime($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Payment update time as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getUpdateTime() - { - return $this->update_time; - } - - /** - * Get Approval Link - * - * @return null|string - */ - public function getApprovalLink() - { - return $this->getLink(PayPalConstants::APPROVAL_URL); - } - - /** - * Get token from Approval Link - * - * @return null|string - */ - public function getToken() - { - $parameter_name = "token"; - parse_str(parse_url($this->getApprovalLink(), PHP_URL_QUERY), $query); - return !isset($query[$parameter_name]) ? null : $query[$parameter_name]; - } - - /** - * Creates and processes a payment. In the JSON request body, include a `payment` object with the intent, payer, and transactions. For PayPal payments, include redirect URLs in the `payment` object. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Payment - */ - public function create($apiContext = null, $restCall = null) - { - $payLoad = $this->toJSON(); - $json = self::executeCall( - "/v1/payments/payment", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Shows details for a payment, by ID. - * - * @param string $paymentId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Payment - */ - public static function get($paymentId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($paymentId, 'paymentId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/payment/$paymentId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Payment(); - $ret->fromJson($json); - return $ret; - } - - /** - * Partially updates a payment, by ID. You can update the amount, shipping address, invoice ID, and custom data. You cannot use patch after execute has been called. - * - * @param PatchRequest $patchRequest - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return boolean - */ - public function update($patchRequest, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($patchRequest, 'patchRequest'); - $payLoad = $patchRequest->toJSON(); - self::executeCall( - "/v1/payments/payment/{$this->getId()}", - "PATCH", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Executes, or completes, a PayPal payment that the payer has approved. You can optionally update selective payment information when you execute a payment. - * - * @param PaymentExecution $paymentExecution - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Payment - */ - public function execute($paymentExecution, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($paymentExecution, 'paymentExecution'); - $payLoad = $paymentExecution->toJSON(); - $json = self::executeCall( - "/v1/payments/payment/{$this->getId()}/execute", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * List payments that were made to the merchant who issues the request. Payments can be in any state. - * - * @param array $params - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return PaymentHistory - */ - public static function all($params, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($params, 'params'); - $payLoad = ""; - $allowedParams = array( - 'count' => 1, - 'start_id' => 1, - 'start_index' => 1, - 'start_time' => 1, - 'end_time' => 1, - 'payee_id' => 1, - 'sort_by' => 1, - 'sort_order' => 1, - ); - $json = self::executeCall( - "/v1/payments/payment?" . http_build_query(array_intersect_key($params, $allowedParams)), - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new PaymentHistory(); - $ret->fromJson($json); - return $ret; - } - -} diff --git a/paypal/PayPal/Api/PaymentCard.php b/paypal/PayPal/Api/PaymentCard.php deleted file mode 100644 index c070462..0000000 --- a/paypal/PayPal/Api/PaymentCard.php +++ /dev/null @@ -1,482 +0,0 @@ -id = $id; - return $this; - } - - /** - * The ID of a credit card to save for later use. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * The card number. - * - * @param string $number - * - * @return $this - */ - public function setNumber($number) - { - $this->number = $number; - return $this; - } - - /** - * The card number. - * - * @return string - */ - public function getNumber() - { - return $this->number; - } - - /** - * The card type. - * Valid Values: ["VISA", "AMEX", "SOLO", "JCB", "STAR", "DELTA", "DISCOVER", "SWITCH", "MAESTRO", "CB_NATIONALE", "CONFINOGA", "COFIDIS", "ELECTRON", "CETELEM", "CHINA_UNION_PAY", "MASTERCARD"] - * - * @param string $type - * - * @return $this - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * The card type. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * The two-digit expiry month for the card. - * - * @param string $expire_month - * - * @return $this - */ - public function setExpireMonth($expire_month) - { - $this->expire_month = $expire_month; - return $this; - } - - /** - * The two-digit expiry month for the card. - * - * @return string - */ - public function getExpireMonth() - { - return $this->expire_month; - } - - /** - * The four-digit expiry year for the card. - * - * @param string $expire_year - * - * @return $this - */ - public function setExpireYear($expire_year) - { - $this->expire_year = $expire_year; - return $this; - } - - /** - * The four-digit expiry year for the card. - * - * @return string - */ - public function getExpireYear() - { - return $this->expire_year; - } - - /** - * The two-digit start month for the card. Required for UK Maestro cards. - * - * @param string $start_month - * - * @return $this - */ - public function setStartMonth($start_month) - { - $this->start_month = $start_month; - return $this; - } - - /** - * The two-digit start month for the card. Required for UK Maestro cards. - * - * @return string - */ - public function getStartMonth() - { - return $this->start_month; - } - - /** - * The four-digit start year for the card. Required for UK Maestro cards. - * - * @param string $start_year - * - * @return $this - */ - public function setStartYear($start_year) - { - $this->start_year = $start_year; - return $this; - } - - /** - * The four-digit start year for the card. Required for UK Maestro cards. - * - * @return string - */ - public function getStartYear() - { - return $this->start_year; - } - - /** - * The validation code for the card. Supported for payments but not for saving payment cards for future use. - * - * @param string $cvv2 - * - * @return $this - */ - public function setCvv2($cvv2) - { - $this->cvv2 = $cvv2; - return $this; - } - - /** - * The validation code for the card. Supported for payments but not for saving payment cards for future use. - * - * @return string - */ - public function getCvv2() - { - return $this->cvv2; - } - - /** - * The first name of the card holder. - * - * @param string $first_name - * - * @return $this - */ - public function setFirstName($first_name) - { - $this->first_name = $first_name; - return $this; - } - - /** - * The first name of the card holder. - * - * @return string - */ - public function getFirstName() - { - return $this->first_name; - } - - /** - * The last name of the card holder. - * - * @param string $last_name - * - * @return $this - */ - public function setLastName($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * The last name of the card holder. - * - * @return string - */ - public function getLastName() - { - return $this->last_name; - } - - /** - * The two-letter country code. - * - * @param string $billing_country - * - * @return $this - */ - public function setBillingCountry($billing_country) - { - $this->billing_country = $billing_country; - return $this; - } - - /** - * The two-letter country code. - * - * @return string - */ - public function getBillingCountry() - { - return $this->billing_country; - } - - /** - * The billing address for the card. - * - * @param \PayPal\Api\Address $billing_address - * - * @return $this - */ - public function setBillingAddress($billing_address) - { - $this->billing_address = $billing_address; - return $this; - } - - /** - * The billing address for the card. - * - * @return \PayPal\Api\Address - */ - public function getBillingAddress() - { - return $this->billing_address; - } - - /** - * The ID of the customer who owns this card account. The facilitator generates and provides this ID. Required when you create or use a stored funding instrument in the PayPal vault. - * - * @param string $external_customer_id - * - * @return $this - */ - public function setExternalCustomerId($external_customer_id) - { - $this->external_customer_id = $external_customer_id; - return $this; - } - - /** - * The ID of the customer who owns this card account. The facilitator generates and provides this ID. Required when you create or use a stored funding instrument in the PayPal vault. - * - * @return string - */ - public function getExternalCustomerId() - { - return $this->external_customer_id; - } - - /** - * The state of the funding instrument. - * Valid Values: ["EXPIRED", "ACTIVE"] - * - * @param string $status - * - * @return $this - */ - public function setStatus($status) - { - $this->status = $status; - return $this; - } - - /** - * The state of the funding instrument. - * - * @return string - */ - public function getStatus() - { - return $this->status; - } - - /** - * The product class of the financial instrument issuer. - * Valid Values: ["CREDIT", "DEBIT", "GIFT", "PAYPAL_PREPAID", "PREPAID", "UNKNOWN"] - * - * @param string $card_product_class - * - * @return $this - */ - public function setCardProductClass($card_product_class) - { - $this->card_product_class = $card_product_class; - return $this; - } - - /** - * The product class of the financial instrument issuer. - * - * @return string - */ - public function getCardProductClass() - { - return $this->card_product_class; - } - - /** - * The date and time until when this instrument can be used fund a payment. - * - * @param string $valid_until - * - * @return $this - */ - public function setValidUntil($valid_until) - { - $this->valid_until = $valid_until; - return $this; - } - - /** - * The date and time until when this instrument can be used fund a payment. - * - * @return string - */ - public function getValidUntil() - { - return $this->valid_until; - } - - /** - * The one- to two-digit card issue number. Required for UK Maestro cards. - * - * @param string $issue_number - * - * @return $this - */ - public function setIssueNumber($issue_number) - { - $this->issue_number = $issue_number; - return $this; - } - - /** - * The one- to two-digit card issue number. Required for UK Maestro cards. - * - * @return string - */ - public function getIssueNumber() - { - return $this->issue_number; - } - - /** - * Sets Links - * - * @param \PayPal\Api\Links[] $links - * - * @return $this - */ - public function setLinks($links) - { - $this->links = $links; - return $this; - } - - /** - * Gets Links - * - * @return \PayPal\Api\Links[] - */ - public function getLinks() - { - return $this->links; - } - - /** - * Append Links to the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function addLink($links) - { - if (!$this->getLinks()) { - return $this->setLinks(array($links)); - } else { - return $this->setLinks( - array_merge($this->getLinks(), array($links)) - ); - } - } - - /** - * Remove Links from the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function removeLink($links) - { - return $this->setLinks( - array_diff($this->getLinks(), array($links)) - ); - } - -} diff --git a/paypal/PayPal/Api/PaymentCardToken.php b/paypal/PayPal/Api/PaymentCardToken.php deleted file mode 100644 index d5fbe6c..0000000 --- a/paypal/PayPal/Api/PaymentCardToken.php +++ /dev/null @@ -1,162 +0,0 @@ -payment_card_id = $payment_card_id; - return $this; - } - - /** - * ID of a previously saved Payment Card resource. - * - * @return string - */ - public function getPaymentCardId() - { - return $this->payment_card_id; - } - - /** - * The unique identifier of the payer used when saving this payment card. - * - * @param string $external_customer_id - * - * @return $this - */ - public function setExternalCustomerId($external_customer_id) - { - $this->external_customer_id = $external_customer_id; - return $this; - } - - /** - * The unique identifier of the payer used when saving this payment card. - * - * @return string - */ - public function getExternalCustomerId() - { - return $this->external_customer_id; - } - - /** - * Last 4 digits of the card number from the saved card. - * - * @param string $last4 - * - * @return $this - */ - public function setLast4($last4) - { - $this->last4 = $last4; - return $this; - } - - /** - * Last 4 digits of the card number from the saved card. - * - * @return string - */ - public function getLast4() - { - return $this->last4; - } - - /** - * Type of the Card. - * Valid Values: ["VISA", "AMEX", "SOLO", "JCB", "STAR", "DELTA", "DISCOVER", "SWITCH", "MAESTRO", "CB_NATIONALE", "CONFINOGA", "COFIDIS", "ELECTRON", "CETELEM", "CHINA_UNION_PAY", "MASTERCARD"] - * - * @param string $type - * - * @return $this - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * Type of the Card. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Expiry month from the saved card with value 1 - 12. - * - * @param int $expire_month - * - * @return $this - */ - public function setExpireMonth($expire_month) - { - $this->expire_month = $expire_month; - return $this; - } - - /** - * Expiry month from the saved card with value 1 - 12. - * - * @return int - */ - public function getExpireMonth() - { - return $this->expire_month; - } - - /** - * Four digit expiry year from the saved card, represented as YYYY format. - * - * @param int $expire_year - * - * @return $this - */ - public function setExpireYear($expire_year) - { - $this->expire_year = $expire_year; - return $this; - } - - /** - * Four digit expiry year from the saved card, represented as YYYY format. - * - * @return int - */ - public function getExpireYear() - { - return $this->expire_year; - } - -} diff --git a/paypal/PayPal/Api/PaymentDefinition.php b/paypal/PayPal/Api/PaymentDefinition.php deleted file mode 100644 index 36cb799..0000000 --- a/paypal/PayPal/Api/PaymentDefinition.php +++ /dev/null @@ -1,239 +0,0 @@ -id = $id; - return $this; - } - - /** - * Identifier of the payment_definition. 128 characters max. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Name of the payment definition. 128 characters max. - * - * @param string $name - * - * @return $this - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * Name of the payment definition. 128 characters max. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Type of the payment definition. Allowed values: `TRIAL`, `REGULAR`. - * - * @param string $type - * - * @return $this - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * Type of the payment definition. Allowed values: `TRIAL`, `REGULAR`. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * How frequently the customer should be charged. - * - * @param string $frequency_interval - * - * @return $this - */ - public function setFrequencyInterval($frequency_interval) - { - $this->frequency_interval = $frequency_interval; - return $this; - } - - /** - * How frequently the customer should be charged. - * - * @return string - */ - public function getFrequencyInterval() - { - return $this->frequency_interval; - } - - /** - * Frequency of the payment definition offered. Allowed values: `WEEK`, `DAY`, `YEAR`, `MONTH`. - * - * @param string $frequency - * - * @return $this - */ - public function setFrequency($frequency) - { - $this->frequency = $frequency; - return $this; - } - - /** - * Frequency of the payment definition offered. Allowed values: `WEEK`, `DAY`, `YEAR`, `MONTH`. - * - * @return string - */ - public function getFrequency() - { - return $this->frequency; - } - - /** - * Number of cycles in this payment definition. - * - * @param string $cycles - * - * @return $this - */ - public function setCycles($cycles) - { - $this->cycles = $cycles; - return $this; - } - - /** - * Number of cycles in this payment definition. - * - * @return string - */ - public function getCycles() - { - return $this->cycles; - } - - /** - * Amount that will be charged at the end of each cycle for this payment definition. - * - * @param \PayPal\Api\Currency $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * Amount that will be charged at the end of each cycle for this payment definition. - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Array of charge_models for this payment definition. - * - * @param \PayPal\Api\ChargeModel[] $charge_models - * - * @return $this - */ - public function setChargeModels($charge_models) - { - $this->charge_models = $charge_models; - return $this; - } - - /** - * Array of charge_models for this payment definition. - * - * @return \PayPal\Api\ChargeModel[] - */ - public function getChargeModels() - { - return $this->charge_models; - } - - /** - * Append ChargeModels to the list. - * - * @param \PayPal\Api\ChargeModel $chargeModel - * @return $this - */ - public function addChargeModel($chargeModel) - { - if (!$this->getChargeModels()) { - return $this->setChargeModels(array($chargeModel)); - } else { - return $this->setChargeModels( - array_merge($this->getChargeModels(), array($chargeModel)) - ); - } - } - - /** - * Remove ChargeModels from the list. - * - * @param \PayPal\Api\ChargeModel $chargeModel - * @return $this - */ - public function removeChargeModel($chargeModel) - { - return $this->setChargeModels( - array_diff($this->getChargeModels(), array($chargeModel)) - ); - } - -} diff --git a/paypal/PayPal/Api/PaymentDetail.php b/paypal/PayPal/Api/PaymentDetail.php deleted file mode 100644 index 59305a7..0000000 --- a/paypal/PayPal/Api/PaymentDetail.php +++ /dev/null @@ -1,188 +0,0 @@ -type = $type; - return $this; - } - - /** - * The PayPal payment detail. Indicates whether payment was made in an invoicing flow through PayPal or externally. In the case of the mark-as-paid API, the supported payment type is `EXTERNAL`. For backward compatibility, the `PAYPAL` payment type is still supported. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * The PayPal payment transaction ID. Required with the `PAYPAL` payment type. - * - * @param string $transaction_id - * - * @return $this - */ - public function setTransactionId($transaction_id) - { - $this->transaction_id = $transaction_id; - return $this; - } - - /** - * The PayPal payment transaction ID. Required with the `PAYPAL` payment type. - * - * @return string - */ - public function getTransactionId() - { - return $this->transaction_id; - } - - /** - * Type of the transaction. - * Valid Values: ["SALE", "AUTHORIZATION", "CAPTURE"] - * - * @param string $transaction_type - * - * @return $this - */ - public function setTransactionType($transaction_type) - { - $this->transaction_type = $transaction_type; - return $this; - } - - /** - * Type of the transaction. - * - * @return string - */ - public function getTransactionType() - { - return $this->transaction_type; - } - - /** - * The date when the invoice was paid. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $date - * - * @return $this - */ - public function setDate($date) - { - $this->date = $date; - return $this; - } - - /** - * The date when the invoice was paid. The date format is *yyyy*-*MM*-*dd* *z* as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getDate() - { - return $this->date; - } - - /** - * The payment mode or method. Required with the `EXTERNAL` payment type. - * Valid Values: ["BANK_TRANSFER", "CASH", "CHECK", "CREDIT_CARD", "DEBIT_CARD", "PAYPAL", "WIRE_TRANSFER", "OTHER"] - * - * @param string $method - * - * @return $this - */ - public function setMethod($method) - { - $this->method = $method; - return $this; - } - - /** - * The payment mode or method. Required with the `EXTERNAL` payment type. - * - * @return string - */ - public function getMethod() - { - return $this->method; - } - - /** - * Optional. A note associated with the payment. - * - * @param string $note - * - * @return $this - */ - public function setNote($note) - { - $this->note = $note; - return $this; - } - - /** - * Optional. A note associated with the payment. - * - * @return string - */ - public function getNote() - { - return $this->note; - } - - /** - * The amount to record as payment against invoice. If you omit this parameter, the total invoice amount is recorded as payment. - * - * @param \PayPal\Api\Currency $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * The amount to record as payment against invoice. If you omit this parameter, the total invoice amount is recorded as payment. - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - -} diff --git a/paypal/PayPal/Api/PaymentExecution.php b/paypal/PayPal/Api/PaymentExecution.php deleted file mode 100644 index 4783037..0000000 --- a/paypal/PayPal/Api/PaymentExecution.php +++ /dev/null @@ -1,118 +0,0 @@ -payer_id = $payer_id; - return $this; - } - - /** - * The ID of the Payer, passed in the `return_url` by PayPal. - * - * @return string - */ - public function getPayerId() - { - return $this->payer_id; - } - - /** - * Carrier account id for a carrier billing payment. For a carrier billing payment, payer_id is not applicable. - * @deprecated Not publicly available - * @param string $carrier_account_id - * - * @return $this - */ - public function setCarrierAccountId($carrier_account_id) - { - $this->carrier_account_id = $carrier_account_id; - return $this; - } - - /** - * Carrier account id for a carrier billing payment. For a carrier billing payment, payer_id is not applicable. - * @deprecated Not publicly available - * @return string - */ - public function getCarrierAccountId() - { - return $this->carrier_account_id; - } - - /** - * Transactional details including the amount and item details. - * - * @param \PayPal\Api\Transaction[] $transactions - * - * @return $this - */ - public function setTransactions($transactions) - { - $this->transactions = $transactions; - return $this; - } - - /** - * Transactional details including the amount and item details. - * - * @return \PayPal\Api\Transaction[] - */ - public function getTransactions() - { - return $this->transactions; - } - - /** - * Append Transactions to the list. - * - * @param \PayPal\Api\Transaction $transaction - * @return $this - */ - public function addTransaction($transaction) - { - if (!$this->getTransactions()) { - return $this->setTransactions(array($transaction)); - } else { - return $this->setTransactions( - array_merge($this->getTransactions(), array($transaction)) - ); - } - } - - /** - * Remove Transactions from the list. - * - * @param \PayPal\Api\Transaction $transaction - * @return $this - */ - public function removeTransaction($transaction) - { - return $this->setTransactions( - array_diff($this->getTransactions(), array($transaction)) - ); - } - -} diff --git a/paypal/PayPal/Api/PaymentHistory.php b/paypal/PayPal/Api/PaymentHistory.php deleted file mode 100644 index eb4e611..0000000 --- a/paypal/PayPal/Api/PaymentHistory.php +++ /dev/null @@ -1,119 +0,0 @@ -payments = $payments; - return $this; - } - - /** - * A list of Payment resources - * - * @return \PayPal\Api\Payment[] - */ - public function getPayments() - { - return $this->payments; - } - - /** - * Append Payments to the list. - * - * @param \PayPal\Api\Payment $payment - * @return $this - */ - public function addPayment($payment) - { - if (!$this->getPayments()) { - return $this->setPayments(array($payment)); - } else { - return $this->setPayments( - array_merge($this->getPayments(), array($payment)) - ); - } - } - - /** - * Remove Payments from the list. - * - * @param \PayPal\Api\Payment $payment - * @return $this - */ - public function removePayment($payment) - { - return $this->setPayments( - array_diff($this->getPayments(), array($payment)) - ); - } - - /** - * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. Maximum value: 20. - * - * @param int $count - * - * @return $this - */ - public function setCount($count) - { - $this->count = $count; - return $this; - } - - /** - * Number of items returned in each range of results. Note that the last results range could have fewer items than the requested number of items. Maximum value: 20. - * - * @return int - */ - public function getCount() - { - return $this->count; - } - - /** - * Identifier of the next element to get the next range of results. - * - * @param string $next_id - * - * @return $this - */ - public function setNextId($next_id) - { - $this->next_id = $next_id; - return $this; - } - - /** - * Identifier of the next element to get the next range of results. - * - * @return string - */ - public function getNextId() - { - return $this->next_id; - } - -} diff --git a/paypal/PayPal/Api/PaymentInstruction.php b/paypal/PayPal/Api/PaymentInstruction.php deleted file mode 100644 index 152d83f..0000000 --- a/paypal/PayPal/Api/PaymentInstruction.php +++ /dev/null @@ -1,190 +0,0 @@ -reference_number = $reference_number; - return $this; - } - - /** - * ID of payment instruction - * - * @return string - */ - public function getReferenceNumber() - { - return $this->reference_number; - } - - /** - * Type of payment instruction - * Valid Values: ["MANUAL_BANK_TRANSFER", "PAY_UPON_INVOICE"] - * - * @param string $instruction_type - * - * @return $this - */ - public function setInstructionType($instruction_type) - { - $this->instruction_type = $instruction_type; - return $this; - } - - /** - * Type of payment instruction - * - * @return string - */ - public function getInstructionType() - { - return $this->instruction_type; - } - - /** - * Recipient bank Details. - * - * @param \PayPal\Api\RecipientBankingInstruction $recipient_banking_instruction - * - * @return $this - */ - public function setRecipientBankingInstruction($recipient_banking_instruction) - { - $this->recipient_banking_instruction = $recipient_banking_instruction; - return $this; - } - - /** - * Recipient bank Details. - * - * @return \PayPal\Api\RecipientBankingInstruction - */ - public function getRecipientBankingInstruction() - { - return $this->recipient_banking_instruction; - } - - /** - * Amount to be transferred - * - * @param \PayPal\Api\Currency $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * Amount to be transferred - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Date by which payment should be received - * - * @param string $payment_due_date - * - * @return $this - */ - public function setPaymentDueDate($payment_due_date) - { - $this->payment_due_date = $payment_due_date; - return $this; - } - - /** - * Date by which payment should be received - * - * @return string - */ - public function getPaymentDueDate() - { - return $this->payment_due_date; - } - - /** - * Additional text regarding payment handling - * - * @param string $note - * - * @return $this - */ - public function setNote($note) - { - $this->note = $note; - return $this; - } - - /** - * Additional text regarding payment handling - * - * @return string - */ - public function getNote() - { - return $this->note; - } - - /** - * Retrieve a payment instruction by passing the payment_id in the request URI. Use this request if you are implementing a solution that includes delayed payment like Pay Upon Invoice (PUI). - * - * @param string $paymentId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return PaymentInstruction - */ - public static function get($paymentId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($paymentId, 'paymentId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/payment/$paymentId/payment-instruction", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new PaymentInstruction(); - $ret->fromJson($json); - return $ret; - } - -} diff --git a/paypal/PayPal/Api/PaymentOptions.php b/paypal/PayPal/Api/PaymentOptions.php deleted file mode 100644 index 90b24a2..0000000 --- a/paypal/PayPal/Api/PaymentOptions.php +++ /dev/null @@ -1,88 +0,0 @@ -allowed_payment_method = $allowed_payment_method; - return $this; - } - - /** - * Payment method requested for this purchase unit - * - * @return string - */ - public function getAllowedPaymentMethod() - { - return $this->allowed_payment_method; - } - - /** - * Indicator if this payment request is a recurring payment. Only supported when the `payment_method` is set to `credit_card` - * @deprecated Not publicly available - * @param bool $recurring_flag - * - * @return $this - */ - public function setRecurringFlag($recurring_flag) - { - $this->recurring_flag = $recurring_flag; - return $this; - } - - /** - * Indicator if this payment request is a recurring payment. Only supported when the `payment_method` is set to `credit_card` - * @deprecated Not publicly available - * @return bool - */ - public function getRecurringFlag() - { - return $this->recurring_flag; - } - - /** - * Indicator if fraud management filters (fmf) should be skipped for this transaction. Only supported when the `payment_method` is set to `credit_card` - * @deprecated Not publicly available - * @param bool $skip_fmf - * - * @return $this - */ - public function setSkipFmf($skip_fmf) - { - $this->skip_fmf = $skip_fmf; - return $this; - } - - /** - * Indicator if fraud management filters (fmf) should be skipped for this transaction. Only supported when the `payment_method` is set to `credit_card` - * @deprecated Not publicly available - * @return bool - */ - public function getSkipFmf() - { - return $this->skip_fmf; - } - -} diff --git a/paypal/PayPal/Api/PaymentSummary.php b/paypal/PayPal/Api/PaymentSummary.php deleted file mode 100644 index 3fcc5d6..0000000 --- a/paypal/PayPal/Api/PaymentSummary.php +++ /dev/null @@ -1,65 +0,0 @@ -paypal = $paypal; - return $this; - } - - /** - * Total Amount paid/refunded via PayPal. - * - * @return \PayPal\Api\Currency - */ - public function getPaypal() - { - return $this->paypal; - } - - /** - * Total Amount paid/refunded via other sources. - * - * @param \PayPal\Api\Currency $other - * - * @return $this - */ - public function setOther($other) - { - $this->other = $other; - return $this; - } - - /** - * Total Amount paid/refunded via other sources. - * - * @return \PayPal\Api\Currency - */ - public function getOther() - { - return $this->other; - } - -} diff --git a/paypal/PayPal/Api/PaymentTerm.php b/paypal/PayPal/Api/PaymentTerm.php deleted file mode 100644 index ee62f6d..0000000 --- a/paypal/PayPal/Api/PaymentTerm.php +++ /dev/null @@ -1,66 +0,0 @@ -term_type = $term_type; - return $this; - } - - /** - * The terms by which the invoice payment is due. - * - * @return string - */ - public function getTermType() - { - return $this->term_type; - } - - /** - * The date when the invoice payment is due. This date must be a future date. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $due_date - * - * @return $this - */ - public function setDueDate($due_date) - { - $this->due_date = $due_date; - return $this; - } - - /** - * The date when the invoice payment is due. This date must be a future date. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getDueDate() - { - return $this->due_date; - } - -} diff --git a/paypal/PayPal/Api/Payout.php b/paypal/PayPal/Api/Payout.php deleted file mode 100644 index b97b515..0000000 --- a/paypal/PayPal/Api/Payout.php +++ /dev/null @@ -1,166 +0,0 @@ -sender_batch_header = $sender_batch_header; - return $this; - } - - /** - * The original batch header as provided by the payment sender. - * - * @return \PayPal\Api\PayoutSenderBatchHeader - */ - public function getSenderBatchHeader() - { - return $this->sender_batch_header; - } - - /** - * An array of payout items (that is, a set of individual payouts). - * - * @param \PayPal\Api\PayoutItem[] $items - * - * @return $this - */ - public function setItems($items) - { - $this->items = $items; - return $this; - } - - /** - * An array of payout items (that is, a set of individual payouts). - * - * @return \PayPal\Api\PayoutItem[] - */ - public function getItems() - { - return $this->items; - } - - /** - * Append Items to the list. - * - * @param \PayPal\Api\PayoutItem $payoutItem - * @return $this - */ - public function addItem($payoutItem) - { - if (!$this->getItems()) { - return $this->setItems(array($payoutItem)); - } else { - return $this->setItems( - array_merge($this->getItems(), array($payoutItem)) - ); - } - } - - /** - * Remove Items from the list. - * - * @param \PayPal\Api\PayoutItem $payoutItem - * @return $this - */ - public function removeItem($payoutItem) - { - return $this->setItems( - array_diff($this->getItems(), array($payoutItem)) - ); - } - - /** - * Create a payout batch resource by passing a sender_batch_header and an items array to the request URI. The sender_batch_header contains payout parameters that describe the handling of a batch resource while the items array conatins payout items. - * - * @param array $params - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return PayoutBatch - */ - public function create($params = array(), $apiContext = null, $restCall = null) - { - $params = $params ? $params : array(); - ArgumentValidator::validate($params, 'params'); - $payLoad = $this->toJSON(); - $allowedParams = array( - 'sync_mode' => 1, - ); - $json = self::executeCall( - "/v1/payments/payouts" . "?" . http_build_query(array_intersect_key($params, $allowedParams)), - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new PayoutBatch(); - $ret->fromJson($json); - return $ret; - } - - /** - * You can submit a payout with a synchronous API call, which immediately returns the results of a PayPal payment. - * - * @param ApiContext $apiContext - * @param PayPalRestCall $restCall - * @return PayoutBatch - */ - public function createSynchronous($apiContext = null, $restCall = null) - { - $params = array('sync_mode' => 'true'); - return $this->create($params, $apiContext, $restCall); - } - - /** - * Obtain the status of a specific batch resource by passing the payout batch ID to the request URI. You can issue this call multiple times to get the current status. - * - * @param string $payoutBatchId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return PayoutBatch - */ - public static function get($payoutBatchId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($payoutBatchId, 'payoutBatchId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/payouts/$payoutBatchId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new PayoutBatch(); - $ret->fromJson($json); - return $ret; - } - -} diff --git a/paypal/PayPal/Api/PayoutBatch.php b/paypal/PayPal/Api/PayoutBatch.php deleted file mode 100644 index 2b5e367..0000000 --- a/paypal/PayPal/Api/PayoutBatch.php +++ /dev/null @@ -1,120 +0,0 @@ -batch_header = $batch_header; - return $this; - } - - /** - * A batch header. Includes the generated batch status. - * - * @return \PayPal\Api\PayoutBatchHeader - */ - public function getBatchHeader() - { - return $this->batch_header; - } - - /** - * An array of items in a batch payout. - * - * @param \PayPal\Api\PayoutItemDetails[] $items - * - * @return $this - */ - public function setItems($items) - { - $this->items = $items; - return $this; - } - - /** - * An array of items in a batch payout. - * - * @return \PayPal\Api\PayoutItemDetails[] - */ - public function getItems() - { - return $this->items; - } - - /** - * Append Items to the list. - * - * @param \PayPal\Api\PayoutItemDetails $payoutItemDetails - * @return $this - */ - public function addItem($payoutItemDetails) - { - if (!$this->getItems()) { - return $this->setItems(array($payoutItemDetails)); - } else { - return $this->setItems( - array_merge($this->getItems(), array($payoutItemDetails)) - ); - } - } - - /** - * Remove Items from the list. - * - * @param \PayPal\Api\PayoutItemDetails $payoutItemDetails - * @return $this - */ - public function removeItem($payoutItemDetails) - { - return $this->setItems( - array_diff($this->getItems(), array($payoutItemDetails)) - ); - } - - - /** - * Sets Links - * - * @param \PayPal\Api\Links[] $links - * - * @return $this - */ - public function setLinks($links) - { - $this->links = $links; - return $this; - } - - /** - * Gets Links - * - * @return \PayPal\Api\Links[] - */ - public function getLinks() - { - return $this->links; - } - -} diff --git a/paypal/PayPal/Api/PayoutBatchHeader.php b/paypal/PayPal/Api/PayoutBatchHeader.php deleted file mode 100644 index 88a834b..0000000 --- a/paypal/PayPal/Api/PayoutBatchHeader.php +++ /dev/null @@ -1,263 +0,0 @@ -payout_batch_id = $payout_batch_id; - return $this; - } - - /** - * The PayPal-generated ID for a batch payout. - * - * @return string - */ - public function getPayoutBatchId() - { - return $this->payout_batch_id; - } - - /** - * The PayPal-generated batch payout status. If the batch payout passes the preliminary checks, the status is `PENDING`. - * - * @param string $batch_status - * - * @return $this - */ - public function setBatchStatus($batch_status) - { - $this->batch_status = $batch_status; - return $this; - } - - /** - * The PayPal-generated batch payout status. If the batch payout passes the preliminary checks, the status is `PENDING`. - * - * @return string - */ - public function getBatchStatus() - { - return $this->batch_status; - } - - /** - * The time the batch entered processing. - * - * @param string $time_created - * - * @return $this - */ - public function setTimeCreated($time_created) - { - $this->time_created = $time_created; - return $this; - } - - /** - * The time the batch entered processing. - * - * @return string - */ - public function getTimeCreated() - { - return $this->time_created; - } - - /** - * The time that processing for the batch was completed. - * - * @param string $time_completed - * - * @return $this - */ - public function setTimeCompleted($time_completed) - { - $this->time_completed = $time_completed; - return $this; - } - - /** - * The time that processing for the batch was completed. - * - * @return string - */ - public function getTimeCompleted() - { - return $this->time_completed; - } - - /** - * The original batch header as provided by the payment sender. - * - * @param \PayPal\Api\PayoutSenderBatchHeader $sender_batch_header - * - * @return $this - */ - public function setSenderBatchHeader($sender_batch_header) - { - $this->sender_batch_header = $sender_batch_header; - return $this; - } - - /** - * The sender-provided batch payout header. - * - * @return \PayPal\Api\PayoutSenderBatchHeader - */ - public function getSenderBatchHeader() - { - return $this->sender_batch_header; - } - - /** - * Total amount, in U.S. dollars, requested for the applicable payouts. - * - * @param \PayPal\Api\Currency $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * Total amount, in U.S. dollars, requested for the applicable payouts. - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Total estimate in U.S. dollars for the applicable payouts fees. - * - * @param \PayPal\Api\Currency $fees - * - * @return $this - */ - public function setFees($fees) - { - $this->fees = $fees; - return $this; - } - - /** - * Total estimate in U.S. dollars for the applicable payouts fees. - * - * @return \PayPal\Api\Currency - */ - public function getFees() - { - return $this->fees; - } - - /** - * Sets Errors - * - * @param \PayPal\Api\Error $errors - * - * @return $this - */ - public function setErrors($errors) - { - $this->errors = $errors; - return $this; - } - - /** - * Gets Errors - * - * @return \PayPal\Api\Error - */ - public function getErrors() - { - return $this->errors; - } - - /** - * Sets Links - * - * @param \PayPal\Api\Links[] $links - * - * @return $this - */ - public function setLinks($links) - { - $this->links = $links; - return $this; - } - - /** - * Gets Links - * - * @return \PayPal\Api\Links[] - */ - public function getLinks() - { - return $this->links; - } - - /** - * Append Links to the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function addLink($links) - { - if (!$this->getLinks()) { - return $this->setLinks(array($links)); - } else { - return $this->setLinks( - array_merge($this->getLinks(), array($links)) - ); - } - } - - /** - * Remove Links from the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function removeLink($links) - { - return $this->setLinks( - array_diff($this->getLinks(), array($links)) - ); - } - -} diff --git a/paypal/PayPal/Api/PayoutItem.php b/paypal/PayPal/Api/PayoutItem.php deleted file mode 100644 index b8e628b..0000000 --- a/paypal/PayPal/Api/PayoutItem.php +++ /dev/null @@ -1,189 +0,0 @@ -EMAIL. Unencrypted email. Value is a string of up to 127 single-byte characters.
  • PHONE. Unencrypted phone number.
    Note: The PayPal sandbox does not support the PHONE recipient type.
  • PAYPAL_ID. Encrypted PayPal account number.
  • If the sender_batch_header includes the recipient_type attribute, any payout item without its own recipient_type attribute uses the recipient_type value from sender_batch_header. If the sender_batch_header omits the recipient_type attribute, each payout item must include its own recipient_type value. - * - * @param string $recipient_type - * - * @return $this - */ - public function setRecipientType($recipient_type) - { - $this->recipient_type = $recipient_type; - return $this; - } - - /** - * The type of ID that identifies the payment receiver. Value is:
      EMAIL. Unencrypted email. Value is a string of up to 127 single-byte characters.
    • PHONE. Unencrypted phone number.
      Note: The PayPal sandbox does not support the PHONE recipient type.
    • PAYPAL_ID. Encrypted PayPal account number.
    If the sender_batch_header includes the recipient_type attribute, any payout item without its own recipient_type attribute uses the recipient_type value from sender_batch_header. If the sender_batch_header omits the recipient_type attribute, each payout item must include its own recipient_type value. - * - * @return string - */ - public function getRecipientType() - { - return $this->recipient_type; - } - - /** - * The amount of money to pay the receiver. - * - * @param \PayPal\Api\Currency $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * The amount of money to pay the receiver. - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Optional. A sender-specified note for notifications. Value is any string value. - * - * @param string $note - * - * @return $this - */ - public function setNote($note) - { - $this->note = $note; - return $this; - } - - /** - * Optional. A sender-specified note for notifications. Value is any string value. - * - * @return string - */ - public function getNote() - { - return $this->note; - } - - /** - * The receiver of the payment. Corresponds to the `recipient_type` value in the request. - * - * @param string $receiver - * - * @return $this - */ - public function setReceiver($receiver) - { - $this->receiver = $receiver; - return $this; - } - - /** - * The receiver of the payment. Corresponds to the `recipient_type` value in the request. - * - * @return string - */ - public function getReceiver() - { - return $this->receiver; - } - - /** - * A sender-specified ID number. Tracks the batch payout in an accounting system. - * - * @param string $sender_item_id - * - * @return $this - */ - public function setSenderItemId($sender_item_id) - { - $this->sender_item_id = $sender_item_id; - return $this; - } - - /** - * A sender-specified ID number. Tracks the batch payout in an accounting system. - * - * @return string - */ - public function getSenderItemId() - { - return $this->sender_item_id; - } - - /** - * Obtain the status of a payout item by passing the item ID to the request URI. - * - * @param string $payoutItemId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return PayoutItemDetails - */ - public static function get($payoutItemId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($payoutItemId, 'payoutItemId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/payouts-item/$payoutItemId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new PayoutItemDetails(); - $ret->fromJson($json); - return $ret; - } - - /** - * Cancels the unclaimed payment using the items id passed in the request URI. If an unclaimed item is not claimed within 30 days, the funds will be automatically returned to the sender. This call can be used to cancel the unclaimed item prior to the automatic 30-day return. - * - * @param string $payoutItemId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return PayoutItemDetails - */ - public static function cancel($payoutItemId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($payoutItemId, 'payoutItemId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/payouts-item/$payoutItemId/cancel", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new PayoutItemDetails(); - $ret->fromJson($json); - return $ret; - } -} diff --git a/paypal/PayPal/Api/PayoutItemDetails.php b/paypal/PayPal/Api/PayoutItemDetails.php deleted file mode 100644 index 147b99e..0000000 --- a/paypal/PayPal/Api/PayoutItemDetails.php +++ /dev/null @@ -1,287 +0,0 @@ -payout_item_id = $payout_item_id; - return $this; - } - - /** - * The ID for the payout item. Viewable when you show details for a batch payout. - * - * @return string - */ - public function getPayoutItemId() - { - return $this->payout_item_id; - } - - /** - * The PayPal-generated ID for the transaction. - * - * @param string $transaction_id - * - * @return $this - */ - public function setTransactionId($transaction_id) - { - $this->transaction_id = $transaction_id; - return $this; - } - - /** - * The PayPal-generated ID for the transaction. - * - * @return string - */ - public function getTransactionId() - { - return $this->transaction_id; - } - - /** - * The transaction status. - * - * @param string $transaction_status - * - * @return $this - */ - public function setTransactionStatus($transaction_status) - { - $this->transaction_status = $transaction_status; - return $this; - } - - /** - * The transaction status. - * - * @return string - */ - public function getTransactionStatus() - { - return $this->transaction_status; - } - - /** - * The amount of money, in U.S. dollars, for fees. - * - * @param \PayPal\Api\Currency $payout_item_fee - * - * @return $this - */ - public function setPayoutItemFee($payout_item_fee) - { - $this->payout_item_fee = $payout_item_fee; - return $this; - } - - /** - * The amount of money, in U.S. dollars, for fees. - * - * @return \PayPal\Api\Currency - */ - public function getPayoutItemFee() - { - return $this->payout_item_fee; - } - - /** - * The PayPal-generated ID for the batch payout. - * - * @param string $payout_batch_id - * - * @return $this - */ - public function setPayoutBatchId($payout_batch_id) - { - $this->payout_batch_id = $payout_batch_id; - return $this; - } - - /** - * The PayPal-generated ID for the batch payout. - * - * @return string - */ - public function getPayoutBatchId() - { - return $this->payout_batch_id; - } - - /** - * A sender-specified ID number. Tracks the batch payout in an accounting system. - * - * @param string $sender_batch_id - * - * @return $this - */ - public function setSenderBatchId($sender_batch_id) - { - $this->sender_batch_id = $sender_batch_id; - return $this; - } - - /** - * A sender-specified ID number. Tracks the batch payout in an accounting system. - * - * @return string - */ - public function getSenderBatchId() - { - return $this->sender_batch_id; - } - - /** - * The sender-provided information for the payout item. - * - * @param \PayPal\Api\PayoutItem $payout_item - * - * @return $this - */ - public function setPayoutItem($payout_item) - { - $this->payout_item = $payout_item; - return $this; - } - - /** - * The sender-provided information for the payout item. - * - * @return \PayPal\Api\PayoutItem - */ - public function getPayoutItem() - { - return $this->payout_item; - } - - /** - * The date and time when this item was last processed. - * - * @param string $time_processed - * - * @return $this - */ - public function setTimeProcessed($time_processed) - { - $this->time_processed = $time_processed; - return $this; - } - - /** - * The date and time when this item was last processed. - * - * @return string - */ - public function getTimeProcessed() - { - return $this->time_processed; - } - - /** - * Sets Errors - * - * @param \PayPal\Api\Error $errors - * - * @return $this - */ - public function setErrors($errors) - { - $this->errors = $errors; - return $this; - } - - /** - * Gets Errors - * - * @return \PayPal\Api\Error - */ - public function getErrors() - { - return $this->errors; - } - - /** - * Sets Links - * - * @param \PayPal\Api\Links[] $links - * - * @return $this - */ - public function setLinks($links) - { - $this->links = $links; - return $this; - } - - /** - * Gets Links - * - * @return \PayPal\Api\Links[] - */ - public function getLinks() - { - return $this->links; - } - - /** - * Append Links to the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function addLink($links) - { - if (!$this->getLinks()) { - return $this->setLinks(array($links)); - } else { - return $this->setLinks( - array_merge($this->getLinks(), array($links)) - ); - } - } - - /** - * Remove Links from the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function removeLink($links) - { - return $this->setLinks( - array_diff($this->getLinks(), array($links)) - ); - } - -} diff --git a/paypal/PayPal/Api/PayoutSenderBatchHeader.php b/paypal/PayPal/Api/PayoutSenderBatchHeader.php deleted file mode 100644 index 3ea59c9..0000000 --- a/paypal/PayPal/Api/PayoutSenderBatchHeader.php +++ /dev/null @@ -1,107 +0,0 @@ -Note: PayPal prevents duplicate batches from being processed. If you specify a `sender_batch_id` that was used in the last 30 days, the API rejects the request and returns an error message that indicates the duplicate `sender_batch_id` and includes a HATEOAS link to the original batch payout with the same `sender_batch_id`. If you receive a HTTP `5nn` status code, you can safely retry the request with the same `sender_batch_id`. In any case, the API completes a payment only once for a specific `sender_batch_id` that is used within 30 days. - * - * @param string $sender_batch_id - * - * @return $this - */ - public function setSenderBatchId($sender_batch_id) - { - $this->sender_batch_id = $sender_batch_id; - return $this; - } - - /** - * A sender-specified ID number. Tracks the batch payout in an accounting system.
    Note: PayPal prevents duplicate batches from being processed. If you specify a `sender_batch_id` that was used in the last 30 days, the API rejects the request and returns an error message that indicates the duplicate `sender_batch_id` and includes a HATEOAS link to the original batch payout with the same `sender_batch_id`. If you receive a HTTP `5nn` status code, you can safely retry the request with the same `sender_batch_id`. In any case, the API completes a payment only once for a specific `sender_batch_id` that is used within 30 days.
    - * - * @return string - */ - public function getSenderBatchId() - { - return $this->sender_batch_id; - } - - /** - * The subject line text for the email that PayPal sends when a payout item completes. The subject line is the same for all recipients. Value is an alphanumeric string with a maximum length of 255 single-byte characters. - * - * @param string $email_subject - * - * @return $this - */ - public function setEmailSubject($email_subject) - { - $this->email_subject = $email_subject; - return $this; - } - - /** - * The subject line text for the email that PayPal sends when a payout item completes. The subject line is the same for all recipients. Value is an alphanumeric string with a maximum length of 255 single-byte characters. - * - * @return string - */ - public function getEmailSubject() - { - return $this->email_subject; - } - - /** - * The type of ID that identifies the payment receiver. Value is:
      EMAIL. Unencrypted email. Value is a string of up to 127 single-byte characters.
    • PHONE. Unencrypted phone number.
      Note: The PayPal sandbox does not support the PHONE recipient type.
    • PAYPAL_ID. Encrypted PayPal account number.
    If the sender_batch_header includes the recipient_type attribute, any payout item without its own recipient_type attribute uses the recipient_type value from sender_batch_header. If the sender_batch_header omits the recipient_type attribute, each payout item must include its own recipient_type value. - * - * @param string $recipient_type - * - * @return $this - */ - public function setRecipientType($recipient_type) - { - $this->recipient_type = $recipient_type; - return $this; - } - - /** - * The type of ID that identifies the payment receiver. Value is:
      EMAIL. Unencrypted email. Value is a string of up to 127 single-byte characters.
    • PHONE. Unencrypted phone number.
      Note: The PayPal sandbox does not support the PHONE recipient type.
    • PAYPAL_ID. Encrypted PayPal account number.
    If the sender_batch_header includes the recipient_type attribute, any payout item without its own recipient_type attribute uses the recipient_type value from sender_batch_header. If the sender_batch_header omits the recipient_type attribute, each payout item must include its own recipient_type value. - * - * @return string - */ - public function getRecipientType() - { - return $this->recipient_type; - } - - /** - * @deprecated This property is unused - */ - public function setBatchStatus($batch_status) - { - $this->batch_status = $batch_status; - return $this; - } - - /** - * @deprecated This property is unused - */ - public function getBatchStatus() - { - return $this->batch_status; - } - -} diff --git a/paypal/PayPal/Api/Phone.php b/paypal/PayPal/Api/Phone.php deleted file mode 100644 index b93a09e..0000000 --- a/paypal/PayPal/Api/Phone.php +++ /dev/null @@ -1,89 +0,0 @@ -country_code = $country_code; - return $this; - } - - /** - * Country code (from in E.164 format) - * - * @return string - */ - public function getCountryCode() - { - return $this->country_code; - } - - /** - * In-country phone number (from in E.164 format) - * - * @param string $national_number - * - * @return $this - */ - public function setNationalNumber($national_number) - { - $this->national_number = $national_number; - return $this; - } - - /** - * In-country phone number (from in E.164 format) - * - * @return string - */ - public function getNationalNumber() - { - return $this->national_number; - } - - /** - * Phone extension - * - * @param string $extension - * - * @return $this - */ - public function setExtension($extension) - { - $this->extension = $extension; - return $this; - } - - /** - * Phone extension - * - * @return string - */ - public function getExtension() - { - return $this->extension; - } - -} diff --git a/paypal/PayPal/Api/Plan.php b/paypal/PayPal/Api/Plan.php deleted file mode 100644 index 630a9dc..0000000 --- a/paypal/PayPal/Api/Plan.php +++ /dev/null @@ -1,445 +0,0 @@ -id = $id; - return $this; - } - - /** - * Identifier of the billing plan. 128 characters max. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Name of the billing plan. 128 characters max. - * - * @param string $name - * - * @return $this - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * Name of the billing plan. 128 characters max. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Description of the billing plan. 128 characters max. - * - * @param string $description - * - * @return $this - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * Description of the billing plan. 128 characters max. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Type of the billing plan. Allowed values: `FIXED`, `INFINITE`. - * - * @param string $type - * - * @return $this - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * Type of the billing plan. Allowed values: `FIXED`, `INFINITE`. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Status of the billing plan. Allowed values: `CREATED`, `ACTIVE`, `INACTIVE`, and `DELETED`. - * - * @param string $state - * - * @return $this - */ - public function setState($state) - { - $this->state = $state; - return $this; - } - - /** - * Status of the billing plan. Allowed values: `CREATED`, `ACTIVE`, `INACTIVE`, and `DELETED`. - * - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Time when the billing plan was created. Format YYYY-MM-DDTimeTimezone, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $create_time - * - * @return $this - */ - public function setCreateTime($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time when the billing plan was created. Format YYYY-MM-DDTimeTimezone, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getCreateTime() - { - return $this->create_time; - } - - /** - * Time when this billing plan was updated. Format YYYY-MM-DDTimeTimezone, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $update_time - * - * @return $this - */ - public function setUpdateTime($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time when this billing plan was updated. Format YYYY-MM-DDTimeTimezone, as defined in [ISO8601](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getUpdateTime() - { - return $this->update_time; - } - - /** - * Array of payment definitions for this billing plan. - * - * @param \PayPal\Api\PaymentDefinition[] $payment_definitions - * - * @return $this - */ - public function setPaymentDefinitions($payment_definitions) - { - $this->payment_definitions = $payment_definitions; - return $this; - } - - /** - * Array of payment definitions for this billing plan. - * - * @return \PayPal\Api\PaymentDefinition[] - */ - public function getPaymentDefinitions() - { - return $this->payment_definitions; - } - - /** - * Append PaymentDefinitions to the list. - * - * @param \PayPal\Api\PaymentDefinition $paymentDefinition - * @return $this - */ - public function addPaymentDefinition($paymentDefinition) - { - if (!$this->getPaymentDefinitions()) { - return $this->setPaymentDefinitions(array($paymentDefinition)); - } else { - return $this->setPaymentDefinitions( - array_merge($this->getPaymentDefinitions(), array($paymentDefinition)) - ); - } - } - - /** - * Remove PaymentDefinitions from the list. - * - * @param \PayPal\Api\PaymentDefinition $paymentDefinition - * @return $this - */ - public function removePaymentDefinition($paymentDefinition) - { - return $this->setPaymentDefinitions( - array_diff($this->getPaymentDefinitions(), array($paymentDefinition)) - ); - } - - /** - * Array of terms for this billing plan. - * - * @param \PayPal\Api\Terms[] $terms - * - * @return $this - */ - public function setTerms($terms) - { - $this->terms = $terms; - return $this; - } - - /** - * Array of terms for this billing plan. - * - * @return \PayPal\Api\Terms[] - */ - public function getTerms() - { - return $this->terms; - } - - /** - * Append Terms to the list. - * - * @param \PayPal\Api\Terms $terms - * @return $this - */ - public function addTerm($terms) - { - if (!$this->getTerms()) { - return $this->setTerms(array($terms)); - } else { - return $this->setTerms( - array_merge($this->getTerms(), array($terms)) - ); - } - } - - /** - * Remove Terms from the list. - * - * @param \PayPal\Api\Terms $terms - * @return $this - */ - public function removeTerm($terms) - { - return $this->setTerms( - array_diff($this->getTerms(), array($terms)) - ); - } - - /** - * Specific preferences such as: set up fee, max fail attempts, autobill amount, and others that are configured for this billing plan. - * - * @param \PayPal\Api\MerchantPreferences $merchant_preferences - * - * @return $this - */ - public function setMerchantPreferences($merchant_preferences) - { - $this->merchant_preferences = $merchant_preferences; - return $this; - } - - /** - * Specific preferences such as: set up fee, max fail attempts, autobill amount, and others that are configured for this billing plan. - * - * @return \PayPal\Api\MerchantPreferences - */ - public function getMerchantPreferences() - { - return $this->merchant_preferences; - } - - /** - * Retrieve the details for a particular billing plan by passing the billing plan ID to the request URI. - * - * @param string $planId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Plan - */ - public static function get($planId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($planId, 'planId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/billing-plans/$planId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Plan(); - $ret->fromJson($json); - return $ret; - } - - /** - * Create a new billing plan by passing the details for the plan, including the plan name, description, and type, to the request URI. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Plan - */ - public function create($apiContext = null, $restCall = null) - { - $payLoad = $this->toJSON(); - $json = self::executeCall( - "/v1/payments/billing-plans/", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Replace specific fields within a billing plan by passing the ID of the billing plan to the request URI. In addition, pass a patch object in the request JSON that specifies the operation to perform, field to update, and new value for each update. - * - * @param PatchRequest $patchRequest - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function update($patchRequest, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($patchRequest, 'patchRequest'); - $payLoad = $patchRequest->toJSON(); - self::executeCall( - "/v1/payments/billing-plans/{$this->getId()}", - "PATCH", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Delete a billing plan by passing the ID of the billing plan to the request URI. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function delete($apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - $patchRequest = new PatchRequest(); - $patch = new Patch(); - $value = new PayPalModel('{ - "state":"DELETED" - }'); - $patch->setOp('replace') - ->setPath('/') - ->setValue($value); - $patchRequest->addPatch($patch); - return $this->update($patchRequest, $apiContext, $restCall); - } - - /** - * List billing plans according to optional query string parameters specified. - * - * @param array $params - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return PlanList - */ - public static function all($params, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($params, 'params'); - $payLoad = ""; - $allowedParams = array( - 'page_size' => 1, - 'status' => 1, - 'page' => 1, - 'total_required' => 1 - ); - $json = self::executeCall( - "/v1/payments/billing-plans/" . "?" . http_build_query(array_intersect_key($params, $allowedParams)), - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new PlanList(); - $ret->fromJson($json); - return $ret; - } - -} diff --git a/paypal/PayPal/Api/PlanList.php b/paypal/PayPal/Api/PlanList.php deleted file mode 100644 index 495599b..0000000 --- a/paypal/PayPal/Api/PlanList.php +++ /dev/null @@ -1,173 +0,0 @@ -plans = $plans; - return $this; - } - - /** - * Array of billing plans. - * - * @return \PayPal\Api\Plan[] - */ - public function getPlans() - { - return $this->plans; - } - - /** - * Append Plans to the list. - * - * @param \PayPal\Api\Plan $plan - * @return $this - */ - public function addPlan($plan) - { - if (!$this->getPlans()) { - return $this->setPlans(array($plan)); - } else { - return $this->setPlans( - array_merge($this->getPlans(), array($plan)) - ); - } - } - - /** - * Remove Plans from the list. - * - * @param \PayPal\Api\Plan $plan - * @return $this - */ - public function removePlan($plan) - { - return $this->setPlans( - array_diff($this->getPlans(), array($plan)) - ); - } - - /** - * Total number of items. - * - * @param string $total_items - * - * @return $this - */ - public function setTotalItems($total_items) - { - $this->total_items = $total_items; - return $this; - } - - /** - * Total number of items. - * - * @return string - */ - public function getTotalItems() - { - return $this->total_items; - } - - /** - * Total number of pages. - * - * @param string $total_pages - * - * @return $this - */ - public function setTotalPages($total_pages) - { - $this->total_pages = $total_pages; - return $this; - } - - /** - * Total number of pages. - * - * @return string - */ - public function getTotalPages() - { - return $this->total_pages; - } - - /** - * Sets Links - * - * @param \PayPal\Api\Links[] $links - * - * @return $this - */ - public function setLinks($links) - { - $this->links = $links; - return $this; - } - - /** - * Gets Links - * - * @return \PayPal\Api\Links[] - */ - public function getLinks() - { - return $this->links; - } - - /** - * Append Links to the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function addLink($links) - { - if (!$this->getLinks()) { - return $this->setLinks(array($links)); - } else { - return $this->setLinks( - array_merge($this->getLinks(), array($links)) - ); - } - } - - /** - * Remove Links from the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function removeLink($links) - { - return $this->setLinks( - array_diff($this->getLinks(), array($links)) - ); - } - -} diff --git a/paypal/PayPal/Api/PotentialPayerInfo.php b/paypal/PayPal/Api/PotentialPayerInfo.php deleted file mode 100644 index 63254cf..0000000 --- a/paypal/PayPal/Api/PotentialPayerInfo.php +++ /dev/null @@ -1,109 +0,0 @@ -email = $email; - return $this; - } - - /** - * Email address representing the potential payer. - * @deprecated Not publicly available - * @return string - */ - public function getEmail() - { - return $this->email; - } - - /** - * ExternalRememberMe id representing the potential payer - * @deprecated Not publicly available - * @param string $external_remember_me_id - * - * @return $this - */ - public function setExternalRememberMeId($external_remember_me_id) - { - $this->external_remember_me_id = $external_remember_me_id; - return $this; - } - - /** - * ExternalRememberMe id representing the potential payer - * @deprecated Not publicly available - * @return string - */ - public function getExternalRememberMeId() - { - return $this->external_remember_me_id; - } - - /** - * Account Number representing the potential payer - * @deprecated Not publicly available - * @param string $account_number - * - * @return $this - */ - public function setAccountNumber($account_number) - { - $this->account_number = $account_number; - return $this; - } - - /** - * Account Number representing the potential payer - * @deprecated Not publicly available - * @return string - */ - public function getAccountNumber() - { - return $this->account_number; - } - - /** - * Billing address of the potential payer. - * @deprecated Not publicly available - * @param \PayPal\Api\Address $billing_address - * - * @return $this - */ - public function setBillingAddress($billing_address) - { - $this->billing_address = $billing_address; - return $this; - } - - /** - * Billing address of the potential payer. - * @deprecated Not publicly available - * @return \PayPal\Api\Address - */ - public function getBillingAddress() - { - return $this->billing_address; - } - -} diff --git a/paypal/PayPal/Api/Presentation.php b/paypal/PayPal/Api/Presentation.php deleted file mode 100644 index 95c13a3..0000000 --- a/paypal/PayPal/Api/Presentation.php +++ /dev/null @@ -1,137 +0,0 @@ -brand_name = $brand_name; - return $this; - } - - /** - * A label that overrides the business name in the PayPal account on the PayPal pages. Character length and limitations: 127 single-byte alphanumeric characters. - * - * @return string - */ - public function getBrandName() - { - return $this->brand_name; - } - - /** - * A URL to the logo image. A valid media type is `.gif`, `.jpg`, or `.png`. The maximum width of the image is 190 pixels. The maximum height of the image is 60 pixels. PayPal crops images that are larger. PayPal places your logo image at the top of the cart review area. PayPal recommends that you store the image on a secure (HTTPS) server. Otherwise, web browsers display a message that checkout pages contain non-secure items. Character length and limit: 127 single-byte alphanumeric characters. - * - * @param string $logo_image - * - * @return $this - */ - public function setLogoImage($logo_image) - { - $this->logo_image = $logo_image; - return $this; - } - - /** - * A URL to the logo image. A valid media type is `.gif`, `.jpg`, or `.png`. The maximum width of the image is 190 pixels. The maximum height of the image is 60 pixels. PayPal crops images that are larger. PayPal places your logo image at the top of the cart review area. PayPal recommends that you store the image on a secure (HTTPS) server. Otherwise, web browsers display a message that checkout pages contain non-secure items. Character length and limit: 127 single-byte alphanumeric characters. - * - * @return string - */ - public function getLogoImage() - { - return $this->logo_image; - } - - /** - * The locale of pages displayed by PayPal payment experience. A valid value is `AU`, `AT`, `BE`, `BR`, `CA`, `CH`, `CN`, `DE`, `ES`, `GB`, `FR`, `IT`, `NL`, `PL`, `PT`, `RU`, or `US`. A 5-character code is also valid for languages in specific countries: `da_DK`, `he_IL`, `id_ID`, `ja_JP`, `no_NO`, `pt_BR`, `ru_RU`, `sv_SE`, `th_TH`, `zh_CN`, `zh_HK`, or `zh_TW`. - * - * @param string $locale_code - * - * @return $this - */ - public function setLocaleCode($locale_code) - { - $this->locale_code = $locale_code; - return $this; - } - - /** - * The locale of pages displayed by PayPal payment experience. A valid value is `AU`, `AT`, `BE`, `BR`, `CA`, `CH`, `CN`, `DE`, `ES`, `GB`, `FR`, `IT`, `NL`, `PL`, `PT`, `RU`, or `US`. A 5-character code is also valid for languages in specific countries: `da_DK`, `he_IL`, `id_ID`, `ja_JP`, `no_NO`, `pt_BR`, `ru_RU`, `sv_SE`, `th_TH`, `zh_CN`, `zh_HK`, or `zh_TW`. - * - * @return string - */ - public function getLocaleCode() - { - return $this->locale_code; - } - - /** - * A label to use as hypertext for the return to merchant link. - * - * @param string $return_url_label - * - * @return $this - */ - public function setReturnUrlLabel($return_url_label) - { - $this->return_url_label = $return_url_label; - return $this; - } - - /** - * A label to use as hypertext for the return to merchant link. - * - * @return string - */ - public function getReturnUrlLabel() - { - return $this->return_url_label; - } - - /** - * A label to use as the title for the note to seller field. Used only when `allow_note` is `1`. - * - * @param string $note_to_seller_label - * - * @return $this - */ - public function setNoteToSellerLabel($note_to_seller_label) - { - $this->note_to_seller_label = $note_to_seller_label; - return $this; - } - - /** - * A label to use as the title for the note to seller field. Used only when `allow_note` is `1`. - * - * @return string - */ - public function getNoteToSellerLabel() - { - return $this->note_to_seller_label; - } - -} diff --git a/paypal/PayPal/Api/PrivateLabelCard.php b/paypal/PayPal/Api/PrivateLabelCard.php deleted file mode 100644 index 385a1cc..0000000 --- a/paypal/PayPal/Api/PrivateLabelCard.php +++ /dev/null @@ -1,137 +0,0 @@ -id = $id; - return $this; - } - - /** - * encrypted identifier of the private label card instrument. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * last 4 digits of the card number. - * - * @param string $card_number - * - * @return $this - */ - public function setCardNumber($card_number) - { - $this->card_number = $card_number; - return $this; - } - - /** - * last 4 digits of the card number. - * - * @return string - */ - public function getCardNumber() - { - return $this->card_number; - } - - /** - * Merchants providing private label store cards have associated issuer account. This value indicates encrypted account number of the associated issuer account. - * - * @param string $issuer_id - * - * @return $this - */ - public function setIssuerId($issuer_id) - { - $this->issuer_id = $issuer_id; - return $this; - } - - /** - * Merchants providing private label store cards have associated issuer account. This value indicates encrypted account number of the associated issuer account. - * - * @return string - */ - public function getIssuerId() - { - return $this->issuer_id; - } - - /** - * Merchants providing private label store cards have associated issuer account. This value indicates name on the issuer account. - * - * @param string $issuer_name - * - * @return $this - */ - public function setIssuerName($issuer_name) - { - $this->issuer_name = $issuer_name; - return $this; - } - - /** - * Merchants providing private label store cards have associated issuer account. This value indicates name on the issuer account. - * - * @return string - */ - public function getIssuerName() - { - return $this->issuer_name; - } - - /** - * This value indicates URL to access PLCC program logo image - * - * @param string $image_key - * - * @return $this - */ - public function setImageKey($image_key) - { - $this->image_key = $image_key; - return $this; - } - - /** - * This value indicates URL to access PLCC program logo image - * - * @return string - */ - public function getImageKey() - { - return $this->image_key; - } - -} diff --git a/paypal/PayPal/Api/ProcessorResponse.php b/paypal/PayPal/Api/ProcessorResponse.php deleted file mode 100644 index 9b903dc..0000000 --- a/paypal/PayPal/Api/ProcessorResponse.php +++ /dev/null @@ -1,162 +0,0 @@ -response_code = $response_code; - return $this; - } - - /** - * Paypal normalized response code, generated from the processor's specific response code - * - * @return string - */ - public function getResponseCode() - { - return $this->response_code; - } - - /** - * Address Verification System response code. https://developer.paypal.com/docs/classic/api/AVSResponseCodes/ - * - * @param string $avs_code - * - * @return $this - */ - public function setAvsCode($avs_code) - { - $this->avs_code = $avs_code; - return $this; - } - - /** - * Address Verification System response code. https://developer.paypal.com/docs/classic/api/AVSResponseCodes/ - * - * @return string - */ - public function getAvsCode() - { - return $this->avs_code; - } - - /** - * CVV System response code. https://developer.paypal.com/docs/classic/api/AVSResponseCodes/ - * - * @param string $cvv_code - * - * @return $this - */ - public function setCvvCode($cvv_code) - { - $this->cvv_code = $cvv_code; - return $this; - } - - /** - * CVV System response code. https://developer.paypal.com/docs/classic/api/AVSResponseCodes/ - * - * @return string - */ - public function getCvvCode() - { - return $this->cvv_code; - } - - /** - * Provides merchant advice on how to handle declines related to recurring payments - * Valid Values: ["01_NEW_ACCOUNT_INFORMATION", "02_TRY_AGAIN_LATER", "02_STOP_SPECIFIC_PAYMENT", "03_DO_NOT_TRY_AGAIN", "03_REVOKE_AUTHORIZATION_FOR_FUTURE_PAYMENT", "21_DO_NOT_TRY_AGAIN_CARD_HOLDER_CANCELLED_RECURRRING_CHARGE", "21_CANCEL_ALL_RECURRING_PAYMENTS"] - * - * @param string $advice_code - * - * @return $this - */ - public function setAdviceCode($advice_code) - { - $this->advice_code = $advice_code; - return $this; - } - - /** - * Provides merchant advice on how to handle declines related to recurring payments - * - * @return string - */ - public function getAdviceCode() - { - return $this->advice_code; - } - - /** - * Response back from the authorization. Provided by the processor - * - * @param string $eci_submitted - * - * @return $this - */ - public function setEciSubmitted($eci_submitted) - { - $this->eci_submitted = $eci_submitted; - return $this; - } - - /** - * Response back from the authorization. Provided by the processor - * - * @return string - */ - public function getEciSubmitted() - { - return $this->eci_submitted; - } - - /** - * Visa Payer Authentication Service status. Will be return from processor - * - * @param string $vpas - * - * @return $this - */ - public function setVpas($vpas) - { - $this->vpas = $vpas; - return $this; - } - - /** - * Visa Payer Authentication Service status. Will be return from processor - * - * @return string - */ - public function getVpas() - { - return $this->vpas; - } - -} diff --git a/paypal/PayPal/Api/RecipientBankingInstruction.php b/paypal/PayPal/Api/RecipientBankingInstruction.php deleted file mode 100644 index 9c2fd0d..0000000 --- a/paypal/PayPal/Api/RecipientBankingInstruction.php +++ /dev/null @@ -1,161 +0,0 @@ -bank_name = $bank_name; - return $this; - } - - /** - * Name of the financial institution. - * - * @return string - */ - public function getBankName() - { - return $this->bank_name; - } - - /** - * Name of the account holder - * - * @param string $account_holder_name - * - * @return $this - */ - public function setAccountHolderName($account_holder_name) - { - $this->account_holder_name = $account_holder_name; - return $this; - } - - /** - * Name of the account holder - * - * @return string - */ - public function getAccountHolderName() - { - return $this->account_holder_name; - } - - /** - * bank account number - * - * @param string $account_number - * - * @return $this - */ - public function setAccountNumber($account_number) - { - $this->account_number = $account_number; - return $this; - } - - /** - * bank account number - * - * @return string - */ - public function getAccountNumber() - { - return $this->account_number; - } - - /** - * bank routing number - * - * @param string $routing_number - * - * @return $this - */ - public function setRoutingNumber($routing_number) - { - $this->routing_number = $routing_number; - return $this; - } - - /** - * bank routing number - * - * @return string - */ - public function getRoutingNumber() - { - return $this->routing_number; - } - - /** - * IBAN equivalent of the bank - * - * @param string $international_bank_account_number - * - * @return $this - */ - public function setInternationalBankAccountNumber($international_bank_account_number) - { - $this->international_bank_account_number = $international_bank_account_number; - return $this; - } - - /** - * IBAN equivalent of the bank - * - * @return string - */ - public function getInternationalBankAccountNumber() - { - return $this->international_bank_account_number; - } - - /** - * BIC identifier of the financial institution - * - * @param string $bank_identifier_code - * - * @return $this - */ - public function setBankIdentifierCode($bank_identifier_code) - { - $this->bank_identifier_code = $bank_identifier_code; - return $this; - } - - /** - * BIC identifier of the financial institution - * - * @return string - */ - public function getBankIdentifierCode() - { - return $this->bank_identifier_code; - } - -} diff --git a/paypal/PayPal/Api/RedirectUrls.php b/paypal/PayPal/Api/RedirectUrls.php deleted file mode 100644 index 5c97ba4..0000000 --- a/paypal/PayPal/Api/RedirectUrls.php +++ /dev/null @@ -1,68 +0,0 @@ -return_url = $return_url; - return $this; - } - - /** - * Url where the payer would be redirected to after approving the payment. **Required for PayPal account payments.** - * - * @return string - */ - public function getReturnUrl() - { - return $this->return_url; - } - - /** - * Url where the payer would be redirected to after canceling the payment. **Required for PayPal account payments.** - * - * @param string $cancel_url - * @throws \InvalidArgumentException - * @return $this - */ - public function setCancelUrl($cancel_url) - { - UrlValidator::validate($cancel_url, "CancelUrl"); - $this->cancel_url = $cancel_url; - return $this; - } - - /** - * Url where the payer would be redirected to after canceling the payment. **Required for PayPal account payments.** - * - * @return string - */ - public function getCancelUrl() - { - return $this->cancel_url; - } - -} diff --git a/paypal/PayPal/Api/Refund.php b/paypal/PayPal/Api/Refund.php deleted file mode 100644 index c008f17..0000000 --- a/paypal/PayPal/Api/Refund.php +++ /dev/null @@ -1,335 +0,0 @@ -id = $id; - return $this; - } - - /** - * ID of the refund transaction. 17 characters max. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Details including both refunded amount (to payer) and refunded fee (to payee). 10 characters max. - * - * @param \PayPal\Api\Amount $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * Details including both refunded amount (to payer) and refunded fee (to payee). 10 characters max. - * - * @return \PayPal\Api\Amount - */ - public function getAmount() - { - return $this->amount; - } - - /** - * State of the refund. - * Valid Values: ["pending", "completed", "failed"] - * - * @param string $state - * - * @return $this - */ - public function setState($state) - { - $this->state = $state; - return $this; - } - - /** - * State of the refund. - * - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Reason description for the Sale transaction being refunded. - * - * @param string $reason - * - * @return $this - */ - public function setReason($reason) - { - $this->reason = $reason; - return $this; - } - - /** - * Reason description for the Sale transaction being refunded. - * - * @return string - */ - public function getReason() - { - return $this->reason; - } - - /** - * Your own invoice or tracking ID number. Character length and limitations: 127 single-byte alphanumeric characters. - * - * @param string $invoice_number - * - * @return $this - */ - public function setInvoiceNumber($invoice_number) - { - $this->invoice_number = $invoice_number; - return $this; - } - - /** - * Your own invoice or tracking ID number. Character length and limitations: 127 single-byte alphanumeric characters. - * - * @return string - */ - public function getInvoiceNumber() - { - return $this->invoice_number; - } - - /** - * ID of the Sale transaction being refunded. - * - * @param string $sale_id - * - * @return $this - */ - public function setSaleId($sale_id) - { - $this->sale_id = $sale_id; - return $this; - } - - /** - * ID of the Sale transaction being refunded. - * - * @return string - */ - public function getSaleId() - { - return $this->sale_id; - } - - /** - * ID of the sale transaction being refunded. - * - * @param string $capture_id - * - * @return $this - */ - public function setCaptureId($capture_id) - { - $this->capture_id = $capture_id; - return $this; - } - - /** - * ID of the sale transaction being refunded. - * - * @return string - */ - public function getCaptureId() - { - return $this->capture_id; - } - - /** - * ID of the payment resource on which this transaction is based. - * - * @param string $parent_payment - * - * @return $this - */ - public function setParentPayment($parent_payment) - { - $this->parent_payment = $parent_payment; - return $this; - } - - /** - * ID of the payment resource on which this transaction is based. - * - * @return string - */ - public function getParentPayment() - { - return $this->parent_payment; - } - - /** - * Description of what is being refunded for. - * - * @param string $description - * - * @return $this - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * Description of what is being refunded for. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Time of refund as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $create_time - * - * @return $this - */ - public function setCreateTime($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time of refund as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getCreateTime() - { - return $this->create_time; - } - - /** - * Time that the resource was last updated. - * - * @param string $update_time - * - * @return $this - */ - public function setUpdateTime($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time that the resource was last updated. - * - * @return string - */ - public function getUpdateTime() - { - return $this->update_time; - } - - /** - * The reason code for the refund state being pending - * Valid Values: ["ECHECK"] - * - * @param string $reason_code - * - * @return $this - */ - public function setReasonCode($reason_code) - { - $this->reason_code = $reason_code; - return $this; - } - - /** - * The reason code for the refund state being pending - * - * @return string - */ - public function getReasonCode() - { - return $this->reason_code; - } - - /** - * Shows details for a refund, by ID. - * - * @param string $refundId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Refund - */ - public static function get($refundId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($refundId, 'refundId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/refund/$refundId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Refund(); - $ret->fromJson($json); - return $ret; - } - -} diff --git a/paypal/PayPal/Api/RefundDetail.php b/paypal/PayPal/Api/RefundDetail.php deleted file mode 100644 index 7674ec1..0000000 --- a/paypal/PayPal/Api/RefundDetail.php +++ /dev/null @@ -1,138 +0,0 @@ -type = $type; - return $this; - } - - /** - * The PayPal refund type. Indicates whether refund was paid in invoicing flow through PayPal or externally. In the case of mark-as-refunded API, the supported refund type is `EXTERNAL`. For backward compatability, the `PAYPAL` refund type is still supported. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * The PayPal refund transaction ID. Required with the `PAYPAL` refund type. - * - * @param string $transaction_id - * - * @return $this - */ - public function setTransactionId($transaction_id) - { - $this->transaction_id = $transaction_id; - return $this; - } - - /** - * The PayPal refund transaction ID. Required with the `PAYPAL` refund type. - * - * @return string - */ - public function getTransactionId() - { - return $this->transaction_id; - } - - /** - * Date on which the invoice was refunded. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. - * - * @param string $date - * - * @return $this - */ - public function setDate($date) - { - $this->date = $date; - return $this; - } - - /** - * Date on which the invoice was refunded. Date format: yyyy-MM-dd z. For example, 2014-02-27 PST. - * - * @return string - */ - public function getDate() - { - return $this->date; - } - - /** - * Optional note associated with the refund. - * - * @param string $note - * - * @return $this - */ - public function setNote($note) - { - $this->note = $note; - return $this; - } - - /** - * Optional note associated with the refund. - * - * @return string - */ - public function getNote() - { - return $this->note; - } - - /** - * Amount to be recorded as refund against invoice. If this field is not passed, the total invoice paid amount is recorded as refund. - * - * @param \PayPal\Api\Currency $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * Amount to be recorded as refund against invoice. If this field is not passed, the total invoice paid amount is recorded as refund. - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - -} diff --git a/paypal/PayPal/Api/RefundRequest.php b/paypal/PayPal/Api/RefundRequest.php deleted file mode 100644 index 1fdaa95..0000000 --- a/paypal/PayPal/Api/RefundRequest.php +++ /dev/null @@ -1,162 +0,0 @@ -amount = $amount; - return $this; - } - - /** - * Details including both refunded amount (to payer) and refunded fee (to payee). - * - * @return \PayPal\Api\Amount - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Description of what is being refunded for. Character length and limitations: 255 single-byte alphanumeric characters. - * - * @param string $description - * - * @return $this - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * Description of what is being refunded for. Character length and limitations: 255 single-byte alphanumeric characters. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Type of PayPal funding source (balance or eCheck) that can be used for auto refund. - * Valid Values: ["INSTANT_FUNDING_SOURCE", "ECHECK", "UNRESTRICTED"] - * - * @param string $refund_source - * - * @return $this - */ - public function setRefundSource($refund_source) - { - $this->refund_source = $refund_source; - return $this; - } - - /** - * Type of PayPal funding source (balance or eCheck) that can be used for auto refund. - * - * @return string - */ - public function getRefundSource() - { - return $this->refund_source; - } - - /** - * Reason description for the Sale transaction being refunded. - * - * @param string $reason - * - * @return $this - */ - public function setReason($reason) - { - $this->reason = $reason; - return $this; - } - - /** - * Reason description for the Sale transaction being refunded. - * - * @return string - */ - public function getReason() - { - return $this->reason; - } - - /** - * The invoice number that is used to track this payment. Character length and limitations: 127 single-byte alphanumeric characters. - * - * @param string $invoice_number - * - * @return $this - */ - public function setInvoiceNumber($invoice_number) - { - $this->invoice_number = $invoice_number; - return $this; - } - - /** - * The invoice number that is used to track this payment. Character length and limitations: 127 single-byte alphanumeric characters. - * - * @return string - */ - public function getInvoiceNumber() - { - return $this->invoice_number; - } - - /** - * Flag to indicate that the buyer was already given store credit for a given transaction. - * - * @param bool $refund_advice - * - * @return $this - */ - public function setRefundAdvice($refund_advice) - { - $this->refund_advice = $refund_advice; - return $this; - } - - /** - * Flag to indicate that the buyer was already given store credit for a given transaction. - * - * @return bool - */ - public function getRefundAdvice() - { - return $this->refund_advice; - } - -} diff --git a/paypal/PayPal/Api/RelatedResources.php b/paypal/PayPal/Api/RelatedResources.php deleted file mode 100644 index d324841..0000000 --- a/paypal/PayPal/Api/RelatedResources.php +++ /dev/null @@ -1,137 +0,0 @@ -sale = $sale; - return $this; - } - - /** - * Sale transaction - * - * @return \PayPal\Api\Sale - */ - public function getSale() - { - return $this->sale; - } - - /** - * Authorization transaction - * - * @param \PayPal\Api\Authorization $authorization - * - * @return $this - */ - public function setAuthorization($authorization) - { - $this->authorization = $authorization; - return $this; - } - - /** - * Authorization transaction - * - * @return \PayPal\Api\Authorization - */ - public function getAuthorization() - { - return $this->authorization; - } - - /** - * Order transaction - * - * @param \PayPal\Api\Order $order - * - * @return $this - */ - public function setOrder($order) - { - $this->order = $order; - return $this; - } - - /** - * Order transaction - * - * @return \PayPal\Api\Order - */ - public function getOrder() - { - return $this->order; - } - - /** - * Capture transaction - * - * @param \PayPal\Api\Capture $capture - * - * @return $this - */ - public function setCapture($capture) - { - $this->capture = $capture; - return $this; - } - - /** - * Capture transaction - * - * @return \PayPal\Api\Capture - */ - public function getCapture() - { - return $this->capture; - } - - /** - * Refund transaction - * - * @param \PayPal\Api\Refund $refund - * - * @return $this - */ - public function setRefund($refund) - { - $this->refund = $refund; - return $this; - } - - /** - * Refund transaction - * - * @return \PayPal\Api\Refund - */ - public function getRefund() - { - return $this->refund; - } - -} diff --git a/paypal/PayPal/Api/Sale.php b/paypal/PayPal/Api/Sale.php deleted file mode 100644 index 1c4cb28..0000000 --- a/paypal/PayPal/Api/Sale.php +++ /dev/null @@ -1,637 +0,0 @@ -id = $id; - return $this; - } - - /** - * Identifier of the sale transaction. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Identifier to the purchase or transaction unit corresponding to this sale transaction. - * - * @param string $purchase_unit_reference_id - * - * @return $this - */ - public function setPurchaseUnitReferenceId($purchase_unit_reference_id) - { - $this->purchase_unit_reference_id = $purchase_unit_reference_id; - return $this; - } - - /** - * Identifier to the purchase or transaction unit corresponding to this sale transaction. - * - * @return string - */ - public function getPurchaseUnitReferenceId() - { - return $this->purchase_unit_reference_id; - } - - /** - * Amount being collected. - * - * @param \PayPal\Api\Amount $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * Amount being collected. - * - * @return \PayPal\Api\Amount - */ - public function getAmount() - { - return $this->amount; - } - - /** - * Specifies payment mode of the transaction. Only supported when the `payment_method` is set to `paypal`. - * Valid Values: ["INSTANT_TRANSFER", "MANUAL_BANK_TRANSFER", "DELAYED_TRANSFER", "ECHECK"] - * - * @param string $payment_mode - * - * @return $this - */ - public function setPaymentMode($payment_mode) - { - $this->payment_mode = $payment_mode; - return $this; - } - - /** - * Specifies payment mode of the transaction. Only supported when the `payment_method` is set to `paypal`. - * - * @return string - */ - public function getPaymentMode() - { - return $this->payment_mode; - } - - /** - * State of the sale transaction. - * Valid Values: ["completed", "partially_refunded", "pending", "refunded", "denied"] - * - * @param string $state - * - * @return $this - */ - public function setState($state) - { - $this->state = $state; - return $this; - } - - /** - * State of the sale transaction. - * - * @return string - */ - public function getState() - { - return $this->state; - } - - /** - * Reason code for the transaction state being Pending or Reversed. Only supported when the `payment_method` is set to `paypal`. - * Valid Values: ["CHARGEBACK", "GUARANTEE", "BUYER_COMPLAINT", "REFUND", "UNCONFIRMED_SHIPPING_ADDRESS", "ECHECK", "INTERNATIONAL_WITHDRAWAL", "RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION", "PAYMENT_REVIEW", "REGULATORY_REVIEW", "UNILATERAL", "VERIFICATION_REQUIRED", "TRANSACTION_APPROVED_AWAITING_FUNDING"] - * - * @param string $reason_code - * - * @return $this - */ - public function setReasonCode($reason_code) - { - $this->reason_code = $reason_code; - return $this; - } - - /** - * Reason code for the transaction state being Pending or Reversed. Only supported when the `payment_method` is set to `paypal`. - * - * @return string - */ - public function getReasonCode() - { - return $this->reason_code; - } - - /** - * The level of seller protection in force for the transaction. Only supported when the `payment_method` is set to `paypal`. - * Valid Values: ["ELIGIBLE", "PARTIALLY_ELIGIBLE", "INELIGIBLE"] - * - * @param string $protection_eligibility - * - * @return $this - */ - public function setProtectionEligibility($protection_eligibility) - { - $this->protection_eligibility = $protection_eligibility; - return $this; - } - - /** - * The level of seller protection in force for the transaction. Only supported when the `payment_method` is set to `paypal`. - * - * @return string - */ - public function getProtectionEligibility() - { - return $this->protection_eligibility; - } - - /** - * The kind of seller protection in force for the transaction. It is returned only when protection_eligibility is ELIGIBLE or PARTIALLY_ELIGIBLE. Only supported when the `payment_method` is set to `paypal`. - * Valid Values: ["ITEM_NOT_RECEIVED_ELIGIBLE", "UNAUTHORIZED_PAYMENT_ELIGIBLE", "ITEM_NOT_RECEIVED_ELIGIBLE,UNAUTHORIZED_PAYMENT_ELIGIBLE"] - * - * @param string $protection_eligibility_type - * - * @return $this - */ - public function setProtectionEligibilityType($protection_eligibility_type) - { - $this->protection_eligibility_type = $protection_eligibility_type; - return $this; - } - - /** - * The kind of seller protection in force for the transaction. It is returned only when protection_eligibility is ELIGIBLE or PARTIALLY_ELIGIBLE. Only supported when the `payment_method` is set to `paypal`. - * - * @return string - */ - public function getProtectionEligibilityType() - { - return $this->protection_eligibility_type; - } - - /** - * Expected clearing time for eCheck Transactions. Returned when payment is made with eCheck. Only supported when the `payment_method` is set to `paypal`. - * - * @param string $clearing_time - * - * @return $this - */ - public function setClearingTime($clearing_time) - { - $this->clearing_time = $clearing_time; - return $this; - } - - /** - * Expected clearing time for eCheck Transactions. Returned when payment is made with eCheck. Only supported when the `payment_method` is set to `paypal`. - * - * @return string - */ - public function getClearingTime() - { - return $this->clearing_time; - } - - /** - * Status of the Recipient Fund. For now, it will be returned only when fund status is held - * Valid Values: ["HELD"] - * - * @param string $payment_hold_status - * - * @return $this - */ - public function setPaymentHoldStatus($payment_hold_status) - { - $this->payment_hold_status = $payment_hold_status; - return $this; - } - - /** - * Status of the Recipient Fund. For now, it will be returned only when fund status is held - * - * @return string - */ - public function getPaymentHoldStatus() - { - return $this->payment_hold_status; - } - - /** - * Reasons for PayPal holding recipient fund. It is set only if payment hold status is held - * - * @param string[] $payment_hold_reasons - * - * @return $this - */ - public function setPaymentHoldReasons($payment_hold_reasons) - { - $this->payment_hold_reasons = $payment_hold_reasons; - return $this; - } - - /** - * Reasons for PayPal holding recipient fund. It is set only if payment hold status is held - * - * @return string[] - */ - public function getPaymentHoldReasons() - { - return $this->payment_hold_reasons; - } - - /** - * Append PaymentHoldReasons to the list. - * - * @param string $string - * @return $this - */ - public function addPaymentHoldReason($string) - { - if (!$this->getPaymentHoldReasons()) { - return $this->setPaymentHoldReasons(array($string)); - } else { - return $this->setPaymentHoldReasons( - array_merge($this->getPaymentHoldReasons(), array($string)) - ); - } - } - - /** - * Remove PaymentHoldReasons from the list. - * - * @param string $string - * @return $this - */ - public function removePaymentHoldReason($string) - { - return $this->setPaymentHoldReasons( - array_diff($this->getPaymentHoldReasons(), array($string)) - ); - } - - /** - * Transaction fee applicable for this payment. - * - * @param \PayPal\Api\Currency $transaction_fee - * - * @return $this - */ - public function setTransactionFee($transaction_fee) - { - $this->transaction_fee = $transaction_fee; - return $this; - } - - /** - * Transaction fee applicable for this payment. - * - * @return \PayPal\Api\Currency - */ - public function getTransactionFee() - { - return $this->transaction_fee; - } - - /** - * Net amount the merchant receives for this transaction in their receivable currency. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer. - * - * @param \PayPal\Api\Currency $receivable_amount - * - * @return $this - */ - public function setReceivableAmount($receivable_amount) - { - $this->receivable_amount = $receivable_amount; - return $this; - } - - /** - * Net amount the merchant receives for this transaction in their receivable currency. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer. - * - * @return \PayPal\Api\Currency - */ - public function getReceivableAmount() - { - return $this->receivable_amount; - } - - /** - * Exchange rate applied for this transaction. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer. - * - * @param string $exchange_rate - * - * @return $this - */ - public function setExchangeRate($exchange_rate) - { - $this->exchange_rate = $exchange_rate; - return $this; - } - - /** - * Exchange rate applied for this transaction. Returned only in cross-currency use cases where a merchant bills a buyer in a non-primary currency for that buyer. - * - * @return string - */ - public function getExchangeRate() - { - return $this->exchange_rate; - } - - /** - * Fraud Management Filter (FMF) details applied for the payment that could result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. See [Fraud Management Filters Summary](/docs/classic/fmf/integration-guide/FMFSummary/) for more information. - * - * @param \PayPal\Api\FmfDetails $fmf_details - * - * @return $this - */ - public function setFmfDetails($fmf_details) - { - $this->fmf_details = $fmf_details; - return $this; - } - - /** - * Fraud Management Filter (FMF) details applied for the payment that could result in accept, deny, or pending action. Returned in a payment response only if the merchant has enabled FMF in the profile settings and one of the fraud filters was triggered based on those settings. See [Fraud Management Filters Summary](/docs/classic/fmf/integration-guide/FMFSummary/) for more information. - * - * @return \PayPal\Api\FmfDetails - */ - public function getFmfDetails() - { - return $this->fmf_details; - } - - /** - * Receipt id is a payment identification number returned for guest users to identify the payment. - * - * @param string $receipt_id - * - * @return $this - */ - public function setReceiptId($receipt_id) - { - $this->receipt_id = $receipt_id; - return $this; - } - - /** - * Receipt id is a payment identification number returned for guest users to identify the payment. - * - * @return string - */ - public function getReceiptId() - { - return $this->receipt_id; - } - - /** - * ID of the payment resource on which this transaction is based. - * - * @param string $parent_payment - * - * @return $this - */ - public function setParentPayment($parent_payment) - { - $this->parent_payment = $parent_payment; - return $this; - } - - /** - * ID of the payment resource on which this transaction is based. - * - * @return string - */ - public function getParentPayment() - { - return $this->parent_payment; - } - - /** - * Response codes returned by the processor concerning the submitted payment. Only supported when the `payment_method` is set to `credit_card`. - * - * @param \PayPal\Api\ProcessorResponse $processor_response - * - * @return $this - */ - public function setProcessorResponse($processor_response) - { - $this->processor_response = $processor_response; - return $this; - } - - /** - * Response codes returned by the processor concerning the submitted payment. Only supported when the `payment_method` is set to `credit_card`. - * - * @return \PayPal\Api\ProcessorResponse - */ - public function getProcessorResponse() - { - return $this->processor_response; - } - - /** - * ID of the billing agreement used as reference to execute this transaction. - * - * @param string $billing_agreement_id - * - * @return $this - */ - public function setBillingAgreementId($billing_agreement_id) - { - $this->billing_agreement_id = $billing_agreement_id; - return $this; - } - - /** - * ID of the billing agreement used as reference to execute this transaction. - * - * @return string - */ - public function getBillingAgreementId() - { - return $this->billing_agreement_id; - } - - /** - * Time of sale as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6) - * - * @param string $create_time - * - * @return $this - */ - public function setCreateTime($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * Time of sale as defined in [RFC 3339 Section 5.6](http://tools.ietf.org/html/rfc3339#section-5.6) - * - * @return string - */ - public function getCreateTime() - { - return $this->create_time; - } - - /** - * Time the resource was last updated in UTC ISO8601 format. - * - * @param string $update_time - * - * @return $this - */ - public function setUpdateTime($update_time) - { - $this->update_time = $update_time; - return $this; - } - - /** - * Time the resource was last updated in UTC ISO8601 format. - * - * @return string - */ - public function getUpdateTime() - { - return $this->update_time; - } - - /** - * Shows details for a sale, by ID. Returns only sales that were created through the REST API. - * - * @param string $saleId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Sale - */ - public static function get($saleId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($saleId, 'saleId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payments/sale/$saleId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Sale(); - $ret->fromJson($json); - return $ret; - } - - /** - * Refund a completed payment by passing the sale_id in the request URI. In addition, include an empty JSON payload in the request body for a full refund. For a partial refund, include an amount object in the request body. - * - * @deprecated Please use #refundSale instead. - * @param Refund $refund - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Refund - */ - public function refund($refund, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($refund, 'refund'); - $payLoad = $refund->toJSON(); - $json = self::executeCall( - "/v1/payments/sale/{$this->getId()}/refund", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Refund(); - $ret->fromJson($json); - return $ret; - } - - /** - * Refunds a sale, by ID. For a full refund, include an empty payload in the JSON request body. For a partial refund, include an `amount` object in the JSON request body. - * - * @param RefundRequest $refundRequest - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return DetailedRefund - */ - public function refundSale($refundRequest, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($refundRequest, 'refundRequest'); - $payLoad = $refundRequest->toJSON(); - $json = self::executeCall( - "/v1/payments/sale/{$this->getId()}/refund", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new DetailedRefund(); - $ret->fromJson($json); - return $ret; - } -} diff --git a/paypal/PayPal/Api/Search.php b/paypal/PayPal/Api/Search.php deleted file mode 100644 index 333d99d..0000000 --- a/paypal/PayPal/Api/Search.php +++ /dev/null @@ -1,498 +0,0 @@ -email = $email; - return $this; - } - - /** - * The initial letters of the email address. - * - * @return string - */ - public function getEmail() - { - return $this->email; - } - - /** - * The initial letters of the recipient's first name. - * - * @param string $recipient_first_name - * - * @return $this - */ - public function setRecipientFirstName($recipient_first_name) - { - $this->recipient_first_name = $recipient_first_name; - return $this; - } - - /** - * The initial letters of the recipient's first name. - * - * @return string - */ - public function getRecipientFirstName() - { - return $this->recipient_first_name; - } - - /** - * The initial letters of the recipient's last name. - * - * @param string $recipient_last_name - * - * @return $this - */ - public function setRecipientLastName($recipient_last_name) - { - $this->recipient_last_name = $recipient_last_name; - return $this; - } - - /** - * The initial letters of the recipient's last name. - * - * @return string - */ - public function getRecipientLastName() - { - return $this->recipient_last_name; - } - - /** - * The initial letters of the recipient's business name. - * - * @param string $recipient_business_name - * - * @return $this - */ - public function setRecipientBusinessName($recipient_business_name) - { - $this->recipient_business_name = $recipient_business_name; - return $this; - } - - /** - * The initial letters of the recipient's business name. - * - * @return string - */ - public function getRecipientBusinessName() - { - return $this->recipient_business_name; - } - - /** - * The invoice number. - * - * @param string $number - * - * @return $this - */ - public function setNumber($number) - { - $this->number = $number; - return $this; - } - - /** - * The invoice number. - * - * @return string - */ - public function getNumber() - { - return $this->number; - } - - /** - * The invoice status. - * Valid Values: ["DRAFT", "SENT", "PAID", "MARKED_AS_PAID", "CANCELLED", "REFUNDED", "PARTIALLY_REFUNDED", "MARKED_AS_REFUNDED"] - * - * @param string $status - * - * @return $this - */ - public function setStatus($status) - { - $this->status = $status; - return $this; - } - - /** - * The invoice status. - * - * @return string - */ - public function getStatus() - { - return $this->status; - } - - /** - * The lower limit of the total amount. - * - * @param \PayPal\Api\Currency $lower_total_amount - * - * @return $this - */ - public function setLowerTotalAmount($lower_total_amount) - { - $this->lower_total_amount = $lower_total_amount; - return $this; - } - - /** - * The lower limit of the total amount. - * - * @return \PayPal\Api\Currency - */ - public function getLowerTotalAmount() - { - return $this->lower_total_amount; - } - - /** - * The upper limit of total amount. - * - * @param \PayPal\Api\Currency $upper_total_amount - * - * @return $this - */ - public function setUpperTotalAmount($upper_total_amount) - { - $this->upper_total_amount = $upper_total_amount; - return $this; - } - - /** - * The upper limit of total amount. - * - * @return \PayPal\Api\Currency - */ - public function getUpperTotalAmount() - { - return $this->upper_total_amount; - } - - /** - * The start date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $start_invoice_date - * - * @return $this - */ - public function setStartInvoiceDate($start_invoice_date) - { - $this->start_invoice_date = $start_invoice_date; - return $this; - } - - /** - * The start date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getStartInvoiceDate() - { - return $this->start_invoice_date; - } - - /** - * The end date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $end_invoice_date - * - * @return $this - */ - public function setEndInvoiceDate($end_invoice_date) - { - $this->end_invoice_date = $end_invoice_date; - return $this; - } - - /** - * The end date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getEndInvoiceDate() - { - return $this->end_invoice_date; - } - - /** - * The start due date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $start_due_date - * - * @return $this - */ - public function setStartDueDate($start_due_date) - { - $this->start_due_date = $start_due_date; - return $this; - } - - /** - * The start due date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getStartDueDate() - { - return $this->start_due_date; - } - - /** - * The end due date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $end_due_date - * - * @return $this - */ - public function setEndDueDate($end_due_date) - { - $this->end_due_date = $end_due_date; - return $this; - } - - /** - * The end due date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getEndDueDate() - { - return $this->end_due_date; - } - - /** - * The start payment date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $start_payment_date - * - * @return $this - */ - public function setStartPaymentDate($start_payment_date) - { - $this->start_payment_date = $start_payment_date; - return $this; - } - - /** - * The start payment date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getStartPaymentDate() - { - return $this->start_payment_date; - } - - /** - * The end payment date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $end_payment_date - * - * @return $this - */ - public function setEndPaymentDate($end_payment_date) - { - $this->end_payment_date = $end_payment_date; - return $this; - } - - /** - * The end payment date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getEndPaymentDate() - { - return $this->end_payment_date; - } - - /** - * The start creation date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $start_creation_date - * - * @return $this - */ - public function setStartCreationDate($start_creation_date) - { - $this->start_creation_date = $start_creation_date; - return $this; - } - - /** - * The start creation date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getStartCreationDate() - { - return $this->start_creation_date; - } - - /** - * The end creation date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @param string $end_creation_date - * - * @return $this - */ - public function setEndCreationDate($end_creation_date) - { - $this->end_creation_date = $end_creation_date; - return $this; - } - - /** - * The end creation date for the invoice. Date format is *yyyy*-*MM*-*dd* *z*, as defined in [Internet Date/Time Format](http://tools.ietf.org/html/rfc3339#section-5.6). - * - * @return string - */ - public function getEndCreationDate() - { - return $this->end_creation_date; - } - - /** - * The offset for the search results. - * - * @param \PayPal\Api\number $page - * - * @return $this - */ - public function setPage($page) - { - $this->page = $page; - return $this; - } - - /** - * The offset for the search results. - * - * @return \PayPal\Api\number - */ - public function getPage() - { - return $this->page; - } - - /** - * The page size for the search results. - * - * @param \PayPal\Api\number $page_size - * - * @return $this - */ - public function setPageSize($page_size) - { - $this->page_size = $page_size; - return $this; - } - - /** - * The page size for the search results. - * - * @return \PayPal\Api\number - */ - public function getPageSize() - { - return $this->page_size; - } - - /** - * Indicates whether the total count appears in the response. Default is `false`. - * - * @param bool $total_count_required - * - * @return $this - */ - public function setTotalCountRequired($total_count_required) - { - $this->total_count_required = $total_count_required; - return $this; - } - - /** - * Indicates whether the total count appears in the response. Default is `false`. - * - * @return bool - */ - public function getTotalCountRequired() - { - return $this->total_count_required; - } - - /** - * A flag indicating whether search is on invoices archived by merchant. true - returns archived / false returns unarchived / null returns all. - * - * @param bool $archived - * - * @return $this - */ - public function setArchived($archived) - { - $this->archived = $archived; - return $this; - } - - /** - * A flag indicating whether search is on invoices archived by merchant. true - returns archived / false returns unarchived / null returns all. - * - * @return bool - */ - public function getArchived() - { - return $this->archived; - } - -} diff --git a/paypal/PayPal/Api/ShippingAddress.php b/paypal/PayPal/Api/ShippingAddress.php deleted file mode 100644 index c7d29f7..0000000 --- a/paypal/PayPal/Api/ShippingAddress.php +++ /dev/null @@ -1,108 +0,0 @@ -id = $id; - return $this; - } - - /** - * Address ID assigned in PayPal system. - * @deprecated Not publicly available - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Name of the recipient at this address. - * - * @param string $recipient_name - * - * @return $this - */ - public function setRecipientName($recipient_name) - { - $this->recipient_name = $recipient_name; - return $this; - } - - /** - * Name of the recipient at this address. - * - * @return string - */ - public function getRecipientName() - { - return $this->recipient_name; - } - - /** - * Default shipping address of the Payer. - * @deprecated Not publicly available - * @param bool $default_address - * - * @return $this - */ - public function setDefaultAddress($default_address) - { - $this->default_address = $default_address; - return $this; - } - - /** - * Default shipping address of the Payer. - * @deprecated Not publicly available - * @return bool - */ - public function getDefaultAddress() - { - return $this->default_address; - } - - /** - * Shipping Address marked as preferred by Payer. - * @deprecated Not publicly available - * @param bool $preferred_address - * - * @return $this - */ - public function setPreferredAddress($preferred_address) - { - $this->preferred_address = $preferred_address; - return $this; - } - - /** - * Shipping Address marked as preferred by Payer. - * @deprecated Not publicly available - * @return bool - */ - public function getPreferredAddress() - { - return $this->preferred_address; - } - -} diff --git a/paypal/PayPal/Api/ShippingCost.php b/paypal/PayPal/Api/ShippingCost.php deleted file mode 100644 index 96694c4..0000000 --- a/paypal/PayPal/Api/ShippingCost.php +++ /dev/null @@ -1,65 +0,0 @@ -amount = $amount; - return $this; - } - - /** - * The shipping cost, as an amount. Valid range is from 0 to 999999.99. - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - - /** - * The tax percentage on the shipping amount. - * - * @param \PayPal\Api\Tax $tax - * - * @return $this - */ - public function setTax($tax) - { - $this->tax = $tax; - return $this; - } - - /** - * The tax percentage on the shipping amount. - * - * @return \PayPal\Api\Tax - */ - public function getTax() - { - return $this->tax; - } - -} diff --git a/paypal/PayPal/Api/ShippingInfo.php b/paypal/PayPal/Api/ShippingInfo.php deleted file mode 100644 index f851e67..0000000 --- a/paypal/PayPal/Api/ShippingInfo.php +++ /dev/null @@ -1,158 +0,0 @@ -first_name = $first_name; - return $this; - } - - /** - * The invoice recipient first name. Maximum length is 30 characters. - * - * @return string - */ - public function getFirstName() - { - return $this->first_name; - } - - /** - * The invoice recipient last name. Maximum length is 30 characters. - * - * @param string $last_name - * - * @return $this - */ - public function setLastName($last_name) - { - $this->last_name = $last_name; - return $this; - } - - /** - * The invoice recipient last name. Maximum length is 30 characters. - * - * @return string - */ - public function getLastName() - { - return $this->last_name; - } - - /** - * The invoice recipient company business name. Maximum length is 100 characters. - * - * @param string $business_name - * - * @return $this - */ - public function setBusinessName($business_name) - { - $this->business_name = $business_name; - return $this; - } - - /** - * The invoice recipient company business name. Maximum length is 100 characters. - * - * @return string - */ - public function getBusinessName() - { - return $this->business_name; - } - - /** - * - * - * @param \PayPal\Api\Phone $phone - * @return $this - */ - public function setPhone($phone) - { - $this->phone = $phone; - return $this; - } - - /** - * - * - * @return \PayPal\Api\Phone - */ - public function getPhone() - { - return $this->phone; - } - - /** - * @deprecated Not used anymore - * - * @param string $email - * @return $this - */ - public function setEmail($email) - { - $this->email = $email; - return $this; - } - - /** - * @deprecated Not used anymore - * - * @return string - */ - public function getEmail() - { - return $this->email; - } - - /** - * Address of the invoice recipient. - * - * @param \PayPal\Api\InvoiceAddress $address - * - * @return $this - */ - public function setAddress($address) - { - $this->address = $address; - return $this; - } - - /** - * The invoice recipient address. - * - * @return \PayPal\Api\InvoiceAddress - */ - public function getAddress() - { - return $this->address; - } - -} diff --git a/paypal/PayPal/Api/Tax.php b/paypal/PayPal/Api/Tax.php deleted file mode 100644 index e83192c..0000000 --- a/paypal/PayPal/Api/Tax.php +++ /dev/null @@ -1,117 +0,0 @@ -id = $id; - return $this; - } - - /** - * The resource ID. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * The tax name. Maximum length is 20 characters. - * - * @param string $name - * - * @return $this - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * The tax name. Maximum length is 20 characters. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * The rate of the specified tax. Valid range is from 0.001 to 99.999. - * - * @param string|double $percent - * - * @return $this - */ - public function setPercent($percent) - { - NumericValidator::validate($percent, "Percent"); - $percent = FormatConverter::formatToPrice($percent); - $this->percent = $percent; - return $this; - } - - /** - * The rate of the specified tax. Valid range is from 0.001 to 99.999. - * - * @return string - */ - public function getPercent() - { - return $this->percent; - } - - /** - * The tax as a monetary amount. Cannot be specified in a request. - * - * @param \PayPal\Api\Currency $amount - * - * @return $this - */ - public function setAmount($amount) - { - $this->amount = $amount; - return $this; - } - - /** - * The tax as a monetary amount. Cannot be specified in a request. - * - * @return \PayPal\Api\Currency - */ - public function getAmount() - { - return $this->amount; - } - -} diff --git a/paypal/PayPal/Api/Template.php b/paypal/PayPal/Api/Template.php deleted file mode 100644 index 4602e9b..0000000 --- a/paypal/PayPal/Api/Template.php +++ /dev/null @@ -1,309 +0,0 @@ -template_id = $template_id; - return $this; - } - - /** - * Unique identifier id of the template. - * - * @return string - */ - public function getTemplateId() - { - return $this->template_id; - } - - /** - * Name of the template. - * - * @param string $name - * - * @return $this - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * Name of the template. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Indicates that this template is merchant's default. There can be only one template which can be a default. - * - * @param bool $default - * - * @return $this - */ - public function setDefault($default) - { - $this->default = $default; - return $this; - } - - /** - * Indicates that this template is merchant's default. There can be only one template which can be a default. - * - * @return bool - */ - public function getDefault() - { - return $this->default; - } - - /** - * Customized invoice data which is saved as template - * - * @param \PayPal\Api\TemplateData $template_data - * - * @return $this - */ - public function setTemplateData($template_data) - { - $this->template_data = $template_data; - return $this; - } - - /** - * Customized invoice data which is saved as template - * - * @return \PayPal\Api\TemplateData - */ - public function getTemplateData() - { - return $this->template_data; - } - - /** - * Settings for each template - * - * @param \PayPal\Api\TemplateSettings[] $settings - * - * @return $this - */ - public function setSettings($settings) - { - $this->settings = $settings; - return $this; - } - - /** - * Settings for each template - * - * @return \PayPal\Api\TemplateSettings[] - */ - public function getSettings() - { - return $this->settings; - } - - /** - * Append Settings to the list. - * - * @param \PayPal\Api\TemplateSettings $templateSettings - * @return $this - */ - public function addSetting($templateSettings) - { - if (!$this->getSettings()) { - return $this->setSettings(array($templateSettings)); - } else { - return $this->setSettings( - array_merge($this->getSettings(), array($templateSettings)) - ); - } - } - - /** - * Remove Settings from the list. - * - * @param \PayPal\Api\TemplateSettings $templateSettings - * @return $this - */ - public function removeSetting($templateSettings) - { - return $this->setSettings( - array_diff($this->getSettings(), array($templateSettings)) - ); - } - - /** - * Unit of measure for the template, possible values are Quantity, Hours, Amount. - * - * @param string $unit_of_measure - * - * @return $this - */ - public function setUnitOfMeasure($unit_of_measure) - { - $this->unit_of_measure = $unit_of_measure; - return $this; - } - - /** - * Unit of measure for the template, possible values are Quantity, Hours, Amount. - * - * @return string - */ - public function getUnitOfMeasure() - { - return $this->unit_of_measure; - } - - /** - * Indicates whether this is a custom template created by the merchant. Non custom templates are system generated - * - * @param bool $custom - * - * @return $this - */ - public function setCustom($custom) - { - $this->custom = $custom; - return $this; - } - - /** - * Indicates whether this is a custom template created by the merchant. Non custom templates are system generated - * - * @return bool - */ - public function getCustom() - { - return $this->custom; - } - - /** - * Retrieve the details for a particular template by passing the template ID to the request URI. - * - * @param string $templateId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Template - */ - public static function get($templateId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($templateId, 'templateId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/invoicing/templates/$templateId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Template(); - $ret->fromJson($json); - return $ret; - } - - /** - * Delete a particular template by passing the template ID to the request URI. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function delete($apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getTemplateId(), "Id"); - $payLoad = ""; - self::executeCall( - "/v1/invoicing/templates/{$this->getTemplateId()}", - "DELETE", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Creates a template. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Template - */ - public function create($apiContext = null, $restCall = null) - { - $json = self::executeCall( - "/v1/invoicing/templates", - "POST", - $this->toJSON(), - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Update an existing template by passing the template ID to the request URI. In addition, pass a complete template object in the request JSON. Partial updates are not supported. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Template - */ - public function update($apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getTemplateId(), "Id"); - $payLoad = $this->toJSON(); - $json = self::executeCall( - "/v1/invoicing/templates/{$this->getTemplateId()}", - "PUT", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - -} diff --git a/paypal/PayPal/Api/TemplateData.php b/paypal/PayPal/Api/TemplateData.php deleted file mode 100644 index 64d56c1..0000000 --- a/paypal/PayPal/Api/TemplateData.php +++ /dev/null @@ -1,619 +0,0 @@ -merchant_info = $merchant_info; - return $this; - } - - /** - * Information about the merchant who is sending the invoice. - * - * @return \PayPal\Api\MerchantInfo - */ - public function getMerchantInfo() - { - return $this->merchant_info; - } - - /** - * The required invoice recipient email address and any optional billing information. One recipient is supported. - * - * @param \PayPal\Api\BillingInfo[] $billing_info - * - * @return $this - */ - public function setBillingInfo($billing_info) - { - $this->billing_info = $billing_info; - return $this; - } - - /** - * The required invoice recipient email address and any optional billing information. One recipient is supported. - * - * @return \PayPal\Api\BillingInfo[] - */ - public function getBillingInfo() - { - return $this->billing_info; - } - - /** - * Append BillingInfo to the list. - * - * @param \PayPal\Api\BillingInfo $billingInfo - * @return $this - */ - public function addBillingInfo($billingInfo) - { - if (!$this->getBillingInfo()) { - return $this->setBillingInfo(array($billingInfo)); - } else { - return $this->setBillingInfo( - array_merge($this->getBillingInfo(), array($billingInfo)) - ); - } - } - - /** - * Remove BillingInfo from the list. - * - * @param \PayPal\Api\BillingInfo $billingInfo - * @return $this - */ - public function removeBillingInfo($billingInfo) - { - return $this->setBillingInfo( - array_diff($this->getBillingInfo(), array($billingInfo)) - ); - } - - /** - * For invoices sent by email, one or more email addresses to which to send a Cc: copy of the notification. Supports only email addresses under participant. - * - * @param string[] $cc_info - * - * @return $this - */ - public function setCcInfo($cc_info) - { - $this->cc_info = $cc_info; - return $this; - } - - /** - * For invoices sent by email, one or more email addresses to which to send a Cc: copy of the notification. Supports only email addresses under participant. - * - * @return string[] - */ - public function getCcInfo() - { - return $this->cc_info; - } - - /** - * Append CcInfo to the list. - * - * @param string $email - * @return $this - */ - public function addCcInfo($email) - { - if (!$this->getCcInfo()) { - return $this->setCcInfo(array($email)); - } else { - return $this->setCcInfo( - array_merge($this->getCcInfo(), array($email)) - ); - } - } - - /** - * Remove CcInfo from the list. - * - * @param string $email - * @return $this - */ - public function removeCcInfo($email) - { - return $this->setCcInfo( - array_diff($this->getCcInfo(), array($email)) - ); - } - - /** - * The shipping information for entities to whom items are being shipped. - * - * @param \PayPal\Api\ShippingInfo $shipping_info - * - * @return $this - */ - public function setShippingInfo($shipping_info) - { - $this->shipping_info = $shipping_info; - return $this; - } - - /** - * The shipping information for entities to whom items are being shipped. - * - * @return \PayPal\Api\ShippingInfo - */ - public function getShippingInfo() - { - return $this->shipping_info; - } - - /** - * The list of items to include in the invoice. Maximum value is 100 items per invoice. - * - * @param \PayPal\Api\InvoiceItem[] $items - * - * @return $this - */ - public function setItems($items) - { - $this->items = $items; - return $this; - } - - /** - * The list of items to include in the invoice. Maximum value is 100 items per invoice. - * - * @return \PayPal\Api\InvoiceItem[] - */ - public function getItems() - { - return $this->items; - } - - /** - * Append Items to the list. - * - * @param \PayPal\Api\InvoiceItem $invoiceItem - * @return $this - */ - public function addItem($invoiceItem) - { - if (!$this->getItems()) { - return $this->setItems(array($invoiceItem)); - } else { - return $this->setItems( - array_merge($this->getItems(), array($invoiceItem)) - ); - } - } - - /** - * Remove Items from the list. - * - * @param \PayPal\Api\InvoiceItem $invoiceItem - * @return $this - */ - public function removeItem($invoiceItem) - { - return $this->setItems( - array_diff($this->getItems(), array($invoiceItem)) - ); - } - - /** - * Optional. The payment deadline for the invoice. Value is either `term_type` or `due_date` but not both. - * - * @param \PayPal\Api\PaymentTerm $payment_term - * - * @return $this - */ - public function setPaymentTerm($payment_term) - { - $this->payment_term = $payment_term; - return $this; - } - - /** - * Optional. The payment deadline for the invoice. Value is either `term_type` or `due_date` but not both. - * - * @return \PayPal\Api\PaymentTerm - */ - public function getPaymentTerm() - { - return $this->payment_term; - } - - /** - * Reference data, such as PO number, to add to the invoice. Maximum length is 60 characters. - * - * @param string $reference - * - * @return $this - */ - public function setReference($reference) - { - $this->reference = $reference; - return $this; - } - - /** - * Reference data, such as PO number, to add to the invoice. Maximum length is 60 characters. - * - * @return string - */ - public function getReference() - { - return $this->reference; - } - - /** - * The invoice level discount, as a percent or an amount value. - * - * @param \PayPal\Api\Cost $discount - * - * @return $this - */ - public function setDiscount($discount) - { - $this->discount = $discount; - return $this; - } - - /** - * The invoice level discount, as a percent or an amount value. - * - * @return \PayPal\Api\Cost - */ - public function getDiscount() - { - return $this->discount; - } - - /** - * The shipping cost, as a percent or an amount value. - * - * @param \PayPal\Api\ShippingCost $shipping_cost - * - * @return $this - */ - public function setShippingCost($shipping_cost) - { - $this->shipping_cost = $shipping_cost; - return $this; - } - - /** - * The shipping cost, as a percent or an amount value. - * - * @return \PayPal\Api\ShippingCost - */ - public function getShippingCost() - { - return $this->shipping_cost; - } - - /** - * The custom amount to apply on an invoice. If you include a label, the amount cannot be empty. - * - * @param \PayPal\Api\CustomAmount $custom - * - * @return $this - */ - public function setCustom($custom) - { - $this->custom = $custom; - return $this; - } - - /** - * The custom amount to apply on an invoice. If you include a label, the amount cannot be empty. - * - * @return \PayPal\Api\CustomAmount - */ - public function getCustom() - { - return $this->custom; - } - - /** - * Indicates whether the invoice allows a partial payment. If set to `false`, invoice must be paid in full. If set to `true`, the invoice allows partial payments. Default is `false`. - * - * @param bool $allow_partial_payment - * - * @return $this - */ - public function setAllowPartialPayment($allow_partial_payment) - { - $this->allow_partial_payment = $allow_partial_payment; - return $this; - } - - /** - * Indicates whether the invoice allows a partial payment. If set to `false`, invoice must be paid in full. If set to `true`, the invoice allows partial payments. Default is `false`. - * - * @return bool - */ - public function getAllowPartialPayment() - { - return $this->allow_partial_payment; - } - - /** - * If `allow_partial_payment` is set to `true`, the minimum amount allowed for a partial payment. - * - * @param \PayPal\Api\Currency $minimum_amount_due - * - * @return $this - */ - public function setMinimumAmountDue($minimum_amount_due) - { - $this->minimum_amount_due = $minimum_amount_due; - return $this; - } - - /** - * If `allow_partial_payment` is set to `true`, the minimum amount allowed for a partial payment. - * - * @return \PayPal\Api\Currency - */ - public function getMinimumAmountDue() - { - return $this->minimum_amount_due; - } - - /** - * Indicates whether tax is calculated before or after a discount. If set to `false`, the tax is calculated before a discount. If set to `true`, the tax is calculated after a discount. Default is `false`. - * - * @param bool $tax_calculated_after_discount - * - * @return $this - */ - public function setTaxCalculatedAfterDiscount($tax_calculated_after_discount) - { - $this->tax_calculated_after_discount = $tax_calculated_after_discount; - return $this; - } - - /** - * Indicates whether tax is calculated before or after a discount. If set to `false`, the tax is calculated before a discount. If set to `true`, the tax is calculated after a discount. Default is `false`. - * - * @return bool - */ - public function getTaxCalculatedAfterDiscount() - { - return $this->tax_calculated_after_discount; - } - - /** - * Indicates whether the unit price includes tax. Default is `false`. - * - * @param bool $tax_inclusive - * - * @return $this - */ - public function setTaxInclusive($tax_inclusive) - { - $this->tax_inclusive = $tax_inclusive; - return $this; - } - - /** - * Indicates whether the unit price includes tax. Default is `false`. - * - * @return bool - */ - public function getTaxInclusive() - { - return $this->tax_inclusive; - } - - /** - * General terms of the invoice. 4000 characters max. - * - * @param string $terms - * - * @return $this - */ - public function setTerms($terms) - { - $this->terms = $terms; - return $this; - } - - /** - * General terms of the invoice. 4000 characters max. - * - * @return string - */ - public function getTerms() - { - return $this->terms; - } - - /** - * Note to the payer. 4000 characters max. - * - * @param string $note - * - * @return $this - */ - public function setNote($note) - { - $this->note = $note; - return $this; - } - - /** - * Note to the payer. 4000 characters max. - * - * @return string - */ - public function getNote() - { - return $this->note; - } - - /** - * A private bookkeeping memo for the merchant. Maximum length is 150 characters. - * - * @param string $merchant_memo - * - * @return $this - */ - public function setMerchantMemo($merchant_memo) - { - $this->merchant_memo = $merchant_memo; - return $this; - } - - /** - * A private bookkeeping memo for the merchant. Maximum length is 150 characters. - * - * @return string - */ - public function getMerchantMemo() - { - return $this->merchant_memo; - } - - /** - * Full URL of an external image to use as the logo. Maximum length is 4000 characters. - * - * @param string $logo_url - * @throws \InvalidArgumentException - * @return $this - */ - public function setLogoUrl($logo_url) - { - UrlValidator::validate($logo_url, "LogoUrl"); - $this->logo_url = $logo_url; - return $this; - } - - /** - * Full URL of an external image to use as the logo. Maximum length is 4000 characters. - * - * @return string - */ - public function getLogoUrl() - { - return $this->logo_url; - } - - /** - * The total amount of the invoice. - * - * @param \PayPal\Api\Currency $total_amount - * - * @return $this - */ - public function setTotalAmount($total_amount) - { - $this->total_amount = $total_amount; - return $this; - } - - /** - * The total amount of the invoice. - * - * @return \PayPal\Api\Currency - */ - public function getTotalAmount() - { - return $this->total_amount; - } - - /** - * List of files attached to the invoice. - * - * @param \PayPal\Api\FileAttachment[] $attachments - * - * @return $this - */ - public function setAttachments($attachments) - { - $this->attachments = $attachments; - return $this; - } - - /** - * List of files attached to the invoice. - * - * @return \PayPal\Api\FileAttachment[] - */ - public function getAttachments() - { - return $this->attachments; - } - - /** - * Append Attachments to the list. - * - * @param \PayPal\Api\FileAttachment $fileAttachment - * @return $this - */ - public function addAttachment($fileAttachment) - { - if (!$this->getAttachments()) { - return $this->setAttachments(array($fileAttachment)); - } else { - return $this->setAttachments( - array_merge($this->getAttachments(), array($fileAttachment)) - ); - } - } - - /** - * Remove Attachments from the list. - * - * @param \PayPal\Api\FileAttachment $fileAttachment - * @return $this - */ - public function removeAttachment($fileAttachment) - { - return $this->setAttachments( - array_diff($this->getAttachments(), array($fileAttachment)) - ); - } - -} diff --git a/paypal/PayPal/Api/TemplateSettings.php b/paypal/PayPal/Api/TemplateSettings.php deleted file mode 100644 index 60be389..0000000 --- a/paypal/PayPal/Api/TemplateSettings.php +++ /dev/null @@ -1,65 +0,0 @@ -field_name = $field_name; - return $this; - } - - /** - * The field name (for any field in template_data) for which the corresponding display preferences will be mapped to. - * - * @return string - */ - public function getFieldName() - { - return $this->field_name; - } - - /** - * Settings metadata for each field. - * - * @param \PayPal\Api\TemplateSettingsMetadata $display_preference - * - * @return $this - */ - public function setDisplayPreference($display_preference) - { - $this->display_preference = $display_preference; - return $this; - } - - /** - * Settings metadata for each field. - * - * @return \PayPal\Api\TemplateSettingsMetadata - */ - public function getDisplayPreference() - { - return $this->display_preference; - } - -} diff --git a/paypal/PayPal/Api/TemplateSettingsMetadata.php b/paypal/PayPal/Api/TemplateSettingsMetadata.php deleted file mode 100644 index 7084a04..0000000 --- a/paypal/PayPal/Api/TemplateSettingsMetadata.php +++ /dev/null @@ -1,41 +0,0 @@ -hidden = $hidden; - return $this; - } - - /** - * Indicates whether this field should be hidden. default is false - * - * @return bool - */ - public function getHidden() - { - return $this->hidden; - } - -} diff --git a/paypal/PayPal/Api/Templates.php b/paypal/PayPal/Api/Templates.php deleted file mode 100644 index c9b0ad0..0000000 --- a/paypal/PayPal/Api/Templates.php +++ /dev/null @@ -1,292 +0,0 @@ -addresses = $addresses; - return $this; - } - - /** - * List of addresses in merchant's profile. - * - * @return \PayPal\Api\Address[] - */ - public function getAddresses() - { - return $this->addresses; - } - - /** - * Append Addresses to the list. - * - * @param \PayPal\Api\Address $address - * @return $this - */ - public function addAddress($address) - { - if (!$this->getAddresses()) { - return $this->setAddresses(array($address)); - } else { - return $this->setAddresses( - array_merge($this->getAddresses(), array($address)) - ); - } - } - - /** - * Remove Addresses from the list. - * - * @param \PayPal\Api\Address $address - * @return $this - */ - public function removeAddress($address) - { - return $this->setAddresses( - array_diff($this->getAddresses(), array($address)) - ); - } - - /** - * List of emails in merchant's profile. - * - * @param string[] $emails - * - * @return $this - */ - public function setEmails($emails) - { - $this->emails = $emails; - return $this; - } - - /** - * List of emails in merchant's profile. - * - * @return string[] - */ - public function getEmails() - { - return $this->emails; - } - - /** - * Append Emails to the list. - * - * @param string $string - * @return $this - */ - public function addEmail($string) - { - if (!$this->getEmails()) { - return $this->setEmails(array($string)); - } else { - return $this->setEmails( - array_merge($this->getEmails(), array($string)) - ); - } - } - - /** - * Remove Emails from the list. - * - * @param string $string - * @return $this - */ - public function removeEmail($string) - { - return $this->setEmails( - array_diff($this->getEmails(), array($string)) - ); - } - - /** - * List of phone numbers in merchant's profile. - * - * @param \PayPal\Api\Phone[] $phones - * - * @return $this - */ - public function setPhones($phones) - { - $this->phones = $phones; - return $this; - } - - /** - * List of phone numbers in merchant's profile. - * - * @return \PayPal\Api\Phone[] - */ - public function getPhones() - { - return $this->phones; - } - - /** - * Append Phones to the list. - * - * @param \PayPal\Api\Phone $phone - * @return $this - */ - public function addPhone($phone) - { - if (!$this->getPhones()) { - return $this->setPhones(array($phone)); - } else { - return $this->setPhones( - array_merge($this->getPhones(), array($phone)) - ); - } - } - - /** - * Remove Phones from the list. - * - * @param \PayPal\Api\Phone $phone - * @return $this - */ - public function removePhone($phone) - { - return $this->setPhones( - array_diff($this->getPhones(), array($phone)) - ); - } - - /** - * Array of templates. - * - * @param \PayPal\Api\Template[] $templates - * - * @return $this - */ - public function setTemplates($templates) - { - $this->templates = $templates; - return $this; - } - - /** - * Array of templates. - * - * @return \PayPal\Api\Template[] - */ - public function getTemplates() - { - return $this->templates; - } - - /** - * Append Templates to the list. - * - * @param \PayPal\Api\Template $template - * @return $this - */ - public function addTemplate($template) - { - if (!$this->getTemplates()) { - return $this->setTemplates(array($template)); - } else { - return $this->setTemplates( - array_merge($this->getTemplates(), array($template)) - ); - } - } - - /** - * Remove Templates from the list. - * - * @param \PayPal\Api\Template $template - * @return $this - */ - public function removeTemplate($template) - { - return $this->setTemplates( - array_diff($this->getTemplates(), array($template)) - ); - } - - /** - * Retrieve the details for a particular template by passing the template ID to the request URI. - * - * @deprecated Please use `Template::get()` instead. - * @see Template::get - * @param string $templateId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Template - */ - public static function get($templateId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($templateId, 'templateId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/invoicing/templates/$templateId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Template(); - $ret->fromJson($json); - return $ret; - } - - /** - * Retrieves the template information of the merchant. - * - * @param array $params - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Templates - */ - public static function getAll($params = array(), $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($params, 'params'); - $payLoad = ""; - $allowedParams = array( - 'fields' => 1, - ); - $json = self::executeCall( - "/v1/invoicing/templates/" . "?" . http_build_query(array_intersect_key($params, $allowedParams)), - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Templates(); - $ret->fromJson($json); - return $ret; - } -} diff --git a/paypal/PayPal/Api/Terms.php b/paypal/PayPal/Api/Terms.php deleted file mode 100644 index 8bc1c84..0000000 --- a/paypal/PayPal/Api/Terms.php +++ /dev/null @@ -1,161 +0,0 @@ -id = $id; - return $this; - } - - /** - * Identifier of the terms. 128 characters max. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Term type. Allowed values: `MONTHLY`, `WEEKLY`, `YEARLY`. - * - * @param string $type - * - * @return $this - */ - public function setType($type) - { - $this->type = $type; - return $this; - } - - /** - * Term type. Allowed values: `MONTHLY`, `WEEKLY`, `YEARLY`. - * - * @return string - */ - public function getType() - { - return $this->type; - } - - /** - * Max Amount associated with this term. - * - * @param \PayPal\Api\Currency $max_billing_amount - * - * @return $this - */ - public function setMaxBillingAmount($max_billing_amount) - { - $this->max_billing_amount = $max_billing_amount; - return $this; - } - - /** - * Max Amount associated with this term. - * - * @return \PayPal\Api\Currency - */ - public function getMaxBillingAmount() - { - return $this->max_billing_amount; - } - - /** - * How many times money can be pulled during this term. - * - * @param string $occurrences - * - * @return $this - */ - public function setOccurrences($occurrences) - { - $this->occurrences = $occurrences; - return $this; - } - - /** - * How many times money can be pulled during this term. - * - * @return string - */ - public function getOccurrences() - { - return $this->occurrences; - } - - /** - * Amount_range associated with this term. - * - * @param \PayPal\Api\Currency $amount_range - * - * @return $this - */ - public function setAmountRange($amount_range) - { - $this->amount_range = $amount_range; - return $this; - } - - /** - * Amount_range associated with this term. - * - * @return \PayPal\Api\Currency - */ - public function getAmountRange() - { - return $this->amount_range; - } - - /** - * Buyer's ability to edit the amount in this term. - * - * @param string $buyer_editable - * - * @return $this - */ - public function setBuyerEditable($buyer_editable) - { - $this->buyer_editable = $buyer_editable; - return $this; - } - - /** - * Buyer's ability to edit the amount in this term. - * - * @return string - */ - public function getBuyerEditable() - { - return $this->buyer_editable; - } - -} diff --git a/paypal/PayPal/Api/Transaction.php b/paypal/PayPal/Api/Transaction.php deleted file mode 100644 index 8520e63..0000000 --- a/paypal/PayPal/Api/Transaction.php +++ /dev/null @@ -1,63 +0,0 @@ -transactions = $transactions; - return $this; - } - - /** - * Additional transactions for complex payment scenarios. - * - * @return self[] - */ - public function getTransactions() - { - return $this->transactions; - } - - /** - * Identifier to the purchase unit corresponding to this sale transaction - * - * @param string $purchase_unit_reference_id - * @deprecated Use #setReferenceId instead - * @return $this - */ - public function setPurchaseUnitReferenceId($purchase_unit_reference_id) - { - $this->purchase_unit_reference_id = $purchase_unit_reference_id; - return $this; - } - - /** - * Identifier to the purchase unit corresponding to this sale transaction - * - * @deprecated Use #getReferenceId instead - * @return string - */ - public function getPurchaseUnitReferenceId() - { - return $this->purchase_unit_reference_id; - } - -} diff --git a/paypal/PayPal/Api/TransactionBase.php b/paypal/PayPal/Api/TransactionBase.php deleted file mode 100644 index 0fcbc70..0000000 --- a/paypal/PayPal/Api/TransactionBase.php +++ /dev/null @@ -1,40 +0,0 @@ -related_resources = $related_resources; - return $this; - } - - /** - * List of financial transactions (Sale, Authorization, Capture, Refund) related to the payment. - * - * @return \PayPal\Api\RelatedResources[] - */ - public function getRelatedResources() - { - return $this->related_resources; - } - -} diff --git a/paypal/PayPal/Api/Transactions.php b/paypal/PayPal/Api/Transactions.php deleted file mode 100644 index f7a09c1..0000000 --- a/paypal/PayPal/Api/Transactions.php +++ /dev/null @@ -1,42 +0,0 @@ -amount = $amount; - return $this; - } - - /** - * Amount being collected. - * - * @return \PayPal\Api\Amount - */ - public function getAmount() - { - return $this->amount; - } - -} diff --git a/paypal/PayPal/Api/VerifyWebhookSignature.php b/paypal/PayPal/Api/VerifyWebhookSignature.php deleted file mode 100644 index edb4bbd..0000000 --- a/paypal/PayPal/Api/VerifyWebhookSignature.php +++ /dev/null @@ -1,256 +0,0 @@ -auth_algo = $auth_algo; - return $this; - } - - /** - * The algorithm that PayPal uses to generate the signature and that you can use to verify the signature. Extract this value from the `PAYPAL-AUTH-ALGO` response header, which is received with the webhook notification. - * - * @return string - */ - public function getAuthAlgo() - { - return $this->auth_algo; - } - - /** - * The X.509 public key certificate. Download the certificate from this URL and use it to verify the signature. Extract this value from the `PAYPAL-CERT-URL` response header, which is received with the webhook notification. - * - * @param string $cert_url - * @throws \InvalidArgumentException - * @return $this - */ - public function setCertUrl($cert_url) - { - UrlValidator::validate($cert_url, "CertUrl"); - $this->cert_url = $cert_url; - return $this; - } - - /** - * The X.509 public key certificate. Download the certificate from this URL and use it to verify the signature. Extract this value from the `PAYPAL-CERT-URL` response header, which is received with the webhook notification. - * - * @return string - */ - public function getCertUrl() - { - return $this->cert_url; - } - - /** - * The ID of the HTTP transmission. Contained in the `PAYPAL-TRANSMISSION-ID` header of the notification message. - * - * @param string $transmission_id - * - * @return $this - */ - public function setTransmissionId($transmission_id) - { - $this->transmission_id = $transmission_id; - return $this; - } - - /** - * The ID of the HTTP transmission. Contained in the `PAYPAL-TRANSMISSION-ID` header of the notification message. - * - * @return string - */ - public function getTransmissionId() - { - return $this->transmission_id; - } - - /** - * The PayPal-generated asymmetric signature. Extract this value from the `PAYPAL-TRANSMISSION-SIG` response header, which is received with the webhook notification. - * - * @param string $transmission_sig - * - * @return $this - */ - public function setTransmissionSig($transmission_sig) - { - $this->transmission_sig = $transmission_sig; - return $this; - } - - /** - * The PayPal-generated asymmetric signature. Extract this value from the `PAYPAL-TRANSMISSION-SIG` response header, which is received with the webhook notification. - * - * @return string - */ - public function getTransmissionSig() - { - return $this->transmission_sig; - } - - /** - * The date and time of the HTTP transmission. Contained in the `PAYPAL-TRANSMISSION-TIME` header of the notification message. - * - * @param string $transmission_time - * - * @return $this - */ - public function setTransmissionTime($transmission_time) - { - $this->transmission_time = $transmission_time; - return $this; - } - - /** - * The date and time of the HTTP transmission. Contained in the `PAYPAL-TRANSMISSION-TIME` header of the notification message. - * - * @return string - */ - public function getTransmissionTime() - { - return $this->transmission_time; - } - - /** - * The ID of the webhook as configured in your Developer Portal account. - * - * @param string $webhook_id - * - * @return $this - */ - public function setWebhookId($webhook_id) - { - $this->webhook_id = $webhook_id; - return $this; - } - - /** - * The ID of the webhook as configured in your Developer Portal account. - * - * @return string - */ - public function getWebhookId() - { - return $this->webhook_id; - } - - /** - * The webhook notification, which is the content of the HTTP `POST` request body. - * @deprecated Please use setRequestBody($request_body) instead. - * @param \PayPal\Api\WebhookEvent $webhook_event - * - * @return $this - */ - public function setWebhookEvent($webhook_event) - { - $this->webhook_event = $webhook_event; - return $this; - } - - /** - * The webhook notification, which is the content of the HTTP `POST` request body. - * - * @return \PayPal\Api\WebhookEvent - */ - public function getWebhookEvent() - { - return $this->webhook_event; - } - - /** - * The content of the HTTP `POST` request body of the webhook notification you received as a string. - * - * @param string $request_body - * - * @return $this - */ - public function setRequestBody($request_body) - { - $this->request_body = $request_body; - return $this; - } - - /** - * The content of the HTTP `POST` request body of the webhook notification you received as a string. - * - * @return string - */ - public function getRequestBody() - { - return $this->request_body; - } - - /** - * Verifies a webhook signature. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return VerifyWebhookSignatureResponse - */ - public function post($apiContext = null, $restCall = null) - { - $payLoad = $this->toJSON(); - - $json = self::executeCall( - "/v1/notifications/verify-webhook-signature", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new VerifyWebhookSignatureResponse(); - $ret->fromJson($json); - return $ret; - } - - public function toJSON($options = 0) - { - if (!is_null($this->request_body)) { - $valuesToEncode = $this->toArray(); - unset($valuesToEncode['webhook_event']); - unset($valuesToEncode['request_body']); - - $payLoad = "{"; - foreach ($valuesToEncode as $field => $value) { - $payLoad .= "\"$field\": \"$value\","; - } - $payLoad .= "\"webhook_event\": $this->request_body"; - $payLoad .= "}"; - return $payLoad; - } else { - $payLoad = parent::toJSON($options); - return $payLoad; - } - } -} diff --git a/paypal/PayPal/Api/VerifyWebhookSignatureResponse.php b/paypal/PayPal/Api/VerifyWebhookSignatureResponse.php deleted file mode 100644 index 75b0845..0000000 --- a/paypal/PayPal/Api/VerifyWebhookSignatureResponse.php +++ /dev/null @@ -1,42 +0,0 @@ -verification_status = $verification_status; - return $this; - } - - /** - * The status of the signature verification. Value is `SUCCESS` or `FAILURE`. - * - * @return string - */ - public function getVerificationStatus() - { - return $this->verification_status; - } - -} diff --git a/paypal/PayPal/Api/WebProfile.php b/paypal/PayPal/Api/WebProfile.php deleted file mode 100644 index 4ff1a80..0000000 --- a/paypal/PayPal/Api/WebProfile.php +++ /dev/null @@ -1,305 +0,0 @@ -id = $id; - return $this; - } - - /** - * The unique ID of the web experience profile. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * The web experience profile name. Unique for a specified merchant's profiles. - * - * @param string $name - * - * @return $this - */ - public function setName($name) - { - $this->name = $name; - return $this; - } - - /** - * The web experience profile name. Unique for a specified merchant's profiles. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Indicates whether the profile persists for three hours or permanently. Set to `false` to persist the profile permanently. Set to `true` to persist the profile for three hours. - * - * @param bool $temporary - * - * @return $this - */ - public function setTemporary($temporary) - { - $this->temporary = $temporary; - return $this; - } - - /** - * Indicates whether the profile persists for three hours or permanently. Set to `false` to persist the profile permanently. Set to `true` to persist the profile for three hours. - * - * @return bool - */ - public function getTemporary() - { - return $this->temporary; - } - - /** - * Parameters for flow configuration. - * - * @param \PayPal\Api\FlowConfig $flow_config - * - * @return $this - */ - public function setFlowConfig($flow_config) - { - $this->flow_config = $flow_config; - return $this; - } - - /** - * Parameters for flow configuration. - * - * @return \PayPal\Api\FlowConfig - */ - public function getFlowConfig() - { - return $this->flow_config; - } - - /** - * Parameters for input fields customization. - * - * @param \PayPal\Api\InputFields $input_fields - * - * @return $this - */ - public function setInputFields($input_fields) - { - $this->input_fields = $input_fields; - return $this; - } - - /** - * Parameters for input fields customization. - * - * @return \PayPal\Api\InputFields - */ - public function getInputFields() - { - return $this->input_fields; - } - - /** - * Parameters for style and presentation. - * - * @param \PayPal\Api\Presentation $presentation - * - * @return $this - */ - public function setPresentation($presentation) - { - $this->presentation = $presentation; - return $this; - } - - /** - * Parameters for style and presentation. - * - * @return \PayPal\Api\Presentation - */ - public function getPresentation() - { - return $this->presentation; - } - - /** - * Creates a web experience profile. Pass the profile name and details in the JSON request body. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return CreateProfileResponse - */ - public function create($apiContext = null, $restCall = null) - { - $payLoad = $this->toJSON(); - $json = self::executeCall( - "/v1/payment-experience/web-profiles/", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new CreateProfileResponse(); - $ret->fromJson($json); - return $ret; - } - - /** - * Updates a web experience profile. Pass the ID of the profile to the request URI and pass the profile details in the JSON request body. If your request omits any profile detail fields, the operation removes the previously set values for those fields. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function update($apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - $payLoad = $this->toJSON(); - self::executeCall( - "/v1/payment-experience/web-profiles/{$this->getId()}", - "PUT", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Partially-updates a web experience profile. Pass the profile ID to the request URI. Pass a patch object with the operation, path of the profile location to update, and, if needed, a new value to complete the operation in the JSON request body. - * - * @param Patch[] $patch - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function partial_update($patch, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($patch, 'patch'); - $payload = array(); - foreach ($patch as $patchObject) { - $payload[] = $patchObject->toArray(); - } - $payLoad = json_encode($payload); - self::executeCall( - "/v1/payment-experience/web-profiles/{$this->getId()}", - "PATCH", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - - /** - * Shows details for a web experience profile, by ID. - * - * @param string $profileId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return WebProfile - */ - public static function get($profileId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($profileId, 'profileId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/payment-experience/web-profiles/$profileId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new WebProfile(); - $ret->fromJson($json); - return $ret; - } - - /** - * Lists all web experience profiles for a merchant or subject. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return WebProfile[] - */ - public static function get_list($apiContext = null, $restCall = null) - { - $payLoad = ""; - $json = self::executeCall( - "/v1/payment-experience/web-profiles/", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - return WebProfile::getList($json); - } - - /** - * Deletes a web experience profile, by ID. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function delete($apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - $payLoad = ""; - self::executeCall( - "/v1/payment-experience/web-profiles/{$this->getId()}", - "DELETE", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - -} diff --git a/paypal/PayPal/Api/Webhook.php b/paypal/PayPal/Api/Webhook.php deleted file mode 100644 index 549b588..0000000 --- a/paypal/PayPal/Api/Webhook.php +++ /dev/null @@ -1,260 +0,0 @@ -id = $id; - return $this; - } - - /** - * The ID of the webhook. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * The URL that is configured to listen on `localhost` for incoming `POST` notification messages that contain event information. - * - * @param string $url - * @throws \InvalidArgumentException - * @return $this - */ - public function setUrl($url) - { - UrlValidator::validate($url, "Url"); - $this->url = $url; - return $this; - } - - /** - * The URL that is configured to listen on `localhost` for incoming `POST` notification messages that contain event information. - * - * @return string - */ - public function getUrl() - { - return $this->url; - } - - /** - * A list of up to ten events to which to subscribe your webhook. To subscribe to all events including new events as they are added, specify the asterisk (`*`) wildcard. To replace the `event_types` array, specify the `*` wildcard. To see all supported events, [list available events](#available-event-type.list). - * - * @param \PayPal\Api\WebhookEventType[] $event_types - * - * @return $this - */ - public function setEventTypes($event_types) - { - $this->event_types = $event_types; - return $this; - } - - /** - * A list of up to ten events to which to subscribe your webhook. To subscribe to all events including new events as they are added, specify the asterisk (`*`) wildcard. To replace the `event_types` array, specify the `*` wildcard. To see all supported events, [list available events](#available-event-type.list). - * - * @return \PayPal\Api\WebhookEventType[] - */ - public function getEventTypes() - { - return $this->event_types; - } - - /** - * Append EventTypes to the list. - * - * @param \PayPal\Api\WebhookEventType $webhookEventType - * @return $this - */ - public function addEventType($webhookEventType) - { - if (!$this->getEventTypes()) { - return $this->setEventTypes(array($webhookEventType)); - } else { - return $this->setEventTypes( - array_merge($this->getEventTypes(), array($webhookEventType)) - ); - } - } - - /** - * Remove EventTypes from the list. - * - * @param \PayPal\Api\WebhookEventType $webhookEventType - * @return $this - */ - public function removeEventType($webhookEventType) - { - return $this->setEventTypes( - array_diff($this->getEventTypes(), array($webhookEventType)) - ); - } - - /** - * Subscribes your webhook listener to events. A successful call returns a [`webhook`](/docs/api/webhooks/#definition-webhook) object, which includes the webhook ID for later use. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Webhook - */ - public function create($apiContext = null, $restCall = null) - { - $payLoad = $this->toJSON(); - $json = self::executeCall( - "/v1/notifications/webhooks", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Shows details for a webhook, by ID. - * - * @param string $webhookId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Webhook - */ - public static function get($webhookId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($webhookId, 'webhookId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/notifications/webhooks/$webhookId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new Webhook(); - $ret->fromJson($json); - return $ret; - } - - /** - * Retrieves all Webhooks for the application associated with access token. - * - * @deprecated Please use Webhook#getAllWithParams instead. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return WebhookList - */ - public static function getAll($apiContext = null, $restCall = null) - { - return self::getAllWithParams(array(), $apiContext, $restCall); - } - - /** - * Lists all webhooks for an app. - * - * @param array $params - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return WebhookList - */ - public static function getAllWithParams($params = array(), $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($params, 'params'); - $payLoad = ""; - $allowedParams = array( - 'anchor_type' => 1, - ); - $json = self::executeCall( - "/v1/notifications/webhooks?" . http_build_query(array_intersect_key($params, $allowedParams)), - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new WebhookList(); - $ret->fromJson($json); - return $ret; - } - - /** - * Replaces webhook fields with new values. Pass a `json_patch` object with `replace` operation and `path`, which is `/url` for a URL or `/event_types` for events. The `value` is either the URL or a list of events. - * - * @param PatchRequest $patchRequest - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return Webhook - */ - public function update($patchRequest, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - ArgumentValidator::validate($patchRequest, 'patchRequest'); - $payLoad = $patchRequest->toJSON(); - $json = self::executeCall( - "/v1/notifications/webhooks/{$this->getId()}", - "PATCH", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Deletes a webhook, by ID. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return bool - */ - public function delete($apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - $payLoad = ""; - self::executeCall( - "/v1/notifications/webhooks/{$this->getId()}", - "DELETE", - $payLoad, - null, - $apiContext, - $restCall - ); - return true; - } - -} diff --git a/paypal/PayPal/Api/WebhookEvent.php b/paypal/PayPal/Api/WebhookEvent.php deleted file mode 100644 index f222b27..0000000 --- a/paypal/PayPal/Api/WebhookEvent.php +++ /dev/null @@ -1,312 +0,0 @@ -id = $id; - return $this; - } - - /** - * The ID of the webhook event notification. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * The date and time when the webhook event notification was created. - * - * @param string $create_time - * - * @return $this - */ - public function setCreateTime($create_time) - { - $this->create_time = $create_time; - return $this; - } - - /** - * The date and time when the webhook event notification was created. - * - * @return string - */ - public function getCreateTime() - { - return $this->create_time; - } - - /** - * The name of the resource related to the webhook notification event. - * - * @param string $resource_type - * - * @return $this - */ - public function setResourceType($resource_type) - { - $this->resource_type = $resource_type; - return $this; - } - - /** - * The name of the resource related to the webhook notification event. - * - * @return string - */ - public function getResourceType() - { - return $this->resource_type; - } - - /** - * The version of the event. - * - * @param string $event_version - * - * @return $this - */ - public function setEventVersion($event_version) - { - $this->event_version = $event_version; - return $this; - } - - /** - * The version of the event. - * - * @return string - */ - public function getEventVersion() - { - return $this->event_version; - } - - /** - * The event that triggered the webhook event notification. - * - * @param string $event_type - * - * @return $this - */ - public function setEventType($event_type) - { - $this->event_type = $event_type; - return $this; - } - - /** - * The event that triggered the webhook event notification. - * - * @return string - */ - public function getEventType() - { - return $this->event_type; - } - - /** - * A summary description for the event notification. For example, `A payment authorization was created.` - * - * @param string $summary - * - * @return $this - */ - public function setSummary($summary) - { - $this->summary = $summary; - return $this; - } - - /** - * A summary description for the event notification. For example, `A payment authorization was created.` - * - * @return string - */ - public function getSummary() - { - return $this->summary; - } - - /** - * The resource that triggered the webhook event notification. - * - * @param \PayPal\Common\PayPalModel $resource - * - * @return $this - */ - public function setResource($resource) - { - $this->resource = $resource; - return $this; - } - - /** - * The resource that triggered the webhook event notification. - * - * @return \PayPal\Common\PayPalModel - */ - public function getResource() - { - return $this->resource; - } - - /** - * Validates Received Event from Webhook, and returns the webhook event object. Because security verifications by verifying certificate chain is not enabled in PHP yet, - * we need to fallback to default behavior of retrieving the ID attribute of the data, and make a separate GET call to PayPal APIs, to retrieve the data. - * This is important to do again, as hacker could have faked the data, and the retrieved data cannot be trusted without either doing client side security validation, or making a separate call - * to PayPal APIs to retrieve the actual data. This limits the hacker to mimick a fake data, as hacker wont be able to predict the Id correctly. - * - * NOTE: PLEASE DO NOT USE THE DATA PROVIDED IN WEBHOOK DIRECTLY, AS HACKER COULD PASS IN FAKE DATA. IT IS VERY IMPORTANT THAT YOU RETRIEVE THE ID AND MAKE A SEPARATE CALL TO PAYPAL API. - * - * @deprecated Please use `VerifyWebhookSignature->post()` instead. - * - * @param string $body - * @param ApiContext $apiContext - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return WebhookEvent - * @throws \InvalidArgumentException if input arguments are incorrect, or Id is not found. - * @throws PayPalConnectionException if any exception from PayPal APIs other than not found is sent. - */ - public static function validateAndGetReceivedEvent($body, $apiContext = null, $restCall = null) - { - if ($body == null | empty($body)){ - throw new \InvalidArgumentException("Body cannot be null or empty"); - } - if (!JsonValidator::validate($body, true)) { - throw new \InvalidArgumentException("Request Body is not a valid JSON."); - } - $object = new WebhookEvent($body); - if ($object->getId() == null) { - throw new \InvalidArgumentException("Id attribute not found in JSON. Possible reason could be invalid JSON Object"); - } - try { - return self::get($object->getId(), $apiContext, $restCall); - } catch(PayPalConnectionException $ex) { - if ($ex->getCode() == 404) { - // It means that the given webhook event Id is not found for this merchant. - throw new \InvalidArgumentException("Webhook Event Id provided in the data is incorrect. This could happen if anyone other than PayPal is faking the incoming webhook data."); - } - throw $ex; - } - } - - /** - * Retrieves the Webhooks event resource identified by event_id. Can be used to retrieve the payload for an event. - * - * @param string $eventId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return WebhookEvent - */ - public static function get($eventId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($eventId, 'eventId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/notifications/webhooks-events/$eventId", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new WebhookEvent(); - $ret->fromJson($json); - return $ret; - } - - /** - * Resends a webhook event notification, by ID. Any pending notifications are not resent. - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return WebhookEvent - */ - public function resend($apiContext = null, $restCall = null) - { - ArgumentValidator::validate($this->getId(), "Id"); - $payLoad = ""; - $json = self::executeCall( - "/v1/notifications/webhooks-events/{$this->getId()}/resend", - "POST", - $payLoad, - null, - $apiContext, - $restCall - ); - $this->fromJson($json); - return $this; - } - - /** - * Lists webhook event notifications. Use query parameters to filter the response. - * - * @param array $params - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return WebhookEventList - */ - public static function all($params, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($params, 'params'); - $payLoad = ""; - $allowedParams = array( - 'page_size' => 1, - 'start_time' => 1, - 'end_time' => 1, - 'transaction_id' => 1, - 'event_type' => 1, - ); - $json = self::executeCall( - "/v1/notifications/webhooks-events" . "?" . http_build_query(array_intersect_key($params, $allowedParams)), - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new WebhookEventList(); - $ret->fromJson($json); - return $ret; - } - -} diff --git a/paypal/PayPal/Api/WebhookEventList.php b/paypal/PayPal/Api/WebhookEventList.php deleted file mode 100644 index 8c8c7ed..0000000 --- a/paypal/PayPal/Api/WebhookEventList.php +++ /dev/null @@ -1,149 +0,0 @@ -events = $events; - return $this; - } - - /** - * A list of webhooks events. - * - * @return \PayPal\Api\WebhookEvent[] - */ - public function getEvents() - { - return $this->events; - } - - /** - * Append Events to the list. - * - * @param \PayPal\Api\WebhookEvent $webhookEvent - * @return $this - */ - public function addEvent($webhookEvent) - { - if (!$this->getEvents()) { - return $this->setEvents(array($webhookEvent)); - } else { - return $this->setEvents( - array_merge($this->getEvents(), array($webhookEvent)) - ); - } - } - - /** - * Remove Events from the list. - * - * @param \PayPal\Api\WebhookEvent $webhookEvent - * @return $this - */ - public function removeEvent($webhookEvent) - { - return $this->setEvents( - array_diff($this->getEvents(), array($webhookEvent)) - ); - } - - /** - * The number of items in each range of results. Note that the response might have fewer items than the requested `page_size` value. - * - * @param int $count - * - * @return $this - */ - public function setCount($count) - { - $this->count = $count; - return $this; - } - - /** - * The number of items in each range of results. Note that the response might have fewer items than the requested `page_size` value. - * - * @return int - */ - public function getCount() - { - return $this->count; - } - - /** - * Sets Links - * - * @param \PayPal\Api\Links[] $links - * - * @return $this - */ - public function setLinks($links) - { - $this->links = $links; - return $this; - } - - /** - * Gets Links - * - * @return \PayPal\Api\Links[] - */ - public function getLinks() - { - return $this->links; - } - - /** - * Append Links to the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function addLink($links) - { - if (!$this->getLinks()) { - return $this->setLinks(array($links)); - } else { - return $this->setLinks( - array_merge($this->getLinks(), array($links)) - ); - } - } - - /** - * Remove Links from the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function removeLink($links) - { - return $this->setLinks( - array_diff($this->getLinks(), array($links)) - ); - } - -} diff --git a/paypal/PayPal/Api/WebhookEventType.php b/paypal/PayPal/Api/WebhookEventType.php deleted file mode 100644 index 2aedc60..0000000 --- a/paypal/PayPal/Api/WebhookEventType.php +++ /dev/null @@ -1,140 +0,0 @@ -name = $name; - return $this; - } - - /** - * The unique event name. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * A human-readable description of the event. - * - * @param string $description - * - * @return $this - */ - public function setDescription($description) - { - $this->description = $description; - return $this; - } - - /** - * A human-readable description of the event. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * The status of a webhook event. - * - * @param string $status - * - * @return $this - */ - public function setStatus($status) - { - $this->status = $status; - return $this; - } - - /** - * The status of a webhook event. - * - * @return string - */ - public function getStatus() - { - return $this->status; - } - - /** - * Lists event subscriptions for a webhook, by ID. - * - * @param string $webhookId - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return WebhookEventTypeList - */ - public static function subscribedEventTypes($webhookId, $apiContext = null, $restCall = null) - { - ArgumentValidator::validate($webhookId, 'webhookId'); - $payLoad = ""; - $json = self::executeCall( - "/v1/notifications/webhooks/$webhookId/event-types", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new WebhookEventTypeList(); - $ret->fromJson($json); - return $ret; - } - - /** - * Lists available events to which any webhook can subscribe. For a list of supported events, see [Webhook events](/docs/integration/direct/rest/webhooks/webhook-events/). - * - * @param ApiContext $apiContext is the APIContext for this call. It can be used to pass dynamic configuration and credentials. - * @param PayPalRestCall $restCall is the Rest Call Service that is used to make rest calls - * @return WebhookEventTypeList - */ - public static function availableEventTypes($apiContext = null, $restCall = null) - { - $payLoad = ""; - $json = self::executeCall( - "/v1/notifications/webhooks-event-types", - "GET", - $payLoad, - null, - $apiContext, - $restCall - ); - $ret = new WebhookEventTypeList(); - $ret->fromJson($json); - return $ret; - } - -} diff --git a/paypal/PayPal/Api/WebhookEventTypeList.php b/paypal/PayPal/Api/WebhookEventTypeList.php deleted file mode 100644 index 63fa2c4..0000000 --- a/paypal/PayPal/Api/WebhookEventTypeList.php +++ /dev/null @@ -1,71 +0,0 @@ -event_types = $event_types; - return $this; - } - - /** - * A list of webhook events. - * - * @return \PayPal\Api\WebhookEventType[] - */ - public function getEventTypes() - { - return $this->event_types; - } - - /** - * Append EventTypes to the list. - * - * @param \PayPal\Api\WebhookEventType $webhookEventType - * @return $this - */ - public function addEventType($webhookEventType) - { - if (!$this->getEventTypes()) { - return $this->setEventTypes(array($webhookEventType)); - } else { - return $this->setEventTypes( - array_merge($this->getEventTypes(), array($webhookEventType)) - ); - } - } - - /** - * Remove EventTypes from the list. - * - * @param \PayPal\Api\WebhookEventType $webhookEventType - * @return $this - */ - public function removeEventType($webhookEventType) - { - return $this->setEventTypes( - array_diff($this->getEventTypes(), array($webhookEventType)) - ); - } - -} diff --git a/paypal/PayPal/Api/WebhookList.php b/paypal/PayPal/Api/WebhookList.php deleted file mode 100644 index 9ccbb36..0000000 --- a/paypal/PayPal/Api/WebhookList.php +++ /dev/null @@ -1,71 +0,0 @@ -webhooks = $webhooks; - return $this; - } - - /** - * A list of webhooks. - * - * @return \PayPal\Api\Webhook[] - */ - public function getWebhooks() - { - return $this->webhooks; - } - - /** - * Append Webhooks to the list. - * - * @param \PayPal\Api\Webhook $webhook - * @return $this - */ - public function addWebhook($webhook) - { - if (!$this->getWebhooks()) { - return $this->setWebhooks(array($webhook)); - } else { - return $this->setWebhooks( - array_merge($this->getWebhooks(), array($webhook)) - ); - } - } - - /** - * Remove Webhooks from the list. - * - * @param \PayPal\Api\Webhook $webhook - * @return $this - */ - public function removeWebhook($webhook) - { - return $this->setWebhooks( - array_diff($this->getWebhooks(), array($webhook)) - ); - } - -} diff --git a/paypal/PayPal/Auth/OAuthTokenCredential.php b/paypal/PayPal/Auth/OAuthTokenCredential.php deleted file mode 100644 index 91e4a02..0000000 --- a/paypal/PayPal/Auth/OAuthTokenCredential.php +++ /dev/null @@ -1,317 +0,0 @@ -clientId = $clientId; - $this->clientSecret = $clientSecret; - $this->cipher = new Cipher($this->clientSecret); - $this->targetSubject = $targetSubject; - } - - /** - * Get Client ID - * - * @return string - */ - public function getClientId() - { - return $this->clientId; - } - - /** - * Get Client Secret - * - * @return string - */ - public function getClientSecret() - { - return $this->clientSecret; - } - - /** - * Get AccessToken - * - * @param $config - * - * @return null|string - */ - public function getAccessToken($config) - { - // Check if we already have accessToken in Cache - if ($this->accessToken && (time() - $this->tokenCreateTime) < ($this->tokenExpiresIn - self::$expiryBufferTime)) { - return $this->accessToken; - } - // Check for persisted data first - $token = AuthorizationCache::pull($config, $this->clientId); - if ($token) { - // We found it - // This code block is for backward compatibility only. - if (array_key_exists('accessToken', $token)) { - $this->accessToken = $token['accessToken']; - } - - $this->tokenCreateTime = $token['tokenCreateTime']; - $this->tokenExpiresIn = $token['tokenExpiresIn']; - - // Case where we have an old unencrypted cache file - if (!array_key_exists('accessTokenEncrypted', $token)) { - AuthorizationCache::push($config, $this->clientId, $this->encrypt($this->accessToken), $this->tokenCreateTime, $this->tokenExpiresIn); - } else { - $this->accessToken = $this->decrypt($token['accessTokenEncrypted']); - } - } - - // Check if Access Token is not null and has not expired. - // The API returns expiry time as a relative time unit - // We use a buffer time when checking for token expiry to account - // for API call delays and any delay between the time the token is - // retrieved and subsequently used - if ( - $this->accessToken != null && - (time() - $this->tokenCreateTime) > ($this->tokenExpiresIn - self::$expiryBufferTime) - ) { - $this->accessToken = null; - } - - - // If accessToken is Null, obtain a new token - if ($this->accessToken == null) { - // Get a new one by making calls to API - $this->updateAccessToken($config); - AuthorizationCache::push($config, $this->clientId, $this->encrypt($this->accessToken), $this->tokenCreateTime, $this->tokenExpiresIn); - } - - return $this->accessToken; - } - - - /** - * Get a Refresh Token from Authorization Code - * - * @param $config - * @param $authorizationCode - * @param array $params optional arrays to override defaults - * @return string|null - */ - public function getRefreshToken($config, $authorizationCode = null, $params = array()) - { - static $allowedParams = array( - 'grant_type' => 'authorization_code', - 'code' => 1, - 'redirect_uri' => 'urn:ietf:wg:oauth:2.0:oob', - 'response_type' => 'token' - ); - - $params = is_array($params) ? $params : array(); - if ($authorizationCode) { - //Override the authorizationCode if value is explicitly set - $params['code'] = $authorizationCode; - } - $payload = http_build_query(array_merge($allowedParams, array_intersect_key($params, $allowedParams))); - - $response = $this->getToken($config, $this->clientId, $this->clientSecret, $payload); - - if ($response != null && isset($response["refresh_token"])) { - return $response['refresh_token']; - } - - return null; - } - - /** - * Updates Access Token based on given input - * - * @param array $config - * @param string|null $refreshToken - * @return string - */ - public function updateAccessToken($config, $refreshToken = null) - { - $this->generateAccessToken($config, $refreshToken); - return $this->accessToken; - } - - /** - * Retrieves the token based on the input configuration - * - * @param array $config - * @param string $clientId - * @param string $clientSecret - * @param string $payload - * @return mixed - * @throws PayPalConfigurationException - * @throws \PayPal\Exception\PayPalConnectionException - */ - protected function getToken($config, $clientId, $clientSecret, $payload) - { - $httpConfig = new PayPalHttpConfig(null, 'POST', $config); - - // if proxy set via config, add it - if (!empty($config['http.Proxy'])) { - $httpConfig->setHttpProxy($config['http.Proxy']); - } - - $handlers = array(self::$AUTH_HANDLER); - - /** @var IPayPalHandler $handler */ - foreach ($handlers as $handler) { - if (!is_object($handler)) { - $fullHandler = "\\" . (string)$handler; - $handler = new $fullHandler(new ApiContext($this)); - } - $handler->handle($httpConfig, $payload, array('clientId' => $clientId, 'clientSecret' => $clientSecret)); - } - - $connection = new PayPalHttpConnection($httpConfig, $config); - $res = $connection->execute($payload); - $response = json_decode($res, true); - - return $response; - } - - - /** - * Generates a new access token - * - * @param array $config - * @param null|string $refreshToken - * @return null - * @throws PayPalConnectionException - */ - private function generateAccessToken($config, $refreshToken = null) - { - $params = array('grant_type' => 'client_credentials'); - if ($refreshToken != null) { - // If the refresh token is provided, it would get access token using refresh token - // Used for Future Payments - $params['grant_type'] = 'refresh_token'; - $params['refresh_token'] = $refreshToken; - } - if ($this->targetSubject != null) { - $params['target_subject'] = $this->targetSubject; - } - $payload = http_build_query($params); - $response = $this->getToken($config, $this->clientId, $this->clientSecret, $payload); - - if ($response == null || !isset($response["access_token"]) || !isset($response["expires_in"])) { - $this->accessToken = null; - $this->tokenExpiresIn = null; - PayPalLoggingManager::getInstance(__CLASS__)->warning("Could not generate new Access token. Invalid response from server: "); - throw new PayPalConnectionException(null, "Could not generate new Access token. Invalid response from server: "); - } else { - $this->accessToken = $response["access_token"]; - $this->tokenExpiresIn = $response["expires_in"]; - } - $this->tokenCreateTime = time(); - - return $this->accessToken; - } - - /** - * Helper method to encrypt data using clientSecret as key - * - * @param $data - * @return string - */ - public function encrypt($data) - { - return $this->cipher->encrypt($data); - } - - /** - * Helper method to decrypt data using clientSecret as key - * - * @param $data - * @return string - */ - public function decrypt($data) - { - return $this->cipher->decrypt($data); - } -} diff --git a/paypal/PayPal/Cache/AuthorizationCache.php b/paypal/PayPal/Cache/AuthorizationCache.php deleted file mode 100644 index 83910d3..0000000 --- a/paypal/PayPal/Cache/AuthorizationCache.php +++ /dev/null @@ -1,123 +0,0 @@ - $clientId, - 'accessTokenEncrypted' => $accessToken, - 'tokenCreateTime' => $tokenCreateTime, - 'tokenExpiresIn' => $tokenExpiresIn - ); - } - if (!file_put_contents($cachePath, json_encode($tokens))) { - throw new \Exception("Failed to write cache"); - }; - } - - /** - * Determines from the Configuration if caching is currently enabled/disabled - * - * @param $config - * @return bool - */ - public static function isEnabled($config) - { - $value = self::getConfigValue('cache.enabled', $config); - return empty($value) ? false : ((trim($value) == true || trim($value) == 'true')); - } - - /** - * Returns the cache file path - * - * @param $config - * @return string - */ - public static function cachePath($config) - { - $cachePath = self::getConfigValue('cache.FileName', $config); - return empty($cachePath) ? __DIR__ . self::$CACHE_PATH : $cachePath; - } - - /** - * Returns the Value of the key if found in given config, or from PayPal Config Manager - * Returns null if not found - * - * @param $key - * @param $config - * @return null|string - */ - private static function getConfigValue($key, $config) - { - $config = ($config && is_array($config)) ? $config : PayPalConfigManager::getInstance()->getConfigHashmap(); - return (array_key_exists($key, $config)) ? trim($config[$key]) : null; - } -} diff --git a/paypal/PayPal/Common/ArrayUtil.php b/paypal/PayPal/Common/ArrayUtil.php deleted file mode 100644 index 4b4ffaf..0000000 --- a/paypal/PayPal/Common/ArrayUtil.php +++ /dev/null @@ -1,27 +0,0 @@ - $v) { - if (is_int($k)) { - return false; - } - } - return true; - } -} diff --git a/paypal/PayPal/Common/PayPalModel.php b/paypal/PayPal/Common/PayPalModel.php deleted file mode 100644 index 2cab284..0000000 --- a/paypal/PayPal/Common/PayPalModel.php +++ /dev/null @@ -1,309 +0,0 @@ -fromJson($data) later after creating the object. - * - * @param array|string|null $data - * @throws \InvalidArgumentException - */ - public function __construct($data = null) - { - switch (gettype($data)) { - case "NULL": - break; - case "string": - JsonValidator::validate($data); - $this->fromJson($data); - break; - case "array": - $this->fromArray($data); - break; - default: - } - } - - /** - * Returns a list of Object from Array or Json String. It is generally used when your json - * contains an array of this object - * - * @param mixed $data Array object or json string representation - * @return array - */ - public static function getList($data) - { - // Return Null if Null - if ($data === null) { - return null; - } - - if (is_a($data, get_class(new \stdClass()))) { - //This means, root element is object - return new static(json_encode($data)); - } - - $list = array(); - - if (is_array($data)) { - $data = json_encode($data); - } - - if (JsonValidator::validate($data)) { - // It is valid JSON - $decoded = json_decode($data); - if ($decoded === null) { - return $list; - } - if (is_array($decoded)) { - foreach ($decoded as $k => $v) { - $list[] = self::getList($v); - } - } - if (is_a($decoded, get_class(new \stdClass()))) { - //This means, root element is object - $list[] = new static(json_encode($decoded)); - } - } - - return $list; - } - - /** - * Magic Get Method - * - * @param $key - * @return mixed - */ - public function __get($key) - { - if ($this->__isset($key)) { - return $this->_propMap[$key]; - } - return null; - } - - /** - * Magic Set Method - * - * @param $key - * @param $value - */ - public function __set($key, $value) - { - if (!is_array($value) && $value === null) { - $this->__unset($key); - } else { - $this->_propMap[$key] = $value; - } - } - - /** - * Converts the input key into a valid Setter Method Name - * - * @param $key - * @return mixed - */ - private function convertToCamelCase($key) - { - return str_replace(' ', '', ucwords(str_replace(array('_', '-'), ' ', $key))); - } - - /** - * Magic isSet Method - * - * @param $key - * @return bool - */ - public function __isset($key) - { - return isset($this->_propMap[$key]); - } - - /** - * Magic Unset Method - * - * @param $key - */ - public function __unset($key) - { - unset($this->_propMap[$key]); - } - - /** - * Converts Params to Array - * - * @param $param - * @return array - */ - private function _convertToArray($param) - { - $ret = array(); - foreach ($param as $k => $v) { - if ($v instanceof PayPalModel) { - $ret[$k] = $v->toArray(); - } elseif (is_array($v) && sizeof($v) <= 0) { - $ret[$k] = array(); - } elseif (is_array($v)) { - $ret[$k] = $this->_convertToArray($v); - } else { - $ret[$k] = $v; - } - } - // If the array is empty, which means an empty object, - // we need to convert array to StdClass object to properly - // represent JSON String - if (sizeof($ret) <= 0) { - $ret = new PayPalModel(); - } - return $ret; - } - - /** - * Fills object value from Array list - * - * @param $arr - * @return $this - */ - public function fromArray($arr) - { - if (!empty($arr)) { - // Iterate over each element in array - foreach ($arr as $k => $v) { - // If the value is an array, it means, it is an object after conversion - if (is_array($v)) { - // Determine the class of the object - if (($clazz = ReflectionUtil::getPropertyClass(get_class($this), $k)) != null) { - // If the value is an associative array, it means, its an object. Just make recursive call to it. - if (empty($v)) { - if (ReflectionUtil::isPropertyClassArray(get_class($this), $k)) { - // It means, it is an array of objects. - $this->assignValue($k, array()); - continue; - } - $o = new $clazz(); - //$arr = array(); - $this->assignValue($k, $o); - } elseif (ArrayUtil::isAssocArray($v)) { - /** @var self $o */ - $o = new $clazz(); - $o->fromArray($v); - $this->assignValue($k, $o); - } else { - // Else, value is an array of object/data - $arr = array(); - // Iterate through each element in that array. - foreach ($v as $nk => $nv) { - if (is_array($nv)) { - $o = new $clazz(); - $o->fromArray($nv); - $arr[$nk] = $o; - } else { - $arr[$nk] = $nv; - } - } - $this->assignValue($k, $arr); - } - } else { - $this->assignValue($k, $v); - } - } else { - $this->assignValue($k, $v); - } - } - } - return $this; - } - - private function assignValue($key, $value) - { - $setter = 'set'. $this->convertToCamelCase($key); - // If we find the setter, use that, otherwise use magic method. - if (method_exists($this, $setter)) { - $this->$setter($value); - } else { - $this->__set($key, $value); - } - } - - /** - * Fills object value from Json string - * - * @param $json - * @return $this - */ - public function fromJson($json) - { - return $this->fromArray(json_decode($json, true)); - } - - /** - * Returns array representation of object - * - * @return array - */ - public function toArray() - { - return $this->_convertToArray($this->_propMap); - } - - /** - * Returns object JSON representation - * - * @param int $options http://php.net/manual/en/json.constants.php - * @return string - */ - public function toJSON($options = 0) - { - // Because of PHP Version 5.3, we cannot use JSON_UNESCAPED_SLASHES option - // Instead we would use the str_replace command for now. - // TODO: Replace this code with return json_encode($this->toArray(), $options | 64); once we support PHP >= 5.4 - if (version_compare(phpversion(), '5.4.0', '>=') === true) { - return json_encode($this->toArray(), $options | 64); - } - return str_replace('\\/', '/', json_encode($this->toArray(), $options)); - } - - /** - * Magic Method for toString - * - * @return string - */ - public function __toString() - { - return $this->toJSON(128); - } -} diff --git a/paypal/PayPal/Common/PayPalResourceModel.php b/paypal/PayPal/Common/PayPalResourceModel.php deleted file mode 100644 index d1ba0f8..0000000 --- a/paypal/PayPal/Common/PayPalResourceModel.php +++ /dev/null @@ -1,120 +0,0 @@ -links = $links; - return $this; - } - - /** - * Gets Links - * - * @return \PayPal\Api\Links[] - */ - public function getLinks() - { - return $this->links; - } - - public function getLink($rel) - { - if (is_array($this->links)) { - foreach ($this->links as $link) { - if ($link->getRel() == $rel) { - return $link->getHref(); - } - } - } - return null; - } - - /** - * Append Links to the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function addLink($links) - { - if (!$this->getLinks()) { - return $this->setLinks(array($links)); - } else { - return $this->setLinks( - array_merge($this->getLinks(), array($links)) - ); - } - } - - /** - * Remove Links from the list. - * - * @param \PayPal\Api\Links $links - * @return $this - */ - public function removeLink($links) - { - return $this->setLinks( - array_diff($this->getLinks(), array($links)) - ); - } - - - /** - * Execute SDK Call to Paypal services - * - * @param string $url - * @param string $method - * @param string $payLoad - * @param array $headers - * @param ApiContext $apiContext - * @param PayPalRestCall $restCall - * @param array $handlers - * @return string json response of the object - */ - protected static function executeCall($url, $method, $payLoad, $headers = array(), $apiContext = null, $restCall = null, $handlers = array('PayPal\Handler\RestHandler')) - { - //Initialize the context and rest call object if not provided explicitly - $apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential); - $restCall = $restCall ? $restCall : new PayPalRestCall($apiContext); - - //Make the execution call - $json = $restCall->execute($handlers, $url, $method, $payLoad, $headers); - return $json; - } - - /** - * Updates Access Token using long lived refresh token - * - * @param string|null $refreshToken - * @param ApiContext $apiContext - * @return void - */ - public function updateAccessToken($refreshToken, $apiContext) - { - $apiContext = $apiContext ? $apiContext : new ApiContext(self::$credential); - $apiContext->getCredential()->updateAccessToken($apiContext->getConfig(), $refreshToken); - } -} diff --git a/paypal/PayPal/Common/PayPalUserAgent.php b/paypal/PayPal/Common/PayPalUserAgent.php deleted file mode 100644 index c3131ed..0000000 --- a/paypal/PayPal/Common/PayPalUserAgent.php +++ /dev/null @@ -1,57 +0,0 @@ -getDocComment(), - $annots, - PREG_PATTERN_ORDER)) { - return null; - } - foreach ($annots[1] as $i => $annot) { - $annotations[strtolower($annot)] = empty($annots[2][$i]) ? true : rtrim($annots[2][$i], " \t\n\r)"); - } - - return $annotations; - } - - /** - * preg_replace_callback callback function - * - * @param $match - * @return string - */ - private static function replace_callback($match) - { - return ucwords($match[2]); - } - - /** - * Returns the properly formatted getter function name based on class name and property - * Formats the property name to a standard getter function - * - * @param string $class - * @param string $propertyName - * @return string getter function name - */ - public static function getter($class, $propertyName) - { - return method_exists($class, "get" . ucfirst($propertyName)) ? - "get" . ucfirst($propertyName) : - "get" . preg_replace_callback("/([_\-\s]?([a-z0-9]+))/", "self::replace_callback", $propertyName); - } -} diff --git a/paypal/PayPal/Converter/FormatConverter.php b/paypal/PayPal/Converter/FormatConverter.php deleted file mode 100644 index 82c1be5..0000000 --- a/paypal/PayPal/Converter/FormatConverter.php +++ /dev/null @@ -1,62 +0,0 @@ - 0, 'TWD' => 0, 'HUF' => 0); - if ($currency && array_key_exists($currency, $currencyDecimals)) { - if (strpos($value, ".") !== false && (floor($value) != $value)) { - //throw exception if it has decimal values for JPY, TWD and HUF which does not ends with .00 - throw new \InvalidArgumentException("value cannot have decimals for $currency currency"); - } - $decimals = $currencyDecimals[$currency]; - } elseif (strpos($value, ".") === false) { - // Check if value has decimal values. If not no need to assign 2 decimals with .00 at the end - $decimals = 0; - } - return self::formatToNumber($value, $decimals); - } -} diff --git a/paypal/PayPal/Core/PayPalConfigManager.php b/paypal/PayPal/Core/PayPalConfigManager.php deleted file mode 100644 index c341bb1..0000000 --- a/paypal/PayPal/Core/PayPalConfigManager.php +++ /dev/null @@ -1,159 +0,0 @@ -addConfigFromIni($configFile); - } - } - - /** - * Returns the singleton object - * - * @return $this - */ - public static function getInstance() - { - if (!isset(self::$instance)) { - self::$instance = new self(); - } - return self::$instance; - } - - /** - * Add Configuration from configuration.ini files - * - * @param string $fileName - * @return $this - */ - public function addConfigFromIni($fileName) - { - if ($configs = parse_ini_file($fileName)) { - $this->addConfigs($configs); - } - return $this; - } - - /** - * If a configuration exists in both arrays, - * then the element from the first array will be used and - * the matching key's element from the second array will be ignored. - * - * @param array $configs - * @return $this - */ - public function addConfigs($configs = array()) - { - $this->configs = $configs + $this->configs; - return $this; - } - - /** - * Simple getter for configuration params - * If an exact match for key is not found, - * does a "contains" search on the key - * - * @param string $searchKey - * @return array - */ - public function get($searchKey) - { - if (array_key_exists($searchKey, $this->configs)) { - return $this->configs[$searchKey]; - } else { - $arr = array(); - if ($searchKey !== '') { - foreach ($this->configs as $k => $v) { - if (strstr($k, $searchKey)) { - $arr[$k] = $v; - } - } - } - - return $arr; - } - } - - /** - * Utility method for handling account configuration - * return config key corresponding to the API userId passed in - * - * If $userId is null, returns config keys corresponding to - * all configured accounts - * - * @param string|null $userId - * @return array|string - */ - public function getIniPrefix($userId = null) - { - if ($userId == null) { - $arr = array(); - foreach ($this->configs as $key => $value) { - $pos = strpos($key, '.'); - if (strstr($key, "acct")) { - $arr[] = substr($key, 0, $pos); - } - } - return array_unique($arr); - } else { - $iniPrefix = array_search($userId, $this->configs); - $pos = strpos($iniPrefix, '.'); - $acct = substr($iniPrefix, 0, $pos); - - return $acct; - } - } - - /** - * returns the config file hashmap - */ - public function getConfigHashmap() - { - return $this->configs; - } - - /** - * Disabling __clone call - */ - public function __clone() - { - trigger_error('Clone is not allowed.', E_USER_ERROR); - } -} diff --git a/paypal/PayPal/Core/PayPalConstants.php b/paypal/PayPal/Core/PayPalConstants.php deleted file mode 100644 index 942b86a..0000000 --- a/paypal/PayPal/Core/PayPalConstants.php +++ /dev/null @@ -1,27 +0,0 @@ -initCredential($config); - } catch (\Exception $e) { - $this->credentialHashmap = array(); - throw $e; - } - } - - /** - * Create singleton instance for this class. - * - * @param array|null $config - * @return PayPalCredentialManager - */ - public static function getInstance($config = null) - { - if (!self::$instance) { - self::$instance = new self($config == null ? PayPalConfigManager::getInstance()->getConfigHashmap() : $config); - } - return self::$instance; - } - - /** - * Load credentials for multiple accounts, with priority given to Signature credential. - * - * @param array $config - */ - private function initCredential($config) - { - $suffix = 1; - $prefix = "acct"; - - $arr = array(); - foreach ($config as $k => $v) { - if (strstr($k, $prefix)) { - $arr[$k] = $v; - } - } - $credArr = $arr; - - $arr = array(); - foreach ($config as $key => $value) { - $pos = strpos($key, '.'); - if (strstr($key, "acct")) { - $arr[] = substr($key, 0, $pos); - } - } - $arrayPartKeys = array_unique($arr); - - $key = $prefix . $suffix; - $userName = null; - while (in_array($key, $arrayPartKeys)) { - if (isset($credArr[$key . ".ClientId"]) && isset($credArr[$key . ".ClientSecret"])) { - $userName = $key; - $this->credentialHashmap[$userName] = new OAuthTokenCredential( - $credArr[$key . ".ClientId"], - $credArr[$key . ".ClientSecret"] - ); - } - if ($userName && $this->defaultAccountName == null) { - if (array_key_exists($key . '.UserName', $credArr)) { - $this->defaultAccountName = $credArr[$key . '.UserName']; - } else { - $this->defaultAccountName = $key; - } - } - $suffix++; - $key = $prefix . $suffix; - } - } - - /** - * Sets credential object for users - * - * @param \PayPal\Auth\OAuthTokenCredential $credential - * @param string|null $userId User Id associated with the account - * @param bool $default If set, it would make it as a default credential for all requests - * - * @return $this - */ - public function setCredentialObject(OAuthTokenCredential $credential, $userId = null, $default = true) - { - $key = $userId == null ? 'default' : $userId; - $this->credentialHashmap[$key] = $credential; - if ($default) { - $this->defaultAccountName = $key; - } - return $this; - } - - /** - * Obtain Credential Object based on UserId provided. - * - * @param null $userId - * @return OAuthTokenCredential - * @throws PayPalInvalidCredentialException - */ - public function getCredentialObject($userId = null) - { - if ($userId == null && array_key_exists($this->defaultAccountName, $this->credentialHashmap)) { - $credObj = $this->credentialHashmap[$this->defaultAccountName]; - } elseif (array_key_exists($userId, $this->credentialHashmap)) { - $credObj = $this->credentialHashmap[$userId]; - } - - if (empty($credObj)) { - throw new PayPalInvalidCredentialException("Credential not found for " . ($userId ? $userId : " default user") . - ". Please make sure your configuration/APIContext has credential information"); - } - return $credObj; - } - - /** - * Disabling __clone call - */ - public function __clone() - { - trigger_error('Clone is not allowed.', E_USER_ERROR); - } -} diff --git a/paypal/PayPal/Core/PayPalHttpConfig.php b/paypal/PayPal/Core/PayPalHttpConfig.php deleted file mode 100644 index 8e431b3..0000000 --- a/paypal/PayPal/Core/PayPalHttpConfig.php +++ /dev/null @@ -1,302 +0,0 @@ - 6, - CURLOPT_CONNECTTIMEOUT => 10, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_TIMEOUT => 60, // maximum number of seconds to allow cURL functions to execute - CURLOPT_USERAGENT => 'PayPal-PHP-SDK', - CURLOPT_HTTPHEADER => array(), - CURLOPT_SSL_VERIFYHOST => 2, - CURLOPT_SSL_VERIFYPEER => 1, - CURLOPT_SSL_CIPHER_LIST => 'TLSv1:TLSv1.2' - //Allowing TLSv1 cipher list. - //Adding it like this for backward compatibility with older versions of curl - ); - - const HEADER_SEPARATOR = ';'; - const HTTP_GET = 'GET'; - const HTTP_POST = 'POST'; - - private $headers = array(); - - private $curlOptions; - - private $url; - - private $method; - - /*** - * Number of times to retry a failed HTTP call - */ - private $retryCount = 0; - - /** - * Default Constructor - * - * @param string $url - * @param string $method HTTP method (GET, POST etc) defaults to POST - * @param array $configs All Configurations - */ - public function __construct($url = null, $method = self::HTTP_POST, $configs = array()) - { - $this->url = $url; - $this->method = $method; - $this->curlOptions = $this->getHttpConstantsFromConfigs($configs, 'http.') + self::$defaultCurlOptions; - // Update the Cipher List based on OpenSSL or NSS settings - $curl = curl_version(); - $sslVersion = isset($curl['ssl_version']) ? $curl['ssl_version'] : ''; - if($sslVersion && substr_compare($sslVersion, "NSS/", 0, strlen("NSS/")) === 0) { - //Remove the Cipher List for NSS - $this->removeCurlOption(CURLOPT_SSL_CIPHER_LIST); - } - } - - /** - * Gets Url - * - * @return null|string - */ - public function getUrl() - { - return $this->url; - } - - /** - * Gets Method - * - * @return string - */ - public function getMethod() - { - return $this->method; - } - - /** - * Gets all Headers - * - * @return array - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * Get Header by Name - * - * @param $name - * @return string|null - */ - public function getHeader($name) - { - if (array_key_exists($name, $this->headers)) { - return $this->headers[$name]; - } - return null; - } - - /** - * Sets Url - * - * @param $url - */ - public function setUrl($url) - { - $this->url = $url; - } - - /** - * Set Headers - * - * @param array $headers - */ - public function setHeaders(array $headers = array()) - { - $this->headers = $headers; - } - - /** - * Adds a Header - * - * @param $name - * @param $value - * @param bool $overWrite allows you to override header value - */ - public function addHeader($name, $value, $overWrite = true) - { - if (!array_key_exists($name, $this->headers) || $overWrite) { - $this->headers[$name] = $value; - } else { - $this->headers[$name] = $this->headers[$name] . self::HEADER_SEPARATOR . $value; - } - } - - /** - * Removes a Header - * - * @param $name - */ - public function removeHeader($name) - { - unset($this->headers[$name]); - } - - /** - * Gets all curl options - * - * @return array - */ - public function getCurlOptions() - { - return $this->curlOptions; - } - - /** - * Add Curl Option - * - * @param string $name - * @param mixed $value - */ - public function addCurlOption($name, $value) - { - $this->curlOptions[$name] = $value; - } - - /** - * Removes a curl option from the list - * - * @param $name - */ - public function removeCurlOption($name) - { - unset($this->curlOptions[$name]); - } - - /** - * Set Curl Options. Overrides all curl options - * - * @param $options - */ - public function setCurlOptions($options) - { - $this->curlOptions = $options; - } - - /** - * Set ssl parameters for certificate based client authentication - * - * @param $certPath - * @param null $passPhrase - */ - public function setSSLCert($certPath, $passPhrase = null) - { - $this->curlOptions[CURLOPT_SSLCERT] = realpath($certPath); - if (isset($passPhrase) && trim($passPhrase) != "") { - $this->curlOptions[CURLOPT_SSLCERTPASSWD] = $passPhrase; - } - } - - /** - * Set connection timeout in seconds - * - * @param integer $timeout - */ - public function setHttpTimeout($timeout) - { - $this->curlOptions[CURLOPT_CONNECTTIMEOUT] = $timeout; - } - - /** - * Set HTTP proxy information - * - * @param string $proxy - * @throws PayPalConfigurationException - */ - public function setHttpProxy($proxy) - { - $urlParts = parse_url($proxy); - if ($urlParts == false || !array_key_exists("host", $urlParts)) { - throw new PayPalConfigurationException("Invalid proxy configuration " . $proxy); - } - $this->curlOptions[CURLOPT_PROXY] = $urlParts["host"]; - if (isset($urlParts["port"])) { - $this->curlOptions[CURLOPT_PROXY] .= ":" . $urlParts["port"]; - } - if (isset($urlParts["user"])) { - $this->curlOptions[CURLOPT_PROXYUSERPWD] = $urlParts["user"] . ":" . $urlParts["pass"]; - } - } - - /** - * Set Http Retry Counts - * - * @param int $retryCount - */ - public function setHttpRetryCount($retryCount) - { - $this->retryCount = $retryCount; - } - - /** - * Get Http Retry Counts - * - * @return int - */ - public function getHttpRetryCount() - { - return $this->retryCount; - } - - /** - * Sets the User-Agent string on the HTTP request - * - * @param string $userAgentString - */ - public function setUserAgent($userAgentString) - { - $this->curlOptions[CURLOPT_USERAGENT] = $userAgentString; - } - - /** - * Retrieves an array of constant key, and value based on Prefix - * - * @param array $configs - * @param $prefix - * @return array - */ - public function getHttpConstantsFromConfigs($configs = array(), $prefix) - { - $arr = array(); - if ($prefix != null && is_array($configs)) { - foreach ($configs as $k => $v) { - // Check if it startsWith - if (substr($k, 0, strlen($prefix)) === $prefix) { - $newKey = ltrim($k, $prefix); - if (defined($newKey)) { - $arr[constant($newKey)] = $v; - } - } - } - } - return $arr; - } -} diff --git a/paypal/PayPal/Core/PayPalHttpConnection.php b/paypal/PayPal/Core/PayPalHttpConnection.php deleted file mode 100644 index cf5253c..0000000 --- a/paypal/PayPal/Core/PayPalHttpConnection.php +++ /dev/null @@ -1,223 +0,0 @@ -httpConfig = $httpConfig; - $this->logger = PayPalLoggingManager::getInstance(__CLASS__); - } - - /** - * Gets all Http Headers - * - * @return array - */ - private function getHttpHeaders() - { - $ret = array(); - foreach ($this->httpConfig->getHeaders() as $k => $v) { - $ret[] = "$k: $v"; - } - return $ret; - } - - /** - * Parses the response headers for debugging. - * - * @param resource $ch - * @param string $data - * @return int - */ - protected function parseResponseHeaders($ch, $data) { - if (!$this->skippedHttpStatusLine) { - $this->skippedHttpStatusLine = true; - return strlen($data); - } - - $trimmedData = trim($data); - if (strlen($trimmedData) == 0) { - return strlen($data); - } - - // Added condition to ignore extra header which dont have colon ( : ) - if (strpos($trimmedData, ":") == false) { - return strlen($data); - } - - list($key, $value) = explode(":", $trimmedData, 2); - - $key = trim($key); - $value = trim($value); - - // This will skip over the HTTP Status Line and any other lines - // that don't look like header lines with values - if (strlen($key) > 0 && strlen($value) > 0) { - // This is actually a very basic way of looking at response headers - // and may miss a few repeated headers with different (appended) - // values but this should work for debugging purposes. - $this->responseHeaders[$key] = $value; - } - - return strlen($data); - } - - - /** - * Implodes a key/value array for printing. - * - * @param array $arr - * @return string - */ - protected function implodeArray($arr) { - $retStr = ''; - foreach($arr as $key => $value) { - $retStr .= $key . ': ' . $value . ', '; - } - rtrim($retStr, ', '); - return $retStr; - } - - /** - * Executes an HTTP request - * - * @param string $data query string OR POST content as a string - * @return mixed - * @throws PayPalConnectionException - */ - public function execute($data) - { - //Initialize the logger - $this->logger->info($this->httpConfig->getMethod() . ' ' . $this->httpConfig->getUrl()); - - //Initialize Curl Options - $ch = curl_init($this->httpConfig->getUrl()); - $options = $this->httpConfig->getCurlOptions(); - if (empty($options[CURLOPT_HTTPHEADER])) { - unset($options[CURLOPT_HTTPHEADER]); - } - curl_setopt_array($ch, $options); - curl_setopt($ch, CURLOPT_URL, $this->httpConfig->getUrl()); - curl_setopt($ch, CURLOPT_HEADER, false); - curl_setopt($ch, CURLINFO_HEADER_OUT, true); - curl_setopt($ch, CURLOPT_HTTPHEADER, $this->getHttpHeaders()); - - //Determine Curl Options based on Method - switch ($this->httpConfig->getMethod()) { - case 'POST': - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $data); - break; - case 'PUT': - case 'PATCH': - case 'DELETE': - curl_setopt($ch, CURLOPT_POSTFIELDS, $data); - break; - } - - //Default Option if Method not of given types in switch case - if ($this->httpConfig->getMethod() != null) { - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->httpConfig->getMethod()); - } - - $this->responseHeaders = array(); - $this->skippedHttpStatusLine = false; - curl_setopt($ch, CURLOPT_HEADERFUNCTION, array($this, 'parseResponseHeaders')); - - //Execute Curl Request - $result = curl_exec($ch); - //Retrieve Response Status - $httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); - - //Retry if Certificate Exception - if (curl_errno($ch) == 60) { - $this->logger->info("Invalid or no certificate authority found - Retrying using bundled CA certs file"); - curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem'); - $result = curl_exec($ch); - //Retrieve Response Status - $httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE); - } - - //Throw Exception if Retries and Certificates doenst work - if (curl_errno($ch)) { - $ex = new PayPalConnectionException( - $this->httpConfig->getUrl(), - curl_error($ch), - curl_errno($ch) - ); - curl_close($ch); - throw $ex; - } - - // Get Request and Response Headers - $requestHeaders = curl_getinfo($ch, CURLINFO_HEADER_OUT); - $this->logger->debug("Request Headers \t: " . str_replace("\r\n", ", ", $requestHeaders)); - $this->logger->debug(($data && $data != '' ? "Request Data\t\t: " . $data : "No Request Payload") . "\n" . str_repeat('-', 128) . "\n"); - $this->logger->info("Response Status \t: " . $httpStatus); - $this->logger->debug("Response Headers\t: " . $this->implodeArray($this->responseHeaders)); - - //Close the curl request - curl_close($ch); - - //More Exceptions based on HttpStatus Code - if ($httpStatus < 200 || $httpStatus >= 300) { - $ex = new PayPalConnectionException( - $this->httpConfig->getUrl(), - "Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}.", - $httpStatus - ); - $ex->setData($result); - $this->logger->error("Got Http response code $httpStatus when accessing {$this->httpConfig->getUrl()}. " . $result); - $this->logger->debug("\n\n" . str_repeat('=', 128) . "\n"); - throw $ex; - } - - $this->logger->debug(($result && $result != '' ? "Response Data \t: " . $result : "No Response Body") . "\n\n" . str_repeat('=', 128) . "\n"); - - //Return result object - return $result; - } -} diff --git a/paypal/PayPal/Core/PayPalLoggingManager.php b/paypal/PayPal/Core/PayPalLoggingManager.php deleted file mode 100644 index 90521a8..0000000 --- a/paypal/PayPal/Core/PayPalLoggingManager.php +++ /dev/null @@ -1,119 +0,0 @@ -getConfigHashmap(); - // Checks if custom factory defined, and is it an implementation of @PayPalLogFactory - $factory = array_key_exists('log.AdapterFactory', $config) && in_array('PayPal\Log\PayPalLogFactory', class_implements($config['log.AdapterFactory'])) ? $config['log.AdapterFactory'] : '\PayPal\Log\PayPalDefaultLogFactory'; - /** @var PayPalLogFactory $factoryInstance */ - $factoryInstance = new $factory(); - $this->logger = $factoryInstance->getLogger($loggerName); - $this->loggerName = $loggerName; - } - - /** - * Log Error - * - * @param string $message - */ - public function error($message) - { - $this->logger->error($message); - } - - /** - * Log Warning - * - * @param string $message - */ - public function warning($message) - { - $this->logger->warning($message); - } - - /** - * Log Info - * - * @param string $message - */ - public function info($message) - { - $this->logger->info($message); - } - - /** - * Log Fine - * - * @param string $message - */ - public function fine($message) - { - $this->info($message); - } - - /** - * Log Debug - * - * @param string $message - */ - public function debug($message) - { - $config = PayPalConfigManager::getInstance()->getConfigHashmap(); - // Disable debug in live mode. - if (array_key_exists('mode', $config) && $config['mode'] != 'live') { - $this->logger->debug($message); - } - } -} diff --git a/paypal/PayPal/Core/cacert.pem b/paypal/PayPal/Core/cacert.pem deleted file mode 100644 index 1202c20..0000000 --- a/paypal/PayPal/Core/cacert.pem +++ /dev/null @@ -1,171 +0,0 @@ -Verisign Class 3 Public Primary Certification Authority -======================================================= ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx -FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow -XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz -IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 -f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol -hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA -TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah -WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf -Tqj/ZA1k ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority - G2 -============================================================ ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT -MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz -dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT -MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz -dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCO -FoUgRm1HP9SFIIThbbP4pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71 -lSk8UOg013gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwIDAQAB -MA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSkU01UbSuvDV1Ai2TT -1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7iF6YM40AIOw7n60RzKprxaZLvcRTD -Oaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpYoJ2daZH9 ------END CERTIFICATE----- - - -Verisign Class 3 Public Primary Certification Authority - G3 -============================================================ ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy -dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1 -EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc -cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw -EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj -055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA -ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f -j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC -/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 -xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa -t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== ------END CERTIFICATE----- - -Verisign Class 4 Public Primary Certification Authority - G3 -============================================================ ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy -dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS -tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM -8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW -Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX -Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA -j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt -mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm -fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd -RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG -UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== ------END CERTIFICATE----- -VeriSign Class 3 Public Primary Certification Authority - G5 -============================================================ ------BEGIN CERTIFICATE----- -MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE -BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO -ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk -IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB -yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln -biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh -dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz -j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD -Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/ -Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r -fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/ -BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv -Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy -aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG -SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+ -X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE -KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC -Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE -ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq ------END CERTIFICATE----- -VeriSign Universal Root Certification Authority -=============================================== ------BEGIN CERTIFICATE----- -MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE -BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO -ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk -IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u -IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj -1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP -MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72 -9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I -AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR -tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G -CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O -a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud -DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 -Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx -Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx -P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P -wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 -mJO37M2CYfE45k+XmCpajQ== ------END CERTIFICATE----- - -VeriSign Class 3 Public Primary Certification Authority - G4 -============================================================ ------BEGIN CERTIFICATE----- -MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC -VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3 -b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz -ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj -YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL -MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU -cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo -b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8 -Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz -rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB -/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw -HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u -Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD -A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx -AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== ------END CERTIFICATE----- -Verisign Class 3 Public Primary Certification Authority -======================================================= ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx -FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow -XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz -IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 -f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol -hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky -CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX -bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/ -D/xwzoiQ ------END CERTIFICATE----- diff --git a/paypal/PayPal/Exception/PayPalConfigurationException.php b/paypal/PayPal/Exception/PayPalConfigurationException.php deleted file mode 100644 index 5105747..0000000 --- a/paypal/PayPal/Exception/PayPalConfigurationException.php +++ /dev/null @@ -1,23 +0,0 @@ -url = $url; - } - - /** - * Sets Data - * - * @param $data - */ - public function setData($data) - { - $this->data = $data; - } - - /** - * Gets Data - * - * @return string - */ - public function getData() - { - return $this->data; - } - - /** - * Gets Url - * - * @return string - */ - public function getUrl() - { - return $this->url; - } -} diff --git a/paypal/PayPal/Exception/PayPalInvalidCredentialException.php b/paypal/PayPal/Exception/PayPalInvalidCredentialException.php deleted file mode 100644 index 09ad27a..0000000 --- a/paypal/PayPal/Exception/PayPalInvalidCredentialException.php +++ /dev/null @@ -1,35 +0,0 @@ -getLine() . ' in ' . $this->getFile() - . ': ' . $this->getMessage() . ''; - return $errorMsg; - } -} diff --git a/paypal/PayPal/Exception/PayPalMissingCredentialException.php b/paypal/PayPal/Exception/PayPalMissingCredentialException.php deleted file mode 100644 index 6ace3b4..0000000 --- a/paypal/PayPal/Exception/PayPalMissingCredentialException.php +++ /dev/null @@ -1,36 +0,0 @@ -getLine() . ' in ' . $this->getFile() - . ': ' . $this->getMessage() . ''; - - return $errorMsg; - } -} diff --git a/paypal/PayPal/Handler/IPayPalHandler.php b/paypal/PayPal/Handler/IPayPalHandler.php deleted file mode 100644 index 0d1c8ff..0000000 --- a/paypal/PayPal/Handler/IPayPalHandler.php +++ /dev/null @@ -1,20 +0,0 @@ -apiContext = $apiContext; - } - - /** - * @param PayPalHttpConfig $httpConfig - * @param string $request - * @param mixed $options - * @return mixed|void - * @throws PayPalConfigurationException - * @throws PayPalInvalidCredentialException - * @throws PayPalMissingCredentialException - */ - public function handle($httpConfig, $request, $options) - { - $config = $this->apiContext->getConfig(); - - $httpConfig->setUrl( - rtrim(trim($this->_getEndpoint($config)), '/') . - (isset($options['path']) ? $options['path'] : '') - ); - - $headers = array( - "User-Agent" => PayPalUserAgent::getValue(PayPalConstants::SDK_NAME, PayPalConstants::SDK_VERSION), - "Authorization" => "Basic " . base64_encode($options['clientId'] . ":" . $options['clientSecret']), - "Accept" => "*/*" - ); - $httpConfig->setHeaders($headers); - - // Add any additional Headers that they may have provided - $headers = $this->apiContext->getRequestHeaders(); - foreach ($headers as $key => $value) { - $httpConfig->addHeader($key, $value); - } - } - - /** - * Get HttpConfiguration object for OAuth API - * - * @param array $config - * - * @return PayPalHttpConfig - * @throws \PayPal\Exception\PayPalConfigurationException - */ - private static function _getEndpoint($config) - { - if (isset($config['oauth.EndPoint'])) { - $baseEndpoint = $config['oauth.EndPoint']; - } elseif (isset($config['service.EndPoint'])) { - $baseEndpoint = $config['service.EndPoint']; - } elseif (isset($config['mode'])) { - switch (strtoupper($config['mode'])) { - case 'SANDBOX': - $baseEndpoint = PayPalConstants::REST_SANDBOX_ENDPOINT; - break; - case 'LIVE': - $baseEndpoint = PayPalConstants::REST_LIVE_ENDPOINT; - break; - default: - throw new PayPalConfigurationException('The mode config parameter must be set to either sandbox/live'); - } - } else { - // Defaulting to Sandbox - $baseEndpoint = PayPalConstants::REST_SANDBOX_ENDPOINT; - } - - $baseEndpoint = rtrim(trim($baseEndpoint), '/') . "/v1/oauth2/token"; - - return $baseEndpoint; - } -} diff --git a/paypal/PayPal/Handler/RestHandler.php b/paypal/PayPal/Handler/RestHandler.php deleted file mode 100644 index 6bc55ae..0000000 --- a/paypal/PayPal/Handler/RestHandler.php +++ /dev/null @@ -1,124 +0,0 @@ -apiContext = $apiContext; - } - - /** - * @param PayPalHttpConfig $httpConfig - * @param string $request - * @param mixed $options - * @return mixed|void - * @throws PayPalConfigurationException - * @throws PayPalInvalidCredentialException - * @throws PayPalMissingCredentialException - */ - public function handle($httpConfig, $request, $options) - { - $credential = $this->apiContext->getCredential(); - $config = $this->apiContext->getConfig(); - - if ($credential == null) { - // Try picking credentials from the config file - $credMgr = PayPalCredentialManager::getInstance($config); - $credValues = $credMgr->getCredentialObject(); - - if (!is_array($credValues)) { - throw new PayPalMissingCredentialException("Empty or invalid credentials passed"); - } - - $credential = new OAuthTokenCredential($credValues['clientId'], $credValues['clientSecret']); - } - - if ($credential == null || !($credential instanceof OAuthTokenCredential)) { - throw new PayPalInvalidCredentialException("Invalid credentials passed"); - } - - $httpConfig->setUrl( - rtrim(trim($this->_getEndpoint($config)), '/') . - (isset($options['path']) ? $options['path'] : '') - ); - - // Overwrite Expect Header to disable 100 Continue Issue - $httpConfig->addHeader("Expect", null); - - if (!array_key_exists("User-Agent", $httpConfig->getHeaders())) { - $httpConfig->addHeader("User-Agent", PayPalUserAgent::getValue(PayPalConstants::SDK_NAME, PayPalConstants::SDK_VERSION)); - } - - if (!is_null($credential) && $credential instanceof OAuthTokenCredential && is_null($httpConfig->getHeader('Authorization'))) { - $httpConfig->addHeader('Authorization', "Bearer " . $credential->getAccessToken($config), false); - } - - if (($httpConfig->getMethod() == 'POST' || $httpConfig->getMethod() == 'PUT') && !is_null($this->apiContext->getRequestId())) { - $httpConfig->addHeader('PayPal-Request-Id', $this->apiContext->getRequestId()); - } - // Add any additional Headers that they may have provided - $headers = $this->apiContext->getRequestHeaders(); - foreach ($headers as $key => $value) { - $httpConfig->addHeader($key, $value); - } - } - - /** - * End Point - * - * @param array $config - * - * @return string - * @throws \PayPal\Exception\PayPalConfigurationException - */ - private function _getEndpoint($config) - { - if (isset($config['service.EndPoint'])) { - return $config['service.EndPoint']; - } elseif (isset($config['mode'])) { - switch (strtoupper($config['mode'])) { - case 'SANDBOX': - return PayPalConstants::REST_SANDBOX_ENDPOINT; - break; - case 'LIVE': - return PayPalConstants::REST_LIVE_ENDPOINT; - break; - default: - throw new PayPalConfigurationException('The mode config parameter must be set to either sandbox/live'); - break; - } - } else { - // Defaulting to Sandbox - return PayPalConstants::REST_SANDBOX_ENDPOINT; - } - } -} diff --git a/paypal/PayPal/LICENSE b/paypal/PayPal/LICENSE deleted file mode 100644 index 967c3e9..0000000 --- a/paypal/PayPal/LICENSE +++ /dev/null @@ -1,171 +0,0 @@ -The PayPal PHP SDK is released under the following license: - - Copyright (c) 2013-2016 PAYPAL, INC. - - SDK LICENSE - - NOTICE TO USER: PayPal, Inc. is providing the Software and Documentation for use under the terms of - this Agreement. Any use, reproduction, modification or distribution of the Software or Documentation, - or any derivatives or portions hereof, constitutes your acceptance of this Agreement. - - As used in this Agreement, "PayPal" means PayPal, Inc. "Software" means the software code accompanying - this agreement. "Documentation" means the documents, specifications and all other items accompanying - this Agreement other than the Software. - - 1. LICENSE GRANT Subject to the terms of this Agreement, PayPal hereby grants you a non-exclusive, - worldwide, royalty free license to use, reproduce, prepare derivative works from, publicly display, - publicly perform, distribute and sublicense the Software for any purpose, provided the copyright notice - below appears in a conspicuous location within the source code of the distributed Software and this - license is distributed in the supporting documentation of the Software you distribute. Furthermore, - you must comply with all third party licenses in order to use the third party software contained in the - Software. - - Subject to the terms of this Agreement, PayPal hereby grants you a non-exclusive, worldwide, royalty free - license to use, reproduce, publicly display, publicly perform, distribute and sublicense the Documentation - for any purpose. You may not modify the Documentation. - - No title to the intellectual property in the Software or Documentation is transferred to you under the - terms of this Agreement. You do not acquire any rights to the Software or the Documentation except as - expressly set forth in this Agreement. - - If you choose to distribute the Software in a commercial product, you do so with the understanding that - you agree to defend, indemnify and hold harmless PayPal and its suppliers against any losses, damages and - costs arising from the claims, lawsuits or other legal actions arising out of such distribution. You may - distribute the Software in object code form under your own license, provided that your license agreement: - - (a) complies with the terms and conditions of this license agreement; - - (b) effectively disclaims all warranties and conditions, express or implied, on behalf of PayPal; - - (c) effectively excludes all liability for damages on behalf of PayPal; - - (d) states that any provisions that differ from this Agreement are offered by you alone and not PayPal; and - - (e) states that the Software is available from you or PayPal and informs licensees how to obtain it in a - reasonable manner on or through a medium customarily used for software exchange. - - 2. DISCLAIMER OF WARRANTY - PAYPAL LICENSES THE SOFTWARE AND DOCUMENTATION TO YOU ONLY ON AN "AS IS" BASIS WITHOUT WARRANTIES OR CONDITIONS - OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY WARRANTIES OR CONDITIONS OF TITLE, - NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. PAYPAL MAKES NO WARRANTY THAT THE - SOFTWARE OR DOCUMENTATION WILL BE ERROR-FREE. Each user of the Software or Documentation is solely responsible - for determining the appropriateness of using and distributing the Software and Documentation and assumes all - risks associated with its exercise of rights under this Agreement, including but not limited to the risks and - costs of program errors, compliance with applicable laws, damage to or loss of data, programs, or equipment, - and unavailability or interruption of operations. Use of the Software and Documentation is made with the - understanding that PayPal will not provide you with any technical or customer support or maintenance. Some - states or jurisdictions do not allow the exclusion of implied warranties or limitations on how long an implied - warranty may last, so the above limitations may not apply to you. To the extent permissible, any implied - warranties are limited to ninety (90) days. - - - 3. LIMITATION OF LIABILITY - PAYPAL AND ITS SUPPLIERS SHALL NOT BE LIABLE FOR LOSS OR DAMAGE ARISING OUT OF THIS AGREEMENT OR FROM THE USE - OF THE SOFTWARE OR DOCUMENTATION. IN NO EVENT WILL PAYPAL OR ITS SUPPLIERS BE LIABLE TO YOU OR ANY THIRD PARTY - FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR SPECIAL DAMAGES INCLUDING LOST PROFITS, LOST SAVINGS, - COSTS, FEES, OR EXPENSES OF ANY KIND ARISING OUT OF ANY PROVISION OF THIS AGREEMENT OR THE USE OR THE INABILITY - TO USE THE SOFTWARE OR DOCUMENTATION, HOWEVER CAUSED AND UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - PAYPAL'S AGGREGATE LIABILITY AND THAT OF ITS SUPPLIERS UNDER OR IN CONNECTION WITH THIS AGREEMENT SHALL BE - LIMITED TO THE AMOUNT PAID BY YOU FOR THE SOFTWARE AND DOCUMENTATION. - - 4. TRADEMARK USAGE - PayPal is a trademark PayPal, Inc. in the United States and other countries. Such trademarks may not be used - to endorse or promote any product unless expressly permitted under separate agreement with PayPal. - - 5. TERM - Your rights under this Agreement shall terminate if you fail to comply with any of the material terms or - conditions of this Agreement and do not cure such failure in a reasonable period of time after becoming - aware of such noncompliance. If all your rights under this Agreement terminate, you agree to cease use - and distribution of the Software and Documentation as soon as reasonably practicable. - - 6. GOVERNING LAW AND JURISDICTION. This Agreement is governed by the statutes and laws of the State of - California, without regard to the conflicts of law principles thereof. If any part of this Agreement is - found void and unenforceable, it will not affect the validity of the balance of the Agreement, which shall - remain valid and enforceable according to its terms. Any dispute arising out of or related to this Agreement - shall be brought in the courts of Santa Clara County, California, USA. The PayPal PHP SDK is released under the following license: - - Copyright (c) 2013-2016 PAYPAL, INC. - - SDK LICENSE - - NOTICE TO USER: PayPal, Inc. is providing the Software and Documentation for use under the terms of - this Agreement. Any use, reproduction, modification or distribution of the Software or Documentation, - or any derivatives or portions hereof, constitutes your acceptance of this Agreement. - - As used in this Agreement, "PayPal" means PayPal, Inc. "Software" means the software code accompanying - this agreement. "Documentation" means the documents, specifications and all other items accompanying - this Agreement other than the Software. - - 1. LICENSE GRANT Subject to the terms of this Agreement, PayPal hereby grants you a non-exclusive, - worldwide, royalty free license to use, reproduce, prepare derivative works from, publicly display, - publicly perform, distribute and sublicense the Software for any purpose, provided the copyright notice - below appears in a conspicuous location within the source code of the distributed Software and this - license is distributed in the supporting documentation of the Software you distribute. Furthermore, - you must comply with all third party licenses in order to use the third party software contained in the - Software. - - Subject to the terms of this Agreement, PayPal hereby grants you a non-exclusive, worldwide, royalty free - license to use, reproduce, publicly display, publicly perform, distribute and sublicense the Documentation - for any purpose. You may not modify the Documentation. - - No title to the intellectual property in the Software or Documentation is transferred to you under the - terms of this Agreement. You do not acquire any rights to the Software or the Documentation except as - expressly set forth in this Agreement. - - If you choose to distribute the Software in a commercial product, you do so with the understanding that - you agree to defend, indemnify and hold harmless PayPal and its suppliers against any losses, damages and - costs arising from the claims, lawsuits or other legal actions arising out of such distribution. You may - distribute the Software in object code form under your own license, provided that your license agreement: - - (a) complies with the terms and conditions of this license agreement; - - (b) effectively disclaims all warranties and conditions, express or implied, on behalf of PayPal; - - (c) effectively excludes all liability for damages on behalf of PayPal; - - (d) states that any provisions that differ from this Agreement are offered by you alone and not PayPal; and - - (e) states that the Software is available from you or PayPal and informs licensees how to obtain it in a - reasonable manner on or through a medium customarily used for software exchange. - - 2. DISCLAIMER OF WARRANTY - PAYPAL LICENSES THE SOFTWARE AND DOCUMENTATION TO YOU ONLY ON AN "AS IS" BASIS WITHOUT WARRANTIES OR CONDITIONS - OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY WARRANTIES OR CONDITIONS OF TITLE, - NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. PAYPAL MAKES NO WARRANTY THAT THE - SOFTWARE OR DOCUMENTATION WILL BE ERROR-FREE. Each user of the Software or Documentation is solely responsible - for determining the appropriateness of using and distributing the Software and Documentation and assumes all - risks associated with its exercise of rights under this Agreement, including but not limited to the risks and - costs of program errors, compliance with applicable laws, damage to or loss of data, programs, or equipment, - and unavailability or interruption of operations. Use of the Software and Documentation is made with the - understanding that PayPal will not provide you with any technical or customer support or maintenance. Some - states or jurisdictions do not allow the exclusion of implied warranties or limitations on how long an implied - warranty may last, so the above limitations may not apply to you. To the extent permissible, any implied - warranties are limited to ninety (90) days. - - - 3. LIMITATION OF LIABILITY - PAYPAL AND ITS SUPPLIERS SHALL NOT BE LIABLE FOR LOSS OR DAMAGE ARISING OUT OF THIS AGREEMENT OR FROM THE USE - OF THE SOFTWARE OR DOCUMENTATION. IN NO EVENT WILL PAYPAL OR ITS SUPPLIERS BE LIABLE TO YOU OR ANY THIRD PARTY - FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, INCIDENTAL, OR SPECIAL DAMAGES INCLUDING LOST PROFITS, LOST SAVINGS, - COSTS, FEES, OR EXPENSES OF ANY KIND ARISING OUT OF ANY PROVISION OF THIS AGREEMENT OR THE USE OR THE INABILITY - TO USE THE SOFTWARE OR DOCUMENTATION, HOWEVER CAUSED AND UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY OR TORT INCLUDING NEGLIGENCE OR OTHERWISE), EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - PAYPAL'S AGGREGATE LIABILITY AND THAT OF ITS SUPPLIERS UNDER OR IN CONNECTION WITH THIS AGREEMENT SHALL BE - LIMITED TO THE AMOUNT PAID BY YOU FOR THE SOFTWARE AND DOCUMENTATION. - - 4. TRADEMARK USAGE - PayPal is a trademark PayPal, Inc. in the United States and other countries. Such trademarks may not be used - to endorse or promote any product unless expressly permitted under separate agreement with PayPal. - - 5. TERM - Your rights under this Agreement shall terminate if you fail to comply with any of the material terms or - conditions of this Agreement and do not cure such failure in a reasonable period of time after becoming - aware of such noncompliance. If all your rights under this Agreement terminate, you agree to cease use - and distribution of the Software and Documentation as soon as reasonably practicable. - - 6. GOVERNING LAW AND JURISDICTION. This Agreement is governed by the statutes and laws of the State of - California, without regard to the conflicts of law principles thereof. If any part of this Agreement is - found void and unenforceable, it will not affect the validity of the balance of the Agreement, which shall - remain valid and enforceable according to its terms. Any dispute arising out of or related to this Agreement - shall be brought in the courts of Santa Clara County, California, USA. diff --git a/paypal/PayPal/Log/PayPalDefaultLogFactory.php b/paypal/PayPal/Log/PayPalDefaultLogFactory.php deleted file mode 100644 index 3066810..0000000 --- a/paypal/PayPal/Log/PayPalDefaultLogFactory.php +++ /dev/null @@ -1,26 +0,0 @@ -loggerName = $className; - $this->initialize(); - } - - public function initialize() - { - $config = PayPalConfigManager::getInstance()->getConfigHashmap(); - if (!empty($config)) { - $this->isLoggingEnabled = (array_key_exists('log.LogEnabled', $config) && $config['log.LogEnabled'] == '1'); - if ($this->isLoggingEnabled) { - $this->loggerFile = ($config['log.FileName']) ? $config['log.FileName'] : ini_get('error_log'); - $loggingLevel = strtoupper($config['log.LogLevel']); - $this->loggingLevel = (isset($loggingLevel) && defined("\\Psr\\Log\\LogLevel::$loggingLevel")) ? - constant("\\Psr\\Log\\LogLevel::$loggingLevel") : - LogLevel::INFO; - } - } - } - - public function log($level, $message, array $context = array()) - { - if ($this->isLoggingEnabled) { - // Checks if the message is at level below configured logging level - if (array_search($level, $this->loggingLevels) <= array_search($this->loggingLevel, $this->loggingLevels)) { - error_log("[" . date('d-m-Y H:i:s') . "] " . $this->loggerName . " : " . strtoupper($level) . ": $message\n", 3, $this->loggerFile); - } - } - } -} diff --git a/paypal/PayPal/Rest/ApiContext.php b/paypal/PayPal/Rest/ApiContext.php deleted file mode 100644 index bbe3752..0000000 --- a/paypal/PayPal/Rest/ApiContext.php +++ /dev/null @@ -1,173 +0,0 @@ -requestId = $requestId; - $this->credential = $credential; - } - - /** - * Get Credential - * - * @return \PayPal\Auth\OAuthTokenCredential - */ - public function getCredential() - { - if ($this->credential == null) { - return PayPalCredentialManager::getInstance()->getCredentialObject(); - } - return $this->credential; - } - - public function getRequestHeaders() - { - $result = PayPalConfigManager::getInstance()->get('http.headers'); - $headers = array(); - foreach ($result as $header => $value) { - $headerName = ltrim($header, 'http.headers'); - $headers[$headerName] = $value; - } - return $headers; - } - - public function addRequestHeader($name, $value) - { - // Determine if the name already has a 'http.headers' prefix. If not, add one. - if (!(substr($name, 0, strlen('http.headers')) === 'http.headers')) { - $name = 'http.headers.' . $name; - } - PayPalConfigManager::getInstance()->addConfigs(array($name => $value)); - } - - /** - * Get Request ID - * - * @return string - */ - public function getRequestId() - { - return $this->requestId; - } - - /** - * Sets the request ID - * - * @param string $requestId the PayPal-Request-Id value to use - */ - public function setRequestId($requestId) - { - $this->requestId = $requestId; - } - - /** - * Resets the requestId that can be used to set the PayPal-request-id - * header used for idempotency. In cases where you need to make multiple create calls - * using the same ApiContext object, you need to reset request Id. - * @deprecated Call setRequestId with a unique value. - * - * @return string - */ - public function resetRequestId() - { - $this->requestId = $this->generateRequestId(); - return $this->getRequestId(); - } - - /** - * Sets Config - * - * @param array $config SDK configuration parameters - */ - public function setConfig(array $config) - { - PayPalConfigManager::getInstance()->addConfigs($config); - } - - /** - * Gets Configurations - * - * @return array - */ - public function getConfig() - { - return PayPalConfigManager::getInstance()->getConfigHashmap(); - } - - /** - * Gets a specific configuration from key - * - * @param $searchKey - * @return mixed - */ - public function get($searchKey) - { - return PayPalConfigManager::getInstance()->get($searchKey); - } - - /** - * Generates a unique per request id that - * can be used to set the PayPal-Request-Id header - * that is used for idempotency - * @deprecated - * - * @return string - */ - private function generateRequestId() - { - static $pid = -1; - static $addr = -1; - - if ($pid == -1) { - $pid = getmypid(); - } - - if ($addr == -1) { - if (array_key_exists('SERVER_ADDR', $_SERVER)) { - $addr = ip2long($_SERVER['SERVER_ADDR']); - } else { - $addr = php_uname('n'); - } - } - - return $addr . $pid . $_SERVER['REQUEST_TIME'] . mt_rand(0, 0xffff); - } -} diff --git a/paypal/PayPal/Rest/IResource.php b/paypal/PayPal/Rest/IResource.php deleted file mode 100644 index 281ac47..0000000 --- a/paypal/PayPal/Rest/IResource.php +++ /dev/null @@ -1,12 +0,0 @@ -secretKey = $secretKey; - } - - /** - * Encrypts the input text using the cipher key - * - * @param $input - * @return string - */ - public function encrypt($input) - { - // Create a random IV. Not using mcrypt to generate one, as to not have a dependency on it. - $iv = substr(uniqid("", true), 0, Cipher::IV_SIZE); - // Encrypt the data - $encrypted = openssl_encrypt($input, "AES-256-CBC", $this->secretKey, 0, $iv); - // Encode the data with IV as prefix - return base64_encode($iv . $encrypted); - } - - /** - * Decrypts the input text from the cipher key - * - * @param $input - * @return string - */ - public function decrypt($input) - { - // Decode the IV + data - $input = base64_decode($input); - // Remove the IV - $iv = substr($input, 0, Cipher::IV_SIZE); - // Return Decrypted Data - return openssl_decrypt(substr($input, Cipher::IV_SIZE), "AES-256-CBC", $this->secretKey, 0, $iv); - } -} diff --git a/paypal/PayPal/Transport/PayPalRestCall.php b/paypal/PayPal/Transport/PayPalRestCall.php deleted file mode 100644 index a505959..0000000 --- a/paypal/PayPal/Transport/PayPalRestCall.php +++ /dev/null @@ -1,82 +0,0 @@ -apiContext = $apiContext; - $this->logger = PayPalLoggingManager::getInstance(__CLASS__); - } - - /** - * @param array $handlers Array of handlers - * @param string $path Resource path relative to base service endpoint - * @param string $method HTTP method - one of GET, POST, PUT, DELETE, PATCH etc - * @param string $data Request payload - * @param array $headers HTTP headers - * @return mixed - * @throws \PayPal\Exception\PayPalConnectionException - */ - public function execute($handlers = array(), $path, $method, $data = '', $headers = array()) - { - $config = $this->apiContext->getConfig(); - $httpConfig = new PayPalHttpConfig(null, $method, $config); - $headers = $headers ? $headers : array(); - $httpConfig->setHeaders($headers + - array( - 'Content-Type' => 'application/json' - ) - ); - - // if proxy set via config, add it - if (!empty($config['http.Proxy'])) { - $httpConfig->setHttpProxy($config['http.Proxy']); - } - - /** @var \Paypal\Handler\IPayPalHandler $handler */ - foreach ($handlers as $handler) { - if (!is_object($handler)) { - $fullHandler = "\\" . (string)$handler; - $handler = new $fullHandler($this->apiContext); - } - $handler->handle($httpConfig, $data, array('path' => $path, 'apiContext' => $this->apiContext)); - } - $connection = new PayPalHttpConnection($httpConfig, $config); - $response = $connection->execute($data); - - return $response; - } -} diff --git a/paypal/PayPal/Validation/ArgumentValidator.php b/paypal/PayPal/Validation/ArgumentValidator.php deleted file mode 100644 index 29e7fa3..0000000 --- a/paypal/PayPal/Validation/ArgumentValidator.php +++ /dev/null @@ -1,32 +0,0 @@ - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/zbar/zbar.wasm b/zbar/zbar.wasm deleted file mode 100644 index f127b3e..0000000 Binary files a/zbar/zbar.wasm and /dev/null differ diff --git a/zbar/zbarIndex.js b/zbar/zbarIndex.js deleted file mode 100644 index 7e00361..0000000 --- a/zbar/zbarIndex.js +++ /dev/null @@ -1,16 +0,0 @@ -var zbarWasm=function(t){"use strict"; -/*! ***************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */function e(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))}function n(t){var e=t.default;if("function"==typeof e){var n=function(){return e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})})),n}var r={exports:{}};const i=n(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));function o(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}var a=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,s=function(t){return a.exec(t).slice(1)};function u(){for(var t="",e=!1,n=arguments.length-1;n>=-1&&!e;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(t=r+"/"+t,e="/"===r.charAt(0))}return(e?"/":"")+(t=o(d(t.split("/"),(function(t){return!!t})),!e).join("/"))||"."}function c(t){var e=f(t),n="/"===y(t,-1);return(t=o(d(t.split("/"),(function(t){return!!t})),!e).join("/"))||e||(t="."),t&&n&&(t+="/"),(e?"/":"")+t}function f(t){return"/"===t.charAt(0)}function l(){var t=Array.prototype.slice.call(arguments,0);return c(d(t,(function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))}function _(t,e){function n(t){for(var e=0;e=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=u(t).substr(1),e=u(e).substr(1);for(var r=n(t.split("/")),i=n(e.split("/")),o=Math.min(r.length,i.length),a=o,s=0;s(t=U(t)?new URL(t):m.normalize(t),p.readFileSync(t,e?void 0:"utf8")),c=t=>{var e=s(t,!0);return e.buffer||(e=new Uint8Array(e)),e},u=(t,e,n)=>{t=U(t)?new URL(t):m.normalize(t),p.readFile(t,(function(t,r){t?n(t):e(r.buffer)}))},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",(function(t){if(!(t instanceof H))throw t})),process.on("unhandledRejection",(function(t){throw t})),a.inspect=function(){return"[Emscripten Module object]"}}else(l||_)&&(_?h=self.location.href:"undefined"!=typeof document&&document.currentScript&&(h=document.currentScript.src),n&&(h=n),h=0!==h.indexOf("blob:")?h.substr(0,h.replace(/[?#].*/,"").lastIndexOf("/")+1):"",s=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},_&&(c=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),u=(t,e,n)=>{var r=new XMLHttpRequest;r.open("GET",t,!0),r.responseType="arraybuffer",r.onload=()=>{200==r.status||0==r.status&&r.response?e(r.response):n()},r.onerror=n,r.send(null)});var d,y,g=a.print||console.log.bind(console),B=a.printErr||console.warn.bind(console);Object.assign(a,f),f=null,a.arguments&&a.arguments,a.thisProgram&&a.thisProgram,a.quit&&a.quit,a.wasmBinary&&(d=a.wasmBinary),a.noExitRuntime,"object"!=typeof WebAssembly&&D("no native wasm support detected");var v,E,Z=!1,b="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function I(){var t=y.buffer;a.HEAP8=new Int8Array(t),a.HEAP16=new Int16Array(t),a.HEAP32=new Int32Array(t),a.HEAPU8=v=new Uint8Array(t),a.HEAPU16=new Uint16Array(t),a.HEAPU32=E=new Uint32Array(t),a.HEAPF32=new Float32Array(t),a.HEAPF64=new Float64Array(t)}a.INITIAL_MEMORY;var S,C,w=[],N=[],T=[],O=0,P=null;function D(t){a.onAbort&&a.onAbort(t),B(t="Aborted("+t+")"),Z=!0,t+=". Build with -sASSERTIONS for more info.";var e=new WebAssembly.RuntimeError(t);throw r(e),e}function F(t){return t.startsWith("data:application/octet-stream;base64,")}function U(t){return t.startsWith("file://")}function G(t){try{if(t==S&&d)return new Uint8Array(d);if(c)return c(t);throw"both async and sync fetching of the wasm failed"}catch(t){D(t)}}function H(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function M(t){for(;t.length>0;)t.shift()(a)}function x(t){var e=y.buffer;try{return y.grow(t-e.byteLength+65535>>>16),I(),1}catch(t){}}F(S="zbar.wasm")||(C=S,S=a.locateFile?a.locateFile(C,h):h+C);var j=[null,[],[]];function L(t,e){var n=j[t];0===e||10===e?((1===t?g:B)(function(t,e,n){for(var r=e+n,i=e;t[i]&&!(i>=r);)++i;if(i-e>16&&t.buffer&&b)return b.decode(t.subarray(e,i));for(var o="";e>10,56320|1023&c)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o}(n,0)),n.length=0):n.push(e)}var k,W={d:function(){return!0},e:function(){return Date.now()},c:function(t){var e,n,r=v.length,i=2147483648;if((t>>>=0)>i)return!1;for(var o=1;o<=4;o*=2){var a=r*(1+.2/o);if(a=Math.min(a,t+100663296),x(Math.min(i,(e=Math.max(t,a))+((n=65536)-e%n)%n)))return!0}return!1},f:function(t){return 52},b:function(t,e,n,r,i){return 70},a:function(t,e,n,r){for(var i=0,o=0;o>2],s=E[e+4>>2];e+=8;for(var u=0;u>2]=i,0}};function Y(t){function n(){k||(k=!0,a.calledRun=!0,Z||(M(N),e(a),a.onRuntimeInitialized&&a.onRuntimeInitialized(),function(){if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)t=a.postRun.shift(),T.unshift(t);var t;M(T)}()))}O>0||(function(){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)t=a.preRun.shift(),w.unshift(t);var t;M(w)}(),O>0||(a.setStatus?(a.setStatus("Running..."),setTimeout((function(){setTimeout((function(){a.setStatus("")}),1),n()}),1)):n()))}if(function(){var t={a:W};function e(t,e){var n,r=t.exports;a.asm=r,y=a.asm.g,I(),a.asm.s,n=a.asm.h,N.unshift(n),function(t){if(O--,a.monitorRunDependencies&&a.monitorRunDependencies(O),0==O&&P){var e=P;P=null,e()}}()}function n(t){e(t.instance)}function i(e){return function(){if(!d&&(l||_)){if("function"==typeof fetch&&!U(S))return fetch(S,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+S+"'";return t.arrayBuffer()})).catch((function(){return G(S)}));if(u)return new Promise((function(t,e){u(S,(function(e){t(new Uint8Array(e))}),e)}))}return Promise.resolve().then((function(){return G(S)}))}().then((function(e){return WebAssembly.instantiate(e,t)})).then((function(t){return t})).then(e,(function(t){B("failed to asynchronously prepare wasm: "+t),D(t)}))}if(O++,a.monitorRunDependencies&&a.monitorRunDependencies(O),a.instantiateWasm)try{return a.instantiateWasm(t,e)}catch(t){B("Module.instantiateWasm callback failed with error: "+t),r(t)}(d||"function"!=typeof WebAssembly.instantiateStreaming||F(S)||U(S)||A||"function"!=typeof fetch?i(n):fetch(S,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(n,(function(t){return B("wasm streaming compile failed: "+t),B("falling back to ArrayBuffer instantiation"),i(n)}))}))).catch(r)}(),a.___wasm_call_ctors=function(){return(a.___wasm_call_ctors=a.asm.h).apply(null,arguments)},a._ImageScanner_create=function(){return(a._ImageScanner_create=a.asm.i).apply(null,arguments)},a._ImageScanner_destory=function(){return(a._ImageScanner_destory=a.asm.j).apply(null,arguments)},a._ImageScanner_set_config=function(){return(a._ImageScanner_set_config=a.asm.k).apply(null,arguments)},a._ImageScanner_enable_cache=function(){return(a._ImageScanner_enable_cache=a.asm.l).apply(null,arguments)},a._ImageScanner_recycle_image=function(){return(a._ImageScanner_recycle_image=a.asm.m).apply(null,arguments)},a._ImageScanner_get_results=function(){return(a._ImageScanner_get_results=a.asm.n).apply(null,arguments)},a._ImageScanner_scan=function(){return(a._ImageScanner_scan=a.asm.o).apply(null,arguments)},a._Image_create=function(){return(a._Image_create=a.asm.p).apply(null,arguments)},a._Image_destory=function(){return(a._Image_destory=a.asm.q).apply(null,arguments)},a._Image_get_symbols=function(){return(a._Image_get_symbols=a.asm.r).apply(null,arguments)},a._free=function(){return(a._free=a.asm.t).apply(null,arguments)},a._malloc=function(){return(a._malloc=a.asm.u).apply(null,arguments)},P=function t(){k||Y(),k||(P=t)},a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);a.preInit.length>0;)a.preInit.pop()();return Y(),o.ready});t.exports=r}(r);const g=r.exports;let B;const v=e(void 0,void 0,void 0,(function*(){if(B=yield g(),!B)throw Error("WASM was not loaded");return B})),E=()=>e(void 0,void 0,void 0,(function*(){return yield v}));var Z,b,I;t.ZBarSymbolType=void 0,(Z=t.ZBarSymbolType||(t.ZBarSymbolType={}))[Z.ZBAR_NONE=0]="ZBAR_NONE",Z[Z.ZBAR_PARTIAL=1]="ZBAR_PARTIAL",Z[Z.ZBAR_EAN2=2]="ZBAR_EAN2",Z[Z.ZBAR_EAN5=5]="ZBAR_EAN5",Z[Z.ZBAR_EAN8=8]="ZBAR_EAN8",Z[Z.ZBAR_UPCE=9]="ZBAR_UPCE",Z[Z.ZBAR_ISBN10=10]="ZBAR_ISBN10",Z[Z.ZBAR_UPCA=12]="ZBAR_UPCA",Z[Z.ZBAR_EAN13=13]="ZBAR_EAN13",Z[Z.ZBAR_ISBN13=14]="ZBAR_ISBN13",Z[Z.ZBAR_COMPOSITE=15]="ZBAR_COMPOSITE",Z[Z.ZBAR_I25=25]="ZBAR_I25",Z[Z.ZBAR_DATABAR=34]="ZBAR_DATABAR",Z[Z.ZBAR_DATABAR_EXP=35]="ZBAR_DATABAR_EXP",Z[Z.ZBAR_CODABAR=38]="ZBAR_CODABAR",Z[Z.ZBAR_CODE39=39]="ZBAR_CODE39",Z[Z.ZBAR_PDF417=57]="ZBAR_PDF417",Z[Z.ZBAR_QRCODE=64]="ZBAR_QRCODE",Z[Z.ZBAR_SQCODE=80]="ZBAR_SQCODE",Z[Z.ZBAR_CODE93=93]="ZBAR_CODE93",Z[Z.ZBAR_CODE128=128]="ZBAR_CODE128",Z[Z.ZBAR_SYMBOL=255]="ZBAR_SYMBOL",Z[Z.ZBAR_ADDON2=512]="ZBAR_ADDON2",Z[Z.ZBAR_ADDON5=1280]="ZBAR_ADDON5",Z[Z.ZBAR_ADDON=1792]="ZBAR_ADDON",t.ZBarConfigType=void 0,(b=t.ZBarConfigType||(t.ZBarConfigType={}))[b.ZBAR_CFG_ENABLE=0]="ZBAR_CFG_ENABLE",b[b.ZBAR_CFG_ADD_CHECK=1]="ZBAR_CFG_ADD_CHECK",b[b.ZBAR_CFG_EMIT_CHECK=2]="ZBAR_CFG_EMIT_CHECK",b[b.ZBAR_CFG_ASCII=3]="ZBAR_CFG_ASCII",b[b.ZBAR_CFG_BINARY=4]="ZBAR_CFG_BINARY",b[b.ZBAR_CFG_NUM=5]="ZBAR_CFG_NUM",b[b.ZBAR_CFG_MIN_LEN=32]="ZBAR_CFG_MIN_LEN",b[b.ZBAR_CFG_MAX_LEN=33]="ZBAR_CFG_MAX_LEN",b[b.ZBAR_CFG_UNCERTAINTY=64]="ZBAR_CFG_UNCERTAINTY",b[b.ZBAR_CFG_POSITION=128]="ZBAR_CFG_POSITION",b[b.ZBAR_CFG_TEST_INVERTED=129]="ZBAR_CFG_TEST_INVERTED",b[b.ZBAR_CFG_X_DENSITY=256]="ZBAR_CFG_X_DENSITY",b[b.ZBAR_CFG_Y_DENSITY=257]="ZBAR_CFG_Y_DENSITY",t.ZBarOrientation=void 0,(I=t.ZBarOrientation||(t.ZBarOrientation={}))[I.ZBAR_ORIENT_UNKNOWN=-1]="ZBAR_ORIENT_UNKNOWN",I[I.ZBAR_ORIENT_UP=0]="ZBAR_ORIENT_UP",I[I.ZBAR_ORIENT_RIGHT=1]="ZBAR_ORIENT_RIGHT",I[I.ZBAR_ORIENT_DOWN=2]="ZBAR_ORIENT_DOWN",I[I.ZBAR_ORIENT_LEFT=3]="ZBAR_ORIENT_LEFT";class S{constructor(t,e){this.ptr=t,this.inst=e}checkAlive(){if(!this.ptr)throw Error("Call after destroyed")}getPointer(){return this.checkAlive(),this.ptr}}class C{constructor(t,e){this.ptr=t,this.ptr32=t>>2,this.buf=e,this.HEAP8=new Int8Array(e),this.HEAPU32=new Uint32Array(e),this.HEAP32=new Int32Array(e)}}class w extends C{get type(){return this.HEAPU32[this.ptr32]}get data(){const t=this.HEAPU32[this.ptr32+4],e=this.HEAPU32[this.ptr32+5];return Int8Array.from(this.HEAP8.subarray(e,e+t))}get points(){const t=this.HEAPU32[this.ptr32+7],e=this.HEAPU32[this.ptr32+8]>>2,n=[];for(let r=0;r>16;return new this(e._Image_create(t,n,808466521,s,a,i),e)}))}destroy(){this.checkAlive(),this.inst._Image_destory(this.ptr),this.ptr=0}getSymbols(){this.checkAlive();const t=this.inst._Image_get_symbols(this.ptr);return T.createSymbolsFromPtr(t,this.inst.HEAPU8.buffer)}}class P extends S{static create(){return e(this,void 0,void 0,(function*(){const t=yield E();return new this(t._ImageScanner_create(),t)}))}destroy(){this.checkAlive(),this.inst._ImageScanner_destory(this.ptr),this.ptr=0}setConfig(t,e,n){return this.checkAlive(),this.inst._ImageScanner_set_config(this.ptr,t,e,n)}enableCache(t=!0){this.checkAlive(),this.inst._ImageScanner_enable_cache(this.ptr,t)}recycleImage(t){this.checkAlive(),this.inst._ImageScanner_recycle_image(this.ptr,t.getPointer())}getResults(){this.checkAlive();const t=this.inst._ImageScanner_get_results(this.ptr);return T.createSymbolsFromPtr(t,this.inst.HEAPU8.buffer)}scan(t){return this.checkAlive(),this.inst._ImageScanner_scan(this.ptr,t.getPointer())}}const D=()=>e(void 0,void 0,void 0,(function*(){const e=yield P.create();return e.setConfig(t.ZBarSymbolType.ZBAR_NONE,t.ZBarConfigType.ZBAR_CFG_BINARY,1),e}));let F;const U=(t,n)=>e(void 0,void 0,void 0,(function*(){void 0===n&&(n=F||(yield D()),F=n);const e=n.scan(t);if(e<0)throw Error("Scan Failed");return 0===e?[]:t.getSymbols()})),G=(t,n,r,i)=>e(void 0,void 0,void 0,(function*(){const e=yield O.createFromRGBABuffer(n,r,t),o=yield U(e,i);return e.destroy(),o}));return t.ZBarImage=O,t.ZBarScanner=P,t.ZBarSymbol=T,t.getDefaultScanner=D,t.getInstance=E,t.scanGrayBuffer=(t,n,r,i)=>e(void 0,void 0,void 0,(function*(){const e=yield O.createFromGrayBuffer(n,r,t),o=yield U(e,i);return e.destroy(),o})),t.scanImageData=(t,n)=>e(void 0,void 0,void 0,(function*(){return yield G(t.data.buffer,t.width,t.height,n)})),t.scanRGBABuffer=G,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),t}({}); -//# sourceMappingURL=index.js.map diff --git a/zxing/LICENSE b/zxing/LICENSE new file mode 100644 index 0000000..4bcbdae --- /dev/null +++ b/zxing/LICENSE @@ -0,0 +1,245 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +======================================================================== +jai-imageio +======================================================================== + +Copyright (c) 2005 Sun Microsystems, Inc. +Copyright © 2010-2014 University of Manchester +Copyright © 2010-2015 Stian Soiland-Reyes +Copyright © 2015 Peter Hull +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistribution of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +- Redistribution in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +Neither the name of Sun Microsystems, Inc. or the names of +contributors may be used to endorse or promote products derived +from this software without specific prior written permission. + +This software is provided "AS IS," without a warranty of any +kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND +WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY +EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL +NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF +USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS +DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR +ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, +CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND +REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR +INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + +You acknowledge that this software is not designed or intended for +use in the design, construction, operation or maintenance of any +nuclear facility. diff --git a/zxing/customerror.js b/zxing/customerror.js new file mode 100644 index 0000000..00d7c6e --- /dev/null +++ b/zxing/customerror.js @@ -0,0 +1 @@ +function t(t,r){void 0===r&&(r=t.constructor);var e=Error.captureStackTrace;e&&e(t,r)}var r,e=(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&(t[e]=r[e])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),o=function(r){function o(e,o){var n,c,a,i=this.constructor,u=r.call(this,e,o)||this;return Object.defineProperty(u,"name",{value:i.name,enumerable:!1,configurable:!0}),n=u,c=i.prototype,(a=Object.setPrototypeOf)?a(n,c):n.__proto__=c,t(u),u}return e(o,r),o}(Error);function n(r,e){function o(){for(var n=[],c=0;c=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},C=function(){function t(){}return t.fill=function(t,e){for(var r=0,n=t.length;rr)throw new u("fromIndex("+e+") > toIndex("+r+")");if(e<0)throw new w(e);if(r>t)throw new w(r)},t.asList=function(){for(var t=[],e=0;e>1,s=n(r,e[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},t.numberComparator=function(t,e){return t-e},t}(),_=function(){function t(){}return t.numberOfTrailingZeros=function(t){var e;if(0===t)return 32;var r=31;return 0!==(e=t<<16)&&(r-=16,t=e),0!==(e=t<<8)&&(r-=8,t=e),0!==(e=t<<4)&&(r-=4,t=e),0!==(e=t<<2)&&(r-=2,t=e),r-(t<<1>>>31)},t.numberOfLeadingZeros=function(t){if(0===t)return 32;var e=1;return t>>>16==0&&(e+=16,t<<=16),t>>>24==0&&(e+=8,t<<=8),t>>>28==0&&(e+=4,t<<=4),t>>>30==0&&(e+=2,t<<=2),e-=t>>>31},t.toHexString=function(t){return t.toString(16)},t.toBinaryString=function(t){return String(parseInt(String(t),2))},t.bitCount=function(t){return t=(t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135,t+=t>>>8,63&(t+=t>>>16)},t.truncDivision=function(t,e){return Math.trunc(t/e)},t.parseInt=function(t,e){return void 0===e&&(e=void 0),parseInt(t,e)},t.MIN_VALUE_32_BITS=-2147483648,t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),A=function(){function t(e,r){void 0===e?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,this.bits=null==r?t.makeArray(e):r)}return t.prototype.getSize=function(){return this.size},t.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},t.prototype.ensureCapacity=function(e){if(e>32*this.bits.length){var r=t.makeArray(e);d.arraycopy(this.bits,0,r,0,this.bits.length),this.bits=r}},t.prototype.get=function(t){return 0!=(this.bits[Math.floor(t/32)]&1<<(31&t))},t.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(31&t)},t.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(31&t)},t.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var r=this.bits,n=Math.floor(t/32),o=r[n];o&=~((1<<(31&t))-1);for(var i=r.length;0===o;){if(++n===i)return e;o=r[n]}var a=32*n+_.numberOfTrailingZeros(o);return a>e?e:a},t.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var r=this.bits,n=Math.floor(t/32),o=~r[n];o&=~((1<<(31&t))-1);for(var i=r.length;0===o;){if(++n===i)return e;o=~r[n]}var a=32*n+_.numberOfTrailingZeros(o);return a>e?e:a},t.prototype.setBulk=function(t,e){this.bits[Math.floor(t/32)]=e},t.prototype.setRange=function(t,e){if(ethis.size)throw new u;if(e!==t){e--;for(var r=Math.floor(t/32),n=Math.floor(e/32),o=this.bits,i=r;i<=n;i++){var a=(2<<(ir?0:31&t));o[i]|=a}}},t.prototype.clear=function(){for(var t=this.bits.length,e=this.bits,r=0;rthis.size)throw new u;if(e===t)return!0;e--;for(var n=Math.floor(t/32),o=Math.floor(e/32),i=this.bits,a=n;a<=o;a++){var s=(2<<(an?0:31&t))&4294967295;if((i[a]&s)!==(r?s:0))return!1}return!0},t.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},t.prototype.appendBits=function(t,e){if(e<0||e>32)throw new u("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(var r=e;r>0;r--)this.appendBit(1==(t>>r-1&1))},t.prototype.appendBitArray=function(t){var e=t.size;this.ensureCapacity(this.size+e);for(var r=0;r>1&1431655765|(1431655765&i)<<1)>>2&858993459|(858993459&i)<<2)>>4&252645135|(252645135&i)<<4)>>8&16711935|(16711935&i)<<8)>>16&65535|(65535&i)<<16,t[e-o]=i}if(this.size!==32*r){var a=32*r-this.size,s=t[0]>>>a;for(o=1;o>>a}t[r-1]=s}this.bits=t},t.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.size===r.size&&C.equals(this.bits,r.bits)},t.prototype.hashCode=function(){return 31*this.size+C.hashCode(this.bits)},t.prototype.toString=function(){for(var t="",e=0,r=this.size;e=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};!function(t){t[t.Cp437=0]="Cp437",t[t.ISO8859_1=1]="ISO8859_1",t[t.ISO8859_2=2]="ISO8859_2",t[t.ISO8859_3=3]="ISO8859_3",t[t.ISO8859_4=4]="ISO8859_4",t[t.ISO8859_5=5]="ISO8859_5",t[t.ISO8859_6=6]="ISO8859_6",t[t.ISO8859_7=7]="ISO8859_7",t[t.ISO8859_8=8]="ISO8859_8",t[t.ISO8859_9=9]="ISO8859_9",t[t.ISO8859_10=10]="ISO8859_10",t[t.ISO8859_11=11]="ISO8859_11",t[t.ISO8859_13=12]="ISO8859_13",t[t.ISO8859_14=13]="ISO8859_14",t[t.ISO8859_15=14]="ISO8859_15",t[t.ISO8859_16=15]="ISO8859_16",t[t.SJIS=16]="SJIS",t[t.Cp1250=17]="Cp1250",t[t.Cp1251=18]="Cp1251",t[t.Cp1252=19]="Cp1252",t[t.Cp1256=20]="Cp1256",t[t.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",t[t.UTF8=22]="UTF8",t[t.ASCII=23]="ASCII",t[t.Big5=24]="Big5",t[t.GB18030=25]="GB18030",t[t.EUC_KR=26]="EUC_KR"}(m||(m={}));var O,b=function(){function t(e,r,n){for(var o,i,a=[],s=3;s=900)throw new S("incorect value");var r=t.VALUES_TO_ECI.get(e);if(void 0===r)throw new S("incorect value");return r},t.getCharacterSetECIByName=function(e){var r=t.NAME_TO_ECI.get(e);if(void 0===r)throw new S("incorect value");return r},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.getName()===r.getName()},t.VALUE_IDENTIFIER_TO_ECI=new Map,t.VALUES_TO_ECI=new Map,t.NAME_TO_ECI=new Map,t.Cp437=new t(m.Cp437,Int32Array.from([0,2]),"Cp437"),t.ISO8859_1=new t(m.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),t.ISO8859_2=new t(m.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),t.ISO8859_3=new t(m.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),t.ISO8859_4=new t(m.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),t.ISO8859_5=new t(m.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),t.ISO8859_6=new t(m.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),t.ISO8859_7=new t(m.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),t.ISO8859_8=new t(m.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),t.ISO8859_9=new t(m.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),t.ISO8859_10=new t(m.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),t.ISO8859_11=new t(m.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),t.ISO8859_13=new t(m.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),t.ISO8859_14=new t(m.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),t.ISO8859_15=new t(m.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),t.ISO8859_16=new t(m.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),t.SJIS=new t(m.SJIS,20,"SJIS","Shift_JIS"),t.Cp1250=new t(m.Cp1250,21,"Cp1250","windows-1250"),t.Cp1251=new t(m.Cp1251,22,"Cp1251","windows-1251"),t.Cp1252=new t(m.Cp1252,23,"Cp1252","windows-1252"),t.Cp1256=new t(m.Cp1256,24,"Cp1256","windows-1256"),t.UnicodeBigUnmarked=new t(m.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),t.UTF8=new t(m.UTF8,26,"UTF8","UTF-8"),t.ASCII=new t(m.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),t.Big5=new t(m.Big5,28,"Big5"),t.GB18030=new t(m.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),t.EUC_KR=new t(m.EUC_KR,30,"EUC_KR","EUC-KR"),t}(),R=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.kind="UnsupportedOperationException",e}(o),D=function(){function t(){}return t.decode=function(t,e){var r=this.encodingName(e);return this.customDecoder?this.customDecoder(t,r):"undefined"==typeof TextDecoder||this.shouldDecodeOnFallback(r)?this.decodeFallback(t,r):new TextDecoder(r).decode(t)},t.shouldDecodeOnFallback=function(e){return!t.isBrowser()&&"ISO-8859-1"===e},t.encode=function(t,e){var r=this.encodingName(e);return this.customEncoder?this.customEncoder(t,r):"undefined"==typeof TextEncoder?this.encodeFallback(t):(new TextEncoder).encode(t)},t.isBrowser=function(){return"undefined"!=typeof window&&"[object Window]"==={}.toString.call(window)},t.encodingName=function(t){return"string"==typeof t?t:t.getName()},t.encodingCharacterSet=function(t){return t instanceof b?t:b.getCharacterSetECIByName(t)},t.decodeFallback=function(e,r){var n=this.encodingCharacterSet(r);if(t.isDecodeFallbackSupported(n)){for(var o="",i=0,a=e.length;i3&&239===e[0]&&187===e[1]&&191===e[2],C=0;C0?0==(128&_)?a=!1:s--:0!=(128&_)&&(0==(64&_)?a=!1:(s++,0==(32&_)?u++:(s++,0==(16&_)?c++:(s++,0==(8&_)?f++:a=!1))))),o&&(_>127&&_<160?o=!1:_>159&&(_<192||215===_||247===_)&&w++),i&&(h>0?_<64||127===_||_>252?i=!1:h--:128===_||160===_||_>239?i=!1:_>160&&_<224?(l++,p=0,++d>g&&(g=d)):_>127?(h++,d=0,++p>y&&(y=p)):(d=0,p=0))}return a&&s>0&&(a=!1),i&&h>0&&(i=!1),a&&(v||u+c+f>0)?t.UTF8:i&&(t.ASSUME_SHIFT_JIS||g>=3||y>=3)?t.SHIFT_JIS:o&&i?2===g&&2===l||10*w>=n?t.SHIFT_JIS:t.ISO88591:o?t.ISO88591:i?t.SHIFT_JIS:a?t.UTF8:t.PLATFORM_DEFAULT_ENCODING},t.format=function(t){for(var e=[],r=1;ra){if(-1===s)s=i-a;else if(i-a!==s)throw new u("row lengths do not match");a=i,c++}f++}else if(e.substring(f,f+r.length)===r)f+=r.length,o[i]=!0,i++;else{if(e.substring(f,f+n.length)!==n)throw new u("illegal character encountered: "+e.substring(f));f+=n.length,o[i]=!1,i++}if(i>a){if(-1===s)s=i-a;else if(i-a!==s)throw new u("row lengths do not match");c++}for(var h=new t(s,c),l=0;l>>(31&t)&1)},t.prototype.set=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]|=1<<(31&t)&4294967295},t.prototype.unset=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]&=~(1<<(31&t)&4294967295)},t.prototype.flip=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]^=1<<(31&t)&4294967295},t.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new u("input matrix dimensions do not match");for(var e=new A(Math.floor(this.width/32)+1),r=this.rowSize,n=this.bits,o=0,i=this.height;othis.height||o>this.width)throw new u("The region must fit inside the matrix");for(var a=this.rowSize,s=this.bits,c=e;cs&&(s=u),32*ca){for(h=31;f>>>h==0;)h--;32*c+h>a&&(a=32*c+h)}}}return a=0&&0===e[r];)r--;if(r<0)return null;for(var n=Math.floor(r/t),o=32*Math.floor(r%t),i=e[r],a=31;i>>>a==0;)a--;return o+=a,Int32Array.from([o,n])},t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.getRowSize=function(){return this.rowSize},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;return this.width===r.width&&this.height===r.height&&this.rowSize===r.rowSize&&C.equals(this.bits,r.bits)},t.prototype.hashCode=function(){var t=this.width;return t=31*(t=31*(t=31*(t=31*t+this.width)+this.height)+this.rowSize)+C.hashCode(this.bits)},t.prototype.toString=function(t,e,r){return void 0===t&&(t="X "),void 0===e&&(e=" "),void 0===r&&(r="\n"),this.buildToString(t,e,r)},t.prototype.buildToString=function(t,e,r){for(var n=new P,o=0,i=this.height;o>e.LUMINANCE_SHIFT]++;var u=e.estimateBlackPoint(a);if(o<3)for(s=0;s>e.LUMINANCE_SHIFT]++}var h=e.estimateBlackPoint(i),l=t.getMatrix();for(a=0;ai&&(o=a,i=t[a]),t[a]>n&&(n=t[a]);var s=0,u=0;for(a=0;au&&(s=a,u=d)}if(o>s){var f=o;o=s,s=f}if(s-o<=r/16)throw new F;var h=s-1,l=-1;for(a=s-1;a>o;a--){var d,p=a-o;(d=p*p*(s-a)*(n-t[a]))>l&&(h=a,l=d)}return h<=e.MINIMUM_DIMENSION&&o>=e.MINIMUM_DIMENSION){var i=r.getMatrix(),a=n>>e.BLOCK_SIZE_POWER;0!=(n&e.BLOCK_SIZE_MASK)&&a++;var s=o>>e.BLOCK_SIZE_POWER;0!=(o&e.BLOCK_SIZE_MASK)&&s++;var u=e.calculateBlackPoints(i,a,s,n,o),c=new B(n,o);e.calculateThresholdForBlock(i,a,s,n,o,u,c),this.matrix=c}else this.matrix=t.prototype.getBlackMatrix.call(this);return this.matrix},e.prototype.createBinarizer=function(t){return new e(t)},e.calculateThresholdForBlock=function(t,r,n,o,i,a,s){for(var u=i-e.BLOCK_SIZE,c=o-e.BLOCK_SIZE,f=0;fu&&(h=u);for(var l=e.cap(f,2,n-3),d=0;dc&&(p=c);for(var g=e.cap(d,2,r-3),y=0,w=-2;w<=2;w++){var v=a[l+w];y+=v[g-2]+v[g-1]+v[g]+v[g+1]+v[g+2]}var C=y/25;e.thresholdBlock(t,p,h,C,o,s)}}},e.cap=function(t,e,r){return tr?r:t},e.thresholdBlock=function(t,r,n,o,i,a){for(var s=0,u=n*i+r;sa&&(f=a);for(var h=0;hs&&(l=s);for(var d=0,p=255,g=0,y=0,w=f*o+l;yg&&(g=C)}if(g-p>e.MIN_DYNAMIC_RANGE)for(y++,w+=o;y>2*e.BLOCK_SIZE_POWER;if(g-p<=e.MIN_DYNAMIC_RANGE&&(_=p/2,c>0&&h>0)){var A=(u[c-1][h]+2*u[c][h-1]+u[c-1][h-1])/4;p>10;o[a]=u}else{i=0,a=0;for(var c=t.length;i>10;o[a]=255-u}}return o},e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new u("Requested row is outside the image: "+t);var r=this.getWidth(),n=t*r;return null===e?e=this.buffer.slice(n,n+r):(e.length0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},q=function(){function t(t,e,r){void 0===e&&(e=500),this.reader=t,this.timeBetweenScansMillis=e,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(t.prototype,"hasNavigator",{get:function(){return"undefined"!=typeof navigator},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),t.prototype.listVideoInputDevices=function(){return Y(this,void 0,void 0,(function(){var t,e,r,n,o,i,a,s,u,c,f,h;return Z(this,(function(l){switch(l.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=l.sent(),e=[];try{for(r=K(t),n=r.next();!n.done;n=r.next())o=n.value,"videoinput"===(i="video"===o.kind?"videoinput":o.kind)&&(a=o.deviceId||o.id,s=o.label||"Video device "+(e.length+1),u=o.groupId,c={deviceId:a,label:s,kind:i,groupId:u},e.push(c))}catch(t){f={error:t}}finally{try{n&&!n.done&&(h=r.return)&&h.call(r)}finally{if(f)throw f.error}}return[2,e]}}))}))},t.prototype.getVideoInputDevices=function(){return Y(this,void 0,void 0,(function(){return Z(this,(function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,t.sent().map((function(t){return new j(t.deviceId,t.label)}))]}}))}))},t.prototype.findDeviceById=function(t){return Y(this,void 0,void 0,(function(){var e;return Z(this,(function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(e=r.sent())?[2,e.find((function(e){return e.deviceId===t}))]:[2,null]}}))}))},t.prototype.decodeFromInputVideoDevice=function(t,e){return Y(this,void 0,void 0,(function(){return Z(this,(function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,e)];case 1:return[2,r.sent()]}}))}))},t.prototype.decodeOnceFromVideoDevice=function(t,e){return Y(this,void 0,void 0,(function(){var r;return Z(this,(function(n){switch(n.label){case 0:return this.reset(),r={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,e)];case 1:return[2,n.sent()]}}))}))},t.prototype.decodeOnceFromConstraints=function(t,e){return Y(this,void 0,void 0,(function(){var r;return Z(this,(function(n){switch(n.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return r=n.sent(),[4,this.decodeOnceFromStream(r,e)];case 2:return[2,n.sent()]}}))}))},t.prototype.decodeOnceFromStream=function(t,e){return Y(this,void 0,void 0,(function(){var r;return Z(this,(function(n){switch(n.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return r=n.sent(),[4,this.decodeOnce(r)];case 2:return[2,n.sent()]}}))}))},t.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,r){return Y(this,void 0,void 0,(function(){return Z(this,(function(n){switch(n.label){case 0:return[4,this.decodeFromVideoDevice(t,e,r)];case 1:return[2,n.sent()]}}))}))},t.prototype.decodeFromVideoDevice=function(t,e,r){return Y(this,void 0,void 0,(function(){var n;return Z(this,(function(o){switch(o.label){case 0:return n={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(n,e,r)];case 1:return[2,o.sent()]}}))}))},t.prototype.decodeFromConstraints=function(t,e,r){return Y(this,void 0,void 0,(function(){var n;return Z(this,(function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=o.sent(),[4,this.decodeFromStream(n,e,r)];case 2:return[2,o.sent()]}}))}))},t.prototype.decodeFromStream=function(t,e,r){return Y(this,void 0,void 0,(function(){var n;return Z(this,(function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return n=o.sent(),[4,this.decodeContinuously(n,r)];case 2:return[2,o.sent()]}}))}))},t.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},t.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},t.prototype.attachStreamToVideo=function(t,e){return Y(this,void 0,void 0,(function(){var r;return Z(this,(function(n){switch(n.label){case 0:return r=this.prepareVideoElement(e),this.addVideoSource(r,t),this.videoElement=r,this.stream=t,[4,this.playVideoOnLoadAsync(r)];case 1:return n.sent(),[2,r]}}))}))},t.prototype.playVideoOnLoadAsync=function(t){var e=this;return new Promise((function(r,n){return e.playVideoOnLoad(t,(function(){return r()}))}))},t.prototype.playVideoOnLoad=function(t,e){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(t)},t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",e),this.tryPlayVideo(t)},t.prototype.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2},t.prototype.tryPlayVideo=function(t){return Y(this,void 0,void 0,(function(){return Z(this,(function(e){switch(e.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,t.play()];case 2:return e.sent(),[3,4];case 3:return e.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}}))}))},t.prototype.getMediaElement=function(t,e){var r=document.getElementById(t);if(!r)throw new a("element with id '"+t+"' not found");if(r.nodeName.toLowerCase()!==e.toLowerCase())throw new a("element with id '"+t+"' must be an "+e+" element");return r},t.prototype.decodeFromImage=function(t,e){if(!t&&!e)throw new a("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)},t.prototype.decodeFromVideo=function(t,e){if(!t&&!e)throw new a("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)},t.prototype.decodeFromVideoContinuously=function(t,e,r){if(void 0===t&&void 0===e)throw new a("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,r):this.decodeFromVideoElementContinuously(t,r)},t.prototype.decodeFromImageElement=function(t){if(!t)throw new a("An image element must be provided.");this.reset();var e=this.prepareImageElement(t);return this.imageElement=e,this.isImageLoaded(e)?this.decodeOnce(e,!1,!0):this._decodeOnLoadImage(e)},t.prototype.decodeFromVideoElement=function(t){var e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)},t.prototype.decodeFromVideoElementContinuously=function(t,e){var r=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(r,e)},t.prototype._decodeFromVideoElementSetup=function(t){if(!t)throw new a("A video element must be provided.");this.reset();var e=this.prepareVideoElement(t);return this.videoElement=e,e},t.prototype.decodeFromImageUrl=function(t){if(!t)throw new a("An URL must be provided.");this.reset();var e=this.prepareImageElement();this.imageElement=e;var r=this._decodeOnLoadImage(e);return e.src=t,r},t.prototype.decodeFromVideoUrl=function(t){if(!t)throw new a("An URL must be provided.");this.reset();var e=this.prepareVideoElement(),r=this.decodeFromVideoElement(e);return e.src=t,r},t.prototype.decodeFromVideoUrlContinuously=function(t,e){if(!t)throw new a("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),n=this.decodeFromVideoElementContinuously(r,e);return r.src=t,n},t.prototype._decodeOnLoadImage=function(t){var e=this;return new Promise((function(r,n){e.imageLoadedListener=function(){return e.decodeOnce(t,!1,!0).then(r,n)},t.addEventListener("load",e.imageLoadedListener)}))},t.prototype._decodeOnLoadVideo=function(t){return Y(this,void 0,void 0,(function(){return Z(this,(function(e){switch(e.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return e.sent(),[4,this.decodeOnce(t)];case 2:return[2,e.sent()]}}))}))},t.prototype._decodeOnLoadVideoContinuously=function(t,e){return Y(this,void 0,void 0,(function(){return Z(this,(function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return r.sent(),this.decodeContinuously(t,e),[2]}}))}))},t.prototype.isImageLoaded=function(t){return!!t.complete&&0!==t.naturalWidth},t.prototype.prepareImageElement=function(t){var e;return void 0===t&&((e=document.createElement("img")).width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e},t.prototype.prepareVideoElement=function(t){var e;return t||"undefined"==typeof document||((e=document.createElement("video")).width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},t.prototype.decodeOnce=function(t,e,r){var n=this;void 0===e&&(e=!0),void 0===r&&(r=!0),this._stopAsyncDecode=!1;var o=function(i,a){if(n._stopAsyncDecode)return a(new F("Video stream has ended before any code could be detected.")),void(n._stopAsyncDecode=void 0);try{i(n.decode(t))}catch(t){if(e&&t instanceof F||(t instanceof h||t instanceof S)&&r)return setTimeout(o,n._timeBetweenDecodingAttempts,i,a);a(t)}};return new Promise((function(t,e){return o(t,e)}))},t.prototype.decodeContinuously=function(t,e){var r=this;this._stopContinuousDecode=!1;var n=function(){if(r._stopContinuousDecode)r._stopContinuousDecode=void 0;else try{var o=r.decode(t);e(o,null),setTimeout(n,r.timeBetweenScansMillis)}catch(t){e(null,t),(t instanceof h||t instanceof S||t instanceof F)&&setTimeout(n,r._timeBetweenDecodingAttempts)}};n()},t.prototype.decode=function(t){var e=this.createBinaryBitmap(t);return this.decodeBitmap(e)},t.prototype.createBinaryBitmap=function(t){this.getCaptureCanvasContext(t),t instanceof HTMLVideoElement?this.drawFrameOnCanvas(t):this.drawImageOnCanvas(t);var e=this.getCaptureCanvas(t),r=new z(e),n=new H(r);return new c(n)},t.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var e=this.getCaptureCanvas(t),r=void 0;try{r=e.getContext("2d",{willReadFrequently:!0})}catch(t){r=e.getContext("2d")}this.captureCanvasContext=r}return this.captureCanvasContext},t.prototype.getCaptureCanvas=function(t){if(!this.captureCanvas){var e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas},t.prototype.drawFrameOnCanvas=function(t,e,r){void 0===e&&(e={sx:0,sy:0,sWidth:t.videoWidth,sHeight:t.videoHeight,dx:0,dy:0,dWidth:t.videoWidth,dHeight:t.videoHeight}),void 0===r&&(r=this.captureCanvasContext),r.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)},t.prototype.drawImageOnCanvas=function(t,e,r){void 0===e&&(e={sx:0,sy:0,sWidth:t.naturalWidth,sHeight:t.naturalHeight,dx:0,dy:0,dWidth:t.naturalWidth,dHeight:t.naturalHeight}),void 0===r&&(r=this.captureCanvasContext),r.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)},t.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)},t.prototype.createCaptureCanvas=function(t){if("undefined"==typeof document)return this._destroyCaptureCanvas(),null;var e,r,n=document.createElement("canvas");return void 0!==t&&(t instanceof HTMLVideoElement?(e=t.videoWidth,r=t.videoHeight):t instanceof HTMLImageElement&&(e=t.naturalWidth||t.width,r=t.naturalHeight||t.height)),n.style.width=e+"px",n.style.height=r+"px",n.width=e,n.height=r,n},t.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach((function(t){return t.stop()})),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()},t.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},t.prototype._destroyVideoElement=function(){this.videoElement&&(void 0!==this.videoEndedListener&&this.videoElement.removeEventListener("ended",this.videoEndedListener),void 0!==this.videoPlayingEventListener&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),void 0!==this.videoCanPlayListener&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},t.prototype._destroyImageElement=function(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},t.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},t.prototype.addVideoSource=function(t,e){try{t.srcObject=e}catch(r){t.src=URL.createObjectURL(e)}},t.prototype.cleanVideoSource=function(t){try{t.srcObject=null}catch(e){t.src=""}this.videoElement.removeAttribute("src")},t}(),Q=function(){function t(t,e,r,n,o,i){void 0===r&&(r=null==e?0:8*e.length),void 0===i&&(i=d.currentTimeMillis()),this.text=t,this.rawBytes=e,this.numBits=r,this.resultPoints=n,this.format=o,this.timestamp=i,this.text=t,this.rawBytes=e,this.numBits=null==r?null==e?0:8*e.length:r,this.resultPoints=n,this.format=o,this.resultMetadata=null,this.timestamp=null==i?d.currentTimeMillis():i}return t.prototype.getText=function(){return this.text},t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.getBarcodeFormat=function(){return this.format},t.prototype.getResultMetadata=function(){return this.resultMetadata},t.prototype.putMetadata=function(t,e){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)},t.prototype.putAllMetadata=function(t){null!==t&&(null===this.resultMetadata?this.resultMetadata=t:this.resultMetadata=new Map(t))},t.prototype.addResultPoints=function(t){var e=this.resultPoints;if(null===e)this.resultPoints=t;else if(null!==t&&t.length>0){var r=new Array(e.length+t.length);d.arraycopy(e,0,r,0,e.length),d.arraycopy(t,0,r,e.length,t.length),this.resultPoints=r}},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.toString=function(){return this.text},t}();!function(t){t[t.AZTEC=0]="AZTEC",t[t.CODABAR=1]="CODABAR",t[t.CODE_39=2]="CODE_39",t[t.CODE_93=3]="CODE_93",t[t.CODE_128=4]="CODE_128",t[t.DATA_MATRIX=5]="DATA_MATRIX",t[t.EAN_8=6]="EAN_8",t[t.EAN_13=7]="EAN_13",t[t.ITF=8]="ITF",t[t.MAXICODE=9]="MAXICODE",t[t.PDF_417=10]="PDF_417",t[t.QR_CODE=11]="QR_CODE",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"}(O||(O={}));var J,$=O;!function(t){t[t.OTHER=0]="OTHER",t[t.ORIENTATION=1]="ORIENTATION",t[t.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",t[t.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",t[t.ISSUE_NUMBER=4]="ISSUE_NUMBER",t[t.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",t[t.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",t[t.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",t[t.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",t[t.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",t[t.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"}(J||(J={}));var tt,et=J,rt=function(){function t(t,e,r,n,o,i){void 0===o&&(o=-1),void 0===i&&(i=-1),this.rawBytes=t,this.text=e,this.byteSegments=r,this.ecLevel=n,this.structuredAppendSequenceNumber=o,this.structuredAppendParity=i,this.numBits=null==t?0:8*t.length}return t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.setNumBits=function(t){this.numBits=t},t.prototype.getText=function(){return this.text},t.prototype.getByteSegments=function(){return this.byteSegments},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getErrorsCorrected=function(){return this.errorsCorrected},t.prototype.setErrorsCorrected=function(t){this.errorsCorrected=t},t.prototype.getErasures=function(){return this.erasures},t.prototype.setErasures=function(t){this.erasures=t},t.prototype.getOther=function(){return this.other},t.prototype.setOther=function(t){this.other=t},t.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},t.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},t.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},t}(),nt=function(){function t(){}return t.prototype.exp=function(t){return this.expTable[t]},t.prototype.log=function(t){if(0===t)throw new u;return this.logTable[t]},t.addOrSubtract=function(t,e){return t^e},t}(),ot=function(){function t(t,e){if(0===e.length)throw new u;this.field=t;var r=e.length;if(r>1&&0===e[0]){for(var n=1;nn.length){var o=r;r=n,n=o}var i=new Int32Array(n.length),a=n.length-r.length;d.arraycopy(n,0,i,0,a);for(var s=a;s=t.getDegree()&&!n.isZero();){var a=n.getDegree()-t.getDegree(),s=e.multiply(n.getCoefficient(n.getDegree()),i),c=t.multiplyByMonomial(a,s),f=e.buildMonomial(a,s);r=r.addOrSubtract(f),n=n.addOrSubtract(c)}return[r,n]},t.prototype.toString=function(){for(var t="",e=this.getDegree();e>=0;e--){var r=this.getCoefficient(e);if(0!==r){if(r<0?(t+=" - ",r=-r):t.length>0&&(t+=" + "),0===e||1!==r){var n=this.field.log(r);0===n?t+="1":1===n?t+="a":(t+="a^",t+=n)}0!==e&&(1===e?t+="x":(t+="x^",t+=e))}}return t},t}(),it=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),at=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return it(e,t),e.kind="ArithmeticException",e}(o),st=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ut=function(t){function e(e,r,n){var o=t.call(this)||this;o.primitive=e,o.size=r,o.generatorBase=n;for(var i=new Int32Array(r),a=1,s=0;s=r&&(a^=e,a&=r-1);o.expTable=i;var u=new Int32Array(r);for(s=0;s=(r/2|0);){var c=i,f=s;if(s=u,(i=a).isZero())throw new ft("r_{i-1} was zero");a=c;for(var h=o.getZero(),l=i.getCoefficient(i.getDegree()),d=o.inverse(l);a.getDegree()>=i.getDegree()&&!a.isZero();){var p=a.getDegree()-i.getDegree(),g=o.multiply(a.getCoefficient(a.getDegree()),d);h=h.addOrSubtract(o.buildMonomial(p,g)),a=a.addOrSubtract(i.multiplyByMonomial(p,g))}if(u=h.multiply(s).addOrSubtract(f),a.getDegree()>=i.getDegree())throw new lt("Division algorithm failed to reduce polynomial?")}var y=u.getCoefficient(0);if(0===y)throw new ft("sigmaTilde(0) was zero");var w=o.inverse(y);return[u.multiplyScalar(w),a.multiplyScalar(w)]},t.prototype.findErrorLocations=function(t){var e=t.getDegree();if(1===e)return Int32Array.from([t.getCoefficient(1)]);for(var r=new Int32Array(e),n=0,o=this.field,i=1;i1,l,l+n-1),l+=n-1;else for(var p=n-1;p>=0;--p)h[l++]=0!=(d&1<=8?t.readCode(e,r,8):t.readCode(e,r,n)<<8-n},t.convertBoolArrayToByteArray=function(e){for(var r=new Uint8Array((e.length+7)/8),n=0;n","?","[","]","{","}","CTRL_UL"],t.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],t}(),gt=function(){function t(){}return t.round=function(t){return isNaN(t)?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0},t.distance=function(t,e,r,n){var o=t-r,i=e-n;return Math.sqrt(o*o+i*i)},t.sum=function(t){for(var e=0,r=0,n=t.length;r!==n;r++){e+=t[r]}return e},t}(),yt=function(){function t(){}return t.floatToIntBits=function(t){return t},t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),wt=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t.prototype.equals=function(e){if(e instanceof t){var r=e;return this.x===r.x&&this.y===r.y}return!1},t.prototype.hashCode=function(){return 31*yt.floatToIntBits(this.x)+yt.floatToIntBits(this.y)},t.prototype.toString=function(){return"("+this.x+","+this.y+")"},t.orderBestPatterns=function(t){var e,r,n,o=this.distance(t[0],t[1]),i=this.distance(t[1],t[2]),a=this.distance(t[0],t[2]);if(i>=o&&i>=a?(r=t[0],e=t[1],n=t[2]):a>=i&&a>=o?(r=t[1],e=t[0],n=t[2]):(r=t[2],e=t[0],n=t[1]),this.crossProductZ(e,r,n)<0){var s=e;e=n,n=s}t[0]=e,t[1]=r,t[2]=n},t.distance=function(t,e){return gt.distance(t.x,t.y,e.x,e.y)},t.crossProductZ=function(t,e,r){var n=e.x,o=e.y;return(r.x-n)*(t.y-o)-(r.y-o)*(t.x-n)},t}(),vt=function(){function t(t,e){this.bits=t,this.points=e}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),Ct=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),_t=function(t){function e(e,r,n,o,i){var a=t.call(this,e,r)||this;return a.compact=n,a.nbDatablocks=o,a.nbLayers=i,a}return Ct(e,t),e.prototype.getNbLayers=function(){return this.nbLayers},e.prototype.getNbDatablocks=function(){return this.nbDatablocks},e.prototype.isCompact=function(){return this.compact},e}(vt),At=function(){function t(e,r,n,o){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),null==r&&(r=t.INIT_SIZE),null==n&&(n=e.getWidth()/2|0),null==o&&(o=e.getHeight()/2|0);var i=r/2|0;if(this.leftInit=n-i,this.rightInit=n+i,this.upInit=o-i,this.downInit=o+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new F}return t.prototype.detect=function(){for(var t=this.leftInit,e=this.rightInit,r=this.upInit,n=this.downInit,o=!1,i=!0,a=!1,s=!1,u=!1,c=!1,f=!1,h=this.width,l=this.height;i;){i=!1;for(var d=!0;(d||!s)&&e=h){o=!0;break}for(var p=!0;(p||!u)&&n=l){o=!0;break}for(var g=!0;(g||!c)&&t>=0;)(g=this.containsBlackPoint(r,n,t,!1))?(t--,i=!0,c=!0):c||t--;if(t<0){o=!0;break}for(var y=!0;(y||!f)&&r>=0;)(y=this.containsBlackPoint(t,e,r,!0))?(r--,i=!0,f=!0):f||r--;if(r<0){o=!0;break}i&&(a=!0)}if(!o&&a){for(var w=e-t,v=null,C=1;null===v&&Cr||s<-1||s>n)throw new F;o=!1,-1===a?(e[i]=0,o=!0):a===r&&(e[i]=r-1,o=!0),-1===s?(e[i+1]=0,o=!0):s===n&&(e[i+1]=n-1,o=!0)}o=!0;for(i=e.length-2;i>=0&&o;i-=2){a=Math.floor(e[i]),s=Math.floor(e[i+1]);if(a<-1||a>r||s<-1||s>n)throw new F;o=!1,-1===a?(e[i]=0,o=!0):a===r&&(e[i]=r-1,o=!0),-1===s?(e[i+1]=0,o=!0):s===n&&(e[i+1]=n-1,o=!0)}},t}(),Et=function(){function t(t,e,r,n,o,i,a,s,u){this.a11=t,this.a21=e,this.a31=r,this.a12=n,this.a22=o,this.a32=i,this.a13=a,this.a23=s,this.a33=u}return t.quadrilateralToQuadrilateral=function(e,r,n,o,i,a,s,u,c,f,h,l,d,p,g,y){var w=t.quadrilateralToSquare(e,r,n,o,i,a,s,u);return t.squareToQuadrilateral(c,f,h,l,d,p,g,y).times(w)},t.prototype.transformPoints=function(t){for(var e=t.length,r=this.a11,n=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,u=this.a31,c=this.a32,f=this.a33,h=0;h>1&127):(n<<=10,n+=(i>>2&992)+(i>>1&31))}var a=this.getCorrectedParameterData(n,this.compact);this.compact?(this.nbLayers=1+(a>>6),this.nbDataBlocks=1+(63&a)):(this.nbLayers=1+(a>>11),this.nbDataBlocks=1+(2047&a))},t.prototype.getRotation=function(t,e){var r=0;t.forEach((function(t,n,o){r=(r<<3)+((t>>e-2<<1)+(1&t))})),r=((1&r)<<11)+(r>>1);for(var n=0;n<4;n++)if(_.bitCount(r^this.EXPECTED_CORNER_BITS[n])<=2)return n;throw new F},t.prototype.getCorrectedParameterData=function(t,e){var r,n;e?(r=7,n=2):(r=10,n=4);for(var o=r-n,i=new Int32Array(r),a=r-1;a>=0;--a)i[a]=15&t,t>>=4;try{new dt(ut.AZTEC_PARAM).decode(i,o)}catch(t){throw new F}var s=0;for(a=0;a2){var f=this.distancePoint(c,a)*this.nbCenterLayers/(this.distancePoint(o,e)*(this.nbCenterLayers+2));if(f<.75||f>1.25||!this.isWhiteOrBlackRectangle(a,s,u,c))break}e=a,r=s,n=u,o=c,i=!i}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new F;this.compact=5===this.nbCenterLayers;var h=new wt(e.getX()+.5,e.getY()-.5),l=new wt(r.getX()+.5,r.getY()+.5),d=new wt(n.getX()-.5,n.getY()+.5),p=new wt(o.getX()-.5,o.getY()-.5);return this.expandSquare([h,l,d,p],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},t.prototype.getMatrixCenter=function(){var t,e,r,n;try{t=(u=new At(this.image).detect())[0],e=u[1],r=u[2],n=u[3]}catch(a){var o=this.image.getWidth()/2,i=this.image.getHeight()/2;t=this.getFirstDifferent(new Ot(o+7,i-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Ot(o+7,i+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Ot(o-7,i+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new Ot(o-7,i-7),!1,-1,-1).toResultPoint()}var a=gt.round((t.getX()+n.getX()+e.getX()+r.getX())/4),s=gt.round((t.getY()+n.getY()+e.getY()+r.getY())/4);try{var u;t=(u=new At(this.image,15,a,s).detect())[0],e=u[1],r=u[2],n=u[3]}catch(o){t=this.getFirstDifferent(new Ot(a+7,s-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new Ot(a+7,s+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Ot(a-7,s+7),!1,-1,1).toResultPoint(),n=this.getFirstDifferent(new Ot(a-7,s-7),!1,-1,-1).toResultPoint()}return a=gt.round((t.getX()+n.getX()+e.getX()+r.getX())/4),s=gt.round((t.getY()+n.getY()+e.getY()+r.getY())/4),new Ot(a,s)},t.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())},t.prototype.sampleGrid=function(t,e,r,n,o){var i=Tt.getInstance(),a=this.getDimension(),s=a/2-this.nbCenterLayers,u=a/2+this.nbCenterLayers;return i.sampleGrid(t,a,a,s,s,u,s,u,u,s,u,e.getX(),e.getY(),r.getX(),r.getY(),n.getX(),n.getY(),o.getX(),o.getY())},t.prototype.sampleLine=function(t,e,r){for(var n=0,o=this.distanceResultPoint(t,e),i=o/r,a=t.getX(),s=t.getY(),u=i*(e.getX()-t.getX())/o,c=i*(e.getY()-t.getY())/o,f=0;f.1&&h<.9?0:h<=.1===u?1:-1},t.prototype.getFirstDifferent=function(t,e,r,n){for(var o=t.getX()+r,i=t.getY()+n;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=r,i+=n;for(o-=r,i-=n;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=r;for(o-=r;this.isValid(o,i)&&this.image.get(o,i)===e;)i+=n;return new Ot(o,i-=n)},t.prototype.expandSquare=function(t,e,r){var n=r/(2*e),o=t[0].getX()-t[2].getX(),i=t[0].getY()-t[2].getY(),a=(t[0].getX()+t[2].getX())/2,s=(t[0].getY()+t[2].getY())/2,u=new wt(a+n*o,s+n*i),c=new wt(a-n*o,s-n*i);return o=t[1].getX()-t[3].getX(),i=t[1].getY()-t[3].getY(),a=(t[1].getX()+t[3].getX())/2,s=(t[1].getY()+t[3].getY())/2,[u,new wt(a+n*o,s+n*i),c,new wt(a-n*o,s-n*i)]},t.prototype.isValid=function(t,e){return t>=0&&t0&&e>(a?8:5));r=a?o:15;for(var u=Math.trunc(o/2),c=0;c=o)break;try{i=t.getBlackRow(h,i)}catch(t){continue}for(var l=function(t){if(1===t&&(i.reverse(),e&&!0===e.get(E.NEED_RESULT_POINT_CALLBACK))){var r=new Map;e.forEach((function(t,e){return r.set(e,t)})),r.delete(E.NEED_RESULT_POINT_CALLBACK),e=r}try{var o=d.decodeRow(h,i,e);if(1===t){o.putMetadata(et.ORIENTATION,180);var a=o.getResultPoints();null!==a&&(a[0]=new wt(n-a[0].getX()-1,a[0].getY()),a[1]=new wt(n-a[1].getX()-1,a[1].getY()))}return{value:o}}catch(t){}},d=this,p=0;p<2;p++){var g=l(p);if("object"==typeof g)return g.value}}throw new F},t.recordPattern=function(t,e,r){for(var n=r.length,o=0;o=i)throw new F;for(var a=!t.get(e),s=0,u=e;u0&&o>=0;)e.get(--r)!==i&&(o--,i=!i);if(o>=0)throw new F;t.recordPattern(e,r+1,n)},t.patternMatchVariance=function(t,e,r){for(var n=t.length,o=0,i=0,a=0;ah?f-h:h-f;if(l>r)return Number.POSITIVE_INFINITY;u+=l}return u/o},t}(),Pt=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Bt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Pt(e,t),e.findStartPattern=function(t){for(var r=t.getSize(),n=t.getNextSet(0),o=0,i=Int32Array.from([0,0,0,0,0,0]),a=n,s=!1,u=n;u=0&&t.isRange(Math.max(0,a-(u-a)/2),a,!1))return Int32Array.from([a,u,f]);a+=i[0]+i[1],(i=i.slice(2,i.length))[o-1]=0,i[o]=0,o--}else o++;i[o]=1,s=!s}throw new F},e.decodeCode=function(t,r,n){Mt.recordPattern(t,n,r);for(var o=e.MAX_AVG_VARIANCE,i=-1,a=0;a=0)return i;throw new F},e.prototype.decodeRow=function(t,r,n){var o,i=n&&!0===n.get(E.ASSUME_GS1),a=e.findStartPattern(r),s=a[2],u=0,c=new Uint8Array(20);switch(c[u++]=s,s){case e.CODE_START_A:o=e.CODE_CODE_A;break;case e.CODE_START_B:o=e.CODE_CODE_B;break;case e.CODE_START_C:o=e.CODE_CODE_C;break;default:throw new S}for(var f=!1,l=!1,d="",p=a[0],g=a[1],y=Int32Array.from([0,0,0,0,0,0]),w=0,v=0,C=s,_=0,A=!0,m=!1,I=!1;!f;){var T=l;switch(l=!1,w=v,v=e.decodeCode(r,y,g),c[u++]=v,v!==e.CODE_STOP&&(A=!0),v!==e.CODE_STOP&&(C+=++_*v),p=g,g+=y.reduce((function(t,e){return t+e}),0),v){case e.CODE_START_A:case e.CODE_START_B:case e.CODE_START_C:throw new S}switch(o){case e.CODE_CODE_A:if(v<64)d+=I===m?String.fromCharCode(" ".charCodeAt(0)+v):String.fromCharCode(" ".charCodeAt(0)+v+128),I=!1;else if(v<96)d+=I===m?String.fromCharCode(v-64):String.fromCharCode(v+64),I=!1;else switch(v!==e.CODE_STOP&&(A=!1),v){case e.CODE_FNC_1:i&&(0===d.length?d+="]C1":d+=String.fromCharCode(29));break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_A:!m&&I?(m=!0,I=!1):m&&I?(m=!1,I=!1):I=!0;break;case e.CODE_SHIFT:l=!0,o=e.CODE_CODE_B;break;case e.CODE_CODE_B:o=e.CODE_CODE_B;break;case e.CODE_CODE_C:o=e.CODE_CODE_C;break;case e.CODE_STOP:f=!0}break;case e.CODE_CODE_B:if(v<96)d+=I===m?String.fromCharCode(" ".charCodeAt(0)+v):String.fromCharCode(" ".charCodeAt(0)+v+128),I=!1;else switch(v!==e.CODE_STOP&&(A=!1),v){case e.CODE_FNC_1:i&&(0===d.length?d+="]C1":d+=String.fromCharCode(29));break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_B:!m&&I?(m=!0,I=!1):m&&I?(m=!1,I=!1):I=!0;break;case e.CODE_SHIFT:l=!0,o=e.CODE_CODE_A;break;case e.CODE_CODE_A:o=e.CODE_CODE_A;break;case e.CODE_CODE_C:o=e.CODE_CODE_C;break;case e.CODE_STOP:f=!0}break;case e.CODE_CODE_C:if(v<100)v<10&&(d+="0"),d+=v;else switch(v!==e.CODE_STOP&&(A=!1),v){case e.CODE_FNC_1:i&&(0===d.length?d+="]C1":d+=String.fromCharCode(29));break;case e.CODE_CODE_A:o=e.CODE_CODE_A;break;case e.CODE_CODE_B:o=e.CODE_CODE_B;break;case e.CODE_STOP:f=!0}}T&&(o=o===e.CODE_CODE_A?e.CODE_CODE_B:e.CODE_CODE_A)}var O=g-p;if(g=r.getNextUnset(g),!r.isRange(g,Math.min(r.getSize(),g+(g-p)/2),!1))throw new F;if((C-=_*w)%103!==w)throw new h;var b=d.length;if(0===b)throw new F;b>0&&A&&(d=o===e.CODE_CODE_C?d.substring(0,b-2):d.substring(0,b-1));for(var R=(a[1]+a[0])/2,N=p+O/2,D=c.length,M=new Uint8Array(D),P=0;P=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xt=function(t){function e(e,r){void 0===e&&(e=!1),void 0===r&&(r=!1);var n=t.call(this)||this;return n.usingCheckDigit=e,n.extendedMode=r,n.decodeRowResult="",n.counters=new Int32Array(9),n}return Lt(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a,s,u=this.counters;u.fill(0),this.decodeRowResult="";var c,f,l=e.findAsteriskPattern(r,u),d=r.getNextSet(l[1]),p=r.getSize();do{e.recordPattern(r,d,u);var g=e.toNarrowWidePattern(u);if(g<0)throw new F;c=e.patternToChar(g),this.decodeRowResult+=c,f=d;try{for(var y=(o=void 0,Ft(u)),w=y.next();!w.done;w=y.next()){d+=w.value}}catch(t){o={error:t}}finally{try{w&&!w.done&&(i=y.return)&&i.call(y)}finally{if(o)throw o.error}}d=r.getNextSet(d)}while("*"!==c);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var v,C=0;try{for(var _=Ft(u),A=_.next();!A.done;A=_.next()){C+=A.value}}catch(t){a={error:t}}finally{try{A&&!A.done&&(s=_.return)&&s.call(_)}finally{if(a)throw a.error}}if(d!==p&&2*(d-f-C)i&&(a=l)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}i=a,n=0;for(var c=0,f=0,h=0;hi&&(f|=1<0;h++){var l;if((l=t[h])>i&&(n--,2*l>=c))return-1}return f}}while(n>3);return-1},e.patternToChar=function(t){for(var r=0;r="A"&&i<="Z"))throw new S;a=String.fromCharCode(i.charCodeAt(0)+32);break;case"$":if(!(i>="A"&&i<="Z"))throw new S;a=String.fromCharCode(i.charCodeAt(0)-64);break;case"%":if(i>="A"&&i<="E")a=String.fromCharCode(i.charCodeAt(0)-38);else if(i>="F"&&i<="J")a=String.fromCharCode(i.charCodeAt(0)-11);else if(i>="K"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)+16);else if(i>="P"&&i<="T")a=String.fromCharCode(i.charCodeAt(0)+43);else if("U"===i)a="\0";else if("V"===i)a="@";else if("W"===i)a="`";else{if("X"!==i&&"Y"!==i&&"Z"!==i)throw new S;a=""}break;case"/":if(i>="A"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)-32);else{if("Z"!==i)throw new S;a=":"}}r+=a,n++}else r+=o}return r},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",e.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],e.ASTERISK_ENCODING=148,e}(Mt),kt=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vt=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ht=function(t){function e(){var e=t.call(this)||this;return e.decodeRowResult="",e.counters=new Int32Array(6),e}return kt(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a,s,u,c,f=this.findAsteriskPattern(r),h=r.getNextSet(f[1]),l=r.getSize(),d=this.counters;d.fill(0),this.decodeRowResult="";do{e.recordPattern(r,h,d);var p=this.toPattern(d);if(p<0)throw new F;u=this.patternToChar(p),this.decodeRowResult+=u,c=h;try{for(var g=(o=void 0,Vt(d)),y=g.next();!y.done;y=g.next()){h+=y.value}}catch(t){o={error:t}}finally{try{y&&!y.done&&(i=g.return)&&i.call(g)}finally{if(o)throw o.error}}h=r.getNextSet(h)}while("*"!==u);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var w=0;try{for(var v=Vt(d),C=v.next();!C.done;C=v.next()){w+=C.value}}catch(t){a={error:t}}finally{try{C&&!C.done&&(s=v.return)&&s.call(v)}finally{if(a)throw a.error}}if(h===l||!r.get(h))throw new F;if(this.decodeRowResult.length<2)throw new F;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var _=this.decodeExtended(this.decodeRowResult),A=(f[1]+f[0])/2,m=c+w/2;return new Q(_,null,0,[new wt(A,t),new wt(m,t)],$.CODE_93,(new Date).getTime())},e.prototype.findAsteriskPattern=function(t){var r=t.getSize(),n=t.getNextSet(0);this.counters.fill(0);for(var o=this.counters,i=n,a=!1,s=o.length,u=0,c=n;c4)return-1;if(0==(1&u))for(var f=0;f="a"&&o<="d"){if(n>=e-1)throw new S;var i=t.charAt(n+1),a="\0";switch(o){case"d":if(!(i>="A"&&i<="Z"))throw new S;a=String.fromCharCode(i.charCodeAt(0)+32);break;case"a":if(!(i>="A"&&i<="Z"))throw new S;a=String.fromCharCode(i.charCodeAt(0)-64);break;case"b":if(i>="A"&&i<="E")a=String.fromCharCode(i.charCodeAt(0)-38);else if(i>="F"&&i<="J")a=String.fromCharCode(i.charCodeAt(0)-11);else if(i>="K"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)+16);else if(i>="P"&&i<="T")a=String.fromCharCode(i.charCodeAt(0)+43);else if("U"===i)a="\0";else if("V"===i)a="@";else if("W"===i)a="`";else{if(!(i>="X"&&i<="Z"))throw new S;a=String.fromCharCode(127)}break;case"c":if(i>="A"&&i<="O")a=String.fromCharCode(i.charCodeAt(0)-32);else{if("Z"!==i)throw new S;a=":"}}r+=a,n++}else r+=o}return r},e.prototype.checkChecksums=function(t){var e=t.length;this.checkOneChecksum(t,e-2,20),this.checkOneChecksum(t,e-1,15)},e.prototype.checkOneChecksum=function(t,r,n){for(var o=1,i=0,a=r-1;a>=0;a--)i+=o*e.ALPHABET_STRING.indexOf(t.charAt(a)),++o>n&&(o=1);if(t.charAt(r)!==e.ALPHABET_STRING[i%47])throw new h},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",e.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],e.ASTERISK_ENCODING=e.CHARACTER_ENCODINGS[47],e}(Mt),Ut=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xt=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Gt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.narrowLineWidth=-1,e}return Ut(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a=this.decodeStart(r),s=this.decodeEnd(r),u=new P;e.decodeMiddle(r,a[1],s[0],u);var c=u.toString(),f=null;null!=n&&(f=n.get(E.ALLOWED_LENGTHS)),null==f&&(f=e.DEFAULT_ALLOWED_LENGTHS);var h=c.length,l=!1,d=0;try{for(var p=Xt(f),g=p.next();!g.done;g=p.next()){var y=g.value;if(h===y){l=!0;break}y>d&&(d=y)}}catch(t){o={error:t}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}if(!l&&h>d&&(l=!0),!l)throw new S;var w=[new wt(a[1],t),new wt(s[0],t)];return new Q(c,null,0,w,$.ITF,(new Date).getTime())},e.decodeMiddle=function(t,r,n,o){var i=new Int32Array(10),a=new Int32Array(5),s=new Int32Array(5);for(i.fill(0),a.fill(0),s.fill(0);r0&&n>=0&&!t.get(n);n--)r--;if(0!==r)throw new F},e.skipWhiteSpace=function(t){var e=t.getSize(),r=t.getNextSet(0);if(r===e)throw new F;return r},e.prototype.decodeEnd=function(t){t.reverse();try{var r=e.skipWhiteSpace(t),n=void 0;try{n=e.findGuardPattern(t,r,e.END_PATTERN_REVERSED[0])}catch(o){o instanceof F&&(n=e.findGuardPattern(t,r,e.END_PATTERN_REVERSED[1]))}this.validateQuietZone(t,n[0]);var o=n[0];return n[0]=t.getSize()-n[1],n[1]=t.getSize()-o,n}finally{t.reverse()}},e.findGuardPattern=function(t,r,n){var o=n.length,i=new Int32Array(o),a=t.getSize(),s=!1,u=0,c=r;i.fill(0);for(var f=r;f=0)return n%10;throw new F},e.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],e.MAX_AVG_VARIANCE=.38,e.MAX_INDIVIDUAL_VARIANCE=.5,e.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],e.START_PATTERN=Int32Array.from([1,1,1,1]),e.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],e}(Mt),Wt=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.decodeRowStringBuffer="",e}return Wt(e,t),e.findStartGuardPattern=function(t){for(var r,n=!1,o=0,i=Int32Array.from([0,0,0]);!n;){i=Int32Array.from([0,0,0]);var a=(r=e.findGuardPattern(t,o,!1,this.START_END_PATTERN,i))[0],s=a-((o=r[1])-a);s>=0&&(n=t.isRange(s,a,!1))}return r},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var r=t.length;if(0===r)return!1;var n=parseInt(t.charAt(r-1),10);return e.getStandardUPCEANChecksum(t.substring(0,r-1))===n},e.getStandardUPCEANChecksum=function(t){for(var e=t.length,r=0,n=e-1;n>=0;n-=2){if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new S;r+=o}r*=3;for(n=e-2;n>=0;n-=2){var o;if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new S;r+=o}return(1e3-r)%10},e.decodeEnd=function(t,r){return e.findGuardPattern(t,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e.findGuardPatternWithoutCounters=function(t,e,r,n){return this.findGuardPattern(t,e,r,n,new Int32Array(n.length))},e.findGuardPattern=function(t,r,n,o,i){for(var a=t.getSize(),s=0,u=r=n?t.getNextUnset(r):t.getNextSet(r),c=o.length,f=n,h=r;h=0)return a;throw new F},e.MAX_AVG_VARIANCE=.48,e.MAX_INDIVIDUAL_VARIANCE=.7,e.START_END_PATTERN=Int32Array.from([1,1,1]),e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],e}(Mt),jt=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Yt=function(){function t(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,r,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(r,n,o),a=o.toString(),s=t.parseExtensionString(a),u=[new wt((n[0]+n[1])/2,e),new wt(i,e)],c=new Q(a,null,0,u,$.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&c.putAllMetadata(s),c},t.prototype.decodeMiddle=function(e,r,n){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),u=r[1],c=0,f=0;f<5&&u=10&&(c|=1<<4-f),4!==f&&(u=e.getNextSet(u),u=e.getNextUnset(u))}if(5!==n.length)throw new F;var p=this.determineCheckDigit(c);if(t.extensionChecksum(n.toString())!==p)throw new F;return u},t.extensionChecksum=function(t){for(var e=t.length,r=0,n=e-2;n>=0;n-=2)r+=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);r*=3;for(n=e-1;n>=0;n-=2)r+=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0);return(r*=3)%10},t.prototype.determineCheckDigit=function(t){for(var e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new F},t.parseExtensionString=function(e){if(5!==e.length)return null;var r=t.parseExtension5String(e);return null==r?null:new Map([[et.SUGGESTED_PRICE,r]])},t.parseExtension5String=function(t){var e;switch(t.charAt(0)){case"0":e="£";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e=""}var r=parseInt(t.substring(1)),n=r%100;return e+(r/100).toString()+"."+(n<10?"0"+n:n.toString())},t}(),Zt=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Kt=function(){function t(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,r,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(r,n,o),a=o.toString(),s=t.parseExtensionString(a),u=[new wt((n[0]+n[1])/2,e),new wt(i,e)],c=new Q(a,null,0,u,$.UPC_EAN_EXTENSION,(new Date).getTime());return null!=s&&c.putAllMetadata(s),c},t.prototype.decodeMiddle=function(t,e,r){var n,o,i=this.decodeMiddleCounters;i[0]=0,i[1]=0,i[2]=0,i[3]=0;for(var a=t.getSize(),s=e[1],u=0,c=0;c<2&&s=10&&(u|=1<<1-c),1!==c&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(2!==r.length)throw new F;if(parseInt(r.toString())%4!==u)throw new F;return s},t.parseExtensionString=function(t){return 2!==t.length?null:new Map([[et.ISSUE_NUMBER,parseInt(t)]])},t}(),qt=function(){function t(){}return t.decodeRow=function(t,e,r){var n=zt.findGuardPattern(e,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new Yt).decodeRow(t,e,n)}catch(r){return(new Kt).decodeRow(t,e,n)}},t.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),t}(),Qt=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jt=function(t){function e(){var r=t.call(this)||this;r.decodeRowStringBuffer="",e.L_AND_G_PATTERNS=e.L_PATTERNS.map((function(t){return Int32Array.from(t)}));for(var n=10;n<20;n++){for(var o=e.L_PATTERNS[n-10],i=new Int32Array(o.length),a=0;a=r.getSize()||!r.isRange(p,g,!1))throw new F;var y=c.toString();if(y.length<8)throw new S;if(!e.checkChecksum(y))throw new h;var w=(o[1]+o[0])/2,v=(l[1]+l[0])/2,C=this.getBarcodeFormat(),_=[new wt(w,t),new wt(v,t)],A=new Q(y,null,0,_,C,(new Date).getTime()),m=0;try{var I=qt.decodeRow(t,r,l[1]);A.putMetadata(et.UPC_EAN_EXTENSION,I.getText()),A.putAllMetadata(I.getResultMetadata()),A.addResultPoints(I.getResultPoints()),m=I.getText().length}catch(t){}var T=null==n?null:n.get(E.ALLOWED_EAN_EXTENSIONS);if(null!=T){var O=!1;for(var b in T)if(m.toString()===b){O=!0;break}if(!O)throw new F}return C===$.EAN_13||$.UPC_A,A},e.checkChecksum=function(t){return e.checkStandardUPCEANChecksum(t)},e.checkStandardUPCEANChecksum=function(t){var r=t.length;if(0===r)return!1;var n=parseInt(t.charAt(r-1),10);return e.getStandardUPCEANChecksum(t.substring(0,r-1))===n},e.getStandardUPCEANChecksum=function(t){for(var e=t.length,r=0,n=e-1;n>=0;n-=2){if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new S;r+=o}r*=3;for(n=e-2;n>=0;n-=2){var o;if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||o>9)throw new S;r+=o}return(1e3-r)%10},e.decodeEnd=function(t,r){return e.findGuardPattern(t,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e}(zt),$t=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),te=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ee=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return $t(e,t),e.prototype.decodeMiddle=function(t,r,n){var o,i,a,s,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var c=t.getSize(),f=r[1],h=0,l=0;l<6&&f=10&&(h|=1<<5-l)}n=e.determineFirstDigit(n,h),f=Jt.findGuardPattern(t,f,!0,Jt.MIDDLE_PATTERN,new Int32Array(Jt.MIDDLE_PATTERN.length).fill(0))[1];for(l=0;l<6&&f=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oe=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return re(e,t),e.prototype.decodeMiddle=function(t,e,r){var n,o,i,a,s=this.decodeMiddleCounters;s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var u=t.getSize(),c=e[1],f=0;f<4&&c=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ce=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=new Int32Array(4),e}return se(e,t),e.prototype.decodeMiddle=function(t,r,n){var o,i,a=this.decodeMiddleCounters.map((function(t){return t}));a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),u=r[1],c=0,f=0;f<6&&u=10&&(c|=1<<5-f)}return e.determineNumSysAndCheckDigit(new P(n),c),u},e.prototype.decodeEnd=function(t,r){return e.findGuardPatternWithoutCounters(t,r,!0,e.MIDDLE_END_PATTERN)},e.prototype.checkChecksum=function(t){return Jt.checkChecksum(e.convertUPCEtoUPCA(t))},e.determineNumSysAndCheckDigit=function(t,e){for(var r=0;r<=1;r++)for(var n=0;n<10;n++)if(e===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[r][n])return t.insert(0,"0"+r),void t.append("0"+n);throw F.getNotFoundInstance()},e.prototype.getBarcodeFormat=function(){return $.UPC_E},e.convertUPCEtoUPCA=function(t){var e=t.slice(1,7).split("").map((function(t){return t.charCodeAt(0)})),r=new P;r.append(t.charAt(0));var n=e[5];switch(n){case 0:case 1:case 2:r.appendChars(e,0,2),r.append(n),r.append("0000"),r.appendChars(e,2,3);break;case 3:r.appendChars(e,0,3),r.append("00000"),r.appendChars(e,3,2);break;case 4:r.appendChars(e,0,4),r.append("00000"),r.append(e[4]);break;default:r.appendChars(e,0,5),r.append("0000"),r.append(n)}return t.length>=8&&r.append(t.charAt(7)),r.toString()},e.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],e}(Jt),fe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),he=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},le=function(t){function e(e){var r=t.call(this)||this,n=null==e?null:e.get(E.POSSIBLE_FORMATS),o=[];return null!=n&&(n.indexOf($.EAN_13)>-1&&o.push(new ee),n.indexOf($.UPC_A)>-1&&o.push(new ae),n.indexOf($.EAN_8)>-1&&o.push(new oe),n.indexOf($.UPC_E)>-1&&o.push(new ce)),0===o.length&&(o.push(new ee),o.push(new ae),o.push(new oe),o.push(new ce)),r.readers=o,r}return fe(e,t),e.prototype.decodeRow=function(t,e,r){var n,o;try{for(var i=he(this.readers),a=i.next();!a.done;a=i.next()){var s=a.value;try{var u=s.decodeRow(t,e,r),c=u.getBarcodeFormat()===$.EAN_13&&"0"===u.getText().charAt(0),f=null==r?null:r.get(E.POSSIBLE_FORMATS),h=null==f||f.includes($.UPC_A);if(c&&h){var l=u.getRawBytes(),d=new Q(u.getText().substring(1),l,l?l.length:null,u.getResultPoints(),$.UPC_A);return d.putAllMetadata(u.getResultMetadata()),d}return u}catch(t){}}}catch(t){n={error:t}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new F},e.prototype.reset=function(){var t,e;try{for(var r=he(this.readers),n=r.next();!n.done;n=r.next()){n.value.reset()}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e}(Mt),de=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pe=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},e}return de(e,t),e.prototype.decodeRow=function(t,e,r){var n=this.getValidRowData(e);if(!n)throw new F;var o=this.codaBarDecodeRow(n.row);if(!o)throw new F;return new Q(o,null,0,[new wt(n.left,t),new wt(n.right,t)],$.CODABAR,(new Date).getTime())},e.prototype.getValidRowData=function(t){var e=t.toArray(),r=e.indexOf(!0);if(-1===r)return null;var n=e.lastIndexOf(!0);if(n<=r)return null;for(var o=[],i=(e=e.slice(r,n+1))[0],a=1,s=1;s0;){var n=t.splice(0,8).splice(0,7).map((function(t){return t=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},we=function(t){function e(){var e=t.call(this)||this;return e.decodeFinderCounters=new Int32Array(4),e.dataCharacterCounters=new Int32Array(8),e.oddRoundingErrors=new Array(4),e.evenRoundingErrors=new Array(4),e.oddCounts=new Array(e.dataCharacterCounters.length/2),e.evenCounts=new Array(e.dataCharacterCounters.length/2),e}return ge(e,t),e.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},e.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},e.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},e.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},e.prototype.getOddCounts=function(){return this.oddCounts},e.prototype.getEvenCounts=function(){return this.evenCounts},e.prototype.parseFinderValue=function(t,r){for(var n=0;nn&&(n=e[o],r=o);t[r]++},e.decrement=function(t,e){for(var r=0,n=e[0],o=1;o=e.MIN_FINDER_PATTERN_RATIO&&i<=e.MAX_FINDER_PATTERN_RATIO){var a=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;try{for(var u=ye(t),c=u.next();!c.done;c=u.next()){var f=c.value;f>s&&(s=f),f=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ae=function(){function t(){}return t.getRSSvalue=function(e,r,n){var o,i,a=0;try{for(var s=_e(e),u=s.next();!u.done;u=s.next()){a+=u.value}}catch(t){o={error:t}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}for(var c=0,f=0,h=e.length,l=0;l=h-l-1&&(p-=t.combins(a-d-(h-l),h-l-2)),h-l-1>1){for(var g=0,y=a-d-(h-l-2);y>r;y--)g+=t.combins(a-d-y-1,h-l-3);p-=g*(h-1-l)}else a-d>r&&p--;c+=p}a-=d}return c},t.combins=function(t,e){var r,n;t-e>e?(n=e,r=t-e):(n=t-e,r=e);for(var o=1,i=1,a=t;a>r;a--)o*=a,i<=n&&(o/=i,i++);for(;i<=n;)o/=i,i++;return o},t}(),me=function(){function t(){}return t.buildBitArray=function(t){var e=2*t.length-1;null==t[t.length-1].getRightChar()&&(e-=1);for(var r=new A(12*e),n=0,o=t[0].getRightChar().getValue(),i=11;i>=0;--i)0!=(o&1<=0;--u)0!=(s&1<=0;--u)0!=(c&1<10||n<0||n>10)throw new S;return o.firstDigit=r,o.secondDigit=n,o}return Re(e,t),e.prototype.getFirstDigit=function(){return this.firstDigit},e.prototype.getSecondDigit=function(){return this.secondDigit},e.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},e.prototype.isFirstDigitFNC1=function(){return this.firstDigit===e.FNC1},e.prototype.isSecondDigitFNC1=function(){return this.secondDigit===e.FNC1},e.prototype.isAnyFNC1=function(){return this.firstDigit===e.FNC1||this.secondDigit===e.FNC1},e.FNC1=10,e}(Ie),De=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Me=function(){function t(){}return t.parseFieldsInGeneralPurpose=function(e){var r,n,o,i,a,s,u,c;if(!e)return null;if(e.length<2)throw new F;var f=e.substring(0,2);try{for(var h=De(t.TWO_DIGIT_DATA_LENGTH),l=h.next();!l.done;l=h.next()){if((A=l.value)[0]===f)return A[1]===t.VARIABLE_LENGTH?t.processVariableAI(2,A[2],e):t.processFixedAI(2,A[1],e)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}if(e.length<3)throw new F;var d=e.substring(0,3);try{for(var p=De(t.THREE_DIGIT_DATA_LENGTH),g=p.next();!g.done;g=p.next()){if((A=g.value)[0]===d)return A[1]===t.VARIABLE_LENGTH?t.processVariableAI(3,A[2],e):t.processFixedAI(3,A[1],e)}}catch(t){o={error:t}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}try{for(var y=De(t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),w=y.next();!w.done;w=y.next()){if((A=w.value)[0]===d)return A[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,A[2],e):t.processFixedAI(4,A[1],e)}}catch(t){a={error:t}}finally{try{w&&!w.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}if(e.length<4)throw new F;var v=e.substring(0,4);try{for(var C=De(t.FOUR_DIGIT_DATA_LENGTH),_=C.next();!_.done;_=C.next()){var A;if((A=_.value)[0]===v)return A[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,A[2],e):t.processFixedAI(4,A[1],e)}}catch(t){u={error:t}}finally{try{_&&!_.done&&(c=C.return)&&c.call(C)}finally{if(u)throw u.error}}throw new F},t.processFixedAI=function(e,r,n){if(n.lengththis.information.getSize())return t+4<=this.information.getSize();for(var e=t;ethis.information.getSize()){var e=this.extractNumericValueFromBitArray(t,4);return new Ne(this.information.getSize(),0===e?Ne.FNC1:e-1,Ne.FNC1)}var r=this.extractNumericValueFromBitArray(t,7);return new Ne(t+7,(r-8)/11,(r-8)%11)},t.prototype.extractNumericValueFromBitArray=function(e,r){return t.extractNumericValueFromBitArray(this.information,e,r)},t.extractNumericValueFromBitArray=function(t,e,r){for(var n=0,o=0;othis.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,7);if(r>=64&&r<116)return!0;if(t+8>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,8);return n>=232&&n<253},t.prototype.decodeIsoIec646=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new Te(t+5,Te.FNC1);if(e>=5&&e<15)return new Te(t+5,"0"+(e-5));var r,n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<90)return new Te(t+7,""+(n+1));if(n>=90&&n<116)return new Te(t+7,""+(n+7));switch(this.extractNumericValueFromBitArray(t,8)){case 232:r="!";break;case 233:r='"';break;case 234:r="%";break;case 235:r="&";break;case 236:r="'";break;case 237:r="(";break;case 238:r=")";break;case 239:r="*";break;case 240:r="+";break;case 241:r=",";break;case 242:r="-";break;case 243:r=".";break;case 244:r="/";break;case 245:r=":";break;case 246:r=";";break;case 247:r="<";break;case 248:r="=";break;case 249:r=">";break;case 250:r="?";break;case 251:r="_";break;case 252:r=" ";break;default:throw new S}return new Te(t+8,r)},t.prototype.isStillAlpha=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(t,6);return r>=16&&r<63},t.prototype.decodeAlphanumeric=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new Te(t+5,Te.FNC1);if(e>=5&&e<15)return new Te(t+5,"0"+(e-5));var r,n=this.extractNumericValueFromBitArray(t,6);if(n>=32&&n<58)return new Te(t+6,""+(n+33));switch(n){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new lt("Decoding invalid alphanumeric value: "+n)}return new Te(t+6,r)},t.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<5&&e+tthis.information.getSize())return!1;for(var e=t;ethis.information.getSize())return!1;for(var e=0;e<4&&e+t=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},sr=function(t){function e(){var r=null!==t&&t.apply(this,arguments)||this;return r.pairs=new Array(e.MAX_PAIRS),r.rows=new Array,r.startEnd=[2],r}return ir(e,t),e.prototype.decodeRow=function(t,r,n){this.pairs.length=0,this.startFromEven=!1;try{return e.constructResult(this.decodeRow2pairs(t,r))}catch(t){}return this.pairs.length=0,this.startFromEven=!0,e.constructResult(this.decodeRow2pairs(t,r))},e.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},e.prototype.decodeRow2pairs=function(t,e){for(var r,n=!1;!n;)try{this.pairs.push(this.retrieveNextPair(e,this.pairs,t))}catch(t){if(t instanceof F){if(!this.pairs.length)throw new F;n=!0}}if(this.checkChecksum())return this.pairs;if(r=!!this.rows.length,this.storeRow(t,!1),r){var o=this.checkRowsBoolean(!1);if(null!=o)return o;if(null!=(o=this.checkRowsBoolean(!0)))return o}throw new F},e.prototype.checkRowsBoolean=function(t){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,t&&(this.rows=this.rows.reverse());var e=null;try{e=this.checkRows(new Array,0)}catch(t){console.log(t)}return t&&(this.rows=this.rows.reverse()),e},e.prototype.checkRows=function(t,r){for(var n,o,i=r;ia.length)){for(var s=!0,u=0;ut){i=a.isEquivalent(this.pairs);break}o=a.isEquivalent(this.pairs),n++}i||o||e.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new or(this.pairs,t,r)),this.removePartialRows(this.pairs,this.rows))},e.prototype.removePartialRows=function(t,e){var r,n,o,i,a,s;try{for(var u=ar(e),c=u.next();!c.done;c=u.next()){var f=c.value;if(f.getPairs().length!==t.length){try{for(var h=(o=void 0,ar(f.getPairs())),l=h.next();!l.done;l=h.next()){var d=l.value,p=!1;try{for(var g=(a=void 0,ar(t)),y=g.next();!y.done;y=g.next()){var w=y.value;if(nr.equals(d,w)){p=!0;break}}}catch(t){a={error:t}}finally{try{y&&!y.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}p||!1}}catch(t){o={error:t}}finally{try{l&&!l.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}}}}catch(t){r={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}},e.isPartialRow=function(t,e){var r,n,o,i,a,s;try{for(var u=ar(e),c=u.next();!c.done;c=u.next()){var f=c.value,h=!0;try{for(var l=(o=void 0,ar(t)),d=l.next();!d.done;d=l.next()){var p=d.value,g=!1;try{for(var y=(a=void 0,ar(f.getPairs())),w=y.next();!w.done;w=y.next()){var v=w.value;if(p.equals(v)){g=!0;break}}}catch(t){a={error:t}}finally{try{w&&!w.done&&(s=y.return)&&s.call(y)}finally{if(a)throw a.error}}if(!g){h=!1;break}}}catch(t){o={error:t}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}if(h)return!0}}catch(t){r={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return!1},e.prototype.getRows=function(){return this.rows},e.constructResult=function(t){var e=er(me.buildBitArray(t)).parseInformation(),r=t[0].getFinderPattern().getResultPoints(),n=t[t.length-1].getFinderPattern().getResultPoints(),o=[r[0],r[1],n[0],n[1]];return new Q(e,null,null,o,$.RSS_EXPANDED,null)},e.prototype.checkChecksum=function(){var t=this.pairs.get(0),e=t.getLeftChar(),r=t.getRightChar();if(null===r)return!1;for(var n=r.getChecksumPortion(),o=2,i=1;i=0)i=n;else if(this.isEmptyPair(r))i=0;else{i=r[r.length-1].getFinderPattern().getStartEnd()[1]}var s=r.length%2!=0;this.startFromEven&&(s=!s);for(var u=!1;i=0&&!t.get(s);)s--;s++,o=this.startEnd[0]-s,i=s,a=this.startEnd[1]}else i=this.startEnd[0],o=(a=t.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var u,c=this.getDecodeFinderCounters();d.arraycopy(c,0,c,1,c.length-1),c[0]=o;try{u=this.parseFinderValue(c,e.FINDER_PATTERNS)}catch(t){return null}return new Ce(u,[i,a],i,a,r)},e.prototype.decodeDataCharacter=function(t,r,n,o){for(var i=this.getDataCharacterCounters(),a=0;a.3)throw new F;var l=this.getOddCounts(),d=this.getEvenCounts(),p=this.getOddRoundingErrors(),g=this.getEvenRoundingErrors();for(s=0;s8){if(y>8.7)throw new F;w=8}var v=s/2;0==(1&s)?(l[v]=w,p[v]=y-w):(d[v]=w,g[v]=y-w)}this.adjustOddEvenCounts(17);var C=4*r.getValue()+(n?0:2)+(o?0:1)-1,_=0,A=0;for(s=l.length-1;s>=0;s--){if(e.isNotA1left(r,n,o)){var m=e.WEIGHTS[C][2*s];A+=l[s]*m}_+=l[s]}var E=0;for(s=d.length-1;s>=0;s--)if(e.isNotA1left(r,n,o)){m=e.WEIGHTS[C][2*s+1];E+=d[s]*m}var I=A+E;if(0!=(1&_)||_>13||_<4)throw new F;var S=(13-_)/2,T=e.SYMBOL_WIDEST[S],O=9-T,b=Ae.getRSSvalue(l,T,!0),R=Ae.getRSSvalue(d,O,!1),N=e.EVEN_TOTAL_SUBSET[S],D=e.GSUM[S];return new ve(b*N+R+D,I)},e.isNotA1left=function(t,e,r){return!(0===t.getValue()&&e&&r)},e.prototype.adjustOddEvenCounts=function(t){var r=gt.sum(new Int32Array(this.getOddCounts())),n=gt.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1;r>13?i=!0:r<4&&(o=!0);var a=!1,s=!1;n>13?s=!0:n<4&&(a=!0);var u=r+n-t,c=1==(1&r),f=0==(1&n);if(1===u)if(c){if(f)throw new F;i=!0}else{if(!f)throw new F;s=!0}else if(-1===u)if(c){if(f)throw new F;o=!0}else{if(!f)throw new F;a=!0}else{if(0!==u)throw new F;if(c){if(!f)throw new F;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},lr=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.possibleLeftPairs=[],e.possibleRightPairs=[],e}return fr(e,t),e.prototype.decodeRow=function(t,r,n){var o,i,a,s,u=this.decodePair(r,!1,t,n);e.addOrTally(this.possibleLeftPairs,u),r.reverse();var c=this.decodePair(r,!0,t,n);e.addOrTally(this.possibleRightPairs,c),r.reverse();try{for(var f=hr(this.possibleLeftPairs),h=f.next();!h.done;h=f.next()){var l=h.value;if(l.getCount()>1)try{for(var d=(a=void 0,hr(this.possibleRightPairs)),p=d.next();!p.done;p=d.next()){var g=p.value;if(g.getCount()>1&&e.checkChecksum(l,g))return e.constructResult(l,g)}}catch(t){a={error:t}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}}}catch(t){o={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}throw new F},e.addOrTally=function(t,e){var r,n;if(null!=e){var o=!1;try{for(var i=hr(t),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.getValue()===e.getValue()){s.incrementCount(),o=!0;break}}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}o||t.push(e)}},e.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},e.constructResult=function(t,e){for(var r=4537077*t.getValue()+e.getValue(),n=new String(r).toString(),o=new P,i=13-n.length;i>0;i--)o.append("0");o.append(n);var a=0;for(i=0;i<13;i++){var s=o.charAt(i).charCodeAt(0)-"0".charCodeAt(0);a+=0==(1&i)?3*s:s}10===(a=10-a%10)&&(a=0),o.append(a.toString());var u=t.getFinderPattern().getResultPoints(),c=e.getFinderPattern().getResultPoints();return new Q(o.toString(),null,0,[u[0],u[1],c[0],c[1]],$.RSS_14,(new Date).getTime())},e.checkChecksum=function(t,e){var r=(t.getChecksumPortion()+16*e.getChecksumPortion())%79,n=9*t.getFinderPattern().getValue()+e.getFinderPattern().getValue();return n>72&&n--,n>8&&n--,r===n},e.prototype.decodePair=function(t,e,r,n){try{var o=this.findFinderPattern(t,e),i=this.parseFoundFinderPattern(t,r,e,o),a=null==n?null:n.get(E.NEED_RESULT_POINT_CALLBACK);if(null!=a){var s=(o[0]+o[1])/2;e&&(s=t.getSize()-1-s),a.foundPossibleResultPoint(new wt(s,r))}var u=this.decodeDataCharacter(t,i,!0),c=this.decodeDataCharacter(t,i,!1);return new cr(1597*u.getValue()+c.getValue(),u.getChecksumPortion()+4*c.getChecksumPortion(),i)}catch(t){return null}},e.prototype.decodeDataCharacter=function(t,r,n){for(var o=this.getDataCharacterCounters(),i=0;i8&&(y=8);var w=Math.floor(a/2);0==(1&a)?(h[w]=y,d[w]=g-y):(l[w]=y,p[w]=g-y)}this.adjustOddEvenCounts(n,c);var v=0,C=0;for(a=h.length-1;a>=0;a--)C*=9,C+=h[a],v+=h[a];var _=0,A=0;for(a=l.length-1;a>=0;a--)_*=9,_+=l[a],A+=l[a];var m=C+3*_;if(n){if(0!=(1&v)||v>12||v<4)throw new F;var E=(12-v)/2,I=9-(R=e.OUTSIDE_ODD_WIDEST[E]),S=Ae.getRSSvalue(h,R,!1),T=Ae.getRSSvalue(l,I,!0),O=e.OUTSIDE_EVEN_TOTAL_SUBSET[E],b=e.OUTSIDE_GSUM[E];return new ve(S*O+T+b,m)}if(0!=(1&A)||A>10||A<4)throw new F;E=(10-A)/2,I=9-(R=e.INSIDE_ODD_WIDEST[E]),S=Ae.getRSSvalue(h,R,!0),T=Ae.getRSSvalue(l,I,!1);var R,N=e.INSIDE_ODD_TOTAL_SUBSET[E];b=e.INSIDE_GSUM[E];return new ve(T*N+S+b,m)},e.prototype.findFinderPattern=function(t,e){var r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;for(var n=t.getSize(),o=!1,i=0;i=0&&i!==t.get(a);)a--;a++;var s=o[0]-a,u=this.getDecodeFinderCounters(),c=new Int32Array(u.length);d.arraycopy(u,0,c,1,u.length-1),c[0]=s;var f=this.parseFinderValue(c,e.FINDER_PATTERNS),h=a,l=o[1];return n&&(h=t.getSize()-1-h,l=t.getSize()-1-l),new Ce(f,[a,o[1]],h,l,r)},e.prototype.adjustOddEvenCounts=function(t,e){var r=gt.sum(new Int32Array(this.getOddCounts())),n=gt.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1,a=!1,s=!1;t?(r>12?i=!0:r<4&&(o=!0),n>12?s=!0:n<4&&(a=!0)):(r>11?i=!0:r<5&&(o=!0),n>10?s=!0:n<4&&(a=!0));var u=r+n-e,c=(1&r)==(t?1:0),f=1==(1&n);if(1===u)if(c){if(f)throw new F;i=!0}else{if(!f)throw new F;s=!0}else if(-1===u)if(c){if(f)throw new F;o=!0}else{if(!f)throw new F;a=!0}else{if(0!==u)throw new F;if(c){if(!f)throw new F;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vr=function(){function t(t,e,r){this.ecCodewords=t,this.ecBlocks=[e],r&&this.ecBlocks.push(r)}return t.prototype.getECCodewords=function(){return this.ecCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),Cr=function(){function t(t,e){this.count=t,this.dataCodewords=e}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),_r=function(){function t(t,e,r,n,o,i){var a,s;this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=r,this.dataRegionSizeRows=n,this.dataRegionSizeColumns=o,this.ecBlocks=i;var u=0,c=i.getECCodewords(),f=i.getECBlocks();try{for(var h=wr(f),l=h.next();!l.done;l=h.next()){var d=l.value;u+=d.getCount()*(d.getDataCodewords()+c)}}catch(t){a={error:t}}finally{try{l&&!l.done&&(s=h.return)&&s.call(h)}finally{if(a)throw a.error}}this.totalCodewords=u}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},t.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},t.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},t.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t.getVersionForDimensions=function(e,r){var n,o;if(0!=(1&e)||0!=(1&r))throw new S;try{for(var i=wr(t.VERSIONS),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.symbolSizeRows===e&&s.symbolSizeColumns===r)return s}}catch(t){n={error:t}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new S},t.prototype.toString=function(){return""+this.versionNumber},t.buildVersions=function(){return[new t(1,10,10,8,8,new vr(5,new Cr(1,3))),new t(2,12,12,10,10,new vr(7,new Cr(1,5))),new t(3,14,14,12,12,new vr(10,new Cr(1,8))),new t(4,16,16,14,14,new vr(12,new Cr(1,12))),new t(5,18,18,16,16,new vr(14,new Cr(1,18))),new t(6,20,20,18,18,new vr(18,new Cr(1,22))),new t(7,22,22,20,20,new vr(20,new Cr(1,30))),new t(8,24,24,22,22,new vr(24,new Cr(1,36))),new t(9,26,26,24,24,new vr(28,new Cr(1,44))),new t(10,32,32,14,14,new vr(36,new Cr(1,62))),new t(11,36,36,16,16,new vr(42,new Cr(1,86))),new t(12,40,40,18,18,new vr(48,new Cr(1,114))),new t(13,44,44,20,20,new vr(56,new Cr(1,144))),new t(14,48,48,22,22,new vr(68,new Cr(1,174))),new t(15,52,52,24,24,new vr(42,new Cr(2,102))),new t(16,64,64,14,14,new vr(56,new Cr(2,140))),new t(17,72,72,16,16,new vr(36,new Cr(4,92))),new t(18,80,80,18,18,new vr(48,new Cr(4,114))),new t(19,88,88,20,20,new vr(56,new Cr(4,144))),new t(20,96,96,22,22,new vr(68,new Cr(4,174))),new t(21,104,104,24,24,new vr(56,new Cr(6,136))),new t(22,120,120,18,18,new vr(68,new Cr(6,175))),new t(23,132,132,20,20,new vr(62,new Cr(8,163))),new t(24,144,144,22,22,new vr(62,new Cr(8,156),new Cr(2,155))),new t(25,8,18,6,16,new vr(7,new Cr(1,5))),new t(26,8,32,6,14,new vr(11,new Cr(1,10))),new t(27,12,26,10,24,new vr(14,new Cr(1,16))),new t(28,12,36,10,16,new vr(18,new Cr(1,22))),new t(29,16,36,14,16,new vr(24,new Cr(1,32))),new t(30,16,48,14,22,new vr(28,new Cr(1,49)))]},t.VERSIONS=t.buildVersions(),t}(),Ar=function(){function t(e){var r=e.getHeight();if(r<8||r>144||0!=(1&r))throw new S;this.version=t.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new B(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return t.prototype.getVersion=function(){return this.version},t.readVersion=function(t){var e=t.getHeight(),r=t.getWidth();return _r.getVersionForDimensions(e,r)},t.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),e=0,r=4,n=0,o=this.mappingBitMatrix.getHeight(),i=this.mappingBitMatrix.getWidth(),a=!1,s=!1,u=!1,c=!1;do{if(r!==o||0!==n||a)if(r!==o-2||0!==n||0==(3&i)||s)if(r!==o+4||2!==n||0!=(7&i)||u)if(r!==o-2||0!==n||4!=(7&i)||c){do{r=0&&!this.readMappingMatrix.get(n,r)&&(t[e++]=255&this.readUtah(r,n,o,i)),r-=2,n+=2}while(r>=0&&n=0&&n=0);r+=3,n+=1}else t[e++]=255&this.readCorner4(o,i),r-=2,n+=2,c=!0;else t[e++]=255&this.readCorner3(o,i),r-=2,n+=2,u=!0;else t[e++]=255&this.readCorner2(o,i),r-=2,n+=2,s=!0;else t[e++]=255&this.readCorner1(o,i),r-=2,n+=2,a=!0}while(r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Er=function(){function t(t,e){this.numDataCodewords=t,this.codewords=e}return t.getDataBlocks=function(e,r){var n,o,i,a,s=r.getECBlocks(),c=0,f=s.getECBlocks();try{for(var h=mr(f),l=h.next();!l.done;l=h.next()){c+=(w=l.value).getCount()}}catch(t){n={error:t}}finally{try{l&&!l.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}var d=new Array(c),p=0;try{for(var g=mr(f),y=g.next();!y.done;y=g.next())for(var w=y.value,v=0;v7?v-1:v;d[b].codewords[R]=e[E++]}if(E!==e.length)throw new u;return d},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}(),Ir=function(){function t(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}return t.prototype.getBitOffset=function(){return this.bitOffset},t.prototype.getByteOffset=function(){return this.byteOffset},t.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new u(""+t);var e=0,r=this.bitOffset,n=this.byteOffset,o=this.bytes;if(r>0){var i=8-r,a=t>8-a<<(c=i-a);e=(o[n]&s)>>c,t-=a,8===(r+=a)&&(r=0,n++)}if(t>0){for(;t>=8;)e=e<<8|255&o[n],n++,t-=8;if(t>0){var c;s=255>>(c=8-t)<>c,r+=t}}return this.bitOffset=r,this.byteOffset=n,e},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t}();!function(t){t[t.PAD_ENCODE=0]="PAD_ENCODE",t[t.ASCII_ENCODE=1]="ASCII_ENCODE",t[t.C40_ENCODE=2]="C40_ENCODE",t[t.TEXT_ENCODE=3]="TEXT_ENCODE",t[t.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",t[t.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",t[t.BASE256_ENCODE=6]="BASE256_ENCODE"}(rr||(rr={}));var Sr,Tr=function(){function t(){}return t.decode=function(t){var e=new Ir(t),r=new P,n=new P,o=new Array,i=rr.ASCII_ENCODE;do{if(i===rr.ASCII_ENCODE)i=this.decodeAsciiSegment(e,r,n);else{switch(i){case rr.C40_ENCODE:this.decodeC40Segment(e,r);break;case rr.TEXT_ENCODE:this.decodeTextSegment(e,r);break;case rr.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,r);break;case rr.EDIFACT_ENCODE:this.decodeEdifactSegment(e,r);break;case rr.BASE256_ENCODE:this.decodeBase256Segment(e,r,o);break;default:throw new S}i=rr.ASCII_ENCODE}}while(i!==rr.PAD_ENCODE&&e.available()>0);return n.length()>0&&r.append(n.toString()),new rt(t,r.toString(),0===o.length?null:o,null)},t.decodeAsciiSegment=function(t,e,r){var n=!1;do{var o=t.readBits(8);if(0===o)throw new S;if(o<=128)return n&&(o+=128),e.append(String.fromCharCode(o-1)),rr.ASCII_ENCODE;if(129===o)return rr.PAD_ENCODE;if(o<=229){var i=o-130;i<10&&e.append("0"),e.append(""+i)}else switch(o){case 230:return rr.C40_ENCODE;case 231:return rr.BASE256_ENCODE;case 232:e.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:n=!0;break;case 236:e.append("[)>05"),r.insert(0,"");break;case 237:e.append("[)>06"),r.insert(0,"");break;case 238:return rr.ANSIX12_ENCODE;case 239:return rr.TEXT_ENCODE;case 240:return rr.EDIFACT_ENCODE;default:if(254!==o||0!==t.available())throw new S}}while(t.available()>0);return rr.ASCII_ENCODE},t.decodeC40Segment=function(t,e){var r=!1,n=[],o=0;do{if(8===t.available())return;var i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(o){case 0:if(s<3)o=s+1;else{if(!(s0)},t.decodeTextSegment=function(t,e){var r=!1,n=[],o=0;do{if(8===t.available())return;var i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var s=n[a];switch(o){case 0:if(s<3)o=s+1;else{if(!(s0)},t.decodeAnsiX12Segment=function(t,e){var r=[];do{if(8===t.available())return;var n=t.readBits(8);if(254===n)return;this.parseTwoBytes(n,t.readBits(8),r);for(var o=0;o<3;o++){var i=r[o];switch(i){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(i<14)e.append(String.fromCharCode(i+44));else{if(!(i<40))throw new S;e.append(String.fromCharCode(i+51))}}}}while(t.available()>0)},t.parseTwoBytes=function(t,e,r){var n=(t<<8)+e-1,o=Math.floor(n/1600);r[0]=o,n-=1600*o,o=Math.floor(n/40),r[1]=o,r[2]=n-40*o},t.decodeEdifactSegment=function(t,e){do{if(t.available()<=16)return;for(var r=0;r<4;r++){var n=t.readBits(6);if(31===n){var o=8-t.getBitOffset();return void(8!==o&&t.readBits(o))}0==(32&n)&&(n|=64),e.append(String.fromCharCode(n))}}while(t.available()>0)},t.decodeBase256Segment=function(t,e,r){var n,o=1+t.getByteOffset(),i=this.unrandomize255State(t.readBits(8),o++);if((n=0===i?t.available()/8|0:i<250?i:250*(i-249)+this.unrandomize255State(t.readBits(8),o++))<0)throw new S;for(var a=new Uint8Array(n),s=0;s=0?r:r+256},t.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],t.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],t.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],t.TEXT_SHIFT2_SET_CHARS=t.C40_SHIFT2_SET_CHARS,t.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)],t}(),Or=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},br=function(){function t(){this.rsDecoder=new dt(ut.DATA_MATRIX_FIELD_256)}return t.prototype.decode=function(t){var e,r,n=new Ar(t),o=n.getVersion(),i=n.readCodewords(),a=Er.getDataBlocks(i,o),s=0;try{for(var u=Or(a),c=u.next();!c.done;c=u.next()){s+=c.value.getNumDataCodewords()}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}for(var f=new Uint8Array(s),h=a.length,l=0;la&&(c=a,f[0]=e,f[1]=r,f[2]=n,f[3]=o),c>s&&(c=s,f[0]=r,f[1]=n,f[2]=o,f[3]=e),c>u&&(f[0]=n,f[1]=o,f[2]=e,f[3]=r),f},t.prototype.detectSolid2=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i),s=t.shiftPoint(n,o,4*(a+1)),u=t.shiftPoint(o,n,4*(a+1));return this.transitionsBetween(s,r)this.transitionsBetween(u,h)+this.transitionsBetween(c,h)?f:h:f:this.isValid(h)?h:null},t.prototype.shiftToModuleCenter=function(e){var r=e[0],n=e[1],o=e[2],i=e[3],a=this.transitionsBetween(r,i)+1,s=this.transitionsBetween(o,i)+1,u=t.shiftPoint(r,n,4*s),c=t.shiftPoint(o,n,4*a);1==(1&(a=this.transitionsBetween(u,i)+1))&&(a+=1),1==(1&(s=this.transitionsBetween(c,i)+1))&&(s+=1);var f,h,l=(r.getX()+n.getX()+o.getX()+i.getX())/4,d=(r.getY()+n.getY()+o.getY()+i.getY())/4;return r=t.moveAway(r,l,d),n=t.moveAway(n,l,d),o=t.moveAway(o,l,d),i=t.moveAway(i,l,d),u=t.shiftPoint(r,n,4*s),u=t.shiftPoint(u,i,4*a),f=t.shiftPoint(n,r,4*s),f=t.shiftPoint(f,o,4*a),c=t.shiftPoint(o,i,4*s),c=t.shiftPoint(c,n,4*a),h=t.shiftPoint(i,o,4*s),[u,f,c,h=t.shiftPoint(h,r,4*a)]},t.prototype.isValid=function(t){return t.getX()>=0&&t.getX()0&&t.getY()Math.abs(o-r);if(a){var s=r;r=n,n=s,s=o,o=i,i=s}for(var u=Math.abs(o-r),c=Math.abs(i-n),f=-u/2,h=n0){if(y===i)break;y+=h,f-=u}}return d},t}(),Nr=function(){function t(){this.decoder=new br}return t.prototype.decode=function(e,r){var n,o;if(void 0===r&&(r=null),null!=r&&r.has(E.PURE_BARCODE)){var i=t.extractPureBits(e.getBlackMatrix());n=this.decoder.decode(i),o=t.NO_POINTS}else{var a=new Rr(e.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits()),o=a.getPoints()}var s=n.getRawBytes(),u=new Q(n.getText(),s,8*s.length,o,$.DATA_MATRIX,d.currentTimeMillis()),c=n.getByteSegments();null!=c&&u.putMetadata(et.BYTE_SEGMENTS,c);var f=n.getECLevel();return null!=f&&u.putMetadata(et.ERROR_CORRECTION_LEVEL,f),u},t.prototype.reset=function(){},t.extractPureBits=function(t){var e=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(null==e||null==r)throw new F;var n=this.moduleSize(e,t),o=e[1],i=r[1],a=e[0],s=(r[0]-a+1)/n,u=(i-o+1)/n;if(s<=0||u<=0)throw new F;var c=n/2;o+=c,a+=c;for(var f=new B(s,u),h=0;h=t.FOR_BITS.size)throw new u;return t.FOR_BITS.get(e)},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.L=new t(Sr.L,"L",1),t.M=new t(Sr.M,"M",0),t.Q=new t(Sr.Q,"Q",3),t.H=new t(Sr.H,"H",2),t}(),Lr=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Fr=function(){function t(t){this.errorCorrectionLevel=Br.forBits(t>>3&3),this.dataMask=7&t}return t.numBitsDiffering=function(t,e){return _.bitCount(t^e)},t.decodeFormatInformation=function(e,r){var n=t.doDecodeFormatInformation(e,r);return null!==n?n:t.doDecodeFormatInformation(e^t.FORMAT_INFO_MASK_QR,r^t.FORMAT_INFO_MASK_QR)},t.doDecodeFormatInformation=function(e,r){var n,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=Lr(t.FORMAT_INFO_DECODE_LOOKUP),u=s.next();!u.done;u=s.next()){var c=u.value,f=c[0];if(f===e||f===r)return new t(c[1]);var h=t.numBitsDiffering(e,f);h=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},kr=function(){function t(t){for(var e=[],r=1;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Ur=function(){function t(t,e){for(var r,n,o=[],i=2;i40)throw new u;return t.VERSIONS[e-1]},t.decodeVersionInformation=function(e){for(var r=Number.MAX_SAFE_INTEGER,n=0,o=0;o6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),e},t.prototype.toString=function(){return""+this.versionNumber},t.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),t.VERSIONS=[new t(1,new Int32Array(0),new kr(7,new Vr(1,19)),new kr(10,new Vr(1,16)),new kr(13,new Vr(1,13)),new kr(17,new Vr(1,9))),new t(2,Int32Array.from([6,18]),new kr(10,new Vr(1,34)),new kr(16,new Vr(1,28)),new kr(22,new Vr(1,22)),new kr(28,new Vr(1,16))),new t(3,Int32Array.from([6,22]),new kr(15,new Vr(1,55)),new kr(26,new Vr(1,44)),new kr(18,new Vr(2,17)),new kr(22,new Vr(2,13))),new t(4,Int32Array.from([6,26]),new kr(20,new Vr(1,80)),new kr(18,new Vr(2,32)),new kr(26,new Vr(2,24)),new kr(16,new Vr(4,9))),new t(5,Int32Array.from([6,30]),new kr(26,new Vr(1,108)),new kr(24,new Vr(2,43)),new kr(18,new Vr(2,15),new Vr(2,16)),new kr(22,new Vr(2,11),new Vr(2,12))),new t(6,Int32Array.from([6,34]),new kr(18,new Vr(2,68)),new kr(16,new Vr(4,27)),new kr(24,new Vr(4,19)),new kr(28,new Vr(4,15))),new t(7,Int32Array.from([6,22,38]),new kr(20,new Vr(2,78)),new kr(18,new Vr(4,31)),new kr(18,new Vr(2,14),new Vr(4,15)),new kr(26,new Vr(4,13),new Vr(1,14))),new t(8,Int32Array.from([6,24,42]),new kr(24,new Vr(2,97)),new kr(22,new Vr(2,38),new Vr(2,39)),new kr(22,new Vr(4,18),new Vr(2,19)),new kr(26,new Vr(4,14),new Vr(2,15))),new t(9,Int32Array.from([6,26,46]),new kr(30,new Vr(2,116)),new kr(22,new Vr(3,36),new Vr(2,37)),new kr(20,new Vr(4,16),new Vr(4,17)),new kr(24,new Vr(4,12),new Vr(4,13))),new t(10,Int32Array.from([6,28,50]),new kr(18,new Vr(2,68),new Vr(2,69)),new kr(26,new Vr(4,43),new Vr(1,44)),new kr(24,new Vr(6,19),new Vr(2,20)),new kr(28,new Vr(6,15),new Vr(2,16))),new t(11,Int32Array.from([6,30,54]),new kr(20,new Vr(4,81)),new kr(30,new Vr(1,50),new Vr(4,51)),new kr(28,new Vr(4,22),new Vr(4,23)),new kr(24,new Vr(3,12),new Vr(8,13))),new t(12,Int32Array.from([6,32,58]),new kr(24,new Vr(2,92),new Vr(2,93)),new kr(22,new Vr(6,36),new Vr(2,37)),new kr(26,new Vr(4,20),new Vr(6,21)),new kr(28,new Vr(7,14),new Vr(4,15))),new t(13,Int32Array.from([6,34,62]),new kr(26,new Vr(4,107)),new kr(22,new Vr(8,37),new Vr(1,38)),new kr(24,new Vr(8,20),new Vr(4,21)),new kr(22,new Vr(12,11),new Vr(4,12))),new t(14,Int32Array.from([6,26,46,66]),new kr(30,new Vr(3,115),new Vr(1,116)),new kr(24,new Vr(4,40),new Vr(5,41)),new kr(20,new Vr(11,16),new Vr(5,17)),new kr(24,new Vr(11,12),new Vr(5,13))),new t(15,Int32Array.from([6,26,48,70]),new kr(22,new Vr(5,87),new Vr(1,88)),new kr(24,new Vr(5,41),new Vr(5,42)),new kr(30,new Vr(5,24),new Vr(7,25)),new kr(24,new Vr(11,12),new Vr(7,13))),new t(16,Int32Array.from([6,26,50,74]),new kr(24,new Vr(5,98),new Vr(1,99)),new kr(28,new Vr(7,45),new Vr(3,46)),new kr(24,new Vr(15,19),new Vr(2,20)),new kr(30,new Vr(3,15),new Vr(13,16))),new t(17,Int32Array.from([6,30,54,78]),new kr(28,new Vr(1,107),new Vr(5,108)),new kr(28,new Vr(10,46),new Vr(1,47)),new kr(28,new Vr(1,22),new Vr(15,23)),new kr(28,new Vr(2,14),new Vr(17,15))),new t(18,Int32Array.from([6,30,56,82]),new kr(30,new Vr(5,120),new Vr(1,121)),new kr(26,new Vr(9,43),new Vr(4,44)),new kr(28,new Vr(17,22),new Vr(1,23)),new kr(28,new Vr(2,14),new Vr(19,15))),new t(19,Int32Array.from([6,30,58,86]),new kr(28,new Vr(3,113),new Vr(4,114)),new kr(26,new Vr(3,44),new Vr(11,45)),new kr(26,new Vr(17,21),new Vr(4,22)),new kr(26,new Vr(9,13),new Vr(16,14))),new t(20,Int32Array.from([6,34,62,90]),new kr(28,new Vr(3,107),new Vr(5,108)),new kr(26,new Vr(3,41),new Vr(13,42)),new kr(30,new Vr(15,24),new Vr(5,25)),new kr(28,new Vr(15,15),new Vr(10,16))),new t(21,Int32Array.from([6,28,50,72,94]),new kr(28,new Vr(4,116),new Vr(4,117)),new kr(26,new Vr(17,42)),new kr(28,new Vr(17,22),new Vr(6,23)),new kr(30,new Vr(19,16),new Vr(6,17))),new t(22,Int32Array.from([6,26,50,74,98]),new kr(28,new Vr(2,111),new Vr(7,112)),new kr(28,new Vr(17,46)),new kr(30,new Vr(7,24),new Vr(16,25)),new kr(24,new Vr(34,13))),new t(23,Int32Array.from([6,30,54,78,102]),new kr(30,new Vr(4,121),new Vr(5,122)),new kr(28,new Vr(4,47),new Vr(14,48)),new kr(30,new Vr(11,24),new Vr(14,25)),new kr(30,new Vr(16,15),new Vr(14,16))),new t(24,Int32Array.from([6,28,54,80,106]),new kr(30,new Vr(6,117),new Vr(4,118)),new kr(28,new Vr(6,45),new Vr(14,46)),new kr(30,new Vr(11,24),new Vr(16,25)),new kr(30,new Vr(30,16),new Vr(2,17))),new t(25,Int32Array.from([6,32,58,84,110]),new kr(26,new Vr(8,106),new Vr(4,107)),new kr(28,new Vr(8,47),new Vr(13,48)),new kr(30,new Vr(7,24),new Vr(22,25)),new kr(30,new Vr(22,15),new Vr(13,16))),new t(26,Int32Array.from([6,30,58,86,114]),new kr(28,new Vr(10,114),new Vr(2,115)),new kr(28,new Vr(19,46),new Vr(4,47)),new kr(28,new Vr(28,22),new Vr(6,23)),new kr(30,new Vr(33,16),new Vr(4,17))),new t(27,Int32Array.from([6,34,62,90,118]),new kr(30,new Vr(8,122),new Vr(4,123)),new kr(28,new Vr(22,45),new Vr(3,46)),new kr(30,new Vr(8,23),new Vr(26,24)),new kr(30,new Vr(12,15),new Vr(28,16))),new t(28,Int32Array.from([6,26,50,74,98,122]),new kr(30,new Vr(3,117),new Vr(10,118)),new kr(28,new Vr(3,45),new Vr(23,46)),new kr(30,new Vr(4,24),new Vr(31,25)),new kr(30,new Vr(11,15),new Vr(31,16))),new t(29,Int32Array.from([6,30,54,78,102,126]),new kr(30,new Vr(7,116),new Vr(7,117)),new kr(28,new Vr(21,45),new Vr(7,46)),new kr(30,new Vr(1,23),new Vr(37,24)),new kr(30,new Vr(19,15),new Vr(26,16))),new t(30,Int32Array.from([6,26,52,78,104,130]),new kr(30,new Vr(5,115),new Vr(10,116)),new kr(28,new Vr(19,47),new Vr(10,48)),new kr(30,new Vr(15,24),new Vr(25,25)),new kr(30,new Vr(23,15),new Vr(25,16))),new t(31,Int32Array.from([6,30,56,82,108,134]),new kr(30,new Vr(13,115),new Vr(3,116)),new kr(28,new Vr(2,46),new Vr(29,47)),new kr(30,new Vr(42,24),new Vr(1,25)),new kr(30,new Vr(23,15),new Vr(28,16))),new t(32,Int32Array.from([6,34,60,86,112,138]),new kr(30,new Vr(17,115)),new kr(28,new Vr(10,46),new Vr(23,47)),new kr(30,new Vr(10,24),new Vr(35,25)),new kr(30,new Vr(19,15),new Vr(35,16))),new t(33,Int32Array.from([6,30,58,86,114,142]),new kr(30,new Vr(17,115),new Vr(1,116)),new kr(28,new Vr(14,46),new Vr(21,47)),new kr(30,new Vr(29,24),new Vr(19,25)),new kr(30,new Vr(11,15),new Vr(46,16))),new t(34,Int32Array.from([6,34,62,90,118,146]),new kr(30,new Vr(13,115),new Vr(6,116)),new kr(28,new Vr(14,46),new Vr(23,47)),new kr(30,new Vr(44,24),new Vr(7,25)),new kr(30,new Vr(59,16),new Vr(1,17))),new t(35,Int32Array.from([6,30,54,78,102,126,150]),new kr(30,new Vr(12,121),new Vr(7,122)),new kr(28,new Vr(12,47),new Vr(26,48)),new kr(30,new Vr(39,24),new Vr(14,25)),new kr(30,new Vr(22,15),new Vr(41,16))),new t(36,Int32Array.from([6,24,50,76,102,128,154]),new kr(30,new Vr(6,121),new Vr(14,122)),new kr(28,new Vr(6,47),new Vr(34,48)),new kr(30,new Vr(46,24),new Vr(10,25)),new kr(30,new Vr(2,15),new Vr(64,16))),new t(37,Int32Array.from([6,28,54,80,106,132,158]),new kr(30,new Vr(17,122),new Vr(4,123)),new kr(28,new Vr(29,46),new Vr(14,47)),new kr(30,new Vr(49,24),new Vr(10,25)),new kr(30,new Vr(24,15),new Vr(46,16))),new t(38,Int32Array.from([6,32,58,84,110,136,162]),new kr(30,new Vr(4,122),new Vr(18,123)),new kr(28,new Vr(13,46),new Vr(32,47)),new kr(30,new Vr(48,24),new Vr(14,25)),new kr(30,new Vr(42,15),new Vr(32,16))),new t(39,Int32Array.from([6,26,54,82,110,138,166]),new kr(30,new Vr(20,117),new Vr(4,118)),new kr(28,new Vr(40,47),new Vr(7,48)),new kr(30,new Vr(43,24),new Vr(22,25)),new kr(30,new Vr(10,15),new Vr(67,16))),new t(40,Int32Array.from([6,30,58,86,114,142,170]),new kr(30,new Vr(19,118),new Vr(6,119)),new kr(28,new Vr(18,47),new Vr(31,48)),new kr(30,new Vr(34,24),new Vr(34,25)),new kr(30,new Vr(20,15),new Vr(61,16)))],t}();!function(t){t[t.DATA_MASK_000=0]="DATA_MASK_000",t[t.DATA_MASK_001=1]="DATA_MASK_001",t[t.DATA_MASK_010=2]="DATA_MASK_010",t[t.DATA_MASK_011=3]="DATA_MASK_011",t[t.DATA_MASK_100=4]="DATA_MASK_100",t[t.DATA_MASK_101=5]="DATA_MASK_101",t[t.DATA_MASK_110=6]="DATA_MASK_110",t[t.DATA_MASK_111=7]="DATA_MASK_111"}(Pr||(Pr={}));var Xr,Gr=function(){function t(t,e){this.value=t,this.isMasked=e}return t.prototype.unmaskBitMatrix=function(t,e){for(var r=0;r=0;r--)t=this.copyBit(8,r,t);var n=this.bitMatrix.getHeight(),o=0,i=n-7;for(r=n-1;r>=i;r--)o=this.copyBit(8,r,o);for(e=n-8;e=0;o--)for(var i=t-9;i>=n;i--)r=this.copyBit(i,o,r);var a=Ur.decodeVersionInformation(r);if(null!==a&&a.getDimensionForVersion()===t)return this.parsedVersion=a,a;r=0;for(i=5;i>=0;i--)for(o=t-9;o>=n;o--)r=this.copyBit(i,o,r);if(null!==(a=Ur.decodeVersionInformation(r))&&a.getDimensionForVersion()===t)return this.parsedVersion=a,a;throw new S},t.prototype.copyBit=function(t,e,r){return(this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e))?r<<1|1:r<<1},t.prototype.readCodewords=function(){var t=this.readFormatInformation(),e=this.readVersion(),r=Gr.values.get(t.getDataMask()),n=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,n);for(var o=e.buildFunctionPattern(),i=!0,a=new Uint8Array(e.getTotalCodewords()),s=0,u=0,c=0,f=n-1;f>0;f-=2){6===f&&f--;for(var h=0;h=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},jr=function(){function t(t,e){this.numDataCodewords=t,this.codewords=e}return t.getDataBlocks=function(e,r,n){var o,i,a,s;if(e.length!==r.getTotalCodewords())throw new u;var c=r.getECBlocksForLevel(n),f=0,h=c.getECBlocks();try{for(var l=zr(h),d=l.next();!d.done;d=l.next()){f+=(v=d.value).getCount()}}catch(t){o={error:t}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}var p=new Array(f),g=0;try{for(var y=zr(h),w=y.next();!w.done;w=y.next())for(var v=w.value,C=0;C=0;){if(p[E].codewords.length===m)break;E--}E++;var I=m-c.getECCodewordsPerBlock(),S=0;for(C=0;Ct.available())throw new S;for(var n=new Uint8Array(2*r),o=0;r>0;){var i=t.readBits(13),a=i/96<<8&4294967295|i%96;a+=a<959?41377:42657,n[o]=a>>8&255,n[o+1]=255&a,o+=2,r--}try{e.append(D.decode(n,M.GB2312))}catch(t){throw new S(t)}},t.decodeKanjiSegment=function(t,e,r){if(13*r>t.available())throw new S;for(var n=new Uint8Array(2*r),o=0;r>0;){var i=t.readBits(13),a=i/192<<8&4294967295|i%192;a+=a<7936?33088:49472,n[o]=a>>8,n[o+1]=a,o+=2,r--}try{e.append(D.decode(n,M.SHIFT_JIS))}catch(t){throw new S(t)}},t.decodeByteSegment=function(t,e,r,n,o,i){if(8*r>t.available())throw new S;for(var a,s=new Uint8Array(r),u=0;u=t.ALPHANUMERIC_CHARS.length)throw new S;return t.ALPHANUMERIC_CHARS[e]},t.decodeAlphanumericSegment=function(e,r,n,o){for(var i=r.length();n>1;){if(e.available()<11)throw new S;var a=e.readBits(11);r.append(t.toAlphaNumericChar(Math.floor(a/45))),r.append(t.toAlphaNumericChar(a%45)),n-=2}if(1===n){if(e.available()<6)throw new S;r.append(t.toAlphaNumericChar(e.readBits(6)))}if(o)for(var s=i;s=3;){if(e.available()<10)throw new S;var o=e.readBits(10);if(o>=1e3)throw new S;r.append(t.toAlphaNumericChar(Math.floor(o/100))),r.append(t.toAlphaNumericChar(Math.floor(o/10)%10)),r.append(t.toAlphaNumericChar(o%10)),n-=3}if(2===n){if(e.available()<7)throw new S;var i=e.readBits(7);if(i>=100)throw new S;r.append(t.toAlphaNumericChar(Math.floor(i/10))),r.append(t.toAlphaNumericChar(i%10))}else if(1===n){if(e.available()<4)throw new S;var a=e.readBits(4);if(a>=10)throw new S;r.append(t.toAlphaNumericChar(a))}},t.parseECIValue=function(t){var e=t.readBits(8);if(0==(128&e))return 127&e;if(128==(192&e))return(63&e)<<8&4294967295|t.readBits(8);if(192==(224&e))return(31&e)<<16&4294967295|t.readBits(16);throw new S},t.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",t.GB2312_SUBSET=1,t}(),Qr=function(){function t(t){this.mirrored=t}return t.prototype.isMirrored=function(){return this.mirrored},t.prototype.applyMirroredCorrection=function(t){if(this.mirrored&&null!==t&&!(t.length<3)){var e=t[0];t[0]=t[2],t[2]=e}},t}(),Jr=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},$r=function(){function t(){this.rsDecoder=new dt(ut.QR_CODE_FIELD_256)}return t.prototype.decodeBooleanArray=function(t,e){return this.decodeBitMatrix(B.parseFromBooleanArray(t),e)},t.prototype.decodeBitMatrix=function(t,e){var r=new Wr(t),n=null;try{return this.decodeBitMatrixParser(r,e)}catch(t){n=t}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var o=this.decodeBitMatrixParser(r,e);return o.setOther(new Qr(!0)),o}catch(t){if(null!==n)throw n;throw t}},t.prototype.decodeBitMatrixParser=function(t,e){var r,n,o,i,a=t.readVersion(),s=t.readFormatInformation().getErrorCorrectionLevel(),u=t.readCodewords(),c=jr.getDataBlocks(u,a,s),f=0;try{for(var h=Jr(c),l=h.next();!l.done;l=h.next()){f+=(w=l.value).getNumDataCodewords()}}catch(t){r={error:t}}finally{try{l&&!l.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}var d=new Uint8Array(f),p=0;try{for(var g=Jr(c),y=g.next();!y.done;y=g.next()){var w,v=(w=y.value).getCodewords(),C=w.getNumDataCodewords();this.correctErrors(v,C);for(var _=0;_=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},nn=function(){function t(t,e,r,n,o,i,a){this.image=t,this.startX=e,this.startY=r,this.width=n,this.height=o,this.moduleSize=i,this.resultPointCallback=a,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return t.prototype.find=function(){for(var t=this.startX,e=this.height,r=t+this.width,n=this.startY+e/2,o=new Int32Array(3),i=this.image,a=0;a=r)return!1;return!0},t.prototype.crossCheckVertical=function(e,r,n,o){var i=this.image,a=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var u=e;u>=0&&i.get(r,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&!i.get(r,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;un)return NaN;for(;un)return NaN;var c=s[0]+s[1]+s[2];return 5*Math.abs(c-o)>=2*o?NaN:this.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.handlePossibleCenter=function(e,r,n){var o,i,a=e[0]+e[1]+e[2],s=t.centerFromEnd(e,n),u=this.crossCheckVertical(r,s,2*e[1],a);if(!isNaN(u)){var c=(e[0]+e[1]+e[2])/3;try{for(var f=rn(this.possibleCenters),h=f.next();!h.done;h=f.next()){var l=h.value;if(l.aboutEquals(c,u,s))return l.combineEstimate(u,s,c)}}catch(t){o={error:t}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}var d=new en(s,u,c);this.possibleCenters.push(d),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(d)}return null},t}(),on=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),an=function(t){function e(e,r,n,o){var i=t.call(this,e,r)||this;return i.estimatedModuleSize=n,i.count=o,void 0===o&&(i.count=1),i}return on(e,t),e.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},e.prototype.getCount=function(){return this.count},e.prototype.aboutEquals=function(t,e,r){if(Math.abs(e-this.getY())<=t&&Math.abs(r-this.getX())<=t){var n=Math.abs(t-this.estimatedModuleSize);return n<=1||n<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(t,r,n){var o=this.count+1;return new e((this.count*this.getX()+r)/o,(this.count*this.getY()+t)/o,(this.count*this.estimatedModuleSize+n)/o,o)},e}(wt),sn=function(){function t(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}return t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t}(),un=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},cn=function(){function t(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}return t.prototype.getImage=function(){return this.image},t.prototype.getPossibleCenters=function(){return this.possibleCenters},t.prototype.find=function(e){var r=null!=e&&void 0!==e.get(E.TRY_HARDER),n=null!=e&&void 0!==e.get(E.PURE_BARCODE),o=this.image,i=o.getHeight(),a=o.getWidth(),s=Math.floor(3*i/(4*t.MAX_MODULES));(sc[2]&&(f+=d-c[2]-s,l=a-1)}h=0,c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0}else c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,h=3;else c[++h]++;else c[h]++;if(t.foundPatternCross(c))!0===this.handlePossibleCenter(c,f,a,n)&&(s=c[0],this.hasSkipped&&(u=this.haveMultiplyConfirmedCenters()))}var p=this.selectBestPatterns();return wt.orderBestPatterns(p),new sn(p)},t.centerFromEnd=function(t,e){return e-t[4]-t[3]-t[2]/2},t.foundPatternCross=function(t){for(var e=0,r=0;r<5;r++){var n=t[r];if(0===n)return!1;e+=n}if(e<7)return!1;var o=e/7,i=o/2;return Math.abs(o-t[0])=a&&r>=a&&s.get(r-a,e-a);)i[2]++,a++;if(e=a&&r>=a&&!s.get(r-a,e-a)&&i[1]<=n;)i[1]++,a++;if(en)return!1;for(;e>=a&&r>=a&&s.get(r-a,e-a)&&i[0]<=n;)i[0]++,a++;if(i[0]>n)return!1;var u=s.getHeight(),c=s.getWidth();for(a=1;e+a=u||r+a>=c)return!1;for(;e+a=u||r+a>=c||i[3]>=n)return!1;for(;e+a=n)return!1;var f=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(f-o)<2*o&&t.foundPatternCross(i)},t.prototype.crossCheckVertical=function(e,r,n,o){for(var i=this.image,a=i.getHeight(),s=this.getCrossCheckStateCount(),u=e;u>=0&&i.get(r,u);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!i.get(r,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&i.get(r,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;u=n)return NaN;for(;u=n)return NaN;var c=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(c-o)>=2*o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.crossCheckHorizontal=function(e,r,n,o){for(var i=this.image,a=i.getWidth(),s=this.getCrossCheckStateCount(),u=e;u>=0&&i.get(u,r);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!i.get(u,r)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&i.get(u,r)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=e+1;u=n)return NaN;for(;u=n)return NaN;var c=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(c-o)>=o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,u):NaN},t.prototype.handlePossibleCenter=function(e,r,n,o){var i=e[0]+e[1]+e[2]+e[3]+e[4],a=t.centerFromEnd(e,n),s=this.crossCheckVertical(r,Math.floor(a),e[2],i);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),e[2],i),!isNaN(a)&&(!o||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),e[2],i)))){for(var u=i/7,c=!1,f=this.possibleCenters,h=0,l=f.length;h=t.CENTER_QUORUM){if(null!=n)return this.hasSkipped=!0,Math.floor((Math.abs(n.getX()-a.getX())-Math.abs(n.getY()-a.getY()))/2);n=a}}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return 0},t.prototype.haveMultiplyConfirmedCenters=function(){var e,r,n,o,i=0,a=0,s=this.possibleCenters.length;try{for(var u=un(this.possibleCenters),c=u.next();!c.done;c=u.next()){(p=c.value).getCount()>=t.CENTER_QUORUM&&(i++,a+=p.getEstimatedModuleSize())}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(e)throw e.error}}if(i<3)return!1;var f=a/s,h=0;try{for(var l=un(this.possibleCenters),d=l.next();!d.done;d=l.next()){var p=d.value;h+=Math.abs(p.getEstimatedModuleSize()-f)}}catch(t){n={error:t}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}return h<=.05*a},t.prototype.selectBestPatterns=function(){var t,e,r,n,o=this.possibleCenters.length;if(o<3)throw new F;var i,a=this.possibleCenters;if(o>3){var s=0,u=0;try{for(var c=un(this.possibleCenters),f=c.next();!f.done;f=c.next()){var h=f.value.getEstimatedModuleSize();s+=h,u+=h*h}}catch(e){t={error:e}}finally{try{f&&!f.done&&(e=c.return)&&e.call(c)}finally{if(t)throw t.error}}i=s/o;var l=Math.sqrt(u/o-i*i);a.sort((function(t,e){var r=Math.abs(e.getEstimatedModuleSize()-i),n=Math.abs(t.getEstimatedModuleSize()-i);return rn?1:0}));for(var d=Math.max(.2*i,l),p=0;p3;p++){var g=a[p];Math.abs(g.getEstimatedModuleSize()-i)>d&&(a.splice(p,1),p--)}}if(a.length>3){s=0;try{for(var y=un(a),w=y.next();!w.done;w=y.next()){s+=w.value.getEstimatedModuleSize()}}catch(t){r={error:t}}finally{try{w&&!w.done&&(n=y.return)&&n.call(y)}finally{if(r)throw r.error}}i=s/a.length,a.sort((function(t,e){if(e.getCount()===t.getCount()){var r=Math.abs(e.getEstimatedModuleSize()-i),n=Math.abs(t.getEstimatedModuleSize()-i);return rn?-1:0}return e.getCount()-t.getCount()})),a.splice(3)}return[a[0],a[1],a[2]]},t.CENTER_QUORUM=2,t.MIN_SKIP=3,t.MAX_MODULES=57,t}(),fn=function(){function t(t){this.image=t}return t.prototype.getImage=function(){return this.image},t.prototype.getResultPointCallback=function(){return this.resultPointCallback},t.prototype.detect=function(t){this.resultPointCallback=null==t?null:t.get(E.NEED_RESULT_POINT_CALLBACK);var e=new cn(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(e)},t.prototype.processFinderPatternInfo=function(e){var r=e.getTopLeft(),n=e.getTopRight(),o=e.getBottomLeft(),i=this.calculateModuleSize(r,n,o);if(i<1)throw new F("No pattern found in proccess finder.");var a=t.computeDimension(r,n,o,i),s=Ur.getProvisionalVersionForDimension(a),u=s.getDimensionForVersion()-7,c=null;if(s.getAlignmentPatternCenters().length>0)for(var f=n.getX()-r.getX()+o.getX(),h=n.getY()-r.getY()+o.getY(),l=1-3/u,d=Math.floor(r.getX()+l*(f-r.getX())),p=Math.floor(r.getY()+l*(h-r.getY())),g=4;g<=16;g<<=1)try{c=this.findAlignmentInRegion(i,d,p,g);break}catch(t){if(!(t instanceof F))throw t}var y=t.createTransform(r,n,o,c,a),w=t.sampleGrid(this.image,y,a);return new vt(w,null===c?[o,r,n]:[o,r,n,c])},t.createTransform=function(t,e,r,n,o){var i,a,s,u,c=o-3.5;return null!==n?(i=n.getX(),a=n.getY(),u=s=c-3):(i=e.getX()-t.getX()+r.getX(),a=e.getY()-t.getY()+r.getY(),s=c,u=c),Et.quadrilateralToQuadrilateral(3.5,3.5,c,3.5,s,u,3.5,c,t.getX(),t.getY(),e.getX(),e.getY(),i,a,r.getX(),r.getY())},t.sampleGrid=function(t,e,r){return Tt.getInstance().sampleGridWithTransform(t,r,r,e)},t.computeDimension=function(t,e,r,n){var o=gt.round(wt.distance(t,e)/n),i=gt.round(wt.distance(t,r)/n),a=Math.floor((o+i)/2)+7;switch(3&a){case 0:a++;break;case 2:a--;break;case 3:throw new F("Dimensions could be not found.")}return a},t.prototype.calculateModuleSize=function(t,e,r){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,r))/2},t.prototype.calculateModuleSizeOneWay=function(t,e){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY())),n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(r)?n/7:isNaN(n)?r/7:(r+n)/14},t.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,e,r,n){var o=this.sizeOfBlackWhiteBlackRun(t,e,r,n),i=1,a=t-(r-t);a<0?(i=t/(t-a),a=0):a>=this.image.getWidth()&&(i=(this.image.getWidth()-1-t)/(a-t),a=this.image.getWidth()-1);var s=Math.floor(e-(n-e)*i);return i=1,s<0?(i=e/(e-s),s=0):s>=this.image.getHeight()&&(i=(this.image.getHeight()-1-e)/(s-e),s=this.image.getHeight()-1),a=Math.floor(t+(a-t)*i),(o+=this.sizeOfBlackWhiteBlackRun(t,e,a,s))-1},t.prototype.sizeOfBlackWhiteBlackRun=function(t,e,r,n){var o=Math.abs(n-e)>Math.abs(r-t);if(o){var i=t;t=e,e=i,i=r,r=n,n=i}for(var a=Math.abs(r-t),s=Math.abs(n-e),u=-a/2,c=t0){if(p===n)break;p+=f,u-=a}}return 2===h?gt.distance(r+c,n,t,e):NaN},t.prototype.findAlignmentInRegion=function(t,e,r,n){var o=Math.floor(n*t),i=Math.max(0,e-o),a=Math.min(this.image.getWidth()-1,e+o);if(a-i<3*t)throw new F("Alignment top exceeds estimated module size.");var s=Math.max(0,r-o),u=Math.min(this.image.getHeight()-1,r+o);if(u-s<3*t)throw new F("Alignment bottom exceeds estimated module size.");return new nn(this.image,i,s,a-i,u-s,t,this.resultPointCallback).find()},t}(),hn=function(){function t(){this.decoder=new $r}return t.prototype.getDecoder=function(){return this.decoder},t.prototype.decode=function(e,r){var n,o;if(null!=r&&void 0!==r.get(E.PURE_BARCODE)){var i=t.extractPureBits(e.getBlackMatrix());n=this.decoder.decodeBitMatrix(i,r),o=t.NO_POINTS}else{var a=new fn(e.getBlackMatrix()).detect(r);n=this.decoder.decodeBitMatrix(a.getBits(),r),o=a.getPoints()}n.getOther()instanceof Qr&&n.getOther().applyMirroredCorrection(o);var s=new Q(n.getText(),n.getRawBytes(),void 0,o,$.QR_CODE,void 0),u=n.getByteSegments();null!==u&&s.putMetadata(et.BYTE_SEGMENTS,u);var c=n.getECLevel();return null!==c&&s.putMetadata(et.ERROR_CORRECTION_LEVEL,c),n.hasStructuredAppend()&&(s.putMetadata(et.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),s.putMetadata(et.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),s},t.prototype.reset=function(){},t.extractPureBits=function(t){var e=t.getTopLeftOnBit(),r=t.getBottomRightOnBit();if(null===e||null===r)throw new F;var n=this.moduleSize(e,t),o=e[1],i=r[1],a=e[0],s=r[0];if(a>=s||o>=i)throw new F;if(i-o!=s-a&&(s=a+(i-o))>=t.getWidth())throw new F;var u=Math.round((s-a+1)/n),c=Math.round((i-o+1)/n);if(u<=0||c<=0)throw new F;if(c!==u)throw new F;var f=Math.floor(n/2);o+=f;var h=(a+=f)+Math.floor((u-1)*n)-s;if(h>0){if(h>f)throw new F;a-=h}var l=o+Math.floor((c-1)*n)-i;if(l>0){if(l>f)throw new F;o-=l}for(var d=new B(u,c),p=0;p=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},dn=function(){function t(){}return t.prototype.PDF417Common=function(){},t.getBitCountSum=function(t){return gt.sum(t)},t.toIntArray=function(e){var r,n;if(null==e||!e.length)return t.EMPTY_INT_ARRAY;var o=new Int32Array(e.length),i=0;try{for(var a=ln(e),s=a.next();!s.done;s=a.next()){var u=s.value;o[i++]=u}}catch(t){r={error:t}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o},t.getCodeword=function(e){var r=C.binarySearch(t.SYMBOL_TABLE,262143&e);return r<0?-1:(t.CODEWORD_TABLE[r]-1)%t.NUMBER_OF_CODEWORDS},t.NUMBER_OF_CODEWORDS=929,t.MAX_CODEWORDS_IN_BARCODE=t.NUMBER_OF_CODEWORDS-1,t.MIN_ROWS_IN_BARCODE=3,t.MAX_ROWS_IN_BARCODE=90,t.MODULES_IN_CODEWORD=17,t.MODULES_IN_STOP_PATTERN=18,t.BARS_IN_MODULE=8,t.EMPTY_INT_ARRAY=new Int32Array([]),t.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),t.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),t}(),pn=function(){function t(t,e){this.bits=t,this.points=e}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),gn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},yn=function(){function t(){}return t.detectMultiple=function(e,r,n){var o=e.getBlackMatrix(),i=t.detect(n,o);return i.length||((o=o.clone()).rotate180(),i=t.detect(n,o)),new pn(o,i)},t.detect=function(e,r){for(var n,o,i=new Array,a=0,s=0,u=!1;a0;){if(null==(l=t.findGuardPattern(e,i,--o,n,!1,a,c))){o++;break}d=l}s[0]=new wt(d[0],o),s[1]=new wt(d[1],o),u=!0;break}}var f=o+1;if(u){for(var h=0,l=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);ft.SKIPPED_ROW_COUNT_MAX)break;h++}}f-=h+1,s[2]=new wt(l[0],f),s[3]=new wt(l[1],f)}return f-o0&&c++h?f-h:h-f;if(l>r)return 1/0;u+=l}return u/o},t.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),t.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),t.MAX_AVG_VARIANCE=.42,t.MAX_INDIVIDUAL_VARIANCE=.8,t.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),t.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),t.MAX_PIXEL_DRIFT=3,t.MAX_PATTERN_DRIFT=5,t.SKIPPED_ROW_COUNT_MAX=25,t.ROW_STEP=5,t.BARCODE_MIN_HEIGHT=10,t}(),wn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vn=function(){function t(t,e){if(0===e.length)throw new u;this.field=t;var r=e.length;if(r>1&&0===e[0]){for(var n=1;nn.length){var o=r;r=n,n=o}var i=new Int32Array(n.length),a=n.length-r.length;d.arraycopy(n,0,i,0,a);for(var s=a;s=0;e--){var r=this.getCoefficient(e);0!==r&&(r<0?(t.append(" - "),r=-r):t.length()>0&&t.append(" + "),0!==e&&1===r||t.append(r),0!==e&&(1===e?t.append("x"):(t.append("x^"),t.append(e))))}return t.toString()},t}(),Cn=function(){function t(){}return t.prototype.add=function(t,e){return(t+e)%this.modulus},t.prototype.subtract=function(t,e){return(this.modulus+t-e)%this.modulus},t.prototype.exp=function(t){return this.expTable[t]},t.prototype.log=function(t){if(0===t)throw new u;return this.logTable[t]},t.prototype.inverse=function(t){if(0===t)throw new at;return this.expTable[this.modulus-this.logTable[t]-1]},t.prototype.multiply=function(t,e){return 0===t||0===e?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]},t.prototype.getSize=function(){return this.modulus},t.prototype.equals=function(t){return t===this},t}(),_n=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),An=function(t){function e(e,r){var n=t.call(this)||this;n.modulus=e,n.expTable=new Int32Array(e),n.logTable=new Int32Array(e);for(var o=1,i=0;i=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},En=function(){function t(){this.field=An.PDF417_GF}return t.prototype.decode=function(t,e,r){for(var n,o,i=new vn(this.field,t),a=new Int32Array(e),s=!1,u=e;u>0;u--){var c=i.evaluateAt(this.field.exp(u));a[e-u]=c,0!==c&&(s=!0)}if(!s)return 0;var f=this.field.getOne();if(null!=r)try{for(var l=mn(r),d=l.next();!d.done;d=l.next()){var p=d.value,g=this.field.exp(t.length-1-p),y=new vn(this.field,new Int32Array([this.field.subtract(0,g),1]));f=f.multiply(y)}}catch(t){n={error:t}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}var w=new vn(this.field,a),v=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),w,e),C=v[0],_=v[1],A=this.findErrorLocations(C),m=this.findErrorMagnitudes(_,C,A);for(u=0;u=Math.round(r/2);){var u=o,c=a;if(a=s,(o=i).isZero())throw h.getChecksumInstance();i=u;for(var f=this.field.getZero(),l=o.getCoefficient(o.getDegree()),d=this.field.inverse(l);i.getDegree()>=o.getDegree()&&!i.isZero();){var p=i.getDegree()-o.getDegree(),g=this.field.multiply(i.getCoefficient(i.getDegree()),d);f=f.add(this.field.buildMonomial(p,g)),i=i.subtract(o.multiplyByMonomial(p,g))}s=f.multiply(a).subtract(c).negative()}var y=s.getCoefficient(0);if(0===y)throw h.getChecksumInstance();var w=this.field.inverse(y);return[s.multiply(w),i.multiply(w)]},t.prototype.findErrorLocations=function(t){for(var e=t.getDegree(),r=new Int32Array(e),n=0,o=1;o0){var u=n?this.topLeft:this.topRight,c=Math.trunc(u.getY()-e);c<0&&(c=0);var f=new wt(u.getX(),c);n?o=f:a=f}if(r>0){var h=n?this.bottomLeft:this.bottomRight,l=Math.trunc(h.getY()+r);l>=this.image.getHeight()&&(l=this.image.getHeight()-1);var d=new wt(h.getX(),l);n?i=d:s=d}return new t(this.image,o,i,a,s)},t.prototype.getMinX=function(){return this.minX},t.prototype.getMaxX=function(){return this.maxX},t.prototype.getMinY=function(){return this.minY},t.prototype.getMaxY=function(){return this.maxY},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getBottomRight=function(){return this.bottomRight},t}(),Sn=function(){function t(t,e,r,n){this.columnCount=t,this.errorCorrectionLevel=n,this.rowCountUpperPart=e,this.rowCountLowerPart=r,this.rowCount=e+r}return t.prototype.getColumnCount=function(){return this.columnCount},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getRowCount=function(){return this.rowCount},t.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},t.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},t}(),Tn=function(){function t(){this.buffer=""}return t.form=function(t,e){var r=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,(function(t,n,o,i,a,s){if("%%"===t)return"%";if(void 0!==e[++r]){t=i?parseInt(i.substr(1)):void 0;var u,c=a?parseInt(a.substr(1)):void 0;switch(s){case"s":u=e[r];break;case"c":u=e[r][0];break;case"f":u=parseFloat(e[r]).toFixed(t);break;case"p":u=parseFloat(e[r]).toPrecision(t);break;case"e":u=parseFloat(e[r]).toExponential(t);break;case"x":u=parseInt(e[r]).toString(c||16);break;case"d":u=parseFloat(parseInt(e[r],c||10).toPrecision(t)).toFixed(0)}u="object"==typeof u?JSON.stringify(u):(+u).toString(c);for(var f=parseInt(o),h=o&&o[0]+""=="0"?"0":" ";u.length=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},bn=function(){function t(t){this.boundingBox=new In(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}return t.prototype.getCodewordNearby=function(e){var r=this.getCodeword(e);if(null!=r)return r;for(var n=1;n=0&&null!=(r=this.codewords[o]))return r;if((o=this.imageRowToCodewordIndex(e)+n)=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Nn=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Dn=function(){function t(){this.values=new Map}return t.prototype.setValue=function(t){t=Math.trunc(t);var e=this.values.get(t);null==e&&(e=0),e++,this.values.set(t,e)},t.prototype.getValue=function(){var t,e,r=-1,n=new Array,o=function(t,e){var o=function(){return t},i=function(){return e};i()>r?(r=i(),(n=[]).push(o())):i()===r&&n.push(o())};try{for(var i=Rn(this.values.entries()),a=i.next();!a.done;a=i.next()){var s=Nn(a.value,2);o(s[0],s[1])}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return dn.toIntArray(n)},t.prototype.getConfidence=function(t){return this.values.get(t)},t}(),Mn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pn=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Bn=function(t){function e(e,r){var n=t.call(this,e)||this;return n._isLeft=r,n}return Mn(e,t),e.prototype.setRowNumbers=function(){var t,e;try{for(var r=Pn(this.getCodewords()),n=r.next();!n.done;n=r.next()){var o=n.value;null!=o&&o.setRowNumberAsRowIndicatorColumn()}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e.prototype.adjustCompleteIndicatorColumnRowNumbers=function(t){var e=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(e,t);for(var r=this.getBoundingBox(),n=this._isLeft?r.getTopLeft():r.getTopRight(),o=this._isLeft?r.getBottomLeft():r.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=-1,u=1,c=0,f=i;f=t.getRowCount()||l>f)e[f]=null;else{for(var d=void 0,p=(d=u>2?(u-2)*l:l)>=f,g=1;g<=d&&!p;g++)p=null!=e[f-g];p?e[f]=null:(s=h.getRowNumber(),c=1)}}},e.prototype.getRowHeights=function(){var t,e,r=this.getBarcodeMetadata();if(null==r)return null;this.adjustIncompleteIndicatorColumnRowNumbers(r);var n=new Int32Array(r.getRowCount());try{for(var o=Pn(this.getCodewords()),i=o.next();!i.done;i=o.next()){var a=i.value;if(null!=a){var s=a.getRowNumber();if(s>=n.length)continue;n[s]++}}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},e.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(t){for(var e=this.getBoundingBox(),r=this._isLeft?e.getTopLeft():e.getTopRight(),n=this._isLeft?e.getBottomLeft():e.getBottomRight(),o=this.imageRowToCodewordIndex(Math.trunc(r.getY())),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),a=this.getCodewords(),s=-1,u=o;u=t.getRowCount()?a[u]=null:s=c.getRowNumber())}},e.prototype.getBarcodeMetadata=function(){var t,e,r=this.getCodewords(),n=new Dn,o=new Dn,i=new Dn,a=new Dn;try{for(var s=Pn(r),u=s.next();!u.done;u=s.next()){var c=u.value;if(null!=c){c.setRowNumberAsRowIndicatorColumn();var f=c.getValue()%30,h=c.getRowNumber();switch(this._isLeft||(h+=2),h%3){case 0:o.setValue(3*f+1);break;case 1:a.setValue(f/3),i.setValue(f%3);break;case 2:n.setValue(f+1)}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}if(0===n.getValue().length||0===o.getValue().length||0===i.getValue().length||0===a.getValue().length||n.getValue()[0]<1||o.getValue()[0]+i.getValue()[0]dn.MAX_ROWS_IN_BARCODE)return null;var l=new Sn(n.getValue()[0],o.getValue()[0],i.getValue()[0],a.getValue()[0]);return this.removeIncorrectCodewords(r,l),l},e.prototype.removeIncorrectCodewords=function(t,e){for(var r=0;re.getRowCount())t[r]=null;else switch(this._isLeft||(i+=2),i%3){case 0:3*o+1!==e.getRowCountUpperPart()&&(t[r]=null);break;case 1:Math.trunc(o/3)===e.getErrorCorrectionLevel()&&o%3===e.getRowCountLowerPart()||(t[r]=null);break;case 2:o+1!==e.getColumnCount()&&(t[r]=null)}}}},e.prototype.isLeft=function(){return this._isLeft},e.prototype.toString=function(){return"IsLeft: "+this._isLeft+"\n"+t.prototype.toString.call(this)},e}(bn),Ln=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Fn=function(){function t(t,e){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=e,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return t.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var t,e=dn.MAX_CODEWORDS_IN_BARCODE;do{t=e,e=this.adjustRowNumbersAndGetCount()}while(e>0&&e0&&i0&&(c[0]=n[r-1],c[4]=s[r-1],c[5]=u[r-1]),r>1&&(c[8]=n[r-2],c[10]=s[r-2],c[11]=u[r-2]),r>=1;n=1&r,t.RATIOS_TABLE[e]||(t.RATIOS_TABLE[e]=new Array(dn.BARS_IN_MODULE)),t.RATIOS_TABLE[e][dn.BARS_IN_MODULE-o-1]=Math.fround(i/dn.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},t.getDecodedValue=function(e){var r=t.getDecodedCodewordValue(t.sampleBitCounts(e));return-1!==r?r:t.getClosestDecodedValue(e)},t.sampleBitCounts=function(t){for(var e=gt.sum(t),r=new Int32Array(dn.BARS_IN_MODULE),n=0,o=0,i=0;i1)for(var o=0;o=i)break}ut.length||r<0||e+r>t.length||e+r<0)throw new g;if(0!==r)for(var n=0;n0&&this.grow(t)},e.prototype.grow=function(t){var e=this.buf.length<<1;if(e-t<0&&(e=t),e<0){if(t<0)throw new jn;e=_.MAX_VALUE}this.buf=C.copyOfUint8Array(this.buf,e)},e.prototype.write=function(t){this.ensureCapacity(this.count+1),this.buf[this.count]=t,this.count+=1},e.prototype.writeBytesOffset=function(t,e,r){if(e<0||e>t.length||r<0||e+r-t.length>0)throw new g;this.ensureCapacity(this.count+r),d.arraycopy(t,e,this.buf,this.count,r),this.count+=r},e.prototype.writeTo=function(t){t.writeBytesOffset(this.buf,0,this.count)},e.prototype.reset=function(){this.count=0},e.prototype.toByteArray=function(){return C.copyOfUint8Array(this.buf,this.count)},e.prototype.size=function(){return this.count},e.prototype.toString=function(t){return t?"string"==typeof t?this.toString_string(t):this.toString_number(t):this.toString_void()},e.prototype.toString_void=function(){return new String(this.buf).toString()},e.prototype.toString_string=function(t){return new String(this.buf).toString()},e.prototype.toString_number=function(t){return new String(this.buf).toString()},e.prototype.close=function(){},e}(Wn);function Kn(){if("undefined"!=typeof window)return window.BigInt||null;if(void 0!==Vn)return Vn.BigInt||null;if("undefined"!=typeof self)return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function qn(t){if(void 0===Zr&&(Zr=Kn()),null===Zr)throw new Error("BigInt is not supported!");return Zr(t)}!function(t){t[t.ALPHA=0]="ALPHA",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.PUNCT=3]="PUNCT",t[t.ALPHA_SHIFT=4]="ALPHA_SHIFT",t[t.PUNCT_SHIFT=5]="PUNCT_SHIFT"}(Yr||(Yr={}));var Qn,Jn=function(){function t(){}return t.decode=function(e,r){var n=new P(""),o=b.ISO8859_1;n.enableDecoding(o);for(var i=1,a=e[i++],s=new Hn;ie[0])throw S.getFormatInstance();for(var o=new Int32Array(t.NUMBER_OF_SEQUENCE_CODEWORDS),i=0;i0){for(var l=0;l<6;++l)a.write(Number(qn(u)>>qn(8*(5-l))));u=0,s=0}}o===r[0]&&h0){for(l=0;l<6;++l)a.write(Number(qn(u)>>qn(8*(5-l))));u=0,s=0}}}return i.append(D.decode(a.toByteArray(),n)),o},t.numericCompaction=function(e,r,n){for(var o=0,i=!1,a=new Int32Array(t.MAX_NUMERIC_CODEWORDS);r0&&(n.append(t.decodeBase900toBase10(a,o)),o=0)}return r},t.decodeBase900toBase10=function(e,r){for(var n=qn(0),o=0;o@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",t.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",t.EXP900=Kn()?function(){var t=[];t[0]=qn(1);var e=qn(900);t[1]=e;for(var r=2;r<16;r++)t[r]=t[r-1]*e;return t}():[],t.NUMBER_OF_SEQUENCE_CODEWORDS=2,t}(),$n=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},to=function(){function t(){}return t.decode=function(e,r,n,o,i,a,s){for(var u,c=new In(e,r,n,o,i),f=null,h=null,l=!0;;l=!1){if(null!=r&&(f=t.getRowIndicatorColumn(e,c,r,!0,a,s)),null!=o&&(h=t.getRowIndicatorColumn(e,c,o,!1,a,s)),null==(u=t.merge(f,h)))throw F.getNotFoundInstance();var d=u.getBoundingBox();if(!l||null==d||!(d.getMinY()c.getMaxY()))break;c=d}u.setBoundingBox(c);var p=u.getBarcodeColumnCount()+1;u.setDetectionResultColumn(0,f),u.setDetectionResultColumn(p,h);for(var g=null!=f,y=1;y<=p;y++){var w=g?y:p-y;if(void 0===u.getDetectionResultColumn(w)){var v=void 0;v=0===w||w===p?new Bn(c,0===w):new bn(c),u.setDetectionResultColumn(w,v);for(var C=-1,_=C,A=c.getMinY();A<=c.getMaxY();A++){if((C=t.getStartColumn(u,w,A,g))<0||C>c.getMaxX()){if(-1===_)continue;C=_}var m=t.detectCodeword(e,c.getMinX(),c.getMaxX(),g,C,A,a,s);null!=m&&(v.setCodeword(A,m),_=C,a=Math.min(a,m.getWidth()),s=Math.max(s,m.getWidth()))}}}return t.createDecoderResult(u)},t.merge=function(e,r){if(null==e&&null==r)return null;var n=t.getBarcodeMetadata(e,r);if(null==n)return null;var o=In.merge(t.adjustBoundingBox(e),t.adjustBoundingBox(r));return new Fn(n,o)},t.adjustBoundingBox=function(e){var r,n;if(null==e)return null;var o=e.getRowHeights();if(null==o)return null;var i=t.getMax(o),a=0;try{for(var s=$n(o),u=s.next();!u.done;u=s.next()){var c=u.value;if(a+=i-c,c>0)break}}catch(t){r={error:t}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}for(var f=e.getCodewords(),h=0;a>0&&null==f[h];h++)a--;var l=0;for(h=o.length-1;h>=0&&(l+=i-o[h],!(o[h]>0));h--);for(h=f.length-1;l>0&&null==f[h];h--)l--;return e.getBoundingBox().addMissingRows(a,l,e.isLeft())},t.getMax=function(t){var e,r,n=-1;try{for(var o=$n(t),i=o.next();!i.done;i=o.next()){var a=i.value;n=Math.max(n,a)}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}return n},t.getBarcodeMetadata=function(t,e){var r,n;return null==t||null==(r=t.getBarcodeMetadata())?null==e?null:e.getBarcodeMetadata():null==e||null==(n=e.getBarcodeMetadata())?r:r.getColumnCount()!==n.getColumnCount()&&r.getErrorCorrectionLevel()!==n.getErrorCorrectionLevel()&&r.getRowCount()!==n.getRowCount()?null:r},t.getRowIndicatorColumn=function(e,r,n,o,i,a){for(var s=new Bn(r,o),u=0;u<2;u++)for(var c=0===u?1:-1,f=Math.trunc(Math.trunc(n.getX())),h=Math.trunc(Math.trunc(n.getY()));h<=r.getMaxY()&&h>=r.getMinY();h+=c){var l=t.detectCodeword(e,0,e.getWidth(),o,f,h,i,a);null!=l&&(s.setCodeword(h,l),f=o?l.getStartX():l.getEndX())}return s},t.adjustCodewordCount=function(e,r){var n=r[0][1],o=n.getValue(),i=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-t.getNumberOfECCodeWords(e.getBarcodeECLevel());if(0===o.length){if(i<1||i>dn.MAX_CODEWORDS_IN_BARCODE)throw F.getNotFoundInstance();n.setValue(i)}else o[0]!==i&&n.setValue(i)},t.createDecoderResult=function(e){var r=t.createBarcodeMatrix(e);t.adjustCodewordCount(e,r);for(var n=new Array,o=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),i=[],a=new Array,s=0;s0;){for(var u=0;u=0){if(g>=i.length)continue;i[g][u].setValue(p.getValue())}}}}catch(t){n={error:t}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}u++}}catch(t){e={error:t}}finally{try{f&&!f.done&&(r=c.return)&&r.call(c)}finally{if(e)throw e.error}}return i},t.isValidBarcodeColumn=function(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1},t.getStartColumn=function(e,r,n,o){var i,a,s=o?1:-1,u=null;if(t.isValidBarcodeColumn(e,r-s)&&(u=e.getDetectionResultColumn(r-s).getCodeword(n)),null!=u)return o?u.getEndX():u.getStartX();if(null!=(u=e.getDetectionResultColumn(r).getCodewordNearby(n)))return o?u.getStartX():u.getEndX();if(t.isValidBarcodeColumn(e,r-s)&&(u=e.getDetectionResultColumn(r-s).getCodewordNearby(n)),null!=u)return o?u.getEndX():u.getStartX();for(var c=0;t.isValidBarcodeColumn(e,r-s);){r-=s;try{for(var f=(i=void 0,$n(e.getDetectionResultColumn(r).getCodewords())),h=f.next();!h.done;h=f.next()){var l=h.value;if(null!=l)return(o?l.getEndX():l.getStartX())+s*c*(l.getEndX()-l.getStartX())}}catch(t){i={error:t}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}c++}return o?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()},t.detectCodeword=function(e,r,n,o,i,a,s,u){i=t.adjustCodewordStartColumn(e,r,n,o,i,a);var c,f=t.getModuleBitCount(e,r,n,o,i,a);if(null==f)return null;var h=gt.sum(f);if(o)c=i+h;else{for(var l=0;l=e)&&u=r:st.CODEWORD_SKEW_SIZE)return i;s+=u}u=-u,o=!o}return s},t.checkCodewordSkew=function(e,r,n){return r-t.CODEWORD_SKEW_SIZE<=e&&e<=n+t.CODEWORD_SKEW_SIZE},t.decodeCodewords=function(e,r,n){if(0===e.length)throw S.getFormatInstance();var o=1<n/2+t.MAX_ERRORS||n<0||n>t.MAX_EC_CODEWORDS)throw h.getChecksumInstance();return t.errorCorrection.decode(e,n,r)},t.verifyCodewordCount=function(t,e){if(t.length<4)throw S.getFormatInstance();var r=t[0];if(r>t.length)throw S.getFormatInstance();if(0===r){if(!(e>=1;return e},t.getCodewordBucketNumber=function(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)},t.getCodewordBucketNumber_number=function(e){return t.getCodewordBucketNumber(t.getBitCountForCodeword(e))},t.getCodewordBucketNumber_Int32Array=function(t){return(t[0]-t[2]+t[4]-t[6]+9)%9},t.toString=function(t){for(var e=new Tn,r=0;r=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ro=function(){function t(){}return t.prototype.decode=function(e,r){void 0===r&&(r=null);var n=t.decode(e,r,!1);if(null==n||0===n.length||null==n[0])throw F.getNotFoundInstance();return n[0]},t.prototype.decodeMultiple=function(e,r){void 0===r&&(r=null);try{return t.decode(e,r,!0)}catch(t){if(t instanceof S||t instanceof h)throw F.getNotFoundInstance();throw t}},t.decode=function(e,r,n){var o,i,a=new Array,s=yn.detectMultiple(e,r,n);try{for(var u=eo(s.getPoints()),c=u.next();!c.done;c=u.next()){var f=c.value,h=to.decode(s.getBits(),f[4],f[5],f[6],f[7],t.getMinCodewordWidth(f),t.getMaxCodewordWidth(f)),l=new Q(h.getText(),h.getRawBytes(),void 0,f,$.PDF_417);l.putMetadata(et.ERROR_CORRECTION_LEVEL,h.getECLevel());var d=h.getOther();null!=d&&l.putMetadata(et.PDF417_EXTRA_METADATA,d),a.push(l)}}catch(t){o={error:t}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return a.map((function(t){return t}))},t.getMaxWidth=function(t,e){return null==t||null==e?0:Math.trunc(Math.abs(t.getX()-e.getX()))},t.getMinWidth=function(t,e){return null==t||null==e?_.MAX_VALUE:Math.trunc(Math.abs(t.getX()-e.getX()))},t.getMaxCodewordWidth=function(e){return Math.floor(Math.max(Math.max(t.getMaxWidth(e[0],e[4]),t.getMaxWidth(e[6],e[2])*dn.MODULES_IN_CODEWORD/dn.MODULES_IN_STOP_PATTERN),Math.max(t.getMaxWidth(e[1],e[5]),t.getMaxWidth(e[7],e[3])*dn.MODULES_IN_CODEWORD/dn.MODULES_IN_STOP_PATTERN)))},t.getMinCodewordWidth=function(e){return Math.floor(Math.min(Math.min(t.getMinWidth(e[0],e[4]),t.getMinWidth(e[6],e[2])*dn.MODULES_IN_CODEWORD/dn.MODULES_IN_STOP_PATTERN),Math.min(t.getMinWidth(e[1],e[5]),t.getMinWidth(e[7],e[3])*dn.MODULES_IN_CODEWORD/dn.MODULES_IN_STOP_PATTERN)))},t.prototype.reset=function(){},t}(),no=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),oo=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return no(e,t),e.kind="ReaderException",e}(o),io=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ao=function(){function t(){}return t.prototype.decode=function(t,e){return this.setHints(e),this.decodeInternal(t)},t.prototype.decodeWithState=function(t){return null!==this.readers&&void 0!==this.readers||this.setHints(null),this.decodeInternal(t)},t.prototype.setHints=function(t){this.hints=t;var e=null!=t&&void 0!==t.get(E.TRY_HARDER),r=null==t?null:t.get(E.POSSIBLE_FORMATS),n=new Array;if(null!=r){var o=r.some((function(t){return t===$.UPC_A||t===$.UPC_E||t===$.EAN_13||t===$.EAN_8||t===$.CODABAR||t===$.CODE_39||t===$.CODE_93||t===$.CODE_128||t===$.ITF||t===$.RSS_14||t===$.RSS_EXPANDED}));o&&!e&&n.push(new pr(t)),r.includes($.QR_CODE)&&n.push(new hn),r.includes($.DATA_MATRIX)&&n.push(new Nr),r.includes($.AZTEC)&&n.push(new Rt),r.includes($.PDF_417)&&n.push(new ro),o&&e&&n.push(new pr(t))}0===n.length&&(e||n.push(new pr(t)),n.push(new hn),n.push(new Nr),n.push(new Rt),n.push(new ro),e&&n.push(new pr(t))),this.readers=n},t.prototype.reset=function(){var t,e;if(null!==this.readers)try{for(var r=io(this.readers),n=r.next();!n.done;n=r.next()){n.value.reset()}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},t.prototype.decodeInternal=function(t){var e,r;if(null===this.readers)throw new oo("No readers where selected, nothing can be read.");try{for(var n=io(this.readers),o=n.next();!o.done;o=n.next()){var i=o.value;try{return i.decode(t,this.hints)}catch(t){if(t instanceof oo)continue}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}throw new F("No MultiFormat Readers were able to detect the code.")},t}(),so=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),uo=function(t){function e(e,r){void 0===e&&(e=null),void 0===r&&(r=500);var n=new ao;return n.setHints(e),t.call(this,n,r)||this}return so(e,t),e.prototype.decodeBitmap=function(t){return this.reader.decodeWithState(t)},e}(q),co=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fo=function(t){function e(e){return void 0===e&&(e=500),t.call(this,new ro,e)||this}return co(e,t),e}(q),ho=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),lo=function(t){function e(e){return void 0===e&&(e=500),t.call(this,new hn,e)||this}return ho(e,t),e}(q);!function(t){t[t.ERROR_CORRECTION=0]="ERROR_CORRECTION",t[t.CHARACTER_SET=1]="CHARACTER_SET",t[t.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",t[t.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",t[t.MIN_SIZE=4]="MIN_SIZE",t[t.MAX_SIZE=5]="MAX_SIZE",t[t.MARGIN=6]="MARGIN",t[t.PDF417_COMPACT=7]="PDF417_COMPACT",t[t.PDF417_COMPACTION=8]="PDF417_COMPACTION",t[t.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",t[t.AZTEC_LAYERS=10]="AZTEC_LAYERS",t[t.QR_VERSION=11]="QR_VERSION",t[t.GS1_FORMAT=12]="GS1_FORMAT",t[t.FORCE_C40=13]="FORCE_C40"}(Qn||(Qn={}));var po,go,yo=Qn,wo=function(){function t(t){this.field=t,this.cachedGenerators=[],this.cachedGenerators.push(new ot(t,Int32Array.from([1])))}return t.prototype.buildGenerator=function(t){var e=this.cachedGenerators;if(t>=e.length)for(var r=e[e.length-1],n=this.field,o=e.length;o<=t;o++){var i=r.multiply(new ot(n,Int32Array.from([1,n.exp(o-1+n.getGeneratorBase())])));e.push(i),r=i}return e[t]},t.prototype.encode=function(t,e){if(0===e)throw new u("No error correction bytes");var r=t.length-e;if(r<=0)throw new u("No data bytes provided");var n=this.buildGenerator(e),o=new Int32Array(r);d.arraycopy(t,0,o,0,r);for(var i=new ot(this.field,o),a=(i=i.multiplyByMonomial(e,1)).divide(n)[1].getCoefficients(),s=e-a.length,c=0;c=5&&(n+=t.N1+(u-5)),u=1,c=h)}u>=5&&(n+=t.N1+(u-5))}return n},t.N1=3,t.N2=3,t.N3=40,t.N4=10,t}(),Co=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},_o=function(){function t(t,e){this.width=t,this.height=e;for(var r=new Array(e),n=0;n!==e;n++)r[n]=new Uint8Array(t);this.bytes=r}return t.prototype.getHeight=function(){return this.height},t.prototype.getWidth=function(){return this.width},t.prototype.get=function(t,e){return this.bytes[e][t]},t.prototype.getArray=function(){return this.bytes},t.prototype.setNumber=function(t,e,r){this.bytes[e][t]=r},t.prototype.setBoolean=function(t,e,r){this.bytes[e][t]=r?1:0},t.prototype.clear=function(t){var e,r;try{for(var n=Co(this.bytes),o=n.next();!o.done;o=n.next()){var i=o.value;C.fill(i,t)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var r=e;if(this.width!==r.width)return!1;if(this.height!==r.height)return!1;for(var n=0,o=this.height;n>\n"),t.toString()},t.prototype.setMode=function(t){this.mode=t},t.prototype.setECLevel=function(t){this.ecLevel=t},t.prototype.setVersion=function(t){this.version=t},t.prototype.setMaskPattern=function(t){this.maskPattern=t},t.prototype.setMatrix=function(t){this.matrix=t},t.isValidMaskPattern=function(e){return e>=0&&e0;){for(6===a&&(a-=1);s>=0&&s=n;)e^=r<=0)for(var u=0;u!==a;u++){var c=o[u];c>=0&&t.isEmpty(r.get(c,s))&&t.embedPositionAdjustmentPattern(c-2,s-2,r)}}},t.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),t.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),t.VERSION_INFO_POLY=7973,t.TYPE_INFO_POLY=1335,t.TYPE_INFO_MASK_PATTERN=21522,t}(),So=function(){function t(t,e){this.dataBytes=t,this.errorCorrectionBytes=e}return t.prototype.getDataBytes=function(){return this.dataBytes},t.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},t}(),To=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Oo=function(){function t(){}return t.calculateMaskPenalty=function(t){return vo.applyMaskPenaltyRule1(t)+vo.applyMaskPenaltyRule2(t)+vo.applyMaskPenaltyRule3(t)+vo.applyMaskPenaltyRule4(t)},t.encode=function(e,r,n){void 0===n&&(n=null);var o=t.DEFAULT_BYTE_MODE_ENCODING,i=null!==n&&void 0!==n.get(yo.CHARACTER_SET);i&&(o=n.get(yo.CHARACTER_SET).toString());var a=this.chooseMode(e,o),s=new A;if(a===Kr.BYTE&&(i||t.DEFAULT_BYTE_MODE_ENCODING!==o)){var u=b.getCharacterSetECIByName(o);void 0!==u&&this.appendECI(u,s)}this.appendModeInfo(a,s);var c,f=new A;if(this.appendBytes(e,a,f,o),null!==n&&void 0!==n.get(yo.QR_VERSION)){var h=Number.parseInt(n.get(yo.QR_VERSION).toString(),10);c=Ur.getVersionForNumber(h);var l=this.calculateBitsNeeded(a,s,f,c);if(!this.willFit(l,c,r))throw new Eo("Data too big for requested version")}else c=this.recommendVersion(r,a,s,f);var d=new A;d.appendBitArray(s);var p=a===Kr.BYTE?f.getSizeInBytes():e.length;this.appendLengthInfo(p,c,a,d),d.appendBitArray(f);var g=c.getECBlocksForLevel(r),y=c.getTotalCodewords()-g.getTotalECCodewords();this.terminateBits(y,d);var w=this.interleaveWithECBytes(d,c.getTotalCodewords(),y,g.getNumBlocks()),v=new Ao;v.setECLevel(r),v.setMode(a),v.setVersion(c);var C=c.getDimensionForVersion(),_=new _o(C,C),m=this.chooseMaskPattern(w,r,c,_);return v.setMaskPattern(m),Io.buildMatrix(w,r,c,m,_),v.setMatrix(_),v},t.recommendVersion=function(t,e,r,n){var o=this.calculateBitsNeeded(e,r,n,Ur.getVersionForNumber(1)),i=this.chooseVersion(o,t),a=this.calculateBitsNeeded(e,r,n,i);return this.chooseVersion(a,t)},t.calculateBitsNeeded=function(t,e,r,n){return e.getSize()+t.getCharacterCountBits(n)+r.getSize()},t.getAlphanumericCode=function(e){return e159)&&(o<224||o>235))return!1}return!0},t.chooseMaskPattern=function(t,e,r,n){for(var o=Number.MAX_SAFE_INTEGER,i=-1,a=0;a=(t+7)/8},t.terminateBits=function(t,e){var r=8*t;if(e.getSize()>r)throw new Eo("data bits cannot fit in the QR Code"+e.getSize()+" > "+r);for(var n=0;n<4&&e.getSize()0)for(n=o;n<8;n++)e.appendBit(!1);var i=t-e.getSizeInBytes();for(n=0;n=r)throw new Eo("Block ID too large");var a=t%r,s=r-a,u=Math.floor(t/r),c=u+1,f=Math.floor(e/r),h=f+1,l=u-f,d=c-h;if(l!==d)throw new Eo("EC bytes mismatch");if(r!==s+a)throw new Eo("RS blocks mismatch");if(t!==(f+l)*s+(h+d)*a)throw new Eo("Total bytes mismatch");n=1<=0&&r<=9},t.appendNumericBytes=function(e,r){for(var n=e.length,o=0;o=33088&&i<=40956?a=i-33088:i>=57408&&i<=60351&&(a=i-49472),-1===a)throw new Eo("Invalid byte sequence");var s=192*(a>>8)+(255&a);e.appendBits(s,13)}},t.appendECI=function(t,e){e.appendBits(Kr.ECI.getBits(),4),e.appendBits(t.getValue(),8)},t.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),t.DEFAULT_BYTE_MODE_ENCODING=b.UTF8.getName(),t}(),bo=function(){function t(){}return t.prototype.write=function(e,r,n,o){if(void 0===o&&(o=null),0===e.length)throw new u("Found empty contents");if(r<0||n<0)throw new u("Requested dimensions are too small: "+r+"x"+n);var i=Br.L,a=t.QUIET_ZONE_SIZE;null!==o&&(void 0!==o.get(yo.ERROR_CORRECTION)&&(i=Br.fromString(o.get(yo.ERROR_CORRECTION).toString())),void 0!==o.get(yo.MARGIN)&&(a=Number.parseInt(o.get(yo.MARGIN).toString(),10)));var s=Oo.encode(e,i,o);return this.renderResult(s,r,n,a)},t.prototype.writeToDom=function(t,e,r,n,o){void 0===o&&(o=null),"string"==typeof t&&(t=document.querySelector(t));var i=this.write(e,r,n,o);t&&t.appendChild(i)},t.prototype.renderResult=function(t,e,r,n){var o=t.getMatrix();if(null===o)throw new lt;for(var i=o.getWidth(),a=o.getHeight(),s=i+2*n,u=a+2*n,c=Math.max(e,s),f=Math.max(r,u),h=Math.min(Math.floor(c/s),Math.floor(f/u)),l=Math.floor((c-i*h)/2),d=Math.floor((f-a*h)/2),p=this.createSVGElement(c,f),g=0,y=d;gr||i+s>n)throw new u("Crop rectangle does not fit within image data.");return c&&f.reverseHorizontal(a,s),f}return Do(e,t),e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new u("Requested row is outside the image: "+t);var r=this.getWidth();(null==e||e.length>16&255,g=d>>7&510,y=255&d;h[l]=(p+g+y)/4&255}c.luminances=h}else c.luminances=e;if(void 0===o&&(c.dataWidth=r),void 0===i&&(c.dataHeight=n),void 0===a&&(c.left=0),void 0===s&&(c.top=0),c.left+r>c.dataWidth||c.top+n>c.dataHeight)throw new u("Crop rectangle does not fit within image data.");return c}return Po(e,t),e.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new u("Requested row is outside the image: "+t);var r=this.getWidth();(null==e||e.length=0&&this.noBit(r,e)&&this.utah(e,r,t++),e-=2,r+=2}while(e>=0&&r=0&&r=0);e+=3,r++}while(e=256&&(r^=301);return{LOG:t,ALOG:e}}([],[]),po.LOG),Xo=po.ALOG;!function(t){t[t.FORCE_NONE=0]="FORCE_NONE",t[t.FORCE_SQUARE=1]="FORCE_SQUARE",t[t.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"}(go||(go={}));var Go,Wo="[)>05",zo="[)>06",jo="",Yo=function(){function t(){}return t.encodeECC200=function(t,e){if(t.length!==e.getDataCapacity())throw new Error("The number of codewords does not match the selected symbol");var r=new P;r.append(t);var n=e.getInterleavedBlockCount();if(1===n){var o=this.createECCBlock(t,e.getErrorCodewords());r.append(o)}else{for(var i=[],a=[],s=0;s0;s--)0!==a&&0!==o[s]?i[s]=i[s-1]^Xo[(Uo[a]+Uo[o[s]])%255]:i[s]=i[s-1];0!==a&&0!==o[0]?i[0]=Xo[(Uo[a]+Uo[o[0]])%255]:i[0]=0}var u=[];for(n=0;n=2)t.writeCodeword(this.encodeASCIIDigits(t.getMessage().charCodeAt(t.pos),t.getMessage().charCodeAt(t.pos+1))),t.pos+=2;else{var e=t.getCurrentChar(),r=ci.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(r!==this.getEncodingMode())switch(r){case 5:return t.writeCodeword(231),void t.signalEncoderChange(5);case 1:return t.writeCodeword(230),void t.signalEncoderChange(1);case 3:t.writeCodeword(238),t.signalEncoderChange(3);break;case 2:t.writeCodeword(239),t.signalEncoderChange(2);break;case 4:t.writeCodeword(240),t.signalEncoderChange(4);break;default:throw new Error("Illegal mode: "+r)}else ci.isExtendedASCII(e)?(t.writeCodeword(235),t.writeCodeword(e-128+1),t.pos++):(t.writeCodeword(e+1),t.pos++)}},t.prototype.encodeASCIIDigits=function(t,e){if(ci.isDigit(t)&&ci.isDigit(e))return 10*(t-48)+(e-48)+130;throw new Error("not digits: "+t+e)},t}(),Ko=function(){function t(){}return t.prototype.getEncodingMode=function(){return 5},t.prototype.encode=function(t){var e=new P;for(e.append(0);t.hasMoreCharacters();){var r=t.getCurrentChar();if(e.append(r),t.pos++,ci.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode())!==this.getEncodingMode()){t.signalEncoderChange(0);break}}var n=e.length()-1,o=t.getCodewordCount()+n+1;t.updateSymbolInfo(o);var i=t.getSymbolInfo().getDataCapacity()-o>0;if(t.hasMoreCharacters()||i)if(n<=249)e.setCharAt(0,M.getCharAt(n));else{if(!(n<=1555))throw new Error("Message length not in valid ranges: "+n);e.setCharAt(0,M.getCharAt(Math.floor(n/250)+249)),e.insert(1,M.getCharAt(n%250))}var a=0;for(r=e.length();a3||1!==u))&&(t.pos=n)}e.length()>0&&t.writeCodeword(230),this.handleEOD(t,e)},t.prototype.encode=function(t){for(var e=new P;t.hasMoreCharacters();){var r=t.getCurrentChar();t.pos++;var n=this.encodeChar(r,e),o=2*Math.floor(e.length()/3),i=t.getCodewordCount()+o;t.updateSymbolInfo(i);var a=t.getSymbolInfo().getDataCapacity()-i;if(!t.hasMoreCharacters()){var s=new P;for(e.length()%3==2&&2!==a&&(n=this.backtrackOneCharacter(t,e,s,n));e.length()%3==1&&(n>3||1!==a);)n=this.backtrackOneCharacter(t,e,s,n);break}if(e.length()%3==0)if(ci.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode())!==this.getEncodingMode()){t.signalEncoderChange(0);break}}this.handleEOD(t,e)},t.prototype.backtrackOneCharacter=function(t,e,r,n){var o=e.length(),i=e.toString().substring(0,o-n);e.setLengthToZero(),e.append(i),t.pos--;var a=t.getCurrentChar();return n=this.encodeChar(a,r),t.resetSymbolInfo(),n},t.prototype.writeNextTriplet=function(t,e){t.writeCodewords(this.encodeToCodewords(e.toString()));var r=e.toString().substring(3);e.setLengthToZero(),e.append(r)},t.prototype.handleEOD=function(t,e){var r=Math.floor(e.length()/3*2),n=e.length()%3,o=t.getCodewordCount()+r;t.updateSymbolInfo(o);var i=t.getSymbolInfo().getDataCapacity()-o;if(2===n){for(e.append("\0");e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(254)}else if(1===i&&1===n){for(;e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(254),t.pos--}else{if(0!==n)throw new Error("Unexpected case. Please report!");for(;e.length()>=3;)this.writeNextTriplet(t,e);(i>0||t.hasMoreCharacters())&&t.writeCodeword(254)}t.signalEncoderChange(0)},t.prototype.encodeChar=function(t,e){if(t===" ".charCodeAt(0))return e.append(3),1;if(t>="0".charCodeAt(0)&&t<="9".charCodeAt(0))return e.append(t-48+4),1;if(t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0))return e.append(t-65+14),1;if(t<" ".charCodeAt(0))return e.append(0),e.append(t),2;if(t<="/".charCodeAt(0))return e.append(1),e.append(t-33),2;if(t<="@".charCodeAt(0))return e.append(1),e.append(t-58+15),2;if(t<="_".charCodeAt(0))return e.append(1),e.append(t-91+22),2;if(t<=127)return e.append(2),e.append(t-96),2;e.append("1");var r=2;return r+=this.encodeChar(t-128,e)},t.prototype.encodeToCodewords=function(t){var e=1600*t.charCodeAt(0)+40*t.charCodeAt(1)+t.charCodeAt(2)+1,r=e/256,n=e%256,o=new P;return o.append(r),o.append(n),o.toString()},t}(),Qo=function(){function t(){}return t.prototype.getEncodingMode=function(){return 4},t.prototype.encode=function(t){for(var e=new P;t.hasMoreCharacters();){var r=t.getCurrentChar();if(this.encodeChar(r,e),t.pos++,e.length()>=4){t.writeCodewords(this.encodeToCodewords(e.toString()));var n=e.toString().substring(4);if(e.setLengthToZero(),e.append(n),ci.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode())!==this.getEncodingMode()){t.signalEncoderChange(0);break}}}e.append(M.getCharAt(31)),this.handleEOD(t,e)},t.prototype.handleEOD=function(t,e){try{var r=e.length();if(0===r)return;if(1===r){t.updateSymbolInfo();var n=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount(),o=t.getRemainingCharacters();if(o>n&&(t.updateSymbolInfo(t.getCodewordCount()+1),n=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount()),o<=n&&n<=2)return}if(r>4)throw new Error("Count must not exceed 4");var i=r-1,a=this.encodeToCodewords(e.toString()),s=!t.hasMoreCharacters()&&i<=2;if(i<=2)t.updateSymbolInfo(t.getCodewordCount()+i),(n=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount())>=3&&(s=!1,t.updateSymbolInfo(t.getCodewordCount()+a.length));s?(t.resetSymbolInfo(),t.pos-=i):t.writeCodewords(a)}finally{t.signalEncoderChange(0)}},t.prototype.encodeChar=function(t,e){t>=" ".charCodeAt(0)&&t<="?".charCodeAt(0)?e.append(t):t>="@".charCodeAt(0)&&t<="^".charCodeAt(0)?e.append(M.getCharAt(t-64)):ci.illegalCharacter(M.getCharAt(t))},t.prototype.encodeToCodewords=function(t){var e=t.length;if(0===e)throw new Error("StringBuilder must not be empty");var r=(t.charAt(0).charCodeAt(0)<<18)+((e>=2?t.charAt(1).charCodeAt(0):0)<<12)+((e>=3?t.charAt(2).charCodeAt(0):0)<<6)+(e>=4?t.charAt(3).charCodeAt(0):0),n=r>>16&255,o=r>>8&255,i=255&r,a=new P;return a.append(n),e>=2&&a.append(o),e>=3&&a.append(i),a.toString()},t}(),Jo=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$o=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ti=function(){function t(t,e,r,n,o,i,a,s){void 0===a&&(a=0),void 0===s&&(s=0),this.rectangular=t,this.dataCapacity=e,this.errorCodewords=r,this.matrixWidth=n,this.matrixHeight=o,this.dataRegions=i,this.rsBlockData=a,this.rsBlockError=s}return t.lookup=function(t,e,r,n,o){var i,a;void 0===e&&(e=0),void 0===r&&(r=null),void 0===n&&(n=null),void 0===o&&(o=!0);try{for(var s=$o(ri),u=s.next();!u.done;u=s.next()){var c=u.value;if((1!==e||!c.rectangular)&&((2!==e||c.rectangular)&&(null==r||!(c.getSymbolWidth()n.getWidth()||c.getSymbolHeight()>n.getHeight()))&&t<=c.dataCapacity))return c}}catch(t){i={error:t}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}if(o)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+t);return null},t.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},t.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},t.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},t.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},t.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+2*this.getHorizontalDataRegions()},t.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+2*this.getVerticalDataRegions()},t.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},t.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},t.prototype.getDataCapacity=function(){return this.dataCapacity},t.prototype.getErrorCodewords=function(){return this.errorCodewords},t.prototype.getDataLengthForInterleavedBlock=function(t){return this.rsBlockData},t.prototype.getErrorLengthForInterleavedBlock=function(t){return this.rsBlockError},t}(),ei=function(t){function e(){return t.call(this,!1,1558,620,22,22,36,-1,62)||this}return Jo(e,t),e.prototype.getInterleavedBlockCount=function(){return 10},e.prototype.getDataLengthForInterleavedBlock=function(t){return t<=8?156:155},e}(ti),ri=[new ti(!1,3,5,8,8,1),new ti(!1,5,7,10,10,1),new ti(!0,5,7,16,6,1),new ti(!1,8,10,12,12,1),new ti(!0,10,11,14,6,2),new ti(!1,12,12,14,14,1),new ti(!0,16,14,24,10,1),new ti(!1,18,14,16,16,1),new ti(!1,22,18,18,18,1),new ti(!0,22,18,16,10,2),new ti(!1,30,20,20,20,1),new ti(!0,32,24,16,14,2),new ti(!1,36,24,22,22,1),new ti(!1,44,28,24,24,1),new ti(!0,49,28,22,14,2),new ti(!1,62,36,14,14,4),new ti(!1,86,42,16,16,4),new ti(!1,114,48,18,18,4),new ti(!1,144,56,20,20,4),new ti(!1,174,68,22,22,4),new ti(!1,204,84,24,24,4,102,42),new ti(!1,280,112,14,14,16,140,56),new ti(!1,368,144,16,16,16,92,36),new ti(!1,456,192,18,18,16,114,48),new ti(!1,576,224,20,20,16,144,56),new ti(!1,696,272,22,22,16,174,68),new ti(!1,816,336,24,24,16,136,56),new ti(!1,1050,408,18,18,36,175,68),new ti(!1,1304,496,20,20,36,163,62),new ei],ni=function(){function t(t){this.msg=t,this.pos=0,this.skipAtEnd=0;for(var e=t.split("").map((function(t){return t.charCodeAt(0)})),r=new P,n=0,o=e.length;nthis.symbolInfo.getDataCapacity())&&(this.symbolInfo=ti.lookup(t,this.shape,this.minSize,this.maxSize,!0))},t.prototype.resetSymbolInfo=function(){this.symbolInfo=null},t}(),oi=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ii=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return oi(e,t),e.prototype.getEncodingMode=function(){return 3},e.prototype.encode=function(t){for(var e=new P;t.hasMoreCharacters();){var r=t.getCurrentChar();if(t.pos++,this.encodeChar(r,e),e.length()%3==0)if(this.writeNextTriplet(t,e),ci.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode())!==this.getEncodingMode()){t.signalEncoderChange(0);break}}this.handleEOD(t,e)},e.prototype.encodeChar=function(t,e){switch(t){case 13:e.append(0);break;case"*".charCodeAt(0):e.append(1);break;case">".charCodeAt(0):e.append(2);break;case" ".charCodeAt(0):e.append(3);break;default:t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)?e.append(t-48+4):t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)?e.append(t-65+14):ci.illegalCharacter(M.getCharAt(t))}return 1},e.prototype.handleEOD=function(t,e){t.updateSymbolInfo();var r=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount(),n=e.length();t.pos-=n,(t.getRemainingCharacters()>1||r>1||t.getRemainingCharacters()!==r)&&t.writeCodeword(254),t.getNewEncoding()<0&&t.signalEncoderChange(0)},e}(qo),ai=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),si=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ai(e,t),e.prototype.getEncodingMode=function(){return 2},e.prototype.encodeChar=function(t,e){if(t===" ".charCodeAt(0))return e.append(3),1;if(t>="0".charCodeAt(0)&&t<="9".charCodeAt(0))return e.append(t-48+4),1;if(t>="a".charCodeAt(0)&&t<="z".charCodeAt(0))return e.append(t-97+14),1;if(t<" ".charCodeAt(0))return e.append(0),e.append(t),2;if(t<="/".charCodeAt(0))return e.append(1),e.append(t-33),2;if(t<="@".charCodeAt(0))return e.append(1),e.append(t-58+15),2;if(t>="[".charCodeAt(0)&&t<="_".charCodeAt(0))return e.append(1),e.append(t-91+22),2;if(t==="`".charCodeAt(0))return e.append(2),e.append(0),2;if(t<="Z".charCodeAt(0))return e.append(2),e.append(t-65+1),2;if(t<=127)return e.append(2),e.append(t-123+27),2;e.append("1");var r=2;return r+=this.encodeChar(t-128,e)},e}(qo),ui=function(){function t(){}return t.randomize253State=function(t){var e=129+(149*t%253+1);return e<=254?e:e-254},t.encodeHighLevel=function(t,e,r,n,o){void 0===e&&(e=0),void 0===r&&(r=null),void 0===n&&(n=null),void 0===o&&(o=!1);var i=new qo,a=[new Zo,i,new si,new ii,new Qo,new Ko],s=new ni(t);s.setSymbolShape(e),s.setSizeConstraints(r,n),t.startsWith(Wo)&&t.endsWith(jo)?(s.writeCodeword(236),s.setSkipAtEnd(2),s.pos+=7):t.startsWith(zo)&&t.endsWith(jo)&&(s.writeCodeword(237),s.setSkipAtEnd(2),s.pos+=7);var u=0;for(o&&(i.encodeMaximal(s),u=s.getNewEncoding(),s.resetEncoderSignal());s.hasMoreCharacters();)a[u].encode(s),s.getNewEncoding()>=0&&(u=s.getNewEncoding(),s.resetEncoderSignal());var c=s.getCodewordCount();s.updateSymbolInfo();var f=s.getSymbolInfo().getDataCapacity();c=t.length)return r;var n;0===r?n=[0,1,1,1,1,1.25]:(n=[1,2,2,2,2,2.25])[r]=0;for(var o=0,i=new Uint8Array(6),a=[];;){if(e+o===t.length){C.fill(i,0),C.fill(a,0);var s=this.findMinimums(n,a,_.MAX_VALUE,i),u=this.getMinimumCount(i);if(a[0]===s)return 0;if(1===u){if(i[5]>0)return 5;if(i[4]>0)return 4;if(i[2]>0)return 2;if(i[3]>0)return 3}return 1}var c=t.charCodeAt(e+o);if(o++,this.isDigit(c)?n[0]+=.5:this.isExtendedASCII(c)?(n[0]=Math.ceil(n[0]),n[0]+=2):(n[0]=Math.ceil(n[0]),n[0]++),this.isNativeC40(c)?n[1]+=2/3:this.isExtendedASCII(c)?n[1]+=8/3:n[1]+=4/3,this.isNativeText(c)?n[2]+=2/3:this.isExtendedASCII(c)?n[2]+=8/3:n[2]+=4/3,this.isNativeX12(c)?n[3]+=2/3:this.isExtendedASCII(c)?n[3]+=13/3:n[3]+=10/3,this.isNativeEDIFACT(c)?n[4]+=3/4:this.isExtendedASCII(c)?n[4]+=4.25:n[4]+=3.25,this.isSpecialB256(c)?n[5]+=4:n[5]++,o>=4){if(C.fill(i,0),C.fill(a,0),this.findMinimums(n,a,_.MAX_VALUE,i),a[0]i&&(r=i,C.fill(n,0)),r===i&&(n[o]=n[o]+1)}return r},t.getMinimumCount=function(t){for(var e=0,r=0;r<6;r++)e+=t[r];return e||0},t.isDigit=function(t){return t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)},t.isExtendedASCII=function(t){return t>=128&&t<=255},t.isNativeC40=function(t){return t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)},t.isNativeText=function(t){return t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="a".charCodeAt(0)&&t<="z".charCodeAt(0)},t.isNativeX12=function(t){return this.isX12TermSep(t)||t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)},t.isX12TermSep=function(t){return 13===t||t==="*".charCodeAt(0)||t===">".charCodeAt(0)},t.isNativeEDIFACT=function(t){return t>=" ".charCodeAt(0)&&t<="^".charCodeAt(0)},t.isSpecialB256=function(t){return!1},t.determineConsecutiveDigitCount=function(t,e){void 0===e&&(e=0);for(var r=t.length,n=e;n=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hi=function(){function t(t){this.charset=t,this.name=t.name}return t.prototype.canEncode=function(t){try{return null!=D.encode(t,this.charset)}catch(t){return!1}},t}(),li=function(){function t(t,e,r){var n,o,i,a,s,u;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","windows-1256","Shift_JIS"].map((function(t){return new hi(Fo.forName(t))})),this.encoders=[];var c=[];c.push(new hi(xo.ISO_8859_1));for(var f=null!=e&&e.name.startsWith("UTF"),h=0;h=this.bytes.length)return!1;for(var r=0;r=this.length())throw new Error(""+t);if(this.isECI(t))throw new Error("value at "+t+" is not a character but an ECI");return this.isFNC1(t)?this.fnc1:this.bytes[t]},t.prototype.subSequence=function(t,e){if(t<0||t>e||e>this.length())throw new Error(""+t);for(var r=new P,n=t;n=this.length())throw new Error(""+t);return this.bytes[t]>255&&this.bytes[t]<=999},t.prototype.isFNC1=function(t){if(t<0||t>=this.length())throw new Error(""+t);return 1e3===this.bytes[t]},t.prototype.getECIValue=function(t){if(t<0||t>=this.length())throw new Error(""+t);if(!this.isECI(t))throw new Error("value at "+t+" is not an ECI but a character");return this.bytes[t]-256},t.prototype.addEdge=function(t,e,r){(null==t[e][r.encoderIndex]||t[e][r.encoderIndex].cachedTotalSize>r.cachedTotalSize)&&(t[e][r.encoderIndex]=r)},t.prototype.addEdges=function(t,e,r,n,o,i){var a=t.charAt(n).charCodeAt(0),s=0,u=e.length();e.getPriorityEncoderIndex()>=0&&(a===i||e.canEncode(a,e.getPriorityEncoderIndex()))&&(u=(s=e.getPriorityEncoderIndex())+1);for(var c=s;c=0;i--)f.unshift(255&l[i])}(null===h.previous?0:h.previous.encoderIndex)!==h.encoderIndex&&f.unshift(256+e.getECIValue(h.encoderIndex)),h=h.previous}var d=[];for(i=0;i=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},wi=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},vi=function(){for(var t=[],e=0;e","?","@","[","\\","]","^","_"],_i=function(){function t(){}return t.isExtendedASCII=function(t,e){return t!==e&&t>=128&&t<=255},t.isInC40Shift1Set=function(t){return t<=31},t.isInC40Shift2Set=function(t,e){var r,n;try{for(var o=yi(Ci),i=o.next();!i.done;i=o.next()){if(i.value.charCodeAt(0)===t)return!0}}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return t===e},t.isInTextShift1Set=function(t){return this.isInC40Shift1Set(t)},t.isInTextShift2Set=function(t,e){return this.isInC40Shift2Set(t,e)},t.encodeHighLevel=function(t,e,r,n){void 0===e&&(e=null),void 0===r&&(r=-1),void 0===n&&(n=0);var o=0;return t.startsWith(Wo)&&t.endsWith(jo)?(o=5,t=t.substring(7,t.length-2)):t.startsWith(zo)&&t.endsWith(jo)&&(o=6,t=t.substring(7,t.length-2)),decodeURIComponent(escape(String.fromCharCode.apply(String,vi(this.encode(t,e,r,n,o)))))},t.encode=function(t,e,r,n,o){return this.encodeMinimally(new Ei(t,e,r,n,o)).getBytes()},t.addEdge=function(t,e){var r=e.fromPosition+e.characterLength;(null===t[r][e.getEndMode()]||t[r][e.getEndMode()].cachedTotalSize>e.cachedTotalSize)&&(t[r][e.getEndMode()]=e)},t.getNumberOfC40Words=function(e,r,n,o){for(var i=0,a=r;a=128&&(n&&ci.isNativeC40(u-128)||!n&&ci.isNativeText(u-128))?i+=3:i+=4}else i+=2;if(i%3==0||(i-2)%3==0&&a+1===e.length())return o[0]=a-r+1,Math.ceil(i/3)}return o[0]=0,0},t.addEdges=function(e,r,n,o){var i,a;if(e.isECI(n))this.addEdge(r,new mi(e,Go.ASCII,n,1,o));else{var s,u=e.charAt(n);if(null===o||o.getEndMode()!==Go.EDF){ci.isDigit(u)&&e.haveNCharacters(n,2)&&ci.isDigit(e.charAt(n+1))?this.addEdge(r,new mi(e,Go.ASCII,n,2,o)):this.addEdge(r,new mi(e,Go.ASCII,n,1,o));var c=[Go.C40,Go.TEXT];try{for(var f=yi(c),h=f.next();!h.done;h=f.next()){var l=h.value,d=[];t.getNumberOfC40Words(e,n,l===Go.C40,d)>0&&this.addEdge(r,new mi(e,l,n,d[0],o))}}catch(t){i={error:t}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}e.haveNCharacters(n,3)&&ci.isNativeX12(e.charAt(n))&&ci.isNativeX12(e.charAt(n+1))&&ci.isNativeX12(e.charAt(n+2))&&this.addEdge(r,new mi(e,Go.X12,n,3,o)),this.addEdge(r,new mi(e,Go.B256,n,1,o))}for(s=0;s<3;s++){var p=n+s;if(!e.haveNCharacters(p,1)||!ci.isNativeEDIFACT(e.charAt(p)))break;this.addEdge(r,new mi(e,Go.EDF,n,s+1,o))}3===s&&e.haveNCharacters(n,4)&&ci.isNativeEDIFACT(e.charAt(n+3))&&this.addEdge(r,new mi(e,Go.EDF,n,4,o))}},t.encodeMinimally=function(t){var e=t.length(),r=Array(e+1).fill(null).map((function(){return Array(6).fill(0)}));this.addEdges(t,r,0,null);for(var n=1;n<=e;n++){for(var o=0;o<6;o++)null!==r[n][o]&&n=1&&o<=3?s.cachedTotalSize+1:s.cachedTotalSize;u0&&(r+=this.prepend(mi.getBytes(232),n));for(var s=0;s=0;r--)e.unshift(t[r]);return t.length},t.prototype.randomize253State=function(t){var e=129+(149*t%253+1);return e<=254?e:e-254},t.prototype.applyRandomPattern=function(t,e,r){for(var n=0;n0&&this.getCodewordsRemaining(this.cachedTotalSize+t)<=2-t)return Go.ASCII}if(this.mode===Go.C40||this.mode===Go.TEXT||this.mode===Go.X12){if(this.fromPosition+this.characterLength>=this.input.length()&&0===this.getCodewordsRemaining(this.cachedTotalSize))return Go.ASCII;var t;if(1===(t=this.getLastASCII())&&0===this.getCodewordsRemaining(this.cachedTotalSize+1))return Go.ASCII}return this.mode},t.prototype.getMode=function(){return this.mode},t.prototype.getLastASCII=function(){var t=this.input.length(),e=this.fromPosition+this.characterLength;return t-e>4||e>=t?0:t-e==1?_i.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())?0:1:t-e==2?_i.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())||_i.isExtendedASCII(this.input.charAt(e+1),this.input.getFNC1Character())?0:ci.isDigit(this.input.charAt(e))&&ci.isDigit(this.input.charAt(e+1))?1:2:t-e==3?ci.isDigit(this.input.charAt(e))&&ci.isDigit(this.input.charAt(e+1))&&!_i.isExtendedASCII(this.input.charAt(e+2),this.input.getFNC1Character())||ci.isDigit(this.input.charAt(e+1))&&ci.isDigit(this.input.charAt(e+2))&&!_i.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())?2:0:ci.isDigit(this.input.charAt(e))&&ci.isDigit(this.input.charAt(e+1))&&ci.isDigit(this.input.charAt(e+2))&&ci.isDigit(this.input.charAt(e+3))?2:0},t.prototype.getMinSymbolSize=function(t){var e,r,n,o,i,a;switch(this.input.getShapeHint()){case 1:try{for(var s=yi(this.squareCodewordCapacities),u=s.next();!u.done;u=s.next()){if((d=u.value)>=t)return d}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}break;case 2:try{for(var c=yi(this.rectangularCodewordCapacities),f=c.next();!f.done;f=c.next()){if((d=f.value)>=t)return d}}catch(t){n={error:t}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}}try{for(var h=yi(this.allCodewordCapacities),l=h.next();!l.done;l=h.next()){var d;if((d=l.value)>=t)return d}}catch(t){i={error:t}}finally{try{l&&!l.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}return this.allCodewordCapacities[this.allCodewordCapacities.length-1]},t.prototype.getCodewordsRemaining=function(t){return this.getMinSymbolSize(t)-t},t.getBytes=function(t,e){var r=new Uint8Array(e?2:1);return r[0]=t,e&&(r[1]=e),r},t.prototype.setC40Word=function(t,e,r,n,o){var i=1600*(255&r)+40*(255&n)+(255&o)+1;t[e]=i/256,t[e+1]=i%256},t.prototype.getX12Value=function(t){return 13===t?0:42===t?1:62===t?2:32===t?3:t>=48&&t<=57?t-44:t>=65&&t<=90?t-51:t},t.prototype.getX12Words=function(){if(this.characterLength%3!=0)throw new Error("X12 words must be a multiple of 3");for(var t=new Uint8Array(this.characterLength/3*2),e=0;e=33&&r<=47?r-33:r>=48&&r<=57?r-44:r>=58&&r<=64?r-43:r>=65&&r<=90?r-64:r>=91&&r<=95?r-69:96===r?0:r>=97&&r<=122?r-83:r>=123&&r<=127?r-96:r},t.prototype.getC40Words=function(t,e){for(var r=[],n=0;n>16&255,e[o+1]=s>>8&255,e[o+2]=255&s}return e},t.prototype.getLatchBytes=function(){switch(this.getPreviousMode()){case Go.ASCII:case Go.B256:switch(this.mode){case Go.B256:return t.getBytes(231);case Go.C40:return t.getBytes(230);case Go.TEXT:return t.getBytes(239);case Go.X12:return t.getBytes(238);case Go.EDF:return t.getBytes(240)}break;case Go.C40:case Go.TEXT:case Go.X12:if(this.mode!==this.getPreviousMode())switch(this.mode){case Go.ASCII:return t.getBytes(254);case Go.B256:return t.getBytes(254,231);case Go.C40:return t.getBytes(254,230);case Go.TEXT:return t.getBytes(254,239);case Go.X12:return t.getBytes(254,238);case Go.EDF:return t.getBytes(254,240)}break;case Go.EDF:if(this.mode!==Go.EDF)throw new Error("Cannot switch from EDF to "+this.mode)}return new Uint8Array(0)},t.prototype.getDataBytes=function(){switch(this.mode){case Go.ASCII:return this.input.isECI(this.fromPosition)?t.getBytes(241,this.input.getECIValue(this.fromPosition)+1):_i.isExtendedASCII(this.input.charAt(this.fromPosition),this.input.getFNC1Character())?t.getBytes(235,this.input.charAt(this.fromPosition)-127):2===this.characterLength?t.getBytes(10*this.input.charAt(this.fromPosition)+this.input.charAt(this.fromPosition+1)+130):this.input.isFNC1(this.fromPosition)?t.getBytes(232):t.getBytes(this.input.charAt(this.fromPosition)+1);case Go.B256:return t.getBytes(this.input.charAt(this.fromPosition));case Go.C40:return this.getC40Words(!0,this.input.getFNC1Character());case Go.TEXT:return this.getC40Words(!1,this.input.getFNC1Character());case Go.X12:return this.getX12Words();case Go.EDF:return this.getEDFBytes()}},t}(),Ei=function(t){function e(e,r,n,o,i){var a=t.call(this,e,r,n)||this;return a.shape=o,a.macroId=i,a}return gi(e,t),e.prototype.getMacroId=function(){return this.macroId},e.prototype.getShapeHint=function(){return this.shape},e}(di),Ii=function(){function t(){}return t.prototype.encode=function(t,e,r,n,o){if(void 0===o&&(o=null),""===t.trim())throw new Error("Found empty contents");if(e!==$.DATA_MATRIX)throw new Error("Can only encode DATA_MATRIX, but got "+e);if(r<0||n<0)throw new Error("Requested dimensions can't be negative: "+r+"x"+n);var i,a=0,s=null,u=null;if(null!=o){var c=o.get(yo.DATA_MATRIX_SHAPE);null!=c&&(a=c);var f=o.get(yo.MIN_SIZE);null!=f&&(s=f);var h=o.get(yo.MAX_SIZE);null!=h&&(u=h)}if(null!=o&&o.has(yo.DATA_MATRIX_COMPACT)&&Boolean(o.get(yo.DATA_MATRIX_COMPACT).toString())){var l=o.has(yo.GS1_FORMAT)&&Boolean(o.get(yo.GS1_FORMAT).toString()),d=null;o.has(yo.CHARACTER_SET)&&(d=Fo.forName(o.get(yo.CHARACTER_SET).toString())),i=_i.encodeHighLevel(t,d,l?29:-1,a)}else{var p=null!=o&&o.has(yo.FORCE_C40)&&Boolean(o.get(yo.FORCE_C40).toString());i=ci.encodeHighLevel(t,a,s,u,p)}var g=ti.lookup(i.length,a,s,u,!0),y=Yo.encodeECC200(i,g),w=new ko(y,g.getSymbolDataWidth(),g.getSymbolDataHeight());return w.place(),this.encodeLowLevel(w,g,r,n)},t.prototype.encodeLowLevel=function(t,e,r,n){for(var o=e.getSymbolDataWidth(),i=e.getSymbolDataHeight(),a=new _o(e.getSymbolWidth(),e.getSymbolHeight()),s=0,u=0;u"},e}(Oi),Ni=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Di=function(t){function e(e,r,n){var o=t.call(this,e,0,0)||this;return o.binaryShiftStart=r,o.binaryShiftByteCount=n,o}return Ni(e,t),e.prototype.appendTo=function(t,e){for(var r=0;r62?t.appendBits(this.binaryShiftByteCount-31,16):0===r?t.appendBits(Math.min(this.binaryShiftByteCount,31),5):t.appendBits(this.binaryShiftByteCount-31,5)),t.appendBits(e[this.binaryShiftStart+r],8)},e.prototype.addBinaryShift=function(t,r){return new e(this,t,r)},e.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},e}(Ri);function Mi(t,e,r){return new Ri(t,e,r)}var Pi=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Bi=new Ri(null,0,0),Li=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])],Fi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};var xi=function(t){var e,r;try{for(var n=Fi(t),o=n.next();!o.done;o=n.next()){var i=o.value;C.fill(i,-1)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}return t[0][4]=0,t[1][4]=0,t[1][0]=28,t[3][4]=0,t[2][4]=0,t[2][0]=15,t}(C.createInt32Array(6,6)),ki=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Vi=function(){function t(t,e,r,n){this.token=t,this.mode=e,this.binaryShiftByteCount=r,this.bitCount=n}return t.prototype.getMode=function(){return this.mode},t.prototype.getToken=function(){return this.token},t.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},t.prototype.getBitCount=function(){return this.bitCount},t.prototype.latchAndAppend=function(e,r){var n=this.bitCount,o=this.token;if(e!==this.mode){var i=Li[this.mode][e];o=Mi(o,65535&i,i>>16),n+=i>>16}var a=2===e?4:5;return new t(o=Mi(o,r,a),e,0,n+a)},t.prototype.shiftAndAppend=function(e,r){var n=this.token,o=2===this.mode?4:5;return n=Mi(n,xi[this.mode][e],o),new t(n=Mi(n,r,5),this.mode,0,this.bitCount+o+5)},t.prototype.addBinaryShiftChar=function(e){var r=this.token,n=this.mode,o=this.bitCount;if(4===this.mode||2===this.mode){var i=Li[n][0];r=Mi(r,65535&i,i>>16),o+=i>>16,n=0}var a=0===this.binaryShiftByteCount||31===this.binaryShiftByteCount?18:62===this.binaryShiftByteCount?9:8,s=new t(r,n,this.binaryShiftByteCount+1,o+a);return 2078===s.binaryShiftByteCount&&(s=s.endBinaryShift(e+1)),s},t.prototype.endBinaryShift=function(e){if(0===this.binaryShiftByteCount)return this;var r=this.token;return new t(r=function(t,e,r){return new Di(t,e,r)}(r,e-this.binaryShiftByteCount,this.binaryShiftByteCount),this.mode,0,this.bitCount)},t.prototype.isBetterThanOrEqualTo=function(e){var r=this.bitCount+(Li[this.mode][e.mode]>>16);return this.binaryShiftByteCounte.binaryShiftByteCount&&e.binaryShiftByteCount>0&&(r+=10),r<=e.bitCount},t.prototype.toBitArray=function(t){for(var e,r,n=[],o=this.endBinaryShift(t.length).token;null!==o;o=o.getPrevious())n.unshift(o);var i=new A;try{for(var a=ki(n),s=a.next();!s.done;s=a.next()){s.value.appendTo(i,t)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}return i},t.prototype.toString=function(){return M.format("%s bits=%d bytes=%d",Pi[this.mode],this.bitCount,this.binaryShiftByteCount)},t.calculateBinaryShiftCost=function(t){return t.binaryShiftByteCount>62?21:t.binaryShiftByteCount>31?20:t.binaryShiftByteCount>0?10:0},t.INITIAL_STATE=new t(Bi,0,0,0),t}();var Hi=function(t){var e=M.getCharCode(" "),r=M.getCharCode("."),n=M.getCharCode(",");t[0][e]=1;for(var o=M.getCharCode("Z"),i=M.getCharCode("A"),a=i;a<=o;a++)t[0][a]=a-i+2;t[1][e]=1;var s=M.getCharCode("z"),u=M.getCharCode("a");for(a=u;a<=s;a++)t[1][a]=a-u+2;t[2][e]=1;var c=M.getCharCode("9"),f=M.getCharCode("0");for(a=f;a<=c;a++)t[2][a]=a-f+2;t[2][n]=12,t[2][r]=13;for(var h=["\0"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~",""],l=0;l","?","[","]","{","}"];for(l=0;l0&&(t[4][M.getCharCode(d[l])]=l);return t}(C.createInt32Array(5,256)),Ui=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Xi=function(){function t(t){this.text=t}return t.prototype.encode=function(){for(var e=M.getCharCode(" "),r=M.getCharCode("\n"),n=Ti.singletonList(Vi.INITIAL_STATE),o=0;o0?(n=t.updateStateListForPair(n,o,i),o++):n=this.updateStateListForChar(n,o)}return Ti.min(n,(function(t,e){return t.getBitCount()-e.getBitCount()})).toBitArray(this.text)},t.prototype.updateStateListForChar=function(e,r){var n,o,i=[];try{for(var a=Ui(e),s=a.next();!s.done;s=a.next()){var u=s.value;this.updateStateForChar(u,r,i)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return t.simplifyStates(i)},t.prototype.updateStateForChar=function(t,e,r){for(var n=255&this.text[e],o=Hi[t.getMode()][n]>0,i=null,a=0;a<=4;a++){var s=Hi[a][n];if(s>0){if(null==i&&(i=t.endBinaryShift(e)),!o||a===t.getMode()||2===a){var u=i.latchAndAppend(a,s);r.push(u)}if(!o&&xi[t.getMode()][a]>=0){var c=i.shiftAndAppend(a,s);r.push(c)}}}if(t.getBinaryShiftByteCount()>0||0===Hi[t.getMode()][n]){var f=t.addBinaryShiftChar(e);r.push(f)}},t.updateStateListForPair=function(t,e,r){var n,o,i=[];try{for(var a=Ui(t),s=a.next();!s.done;s=a.next()){var u=s.value;this.updateStateForPair(u,e,r,i)}}catch(t){n={error:t}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return this.simplifyStates(i)},t.updateStateForPair=function(t,e,r,n){var o=t.endBinaryShift(e);if(n.push(o.latchAndAppend(4,r)),4!==t.getMode()&&n.push(o.shiftAndAppend(4,r)),3===r||4===r){var i=o.latchAndAppend(2,16-r).latchAndAppend(2,1);n.push(i)}if(t.getBinaryShiftByteCount()>0){var a=t.addBinaryShiftChar(e).addBinaryShiftChar(e+1);n.push(a)}},t.simplifyStates=function(t){var e,r,n,o,i=[];try{for(var a=Ui(t),s=a.next();!s.done;s=a.next()){var u=s.value,c=!0,f=function(t){if(t.isBetterThanOrEqualTo(u))return c=!1,"break";u.isBetterThanOrEqualTo(t)&&(i=i.filter((function(e){return e!==t})))};try{for(var h=(n=void 0,Ui(i)),l=h.next();!l.done;l=h.next()){if("break"===f(l.value))break}}catch(t){n={error:t}}finally{try{l&&!l.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}c&&i.push(u)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}return i},t}(),Gi=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Wi=function(){function t(){}return t.encodeBytes=function(e){return t.encode(e,t.DEFAULT_EC_PERCENT,t.DEFAULT_AZTEC_LAYERS)},t.encode=function(e,r,n){var o,i,a,s,c,f=new Xi(e).encode(),h=_.truncDivision(f.getSize()*r,100)+11,l=f.getSize()+h;if(n!==t.DEFAULT_AZTEC_LAYERS){if(o=n<0,(i=Math.abs(n))>(o?t.MAX_NB_BITS_COMPACT:t.MAX_NB_BITS))throw new u(M.format("Illegal value %s for layers",n));var d=(a=t.totalBitsInLayer(i,o))-a%(s=t.WORD_SIZE[i]);if((c=t.stuffBits(f,s)).getSize()+h>d)throw new u("Data to large for user specified layer");if(o&&c.getSize()>64*s)throw new u("Data to large for user specified layer")}else{s=0,c=null;for(var p=0;;p++){if(p>t.MAX_NB_BITS)throw new u("Data too large for an Aztec code");if(i=(o=p<=3)?p+1:p,!(l>(a=t.totalBitsInLayer(i,o)))){null!=c&&s===t.WORD_SIZE[i]||(s=t.WORD_SIZE[i],c=t.stuffBits(f,s));d=a-a%s;if(!(o&&c.getSize()>64*s)&&c.getSize()+h<=d)break}}}var g,y=t.generateCheckWords(c,a,s),w=c.getSize()/s,v=t.generateModeMessage(o,i,w),C=(o?11:14)+4*i,A=new Int32Array(C);if(o){g=C;for(p=0;p=n||t.get(i+s))&&(a|=1<=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},$=function(){function r(){}return r.fill=function(t,e){for(var n=0,o=t.length;nn)throw new N("fromIndex("+e+") > toIndex("+n+")");if(e<0)throw new ze(e);if(n>t)throw new ze(n)},r.asList=function(){for(var t=[],e=0;e>1,s=n(e,t[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},r.numberComparator=function(t,e){return t-e},r}(),P=function(){function r(){}return r.numberOfTrailingZeros=function(t){var e;if(t===0)return 32;var n=31;return(e=t<<16)!==0&&(n-=16,t=e),(e=t<<8)!==0&&(n-=8,t=e),(e=t<<4)!==0&&(n-=4,t=e),(e=t<<2)!==0&&(n-=2,t=e),n-(t<<1>>>31)},r.numberOfLeadingZeros=function(t){if(t===0)return 32;var e=1;return!(t>>>16)&&(e+=16,t<<=16),!(t>>>24)&&(e+=8,t<<=8),!(t>>>28)&&(e+=4,t<<=4),!(t>>>30)&&(e+=2,t<<=2),e-=t>>>31},r.toHexString=function(t){return t.toString(16)},r.toBinaryString=function(t){return String(parseInt(String(t),2))},r.bitCount=function(t){return t=(t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135,t+=t>>>8,63&(t+=t>>>16)},r.truncDivision=function(t,e){return Math.trunc(t/e)},r.parseInt=function(t,e){return e===void 0&&(e=void 0),parseInt(t,e)},r.MIN_VALUE_32_BITS=-2147483648,r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),st=function(){function r(t,e){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,this.bits=e??r.makeArray(t))}return r.prototype.getSize=function(){return this.size},r.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},r.prototype.ensureCapacity=function(t){if(t>32*this.bits.length){var e=r.makeArray(t);Z.arraycopy(this.bits,0,e,0,this.bits.length),this.bits=e}},r.prototype.get=function(t){return(this.bits[Math.floor(t/32)]&1<<(31&t))!=0},r.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(31&t)},r.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(31&t)},r.prototype.getNextSet=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,o=Math.floor(t/32),i=n[o];i&=~((1<<(31&t))-1);for(var a=n.length;i===0;){if(++o===a)return e;i=n[o]}var s=32*o+P.numberOfTrailingZeros(i);return s>e?e:s},r.prototype.getNextUnset=function(t){var e=this.size;if(t>=e)return e;var n=this.bits,o=Math.floor(t/32),i=~n[o];i&=~((1<<(31&t))-1);for(var a=n.length;i===0;){if(++o===a)return e;i=~n[o]}var s=32*o+P.numberOfTrailingZeros(i);return s>e?e:s},r.prototype.setBulk=function(t,e){this.bits[Math.floor(t/32)]=e},r.prototype.setRange=function(t,e){if(ethis.size)throw new N;if(e!==t){e--;for(var n=Math.floor(t/32),o=Math.floor(e/32),i=this.bits,a=n;a<=o;a++){var s=(2<<(an?0:31&t));i[a]|=s}}},r.prototype.clear=function(){for(var t=this.bits.length,e=this.bits,n=0;nthis.size)throw new N;if(e===t)return!0;e--;for(var o=Math.floor(t/32),i=Math.floor(e/32),a=this.bits,s=o;s<=i;s++){var u=(2<<(so?0:31&t))&4294967295;if((a[s]&u)!==(n?u:0))return!1}return!0},r.prototype.appendBit=function(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},r.prototype.appendBits=function(t,e){if(e<0||e>32)throw new N("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(var n=e;n>0;n--)this.appendBit((t>>n-1&1)==1)},r.prototype.appendBitArray=function(t){var e=t.size;this.ensureCapacity(this.size+e);for(var n=0;n>1&1431655765|(1431655765&a)<<1)>>2&858993459|(858993459&a)<<2)>>4&252645135|(252645135&a)<<4)>>8&16711935|(16711935&a)<<8)>>16&65535|(65535&a)<<16,t[e-i]=a}if(this.size!==32*n){var s=32*n-this.size,u=t[0]>>>s;for(i=1;i>>s}t[n-1]=u}this.bits=t},r.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.size===e.size&&$.equals(this.bits,e.bits)},r.prototype.hashCode=function(){return 31*this.size+$.hashCode(this.bits)},r.prototype.toString=function(){for(var t="",e=0,n=this.size;e=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(r){r[r.Cp437=0]="Cp437",r[r.ISO8859_1=1]="ISO8859_1",r[r.ISO8859_2=2]="ISO8859_2",r[r.ISO8859_3=3]="ISO8859_3",r[r.ISO8859_4=4]="ISO8859_4",r[r.ISO8859_5=5]="ISO8859_5",r[r.ISO8859_6=6]="ISO8859_6",r[r.ISO8859_7=7]="ISO8859_7",r[r.ISO8859_8=8]="ISO8859_8",r[r.ISO8859_9=9]="ISO8859_9",r[r.ISO8859_10=10]="ISO8859_10",r[r.ISO8859_11=11]="ISO8859_11",r[r.ISO8859_13=12]="ISO8859_13",r[r.ISO8859_14=13]="ISO8859_14",r[r.ISO8859_15=14]="ISO8859_15",r[r.ISO8859_16=15]="ISO8859_16",r[r.SJIS=16]="SJIS",r[r.Cp1250=17]="Cp1250",r[r.Cp1251=18]="Cp1251",r[r.Cp1252=19]="Cp1252",r[r.Cp1256=20]="Cp1256",r[r.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",r[r.UTF8=22]="UTF8",r[r.ASCII=23]="ASCII",r[r.Big5=24]="Big5",r[r.GB18030=25]="GB18030",r[r.EUC_KR=26]="EUC_KR"})(z||(z={}));var me,nt=function(){function r(t,e,n){for(var o,i,a=[],s=3;s=900)throw new T("incorect value");var e=r.VALUES_TO_ECI.get(t);if(e===void 0)throw new T("incorect value");return e},r.getCharacterSetECIByName=function(t){var e=r.NAME_TO_ECI.get(t);if(e===void 0)throw new T("incorect value");return e},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.getName()===e.getName()},r.VALUE_IDENTIFIER_TO_ECI=new Map,r.VALUES_TO_ECI=new Map,r.NAME_TO_ECI=new Map,r.Cp437=new r(z.Cp437,Int32Array.from([0,2]),"Cp437"),r.ISO8859_1=new r(z.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),r.ISO8859_2=new r(z.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),r.ISO8859_3=new r(z.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),r.ISO8859_4=new r(z.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),r.ISO8859_5=new r(z.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),r.ISO8859_6=new r(z.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),r.ISO8859_7=new r(z.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),r.ISO8859_8=new r(z.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),r.ISO8859_9=new r(z.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),r.ISO8859_10=new r(z.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),r.ISO8859_11=new r(z.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),r.ISO8859_13=new r(z.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),r.ISO8859_14=new r(z.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),r.ISO8859_15=new r(z.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),r.ISO8859_16=new r(z.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),r.SJIS=new r(z.SJIS,20,"SJIS","Shift_JIS"),r.Cp1250=new r(z.Cp1250,21,"Cp1250","windows-1250"),r.Cp1251=new r(z.Cp1251,22,"Cp1251","windows-1251"),r.Cp1252=new r(z.Cp1252,23,"Cp1252","windows-1252"),r.Cp1256=new r(z.Cp1256,24,"Cp1256","windows-1256"),r.UnicodeBigUnmarked=new r(z.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),r.UTF8=new r(z.UTF8,26,"UTF8","UTF-8"),r.ASCII=new r(z.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),r.Big5=new r(z.Big5,28,"Big5"),r.GB18030=new r(z.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),r.EUC_KR=new r(z.EUC_KR,30,"EUC_KR","EUC-KR"),r}(),rn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ne=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return rn(t,r),t.kind="UnsupportedOperationException",t}(wt),At=function(){function r(){}return r.decode=function(t,e){var n=this.encodingName(e);return this.customDecoder?this.customDecoder(t,n):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(n)?this.decodeFallback(t,n):new TextDecoder(n).decode(t)},r.shouldDecodeOnFallback=function(t){return!r.isBrowser()&&t==="ISO-8859-1"},r.encode=function(t,e){var n=this.encodingName(e);return this.customEncoder?this.customEncoder(t,n):typeof TextEncoder>"u"?this.encodeFallback(t):new TextEncoder().encode(t)},r.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},r.encodingName=function(t){return typeof t=="string"?t:t.getName()},r.encodingCharacterSet=function(t){return t instanceof nt?t:nt.getCharacterSetECIByName(t)},r.decodeFallback=function(t,e){var n=this.encodingCharacterSet(e);if(r.isDecodeFallbackSupported(n)){for(var o="",i=0,a=t.length;i3&&t[0]===239&&t[1]===187&&t[2]===191,_=0;_0?128&m?s--:a=!1:128&m&&(64&m?(s++,32&m?(s++,16&m?(s++,8&m?a=!1:f++):c++):u++):a=!1)),o&&(m>127&&m<160?o=!1:m>159&&(m<192||m===215||m===247)&&w++),i&&(h>0?m<64||m===127||m>252?i=!1:h--:m===128||m===160||m>239?i=!1:m>160&&m<224?(l++,p=0,++d>y&&(y=d)):m>127?(h++,d=0,++p>C&&(C=p)):(d=0,p=0))}return a&&s>0&&(a=!1),i&&h>0&&(i=!1),a&&(v||u+c+f>0)?r.UTF8:i&&(r.ASSUME_SHIFT_JIS||y>=3||C>=3)?r.SHIFT_JIS:o&&i?y===2&&l===2||10*w>=n?r.SHIFT_JIS:r.ISO88591:o?r.ISO88591:i?r.SHIFT_JIS:a?r.UTF8:r.PLATFORM_DEFAULT_ENCODING},r.format=function(t){for(var e=[],n=1;na){if(s===-1)s=i-a;else if(i-a!==s)throw new N("row lengths do not match");a=i,u++}c++}else if(t.substring(c,c+e.length)===e)c+=e.length,o[i]=!0,i++;else{if(t.substring(c,c+n.length)!==n)throw new N("illegal character encountered: "+t.substring(c));c+=n.length,o[i]=!1,i++}if(i>a){if(s===-1)s=i-a;else if(i-a!==s)throw new N("row lengths do not match");u++}for(var f=new r(s,u),h=0;h>>(31&t)&1)!=0},r.prototype.set=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]|=1<<(31&t)&4294967295},r.prototype.unset=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]&=~(1<<(31&t)&4294967295)},r.prototype.flip=function(t,e){var n=e*this.rowSize+Math.floor(t/32);this.bits[n]^=1<<(31&t)&4294967295},r.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new N("input matrix dimensions do not match");for(var e=new st(Math.floor(this.width/32)+1),n=this.rowSize,o=this.bits,i=0,a=this.height;ithis.height||i>this.width)throw new N("The region must fit inside the matrix");for(var s=this.rowSize,u=this.bits,c=e;cu&&(u=c),32*fs){for(l=31;!(h>>>l);)l--;32*f+l>s&&(s=32*f+l)}}}return s=0&&e[n]===0;)n--;if(n<0)return null;for(var o=Math.floor(n/t),i=32*Math.floor(n%t),a=e[n],s=31;!(a>>>s);)s--;return i+=s,Int32Array.from([i,o])},r.prototype.getWidth=function(){return this.width},r.prototype.getHeight=function(){return this.height},r.prototype.getRowSize=function(){return this.rowSize},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;return this.width===e.width&&this.height===e.height&&this.rowSize===e.rowSize&&$.equals(this.bits,e.bits)},r.prototype.hashCode=function(){var t=this.width;return t=31*(t=31*(t=31*(t=31*t+this.width)+this.height)+this.rowSize)+$.hashCode(this.bits)},r.prototype.toString=function(t,e,n){return t===void 0&&(t="X "),e===void 0&&(e=" "),n===void 0&&(n=` +`),this.buildToString(t,e,n)},r.prototype.buildToString=function(t,e,n){for(var o=new B,i=0,a=this.height;i>t.LUMINANCE_SHIFT]++;var c=t.estimateBlackPoint(s);if(i<3)for(u=0;u>t.LUMINANCE_SHIFT]++;var l=t.estimateBlackPoint(a),d=e.getMatrix();for(s=0;sa&&(i=s,a=e[s]),e[s]>o&&(o=e[s]);var u=0,c=0;for(s=0;sc&&(u=s,c=p)}if(i>u){var h=i;i=u,u=h}if(u-i<=n/16)throw new E;var l=u-1,d=-1;for(s=u-1;s>i;s--){var p,y=s-i;(p=y*y*(u-s)*(o-e[s]))>d&&(l=s,d=p)}return l<=t.MINIMUM_DIMENSION&&o>=t.MINIMUM_DIMENSION){var i=e.getMatrix(),a=n>>t.BLOCK_SIZE_POWER;n&t.BLOCK_SIZE_MASK&&a++;var s=o>>t.BLOCK_SIZE_POWER;o&t.BLOCK_SIZE_MASK&&s++;var u=t.calculateBlackPoints(i,a,s,n,o),c=new yt(n,o);t.calculateThresholdForBlock(i,a,s,n,o,u,c),this.matrix=c}else this.matrix=r.prototype.getBlackMatrix.call(this);return this.matrix},t.prototype.createBinarizer=function(e){return new t(e)},t.calculateThresholdForBlock=function(e,n,o,i,a,s,u){for(var c=a-t.BLOCK_SIZE,f=i-t.BLOCK_SIZE,h=0;hc&&(l=c);for(var d=t.cap(h,2,o-3),p=0;pf&&(y=f);for(var C=t.cap(p,2,n-3),w=0,v=-2;v<=2;v++){var _=s[d+v];w+=_[C-2]+_[C-1]+_[C]+_[C+1]+_[C+2]}var m=w/25;t.thresholdBlock(e,y,l,m,i,u)}}},t.cap=function(e,n,o){return eo?o:e},t.thresholdBlock=function(e,n,o,i,a,s){for(var u=0,c=o*a+n;us&&(h=s);for(var l=0;lu&&(d=u);for(var p=0,y=255,C=0,w=0,v=h*i+d;wC&&(C=m)}if(C-y>t.MIN_DYNAMIC_RANGE)for(w++,v+=i;w>2*t.BLOCK_SIZE_POWER;if(C-y<=t.MIN_DYNAMIC_RANGE&&(I=y/2,f>0&&l>0)){var S=(c[f-1][l]+2*c[f][l-1]+c[f-1][l-1])/4;y>10,i[s]=c}else{a=0,s=0;for(var f=e.length;a>10,i[s]=255-c}return i},t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new N("Requested row is outside the image: "+e);var o=this.getWidth(),i=e*o;return n===null?n=this.buffer.slice(i,i+o):(n.length0&&o[o.length-1])||f[0]!==6&&f[0]!==2)){a=0;continue}if(f[0]===3&&(!o||f[1]>o[0]&&f[1]=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Vt=function(){function r(t,e,n){e===void 0&&(e=500),this.reader=t,this.timeBetweenScansMillis=e,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(r.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(t){this._timeBetweenDecodingAttempts=t<0?0:t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"hints",{get:function(){return this._hints},set:function(t){this._hints=t||null},enumerable:!1,configurable:!0}),r.prototype.listVideoInputDevices=function(){return ht(this,void 0,void 0,function(){var t,e,n,o,i,a,s,u,c,f,h,l;return lt(this,function(d){switch(d.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:t=d.sent(),e=[];try{for(n=dn(t),o=n.next();!o.done;o=n.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,u=i.label||"Video device "+(e.length+1),c=i.groupId,f={deviceId:s,label:u,kind:a,groupId:c},e.push(f))}catch(p){h={error:p}}finally{try{o&&!o.done&&(l=n.return)&&l.call(n)}finally{if(h)throw h.error}}return[2,e]}})})},r.prototype.getVideoInputDevices=function(){return ht(this,void 0,void 0,function(){return lt(this,function(t){switch(t.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,t.sent().map(function(e){return new ln(e.deviceId,e.label)})]}})})},r.prototype.findDeviceById=function(t){return ht(this,void 0,void 0,function(){var e;return lt(this,function(n){switch(n.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(e=n.sent())?[2,e.find(function(o){return o.deviceId===t})]:[2,null]}})})},r.prototype.decodeFromInputVideoDevice=function(t,e){return ht(this,void 0,void 0,function(){return lt(this,function(n){switch(n.label){case 0:return[4,this.decodeOnceFromVideoDevice(t,e)];case 1:return[2,n.sent()]}})})},r.prototype.decodeOnceFromVideoDevice=function(t,e){return ht(this,void 0,void 0,function(){var n;return lt(this,function(o){switch(o.label){case 0:return this.reset(),n={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(n,e)];case 1:return[2,o.sent()]}})})},r.prototype.decodeOnceFromConstraints=function(t,e){return ht(this,void 0,void 0,function(){var n;return lt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return n=o.sent(),[4,this.decodeOnceFromStream(n,e)];case 2:return[2,o.sent()]}})})},r.prototype.decodeOnceFromStream=function(t,e){return ht(this,void 0,void 0,function(){var n;return lt(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return n=o.sent(),[4,this.decodeOnce(n)];case 2:return[2,o.sent()]}})})},r.prototype.decodeFromInputVideoDeviceContinuously=function(t,e,n){return ht(this,void 0,void 0,function(){return lt(this,function(o){switch(o.label){case 0:return[4,this.decodeFromVideoDevice(t,e,n)];case 1:return[2,o.sent()]}})})},r.prototype.decodeFromVideoDevice=function(t,e,n){return ht(this,void 0,void 0,function(){var o;return lt(this,function(i){switch(i.label){case 0:return o={video:t?{deviceId:{exact:t}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,e,n)];case 1:return[2,i.sent()]}})})},r.prototype.decodeFromConstraints=function(t,e,n){return ht(this,void 0,void 0,function(){var o;return lt(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(t)];case 1:return o=i.sent(),[4,this.decodeFromStream(o,e,n)];case 2:return[2,i.sent()]}})})},r.prototype.decodeFromStream=function(t,e,n){return ht(this,void 0,void 0,function(){var o;return lt(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(t,e)];case 1:return o=i.sent(),[4,this.decodeContinuously(o,n)];case 2:return[2,i.sent()]}})})},r.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},r.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},r.prototype.attachStreamToVideo=function(t,e){return ht(this,void 0,void 0,function(){var n;return lt(this,function(o){switch(o.label){case 0:return n=this.prepareVideoElement(e),this.addVideoSource(n,t),this.videoElement=n,this.stream=t,[4,this.playVideoOnLoadAsync(n)];case 1:return o.sent(),[2,n]}})})},r.prototype.playVideoOnLoadAsync=function(t){var e=this;return new Promise(function(n,o){return e.playVideoOnLoad(t,function(){return n()})})},r.prototype.playVideoOnLoad=function(t,e){var n=this;this.videoEndedListener=function(){return n.stopStreams()},this.videoCanPlayListener=function(){return n.tryPlayVideo(t)},t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",e),this.tryPlayVideo(t)},r.prototype.isVideoPlaying=function(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2},r.prototype.tryPlayVideo=function(t){return ht(this,void 0,void 0,function(){return lt(this,function(e){switch(e.label){case 0:if(this.isVideoPlaying(t))return console.warn("Trying to play video that is already playing."),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,t.play()];case 2:return e.sent(),[3,4];case 3:return e.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},r.prototype.getMediaElement=function(t,e){var n=document.getElementById(t);if(!n)throw new mt("element with id '"+t+"' not found");if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new mt("element with id '"+t+"' must be an "+e+" element");return n},r.prototype.decodeFromImage=function(t,e){if(!t&&!e)throw new mt("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)},r.prototype.decodeFromVideo=function(t,e){if(!t&&!e)throw new mt("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)},r.prototype.decodeFromVideoContinuously=function(t,e,n){if(t===void 0&&e===void 0)throw new mt("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,n):this.decodeFromVideoElementContinuously(t,n)},r.prototype.decodeFromImageElement=function(t){if(!t)throw new mt("An image element must be provided.");this.reset();var e=this.prepareImageElement(t);return this.imageElement=e,this.isImageLoaded(e)?this.decodeOnce(e,!1,!0):this._decodeOnLoadImage(e)},r.prototype.decodeFromVideoElement=function(t){var e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)},r.prototype.decodeFromVideoElementContinuously=function(t,e){var n=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(n,e)},r.prototype._decodeFromVideoElementSetup=function(t){if(!t)throw new mt("A video element must be provided.");this.reset();var e=this.prepareVideoElement(t);return this.videoElement=e,e},r.prototype.decodeFromImageUrl=function(t){if(!t)throw new mt("An URL must be provided.");this.reset();var e=this.prepareImageElement();this.imageElement=e;var n=this._decodeOnLoadImage(e);return e.src=t,n},r.prototype.decodeFromVideoUrl=function(t){if(!t)throw new mt("An URL must be provided.");this.reset();var e=this.prepareVideoElement(),n=this.decodeFromVideoElement(e);return e.src=t,n},r.prototype.decodeFromVideoUrlContinuously=function(t,e){if(!t)throw new mt("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),o=this.decodeFromVideoElementContinuously(n,e);return n.src=t,o},r.prototype._decodeOnLoadImage=function(t){var e=this;return new Promise(function(n,o){e.imageLoadedListener=function(){return e.decodeOnce(t,!1,!0).then(n,o)},t.addEventListener("load",e.imageLoadedListener)})},r.prototype._decodeOnLoadVideo=function(t){return ht(this,void 0,void 0,function(){return lt(this,function(e){switch(e.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return e.sent(),[4,this.decodeOnce(t)];case 2:return[2,e.sent()]}})})},r.prototype._decodeOnLoadVideoContinuously=function(t,e){return ht(this,void 0,void 0,function(){return lt(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(t)];case 1:return n.sent(),this.decodeContinuously(t,e),[2]}})})},r.prototype.isImageLoaded=function(t){return!!t.complete&&t.naturalWidth!==0},r.prototype.prepareImageElement=function(t){var e;return t===void 0&&((e=document.createElement("img")).width=200,e.height=200),typeof t=="string"&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e},r.prototype.prepareVideoElement=function(t){var e;return t||typeof document>"u"||((e=document.createElement("video")).width=200,e.height=200),typeof t=="string"&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e},r.prototype.decodeOnce=function(t,e,n){var o=this;e===void 0&&(e=!0),n===void 0&&(n=!0),this._stopAsyncDecode=!1;var i=function(a,s){if(o._stopAsyncDecode)return s(new E("Video stream has ended before any code could be detected.")),void(o._stopAsyncDecode=void 0);try{a(o.decode(t))}catch(u){if(e&&u instanceof E||(u instanceof at||u instanceof T)&&n)return setTimeout(i,o._timeBetweenDecodingAttempts,a,s);s(u)}};return new Promise(function(a,s){return i(a,s)})},r.prototype.decodeContinuously=function(t,e){var n=this;this._stopContinuousDecode=!1;var o=function(){if(n._stopContinuousDecode)n._stopContinuousDecode=void 0;else try{var i=n.decode(t);e(i,null),setTimeout(o,n.timeBetweenScansMillis)}catch(a){e(null,a),(a instanceof at||a instanceof T||a instanceof E)&&setTimeout(o,n._timeBetweenDecodingAttempts)}};o()},r.prototype.decode=function(t){var e=this.createBinaryBitmap(t);return this.decodeBitmap(e)},r.prototype.createBinaryBitmap=function(t){this.getCaptureCanvasContext(t),t instanceof HTMLVideoElement?this.drawFrameOnCanvas(t):this.drawImageOnCanvas(t);var e=this.getCaptureCanvas(t),n=new hn(e),o=new un(n);return new Zr(o)},r.prototype.getCaptureCanvasContext=function(t){if(!this.captureCanvasContext){var e=this.getCaptureCanvas(t),n=void 0;try{n=e.getContext("2d",{willReadFrequently:!0})}catch{n=e.getContext("2d")}this.captureCanvasContext=n}return this.captureCanvasContext},r.prototype.getCaptureCanvas=function(t){if(!this.captureCanvas){var e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas},r.prototype.drawFrameOnCanvas=function(t,e,n){e===void 0&&(e={sx:0,sy:0,sWidth:t.videoWidth,sHeight:t.videoHeight,dx:0,dy:0,dWidth:t.videoWidth,dHeight:t.videoHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)},r.prototype.drawImageOnCanvas=function(t,e,n){e===void 0&&(e={sx:0,sy:0,sWidth:t.naturalWidth,sHeight:t.naturalHeight,dx:0,dy:0,dWidth:t.naturalWidth,dHeight:t.naturalHeight}),n===void 0&&(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)},r.prototype.decodeBitmap=function(t){return this.reader.decode(t,this._hints)},r.prototype.createCaptureCanvas=function(t){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var e,n,o=document.createElement("canvas");return t!==void 0&&(t instanceof HTMLVideoElement?(e=t.videoWidth,n=t.videoHeight):t instanceof HTMLImageElement&&(e=t.naturalWidth||t.width,n=t.naturalHeight||t.height)),o.style.width=e+"px",o.style.height=n+"px",o.width=e,o.height=n,o},r.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(t){return t.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},r.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},r.prototype._destroyVideoElement=function(){this.videoElement&&(this.videoEndedListener!==void 0&&this.videoElement.removeEventListener("ended",this.videoEndedListener),this.videoPlayingEventListener!==void 0&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),this.videoCanPlayListener!==void 0&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},r.prototype._destroyImageElement=function(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},r.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},r.prototype.addVideoSource=function(t,e){try{t.srcObject=e}catch{t.src=URL.createObjectURL(e)}},r.prototype.cleanVideoSource=function(t){try{t.srcObject=null}catch{t.src=""}this.videoElement.removeAttribute("src")},r}(),ft=function(){function r(t,e,n,o,i,a){n===void 0&&(n=e==null?0:8*e.length),a===void 0&&(a=Z.currentTimeMillis()),this.text=t,this.rawBytes=e,this.numBits=n,this.resultPoints=o,this.format=i,this.timestamp=a,this.text=t,this.rawBytes=e,this.numBits=n??(e==null?0:8*e.length),this.resultPoints=o,this.format=i,this.resultMetadata=null,this.timestamp=a??Z.currentTimeMillis()}return r.prototype.getText=function(){return this.text},r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.getResultPoints=function(){return this.resultPoints},r.prototype.getBarcodeFormat=function(){return this.format},r.prototype.getResultMetadata=function(){return this.resultMetadata},r.prototype.putMetadata=function(t,e){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)},r.prototype.putAllMetadata=function(t){t!==null&&(this.resultMetadata===null?this.resultMetadata=t:this.resultMetadata=new Map(t))},r.prototype.addResultPoints=function(t){var e=this.resultPoints;if(e===null)this.resultPoints=t;else if(t!==null&&t.length>0){var n=new Array(e.length+t.length);Z.arraycopy(e,0,n,0,e.length),Z.arraycopy(t,0,n,e.length,t.length),this.resultPoints=n}},r.prototype.getTimestamp=function(){return this.timestamp},r.prototype.toString=function(){return this.text},r}();(function(r){r[r.AZTEC=0]="AZTEC",r[r.CODABAR=1]="CODABAR",r[r.CODE_39=2]="CODE_39",r[r.CODE_93=3]="CODE_93",r[r.CODE_128=4]="CODE_128",r[r.DATA_MATRIX=5]="DATA_MATRIX",r[r.EAN_8=6]="EAN_8",r[r.EAN_13=7]="EAN_13",r[r.ITF=8]="ITF",r[r.MAXICODE=9]="MAXICODE",r[r.PDF_417=10]="PDF_417",r[r.QR_CODE=11]="QR_CODE",r[r.RSS_14=12]="RSS_14",r[r.RSS_EXPANDED=13]="RSS_EXPANDED",r[r.UPC_A=14]="UPC_A",r[r.UPC_E=15]="UPC_E",r[r.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(me||(me={}));var Ee,D=me;(function(r){r[r.OTHER=0]="OTHER",r[r.ORIENTATION=1]="ORIENTATION",r[r.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",r[r.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",r[r.ISSUE_NUMBER=4]="ISSUE_NUMBER",r[r.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",r[r.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",r[r.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",r[r.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",r[r.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",r[r.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(Ee||(Ee={}));var ut,ct=Ee,ce=function(){function r(t,e,n,o,i,a){i===void 0&&(i=-1),a===void 0&&(a=-1),this.rawBytes=t,this.text=e,this.byteSegments=n,this.ecLevel=o,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=a,this.numBits=t==null?0:8*t.length}return r.prototype.getRawBytes=function(){return this.rawBytes},r.prototype.getNumBits=function(){return this.numBits},r.prototype.setNumBits=function(t){this.numBits=t},r.prototype.getText=function(){return this.text},r.prototype.getByteSegments=function(){return this.byteSegments},r.prototype.getECLevel=function(){return this.ecLevel},r.prototype.getErrorsCorrected=function(){return this.errorsCorrected},r.prototype.setErrorsCorrected=function(t){this.errorsCorrected=t},r.prototype.getErasures=function(){return this.erasures},r.prototype.setErasures=function(t){this.erasures=t},r.prototype.getOther=function(){return this.other},r.prototype.setOther=function(t){this.other=t},r.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},r.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},r.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},r}(),Gt=function(){function r(){}return r.prototype.exp=function(t){return this.expTable[t]},r.prototype.log=function(t){if(t===0)throw new N;return this.logTable[t]},r.addOrSubtract=function(t,e){return t^e},r}(),Rt=function(){function r(t,e){if(e.length===0)throw new N;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var o=1;on.length){var o=e;e=n,n=o}var i=new Int32Array(n.length),a=n.length-e.length;Z.arraycopy(n,0,i,0,a);for(var s=a;s=t.getDegree()&&!o.isZero();){var s=o.getDegree()-t.getDegree(),u=e.multiply(o.getCoefficient(o.getDegree()),a),c=t.multiplyByMonomial(s,u),f=e.buildMonomial(s,u);n=n.addOrSubtract(f),o=o.addOrSubtract(c)}return[n,o]},r.prototype.toString=function(){for(var t="",e=this.getDegree();e>=0;e--){var n=this.getCoefficient(e);if(n!==0){if(n<0?(t+=" - ",n=-n):t.length>0&&(t+=" + "),e===0||n!==1){var o=this.field.log(n);o===0?t+="1":o===1?t+="a":(t+="a^",t+=o)}e!==0&&(e===1?t+="x":(t+="x^",t+=e))}}return t},r}(),pn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ir=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return pn(t,r),t.kind="ArithmeticException",t}(wt),gn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),gt=function(r){function t(e,n,o){var i=r.call(this)||this;i.primitive=e,i.size=n,i.generatorBase=o;for(var a=new Int32Array(n),s=1,u=0;u=n&&(s^=e,s&=n-1);i.expTable=a;var c=new Int32Array(n);for(u=0;u=(n/2|0);){var f=a,h=u;if(u=c,(a=s).isZero())throw new Qt("r_{i-1} was zero");s=f;for(var l=i.getZero(),d=a.getCoefficient(a.getDegree()),p=i.inverse(d);s.getDegree()>=a.getDegree()&&!s.isZero();){var y=s.getDegree()-a.getDegree(),C=i.multiply(s.getCoefficient(s.getDegree()),p);l=l.addOrSubtract(i.buildMonomial(y,C)),s=s.addOrSubtract(a.multiplyByMonomial(y,C))}if(c=l.multiply(u).addOrSubtract(h),s.getDegree()>=a.getDegree())throw new Nt("Division algorithm failed to reduce polynomial?")}var w=c.getCoefficient(0);if(w===0)throw new Qt("sigmaTilde(0) was zero");var v=i.inverse(w);return[c.multiplyScalar(v),s.multiplyScalar(v)]},r.prototype.findErrorLocations=function(t){var e=t.getDegree();if(e===1)return Int32Array.from([t.getCoefficient(1)]);for(var n=new Int32Array(e),o=0,i=this.field,a=1;a1,l,l+n-1),l+=n-1;else for(var p=n-1;p>=0;--p)h[l++]=(d&1<=8?r.readCode(t,e,8):r.readCode(t,e,n)<<8-n},r.convertBoolArrayToByteArray=function(t){for(var e=new Uint8Array((t.length+7)/8),n=0;n","?","[","]","{","}","CTRL_UL"],r.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],r}(),U=function(){function r(){}return r.round=function(t){return isNaN(t)?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0},r.distance=function(t,e,n,o){var i=t-n,a=e-o;return Math.sqrt(i*i+a*a)},r.sum=function(t){for(var e=0,n=0,o=t.length;n!==o;n++)e+=t[n];return e},r}(),Ie=function(){function r(){}return r.floatToIntBits=function(t){return t},r.MAX_VALUE=Number.MAX_SAFE_INTEGER,r}(),R=function(){function r(t,e){this.x=t,this.y=e}return r.prototype.getX=function(){return this.x},r.prototype.getY=function(){return this.y},r.prototype.equals=function(t){if(t instanceof r){var e=t;return this.x===e.x&&this.y===e.y}return!1},r.prototype.hashCode=function(){return 31*Ie.floatToIntBits(this.x)+Ie.floatToIntBits(this.y)},r.prototype.toString=function(){return"("+this.x+","+this.y+")"},r.orderBestPatterns=function(t){var e,n,o,i=this.distance(t[0],t[1]),a=this.distance(t[1],t[2]),s=this.distance(t[0],t[2]);if(a>=i&&a>=s?(n=t[0],e=t[1],o=t[2]):s>=a&&s>=i?(n=t[1],e=t[0],o=t[2]):(n=t[2],e=t[0],o=t[1]),this.crossProductZ(e,n,o)<0){var u=e;e=o,o=u}t[0]=e,t[1]=n,t[2]=o},r.distance=function(t,e){return U.distance(t.x,t.y,e.x,e.y)},r.crossProductZ=function(t,e,n){var o=e.x,i=e.y;return(n.x-o)*(t.y-i)-(n.y-i)*(t.x-o)},r}(),xe=function(){function r(t,e){this.bits=t,this.points=e}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r}(),Cn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),vn=function(r){function t(e,n,o,i,a){var s=r.call(this,e,n)||this;return s.compact=o,s.nbDatablocks=i,s.nbLayers=a,s}return Cn(t,r),t.prototype.getNbLayers=function(){return this.nbLayers},t.prototype.getNbDatablocks=function(){return this.nbDatablocks},t.prototype.isCompact=function(){return this.compact},t}(xe),Se=function(){function r(t,e,n,o){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),e==null&&(e=r.INIT_SIZE),n==null&&(n=t.getWidth()/2|0),o==null&&(o=t.getHeight()/2|0);var i=e/2|0;if(this.leftInit=n-i,this.rightInit=n+i,this.upInit=o-i,this.downInit=o+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new E}return r.prototype.detect=function(){for(var t=this.leftInit,e=this.rightInit,n=this.upInit,o=this.downInit,i=!1,a=!0,s=!1,u=!1,c=!1,f=!1,h=!1,l=this.width,d=this.height;a;){a=!1;for(var p=!0;(p||!u)&&e=l){i=!0;break}for(var y=!0;(y||!c)&&o=d){i=!0;break}for(var C=!0;(C||!f)&&t>=0;)(C=this.containsBlackPoint(n,o,t,!1))?(t--,a=!0,f=!0):f||t--;if(t<0){i=!0;break}for(var w=!0;(w||!h)&&n>=0;)(w=this.containsBlackPoint(t,e,n,!0))?(n--,a=!0,h=!0):h||n--;if(n<0){i=!0;break}a&&(s=!0)}if(!i&&s){for(var v=e-t,_=null,m=1;_===null&&mn||u<-1||u>o)throw new E;i=!1,s===-1?(e[a]=0,i=!0):s===n&&(e[a]=n-1,i=!0),u===-1?(e[a+1]=0,i=!0):u===o&&(e[a+1]=o-1,i=!0)}for(i=!0,a=e.length-2;a>=0&&i;a-=2){if(s=Math.floor(e[a]),u=Math.floor(e[a+1]),s<-1||s>n||u<-1||u>o)throw new E;i=!1,s===-1?(e[a]=0,i=!0):s===n&&(e[a]=n-1,i=!0),u===-1?(e[a+1]=0,i=!0):u===o&&(e[a+1]=o-1,i=!0)}},r}(),Sr=function(){function r(t,e,n,o,i,a,s,u,c){this.a11=t,this.a21=e,this.a31=n,this.a12=o,this.a22=i,this.a32=a,this.a13=s,this.a23=u,this.a33=c}return r.quadrilateralToQuadrilateral=function(t,e,n,o,i,a,s,u,c,f,h,l,d,p,y,C){var w=r.quadrilateralToSquare(t,e,n,o,i,a,s,u);return r.squareToQuadrilateral(c,f,h,l,d,p,y,C).times(w)},r.prototype.transformPoints=function(t){for(var e=t.length,n=this.a11,o=this.a12,i=this.a13,a=this.a21,s=this.a22,u=this.a23,c=this.a31,f=this.a32,h=this.a33,l=0;l>1&127):(o<<=10,o+=(a>>2&992)+(a>>1&31))}var s=this.getCorrectedParameterData(o,this.compact);this.compact?(this.nbLayers=1+(s>>6),this.nbDataBlocks=1+(63&s)):(this.nbLayers=1+(s>>11),this.nbDataBlocks=1+(2047&s))},r.prototype.getRotation=function(t,e){var n=0;t.forEach(function(i,a,s){n=(n<<3)+((i>>e-2<<1)+(1&i))}),n=((1&n)<<11)+(n>>1);for(var o=0;o<4;o++)if(P.bitCount(n^this.EXPECTED_CORNER_BITS[o])<=2)return o;throw new E},r.prototype.getCorrectedParameterData=function(t,e){var n,o;e?(n=7,o=2):(n=10,o=4);for(var i=n-o,a=new Int32Array(n),s=n-1;s>=0;--s)a[s]=15&t,t>>=4;try{new fe(gt.AZTEC_PARAM).decode(a,i)}catch{throw new E}var u=0;for(s=0;s2){var h=this.distancePoint(f,s)*this.nbCenterLayers/(this.distancePoint(i,e)*(this.nbCenterLayers+2));if(h<.75||h>1.25||!this.isWhiteOrBlackRectangle(s,u,c,f))break}e=s,n=u,o=c,i=f,a=!a}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new E;this.compact=this.nbCenterLayers===5;var l=new R(e.getX()+.5,e.getY()-.5),d=new R(n.getX()+.5,n.getY()+.5),p=new R(o.getX()-.5,o.getY()+.5),y=new R(i.getX()-.5,i.getY()-.5);return this.expandSquare([l,d,p,y],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},r.prototype.getMatrixCenter=function(){var t,e,n,o;try{t=(c=new Se(this.image).detect())[0],e=c[1],n=c[2],o=c[3]}catch{var i=this.image.getWidth()/2,a=this.image.getHeight()/2;t=this.getFirstDifferent(new dt(i+7,a-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new dt(i+7,a+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new dt(i-7,a+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new dt(i-7,a-7),!1,-1,-1).toResultPoint()}var s=U.round((t.getX()+o.getX()+e.getX()+n.getX())/4),u=U.round((t.getY()+o.getY()+e.getY()+n.getY())/4);try{var c;t=(c=new Se(this.image,15,s,u).detect())[0],e=c[1],n=c[2],o=c[3]}catch{t=this.getFirstDifferent(new dt(s+7,u-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new dt(s+7,u+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new dt(s-7,u+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new dt(s-7,u-7),!1,-1,-1).toResultPoint()}return s=U.round((t.getX()+o.getX()+e.getX()+n.getX())/4),u=U.round((t.getY()+o.getY()+e.getY()+n.getY())/4),new dt(s,u)},r.prototype.getMatrixCornerPoints=function(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())},r.prototype.sampleGrid=function(t,e,n,o,i){var a=ke.getInstance(),s=this.getDimension(),u=s/2-this.nbCenterLayers,c=s/2+this.nbCenterLayers;return a.sampleGrid(t,s,s,u,u,c,u,c,c,u,c,e.getX(),e.getY(),n.getX(),n.getY(),o.getX(),o.getY(),i.getX(),i.getY())},r.prototype.sampleLine=function(t,e,n){for(var o=0,i=this.distanceResultPoint(t,e),a=i/n,s=t.getX(),u=t.getY(),c=a*(e.getX()-t.getX())/i,f=a*(e.getY()-t.getY())/i,h=0;h.1&&l<.9?0:l<=.1===c?1:-1},r.prototype.getFirstDifferent=function(t,e,n,o){for(var i=t.getX()+n,a=t.getY()+o;this.isValid(i,a)&&this.image.get(i,a)===e;)i+=n,a+=o;for(i-=n,a-=o;this.isValid(i,a)&&this.image.get(i,a)===e;)i+=n;for(i-=n;this.isValid(i,a)&&this.image.get(i,a)===e;)a+=o;return new dt(i,a-=o)},r.prototype.expandSquare=function(t,e,n){var o=n/(2*e),i=t[0].getX()-t[2].getX(),a=t[0].getY()-t[2].getY(),s=(t[0].getX()+t[2].getX())/2,u=(t[0].getY()+t[2].getY())/2,c=new R(s+o*i,u+o*a),f=new R(s-o*i,u-o*a);return i=t[1].getX()-t[3].getX(),a=t[1].getY()-t[3].getY(),s=(t[1].getX()+t[3].getX())/2,u=(t[1].getY()+t[3].getY())/2,[c,new R(s+o*i,u+o*a),f,new R(s-o*i,u-o*a)]},r.prototype.isValid=function(t,e){return t>=0&&t0&&e>(s?8:5));n=s?i:15;for(var c=Math.trunc(i/2),f=0;f=i)break;try{a=t.getBlackRow(l,a)}catch{continue}for(var d=function(w){if(w===1&&(a.reverse(),e&&e.get(Q.NEED_RESULT_POINT_CALLBACK)===!0)){var v=new Map;e.forEach(function(I,S){return v.set(S,I)}),v.delete(Q.NEED_RESULT_POINT_CALLBACK),e=v}try{var _=p.decodeRow(l,a,e);if(w===1){_.putMetadata(ct.ORIENTATION,180);var m=_.getResultPoints();m!==null&&(m[0]=new R(o-m[0].getX()-1,m[0].getY()),m[1]=new R(o-m[1].getX()-1,m[1].getY()))}return{value:_}}catch{}},p=this,y=0;y<2;y++){var C=d(y);if(typeof C=="object")return C.value}}throw new E},r.recordPattern=function(t,e,n){for(var o=n.length,i=0;i=a)throw new E;for(var s=!t.get(e),u=0,c=e;c0&&o>=0;)t.get(--e)!==i&&(o--,i=!i);if(o>=0)throw new E;r.recordPattern(t,e+1,n)},r.patternMatchVariance=function(t,e,n){for(var o=t.length,i=0,a=0,s=0;sl?h-l:l-h;if(d>n)return Number.POSITIVE_INFINITY;c+=d}return c/i},r}(),In=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ze=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return In(t,r),t.findStartPattern=function(e){for(var n=e.getSize(),o=e.getNextSet(0),i=0,a=Int32Array.from([0,0,0,0,0,0]),s=o,u=!1,c=o;c=0&&e.isRange(Math.max(0,s-(c-s)/2),s,!1))return Int32Array.from([s,c,h]);s+=a[0]+a[1],(a=a.slice(2,a.length))[i-1]=0,a[i]=0,i--}else i++;a[i]=1,u=!u}throw new E},t.decodeCode=function(e,n,o){ot.recordPattern(e,o,n);for(var i=t.MAX_AVG_VARIANCE,a=-1,s=0;s=0)return a;throw new E},t.prototype.decodeRow=function(e,n,o){var i,a=o&&o.get(Q.ASSUME_GS1)===!0,s=t.findStartPattern(n),u=s[2],c=0,f=new Uint8Array(20);switch(f[c++]=u,u){case t.CODE_START_A:i=t.CODE_CODE_A;break;case t.CODE_START_B:i=t.CODE_CODE_B;break;case t.CODE_START_C:i=t.CODE_CODE_C;break;default:throw new T}for(var h=!1,l=!1,d="",p=s[0],y=s[1],C=Int32Array.from([0,0,0,0,0,0]),w=0,v=0,_=u,m=0,I=!0,S=!1,O=!1;!h;){var M=l;switch(l=!1,w=v,v=t.decodeCode(n,C,y),f[c++]=v,v!==t.CODE_STOP&&(I=!0),v!==t.CODE_STOP&&(_+=++m*v),p=y,y+=C.reduce(function(Ur,Xr){return Ur+Xr},0),v){case t.CODE_START_A:case t.CODE_START_B:case t.CODE_START_C:throw new T}switch(i){case t.CODE_CODE_A:if(v<64)d+=O===S?String.fromCharCode(" ".charCodeAt(0)+v):String.fromCharCode(" ".charCodeAt(0)+v+128),O=!1;else if(v<96)d+=O===S?String.fromCharCode(v-64):String.fromCharCode(v+64),O=!1;else switch(v!==t.CODE_STOP&&(I=!1),v){case t.CODE_FNC_1:a&&(d.length===0?d+="]C1":d+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_A:!S&&O?(S=!0,O=!1):S&&O?(S=!1,O=!1):O=!0;break;case t.CODE_SHIFT:l=!0,i=t.CODE_CODE_B;break;case t.CODE_CODE_B:i=t.CODE_CODE_B;break;case t.CODE_CODE_C:i=t.CODE_CODE_C;break;case t.CODE_STOP:h=!0}break;case t.CODE_CODE_B:if(v<96)d+=O===S?String.fromCharCode(" ".charCodeAt(0)+v):String.fromCharCode(" ".charCodeAt(0)+v+128),O=!1;else switch(v!==t.CODE_STOP&&(I=!1),v){case t.CODE_FNC_1:a&&(d.length===0?d+="]C1":d+=String.fromCharCode(29));break;case t.CODE_FNC_2:case t.CODE_FNC_3:break;case t.CODE_FNC_4_B:!S&&O?(S=!0,O=!1):S&&O?(S=!1,O=!1):O=!0;break;case t.CODE_SHIFT:l=!0,i=t.CODE_CODE_A;break;case t.CODE_CODE_A:i=t.CODE_CODE_A;break;case t.CODE_CODE_C:i=t.CODE_CODE_C;break;case t.CODE_STOP:h=!0}break;case t.CODE_CODE_C:if(v<100)v<10&&(d+="0"),d+=v;else switch(v!==t.CODE_STOP&&(I=!1),v){case t.CODE_FNC_1:a&&(d.length===0?d+="]C1":d+=String.fromCharCode(29));break;case t.CODE_CODE_A:i=t.CODE_CODE_A;break;case t.CODE_CODE_B:i=t.CODE_CODE_B;break;case t.CODE_STOP:h=!0}}M&&(i=i===t.CODE_CODE_A?t.CODE_CODE_B:t.CODE_CODE_A)}var k=y-p;if(y=n.getNextUnset(y),!n.isRange(y,Math.min(n.getSize(),y+(y-p)/2),!1))throw new E;if((_-=m*w)%103!==w)throw new at;var x=d.length;if(x===0)throw new E;x>0&&I&&(d=i===t.CODE_CODE_C?d.substring(0,x-2):d.substring(0,x-1));for(var J=(s[1]+s[0])/2,W=p+k/2,tt=f.length,It=new Uint8Array(tt),St=0;St=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ke=function(r){function t(e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var o=r.call(this)||this;return o.usingCheckDigit=e,o.extendedMode=n,o.decodeRowResult="",o.counters=new Int32Array(9),o}return Sn(t,r),t.prototype.decodeRow=function(e,n,o){var i,a,s,u,c=this.counters;c.fill(0),this.decodeRowResult="";var f,h,l=t.findAsteriskPattern(n,c),d=n.getNextSet(l[1]),p=n.getSize();do{t.recordPattern(n,d,c);var y=t.toNarrowWidePattern(c);if(y<0)throw new E;f=t.patternToChar(y),this.decodeRowResult+=f,h=d;try{for(var C=(i=void 0,le(c)),w=C.next();!w.done;w=C.next())d+=w.value}catch(J){i={error:J}}finally{try{w&&!w.done&&(a=C.return)&&a.call(C)}finally{if(i)throw i.error}}d=n.getNextSet(d)}while(f!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var v,_=0;try{for(var m=le(c),I=m.next();!I.done;I=m.next())_+=I.value}catch(J){s={error:J}}finally{try{I&&!I.done&&(u=m.return)&&u.call(m)}finally{if(s)throw s.error}}if(d!==p&&2*(d-h-_)<_)throw new E;if(this.usingCheckDigit){for(var S=this.decodeRowResult.length-1,O=0,M=0;Ms&&(u=p)}catch(y){n={error:y}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}s=u,i=0;for(var h=0,l=0,d=0;ds&&(l|=1<0;d++){var p;if((p=e[d])>s&&(i--,2*p>=h))return-1}return l}}while(i>3);return-1},t.patternToChar=function(e){for(var n=0;n="A"&&s<="Z"))throw new T;u=String.fromCharCode(s.charCodeAt(0)+32);break;case"$":if(!(s>="A"&&s<="Z"))throw new T;u=String.fromCharCode(s.charCodeAt(0)-64);break;case"%":if(s>="A"&&s<="E")u=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")u=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")u=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")u=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")u="\0";else if(s==="V")u="@";else if(s==="W")u="`";else{if(s!=="X"&&s!=="Y"&&s!=="Z")throw new T;u="\x7F"}break;case"/":if(s>="A"&&s<="O")u=String.fromCharCode(s.charCodeAt(0)-32);else{if(s!=="Z")throw new T;u=":"}}o+=u,i++}else o+=a}return o},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",t.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],t.ASTERISK_ENCODING=148,t}(ot),Tn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),de=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},qe=function(r){function t(){var e=r.call(this)||this;return e.decodeRowResult="",e.counters=new Int32Array(6),e}return Tn(t,r),t.prototype.decodeRow=function(e,n,o){var i,a,s,u,c,f,h=this.findAsteriskPattern(n),l=n.getNextSet(h[1]),d=n.getSize(),p=this.counters;p.fill(0),this.decodeRowResult="";do{t.recordPattern(n,l,p);var y=this.toPattern(p);if(y<0)throw new E;c=this.patternToChar(y),this.decodeRowResult+=c,f=l;try{for(var C=(i=void 0,de(p)),w=C.next();!w.done;w=C.next())l+=w.value}catch(M){i={error:M}}finally{try{w&&!w.done&&(a=C.return)&&a.call(C)}finally{if(i)throw i.error}}l=n.getNextSet(l)}while(c!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var v=0;try{for(var _=de(p),m=_.next();!m.done;m=_.next())v+=m.value}catch(M){s={error:M}}finally{try{m&&!m.done&&(u=_.return)&&u.call(_)}finally{if(s)throw s.error}}if(l===d||!n.get(l))throw new E;if(this.decodeRowResult.length<2)throw new E;this.checkChecksums(this.decodeRowResult),this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-2);var I=this.decodeExtended(this.decodeRowResult),S=(h[1]+h[0])/2,O=f+v/2;return new ft(I,null,0,[new R(S,e),new R(O,e)],D.CODE_93,new Date().getTime())},t.prototype.findAsteriskPattern=function(e){var n=e.getSize(),o=e.getNextSet(0);this.counters.fill(0);for(var i=this.counters,a=o,s=!1,u=i.length,c=0,f=o;f4)return-1;if(1&f)u<<=h;else for(var l=0;l="a"&&a<="d"){if(i>=n-1)throw new T;var s=e.charAt(i+1),u="\0";switch(a){case"d":if(!(s>="A"&&s<="Z"))throw new T;u=String.fromCharCode(s.charCodeAt(0)+32);break;case"a":if(!(s>="A"&&s<="Z"))throw new T;u=String.fromCharCode(s.charCodeAt(0)-64);break;case"b":if(s>="A"&&s<="E")u=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")u=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")u=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")u=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")u="\0";else if(s==="V")u="@";else if(s==="W")u="`";else{if(!(s>="X"&&s<="Z"))throw new T;u=String.fromCharCode(127)}break;case"c":if(s>="A"&&s<="O")u=String.fromCharCode(s.charCodeAt(0)-32);else{if(s!=="Z")throw new T;u=":"}}o+=u,i++}else o+=a}return o},t.prototype.checkChecksums=function(e){var n=e.length;this.checkOneChecksum(e,n-2,20),this.checkOneChecksum(e,n-1,15)},t.prototype.checkOneChecksum=function(e,n,o){for(var i=1,a=0,s=n-1;s>=0;s--)a+=i*t.ALPHABET_STRING.indexOf(e.charAt(s)),++i>o&&(i=1);if(e.charAt(n)!==t.ALPHABET_STRING[a%47])throw new at},t.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%abcd*",t.CHARACTER_ENCODINGS=[276,328,324,322,296,292,290,336,274,266,424,420,418,404,402,394,360,356,354,308,282,344,332,326,300,278,436,434,428,422,406,410,364,358,310,314,302,468,466,458,366,374,430,294,474,470,306,350],t.ASTERISK_ENCODING=t.CHARACTER_ENCODINGS[47],t}(ot),On=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),bn=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Qe=function(r){function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.narrowLineWidth=-1,e}return On(t,r),t.prototype.decodeRow=function(e,n,o){var i,a,s=this.decodeStart(n),u=this.decodeEnd(n),c=new B;t.decodeMiddle(n,s[1],u[0],c);var f=c.toString(),h=null;o!=null&&(h=o.get(Q.ALLOWED_LENGTHS)),h==null&&(h=t.DEFAULT_ALLOWED_LENGTHS);var l=f.length,d=!1,p=0;try{for(var y=bn(h),C=y.next();!C.done;C=y.next()){var w=C.value;if(l===w){d=!0;break}w>p&&(p=w)}}catch(_){i={error:_}}finally{try{C&&!C.done&&(a=y.return)&&a.call(y)}finally{if(i)throw i.error}}if(!d&&l>p&&(d=!0),!d)throw new T;var v=[new R(s[1],e),new R(u[0],e)];return new ft(f,null,0,v,D.ITF,new Date().getTime())},t.decodeMiddle=function(e,n,o,i){var a=new Int32Array(10),s=new Int32Array(5),u=new Int32Array(5);for(a.fill(0),s.fill(0),u.fill(0);n0&&i>=0&&!e.get(i);i--)o--;if(o!==0)throw new E},t.skipWhiteSpace=function(e){var n=e.getSize(),o=e.getNextSet(0);if(o===n)throw new E;return o},t.prototype.decodeEnd=function(e){e.reverse();try{var n=t.skipWhiteSpace(e),o=void 0;try{o=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[0])}catch(a){a instanceof E&&(o=t.findGuardPattern(e,n,t.END_PATTERN_REVERSED[1]))}this.validateQuietZone(e,o[0]);var i=o[0];return o[0]=e.getSize()-o[1],o[1]=e.getSize()-i,o}finally{e.reverse()}},t.findGuardPattern=function(e,n,o){var i=o.length,a=new Int32Array(i),s=e.getSize(),u=!1,c=0,f=n;a.fill(0);for(var h=n;h=0)return o%10;throw new E},t.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],t.MAX_AVG_VARIANCE=.38,t.MAX_INDIVIDUAL_VARIANCE=.5,t.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],t.START_PATTERN=Int32Array.from([1,1,1,1]),t.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],t}(ot),Rn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),kt=function(r){function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.decodeRowStringBuffer="",e}return Rn(t,r),t.findStartGuardPattern=function(e){for(var n,o=!1,i=0,a=Int32Array.from([0,0,0]);!o;){a=Int32Array.from([0,0,0]);var s=(n=t.findGuardPattern(e,i,!1,this.START_END_PATTERN,a))[0],u=s-((i=n[1])-s);u>=0&&(o=e.isRange(u,s,!1))}return n},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var o=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===o},t.getStandardUPCEANChecksum=function(e){for(var n=e.length,o=0,i=n-1;i>=0;i-=2){if((a=e.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new T;o+=a}for(o*=3,i=n-2;i>=0;i-=2){var a;if((a=e.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new T;o+=a}return(1e3-o)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t.findGuardPatternWithoutCounters=function(e,n,o,i){return this.findGuardPattern(e,n,o,i,new Int32Array(i.length))},t.findGuardPattern=function(e,n,o,i,a){for(var s=e.getSize(),u=0,c=n=o?e.getNextUnset(n):e.getNextSet(n),f=i.length,h=o,l=n;l=0)return s;throw new E},t.MAX_AVG_VARIANCE=.48,t.MAX_INDIVIDUAL_VARIANCE=.7,t.START_END_PATTERN=Int32Array.from([1,1,1]),t.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),t.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],t}(ot),Nn=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Dn=function(){function r(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(t,e,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(e,n,o),a=o.toString(),s=r.parseExtensionString(a),u=[new R((n[0]+n[1])/2,t),new R(i,t)],c=new ft(a,null,0,u,D.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},r.prototype.decodeMiddle=function(t,e,n){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),u=e[1],c=0,f=0;f<5&&u=10&&(c|=1<<4-f),f!==4&&(u=t.getNextSet(u),u=t.getNextUnset(u))}if(n.length!==5)throw new E;var p=this.determineCheckDigit(c);if(r.extensionChecksum(n.toString())!==p)throw new E;return u},r.extensionChecksum=function(t){for(var e=t.length,n=0,o=e-2;o>=0;o-=2)n+=t.charAt(o).charCodeAt(0)-"0".charCodeAt(0);for(n*=3,o=e-1;o>=0;o-=2)n+=t.charAt(o).charCodeAt(0)-"0".charCodeAt(0);return(n*=3)%10},r.prototype.determineCheckDigit=function(t){for(var e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new E},r.parseExtensionString=function(t){if(t.length!==5)return null;var e=r.parseExtension5String(t);return e==null?null:new Map([[ct.SUGGESTED_PRICE,e]])},r.parseExtension5String=function(t){var e;switch(t.charAt(0)){case"0":e="\xA3";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e=""}var n=parseInt(t.substring(1)),o=n%100;return e+(n/100).toString()+"."+(o<10?"0"+o:o.toString())},r}(),Mn=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Pn=function(){function r(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return r.prototype.decodeRow=function(t,e,n){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(e,n,o),a=o.toString(),s=r.parseExtensionString(a),u=[new R((n[0]+n[1])/2,t),new R(i,t)],c=new ft(a,null,0,u,D.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&c.putAllMetadata(s),c},r.prototype.decodeMiddle=function(t,e,n){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=t.getSize(),u=e[1],c=0,f=0;f<2&&u=10&&(c|=1<<1-f),f!==1&&(u=t.getNextSet(u),u=t.getNextUnset(u))}if(n.length!==2)throw new E;if(parseInt(n.toString())%4!==c)throw new E;return u},r.parseExtensionString=function(t){return t.length!==2?null:new Map([[ct.ISSUE_NUMBER,parseInt(t)]])},r}(),Bn=function(){function r(){}return r.decodeRow=function(t,e,n){var o=kt.findGuardPattern(e,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new Dn().decodeRow(t,e,o)}catch{return new Pn().decodeRow(t,e,o)}},r.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),r}(),Ln=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),rt=function(r){function t(){var e=r.call(this)||this;e.decodeRowStringBuffer="",t.L_AND_G_PATTERNS=t.L_PATTERNS.map(function(s){return Int32Array.from(s)});for(var n=10;n<20;n++){for(var o=t.L_PATTERNS[n-10],i=new Int32Array(o.length),a=0;a=n.getSize()||!n.isRange(p,y,!1))throw new E;var C=f.toString();if(C.length<8)throw new T;if(!t.checkChecksum(C))throw new at;var w=(i[1]+i[0])/2,v=(l[1]+l[0])/2,_=this.getBarcodeFormat(),m=[new R(w,e),new R(v,e)],I=new ft(C,null,0,m,_,new Date().getTime()),S=0;try{var O=Bn.decodeRow(e,n,l[1]);I.putMetadata(ct.UPC_EAN_EXTENSION,O.getText()),I.putAllMetadata(O.getResultMetadata()),I.addResultPoints(O.getResultPoints()),S=O.getText().length}catch{}var M=o==null?null:o.get(Q.ALLOWED_EAN_EXTENSIONS);if(M!=null){var k=!1;for(var x in M)if(S.toString()===x){k=!0;break}if(!k)throw new E}return _===D.EAN_13||D.UPC_A,I},t.checkChecksum=function(e){return t.checkStandardUPCEANChecksum(e)},t.checkStandardUPCEANChecksum=function(e){var n=e.length;if(n===0)return!1;var o=parseInt(e.charAt(n-1),10);return t.getStandardUPCEANChecksum(e.substring(0,n-1))===o},t.getStandardUPCEANChecksum=function(e){for(var n=e.length,o=0,i=n-1;i>=0;i-=2){if((a=e.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new T;o+=a}for(o*=3,i=n-2;i>=0;i-=2){var a;if((a=e.charAt(i).charCodeAt(0)-"0".charCodeAt(0))<0||a>9)throw new T;o+=a}return(1e3-o)%10},t.decodeEnd=function(e,n){return t.findGuardPattern(e,n,!1,t.START_END_PATTERN,new Int32Array(t.START_END_PATTERN.length).fill(0))},t}(kt),Fn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Je=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Oe=function(r){function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return Fn(t,r),t.prototype.decodeMiddle=function(e,n,o){var i,a,s,u,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var f=e.getSize(),h=n[1],l=0,d=0;d<6&&h=10&&(l|=1<<5-d)}for(o=t.determineFirstDigit(o,l),h=rt.findGuardPattern(e,h,!0,rt.MIDDLE_PATTERN,new Int32Array(rt.MIDDLE_PATTERN.length).fill(0))[1],d=0;d<6&&h=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},tr=function(r){function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=Int32Array.from([0,0,0,0]),e}return xn(t,r),t.prototype.decodeMiddle=function(e,n,o){var i,a,s,u,c=this.decodeMiddleCounters;c[0]=0,c[1]=0,c[2]=0,c[3]=0;for(var f=e.getSize(),h=n[1],l=0;l<4&&h=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},rr=function(r){function t(){var e=r.call(this)||this;return e.decodeMiddleCounters=new Int32Array(4),e}return Vn(t,r),t.prototype.decodeMiddle=function(e,n,o){var i,a,s=this.decodeMiddleCounters.map(function(y){return y});s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var u=e.getSize(),c=n[1],f=0,h=0;h<6&&c=10&&(f|=1<<5-h)}return t.determineNumSysAndCheckDigit(new B(o),f),c},t.prototype.decodeEnd=function(e,n){return t.findGuardPatternWithoutCounters(e,n,!0,t.MIDDLE_END_PATTERN)},t.prototype.checkChecksum=function(e){return rt.checkChecksum(t.convertUPCEtoUPCA(e))},t.determineNumSysAndCheckDigit=function(e,n){for(var o=0;o<=1;o++)for(var i=0;i<10;i++)if(n===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[o][i])return e.insert(0,"0"+o),void e.append("0"+i);throw E.getNotFoundInstance()},t.prototype.getBarcodeFormat=function(){return D.UPC_E},t.convertUPCEtoUPCA=function(e){var n=e.slice(1,7).split("").map(function(a){return a.charCodeAt(0)}),o=new B;o.append(e.charAt(0));var i=n[5];switch(i){case 0:case 1:case 2:o.appendChars(n,0,2),o.append(i),o.append("0000"),o.appendChars(n,2,3);break;case 3:o.appendChars(n,0,3),o.append("00000"),o.appendChars(n,3,2);break;case 4:o.appendChars(n,0,4),o.append("00000"),o.append(n[4]);break;default:o.appendChars(n,0,5),o.append("0000"),o.append(i)}return e.length>=8&&o.append(e.charAt(7)),o.toString()},t.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),t.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],t}(rt),Un=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),nr=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},pe=function(r){function t(e){var n=r.call(this)||this,o=e==null?null:e.get(Q.POSSIBLE_FORMATS),i=[];return o!=null&&(o.indexOf(D.EAN_13)>-1&&i.push(new Oe),o.indexOf(D.UPC_A)>-1&&i.push(new er),o.indexOf(D.EAN_8)>-1&&i.push(new tr),o.indexOf(D.UPC_E)>-1&&i.push(new rr)),i.length===0&&(i.push(new Oe),i.push(new er),i.push(new tr),i.push(new rr)),n.readers=i,n}return Un(t,r),t.prototype.decodeRow=function(e,n,o){var i,a;try{for(var s=nr(this.readers),u=s.next();!u.done;u=s.next()){var c=u.value;try{var f=c.decodeRow(e,n,o),h=f.getBarcodeFormat()===D.EAN_13&&f.getText().charAt(0)==="0",l=o==null?null:o.get(Q.POSSIBLE_FORMATS),d=l==null||l.includes(D.UPC_A);if(h&&d){var p=f.getRawBytes(),y=new ft(f.getText().substring(1),p,p?p.length:null,f.getResultPoints(),D.UPC_A);return y.putAllMetadata(f.getResultMetadata()),y}return f}catch{}}}catch(C){i={error:C}}finally{try{u&&!u.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}throw new E},t.prototype.reset=function(){var e,n;try{for(var o=nr(this.readers),i=o.next();!i.done;i=o.next())i.value.reset()}catch(a){e={error:a}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}},t}(ot),Xn=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Gn=function(r){function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.CODA_BAR_CHAR_SET={nnnnnww:"0",nnnnwwn:"1",nnnwnnw:"2",wwnnnnn:"3",nnwnnwn:"4",wnnnnwn:"5",nwnnnnw:"6",nwnnwnn:"7",nwwnnnn:"8",wnnwnnn:"9",nnnwwnn:"-",nnwwnnn:"$",wnnnwnw:":",wnwnnnw:"/",wnwnwnn:".",nnwwwww:"+",nnwwnwn:"A",nwnwnnw:"B",nnnwnww:"C",nnnwwwn:"D"},e}return Xn(t,r),t.prototype.decodeRow=function(e,n,o){var i=this.getValidRowData(n);if(!i)throw new E;var a=this.codaBarDecodeRow(i.row);if(!a)throw new E;return new ft(a,null,0,[new R(i.left,e),new R(i.right,e)],D.CODABAR,new Date().getTime())},t.prototype.getValidRowData=function(e){var n=e.toArray(),o=n.indexOf(!0);if(o===-1)return null;var i=n.lastIndexOf(!0);if(i<=o)return null;for(var a=[],s=(n=n.slice(o,i+1))[0],u=1,c=1;c0;){var i=e.splice(0,8).splice(0,7).map(function(s){return s=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Pt=function(r){function t(){var e=r.call(this)||this;return e.decodeFinderCounters=new Int32Array(4),e.dataCharacterCounters=new Int32Array(8),e.oddRoundingErrors=new Array(4),e.evenRoundingErrors=new Array(4),e.oddCounts=new Array(e.dataCharacterCounters.length/2),e.evenCounts=new Array(e.dataCharacterCounters.length/2),e}return Wn(t,r),t.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},t.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},t.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},t.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},t.prototype.getOddCounts=function(){return this.oddCounts},t.prototype.getEvenCounts=function(){return this.evenCounts},t.prototype.parseFinderValue=function(e,n){for(var o=0;oi&&(i=n[a],o=a);e[o]++},t.decrement=function(e,n){for(var o=0,i=n[0],a=1;a=t.MIN_FINDER_PATTERN_RATIO&&a<=t.MAX_FINDER_PATTERN_RATIO){var s=Number.MAX_SAFE_INTEGER,u=Number.MIN_SAFE_INTEGER;try{for(var c=zn(e),f=c.next();!f.done;f=c.next()){var h=f.value;h>u&&(u=h),h=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ft=function(){function r(){}return r.getRSSvalue=function(t,e,n){var o,i,a=0;try{for(var s=jn(t),u=s.next();!u.done;u=s.next())a+=u.value}catch(w){o={error:w}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}for(var c=0,f=0,h=t.length,l=0;l=h-l-1&&(p-=r.combins(a-d-(h-l),h-l-2)),h-l-1>1){for(var y=0,C=a-d-(h-l-2);C>e;C--)y+=r.combins(a-d-C-1,h-l-3);p-=y*(h-1-l)}else a-d>e&&p--;c+=p}a-=d}return c},r.combins=function(t,e){var n,o;t-e>e?(o=e,n=t-e):(o=t-e,n=e);for(var i=1,a=1,s=t;s>n;s--)i*=s,a<=o&&(i/=a,a++);for(;a<=o;)i/=a,a++;return i},r}(),Yn=function(){function r(){}return r.buildBitArray=function(t){var e=2*t.length-1;t[t.length-1].getRightChar()==null&&(e-=1);for(var n=new st(12*e),o=0,i=t[0].getRightChar().getValue(),a=11;a>=0;--a)i&1<=0;--c)u&1<=0;--c)f&1<10||o<0||o>10)throw new T;return i.firstDigit=n,i.secondDigit=o,i}return qn(t,r),t.prototype.getFirstDigit=function(){return this.firstDigit},t.prototype.getSecondDigit=function(){return this.secondDigit},t.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},t.prototype.isFirstDigitFNC1=function(){return this.firstDigit===t.FNC1},t.prototype.isSecondDigitFNC1=function(){return this.secondDigit===t.FNC1},t.prototype.isAnyFNC1=function(){return this.firstDigit===t.FNC1||this.secondDigit===t.FNC1},t.FNC1=10,t}(Ve),$t=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Qn=function(){function r(){}return r.parseFieldsInGeneralPurpose=function(t){var e,n,o,i,a,s,u,c;if(!t)return null;if(t.length<2)throw new E;var f=t.substring(0,2);try{for(var h=$t(r.TWO_DIGIT_DATA_LENGTH),l=h.next();!l.done;l=h.next())if((I=l.value)[0]===f)return I[1]===r.VARIABLE_LENGTH?r.processVariableAI(2,I[2],t):r.processFixedAI(2,I[1],t)}catch(S){e={error:S}}finally{try{l&&!l.done&&(n=h.return)&&n.call(h)}finally{if(e)throw e.error}}if(t.length<3)throw new E;var d=t.substring(0,3);try{for(var p=$t(r.THREE_DIGIT_DATA_LENGTH),y=p.next();!y.done;y=p.next())if((I=y.value)[0]===d)return I[1]===r.VARIABLE_LENGTH?r.processVariableAI(3,I[2],t):r.processFixedAI(3,I[1],t)}catch(S){o={error:S}}finally{try{y&&!y.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}try{for(var C=$t(r.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),w=C.next();!w.done;w=C.next())if((I=w.value)[0]===d)return I[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,I[2],t):r.processFixedAI(4,I[1],t)}catch(S){a={error:S}}finally{try{w&&!w.done&&(s=C.return)&&s.call(C)}finally{if(a)throw a.error}}if(t.length<4)throw new E;var v=t.substring(0,4);try{for(var _=$t(r.FOUR_DIGIT_DATA_LENGTH),m=_.next();!m.done;m=_.next()){var I;if((I=m.value)[0]===v)return I[1]===r.VARIABLE_LENGTH?r.processVariableAI(4,I[2],t):r.processFixedAI(4,I[1],t)}}catch(S){u={error:S}}finally{try{m&&!m.done&&(c=_.return)&&c.call(_)}finally{if(u)throw u.error}}throw new E},r.processFixedAI=function(t,e,n){if(n.lengththis.information.getSize())return t+4<=this.information.getSize();for(var e=t;ethis.information.getSize()){var e=this.extractNumericValueFromBitArray(t,4);return new Jt(this.information.getSize(),e===0?Jt.FNC1:e-1,Jt.FNC1)}var n=this.extractNumericValueFromBitArray(t,7);return new Jt(t+7,(n-8)/11,(n-8)%11)},r.prototype.extractNumericValueFromBitArray=function(t,e){return r.extractNumericValueFromBitArray(this.information,t,e)},r.extractNumericValueFromBitArray=function(t,e,n){for(var o=0,i=0;ithis.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+7>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<116)return!0;if(t+8>this.information.getSize())return!1;var o=this.extractNumericValueFromBitArray(t,8);return o>=232&&o<253},r.prototype.decodeIsoIec646=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(e===15)return new _t(t+5,_t.FNC1);if(e>=5&&e<15)return new _t(t+5,"0"+(e-5));var n,o=this.extractNumericValueFromBitArray(t,7);if(o>=64&&o<90)return new _t(t+7,""+(o+1));if(o>=90&&o<116)return new _t(t+7,""+(o+7));switch(this.extractNumericValueFromBitArray(t,8)){case 232:n="!";break;case 233:n='"';break;case 234:n="%";break;case 235:n="&";break;case 236:n="'";break;case 237:n="(";break;case 238:n=")";break;case 239:n="*";break;case 240:n="+";break;case 241:n=",";break;case 242:n="-";break;case 243:n=".";break;case 244:n="/";break;case 245:n=":";break;case 246:n=";";break;case 247:n="<";break;case 248:n="=";break;case 249:n=">";break;case 250:n="?";break;case 251:n="_";break;case 252:n=" ";break;default:throw new T}return new _t(t+8,n)},r.prototype.isStillAlpha=function(t){if(t+5>this.information.getSize())return!1;var e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+6>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(t,6);return n>=16&&n<63},r.prototype.decodeAlphanumeric=function(t){var e=this.extractNumericValueFromBitArray(t,5);if(e===15)return new _t(t+5,_t.FNC1);if(e>=5&&e<15)return new _t(t+5,"0"+(e-5));var n,o=this.extractNumericValueFromBitArray(t,6);if(o>=32&&o<58)return new _t(t+6,""+(o+33));switch(o){case 58:n="*";break;case 59:n=",";break;case 60:n="-";break;case 61:n=".";break;case 62:n="/";break;default:throw new Nt("Decoding invalid alphanumeric value: "+o)}return new _t(t+6,n)},r.prototype.isAlphaTo646ToAlphaLatch=function(t){if(t+1>this.information.getSize())return!1;for(var e=0;e<5&&e+tthis.information.getSize())return!1;for(var e=t;ethis.information.getSize())return!1;for(var e=0;e<4&&e+t=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Co=function(r){function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.pairs=new Array(t.MAX_PAIRS),e.rows=new Array,e.startEnd=[2],e}return wo(t,r),t.prototype.decodeRow=function(e,n,o){this.pairs.length=0,this.startFromEven=!1;try{return t.constructResult(this.decodeRow2pairs(e,n))}catch{}return this.pairs.length=0,this.startFromEven=!0,t.constructResult(this.decodeRow2pairs(e,n))},t.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},t.prototype.decodeRow2pairs=function(e,n){for(var o,i=!1;!i;)try{this.pairs.push(this.retrieveNextPair(n,this.pairs,e))}catch(s){if(s instanceof E){if(!this.pairs.length)throw new E;i=!0}}if(this.checkChecksum())return this.pairs;if(o=!!this.rows.length,this.storeRow(e,!1),o){var a=this.checkRowsBoolean(!1);if(a!=null||(a=this.checkRowsBoolean(!0))!=null)return a}throw new E},t.prototype.checkRowsBoolean=function(e){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,e&&(this.rows=this.rows.reverse());var n=null;try{n=this.checkRows(new Array,0)}catch(o){console.log(o)}return e&&(this.rows=this.rows.reverse()),n},t.prototype.checkRows=function(e,n){for(var o,i,a=n;as.length)){for(var u=!0,c=0;ce){a=s.isEquivalent(this.pairs);break}i=s.isEquivalent(this.pairs),o++}a||i||t.isPartialRow(this.pairs,this.rows)||(this.rows.push(o,new yo(this.pairs,e,n)),this.removePartialRows(this.pairs,this.rows))},t.prototype.removePartialRows=function(e,n){var o,i,a,s,u,c;try{for(var f=Ot(n),h=f.next();!h.done;h=f.next()){var l=h.value;if(l.getPairs().length!==e.length)try{for(var d=(a=void 0,Ot(l.getPairs())),p=d.next();!p.done;p=d.next()){var y=p.value,C=!1;try{for(var w=(u=void 0,Ot(e)),v=w.next();!v.done;v=w.next()){var _=v.value;if(or.equals(y,_)){C=!0;break}}}catch(m){u={error:m}}finally{try{v&&!v.done&&(c=w.return)&&c.call(w)}finally{if(u)throw u.error}}}}catch(m){a={error:m}}finally{try{p&&!p.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}}}catch(m){o={error:m}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}},t.isPartialRow=function(e,n){var o,i,a,s,u,c;try{for(var f=Ot(n),h=f.next();!h.done;h=f.next()){var l=h.value,d=!0;try{for(var p=(a=void 0,Ot(e)),y=p.next();!y.done;y=p.next()){var C=y.value,w=!1;try{for(var v=(u=void 0,Ot(l.getPairs())),_=v.next();!_.done;_=v.next()){var m=_.value;if(C.equals(m)){w=!0;break}}}catch(I){u={error:I}}finally{try{_&&!_.done&&(c=v.return)&&c.call(v)}finally{if(u)throw u.error}}if(!w){d=!1;break}}}catch(I){a={error:I}}finally{try{y&&!y.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}if(d)return!0}}catch(I){o={error:I}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}return!1},t.prototype.getRows=function(){return this.rows},t.constructResult=function(e){var n=go(Yn.buildBitArray(e)).parseInformation(),o=e[0].getFinderPattern().getResultPoints(),i=e[e.length-1].getFinderPattern().getResultPoints(),a=[o[0],o[1],i[0],i[1]];return new ft(n,null,null,a,D.RSS_EXPANDED,null)},t.prototype.checkChecksum=function(){var e=this.pairs.get(0),n=e.getLeftChar(),o=e.getRightChar();if(o===null)return!1;for(var i=o.getChecksumPortion(),a=2,s=1;s=0?a=o:this.isEmptyPair(n)?a=0:a=n[n.length-1].getFinderPattern().getStartEnd()[1];var u=n.length%2!=0;this.startFromEven&&(u=!u);for(var c=!1;a=0&&!e.get(u);)u--;u++,i=this.startEnd[0]-u,a=u,s=this.startEnd[1]}else a=this.startEnd[0],i=(s=e.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var c,f=this.getDecodeFinderCounters();Z.arraycopy(f,0,f,1,f.length-1),f[0]=i;try{c=this.parseFinderValue(f,t.FINDER_PATTERNS)}catch{return null}return new Tr(c,[a,s],a,s,n)},t.prototype.decodeDataCharacter=function(e,n,o,i){for(var a=this.getDataCharacterCounters(),s=0;s.3)throw new E;var d=this.getOddCounts(),p=this.getEvenCounts(),y=this.getOddRoundingErrors(),C=this.getEvenRoundingErrors();for(u=0;u8){if(w>8.7)throw new E;v=8}var _=u/2;1&u?(p[_]=v,C[_]=w-v):(d[_]=v,y[_]=w-v)}this.adjustOddEvenCounts(17);var m=4*n.getValue()+(o?0:2)+(i?0:1)-1,I=0,S=0;for(u=d.length-1;u>=0;u--){if(t.isNotA1left(n,o,i)){var O=t.WEIGHTS[m][2*u];S+=d[u]*O}I+=d[u]}var M=0;for(u=p.length-1;u>=0;u--)t.isNotA1left(n,o,i)&&(O=t.WEIGHTS[m][2*u+1],M+=p[u]*O);var k=S+M;if(1&I||I>13||I<4)throw new E;var x=(13-I)/2,J=t.SYMBOL_WIDEST[x],W=9-J,tt=Ft.getRSSvalue(d,J,!0),It=Ft.getRSSvalue(p,W,!1),St=t.EVEN_TOTAL_SUBSET[x],he=t.GSUM[x];return new ae(tt*St+It+he,k)},t.isNotA1left=function(e,n,o){return!(e.getValue()===0&&n&&o)},t.prototype.adjustOddEvenCounts=function(e){var n=U.sum(new Int32Array(this.getOddCounts())),o=U.sum(new Int32Array(this.getEvenCounts())),i=!1,a=!1;n>13?a=!0:n<4&&(i=!0);var s=!1,u=!1;o>13?u=!0:o<4&&(s=!0);var c=n+o-e,f=(1&n)==1,h=(1&o)==0;if(c===1)if(f){if(h)throw new E;a=!0}else{if(!h)throw new E;u=!0}else if(c===-1)if(f){if(h)throw new E;i=!0}else{if(!h)throw new E;s=!0}else{if(c!==0)throw new E;if(f){if(!h)throw new E;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ir=function(r){function t(){var e=r!==null&&r.apply(this,arguments)||this;return e.possibleLeftPairs=[],e.possibleRightPairs=[],e}return _o(t,r),t.prototype.decodeRow=function(e,n,o){var i,a,s,u,c=this.decodePair(n,!1,e,o);t.addOrTally(this.possibleLeftPairs,c),n.reverse();var f=this.decodePair(n,!0,e,o);t.addOrTally(this.possibleRightPairs,f),n.reverse();try{for(var h=ge(this.possibleLeftPairs),l=h.next();!l.done;l=h.next()){var d=l.value;if(d.getCount()>1)try{for(var p=(s=void 0,ge(this.possibleRightPairs)),y=p.next();!y.done;y=p.next()){var C=y.value;if(C.getCount()>1&&t.checkChecksum(d,C))return t.constructResult(d,C)}}catch(w){s={error:w}}finally{try{y&&!y.done&&(u=p.return)&&u.call(p)}finally{if(s)throw s.error}}}}catch(w){i={error:w}}finally{try{l&&!l.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}throw new E},t.addOrTally=function(e,n){var o,i;if(n!=null){var a=!1;try{for(var s=ge(e),u=s.next();!u.done;u=s.next()){var c=u.value;if(c.getValue()===n.getValue()){c.incrementCount(),a=!0;break}}}catch(f){o={error:f}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}a||e.push(n)}},t.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},t.constructResult=function(e,n){for(var o=4537077*e.getValue()+n.getValue(),i=new String(o).toString(),a=new B,s=13-i.length;s>0;s--)a.append("0");a.append(i);var u=0;for(s=0;s<13;s++){var c=a.charAt(s).charCodeAt(0)-"0".charCodeAt(0);u+=1&s?c:3*c}(u=10-u%10)===10&&(u=0),a.append(u.toString());var f=e.getFinderPattern().getResultPoints(),h=n.getFinderPattern().getResultPoints();return new ft(a.toString(),null,0,[f[0],f[1],h[0],h[1]],D.RSS_14,new Date().getTime())},t.checkChecksum=function(e,n){var o=(e.getChecksumPortion()+16*n.getChecksumPortion())%79,i=9*e.getFinderPattern().getValue()+n.getFinderPattern().getValue();return i>72&&i--,i>8&&i--,o===i},t.prototype.decodePair=function(e,n,o,i){try{var a=this.findFinderPattern(e,n),s=this.parseFoundFinderPattern(e,o,n,a),u=i==null?null:i.get(Q.NEED_RESULT_POINT_CALLBACK);if(u!=null){var c=(a[0]+a[1])/2;n&&(c=e.getSize()-1-c),u.foundPossibleResultPoint(new R(c,o))}var f=this.decodeDataCharacter(e,s,!0),h=this.decodeDataCharacter(e,s,!1);return new Ao(1597*f.getValue()+h.getValue(),f.getChecksumPortion()+4*h.getChecksumPortion(),s)}catch{return null}},t.prototype.decodeDataCharacter=function(e,n,o){for(var i=this.getDataCharacterCounters(),a=0;a8&&(w=8);var v=Math.floor(s/2);1&s?(d[v]=w,y[v]=C-w):(l[v]=w,p[v]=C-w)}this.adjustOddEvenCounts(o,f);var _=0,m=0;for(s=l.length-1;s>=0;s--)m*=9,m+=l[s],_+=l[s];var I=0,S=0;for(s=d.length-1;s>=0;s--)I*=9,I+=d[s],S+=d[s];var O=m+3*I;if(o){if(1&_||_>12||_<4)throw new E;var M=(12-_)/2,k=9-(It=t.OUTSIDE_ODD_WIDEST[M]),x=Ft.getRSSvalue(l,It,!1),J=Ft.getRSSvalue(d,k,!0),W=t.OUTSIDE_EVEN_TOTAL_SUBSET[M],tt=t.OUTSIDE_GSUM[M];return new ae(x*W+J+tt,O)}if(1&S||S>10||S<4)throw new E;M=(10-S)/2,k=9-(It=t.INSIDE_ODD_WIDEST[M]),x=Ft.getRSSvalue(l,It,!0),J=Ft.getRSSvalue(d,k,!1);var It,St=t.INSIDE_ODD_TOTAL_SUBSET[M];return tt=t.INSIDE_GSUM[M],new ae(J*St+x+tt,O)},t.prototype.findFinderPattern=function(e,n){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var i=e.getSize(),a=!1,s=0;s=0&&a!==e.get(s);)s--;s++;var u=i[0]-s,c=this.getDecodeFinderCounters(),f=new Int32Array(c.length);Z.arraycopy(c,0,f,1,c.length-1),f[0]=u;var h=this.parseFinderValue(f,t.FINDER_PATTERNS),l=s,d=i[1];return o&&(l=e.getSize()-1-l,d=e.getSize()-1-d),new Tr(h,[s,i[1]],l,d,n)},t.prototype.adjustOddEvenCounts=function(e,n){var o=U.sum(new Int32Array(this.getOddCounts())),i=U.sum(new Int32Array(this.getEvenCounts())),a=!1,s=!1,u=!1,c=!1;e?(o>12?s=!0:o<4&&(a=!0),i>12?c=!0:i<4&&(u=!0)):(o>11?s=!0:o<5&&(a=!0),i>10?c=!0:i<4&&(u=!0));var f=o+i-n,h=(1&o)==(e?1:0),l=(1&i)==1;if(f===1)if(h){if(l)throw new E;s=!0}else{if(!l)throw new E;c=!0}else if(f===-1)if(h){if(l)throw new E;a=!0}else{if(!l)throw new E;u=!0}else{if(f!==0)throw new E;if(h){if(!l)throw new E;o=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},G=function(){function r(t,e,n){this.ecCodewords=t,this.ecBlocks=[e],n&&this.ecBlocks.push(n)}return r.prototype.getECCodewords=function(){return this.ecCodewords},r.prototype.getECBlocks=function(){return this.ecBlocks},r}(),X=function(){function r(t,e){this.count=t,this.dataCodewords=e}return r.prototype.getCount=function(){return this.count},r.prototype.getDataCodewords=function(){return this.dataCodewords},r}(),Io=function(){function r(t,e,n,o,i,a){var s,u;this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=n,this.dataRegionSizeRows=o,this.dataRegionSizeColumns=i,this.ecBlocks=a;var c=0,f=a.getECCodewords(),h=a.getECBlocks();try{for(var l=ar(h),d=l.next();!d.done;d=l.next()){var p=d.value;c+=p.getCount()*(p.getDataCodewords()+f)}}catch(y){s={error:y}}finally{try{d&&!d.done&&(u=l.return)&&u.call(l)}finally{if(s)throw s.error}}this.totalCodewords=c}return r.prototype.getVersionNumber=function(){return this.versionNumber},r.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},r.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},r.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},r.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},r.prototype.getTotalCodewords=function(){return this.totalCodewords},r.prototype.getECBlocks=function(){return this.ecBlocks},r.getVersionForDimensions=function(t,e){var n,o;if(1&t||1&e)throw new T;try{for(var i=ar(r.VERSIONS),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.symbolSizeRows===t&&s.symbolSizeColumns===e)return s}}catch(u){n={error:u}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new T},r.prototype.toString=function(){return""+this.versionNumber},r.buildVersions=function(){return[new r(1,10,10,8,8,new G(5,new X(1,3))),new r(2,12,12,10,10,new G(7,new X(1,5))),new r(3,14,14,12,12,new G(10,new X(1,8))),new r(4,16,16,14,14,new G(12,new X(1,12))),new r(5,18,18,16,16,new G(14,new X(1,18))),new r(6,20,20,18,18,new G(18,new X(1,22))),new r(7,22,22,20,20,new G(20,new X(1,30))),new r(8,24,24,22,22,new G(24,new X(1,36))),new r(9,26,26,24,24,new G(28,new X(1,44))),new r(10,32,32,14,14,new G(36,new X(1,62))),new r(11,36,36,16,16,new G(42,new X(1,86))),new r(12,40,40,18,18,new G(48,new X(1,114))),new r(13,44,44,20,20,new G(56,new X(1,144))),new r(14,48,48,22,22,new G(68,new X(1,174))),new r(15,52,52,24,24,new G(42,new X(2,102))),new r(16,64,64,14,14,new G(56,new X(2,140))),new r(17,72,72,16,16,new G(36,new X(4,92))),new r(18,80,80,18,18,new G(48,new X(4,114))),new r(19,88,88,20,20,new G(56,new X(4,144))),new r(20,96,96,22,22,new G(68,new X(4,174))),new r(21,104,104,24,24,new G(56,new X(6,136))),new r(22,120,120,18,18,new G(68,new X(6,175))),new r(23,132,132,20,20,new G(62,new X(8,163))),new r(24,144,144,22,22,new G(62,new X(8,156),new X(2,155))),new r(25,8,18,6,16,new G(7,new X(1,5))),new r(26,8,32,6,14,new G(11,new X(1,10))),new r(27,12,26,10,24,new G(14,new X(1,16))),new r(28,12,36,10,16,new G(18,new X(1,22))),new r(29,16,36,14,16,new G(24,new X(1,32))),new r(30,16,48,14,22,new G(28,new X(1,49)))]},r.VERSIONS=r.buildVersions(),r}(),So=function(){function r(t){var e=t.getHeight();if(e<8||e>144||1&e)throw new T;this.version=r.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new yt(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return r.prototype.getVersion=function(){return this.version},r.readVersion=function(t){var e=t.getHeight(),n=t.getWidth();return Io.getVersionForDimensions(e,n)},r.prototype.readCodewords=function(){var t=new Int8Array(this.version.getTotalCodewords()),e=0,n=4,o=0,i=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),s=!1,u=!1,c=!1,f=!1;do if(n!==i||o!==0||s)if(n!==i-2||o!==0||!(3&a)||u)if(n!==i+4||o!==2||7&a||c)if(n!==i-2||o!==0||(7&a)!=4||f){do n=0&&!this.readMappingMatrix.get(o,n)&&(t[e++]=255&this.readUtah(n,o,i,a)),n-=2,o+=2;while(n>=0&&o=0&&o=0);n+=3,o+=1}else t[e++]=255&this.readCorner4(i,a),n-=2,o+=2,f=!0;else t[e++]=255&this.readCorner3(i,a),n-=2,o+=2,c=!0;else t[e++]=255&this.readCorner2(i,a),n-=2,o+=2,u=!0;else t[e++]=255&this.readCorner1(i,a),n-=2,o+=2,s=!0;while(n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},To=function(){function r(t,e){this.numDataCodewords=t,this.codewords=e}return r.getDataBlocks=function(t,e){var n,o,i,a,s=e.getECBlocks(),u=0,c=s.getECBlocks();try{for(var f=sr(c),h=f.next();!h.done;h=f.next())u+=(C=h.value).getCount()}catch(tt){n={error:tt}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}var l=new Array(u),d=0;try{for(var p=sr(c),y=p.next();!y.done;y=p.next())for(var C=y.value,w=0;w7?w-1:w;l[J].codewords[W]=t[S++]}if(S!==t.length)throw new N;return l},r.prototype.getNumDataCodewords=function(){return this.numDataCodewords},r.prototype.getCodewords=function(){return this.codewords},r}(),Rr=function(){function r(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}return r.prototype.getBitOffset=function(){return this.bitOffset},r.prototype.getByteOffset=function(){return this.byteOffset},r.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new N(""+t);var e=0,n=this.bitOffset,o=this.byteOffset,i=this.bytes;if(n>0){var a=8-n,s=t>8-s<<(c=a-s);e=(i[o]&u)>>c,t-=s,(n+=s)===8&&(n=0,o++)}if(t>0){for(;t>=8;)e=e<<8|255&i[o],o++,t-=8;if(t>0){var c;u=255>>(c=8-t)<>c,n+=t}}return this.bitOffset=n,this.byteOffset=o,e},r.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},r}();(function(r){r[r.PAD_ENCODE=0]="PAD_ENCODE",r[r.ASCII_ENCODE=1]="ASCII_ENCODE",r[r.C40_ENCODE=2]="C40_ENCODE",r[r.TEXT_ENCODE=3]="TEXT_ENCODE",r[r.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",r[r.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",r[r.BASE256_ENCODE=6]="BASE256_ENCODE"})(et||(et={}));var xt,Oo=function(){function r(){}return r.decode=function(t){var e=new Rr(t),n=new B,o=new B,i=new Array,a=et.ASCII_ENCODE;do if(a===et.ASCII_ENCODE)a=this.decodeAsciiSegment(e,n,o);else{switch(a){case et.C40_ENCODE:this.decodeC40Segment(e,n);break;case et.TEXT_ENCODE:this.decodeTextSegment(e,n);break;case et.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,n);break;case et.EDIFACT_ENCODE:this.decodeEdifactSegment(e,n);break;case et.BASE256_ENCODE:this.decodeBase256Segment(e,n,i);break;default:throw new T}a=et.ASCII_ENCODE}while(a!==et.PAD_ENCODE&&e.available()>0);return o.length()>0&&n.append(o.toString()),new ce(t,n.toString(),i.length===0?null:i,null)},r.decodeAsciiSegment=function(t,e,n){var o=!1;do{var i=t.readBits(8);if(i===0)throw new T;if(i<=128)return o&&(i+=128),e.append(String.fromCharCode(i-1)),et.ASCII_ENCODE;if(i===129)return et.PAD_ENCODE;if(i<=229){var a=i-130;a<10&&e.append("0"),e.append(""+a)}else switch(i){case 230:return et.C40_ENCODE;case 231:return et.BASE256_ENCODE;case 232:e.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:o=!0;break;case 236:e.append("[)>05"),n.insert(0,"");break;case 237:e.append("[)>06"),n.insert(0,"");break;case 238:return et.ANSIX12_ENCODE;case 239:return et.TEXT_ENCODE;case 240:return et.EDIFACT_ENCODE;default:if(i!==254||t.available()!==0)throw new T}}while(t.available()>0);return et.ASCII_ENCODE},r.decodeC40Segment=function(t,e){var n=!1,o=[],i=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),o);for(var s=0;s<3;s++){var u=o[s];switch(i){case 0:if(u<3)i=u+1;else{if(!(u0)},r.decodeTextSegment=function(t,e){var n=!1,o=[],i=0;do{if(t.available()===8)return;var a=t.readBits(8);if(a===254)return;this.parseTwoBytes(a,t.readBits(8),o);for(var s=0;s<3;s++){var u=o[s];switch(i){case 0:if(u<3)i=u+1;else{if(!(u0)},r.decodeAnsiX12Segment=function(t,e){var n=[];do{if(t.available()===8)return;var o=t.readBits(8);if(o===254)return;this.parseTwoBytes(o,t.readBits(8),n);for(var i=0;i<3;i++){var a=n[i];switch(a){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(a<14)e.append(String.fromCharCode(a+44));else{if(!(a<40))throw new T;e.append(String.fromCharCode(a+51))}}}}while(t.available()>0)},r.parseTwoBytes=function(t,e,n){var o=(t<<8)+e-1,i=Math.floor(o/1600);n[0]=i,o-=1600*i,i=Math.floor(o/40),n[1]=i,n[2]=o-40*i},r.decodeEdifactSegment=function(t,e){do{if(t.available()<=16)return;for(var n=0;n<4;n++){var o=t.readBits(6);if(o===31){var i=8-t.getBitOffset();return void(i!==8&&t.readBits(i))}!(32&o)&&(o|=64),e.append(String.fromCharCode(o))}}while(t.available()>0)},r.decodeBase256Segment=function(t,e,n){var o,i=1+t.getByteOffset(),a=this.unrandomize255State(t.readBits(8),i++);if((o=a===0?t.available()/8|0:a<250?a:250*(a-249)+this.unrandomize255State(t.readBits(8),i++))<0)throw new T;for(var s=new Uint8Array(o),u=0;u=0?n:n+256},r.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],r.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],r.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],r.TEXT_SHIFT2_SET_CHARS=r.C40_SHIFT2_SET_CHARS,r.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)],r}(),bo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ro=function(){function r(){this.rsDecoder=new fe(gt.DATA_MATRIX_FIELD_256)}return r.prototype.decode=function(t){var e,n,o=new So(t),i=o.getVersion(),a=o.readCodewords(),s=To.getDataBlocks(a,i),u=0;try{for(var c=bo(s),f=c.next();!f.done;f=c.next())u+=f.value.getNumDataCodewords()}catch(v){e={error:v}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}for(var h=new Uint8Array(u),l=s.length,d=0;ds&&(f=s,h[0]=e,h[1]=n,h[2]=o,h[3]=i),f>u&&(f=u,h[0]=n,h[1]=o,h[2]=i,h[3]=e),f>c&&(h[0]=o,h[1]=i,h[2]=e,h[3]=n),h},r.prototype.detectSolid2=function(t){var e=t[0],n=t[1],o=t[2],i=t[3],a=this.transitionsBetween(e,i),s=r.shiftPoint(n,o,4*(a+1)),u=r.shiftPoint(o,n,4*(a+1));return this.transitionsBetween(s,e)this.transitionsBetween(u,h)+this.transitionsBetween(c,h)?f:h:f:this.isValid(h)?h:null},r.prototype.shiftToModuleCenter=function(t){var e=t[0],n=t[1],o=t[2],i=t[3],a=this.transitionsBetween(e,i)+1,s=this.transitionsBetween(o,i)+1,u=r.shiftPoint(e,n,4*s),c=r.shiftPoint(o,n,4*a);(1&(a=this.transitionsBetween(u,i)+1))==1&&(a+=1),(1&(s=this.transitionsBetween(c,i)+1))==1&&(s+=1);var f,h,l=(e.getX()+n.getX()+o.getX()+i.getX())/4,d=(e.getY()+n.getY()+o.getY()+i.getY())/4;return e=r.moveAway(e,l,d),n=r.moveAway(n,l,d),o=r.moveAway(o,l,d),i=r.moveAway(i,l,d),u=r.shiftPoint(e,n,4*s),u=r.shiftPoint(u,i,4*a),f=r.shiftPoint(n,e,4*s),f=r.shiftPoint(f,o,4*a),c=r.shiftPoint(o,i,4*s),c=r.shiftPoint(c,n,4*a),h=r.shiftPoint(i,o,4*s),[u,f,c,h=r.shiftPoint(h,e,4*a)]},r.prototype.isValid=function(t){return t.getX()>=0&&t.getX()0&&t.getY()Math.abs(i-n);if(s){var u=n;n=o,o=u,u=i,i=a,a=u}for(var c=Math.abs(i-n),f=Math.abs(a-o),h=-c/2,l=o0){if(w===a)break;w+=l,h-=c}}return p},r}(),be=function(){function r(){this.decoder=new Ro}return r.prototype.decode=function(t,e){var n,o;if(e===void 0&&(e=null),e!=null&&e.has(Q.PURE_BARCODE)){var i=r.extractPureBits(t.getBlackMatrix());n=this.decoder.decode(i),o=r.NO_POINTS}else{var a=new No(t.getBlackMatrix()).detect();n=this.decoder.decode(a.getBits()),o=a.getPoints()}var s=n.getRawBytes(),u=new ft(n.getText(),s,8*s.length,o,D.DATA_MATRIX,Z.currentTimeMillis()),c=n.getByteSegments();c!=null&&u.putMetadata(ct.BYTE_SEGMENTS,c);var f=n.getECLevel();return f!=null&&u.putMetadata(ct.ERROR_CORRECTION_LEVEL,f),u},r.prototype.reset=function(){},r.extractPureBits=function(t){var e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(e==null||n==null)throw new E;var o=this.moduleSize(e,t),i=e[1],a=n[1],s=e[0],u=(n[0]-s+1)/o,c=(a-i+1)/o;if(u<=0||c<=0)throw new E;var f=o/2;i+=f,s+=f;for(var h=new yt(u,c),l=0;l=r.FOR_BITS.size)throw new N;return r.FOR_BITS.get(t)},r.FOR_BITS=new Map,r.FOR_VALUE=new Map,r.L=new r(xt.L,"L",1),r.M=new r(xt.M,"M",0),r.Q=new r(xt.Q,"Q",3),r.H=new r(xt.H,"H",2),r}(),Mo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Nr=function(){function r(t){this.errorCorrectionLevel=Zt.forBits(t>>3&3),this.dataMask=7&t}return r.numBitsDiffering=function(t,e){return P.bitCount(t^e)},r.decodeFormatInformation=function(t,e){var n=r.doDecodeFormatInformation(t,e);return n!==null?n:r.doDecodeFormatInformation(t^r.FORMAT_INFO_MASK_QR,e^r.FORMAT_INFO_MASK_QR)},r.doDecodeFormatInformation=function(t,e){var n,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=Mo(r.FORMAT_INFO_DECODE_LOOKUP),u=s.next();!u.done;u=s.next()){var c=u.value,f=c[0];if(f===t||f===e)return new r(c[1]);var h=r.numBitsDiffering(t,f);h=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},A=function(){function r(t){for(var e=[],n=1;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Lt=function(){function r(t,e){for(var n,o,i=[],a=2;a40)throw new N;return r.VERSIONS[t-1]},r.decodeVersionInformation=function(t){for(var e=Number.MAX_SAFE_INTEGER,n=0,o=0;o6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),e},r.prototype.toString=function(){return""+this.versionNumber},r.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),r.VERSIONS=[new r(1,new Int32Array(0),new A(7,new g(1,19)),new A(10,new g(1,16)),new A(13,new g(1,13)),new A(17,new g(1,9))),new r(2,Int32Array.from([6,18]),new A(10,new g(1,34)),new A(16,new g(1,28)),new A(22,new g(1,22)),new A(28,new g(1,16))),new r(3,Int32Array.from([6,22]),new A(15,new g(1,55)),new A(26,new g(1,44)),new A(18,new g(2,17)),new A(22,new g(2,13))),new r(4,Int32Array.from([6,26]),new A(20,new g(1,80)),new A(18,new g(2,32)),new A(26,new g(2,24)),new A(16,new g(4,9))),new r(5,Int32Array.from([6,30]),new A(26,new g(1,108)),new A(24,new g(2,43)),new A(18,new g(2,15),new g(2,16)),new A(22,new g(2,11),new g(2,12))),new r(6,Int32Array.from([6,34]),new A(18,new g(2,68)),new A(16,new g(4,27)),new A(24,new g(4,19)),new A(28,new g(4,15))),new r(7,Int32Array.from([6,22,38]),new A(20,new g(2,78)),new A(18,new g(4,31)),new A(18,new g(2,14),new g(4,15)),new A(26,new g(4,13),new g(1,14))),new r(8,Int32Array.from([6,24,42]),new A(24,new g(2,97)),new A(22,new g(2,38),new g(2,39)),new A(22,new g(4,18),new g(2,19)),new A(26,new g(4,14),new g(2,15))),new r(9,Int32Array.from([6,26,46]),new A(30,new g(2,116)),new A(22,new g(3,36),new g(2,37)),new A(20,new g(4,16),new g(4,17)),new A(24,new g(4,12),new g(4,13))),new r(10,Int32Array.from([6,28,50]),new A(18,new g(2,68),new g(2,69)),new A(26,new g(4,43),new g(1,44)),new A(24,new g(6,19),new g(2,20)),new A(28,new g(6,15),new g(2,16))),new r(11,Int32Array.from([6,30,54]),new A(20,new g(4,81)),new A(30,new g(1,50),new g(4,51)),new A(28,new g(4,22),new g(4,23)),new A(24,new g(3,12),new g(8,13))),new r(12,Int32Array.from([6,32,58]),new A(24,new g(2,92),new g(2,93)),new A(22,new g(6,36),new g(2,37)),new A(26,new g(4,20),new g(6,21)),new A(28,new g(7,14),new g(4,15))),new r(13,Int32Array.from([6,34,62]),new A(26,new g(4,107)),new A(22,new g(8,37),new g(1,38)),new A(24,new g(8,20),new g(4,21)),new A(22,new g(12,11),new g(4,12))),new r(14,Int32Array.from([6,26,46,66]),new A(30,new g(3,115),new g(1,116)),new A(24,new g(4,40),new g(5,41)),new A(20,new g(11,16),new g(5,17)),new A(24,new g(11,12),new g(5,13))),new r(15,Int32Array.from([6,26,48,70]),new A(22,new g(5,87),new g(1,88)),new A(24,new g(5,41),new g(5,42)),new A(30,new g(5,24),new g(7,25)),new A(24,new g(11,12),new g(7,13))),new r(16,Int32Array.from([6,26,50,74]),new A(24,new g(5,98),new g(1,99)),new A(28,new g(7,45),new g(3,46)),new A(24,new g(15,19),new g(2,20)),new A(30,new g(3,15),new g(13,16))),new r(17,Int32Array.from([6,30,54,78]),new A(28,new g(1,107),new g(5,108)),new A(28,new g(10,46),new g(1,47)),new A(28,new g(1,22),new g(15,23)),new A(28,new g(2,14),new g(17,15))),new r(18,Int32Array.from([6,30,56,82]),new A(30,new g(5,120),new g(1,121)),new A(26,new g(9,43),new g(4,44)),new A(28,new g(17,22),new g(1,23)),new A(28,new g(2,14),new g(19,15))),new r(19,Int32Array.from([6,30,58,86]),new A(28,new g(3,113),new g(4,114)),new A(26,new g(3,44),new g(11,45)),new A(26,new g(17,21),new g(4,22)),new A(26,new g(9,13),new g(16,14))),new r(20,Int32Array.from([6,34,62,90]),new A(28,new g(3,107),new g(5,108)),new A(26,new g(3,41),new g(13,42)),new A(30,new g(15,24),new g(5,25)),new A(28,new g(15,15),new g(10,16))),new r(21,Int32Array.from([6,28,50,72,94]),new A(28,new g(4,116),new g(4,117)),new A(26,new g(17,42)),new A(28,new g(17,22),new g(6,23)),new A(30,new g(19,16),new g(6,17))),new r(22,Int32Array.from([6,26,50,74,98]),new A(28,new g(2,111),new g(7,112)),new A(28,new g(17,46)),new A(30,new g(7,24),new g(16,25)),new A(24,new g(34,13))),new r(23,Int32Array.from([6,30,54,78,102]),new A(30,new g(4,121),new g(5,122)),new A(28,new g(4,47),new g(14,48)),new A(30,new g(11,24),new g(14,25)),new A(30,new g(16,15),new g(14,16))),new r(24,Int32Array.from([6,28,54,80,106]),new A(30,new g(6,117),new g(4,118)),new A(28,new g(6,45),new g(14,46)),new A(30,new g(11,24),new g(16,25)),new A(30,new g(30,16),new g(2,17))),new r(25,Int32Array.from([6,32,58,84,110]),new A(26,new g(8,106),new g(4,107)),new A(28,new g(8,47),new g(13,48)),new A(30,new g(7,24),new g(22,25)),new A(30,new g(22,15),new g(13,16))),new r(26,Int32Array.from([6,30,58,86,114]),new A(28,new g(10,114),new g(2,115)),new A(28,new g(19,46),new g(4,47)),new A(28,new g(28,22),new g(6,23)),new A(30,new g(33,16),new g(4,17))),new r(27,Int32Array.from([6,34,62,90,118]),new A(30,new g(8,122),new g(4,123)),new A(28,new g(22,45),new g(3,46)),new A(30,new g(8,23),new g(26,24)),new A(30,new g(12,15),new g(28,16))),new r(28,Int32Array.from([6,26,50,74,98,122]),new A(30,new g(3,117),new g(10,118)),new A(28,new g(3,45),new g(23,46)),new A(30,new g(4,24),new g(31,25)),new A(30,new g(11,15),new g(31,16))),new r(29,Int32Array.from([6,30,54,78,102,126]),new A(30,new g(7,116),new g(7,117)),new A(28,new g(21,45),new g(7,46)),new A(30,new g(1,23),new g(37,24)),new A(30,new g(19,15),new g(26,16))),new r(30,Int32Array.from([6,26,52,78,104,130]),new A(30,new g(5,115),new g(10,116)),new A(28,new g(19,47),new g(10,48)),new A(30,new g(15,24),new g(25,25)),new A(30,new g(23,15),new g(25,16))),new r(31,Int32Array.from([6,30,56,82,108,134]),new A(30,new g(13,115),new g(3,116)),new A(28,new g(2,46),new g(29,47)),new A(30,new g(42,24),new g(1,25)),new A(30,new g(23,15),new g(28,16))),new r(32,Int32Array.from([6,34,60,86,112,138]),new A(30,new g(17,115)),new A(28,new g(10,46),new g(23,47)),new A(30,new g(10,24),new g(35,25)),new A(30,new g(19,15),new g(35,16))),new r(33,Int32Array.from([6,30,58,86,114,142]),new A(30,new g(17,115),new g(1,116)),new A(28,new g(14,46),new g(21,47)),new A(30,new g(29,24),new g(19,25)),new A(30,new g(11,15),new g(46,16))),new r(34,Int32Array.from([6,34,62,90,118,146]),new A(30,new g(13,115),new g(6,116)),new A(28,new g(14,46),new g(23,47)),new A(30,new g(44,24),new g(7,25)),new A(30,new g(59,16),new g(1,17))),new r(35,Int32Array.from([6,30,54,78,102,126,150]),new A(30,new g(12,121),new g(7,122)),new A(28,new g(12,47),new g(26,48)),new A(30,new g(39,24),new g(14,25)),new A(30,new g(22,15),new g(41,16))),new r(36,Int32Array.from([6,24,50,76,102,128,154]),new A(30,new g(6,121),new g(14,122)),new A(28,new g(6,47),new g(34,48)),new A(30,new g(46,24),new g(10,25)),new A(30,new g(2,15),new g(64,16))),new r(37,Int32Array.from([6,28,54,80,106,132,158]),new A(30,new g(17,122),new g(4,123)),new A(28,new g(29,46),new g(14,47)),new A(30,new g(49,24),new g(10,25)),new A(30,new g(24,15),new g(46,16))),new r(38,Int32Array.from([6,32,58,84,110,136,162]),new A(30,new g(4,122),new g(18,123)),new A(28,new g(13,46),new g(32,47)),new A(30,new g(48,24),new g(14,25)),new A(30,new g(42,15),new g(32,16))),new r(39,Int32Array.from([6,26,54,82,110,138,166]),new A(30,new g(20,117),new g(4,118)),new A(28,new g(40,47),new g(7,48)),new A(30,new g(43,24),new g(22,25)),new A(30,new g(10,15),new g(67,16))),new r(40,Int32Array.from([6,30,58,86,114,142,170]),new A(30,new g(19,118),new g(6,119)),new A(28,new g(18,47),new g(31,48)),new A(30,new g(34,24),new g(34,25)),new A(30,new g(20,15),new g(61,16)))],r}();(function(r){r[r.DATA_MASK_000=0]="DATA_MASK_000",r[r.DATA_MASK_001=1]="DATA_MASK_001",r[r.DATA_MASK_010=2]="DATA_MASK_010",r[r.DATA_MASK_011=3]="DATA_MASK_011",r[r.DATA_MASK_100=4]="DATA_MASK_100",r[r.DATA_MASK_101=5]="DATA_MASK_101",r[r.DATA_MASK_110=6]="DATA_MASK_110",r[r.DATA_MASK_111=7]="DATA_MASK_111"})(it||(it={}));var Ct,ur=function(){function r(t,e){this.value=t,this.isMasked=e}return r.prototype.unmaskBitMatrix=function(t,e){for(var n=0;n=0;n--)t=this.copyBit(8,n,t);var o=this.bitMatrix.getHeight(),i=0,a=o-7;for(n=o-1;n>=a;n--)i=this.copyBit(8,n,i);for(e=o-8;e=0;i--)for(var a=t-9;a>=o;a--)n=this.copyBit(a,i,n);var s=Lt.decodeVersionInformation(n);if(s!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;for(n=0,a=5;a>=0;a--)for(i=t-9;i>=o;i--)n=this.copyBit(a,i,n);if((s=Lt.decodeVersionInformation(n))!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;throw new T},r.prototype.copyBit=function(t,e,n){return(this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e))?n<<1|1:n<<1},r.prototype.readCodewords=function(){var t=this.readFormatInformation(),e=this.readVersion(),n=ur.values.get(t.getDataMask()),o=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,o);for(var i=e.buildFunctionPattern(),a=!0,s=new Uint8Array(e.getTotalCodewords()),u=0,c=0,f=0,h=o-1;h>0;h-=2){h===6&&h--;for(var l=0;l=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fo=function(){function r(t,e){this.numDataCodewords=t,this.codewords=e}return r.getDataBlocks=function(t,e,n){var o,i,a,s;if(t.length!==e.getTotalCodewords())throw new N;var u=e.getECBlocksForLevel(n),c=0,f=u.getECBlocks();try{for(var h=cr(f),l=h.next();!l.done;l=h.next())c+=(w=l.value).getCount()}catch(W){o={error:W}}finally{try{l&&!l.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}var d=new Array(c),p=0;try{for(var y=cr(f),C=y.next();!C.done;C=y.next())for(var w=C.value,v=0;v=0&&d[S].codewords.length!==I;)S--;S++;var O=I-u.getECCodewordsPerBlock(),M=0;for(v=0;vt.available())throw new T;for(var o=new Uint8Array(2*n),i=0;n>0;){var a=t.readBits(13),s=a/96<<8&4294967295|a%96;s+=s<959?41377:42657,o[i]=s>>8&255,o[i+1]=255&s,i+=2,n--}try{e.append(At.decode(o,F.GB2312))}catch(u){throw new T(u)}},r.decodeKanjiSegment=function(t,e,n){if(13*n>t.available())throw new T;for(var o=new Uint8Array(2*n),i=0;n>0;){var a=t.readBits(13),s=a/192<<8&4294967295|a%192;s+=s<7936?33088:49472,o[i]=s>>8,o[i+1]=s,i+=2,n--}try{e.append(At.decode(o,F.SHIFT_JIS))}catch(u){throw new T(u)}},r.decodeByteSegment=function(t,e,n,o,i,a){if(8*n>t.available())throw new T;for(var s,u=new Uint8Array(n),c=0;c=r.ALPHANUMERIC_CHARS.length)throw new T;return r.ALPHANUMERIC_CHARS[t]},r.decodeAlphanumericSegment=function(t,e,n,o){for(var i=e.length();n>1;){if(t.available()<11)throw new T;var a=t.readBits(11);e.append(r.toAlphaNumericChar(Math.floor(a/45))),e.append(r.toAlphaNumericChar(a%45)),n-=2}if(n===1){if(t.available()<6)throw new T;e.append(r.toAlphaNumericChar(t.readBits(6)))}if(o)for(var s=i;s=3;){if(t.available()<10)throw new T;var o=t.readBits(10);if(o>=1e3)throw new T;e.append(r.toAlphaNumericChar(Math.floor(o/100))),e.append(r.toAlphaNumericChar(Math.floor(o/10)%10)),e.append(r.toAlphaNumericChar(o%10)),n-=3}if(n===2){if(t.available()<7)throw new T;var i=t.readBits(7);if(i>=100)throw new T;e.append(r.toAlphaNumericChar(Math.floor(i/10))),e.append(r.toAlphaNumericChar(i%10))}else if(n===1){if(t.available()<4)throw new T;var a=t.readBits(4);if(a>=10)throw new T;e.append(r.toAlphaNumericChar(a))}},r.parseECIValue=function(t){var e=t.readBits(8);if(!(128&e))return 127&e;if((192&e)==128)return(63&e)<<8&4294967295|t.readBits(8);if((224&e)==192)return(31&e)<<16&4294967295|t.readBits(16);throw new T},r.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",r.GB2312_SUBSET=1,r}(),Dr=function(){function r(t){this.mirrored=t}return r.prototype.isMirrored=function(){return this.mirrored},r.prototype.applyMirroredCorrection=function(t){if(this.mirrored&&t!==null&&!(t.length<3)){var e=t[0];t[0]=t[2],t[2]=e}},r}(),fr=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ko=function(){function r(){this.rsDecoder=new fe(gt.QR_CODE_FIELD_256)}return r.prototype.decodeBooleanArray=function(t,e){return this.decodeBitMatrix(yt.parseFromBooleanArray(t),e)},r.prototype.decodeBitMatrix=function(t,e){var n=new Lo(t),o=null;try{return this.decodeBitMatrixParser(n,e)}catch(a){o=a}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();var i=this.decodeBitMatrixParser(n,e);return i.setOther(new Dr(!0)),i}catch(a){throw o!==null?o:a}},r.prototype.decodeBitMatrixParser=function(t,e){var n,o,i,a,s=t.readVersion(),u=t.readFormatInformation().getErrorCorrectionLevel(),c=t.readCodewords(),f=Fo.getDataBlocks(c,s,u),h=0;try{for(var l=fr(f),d=l.next();!d.done;d=l.next())h+=(v=d.value).getNumDataCodewords()}catch(S){n={error:S}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}var p=new Uint8Array(h),y=0;try{for(var C=fr(f),w=C.next();!w.done;w=C.next()){var v,_=(v=w.value).getCodewords(),m=v.getNumDataCodewords();this.correctErrors(_,m);for(var I=0;I=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Xo=function(){function r(t,e,n,o,i,a,s){this.image=t,this.startX=e,this.startY=n,this.width=o,this.height=i,this.moduleSize=a,this.resultPointCallback=s,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return r.prototype.find=function(){for(var t=this.startX,e=this.height,n=t+this.width,o=this.startY+e/2,i=new Int32Array(3),a=this.image,s=0;s=n)return!1;return!0},r.prototype.crossCheckVertical=function(t,e,n,o){var i=this.image,a=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var u=t;u>=0&&i.get(e,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&!i.get(e,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;un)return NaN;for(;un)return NaN;var c=s[0]+s[1]+s[2];return 5*Math.abs(c-o)>=2*o?NaN:this.foundPatternCross(s)?r.centerFromEnd(s,u):NaN},r.prototype.handlePossibleCenter=function(t,e,n){var o,i,a=t[0]+t[1]+t[2],s=r.centerFromEnd(t,n),u=this.crossCheckVertical(e,s,2*t[1],a);if(!isNaN(u)){var c=(t[0]+t[1]+t[2])/3;try{for(var f=Uo(this.possibleCenters),h=f.next();!h.done;h=f.next()){var l=h.value;if(l.aboutEquals(c,u,s))return l.combineEstimate(u,s,c)}}catch(p){o={error:p}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}var d=new Ho(s,u,c);this.possibleCenters.push(d),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(d)}return null},r}(),Go=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Wo=function(r){function t(e,n,o,i){var a=r.call(this,e,n)||this;return a.estimatedModuleSize=o,a.count=i,i===void 0&&(a.count=1),a}return Go(t,r),t.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},t.prototype.getCount=function(){return this.count},t.prototype.aboutEquals=function(e,n,o){if(Math.abs(n-this.getY())<=e&&Math.abs(o-this.getX())<=e){var i=Math.abs(e-this.estimatedModuleSize);return i<=1||i<=this.estimatedModuleSize}return!1},t.prototype.combineEstimate=function(e,n,o){var i=this.count+1;return new t((this.count*this.getX()+n)/i,(this.count*this.getY()+e)/i,(this.count*this.estimatedModuleSize+o)/i,i)},t}(R),zo=function(){function r(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}return r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopRight=function(){return this.topRight},r}(),Ht=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},jo=function(){function r(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}return r.prototype.getImage=function(){return this.image},r.prototype.getPossibleCenters=function(){return this.possibleCenters},r.prototype.find=function(t){var e=t!=null&&t.get(Q.TRY_HARDER)!==void 0,n=t!=null&&t.get(Q.PURE_BARCODE)!==void 0,o=this.image,i=o.getHeight(),a=o.getWidth(),s=Math.floor(3*i/(4*r.MAX_MODULES));(sc[2]&&(f+=d-c[2]-s,l=a-1)}h=0,c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0}else c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,h=3;else c[++h]++;r.foundPatternCross(c)&&this.handlePossibleCenter(c,f,a,n)===!0&&(s=c[0],this.hasSkipped&&(u=this.haveMultiplyConfirmedCenters()))}var p=this.selectBestPatterns();return R.orderBestPatterns(p),new zo(p)},r.centerFromEnd=function(t,e){return e-t[4]-t[3]-t[2]/2},r.foundPatternCross=function(t){for(var e=0,n=0;n<5;n++){var o=t[n];if(o===0)return!1;e+=o}if(e<7)return!1;var i=e/7,a=i/2;return Math.abs(i-t[0])=a&&e>=a&&s.get(e-a,t-a);)i[2]++,a++;if(t=a&&e>=a&&!s.get(e-a,t-a)&&i[1]<=n;)i[1]++,a++;if(tn)return!1;for(;t>=a&&e>=a&&s.get(e-a,t-a)&&i[0]<=n;)i[0]++,a++;if(i[0]>n)return!1;var u=s.getHeight(),c=s.getWidth();for(a=1;t+a=u||e+a>=c)return!1;for(;t+a=u||e+a>=c||i[3]>=n)return!1;for(;t+a=n)return!1;var f=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(f-o)<2*o&&r.foundPatternCross(i)},r.prototype.crossCheckVertical=function(t,e,n,o){for(var i=this.image,a=i.getHeight(),s=this.getCrossCheckStateCount(),u=t;u>=0&&i.get(e,u);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!i.get(e,u)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&i.get(e,u)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;u=n)return NaN;for(;u=n)return NaN;var c=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(c-o)>=2*o?NaN:r.foundPatternCross(s)?r.centerFromEnd(s,u):NaN},r.prototype.crossCheckHorizontal=function(t,e,n,o){for(var i=this.image,a=i.getWidth(),s=this.getCrossCheckStateCount(),u=t;u>=0&&i.get(u,e);)s[2]++,u--;if(u<0)return NaN;for(;u>=0&&!i.get(u,e)&&s[1]<=n;)s[1]++,u--;if(u<0||s[1]>n)return NaN;for(;u>=0&&i.get(u,e)&&s[0]<=n;)s[0]++,u--;if(s[0]>n)return NaN;for(u=t+1;u=n)return NaN;for(;u=n)return NaN;var c=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(c-o)>=o?NaN:r.foundPatternCross(s)?r.centerFromEnd(s,u):NaN},r.prototype.handlePossibleCenter=function(t,e,n,o){var i=t[0]+t[1]+t[2]+t[3]+t[4],a=r.centerFromEnd(t,n),s=this.crossCheckVertical(e,Math.floor(a),t[2],i);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),t[2],i),!isNaN(a)&&(!o||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),t[2],i)))){for(var u=i/7,c=!1,f=this.possibleCenters,h=0,l=f.length;h=r.CENTER_QUORUM){if(n!=null)return this.hasSkipped=!0,Math.floor((Math.abs(n.getX()-a.getX())-Math.abs(n.getY()-a.getY()))/2);n=a}}}catch(s){t={error:s}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return 0},r.prototype.haveMultiplyConfirmedCenters=function(){var t,e,n,o,i=0,a=0,s=this.possibleCenters.length;try{for(var u=Ht(this.possibleCenters),c=u.next();!c.done;c=u.next())(p=c.value).getCount()>=r.CENTER_QUORUM&&(i++,a+=p.getEstimatedModuleSize())}catch(y){t={error:y}}finally{try{c&&!c.done&&(e=u.return)&&e.call(u)}finally{if(t)throw t.error}}if(i<3)return!1;var f=a/s,h=0;try{for(var l=Ht(this.possibleCenters),d=l.next();!d.done;d=l.next()){var p=d.value;h+=Math.abs(p.getEstimatedModuleSize()-f)}}catch(y){n={error:y}}finally{try{d&&!d.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}return h<=.05*a},r.prototype.selectBestPatterns=function(){var t,e,n,o,i=this.possibleCenters.length;if(i<3)throw new E;var a,s=this.possibleCenters;if(i>3){var u=0,c=0;try{for(var f=Ht(this.possibleCenters),h=f.next();!h.done;h=f.next()){var l=h.value.getEstimatedModuleSize();u+=l,c+=l*l}}catch(_){t={error:_}}finally{try{h&&!h.done&&(e=f.return)&&e.call(f)}finally{if(t)throw t.error}}a=u/i;var d=Math.sqrt(c/i-a*a);s.sort(function(_,m){var I=Math.abs(m.getEstimatedModuleSize()-a),S=Math.abs(_.getEstimatedModuleSize()-a);return IS?1:0});for(var p=Math.max(.2*a,d),y=0;y3;y++){var C=s[y];Math.abs(C.getEstimatedModuleSize()-a)>p&&(s.splice(y,1),y--)}}if(s.length>3){u=0;try{for(var w=Ht(s),v=w.next();!v.done;v=w.next())u+=v.value.getEstimatedModuleSize()}catch(_){n={error:_}}finally{try{v&&!v.done&&(o=w.return)&&o.call(w)}finally{if(n)throw n.error}}a=u/s.length,s.sort(function(_,m){if(m.getCount()===_.getCount()){var I=Math.abs(m.getEstimatedModuleSize()-a),S=Math.abs(_.getEstimatedModuleSize()-a);return IS?-1:0}return m.getCount()-_.getCount()}),s.splice(3)}return[s[0],s[1],s[2]]},r.CENTER_QUORUM=2,r.MIN_SKIP=3,r.MAX_MODULES=57,r}(),Yo=function(){function r(t){this.image=t}return r.prototype.getImage=function(){return this.image},r.prototype.getResultPointCallback=function(){return this.resultPointCallback},r.prototype.detect=function(t){this.resultPointCallback=t==null?null:t.get(Q.NEED_RESULT_POINT_CALLBACK);var e=new jo(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(e)},r.prototype.processFinderPatternInfo=function(t){var e=t.getTopLeft(),n=t.getTopRight(),o=t.getBottomLeft(),i=this.calculateModuleSize(e,n,o);if(i<1)throw new E("No pattern found in proccess finder.");var a=r.computeDimension(e,n,o,i),s=Lt.getProvisionalVersionForDimension(a),u=s.getDimensionForVersion()-7,c=null;if(s.getAlignmentPatternCenters().length>0)for(var f=n.getX()-e.getX()+o.getX(),h=n.getY()-e.getY()+o.getY(),l=1-3/u,d=Math.floor(e.getX()+l*(f-e.getX())),p=Math.floor(e.getY()+l*(h-e.getY())),y=4;y<=16;y<<=1)try{c=this.findAlignmentInRegion(i,d,p,y);break}catch(v){if(!(v instanceof E))throw v}var C=r.createTransform(e,n,o,c,a),w=r.sampleGrid(this.image,C,a);return new xe(w,c===null?[o,e,n]:[o,e,n,c])},r.createTransform=function(t,e,n,o,i){var a,s,u,c,f=i-3.5;return o!==null?(a=o.getX(),s=o.getY(),c=u=f-3):(a=e.getX()-t.getX()+n.getX(),s=e.getY()-t.getY()+n.getY(),u=f,c=f),Sr.quadrilateralToQuadrilateral(3.5,3.5,f,3.5,u,c,3.5,f,t.getX(),t.getY(),e.getX(),e.getY(),a,s,n.getX(),n.getY())},r.sampleGrid=function(t,e,n){return ke.getInstance().sampleGridWithTransform(t,n,n,e)},r.computeDimension=function(t,e,n,o){var i=U.round(R.distance(t,e)/o),a=U.round(R.distance(t,n)/o),s=Math.floor((i+a)/2)+7;switch(3&s){case 0:s++;break;case 2:s--;break;case 3:throw new E("Dimensions could be not found.")}return s},r.prototype.calculateModuleSize=function(t,e,n){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,n))/2},r.prototype.calculateModuleSizeOneWay=function(t,e){var n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY())),o=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(n)?o/7:isNaN(o)?n/7:(n+o)/14},r.prototype.sizeOfBlackWhiteBlackRunBothWays=function(t,e,n,o){var i=this.sizeOfBlackWhiteBlackRun(t,e,n,o),a=1,s=t-(n-t);s<0?(a=t/(t-s),s=0):s>=this.image.getWidth()&&(a=(this.image.getWidth()-1-t)/(s-t),s=this.image.getWidth()-1);var u=Math.floor(e-(o-e)*a);return a=1,u<0?(a=e/(e-u),u=0):u>=this.image.getHeight()&&(a=(this.image.getHeight()-1-e)/(u-e),u=this.image.getHeight()-1),s=Math.floor(t+(s-t)*a),(i+=this.sizeOfBlackWhiteBlackRun(t,e,s,u))-1},r.prototype.sizeOfBlackWhiteBlackRun=function(t,e,n,o){var i=Math.abs(o-e)>Math.abs(n-t);if(i){var a=t;t=e,e=a,a=n,n=o,o=a}for(var s=Math.abs(n-t),u=Math.abs(o-e),c=-s/2,f=t0){if(y===o)break;y+=h,c-=s}}return l===2?U.distance(n+f,o,t,e):NaN},r.prototype.findAlignmentInRegion=function(t,e,n,o){var i=Math.floor(o*t),a=Math.max(0,e-i),s=Math.min(this.image.getWidth()-1,e+i);if(s-a<3*t)throw new E("Alignment top exceeds estimated module size.");var u=Math.max(0,n-i),c=Math.min(this.image.getHeight()-1,n+i);if(c-u<3*t)throw new E("Alignment bottom exceeds estimated module size.");return new Xo(this.image,a,u,s-a,c-u,t,this.resultPointCallback).find()},r}(),Re=function(){function r(){this.decoder=new ko}return r.prototype.getDecoder=function(){return this.decoder},r.prototype.decode=function(t,e){var n,o;if(e!=null&&e.get(Q.PURE_BARCODE)!==void 0){var i=r.extractPureBits(t.getBlackMatrix());n=this.decoder.decodeBitMatrix(i,e),o=r.NO_POINTS}else{var a=new Yo(t.getBlackMatrix()).detect(e);n=this.decoder.decodeBitMatrix(a.getBits(),e),o=a.getPoints()}n.getOther()instanceof Dr&&n.getOther().applyMirroredCorrection(o);var s=new ft(n.getText(),n.getRawBytes(),void 0,o,D.QR_CODE,void 0),u=n.getByteSegments();u!==null&&s.putMetadata(ct.BYTE_SEGMENTS,u);var c=n.getECLevel();return c!==null&&s.putMetadata(ct.ERROR_CORRECTION_LEVEL,c),n.hasStructuredAppend()&&(s.putMetadata(ct.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),s.putMetadata(ct.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),s},r.prototype.reset=function(){},r.extractPureBits=function(t){var e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(e===null||n===null)throw new E;var o=this.moduleSize(e,t),i=e[1],a=n[1],s=e[0],u=n[0];if(s>=u||i>=a)throw new E;if(a-i!=u-s&&(u=s+(a-i))>=t.getWidth())throw new E;var c=Math.round((u-s+1)/o),f=Math.round((a-i+1)/o);if(c<=0||f<=0)throw new E;if(f!==c)throw new E;var h=Math.floor(o/2);i+=h;var l=(s+=h)+Math.floor((c-1)*o)-u;if(l>0){if(l>h)throw new E;s-=l}var d=i+Math.floor((f-1)*o)-a;if(d>0){if(d>h)throw new E;i-=d}for(var p=new yt(c,f),y=0;y=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},V=function(){function r(){}return r.prototype.PDF417Common=function(){},r.getBitCountSum=function(t){return U.sum(t)},r.toIntArray=function(t){var e,n;if(t==null||!t.length)return r.EMPTY_INT_ARRAY;var o=new Int32Array(t.length),i=0;try{for(var a=Zo(t),s=a.next();!s.done;s=a.next()){var u=s.value;o[i++]=u}}catch(c){e={error:c}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return o},r.getCodeword=function(t){var e=$.binarySearch(r.SYMBOL_TABLE,262143&t);return e<0?-1:(r.CODEWORD_TABLE[e]-1)%r.NUMBER_OF_CODEWORDS},r.NUMBER_OF_CODEWORDS=929,r.MAX_CODEWORDS_IN_BARCODE=r.NUMBER_OF_CODEWORDS-1,r.MIN_ROWS_IN_BARCODE=3,r.MAX_ROWS_IN_BARCODE=90,r.MODULES_IN_CODEWORD=17,r.MODULES_IN_STOP_PATTERN=18,r.BARS_IN_MODULE=8,r.EMPTY_INT_ARRAY=new Int32Array([]),r.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),r.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),r}(),Ko=function(){function r(t,e){this.bits=t,this.points=e}return r.prototype.getBits=function(){return this.bits},r.prototype.getPoints=function(){return this.points},r}(),qo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Qo=function(){function r(){}return r.detectMultiple=function(t,e,n){var o=t.getBlackMatrix(),i=r.detect(n,o);return i.length||((o=o.clone()).rotate180(),i=r.detect(n,o)),new Ko(o,i)},r.detect=function(t,e){for(var n,o,i=new Array,a=0,s=0,u=!1;a0;){if((l=r.findGuardPattern(t,i,--o,n,!1,a,c))==null){o++;break}d=l}s[0]=new R(d[0],o),s[1]=new R(d[1],o),u=!0;break}var f=o+1;if(u){for(var h=0,l=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);fr.SKIPPED_ROW_COUNT_MAX)break;h++}}f-=h+1,s[2]=new R(l[0],f),s[3]=new R(l[1],f)}return f-o0&&c++l?h-l:l-h;if(d>n)return 1/0;c+=d}return c/i},r.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),r.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),r.MAX_AVG_VARIANCE=.42,r.MAX_INDIVIDUAL_VARIANCE=.8,r.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),r.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),r.MAX_PIXEL_DRIFT=3,r.MAX_PATTERN_DRIFT=5,r.SKIPPED_ROW_COUNT_MAX=25,r.ROW_STEP=5,r.BARCODE_MIN_HEIGHT=10,r}(),Jo=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Bt=function(){function r(t,e){if(e.length===0)throw new N;this.field=t;var n=e.length;if(n>1&&e[0]===0){for(var o=1;on.length){var o=e;e=n,n=o}var i=new Int32Array(n.length),a=n.length-e.length;Z.arraycopy(n,0,i,0,a);for(var s=a;s=0;e--){var n=this.getCoefficient(e);n!==0&&(n<0?(t.append(" - "),n=-n):t.length()>0&&t.append(" + "),e!==0&&n===1||t.append(n),e!==0&&(e===1?t.append("x"):(t.append("x^"),t.append(e))))}return t.toString()},r}(),$o=function(){function r(){}return r.prototype.add=function(t,e){return(t+e)%this.modulus},r.prototype.subtract=function(t,e){return(this.modulus+t-e)%this.modulus},r.prototype.exp=function(t){return this.expTable[t]},r.prototype.log=function(t){if(t===0)throw new N;return this.logTable[t]},r.prototype.inverse=function(t){if(t===0)throw new Ir;return this.expTable[this.modulus-this.logTable[t]-1]},r.prototype.multiply=function(t,e){return t===0||e===0?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]},r.prototype.getSize=function(){return this.modulus},r.prototype.equals=function(t){return t===this},r}(),ti=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ei=function(r){function t(e,n){var o=r.call(this)||this;o.modulus=e,o.expTable=new Int32Array(e),o.logTable=new Int32Array(e);for(var i=1,a=0;a=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ni=function(){function r(){this.field=ei.PDF417_GF}return r.prototype.decode=function(t,e,n){for(var o,i,a=new Bt(this.field,t),s=new Int32Array(e),u=!1,c=e;c>0;c--){var f=a.evaluateAt(this.field.exp(c));s[e-c]=f,f!==0&&(u=!0)}if(!u)return 0;var h=this.field.getOne();if(n!=null)try{for(var l=ri(n),d=l.next();!d.done;d=l.next()){var p=d.value,y=this.field.exp(t.length-1-p),C=new Bt(this.field,new Int32Array([this.field.subtract(0,y),1]));h=h.multiply(C)}}catch(M){o={error:M}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}var w=new Bt(this.field,s),v=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),w,e),_=v[0],m=v[1],I=this.findErrorLocations(_),S=this.findErrorMagnitudes(m,_,I);for(c=0;c=Math.round(n/2);){var c=i,f=s;if(s=u,(i=a).isZero())throw at.getChecksumInstance();a=c;for(var h=this.field.getZero(),l=i.getCoefficient(i.getDegree()),d=this.field.inverse(l);a.getDegree()>=i.getDegree()&&!a.isZero();){var p=a.getDegree()-i.getDegree(),y=this.field.multiply(a.getCoefficient(a.getDegree()),d);h=h.add(this.field.buildMonomial(p,y)),a=a.subtract(i.multiplyByMonomial(p,y))}u=h.multiply(s).subtract(f).negative()}var C=u.getCoefficient(0);if(C===0)throw at.getChecksumInstance();var w=this.field.inverse(C);return[u.multiply(w),a.multiply(w)]},r.prototype.findErrorLocations=function(t){for(var e=t.getDegree(),n=new Int32Array(e),o=0,i=1;i0){var u=n?this.topLeft:this.topRight,c=Math.trunc(u.getY()-t);c<0&&(c=0);var f=new R(u.getX(),c);n?o=f:a=f}if(e>0){var h=n?this.bottomLeft:this.bottomRight,l=Math.trunc(h.getY()+e);l>=this.image.getHeight()&&(l=this.image.getHeight()-1);var d=new R(h.getX(),l);n?i=d:s=d}return new r(this.image,o,i,a,s)},r.prototype.getMinX=function(){return this.minX},r.prototype.getMaxX=function(){return this.maxX},r.prototype.getMinY=function(){return this.minY},r.prototype.getMaxY=function(){return this.maxY},r.prototype.getTopLeft=function(){return this.topLeft},r.prototype.getTopRight=function(){return this.topRight},r.prototype.getBottomLeft=function(){return this.bottomLeft},r.prototype.getBottomRight=function(){return this.bottomRight},r}(),oi=function(){function r(t,e,n,o){this.columnCount=t,this.errorCorrectionLevel=o,this.rowCountUpperPart=e,this.rowCountLowerPart=n,this.rowCount=e+n}return r.prototype.getColumnCount=function(){return this.columnCount},r.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},r.prototype.getRowCount=function(){return this.rowCount},r.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},r.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},r}(),He=function(){function r(){this.buffer=""}return r.form=function(t,e){var n=-1;return t.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(o,i,a,s,u,c){if(o==="%%")return"%";if(e[++n]!==void 0){o=s?parseInt(s.substr(1)):void 0;var f,h=u?parseInt(u.substr(1)):void 0;switch(c){case"s":f=e[n];break;case"c":f=e[n][0];break;case"f":f=parseFloat(e[n]).toFixed(o);break;case"p":f=parseFloat(e[n]).toPrecision(o);break;case"e":f=parseFloat(e[n]).toExponential(o);break;case"x":f=parseInt(e[n]).toString(h||16);break;case"d":f=parseFloat(parseInt(e[n],h||10).toPrecision(o)).toFixed(0)}f=typeof f=="object"?JSON.stringify(f):(+f).toString(h);for(var l=parseInt(a),d=a&&a[0]+""=="0"?"0":" ";f.length=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Mr=function(){function r(t){this.boundingBox=new Ne(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}return r.prototype.getCodewordNearby=function(t){var e=this.getCodeword(t);if(e!=null)return e;for(var n=1;n=0&&(e=this.codewords[o])!=null||(o=this.imageRowToCodewordIndex(t)+n)=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},si=function(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n,o,i=e.call(r),a=[];try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a},zt=function(){function r(){this.values=new Map}return r.prototype.setValue=function(t){t=Math.trunc(t);var e=this.values.get(t);e==null&&(e=0),e++,this.values.set(t,e)},r.prototype.getValue=function(){var t,e,n=-1,o=new Array,i=function(c,f){var h=function(){return c},l=function(){return f};l()>n?(n=l(),(o=[]).push(h())):l()===n&&o.push(h())};try{for(var a=ai(this.values.entries()),s=a.next();!s.done;s=a.next()){var u=si(s.value,2);i(u[0],u[1])}}catch(c){t={error:c}}finally{try{s&&!s.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}return V.toIntArray(o)},r.prototype.getConfidence=function(t){return this.values.get(t)},r}(),ui=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ye=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},hr=function(r){function t(e,n){var o=r.call(this,e)||this;return o._isLeft=n,o}return ui(t,r),t.prototype.setRowNumbers=function(){var e,n;try{for(var o=ye(this.getCodewords()),i=o.next();!i.done;i=o.next()){var a=i.value;a?.setRowNumberAsRowIndicatorColumn()}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}},t.prototype.adjustCompleteIndicatorColumnRowNumbers=function(e){var n=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(n,e);for(var o=this.getBoundingBox(),i=this._isLeft?o.getTopLeft():o.getTopRight(),a=this._isLeft?o.getBottomLeft():o.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),u=this.imageRowToCodewordIndex(Math.trunc(a.getY())),c=-1,f=1,h=0,l=s;l=e.getRowCount()||p>l)n[l]=null;else{for(var y=void 0,C=(y=f>2?(f-2)*p:p)>=l,w=1;w<=y&&!C;w++)C=n[l-w]!=null;C?n[l]=null:(c=d.getRowNumber(),h=1)}}},t.prototype.getRowHeights=function(){var e,n,o=this.getBarcodeMetadata();if(o==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(o);var i=new Int32Array(o.getRowCount());try{for(var a=ye(this.getCodewords()),s=a.next();!s.done;s=a.next()){var u=s.value;if(u!=null){var c=u.getRowNumber();if(c>=i.length)continue;i[c]++}}}catch(f){e={error:f}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return i},t.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(e){for(var n=this.getBoundingBox(),o=this._isLeft?n.getTopLeft():n.getTopRight(),i=this._isLeft?n.getBottomLeft():n.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),u=this.getCodewords(),c=-1,f=a;f=e.getRowCount()?u[f]=null:c=h.getRowNumber())}},t.prototype.getBarcodeMetadata=function(){var e,n,o=this.getCodewords(),i=new zt,a=new zt,s=new zt,u=new zt;try{for(var c=ye(o),f=c.next();!f.done;f=c.next()){var h=f.value;if(h!=null){h.setRowNumberAsRowIndicatorColumn();var l=h.getValue()%30,d=h.getRowNumber();switch(this._isLeft||(d+=2),d%3){case 0:a.setValue(3*l+1);break;case 1:u.setValue(l/3),s.setValue(l%3);break;case 2:i.setValue(l+1)}}}}catch(y){e={error:y}}finally{try{f&&!f.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}if(i.getValue().length===0||a.getValue().length===0||s.getValue().length===0||u.getValue().length===0||i.getValue()[0]<1||a.getValue()[0]+s.getValue()[0]V.MAX_ROWS_IN_BARCODE)return null;var p=new oi(i.getValue()[0],a.getValue()[0],s.getValue()[0],u.getValue()[0]);return this.removeIncorrectCodewords(o,p),p},t.prototype.removeIncorrectCodewords=function(e,n){for(var o=0;on.getRowCount())e[o]=null;else switch(this._isLeft||(s+=2),s%3){case 0:3*a+1!==n.getRowCountUpperPart()&&(e[o]=null);break;case 1:Math.trunc(a/3)===n.getErrorCorrectionLevel()&&a%3===n.getRowCountLowerPart()||(e[o]=null);break;case 2:a+1!==n.getColumnCount()&&(e[o]=null)}}}},t.prototype.isLeft=function(){return this._isLeft},t.prototype.toString=function(){return"IsLeft: "+this._isLeft+` +`+r.prototype.toString.call(this)},t}(Mr),ci=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},fi=function(){function r(t,e){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=e,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return r.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var t,e=V.MAX_CODEWORDS_IN_BARCODE;do t=e,e=this.adjustRowNumbersAndGetCount();while(e>0&&e0&&i0&&(c[0]=n[e-1],c[4]=s[e-1],c[5]=u[e-1]),e>1&&(c[8]=n[e-2],c[10]=s[e-2],c[11]=u[e-2]),e>=1;n=1&e,r.RATIOS_TABLE[t]||(r.RATIOS_TABLE[t]=new Array(V.BARS_IN_MODULE)),r.RATIOS_TABLE[t][V.BARS_IN_MODULE-o-1]=Math.fround(i/V.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},r.getDecodedValue=function(t){var e=r.getDecodedCodewordValue(r.sampleBitCounts(t));return e!==-1?e:r.getClosestDecodedValue(t)},r.sampleBitCounts=function(t){for(var e=U.sum(t),n=new Int32Array(V.BARS_IN_MODULE),o=0,i=0,a=0;a1)for(var o=0;o=i)break}ut.length||n<0||e+n>t.length||e+n<0)throw new Le;if(n!==0)for(var o=0;o0&&this.grow(e)},t.prototype.grow=function(e){var n=this.buf.length<<1;if(n-e<0&&(n=e),n<0){if(e<0)throw new Ci;n=P.MAX_VALUE}this.buf=$.copyOfUint8Array(this.buf,n)},t.prototype.write=function(e){this.ensureCapacity(this.count+1),this.buf[this.count]=e,this.count+=1},t.prototype.writeBytesOffset=function(e,n,o){if(n<0||n>e.length||o<0||n+o-e.length>0)throw new Le;this.ensureCapacity(this.count+o),Z.arraycopy(e,n,this.buf,this.count,o),this.count+=o},t.prototype.writeTo=function(e){e.writeBytesOffset(this.buf,0,this.count)},t.prototype.reset=function(){this.count=0},t.prototype.toByteArray=function(){return $.copyOfUint8Array(this.buf,this.count)},t.prototype.size=function(){return this.count},t.prototype.toString=function(e){return e?typeof e=="string"?this.toString_string(e):this.toString_number(e):this.toString_void()},t.prototype.toString_void=function(){return new String(this.buf).toString()},t.prototype.toString_string=function(e){return new String(this.buf).toString()},t.prototype.toString_number=function(e){return new String(this.buf).toString()},t.prototype.close=function(){},t}(yi);function Pr(){if(typeof window<"u")return window.BigInt||null;if(lr!==void 0)return lr.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function bt(r){if(te===void 0&&(te=Pr()),te===null)throw new Error("BigInt is not supported!");return te(r)}(function(r){r[r.ALPHA=0]="ALPHA",r[r.LOWER=1]="LOWER",r[r.MIXED=2]="MIXED",r[r.PUNCT=3]="PUNCT",r[r.ALPHA_SHIFT=4]="ALPHA_SHIFT",r[r.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(Y||(Y={}));var De,_i=function(){function r(){}return r.decode=function(t,e){var n=new B(""),o=nt.ISO8859_1;n.enableDecoding(o);for(var i=1,a=t[i++],s=new di;it[0])throw T.getFormatInstance();for(var o=new Int32Array(r.NUMBER_OF_SEQUENCE_CODEWORDS),i=0;i0){for(var l=0;l<6;++l)a.write(Number(bt(u)>>bt(8*(5-l))));u=0,s=0}}o===e[0]&&h0){for(l=0;l<6;++l)a.write(Number(bt(u)>>bt(8*(5-l))));u=0,s=0}}}return i.append(At.decode(a.toByteArray(),n)),o},r.numericCompaction=function(t,e,n){for(var o=0,i=!1,a=new Int32Array(r.MAX_NUMERIC_CODEWORDS);e0&&(n.append(r.decodeBase900toBase10(a,o)),o=0)}return e},r.decodeBase900toBase10=function(t,e){for(var n=bt(0),o=0;o@[\\]_\`~!\r ,: +-.$/"|*()?{}'`,r.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",r.EXP900=Pr()?function(){var t=[];t[0]=bt(1);var e=bt(900);t[1]=e;for(var n=2;n<16;n++)t[n]=t[n-1]*e;return t}():[],r.NUMBER_OF_SEQUENCE_CODEWORDS=2,r}(),Ut=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},mi=function(){function r(){}return r.decode=function(t,e,n,o,i,a,s){for(var u,c=new Ne(t,e,n,o,i),f=null,h=null,l=!0;;l=!1){if(e!=null&&(f=r.getRowIndicatorColumn(t,c,e,!0,a,s)),o!=null&&(h=r.getRowIndicatorColumn(t,c,o,!1,a,s)),(u=r.merge(f,h))==null)throw E.getNotFoundInstance();var d=u.getBoundingBox();if(!l||d==null||!(d.getMinY()c.getMaxY()))break;c=d}u.setBoundingBox(c);var p=u.getBarcodeColumnCount()+1;u.setDetectionResultColumn(0,f),u.setDetectionResultColumn(p,h);for(var y=f!=null,C=1;C<=p;C++){var w=y?C:p-C;if(u.getDetectionResultColumn(w)===void 0){var v=void 0;v=w===0||w===p?new hr(c,w===0):new Mr(c),u.setDetectionResultColumn(w,v);for(var _=-1,m=_,I=c.getMinY();I<=c.getMaxY();I++){if((_=r.getStartColumn(u,w,I,y))<0||_>c.getMaxX()){if(m===-1)continue;_=m}var S=r.detectCodeword(t,c.getMinX(),c.getMaxX(),y,_,I,a,s);S!=null&&(v.setCodeword(I,S),m=_,a=Math.min(a,S.getWidth()),s=Math.max(s,S.getWidth()))}}}return r.createDecoderResult(u)},r.merge=function(t,e){if(t==null&&e==null)return null;var n=r.getBarcodeMetadata(t,e);if(n==null)return null;var o=Ne.merge(r.adjustBoundingBox(t),r.adjustBoundingBox(e));return new fi(n,o)},r.adjustBoundingBox=function(t){var e,n;if(t==null)return null;var o=t.getRowHeights();if(o==null)return null;var i=r.getMax(o),a=0;try{for(var s=Ut(o),u=s.next();!u.done;u=s.next()){var c=u.value;if(a+=i-c,c>0)break}}catch(d){e={error:d}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}for(var f=t.getCodewords(),h=0;a>0&&f[h]==null;h++)a--;var l=0;for(h=o.length-1;h>=0&&(l+=i-o[h],!(o[h]>0));h--);for(h=f.length-1;l>0&&f[h]==null;h--)l--;return t.getBoundingBox().addMissingRows(a,l,t.isLeft())},r.getMax=function(t){var e,n,o=-1;try{for(var i=Ut(t),a=i.next();!a.done;a=i.next()){var s=a.value;o=Math.max(o,s)}}catch(u){e={error:u}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return o},r.getBarcodeMetadata=function(t,e){var n,o;return t==null||(n=t.getBarcodeMetadata())==null?e==null?null:e.getBarcodeMetadata():e==null||(o=e.getBarcodeMetadata())==null?n:n.getColumnCount()!==o.getColumnCount()&&n.getErrorCorrectionLevel()!==o.getErrorCorrectionLevel()&&n.getRowCount()!==o.getRowCount()?null:n},r.getRowIndicatorColumn=function(t,e,n,o,i,a){for(var s=new hr(e,o),u=0;u<2;u++)for(var c=u===0?1:-1,f=Math.trunc(Math.trunc(n.getX())),h=Math.trunc(Math.trunc(n.getY()));h<=e.getMaxY()&&h>=e.getMinY();h+=c){var l=r.detectCodeword(t,0,t.getWidth(),o,f,h,i,a);l!=null&&(s.setCodeword(h,l),f=o?l.getStartX():l.getEndX())}return s},r.adjustCodewordCount=function(t,e){var n=e[0][1],o=n.getValue(),i=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-r.getNumberOfECCodeWords(t.getBarcodeECLevel());if(o.length===0){if(i<1||i>V.MAX_CODEWORDS_IN_BARCODE)throw E.getNotFoundInstance();n.setValue(i)}else o[0]!==i&&n.setValue(i)},r.createDecoderResult=function(t){var e=r.createBarcodeMatrix(t);r.adjustCodewordCount(t,e);for(var n=new Array,o=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),i=[],a=new Array,s=0;s0;){for(var u=0;u=0){if(C>=a.length)continue;a[C][c].setValue(y.getValue())}}}}catch(w){o={error:w}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}c++}}catch(w){e={error:w}}finally{try{h&&!h.done&&(n=f.return)&&n.call(f)}finally{if(e)throw e.error}}return a},r.isValidBarcodeColumn=function(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1},r.getStartColumn=function(t,e,n,o){var i,a,s=o?1:-1,u=null;if(r.isValidBarcodeColumn(t,e-s)&&(u=t.getDetectionResultColumn(e-s).getCodeword(n)),u!=null)return o?u.getEndX():u.getStartX();if((u=t.getDetectionResultColumn(e).getCodewordNearby(n))!=null)return o?u.getStartX():u.getEndX();if(r.isValidBarcodeColumn(t,e-s)&&(u=t.getDetectionResultColumn(e-s).getCodewordNearby(n)),u!=null)return o?u.getEndX():u.getStartX();for(var c=0;r.isValidBarcodeColumn(t,e-s);){e-=s;try{for(var f=(i=void 0,Ut(t.getDetectionResultColumn(e).getCodewords())),h=f.next();!h.done;h=f.next()){var l=h.value;if(l!=null)return(o?l.getEndX():l.getStartX())+s*c*(l.getEndX()-l.getStartX())}}catch(d){i={error:d}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}c++}return o?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()},r.detectCodeword=function(t,e,n,o,i,a,s,u){i=r.adjustCodewordStartColumn(t,e,n,o,i,a);var c,f=r.getModuleBitCount(t,e,n,o,i,a);if(f==null)return null;var h=U.sum(f);if(o)c=i+h;else{for(var l=0;l=e)&&c=e:sr.CODEWORD_SKEW_SIZE)return i;s+=u}u=-u,o=!o}return s},r.checkCodewordSkew=function(t,e,n){return e-r.CODEWORD_SKEW_SIZE<=t&&t<=n+r.CODEWORD_SKEW_SIZE},r.decodeCodewords=function(t,e,n){if(t.length===0)throw T.getFormatInstance();var o=1<n/2+r.MAX_ERRORS||n<0||n>r.MAX_EC_CODEWORDS)throw at.getChecksumInstance();return r.errorCorrection.decode(t,n,e)},r.verifyCodewordCount=function(t,e){if(t.length<4)throw T.getFormatInstance();var n=t[0];if(n>t.length)throw T.getFormatInstance();if(n===0){if(!(e>=1;return e},r.getCodewordBucketNumber=function(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)},r.getCodewordBucketNumber_number=function(t){return r.getCodewordBucketNumber(r.getBitCountForCodeword(t))},r.getCodewordBucketNumber_Int32Array=function(t){return(t[0]-t[2]+t[4]-t[6]+9)%9},r.toString=function(t){for(var e=new He,n=0;n=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Me=function(){function r(){}return r.prototype.decode=function(t,e){e===void 0&&(e=null);var n=r.decode(t,e,!1);if(n==null||n.length===0||n[0]==null)throw E.getNotFoundInstance();return n[0]},r.prototype.decodeMultiple=function(t,e){e===void 0&&(e=null);try{return r.decode(t,e,!0)}catch(n){throw n instanceof T||n instanceof at?E.getNotFoundInstance():n}},r.decode=function(t,e,n){var o,i,a=new Array,s=Qo.detectMultiple(t,e,n);try{for(var u=Ei(s.getPoints()),c=u.next();!c.done;c=u.next()){var f=c.value,h=mi.decode(s.getBits(),f[4],f[5],f[6],f[7],r.getMinCodewordWidth(f),r.getMaxCodewordWidth(f)),l=new ft(h.getText(),h.getRawBytes(),void 0,f,D.PDF_417);l.putMetadata(ct.ERROR_CORRECTION_LEVEL,h.getECLevel());var d=h.getOther();d!=null&&l.putMetadata(ct.PDF417_EXTRA_METADATA,d),a.push(l)}}catch(p){o={error:p}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}return a.map(function(p){return p})},r.getMaxWidth=function(t,e){return t==null||e==null?0:Math.trunc(Math.abs(t.getX()-e.getX()))},r.getMinWidth=function(t,e){return t==null||e==null?P.MAX_VALUE:Math.trunc(Math.abs(t.getX()-e.getX()))},r.getMaxCodewordWidth=function(t){return Math.floor(Math.max(Math.max(r.getMaxWidth(t[0],t[4]),r.getMaxWidth(t[6],t[2])*V.MODULES_IN_CODEWORD/V.MODULES_IN_STOP_PATTERN),Math.max(r.getMaxWidth(t[1],t[5]),r.getMaxWidth(t[7],t[3])*V.MODULES_IN_CODEWORD/V.MODULES_IN_STOP_PATTERN)))},r.getMinCodewordWidth=function(t){return Math.floor(Math.min(Math.min(r.getMinWidth(t[0],t[4]),r.getMinWidth(t[6],t[2])*V.MODULES_IN_CODEWORD/V.MODULES_IN_STOP_PATTERN),Math.min(r.getMinWidth(t[1],t[5]),r.getMinWidth(t[7],t[3])*V.MODULES_IN_CODEWORD/V.MODULES_IN_STOP_PATTERN)))},r.prototype.reset=function(){},r}(),Ii=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),pr=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return Ii(t,r),t.kind="ReaderException",t}(wt),gr=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Si=function(){function r(){}return r.prototype.decode=function(t,e){return this.setHints(e),this.decodeInternal(t)},r.prototype.decodeWithState=function(t){return this.readers!==null&&this.readers!==void 0||this.setHints(null),this.decodeInternal(t)},r.prototype.setHints=function(t){this.hints=t;var e=t!=null&&t.get(Q.TRY_HARDER)!==void 0,n=t==null?null:t.get(Q.POSSIBLE_FORMATS),o=new Array;if(n!=null){var i=n.some(function(a){return a===D.UPC_A||a===D.UPC_E||a===D.EAN_13||a===D.EAN_8||a===D.CODABAR||a===D.CODE_39||a===D.CODE_93||a===D.CODE_128||a===D.ITF||a===D.RSS_14||a===D.RSS_EXPANDED});i&&!e&&o.push(new Wt(t)),n.includes(D.QR_CODE)&&o.push(new Re),n.includes(D.DATA_MATRIX)&&o.push(new be),n.includes(D.AZTEC)&&o.push(new Te),n.includes(D.PDF_417)&&o.push(new Me),i&&e&&o.push(new Wt(t))}o.length===0&&(e||o.push(new Wt(t)),o.push(new Re),o.push(new be),o.push(new Te),o.push(new Me),e&&o.push(new Wt(t))),this.readers=o},r.prototype.reset=function(){var t,e;if(this.readers!==null)try{for(var n=gr(this.readers),o=n.next();!o.done;o=n.next())o.value.reset()}catch(i){t={error:i}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},r.prototype.decodeInternal=function(t){var e,n;if(this.readers===null)throw new pr("No readers where selected, nothing can be read.");try{for(var o=gr(this.readers),i=o.next();!i.done;i=o.next()){var a=i.value;try{return a.decode(t,this.hints)}catch(s){if(s instanceof pr)continue}}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}throw new E("No MultiFormat Readers were able to detect the code.")},r}(),Ti=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ea=function(r){function t(e,n){e===void 0&&(e=null),n===void 0&&(n=500);var o=new Si;return o.setHints(e),r.call(this,o,n)||this}return Ti(t,r),t.prototype.decodeBitmap=function(e){return this.reader.decodeWithState(e)},t}(Vt),Oi=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Ia=function(r){function t(e){return e===void 0&&(e=500),r.call(this,new Me,e)||this}return Oi(t,r),t}(Vt),bi=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Sa=function(r){function t(e){return e===void 0&&(e=500),r.call(this,new Re,e)||this}return bi(t,r),t}(Vt);(function(r){r[r.ERROR_CORRECTION=0]="ERROR_CORRECTION",r[r.CHARACTER_SET=1]="CHARACTER_SET",r[r.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",r[r.DATA_MATRIX_COMPACT=3]="DATA_MATRIX_COMPACT",r[r.MIN_SIZE=4]="MIN_SIZE",r[r.MAX_SIZE=5]="MAX_SIZE",r[r.MARGIN=6]="MARGIN",r[r.PDF417_COMPACT=7]="PDF417_COMPACT",r[r.PDF417_COMPACTION=8]="PDF417_COMPACTION",r[r.PDF417_DIMENSIONS=9]="PDF417_DIMENSIONS",r[r.AZTEC_LAYERS=10]="AZTEC_LAYERS",r[r.QR_VERSION=11]="QR_VERSION",r[r.GS1_FORMAT=12]="GS1_FORMAT",r[r.FORCE_C40=13]="FORCE_C40"})(De||(De={}));var Pe,yr,j=De,Br=function(){function r(t){this.field=t,this.cachedGenerators=[],this.cachedGenerators.push(new Rt(t,Int32Array.from([1])))}return r.prototype.buildGenerator=function(t){var e=this.cachedGenerators;if(t>=e.length)for(var n=e[e.length-1],o=this.field,i=e.length;i<=t;i++){var a=n.multiply(new Rt(o,Int32Array.from([1,o.exp(i-1+o.getGeneratorBase())])));e.push(a),n=a}return e[t]},r.prototype.encode=function(t,e){if(e===0)throw new N("No error correction bytes");var n=t.length-e;if(n<=0)throw new N("No data bytes provided");var o=this.buildGenerator(e),i=new Int32Array(n);Z.arraycopy(t,0,i,0,n);for(var a=new Rt(this.field,i),s=(a=a.multiplyByMonomial(e,1)).divide(o)[1].getCoefficients(),u=e-s.length,c=0;c=5&&(n+=r.N1+(u-5)),u=1,c=h)}u>=5&&(n+=r.N1+(u-5))}return n},r.N1=3,r.N2=3,r.N3=40,r.N4=10,r}(),Ri=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Lr=function(){function r(t,e){this.width=t,this.height=e;for(var n=new Array(e),o=0;o!==e;o++)n[o]=new Uint8Array(t);this.bytes=n}return r.prototype.getHeight=function(){return this.height},r.prototype.getWidth=function(){return this.width},r.prototype.get=function(t,e){return this.bytes[e][t]},r.prototype.getArray=function(){return this.bytes},r.prototype.setNumber=function(t,e,n){this.bytes[e][t]=n},r.prototype.setBoolean=function(t,e,n){this.bytes[e][t]=n?1:0},r.prototype.clear=function(t){var e,n;try{for(var o=Ri(this.bytes),i=o.next();!i.done;i=o.next()){var a=i.value;$.fill(a,t)}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}},r.prototype.equals=function(t){if(!(t instanceof r))return!1;var e=t;if(this.width!==e.width||this.height!==e.height)return!1;for(var n=0,o=this.height;n> +`),t.toString()},r.prototype.setMode=function(t){this.mode=t},r.prototype.setECLevel=function(t){this.ecLevel=t},r.prototype.setVersion=function(t){this.version=t},r.prototype.setMaskPattern=function(t){this.maskPattern=t},r.prototype.setMatrix=function(t){this.matrix=t},r.isValidMaskPattern=function(t){return t>=0&&t0;){for(a===6&&(a-=1);s>=0&&s=n;)t^=e<=0)for(var u=0;u!==a;u++){var c=o[u];c>=0&&r.isEmpty(e.get(c,s))&&r.embedPositionAdjustmentPattern(c-2,s-2,e)}}},r.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),r.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),r.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),r.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),r.VERSION_INFO_POLY=7973,r.TYPE_INFO_POLY=1335,r.TYPE_INFO_MASK_PATTERN=21522,r}(),Di=function(){function r(t,e){this.dataBytes=t,this.errorCorrectionBytes=e}return r.prototype.getDataBytes=function(){return this.dataBytes},r.prototype.getErrorCorrectionBytes=function(){return this.errorCorrectionBytes},r}(),Cr=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Fr=function(){function r(){}return r.calculateMaskPenalty=function(t){return jt.applyMaskPenaltyRule1(t)+jt.applyMaskPenaltyRule2(t)+jt.applyMaskPenaltyRule3(t)+jt.applyMaskPenaltyRule4(t)},r.encode=function(t,e,n){n===void 0&&(n=null);var o=r.DEFAULT_BYTE_MODE_ENCODING,i=n!==null&&n.get(j.CHARACTER_SET)!==void 0;i&&(o=n.get(j.CHARACTER_SET).toString());var a=this.chooseMode(t,o),s=new st;if(a===q.BYTE&&(i||r.DEFAULT_BYTE_MODE_ENCODING!==o)){var u=nt.getCharacterSetECIByName(o);u!==void 0&&this.appendECI(u,s)}this.appendModeInfo(a,s);var c,f=new st;if(this.appendBytes(t,a,f,o),n!==null&&n.get(j.QR_VERSION)!==void 0){var h=Number.parseInt(n.get(j.QR_VERSION).toString(),10);c=Lt.getVersionForNumber(h);var l=this.calculateBitsNeeded(a,s,f,c);if(!this.willFit(l,c,e))throw new K("Data too big for requested version")}else c=this.recommendVersion(e,a,s,f);var d=new st;d.appendBitArray(s);var p=a===q.BYTE?f.getSizeInBytes():t.length;this.appendLengthInfo(p,c,a,d),d.appendBitArray(f);var y=c.getECBlocksForLevel(e),C=c.getTotalCodewords()-y.getTotalECCodewords();this.terminateBits(C,d);var w=this.interleaveWithECBytes(d,c.getTotalCodewords(),C,y.getNumBlocks()),v=new Be;v.setECLevel(e),v.setMode(a),v.setVersion(c);var _=c.getDimensionForVersion(),m=new Lr(_,_),I=this.chooseMaskPattern(w,e,c,m);return v.setMaskPattern(I),wr.buildMatrix(w,e,c,I,m),v.setMatrix(m),v},r.recommendVersion=function(t,e,n,o){var i=this.calculateBitsNeeded(e,n,o,Lt.getVersionForNumber(1)),a=this.chooseVersion(i,t),s=this.calculateBitsNeeded(e,n,o,a);return this.chooseVersion(s,t)},r.calculateBitsNeeded=function(t,e,n,o){return e.getSize()+t.getCharacterCountBits(o)+n.getSize()},r.getAlphanumericCode=function(t){return t159)&&(i<224||i>235))return!1}return!0},r.chooseMaskPattern=function(t,e,n,o){for(var i=Number.MAX_SAFE_INTEGER,a=-1,s=0;s=(t+7)/8},r.terminateBits=function(t,e){var n=8*t;if(e.getSize()>n)throw new K("data bits cannot fit in the QR Code"+e.getSize()+" > "+n);for(var o=0;o<4&&e.getSize()0)for(o=i;o<8;o++)e.appendBit(!1);var a=t-e.getSizeInBytes();for(o=0;o=n)throw new K("Block ID too large");var s=t%n,u=n-s,c=Math.floor(t/n),f=c+1,h=Math.floor(e/n),l=h+1,d=c-h,p=f-l;if(d!==p)throw new K("EC bytes mismatch");if(n!==u+s)throw new K("RS blocks mismatch");if(t!==(h+d)*u+(l+p)*s)throw new K("Total bytes mismatch");o=1<=0&&e<=9},r.appendNumericBytes=function(t,e){for(var n=t.length,o=0;o=33088&&a<=40956?s=a-33088:a>=57408&&a<=60351&&(s=a-49472),s===-1)throw new K("Invalid byte sequence");var u=192*(s>>8)+(255&s);e.appendBits(u,13)}},r.appendECI=function(t,e){e.appendBits(q.ECI.getBits(),4),e.appendBits(t.getValue(),8)},r.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),r.DEFAULT_BYTE_MODE_ENCODING=nt.UTF8.getName(),r}(),Ta=function(){function r(){}return r.prototype.write=function(t,e,n,o){if(o===void 0&&(o=null),t.length===0)throw new N("Found empty contents");if(e<0||n<0)throw new N("Requested dimensions are too small: "+e+"x"+n);var i=Zt.L,a=r.QUIET_ZONE_SIZE;o!==null&&(o.get(j.ERROR_CORRECTION)!==void 0&&(i=Zt.fromString(o.get(j.ERROR_CORRECTION).toString())),o.get(j.MARGIN)!==void 0&&(a=Number.parseInt(o.get(j.MARGIN).toString(),10)));var s=Fr.encode(t,i,o);return this.renderResult(s,e,n,a)},r.prototype.writeToDom=function(t,e,n,o,i){i===void 0&&(i=null),typeof t=="string"&&(t=document.querySelector(t));var a=this.write(e,n,o,i);t&&t.appendChild(a)},r.prototype.renderResult=function(t,e,n,o){var i=t.getMatrix();if(i===null)throw new Nt;for(var a=i.getWidth(),s=i.getHeight(),u=a+2*o,c=s+2*o,f=Math.max(e,u),h=Math.max(n,c),l=Math.min(Math.floor(f/u),Math.floor(h/c)),d=Math.floor((f-a*l)/2),p=Math.floor((h-s*l)/2),y=this.createSVGElement(f,h),C=0,w=p;Cn||a+u>o)throw new N("Crop rectangle does not fit within image data.");return c&&f.reverseHorizontal(s,u),f}return Pi(t,r),t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new N("Requested row is outside the image: "+e);var o=this.getWidth();(n==null||n.length>16&255,y=d>>7&510,C=255&d;h[l]=(p+y+C)/4&255}c.luminances=h}else c.luminances=e;if(i===void 0&&(c.dataWidth=n),a===void 0&&(c.dataHeight=o),s===void 0&&(c.left=0),u===void 0&&(c.top=0),c.left+n>c.dataWidth||c.top+o>c.dataHeight)throw new N("Crop rectangle does not fit within image data.");return c}return Bi(t,r),t.prototype.getRow=function(e,n){if(e<0||e>=this.getHeight())throw new N("Requested row is outside the image: "+e);var o=this.getWidth();(n==null||n.length=0&&this.noBit(n,e)&&this.utah(e,n,t++),e-=2,n+=2;while(e>=0&&n=0&&n=0);e+=3,n++}while(e=256&&(e^=301);return{LOG:r,ALOG:t}}([],[]),Pe.LOG),Ar=Pe.ALOG;(function(r){r[r.FORCE_NONE=0]="FORCE_NONE",r[r.FORCE_SQUARE=1]="FORCE_SQUARE",r[r.FORCE_RECTANGLE=2]="FORCE_RECTANGLE"})(yr||(yr={}));var b,kr="[)>05",Vr="[)>06",se="",ki=function(){function r(){}return r.encodeECC200=function(t,e){if(t.length!==e.getDataCapacity())throw new Error("The number of codewords does not match the selected symbol");var n=new B;n.append(t);var o=e.getInterleavedBlockCount();if(o===1){var i=this.createECCBlock(t,e.getErrorCodewords());n.append(i)}else{for(var a=[],s=[],u=0;u0;u--)s!==0&&i[u]!==0?a[u]=a[u-1]^Ar[(ee[s]+ee[i[u]])%255]:a[u]=a[u-1];s!==0&&i[0]!==0?a[0]=Ar[(ee[s]+ee[i[0]])%255]:a[0]=0}var c=[];for(o=0;o=2)t.writeCodeword(this.encodeASCIIDigits(t.getMessage().charCodeAt(t.pos),t.getMessage().charCodeAt(t.pos+1))),t.pos+=2;else{var e=t.getCurrentChar(),n=L.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode());if(n!==this.getEncodingMode())switch(n){case 5:return t.writeCodeword(231),void t.signalEncoderChange(5);case 1:return t.writeCodeword(230),void t.signalEncoderChange(1);case 3:t.writeCodeword(238),t.signalEncoderChange(3);break;case 2:t.writeCodeword(239),t.signalEncoderChange(2);break;case 4:t.writeCodeword(240),t.signalEncoderChange(4);break;default:throw new Error("Illegal mode: "+n)}else L.isExtendedASCII(e)?(t.writeCodeword(235),t.writeCodeword(e-128+1),t.pos++):(t.writeCodeword(e+1),t.pos++)}},r.prototype.encodeASCIIDigits=function(t,e){if(L.isDigit(t)&&L.isDigit(e))return 10*(t-48)+(e-48)+130;throw new Error("not digits: "+t+e)},r}(),Hi=function(){function r(){}return r.prototype.getEncodingMode=function(){return 5},r.prototype.encode=function(t){var e=new B;for(e.append(0);t.hasMoreCharacters();){var n=t.getCurrentChar();if(e.append(n),t.pos++,L.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode())!==this.getEncodingMode()){t.signalEncoderChange(0);break}}var o=e.length()-1,i=t.getCodewordCount()+o+1;t.updateSymbolInfo(i);var a=t.getSymbolInfo().getDataCapacity()-i>0;if(t.hasMoreCharacters()||a)if(o<=249)e.setCharAt(0,F.getCharAt(o));else{if(!(o<=1555))throw new Error("Message length not in valid ranges: "+o);e.setCharAt(0,F.getCharAt(Math.floor(o/250)+249)),e.insert(1,F.getCharAt(o%250))}var s=0;for(n=e.length();s3||c!==1))&&(t.pos=o)}e.length()>0&&t.writeCodeword(230),this.handleEOD(t,e)},r.prototype.encode=function(t){for(var e=new B;t.hasMoreCharacters();){var n=t.getCurrentChar();t.pos++;var o=this.encodeChar(n,e),i=2*Math.floor(e.length()/3),a=t.getCodewordCount()+i;t.updateSymbolInfo(a);var s=t.getSymbolInfo().getDataCapacity()-a;if(!t.hasMoreCharacters()){var u=new B;for(e.length()%3==2&&s!==2&&(o=this.backtrackOneCharacter(t,e,u,o));e.length()%3==1&&(o>3||s!==1);)o=this.backtrackOneCharacter(t,e,u,o);break}if(e.length()%3==0&&L.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode())!==this.getEncodingMode()){t.signalEncoderChange(0);break}}this.handleEOD(t,e)},r.prototype.backtrackOneCharacter=function(t,e,n,o){var i=e.length(),a=e.toString().substring(0,i-o);e.setLengthToZero(),e.append(a),t.pos--;var s=t.getCurrentChar();return o=this.encodeChar(s,n),t.resetSymbolInfo(),o},r.prototype.writeNextTriplet=function(t,e){t.writeCodewords(this.encodeToCodewords(e.toString()));var n=e.toString().substring(3);e.setLengthToZero(),e.append(n)},r.prototype.handleEOD=function(t,e){var n=Math.floor(e.length()/3*2),o=e.length()%3,i=t.getCodewordCount()+n;t.updateSymbolInfo(i);var a=t.getSymbolInfo().getDataCapacity()-i;if(o===2){for(e.append("\0");e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(254)}else if(a===1&&o===1){for(;e.length()>=3;)this.writeNextTriplet(t,e);t.hasMoreCharacters()&&t.writeCodeword(254),t.pos--}else{if(o!==0)throw new Error("Unexpected case. Please report!");for(;e.length()>=3;)this.writeNextTriplet(t,e);(a>0||t.hasMoreCharacters())&&t.writeCodeword(254)}t.signalEncoderChange(0)},r.prototype.encodeChar=function(t,e){if(t===" ".charCodeAt(0))return e.append(3),1;if(t>="0".charCodeAt(0)&&t<="9".charCodeAt(0))return e.append(t-48+4),1;if(t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0))return e.append(t-65+14),1;if(t<" ".charCodeAt(0))return e.append(0),e.append(t),2;if(t<="/".charCodeAt(0))return e.append(1),e.append(t-33),2;if(t<="@".charCodeAt(0))return e.append(1),e.append(t-58+15),2;if(t<="_".charCodeAt(0))return e.append(1),e.append(t-91+22),2;if(t<=127)return e.append(2),e.append(t-96),2;e.append("1");var n=2;return n+=this.encodeChar(t-128,e)},r.prototype.encodeToCodewords=function(t){var e=1600*t.charCodeAt(0)+40*t.charCodeAt(1)+t.charCodeAt(2)+1,n=e/256,o=e%256,i=new B;return i.append(n),i.append(o),i.toString()},r}(),Ui=function(){function r(){}return r.prototype.getEncodingMode=function(){return 4},r.prototype.encode=function(t){for(var e=new B;t.hasMoreCharacters();){var n=t.getCurrentChar();if(this.encodeChar(n,e),t.pos++,e.length()>=4){t.writeCodewords(this.encodeToCodewords(e.toString()));var o=e.toString().substring(4);if(e.setLengthToZero(),e.append(o),L.lookAheadTest(t.getMessage(),t.pos,this.getEncodingMode())!==this.getEncodingMode()){t.signalEncoderChange(0);break}}}e.append(F.getCharAt(31)),this.handleEOD(t,e)},r.prototype.handleEOD=function(t,e){try{var n=e.length();if(n===0)return;if(n===1){t.updateSymbolInfo();var o=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount(),i=t.getRemainingCharacters();if(i>o&&(t.updateSymbolInfo(t.getCodewordCount()+1),o=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount()),i<=o&&o<=2)return}if(n>4)throw new Error("Count must not exceed 4");var a=n-1,s=this.encodeToCodewords(e.toString()),u=!t.hasMoreCharacters()&&a<=2;a<=2&&(t.updateSymbolInfo(t.getCodewordCount()+a),(o=t.getSymbolInfo().getDataCapacity()-t.getCodewordCount())>=3&&(u=!1,t.updateSymbolInfo(t.getCodewordCount()+s.length))),u?(t.resetSymbolInfo(),t.pos-=a):t.writeCodewords(s)}finally{t.signalEncoderChange(0)}},r.prototype.encodeChar=function(t,e){t>=" ".charCodeAt(0)&&t<="?".charCodeAt(0)?e.append(t):t>="@".charCodeAt(0)&&t<="^".charCodeAt(0)?e.append(F.getCharAt(t-64)):L.illegalCharacter(F.getCharAt(t))},r.prototype.encodeToCodewords=function(t){var e=t.length;if(e===0)throw new Error("StringBuilder must not be empty");var n=(t.charAt(0).charCodeAt(0)<<18)+((e>=2?t.charAt(1).charCodeAt(0):0)<<12)+((e>=3?t.charAt(2).charCodeAt(0):0)<<6)+(e>=4?t.charAt(3).charCodeAt(0):0),o=n>>16&255,i=n>>8&255,a=255&n,s=new B;return s.append(o),e>=2&&s.append(i),e>=3&&s.append(a),s.toString()},r}(),Xi=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Gi=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},H=function(){function r(t,e,n,o,i,a,s,u){s===void 0&&(s=0),u===void 0&&(u=0),this.rectangular=t,this.dataCapacity=e,this.errorCodewords=n,this.matrixWidth=o,this.matrixHeight=i,this.dataRegions=a,this.rsBlockData=s,this.rsBlockError=u}return r.lookup=function(t,e,n,o,i){var a,s;e===void 0&&(e=0),n===void 0&&(n=null),o===void 0&&(o=null),i===void 0&&(i=!0);try{for(var u=Gi(zi),c=u.next();!c.done;c=u.next()){var f=c.value;if((e!==1||!f.rectangular)&&(e!==2||f.rectangular)&&(n==null||!(f.getSymbolWidth()o.getWidth()||f.getSymbolHeight()>o.getHeight()))&&t<=f.dataCapacity)return f}}catch(h){a={error:h}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}if(i)throw new Error("Can't find a symbol arrangement that matches the message. Data codewords: "+t);return null},r.prototype.getHorizontalDataRegions=function(){switch(this.dataRegions){case 1:return 1;case 2:case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},r.prototype.getVerticalDataRegions=function(){switch(this.dataRegions){case 1:case 2:return 1;case 4:return 2;case 16:return 4;case 36:return 6;default:throw new Error("Cannot handle this number of data regions")}},r.prototype.getSymbolDataWidth=function(){return this.getHorizontalDataRegions()*this.matrixWidth},r.prototype.getSymbolDataHeight=function(){return this.getVerticalDataRegions()*this.matrixHeight},r.prototype.getSymbolWidth=function(){return this.getSymbolDataWidth()+2*this.getHorizontalDataRegions()},r.prototype.getSymbolHeight=function(){return this.getSymbolDataHeight()+2*this.getVerticalDataRegions()},r.prototype.getCodewordCount=function(){return this.dataCapacity+this.errorCodewords},r.prototype.getInterleavedBlockCount=function(){return this.rsBlockData?this.dataCapacity/this.rsBlockData:1},r.prototype.getDataCapacity=function(){return this.dataCapacity},r.prototype.getErrorCodewords=function(){return this.errorCodewords},r.prototype.getDataLengthForInterleavedBlock=function(t){return this.rsBlockData},r.prototype.getErrorLengthForInterleavedBlock=function(t){return this.rsBlockError},r}(),Wi=function(r){function t(){return r.call(this,!1,1558,620,22,22,36,-1,62)||this}return Xi(t,r),t.prototype.getInterleavedBlockCount=function(){return 10},t.prototype.getDataLengthForInterleavedBlock=function(e){return e<=8?156:155},t}(H),zi=[new H(!1,3,5,8,8,1),new H(!1,5,7,10,10,1),new H(!0,5,7,16,6,1),new H(!1,8,10,12,12,1),new H(!0,10,11,14,6,2),new H(!1,12,12,14,14,1),new H(!0,16,14,24,10,1),new H(!1,18,14,16,16,1),new H(!1,22,18,18,18,1),new H(!0,22,18,16,10,2),new H(!1,30,20,20,20,1),new H(!0,32,24,16,14,2),new H(!1,36,24,22,22,1),new H(!1,44,28,24,24,1),new H(!0,49,28,22,14,2),new H(!1,62,36,14,14,4),new H(!1,86,42,16,16,4),new H(!1,114,48,18,18,4),new H(!1,144,56,20,20,4),new H(!1,174,68,22,22,4),new H(!1,204,84,24,24,4,102,42),new H(!1,280,112,14,14,16,140,56),new H(!1,368,144,16,16,16,92,36),new H(!1,456,192,18,18,16,114,48),new H(!1,576,224,20,20,16,144,56),new H(!1,696,272,22,22,16,174,68),new H(!1,816,336,24,24,16,136,56),new H(!1,1050,408,18,18,36,175,68),new H(!1,1304,496,20,20,36,163,62),new Wi],ji=function(){function r(t){this.msg=t,this.pos=0,this.skipAtEnd=0;for(var e=t.split("").map(function(s){return s.charCodeAt(0)}),n=new B,o=0,i=e.length;othis.symbolInfo.getDataCapacity())&&(this.symbolInfo=H.lookup(t,this.shape,this.minSize,this.maxSize,!0))},r.prototype.resetSymbolInfo=function(){this.symbolInfo=null},r}(),Yi=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),Zi=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return Yi(t,r),t.prototype.getEncodingMode=function(){return 3},t.prototype.encode=function(e){for(var n=new B;e.hasMoreCharacters();){var o=e.getCurrentChar();if(e.pos++,this.encodeChar(o,n),n.length()%3==0&&(this.writeNextTriplet(e,n),L.lookAheadTest(e.getMessage(),e.pos,this.getEncodingMode())!==this.getEncodingMode())){e.signalEncoderChange(0);break}}this.handleEOD(e,n)},t.prototype.encodeChar=function(e,n){switch(e){case 13:n.append(0);break;case"*".charCodeAt(0):n.append(1);break;case">".charCodeAt(0):n.append(2);break;case" ".charCodeAt(0):n.append(3);break;default:e>="0".charCodeAt(0)&&e<="9".charCodeAt(0)?n.append(e-48+4):e>="A".charCodeAt(0)&&e<="Z".charCodeAt(0)?n.append(e-65+14):L.illegalCharacter(F.getCharAt(e))}return 1},t.prototype.handleEOD=function(e,n){e.updateSymbolInfo();var o=e.getSymbolInfo().getDataCapacity()-e.getCodewordCount(),i=n.length();e.pos-=i,(e.getRemainingCharacters()>1||o>1||e.getRemainingCharacters()!==o)&&e.writeCodeword(254),e.getNewEncoding()<0&&e.signalEncoderChange(0)},t}(Xe),Ki=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),qi=function(r){function t(){return r!==null&&r.apply(this,arguments)||this}return Ki(t,r),t.prototype.getEncodingMode=function(){return 2},t.prototype.encodeChar=function(e,n){if(e===" ".charCodeAt(0))return n.append(3),1;if(e>="0".charCodeAt(0)&&e<="9".charCodeAt(0))return n.append(e-48+4),1;if(e>="a".charCodeAt(0)&&e<="z".charCodeAt(0))return n.append(e-97+14),1;if(e<" ".charCodeAt(0))return n.append(0),n.append(e),2;if(e<="/".charCodeAt(0))return n.append(1),n.append(e-33),2;if(e<="@".charCodeAt(0))return n.append(1),n.append(e-58+15),2;if(e>="[".charCodeAt(0)&&e<="_".charCodeAt(0))return n.append(1),n.append(e-91+22),2;if(e==="`".charCodeAt(0))return n.append(2),n.append(0),2;if(e<="Z".charCodeAt(0))return n.append(2),n.append(e-65+1),2;if(e<=127)return n.append(2),n.append(e-123+27),2;n.append("1");var o=2;return o+=this.encodeChar(e-128,n)},t}(Xe),Qi=function(){function r(){}return r.randomize253State=function(t){var e=129+(149*t%253+1);return e<=254?e:e-254},r.encodeHighLevel=function(t,e,n,o,i){e===void 0&&(e=0),n===void 0&&(n=null),o===void 0&&(o=null),i===void 0&&(i=!1);var a=new Xe,s=[new Vi,a,new qi,new Zi,new Ui,new Hi],u=new ji(t);u.setSymbolShape(e),u.setSizeConstraints(n,o),t.startsWith(kr)&&t.endsWith(se)?(u.writeCodeword(236),u.setSkipAtEnd(2),u.pos+=7):t.startsWith(Vr)&&t.endsWith(se)&&(u.writeCodeword(237),u.setSkipAtEnd(2),u.pos+=7);var c=0;for(i&&(a.encodeMaximal(u),c=u.getNewEncoding(),u.resetEncoderSignal());u.hasMoreCharacters();)s[c].encode(u),u.getNewEncoding()>=0&&(c=u.getNewEncoding(),u.resetEncoderSignal());var f=u.getCodewordCount();u.updateSymbolInfo();var h=u.getSymbolInfo().getDataCapacity();f=t.length)return n;var o;n===0?o=[0,1,1,1,1,1.25]:(o=[1,2,2,2,2,2.25])[n]=0;for(var i=0,a=new Uint8Array(6),s=[];;){if(e+i===t.length){$.fill(a,0),$.fill(s,0);var u=this.findMinimums(o,s,P.MAX_VALUE,a),c=this.getMinimumCount(a);if(s[0]===u)return 0;if(c===1){if(a[5]>0)return 5;if(a[4]>0)return 4;if(a[2]>0)return 2;if(a[3]>0)return 3}return 1}var f=t.charCodeAt(e+i);if(i++,this.isDigit(f)?o[0]+=.5:this.isExtendedASCII(f)?(o[0]=Math.ceil(o[0]),o[0]+=2):(o[0]=Math.ceil(o[0]),o[0]++),this.isNativeC40(f)?o[1]+=2/3:this.isExtendedASCII(f)?o[1]+=8/3:o[1]+=4/3,this.isNativeText(f)?o[2]+=2/3:this.isExtendedASCII(f)?o[2]+=8/3:o[2]+=4/3,this.isNativeX12(f)?o[3]+=2/3:this.isExtendedASCII(f)?o[3]+=13/3:o[3]+=10/3,this.isNativeEDIFACT(f)?o[4]+=3/4:this.isExtendedASCII(f)?o[4]+=4.25:o[4]+=3.25,this.isSpecialB256(f)?o[5]+=4:o[5]++,i>=4){if($.fill(a,0),$.fill(s,0),this.findMinimums(o,s,P.MAX_VALUE,a),s[0]a&&(n=a,$.fill(o,0)),n===a&&(o[i]=o[i]+1)}return n},r.getMinimumCount=function(t){for(var e=0,n=0;n<6;n++)e+=t[n];return e||0},r.isDigit=function(t){return t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)},r.isExtendedASCII=function(t){return t>=128&&t<=255},r.isNativeC40=function(t){return t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)},r.isNativeText=function(t){return t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="a".charCodeAt(0)&&t<="z".charCodeAt(0)},r.isNativeX12=function(t){return this.isX12TermSep(t)||t===" ".charCodeAt(0)||t>="0".charCodeAt(0)&&t<="9".charCodeAt(0)||t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)},r.isX12TermSep=function(t){return t===13||t==="*".charCodeAt(0)||t===">".charCodeAt(0)},r.isNativeEDIFACT=function(t){return t>=" ".charCodeAt(0)&&t<="^".charCodeAt(0)},r.isSpecialB256=function(t){return!1},r.determineConsecutiveDigitCount=function(t,e){e===void 0&&(e=0);for(var n=t.length,o=e;o=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_r=function(){function r(t){this.charset=t,this.name=t.name}return r.prototype.canEncode=function(t){try{return At.encode(t,this.charset)!=null}catch{return!1}},r}(),Ji=function(){function r(t,e,n){var o,i,a,s,u,c;this.ENCODERS=["IBM437","ISO-8859-2","ISO-8859-3","ISO-8859-4","ISO-8859-5","ISO-8859-6","ISO-8859-7","ISO-8859-8","ISO-8859-9","ISO-8859-10","ISO-8859-11","ISO-8859-13","ISO-8859-14","ISO-8859-15","ISO-8859-16","windows-1250","windows-1251","windows-1252","windows-1256","Shift_JIS"].map(function(M){return new _r(Ue.forName(M))}),this.encoders=[];var f=[];f.push(new _r(xr.ISO_8859_1));for(var h=e!=null&&e.name.startsWith("UTF"),l=0;l=this.bytes.length)return!1;for(var n=0;n=this.length())throw new Error(""+t);if(this.isECI(t))throw new Error("value at "+t+" is not a character but an ECI");return this.isFNC1(t)?this.fnc1:this.bytes[t]},r.prototype.subSequence=function(t,e){if(t<0||t>e||e>this.length())throw new Error(""+t);for(var n=new B,o=t;o=this.length())throw new Error(""+t);return this.bytes[t]>255&&this.bytes[t]<=999},r.prototype.isFNC1=function(t){if(t<0||t>=this.length())throw new Error(""+t);return this.bytes[t]===1e3},r.prototype.getECIValue=function(t){if(t<0||t>=this.length())throw new Error(""+t);if(!this.isECI(t))throw new Error("value at "+t+" is not an ECI but a character");return this.bytes[t]-256},r.prototype.addEdge=function(t,e,n){(t[e][n.encoderIndex]==null||t[e][n.encoderIndex].cachedTotalSize>n.cachedTotalSize)&&(t[e][n.encoderIndex]=n)},r.prototype.addEdges=function(t,e,n,o,i,a){var s=t.charAt(o).charCodeAt(0),u=0,c=e.length();e.getPriorityEncoderIndex()>=0&&(s===a||e.canEncode(s,e.getPriorityEncoderIndex()))&&(c=(u=e.getPriorityEncoderIndex())+1);for(var f=u;f=0;a--)h.unshift(255&d[a])}(l.previous===null?0:l.previous.encoderIndex)!==l.encoderIndex&&h.unshift(256+e.getECIValue(l.encoderIndex)),l=l.previous}var p=[];for(a=0;a=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ea=function(r,t){var e=typeof Symbol=="function"&&r[Symbol.iterator];if(!e)return r;var n,o,i=e.call(r),a=[];try{for(;(t===void 0||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(s){o={error:s}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return a},ra=function(){for(var r=[],t=0;t","?","@","[","\\","]","^","_"],pt=function(){function r(){}return r.isExtendedASCII=function(t,e){return t!==e&&t>=128&&t<=255},r.isInC40Shift1Set=function(t){return t<=31},r.isInC40Shift2Set=function(t,e){var n,o;try{for(var i=Yt(na),a=i.next();!a.done;a=i.next())if(a.value.charCodeAt(0)===t)return!0}catch(s){n={error:s}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}return t===e},r.isInTextShift1Set=function(t){return this.isInC40Shift1Set(t)},r.isInTextShift2Set=function(t,e){return this.isInC40Shift2Set(t,e)},r.encodeHighLevel=function(t,e,n,o){e===void 0&&(e=null),n===void 0&&(n=-1),o===void 0&&(o=0);var i=0;return t.startsWith(kr)&&t.endsWith(se)?(i=5,t=t.substring(7,t.length-2)):t.startsWith(Vr)&&t.endsWith(se)&&(i=6,t=t.substring(7,t.length-2)),decodeURIComponent(escape(String.fromCharCode.apply(String,ra(this.encode(t,e,n,o,i)))))},r.encode=function(t,e,n,o,i){return this.encodeMinimally(new ia(t,e,n,o,i)).getBytes()},r.addEdge=function(t,e){var n=e.fromPosition+e.characterLength;(t[n][e.getEndMode()]===null||t[n][e.getEndMode()].cachedTotalSize>e.cachedTotalSize)&&(t[n][e.getEndMode()]=e)},r.getNumberOfC40Words=function(t,e,n,o){for(var i=0,a=e;a=128&&(n&&L.isNativeC40(u-128)||!n&&L.isNativeText(u-128))?i+=3:i+=4}else i+=2;if(i%3==0||(i-2)%3==0&&a+1===t.length())return o[0]=a-e+1,Math.ceil(i/3)}return o[0]=0,0},r.addEdges=function(t,e,n,o){var i,a;if(t.isECI(n))this.addEdge(e,new vt(t,b.ASCII,n,1,o));else{var s,u=t.charAt(n);if(o===null||o.getEndMode()!==b.EDF){L.isDigit(u)&&t.haveNCharacters(n,2)&&L.isDigit(t.charAt(n+1))?this.addEdge(e,new vt(t,b.ASCII,n,2,o)):this.addEdge(e,new vt(t,b.ASCII,n,1,o));var c=[b.C40,b.TEXT];try{for(var f=Yt(c),h=f.next();!h.done;h=f.next()){var l=h.value,d=[];r.getNumberOfC40Words(t,n,l===b.C40,d)>0&&this.addEdge(e,new vt(t,l,n,d[0],o))}}catch(y){i={error:y}}finally{try{h&&!h.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}t.haveNCharacters(n,3)&&L.isNativeX12(t.charAt(n))&&L.isNativeX12(t.charAt(n+1))&&L.isNativeX12(t.charAt(n+2))&&this.addEdge(e,new vt(t,b.X12,n,3,o)),this.addEdge(e,new vt(t,b.B256,n,1,o))}for(s=0;s<3;s++){var p=n+s;if(!t.haveNCharacters(p,1)||!L.isNativeEDIFACT(t.charAt(p)))break;this.addEdge(e,new vt(t,b.EDF,n,s+1,o))}s===3&&t.haveNCharacters(n,4)&&L.isNativeEDIFACT(t.charAt(n+3))&&this.addEdge(e,new vt(t,b.EDF,n,4,o))}},r.encodeMinimally=function(t){var e=t.length(),n=Array(e+1).fill(null).map(function(){return Array(6).fill(0)});this.addEdges(t,n,0,null);for(var o=1;o<=e;o++){for(var i=0;i<6;i++)n[o][i]!==null&&o=1&&i<=3?u.cachedTotalSize+1:u.cachedTotalSize;c0&&(n+=this.prepend(vt.getBytes(232),o));for(var u=0;u=0;n--)e.unshift(t[n]);return t.length},r.prototype.randomize253State=function(t){var e=129+(149*t%253+1);return e<=254?e:e-254},r.prototype.applyRandomPattern=function(t,e,n){for(var o=0;o0&&this.getCodewordsRemaining(this.cachedTotalSize+t)<=2-t))return b.ASCII;if(this.mode===b.C40||this.mode===b.TEXT||this.mode===b.X12){if(this.fromPosition+this.characterLength>=this.input.length()&&this.getCodewordsRemaining(this.cachedTotalSize)===0)return b.ASCII;var t;if((t=this.getLastASCII())===1&&this.getCodewordsRemaining(this.cachedTotalSize+1)===0)return b.ASCII}return this.mode},r.prototype.getMode=function(){return this.mode},r.prototype.getLastASCII=function(){var t=this.input.length(),e=this.fromPosition+this.characterLength;return t-e>4||e>=t?0:t-e==1?pt.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())?0:1:t-e==2?pt.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())||pt.isExtendedASCII(this.input.charAt(e+1),this.input.getFNC1Character())?0:L.isDigit(this.input.charAt(e))&&L.isDigit(this.input.charAt(e+1))?1:2:t-e==3?L.isDigit(this.input.charAt(e))&&L.isDigit(this.input.charAt(e+1))&&!pt.isExtendedASCII(this.input.charAt(e+2),this.input.getFNC1Character())||L.isDigit(this.input.charAt(e+1))&&L.isDigit(this.input.charAt(e+2))&&!pt.isExtendedASCII(this.input.charAt(e),this.input.getFNC1Character())?2:0:L.isDigit(this.input.charAt(e))&&L.isDigit(this.input.charAt(e+1))&&L.isDigit(this.input.charAt(e+2))&&L.isDigit(this.input.charAt(e+3))?2:0},r.prototype.getMinSymbolSize=function(t){var e,n,o,i,a,s;switch(this.input.getShapeHint()){case 1:try{for(var u=Yt(this.squareCodewordCapacities),c=u.next();!c.done;c=u.next())if((p=c.value)>=t)return p}catch(y){e={error:y}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}break;case 2:try{for(var f=Yt(this.rectangularCodewordCapacities),h=f.next();!h.done;h=f.next())if((p=h.value)>=t)return p}catch(y){o={error:y}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}}try{for(var l=Yt(this.allCodewordCapacities),d=l.next();!d.done;d=l.next()){var p;if((p=d.value)>=t)return p}}catch(y){a={error:y}}finally{try{d&&!d.done&&(s=l.return)&&s.call(l)}finally{if(a)throw a.error}}return this.allCodewordCapacities[this.allCodewordCapacities.length-1]},r.prototype.getCodewordsRemaining=function(t){return this.getMinSymbolSize(t)-t},r.getBytes=function(t,e){var n=new Uint8Array(e?2:1);return n[0]=t,e&&(n[1]=e),n},r.prototype.setC40Word=function(t,e,n,o,i){var a=1600*(255&n)+40*(255&o)+(255&i)+1;t[e]=a/256,t[e+1]=a%256},r.prototype.getX12Value=function(t){return t===13?0:t===42?1:t===62?2:t===32?3:t>=48&&t<=57?t-44:t>=65&&t<=90?t-51:t},r.prototype.getX12Words=function(){if(this.characterLength%3!=0)throw new Error("X12 words must be a multiple of 3");for(var t=new Uint8Array(this.characterLength/3*2),e=0;e=33&&n<=47?n-33:n>=48&&n<=57?n-44:n>=58&&n<=64?n-43:n>=65&&n<=90?n-64:n>=91&&n<=95?n-69:n===96?0:n>=97&&n<=122?n-83:n>=123&&n<=127?n-96:n},r.prototype.getC40Words=function(t,e){for(var n=[],o=0;o>16&255,e[i+1]=u>>8&255,e[i+2]=255&u}return e},r.prototype.getLatchBytes=function(){switch(this.getPreviousMode()){case b.ASCII:case b.B256:switch(this.mode){case b.B256:return r.getBytes(231);case b.C40:return r.getBytes(230);case b.TEXT:return r.getBytes(239);case b.X12:return r.getBytes(238);case b.EDF:return r.getBytes(240)}break;case b.C40:case b.TEXT:case b.X12:if(this.mode!==this.getPreviousMode())switch(this.mode){case b.ASCII:return r.getBytes(254);case b.B256:return r.getBytes(254,231);case b.C40:return r.getBytes(254,230);case b.TEXT:return r.getBytes(254,239);case b.X12:return r.getBytes(254,238);case b.EDF:return r.getBytes(254,240)}break;case b.EDF:if(this.mode!==b.EDF)throw new Error("Cannot switch from EDF to "+this.mode)}return new Uint8Array(0)},r.prototype.getDataBytes=function(){switch(this.mode){case b.ASCII:return this.input.isECI(this.fromPosition)?r.getBytes(241,this.input.getECIValue(this.fromPosition)+1):pt.isExtendedASCII(this.input.charAt(this.fromPosition),this.input.getFNC1Character())?r.getBytes(235,this.input.charAt(this.fromPosition)-127):this.characterLength===2?r.getBytes(10*this.input.charAt(this.fromPosition)+this.input.charAt(this.fromPosition+1)+130):this.input.isFNC1(this.fromPosition)?r.getBytes(232):r.getBytes(this.input.charAt(this.fromPosition)+1);case b.B256:return r.getBytes(this.input.charAt(this.fromPosition));case b.C40:return this.getC40Words(!0,this.input.getFNC1Character());case b.TEXT:return this.getC40Words(!1,this.input.getFNC1Character());case b.X12:return this.getX12Words();case b.EDF:return this.getEDFBytes()}},r}(),ia=function(r){function t(e,n,o,i,a){var s=r.call(this,e,n,o)||this;return s.shape=i,s.macroId=a,s}return ta(t,r),t.prototype.getMacroId=function(){return this.macroId},t.prototype.getShapeHint=function(){return this.shape},t}($i),Na=function(){function r(){}return r.prototype.encode=function(t,e,n,o,i){if(i===void 0&&(i=null),t.trim()==="")throw new Error("Found empty contents");if(e!==D.DATA_MATRIX)throw new Error("Can only encode DATA_MATRIX, but got "+e);if(n<0||o<0)throw new Error("Requested dimensions can't be negative: "+n+"x"+o);var a,s=0,u=null,c=null;if(i!=null){var f=i.get(j.DATA_MATRIX_SHAPE);f!=null&&(s=f);var h=i.get(j.MIN_SIZE);h!=null&&(u=h);var l=i.get(j.MAX_SIZE);l!=null&&(c=l)}if(i!=null&&i.has(j.DATA_MATRIX_COMPACT)&&i.get(j.DATA_MATRIX_COMPACT).toString()){var d=i.has(j.GS1_FORMAT)&&!!i.get(j.GS1_FORMAT).toString(),p=null;i.has(j.CHARACTER_SET)&&(p=Ue.forName(i.get(j.CHARACTER_SET).toString())),a=pt.encodeHighLevel(t,p,d?29:-1,s)}else{var y=i!=null&&i.has(j.FORCE_C40)&&!!i.get(j.FORCE_C40).toString();a=L.encodeHighLevel(t,s,u,c,y)}var C=H.lookup(a.length,s,u,c,!0),w=ki.encodeECC200(a,C),v=new Fi(w,C.getSymbolDataWidth(),C.getSymbolDataHeight());return v.place(),this.encodeLowLevel(v,C,n,o)},r.prototype.encodeLowLevel=function(t,e,n,o){for(var i=e.getSymbolDataWidth(),a=e.getSymbolDataHeight(),s=new Lr(e.getSymbolWidth(),e.getSymbolHeight()),u=0,c=0;c"},t}(sa),ca=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},r(t,e)};return function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),fa=function(r){function t(e,n,o){var i=r.call(this,e,0,0)||this;return i.binaryShiftStart=n,i.binaryShiftByteCount=o,i}return ca(t,r),t.prototype.appendTo=function(e,n){for(var o=0;o62?e.appendBits(this.binaryShiftByteCount-31,16):o===0?e.appendBits(Math.min(this.binaryShiftByteCount,31),5):e.appendBits(this.binaryShiftByteCount-31,5)),e.appendBits(n[this.binaryShiftStart+o],8)},t.prototype.addBinaryShift=function(e,n){return new t(this,e,n)},t.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"},t}(Ge);function Xt(r,t,e){return new Ge(r,t,e)}var ha=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],la=new Ge(null,0,0),Ce=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])],da=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Hr=function(r){var t,e;try{for(var n=da(r),o=n.next();!o.done;o=n.next()){var i=o.value;$.fill(i,-1)}}catch(a){t={error:a}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return r[0][4]=0,r[1][4]=0,r[1][0]=28,r[3][4]=0,r[2][4]=0,r[2][0]=15,r}($.createInt32Array(6,6)),pa=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ga=function(){function r(t,e,n,o){this.token=t,this.mode=e,this.binaryShiftByteCount=n,this.bitCount=o}return r.prototype.getMode=function(){return this.mode},r.prototype.getToken=function(){return this.token},r.prototype.getBinaryShiftByteCount=function(){return this.binaryShiftByteCount},r.prototype.getBitCount=function(){return this.bitCount},r.prototype.latchAndAppend=function(t,e){var n=this.bitCount,o=this.token;if(t!==this.mode){var i=Ce[this.mode][t];o=Xt(o,65535&i,i>>16),n+=i>>16}var a=t===2?4:5;return new r(o=Xt(o,e,a),t,0,n+a)},r.prototype.shiftAndAppend=function(t,e){var n=this.token,o=this.mode===2?4:5;return n=Xt(n,Hr[this.mode][t],o),new r(n=Xt(n,e,5),this.mode,0,this.bitCount+o+5)},r.prototype.addBinaryShiftChar=function(t){var e=this.token,n=this.mode,o=this.bitCount;if(this.mode===4||this.mode===2){var i=Ce[n][0];e=Xt(e,65535&i,i>>16),o+=i>>16,n=0}var a=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,s=new r(e,n,this.binaryShiftByteCount+1,o+a);return s.binaryShiftByteCount===2078&&(s=s.endBinaryShift(t+1)),s},r.prototype.endBinaryShift=function(t){if(this.binaryShiftByteCount===0)return this;var e=this.token;return new r(e=function(n,o,i){return new fa(n,o,i)}(e,t-this.binaryShiftByteCount,this.binaryShiftByteCount),this.mode,0,this.bitCount)},r.prototype.isBetterThanOrEqualTo=function(t){var e=this.bitCount+(Ce[this.mode][t.mode]>>16);return this.binaryShiftByteCountt.binaryShiftByteCount&&t.binaryShiftByteCount>0&&(e+=10),e<=t.bitCount},r.prototype.toBitArray=function(t){for(var e,n,o=[],i=this.endBinaryShift(t.length).token;i!==null;i=i.getPrevious())o.unshift(i);var a=new st;try{for(var s=pa(o),u=s.next();!u.done;u=s.next())u.value.appendTo(a,t)}catch(c){e={error:c}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return a},r.prototype.toString=function(){return F.format("%s bits=%d bytes=%d",ha[this.mode],this.bitCount,this.binaryShiftByteCount)},r.calculateBinaryShiftCost=function(t){return t.binaryShiftByteCount>62?21:t.binaryShiftByteCount>31?20:t.binaryShiftByteCount>0?10:0},r.INITIAL_STATE=new r(la,0,0,0),r}(),ve=function(r){var t=F.getCharCode(" "),e=F.getCharCode("."),n=F.getCharCode(",");r[0][t]=1;for(var o=F.getCharCode("Z"),i=F.getCharCode("A"),a=i;a<=o;a++)r[0][a]=a-i+2;r[1][t]=1;var s=F.getCharCode("z"),u=F.getCharCode("a");for(a=u;a<=s;a++)r[1][a]=a-u+2;r[2][t]=1;var c=F.getCharCode("9"),f=F.getCharCode("0");for(a=f;a<=c;a++)r[2][a]=a-f+2;r[2][n]=12,r[2][e]=13;for(var h=["\0"," ","","","","","","","\x07","\b"," ",` +`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~","\x7F"],l=0;l","?","[","]","{","}"];for(l=0;l0&&(r[4][F.getCharCode(d[l])]=l);return r}($.createInt32Array(5,256)),re=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},ya=function(){function r(t){this.text=t}return r.prototype.encode=function(){for(var t=F.getCharCode(" "),e=F.getCharCode(` +`),n=Er.singletonList(ga.INITIAL_STATE),o=0;o0?(n=r.updateStateListForPair(n,o,i),o++):n=this.updateStateListForChar(n,o)}return Er.min(n,function(s,u){return s.getBitCount()-u.getBitCount()}).toBitArray(this.text)},r.prototype.updateStateListForChar=function(t,e){var n,o,i=[];try{for(var a=re(t),s=a.next();!s.done;s=a.next()){var u=s.value;this.updateStateForChar(u,e,i)}}catch(c){n={error:c}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}return r.simplifyStates(i)},r.prototype.updateStateForChar=function(t,e,n){for(var o=255&this.text[e],i=ve[t.getMode()][o]>0,a=null,s=0;s<=4;s++){var u=ve[s][o];if(u>0){if(a==null&&(a=t.endBinaryShift(e)),!i||s===t.getMode()||s===2){var c=a.latchAndAppend(s,u);n.push(c)}if(!i&&Hr[t.getMode()][s]>=0){var f=a.shiftAndAppend(s,u);n.push(f)}}}if(t.getBinaryShiftByteCount()>0||ve[t.getMode()][o]===0){var h=t.addBinaryShiftChar(e);n.push(h)}},r.updateStateListForPair=function(t,e,n){var o,i,a=[];try{for(var s=re(t),u=s.next();!u.done;u=s.next()){var c=u.value;this.updateStateForPair(c,e,n,a)}}catch(f){o={error:f}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return this.simplifyStates(a)},r.updateStateForPair=function(t,e,n,o){var i=t.endBinaryShift(e);if(o.push(i.latchAndAppend(4,n)),t.getMode()!==4&&o.push(i.shiftAndAppend(4,n)),n===3||n===4){var a=i.latchAndAppend(2,16-n).latchAndAppend(2,1);o.push(a)}if(t.getBinaryShiftByteCount()>0){var s=t.addBinaryShiftChar(e).addBinaryShiftChar(e+1);o.push(s)}},r.simplifyStates=function(t){var e,n,o,i,a=[];try{for(var s=re(t),u=s.next();!u.done;u=s.next()){var c=u.value,f=!0,h=function(p){if(p.isBetterThanOrEqualTo(c))return f=!1,"break";c.isBetterThanOrEqualTo(p)&&(a=a.filter(function(y){return y!==p}))};try{for(var l=(o=void 0,re(a)),d=l.next();!d.done&&h(d.value)!=="break";d=l.next());}catch(p){o={error:p}}finally{try{d&&!d.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}f&&a.push(c)}}catch(p){e={error:p}}finally{try{u&&!u.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}return a},r}(),wa=function(r){var t=typeof Symbol=="function"&&Symbol.iterator,e=t&&r[t],n=0;if(e)return e.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},Ae=function(){function r(){}return r.encodeBytes=function(t){return r.encode(t,r.DEFAULT_EC_PERCENT,r.DEFAULT_AZTEC_LAYERS)},r.encode=function(t,e,n){var o,i,a,s,u,c=new ya(t).encode(),f=P.truncDivision(c.getSize()*e,100)+11,h=c.getSize()+f;if(n!==r.DEFAULT_AZTEC_LAYERS){if(o=n<0,(i=Math.abs(n))>(o?r.MAX_NB_BITS_COMPACT:r.MAX_NB_BITS))throw new N(F.format("Illegal value %s for layers",n));var l=(a=r.totalBitsInLayer(i,o))-a%(s=r.WORD_SIZE[i]);if((u=r.stuffBits(c,s)).getSize()+f>l)throw new N("Data to large for user specified layer");if(o&&u.getSize()>64*s)throw new N("Data to large for user specified layer")}else{s=0,u=null;for(var d=0;;d++){if(d>r.MAX_NB_BITS)throw new N("Data too large for an Aztec code");if(i=(o=d<=3)?d+1:d,!(h>(a=r.totalBitsInLayer(i,o)))&&(u!=null&&s===r.WORD_SIZE[i]||(s=r.WORD_SIZE[i],u=r.stuffBits(c,s)),l=a-a%s,!(o&&u.getSize()>64*s)&&u.getSize()+f<=l))break}}var p,y=r.generateCheckWords(u,a,s),C=u.getSize()/s,w=r.generateModeMessage(o,i,C),v=(o?11:14)+4*i,_=new Int32Array(v);if(o)for(p=v,d=0;d<_.length;d++)_[d]=d;else{p=v+1+2*P.truncDivision(P.truncDivision(v,2)-1,15);var m=P.truncDivision(v,2),I=P.truncDivision(p,2);for(d=0;d=o||t.get(a+u))&&(s|=1<