UNPKG

@ew-did-registry/did-ethr-resolver

Version:

The package resolve CRUD operations on DID Documents

2 lines 91.6 kB
/*! For license information please see index.esm.js.LICENSE.txt */ (()=>{var f={778:(f,t,e)=>{"use strict";var r=e(320);function n(f,t){if(f===t)return 0;for(var e=f.length,r=t.length,n=0,i=Math.min(e,r);n<i;++n)if(f[n]!==t[n]){e=f[n],r=t[n];break}return e<r?-1:r<e?1:0}function i(f){return e.g.Buffer&&"function"==typeof e.g.Buffer.isBuffer?e.g.Buffer.isBuffer(f):!(null==f||!f._isBuffer)}var o=e(485),s=Object.prototype.hasOwnProperty,u=Array.prototype.slice,a="foo"===function(){}.name;function c(f){return Object.prototype.toString.call(f)}function l(f){return!i(f)&&"function"==typeof e.g.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(f):!!f&&(f instanceof DataView||!!(f.buffer&&f.buffer instanceof ArrayBuffer)))}var p=f.exports=v,d=/\s*function\s+([^\(\s]*)\s*/;function y(f){if(o.isFunction(f)){if(a)return f.name;var t=f.toString().match(d);return t&&t[1]}}function h(f,t){return"string"==typeof f?f.length<t?f:f.slice(0,t):f}function b(f){if(a||!o.isFunction(f))return o.inspect(f);var t=y(f);return"[Function"+(t?": "+t:"")+"]"}function g(f,t,e,r,n){throw new p.AssertionError({message:e,actual:f,expected:t,operator:r,stackStartFunction:n})}function v(f,t){f||g(f,!0,t,"==",p.ok)}function m(f,t,e,r){if(f===t)return!0;if(i(f)&&i(t))return 0===n(f,t);if(o.isDate(f)&&o.isDate(t))return f.getTime()===t.getTime();if(o.isRegExp(f)&&o.isRegExp(t))return f.source===t.source&&f.global===t.global&&f.multiline===t.multiline&&f.lastIndex===t.lastIndex&&f.ignoreCase===t.ignoreCase;if(null!==f&&"object"==typeof f||null!==t&&"object"==typeof t){if(l(f)&&l(t)&&c(f)===c(t)&&!(f instanceof Float32Array||f instanceof Float64Array))return 0===n(new Uint8Array(f.buffer),new Uint8Array(t.buffer));if(i(f)!==i(t))return!1;var s=(r=r||{actual:[],expected:[]}).actual.indexOf(f);return-1!==s&&s===r.expected.indexOf(t)||(r.actual.push(f),r.expected.push(t),function(f,t,e,r){if(null==f||null==t)return!1;if(o.isPrimitive(f)||o.isPrimitive(t))return f===t;if(e&&Object.getPrototypeOf(f)!==Object.getPrototypeOf(t))return!1;var n=w(f),i=w(t);if(n&&!i||!n&&i)return!1;if(n)return m(f=u.call(f),t=u.call(t),e);var s,a,c=A(f),l=A(t);if(c.length!==l.length)return!1;for(c.sort(),l.sort(),a=c.length-1;a>=0;a--)if(c[a]!==l[a])return!1;for(a=c.length-1;a>=0;a--)if(!m(f[s=c[a]],t[s],e,r))return!1;return!0}(f,t,e,r))}return e?f===t:f==t}function w(f){return"[object Arguments]"==Object.prototype.toString.call(f)}function E(f,t){if(!f||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(f);try{if(f instanceof t)return!0}catch(f){}return!Error.isPrototypeOf(t)&&!0===t.call({},f)}function O(f,t,e,r){var n;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof e&&(r=e,e=null),n=function(f){var t;try{f()}catch(f){t=f}return t}(t),r=(e&&e.name?" ("+e.name+").":".")+(r?" "+r:"."),f&&!n&&g(n,e,"Missing expected exception"+r);var i="string"==typeof r,s=!f&&n&&!e;if((!f&&o.isError(n)&&i&&E(n,e)||s)&&g(n,e,"Got unwanted exception"+r),f&&n&&e&&!E(n,e)||!f&&n)throw n}p.AssertionError=function(f){this.name="AssertionError",this.actual=f.actual,this.expected=f.expected,this.operator=f.operator,f.message?(this.message=f.message,this.generatedMessage=!1):(this.message=h(b(this.actual),128)+" "+this.operator+" "+h(b(this.expected),128),this.generatedMessage=!0);var t=f.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var e=new Error;if(e.stack){var r=e.stack,n=y(t),i=r.indexOf("\n"+n);if(i>=0){var o=r.indexOf("\n",i+1);r=r.substring(o+1)}this.stack=r}}},o.inherits(p.AssertionError,Error),p.fail=g,p.ok=v,p.equal=function(f,t,e){f!=t&&g(f,t,e,"==",p.equal)},p.notEqual=function(f,t,e){f==t&&g(f,t,e,"!=",p.notEqual)},p.deepEqual=function(f,t,e){m(f,t,!1)||g(f,t,e,"deepEqual",p.deepEqual)},p.deepStrictEqual=function(f,t,e){m(f,t,!0)||g(f,t,e,"deepStrictEqual",p.deepStrictEqual)},p.notDeepEqual=function(f,t,e){m(f,t,!1)&&g(f,t,e,"notDeepEqual",p.notDeepEqual)},p.notDeepStrictEqual=function f(t,e,r){m(t,e,!0)&&g(t,e,r,"notDeepStrictEqual",f)},p.strictEqual=function(f,t,e){f!==t&&g(f,t,e,"===",p.strictEqual)},p.notStrictEqual=function(f,t,e){f===t&&g(f,t,e,"!==",p.notStrictEqual)},p.throws=function(f,t,e){O(!0,f,t,e)},p.doesNotThrow=function(f,t,e){O(!1,f,t,e)},p.ifError=function(f){if(f)throw f},p.strict=r((function f(t,e){t||g(t,!0,e,"==",f)}),p,{equal:p.strictEqual,deepEqual:p.deepStrictEqual,notEqual:p.notStrictEqual,notDeepEqual:p.notDeepStrictEqual}),p.strict.strict=p.strict;var A=Object.keys||function(f){var t=[];for(var e in f)s.call(f,e)&&t.push(e);return t}},147:f=>{"function"==typeof Object.create?f.exports=function(f,t){f.super_=t,f.prototype=Object.create(t.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}})}:f.exports=function(f,t){f.super_=t;var e=function(){};e.prototype=t.prototype,f.prototype=new e,f.prototype.constructor=f}},819:f=>{f.exports=function(f){return f&&"object"==typeof f&&"function"==typeof f.copy&&"function"==typeof f.fill&&"function"==typeof f.readUInt8}},485:(f,t,e)=>{var r=e(406),n=e(716),i=/%[sdj%]/g;t.format=function(f){if(!v(f)){for(var t=[],e=0;e<arguments.length;e++)t.push(u(arguments[e]));return t.join(" ")}e=1;for(var r=arguments,n=r.length,o=String(f).replace(i,(function(f){if("%%"===f)return"%";if(e>=n)return f;switch(f){case"%s":return String(r[e++]);case"%d":return Number(r[e++]);case"%j":try{return JSON.stringify(r[e++])}catch(f){return"[Circular]"}default:return f}})),s=r[e];e<n;s=r[++e])b(s)||!E(s)?o+=" "+s:o+=" "+u(s);return o},t.deprecate=function(f,i){if(m(e.g.process))return function(){return t.deprecate(f,i).apply(this,arguments)};if(!0===r.noDeprecation)return f;var o=!1;return function(){if(!o){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?n.trace(i):n.error(i),o=!0}return f.apply(this,arguments)}};var o,s={};function u(f,e){var r={seen:[],stylize:c};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),h(e)?r.showHidden=e:e&&t._extend(r,e),m(r.showHidden)&&(r.showHidden=!1),m(r.depth)&&(r.depth=2),m(r.colors)&&(r.colors=!1),m(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=a),l(r,f,r.depth)}function a(f,t){var e=u.styles[t];return e?"["+u.colors[e][0]+"m"+f+"["+u.colors[e][1]+"m":f}function c(f,t){return f}function l(f,e,r){if(f.customInspect&&e&&_(e.inspect)&&e.inspect!==t.inspect&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(r,f);return v(n)||(n=l(f,n,r)),n}var i=function(f,t){if(m(t))return f.stylize("undefined","undefined");if(v(t)){var e="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return f.stylize(e,"string")}return g(t)?f.stylize(""+t,"number"):h(t)?f.stylize(""+t,"boolean"):b(t)?f.stylize("null","null"):void 0}(f,e);if(i)return i;var o=Object.keys(e),s=function(f){var t={};return f.forEach((function(f,e){t[f]=!0})),t}(o);if(f.showHidden&&(o=Object.getOwnPropertyNames(e)),A(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return p(e);if(0===o.length){if(_(e)){var u=e.name?": "+e.name:"";return f.stylize("[Function"+u+"]","special")}if(w(e))return f.stylize(RegExp.prototype.toString.call(e),"regexp");if(O(e))return f.stylize(Date.prototype.toString.call(e),"date");if(A(e))return p(e)}var a,c="",E=!1,B=["{","}"];return y(e)&&(E=!0,B=["[","]"]),_(e)&&(c=" [Function"+(e.name?": "+e.name:"")+"]"),w(e)&&(c=" "+RegExp.prototype.toString.call(e)),O(e)&&(c=" "+Date.prototype.toUTCString.call(e)),A(e)&&(c=" "+p(e)),0!==o.length||E&&0!=e.length?r<0?w(e)?f.stylize(RegExp.prototype.toString.call(e),"regexp"):f.stylize("[Object]","special"):(f.seen.push(e),a=E?function(f,t,e,r,n){for(var i=[],o=0,s=t.length;o<s;++o)P(t,String(o))?i.push(d(f,t,e,r,String(o),!0)):i.push("");return n.forEach((function(n){n.match(/^\d+$/)||i.push(d(f,t,e,r,n,!0))})),i}(f,e,r,s,o):o.map((function(t){return d(f,e,r,s,t,E)})),f.seen.pop(),function(f,t,e){return f.reduce((function(f,t){return t.indexOf("\n"),f+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?e[0]+(""===t?"":t+"\n ")+" "+f.join(",\n ")+" "+e[1]:e[0]+t+" "+f.join(", ")+" "+e[1]}(a,c,B)):B[0]+c+B[1]}function p(f){return"["+Error.prototype.toString.call(f)+"]"}function d(f,t,e,r,n,i){var o,s,u;if((u=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?s=u.set?f.stylize("[Getter/Setter]","special"):f.stylize("[Getter]","special"):u.set&&(s=f.stylize("[Setter]","special")),P(r,n)||(o="["+n+"]"),s||(f.seen.indexOf(u.value)<0?(s=b(e)?l(f,u.value,null):l(f,u.value,e-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(f){return" "+f})).join("\n").substr(2):"\n"+s.split("\n").map((function(f){return" "+f})).join("\n")):s=f.stylize("[Circular]","special")),m(o)){if(i&&n.match(/^\d+$/))return s;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=f.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=f.stylize(o,"string"))}return o+": "+s}function y(f){return Array.isArray(f)}function h(f){return"boolean"==typeof f}function b(f){return null===f}function g(f){return"number"==typeof f}function v(f){return"string"==typeof f}function m(f){return void 0===f}function w(f){return E(f)&&"[object RegExp]"===B(f)}function E(f){return"object"==typeof f&&null!==f}function O(f){return E(f)&&"[object Date]"===B(f)}function A(f){return E(f)&&("[object Error]"===B(f)||f instanceof Error)}function _(f){return"function"==typeof f}function B(f){return Object.prototype.toString.call(f)}function x(f){return f<10?"0"+f.toString(10):f.toString(10)}t.debuglog=function(f){if(m(o)&&(o=r.env.NODE_DEBUG||""),f=f.toUpperCase(),!s[f])if(new RegExp("\\b"+f+"\\b","i").test(o)){var e=r.pid;s[f]=function(){var r=t.format.apply(t,arguments);n.error("%s %d: %s",f,e,r)}}else s[f]=function(){};return s[f]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=y,t.isBoolean=h,t.isNull=b,t.isNullOrUndefined=function(f){return null==f},t.isNumber=g,t.isString=v,t.isSymbol=function(f){return"symbol"==typeof f},t.isUndefined=m,t.isRegExp=w,t.isObject=E,t.isDate=O,t.isError=A,t.isFunction=_,t.isPrimitive=function(f){return null===f||"boolean"==typeof f||"number"==typeof f||"string"==typeof f||"symbol"==typeof f||void 0===f},t.isBuffer=e(819);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(f,t){return Object.prototype.hasOwnProperty.call(f,t)}t.log=function(){var f,e;n.log("%s - %s",(e=[x((f=new Date).getHours()),x(f.getMinutes()),x(f.getSeconds())].join(":"),[f.getDate(),S[f.getMonth()],e].join(" ")),t.format.apply(t,arguments))},t.inherits=e(147),t._extend=function(f,t){if(!t||!E(t))return f;for(var e=Object.keys(t),r=e.length;r--;)f[e[r]]=t[e[r]];return f}},766:(f,t)=>{"use strict";t.byteLength=function(f){var t=s(f),e=t[0],r=t[1];return 3*(e+r)/4-r},t.toByteArray=function(f){var t,e,i=s(f),o=i[0],u=i[1],a=new n(function(f,t,e){return 3*(t+e)/4-e}(0,o,u)),c=0,l=u>0?o-4:o;for(e=0;e<l;e+=4)t=r[f.charCodeAt(e)]<<18|r[f.charCodeAt(e+1)]<<12|r[f.charCodeAt(e+2)]<<6|r[f.charCodeAt(e+3)],a[c++]=t>>16&255,a[c++]=t>>8&255,a[c++]=255&t;return 2===u&&(t=r[f.charCodeAt(e)]<<2|r[f.charCodeAt(e+1)]>>4,a[c++]=255&t),1===u&&(t=r[f.charCodeAt(e)]<<10|r[f.charCodeAt(e+1)]<<4|r[f.charCodeAt(e+2)]>>2,a[c++]=t>>8&255,a[c++]=255&t),a},t.fromByteArray=function(f){for(var t,r=f.length,n=r%3,i=[],o=16383,s=0,a=r-n;s<a;s+=o)i.push(u(f,s,s+o>a?a:s+o));return 1===n?(t=f[r-1],i.push(e[t>>2]+e[t<<4&63]+"==")):2===n&&(t=(f[r-2]<<8)+f[r-1],i.push(e[t>>10]+e[t>>4&63]+e[t<<2&63]+"=")),i.join("")};for(var e=[],r=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)e[o]=i[o],r[i.charCodeAt(o)]=o;function s(f){var t=f.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=f.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(f,t,r){for(var n,i,o=[],s=t;s<r;s+=3)n=(f[s]<<16&16711680)+(f[s+1]<<8&65280)+(255&f[s+2]),o.push(e[(i=n)>>18&63]+e[i>>12&63]+e[i>>6&63]+e[63&i]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},716:(f,t,e)=>{var r=e(335),n=e(778);function i(){return(new Date).getTime()}var o,s=Array.prototype.slice,u={};o=void 0!==e.g&&e.g.console?e.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var a=[[function(){},"log"],[function(){o.log.apply(o,arguments)},"info"],[function(){o.log.apply(o,arguments)},"warn"],[function(){o.warn.apply(o,arguments)},"error"],[function(f){u[f]=i()},"time"],[function(f){var t=u[f];if(!t)throw new Error("No such label: "+f);delete u[f];var e=i()-t;o.log(f+": "+e+"ms")},"timeEnd"],[function(){var f=new Error;f.name="Trace",f.message=r.format.apply(null,arguments),o.error(f.stack)},"trace"],[function(f){o.log(r.inspect(f)+"\n")},"dir"],[function(f){if(!f){var t=s.call(arguments,1);n.ok(!1,r.format.apply(null,t))}},"assert"]],c=0;c<a.length;c++){var l=a[c],p=l[0],d=l[1];o[d]||(o[d]=p)}f.exports=o},333:(f,t)=>{t.read=function(f,t,e,r,n){var i,o,s=8*n-r-1,u=(1<<s)-1,a=u>>1,c=-7,l=e?n-1:0,p=e?-1:1,d=f[t+l];for(l+=p,i=d&(1<<-c)-1,d>>=-c,c+=s;c>0;i=256*i+f[t+l],l+=p,c-=8);for(o=i&(1<<-c)-1,i>>=-c,c+=r;c>0;o=256*o+f[t+l],l+=p,c-=8);if(0===i)i=1-a;else{if(i===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,r),i-=a}return(d?-1:1)*o*Math.pow(2,i-r)},t.write=function(f,t,e,r,n,i){var o,s,u,a=8*i-n-1,c=(1<<a)-1,l=c>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,y=r?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+l>=1?p/u:p*Math.pow(2,1-l))*u>=2&&(o++,u/=2),o+l>=c?(s=0,o=c):o+l>=1?(s=(t*u-1)*Math.pow(2,n),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,n),o=0));n>=8;f[e+d]=255&s,d+=y,s/=256,n-=8);for(o=o<<n|s,a+=n;a>0;f[e+d]=255&o,d+=y,o/=256,a-=8);f[e+d-y]|=128*h}},317:(f,t,e)=>{"use strict";var r=e(716);const n=e(766),i=e(333),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=a,t.h2=50;const s=2147483647;function u(f){if(f>s)throw new RangeError('The value "'+f+'" is invalid for option "size"');const t=new Uint8Array(f);return Object.setPrototypeOf(t,a.prototype),t}function a(f,t,e){if("number"==typeof f){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return p(f)}return c(f,t,e)}function c(f,t,e){if("string"==typeof f)return function(f,t){if("string"==typeof t&&""!==t||(t="utf8"),!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const e=0|b(f,t);let r=u(e);const n=r.write(f,t);return n!==e&&(r=r.slice(0,n)),r}(f,t);if(ArrayBuffer.isView(f))return function(f){if(Z(f,Uint8Array)){const t=new Uint8Array(f);return y(t.buffer,t.byteOffset,t.byteLength)}return d(f)}(f);if(null==f)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f);if(Z(f,ArrayBuffer)||f&&Z(f.buffer,ArrayBuffer))return y(f,t,e);if("undefined"!=typeof SharedArrayBuffer&&(Z(f,SharedArrayBuffer)||f&&Z(f.buffer,SharedArrayBuffer)))return y(f,t,e);if("number"==typeof f)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=f.valueOf&&f.valueOf();if(null!=r&&r!==f)return a.from(r,t,e);const n=function(f){if(a.isBuffer(f)){const t=0|h(f.length),e=u(t);return 0===e.length||f.copy(e,0,0,t),e}return void 0!==f.length?"number"!=typeof f.length||Y(f.length)?u(0):d(f):"Buffer"===f.type&&Array.isArray(f.data)?d(f.data):void 0}(f);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof f[Symbol.toPrimitive])return a.from(f[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f)}function l(f){if("number"!=typeof f)throw new TypeError('"size" argument must be of type number');if(f<0)throw new RangeError('The value "'+f+'" is invalid for option "size"')}function p(f){return l(f),u(f<0?0:0|h(f))}function d(f){const t=f.length<0?0:0|h(f.length),e=u(t);for(let r=0;r<t;r+=1)e[r]=255&f[r];return e}function y(f,t,e){if(t<0||f.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(f.byteLength<t+(e||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===e?new Uint8Array(f):void 0===e?new Uint8Array(f,t):new Uint8Array(f,t,e),Object.setPrototypeOf(r,a.prototype),r}function h(f){if(f>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|f}function b(f,t){if(a.isBuffer(f))return f.length;if(ArrayBuffer.isView(f)||Z(f,ArrayBuffer))return f.byteLength;if("string"!=typeof f)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof f);const e=f.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===e)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return J(f).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return G(f).length;default:if(n)return r?-1:J(f).length;t=(""+t).toLowerCase(),n=!0}}function g(f,t,e){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(t>>>=0))return"";for(f||(f="utf8");;)switch(f){case"hex":return j(this,t,e);case"utf8":case"utf-8":return S(this,t,e);case"ascii":return I(this,t,e);case"latin1":case"binary":return D(this,t,e);case"base64":return x(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e);default:if(r)throw new TypeError("Unknown encoding: "+f);f=(f+"").toLowerCase(),r=!0}}function v(f,t,e){const r=f[t];f[t]=f[e],f[e]=r}function m(f,t,e,r,n){if(0===f.length)return-1;if("string"==typeof e?(r=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),Y(e=+e)&&(e=n?0:f.length-1),e<0&&(e=f.length+e),e>=f.length){if(n)return-1;e=f.length-1}else if(e<0){if(!n)return-1;e=0}if("string"==typeof t&&(t=a.from(t,r)),a.isBuffer(t))return 0===t.length?-1:w(f,t,e,r,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(f,t,e):Uint8Array.prototype.lastIndexOf.call(f,t,e):w(f,[t],e,r,n);throw new TypeError("val must be string, number or Buffer")}function w(f,t,e,r,n){let i,o=1,s=f.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(f.length<2||t.length<2)return-1;o=2,s/=2,u/=2,e/=2}function a(f,t){return 1===o?f[t]:f.readUInt16BE(t*o)}if(n){let r=-1;for(i=e;i<s;i++)if(a(f,i)===a(t,-1===r?0:i-r)){if(-1===r&&(r=i),i-r+1===u)return r*o}else-1!==r&&(i-=i-r),r=-1}else for(e+u>s&&(e=s-u),i=e;i>=0;i--){let e=!0;for(let r=0;r<u;r++)if(a(f,i+r)!==a(t,r)){e=!1;break}if(e)return i}return-1}function E(f,t,e,r){e=Number(e)||0;const n=f.length-e;r?(r=Number(r))>n&&(r=n):r=n;const i=t.length;let o;for(r>i/2&&(r=i/2),o=0;o<r;++o){const r=parseInt(t.substr(2*o,2),16);if(Y(r))return o;f[e+o]=r}return o}function O(f,t,e,r){return W(J(t,f.length-e),f,e,r)}function A(f,t,e,r){return W(function(f){const t=[];for(let e=0;e<f.length;++e)t.push(255&f.charCodeAt(e));return t}(t),f,e,r)}function _(f,t,e,r){return W(G(t),f,e,r)}function B(f,t,e,r){return W(function(f,t){let e,r,n;const i=[];for(let o=0;o<f.length&&!((t-=2)<0);++o)e=f.charCodeAt(o),r=e>>8,n=e%256,i.push(n),i.push(r);return i}(t,f.length-e),f,e,r)}function x(f,t,e){return 0===t&&e===f.length?n.fromByteArray(f):n.fromByteArray(f.slice(t,e))}function S(f,t,e){e=Math.min(f.length,e);const r=[];let n=t;for(;n<e;){const t=f[n];let i=null,o=t>239?4:t>223?3:t>191?2:1;if(n+o<=e){let e,r,s,u;switch(o){case 1:t<128&&(i=t);break;case 2:e=f[n+1],128==(192&e)&&(u=(31&t)<<6|63&e,u>127&&(i=u));break;case 3:e=f[n+1],r=f[n+2],128==(192&e)&&128==(192&r)&&(u=(15&t)<<12|(63&e)<<6|63&r,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:e=f[n+1],r=f[n+2],s=f[n+3],128==(192&e)&&128==(192&r)&&128==(192&s)&&(u=(15&t)<<18|(63&e)<<12|(63&r)<<6|63&s,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,o=1):i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i),n+=o}return function(f){const t=f.length;if(t<=P)return String.fromCharCode.apply(String,f);let e="",r=0;for(;r<t;)e+=String.fromCharCode.apply(String,f.slice(r,r+=P));return e}(r)}a.TYPED_ARRAY_SUPPORT=function(){try{const f=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(f,t),42===f.foo()}catch(f){return!1}}(),a.TYPED_ARRAY_SUPPORT||void 0===r||"function"!=typeof r.error||r.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(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(f,t,e){return c(f,t,e)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(f,t,e){return function(f,t,e){return l(f),f<=0?u(f):void 0!==t?"string"==typeof e?u(f).fill(t,e):u(f).fill(t):u(f)}(f,t,e)},a.allocUnsafe=function(f){return p(f)},a.allocUnsafeSlow=function(f){return p(f)},a.isBuffer=function(f){return null!=f&&!0===f._isBuffer&&f!==a.prototype},a.compare=function(f,t){if(Z(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),Z(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(f)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===t)return 0;let e=f.length,r=t.length;for(let n=0,i=Math.min(e,r);n<i;++n)if(f[n]!==t[n]){e=f[n],r=t[n];break}return e<r?-1:r<e?1:0},a.isEncoding=function(f){switch(String(f).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}},a.concat=function(f,t){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(0===f.length)return a.alloc(0);let e;if(void 0===t)for(t=0,e=0;e<f.length;++e)t+=f[e].length;const r=a.allocUnsafe(t);let n=0;for(e=0;e<f.length;++e){let t=f[e];if(Z(t,Uint8Array))n+t.length>r.length?(a.isBuffer(t)||(t=a.from(t)),t.copy(r,n)):Uint8Array.prototype.set.call(r,t,n);else{if(!a.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,n)}n+=t.length}return r},a.byteLength=b,a.prototype._isBuffer=!0,a.prototype.swap16=function(){const f=this.length;if(f%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<f;t+=2)v(this,t,t+1);return this},a.prototype.swap32=function(){const f=this.length;if(f%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<f;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},a.prototype.swap64=function(){const f=this.length;if(f%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<f;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},a.prototype.toString=function(){const f=this.length;return 0===f?"":0===arguments.length?S(this,0,f):g.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(f){if(!a.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f||0===a.compare(this,f)},a.prototype.inspect=function(){let f="";const e=t.h2;return f=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(f+=" ... "),"<Buffer "+f+">"},o&&(a.prototype[o]=a.prototype.inspect),a.prototype.compare=function(f,t,e,r,n){if(Z(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),!a.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(void 0===t&&(t=0),void 0===e&&(e=f?f.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),t<0||e>f.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&t>=e)return 0;if(r>=n)return-1;if(t>=e)return 1;if(this===f)return 0;let i=(n>>>=0)-(r>>>=0),o=(e>>>=0)-(t>>>=0);const s=Math.min(i,o),u=this.slice(r,n),c=f.slice(t,e);for(let f=0;f<s;++f)if(u[f]!==c[f]){i=u[f],o=c[f];break}return i<o?-1:o<i?1:0},a.prototype.includes=function(f,t,e){return-1!==this.indexOf(f,t,e)},a.prototype.indexOf=function(f,t,e){return m(this,f,t,e,!0)},a.prototype.lastIndexOf=function(f,t,e){return m(this,f,t,e,!1)},a.prototype.write=function(f,t,e,r){if(void 0===t)r="utf8",e=this.length,t=0;else if(void 0===e&&"string"==typeof t)r=t,e=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(e)?(e>>>=0,void 0===r&&(r="utf8")):(r=e,e=void 0)}const n=this.length-t;if((void 0===e||e>n)&&(e=n),f.length>0&&(e<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let i=!1;for(;;)switch(r){case"hex":return E(this,f,t,e);case"utf8":case"utf-8":return O(this,f,t,e);case"ascii":case"latin1":case"binary":return A(this,f,t,e);case"base64":return _(this,f,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,f,t,e);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const P=4096;function I(f,t,e){let r="";e=Math.min(f.length,e);for(let n=t;n<e;++n)r+=String.fromCharCode(127&f[n]);return r}function D(f,t,e){let r="";e=Math.min(f.length,e);for(let n=t;n<e;++n)r+=String.fromCharCode(f[n]);return r}function j(f,t,e){const r=f.length;(!t||t<0)&&(t=0),(!e||e<0||e>r)&&(e=r);let n="";for(let r=t;r<e;++r)n+=X[f[r]];return n}function T(f,t,e){const r=f.slice(t,e);let n="";for(let f=0;f<r.length-1;f+=2)n+=String.fromCharCode(r[f]+256*r[f+1]);return n}function k(f,t,e){if(f%1!=0||f<0)throw new RangeError("offset is not uint");if(f+t>e)throw new RangeError("Trying to access beyond buffer length")}function R(f,t,e,r,n,i){if(!a.isBuffer(f))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<i)throw new RangeError('"value" argument is out of bounds');if(e+r>f.length)throw new RangeError("Index out of range")}function U(f,t,e,r,n){F(t,r,n,f,e,7);let i=Number(t&BigInt(4294967295));f[e++]=i,i>>=8,f[e++]=i,i>>=8,f[e++]=i,i>>=8,f[e++]=i;let o=Number(t>>BigInt(32)&BigInt(4294967295));return f[e++]=o,o>>=8,f[e++]=o,o>>=8,f[e++]=o,o>>=8,f[e++]=o,e}function K(f,t,e,r,n){F(t,r,n,f,e,7);let i=Number(t&BigInt(4294967295));f[e+7]=i,i>>=8,f[e+6]=i,i>>=8,f[e+5]=i,i>>=8,f[e+4]=i;let o=Number(t>>BigInt(32)&BigInt(4294967295));return f[e+3]=o,o>>=8,f[e+2]=o,o>>=8,f[e+1]=o,o>>=8,f[e]=o,e+8}function M(f,t,e,r,n,i){if(e+r>f.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function N(f,t,e,r,n){return t=+t,e>>>=0,n||M(f,0,e,4),i.write(f,t,e,r,23,4),e+4}function $(f,t,e,r,n){return t=+t,e>>>=0,n||M(f,0,e,8),i.write(f,t,e,r,52,8),e+8}a.prototype.slice=function(f,t){const e=this.length;(f=~~f)<0?(f+=e)<0&&(f=0):f>e&&(f=e),(t=void 0===t?e:~~t)<0?(t+=e)<0&&(t=0):t>e&&(t=e),t<f&&(t=f);const r=this.subarray(f,t);return Object.setPrototypeOf(r,a.prototype),r},a.prototype.readUintLE=a.prototype.readUIntLE=function(f,t,e){f>>>=0,t>>>=0,e||k(f,t,this.length);let r=this[f],n=1,i=0;for(;++i<t&&(n*=256);)r+=this[f+i]*n;return r},a.prototype.readUintBE=a.prototype.readUIntBE=function(f,t,e){f>>>=0,t>>>=0,e||k(f,t,this.length);let r=this[f+--t],n=1;for(;t>0&&(n*=256);)r+=this[f+--t]*n;return r},a.prototype.readUint8=a.prototype.readUInt8=function(f,t){return f>>>=0,t||k(f,1,this.length),this[f]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(f,t){return f>>>=0,t||k(f,2,this.length),this[f]|this[f+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(f,t){return f>>>=0,t||k(f,2,this.length),this[f]<<8|this[f+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(f,t){return f>>>=0,t||k(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+16777216*this[f+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(f,t){return f>>>=0,t||k(f,4,this.length),16777216*this[f]+(this[f+1]<<16|this[f+2]<<8|this[f+3])},a.prototype.readBigUInt64LE=Q((function(f){q(f>>>=0,"offset");const t=this[f],e=this[f+7];void 0!==t&&void 0!==e||V(f,this.length-8);const r=t+256*this[++f]+65536*this[++f]+this[++f]*2**24,n=this[++f]+256*this[++f]+65536*this[++f]+e*2**24;return BigInt(r)+(BigInt(n)<<BigInt(32))})),a.prototype.readBigUInt64BE=Q((function(f){q(f>>>=0,"offset");const t=this[f],e=this[f+7];void 0!==t&&void 0!==e||V(f,this.length-8);const r=t*2**24+65536*this[++f]+256*this[++f]+this[++f],n=this[++f]*2**24+65536*this[++f]+256*this[++f]+e;return(BigInt(r)<<BigInt(32))+BigInt(n)})),a.prototype.readIntLE=function(f,t,e){f>>>=0,t>>>=0,e||k(f,t,this.length);let r=this[f],n=1,i=0;for(;++i<t&&(n*=256);)r+=this[f+i]*n;return n*=128,r>=n&&(r-=Math.pow(2,8*t)),r},a.prototype.readIntBE=function(f,t,e){f>>>=0,t>>>=0,e||k(f,t,this.length);let r=t,n=1,i=this[f+--r];for(;r>0&&(n*=256);)i+=this[f+--r]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},a.prototype.readInt8=function(f,t){return f>>>=0,t||k(f,1,this.length),128&this[f]?-1*(255-this[f]+1):this[f]},a.prototype.readInt16LE=function(f,t){f>>>=0,t||k(f,2,this.length);const e=this[f]|this[f+1]<<8;return 32768&e?4294901760|e:e},a.prototype.readInt16BE=function(f,t){f>>>=0,t||k(f,2,this.length);const e=this[f+1]|this[f]<<8;return 32768&e?4294901760|e:e},a.prototype.readInt32LE=function(f,t){return f>>>=0,t||k(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},a.prototype.readInt32BE=function(f,t){return f>>>=0,t||k(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},a.prototype.readBigInt64LE=Q((function(f){q(f>>>=0,"offset");const t=this[f],e=this[f+7];void 0!==t&&void 0!==e||V(f,this.length-8);const r=this[f+4]+256*this[f+5]+65536*this[f+6]+(e<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++f]+65536*this[++f]+this[++f]*2**24)})),a.prototype.readBigInt64BE=Q((function(f){q(f>>>=0,"offset");const t=this[f],e=this[f+7];void 0!==t&&void 0!==e||V(f,this.length-8);const r=(t<<24)+65536*this[++f]+256*this[++f]+this[++f];return(BigInt(r)<<BigInt(32))+BigInt(this[++f]*2**24+65536*this[++f]+256*this[++f]+e)})),a.prototype.readFloatLE=function(f,t){return f>>>=0,t||k(f,4,this.length),i.read(this,f,!0,23,4)},a.prototype.readFloatBE=function(f,t){return f>>>=0,t||k(f,4,this.length),i.read(this,f,!1,23,4)},a.prototype.readDoubleLE=function(f,t){return f>>>=0,t||k(f,8,this.length),i.read(this,f,!0,52,8)},a.prototype.readDoubleBE=function(f,t){return f>>>=0,t||k(f,8,this.length),i.read(this,f,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(f,t,e,r){f=+f,t>>>=0,e>>>=0,r||R(this,f,t,e,Math.pow(2,8*e)-1,0);let n=1,i=0;for(this[t]=255&f;++i<e&&(n*=256);)this[t+i]=f/n&255;return t+e},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(f,t,e,r){f=+f,t>>>=0,e>>>=0,r||R(this,f,t,e,Math.pow(2,8*e)-1,0);let n=e-1,i=1;for(this[t+n]=255&f;--n>=0&&(i*=256);)this[t+n]=f/i&255;return t+e},a.prototype.writeUint8=a.prototype.writeUInt8=function(f,t,e){return f=+f,t>>>=0,e||R(this,f,t,1,255,0),this[t]=255&f,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(f,t,e){return f=+f,t>>>=0,e||R(this,f,t,2,65535,0),this[t]=255&f,this[t+1]=f>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(f,t,e){return f=+f,t>>>=0,e||R(this,f,t,2,65535,0),this[t]=f>>>8,this[t+1]=255&f,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(f,t,e){return f=+f,t>>>=0,e||R(this,f,t,4,4294967295,0),this[t+3]=f>>>24,this[t+2]=f>>>16,this[t+1]=f>>>8,this[t]=255&f,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(f,t,e){return f=+f,t>>>=0,e||R(this,f,t,4,4294967295,0),this[t]=f>>>24,this[t+1]=f>>>16,this[t+2]=f>>>8,this[t+3]=255&f,t+4},a.prototype.writeBigUInt64LE=Q((function(f,t=0){return U(this,f,t,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeBigUInt64BE=Q((function(f,t=0){return K(this,f,t,BigInt(0),BigInt("0xffffffffffffffff"))})),a.prototype.writeIntLE=function(f,t,e,r){if(f=+f,t>>>=0,!r){const r=Math.pow(2,8*e-1);R(this,f,t,e,r-1,-r)}let n=0,i=1,o=0;for(this[t]=255&f;++n<e&&(i*=256);)f<0&&0===o&&0!==this[t+n-1]&&(o=1),this[t+n]=(f/i>>0)-o&255;return t+e},a.prototype.writeIntBE=function(f,t,e,r){if(f=+f,t>>>=0,!r){const r=Math.pow(2,8*e-1);R(this,f,t,e,r-1,-r)}let n=e-1,i=1,o=0;for(this[t+n]=255&f;--n>=0&&(i*=256);)f<0&&0===o&&0!==this[t+n+1]&&(o=1),this[t+n]=(f/i>>0)-o&255;return t+e},a.prototype.writeInt8=function(f,t,e){return f=+f,t>>>=0,e||R(this,f,t,1,127,-128),f<0&&(f=255+f+1),this[t]=255&f,t+1},a.prototype.writeInt16LE=function(f,t,e){return f=+f,t>>>=0,e||R(this,f,t,2,32767,-32768),this[t]=255&f,this[t+1]=f>>>8,t+2},a.prototype.writeInt16BE=function(f,t,e){return f=+f,t>>>=0,e||R(this,f,t,2,32767,-32768),this[t]=f>>>8,this[t+1]=255&f,t+2},a.prototype.writeInt32LE=function(f,t,e){return f=+f,t>>>=0,e||R(this,f,t,4,2147483647,-2147483648),this[t]=255&f,this[t+1]=f>>>8,this[t+2]=f>>>16,this[t+3]=f>>>24,t+4},a.prototype.writeInt32BE=function(f,t,e){return f=+f,t>>>=0,e||R(this,f,t,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[t]=f>>>24,this[t+1]=f>>>16,this[t+2]=f>>>8,this[t+3]=255&f,t+4},a.prototype.writeBigInt64LE=Q((function(f,t=0){return U(this,f,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeBigInt64BE=Q((function(f,t=0){return K(this,f,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),a.prototype.writeFloatLE=function(f,t,e){return N(this,f,t,!0,e)},a.prototype.writeFloatBE=function(f,t,e){return N(this,f,t,!1,e)},a.prototype.writeDoubleLE=function(f,t,e){return $(this,f,t,!0,e)},a.prototype.writeDoubleBE=function(f,t,e){return $(this,f,t,!1,e)},a.prototype.copy=function(f,t,e,r){if(!a.isBuffer(f))throw new TypeError("argument should be a Buffer");if(e||(e=0),r||0===r||(r=this.length),t>=f.length&&(t=f.length),t||(t=0),r>0&&r<e&&(r=e),r===e)return 0;if(0===f.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),f.length-t<r-e&&(r=f.length-t+e);const n=r-e;return this===f&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,e,r):Uint8Array.prototype.set.call(f,this.subarray(e,r),t),n},a.prototype.fill=function(f,t,e,r){if("string"==typeof f){if("string"==typeof t?(r=t,t=0,e=this.length):"string"==typeof e&&(r=e,e=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!a.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===f.length){const t=f.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(f=t)}}else"number"==typeof f?f&=255:"boolean"==typeof f&&(f=Number(f));if(t<0||this.length<t||this.length<e)throw new RangeError("Out of range index");if(e<=t)return this;let n;if(t>>>=0,e=void 0===e?this.length:e>>>0,f||(f=0),"number"==typeof f)for(n=t;n<e;++n)this[n]=f;else{const i=a.isBuffer(f)?f:a.from(f,r),o=i.length;if(0===o)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(n=0;n<e-t;++n)this[n+t]=i[n%o]}return this};const L={};function C(f,t,e){L[f]=class extends e{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${f}]`,this.stack,delete this.name}get code(){return f}set code(f){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:f,writable:!0})}toString(){return`${this.name} [${f}]: ${this.message}`}}}function z(f){let t="",e=f.length;const r="-"===f[0]?1:0;for(;e>=r+4;e-=3)t=`_${f.slice(e-3,e)}${t}`;return`${f.slice(0,e)}${t}`}function F(f,t,e,r,n,i){if(f>e||f<t){const r="bigint"==typeof t?"n":"";let n;throw n=i>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`:`>= ${t}${r} and <= ${e}${r}`,new L.ERR_OUT_OF_RANGE("value",n,f)}!function(f,t,e){q(t,"offset"),void 0!==f[t]&&void 0!==f[t+e]||V(t,f.length-(e+1))}(r,n,i)}function q(f,t){if("number"!=typeof f)throw new L.ERR_INVALID_ARG_TYPE(t,"number",f)}function V(f,t,e){if(Math.floor(f)!==f)throw q(f,e),new L.ERR_OUT_OF_RANGE(e||"offset","an integer",f);if(t<0)throw new L.ERR_BUFFER_OUT_OF_BOUNDS;throw new L.ERR_OUT_OF_RANGE(e||"offset",`>= ${e?1:0} and <= ${t}`,f)}C("ERR_BUFFER_OUT_OF_BOUNDS",(function(f){return f?`${f} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),C("ERR_INVALID_ARG_TYPE",(function(f,t){return`The "${f}" argument must be of type number. Received type ${typeof t}`}),TypeError),C("ERR_OUT_OF_RANGE",(function(f,t,e){let r=`The value of "${f}" is out of range.`,n=e;return Number.isInteger(e)&&Math.abs(e)>2**32?n=z(String(e)):"bigint"==typeof e&&(n=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(n=z(n)),n+="n"),r+=` It must be ${t}. Received ${n}`,r}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function J(f,t){let e;t=t||1/0;const r=f.length;let n=null;const i=[];for(let o=0;o<r;++o){if(e=f.charCodeAt(o),e>55295&&e<57344){if(!n){if(e>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&i.push(239,191,189);continue}n=e;continue}if(e<56320){(t-=3)>-1&&i.push(239,191,189),n=e;continue}e=65536+(n-55296<<10|e-56320)}else n&&(t-=3)>-1&&i.push(239,191,189);if(n=null,e<128){if((t-=1)<0)break;i.push(e)}else if(e<2048){if((t-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(e<65536){if((t-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function G(f){return n.toByteArray(function(f){if((f=(f=f.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;f.length%4!=0;)f+="=";return f}(f))}function W(f,t,e,r){let n;for(n=0;n<r&&!(n+e>=t.length||n>=f.length);++n)t[n+e]=f[n];return n}function Z(f,t){return f instanceof t||null!=f&&null!=f.constructor&&null!=f.constructor.name&&f.constructor.name===t.name}function Y(f){return f!=f}const X=function(){const f="0123456789abcdef",t=new Array(256);for(let e=0;e<16;++e){const r=16*e;for(let n=0;n<16;++n)t[r+n]=f[e]+f[n]}return t}();function Q(f){return"undefined"==typeof BigInt?ff:f}function ff(){throw new Error("BigInt not supported")}},320:f=>{"use strict";var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;f.exports=function(){try{if(!Object.assign)return!1;var f=new String("abc");if(f[5]="de","5"===Object.getOwnPropertyNames(f)[0])return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(f){return t[f]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(f){r[f]=f})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(f){return!1}}()?Object.assign:function(f,n){for(var i,o,s=function(f){if(null==f)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(f)}(f),u=1;u<arguments.length;u++){for(var a in i=Object(arguments[u]))e.call(i,a)&&(s[a]=i[a]);if(t){o=t(i);for(var c=0;c<o.length;c++)r.call(i,o[c])&&(s[o[c]]=i[o[c]])}}return s}},406:f=>{var t,e,r=f.exports={};function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(f){if(t===setTimeout)return setTimeout(f,0);if((t===n||!t)&&setTimeout)return t=setTimeout,setTimeout(f,0);try{return t(f,0)}catch(e){try{return t.call(null,f,0)}catch(e){return t.call(this,f,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:n}catch(f){t=n}try{e="function"==typeof clearTimeout?clearTimeout:i}catch(f){e=i}}();var s,u=[],a=!1,c=-1;function l(){a&&s&&(a=!1,s.length?u=s.concat(u):c=-1,u.length&&p())}function p(){if(!a){var f=o(l);a=!0;for(var t=u.length;t;){for(s=u,u=[];++c<t;)s&&s[c].run();c=-1,t=u.length}s=null,a=!1,function(f){if(e===clearTimeout)return clearTimeout(f);if((e===i||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(f);try{return e(f)}catch(t){try{return e.call(null,f)}catch(t){return e.call(this,f)}}}(f)}}function d(f,t){this.fun=f,this.array=t}function y(){}r.nextTick=function(f){var t=new Array(arguments.length-1);if(arguments.length>1)for(var e=1;e<arguments.length;e++)t[e-1]=arguments[e];u.push(new d(f,t)),1!==u.length||a||o(p)},d.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=y,r.addListener=y,r.once=y,r.off=y,r.removeListener=y,r.removeAllListeners=y,r.emit=y,r.prependListener=y,r.prependOnceListener=y,r.listeners=function(f){return[]},r.binding=function(f){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(f){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},61:(f,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ethrReg=void 0,t.ethrReg={contractName:"EthereumDIDRegistry",abi:[{constant:!0,inputs:[{name:"",type:"address"}],name:"owners",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"},{name:"",type:"bytes32"},{name:"",type:"address"}],name:"delegates",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"}],name:"nonce",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"",type:"address"}],name:"changed",outputs:[{name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{anonymous:!1,inputs:[{indexed:!0,name:"identity",type:"address"},{indexed:!1,name:"owner",type:"address"},{indexed:!1,name:"previousChange",type:"uint256"}],name:"DIDOwnerChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"identity",type:"address"},{indexed:!1,name:"delegateType",type:"bytes32"},{indexed:!1,name:"delegate",type:"address"},{indexed:!1,name:"validTo",type:"uint256"},{indexed:!1,name:"previousChange",type:"uint256"}],name:"DIDDelegateChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"identity",type:"address"},{indexed:!1,name:"name",type:"bytes32"},{indexed:!1,name:"value",type:"bytes"},{indexed:!1,name:"validTo",type:"uint256"},{indexed:!1,name:"previousChange",type:"uint256"}],name:"DIDAttributeChanged",type:"event"},{constant:!0,inputs:[{name:"identity",type:"address"}],name:"identityOwner",outputs:[{name:"",type:"address"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{name:"identity",type:"address"},{name:"delegateType",type:"bytes32"},{name:"delegate",type:"address"}],name:"validDelegate",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"view",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"newOwner",type:"address"}],name:"changeOwner",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"sigV",type:"uint8"},{name:"sigR",type:"bytes32"},{name:"sigS",type:"bytes32"},{name:"newOwner",type:"address"}],name:"changeOwnerSigned",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"delegateType",type:"bytes32"},{name:"delegate",type:"address"},{name:"validity",type:"uint256"}],name:"addDelegate",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"sigV",type:"uint8"},{name:"sigR",type:"bytes32"},{name:"sigS",type:"bytes32"},{name:"delegateType",type:"bytes32"},{name:"delegate",type:"address"},{name:"validity",type:"uint256"}],name:"addDelegateSigned",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"delegateType",type:"bytes32"},{name:"delegate",type:"address"}],name:"revokeDelegate",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"sigV",type:"uint8"},{name:"sigR",type:"bytes32"},{name:"sigS",type:"bytes32"},{name:"delegateType",type:"bytes32"},{name:"delegate",type:"address"}],name:"revokeDelegateSigned",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"name",type:"bytes32"},{name:"value",type:"bytes"},{name:"validity",type:"uint256"}],name:"setAttribute",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"sigV",type:"uint8"},{name:"sigR",type:"bytes32"},{name:"sigS",type:"bytes32"},{name:"name",type:"bytes32"},{name:"value",type:"bytes"},{name:"validity",type:"uint256"}],name:"setAttributeSigned",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"name",type:"bytes32"},{name:"value",type:"bytes"}],name:"revokeAttribute",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"},{constant:!1,inputs:[{name:"identity",type:"address"},{name:"sigV",type:"uint8"},{name:"sigR",type:"bytes32"},{name:"sigS",type:"bytes32"},{name:"name",type:"bytes32"},{name:"value",type:"bytes"}],name:"revokeAttributeSigned",outputs:[],payable:!1,stateMutability:"nonpayable",type:"function"}],bytecode:"0x608060405234801561001057600080fd5b50612273806100206000396000f3006080604052600436106100e5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168062c023da146100ea578063022914a7146101815780630d44625b14610204578063123b5e9814610289578063240cf1fa14610353578063622b2a3c146103df57806370ae92d2146104685780637ad4b0a4146104bf57806380b29f7c146105605780638733d4e8146105d157806393072684146106545780639c2c1b2b146106ee578063a7068d6614610792578063e476af5c1461080d578063f00d4b5d146108cd578063f96d0f9f14610930575b600080fd5b3480156100f657600080fd5b5061017f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610987565b005b34801561018d57600080fd5b506101c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610998565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561021057600080fd5b50610273600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109cb565b6040518082815260200191505060405180910390f35b34801561029557600080fd5b50610351600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190803560001916906020019092919080356000191690602001909291908035600019169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001909291905050506109fd565b005b34801561035f57600080fd5b506103dd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff16906020019092919080356000191690602001909291908035600019169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c72565b005b3480156103eb57600080fd5b5061044e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ec1565b604051808215151515815260200191505060405180910390f35b34801561047457600080fd5b506104a9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f86565b6040518082815260200191505060405180910390f35b3480156104cb57600080fd5b5061055e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190505050610f9e565b005b34801561056c57600080fd5b506105cf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035600019169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fb1565b005b3480156105dd57600080fd5b50610612600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561066057600080fd5b506106ec600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190803560001916906020019092919080356000191690602001909291908035600019169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611058565b005b3480156106fa57600080fd5b50610790600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff1690602001