balena-sdk
Version:
The Balena JavaScript SDK
1 lines • 509 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.balenaSdk=t():e.balenaSdk=t()}(self,()=>(()=>{var e={34(e,t,r){"use strict";t.APIKey=void 0;const n=r(9121);t.APIKey=class{constructor(e){this.type=n.TokenType.APIKey,this.isValid=()=>!0,this.getAge=()=>0,this.isExpired=()=>!1,this.get2FAStatus=()=>"not_required",this.key=e}}},4488(e,t,r){"use strict";t.TokenType=void 0;const n=r(1635),i=r(4786);const o=r(5809),a=r(34),s=r(9157);var l=r(9121);Object.defineProperty(t,"TokenType",{enumerable:!0,get:function(){return l.TokenType}});t.Ay=class{constructor({dataDirectory:e,tokenKey:t="token"}={}){this.setKey=e=>n.__awaiter(this,void 0,void 0,function*(){return this.token=this.createToken(e),this.storage.set(this.tokenKey,e)}),this.hasKey=()=>this.storage.has(this.tokenKey),this.removeKey=()=>(this.token=void 0,this.storage.remove(this.tokenKey)),this.getType=()=>n.__awaiter(this,void 0,void 0,function*(){return(yield this.getToken()).type}),this.getKey=()=>n.__awaiter(this,void 0,void 0,function*(){return(yield this.getToken()).key}),this.getAge=()=>n.__awaiter(this,void 0,void 0,function*(){return(yield this.getToken()).getAge()}),this.isExpired=()=>n.__awaiter(this,void 0,void 0,function*(){return(yield this.getToken()).isExpired()}),this.isValid=()=>n.__awaiter(this,void 0,void 0,function*(){return(yield this.getToken()).isValid()}),this.get2FAStatus=()=>n.__awaiter(this,void 0,void 0,function*(){return(yield this.getToken()).get2FAStatus()}),this.needs2FA=()=>n.__awaiter(this,void 0,void 0,function*(){return"pending"===(yield this.get2FAStatus())}),this.createToken=e=>{const t=s.JWT.isValid(e)?new s.JWT(e):new a.APIKey(e);if(!t.isValid())throw new i.BalenaMalformedToken(e);if(t.isExpired())throw new i.BalenaExpiredToken(e);return t},this.getToken=()=>n.__awaiter(this,void 0,void 0,function*(){if(this.token)return this.token;const e=yield this.storage.get(this.tokenKey);if("string"!=typeof e)throw new i.BalenaMalformedToken(e);return this.token=this.createToken(e),this.token}),this.storage=(0,o.getStorage)({dataDirectory:e}),this.tokenKey=t}}},9157(e,t,r){"use strict";t.JWT=void 0;const n=r(6765),i=r(9121);class o{static parse(e){return(0,n.default)(e.trim())}static isValid(e){try{return this.parse(e),!0}catch(e){return!1}}constructor(e){this.type=i.TokenType.JWT,this.isValid=()=>o.isValid(this.key),this.getAge=()=>{const{iat:e}=o.parse(this.key);return e?Date.now()-1e3*e:void 0},this.isExpired=()=>{const{exp:e}=o.parse(this.key);return!!e&&Date.now()>1e3*e},this.get2FAStatus=()=>{const{twoFactorRequired:e}=o.parse(this.key);return null==e?"not_required":e?"pending":"passed"},this.key=e}}t.JWT=o},9121(e,t){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenType=void 0,function(e){e[e.JWT=0]="JWT",e[e.APIKey=1]="APIKey"}(r||(t.TokenType=r={}))},4786(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BalenaInvalidParameterError=t.BalenaNotLoggedIn=t.BalenaRequestError=t.BalenaKeyNotFound=t.BalenaAmbiguousRelease=t.BalenaAmbiguousApplication=t.BalenaAmbiguousDevice=t.BalenaOrganizationNotFound=t.BalenaDeviceNotFound=t.BalenaServiceNotFound=t.BalenaImageNotFound=t.BalenaApplicationMembershipRoleNotFound=t.BalenaOrganizationMembershipRoleNotFound=t.BalenaReleaseNotFound=t.BalenaApplicationNotFound=t.BalenaExpiredToken=t.BalenaSupervisorLockedError=t.BalenaSettingsPermissionError=t.BalenaMalformedToken=t.BalenaDiscontinuedDeviceType=t.BalenaInvalidDeviceType=t.BalenaInvalidLoginCredentials=t.BalenaTooManyRequests=t.BalenaError=void 0;const n=r(4723);class i extends n.TypedError{}t.BalenaError=i,i.prototype.code="BalenaError",i.prototype.exitCode=1;class o extends i{constructor(e){super(`Too Many Requests. Try again ${e||"later"}`),this.nextValidRequestDate=e}}t.BalenaTooManyRequests=o,o.prototype.code="BalenaTooManyRequests";class a extends i{constructor(){super("Invalid login credentials")}}t.BalenaInvalidLoginCredentials=a,a.prototype.code="BalenaInvalidLoginCredentials";class s extends i{constructor(e){super(`Invalid device type: ${e}`),this.type=e}}t.BalenaInvalidDeviceType=s,s.prototype.code="BalenaInvalidDeviceType";class l extends s{constructor(e){super(`Discontinued device type: ${e}`),this.type=e}}t.BalenaDiscontinuedDeviceType=l,l.prototype.code="BalenaDiscontinuedDeviceType";class c extends i{constructor(e){super("Malformed token"),this.token=e}}t.BalenaMalformedToken=c,c.prototype.code="BalenaMalformedToken";class u extends i{}t.BalenaSettingsPermissionError=u,u.prototype.code="BalenaSettingsPermissionError";class p extends i{constructor(e){super("Supervisor locked"),this.token=e}}t.BalenaSupervisorLockedError=p,p.prototype.code="BalenaSupervisorLockedError";class f extends i{constructor(e){super("The token expired"),this.token=e}}t.BalenaExpiredToken=f,f.prototype.code="BalenaExpiredToken";class d extends i{constructor(e){super(`Application not found: ${e}`),this.application=e}}t.BalenaApplicationNotFound=d,d.prototype.code="BalenaApplicationNotFound";class h extends i{constructor(e){super(`Release not found: ${e}`),this.release=e}}t.BalenaReleaseNotFound=h,h.prototype.code="BalenaReleaseNotFound";class y extends i{constructor(e){super(`Organization membership role not found: ${e}`),this.organizationMembershipRole=e}}t.BalenaOrganizationMembershipRoleNotFound=y,y.prototype.code="BalenaOrganizationMembershipRoleNotFound";class g extends i{constructor(e){super(`Application membership role not found: ${e}`),this.applicationMembershipRole=e}}t.BalenaApplicationMembershipRoleNotFound=g,g.prototype.code="BalenaApplicationMembershipRoleNotFound";class m extends i{constructor(e){super(`Image not found: ${e}`),this.image=e}}t.BalenaImageNotFound=m,m.prototype.code="BalenaImageNotFound";class b extends i{constructor(e){super(`Service not found: ${e}`),this.service=e}}t.BalenaServiceNotFound=b,b.prototype.code="BalenaServiceNotFound";class v extends i{constructor(e){super(`Device not found: ${e}`),this.device=e}}t.BalenaDeviceNotFound=v,v.prototype.code="BalenaDeviceNotFound";class w extends i{constructor(e){super(`Organization not found: ${e}`),this.organization=e}}t.BalenaOrganizationNotFound=w,w.prototype.code="BalenaOrganizationNotFound";class _ extends i{constructor(e){super(`Device is ambiguous: ${e}`),this.device=e}}t.BalenaAmbiguousDevice=_,_.prototype.code="BalenaAmbiguousDevice";class E extends i{constructor(e){super(`Application is ambiguous: ${e}`),this.application=e}}t.BalenaAmbiguousApplication=E,E.prototype.code="BalenaAmbiguousApplication";class S extends i{constructor(e){super(`Release is ambiguous: There are multiple releases matching the release hash '${e}'`),this.release=e}}t.BalenaAmbiguousRelease=S,S.prototype.code="BalenaAmbiguousRelease";class O extends i{constructor(e){super(`Key not found: ${e}`)}}t.BalenaKeyNotFound=O,O.prototype.code="BalenaKeyNotFound";class A extends i{constructor(e,t,r,n){super(`Request error: ${e}`),this.body=e,this.statusCode=t,this.requestOptions=r,this.responseHeaders=n}}t.BalenaRequestError=A,A.prototype.code="BalenaRequestError";class R extends i{constructor(){super("You have to log in")}}t.BalenaNotLoggedIn=R,R.prototype.code="BalenaNotLoggedIn";class x extends i{constructor(e,t){super(`Invalid parameter: ${t} is not a valid value for parameter '${e}'`),this.parameterName=e,this.suppliedValue=t}}t.BalenaInvalidParameterError=x,x.prototype.code="BalenaInvalidParameterError"},1285(e,t,r){"use strict";t.Ki=void 0;const n=r(1635),i=r(3235),o=r(4723);t.Ki=({request:e})=>({generateUniqueKey:()=>(0,i.v4)().replace(/-/g,""),register(t){return n.__awaiter(this,void 0,void 0,function*(){for(const e of["applicationId","uuid","deviceType","provisioningApiKey","apiEndpoint"])if(null==t[e])throw new Error(`Options must contain a '${e}' entry.`);const r=yield e.send({method:"POST",baseUrl:t.apiEndpoint,url:"/device/register",refreshToken:!1,sendToken:!1,headers:{Authorization:`Bearer ${t.provisioningApiKey}`},timeout:3e4,body:{user:t.userId,application:t.applicationId,uuid:t.uuid,device_type:t.deviceType,api_key:t.deviceApiKey,supervisor_version:t.supervisorVersion,os_version:t.osVersion,os_variant:t.osVariant,mac_address:t.macAddress}});if(201!==r.statusCode)throw new a(r.body,r);return r.body})}});class a extends o.TypedError{constructor(e="Error with API request",t){super(e),this.response=t}}},5809(e,t,r){"use strict";t.getStorage=void 0;const n=r(2805),i=r(6137),o=r(9646);t.getStorage=e=>{const t=!1!==(null==e?void 0:e.dataDirectory)&&n.isSupported()?n.createStorage(null==e?void 0:e.dataDirectory):i.createStore();return(0,o.getStorage)(t)}},9646(e,t,r){"use strict";t.getStorage=void 0;const n=r(4786);t.getStorage=e=>{const t=async t=>{try{const r=await e.getItem(t);if(null==r)return;if(/^-?\d+\.?\d*$/.test(r))return parseFloat(r);try{return JSON.parse(r)}catch{}return r}catch(e){if("EACCES"===e.code)throw new n.BalenaSettingsPermissionError(e);return}};return{set:async(t,r)=>("string"!=typeof r&&(r=JSON.stringify(r)),e.setItem(t,r)),get:t,has:async e=>null!=await t(e),remove:async t=>e.removeItem(t),clear:async()=>e.clear()}}},2805(e,t){"use strict";t.createStorage=t.isSupported=void 0;const r=e=>`balena-${e}`;t.isSupported=()=>"undefined"!=typeof window&&((e,t)=>{let r,n;try{r=e[t]}catch{return!1}const i=`__${Math.round(1e7*Math.random())}`;try{r.setItem(i,i),n=r.getItem(i)===i,r.removeItem(i)}catch{return!1}return n})(window,"localStorage");t.createStorage=()=>({getItem:e=>localStorage.getItem(r(e)),setItem(e,t){localStorage.setItem(r(e),t)},removeItem(e){localStorage.removeItem(r(e))},clear(){localStorage.clear()}})},6137(e,t){"use strict";t.createStore=void 0;t.createStore=()=>{let e=Object.create(null);return{getItem:t=>Object.prototype.hasOwnProperty.call(e,t)?e[t]:null,setItem(t,r){e[t]=r},removeItem(t){delete e[t]},clear(){e={}}}}},7526(e,t){"use strict";t.toByteArray=function(e){var t,r,o=s(e),a=o[0],l=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,l)),u=0,p=l>0?a-4:a;for(r=0;r<p;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t);1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,l=n-i;s<l;s+=a)o.push(c(e,s,s+a>l?l:s+a));1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(l(n));return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8287(e,t,r){"use strict";const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function s(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return p(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=s(r);const i=n.write(e,t);i!==r&&(n=n.slice(0,i));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Y(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Y(e,ArrayBuffer)||e&&Y(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(e,SharedArrayBuffer)||e&&Y(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);const i=function(e){if(l.isBuffer(e)){const t=0|h(e.length),r=s(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||J(e.length)?s(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function p(e){return u(e),s(e<0?0:0|h(e))}function f(e){const t=e.length<0?0:0|h(e.length),r=s(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,l.prototype),n}function h(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Y(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return R(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return $(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){let o,a=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+l>s&&(r=s-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(J(n))return a;e[r+a]=n}return a}function _(e,t,r,n){return G(z(t,e.length-r),e,r,n)}function E(e,t,r,n){return G(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return G(K(t),e,r,n)}function O(e,t,r,n){return G(function(e,t){let r,n,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function R(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,s,l;switch(a){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(o=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(e){const t=e.length;if(t<=x)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=x));return r}(n)}t.kMaxLength=a,l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?s(e):void 0!==t?"string"==typeof r?s(e).fill(t,r):s(e).fill(t):s(e)}(e,t,r)},l.allocUnsafe=function(e){return p(e)},l.allocUnsafeSlow=function(e){return p(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(Y(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),Y(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=l.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Y(t,Uint8Array))i+t.length>n.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},l.byteLength=y,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?R(this,0,e):g.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if(Y(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(o,a),c=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<s;++e)if(c[e]!==u[e]){o=c[e],a=u[e];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return S(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function k(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function $(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function P(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=X[e[n]];return i}function T(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function I(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,r,n,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n,i){q(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function M(e,t,r,n,i){q(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function C(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||I(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=Q(function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),l.prototype.readBigUInt64BE=Q(function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||I(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||I(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||I(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||I(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||I(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=Q(function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),l.prototype.readBigInt64BE=Q(function(e){W(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||H(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||I(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||I(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||I(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||I(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){j(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){j(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=Q(function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=Q(function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let i=0,o=1,a=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o|0)-a&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=Q(function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=Q(function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return C(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return C(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=l.isBuffer(e)?e:l.from(e,n),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%a]}return this};const D={};function U(e,t,r){D[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function F(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function q(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new D.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){W(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||H(t,e.length-(r+1))}(n,i,o)}function W(e,t){if("number"!=typeof e)throw new D.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,r){if(Math.floor(e)!==e)throw W(e,r),new D.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),U("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=F(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);const V=/[^+/0-9A-Za-z-_]/g;function z(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function K(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Y(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Q(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},3144(e,t,r){"use strict";var n=r(6743),i=r(8621),o=r(76),a=r(7119);e.exports=a||n.call(o,i)},2205(e,t,r){"use strict";var n=r(6743),i=r(8621),o=r(3144);e.exports=function(){return o(n,i,arguments)}},8621(e){"use strict";e.exports=Function.prototype.apply},76(e){"use strict";e.exports=Function.prototype.call},3126(e,t,r){"use strict";var n=r(6743),i=r(9675),o=r(76),a=r(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return a(n,o,e)}},7119(e){"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},487(e,t,r){"use strict";var n=r(6897),i=r(655),o=r(3126),a=r(2205);e.exports=function(e){var t=o(arguments),r=1+e.length-(arguments.length-1);return n(t,r>0?r:0,!0)},i?i(e.exports,"apply",{value:a}):e.exports.apply=a},6556(e,t,r){"use strict";var n=r(453),i=r(3126),o=i([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i([r]):r}},5622(e,t,r){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(8287).Buffer.isBuffer},8263(e,t,r){"use strict";var n=r(8175),i=r(6873),o=r(6596),a=r(148),s=r(214),l=e.exports=function(e,t){var r,i,l,c,u;return arguments.length<2||"string"!=typeof e?(c=t,t=e,e=null):c=arguments[2],n(e)?(r=s.call(e,"c"),i=s.call(e,"e"),l=s.call(e,"w")):(r=l=!0,i=!1),u={value:t,configurable:r,enumerable:i,writable:l},c?o(a(c),u):u};l.gs=function(e,t,r){var l,c,u,p;return"string"!=typeof e?(u=r,r=t,t=e,e=null):u=arguments[3],n(t)?i(t)?n(r)?i(r)||(u=r,r=void 0):r=void 0:(u=t,t=r=void 0):t=void 0,n(e)?(l=s.call(e,"c"),c=s.call(e,"e")):(l=!0,c=!1),p={get:t,set:r,configurable:l,enumerable:c},u?o(a(u),p):p}},41(e,t,r){"use strict";var n=r(655),i=r(8068),o=r(9675),a=r(5795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new o("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],p=!!a&&a(e,t);if(n)n(e,t,{configurable:null===c&&p?p.configurable:!c,enumerable:null===s&&p?p.enumerable:!s,value:r,writable:null===l&&p?p.writable:!l});else{if(!u&&(s||l||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},7176(e,t,r){"use strict";var n,i=r(3126),o=r(5795);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var a=!!n&&o&&o(Object.prototype,"__proto__"),s=Object,l=s.getPrototypeOf;e.exports=a&&"function"==typeof a.get?i([a.get]):"function"==typeof l&&function(e){return l(null==e?e:s(e))}},655(e){"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},1237(e){"use strict";e.exports=EvalError},9383(e){"use strict";e.exports=Error},9290(e){"use strict";e.exports=RangeError},9538(e){"use strict";e.exports=ReferenceError},8068(e){"use strict";e.exports=SyntaxError},9675(e){"use strict";e.exports=TypeError},5345(e){"use strict";e.exports=URIError},9612(e){"use strict";e.exports=Object},7910(e,t,r){"use strict";var n=r(4295),i=r(2665),o=r(7134),a=Array.prototype.indexOf,s=Object.prototype.hasOwnProperty,l=Math.abs,c=Math.floor;e.exports=function(e){var t,r,u,p;if(!n(e))return a.apply(this,arguments);for(r=i(o(this).length),u=arguments[1],t=u=isNaN(u)?0:u>=0?c(u):i(this.length)-c(l(u));t<r;++t)if(s.call(this,t)&&(p=this[t],n(p)))return t;return-1}},4645(e,t,r){"use strict";e.exports=r(3916)()?Array.from:r(5552)},3916(e){"use strict";e.exports=function(){var e,t,r=Array.from;return"function"==typeof r&&(t=r(e=["raz","dwa"]),Boolean(t&&t!==e&&"dwa"===t[1]))}},5552(e,t,r){"use strict";var n=r(2380).iterator,i=r(8746),o=r(2840),a=r(2665),s=r(5499),l=r(7134),c=r(9762),u=r(3748),p=Array.isArray,f=Function.prototype.call,d={configurable:!0,enumerable:!0,writable:!0,value:null},h=Object.defineProperty;e.exports=function(e){var t,r,y,g,m,b,v,w,_,E,S=arguments[1],O=arguments[2];if(e=Object(l(e)),c(S)&&s(S),this&&this!==Array&&o(this))t=this;else{if(!S){if(i(e))return 1!==(m=e.length)?Array.apply(null,e):((g=new Array(1))[0]=e[0],g);if(p(e)){for(g=new Array(m=e.length),r=0;r<m;++r)g[r]=e[r];return g}}g=[]}if(!p(e))if(void 0!==(_=e[n])){for(v=s(_).call(e),t&&(g=new t),w=v.next(),r=0;!w.done;)E=S?f.call(S,O,w.value,r):w.value,t?(d.value=E,h(g,r,d)):g[r]=E,w=v.next(),++r;m=r}else if(u(e)){for(m=e.length,t&&(g=new t),r=0,y=0;r<m;++r)E=e[r],r+1<m&&(b=E.charCodeAt(0))>=55296&&b<=56319&&(E+=e[++r]),E=S?f.call(S,O,E,y):E,t?(d.value=E,h(g,y,d)):g[y]=E,++y;m=y}if(void 0===m)for(m=a(e.length),t&&(g=new t(m)),r=0;r<m;++r)E=S?f.call(S,O,e[r],r):e[r],t?(d.value=E,h(g,r,d)):g[r]=E;return t&&(d.value=null,g.length=m),g}},7391(e,t,r){"use strict";var n=r(4645),i=Array.isArray;e.exports=function(e){return i(e)?e:n(e)}},3484(e,t,r){"use strict";var n=r(6596),i=r(3052),o=r(9762),a=Error.captureStackTrace;e.exports=function(t){var r=new Error(t),s=arguments[1],l=arguments[2];return o(l)||i(s)&&(l=s,s=null),o(l)&&n(r,l),o(s)&&(r.code=s),a&&a(r,e.exports),r}},5378(e,t,r){"use strict";var n,i,o,a,s,l=r(2665),c=function(e,t){return t};try{Object.defineProperty(c,"length",{configurable:!0,writable:!1,enumerable:!1,value:1})}catch(e){}1===c.length?(n={configurable:!0,writable:!1,enumerable:!1},i=Object.defineProperty,e.exports=function(e,t){return t=l(t),e.length===t?e:(n.value=t,i(e,"length",n))}):(a=r(6069),s=[],o=function(e){var t,r=0;if(s[e])return s[e];for(t=[];e--;)t.push("a"+(++r).toString(36));return new Function("fn","return function ("+t.join(", ")+") { return fn.apply(this, arguments); };")},e.exports=function(e,t){var r;if(t=l(t),e.length===t)return e;r=o(t)(e);try{a(r,e)}catch(e){}return r})},8746(e){"use strict";var t=Object.prototype.toString,r=t.call(function(){return arguments}());e.exports=function(e){return t.call(e)===r}},2840(e){"use strict";var t=Object.prototype.toString,r=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(e){return"function"==typeof e&&r(t.call(e))}},6011(e){"use strict";e.exports=function(){}},9911(e,t,r){"use strict";e.exports=r(2734)()?Math.sign:r(3670)},2734(e){"use strict";e.exports=function(){var e=Math.sign;return"function"==typeof e&&(1===e(10)&&-1===e(-20))}},3670(e){"use strict";e.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}},4295(e,t,r){"use strict";e.exports=r(8686)()?Number.isNaN:r(8454)},8686(e){"use strict";e.exports=function(){var e=Number.isNaN;return"function"==typeof e&&(!e({})&&e(NaN)&&!e(34))}},8454(e){"use strict";e.exports=function(e){return e!=e}},9806(e,t,r){"use strict";var n=r(9911),i=Math.abs,o=Math.floor;e.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?n(e)*o(i(e)):e}},2665(e,t,r){"use strict";var n=r(9806),i=Math.max;e.exports=function(e){return i(0,n(e))}},8191(e,t,r){"use strict";var n=r(5499),i=r(7134),o=Function.prototype.bind,a=Function.prototype.call,s=Object.keys,l=Object.prototype.propertyIsEnumerable;e.exports=function(e,t){return function(r,c){var u,p=arguments[2],f=arguments[3];return r=Object(i(r)),n(c),u=s(r),f&&u.sort("function"==typeof f?o.call(f,r):void 0),"function"!=typeof e&&(e=u[e]),a.call(e,u,function(e,n){return l.call(r,e)?a.call(c,p,r[e],e,r,n):t})}}},6596(e,t,r){"use strict";e.exports=r(5339)()?Object.assign:r(3595)},5339(e){"use strict";e.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},3595(e,t,r){"use strict";var n=r(2093),i=r(7134),o=Math.max;e.exports=function(e,t){var r,a,s,l=o(arguments.length,2);for(e=Object(i(e)),s=function(n){try{e[n]=t[n]}catch(e){r||(r=e)}},a=1;a<l;++a)n(t=arguments[a]).forEach(s);if(void 0!==r)throw r;return e}},5921(e,t,r){"use strict";e.exports=r(8191)("forEach")},9575(e){"use strict";e.exports=function(e){return"function"==typeof e}},3052(e,t,r){"use strict";var n=r(9762),i={function:!0,object:!0};e.exports=function(e){return n(e)&&i[typeof e]||!1}},9762(e,t,r){"use strict";var n=r(6011)();e.exports=function(e){return e!==n&&null!==e}},2093(e,t,r){"use strict";e.exports=r(3380)()?Object.keys:r(4232)},3380(e){"use strict";e.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},4232(e,t,r){"use strict";var n=r(9762),i=Object.keys;e.exports=function(e){return i(n(e)?Object(e):e)}},498(e,t,r){"use strict";var n=r(5499),i=r(5921),o=Function.prototype.call;e.exports=function(e,t){var r={},a=arguments[2];return n(t),i(e,function(e,n,i,s){r[n]=o.call(t,a,e,n,i,s)}),r}},6069(e,t,r){"use strict";var n=r(7134),i=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols;e.exports=function(e,t){var r,l=Object(n(t));if(e=Object(n(e)),a(l).forEach(function(n){try{i(e,n,o(t,n))}catch(e){r=e}}),"function"==typeof s&&s(l).forEach(function(n){try{i(e,n,o(t,n))}catch(e){r=e}}),void 0!==r)throw r;return e}},148(e,t,r){"use strict";var n=r(9762),i=Array.prototype.forEach,o=Object.create;e.exports=function(e){var t=o(null);return i.call(arguments,function(e){n(e)&&function(e,t){var r;for(r in e)t[r]=e[r]}(Object(e),t)}),t}},7724(e){"use strict";var t=Array.prototype.forEach,r=Object.create;e.exports=function(e){var n=r(null);return t.call(arguments,function(e){n[e]=!0}),n}},5499(e){"use strict";e.exports=function(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return e}},7134(e,t,r){"use strict";var n=r(9762);e.exports=function(e){if(!n(e))throw new TypeError("Cannot use null or undefined");return e}},7292(e,t,r){"use strict";var n=r(7134),i=r(1484);e.exports=function(e){return i(n(e))}},1484(e,t,r){"use strict";var n=r(9575);e.exports=function(e){try{return e&&n(e.toString)?e.toString():String(e)}catch(e){throw new TypeError("Passed argument cannot be stringifed")}}},1029(e,t,r){"use strict";var n=r(9575);e.exports=function(e){try{return e&&n(e.toString)?e.toString():String(e)}catch(e){return"<Non-coercible to string value>"}}},214(e,t,r){"use strict";e.exports=r(525)()?String.prototype.contains:r(1521)},525(e){"use strict";var t="razdwatrzy";e.exports=function(){return"function"==typeof t.contains&&(!0===t.contains("dwa")&&!1===t.contains("foo"))}},1521(e){"use strict";var t=String.prototype.indexOf;e.exports=function(e){return t.call(this,e,arguments[1])>-1}},3748(e){"use strict";var t=Object.prototype.toString,r=t.call("");e.exports=function(e){return"string"==typeof e||e&&"object"==typeof e&&(e instanceof String||t.call(e)===r)||!1}},9438(e,t,r){"use strict";var n=r(1029),i=/[\n\r\u2028\u2029]/g;e.exports=function(e){var t=n(e);return t.length>100&&(t=t.slice(0,99)+"…"),t=t.replace(i,function(e){return JSON.stringify(e).slice(1,-1)})}},2380(e,t,r){"use strict";e.exports=r(4195)()?r(8209).Symbol:r(6613)},4195(e,t,r){"use strict";var n=r(8209),i={object:!0,symbol:!0};e.exports=function(){var e,t=n.Symbol;if("function"!=typeof t)return!1;e=t("test symbol");try{String(e)}catch(e){return!1}return!!i[typeof t.iterator]&&(!!i[typeof t.toPrimitive]&&!!i[typeof t.toStringTag])}},3055(e){"use strict";e.exports=function(e){return!!e&&("symbol"==typeof e||!!e.constructor&&("Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag]))}},2941(e,t,r){"use strict";var n=r(8263),i=Object.create,o=Object.defineProperty,a=Object.prototype,s=i(null);e.exports=function(e){for(var t,r,i=0;s[e+(i||"")];)++i;return s[e+=i||""]=!0,o(a,t="@@"+e,n.gs(null,function(e){r||(r=!0,o(this,t,n(e)),r=!1)})),t}},3333(e,t,r){"use strict";var n=r(8263),i=r(8209).Symbol;e.exports=function(e){return Object.defineProperties(e,{hasInstance:n("",i&&i.hasInstance||e("hasInstance")),isConcatSpreadable:n("",i&&i.isConcatSpreadable||e("isConcatSpreadable")),iterator:n("",i&&i.iterator||e("iterator")),match:n("",i&&i.match||e("match")),replace:n("",i&&i.replace||e("replace")),search:n("",i&&i.search||e("search")),species:n("",i&&i.species||e("species")),split:n("",i&&i.split||e("split")),toPrimitive:n("",i&&i.toPrimitive||e("toPrimitive")),toStringTag:n("",i&&i.toStringTag||e("toStringTag")),unscopables:n("",i&&i.unscopables||e("unscopables"))})}},8118(e,t,