@blockcerts/blockcerts-verifier 1.44.1 → 1.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ie11.js +31 -31
- package/dist/main.js +120 -120
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -325,46 +325,46 @@ if("@preserve"in t)return"@null"===t["@preserve"]?null:t["@preserve"];if(FG(t))r
|
|
|
325
325
|
*/const xX=OW.IdentifierIssuer,{expand:SX}=RJ,{flatten:EX}=VJ,{fromRDF:kX}=rG,{toRDF:IX}=yG,{frameMergedOrDefault:AX}=kG,{isArray:PX,isObject:TX,isString:OX}=yW,{isSubjectReference:CX}=wW,{getInitialContext:MX,process:RX,getAllContexts:NX}=cJ,{compact:LX,compactIri:jX,removePreserve:DX}=ZG,{createNodeMap:BX,createMergedNodeMap:UX,mergeNodeMaps:FX}=UJ,HX=void 0!==cF&&cF.versions&&cF.versions.node,zX=!HX&&("undefined"!=typeof window||"undefined"!=typeof self),VX=function(e){const t={};function r(t,r){let{documentLoader:n=e.documentLoader}=r,i=function(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(r,["documentLoader"]);return Object.assign({},{documentLoader:n},i,t)}return e.compact=OW.callbackify(function(){var t=_X((function*(t,n,i){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new _W("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let o;(i=r(i,{base:OX(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new xX("_:b")})).link&&(i.skipExpansion=!0),i.compactToRelative||delete i.base,o=i.skipExpansion?t:yield e.expand(t,i);const s=yield e.processContext(MX(i),n,i);let a=LX({activeCtx:s,element:o,options:i,compactionMap:i.compactionMap});i.compactArrays&&!i.graph&&PX(a)?1===a.length?a=a[0]:0===a.length&&(a={}):i.graph&&TX(a)&&(a=[a]),TX(n)&&"@context"in n&&(n=n["@context"]),n=OW.clone(n),PX(n)||(n=[n]);const u=n;n=[];for(let e=0;e<u.length;++e)(!TX(u[e])||Object.keys(u[e]).length>0)&&n.push(u[e]);const c=n.length>0;if(1===n.length&&(n=n[0]),PX(a)){const e=jX({activeCtx:s,iri:"@graph",relativeTo:{vocab:!0}}),t=a;a={},c&&(a["@context"]=n),a[e]=t}else if(TX(a)&&c){const e=a;a={"@context":n};for(const t in e)a[t]=e[t]}if(i.framing){const e=jX({activeCtx:s,iri:"@graph",relativeTo:{vocab:!0}});// remove @preserve from results
|
|
326
326
|
i.link={},a[e]=DX(s,a[e],i)}return a}));return function(e,r,n){return t.apply(this,arguments)}}()),e.expand=OW.callbackify(function(){var t=_X((function*(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(n=r(n,{keepFreeFloatingNodes:!1})).expansionMap&&(n.expansionMap=void 0);const i={},o=[];if("expandContext"in n){const e=OW.clone(n.expandContext);TX(e)&&"@context"in e?i.expandContext=e:i.expandContext={"@context":e},o.push(i.expandContext)}let s;if(OX(t)){const r=yield e.get(t,n);s=r.documentUrl,i.input=r.document,r.contextUrl&&(i.remoteContext={"@context":r.contextUrl},o.push(i.remoteContext))}else i.input=OW.clone(t);"base"in n||(n.base=s||""),yield NX(i,n);let a=MX(n);o.forEach((e=>{a=RX({activeCtx:a,localCtx:e,options:n})}));let u=SX({activeCtx:a,element:i.input,options:n,expansionMap:n.expansionMap});return TX(u)&&"@graph"in u&&1===Object.keys(u).length?u=u["@graph"]:null===u&&(u=[]),PX(u)||(u=[u]),u}));return function(e,r){return t.apply(this,arguments)}}()),e.flatten=OW.callbackify(function(){var t=_X((function*(t,n,i){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,i=r(i,{base:OX(t)?t:""});const o=yield e.expand(t,i),s=EX(o);if(null===n)return s;i.graph=!0,i.skipExpansion=!0;const a=yield e.compact(s,n,i);return a}));return function(e,r,n){return t.apply(this,arguments)}}()),e.frame=OW.callbackify(function(){var t=_X((function*(t,n,i){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(i=r(i,{base:OX(t)?t:"",embed:"@last",explicit:!1,requireAll:!0,omitDefault:!1,pruneBlankNodeIdentifiers:!0,bnodesToClear:[]}),OX(n)){const t=yield e.get(n,i);if(n=t.document,t.contextUrl){let e=n["@context"];e?PX(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const o=n&&n["@context"]||{},s=yield e.expand(t,i),a=OW.clone(i);a.isFrame=!0,a.keepFreeFloatingNodes=!0;const u=yield e.expand(n,a);a.merged=!("@graph"in n);const c=AX(s,u,a);a.graph=!0,a.skipExpansion=!0,a.link={},a.framing=!0;const l=yield e.compact(c,o,a);return l}));return function(e,r,n){return t.apply(this,arguments)}}()),e.link=OW.callbackify(function(){var t=_X((function*(t,r,n){const i={};return r&&(i["@context"]=r),i["@embed"]="@link",e.frame(t,i,n)}));return function(e,r,n){return t.apply(this,arguments)}}()),e.normalize=e.canonize=OW.callbackify(function(){var t=_X((function*(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=r(n,{base:OX(t)?t:"",algorithm:"URDNA2015",skipExpansion:!1}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new _W("Unknown canonicalization input format.","jsonld.CanonizeError");const e=LW.parse(t);return tq.canonize(e,n)}const i=OW.clone(n);delete i.format,i.produceGeneralizedRdf=!1;const o=yield e.toRDF(t,i);return tq.canonize(o,n)}));return function(e,r){return t.apply(this,arguments)}}()),e.fromRDF=OW.callbackify(function(){var e=_X((function*(e,n){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");n=r(n,{format:OX(e)?"application/n-quads":void 0});const{format:i}=n;let o,{rdfParser:s}=n;if(i){if(s=s||t[i],!s)throw new _W("Unknown input format.","jsonld.UnknownFormat",{format:i})}else s=()=>e;return o=s.length>1?new Promise(((t,r)=>{s(e,((e,n)=>{e?r(e):t(n)}))})):Promise.resolve(s(e)),o=yield o,Array.isArray(o)||(o=LW.legacyDatasetToQuads(o)),kX(o,n)}));return function(t,r){return e.apply(this,arguments)}}()),e.toRDF=OW.callbackify(function(){var t=_X((function*(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let i;i=(n=r(n,{base:OX(t)?t:"",skipExpansion:!1})).skipExpansion?t:yield e.expand(t,n);const o=IX(i,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return yield LW.serialize(o);throw new _W("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return o}));return function(e,r){return t.apply(this,arguments)}}()),e.createNodeMap=OW.callbackify(function(){var t=_X((function*(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=r(n,{base:OX(t)?t:""});const i=yield e.expand(t,n);return UX(i,n)}));return function(e,r){return t.apply(this,arguments)}}()),e.merge=OW.callbackify(function(){var t=_X((function*(t,n,i){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!PX(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,i=r(i,{});const o=yield Promise.all(t.map((t=>{const r=Object.assign({},i);return e.expand(t,r)})));let s=!0;"mergeNodes"in i&&(s=i.mergeNodes);const a=i.issuer||new xX("_:b"),u={"@default":{}};for(let e=0;e<o.length;++e){const t=OW.relabelBlankNodes(o[e],{issuer:new xX("_:b"+e+"-")}),r=s||0===e?u:{"@default":{}};if(BX(t,r,"@default",a),r!==u)for(const e in r){const t=r[e];if(!(e in u)){u[e]=t;continue}const n=u[e];for(const e in t)e in n||(n[e]=t[e])}}const c=FX(u),l=[],h=Object.keys(c).sort();for(let e=0;e<h.length;++e){const t=c[h[e]];CX(t)||l.push(t)}if(null===n)return l;i.graph=!0,i.skipExpansion=!0;const f=yield e.compact(l,n,i);return f}));return function(e,r,n){return t.apply(this,arguments)}}()),Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=OW.normalizeDocumentLoader(t)}),e.documentLoader=function(){var e=_X((function*(e){throw new _W("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})}));return function(t){return e.apply(this,arguments)}}(),e.loadDocument=OW.callbackify(_X((function*(){return e.documentLoader.apply(null,arguments)}))),e.get=OW.callbackify(function(){var t=_X((function*(t,r){let n;n="function"==typeof r.documentLoader?OW.normalizeDocumentLoader(r.documentLoader):e.documentLoader;const i=yield n(t);try{if(!i.document)throw new _W("No remote document found at the given URL.","jsonld.NullRemoteDocument");OX(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new _W("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i}));return function(e,r){return t.apply(this,arguments)}}()),e.processContext=OW.callbackify(function(){var e=_X((function*(e,t,n){if(n=r(n,{base:""}),null===t)return MX(n);t=OW.clone(t),TX(t)&&"@context"in t||(t={"@context":t});const i=yield NX(t,n);return RX({activeCtx:e,localCtx:i,options:n})}));return function(t,r,n){return e.apply(this,arguments)}}()),e.getContextValue=cJ.getContextValue,e.documentLoaders={},e.documentLoaders.node=lX,e.documentLoaders.xhr=yX,e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new _W('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,r){t[e]=r},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",LW.parse),e.registerRDFParser("application/nquads",LW.parse),e.registerRDFParser("rdfa-api",class{parse(e){const t={"@default":[]},r=e.getSubjects();for(let n=0;n<r.length;++n){const i=r[n];if(null===i)continue;const o=e.getSubjectTriples(i);if(null===o)continue;const s=o.predicates;for(const e in s){const r=s[e].objects;for(let n=0;n<r.length;++n){const o=r[n],s={};0===i.indexOf("_:")?s.subject={type:"blank node",value:i}:s.subject={type:"IRI",value:i},0===e.indexOf("_:")?s.predicate={type:"blank node",value:e}:s.predicate={type:"IRI",value:e};let a=o.value;if(o.type===zW){const e=new("undefined"==typeof XMLSerializer?QV.XMLSerializer:XMLSerializer);a="";for(let t=0;t<o.value.length;t++)o.value[t].nodeType===qW.ELEMENT_NODE?a+=e.serializeToString(o.value[t]):o.value[t].nodeType===qW.TEXT_NODE&&(a+=o.value[t].nodeValue)}s.object={},o.type===HW?0===o.value.indexOf("_:")?s.object.type="blank node":s.object.type="IRI":(s.object.type="literal",o.type===FW?o.language?(s.object.datatype=UW,s.object.language=o.language):s.object.datatype=VW:s.object.datatype=o.type),s.object.value=a,t["@default"].push(s)}}}return t}}.parse),e.url=WW,e.util=OW,Object.assign(e,OW),e.promises=e,e.RequestQueue=iX,e.JsonLdProcessor=(e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,r)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t})(e),zX&&void 0===CB.JsonLdProcessor&&Object.defineProperty(CB,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor}),HX?e.useDocumentLoader("node"):"undefined"!=typeof XMLHttpRequest&&e.useDocumentLoader("xhr"),e},qX=function(){return VX((function(){return qX()}))};VX(qX);var KX=qX,$X=RB((function(e){kV.gte(cF.version,"8.6.0")?e.exports=mW:e.exports=KX}));$X.jsonld;var WX=RB((function(e){!function(t){var r={bytesToHex:function(e){return function(e){return e.map((function(e){return 2,(t=e.toString(16)).length>2?t:Array(2-t.length+1).join("0")+t;var t})).join("")}(e)},hexToBytes:function(e){if(e.length%2==1)throw new Error("hexToBytes can't have a string with an odd number of characters.");return 0===e.indexOf("0x")&&(e=e.slice(2)),e.match(/../g).map((function(e){return parseInt(e,16)}))}};e.exports?e.exports=r:t.convertHex=r}(CB)})),JX=RB((function(e){!function(t){var r={bytesToString:function(e){return e.map((function(e){return String.fromCharCode(e)})).join("")},stringToBytes:function(e){return e.split("").map((function(e){return e.charCodeAt(0)}))}};r.UTF8={bytesToString:function(e){return decodeURIComponent(escape(r.bytesToString(e)))},stringToBytes:function(e){return r.stringToBytes(unescape(encodeURIComponent(e)))}},e.exports?e.exports=r:t.convertString=r}(CB)})),GX=RB((function(e){!function(t){var r={};e.exports?(r.bytesToHex=WX.bytesToHex,r.convertString=JX,e.exports=s):(r.bytesToHex=t.convertHex.bytesToHex,r.convertString=t.convertString,t.sha256=s);var n=[];!function(){function e(e){for(var t=Math.sqrt(e),r=2;r<=t;r++)if(!(e%r))return!1;return!0}function t(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(n[i]=t(Math.pow(r,1/3)),i++),r++}();var i=[],o=function(e,t,r){for(var o=e[0],s=e[1],a=e[2],u=e[3],c=e[4],l=e[5],h=e[6],f=e[7],d=0;d<64;d++){if(d<16)i[d]=0|t[r+d];else{var p=i[d-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,m=i[d-2],v=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;i[d]=g+i[d-7]+v+i[d-16]}var y=o&s^o&a^s&a,b=(o<<30|o>>>2)^(o<<19|o>>>13)^(o<<10|o>>>22),w=f+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&l^~c&h)+n[d]+i[d];f=h,h=l,l=c,c=u+w|0,u=a,a=s,s=o,o=w+(b+y)|0}e[0]=e[0]+o|0,e[1]=e[1]+s|0,e[2]=e[2]+a|0,e[3]=e[3]+u|0,e[4]=e[4]+c|0,e[5]=e[5]+l|0,e[6]=e[6]+h|0,e[7]=e[7]+f|0};function s(e,t){e.constructor===String&&(e=r.convertString.UTF8.stringToBytes(e));var n=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],i=function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t}(e),s=8*e.length;i[s>>5]|=128<<24-s%32,i[15+(s+64>>9<<4)]=s;for(var a=0;a<i.length;a+=16)o(n,i,a);var u=function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t}(n);return t&&t.asBytes?u:t&&t.asString?r.convertString.bytesToString(u):r.bytesToHex(u)}s.x2=function(e,t){return s(s(e,{asBytes:!0}),t)}}(CB)}));function XX(e){e=e.trim();const t=[];for(let r=0;r<e.length;r+=2)t.push(parseInt(e.substring(r,r+2),16));return t}var YX=RB((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),QX=RB((function(e,t){
|
|
327
327
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
328
|
-
var r=BU.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=BU:(n(BU,t),t.Buffer=i),i.prototype=Object.create(r.prototype),n(r,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return BU.SlowBuffer(e)}}));QX.Buffer;var ZX=AH.EventEmitter;function eY(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var rY=BU.Buffer,nY=QV.inspect,iY=nY&&nY.custom||"inspect";function oY(e,t,r){rY.prototype.copy.call(e,t,r)}var sY=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t;return(t=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return rY.alloc(0);for(var t=rY.allocUnsafe(e>>>0),r=this.head,n=0;r;)oY(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=rY.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:iY,value:function(e,t){return nY(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eY(Object(r),!0).forEach((function(t){tY(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eY(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}();function aY(e,t){cY(e,t),uY(e)}function uY(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function cY(e,t){e.emit("error",t)}var lY=function(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,XU(cY,this,e)):XU(cY,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?XU(uY,r):(r._writableState.errorEmitted=!0,XU(aY,r,e)):XU(aY,r,e):t?(XU(uY,r),t(e)):XU(uY,r)})),this)},hY=function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},fY=function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)},dY={};function pY(e,t,r){r||(r=Error);var n=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);n.prototype.name=r.name,n.prototype.code=e,dY[e]=n}function gY(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}pY("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),pY("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,o;if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))o="The ".concat(e," ").concat(n," ").concat(gY(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+".".length>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";o='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(gY(t,"type"))}return o+". Received type ".concat(typeof r)}),TypeError),pY("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),pY("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),pY("ERR_STREAM_PREMATURE_CLOSE","Premature close"),pY("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),pY("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),pY("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),pY("ERR_STREAM_WRITE_AFTER_END","write after end"),pY("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),pY("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),pY("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");var mY={codes:dY},vY=mY.codes.ERR_INVALID_OPT_VALUE,yY=function(e,t,r,n){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,n,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new vY(n?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384};function bY(e){try{if(!CB.localStorage)return!1}catch(e){return!1}var t=CB.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}var wY,_Y=FY;function xY(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}FY.WritableState=UY;var SY,EY=function(e,t){if(bY("noDeprecation"))return e;var r=!1;return function(){if(!r){if(bY("throwDeprecation"))throw new Error(t);bY("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}},kY=BU.Buffer,IY=CB.Uint8Array||function(){},AY=yY,PY=mY.codes,TY=PY.ERR_INVALID_ARG_TYPE,OY=PY.ERR_METHOD_NOT_IMPLEMENTED,CY=PY.ERR_MULTIPLE_CALLBACK,MY=PY.ERR_STREAM_CANNOT_PIPE,RY=PY.ERR_STREAM_DESTROYED,NY=PY.ERR_STREAM_NULL_VALUES,LY=PY.ERR_STREAM_WRITE_AFTER_END,jY=PY.ERR_UNKNOWN_ENCODING,DY=fY;function BY(){}function UY(e,t,r){wY=wY||JY,e=e||{},"boolean"!=typeof r&&(r=t instanceof wY),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=AY(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=!1===e.decodeStrings;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new CY;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(XU(i,n),XU($Y,e,t),e._writableState.errorEmitted=!0,DY(e,n)):(i(n),e._writableState.errorEmitted=!0,DY(e,n),$Y(e,t))}(e,r,n,t,i);else{var o=qY(r)||e.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||VY(e,r),n?XU(zY,e,r,o,i):zY(e,r,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new xY(this)}function FY(e){var t=this instanceof(wY=wY||JY);if(!t&&!SY.call(FY,this))return new FY(e);this._writableState=new UY(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),ZX.call(this)}function HY(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new RY("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function zY(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),$Y(e,t)}function VY(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)i[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;i.allBuffers=a,HY(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new xY(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback;if(HY(e,t,!1,t.objectMode?1:u.length,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function qY(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function KY(e,t){e._final((function(r){t.pendingcb--,r&&DY(e,r),t.prefinished=!0,e.emit("prefinish"),$Y(e,t)}))}function $Y(e,t){var r=qY(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,XU(KY,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}YX(FY,ZX),UY.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(UY.prototype,"buffer",{get:EY((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(SY=Function.prototype[Symbol.hasInstance],Object.defineProperty(FY,Symbol.hasInstance,{value:function(e){return!!SY.call(this,e)||this===FY&&e&&e._writableState instanceof UY}})):SY=function(e){return e instanceof this},FY.prototype.pipe=function(){DY(this,new MY)},FY.prototype.write=function(e,t,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(n=e,kY.isBuffer(n)||n instanceof IY);return s&&!kY.isBuffer(e)&&(e=function(e){return kY.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=BY),i.ending?function(e,t){var r=new LY;DY(e,r),XU(t,r)}(this,r):(s||function(e,t,r,n){var i;return null===r?i=new NY:"string"==typeof r||t.objectMode||(i=new TY("chunk",["string","Buffer"],r)),!i||(DY(e,i),XU(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=kY.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else HY(e,t,!1,a,n,i,o);return u}(this,i,s,e,t,r)),o},FY.prototype.cork=function(){this._writableState.corked++},FY.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||VY(this,e))},FY.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new jY(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(FY.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(FY.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),FY.prototype._write=function(e,t,r){r(new OY("_write()"))},FY.prototype._writev=null,FY.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,$Y(e,t),r&&(t.finished?XU(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(FY.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(FY.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),FY.prototype.destroy=lY,FY.prototype._undestroy=hY,FY.prototype._destroy=function(e,t){t(e)};var WY=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t},JY=QY;YX(QY,NQ);for(var GY=WY(_Y.prototype),XY=0;XY<GY.length;XY++){var YY=GY[XY];QY.prototype[YY]||(QY.prototype[YY]=_Y.prototype[YY])}function QY(e){if(!(this instanceof QY))return new QY(e);NQ.call(this,e),_Y.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",ZY)))}function ZY(){this._writableState.ended||XU(eQ,this)}function eQ(e){e.end()}Object.defineProperty(QY.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(QY.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(QY.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(QY.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}});var tQ=QX.Buffer,rQ=tQ.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},nQ=iQ;function iQ(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(tQ.isEncoding===rQ||!rQ(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=aQ,this.end=uQ,t=4;break;case"utf8":this.fillLast=sQ,t=4;break;case"base64":this.text=cQ,this.end=lQ,t=3;break;default:return this.write=hQ,void(this.end=fQ)}this.lastNeed=0,this.lastTotal=0,this.lastChar=tQ.allocUnsafe(t)}function oQ(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function sQ(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function aQ(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function uQ(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function cQ(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function lQ(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function hQ(e){return e.toString(this.encoding)}function fQ(e){return e&&e.length?this.write(e):""}iQ.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},iQ.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},iQ.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=oQ(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=oQ(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=oQ(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},iQ.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var dQ={StringDecoder:nQ},pQ=mY.codes.ERR_STREAM_PREMATURE_CLOSE;function gQ(){}var mQ,vQ=function e(t,r,n){if("function"==typeof r)return e(t,null,r);r||(r={}),n=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(n||gQ);var i=r.readable||!1!==r.readable&&t.readable,o=r.writable||!1!==r.writable&&t.writable,s=function(){t.writable||u()},a=t._writableState&&t._writableState.finished,u=function(){o=!1,a=!0,i||n.call(t)},c=t._readableState&&t._readableState.endEmitted,l=function(){i=!1,c=!0,o||n.call(t)},h=function(e){n.call(t,e)},f=function(){var e;return i&&!c?(t._readableState&&t._readableState.ended||(e=new pQ),n.call(t,e)):o&&!a?(t._writableState&&t._writableState.ended||(e=new pQ),n.call(t,e)):void 0},d=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",f),t.req?d():t.on("request",d)):o&&!t._writableState&&(t.on("end",s),t.on("close",s)),t.on("end",l),t.on("finish",u),!1!==r.error&&t.on("error",h),t.on("close",f),function(){t.removeListener("complete",u),t.removeListener("abort",f),t.removeListener("request",d),t.req&&t.req.removeListener("finish",u),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",u),t.removeListener("end",l),t.removeListener("error",h),t.removeListener("close",f)}};function yQ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var bQ=Symbol("lastResolve"),wQ=Symbol("lastReject"),_Q=Symbol("error"),xQ=Symbol("ended"),SQ=Symbol("lastPromise"),EQ=Symbol("handlePromise"),kQ=Symbol("stream");function IQ(e,t){return{value:e,done:t}}function AQ(e){var t=e[bQ];if(null!==t){var r=e[kQ].read();null!==r&&(e[SQ]=null,e[bQ]=null,e[wQ]=null,t(IQ(r,!1)))}}function PQ(e){XU(AQ,e)}var TQ,OQ=Object.getPrototypeOf((function(){})),CQ=Object.setPrototypeOf((yQ(mQ={get stream(){return this[kQ]},next:function(){var e=this,t=this[_Q];if(null!==t)return Promise.reject(t);if(this[xQ])return Promise.resolve(IQ(void 0,!0));if(this[kQ].destroyed)return new Promise((function(t,r){XU((function(){e[_Q]?r(e[_Q]):t(IQ(void 0,!0))}))}));var r,n=this[SQ];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[xQ]?r(IQ(void 0,!0)):t[EQ](r,n)}),n)}}(n,this));else{var i=this[kQ].read();if(null!==i)return Promise.resolve(IQ(i,!1));r=new Promise(this[EQ])}return this[SQ]=r,r}},Symbol.asyncIterator,(function(){return this})),yQ(mQ,"return",(function(){var e=this;return new Promise((function(t,r){e[kQ].destroy(null,(function(e){e?r(e):t(IQ(void 0,!0))}))}))})),mQ),OQ),MQ=function(e){var t,r=Object.create(CQ,(yQ(t={},kQ,{value:e,writable:!0}),yQ(t,bQ,{value:null,writable:!0}),yQ(t,wQ,{value:null,writable:!0}),yQ(t,_Q,{value:null,writable:!0}),yQ(t,xQ,{value:e._readableState.endEmitted,writable:!0}),yQ(t,EQ,{value:function(e,t){var n=r[kQ].read();n?(r[SQ]=null,r[bQ]=null,r[wQ]=null,e(IQ(n,!1))):(r[bQ]=e,r[wQ]=t)},writable:!0}),t));return r[SQ]=null,vQ(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[wQ];return null!==t&&(r[SQ]=null,r[bQ]=null,r[wQ]=null,t(e)),void(r[_Q]=e)}var n=r[bQ];null!==n&&(r[SQ]=null,r[bQ]=null,r[wQ]=null,n(IQ(void 0,!0))),r[xQ]=!0})),e.on("readable",PQ.bind(null,r)),r},RQ=function(){throw new Error("Readable.from is not available in the browser")},NQ=YQ;YQ.ReadableState=XQ;var LQ,jQ=function(e,t){return e.listeners(t).length},DQ=BU.Buffer,BQ=CB.Uint8Array||function(){};LQ=QV&&QV.debuglog?QV.debuglog("stream"):function(){};var UQ,FQ,HQ,zQ=yY,VQ=mY.codes,qQ=VQ.ERR_INVALID_ARG_TYPE,KQ=VQ.ERR_STREAM_PUSH_AFTER_EOF,$Q=VQ.ERR_METHOD_NOT_IMPLEMENTED,WQ=VQ.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;YX(YQ,ZX);var JQ=fY,GQ=["error","close","destroy","pause","resume"];function XQ(e,t,r){TQ=TQ||JY,e=e||{},"boolean"!=typeof r&&(r=t instanceof TQ),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=zQ(this,e,"readableHighWaterMark",r),this.buffer=new sY,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(UQ||(UQ=dQ.StringDecoder),this.decoder=new UQ(e.encoding),this.encoding=e.encoding)}function YQ(e){if(TQ=TQ||JY,!(this instanceof YQ))return new YQ(e);var t=this instanceof TQ;this._readableState=new XQ(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),ZX.call(this)}function QQ(e,t,r,n,i){LQ("readableAddChunk",t);var o,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(LQ("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?tZ(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,rZ(e)))}}(e,s);else if(i||(o=function(e,t){var r,n;return n=t,DQ.isBuffer(n)||n instanceof BQ||"string"==typeof t||void 0===t||e.objectMode||(r=new qQ("chunk",["string","Buffer","Uint8Array"],t)),r}(s,t)),o)JQ(e,o);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===DQ.prototype||(t=function(e){return DQ.from(e)}(t)),n)s.endEmitted?JQ(e,new WQ):ZQ(e,s,t,!0);else if(s.ended)JQ(e,new KQ);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?ZQ(e,s,t,!1):nZ(e,s)):ZQ(e,s,t,!1)}else n||(s.reading=!1,nZ(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function ZQ(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&tZ(e)),nZ(e,t)}function eZ(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function tZ(e){var t=e._readableState;LQ("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(LQ("emitReadable",t.flowing),t.emittedReadable=!0,XU(rZ,e))}function rZ(e){var t=e._readableState;LQ("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,uZ(e)}function nZ(e,t){t.readingMore||(t.readingMore=!0,XU(iZ,e,t))}function iZ(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(LQ("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function oZ(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function sZ(e){LQ("readable nexttick read 0"),e.read(0)}function aZ(e,t){LQ("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),uZ(e),t.flowing&&!t.reading&&e.read(0)}function uZ(e){var t=e._readableState;for(LQ("flow",t.flowing);t.flowing&&null!==e.read(););}function cZ(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function lZ(e){var t=e._readableState;LQ("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,XU(hZ,t,e))}function hZ(e,t){if(LQ("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function fZ(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}Object.defineProperty(YQ.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),YQ.prototype.destroy=lY,YQ.prototype._undestroy=hY,YQ.prototype._destroy=function(e,t){t(e)},YQ.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=DQ.from(e,t),t=""),r=!0),QQ(this,e,t,!1,r)},YQ.prototype.unshift=function(e){return QQ(this,e,null,!0,!1)},YQ.prototype.isPaused=function(){return!1===this._readableState.flowing},YQ.prototype.setEncoding=function(e){UQ||(UQ=dQ.StringDecoder);var t=new UQ(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this},YQ.prototype.read=function(e){LQ("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return LQ("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?lZ(this):tZ(this),null;if(0===(e=eZ(e,t))&&t.ended)return 0===t.length&&lZ(this),null;var n,i=t.needReadable;return LQ("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&LQ("length less than watermark",i=!0),t.ended||t.reading?LQ("reading or ended",i=!1):i&&(LQ("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=eZ(r,t))),null===(n=e>0?cZ(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&lZ(this)),null!==n&&this.emit("data",n),n},YQ.prototype._read=function(e){JQ(this,new $Q("_read()"))},YQ.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,LQ("pipe count=%d opts=%j",n.pipesCount,t);var i=t&&!1===t.end||e===cF.stdout||e===cF.stderr?f:o;function o(){LQ("onend"),e.end()}n.endEmitted?XU(i):r.once("end",i),e.on("unpipe",(function t(i,d){LQ("onunpipe"),i===r&&d&&!1===d.hasUnpiped&&(d.hasUnpiped=!0,LQ("cleanup"),e.removeListener("close",l),e.removeListener("finish",h),e.removeListener("drain",s),e.removeListener("error",c),e.removeListener("unpipe",t),r.removeListener("end",o),r.removeListener("end",f),r.removeListener("data",u),a=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||s())}));var s=function(e){return function(){var t=e._readableState;LQ("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&jQ(e,"data")&&(t.flowing=!0,uZ(e))}}(r);e.on("drain",s);var a=!1;function u(t){LQ("ondata");var i=e.write(t);LQ("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==fZ(n.pipes,e))&&!a&&(LQ("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function c(t){LQ("onerror",t),f(),e.removeListener("error",c),0===jQ(e,"error")&&JQ(e,t)}function l(){e.removeListener("finish",h),f()}function h(){LQ("onfinish"),e.removeListener("close",l),f()}function f(){LQ("unpipe"),r.unpipe(e)}return r.on("data",u),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",c),e.once("close",l),e.once("finish",h),e.emit("pipe",r),n.flowing||(LQ("pipe resume"),r.resume()),e},YQ.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=fZ(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},YQ.prototype.on=function(e,t){var r=ZX.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,LQ("on readable",n.length,n.reading),n.length?tZ(this):n.reading||XU(sZ,this))),r},YQ.prototype.addListener=YQ.prototype.on,YQ.prototype.removeListener=function(e,t){var r=ZX.prototype.removeListener.call(this,e,t);return"readable"===e&&XU(oZ,this),r},YQ.prototype.removeAllListeners=function(e){var t=ZX.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||XU(oZ,this),t},YQ.prototype.resume=function(){var e=this._readableState;return e.flowing||(LQ("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,XU(aZ,e,t))}(this,e)),e.paused=!1,this},YQ.prototype.pause=function(){return LQ("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(LQ("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},YQ.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(LQ("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){LQ("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<GQ.length;o++)e.on(GQ[o],this.emit.bind(this,GQ[o]));return this._read=function(t){LQ("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(YQ.prototype[Symbol.asyncIterator]=function(){return void 0===FQ&&(FQ=MQ),FQ(this)}),Object.defineProperty(YQ.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(YQ.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(YQ.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),YQ._fromList=cZ,Object.defineProperty(YQ.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(YQ.from=function(e,t){return void 0===HQ&&(HQ=RQ),HQ(YQ,e,t)});var dZ=wZ,pZ=mY.codes,gZ=pZ.ERR_METHOD_NOT_IMPLEMENTED,mZ=pZ.ERR_MULTIPLE_CALLBACK,vZ=pZ.ERR_TRANSFORM_ALREADY_TRANSFORMING,yZ=pZ.ERR_TRANSFORM_WITH_LENGTH_0;function bZ(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new mZ);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function wZ(e){if(!(this instanceof wZ))return new wZ(e);JY.call(this,e),this._transformState={afterTransform:bZ.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",_Z)}function _Z(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?xZ(this,null,null):this._flush((function(t,r){xZ(e,t,r)}))}function xZ(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new yZ;if(e._transformState.transforming)throw new vZ;return e.push(null)}YX(wZ,JY),wZ.prototype.push=function(e,t){return this._transformState.needTransform=!1,JY.prototype.push.call(this,e,t)},wZ.prototype._transform=function(e,t,r){r(new gZ("_transform()"))},wZ.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},wZ.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},wZ.prototype._destroy=function(e,t){JY.prototype._destroy.call(this,e,(function(e){t(e)}))};var SZ,EZ=kZ;function kZ(e){if(!(this instanceof kZ))return new kZ(e);dZ.call(this,e)}YX(kZ,dZ),kZ.prototype._transform=function(e,t,r){r(null,e)};var IZ=mY.codes,AZ=IZ.ERR_MISSING_ARGS,PZ=IZ.ERR_STREAM_DESTROYED;function TZ(e){if(e)throw e}function OZ(e,t,r,n){n=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(n);var i=!1;e.on("close",(function(){i=!0})),void 0===SZ&&(SZ=vQ),SZ(e,{readable:t,writable:r},(function(e){if(e)return n(e);i=!0,n()}));var o=!1;return function(t){if(!i&&!o)return o=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void n(t||new PZ("pipe"))}}function CZ(e){e()}function MZ(e,t){return e.pipe(t)}function RZ(e){return e.length?"function"!=typeof e[e.length-1]?TZ:e.pop():TZ}var NZ=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=RZ(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new AZ("streams");var o=t.map((function(e,r){var s=r<t.length-1;return OZ(e,s,r>0,(function(e){n||(n=e),e&&o.forEach(CZ),s||(o.forEach(CZ),i(n))}))}));return t.reduce(MZ)},LZ=RB((function(e,t){(t=e.exports=NQ).Stream=t,t.Readable=t,t.Writable=_Y,t.Duplex=JY,t.Transform=dZ,t.PassThrough=EZ,t.finished=vQ,t.pipeline=NZ}));LZ.Stream,LZ.Readable,LZ.Writable,LZ.Duplex,LZ.Transform,LZ.PassThrough,LZ.finished,LZ.pipeline;var jZ=QX.Buffer,DZ=LZ.Transform;function BZ(e){DZ.call(this),this._block=jZ.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}YX(BZ,DZ),BZ.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},BZ.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},BZ.prototype.update=function(e,t){if(function(e,t){if(!jZ.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");jZ.isBuffer(e)||(e=jZ.from(e,t));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=e[n++];this._update(),this._blockOffset=0}for(;n<e.length;)r[this._blockOffset++]=e[n++];for(var o=0,s=8*e.length;s>0;++o)this._length[o]+=s,(s=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*s);return this},BZ.prototype._update=function(){throw new Error("_update is not implemented")},BZ.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},BZ.prototype._digest=function(){throw new Error("_digest is not implemented")};var UZ=BZ,FZ=QX.Buffer,HZ=new Array(16);function zZ(){UZ.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function VZ(e,t){return e<<t|e>>>32-t}function qZ(e,t,r,n,i,o,s){return VZ(e+(t&r|~t&n)+i+o|0,s)+t|0}function KZ(e,t,r,n,i,o,s){return VZ(e+(t&n|r&~n)+i+o|0,s)+t|0}function $Z(e,t,r,n,i,o,s){return VZ(e+(t^r^n)+i+o|0,s)+t|0}function WZ(e,t,r,n,i,o,s){return VZ(e+(r^(t|~n))+i+o|0,s)+t|0}YX(zZ,UZ),zZ.prototype._update=function(){for(var e=HZ,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=qZ(r,n,i,o,e[0],3614090360,7),o=qZ(o,r,n,i,e[1],3905402710,12),i=qZ(i,o,r,n,e[2],606105819,17),n=qZ(n,i,o,r,e[3],3250441966,22),r=qZ(r,n,i,o,e[4],4118548399,7),o=qZ(o,r,n,i,e[5],1200080426,12),i=qZ(i,o,r,n,e[6],2821735955,17),n=qZ(n,i,o,r,e[7],4249261313,22),r=qZ(r,n,i,o,e[8],1770035416,7),o=qZ(o,r,n,i,e[9],2336552879,12),i=qZ(i,o,r,n,e[10],4294925233,17),n=qZ(n,i,o,r,e[11],2304563134,22),r=qZ(r,n,i,o,e[12],1804603682,7),o=qZ(o,r,n,i,e[13],4254626195,12),i=qZ(i,o,r,n,e[14],2792965006,17),r=KZ(r,n=qZ(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=KZ(o,r,n,i,e[6],3225465664,9),i=KZ(i,o,r,n,e[11],643717713,14),n=KZ(n,i,o,r,e[0],3921069994,20),r=KZ(r,n,i,o,e[5],3593408605,5),o=KZ(o,r,n,i,e[10],38016083,9),i=KZ(i,o,r,n,e[15],3634488961,14),n=KZ(n,i,o,r,e[4],3889429448,20),r=KZ(r,n,i,o,e[9],568446438,5),o=KZ(o,r,n,i,e[14],3275163606,9),i=KZ(i,o,r,n,e[3],4107603335,14),n=KZ(n,i,o,r,e[8],1163531501,20),r=KZ(r,n,i,o,e[13],2850285829,5),o=KZ(o,r,n,i,e[2],4243563512,9),i=KZ(i,o,r,n,e[7],1735328473,14),r=$Z(r,n=KZ(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=$Z(o,r,n,i,e[8],2272392833,11),i=$Z(i,o,r,n,e[11],1839030562,16),n=$Z(n,i,o,r,e[14],4259657740,23),r=$Z(r,n,i,o,e[1],2763975236,4),o=$Z(o,r,n,i,e[4],1272893353,11),i=$Z(i,o,r,n,e[7],4139469664,16),n=$Z(n,i,o,r,e[10],3200236656,23),r=$Z(r,n,i,o,e[13],681279174,4),o=$Z(o,r,n,i,e[0],3936430074,11),i=$Z(i,o,r,n,e[3],3572445317,16),n=$Z(n,i,o,r,e[6],76029189,23),r=$Z(r,n,i,o,e[9],3654602809,4),o=$Z(o,r,n,i,e[12],3873151461,11),i=$Z(i,o,r,n,e[15],530742520,16),r=WZ(r,n=$Z(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=WZ(o,r,n,i,e[7],1126891415,10),i=WZ(i,o,r,n,e[14],2878612391,15),n=WZ(n,i,o,r,e[5],4237533241,21),r=WZ(r,n,i,o,e[12],1700485571,6),o=WZ(o,r,n,i,e[3],2399980690,10),i=WZ(i,o,r,n,e[10],4293915773,15),n=WZ(n,i,o,r,e[1],2240044497,21),r=WZ(r,n,i,o,e[8],1873313359,6),o=WZ(o,r,n,i,e[15],4264355552,10),i=WZ(i,o,r,n,e[6],2734768916,15),n=WZ(n,i,o,r,e[13],1309151649,21),r=WZ(r,n,i,o,e[4],4149444226,6),o=WZ(o,r,n,i,e[11],3174756917,10),i=WZ(i,o,r,n,e[2],718787259,15),n=WZ(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},zZ.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=FZ.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};var JZ=zZ,GZ=BU.Buffer,XZ=new Array(16),YZ=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],QZ=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],ZZ=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],e0=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],t0=[0,1518500249,1859775393,2400959708,2840853838],r0=[1352829926,1548603684,1836072691,2053994217,0];function n0(){UZ.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function i0(e,t){return e<<t|e>>>32-t}function o0(e,t,r,n,i,o,s,a){return i0(e+(t^r^n)+o+s|0,a)+i|0}function s0(e,t,r,n,i,o,s,a){return i0(e+(t&r|~t&n)+o+s|0,a)+i|0}function a0(e,t,r,n,i,o,s,a){return i0(e+((t|~r)^n)+o+s|0,a)+i|0}function u0(e,t,r,n,i,o,s,a){return i0(e+(t&n|r&~n)+o+s|0,a)+i|0}function c0(e,t,r,n,i,o,s,a){return i0(e+(t^(r|~n))+o+s|0,a)+i|0}YX(n0,UZ),n0.prototype._update=function(){for(var e=XZ,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,a=0|this._a,u=0|this._b,c=0|this._c,l=0|this._d,h=0|this._e,f=0;f<80;f+=1){var d,p;f<16?(d=o0(r,n,i,o,s,e[YZ[f]],t0[0],ZZ[f]),p=c0(a,u,c,l,h,e[QZ[f]],r0[0],e0[f])):f<32?(d=s0(r,n,i,o,s,e[YZ[f]],t0[1],ZZ[f]),p=u0(a,u,c,l,h,e[QZ[f]],r0[1],e0[f])):f<48?(d=a0(r,n,i,o,s,e[YZ[f]],t0[2],ZZ[f]),p=a0(a,u,c,l,h,e[QZ[f]],r0[2],e0[f])):f<64?(d=u0(r,n,i,o,s,e[YZ[f]],t0[3],ZZ[f]),p=s0(a,u,c,l,h,e[QZ[f]],r0[3],e0[f])):(d=c0(r,n,i,o,s,e[YZ[f]],t0[4],ZZ[f]),p=o0(a,u,c,l,h,e[QZ[f]],r0[4],e0[f])),r=s,s=o,o=i0(i,10),i=n,n=d,a=h,h=l,l=i0(c,10),c=u,u=p}var g=this._b+i+l|0;this._b=this._c+o+h|0,this._c=this._d+s+a|0,this._d=this._e+r+u|0,this._e=this._a+n+c|0,this._a=g},n0.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=GZ.alloc?GZ.alloc(20):new GZ(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};var l0=n0,h0=QX.Buffer;function f0(e,t){this._block=h0.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}f0.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=h0.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,o=this._len,s=0;s<i;){for(var a=o%n,u=Math.min(i-s,n-a),c=0;c<u;c++)r[a+c]=e[s+c];s+=u,(o+=u)%n==0&&this._update(r)}return this._len+=i,this},f0.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},f0.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var d0=f0,p0=QX.Buffer,g0=[1518500249,1859775393,-1894007588,-899497514],m0=new Array(80);function v0(){this.init(),this._w=m0,d0.call(this,64,56)}function y0(e){return e<<30|e>>>2}function b0(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}YX(v0,d0),v0.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},v0.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,u=0;u<16;++u)r[u]=e.readInt32BE(4*u);for(;u<80;++u)r[u]=r[u-3]^r[u-8]^r[u-14]^r[u-16];for(var c=0;c<80;++c){var l=~~(c/20),h=0|((t=n)<<5|t>>>27)+b0(l,i,o,s)+a+r[c]+g0[l];a=s,s=o,o=y0(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},v0.prototype._hash=function(){var e=p0.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var w0=v0,_0=QX.Buffer,x0=[1518500249,1859775393,-1894007588,-899497514],S0=new Array(80);function E0(){this.init(),this._w=S0,d0.call(this,64,56)}function k0(e){return e<<5|e>>>27}function I0(e){return e<<30|e>>>2}function A0(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}YX(E0,d0),E0.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},E0.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,u=0;u<16;++u)r[u]=e.readInt32BE(4*u);for(;u<80;++u)r[u]=(t=r[u-3]^r[u-8]^r[u-14]^r[u-16])<<1|t>>>31;for(var c=0;c<80;++c){var l=~~(c/20),h=k0(n)+A0(l,i,o,s)+a+r[c]+x0[l]|0;a=s,s=o,o=I0(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},E0.prototype._hash=function(){var e=_0.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var P0=E0,T0=QX.Buffer,O0=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],C0=new Array(64);function M0(){this.init(),this._w=C0,d0.call(this,64,56)}function R0(e,t,r){return r^e&(t^r)}function N0(e,t,r){return e&t|r&(e|t)}function L0(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function j0(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function D0(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function B0(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}YX(M0,d0),M0.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},M0.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,a=0|this._f,u=0|this._g,c=0|this._h,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<64;++l)t[l]=B0(t[l-2])+t[l-7]+D0(t[l-15])+t[l-16]|0;for(var h=0;h<64;++h){var f=c+j0(s)+R0(s,a,u)+O0[h]+t[h]|0,d=L0(r)+N0(r,n,i)|0;c=u,u=a,a=s,s=o+f|0,o=i,i=n,n=r,r=f+d|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=a+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0},M0.prototype._hash=function(){var e=T0.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var U0=M0,F0=QX.Buffer,H0=new Array(64);function z0(){this.init(),this._w=H0,d0.call(this,64,56)}YX(z0,U0),z0.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},z0.prototype._hash=function(){var e=F0.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var V0=z0,q0=QX.Buffer,K0=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],$0=new Array(160);function W0(){this.init(),this._w=$0,d0.call(this,128,112)}function J0(e,t,r){return r^e&(t^r)}function G0(e,t,r){return e&t|r&(e|t)}function X0(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Y0(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Q0(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Z0(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function e1(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function t1(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function r1(e,t){return e>>>0<t>>>0?1:0}YX(W0,d0),W0.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},W0.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,a=0|this._fh,u=0|this._gh,c=0|this._hh,l=0|this._al,h=0|this._bl,f=0|this._cl,d=0|this._dl,p=0|this._el,g=0|this._fl,m=0|this._gl,v=0|this._hl,y=0;y<32;y+=2)t[y]=e.readInt32BE(4*y),t[y+1]=e.readInt32BE(4*y+4);for(;y<160;y+=2){var b=t[y-30],w=t[y-30+1],_=Q0(b,w),x=Z0(w,b),S=e1(b=t[y-4],w=t[y-4+1]),E=t1(w,b),k=t[y-14],I=t[y-14+1],A=t[y-32],P=t[y-32+1],T=x+I|0,O=_+k+r1(T,x)|0;O=(O=O+S+r1(T=T+E|0,E)|0)+A+r1(T=T+P|0,P)|0,t[y]=O,t[y+1]=T}for(var C=0;C<160;C+=2){O=t[C],T=t[C+1];var M=G0(r,n,i),R=G0(l,h,f),N=X0(r,l),L=X0(l,r),j=Y0(s,p),D=Y0(p,s),B=K0[C],U=K0[C+1],F=J0(s,a,u),H=J0(p,g,m),z=v+D|0,V=c+j+r1(z,v)|0;V=(V=(V=V+F+r1(z=z+H|0,H)|0)+B+r1(z=z+U|0,U)|0)+O+r1(z=z+T|0,T)|0;var q=L+R|0,K=N+M+r1(q,L)|0;c=u,v=m,u=a,m=g,a=s,g=p,s=o+V+r1(p=d+z|0,d)|0,o=i,d=f,i=n,f=h,n=r,h=l,r=V+K+r1(l=z+q|0,z)|0}this._al=this._al+l|0,this._bl=this._bl+h|0,this._cl=this._cl+f|0,this._dl=this._dl+d|0,this._el=this._el+p|0,this._fl=this._fl+g|0,this._gl=this._gl+m|0,this._hl=this._hl+v|0,this._ah=this._ah+r+r1(this._al,l)|0,this._bh=this._bh+n+r1(this._bl,h)|0,this._ch=this._ch+i+r1(this._cl,f)|0,this._dh=this._dh+o+r1(this._dl,d)|0,this._eh=this._eh+s+r1(this._el,p)|0,this._fh=this._fh+a+r1(this._fl,g)|0,this._gh=this._gh+u+r1(this._gl,m)|0,this._hh=this._hh+c+r1(this._hl,v)|0},W0.prototype._hash=function(){var e=q0.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var n1=W0,i1=QX.Buffer,o1=new Array(160);function s1(){this.init(),this._w=o1,d0.call(this,128,112)}YX(s1,n1),s1.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},s1.prototype._hash=function(){var e=i1.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var a1=s1,u1=RB((function(e){var t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};t.sha=w0,t.sha1=P0,t.sha224=V0,t.sha256=U0,t.sha384=a1,t.sha512=n1})),c1=QX.Buffer,l1=Az.Transform,h1=qH.StringDecoder;function f1(e){l1.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}YX(f1,l1),f1.prototype.update=function(e,t,r){"string"==typeof e&&(e=c1.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},f1.prototype.setAutoPadding=function(){},f1.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},f1.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},f1.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},f1.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},f1.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},f1.prototype._finalOrDigest=function(e){var t=this.__final()||c1.alloc(0);return e&&(t=this._toString(t,e,!0)),t},f1.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new h1(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n};var d1=f1;function p1(e){d1.call(this,"digest"),this._hash=e}YX(p1,d1),p1.prototype._update=function(e){this._hash.update(e)},p1.prototype._final=function(){return this._hash.digest()};var g1=function(e){return"md5"===(e=e.toLowerCase())?new JZ:"rmd160"===e||"ripemd160"===e?new l0:new p1(u1(e))},m1=QX.Buffer,v1=m1.alloc(128);function y1(e,t){d1.call(this,"digest"),"string"==typeof t&&(t=m1.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=m1.concat([t,v1],64));for(var r=this._ipad=m1.allocUnsafe(64),n=this._opad=m1.allocUnsafe(64),i=0;i<64;i++)r[i]=54^t[i],n[i]=92^t[i];this._hash=[r]}YX(y1,d1),y1.prototype._update=function(e){this._hash.push(e)},y1.prototype._final=function(){var e=this._alg(m1.concat(this._hash));return this._alg(m1.concat([this._opad,e]))};var b1=y1,w1=function(e){return(new JZ).update(e).digest()},_1=QX.Buffer,x1=_1.alloc(128);function S1(e,t){d1.call(this,"digest"),"string"==typeof t&&(t=_1.from(t));var r="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>r?t=("rmd160"===e?new l0:u1(e)).update(t).digest():t.length<r&&(t=_1.concat([t,x1],r));for(var n=this._ipad=_1.allocUnsafe(r),i=this._opad=_1.allocUnsafe(r),o=0;o<r;o++)n[o]=54^t[o],i[o]=92^t[o];this._hash="rmd160"===e?new l0:u1(e),this._hash.update(n)}YX(S1,d1),S1.prototype._update=function(e){this._hash.update(e)},S1.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new l0:u1(this._alg)).update(this._opad).update(e).digest()};var E1=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new S1("rmd160",t):"md5"===e?new b1(w1,t):new S1(e,t)},k1=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hash160=function(e){const t=g1("sha256").update(e).digest();try{return g1("rmd160").update(t).digest()}catch(e){return g1("ripemd160").update(t).digest()}},t.hmacSHA512=function(e,t){return E1("sha512",e).update(t).digest()}}));MB(k1),k1.hash160,k1.hmacSHA512;var I1=QX.Buffer,A1=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}var s=e.length,a=e.charAt(0),u=Math.log(s)/Math.log(256),c=Math.log(256)/Math.log(s);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return I1.alloc(0);var r=0;if(" "!==e[r]){for(var n=0,i=0;e[r]===a;)n++,r++;for(var o=(e.length-r)*u+1>>>0,c=new Uint8Array(o);e[r];){var l=t[e.charCodeAt(r)];if(255===l)return;for(var h=0,f=o-1;(0!==l||h<i)&&-1!==f;f--,h++)l+=s*c[f]>>>0,c[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=h,r++}if(" "!==e[r]){for(var d=o-i;d!==o&&0===c[d];)d++;var p=I1.allocUnsafe(n+(o-d));p.fill(0,0,n);for(var g=n;d!==o;)p[g++]=c[d++];return p}}}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=I1.from(t)),!I1.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var u=(o-i)*c+1>>>0,l=new Uint8Array(u);i!==o;){for(var h=t[i],f=0,d=u-1;(0!==h||f<n)&&-1!==d;d--,f++)h+=256*l[d]>>>0,l[d]=h%s>>>0,h=h/s>>>0;if(0!==h)throw new Error("Non-zero carry");n=f,i++}for(var p=u-n;p!==u&&0===l[p];)p++;for(var g=a.repeat(r);p<u;++p)g+=e.charAt(l[p]);return g},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),P1=QX.Buffer,T1=function(e){function t(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(t){var r=e(t);return A1.encode(P1.concat([t,r],t.length+4))},decode:function(e){var r=t(A1.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=A1.decodeUnsafe(e);if(r)return t(r)}}}((function(e){var t=g1("sha256").update(e).digest();return g1("sha256").update(t).digest()})),O1=RB((function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:QV.Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===n)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=a(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=a(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l<a;l+=n)c=u(e,l,l+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var h=1;for(c=u(e,l,e.length,t),l=0;l<s;l++)h*=t;this.imuln(h),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,h=67108863&u,f=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=f;d++){var p=c-d|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[d])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);n=0!=(o=a>>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var f=l[e],d=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(e);n=(p=p.idivn(d)).isZero()?g+n:c[f-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[o-a-1]=s}return c},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,l=0|s[0],h=8191&l,f=l>>>13,d=0|s[1],p=8191&d,g=d>>>13,m=0|s[2],v=8191&m,y=m>>>13,b=0|s[3],w=8191&b,_=b>>>13,x=0|s[4],S=8191&x,E=x>>>13,k=0|s[5],I=8191&k,A=k>>>13,P=0|s[6],T=8191&P,O=P>>>13,C=0|s[7],M=8191&C,R=C>>>13,N=0|s[8],L=8191&N,j=N>>>13,D=0|s[9],B=8191&D,U=D>>>13,F=0|a[0],H=8191&F,z=F>>>13,V=0|a[1],q=8191&V,K=V>>>13,$=0|a[2],W=8191&$,J=$>>>13,G=0|a[3],X=8191&G,Y=G>>>13,Q=0|a[4],Z=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,le=0|a[8],he=8191&le,fe=le>>>13,de=0|a[9],pe=8191&de,ge=de>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(h,H))|0)+((8191&(i=(i=Math.imul(h,z))+Math.imul(f,H)|0))<<13)|0;c=((o=Math.imul(f,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,z))+Math.imul(g,H)|0,o=Math.imul(g,z);var ve=(c+(n=n+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(f,q)|0))<<13)|0;c=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,H),i=(i=Math.imul(v,z))+Math.imul(y,H)|0,o=Math.imul(y,z),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,K)|0;var ye=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(w,H),i=(i=Math.imul(w,z))+Math.imul(_,H)|0,o=Math.imul(_,z),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,K)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,J)|0;var be=(c+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(S,H),i=(i=Math.imul(S,z))+Math.imul(E,H)|0,o=Math.imul(E,z),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,Y)|0;var we=(c+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(f,Z)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,H),i=(i=Math.imul(I,z))+Math.imul(A,H)|0,o=Math.imul(A,z),n=n+Math.imul(S,q)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(v,X)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,ee)|0;var _e=(c+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(T,H),i=(i=Math.imul(T,z))+Math.imul(O,H)|0,o=Math.imul(O,z),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,J)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0;var xe=(c+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(M,H),i=(i=Math.imul(M,z))+Math.imul(R,H)|0,o=Math.imul(R,z),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(v,re)|0,i=(i=i+Math.imul(v,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,se)|0;var Se=(c+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,H),i=(i=Math.imul(L,z))+Math.imul(j,H)|0,o=Math.imul(j,z),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0;var Ee=(c+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,fe)|0)+Math.imul(f,he)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,z))+Math.imul(U,H)|0,o=Math.imul(U,z),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(v,ue)|0,i=(i=i+Math.imul(v,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(g,he)|0,o=o+Math.imul(g,fe)|0;var ke=(c+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ge)|0)+Math.imul(f,pe)|0))<<13)|0;c=((o=o+Math.imul(f,ge)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,K))+Math.imul(U,q)|0,o=Math.imul(U,K),n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,J)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,J)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Y)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(v,he)|0,i=(i=i+Math.imul(v,fe)|0)+Math.imul(y,he)|0,o=o+Math.imul(y,fe)|0;var Ie=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;c=((o=o+Math.imul(g,ge)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,J))+Math.imul(U,W)|0,o=Math.imul(U,J),n=n+Math.imul(L,X)|0,i=(i=i+Math.imul(L,Y)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,ce)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,he)|0,o=o+Math.imul(_,fe)|0;var Ae=(c+(n=n+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,ge)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ge)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,X),i=(i=Math.imul(B,Y))+Math.imul(U,X)|0,o=Math.imul(U,Y),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,ce)|0,n=n+Math.imul(S,he)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(E,he)|0,o=o+Math.imul(E,fe)|0;var Pe=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ge)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ge)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,ee))+Math.imul(U,Z)|0,o=Math.imul(U,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,fe)|0;var Te=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ge)|0)+Math.imul(E,pe)|0))<<13)|0;c=((o=o+Math.imul(E,ge)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,se)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,se)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,n=n+Math.imul(T,he)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(O,he)|0,o=o+Math.imul(O,fe)|0;var Oe=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ge)|0)+Math.imul(A,pe)|0))<<13)|0;c=((o=o+Math.imul(A,ge)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(L,ue)|0,i=(i=i+Math.imul(L,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,fe)|0;var Ce=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ge)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ge)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,ue),i=(i=Math.imul(B,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(L,he)|0,i=(i=i+Math.imul(L,fe)|0)+Math.imul(j,he)|0,o=o+Math.imul(j,fe)|0;var Me=(c+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,ge)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,ge)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,he),i=(i=Math.imul(B,fe))+Math.imul(U,he)|0,o=Math.imul(U,fe);var Re=(c+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,ge)|0)+Math.imul(j,pe)|0))<<13)|0;c=((o=o+Math.imul(j,ge)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(c+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,ge))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ge))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ve,u[2]=ye,u[3]=be,u[4]=we,u[5]=_e,u[6]=xe,u[7]=Se,u[8]=Ee,u[9]=ke,u[10]=Ie,u[11]=Ae,u[12]=Pe,u[13]=Te,u[14]=Oe,u[15]=Ce,u[16]=Me,u[17]=Re,u[18]=Ne,0!==c&&(u[19]=c,r.length++),r};function p(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(d=f),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,h=(0|e.words[l])*(0|t.words[c]),f=67108863&h;a=67108863&(f=f+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var h=u,f=c,d=0;d<s;d++){var p=r[l+d],g=n[l+d],m=r[l+d+s],v=n[l+d+s],y=h*m-f*v;v=h*v+f*m,m=y,r[l+d]=p+m,n[l+d]=g+v,r[l+d+s]=p-m,n[l+d+s]=g-v,d!==a&&(y=u*h-c*f,f=u*f+c*h,h=y)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,n,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],n[2*s]=8191&o,o>>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)n[s]=0;r(0===o),r(0==(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,l,h,n,i);for(var d=0;d<n;d++){var p=a[d]*l[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),p(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<n;this.words[t]=u|s,s=a>>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},i.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=n;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n||!(this.words[n]&i))},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,n){var i,o,s=e.length+n;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+n])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)a=(o=(0|this.words[i+n])+a)>>26,this.words[i+n]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var a,u=n.length-o.length;if("mod"!==t){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(o,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(o,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),h=t.clone();!t.isZero();){for(var f=0,d=1;0==(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(l),s.isub(h)),o.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(n.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(a),s.isub(u)):(n.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new i(1),a=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0==(n.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(n.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,s=n;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new x(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(y,v),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(b,v),n(w,v),n(_,v),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new b;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return m[e]=t,t},x.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,o),f=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();r(m<p);var v=this.pow(h,new i(1).iushln(p-m-1));f=f.redMul(v),h=v.redSqr(),d=d.redMul(h),p=m}return f},x.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},x.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var h=c>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===l)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,x),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,CB)})),C1="lib/elliptic.js",M1=["lib"],R1={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},N1={type:"git",url:"git@github.com:indutny/elliptic"},L1=["EC","Elliptic","curve","Cryptography"],j1="Fedor Indutny <fedor@indutny.com>",D1={url:"https://github.com/indutny/elliptic/issues"},B1="https://github.com/indutny/elliptic",U1={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},F1={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},H1={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:C1,files:M1,scripts:R1,repository:N1,keywords:L1,author:j1,license:"MIT",bugs:D1,homepage:B1,devDependencies:U1,dependencies:F1},z1=Object.freeze({__proto__:null,name:"elliptic",version:"6.5.4",description:"EC cryptography",main:C1,files:M1,scripts:R1,repository:N1,keywords:L1,author:j1,license:"MIT",bugs:D1,homepage:B1,devDependencies:U1,dependencies:F1,default:H1}),V1=q1;function q1(e,t){if(!e)throw new Error(t||"Assertion failed")}q1.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var K1,$1=RB((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),W1=RB((function(e,t){var r=t;r.assert=V1,r.toArray=$1.toArray,r.zero2=$1.zero2,r.toHex=$1.toHex,r.encode=$1.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),s=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(s),a=0==(1&c)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new O1(e,"hex","le")}})),J1=function(e){return K1||(K1=new G1(null)),K1.generate(e)};function G1(e){this.rand=e}var X1=G1;if(G1.prototype.generate=function(e){return this._rand(e)},G1.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?G1.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?G1.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(G1.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var Y1=QV;if("function"!=typeof Y1.randomBytes)throw new Error("Not supported");G1.prototype._rand=function(e){return Y1.randomBytes(e)}}catch(oB){}J1.Rand=X1;var Q1=W1.getNAF,Z1=W1.getJSF,e2=W1.assert;function t2(e,t){this.type=e,this.p=new O1(t.p,16),this.red=t.prime?O1.red(t.prime):O1.mont(this.p),this.zero=new O1(0).toRed(this.red),this.one=new O1(1).toRed(this.red),this.two=new O1(2).toRed(this.red),this.n=t.n&&new O1(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var r2=t2;function n2(e,t){this.curve=e,this.type=t,this.precomputed=null}t2.prototype.point=function(){throw new Error("Not implemented")},t2.prototype.validate=function(){throw new Error("Not implemented")},t2.prototype._fixedNafMul=function(e,t){e2(e.precomputed);var r=e._getDoubles(),n=Q1(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,s,a=[];for(o=0;o<n.length;o+=r.step){s=0;for(var u=o+r.step-1;u>=o;u--)s=(s<<1)+n[u];a.push(s)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),h=i;h>0;h--){for(o=0;o<a.length;o++)(s=a[o])===h?l=l.mixedAdd(r.points[o]):s===-h&&(l=l.mixedAdd(r.points[o].neg()));c=c.add(l)}return c.toP()},t2.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=Q1(t,r,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;a>=0;a--){for(var u=0;a>=0&&0===o[a];a--)u++;if(a>=0&&u++,s=s.dblp(u),a<0)break;var c=o[a];e2(0!==c),s="affine"===e.type?c>0?s.mixedAdd(i[c-1>>1]):s.mixedAdd(i[-c-1>>1].neg()):c>0?s.add(i[c-1>>1]):s.add(i[-c-1>>1].neg())}return"affine"===e.type?s.toP():s},t2.prototype._wnafMulAdd=function(e,t,r,n,i){var o,s,a,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,h=0;for(o=0;o<n;o++){var f=(a=t[o])._getNAFPoints(e);u[o]=f.wnd,c[o]=f.points}for(o=n-1;o>=1;o-=2){var d=o-1,p=o;if(1===u[d]&&1===u[p]){var g=[t[d],null,null,t[p]];0===t[d].y.cmp(t[p].y)?(g[1]=t[d].add(t[p]),g[2]=t[d].toJ().mixedAdd(t[p].neg())):0===t[d].y.cmp(t[p].y.redNeg())?(g[1]=t[d].toJ().mixedAdd(t[p]),g[2]=t[d].add(t[p].neg())):(g[1]=t[d].toJ().mixedAdd(t[p]),g[2]=t[d].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],v=Z1(r[d],r[p]);for(h=Math.max(v[0].length,h),l[d]=new Array(h),l[p]=new Array(h),s=0;s<h;s++){var y=0|v[0][s],b=0|v[1][s];l[d][s]=m[3*(y+1)+(b+1)],l[p][s]=0,c[d]=g}}else l[d]=Q1(r[d],u[d],this._bitLength),l[p]=Q1(r[p],u[p],this._bitLength),h=Math.max(l[d].length,h),h=Math.max(l[p].length,h)}var w=this.jpoint(null,null,null),_=this._wnafT4;for(o=h;o>=0;o--){for(var x=0;o>=0;){var S=!0;for(s=0;s<n;s++)_[s]=0|l[s][o],0!==_[s]&&(S=!1);if(!S)break;x++,o--}if(o>=0&&x++,w=w.dblp(x),o<0)break;for(s=0;s<n;s++){var E=_[s];0!==E&&(E>0?a=c[s][E-1>>1]:E<0&&(a=c[s][-E-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(o=0;o<n;o++)c[o]=null;return i?w:w.toP()},t2.BasePoint=n2,n2.prototype.eq=function(){throw new Error("Not implemented")},n2.prototype.validate=function(){return this.curve.validate(this)},t2.prototype.decodePoint=function(e,t){e=W1.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?e2(e[e.length-1]%2==0):7===e[0]&&e2(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},n2.prototype.encodeCompressed=function(e){return this.encode(e,!0)},n2.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},n2.prototype.encode=function(e,t){return W1.encode(this._encode(t),e)},n2.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},n2.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},n2.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},n2.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},n2.prototype._getBeta=function(){return null},n2.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var i2=W1.assert;function o2(e){r2.call(this,"short",e),this.a=new O1(e.a,16).toRed(this.red),this.b=new O1(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}YX(o2,r2);var s2=o2;function a2(e,t,r,n){r2.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new O1(t,16),this.y=new O1(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u2(e,t,r,n){r2.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new O1(0)):(this.x=new O1(t,16),this.y=new O1(r,16),this.z=new O1(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}function c2(e){r2.call(this,"mont",e),this.a=new O1(e.a,16).toRed(this.red),this.b=new O1(e.b,16).toRed(this.red),this.i4=new O1(4).toRed(this.red).redInvm(),this.two=new O1(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o2.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new O1(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new O1(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],i2(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new O1(e.a,16),b:new O1(e.b,16)}})):this._getEndoBasis(r)}}},o2.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:O1.mont(e),r=new O1(2).toRed(t).redInvm(),n=r.redNeg(),i=new O1(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},o2.prototype._getEndoBasis=function(e){for(var t,r,n,i,o,s,a,u,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,f=this.n.clone(),d=new O1(1),p=new O1(0),g=new O1(0),m=new O1(1),v=0;0!==h.cmpn(0);){var y=f.div(h);u=f.sub(y.mul(h)),c=g.sub(y.mul(d));var b=m.sub(y.mul(p));if(!n&&u.cmp(l)<0)t=a.neg(),r=d,n=u.neg(),i=c;else if(n&&2==++v)break;a=u,f=h,h=u,g=d,d=c,m=p,p=b}o=u.neg(),s=c;var w=n.sqr().add(i.sqr());return o.sqr().add(s.sqr()).cmp(w)>=0&&(o=t,s=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:n,b:i},{a:o,b:s}]},o2.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:u.add(c).neg()}},o2.prototype.pointFromX=function(e,t){(e=new O1(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},o2.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},o2.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return c},YX(a2,r2.BasePoint),o2.prototype.point=function(e,t,r){return new a2(this,e,t,r)},o2.prototype.pointFromJSON=function(e,t){return a2.fromJSON(this,e,t)},a2.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},a2.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},a2.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},a2.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},a2.prototype.isInfinity=function(){return this.inf},a2.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},a2.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},a2.prototype.getX=function(){return this.x.fromRed()},a2.prototype.getY=function(){return this.y.fromRed()},a2.prototype.mul=function(e){return e=new O1(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},a2.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},a2.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},a2.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},a2.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},a2.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},YX(u2,r2.BasePoint),o2.prototype.jpoint=function(e,t,r){return new u2(this,e,t,r)},u2.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},u2.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u2.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),l=c.redMul(a),h=n.redMul(c),f=u.redSqr().redIAdd(l).redISub(h).redISub(h),d=u.redMul(h.redISub(f)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,d,p)},u2.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),l=r.redMul(u),h=a.redSqr().redIAdd(c).redISub(l).redISub(l),f=a.redMul(l.redISub(h)).redISub(i.redMul(c)),d=this.z.redMul(s);return this.curve.jpoint(h,f,d)},u2.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),c=s.redAdd(s);for(t=0;t<e;t++){var l=o.redSqr(),h=c.redSqr(),f=h.redSqr(),d=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(u)),p=o.redMul(h),g=d.redSqr().redISub(p.redAdd(p)),m=p.redISub(g),v=d.redMul(m);v=v.redIAdd(v).redISub(f);var y=c.redMul(a);t+1<e&&(u=u.redMul(f)),o=g,a=y,c=v}return this.curve.jpoint(o,c.redMul(i),a)},u2.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},u2.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),h=this.y.redSqr(),f=h.redSqr(),d=this.x.redAdd(h).redSqr().redISub(l).redISub(f);d=d.redIAdd(d);var p=l.redAdd(l).redIAdd(l),g=p.redSqr(),m=f.redIAdd(f);m=(m=m.redIAdd(m)).redIAdd(m),e=g.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},u2.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),h=this.y.redSqr(),f=this.x.redMul(h),d=this.x.redSub(l).redMul(this.x.redAdd(l));d=d.redAdd(d).redIAdd(d);var p=f.redIAdd(f),g=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(l);var m=h.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=d.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},u2.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(s),l=a.redSqr().redISub(c.redAdd(c)),h=c.redISub(l),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=a.redMul(h).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,d,p)},u2.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),l=t.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var h=this.x.redMul(a).redISub(l);h=(h=h.redIAdd(h)).redIAdd(h);var f=this.y.redMul(c.redMul(u.redISub(c)).redISub(s.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(h,f,d)},u2.prototype.mul=function(e,t){return e=new O1(e,t),this.curve._wnafMul(this,e)},u2.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},u2.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},u2.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},u2.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},YX(c2,r2);var l2=c2;function h2(e,t,r){r2.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new O1(t,16),this.z=new O1(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}c2.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},YX(h2,r2.BasePoint),c2.prototype.decodePoint=function(e,t){return this.point(W1.toArray(e,t),1)},c2.prototype.point=function(e,t){return new h2(this,e,t)},c2.prototype.pointFromJSON=function(e){return h2.fromJSON(this,e)},h2.prototype.precompute=function(){},h2.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},h2.fromJSON=function(e,t){return new h2(e,t[0],t[1]||e.one)},h2.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},h2.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},h2.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},h2.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},h2.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),u=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},h2.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},h2.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},h2.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},h2.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},h2.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h2.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var f2=W1.assert;function d2(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,r2.call(this,"edwards",e),this.a=new O1(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new O1(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new O1(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),f2(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}YX(d2,r2);var p2=d2;function g2(e,t,r,n,i){r2.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new O1(t,16),this.y=new O1(r,16),this.z=n?new O1(n,16):this.curve.one,this.t=i&&new O1(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}d2.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},d2.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},d2.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},d2.prototype.pointFromX=function(e,t){(e=new O1(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var a=s.fromRed().isOdd();return(t&&!a||!t&&a)&&(s=s.redNeg()),this.point(e,s)},d2.prototype.pointFromY=function(e,t){(e=new O1(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},d2.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},YX(g2,r2.BasePoint),d2.prototype.pointFromJSON=function(e){return g2.fromJSON(this,e)},d2.prototype.point=function(e,t,r,n){return new g2(this,e,t,r,n)},g2.fromJSON=function(e,t){return new g2(e,t[0],t[1],t[2])},g2.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},g2.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},g2.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),u=i.redMul(s),c=o.redMul(a),l=i.redMul(a),h=s.redMul(o);return this.curve.point(u,c,h,l)},g2.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(a)).redAdd(u);this.zOne?(e=s.redSub(a).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=s.redSub(a).redISub(u).redMul(o),t=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=a.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},g2.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},g2.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),u=r.redAdd(t),c=o.redMul(s),l=a.redMul(u),h=o.redMul(u),f=s.redMul(a);return this.curve.point(c,l,f,h)},g2.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),c=i.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),h=n.redMul(u).redMul(l);return this.curve.twisted?(t=n.redMul(c).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(h,t,r)},g2.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},g2.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},g2.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},g2.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},g2.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},g2.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},g2.prototype.getX=function(){return this.normalize(),this.x.fromRed()},g2.prototype.getY=function(){return this.normalize(),this.y.fromRed()},g2.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},g2.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},g2.prototype.toP=g2.prototype.normalize,g2.prototype.mixedAdd=g2.prototype.add;var m2=RB((function(e,t){var r=t;r.base=r2,r.short=s2,r.mont=l2,r.edwards=p2}));function v2(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function y2(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function b2(e){return 1===e.length?"0"+e:e}function w2(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var _2={inherits:YX,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):v2(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},toHex:function(e){for(var t="",r=0;r<e.length;r++)t+=b2(e[r].toString(16));return t},htonl:y2,toHex32:function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=y2(i)),r+=w2(i.toString(16))}return r},zero2:b2,zero8:w2,join32:function(e,t,r,n){var i=r-t;V1(i%4==0);for(var o=new Array(i/4),s=0,a=t;s<o.length;s++,a+=4){var u;u="big"===n?e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3]:e[a+3]<<24|e[a+2]<<16|e[a+1]<<8|e[a],o[s]=u>>>0}return o},split32:function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<<t|e>>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,n){return e+t+r+n>>>0},sum32_5:function(e,t,r,n,i){return e+t+r+n+i>>>0},sum64:function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},sum64_hi:function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},sum64_lo:function(e,t,r,n){return t+n>>>0},sum64_4_hi:function(e,t,r,n,i,o,s,a){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+s+(u+=(c=c+a>>>0)<a?1:0)>>>0},sum64_4_lo:function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},sum64_5_hi:function(e,t,r,n,i,o,s,a,u,c){var l=0,h=t;return l+=(h=h+n>>>0)<t?1:0,l+=(h=h+o>>>0)<o?1:0,l+=(h=h+a>>>0)<a?1:0,e+r+i+s+u+(l+=(h=h+c>>>0)<c?1:0)>>>0},sum64_5_lo:function(e,t,r,n,i,o,s,a,u,c){return t+n+o+a+c>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function x2(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var S2=x2;x2.prototype.update=function(e,t){if(e=_2.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=_2.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},x2.prototype.digest=function(e){return this.update(this._pad()),V1(null===this.pending),this._digest(e)},x2.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n};var E2={BlockHash:S2},k2=_2.rotr32;function I2(e,t,r){return e&t^~e&r}function A2(e,t,r){return e&t^e&r^t&r}function P2(e,t,r){return e^t^r}var T2=function(e,t,r,n){return 0===e?I2(t,r,n):1===e||3===e?P2(t,r,n):2===e?A2(t,r,n):void 0},O2=I2,C2=A2,M2=function(e){return k2(e,2)^k2(e,13)^k2(e,22)},R2=function(e){return k2(e,6)^k2(e,11)^k2(e,25)},N2=function(e){return k2(e,7)^k2(e,18)^e>>>3},L2=function(e){return k2(e,17)^k2(e,19)^e>>>10},j2=_2.rotl32,D2=_2.sum32,B2=_2.sum32_5,U2=T2,F2=E2.BlockHash,H2=[1518500249,1859775393,2400959708,3395469782];function z2(){if(!(this instanceof z2))return new z2;F2.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}_2.inherits(z2,F2);var V2=z2;z2.blockSize=512,z2.outSize=160,z2.hmacStrength=80,z2.padLength=64,z2.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=j2(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4];for(n=0;n<r.length;n++){var c=~~(n/20),l=B2(j2(i,5),U2(c,o,s,a),u,r[n],H2[c]);u=a,a=s,s=j2(o,30),o=i,i=l}this.h[0]=D2(this.h[0],i),this.h[1]=D2(this.h[1],o),this.h[2]=D2(this.h[2],s),this.h[3]=D2(this.h[3],a),this.h[4]=D2(this.h[4],u)},z2.prototype._digest=function(e){return"hex"===e?_2.toHex32(this.h,"big"):_2.split32(this.h,"big")};var q2=_2.sum32,K2=_2.sum32_4,$2=_2.sum32_5,W2=O2,J2=C2,G2=M2,X2=R2,Y2=N2,Q2=L2,Z2=E2.BlockHash,e3=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function t3(){if(!(this instanceof t3))return new t3;Z2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=e3,this.W=new Array(64)}_2.inherits(t3,Z2);var r3=t3;function n3(){if(!(this instanceof n3))return new n3;r3.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}t3.blockSize=512,t3.outSize=256,t3.hmacStrength=192,t3.padLength=64,t3.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=K2(Q2(r[n-2]),r[n-7],Y2(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],c=this.h[5],l=this.h[6],h=this.h[7];for(V1(this.k.length===r.length),n=0;n<r.length;n++){var f=$2(h,X2(u),W2(u,c,l),this.k[n],r[n]),d=q2(G2(i),J2(i,o,s));h=l,l=c,c=u,u=q2(a,f),a=s,s=o,o=i,i=q2(f,d)}this.h[0]=q2(this.h[0],i),this.h[1]=q2(this.h[1],o),this.h[2]=q2(this.h[2],s),this.h[3]=q2(this.h[3],a),this.h[4]=q2(this.h[4],u),this.h[5]=q2(this.h[5],c),this.h[6]=q2(this.h[6],l),this.h[7]=q2(this.h[7],h)},t3.prototype._digest=function(e){return"hex"===e?_2.toHex32(this.h,"big"):_2.split32(this.h,"big")},_2.inherits(n3,r3);var i3=n3;n3.blockSize=512,n3.outSize=224,n3.hmacStrength=192,n3.padLength=64,n3.prototype._digest=function(e){return"hex"===e?_2.toHex32(this.h.slice(0,7),"big"):_2.split32(this.h.slice(0,7),"big")};var o3=_2.rotr64_hi,s3=_2.rotr64_lo,a3=_2.shr64_hi,u3=_2.shr64_lo,c3=_2.sum64,l3=_2.sum64_hi,h3=_2.sum64_lo,f3=_2.sum64_4_hi,d3=_2.sum64_4_lo,p3=_2.sum64_5_hi,g3=_2.sum64_5_lo,m3=E2.BlockHash,v3=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y3(){if(!(this instanceof y3))return new y3;m3.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v3,this.W=new Array(160)}_2.inherits(y3,m3);var b3=y3;function w3(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function _3(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function x3(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function S3(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function E3(e,t){var r=o3(e,t,28)^o3(t,e,2)^o3(t,e,7);return r<0&&(r+=4294967296),r}function k3(e,t){var r=s3(e,t,28)^s3(t,e,2)^s3(t,e,7);return r<0&&(r+=4294967296),r}function I3(e,t){var r=o3(e,t,14)^o3(e,t,18)^o3(t,e,9);return r<0&&(r+=4294967296),r}function A3(e,t){var r=s3(e,t,14)^s3(e,t,18)^s3(t,e,9);return r<0&&(r+=4294967296),r}function P3(e,t){var r=o3(e,t,1)^o3(e,t,8)^a3(e,t,7);return r<0&&(r+=4294967296),r}function T3(e,t){var r=s3(e,t,1)^s3(e,t,8)^u3(e,t,7);return r<0&&(r+=4294967296),r}function O3(e,t){var r=o3(e,t,19)^o3(t,e,29)^a3(e,t,6);return r<0&&(r+=4294967296),r}function C3(e,t){var r=s3(e,t,19)^s3(t,e,29)^u3(e,t,6);return r<0&&(r+=4294967296),r}function M3(){if(!(this instanceof M3))return new M3;b3.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}y3.blockSize=1024,y3.outSize=512,y3.hmacStrength=192,y3.padLength=128,y3.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=O3(r[n-4],r[n-3]),o=C3(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=P3(r[n-30],r[n-29]),c=T3(r[n-30],r[n-29]),l=r[n-32],h=r[n-31];r[n]=f3(i,o,s,a,u,c,l,h),r[n+1]=d3(i,o,s,a,u,c,l,h)}},y3.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],s=this.h[3],a=this.h[4],u=this.h[5],c=this.h[6],l=this.h[7],h=this.h[8],f=this.h[9],d=this.h[10],p=this.h[11],g=this.h[12],m=this.h[13],v=this.h[14],y=this.h[15];V1(this.k.length===r.length);for(var b=0;b<r.length;b+=2){var w=v,_=y,x=I3(h,f),S=A3(h,f),E=w3(h,0,d,0,g),k=_3(0,f,0,p,0,m),I=this.k[b],A=this.k[b+1],P=r[b],T=r[b+1],O=p3(w,_,x,S,E,k,I,A,P,T),C=g3(w,_,x,S,E,k,I,A,P,T);w=E3(n,i),_=k3(n,i),x=x3(n,0,o,0,a),S=S3(0,i,0,s,0,u);var M=l3(w,_,x,S),R=h3(w,_,x,S);v=g,y=m,g=d,m=p,d=h,p=f,h=l3(c,l,O,C),f=h3(l,l,O,C),c=a,l=u,a=o,u=s,o=n,s=i,n=l3(O,C,M,R),i=h3(O,C,M,R)}c3(this.h,0,n,i),c3(this.h,2,o,s),c3(this.h,4,a,u),c3(this.h,6,c,l),c3(this.h,8,h,f),c3(this.h,10,d,p),c3(this.h,12,g,m),c3(this.h,14,v,y)},y3.prototype._digest=function(e){return"hex"===e?_2.toHex32(this.h,"big"):_2.split32(this.h,"big")},_2.inherits(M3,b3);var R3=M3;M3.blockSize=1024,M3.outSize=384,M3.hmacStrength=192,M3.padLength=128,M3.prototype._digest=function(e){return"hex"===e?_2.toHex32(this.h.slice(0,12),"big"):_2.split32(this.h.slice(0,12),"big")};var N3={sha1:V2,sha224:i3,sha256:r3,sha384:R3,sha512:b3},L3=_2.rotl32,j3=_2.sum32,D3=_2.sum32_3,B3=_2.sum32_4,U3=E2.BlockHash;function F3(){if(!(this instanceof F3))return new F3;U3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}_2.inherits(F3,U3);var H3=F3;function z3(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function V3(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function q3(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}F3.blockSize=512,F3.outSize=160,F3.hmacStrength=192,F3.padLength=64,F3.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],s=this.h[4],a=r,u=n,c=i,l=o,h=s,f=0;f<80;f++){var d=j3(L3(B3(r,z3(f,n,i,o),e[K3[f]+t],V3(f)),W3[f]),s);r=s,s=o,o=L3(i,10),i=n,n=d,d=j3(L3(B3(a,z3(79-f,u,c,l),e[$3[f]+t],q3(f)),J3[f]),h),a=h,h=l,l=L3(c,10),c=u,u=d}d=D3(this.h[1],i,l),this.h[1]=D3(this.h[2],o,h),this.h[2]=D3(this.h[3],s,a),this.h[3]=D3(this.h[4],r,u),this.h[4]=D3(this.h[0],n,c),this.h[0]=d},F3.prototype._digest=function(e){return"hex"===e?_2.toHex32(this.h,"little"):_2.split32(this.h,"little")};var K3=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],$3=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],W3=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],J3=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],G3={ripemd160:H3};function X3(e,t,r){if(!(this instanceof X3))return new X3(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(_2.toArray(t,r))}var Y3=X3;X3.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),V1(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},X3.prototype.update=function(e,t){return this.inner.update(e,t),this},X3.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};var Q3=RB((function(e,t){var r=t;r.utils=_2,r.common=E2,r.sha=N3,r.ripemd=G3,r.hmac=Y3,r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160})),Z3={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}},e6=RB((function(e,t){var r,n=t,i=W1.assert;function o(e){"short"===e.type?this.curve=new m2.short(e):"edwards"===e.type?this.curve=new m2.edwards(e):this.curve=new m2.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Q3.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Q3.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Q3.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Q3.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Q3.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Q3.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Q3.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=Z3}catch(e){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Q3.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function t6(e){if(!(this instanceof t6))return new t6(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=$1.toArray(e.entropy,e.entropyEnc||"hex"),r=$1.toArray(e.nonce,e.nonceEnc||"hex"),n=$1.toArray(e.pers,e.persEnc||"hex");V1(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var r6=t6;t6.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},t6.prototype._hmac=function(){return new Q3.hmac(this.hash,this.K)},t6.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},t6.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=$1.toArray(e,t),r=$1.toArray(r,n),V1(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},t6.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=$1.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(r),this._reseed++,$1.encode(o,t)};var n6=W1.assert;function i6(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var o6=i6;i6.fromPublic=function(e,t,r){return t instanceof i6?t:new i6(e,{pub:t,pubEnc:r})},i6.fromPrivate=function(e,t,r){return t instanceof i6?t:new i6(e,{priv:t,privEnc:r})},i6.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},i6.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},i6.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},i6.prototype._importPrivate=function(e,t){this.priv=new O1(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},i6.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n6(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n6(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},i6.prototype.derive=function(e){return e.validate()||n6(e.validate(),"public point not validated"),e.mul(this.priv).getX()},i6.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},i6.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},i6.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var s6=W1.assert;function a6(e,t){if(e instanceof a6)return e;this._importDER(e,t)||(s6(e.r&&e.s,"Signature without r or s"),this.r=new O1(e.r,16),this.s=new O1(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var u6=a6;function c6(){this.place=0}function l6(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function h6(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function f6(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}a6.prototype._importDER=function(e,t){e=W1.toArray(e,t);var r=new c6;if(48!==e[r.place++])return!1;var n=l6(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=l6(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var s=l6(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var a=e.slice(r.place,s+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new O1(o),this.s=new O1(a),this.recoveryParam=null,!0},a6.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=h6(t),r=h6(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f6(n,t.length),(n=n.concat(t)).push(2),f6(n,r.length);var i=n.concat(r),o=[48];return f6(o,i.length),o=o.concat(i),W1.encode(o,e)};var d6=W1.assert;function p6(e){if(!(this instanceof p6))return new p6(e);"string"==typeof e&&(d6(Object.prototype.hasOwnProperty.call(e6,e),"Unknown curve "+e),e=e6[e]),e instanceof e6.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var g6=p6;p6.prototype.keyPair=function(e){return new o6(this,e)},p6.prototype.keyFromPrivate=function(e,t){return o6.fromPrivate(this,e,t)},p6.prototype.keyFromPublic=function(e,t){return o6.fromPublic(this,e,t)},p6.prototype.genKeyPair=function(e){e||(e={});for(var t=new r6({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||J1(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new O1(2));;){var i=new O1(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},p6.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},p6.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new O1(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),s=e.toArray("be",i),a=new r6({hash:this.hash,entropy:o,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new O1(1)),c=0;;c++){var l=n.k?n.k(c):new O1(a.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var h=this.g.mul(l);if(!h.isInfinity()){var f=h.getX(),d=f.umod(this.n);if(0!==d.cmpn(0)){var p=l.invm(this.n).mul(d.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(h.getY().isOdd()?1:0)|(0!==f.cmp(d)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new u6({r:d,s:p,recoveryParam:g})}}}}}},p6.prototype.verify=function(e,t,r,n){e=this._truncateToN(new O1(e,16)),r=this.keyFromPublic(r,n);var i=(t=new u6(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,a=o.invm(this.n),u=a.mul(e).umod(this.n),c=a.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),c)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(u,r.getPublic(),c)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},p6.prototype.recoverPubKey=function(e,t,r,n){d6((3&r)===r,"The recovery param is more than two bits"),t=new u6(t,n);var i=this.n,o=new O1(e),s=t.r,a=t.s,u=1&r,c=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");s=c?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var l=t.r.invm(i),h=i.sub(o).mul(l).umod(i),f=a.mul(l).umod(i);return this.g.mulAdd(h,s,f)},p6.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new u6(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var m6=W1.assert,v6=W1.parseBytes,y6=W1.cachedProperty;function b6(e,t){this.eddsa=e,this._secret=v6(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=v6(t.pub)}b6.fromPublic=function(e,t){return t instanceof b6?t:new b6(e,{pub:t})},b6.fromSecret=function(e,t){return t instanceof b6?t:new b6(e,{secret:t})},b6.prototype.secret=function(){return this._secret},y6(b6,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),y6(b6,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),y6(b6,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),y6(b6,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),y6(b6,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),y6(b6,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),b6.prototype.sign=function(e){return m6(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},b6.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},b6.prototype.getSecret=function(e){return m6(this._secret,"KeyPair is public only"),W1.encode(this.secret(),e)},b6.prototype.getPublic=function(e){return W1.encode(this.pubBytes(),e)};var w6=b6,_6=W1.assert,x6=W1.cachedProperty,S6=W1.parseBytes;function E6(e,t){this.eddsa=e,"object"!=typeof t&&(t=S6(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),_6(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof O1&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}x6(E6,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),x6(E6,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),x6(E6,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),x6(E6,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),E6.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},E6.prototype.toHex=function(){return W1.encode(this.toBytes(),"hex").toUpperCase()};var k6=E6,I6=W1.assert,A6=W1.parseBytes;function P6(e){if(I6("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof P6))return new P6(e);e=e6[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=Q3.sha512}var T6=P6;P6.prototype.sign=function(e,t){e=A6(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),a=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:a,Rencoded:o})},P6.prototype.verify=function(e,t,r){e=A6(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},P6.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return W1.intFromLE(e.digest()).umod(this.curve.n)},P6.prototype.keyFromPublic=function(e){return w6.fromPublic(this,e)},P6.prototype.keyFromSecret=function(e){return w6.fromSecret(this,e)},P6.prototype.makeSignature=function(e){return e instanceof k6?e:new k6(this,e)},P6.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},P6.prototype.decodePoint=function(e){var t=(e=W1.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=W1.intFromLE(r);return this.curve.pointFromY(i,n)},P6.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},P6.prototype.decodeInt=function(e){return W1.intFromLE(e)},P6.prototype.isPoint=function(e){return e instanceof this.pointClass};var O6=NB(z1),C6=RB((function(e,t){var r=t;r.version=O6.version,r.utils=W1,r.rand=J1,r.curve=m2,r.curves=e6,r.ec=g6,r.eddsa=T6}));const M6=eU.alloc(1,1),R6=eU.alloc(1,0);const N6=new C6.ec("secp256k1"),L6=eU.alloc(32,0),j6=eU.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),D6=eU.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex"),B6=N6.curve.n,U6=B6.shrn(1),F6=N6.curve.g;function H6(e){return jU(e)&&32===e.length}function z6(e){return!!H6(e)&&e.compare(j6)<0}function V6(e){if(!jU(e))return!1;if(e.length<33)return!1;const t=e[0],r=e.slice(1,33);if(0===r.compare(L6))return!1;if(r.compare(D6)>=0)return!1;if((2===t||3===t)&&33===e.length){try{G6(e)}catch(e){return!1}return!0}const n=e.slice(33);return 0!==n.compare(L6)&&!(n.compare(D6)>=0)&&4===t&&65===e.length}function q6(e){return 4!==e[0]}function K6(e){return!!H6(e)&&e.compare(L6)>0&&e.compare(j6)<0}function $6(e,t){return void 0===e&&void 0!==t?q6(t):void 0===e||e}function W6(e){return new O1(e)}function J6(e){return e.toArrayLike(eU,"be",32)}function G6(e){return N6.curve.decodePoint(e)}function X6(e,t){return eU.from(e._encode(t))}function Y6(e,t,r){if(!H6(e))throw new TypeError("Expected Hash");if(!K6(t))throw new TypeError("Expected Private");if(void 0!==r&&!H6(r))throw new TypeError("Expected Extra Data (32 bytes)");const n=W6(t),i=W6(e);let o,s;(function(e,t,r,n,i){let o=eU.alloc(32,0),s=eU.alloc(32,1);o=E1("sha256",o).update(s).update(R6).update(t).update(e).update(i||"").digest(),s=E1("sha256",o).update(s).digest(),o=E1("sha256",o).update(s).update(M6).update(t).update(e).update(i||"").digest(),s=E1("sha256",o).update(s).digest(),s=E1("sha256",o).update(s).digest();let a=s;for(;!n(a)||!r(a);)o=E1("sha256",o).update(s).update(R6).digest(),s=E1("sha256",o).update(s).digest(),s=E1("sha256",o).update(s).digest(),a=s})(e,t,(function(e){const t=W6(e),r=F6.mul(t);return!r.isInfinity()&&(o=r.x.umod(B6),0!==o.isZero()&&(s=t.invm(B6).mul(i.add(n.mul(o))).umod(B6),0!==s.isZero()))}),K6,r),s.cmp(U6)>0&&(s=B6.sub(s));const a=eU.allocUnsafe(64);return J6(o).copy(a,0),J6(s).copy(a,32),a}var Q6={isPoint:V6,isPointCompressed:function(e){return!!V6(e)&&q6(e)},isPrivate:K6,pointAdd:function(e,t,r){if(!V6(e))throw new TypeError("Expected Point");if(!V6(t))throw new TypeError("Expected Point");const n=G6(e),i=G6(t),o=n.add(i);return o.isInfinity()?null:X6(o,$6(r,e))},pointAddScalar:function(e,t,r){if(!V6(e))throw new TypeError("Expected Point");if(!z6(t))throw new TypeError("Expected Tweak");const n=$6(r,e),i=G6(e);if(0===t.compare(L6))return X6(i,n);const o=W6(t),s=F6.mul(o),a=i.add(s);return a.isInfinity()?null:X6(a,n)},pointCompress:function(e,t){if(!V6(e))throw new TypeError("Expected Point");const r=G6(e);if(r.isInfinity())throw new TypeError("Expected Point");return X6(r,$6(t,e))},pointFromScalar:function(e,t){if(!K6(e))throw new TypeError("Expected Private");const r=W6(e),n=F6.mul(r);return n.isInfinity()?null:X6(n,$6(t))},pointMultiply:function(e,t,r){if(!V6(e))throw new TypeError("Expected Point");if(!z6(t))throw new TypeError("Expected Tweak");const n=$6(r,e),i=G6(e),o=W6(t),s=i.mul(o);return s.isInfinity()?null:X6(s,n)},privateAdd:function(e,t){if(!K6(e))throw new TypeError("Expected Private");if(!z6(t))throw new TypeError("Expected Tweak");const r=W6(e),n=W6(t),i=J6(r.add(n).umod(B6));return K6(i)?i:null},privateSub:function(e,t){if(!K6(e))throw new TypeError("Expected Private");if(!z6(t))throw new TypeError("Expected Tweak");const r=W6(e),n=W6(t),i=J6(r.sub(n).umod(B6));return K6(i)?i:null},sign:function(e,t){return Y6(e,t)},signWithEntropy:function(e,t,r){return Y6(e,t,r)},verify:function(e,t,r,n){if(!H6(e))throw new TypeError("Expected Hash");if(!V6(t))throw new TypeError("Expected Point");if(!function(e){const t=e.slice(0,32),r=e.slice(32,64);return jU(e)&&64===e.length&&t.compare(j6)<0&&r.compare(j6)<0}(r))throw new TypeError("Expected Signature");const i=G6(t),o=W6(r.slice(0,32)),s=W6(r.slice(32,64));if(n&&s.cmp(U6)>0)return!1;if(o.gtn(0)<=0)return!1;if(s.gtn(0)<=0)return!1;const a=W6(e),u=s.invm(B6),c=a.mul(u).umod(B6),l=o.mul(u).umod(B6),h=F6.mulAdd(c,i,l);return!h.isInfinity()&&h.x.umod(B6).eq(o)}},Z6={Array:function(e){return null!=e&&e.constructor===Array},Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"==typeof e},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var e4 in Z6.Null=Z6.Nil,Z6)Z6[e4].toJSON=function(e){return e}.bind(null,e4);var t4=Z6;function r4(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function n4(e){return t4.Nil(e)?"":r4(e.constructor)}function i4(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function o4(e){return t4.Function(e)?e.toJSON?e.toJSON():r4(e):t4.Array(e)?"Array":e&&t4.Object(e)?"Object":void 0!==e?e:""}function s4(e,t,r){var n=function(e){return t4.Function(e)?"":t4.String(e)?JSON.stringify(e):e&&t4.Object(e)?"":e}(t);return"Expected "+o4(e)+", got"+(""!==r?" "+r:"")+(""!==n?" "+n:"")}function a4(e,t,r){r=r||n4(t),this.message=s4(e,t,r),i4(this,a4),this.__type=e,this.__value=t,this.__valueTypeName=r}function u4(e,t,r,n,i){e?(i=i||n4(n),this.message=function(e,t,r,n,i){var o='" of type ';return"key"===t&&(o='" with key type '),s4('property "'+o4(r)+o+o4(e),n,i)}(e,r,t,n,i)):this.message='Unexpected property "'+t+'"',i4(this,a4),this.__label=r,this.__property=t,this.__type=e,this.__value=n,this.__valueTypeName=i}a4.prototype=Object.create(Error.prototype),a4.prototype.constructor=a4,u4.prototype=Object.create(Error.prototype),u4.prototype.constructor=a4;var c4=a4,l4=u4,h4=function(e,t){return new a4(e,{},t)},f4=function(e,t,r){return e instanceof u4?(t=t+"."+e.__property,e=new u4(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof a4&&(e=new u4(e.__type,t,r,e.__value,e.__valueTypeName)),i4(e),e},d4=o4,p4=n4;function g4(e){return jU(e)}function m4(e){return"string"==typeof e&&/^([0-9a-f]{2})+$/i.test(e)}function v4(e,t){var r=e.toJSON();function n(n){if(!e(n))return!1;if(n.length===t)return!0;throw h4(r+"(Length: "+t+")",r+"(Length: "+n.length+")")}return n.toJSON=function(){return r},n}var y4=v4.bind(null,t4.Array),b4=v4.bind(null,g4),w4=v4.bind(null,m4),_4=v4.bind(null,t4.String),x4=Math.pow(2,53)-1,S4={ArrayN:y4,Buffer:g4,BufferN:b4,Finite:function(e){return"number"==typeof e&&isFinite(e)},Hex:m4,HexN:w4,Int8:function(e){return e<<24>>24===e},Int16:function(e){return e<<16>>16===e},Int32:function(e){return(0|e)===e},Int53:function(e){return"number"==typeof e&&e>=-x4&&e<=x4&&Math.floor(e)===e},Range:function(e,t,r){function n(n,i){return r(n,i)&&n>e&&n<t}return r=r||t4.Number,n.toJSON=function(){return`${r.toJSON()} between [${e}, ${t}]`},n},StringN:_4,UInt8:function(e){return(255&e)===e},UInt16:function(e){return(65535&e)===e},UInt32:function(e){return e>>>0===e},UInt53:function(e){return"number"==typeof e&&e>=0&&e<=x4&&Math.floor(e)===e}};for(var E4 in S4)S4[E4].toJSON=function(e){return e}.bind(null,E4);var k4=S4,I4=d4,A4=c4,P4=l4,T4=f4,O4=p4,C4={arrayOf:function(e,t){function r(r,n){return!!t4.Array(r)&&!t4.Nil(r)&&!(void 0!==t.minLength&&r.length<t.minLength)&&!(void 0!==t.maxLength&&r.length>t.maxLength)&&(void 0===t.length||r.length===t.length)&&r.every((function(t,r){try{return R4(e,t,n)}catch(e){throw T4(e,r)}}))}return e=M4(e),t=t||{},r.toJSON=function(){var r="["+I4(e)+"]";return void 0!==t.length?r+="{"+t.length+"}":void 0===t.minLength&&void 0===t.maxLength||(r+="{"+(void 0===t.minLength?0:t.minLength)+","+(void 0===t.maxLength?1/0:t.maxLength)+"}"),r},r},maybe:function e(t){function r(r,n){return t4.Nil(r)||t(r,n,e)}return t=M4(t),r.toJSON=function(){return"?"+I4(t)},r},map:function(e,t){function r(r,n){if(!t4.Object(r))return!1;if(t4.Nil(r))return!1;for(var i in r){try{t&&R4(t,i,n)}catch(e){throw T4(e,i,"key")}try{var o=r[i];R4(e,o,n)}catch(e){throw T4(e,i)}}return!0}return e=M4(e),t&&(t=M4(t)),r.toJSON=t?function(){return"{"+I4(t)+": "+I4(e)+"}"}:function(){return"{"+I4(e)+"}"},r},object:function(e){var t={};for(var r in e)t[r]=M4(e[r]);function n(e,r){if(!t4.Object(e))return!1;if(t4.Nil(e))return!1;var n;try{for(n in t)R4(t[n],e[n],r)}catch(e){throw T4(e,n)}if(r)for(n in e)if(!t[n])throw new P4(void 0,n);return!0}return n.toJSON=function(){return I4(t)},n},anyOf:function(){var e=[].slice.call(arguments).map(M4);function t(t,r){return e.some((function(e){try{return R4(e,t,r)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(I4).join("|")},t},allOf:function(){var e=[].slice.call(arguments).map(M4);function t(t,r){return e.every((function(e){try{return R4(e,t,r)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(I4).join(" & ")},t},quacksLike:function(e){function t(t){return e===O4(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(M4);function t(t,r){return!t4.Nil(t)&&!t4.Nil(t.length)&&(!r||t.length===e.length)&&e.every((function(e,n){try{return R4(e,t[n],r)}catch(e){throw T4(e,n)}}))}return t.toJSON=function(){return"("+e.map(I4).join(", ")+")"},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function M4(e){if(t4.String(e))return"?"===e[0]?C4.maybe(e.slice(1)):t4[e]||C4.quacksLike(e);if(e&&t4.Object(e)){if(t4.Array(e)){if(1!==e.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return C4.arrayOf(e[0])}return C4.object(e)}return t4.Function(e)?e:C4.value(e)}function R4(e,t,r,n){if(t4.Function(e)){if(e(t,r))return!0;throw new A4(n||e,t)}return R4(M4(e),t,r)}for(var N4 in C4.oneOf=C4.anyOf,t4)R4[N4]=t4[N4];for(N4 in C4)R4[N4]=C4[N4];for(N4 in k4)R4[N4]=k4[N4];R4.compile=M4,R4.TfTypeError=A4,R4.TfPropertyTypeError=P4;var L4=R4;function j4(e,t){if(void 0!==t&&e[0]!==t)throw new Error("Invalid network version");if(33===e.length)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(34!==e.length)throw new Error("Invalid WIF length");if(1!==e[33])throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function D4(e,t,r){var n=new eU(r?34:33);return n.writeUInt8(e,0),t.copy(n,1),r&&(n[33]=1),n}var B4=function(e,t){return j4(T1.decode(e),t)},U4=function(e,t,r){return"number"==typeof e?T1.encode(D4(e,t,r)):T1.encode(D4(e.version,e.privateKey,e.compressed))},F4=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=L4.BufferN(32),n=L4.compile({wif:L4.UInt8,bip32:{public:L4.UInt32,private:L4.UInt32}}),i={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},o=2147483648,s=Math.pow(2,31)-1;function a(e){return L4.String(e)&&null!==e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function u(e){return L4.UInt32(e)&&e<=s}class c{constructor(e,t,r,i,o=0,s=0,a=0){this.__D=e,this.__Q=t,this.chainCode=r,this.network=i,this.__DEPTH=o,this.__INDEX=s,this.__PARENT_FINGERPRINT=a,L4(n,i),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return void 0===this.__Q&&(this.__Q=Q6.pointFromScalar(this.__D,!0)),this.__Q}get privateKey(){return this.__D}get identifier(){return k1.hash160(this.publicKey)}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return void 0===this.__D}neutered(){return f(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){const e=this.network,t=this.isNeutered()?e.bip32.public:e.bip32.private,r=eU.allocUnsafe(78);return r.writeUInt32BE(t,0),r.writeUInt8(this.depth,4),r.writeUInt32BE(this.parentFingerprint,5),r.writeUInt32BE(this.index,9),this.chainCode.copy(r,13),this.isNeutered()?this.publicKey.copy(r,45):(r.writeUInt8(0,45),this.privateKey.copy(r,46)),T1.encode(r)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return U4(this.network.wif,this.privateKey,!0)}derive(e){L4(L4.UInt32,e);const t=e>=o,r=eU.allocUnsafe(37);if(t){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");r[0]=0,this.privateKey.copy(r,1),r.writeUInt32BE(e,33)}else this.publicKey.copy(r,0),r.writeUInt32BE(e,33);const n=k1.hmacSHA512(this.chainCode,r),i=n.slice(0,32),s=n.slice(32);if(!Q6.isPrivate(i))return this.derive(e+1);let a;if(this.isNeutered()){const t=Q6.pointAddScalar(this.publicKey,i,!0);if(null===t)return this.derive(e+1);a=f(t,s,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}else{const t=Q6.privateAdd(this.privateKey,i);if(null==t)return this.derive(e+1);a=h(t,s,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}return a}deriveHardened(e){return L4(u,e),this.derive(e+o)}derivePath(e){L4(a,e);let t=e.split("/");if("m"===t[0]){if(this.parentFingerprint)throw new TypeError("Expected master, got child");t=t.slice(1)}return t.reduce(((e,t)=>{let r;return"'"===t.slice(-1)?(r=parseInt(t.slice(0,-1),10),e.deriveHardened(r)):(r=parseInt(t,10),e.derive(r))}),this)}sign(e,t){if(!this.privateKey)throw new Error("Missing private key");if(void 0===t&&(t=this.lowR),!1===t)return Q6.sign(e,this.privateKey);{let t=Q6.sign(e,this.privateKey);const r=eU.alloc(32,0);let n=0;for(;t[0]>127;)n++,r.writeUIntLE(n,0,6),t=Q6.signWithEntropy(e,this.privateKey,r);return t}}verify(e,t){return Q6.verify(e,this.publicKey,t)}}function l(e,t,r){return h(e,t,r)}function h(e,t,n,o,s,a){if(L4({privateKey:r,chainCode:r},{privateKey:e,chainCode:t}),n=n||i,!Q6.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return new c(e,void 0,t,n,o,s,a)}function f(e,t,n,o,s,a){if(L4({publicKey:L4.BufferN(33),chainCode:r},{publicKey:e,chainCode:t}),n=n||i,!Q6.isPoint(e))throw new TypeError("Point is not on the curve");return new c(void 0,e,t,n,o,s,a)}t.fromBase58=function(e,t){const r=T1.decode(e);if(78!==r.length)throw new TypeError("Invalid buffer length");t=t||i;const n=r.readUInt32BE(0);if(n!==t.bip32.private&&n!==t.bip32.public)throw new TypeError("Invalid network version");const o=r[4],s=r.readUInt32BE(5);if(0===o&&0!==s)throw new TypeError("Invalid parent fingerprint");const a=r.readUInt32BE(9);if(0===o&&0!==a)throw new TypeError("Invalid index");const u=r.slice(13,45);let c;if(n===t.bip32.private){if(0!==r.readUInt8(45))throw new TypeError("Invalid private key");c=h(r.slice(46,78),u,t,o,a,s)}else c=f(r.slice(45,78),u,t,o,a,s);return c},t.fromPrivateKey=l,t.fromPublicKey=function(e,t,r){return f(e,t,r)},t.fromSeed=function(e,t){if(L4(L4.Buffer,e),e.length<16)throw new TypeError("Seed should be at least 128 bits");if(e.length>64)throw new TypeError("Seed should be at most 512 bits");t=t||i;const r=k1.hmacSHA512(eU.from("Bitcoin seed","utf8"),e);return l(r.slice(0,32),r.slice(32),t)}}));MB(F4),F4.fromBase58,F4.fromPrivateKey,F4.fromPublicKey,F4.fromSeed;var H4=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fromSeed=F4.fromSeed,t.fromBase58=F4.fromBase58,t.fromPublicKey=F4.fromPublicKey,t.fromPrivateKey=F4.fromPrivateKey}));MB(H4),H4.fromSeed,H4.fromBase58,H4.fromPublicKey,H4.fromPrivateKey;var z4=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},t.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},t.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}}));MB(z4),z4.bitcoin,z4.regtest,z4.testnet;var V4=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e,t,r){t=t||4,r=void 0===r||r;const n=e.length;if(0===n)return 0;if(n>t)throw new TypeError("Script number overflow");if(r&&0==(127&e[n-1])&&(n<=1||0==(128&e[n-2])))throw new Error("Non-minimally encoded script number");if(5===n){const t=e.readUInt32LE(0),r=e.readUInt8(4);return 128&r?-(4294967296*(-129&r)+t):4294967296*r+t}let i=0;for(let t=0;t<n;++t)i|=e[t]<<8*t;return 128&e[n-1]?-(i&~(128<<8*(n-1))):i},t.encode=function(e){let t=Math.abs(e);const r=(n=t)>2147483647?5:n>8388607?4:n>32767?3:n>127?2:n>0?1:0;var n;const i=eU.allocUnsafe(r),o=e<0;for(let e=0;e<r;++e)i.writeUInt8(255&t,e),t>>=8;return 128&i[r-1]?i.writeUInt8(o?128:0,r-1):o&&(i[r-1]|=128),i}}));MB(V4),V4.decode,V4.encode;var q4=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Math.pow(2,31)-1;function n(e){return L4.String(e)&&!!e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}t.UInt31=function(e){return L4.UInt32(e)&&e<=r},t.BIP32Path=n,n.toJSON=()=>"BIP32 derivation path",t.Signer=function(e){return(L4.Buffer(e.publicKey)||"function"==typeof e.getPublicKey)&&"function"==typeof e.sign},t.Satoshi=function(e){return L4.UInt53(e)&&e<=21e14},t.ECPoint=L4.quacksLike("Point"),t.Network=L4.compile({messagePrefix:L4.oneOf(L4.Buffer,L4.String),bip32:{public:L4.UInt32,private:L4.UInt32},pubKeyHash:L4.UInt8,scriptHash:L4.UInt8,wif:L4.UInt8}),t.Buffer256bit=L4.BufferN(32),t.Hash160bit=L4.BufferN(20),t.Hash256bit=L4.BufferN(32),t.Number=L4.Number,t.Array=L4.Array,t.Boolean=L4.Boolean,t.String=L4.String,t.Buffer=L4.Buffer,t.Hex=L4.Hex,t.maybe=L4.maybe,t.tuple=L4.tuple,t.UInt8=L4.UInt8,t.UInt32=L4.UInt32,t.Function=L4.Function,t.BufferN=L4.BufferN,t.Null=L4.Null,t.oneOf=L4.oneOf}));MB(q4),q4.UInt31,q4.BIP32Path,q4.Signer,q4.Satoshi,q4.ECPoint,q4.Network,q4.Buffer256bit,q4.Hash160bit,q4.Hash256bit,q4.Number,q4.Array,q4.Boolean,q4.String,q4.Buffer,q4.Hex,q4.maybe,q4.tuple,q4.UInt8,q4.UInt32,q4.Function,q4.BufferN,q4.Null,q4.oneOf;var K4=QX.Buffer,$4=function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return!(0===r||6+t+r!==e.length||128&e[4]||t>1&&0===e[4]&&!(128&e[5])||128&e[t+6]||r>1&&0===e[t+6]&&!(128&e[t+7]))},W4=function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},J4=function(e,t){var r=e.length,n=t.length;if(0===r)throw new Error("R length is zero");if(0===n)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(n>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(n>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var i=K4.allocUnsafe(6+r+n);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=e.length,e.copy(i,4),i[4+r]=2,i[5+r]=t.length,t.copy(i,6+r),i},G4=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=eU.alloc(1,0);function n(e){let t=0;for(;0===e[t];)++t;return t===e.length?r:128&(e=e.slice(t))[0]?eU.concat([r,e],1+e.length):e}function i(e){0===e[0]&&(e=e.slice(1));const t=eU.alloc(32,0),r=Math.max(0,32-e.length);return e.copy(t,r),t}t.decode=function(e){const t=e.readUInt8(e.length-1),r=-129&t;if(r<=0||r>=4)throw new Error("Invalid hashType "+t);const n=W4(e.slice(0,-1)),o=i(n.r),s=i(n.s);return{signature:eU.concat([o,s],64),hashType:t}},t.encode=function(e,t){L4({signature:q4.BufferN(64),hashType:q4.UInt8},{signature:e,hashType:t});const r=-129&t;if(r<=0||r>=4)throw new Error("Invalid hashType "+t);const i=eU.allocUnsafe(1);i.writeUInt8(t,0);const o=n(e.slice(0,32)),s=n(e.slice(32,64));return eU.concat([J4(o,s),i])}}));MB(G4),G4.decode,G4.encode;var X4=NB(Object.freeze({__proto__:null,OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255,default:{OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255}}));function Y4(e){return e<X4.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}var Q4={encodingLength:Y4,encode:function(e,t,r){var n=Y4(t);return 1===n?e.writeUInt8(t,r):2===n?(e.writeUInt8(X4.OP_PUSHDATA1,r),e.writeUInt8(t,r+1)):3===n?(e.writeUInt8(X4.OP_PUSHDATA2,r),e.writeUInt16LE(t,r+1)):(e.writeUInt8(X4.OP_PUSHDATA4,r),e.writeUInt32LE(t,r+1)),n},decode:function(e,t){var r,n,i=e.readUInt8(t);if(i<X4.OP_PUSHDATA1)r=i,n=1;else if(i===X4.OP_PUSHDATA1){if(t+2>e.length)return null;r=e.readUInt8(t+1),n=2}else if(i===X4.OP_PUSHDATA2){if(t+3>e.length)return null;r=e.readUInt16LE(t+1),n=3}else{if(t+5>e.length)return null;if(i!==X4.OP_PUSHDATA4)throw new Error("Unexpected opcode");r=e.readUInt32LE(t+1),n=5}return{opcode:i,number:r,size:n}}},Z4={};for(var e5 in X4)Z4[X4[e5]]=e5;var t5=Z4,r5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.OPS=X4;const r=t.OPS.OP_RESERVED;function n(e){return q4.Buffer(e)||function(e){return q4.Number(e)&&(e===t.OPS.OP_0||e>=t.OPS.OP_1&&e<=t.OPS.OP_16||e===t.OPS.OP_1NEGATE)}(e)}function i(e){return q4.Array(e)&&e.every(n)}function o(e){return 0===e.length?t.OPS.OP_0:1===e.length?e[0]>=1&&e[0]<=16?r+e[0]:129===e[0]?t.OPS.OP_1NEGATE:void 0:void 0}function s(e){return jU(e)}function a(e){return jU(e)}function u(e){if(s(e))return e;L4(q4.Array,e);const t=e.reduce(((e,t)=>a(t)?1===t.length&&void 0!==o(t)?e+1:e+Q4.encodingLength(t.length)+t.length:e+1),0),r=eU.allocUnsafe(t);let n=0;if(e.forEach((e=>{if(a(e)){const t=o(e);if(void 0!==t)return r.writeUInt8(t,n),void(n+=1);n+=Q4.encode(r,e.length,n),e.copy(r,n),n+=e.length}else r.writeUInt8(e,n),n+=1})),n!==r.length)throw new Error("Could not decode chunks");return r}function c(e){if(r=e,q4.Array(r))return e;var r;L4(q4.Buffer,e);const n=[];let i=0;for(;i<e.length;){const r=e[i];if(r>t.OPS.OP_0&&r<=t.OPS.OP_PUSHDATA4){const t=Q4.decode(e,i);if(null===t)return null;if(i+=t.size,i+t.number>e.length)return null;const r=e.slice(i,i+t.number);i+=t.number;const s=o(r);void 0!==s?n.push(s):n.push(r)}else n.push(r),i+=1}return n}function l(e){const t=-129&e;return t>0&&t<4}t.isPushOnly=i,t.compile=u,t.decompile=c,t.toASM=function(e){return s(e)&&(e=c(e)),e.map((e=>{if(a(e)){const t=o(e);if(void 0===t)return e.toString("hex");e=t}return t5[e]})).join(" ")},t.fromASM=function(e){return L4(q4.String,e),u(e.split(" ").map((e=>void 0!==t.OPS[e]?t.OPS[e]:(L4(q4.Hex,e),eU.from(e,"hex")))))},t.toStack=function(e){return e=c(e),L4(i,e),e.map((e=>a(e)?e:e===t.OPS.OP_0?eU.allocUnsafe(0):V4.encode(e-r)))},t.isCanonicalPubKey=function(e){return Q6.isPoint(e)},t.isDefinedHashType=l,t.isCanonicalScriptSignature=function(e){return!!jU(e)&&!!l(e[e.length-1])&&$4(e.slice(0,-1))},t.number=V4,t.signature=G4}));MB(r5),r5.OPS,r5.isPushOnly,r5.compile,r5.decompile,r5.toASM,r5.fromASM,r5.toStack,r5.isCanonicalPubKey,r5.isDefinedHashType,r5.isCanonicalScriptSignature,r5.number,r5.signature;var n5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.prop=function(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=r.call(this);return this[t]=e,e},set(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})},t.value=function(e){let t;return()=>(void 0!==t||(t=e()),t)}}));MB(n5),n5.prop,n5.value;var i5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS;t.p2data=function(e,t){if(!e.data&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),L4({network:L4.maybe(L4.Object),output:L4.maybe(L4.Buffer),data:L4.maybe(L4.arrayOf(L4.Buffer))},e);const n={name:"embed",network:e.network||z4.bitcoin};if(n5.prop(n,"output",(()=>{if(e.data)return r5.compile([r.OP_RETURN].concat(e.data))})),n5.prop(n,"data",(()=>{if(e.output)return r5.decompile(e.output).slice(1)})),t.validate&&e.output){const t=r5.decompile(e.output);if(t[0]!==r.OP_RETURN)throw new TypeError("Output is invalid");if(!t.slice(1).every(L4.Buffer))throw new TypeError("Output is invalid");if(e.data&&!function(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}(e.data,n.data))throw new TypeError("Data mismatch")}return Object.assign(n,e)}}));MB(i5),i5.p2data;var o5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS,n=r.OP_RESERVED;function i(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}t.p2ms=function(e,t){if(!(e.input||e.output||e.pubkeys&&void 0!==e.m||e.signatures))throw new TypeError("Not enough data");function o(e){return r5.isCanonicalScriptSignature(e)||void 0!==(t.allowIncomplete&&e===r.OP_0)}t=Object.assign({validate:!0},t||{}),L4({network:L4.maybe(L4.Object),m:L4.maybe(L4.Number),n:L4.maybe(L4.Number),output:L4.maybe(L4.Buffer),pubkeys:L4.maybe(L4.arrayOf(Q6.isPoint)),signatures:L4.maybe(L4.arrayOf(o)),input:L4.maybe(L4.Buffer)},e);const s={network:e.network||z4.bitcoin};let a=[],u=!1;function c(e){u||(u=!0,a=r5.decompile(e),s.m=a[0]-n,s.n=a[a.length-2]-n,s.pubkeys=a.slice(1,-2))}if(n5.prop(s,"output",(()=>{if(e.m&&s.n&&e.pubkeys)return r5.compile([].concat(n+e.m,e.pubkeys,n+s.n,r.OP_CHECKMULTISIG))})),n5.prop(s,"m",(()=>{if(s.output)return c(s.output),s.m})),n5.prop(s,"n",(()=>{if(s.pubkeys)return s.pubkeys.length})),n5.prop(s,"pubkeys",(()=>{if(e.output)return c(e.output),s.pubkeys})),n5.prop(s,"signatures",(()=>{if(e.input)return r5.decompile(e.input).slice(1)})),n5.prop(s,"input",(()=>{if(e.signatures)return r5.compile([r.OP_0].concat(e.signatures))})),n5.prop(s,"witness",(()=>{if(s.input)return[]})),n5.prop(s,"name",(()=>{if(s.m&&s.n)return`p2ms(${s.m} of ${s.n})`})),t.validate){if(e.output){if(c(e.output),!L4.Number(a[0]))throw new TypeError("Output is invalid");if(!L4.Number(a[a.length-2]))throw new TypeError("Output is invalid");if(a[a.length-1]!==r.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(s.m<=0||s.n>16||s.m>s.n||s.n!==a.length-3)throw new TypeError("Output is invalid");if(!s.pubkeys.every((e=>Q6.isPoint(e))))throw new TypeError("Output is invalid");if(void 0!==e.m&&e.m!==s.m)throw new TypeError("m mismatch");if(void 0!==e.n&&e.n!==s.n)throw new TypeError("n mismatch");if(e.pubkeys&&!i(e.pubkeys,s.pubkeys))throw new TypeError("Pubkeys mismatch")}if(e.pubkeys){if(void 0!==e.n&&e.n!==e.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(s.n=e.pubkeys.length,s.n<s.m)throw new TypeError("Pubkey count cannot be less than m")}if(e.signatures){if(e.signatures.length<s.m)throw new TypeError("Not enough signatures provided");if(e.signatures.length>s.m)throw new TypeError("Too many signatures provided")}if(e.input){if(e.input[0]!==r.OP_0)throw new TypeError("Input is invalid");if(0===s.signatures.length||!s.signatures.every(o))throw new TypeError("Input has invalid signature(s)");if(e.signatures&&!i(e.signatures,s.signatures))throw new TypeError("Signature mismatch");if(void 0!==e.m&&e.m!==e.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(s,e)}}));MB(o5),o5.p2ms;var s5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS;t.p2pk=function(e,t){if(!(e.input||e.output||e.pubkey||e.input||e.signature))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),L4({network:L4.maybe(L4.Object),output:L4.maybe(L4.Buffer),pubkey:L4.maybe(Q6.isPoint),signature:L4.maybe(r5.isCanonicalScriptSignature),input:L4.maybe(L4.Buffer)},e);const n=n5.value((()=>r5.decompile(e.input))),i={name:"p2pk",network:e.network||z4.bitcoin};if(n5.prop(i,"output",(()=>{if(e.pubkey)return r5.compile([e.pubkey,r.OP_CHECKSIG])})),n5.prop(i,"pubkey",(()=>{if(e.output)return e.output.slice(1,-1)})),n5.prop(i,"signature",(()=>{if(e.input)return n()[0]})),n5.prop(i,"input",(()=>{if(e.signature)return r5.compile([e.signature])})),n5.prop(i,"witness",(()=>{if(i.input)return[]})),t.validate){if(e.output){if(e.output[e.output.length-1]!==r.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!Q6.isPoint(i.pubkey))throw new TypeError("Output pubkey is invalid");if(e.pubkey&&!e.pubkey.equals(i.pubkey))throw new TypeError("Pubkey mismatch")}if(e.signature&&e.input&&!e.input.equals(i.input))throw new TypeError("Signature mismatch");if(e.input){if(1!==n().length)throw new TypeError("Input is invalid");if(!r5.isCanonicalScriptSignature(i.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(i,e)}}));MB(s5),s5.p2pk;var a5=RB((function(e,t){function r(e){try{return g1("rmd160").update(e).digest()}catch(t){return g1("ripemd160").update(e).digest()}}function n(e){return g1("sha256").update(e).digest()}Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=r,t.sha1=function(e){return g1("sha1").update(e).digest()},t.sha256=n,t.hash160=function(e){return r(n(e))},t.hash256=function(e){return n(n(e))}}));MB(a5),a5.ripemd160,a5.sha1,a5.sha256,a5.hash160,a5.hash256;var u5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS;t.p2pkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),L4({network:L4.maybe(L4.Object),address:L4.maybe(L4.String),hash:L4.maybe(L4.BufferN(20)),output:L4.maybe(L4.BufferN(25)),pubkey:L4.maybe(Q6.isPoint),signature:L4.maybe(r5.isCanonicalScriptSignature),input:L4.maybe(L4.Buffer)},e);const n=n5.value((()=>{const t=T1.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}})),i=n5.value((()=>r5.decompile(e.input))),o=e.network||z4.bitcoin,s={name:"p2pkh",network:o};if(n5.prop(s,"address",(()=>{if(!s.hash)return;const e=eU.allocUnsafe(21);return e.writeUInt8(o.pubKeyHash,0),s.hash.copy(e,1),T1.encode(e)})),n5.prop(s,"hash",(()=>e.output?e.output.slice(3,23):e.address?n().hash:e.pubkey||s.pubkey?a5.hash160(e.pubkey||s.pubkey):void 0)),n5.prop(s,"output",(()=>{if(s.hash)return r5.compile([r.OP_DUP,r.OP_HASH160,s.hash,r.OP_EQUALVERIFY,r.OP_CHECKSIG])})),n5.prop(s,"pubkey",(()=>{if(e.input)return i()[1]})),n5.prop(s,"signature",(()=>{if(e.input)return i()[0]})),n5.prop(s,"input",(()=>{if(e.pubkey&&e.signature)return r5.compile([e.signature,e.pubkey])})),n5.prop(s,"witness",(()=>{if(s.input)return[]})),t.validate){let t=eU.from([]);if(e.address){if(n().version!==o.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==n().hash.length)throw new TypeError("Invalid address");t=n().hash}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(25!==e.output.length||e.output[0]!==r.OP_DUP||e.output[1]!==r.OP_HASH160||20!==e.output[2]||e.output[23]!==r.OP_EQUALVERIFY||e.output[24]!==r.OP_CHECKSIG)throw new TypeError("Output is invalid");const n=e.output.slice(3,23);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch");t=n}if(e.pubkey){const r=a5.hash160(e.pubkey);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.input){const r=i();if(2!==r.length)throw new TypeError("Input is invalid");if(!r5.isCanonicalScriptSignature(r[0]))throw new TypeError("Input has invalid signature");if(!Q6.isPoint(r[1]))throw new TypeError("Input has invalid pubkey");if(e.signature&&!e.signature.equals(r[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(r[1]))throw new TypeError("Pubkey mismatch");const n=a5.hash160(r[1]);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch")}}return Object.assign(s,e)}}));MB(u5),u5.p2pkh;var c5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS;t.p2sh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),L4({network:L4.maybe(L4.Object),address:L4.maybe(L4.String),hash:L4.maybe(L4.BufferN(20)),output:L4.maybe(L4.BufferN(23)),redeem:L4.maybe({network:L4.maybe(L4.Object),output:L4.maybe(L4.Buffer),input:L4.maybe(L4.Buffer),witness:L4.maybe(L4.arrayOf(L4.Buffer))}),input:L4.maybe(L4.Buffer),witness:L4.maybe(L4.arrayOf(L4.Buffer))},e);let n=e.network;n||(n=e.redeem&&e.redeem.network||z4.bitcoin);const i={network:n},o=n5.value((()=>{const t=T1.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}})),s=n5.value((()=>r5.decompile(e.input))),a=n5.value((()=>{const t=s();return{network:n,output:t[t.length-1],input:r5.compile(t.slice(0,-1)),witness:e.witness||[]}}));if(n5.prop(i,"address",(()=>{if(!i.hash)return;const e=eU.allocUnsafe(21);return e.writeUInt8(i.network.scriptHash,0),i.hash.copy(e,1),T1.encode(e)})),n5.prop(i,"hash",(()=>e.output?e.output.slice(2,22):e.address?o().hash:i.redeem&&i.redeem.output?a5.hash160(i.redeem.output):void 0)),n5.prop(i,"output",(()=>{if(i.hash)return r5.compile([r.OP_HASH160,i.hash,r.OP_EQUAL])})),n5.prop(i,"redeem",(()=>{if(e.input)return a()})),n5.prop(i,"input",(()=>{if(e.redeem&&e.redeem.input&&e.redeem.output)return r5.compile([].concat(r5.decompile(e.redeem.input),e.redeem.output))})),n5.prop(i,"witness",(()=>i.redeem&&i.redeem.witness?i.redeem.witness:i.input?[]:void 0)),n5.prop(i,"name",(()=>{const e=["p2sh"];return void 0!==i.redeem&&e.push(i.redeem.name),e.join("-")})),t.validate){let t=eU.from([]);if(e.address){if(o().version!==n.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==o().hash.length)throw new TypeError("Invalid address");t=o().hash}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(23!==e.output.length||e.output[0]!==r.OP_HASH160||20!==e.output[1]||e.output[22]!==r.OP_EQUAL)throw new TypeError("Output is invalid");const n=e.output.slice(2,22);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch");t=n}const i=e=>{if(e.output){const r=r5.decompile(e.output);if(!r||r.length<1)throw new TypeError("Redeem.output too short");const n=a5.hash160(e.output);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch");t=n}if(e.input){const t=e.input.length>0,r=e.witness&&e.witness.length>0;if(!t&&!r)throw new TypeError("Empty input");if(t&&r)throw new TypeError("Input and witness provided");if(t){const t=r5.decompile(e.input);if(!r5.isPushOnly(t))throw new TypeError("Non push-only scriptSig")}}};if(e.input){const e=s();if(!e||e.length<1)throw new TypeError("Input too short");if(!jU(a().output))throw new TypeError("Input is invalid");i(a())}if(e.redeem){if(e.redeem.network&&e.redeem.network!==n)throw new TypeError("Network mismatch");if(e.input){const t=a();if(e.redeem.output&&!e.redeem.output.equals(t.output))throw new TypeError("Redeem.output mismatch");if(e.redeem.input&&!e.redeem.input.equals(t.input))throw new TypeError("Redeem.input mismatch")}i(e.redeem)}if(e.witness&&e.redeem&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}(e.redeem.witness,e.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(i,e)}}));MB(c5),c5.p2sh;for(var l5="qpzry9x8gf2tvdw0s3jn54khce6mua7l",h5={},f5=0;f5<l5.length;f5++){var d5=l5.charAt(f5);if(void 0!==h5[d5])throw new TypeError(d5+" is ambiguous");h5[d5]=f5}function p5(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function g5(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=p5(t)^n>>5}for(t=p5(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=p5(t)^31&i}return t}function m5(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var i=(e=r).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),s=e.slice(i+1);if(s.length<6)return"Data too short";var a=g5(o);if("string"==typeof a)return a;for(var u=[],c=0;c<s.length;++c){var l=s.charAt(c),h=h5[l];if(void 0===h)return"Unknown character "+l;a=p5(a)^h,c+6>=s.length||u.push(h)}return 1!==a?"Invalid checksum for "+e:{prefix:o,words:u}}function v5(e,t,r,n){for(var i=0,o=0,s=(1<<r)-1,a=[],u=0;u<e.length;++u)for(i=i<<t|e[u],o+=t;o>=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<<r-o&s);else{if(o>=t)return"Excess padding";if(i<<r-o&s)return"Non-zero padding"}return a}var y5=function(e){var t=m5.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},b5=function(e,t,r){if(r=r||90,e.length+7+t.length>r)throw new TypeError("Exceeds length limit");var n=g5(e=e.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=e+"1",o=0;o<t.length;++o){var s=t[o];if(s>>5!=0)throw new Error("Non 5-bit word");n=p5(n)^s,i+=l5.charAt(s)}for(o=0;o<6;++o)n=p5(n);for(n^=1,o=0;o<6;++o)i+=l5.charAt(n>>5*(5-o)&31);return i},w5=function(e){var t=v5(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},_5=function(e){var t=v5(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)},x5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS,n=eU.alloc(0);t.p2wpkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),L4({address:L4.maybe(L4.String),hash:L4.maybe(L4.BufferN(20)),input:L4.maybe(L4.BufferN(0)),network:L4.maybe(L4.Object),output:L4.maybe(L4.BufferN(22)),pubkey:L4.maybe(Q6.isPoint),signature:L4.maybe(r5.isCanonicalScriptSignature),witness:L4.maybe(L4.arrayOf(L4.Buffer))},e);const i=n5.value((()=>{const t=y5(e.address),r=t.words.shift(),n=_5(t.words);return{version:r,prefix:t.prefix,data:eU.from(n)}})),o=e.network||z4.bitcoin,s={name:"p2wpkh",network:o};if(n5.prop(s,"address",(()=>{if(!s.hash)return;const e=w5(s.hash);return e.unshift(0),b5(o.bech32,e)})),n5.prop(s,"hash",(()=>e.output?e.output.slice(2,22):e.address?i().data:e.pubkey||s.pubkey?a5.hash160(e.pubkey||s.pubkey):void 0)),n5.prop(s,"output",(()=>{if(s.hash)return r5.compile([r.OP_0,s.hash])})),n5.prop(s,"pubkey",(()=>e.pubkey?e.pubkey:e.witness?e.witness[1]:void 0)),n5.prop(s,"signature",(()=>{if(e.witness)return e.witness[0]})),n5.prop(s,"input",(()=>{if(s.witness)return n})),n5.prop(s,"witness",(()=>{if(e.pubkey&&e.signature)return[e.signature,e.pubkey]})),t.validate){let t=eU.from([]);if(e.address){if(o&&o.bech32!==i().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(0!==i().version)throw new TypeError("Invalid address version");if(20!==i().data.length)throw new TypeError("Invalid address data");t=i().data}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(22!==e.output.length||e.output[0]!==r.OP_0||20!==e.output[1])throw new TypeError("Output is invalid");if(t.length>0&&!t.equals(e.output.slice(2)))throw new TypeError("Hash mismatch");t=e.output.slice(2)}if(e.pubkey){const r=a5.hash160(e.pubkey);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");if(t=r,!Q6.isPoint(e.pubkey)||33!==e.pubkey.length)throw new TypeError("Invalid pubkey for p2wpkh")}if(e.witness){if(2!==e.witness.length)throw new TypeError("Witness is invalid");if(!r5.isCanonicalScriptSignature(e.witness[0]))throw new TypeError("Witness has invalid signature");if(!Q6.isPoint(e.witness[1])||33!==e.witness[1].length)throw new TypeError("Witness has invalid pubkey");if(e.signature&&!e.signature.equals(e.witness[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(e.witness[1]))throw new TypeError("Pubkey mismatch");const r=a5.hash160(e.witness[1]);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch")}}return Object.assign(s,e)}}));MB(x5),x5.p2wpkh;var S5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS,n=eU.alloc(0);function i(e){return!(!jU(e)||65!==e.length||4!==e[0]||!Q6.isPoint(e))}t.p2wsh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),L4({network:L4.maybe(L4.Object),address:L4.maybe(L4.String),hash:L4.maybe(L4.BufferN(32)),output:L4.maybe(L4.BufferN(34)),redeem:L4.maybe({input:L4.maybe(L4.Buffer),network:L4.maybe(L4.Object),output:L4.maybe(L4.Buffer),witness:L4.maybe(L4.arrayOf(L4.Buffer))}),input:L4.maybe(L4.BufferN(0)),witness:L4.maybe(L4.arrayOf(L4.Buffer))},e);const o=n5.value((()=>{const t=y5(e.address),r=t.words.shift(),n=_5(t.words);return{version:r,prefix:t.prefix,data:eU.from(n)}})),s=n5.value((()=>r5.decompile(e.redeem.input)));let a=e.network;a||(a=e.redeem&&e.redeem.network||z4.bitcoin);const u={network:a};if(n5.prop(u,"address",(()=>{if(!u.hash)return;const e=w5(u.hash);return e.unshift(0),b5(a.bech32,e)})),n5.prop(u,"hash",(()=>e.output?e.output.slice(2):e.address?o().data:u.redeem&&u.redeem.output?a5.sha256(u.redeem.output):void 0)),n5.prop(u,"output",(()=>{if(u.hash)return r5.compile([r.OP_0,u.hash])})),n5.prop(u,"redeem",(()=>{if(e.witness)return{output:e.witness[e.witness.length-1],input:n,witness:e.witness.slice(0,-1)}})),n5.prop(u,"input",(()=>{if(u.witness)return n})),n5.prop(u,"witness",(()=>{if(e.redeem&&e.redeem.input&&e.redeem.input.length>0&&e.redeem.output&&e.redeem.output.length>0){const t=r5.toStack(s());return u.redeem=Object.assign({witness:t},e.redeem),u.redeem.input=n,[].concat(t,e.redeem.output)}if(e.redeem&&e.redeem.output&&e.redeem.witness)return[].concat(e.redeem.witness,e.redeem.output)})),n5.prop(u,"name",(()=>{const e=["p2wsh"];return void 0!==u.redeem&&e.push(u.redeem.name),e.join("-")})),t.validate){let t=eU.from([]);if(e.address){if(o().prefix!==a.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==o().version)throw new TypeError("Invalid address version");if(32!==o().data.length)throw new TypeError("Invalid address data");t=o().data}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(34!==e.output.length||e.output[0]!==r.OP_0||32!==e.output[1])throw new TypeError("Output is invalid");const n=e.output.slice(2);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch");t=n}if(e.redeem){if(e.redeem.network&&e.redeem.network!==a)throw new TypeError("Network mismatch");if(e.redeem.input&&e.redeem.input.length>0&&e.redeem.witness&&e.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(e.redeem.output){if(0===r5.decompile(e.redeem.output).length)throw new TypeError("Redeem.output is invalid");const r=a5.sha256(e.redeem.output);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.redeem.input&&!r5.isPushOnly(s()))throw new TypeError("Non push-only scriptSig");if(e.witness&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}(e.witness,e.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(e.redeem.input&&s().some(i)||e.redeem.output&&(r5.decompile(e.redeem.output)||[]).some(i))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(e.witness&&e.witness.length>0){const t=e.witness[e.witness.length-1];if(e.redeem&&e.redeem.output&&!e.redeem.output.equals(t))throw new TypeError("Witness and redeem.output mismatch");if(e.witness.some(i)||(r5.decompile(t)||[]).some(i))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(u,e)}}));MB(S5),S5.p2wsh;var E5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.embed=i5.p2data,t.p2ms=o5.p2ms,t.p2pk=s5.p2pk,t.p2pkh=u5.p2pkh,t.p2sh=c5.p2sh,t.p2wpkh=x5.p2wpkh,t.p2wsh=S5.p2wsh}));MB(E5),E5.embed,E5.p2ms,E5.p2pk,E5.p2pkh,E5.p2sh,E5.p2wpkh,E5.p2wsh;var k5=RB((function(e,t){function r(e){const t=T1.decode(e);if(t.length<21)throw new TypeError(e+" is too short");if(t.length>21)throw new TypeError(e+" is too long");return{version:t.readUInt8(0),hash:t.slice(1)}}function n(e){const t=y5(e),r=_5(t.words.slice(1));return{version:t.words[0],prefix:t.prefix,data:eU.from(r)}}Object.defineProperty(t,"__esModule",{value:!0}),t.fromBase58Check=r,t.fromBech32=n,t.toBase58Check=function(e,t){L4(q4.tuple(q4.Hash160bit,q4.UInt8),arguments);const r=eU.allocUnsafe(21);return r.writeUInt8(t,0),e.copy(r,1),T1.encode(r)},t.toBech32=function(e,t,r){const n=w5(e);return n.unshift(t),b5(r,n)},t.fromOutputScript=function(e,t){t=t||z4.bitcoin;try{return E5.p2pkh({output:e,network:t}).address}catch(e){}try{return E5.p2sh({output:e,network:t}).address}catch(e){}try{return E5.p2wpkh({output:e,network:t}).address}catch(e){}try{return E5.p2wsh({output:e,network:t}).address}catch(e){}throw new Error(r5.toASM(e)+" has no matching Address")},t.toOutputScript=function(e,t){let i,o;t=t||z4.bitcoin;try{i=r(e)}catch(e){}if(i){if(i.version===t.pubKeyHash)return E5.p2pkh({hash:i.hash}).output;if(i.version===t.scriptHash)return E5.p2sh({hash:i.hash}).output}else{try{o=n(e)}catch(e){}if(o){if(o.prefix!==t.bech32)throw new Error(e+" has an invalid prefix");if(0===o.version){if(20===o.data.length)return E5.p2wpkh({hash:o.data}).output;if(32===o.data.length)return E5.p2wsh({hash:o.data}).output}}}throw new Error(e+" has no matching Script")}}));MB(k5),k5.fromBase58Check,k5.fromBech32,k5.toBase58Check,k5.toBech32,k5.fromOutputScript,k5.toOutputScript;var I5=RB((function(e){var t=65536,r=QX.Buffer,n=CB.crypto||CB.msCrypto;n&&n.getRandomValues?e.exports=function(e,i){if(e>4294967295)throw new RangeError("requested too many random bytes");var o=r.allocUnsafe(e);if(e>0)if(e>t)for(var s=0;s<e;s+=t)n.getRandomValues(o.slice(s,s+t));else n.getRandomValues(o);return"function"==typeof i?XU((function(){i(null,o)})):o}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}})),A5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=L4.maybe(L4.compile({compressed:q4.maybe(q4.Boolean),network:q4.maybe(q4.Network)}));class n{constructor(e,t,r){this.__D=e,this.__Q=t,this.lowR=!1,void 0===r&&(r={}),this.compressed=void 0===r.compressed||r.compressed,this.network=r.network||z4.bitcoin,void 0!==t&&(this.__Q=Q6.pointCompress(t,this.compressed))}get privateKey(){return this.__D}get publicKey(){return this.__Q||(this.__Q=Q6.pointFromScalar(this.__D,this.compressed)),this.__Q}toWIF(){if(!this.__D)throw new Error("Missing private key");return U4(this.network.wif,this.__D,this.compressed)}sign(e,t){if(!this.__D)throw new Error("Missing private key");if(void 0===t&&(t=this.lowR),!1===t)return Q6.sign(e,this.__D);{let t=Q6.sign(e,this.__D);const r=eU.alloc(32,0);let n=0;for(;t[0]>127;)n++,r.writeUIntLE(n,0,6),t=Q6.signWithEntropy(e,this.__D,r);return t}}verify(e,t){return Q6.verify(e,this.publicKey,t)}}function i(e,t){if(L4(q4.Buffer256bit,e),!Q6.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return L4(r,t),new n(e,void 0,t)}t.fromPrivateKey=i,t.fromPublicKey=function(e,t){return L4(Q6.isPoint,e),L4(r,t),new n(void 0,e,t)},t.fromWIF=function(e,t){const r=B4(e),n=r.version;if(q4.Array(t)){if(!(t=t.filter((e=>n===e.wif)).pop()))throw new Error("Unknown network version")}else if(t=t||z4.bitcoin,n!==t.wif)throw new Error("Invalid network version");return i(r.privateKey,{compressed:r.compressed,network:t})},t.makeRandom=function(e){L4(r,e),void 0===e&&(e={});const t=e.rng||I5;let n;do{n=t(32),L4(q4.Buffer256bit,n)}while(!Q6.isPrivate(n));return i(n,e)}}));MB(A5),A5.fromPrivateKey,A5.fromPublicKey,A5.fromWIF,A5.makeRandom;var P5=QX.Buffer;function T5(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function O5(e){return T5(e),e<253?1:e<=65535?3:e<=4294967295?5:9}var C5={encode:function e(t,r,n){if(T5(t),r||(r=P5.allocUnsafe(O5(t))),!P5.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return n||(n=0),t<253?(r.writeUInt8(t,n),e.bytes=1):t<=65535?(r.writeUInt8(253,n),r.writeUInt16LE(t,n+1),e.bytes=3):t<=4294967295?(r.writeUInt8(254,n),r.writeUInt32LE(t,n+1),e.bytes=5):(r.writeUInt8(255,n),r.writeUInt32LE(t>>>0,n+1),r.writeUInt32LE(t/4294967296|0,n+5),e.bytes=9),r},decode:function e(t,r){if(!P5.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var n=t.readUInt8(r);if(n<253)return e.bytes=1,n;if(253===n)return e.bytes=3,t.readUInt16LE(r+1);if(254===n)return e.bytes=5,t.readUInt32LE(r+1);e.bytes=9;var i=t.readUInt32LE(r+1),o=4294967296*t.readUInt32LE(r+5)+i;return T5(o),o},encodingLength:O5},M5=RB((function(e,t){function r(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}function n(e,t){const n=e.readUInt32LE(t);let i=e.readUInt32LE(t+4);return i*=4294967296,r(i+n,9007199254740991),i+n}function i(e,t,n){return r(t,9007199254740991),e.writeInt32LE(-1&t,n),e.writeUInt32LE(Math.floor(t/4294967296),n+4),n+8}Object.defineProperty(t,"__esModule",{value:!0}),t.readUInt64LE=n,t.writeUInt64LE=i,t.reverseBuffer=function(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.cloneBuffer=function(e){const t=eU.allocUnsafe(e.length);return e.copy(t),t},t.BufferWriter=class{constructor(e,t=0){this.buffer=e,this.offset=t,L4(q4.tuple(q4.Buffer,q4.UInt32),[e,t])}writeUInt8(e){this.offset=this.buffer.writeUInt8(e,this.offset)}writeInt32(e){this.offset=this.buffer.writeInt32LE(e,this.offset)}writeUInt32(e){this.offset=this.buffer.writeUInt32LE(e,this.offset)}writeUInt64(e){this.offset=i(this.buffer,e,this.offset)}writeVarInt(e){C5.encode(e,this.buffer,this.offset),this.offset+=C5.encode.bytes}writeSlice(e){if(this.buffer.length<this.offset+e.length)throw new Error("Cannot write slice out of bounds");this.offset+=e.copy(this.buffer,this.offset)}writeVarSlice(e){this.writeVarInt(e.length),this.writeSlice(e)}writeVector(e){this.writeVarInt(e.length),e.forEach((e=>this.writeVarSlice(e)))}},t.BufferReader=class{constructor(e,t=0){this.buffer=e,this.offset=t,L4(q4.tuple(q4.Buffer,q4.UInt32),[e,t])}readUInt8(){const e=this.buffer.readUInt8(this.offset);return this.offset++,e}readInt32(){const e=this.buffer.readInt32LE(this.offset);return this.offset+=4,e}readUInt32(){const e=this.buffer.readUInt32LE(this.offset);return this.offset+=4,e}readUInt64(){const e=n(this.buffer,this.offset);return this.offset+=8,e}readVarInt(){const e=C5.decode(this.buffer,this.offset);return this.offset+=C5.decode.bytes,e}readSlice(e){if(this.buffer.length<this.offset+e)throw new Error("Cannot read slice out of bounds");const t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}readVarSlice(){return this.readSlice(this.readVarInt())}readVector(){const e=this.readVarInt(),t=[];for(let r=0;r<e;r++)t.push(this.readVarSlice());return t}}}));MB(M5),M5.readUInt64LE,M5.writeUInt64LE,M5.reverseBuffer,M5.cloneBuffer,M5.BufferWriter,M5.BufferReader;var R5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5;function n(e){const t=e.length;return C5.encodingLength(t)+t}const i=eU.allocUnsafe(0),o=[],s=eU.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),a=eU.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),u=eU.from("ffffffffffffffff","hex"),c={script:i,valueBuffer:u};class l{constructor(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}static fromBuffer(e,t){const r=new M5.BufferReader(e),n=new l;n.version=r.readInt32();const i=r.readUInt8(),s=r.readUInt8();let a=!1;i===l.ADVANCED_TRANSACTION_MARKER&&s===l.ADVANCED_TRANSACTION_FLAG?a=!0:r.offset-=2;const u=r.readVarInt();for(let e=0;e<u;++e)n.ins.push({hash:r.readSlice(32),index:r.readUInt32(),script:r.readVarSlice(),sequence:r.readUInt32(),witness:o});const c=r.readVarInt();for(let e=0;e<c;++e)n.outs.push({value:r.readUInt64(),script:r.readVarSlice()});if(a){for(let e=0;e<u;++e)n.ins[e].witness=r.readVector();if(!n.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(n.locktime=r.readUInt32(),t)return n;if(r.offset!==e.length)throw new Error("Transaction has unexpected data");return n}static fromHex(e){return l.fromBuffer(eU.from(e,"hex"),!1)}static isCoinbaseHash(e){L4(q4.Hash256bit,e);for(let t=0;t<32;++t)if(0!==e[t])return!1;return!0}isCoinbase(){return 1===this.ins.length&&l.isCoinbaseHash(this.ins[0].hash)}addInput(e,t,r,n){return L4(q4.tuple(q4.Hash256bit,q4.UInt32,q4.maybe(q4.UInt32),q4.maybe(q4.Buffer)),arguments),q4.Null(r)&&(r=l.DEFAULT_SEQUENCE),this.ins.push({hash:e,index:t,script:n||i,sequence:r,witness:o})-1}addOutput(e,t){return L4(q4.tuple(q4.Buffer,q4.Satoshi),arguments),this.outs.push({script:e,value:t})-1}hasWitnesses(){return this.ins.some((e=>0!==e.witness.length))}weight(){return 3*this.byteLength(!1)+this.byteLength(!0)}virtualSize(){return Math.ceil(this.weight()/4)}byteLength(e=!0){const t=e&&this.hasWitnesses();return(t?10:8)+C5.encodingLength(this.ins.length)+C5.encodingLength(this.outs.length)+this.ins.reduce(((e,t)=>e+40+n(t.script)),0)+this.outs.reduce(((e,t)=>e+8+n(t.script)),0)+(t?this.ins.reduce(((e,t)=>e+function(e){const t=e.length;return C5.encodingLength(t)+e.reduce(((e,t)=>e+n(t)),0)}(t.witness)),0):0)}clone(){const e=new l;return e.version=this.version,e.locktime=this.locktime,e.ins=this.ins.map((e=>({hash:e.hash,index:e.index,script:e.script,sequence:e.sequence,witness:e.witness}))),e.outs=this.outs.map((e=>({script:e.script,value:e.value}))),e}hashForSignature(e,t,n){if(L4(q4.tuple(q4.UInt32,q4.Buffer,q4.Number),arguments),e>=this.ins.length)return a;const o=r5.compile(r5.decompile(t).filter((e=>e!==r.OPS.OP_CODESEPARATOR))),s=this.clone();if((31&n)===l.SIGHASH_NONE)s.outs=[],s.ins.forEach(((t,r)=>{r!==e&&(t.sequence=0)}));else if((31&n)===l.SIGHASH_SINGLE){if(e>=this.outs.length)return a;s.outs.length=e+1;for(let t=0;t<e;t++)s.outs[t]=c;s.ins.forEach(((t,r)=>{r!==e&&(t.sequence=0)}))}n&l.SIGHASH_ANYONECANPAY?(s.ins=[s.ins[e]],s.ins[0].script=o):(s.ins.forEach((e=>{e.script=i})),s.ins[e].script=o);const u=eU.allocUnsafe(s.byteLength(!1)+4);return u.writeInt32LE(n,u.length-4),s.__toBuffer(u,0,!1),a5.hash256(u)}hashForWitnessV0(e,t,r,i){L4(q4.tuple(q4.UInt32,q4.Buffer,q4.Satoshi,q4.UInt32),arguments);let o,a=eU.from([]),u=s,c=s,h=s;if(i&l.SIGHASH_ANYONECANPAY||(a=eU.allocUnsafe(36*this.ins.length),o=new M5.BufferWriter(a,0),this.ins.forEach((e=>{o.writeSlice(e.hash),o.writeUInt32(e.index)})),c=a5.hash256(a)),i&l.SIGHASH_ANYONECANPAY||(31&i)===l.SIGHASH_SINGLE||(31&i)===l.SIGHASH_NONE||(a=eU.allocUnsafe(4*this.ins.length),o=new M5.BufferWriter(a,0),this.ins.forEach((e=>{o.writeUInt32(e.sequence)})),h=a5.hash256(a)),(31&i)!==l.SIGHASH_SINGLE&&(31&i)!==l.SIGHASH_NONE){const e=this.outs.reduce(((e,t)=>e+8+n(t.script)),0);a=eU.allocUnsafe(e),o=new M5.BufferWriter(a,0),this.outs.forEach((e=>{o.writeUInt64(e.value),o.writeVarSlice(e.script)})),u=a5.hash256(a)}else if((31&i)===l.SIGHASH_SINGLE&&e<this.outs.length){const t=this.outs[e];a=eU.allocUnsafe(8+n(t.script)),o=new M5.BufferWriter(a,0),o.writeUInt64(t.value),o.writeVarSlice(t.script),u=a5.hash256(a)}a=eU.allocUnsafe(156+n(t)),o=new M5.BufferWriter(a,0);const f=this.ins[e];return o.writeUInt32(this.version),o.writeSlice(c),o.writeSlice(h),o.writeSlice(f.hash),o.writeUInt32(f.index),o.writeVarSlice(t),o.writeUInt64(r),o.writeUInt32(f.sequence),o.writeSlice(u),o.writeUInt32(this.locktime),o.writeUInt32(i),a5.hash256(a)}getHash(e){return e&&this.isCoinbase()?eU.alloc(32,0):a5.hash256(this.__toBuffer(void 0,void 0,e))}getId(){return M5.reverseBuffer(this.getHash(!1)).toString("hex")}toBuffer(e,t){return this.__toBuffer(e,t,!0)}toHex(){return this.toBuffer(void 0,void 0).toString("hex")}setInputScript(e,t){L4(q4.tuple(q4.Number,q4.Buffer),arguments),this.ins[e].script=t}setWitness(e,t){L4(q4.tuple(q4.Number,[q4.Buffer]),arguments),this.ins[e].witness=t}__toBuffer(e,t,r=!1){e||(e=eU.allocUnsafe(this.byteLength(r)));const n=new M5.BufferWriter(e,t||0);n.writeInt32(this.version);const i=r&&this.hasWitnesses();return i&&(n.writeUInt8(l.ADVANCED_TRANSACTION_MARKER),n.writeUInt8(l.ADVANCED_TRANSACTION_FLAG)),n.writeVarInt(this.ins.length),this.ins.forEach((e=>{n.writeSlice(e.hash),n.writeUInt32(e.index),n.writeVarSlice(e.script),n.writeUInt32(e.sequence)})),n.writeVarInt(this.outs.length),this.outs.forEach((e=>{void 0!==e.value?n.writeUInt64(e.value):n.writeSlice(e.valueBuffer),n.writeVarSlice(e.script)})),i&&this.ins.forEach((e=>{n.writeVector(e.witness)})),n.writeUInt32(this.locktime),void 0!==t?e.slice(t,n.offset):e}}l.DEFAULT_SEQUENCE=4294967295,l.SIGHASH_ALL=1,l.SIGHASH_NONE=2,l.SIGHASH_SINGLE=3,l.SIGHASH_ANYONECANPAY=128,l.ADVANCED_TRANSACTION_MARKER=0,l.ADVANCED_TRANSACTION_FLAG=1,t.Transaction=l}));MB(R5),R5.Transaction;var N5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=new TypeError("Cannot compute merkle root for zero transactions"),n=new TypeError("Cannot compute witness commit for non-segwit block");class i{constructor(){this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}static fromBuffer(e){if(e.length<80)throw new Error("Buffer too small (< 80 bytes)");const t=new M5.BufferReader(e),r=new i;if(r.version=t.readInt32(),r.prevHash=t.readSlice(32),r.merkleRoot=t.readSlice(32),r.timestamp=t.readUInt32(),r.bits=t.readUInt32(),r.nonce=t.readUInt32(),80===e.length)return r;const n=()=>{const e=R5.Transaction.fromBuffer(t.buffer.slice(t.offset),!0);return t.offset+=e.byteLength(),e},o=t.readVarInt();r.transactions=[];for(let e=0;e<o;++e){const e=n();r.transactions.push(e)}const s=r.getWitnessCommit();return s&&(r.witnessCommit=s),r}static fromHex(e){return i.fromBuffer(eU.from(e,"hex"))}static calculateTarget(e){const t=((4278190080&e)>>24)-3,r=8388607&e,n=eU.alloc(32,0);return n.writeUIntBE(r,29-t,3),n}static calculateMerkleRoot(e,t){if(L4([{getHash:q4.Function}],e),0===e.length)throw r;if(t&&!o(e))throw n;const i=function(e,t){if(!Array.isArray(e))throw TypeError("Expected values Array");if("function"!=typeof t)throw TypeError("Expected digest Function");for(var r=e.length,n=e.concat();r>1;){for(var i=0,o=0;o<r;o+=2,++i){var s=n[o],a=o+1===r?s:n[o+1],u=eU.concat([s,a]);n[i]=t(u)}r=i}return n[0]}(e.map((e=>e.getHash(t))),a5.hash256);return t?a5.hash256(eU.concat([i,e[0].ins[0].witness[0]])):i}getWitnessCommit(){if(!o(this.transactions))return null;const e=this.transactions[0].outs.filter((e=>e.script.slice(0,6).equals(eU.from("6a24aa21a9ed","hex")))).map((e=>e.script.slice(6,38)));if(0===e.length)return null;const t=e[e.length-1];return t instanceof eU&&32===t.length?t:null}hasWitnessCommit(){return this.witnessCommit instanceof eU&&32===this.witnessCommit.length||null!==this.getWitnessCommit()}hasWitness(){return(e=this.transactions)instanceof Array&&e.some((e=>"object"==typeof e&&e.ins instanceof Array&&e.ins.some((e=>"object"==typeof e&&e.witness instanceof Array&&e.witness.length>0))));var e}weight(){return 3*this.byteLength(!1,!1)+this.byteLength(!1,!0)}byteLength(e,t=!0){return e||!this.transactions?80:80+C5.encodingLength(this.transactions.length)+this.transactions.reduce(((e,r)=>e+r.byteLength(t)),0)}getHash(){return a5.hash256(this.toBuffer(!0))}getId(){return M5.reverseBuffer(this.getHash()).toString("hex")}getUTCDate(){const e=new Date(0);return e.setUTCSeconds(this.timestamp),e}toBuffer(e){const t=eU.allocUnsafe(this.byteLength(e)),r=new M5.BufferWriter(t);return r.writeInt32(this.version),r.writeSlice(this.prevHash),r.writeSlice(this.merkleRoot),r.writeUInt32(this.timestamp),r.writeUInt32(this.bits),r.writeUInt32(this.nonce),e||!this.transactions||(C5.encode(this.transactions.length,t,r.offset),r.offset+=C5.encode.bytes,this.transactions.forEach((e=>{const n=e.byteLength();e.toBuffer(t,r.offset),r.offset+=n}))),t}toHex(e){return this.toBuffer(e).toString("hex")}checkTxRoots(){const e=this.hasWitnessCommit();return!(!e&&this.hasWitness())&&this.__checkMerkleRoot()&&(!e||this.__checkWitnessCommit())}checkProofOfWork(){const e=M5.reverseBuffer(this.getHash()),t=i.calculateTarget(this.bits);return e.compare(t)<=0}__checkMerkleRoot(){if(!this.transactions)throw r;const e=i.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(e)}__checkWitnessCommit(){if(!this.transactions)throw r;if(!this.hasWitnessCommit())throw n;const e=i.calculateMerkleRoot(this.transactions,!0);return 0===this.witnessCommit.compare(e)}}function o(e){return e instanceof Array&&e[0]&&e[0].ins&&e[0].ins instanceof Array&&e[0].ins[0]&&e[0].ins[0].witness&&e[0].ins[0].witness instanceof Array&&e[0].ins[0].witness.length>0}t.Block=i}));MB(N5),N5.Block;var L5=RB((function(e,t){var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),(r=t.GlobalTypes||(t.GlobalTypes={}))[r.UNSIGNED_TX=0]="UNSIGNED_TX",r[r.GLOBAL_XPUB=1]="GLOBAL_XPUB",t.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"],(n=t.InputTypes||(t.InputTypes={}))[n.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",n[n.WITNESS_UTXO=1]="WITNESS_UTXO",n[n.PARTIAL_SIG=2]="PARTIAL_SIG",n[n.SIGHASH_TYPE=3]="SIGHASH_TYPE",n[n.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",n[n.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",n[n.BIP32_DERIVATION=6]="BIP32_DERIVATION",n[n.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",n[n.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",n[n.POR_COMMITMENT=9]="POR_COMMITMENT",t.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment"],(i=t.OutputTypes||(t.OutputTypes={}))[i.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",i[i.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",i[i.BIP32_DERIVATION=2]="BIP32_DERIVATION",t.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation"]}));MB(L5),L5.GlobalTypes,L5.GLOBAL_TYPE_NAMES,L5.InputTypes,L5.INPUT_TYPE_NAMES,L5.OutputTypes,L5.OUTPUT_TYPE_NAMES;var j5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+e.key.toString("hex"));if(79!==e.key.length||![2,3].includes(e.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+e.key.toString("hex"));if(e.value.length/4%1!=0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");const t=e.key.slice(1),r={masterFingerprint:e.value.slice(0,4),extendedPubkey:t,path:"m"};for(const t of(e=>[...Array(e).keys()])(e.value.length/4-1)){const n=e.value.readUInt32LE(4*t+4),i=!!(2147483648&n),o=2147483647&n;r.path+="/"+o.toString(10)+(i?"'":"")}return r},t.encode=function(e){const t=eU.from([L5.GlobalTypes.GLOBAL_XPUB]),r=eU.concat([t,e.extendedPubkey]),n=e.path.split("/"),i=eU.allocUnsafe(4*n.length);e.masterFingerprint.copy(i,0);let o=4;return n.slice(1).forEach((e=>{const t="'"===e.slice(-1);let r=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(r+=2147483648),i.writeUInt32LE(r,o),o+=4})),{key:r,value:i}},t.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }",t.check=function(e){const t=e.extendedPubkey,r=e.masterFingerprint,n=e.path;return jU(t)&&78===t.length&&[2,3].indexOf(t[45])>-1&&jU(r)&&4===r.length&&"string"==typeof n&&!!n.match(/^m(\/\d+'?)+$/)},t.canAddToArray=function(e,t,r){const n=t.extendedPubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter((e=>e.extendedPubkey.equals(t.extendedPubkey))).length)}}));MB(j5),j5.decode,j5.encode,j5.expected,j5.check,j5.canAddToArray;var D5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.encode=function(e){return{key:eU.from([L5.GlobalTypes.UNSIGNED_TX]),value:e.toBuffer()}}}));MB(D5),D5.encode;var B5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:eU.from([L5.InputTypes.FINAL_SCRIPTSIG]),value:e}},t.expected="Buffer",t.check=function(e){return jU(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptSig}}));MB(B5),B5.decode,B5.encode,B5.expected,B5.check,B5.canAdd;var U5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:eU.from([L5.InputTypes.FINAL_SCRIPTWITNESS]),value:e}},t.expected="Buffer",t.check=function(e){return jU(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptWitness}}));MB(U5),U5.decode,U5.encode,U5.expected,U5.check,U5.canAdd;var F5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:eU.from([L5.InputTypes.NON_WITNESS_UTXO]),value:e}},t.expected="Buffer",t.check=function(e){return jU(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.nonWitnessUtxo}}));MB(F5),F5.decode,F5.encode,F5.expected,F5.check,F5.canAdd;var H5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+e.key.toString("hex"));if(34!==e.key.length&&66!==e.key.length||![2,3,4].includes(e.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+e.key.toString("hex"));return{pubkey:e.key.slice(1),signature:e.value}},t.encode=function(e){const t=eU.from([L5.InputTypes.PARTIAL_SIG]);return{key:eU.concat([t,e.pubkey]),value:e.signature}},t.expected="{ pubkey: Buffer; signature: Buffer; }",t.check=function(e){return jU(e.pubkey)&&jU(e.signature)&&[33,65].includes(e.pubkey.length)&&[2,3,4].includes(e.pubkey[0])&&function(e){if(!jU(e)||e.length<9)return!1;if(48!==e[0])return!1;if(e.length!==e[1]+3)return!1;if(2!==e[2])return!1;const t=e[3];if(t>33||t<1)return!1;if(2!==e[3+t+1])return!1;const r=e[3+t+2];return!(r>33||r<1)&&e.length===3+t+2+r+2}(e.signature)},t.canAddToArray=function(e,t,r){const n=t.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter((e=>e.pubkey.equals(t.pubkey))).length)}}));MB(H5),H5.decode,H5.encode,H5.expected,H5.check,H5.canAddToArray;var z5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+e.key.toString("hex"));return e.value.toString("utf8")},t.encode=function(e){return{key:eU.from([L5.InputTypes.POR_COMMITMENT]),value:eU.from(e,"utf8")}},t.expected="string",t.check=function(e){return"string"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.porCommitment}}));MB(z5),z5.decode,z5.encode,z5.expected,z5.check,z5.canAdd;var V5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+e.key.toString("hex"));return e.value.readUInt32LE(0)},t.encode=function(e){const t=eU.from([L5.InputTypes.SIGHASH_TYPE]),r=eU.allocUnsafe(4);return r.writeUInt32LE(e,0),{key:t,value:r}},t.expected="number",t.check=function(e){return"number"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.sighashType}}));MB(V5),V5.decode,V5.encode,V5.expected,V5.check,V5.canAdd;var q5=RB((function(e,t){function r(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function n(e){return r(e),e<253?1:e<=65535?3:e<=4294967295?5:9}Object.defineProperty(t,"__esModule",{value:!0}),t.encode=function e(t,i,o){if(r(t),i||(i=eU.allocUnsafe(n(t))),!jU(i))throw new TypeError("buffer must be a Buffer instance");return o||(o=0),t<253?(i.writeUInt8(t,o),Object.assign(e,{bytes:1})):t<=65535?(i.writeUInt8(253,o),i.writeUInt16LE(t,o+1),Object.assign(e,{bytes:3})):t<=4294967295?(i.writeUInt8(254,o),i.writeUInt32LE(t,o+1),Object.assign(e,{bytes:5})):(i.writeUInt8(255,o),i.writeUInt32LE(t>>>0,o+1),i.writeUInt32LE(t/4294967296|0,o+5),Object.assign(e,{bytes:9})),i},t.decode=function e(t,n){if(!jU(t))throw new TypeError("buffer must be a Buffer instance");n||(n=0);const i=t.readUInt8(n);if(i<253)return Object.assign(e,{bytes:1}),i;if(253===i)return Object.assign(e,{bytes:3}),t.readUInt16LE(n+1);if(254===i)return Object.assign(e,{bytes:5}),t.readUInt32LE(n+1);{Object.assign(e,{bytes:9});const i=t.readUInt32LE(n+1),o=4294967296*t.readUInt32LE(n+5)+i;return r(o),o}},t.encodingLength=n}));MB(q5),q5.encode,q5.decode,q5.encodingLength;var K5=RB((function(e,t){function r(e){const t=e.key.length,r=e.value.length,n=q5.encodingLength(t),i=q5.encodingLength(r),o=eU.allocUnsafe(n+t+i+r);return q5.encode(t,o,0),e.key.copy(o,n),q5.encode(r,o,n+t),e.value.copy(o,n+t+i),o}function n(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}Object.defineProperty(t,"__esModule",{value:!0}),t.range=e=>[...Array(e).keys()],t.reverseBuffer=function(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.keyValsToBuffer=function(e){const t=e.map(r);return t.push(eU.from([0])),eU.concat(t)},t.keyValToBuffer=r,t.readUInt64LE=function(e,t){const r=e.readUInt32LE(t);let i=e.readUInt32LE(t+4);return i*=4294967296,n(i+r,9007199254740991),i+r},t.writeUInt64LE=function(e,t,r){return n(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}}));MB(K5),K5.range,K5.reverseBuffer,K5.keyValsToBuffer,K5.keyValToBuffer,K5.readUInt64LE,K5.writeUInt64LE;var $5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+e.key.toString("hex"));const t=K5.readUInt64LE(e.value,0);let r=8;const n=q5.decode(e.value,r);r+=q5.encodingLength(n);const i=e.value.slice(r);if(i.length!==n)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:i,value:t}},t.encode=function(e){const{script:t,value:r}=e,n=q5.encodingLength(t.length),i=eU.allocUnsafe(8+n+t.length);return K5.writeUInt64LE(i,r,0),q5.encode(t.length,i,8),t.copy(i,8+n),{key:eU.from([L5.InputTypes.WITNESS_UTXO]),value:i}},t.expected="{ script: Buffer; value: number; }",t.check=function(e){return jU(e.script)&&"number"==typeof e.value},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.witnessUtxo}}));MB($5),$5.decode,$5.encode,$5.expected,$5.check,$5.canAdd;var W5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+t.key.toString("hex"));if(34!==t.key.length&&66!==t.key.length||![2,3,4].includes(t.key[1]))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+t.key.toString("hex"));if(t.value.length/4%1!=0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");const r=t.key.slice(1),n={masterFingerprint:t.value.slice(0,4),pubkey:r,path:"m"};for(const e of(e=>[...Array(e).keys()])(t.value.length/4-1)){const r=t.value.readUInt32LE(4*e+4),i=!!(2147483648&r),o=2147483647&r;n.path+="/"+o.toString(10)+(i?"'":"")}return n},encode:function(t){const r=eU.from([e]),n=eU.concat([r,t.pubkey]),i=t.path.split("/"),o=eU.allocUnsafe(4*i.length);t.masterFingerprint.copy(o,0);let s=4;return i.slice(1).forEach((e=>{const t="'"===e.slice(-1);let r=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(r+=2147483648),o.writeUInt32LE(r,s),s+=4})),{key:n,value:o}},check:function(e){return jU(e.pubkey)&&jU(e.masterFingerprint)&&"string"==typeof e.path&&[33,65].includes(e.pubkey.length)&&[2,3,4].includes(e.pubkey[0])&&4===e.masterFingerprint.length},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }",canAddToArray:function(e,t,r){const n=t.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter((e=>e.pubkey.equals(t.pubkey))).length)}}}}));MB(W5),W5.makeConverter;var J5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeChecker=function(e){return function(t){let r;if(e.includes(t.key[0])&&(r=t.key.slice(1),33!==r.length&&65!==r.length||![2,3,4].includes(r[0])))throw new Error("Format Error: invalid pubkey in key 0x"+t.key.toString("hex"));return r}}}));MB(J5),J5.makeChecker;var G5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode redeemScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:eU.from([e]),value:t}},check:function(e){return jU(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.redeemScript}}}}));MB(G5),G5.makeConverter;var X5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode witnessScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:eU.from([e]),value:t}},check:function(e){return jU(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.witnessScript}}}}));MB(X5),X5.makeConverter;var Y5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r={unsignedTx:D5,globalXpub:j5,checkPubkey:J5.makeChecker([])};t.globals=r;const n={nonWitnessUtxo:F5,partialSig:H5,sighashType:V5,finalScriptSig:B5,finalScriptWitness:U5,porCommitment:z5,witnessUtxo:$5,bip32Derivation:W5.makeConverter(L5.InputTypes.BIP32_DERIVATION),redeemScript:G5.makeConverter(L5.InputTypes.REDEEM_SCRIPT),witnessScript:X5.makeConverter(L5.InputTypes.WITNESS_SCRIPT),checkPubkey:J5.makeChecker([L5.InputTypes.PARTIAL_SIG,L5.InputTypes.BIP32_DERIVATION])};t.inputs=n;const i={bip32Derivation:W5.makeConverter(L5.OutputTypes.BIP32_DERIVATION),redeemScript:G5.makeConverter(L5.OutputTypes.REDEEM_SCRIPT),witnessScript:X5.makeConverter(L5.OutputTypes.WITNESS_SCRIPT),checkPubkey:J5.makeChecker([L5.OutputTypes.BIP32_DERIVATION])};t.outputs=i}));MB(Y5),Y5.globals,Y5.inputs,Y5.outputs;var Q5=RB((function(e,t){function r(e,t,r){if(!t.equals(eU.from([r])))throw new Error(`Format Error: Invalid ${e} key: ${t.toString("hex")}`)}function n(e,{globalMapKeyVals:t,inputKeyVals:n,outputKeyVals:i}){const o={unsignedTx:e};let s=0;for(const e of t)switch(e.key[0]){case L5.GlobalTypes.UNSIGNED_TX:if(r("global",e.key,L5.GlobalTypes.UNSIGNED_TX),s>0)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");s++;break;case L5.GlobalTypes.GLOBAL_XPUB:void 0===o.globalXpub&&(o.globalXpub=[]),o.globalXpub.push(Y5.globals.globalXpub.decode(e));break;default:o.unknownKeyVals||(o.unknownKeyVals=[]),o.unknownKeyVals.push(e)}const a=n.length,u=i.length,c=[],l=[];for(const e of K5.range(a)){const t={};for(const i of n[e])switch(Y5.inputs.checkPubkey(i),i.key[0]){case L5.InputTypes.NON_WITNESS_UTXO:if(r("input",i.key,L5.InputTypes.NON_WITNESS_UTXO),void 0!==t.nonWitnessUtxo)throw new Error("Format Error: Input has multiple NON_WITNESS_UTXO");t.nonWitnessUtxo=Y5.inputs.nonWitnessUtxo.decode(i);break;case L5.InputTypes.WITNESS_UTXO:if(r("input",i.key,L5.InputTypes.WITNESS_UTXO),void 0!==t.witnessUtxo)throw new Error("Format Error: Input has multiple WITNESS_UTXO");t.witnessUtxo=Y5.inputs.witnessUtxo.decode(i);break;case L5.InputTypes.PARTIAL_SIG:void 0===t.partialSig&&(t.partialSig=[]),t.partialSig.push(Y5.inputs.partialSig.decode(i));break;case L5.InputTypes.SIGHASH_TYPE:if(r("input",i.key,L5.InputTypes.SIGHASH_TYPE),void 0!==t.sighashType)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");t.sighashType=Y5.inputs.sighashType.decode(i);break;case L5.InputTypes.REDEEM_SCRIPT:if(r("input",i.key,L5.InputTypes.REDEEM_SCRIPT),void 0!==t.redeemScript)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");t.redeemScript=Y5.inputs.redeemScript.decode(i);break;case L5.InputTypes.WITNESS_SCRIPT:if(r("input",i.key,L5.InputTypes.WITNESS_SCRIPT),void 0!==t.witnessScript)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");t.witnessScript=Y5.inputs.witnessScript.decode(i);break;case L5.InputTypes.BIP32_DERIVATION:void 0===t.bip32Derivation&&(t.bip32Derivation=[]),t.bip32Derivation.push(Y5.inputs.bip32Derivation.decode(i));break;case L5.InputTypes.FINAL_SCRIPTSIG:r("input",i.key,L5.InputTypes.FINAL_SCRIPTSIG),t.finalScriptSig=Y5.inputs.finalScriptSig.decode(i);break;case L5.InputTypes.FINAL_SCRIPTWITNESS:r("input",i.key,L5.InputTypes.FINAL_SCRIPTWITNESS),t.finalScriptWitness=Y5.inputs.finalScriptWitness.decode(i);break;case L5.InputTypes.POR_COMMITMENT:r("input",i.key,L5.InputTypes.POR_COMMITMENT),t.porCommitment=Y5.inputs.porCommitment.decode(i);break;default:t.unknownKeyVals||(t.unknownKeyVals=[]),t.unknownKeyVals.push(i)}c.push(t)}for(const e of K5.range(u)){const t={};for(const n of i[e])switch(Y5.outputs.checkPubkey(n),n.key[0]){case L5.OutputTypes.REDEEM_SCRIPT:if(r("output",n.key,L5.OutputTypes.REDEEM_SCRIPT),void 0!==t.redeemScript)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");t.redeemScript=Y5.outputs.redeemScript.decode(n);break;case L5.OutputTypes.WITNESS_SCRIPT:if(r("output",n.key,L5.OutputTypes.WITNESS_SCRIPT),void 0!==t.witnessScript)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");t.witnessScript=Y5.outputs.witnessScript.decode(n);break;case L5.OutputTypes.BIP32_DERIVATION:void 0===t.bip32Derivation&&(t.bip32Derivation=[]),t.bip32Derivation.push(Y5.outputs.bip32Derivation.decode(n));break;default:t.unknownKeyVals||(t.unknownKeyVals=[]),t.unknownKeyVals.push(n)}l.push(t)}return{globalMap:o,inputs:c,outputs:l}}Object.defineProperty(t,"__esModule",{value:!0}),t.psbtFromBuffer=function(e,t){let r=0;function i(){const t=q5.decode(e,r);r+=q5.encodingLength(t);const n=e.slice(r,r+t);return r+=t,n}function o(){return{key:i(),value:i()}}function s(){if(r>=e.length)throw new Error("Format Error: Unexpected End of PSBT");const t=0===e.readUInt8(r);return t&&r++,t}if(1886610036!==function(){const t=e.readUInt32BE(r);return r+=4,t}())throw new Error("Format Error: Invalid Magic Number");if(255!==function(){const t=e.readUInt8(r);return r+=1,t}())throw new Error("Format Error: Magic Number must be followed by 0xff separator");const a=[],u={};for(;!s();){const e=o(),t=e.key.toString("hex");if(u[t])throw new Error("Format Error: Keys must be unique for global keymap: key "+t);u[t]=1,a.push(e)}const c=a.filter((e=>e.key[0]===L5.GlobalTypes.UNSIGNED_TX));if(1!==c.length)throw new Error("Format Error: Only one UNSIGNED_TX allowed");const l=t(c[0].value),{inputCount:h,outputCount:f}=l.getInputOutputCounts(),d=[],p=[];for(const e of K5.range(h)){const t={},r=[];for(;!s();){const n=o(),i=n.key.toString("hex");if(t[i])throw new Error("Format Error: Keys must be unique for each input: input index "+e+" key "+i);t[i]=1,r.push(n)}d.push(r)}for(const e of K5.range(f)){const t={},r=[];for(;!s();){const n=o(),i=n.key.toString("hex");if(t[i])throw new Error("Format Error: Keys must be unique for each output: output index "+e+" key "+i);t[i]=1,r.push(n)}p.push(r)}return n(l,{globalMapKeyVals:a,inputKeyVals:d,outputKeyVals:p})},t.checkKeyBuffer=r,t.psbtFromKeyVals=n}));MB(Q5),Q5.psbtFromBuffer,Q5.checkKeyBuffer,Q5.psbtFromKeyVals;var Z5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.psbtToBuffer=function({globalMap:e,inputs:t,outputs:r}){const{globalKeyVals:n,inputKeyVals:o,outputKeyVals:s}=i({globalMap:e,inputs:t,outputs:r}),a=K5.keyValsToBuffer(n),u=e=>0===e.length?[eU.from([0])]:e.map(K5.keyValsToBuffer),c=u(o),l=u(s),h=eU.allocUnsafe(5);return h.writeUIntBE(482972169471,0,5),eU.concat([h,a].concat(c,l))};const r=(e,t)=>e.key.compare(t.key);function n(e,t){const n=new Set,i=Object.entries(e).reduce(((e,[r,i])=>{if("unknownKeyVals"===r)return e;const o=t[r];if(void 0===o)return e;const s=(Array.isArray(i)?i:[i]).map(o.encode);return s.map((e=>e.key.toString("hex"))).forEach((e=>{if(n.has(e))throw new Error("Serialize Error: Duplicate key: "+e);n.add(e)})),e.concat(s)}),[]),o=e.unknownKeyVals?e.unknownKeyVals.filter((e=>!n.has(e.key.toString("hex")))):[];return i.concat(o).sort(r)}function i({globalMap:e,inputs:t,outputs:r}){return{globalKeyVals:n(e,Y5.globals),inputKeyVals:t.map((e=>n(e,Y5.inputs))),outputKeyVals:r.map((e=>n(e,Y5.outputs)))}}t.psbtToKeyVals=i}));MB(Z5),Z5.psbtToBuffer,Z5.psbtToKeyVals;var e8=RB((function(e,t){function r(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),r(Q5),r(Z5)}));MB(e8);var t8=RB((function(e,t){function r(e,t,r){return n=>{if(e.has(n))return;const i=r.filter((e=>e.key.toString("hex")===n))[0];t.push(i),e.add(n)}}function n(e){return e.globalMap.unsignedTx}function i(e){const t=new Set;return e.forEach((e=>{const r=e.key.toString("hex");if(t.has(r))throw new Error("Combine: KeyValue Map keys should be unique");t.add(r)})),t}Object.defineProperty(t,"__esModule",{value:!0}),t.combine=function(e){const t=e[0],o=e8.psbtToKeyVals(t),s=e.slice(1);if(0===s.length)throw new Error("Combine: Nothing to combine");const a=n(t);if(void 0===a)throw new Error("Combine: Self missing transaction");const u=i(o.globalKeyVals),c=o.inputKeyVals.map(i),l=o.outputKeyVals.map(i);for(const e of s){const t=n(e);if(void 0===t||!t.toBuffer().equals(a.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");const s=e8.psbtToKeyVals(e);i(s.globalKeyVals).forEach(r(u,o.globalKeyVals,s.globalKeyVals)),s.inputKeyVals.map(i).forEach(((e,t)=>e.forEach(r(c[t],o.inputKeyVals[t],s.inputKeyVals[t])))),s.outputKeyVals.map(i).forEach(((e,t)=>e.forEach(r(l[t],o.outputKeyVals[t],s.outputKeyVals[t]))))}return e8.psbtFromKeyVals(a,{globalMapKeyVals:o.globalKeyVals,inputKeyVals:o.inputKeyVals,outputKeyVals:o.outputKeyVals})}}));MB(t8),t8.combine;var r8=RB((function(e,t){function r(e,t){const r=e[t];if(void 0===r)throw new Error(`No input #${t}`);return r}function n(e,t,r,n){throw new Error(`Data for ${e} key ${t} is incorrect: Expected ${r} and got ${JSON.stringify(n)}`)}function i(e){return(t,r)=>{for(const i of Object.keys(t)){const o=t[i],{canAdd:s,canAddToArray:a,check:u,expected:c}=Y5[e+"s"][i]||{},l=!!a;if(u)if(l){if(!Array.isArray(o)||r[i]&&!Array.isArray(r[i]))throw new Error(`Key type ${i} must be an array`);o.every(u)||n(e,i,c,o);const t=r[i]||[],s=new Set;if(!o.every((e=>a(t,e,s))))throw new Error("Can not add duplicate data to array");r[i]=t.concat(o)}else{if(u(o)||n(e,i,c,o),!s(r,o))throw new Error(`Can not add duplicate data to ${e}`);r[i]=o}}}}Object.defineProperty(t,"__esModule",{value:!0}),t.checkForInput=r,t.checkForOutput=function(e,t){const r=e[t];if(void 0===r)throw new Error(`No output #${t}`);return r},t.checkHasKey=function(e,t,r){if(e.key[0]<r)throw new Error("Use the method for your specific key instead of addUnknownKeyVal*");if(t&&0!==t.filter((t=>t.key.equals(e.key))).length)throw new Error(`Duplicate Key: ${e.key.toString("hex")}`)},t.getEnumLength=function(e){let t=0;return Object.keys(e).forEach((e=>{Number(isNaN(Number(e)))&&t++})),t},t.inputCheckUncleanFinalized=function(e,t){let r=!1;if(t.nonWitnessUtxo||t.witnessUtxo){const e=!!t.redeemScript,n=!!t.witnessScript,i=!e||!!t.finalScriptSig,o=!n||!!t.finalScriptWitness,s=!!t.finalScriptSig||!!t.finalScriptWitness;r=i&&o&&s}if(!1===r)throw new Error(`Input #${e} has too much or too little data to clean`)},t.updateGlobal=i("global"),t.updateInput=i("input"),t.updateOutput=i("output"),t.addInputAttributes=function(e,n){const i=r(e,e.length-1);t.updateInput(n,i)},t.addOutputAttributes=function(e,n){const i=r(e,e.length-1);t.updateOutput(n,i)},t.defaultVersionSetter=function(e,t){if(!jU(t)||t.length<4)throw new Error("Set Version: Invalid Transaction");return t.writeUInt32LE(e,0),t},t.defaultLocktimeSetter=function(e,t){if(!jU(t)||t.length<4)throw new Error("Set Locktime: Invalid Transaction");return t.writeUInt32LE(e,t.length-4),t}}));MB(r8),r8.checkForInput,r8.checkForOutput,r8.checkHasKey,r8.getEnumLength,r8.inputCheckUncleanFinalized,r8.updateGlobal,r8.updateInput,r8.updateOutput,r8.addInputAttributes,r8.addOutputAttributes,r8.defaultVersionSetter,r8.defaultLocktimeSetter;var n8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Psbt=class{constructor(e){this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:e}}static fromBase64(e,t){const r=eU.from(e,"base64");return this.fromBuffer(r,t)}static fromHex(e,t){const r=eU.from(e,"hex");return this.fromBuffer(r,t)}static fromBuffer(e,t){const r=e8.psbtFromBuffer(e,t),n=new this(r.globalMap.unsignedTx);return Object.assign(n,r),n}toBase64(){return this.toBuffer().toString("base64")}toHex(){return this.toBuffer().toString("hex")}toBuffer(){return e8.psbtToBuffer(this)}updateGlobal(e){return r8.updateGlobal(e,this.globalMap),this}updateInput(e,t){const r=r8.checkForInput(this.inputs,e);return r8.updateInput(t,r),this}updateOutput(e,t){const r=r8.checkForOutput(this.outputs,e);return r8.updateOutput(t,r),this}addUnknownKeyValToGlobal(e){return r8.checkHasKey(e,this.globalMap.unknownKeyVals,r8.getEnumLength(L5.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(e),this}addUnknownKeyValToInput(e,t){const r=r8.checkForInput(this.inputs,e);return r8.checkHasKey(t,r.unknownKeyVals,r8.getEnumLength(L5.InputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(t),this}addUnknownKeyValToOutput(e,t){const r=r8.checkForOutput(this.outputs,e);return r8.checkHasKey(t,r.unknownKeyVals,r8.getEnumLength(L5.OutputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(t),this}addInput(e){this.globalMap.unsignedTx.addInput(e),this.inputs.push({unknownKeyVals:[]});const t=e.unknownKeyVals||[],r=this.inputs.length-1;if(!Array.isArray(t))throw new Error("unknownKeyVals must be an Array");return t.forEach((e=>this.addUnknownKeyValToInput(r,e))),r8.addInputAttributes(this.inputs,e),this}addOutput(e){this.globalMap.unsignedTx.addOutput(e),this.outputs.push({unknownKeyVals:[]});const t=e.unknownKeyVals||[],r=this.outputs.length-1;if(!Array.isArray(t))throw new Error("unknownKeyVals must be an Array");return t.forEach((e=>this.addUnknownKeyValToInput(r,e))),r8.addOutputAttributes(this.outputs,e),this}clearFinalizedInput(e){const t=r8.checkForInput(this.inputs,e);r8.inputCheckUncleanFinalized(e,t);for(const e of Object.keys(t))["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(e)||delete t[e];return this}combine(...e){const t=t8.combine([this].concat(e));return Object.assign(this,t),this}getTransaction(){return this.globalMap.unsignedTx.toBuffer()}}}));MB(n8),n8.Psbt;var i8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r={network:z4.bitcoin,maximumFeeRate:5e3};class n{constructor(e={},t=new n8.Psbt(new o)){this.data=t,this.opts=Object.assign({},r,e),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},0===this.data.inputs.length&&this.setVersion(2);const n=(e,t,r,n)=>Object.defineProperty(e,t,{enumerable:r,writable:n});n(this,"__CACHE",!1,!0),n(this,"opts",!1,!0)}static fromBase64(e,t={}){const r=eU.from(e,"base64");return this.fromBuffer(r,t)}static fromHex(e,t={}){const r=eU.from(e,"hex");return this.fromBuffer(r,t)}static fromBuffer(e,t={}){const r=n8.Psbt.fromBuffer(e,i),o=new n(t,r);var s,a;return s=o.__CACHE.__TX,a=o.__CACHE,s.ins.forEach((e=>{b(a,e)})),o}get inputCount(){return this.data.inputs.length}get version(){return this.__CACHE.__TX.version}set version(e){this.setVersion(e)}get locktime(){return this.__CACHE.__TX.locktime}set locktime(e){this.setLocktime(e)}get txInputs(){return this.__CACHE.__TX.ins.map((e=>({hash:M5.cloneBuffer(e.hash),index:e.index,sequence:e.sequence})))}get txOutputs(){return this.__CACHE.__TX.outs.map((e=>{let t;try{t=k5.fromOutputScript(e.script,this.opts.network)}catch(e){}return{script:M5.cloneBuffer(e.script),value:e.value,address:t}}))}combine(...e){return this.data.combine(...e.map((e=>e.data))),this}clone(){const e=n.fromBuffer(this.data.toBuffer());return e.opts=JSON.parse(JSON.stringify(this.opts)),e}setMaximumFeeRate(e){m(e),this.opts.maximumFeeRate=e}setVersion(e){m(e),v(this.data.inputs,"setVersion");const t=this.__CACHE;return t.__TX.version=e,t.__EXTRACTED_TX=void 0,this}setLocktime(e){m(e),v(this.data.inputs,"setLocktime");const t=this.__CACHE;return t.__TX.locktime=e,t.__EXTRACTED_TX=void 0,this}setInputSequence(e,t){m(t),v(this.data.inputs,"setInputSequence");const r=this.__CACHE;if(r.__TX.ins.length<=e)throw new Error("Input index too high");return r.__TX.ins[e].sequence=t,r.__EXTRACTED_TX=void 0,this}addInputs(e){return e.forEach((e=>this.addInput(e))),this}addInput(e){if(arguments.length>1||!e||void 0===e.hash||void 0===e.index)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");v(this.data.inputs,"addInput"),e.witnessScript&&L(e.witnessScript);const t=this.__CACHE;this.data.addInput(e),b(t,t.__TX.ins[t.__TX.ins.length-1]);const r=this.data.inputs.length-1,n=this.data.inputs[r];return n.nonWitnessUtxo&&T(this.__CACHE,n,r),t.__FEE=void 0,t.__FEE_RATE=void 0,t.__EXTRACTED_TX=void 0,this}addOutputs(e){return e.forEach((e=>this.addOutput(e))),this}addOutput(e){if(arguments.length>1||!e||void 0===e.value||void 0===e.address&&void 0===e.script)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");v(this.data.inputs,"addOutput");const{address:t}=e;if("string"==typeof t){const{network:r}=this.opts,n=k5.toOutputScript(t,r);e=Object.assign(e,{script:n})}const r=this.__CACHE;return this.data.addOutput(e),r.__FEE=void 0,r.__FEE_RATE=void 0,r.__EXTRACTED_TX=void 0,this}extractTransaction(e){if(!this.data.inputs.every(a))throw new Error("Not finalized");const t=this.__CACHE;if(e||function(e,t,r){const n=t.__FEE_RATE||e.getFeeRate(),i=t.__EXTRACTED_TX.virtualSize(),o=n*i;if(n>=r.maximumFeeRate)throw new Error(`Warning: You are paying around ${(o/1e8).toFixed(8)} in fees, which is ${n} satoshi per byte for a transaction with a VSize of ${i} bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction.`)}(this,t,this.opts),t.__EXTRACTED_TX)return t.__EXTRACTED_TX;const r=t.__TX.clone();return O(this.data.inputs,r,t,!0),r}getFeeRate(){return S("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}getFee(){return S("__FEE","fee",this.data.inputs,this.__CACHE)}finalizeAllInputs(){return r8.checkForInput(this.data.inputs,0),B(this.data.inputs.length).forEach((e=>this.finalizeInput(e))),this}finalizeInput(e,t=E){const r=r8.checkForInput(this.data.inputs,e),{script:n,isP2SH:i,isP2WSH:o,isSegwit:s}=function(e,t,r){const n=r.__TX,i={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(i.isP2SH=!!t.redeemScript,i.isP2WSH=!!t.witnessScript,t.witnessScript)i.script=t.witnessScript;else if(t.redeemScript)i.script=t.redeemScript;else if(t.nonWitnessUtxo){const o=C(r,t,e),s=n.ins[e].index;i.script=o.outs[s].script}else t.witnessUtxo&&(i.script=t.witnessUtxo.script);return(t.witnessScript||f(i.script))&&(i.isSegwit=!0),i}(e,r,this.__CACHE);if(!n)throw new Error(`No script found for input #${e}`);!function(e){if(!e.sighashType||!e.partialSig)return;const{partialSig:t,sighashType:r}=e;t.forEach((e=>{const{hashType:t}=r5.signature.decode(e.signature);if(r!==t)throw new Error("Signature sighash does not match input sighash type")}))}(r);const{finalScriptSig:a,finalScriptWitness:u}=t(e,r,n,s,i,o);if(a&&this.data.updateInput(e,{finalScriptSig:a}),u&&this.data.updateInput(e,{finalScriptWitness:u}),!a&&!u)throw new Error(`Unknown error finalizing input #${e}`);return this.data.clearFinalizedInput(e),this}getInputType(e){const t=r8.checkForInput(this.data.inputs,e),r=N(M(e,t,this.__CACHE),e,"input",t.redeemScript||function(e){if(!e)return;const t=r5.decompile(e);if(!t)return;const r=t[t.length-1];if(!jU(r)||R(r)||(n=r,r5.isCanonicalScriptSignature(n)))return;var n;return r5.decompile(r)?r:void 0}(t.finalScriptSig),t.witnessScript||function(e){if(!e)return;const t=P(e),r=t[t.length-1];if(R(r))return;return r5.decompile(r)?r:void 0}(t.finalScriptWitness));return("raw"===r.type?"":r.type+"-")+D(r.meaningfulScript)}inputHasPubkey(e,t){return function(e,t,r,n){const i=M(r,t,n),{meaningfulScript:o}=N(i,r,"input",t.redeemScript,t.witnessScript);return j(e,o)}(t,r8.checkForInput(this.data.inputs,e),e,this.__CACHE)}inputHasHDKey(e,t){const r=r8.checkForInput(this.data.inputs,e),n=g(t);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}outputHasPubkey(e,t){return function(e,t,r,n){const i=n.__TX.outs[r].script,{meaningfulScript:o}=N(i,r,"output",t.redeemScript,t.witnessScript);return j(e,o)}(t,r8.checkForOutput(this.data.outputs,e),e,this.__CACHE)}outputHasHDKey(e,t){const r=r8.checkForOutput(this.data.outputs,e),n=g(t);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}validateSignaturesOfAllInputs(){return r8.checkForInput(this.data.inputs,0),B(this.data.inputs.length).map((e=>this.validateSignaturesOfInput(e))).reduce(((e,t)=>!0===t&&e),!0)}validateSignaturesOfInput(e,t){const r=this.data.inputs[e],n=(r||{}).partialSig;if(!r||!n||n.length<1)throw new Error("No signatures to validate");const i=t?n.filter((e=>e.pubkey.equals(t))):n;if(i.length<1)throw new Error("No signatures for this pubkey");const o=[];let s,a,u;for(const t of i){const n=r5.signature.decode(t.signature),{hash:i,script:c}=u!==n.hashType?I(e,Object.assign({},r,{sighashType:n.hashType}),this.__CACHE,!0):{hash:s,script:a};u=n.hashType,s=i,a=c,y(t.pubkey,c,"verify");const l=A5.fromPublicKey(t.pubkey);o.push(l.verify(i,n.signature))}return o.every((e=>!0===e))}signAllInputsHD(e,t=[R5.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey||!e.fingerprint)throw new Error("Need HDSigner to sign input");const r=[];for(const n of B(this.data.inputs.length))try{this.signInputHD(n,e,t),r.push(!0)}catch(e){r.push(!1)}if(r.every((e=>!1===e)))throw new Error("No inputs were signed");return this}signAllInputsHDAsync(e,t=[R5.Transaction.SIGHASH_ALL]){return new Promise(((r,n)=>{if(!e||!e.publicKey||!e.fingerprint)return n(new Error("Need HDSigner to sign input"));const i=[],o=[];for(const r of B(this.data.inputs.length))o.push(this.signInputHDAsync(r,e,t).then((()=>{i.push(!0)}),(()=>{i.push(!1)})));return Promise.all(o).then((()=>{if(i.every((e=>!1===e)))return n(new Error("No inputs were signed"));r()}))}))}signInputHD(e,t,r=[R5.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");return A(e,this.data.inputs,t).forEach((t=>this.signInput(e,t,r))),this}signInputHDAsync(e,t,r=[R5.Transaction.SIGHASH_ALL]){return new Promise(((n,i)=>{if(!t||!t.publicKey||!t.fingerprint)return i(new Error("Need HDSigner to sign input"));const o=A(e,this.data.inputs,t).map((t=>this.signInputAsync(e,t,r)));return Promise.all(o).then((()=>{n()})).catch(i)}))}signAllInputs(e,t=[R5.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey)throw new Error("Need Signer to sign input");const r=[];for(const n of B(this.data.inputs.length))try{this.signInput(n,e,t),r.push(!0)}catch(e){r.push(!1)}if(r.every((e=>!1===e)))throw new Error("No inputs were signed");return this}signAllInputsAsync(e,t=[R5.Transaction.SIGHASH_ALL]){return new Promise(((r,n)=>{if(!e||!e.publicKey)return n(new Error("Need Signer to sign input"));const i=[],o=[];for(const[r]of this.data.inputs.entries())o.push(this.signInputAsync(r,e,t).then((()=>{i.push(!0)}),(()=>{i.push(!1)})));return Promise.all(o).then((()=>{if(i.every((e=>!1===e)))return n(new Error("No inputs were signed"));r()}))}))}signInput(e,t,r=[R5.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const{hash:n,sighashType:i}=k(this.data.inputs,e,t.publicKey,this.__CACHE,r),o=[{pubkey:t.publicKey,signature:r5.signature.encode(t.sign(n),i)}];return this.data.updateInput(e,{partialSig:o}),this}signInputAsync(e,t,r=[R5.Transaction.SIGHASH_ALL]){return Promise.resolve().then((()=>{if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const{hash:n,sighashType:i}=k(this.data.inputs,e,t.publicKey,this.__CACHE,r);return Promise.resolve(t.sign(n)).then((r=>{const n=[{pubkey:t.publicKey,signature:r5.signature.encode(r,i)}];this.data.updateInput(e,{partialSig:n})}))}))}toBuffer(){return s(this.__CACHE),this.data.toBuffer()}toHex(){return s(this.__CACHE),this.data.toHex()}toBase64(){return s(this.__CACHE),this.data.toBase64()}updateGlobal(e){return this.data.updateGlobal(e),this}updateInput(e,t){return t.witnessScript&&L(t.witnessScript),this.data.updateInput(e,t),t.nonWitnessUtxo&&T(this.__CACHE,this.data.inputs[e],e),this}updateOutput(e,t){return this.data.updateOutput(e,t),this}addUnknownKeyValToGlobal(e){return this.data.addUnknownKeyValToGlobal(e),this}addUnknownKeyValToInput(e,t){return this.data.addUnknownKeyValToInput(e,t),this}addUnknownKeyValToOutput(e,t){return this.data.addUnknownKeyValToOutput(e,t),this}clearFinalizedInput(e){return this.data.clearFinalizedInput(e),this}}t.Psbt=n;const i=e=>new o(e);class o{constructor(e=eU.from([2,0,0,0,0,0,0,0,0,0])){this.tx=R5.Transaction.fromBuffer(e),function(e){if(!e.ins.every((e=>e.script&&0===e.script.length&&e.witness&&0===e.witness.length)))throw new Error("Format Error: Transaction ScriptSigs are not empty")}(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}getInputOutputCounts(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}addInput(e){if(void 0===e.hash||void 0===e.index||!jU(e.hash)&&"string"!=typeof e.hash||"number"!=typeof e.index)throw new Error("Error adding input.");const t="string"==typeof e.hash?M5.reverseBuffer(eU.from(e.hash,"hex")):e.hash;this.tx.addInput(t,e.index,e.sequence)}addOutput(e){if(void 0===e.script||void 0===e.value||!jU(e.script)||"number"!=typeof e.value)throw new Error("Error adding output.");this.tx.addOutput(e.script,e.value)}toBuffer(){return this.tx.toBuffer()}}function s(e){if(!1!==e.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Not BIP174 compliant, can not export")}function a(e){return!!e.finalScriptSig||!!e.finalScriptWitness}function u(e){return t=>{try{return e({output:t}),!0}catch(e){return!1}}}const c=u(E5.p2ms),l=u(E5.p2pk),h=u(E5.p2pkh),f=u(E5.p2wpkh),d=u(E5.p2wsh),p=u(E5.p2sh);function g(e){return t=>!!t.masterFingerprint.equals(e.fingerprint)&&!!e.derivePath(t.path).publicKey.equals(t.pubkey)}function m(e){if("number"!=typeof e||e!==Math.floor(e)||e>4294967295||e<0)throw new Error("Invalid 32 bit integer")}function v(e,t){e.forEach((e=>{let r=!1,n=[];if(0===(e.partialSig||[]).length){if(!e.finalScriptSig&&!e.finalScriptWitness)return;n=function(e){const t=e.finalScriptSig&&r5.decompile(e.finalScriptSig)||[],r=e.finalScriptWitness&&r5.decompile(e.finalScriptWitness)||[];return t.concat(r).filter((e=>jU(e)&&r5.isCanonicalScriptSignature(e))).map((e=>({signature:e})))}(e)}else n=e.partialSig;if(n.forEach((e=>{const{hashType:n}=r5.signature.decode(e.signature),i=[];switch(n&R5.Transaction.SIGHASH_ANYONECANPAY&&i.push("addInput"),31&n){case R5.Transaction.SIGHASH_ALL:break;case R5.Transaction.SIGHASH_SINGLE:case R5.Transaction.SIGHASH_NONE:i.push("addOutput"),i.push("setInputSequence")}-1===i.indexOf(t)&&(r=!0)})),r)throw new Error("Can not modify transaction, signatures exist.")}))}function y(e,t,r){if(!j(e,t))throw new Error(`Can not ${r} for this input with the key ${e.toString("hex")}`)}function b(e,t){const r=M5.reverseBuffer(eU.from(t.hash)).toString("hex")+":"+t.index;if(e.__TX_IN_CACHE[r])throw new Error("Duplicate input detected.");e.__TX_IN_CACHE[r]=1}function w(e,t){return(r,n,i,o)=>{const s=e({redeem:{output:i}}).output;if(!n.equals(s))throw new Error(`${t} for ${o} #${r} doesn't match the scriptPubKey in the prevout`)}}const _=w(E5.p2sh,"Redeem script"),x=w(E5.p2wsh,"Witness script");function S(e,t,r,n){if(!r.every(a))throw new Error(`PSBT must be finalized to calculate ${t}`);if("__FEE_RATE"===e&&n.__FEE_RATE)return n.__FEE_RATE;if("__FEE"===e&&n.__FEE)return n.__FEE;let i,o=!0;return n.__EXTRACTED_TX?(i=n.__EXTRACTED_TX,o=!1):i=n.__TX.clone(),O(r,i,n,o),"__FEE_RATE"===e?n.__FEE_RATE:"__FEE"===e?n.__FEE:void 0}function E(e,t,r,n,i,o){D(r);throw new Error(`Can not finalize input #${e}`)}function k(e,t,r,n,i){const o=r8.checkForInput(e,t),{hash:s,sighashType:a,script:u}=I(t,o,n,!1,i);return y(r,u,"sign"),{hash:s,sighashType:a}}function I(e,t,r,n,i){const o=r.__TX,s=t.sighashType||R5.Transaction.SIGHASH_ALL;if(i&&i.indexOf(s)<0){const e=function(e){let t=e&R5.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";switch(31&e){case R5.Transaction.SIGHASH_ALL:t+="SIGHASH_ALL";break;case R5.Transaction.SIGHASH_SINGLE:t+="SIGHASH_SINGLE";break;case R5.Transaction.SIGHASH_NONE:t+="SIGHASH_NONE"}return t}(s);throw new Error(`Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: ${e}`)}let a,u;if(t.nonWitnessUtxo){const n=C(r,t,e),i=o.ins[e].hash,s=n.getHash();if(!i.equals(s))throw new Error(`Non-witness UTXO hash for input #${e} doesn't match the hash specified in the prevout`);const a=o.ins[e].index;u=n.outs[a]}else{if(!t.witnessUtxo)throw new Error("Need a Utxo input item for signing");u=t.witnessUtxo}const{meaningfulScript:c,type:l}=N(u.script,e,"input",t.redeemScript,t.witnessScript);if(["p2sh-p2wsh","p2wsh"].indexOf(l)>=0)a=o.hashForWitnessV0(e,c,u.value,s);else if(f(c)){const t=E5.p2pkh({hash:c.slice(2)}).output;a=o.hashForWitnessV0(e,t,u.value,s)}else{if(void 0===t.nonWitnessUtxo&&!1===r.__UNSAFE_SIGN_NONSEGWIT)throw new Error(`Input #${e} has witnessUtxo but non-segwit script: ${c.toString("hex")}`);n||!1===r.__UNSAFE_SIGN_NONSEGWIT||console.warn("Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as the old TransactionBuilder class when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n*********************"),a=o.hashForSignature(e,c,s)}return{script:c,sighashType:s,hash:a}}function A(e,t,r){const n=r8.checkForInput(t,e);if(!n.bip32Derivation||0===n.bip32Derivation.length)throw new Error("Need bip32Derivation to sign with HD");const i=n.bip32Derivation.map((e=>e.masterFingerprint.equals(r.fingerprint)?e:void 0)).filter((e=>!!e));if(0===i.length)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return i.map((e=>{const t=r.derivePath(e.path);if(!e.pubkey.equals(t.publicKey))throw new Error("pubkey did not match bip32Derivation");return t}))}function P(e){let t=0;function r(){const r=q5.decode(e,t);return t+=q5.decode.bytes,r}function n(){return function(r){return t+=r,e.slice(t-r,t)}(r())}return function(){const e=r(),t=[];for(let r=0;r<e;r++)t.push(n());return t}()}function T(e,t,r){e.__NON_WITNESS_UTXO_BUF_CACHE[r]=t.nonWitnessUtxo;const n=R5.Transaction.fromBuffer(t.nonWitnessUtxo);e.__NON_WITNESS_UTXO_TX_CACHE[r]=n;const i=e,o=r;delete t.nonWitnessUtxo,Object.defineProperty(t,"nonWitnessUtxo",{enumerable:!0,get(){const e=i.__NON_WITNESS_UTXO_BUF_CACHE[o],t=i.__NON_WITNESS_UTXO_TX_CACHE[o];if(void 0!==e)return e;{const e=t.toBuffer();return i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e,e}},set(e){i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e}})}function O(e,t,r,n){let i=0;e.forEach(((e,o)=>{if(n&&e.finalScriptSig&&(t.ins[o].script=e.finalScriptSig),n&&e.finalScriptWitness&&(t.ins[o].witness=P(e.finalScriptWitness)),e.witnessUtxo)i+=e.witnessUtxo.value;else if(e.nonWitnessUtxo){const n=C(r,e,o),s=t.ins[o].index,a=n.outs[s];i+=a.value}}));const o=t.outs.reduce(((e,t)=>e+t.value),0),s=i-o;if(s<0)throw new Error("Outputs are spending more than Inputs");const a=t.virtualSize();r.__FEE=s,r.__EXTRACTED_TX=t,r.__FEE_RATE=Math.floor(s/a)}function C(e,t,r){const n=e.__NON_WITNESS_UTXO_TX_CACHE;return n[r]||T(e,t,r),n[r]}function M(e,t,r){if(void 0!==t.witnessUtxo)return t.witnessUtxo.script;if(void 0!==t.nonWitnessUtxo)return C(r,t,e).outs[r.__TX.ins[e].index].script;throw new Error("Can't find pubkey in input without Utxo data")}function R(e){return 33===e.length&&r5.isCanonicalPubKey(e)}function N(e,t,r,n,i){const o=p(e),s=o&&n&&d(n),a=d(e);if(o&&void 0===n)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((a||s)&&void 0===i)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");let u;return s?(u=i,_(t,e,n,r),x(t,n,i,r),L(u)):a?(u=i,x(t,e,i,r),L(u)):o?(u=n,_(t,e,n,r)):u=e,{meaningfulScript:u,type:s?"p2sh-p2wsh":o?"p2sh":a?"p2wsh":"raw"}}function L(e){if(f(e)||p(e))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function j(e,t){const r=a5.hash160(e),n=r5.decompile(t);if(null===n)throw new Error("Unknown script error");return n.some((t=>"number"!=typeof t&&(t.equals(e)||t.equals(r))))}function D(e){return f(e)?"witnesspubkeyhash":h(e)?"pubkeyhash":c(e)?"multisig":l(e)?"pubkey":"nonstandard"}function B(e){return[...Array(e).keys()]}}));MB(i8),i8.Psbt;var o8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5;function n(e){return e===r.OPS.OP_0||r5.isCanonicalScriptSignature(e)}function i(e,t){const i=r5.decompile(e);return!(i.length<2)&&i[0]===r.OPS.OP_0&&(t?i.slice(1).every(n):i.slice(1).every(r5.isCanonicalScriptSignature))}t.check=i,i.toJSON=()=>"multisig input"}));MB(o8),o8.check;var s8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5,n=r.OPS.OP_RESERVED;function i(e,t){const i=r5.decompile(e);if(i.length<4)return!1;if(i[i.length-1]!==r.OPS.OP_CHECKMULTISIG)return!1;if(!q4.Number(i[0]))return!1;if(!q4.Number(i[i.length-2]))return!1;const o=i[0]-n,s=i[i.length-2]-n;return!(o<=0)&&(!(s>16)&&(!(o>s)&&(s===i.length-3&&(!!t||i.slice(1,-2).every(r5.isCanonicalPubKey)))))}t.check=i,i.toJSON=()=>"multi-sig output"}));MB(s8),s8.check;var a8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=o8,t.output=s8}));MB(a8),a8.input,a8.output;var u8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS;function n(e){const t=r5.compile(e);return t.length>1&&t[0]===r.OP_RETURN}t.check=n,n.toJSON=()=>"null data output";const i={check:n};t.output=i}));MB(u8),u8.check,u8.output;var c8=RB((function(e,t){function r(e){const t=r5.decompile(e);return 1===t.length&&r5.isCanonicalScriptSignature(t[0])}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"pubKey input"}));MB(c8),c8.check;var l8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5;function n(e){const t=r5.decompile(e);return 2===t.length&&r5.isCanonicalPubKey(t[0])&&t[1]===r.OPS.OP_CHECKSIG}t.check=n,n.toJSON=()=>"pubKey output"}));MB(l8),l8.check;var h8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=c8,t.output=l8}));MB(h8),h8.input,h8.output;var f8=RB((function(e,t){function r(e){const t=r5.decompile(e);return 2===t.length&&r5.isCanonicalScriptSignature(t[0])&&r5.isCanonicalPubKey(t[1])}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"pubKeyHash input"}));MB(f8),f8.check;var d8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5;function n(e){const t=r5.compile(e);return 25===t.length&&t[0]===r.OPS.OP_DUP&&t[1]===r.OPS.OP_HASH160&&20===t[2]&&t[23]===r.OPS.OP_EQUALVERIFY&&t[24]===r.OPS.OP_CHECKSIG}t.check=n,n.toJSON=()=>"pubKeyHash output"}));MB(d8),d8.check;var p8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=f8,t.output=d8}));MB(p8),p8.input,p8.output;var g8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5;function n(e){const t=r5.compile(e);return 22===t.length&&t[0]===r.OPS.OP_0&&20===t[1]}t.check=n,n.toJSON=()=>"Witness pubKeyHash output"}));MB(g8),g8.check;var m8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5;function n(e){const t=r5.compile(e);return 34===t.length&&t[0]===r.OPS.OP_0&&32===t[1]}t.check=n,n.toJSON=()=>"Witness scriptHash output"}));MB(m8),m8.check;var v8=RB((function(e,t){function r(e,t){const r=r5.decompile(e);if(r.length<1)return!1;const n=r[r.length-1];if(!jU(n))return!1;const i=r5.decompile(r5.compile(r.slice(0,-1))),o=r5.decompile(n);return!!o&&!!r5.isPushOnly(i)&&(1===r.length?m8.check(o)||g8.check(o):!(!p8.input.check(i)||!p8.output.check(o))||!(!a8.input.check(i,t)||!a8.output.check(o))||!(!h8.input.check(i)||!h8.output.check(o)))}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"scriptHash input"}));MB(v8),v8.check;var y8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5;function n(e){const t=r5.compile(e);return 23===t.length&&t[0]===r.OPS.OP_HASH160&&20===t[1]&&t[22]===r.OPS.OP_EQUAL}t.check=n,n.toJSON=()=>"scriptHash output"}));MB(y8),y8.check;var b8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=v8,t.output=y8}));MB(b8),b8.input,b8.output;var w8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5,n=eU.from("aa21a9ed","hex");function i(e){const t=r5.compile(e);return t.length>37&&t[0]===r.OPS.OP_RETURN&&36===t[1]&&t.slice(2,6).equals(n)}t.check=i,i.toJSON=()=>"Witness commitment output",t.encode=function(e){L4(q4.Hash256bit,e);const t=eU.allocUnsafe(36);return n.copy(t,0),e.copy(t,4),r5.compile([r.OPS.OP_RETURN,t])},t.decode=function(e){return L4(i,e),r5.decompile(e)[1].slice(4,36)}}));MB(w8),w8.check,w8.encode,w8.decode;var _8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.output=w8}));MB(_8),_8.output;var x8=RB((function(e,t){function r(e){const t=r5.decompile(e);return 2===t.length&&r5.isCanonicalScriptSignature(t[0])&&(r=t[1],r5.isCanonicalPubKey(r)&&33===r.length);var r}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"witnessPubKeyHash input"}));MB(x8),x8.check;var S8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=x8,t.output=g8}));MB(S8),S8.input,S8.output;var E8=RB((function(e,t){function r(e,t){if(L4(L4.Array,e),e.length<1)return!1;const r=e[e.length-1];if(!jU(r))return!1;const n=r5.decompile(r);if(!n||0===n.length)return!1;const i=r5.compile(e.slice(0,-1));return!(!p8.input.check(i)||!p8.output.check(n))||!(!a8.input.check(i,t)||!a8.output.check(n))||!(!h8.input.check(i)||!h8.output.check(n))}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"witnessScriptHash input"}));MB(E8),E8.check;var k8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=E8,t.output=m8}));MB(k8),k8.input,k8.output;var I8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r={P2MS:"multisig",NONSTANDARD:"nonstandard",NULLDATA:"nulldata",P2PK:"pubkey",P2PKH:"pubkeyhash",P2SH:"scripthash",P2WPKH:"witnesspubkeyhash",P2WSH:"witnessscripthash",WITNESS_COMMITMENT:"witnesscommitment"};t.types=r,t.output=function(e){if(S8.output.check(e))return r.P2WPKH;if(k8.output.check(e))return r.P2WSH;if(p8.output.check(e))return r.P2PKH;if(b8.output.check(e))return r.P2SH;const t=r5.decompile(e);if(!t)throw new TypeError("Invalid script");return a8.output.check(t)?r.P2MS:h8.output.check(t)?r.P2PK:_8.output.check(t)?r.WITNESS_COMMITMENT:u8.output.check(t)?r.NULLDATA:r.NONSTANDARD},t.input=function(e,t){const n=r5.decompile(e);if(!n)throw new TypeError("Invalid script");return p8.input.check(n)?r.P2PKH:b8.input.check(n,t)?r.P2SH:a8.input.check(n,t)?r.P2MS:h8.input.check(n)?r.P2PK:r.NONSTANDARD},t.witness=function(e,t){const n=r5.decompile(e);if(!n)throw new TypeError("Invalid script");return S8.input.check(n)?r.P2WPKH:k8.input.check(n,t)?r.P2WSH:r.NONSTANDARD}}));MB(I8),I8.types,I8.output,I8.input,I8.witness;var A8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5,n=I8.types,i=new Set(["p2pkh","p2pk","p2wpkh","p2ms","p2sh-p2pkh","p2sh-p2pk","p2sh-p2wpkh","p2sh-p2ms","p2wsh-p2pkh","p2wsh-p2pk","p2wsh-p2ms","p2sh-p2wsh-p2pkh","p2sh-p2wsh-p2pk","p2sh-p2wsh-p2ms"]);function o(e,t,r){try{L4(e,t)}catch(e){throw new Error(r)}}class s{constructor(e=z4.bitcoin,t=2500){this.network=e,this.maximumFeeRate=t,this.__PREV_TX_SET={},this.__INPUTS=[],this.__TX=new R5.Transaction,this.__TX.version=2,this.__USE_LOW_R=!1,console.warn("Deprecation Warning: TransactionBuilder will be removed in the future. (v6.x.x or later) Please use the Psbt class instead. Examples of usage are available in the transactions-psbt.js integration test file on our Github. A high level explanation is available in the psbt.ts and psbt.js files as well.")}static fromTransaction(e,t){const r=new s(t);return r.setVersion(e.version),r.setLockTime(e.locktime),e.outs.forEach((e=>{r.addOutput(e.script,e.value)})),e.ins.forEach((e=>{r.__addInputUnsafe(e.hash,e.index,{sequence:e.sequence,script:e.script,witness:e.witness})})),r.__INPUTS.forEach(((t,r)=>{!function(e,t,r){if(e.redeemScriptType!==n.P2MS||!e.redeemScript)return;if(e.pubkeys.length===e.signatures.length)return;const i=e.signatures.concat();e.signatures=e.pubkeys.map((n=>{const o=A5.fromPublicKey(n);let s;return i.some(((n,a)=>{if(!n)return!1;const u=r5.signature.decode(n),c=t.hashForSignature(r,e.redeemScript,u.hashType);return!!o.verify(c,u.signature)&&(i[a]=void 0,s=n,!0)})),s}))}(t,e,r)})),r}setLowR(e){return L4(L4.maybe(L4.Boolean),e),void 0===e&&(e=!0),this.__USE_LOW_R=e,e}setLockTime(e){if(L4(q4.UInt32,e),this.__INPUTS.some((e=>!!e.signatures&&e.signatures.some((e=>void 0!==e)))))throw new Error("No, this would invalidate signatures");this.__TX.locktime=e}setVersion(e){L4(q4.UInt32,e),this.__TX.version=e}addInput(e,t,r,n){if(!this.__canModifyInputs())throw new Error("No, this would invalidate signatures");let i;if("string"==typeof(o=e)||o instanceof String)e=M5.reverseBuffer(eU.from(e,"hex"));else if(function(e){return e instanceof R5.Transaction}(e)){const r=e.outs[t];n=r.script,i=r.value,e=e.getHash(!1)}var o;return this.__addInputUnsafe(e,t,{sequence:r,prevOutScript:n,value:i})}addOutput(e,t){if(!this.__canModifyOutputs())throw new Error("No, this would invalidate signatures");return"string"==typeof e&&(e=k5.toOutputScript(e,this.network)),this.__TX.addOutput(e,t)}build(){return this.__build(!1)}buildIncomplete(){return this.__build(!0)}sign(e,t,r,s,a,c){!function({input:e,ourPubKey:t,keyPair:r,signatureHash:n,hashType:i,useLowR:o}){let s=!1;for(const[a,u]of e.pubkeys.entries()){if(!t.equals(u))continue;if(e.signatures[a])throw new Error("Signature already exists");if(33!==t.length&&e.hasWitness)throw new Error("BIP143 rejects uncompressed public keys in P2WPKH or P2WSH");const c=r.sign(n,o);e.signatures[a]=r5.signature.encode(c,i),s=!0}if(!s)throw new Error("Key pair cannot sign for this input")}(function(e,t,r,s,a,c,h,f,d,p,g){let m;if("number"==typeof a)console.warn("DEPRECATED: TransactionBuilder sign method arguments will change in v6, please use the TxbSignArg interface"),m=a;else{if("object"!=typeof a)throw new TypeError("TransactionBuilder sign first arg must be TxbSignArg or number");!function(e,t){if(!i.has(t.prevOutScriptType))throw new TypeError(`Unknown prevOutScriptType "${t.prevOutScriptType}"`);o(L4.Number,t.vin,"sign must include vin parameter as Number (input index)"),o(q4.Signer,t.keyPair,"sign must include keyPair parameter as Signer interface"),o(L4.maybe(L4.Number),t.hashType,"sign hashType parameter must be a number");const r=(e[t.vin]||[]).prevOutType,n=t.prevOutScriptType;switch(n){case"p2pkh":if(r&&"pubkeyhash"!==r)throw new TypeError(`input #${t.vin} is not of type p2pkh: ${r}`);o(L4.value(void 0),t.witnessScript,`${n} requires NO witnessScript`),o(L4.value(void 0),t.redeemScript,`${n} requires NO redeemScript`),o(L4.value(void 0),t.witnessValue,`${n} requires NO witnessValue`);break;case"p2pk":if(r&&"pubkey"!==r)throw new TypeError(`input #${t.vin} is not of type p2pk: ${r}`);o(L4.value(void 0),t.witnessScript,`${n} requires NO witnessScript`),o(L4.value(void 0),t.redeemScript,`${n} requires NO redeemScript`),o(L4.value(void 0),t.witnessValue,`${n} requires NO witnessValue`);break;case"p2wpkh":if(r&&"witnesspubkeyhash"!==r)throw new TypeError(`input #${t.vin} is not of type p2wpkh: ${r}`);o(L4.value(void 0),t.witnessScript,`${n} requires NO witnessScript`),o(L4.value(void 0),t.redeemScript,`${n} requires NO redeemScript`),o(q4.Satoshi,t.witnessValue,`${n} requires witnessValue`);break;case"p2ms":if(r&&"multisig"!==r)throw new TypeError(`input #${t.vin} is not of type p2ms: ${r}`);o(L4.value(void 0),t.witnessScript,`${n} requires NO witnessScript`),o(L4.value(void 0),t.redeemScript,`${n} requires NO redeemScript`),o(L4.value(void 0),t.witnessValue,`${n} requires NO witnessValue`);break;case"p2sh-p2wpkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type p2sh-p2wpkh: ${r}`);o(L4.value(void 0),t.witnessScript,`${n} requires NO witnessScript`),o(L4.Buffer,t.redeemScript,`${n} requires redeemScript`),o(q4.Satoshi,t.witnessValue,`${n} requires witnessValue`);break;case"p2sh-p2ms":case"p2sh-p2pk":case"p2sh-p2pkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);o(L4.value(void 0),t.witnessScript,`${n} requires NO witnessScript`),o(L4.Buffer,t.redeemScript,`${n} requires redeemScript`),o(L4.value(void 0),t.witnessValue,`${n} requires NO witnessValue`);break;case"p2wsh-p2ms":case"p2wsh-p2pk":case"p2wsh-p2pkh":if(r&&"witnessscripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);o(L4.Buffer,t.witnessScript,`${n} requires witnessScript`),o(L4.value(void 0),t.redeemScript,`${n} requires NO redeemScript`),o(q4.Satoshi,t.witnessValue,`${n} requires witnessValue`);break;case"p2sh-p2wsh-p2ms":case"p2sh-p2wsh-p2pk":case"p2sh-p2wsh-p2pkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);o(L4.Buffer,t.witnessScript,`${n} requires witnessScript`),o(L4.Buffer,t.redeemScript,`${n} requires witnessScript`),o(q4.Satoshi,t.witnessValue,`${n} requires witnessScript`)}}(t,a),({vin:m,keyPair:c,redeemScript:h,hashType:f,witnessValue:d,witnessScript:p}=a)}if(void 0===c)throw new Error("sign requires keypair");if(c.network&&c.network!==e)throw new TypeError("Inconsistent network");if(!t[m])throw new Error("No input at index: "+m);if(r(f=f||R5.Transaction.SIGHASH_ALL))throw new Error("Transaction needs outputs");const v=t[m];if(void 0!==v.redeemScript&&h&&!v.redeemScript.equals(h))throw new Error("Inconsistent redeemScript");const y=c.publicKey||c.getPublicKey&&c.getPublicKey();if(!l(v)){if(void 0!==d){if(void 0!==v.value&&v.value!==d)throw new Error("Input did not match witnessValue");L4(q4.Satoshi,d),v.value=d}if(!l(v)){const e=function(e,t,r,i){if(r&&i){const o=E5.p2wsh({redeem:{output:i}}),s=E5.p2wsh({output:r}),a=E5.p2sh({redeem:{output:r}}),c=E5.p2sh({redeem:o});if(!o.hash.equals(s.hash))throw new Error("Witness script inconsistent with prevOutScript");if(!a.hash.equals(c.hash))throw new Error("Redeem script inconsistent with prevOutScript");const l=u(o.redeem.output,t);if(!l.pubkeys)throw new Error(l.type+" not supported as witnessScript ("+r5.toASM(i)+")");e.signatures&&e.signatures.some((e=>void 0!==e))&&(l.signatures=e.signatures);const h=i;if(l.type===n.P2WPKH)throw new Error("P2SH(P2WSH(P2WPKH)) is a consensus failure");return{redeemScript:r,redeemScriptType:n.P2WSH,witnessScript:i,witnessScriptType:l.type,prevOutType:n.P2SH,prevOutScript:a.output,hasWitness:!0,signScript:h,signType:l.type,pubkeys:l.pubkeys,signatures:l.signatures,maxSignatures:l.maxSignatures}}if(r){const i=E5.p2sh({redeem:{output:r}});if(e.prevOutScript){let t;try{t=E5.p2sh({output:e.prevOutScript})}catch(e){throw new Error("PrevOutScript must be P2SH")}if(!i.hash.equals(t.hash))throw new Error("Redeem script inconsistent with prevOutScript")}const o=u(i.redeem.output,t);if(!o.pubkeys)throw new Error(o.type+" not supported as redeemScript ("+r5.toASM(r)+")");e.signatures&&e.signatures.some((e=>void 0!==e))&&(o.signatures=e.signatures);let s=r;return o.type===n.P2WPKH&&(s=E5.p2pkh({pubkey:o.pubkeys[0]}).output),{redeemScript:r,redeemScriptType:o.type,prevOutType:n.P2SH,prevOutScript:i.output,hasWitness:o.type===n.P2WPKH,signScript:s,signType:o.type,pubkeys:o.pubkeys,signatures:o.signatures,maxSignatures:o.maxSignatures}}if(i){const r=E5.p2wsh({redeem:{output:i}});if(e.prevOutScript){const t=E5.p2wsh({output:e.prevOutScript});if(!r.hash.equals(t.hash))throw new Error("Witness script inconsistent with prevOutScript")}const o=u(r.redeem.output,t);if(!o.pubkeys)throw new Error(o.type+" not supported as witnessScript ("+r5.toASM(i)+")");e.signatures&&e.signatures.some((e=>void 0!==e))&&(o.signatures=e.signatures);const s=i;if(o.type===n.P2WPKH)throw new Error("P2WSH(P2WPKH) is a consensus failure");return{witnessScript:i,witnessScriptType:o.type,prevOutType:n.P2WSH,prevOutScript:r.output,hasWitness:!0,signScript:s,signType:o.type,pubkeys:o.pubkeys,signatures:o.signatures,maxSignatures:o.maxSignatures}}if(e.prevOutType&&e.prevOutScript){if(e.prevOutType===n.P2SH)throw new Error("PrevOutScript is "+e.prevOutType+", requires redeemScript");if(e.prevOutType===n.P2WSH)throw new Error("PrevOutScript is "+e.prevOutType+", requires witnessScript");if(!e.prevOutScript)throw new Error("PrevOutScript is missing");const r=u(e.prevOutScript,t);if(!r.pubkeys)throw new Error(r.type+" not supported ("+r5.toASM(e.prevOutScript)+")");e.signatures&&e.signatures.some((e=>void 0!==e))&&(r.signatures=e.signatures);let i=e.prevOutScript;return r.type===n.P2WPKH&&(i=E5.p2pkh({pubkey:r.pubkeys[0]}).output),{prevOutType:r.type,prevOutScript:e.prevOutScript,hasWitness:r.type===n.P2WPKH,signScript:i,signType:r.type,pubkeys:r.pubkeys,signatures:r.signatures,maxSignatures:r.maxSignatures}}const o=E5.p2pkh({pubkey:t}).output;return{prevOutType:n.P2PKH,prevOutScript:o,hasWitness:!1,signScript:o,signType:n.P2PKH,pubkeys:[t],signatures:[void 0]}}(v,y,h,p);Object.assign(v,e)}if(!l(v))throw Error(v.prevOutType+" not supported")}let b;return b=v.hasWitness?s.hashForWitnessV0(m,v.signScript,v.value,f):s.hashForSignature(m,v.signScript,f),{input:v,ourPubKey:y,keyPair:c,signatureHash:b,hashType:f,useLowR:!!g}}(this.network,this.__INPUTS,this.__needsOutputs.bind(this),this.__TX,e,t,r,s,a,c,this.__USE_LOW_R))}__addInputUnsafe(e,t,r){if(R5.Transaction.isCoinbaseHash(e))throw new Error("coinbase inputs not supported");const n=e.toString("hex")+":"+t;if(void 0!==this.__PREV_TX_SET[n])throw new Error("Duplicate TxOut: "+n);let i={};if(void 0!==r.script&&(i=a(r.script,r.witness||[])),void 0!==r.value&&(i.value=r.value),!i.prevOutScript&&r.prevOutScript){let e;if(!i.pubkeys&&!i.signatures){const t=u(r.prevOutScript);t.pubkeys&&(i.pubkeys=t.pubkeys,i.signatures=t.signatures),e=t.type}i.prevOutScript=r.prevOutScript,i.prevOutType=e||I8.output(r.prevOutScript)}const o=this.__TX.addInput(e,t,r.sequence,r.scriptSig);return this.__INPUTS[o]=i,this.__PREV_TX_SET[n]=!0,o}__build(e){if(!e){if(!this.__TX.ins.length)throw new Error("Transaction has no inputs");if(!this.__TX.outs.length)throw new Error("Transaction has no outputs")}const t=this.__TX.clone();if(this.__INPUTS.forEach(((r,i)=>{if(!r.prevOutType&&!e)throw new Error("Transaction is not complete");const o=c(r.prevOutType,r,e);if(o)t.setInputScript(i,o.input),t.setWitness(i,o.witness);else{if(!e&&r.prevOutType===n.NONSTANDARD)throw new Error("Unknown input type");if(!e)throw new Error("Not enough information")}})),!e&&this.__overMaximumFees(t.virtualSize()))throw new Error("Transaction has absurd fees");return t}__canModifyInputs(){return this.__INPUTS.every((e=>!e.signatures||e.signatures.every((e=>!e||0!=(h(e)&R5.Transaction.SIGHASH_ANYONECANPAY)))))}__needsOutputs(e){return e===R5.Transaction.SIGHASH_ALL?0===this.__TX.outs.length:0===this.__TX.outs.length&&this.__INPUTS.some((e=>!!e.signatures&&e.signatures.some((e=>!!e&&!(h(e)&R5.Transaction.SIGHASH_NONE)))))}__canModifyOutputs(){const e=this.__TX.ins.length,t=this.__TX.outs.length;return this.__INPUTS.every((r=>void 0===r.signatures||r.signatures.every((r=>{if(!r)return!0;const n=31&h(r);return n===R5.Transaction.SIGHASH_NONE||n===R5.Transaction.SIGHASH_SINGLE&&e<=t}))))}__overMaximumFees(e){return(this.__INPUTS.reduce(((e,t)=>e+(t.value>>>0)),0)-this.__TX.outs.reduce(((e,t)=>e+t.value),0))/e>this.maximumFeeRate}}function a(e,t,r,i){if(0===e.length&&0===t.length)return{};if(!r){let i=I8.input(e,!0),o=I8.witness(t,!0);i===n.NONSTANDARD&&(i=void 0),o===n.NONSTANDARD&&(o=void 0),r=i||o}switch(r){case n.P2WPKH:{const{output:e,pubkey:r,signature:i}=E5.p2wpkh({witness:t});return{prevOutScript:e,prevOutType:n.P2WPKH,pubkeys:[r],signatures:[i]}}case n.P2PKH:{const{output:t,pubkey:r,signature:i}=E5.p2pkh({input:e});return{prevOutScript:t,prevOutType:n.P2PKH,pubkeys:[r],signatures:[i]}}case n.P2PK:{const{signature:t}=E5.p2pk({input:e});return{prevOutType:n.P2PK,pubkeys:[void 0],signatures:[t]}}case n.P2MS:{const{m:t,pubkeys:r,signatures:o}=E5.p2ms({input:e,output:i},{allowIncomplete:!0});return{prevOutType:n.P2MS,pubkeys:r,signatures:o,maxSignatures:t}}}if(r===n.P2SH){const{output:r,redeem:i}=E5.p2sh({input:e,witness:t}),o=I8.output(i.output),s=a(i.input,i.witness,o,i.output);return s.prevOutType?{prevOutScript:r,prevOutType:n.P2SH,redeemScript:i.output,redeemScriptType:s.prevOutType,witnessScript:s.witnessScript,witnessScriptType:s.witnessScriptType,pubkeys:s.pubkeys,signatures:s.signatures}:{}}if(r===n.P2WSH){const{output:r,redeem:i}=E5.p2wsh({input:e,witness:t}),o=I8.output(i.output);let s;return s=o===n.P2WPKH?a(i.input,i.witness,o):a(r5.compile(i.witness),[],o,i.output),s.prevOutType?{prevOutScript:r,prevOutType:n.P2WSH,witnessScript:i.output,witnessScriptType:s.prevOutType,pubkeys:s.pubkeys,signatures:s.signatures}:{}}return{prevOutType:n.NONSTANDARD,prevOutScript:e}}function u(e,t){L4(q4.Buffer,e);const r=I8.output(e);switch(r){case n.P2PKH:{if(!t)return{type:r};const n=E5.p2pkh({output:e}).hash,i=a5.hash160(t);return n.equals(i)?{type:r,pubkeys:[t],signatures:[void 0]}:{type:r}}case n.P2WPKH:{if(!t)return{type:r};const n=E5.p2wpkh({output:e}).hash,i=a5.hash160(t);return n.equals(i)?{type:r,pubkeys:[t],signatures:[void 0]}:{type:r}}case n.P2PK:return{type:r,pubkeys:[E5.p2pk({output:e}).pubkey],signatures:[void 0]};case n.P2MS:{const t=E5.p2ms({output:e});return{type:r,pubkeys:t.pubkeys,signatures:t.pubkeys.map((()=>{})),maxSignatures:t.m}}}return{type:r}}function c(e,t,i){const o=t.pubkeys||[];let s=t.signatures||[];switch(e){case n.P2PKH:if(0===o.length)break;if(0===s.length)break;return E5.p2pkh({pubkey:o[0],signature:s[0]});case n.P2WPKH:if(0===o.length)break;if(0===s.length)break;return E5.p2wpkh({pubkey:o[0],signature:s[0]});case n.P2PK:if(0===o.length)break;if(0===s.length)break;return E5.p2pk({signature:s[0]});case n.P2MS:{const e=t.maxSignatures;s=i?s.map((e=>e||r.OPS.OP_0)):s.filter((e=>e));const n=!i||e===s.length;return E5.p2ms({m:e,pubkeys:o,signatures:s},{allowIncomplete:i,validate:n})}case n.P2SH:{const e=c(t.redeemScriptType,t,i);if(!e)return;return E5.p2sh({redeem:{output:e.output||t.redeemScript,input:e.input,witness:e.witness}})}case n.P2WSH:{const e=c(t.witnessScriptType,t,i);if(!e)return;return E5.p2wsh({redeem:{output:t.witnessScript,input:e.input,witness:e.witness}})}}}function l(e){return void 0!==e.signScript&&void 0!==e.signType&&void 0!==e.pubkeys&&void 0!==e.signatures&&e.signatures.length===e.pubkeys.length&&e.pubkeys.length>0&&(!1===e.hasWitness||void 0!==e.value)}function h(e){return e.readUInt8(e.length-1)}t.TransactionBuilder=s}));MB(A8),A8.TransactionBuilder;var P8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.bip32=H4,t.address=k5,t.crypto=a5,t.ECPair=A5,t.networks=z4,t.payments=E5,t.script=r5,t.Block=N5.Block,t.Psbt=i8.Psbt;var r=r5;t.opcodes=r.OPS,t.Transaction=R5.Transaction,t.TransactionBuilder=A8.TransactionBuilder}));MB(P8),P8.bitcoin,P8.bip32,P8.address,P8.crypto,P8.ECPair,P8.networks,P8.payments,P8.script,P8.Block,P8.Psbt,P8.opcodes,P8.Transaction,P8.TransactionBuilder;const T8=Hz("Verifier");class O8{constructor({certificateJson:e,chain:t,expires:r,id:n,issuer:i,receipt:o,revocationKey:s,transactionId:a,version:u,explorerAPIs:c}){this.chain=t,this.expires=r,this.id=n,this.issuer=i,this.receipt=o,this.revocationKey=s,this.version=u,this.transactionId=a,this.explorerAPIs=c;let l=e.document;l||(l=this._retrieveDocumentBeforeIssuance(e)),this.documentToVerify=Object.assign({},l),this._stepsStatuses=[]}verify(e=(()=>{})){return oB(this,void 0,void 0,(function*(){if(this._stepCallback=e,this.version===aB.V1_1)throw new TB("","Verification of 1.1 certificates is not supported by this component. See the python cert-verifier for legacy verification");xV.chains.isMockChain(this.chain)?yield this._verifyV2Mock():yield this._verifyMain();const t=this._stepsStatuses.find((e=>"failure"===e.status));return t?this._failed(t):this._succeed()}))}_getRevocationListUrl(e){var t;return(null===(t=this.issuer)||void 0===t?void 0:t.revocationList)?this.issuer.revocationList:e.revocationList}_doAction(e,t){return oB(this,void 0,void 0,(function*(){if(this._isFailing())return;let r;e&&(r=xV.i18n.getText("subSteps",`${e}LabelPending`),T8(r),this._updateStatusCallback(e,r,"starting"));try{const n=yield t();return e&&(this._updateStatusCallback(e,r,"success"),this._stepsStatuses.push({step:e,label:r,status:"success"})),n}catch(t){e&&(this._updateStatusCallback(e,r,"failure",t.message),this._stepsStatuses.push({code:e,label:r,status:"failure",errorMessage:t.message}))}}))}_stepCallback(e){}_verifyMain(){return oB(this,void 0,void 0,(function*(){yield this.getTransactionId(),yield this.computeLocalHash(),yield this.fetchRemoteHash(),yield this.getIssuerProfile(),yield this.parseIssuerKeys(),yield this.compareHashes(),yield this.checkMerkleRoot(),yield this.checkReceipt(),yield this.checkRevokedStatus(),yield this.checkAuthenticity(),yield this.checkExpiresDate()}))}_verifyV2Mock(){return oB(this,void 0,void 0,(function*(){yield this.computeLocalHash(),yield this.compareHashes(),yield this.checkReceipt(),yield this.checkExpiresDate()}))}getTransactionId(){return oB(this,void 0,void 0,(function*(){yield this._doAction("getTransactionId",(()=>function(e){if("string"==typeof e&&e.length>0)return e;throw new TB("getTransactionId",SB("errors","isTransactionIdValid"))}(this.transactionId)))}))}computeLocalHash(){return oB(this,void 0,void 0,(function*(){this.localHash=yield this._doAction("computeLocalHash",(()=>oB(this,void 0,void 0,(function*(){return yield function(e,t){return oB(this,void 0,void 0,(function*(){let r=e["@context"];const n=e;!function(e){return e===rB.V1_1||e===rB.V1_2}(t)&&(r.find((e=>e===Object(e)&&"@vocab"in e))?r=null:r.push({"@vocab":"http://fallback.org/"}));const i="undefined"!=typeof window&&void 0!==window.XMLHttpRequest?$X.documentLoaders.xhr():$X.documentLoaders.node();$X.documentLoader=function(e,t){return e in bB?t(null,{contextUrl:null,document:bB[e],documentUrl:e}):i(e,t)};const o={algorithm:"URDNA2015",format:"application/nquads"};return r&&(o.expandContext=r),new Promise(((e,t)=>{$X.normalize(n,o,((r,n)=>{if(r)console.error(r),t(new TB("computeLocalHash",SB("errors","failedJsonLdNormalization")));else{const r=function(e){const t=/<http:\/\/fallback\.org\/(.*)>/.exec(e);if(t){const e=[];for(let r=0;r<t.length;r++)e.push(t[r]);return e}return null}(n);r?t(new TB("computeLocalHash",`${SB("errors","foundUnmappedFields")}: ${r.join(", ")}`)):e(GX(function(e){const t=[];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<55296||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&e.charCodeAt(r)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}(n)))}}))}))}))}(this.documentToVerify,this.version)}))))}))}fetchRemoteHash(){return oB(this,void 0,void 0,(function*(){this.txData=yield this._doAction("fetchRemoteHash",(()=>oB(this,void 0,void 0,(function*(){return yield xV.verifier.lookForTx({transactionId:this.transactionId,chain:this.chain.code,explorerAPIs:this.explorerAPIs})}))))}))}getIssuerProfile(){return oB(this,void 0,void 0,(function*(){this.issuer=yield this._doAction("getIssuerProfile",(()=>oB(this,void 0,void 0,(function*(){return yield xV.verifier.getIssuerProfile(this.issuer)}))))}))}parseIssuerKeys(){return oB(this,void 0,void 0,(function*(){this.issuerPublicKeyList=yield this._doAction("parseIssuerKeys",(()=>xV.verifier.parseIssuerKeys(this.issuer)))}))}compareHashes(){return oB(this,void 0,void 0,(function*(){yield this._doAction("compareHashes",(()=>{!function(e,t){if(e!==t)throw new TB("compareHashes",SB("errors","ensureHashesEqual"))}(this.localHash,this.receipt.targetHash)}))}))}checkMerkleRoot(){return oB(this,void 0,void 0,(function*(){yield this._doAction("checkMerkleRoot",(()=>function(e,t){if(e!==t)throw new TB("checkMerkleRoot",SB("errors","ensureMerkleRootEqual"));return!0}(this.receipt.merkleRoot,this.txData.remoteHash)))}))}checkReceipt(){return oB(this,void 0,void 0,(function*(){yield this._doAction("checkReceipt",(()=>function(e){let t=e.targetHash;const r=e.merkleRoot;try{const r=e.proof||e.path;if(r)for(const e in r){const n=r[e];let i;if(void 0!==n.left)i=XX(`${n.left}${t}`),t=GX(i);else{if(void 0===n.right)throw new TB("checkReceipt","Trigger catch error.");i=XX(`${t}${n.right}`),t=GX(i)}}}catch(e){throw new TB("checkReceipt",SB("errors","ensureValidReceipt"))}if(t!==r)throw new TB("checkReceipt",SB("errors","invalidMerkleReceipt"))}(this.receipt)))}))}checkRevokedStatus(){var e;return oB(this,void 0,void 0,(function*(){let t,r;this.version===aB.V1_2?(r=(null===(e=this.txData)||void 0===e?void 0:e.revokedAddresses)||[],t=[xV.verifier.parseRevocationKey(this.issuer),this.revocationKey]):(r=yield this._doAction(null,(()=>oB(this,void 0,void 0,(function*(){return yield xV.verifier.getRevokedAssertions(this._getRevocationListUrl(this.issuer),this.id)})))),t=this.id),yield this._doAction("checkRevokedStatus",(()=>function(e,t){if(!e||!t)return;Array.isArray(t)||(t=[t]);const r=function(e=[],t=[]){return e.filter((e=>-1!==t.indexOf(e))).filter(((e,t,r)=>r.indexOf(e)===t))}(t=t.filter((e=>null!=e)),e.map((e=>e.id)));if(r.length>0){const t=e.findIndex((e=>e.id===r[0]));if(t>-1)throw new TB("checkRevokedStatus",xV.certificates.generateRevocationReason(e[t].revocationReason))}}(r,t)))}))}checkAuthenticity(){return oB(this,void 0,void 0,(function*(){yield this._doAction("checkAuthenticity",(()=>function(e,t,r){let n="";const i=function(e,t){let r=null;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&n.toLowerCase()===t.toLowerCase()&&(r=n);return e[r]}(e,t),o=wV(r);if(i?(i.created&&o<=i.created&&(n="invalidIssuingAddressCreationTime"),i.revoked&&o>=i.revoked&&(n="invalidIssuingAddressRevoked"),i.expires&&o>=i.expires&&(n="invalidIssuingAddressExpired")):n="invalidIssuingAddressUnknown",n)throw new TB("checkAuthenticity",SB("errors",n))}(this.issuerPublicKeyList,this.txData.issuingAddress,this.txData.time)))}))}checkExpiresDate(){return oB(this,void 0,void 0,(function*(){yield this._doAction("checkExpiresDate",(()=>function(e=null){if(!e)return;const t=wV(e);if(new Date>=t)throw new TB("checkExpiresDate",SB("errors","ensureNotExpired"))}(this.expires)))}))}_failed(e){const t=e.errorMessage;return T8(`failure:${t}`),this._setFinalStep({status:"failure",message:t})}_isFailing(){return this._stepsStatuses.some((e=>"failure"===e.status))}_retrieveDocumentBeforeIssuance(e){const t=Object.assign({},e);return delete t.signature,t}_succeed(){const e=xV.chains.isMockChain(this.chain)?xV.i18n.getText("success","mocknet"):xV.i18n.getText("success","blockchain");return T8(e),this._setFinalStep({status:"success",message:e})}_setFinalStep({status:e,message:t}){return{code:"final",status:e,message:t}}_updateStatusCallback(e,t,r,n=""){if(null!=e){const i={code:e,label:t,status:r};n&&(i.errorMessage=n),this._stepCallback(i)}}}class C8{constructor(e,t={}){if(this.explorerAPIs=[],this._setOptions(t),"object"!=typeof e)try{e=JSON.parse(e)}catch(e){throw new Error(xV.i18n.getText("errors","certificateNotValid"))}this.certificateJson=jB(e)}init(){return oB(this,void 0,void 0,(function*(){yield this.parseJson(this.certificateJson)}))}parseJson(e){return oB(this,void 0,void 0,(function*(){const t=yield EV(e);if(!t.isFormatValid)throw new Error(t.error);this._setProperties(t)}))}verify(e){return oB(this,void 0,void 0,(function*(){const t=new O8({certificateJson:this.certificateJson,chain:this.chain,expires:this.expires,id:this.id,issuer:this.issuer,receipt:this.receipt,revocationKey:this.revocationKey,transactionId:this.transactionId,version:this.version,explorerAPIs:jB(this.explorerAPIs)});return yield t.verify(e)}))}_setOptions(e){this.options=Object.assign({},wB,e),this.locale=xV.i18n.ensureIsSupported("auto"===this.options.locale?xV.i18n.detectLocale():this.options.locale),this.explorerAPIs=this.options.explorerAPIs||[],xB.locale=this.locale}_setProperties({certificateImage:e,chain:t,description:r,expires:n,id:i,isFormatValid:o,issuedOn:s,issuer:a,metadataJson:u,name:c,publicKey:l,receipt:h,recipientFullName:f,recordLink:d,revocationKey:p,sealImage:g,signature:m,signatureImage:v,subtitle:y,version:b}){this.isFormatValid=o,this.certificateImage=e,this.chain=t,this.description=r,this.expires=n,this.id=i,this.issuedOn=s,this.issuer=a,this.metadataJson=u,this.name=c,this.publicKey=l,this.receipt=h,this.recipientFullName=f,this.recordLink=d,this.revocationKey=p,this.sealImage=g,this.signature=m,this.signatureImage=v,this.subtitle=y,this.verificationSteps=xV.certificates.getVerificationMap(t),this.version=b,this._setTransactionDetails()}_setTransactionDetails(){this.transactionId=xV.certificates.getTransactionId(this.receipt),this.rawTransactionLink=xV.certificates.getTransactionLink(this.transactionId,this.chain,!0),this.transactionLink=xV.certificates.getTransactionLink(this.transactionId,this.chain)}}var M8=Object.freeze({__proto__:null,displayHtmlHasNoWidthConstraint:function(e){const t=(new DOMParser).parseFromString(e,"text/html");return t.body.childElementCount===t.body.querySelectorAll(ut.map((e=>`section[class*="${e}"]`)).join(", ")).length},download:function(e){return e+ct},initializeVerificationSteps:function(e){const t=JSON.parse(JSON.stringify(e.verificationSteps));return t.map(((e,r)=>({...e,isLast:r===t.length-1,status:GD.DEFAULT})))},retrieve:function(e){return XD(e)||YD(e)?fetch(e+ct).then((e=>e.text())).then((e=>{try{return{certificateDefinition:JSON.parse(e)}}catch(e){return console.log(e),{certificateDefinition:null,errorMessage:"errors.invalidBlockcertsUrl"}}})).catch(QD):(console.error("Invalid url to retrieve:",e),null)},read:async function(e){if(!e)return;const t=await function(e){return new Promise((function(t,r){const n=new FileReader;n.onload=function(e){t(e.target.result)},n.onerror=n.onabort=r,n.readAsText(e)}))}(e);return t},parse:function(e,t={}){return iB(this,void 0,void 0,(function*(){t.locale||(t.locale="auto");try{let r;return r=1===Fh(e["@context"]).versionNumber?new C8(e,t):new JD(e,t),yield r.init(),{certificateDefinition:r}}catch(e){return console.error(e),{certificateDefinition:null,errorMessage:"errors.invalidBlockcerts"}}}))},isPathToCertificateValidURI:function(e){return XD(e)||YD(e)}});var R8=((e={})=>{if(!window.Proxy){const t=function(){let e=null;function t(e){return!!e&&("object"==typeof e||"function"==typeof e)}const r=function(r,n){if(!t(r)||!t(n))throw new TypeError("Cannot create proxy with a non-object as target or handler");let i=function(){};e=function(){i=function(e){throw new TypeError(`Cannot perform '${e}' on a proxy that has been revoked`)}};const o=n;n={get:null,set:null,apply:null,construct:null};for(const e in o)e in n&&(n[e]=o[e]);"function"==typeof o&&(n.apply=o.apply.bind(o));let s=this,a=!1,u=!1;"function"==typeof r?(s=function(){const e=this&&this.constructor===s,t=Array.prototype.slice.call(arguments);return i(e?"construct":"apply"),e&&n.construct?n.construct.call(this,r,t):!e&&n.apply?n.apply(r,this,t):e?(t.unshift(r),new(r.bind.apply(r,t))):r.apply(this,t)},a=!0):r instanceof Array&&(s=[],u=!0);const c=n.get?function(e){return i("get"),n.get(this,e,s)}:function(e){return i("get"),this[e]},l=n.set?function(e,t){i("set"),n.set(this,e,t,s)}:function(e,t){i("set"),this[e]=t},h=Object.getOwnPropertyNames(r),f={};h.forEach((function(e){if((a||u)&&e in s)return;const t={enumerable:!!Object.getOwnPropertyDescriptor(r,e).enumerable,get:c.bind(r,e),set:l.bind(r,e)};Object.defineProperty(s,e,t),f[e]=!0}));let d=!0;if(Object.setPrototypeOf?Object.setPrototypeOf(s,Object.getPrototypeOf(r)):s.__proto__?s.__proto__=r.__proto__:d=!1,n.get||!d)for(const e in r)f[e]||Object.defineProperty(s,e,{get:c.bind(r,e)});return Object.seal(r),Object.seal(s),s};return r.revocable=function(t,n){return{proxy:new r(t,n),revoke:e}},r}();return new t(e,at)}return new Proxy(e,at)})({certificates:M8,events:Object.freeze({__proto__:null,dispatch:function(e="",t=null,r){if(!e||"string"!=typeof e)return;if(!t||"object"!=typeof t)return;const n=new CustomEvent(e,{detail:{certificateDefinition:t,...r}});window.dispatchEvent(n)}})});function N8(e,t){return e(t={exports:{}},t.exports),t.exports}function L8(){var e={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return e}var j8=/javascript\s*\:/gim;var D8={whiteList:L8(),getDefaultWhiteList:L8,onAttr:function(e,t,r){},onIgnoreAttr:function(e,t,r){},safeAttrValue:function(e,t){return j8.test(t)?"":t}},B8=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},U8=function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")};var F8=function(e,t){";"!==(e=U8(e))[e.length-1]&&(e+=";");var r=e.length,n=!1,i=0,o=0,s="";function a(){if(!n){var r=B8(e.slice(i,o)),a=r.indexOf(":");if(-1!==a){var u=B8(r.slice(0,a)),c=B8(r.slice(a+1));if(u){var l=t(i,s.length,u,c,r);l&&(s+=l+"; ")}}}i=o+1}for(;o<r;o++){var u=e[o];if("/"===u&&"*"===e[o+1]){var c=e.indexOf("*/",o+2);if(-1===c)break;i=(o=c+1)+1,n=!1}else"("===u?n=!0:")"===u?n=!1:";"===u?n||a():"\n"===u&&a()}return B8(s)};function H8(e){return null==e}function z8(e){e=function(e){var t={};for(var r in e)t[r]=e[r];return t}(e||{}),e.whiteList=e.whiteList||D8.whiteList,e.onAttr=e.onAttr||D8.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||D8.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||D8.safeAttrValue,this.options=e}z8.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,r=t.whiteList,n=t.onAttr,i=t.onIgnoreAttr,o=t.safeAttrValue;return F8(e,(function(e,t,s,a,u){var c=r[s],l=!1;if(!0===c?l=c:"function"==typeof c?l=c(a):c instanceof RegExp&&(l=c.test(a)),!0!==l&&(l=!1),a=o(s,a)){var h,f={position:t,sourcePosition:e,source:u,isWhite:l};return l?H8(h=n(s,a,f))?s+":"+a:h:H8(h=i(s,a,f))?void 0:h}}))};var V8=z8,q8=N8((function(e,t){for(var r in t=e.exports=function(e,t){return new V8(t).process(e)},t.FilterCSS=V8,D8)t[r]=D8[r];"undefined"!=typeof window&&(window.filterCSS=e.exports)}));q8.cssfilter,q8.FilterCSS;var K8=function(e,t){var r,n;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},$8=function(e,t,r){var n,i;if(Array.prototype.forEach)return e.forEach(t,r);for(n=0,i=e.length;n<i;n++)t.call(r,e[n],n,e)},W8=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},J8=function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1},G8=q8.FilterCSS,X8=q8.getDefaultWhiteList;function Y8(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var Q8=new G8;function Z8(e){return e.replace(e9,"<").replace(t9,">")}var e9=/</g,t9=/>/g,r9=/"/g,n9=/"/g,i9=/&#([a-zA-Z0-9]*);?/gim,o9=/:?/gim,s9=/&newline;?/gim,a9=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi,u9=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,c9=/u\s*r\s*l\s*\(.*/gi;function l9(e){return e.replace(r9,""")}function h9(e){return e.replace(n9,'"')}function f9(e){return e.replace(i9,(function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))}))}function d9(e){return e.replace(o9,":").replace(s9," ")}function p9(e){for(var t="",r=0,n=e.length;r<n;r++)t+=e.charCodeAt(r)<32?" ":e.charAt(r);return W8(t)}function g9(e){return e=p9(e=d9(e=f9(e=h9(e))))}function m9(e){return e=Z8(e=l9(e))}var v9=/<!--[\s\S]*?-->/g;var y9=function(e,t,r,n){if(r=g9(r),"href"===t||"src"===t){if("#"===(r=W8(r)))return"#";if("http://"!==r.substr(0,7)&&"https://"!==r.substr(0,8)&&"mailto:"!==r.substr(0,7)&&"tel:"!==r.substr(0,4)&&"data:image/"!==r.substr(0,11)&&"ftp://"!==r.substr(0,6)&&"./"!==r.substr(0,2)&&"../"!==r.substr(0,3)&&"#"!==r[0]&&"/"!==r[0])return""}else if("background"===t){if(a9.lastIndex=0,a9.test(r))return""}else if("style"===t){if(u9.lastIndex=0,u9.test(r))return"";if(c9.lastIndex=0,c9.test(r)&&(a9.lastIndex=0,a9.test(r)))return"";!1!==n&&(r=(n=n||Q8).process(r))}return r=m9(r)},b9=function(e,t){"function"!=typeof t&&(t=function(){});var r=!Array.isArray(e),n=[],i=!1;return{onIgnoreTag:function(o,s,a){if(function(t){return!!r||-1!==K8(e,t)}(o)){if(a.isClosing){var u="[/removed]",c=a.position+u.length;return n.push([!1!==i?i:a.position,c]),i=!1,u}return i||(i=a.position),"[removed]"}return t(o,s,a)},remove:function(e){var t="",r=0;return $8(n,(function(n){t+=e.slice(r,n[0]),r=n[1]})),t+=e.slice(r)}}},w9=function(e){return e.replace(v9,"")},_9=function(e){var t=e.split("");return t=t.filter((function(e){var t=e.charCodeAt(0);return 127!==t&&(!(t<=31)||(10===t||13===t))})),t.join("")},x9={whiteList:{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},getDefaultWhiteList:Y8,onTag:function(e,t,r){},onIgnoreTag:function(e,t,r){},onTagAttr:function(e,t,r){},onIgnoreTagAttr:function(e,t,r){},safeAttrValue:y9,escapeHtml:Z8,escapeQuote:l9,unescapeQuote:h9,escapeHtmlEntities:f9,escapeDangerHtml5Entities:d9,clearNonPrintableCharacter:p9,friendlyAttrValue:g9,escapeAttrValue:m9,onIgnoreTagStripAll:function(){return""},StripTagBody:b9,stripCommentTag:w9,stripBlankChar:_9,cssFilter:Q8,getDefaultCSSWhiteList:X8};function S9(e){var t=J8(e);if(-1===t)var r=e.slice(1,-1);else r=e.slice(1,t+1);return"/"===(r=W8(r).toLowerCase()).slice(0,1)&&(r=r.slice(1)),"/"===r.slice(-1)&&(r=r.slice(0,-1)),r}function E9(e){return"</"===e.slice(0,2)}var k9=/[^a-zA-Z0-9_:\.\-]/gim;function I9(e,t){for(;t<e.length;t++){var r=e[t];if(" "!==r)return"="===r?t:-1}}function A9(e,t){for(;t>0;t--){var r=e[t];if(" "!==r)return"="===r?t:-1}}function P9(e){return function(e){return'"'===e[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]}(e)?e.substr(1,e.length-2):e}var T9=function(e,t,r){var n="",i=0,o=!1,s=!1,a=0,u=e.length,c="",l="";e:for(a=0;a<u;a++){var h=e.charAt(a);if(!1===o){if("<"===h){o=a;continue}}else if(!1===s){if("<"===h){n+=r(e.slice(i,a)),o=a,i=a;continue}if(">"===h){n+=r(e.slice(i,o)),c=S9(l=e.slice(o,a+1)),n+=t(o,n.length,c,l,E9(l)),i=a+1,o=!1;continue}if('"'===h||"'"===h)for(var f=1,d=e.charAt(a-f);""===d.trim()||"="===d;){if("="===d){s=h;continue e}d=e.charAt(a-++f)}}else if(h===s){s=!1;continue}}return i<e.length&&(n+=r(e.substr(i))),n},O9=function(e,t){var r=0,n=[],i=!1,o=e.length;function s(e,r){if(!((e=(e=W8(e)).replace(k9,"").toLowerCase()).length<1)){var i=t(e,r||"");i&&n.push(i)}}for(var a=0;a<o;a++){var u,c=e.charAt(a);if(!1!==i||"="!==c)if(!1===i||a!==r||'"'!==c&&"'"!==c||"="!==e.charAt(a-1))if(/\s|\n|\t/.test(c)){if(e=e.replace(/\s|\n|\t/g," "),!1===i){if(-1===(u=I9(e,a))){s(W8(e.slice(r,a))),i=!1,r=a+1;continue}a=u-1;continue}if(-1===(u=A9(e,a-1))){s(i,P9(W8(e.slice(r,a)))),i=!1,r=a+1;continue}}else;else{if(-1===(u=e.indexOf(c,a+1)))break;s(i,W8(e.slice(r+1,u))),i=!1,r=(a=u)+1}else i=e.slice(r,a),r=a+1}return r<e.length&&(!1===i?s(e.slice(r)):s(i,P9(W8(e.slice(r))))),W8(n.join(" "))},C9={parseTag:T9,parseAttr:O9},M9=q8.FilterCSS,R9=C9.parseTag,N9=C9.parseAttr;function L9(e){return null==e}function j9(e){e=function(e){var t={};for(var r in e)t[r]=e[r];return t}(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=x9.onIgnoreTagStripAll),e.whiteList=e.whiteList||x9.whiteList,e.onTag=e.onTag||x9.onTag,e.onTagAttr=e.onTagAttr||x9.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||x9.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||x9.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||x9.safeAttrValue,e.escapeHtml=e.escapeHtml||x9.escapeHtml,this.options=e,!1===e.css?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new M9(e.css))}j9.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,r=t.whiteList,n=t.onTag,i=t.onIgnoreTag,o=t.onTagAttr,s=t.onIgnoreTagAttr,a=t.safeAttrValue,u=t.escapeHtml,c=this.cssFilter;t.stripBlankChar&&(e=x9.stripBlankChar(e)),t.allowCommentTag||(e=x9.stripCommentTag(e));var l=!1;if(t.stripIgnoreTagBody){l=x9.StripTagBody(t.stripIgnoreTagBody,i);i=l.onIgnoreTag}var h=R9(e,(function(e,t,l,h,f){var d,p={sourcePosition:e,position:t,isClosing:f,isWhite:r.hasOwnProperty(l)};if(!L9(d=n(l,h,p)))return d;if(p.isWhite){if(p.isClosing)return"</"+l+">";var g=function(e){var t=J8(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var r="/"===(e=W8(e.slice(t+1,-1)))[e.length-1];return r&&(e=W8(e.slice(0,-1))),{html:e,closing:r}}(h),m=r[l],v=N9(g.html,(function(e,t){var r,n=-1!==K8(m,e);return L9(r=o(l,e,t,n))?n?(t=a(l,e,t,c))?e+'="'+t+'"':e:L9(r=s(l,e,t,n))?void 0:r:r}));h="<"+l;return v&&(h+=" "+v),g.closing&&(h+=" /"),h+=">"}return L9(d=i(l,h,p))?u(h):d}),u);return l&&(h=l.remove(h)),h};var D9=j9,B9=N8((function(e,t){function r(e,t){return new D9(t).process(e)}for(var n in(t=e.exports=r).filterXSS=r,t.FilterXSS=D9,x9)t[n]=x9[n];for(var n in C9)t[n]=C9[n];"undefined"!=typeof window&&(window.filterXSS=e.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=e.exports)}));B9.xss,B9.filterXSS,B9.FilterXSS;const U9={...q8.getDefaultWhiteList(),bottom:!0,left:!0,float:!0,overflow:!0,position:!0,right:!0,top:!0,transform:!0,opacity:!0,"transform-origin":!0,"flex-direction":!0,"flex-wrap":!0,"justify-content":!0,"align-items":!0,"white-space":!0,"line-height":!0};var F9=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,H9=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,z9=/u\s*r\s*l\s*\(.*/gi;const V9={whiteList:function(){const e=B9.getDefaultWhiteList();return Object.keys(e).forEach((t=>{e[t].push("style"),e[t].push("class"),e[t].push("download")})),e}(),css:!1,stripIgnoreTagBody:!0,onTagAttr:function(e,t,r,n){if("style"===t)return`${t}="${q8(r,{whiteList:U9}).replace(/; /g,";")}"`;if("img"===e&&"src"===t&&function(e){return!!e.match(/^data:.+;base64,/)}(r)){const e=function(e){return e.split("base64,")[1]}(r);try{return atob(e),`${t}="${r}"`}catch(e){return t}}},safeAttrValue:function(e,t,r,n){if(r=B9.friendlyAttrValue(r),"href"===t||"src"===t){if("#"===(r=function(e){if(String.prototype.trim)return e.trim();return e.replace(/(^\s*)|(\s*$)/g,"")}(r)))return"#";if(!function(e){return["http://","https://","mailto:","tel:","data:","#","/"].some((t=>e.substr(0,t.length)===t))}(r))return""}else if("background"===t){if(F9.lastIndex=0,F9.test(r))return""}else if("style"===t){if(H9.lastIndex=0,H9.test(r))return"";if(z9.lastIndex=0,z9.test(r)&&(F9.lastIndex=0,F9.test(r)))return"";!1!==n&&(r=(n=n||B9.getDefaultCSSWhiteList()).process(r))}return r=B9.escapeAttrValue(r)}},q9=new B9.FilterXSS(V9);function K9(e){return q9.process(e)}const $9="en";var W9={locale:$9};const J9={en:{errors:{errorLabel:"Error",invalidBlockcerts:"Not a valid Blockcerts credential. Please check with the issuer or recipient that has provided this credential.",invalidBlockcertsUrl:"Not a valid credential URL.",invalidFormatDragAndDrop:"Only JSON files are accepted",invalidUrl:"This does not seem to be a valid URL.",noDownloadLink:"No link provided for download!",noMetadata:"No metadata specified for this record",noShareUrl:"No URL to share!",noTransactionId:"No transaction ID"},text:{brandName:"Blockcerts",blockcertsHint:"Visit Blockcerts website",by:"by",certified:"Certified by",closeButton:"Click to close",downloadLink:"Download Record in JSON format",dragAndDropHint:"(you can also drag & drop your file).",fileUpload:"Choose JSON file",issued:"Issued on",issueDate:"Issue Date",issuerName:"Issuer",issuerPublicKey:"Issuer's public key",item:"Item",itemPlural:"Items",metadataButton:"View Metadata",metadataTitle:"Metadata",motto:"Blockcerts, The Open Standard for Blockchain Credentials",recipient:"Recipient",share:"Share on",shareButton:"Share on Social Networks",signed:"Signed by",substepsListClose:"Hide",substepsListHint:"Toggle open list of substeps",transactionId:"Transaction ID",urlInput:"Enter the certificate URL",urlInputPlaceholder:"Certificate URL",verificationStepProgress:"Verifying step...",verify:"Verify",verifyAgain:"Verify again",verifyOther:"Verify another record",viewRecord:"View Record"},date:{months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],pattern:"MM DD, YYYY"}},es:{errors:{errorLabel:"Error",invalidBlockcerts:"No es una credencial válida de Blockcerts. Verifique con el emisor o el destinatario que ha proporcionado esta credencial.",invalidBlockcertsUrl:"No es URL de certificado valido.",invalidFormatDragAndDrop:"Solo se aceptan archivos JSON",invalidUrl:"Esto no parece ser un URL válido.",noDownloadLink:"Enlace para descargar no proporcionado!",noMetadata:"No se han especificado metadatos para este registro",noShareUrl:"No hay URL para compartir!",noTransactionId:"No ID de transacción"},text:{brandName:"Blockcerts",blockcertsHint:"Visite el sitio web de Blockcerts",by:"por",certified:"Certificado por",closeButton:"Haz Click para cerrar",downloadLink:"Descarga el Registro en formato JSON",dragAndDropHint:"(también puedes arrastrar y soltar tu archivo).",fileUpload:"Escoge archivo JSON",issued:"Emitido el",issueDate:"Fecha de Emisión",issuerName:"Emisor",issuerPublicKey:"Llave publica del Emisor",item:"Elemento",itemPlural:"Elementos",metadataButton:"Ver Metadata",metadataTitle:"Metadata",motto:"Blockcerts, El Estándar Abierto para Credenciales Blockchain",recipient:"Recipiente",share:"Comparte en",shareButton:"Comparte en Redes Sociales",signed:"Firmado Por",substepsListClose:"Esconde",substepsListHint:"Pasa lista abierta de sub-pasos",transactionId:"ID de Transacción",urlInput:"Ingrese el URL del certificado",urlInputPlaceholder:"Certificado del URL",verificationStepProgress:"Paso de verificación...",verify:"Verifica",verifyAgain:"Verifica nuevamente",verifyOther:"Verifica otro registro",viewRecord:"Ver Registro"},date:{months:["enero","feb","marzo","abr","mayo","jun","jul","agosto","set","oct","nov","dic"],pattern:"MM DD, YYYY"}},fr:{errors:{errorLabel:"Erreur",invalidBlockcerts:"Ceci n'est pas un certificat Blockcerts valide. Veuillez s'il vous plaît contrôler avec l'organisme émetteur ou le récipiendaire de ce certificat.",invalidBlockcertsUrl:"Ceci n'est pas une URL de certificat valide.",invalidFormatDragAndDrop:"Seul le format JSON est accepté",invalidUrl:"URL invalide",noDownloadLink:"Aucun lien disponible pour le téléchargement!",noMetadata:"Ce certificat ne contient pas de métadata",noShareUrl:"Pas d'URL à partager!",noTransactionId:"Pas d'identifiant de transaction"},text:{brandName:"Blockcerts",blockcertsHint:"Visiter le site de Blockcerts",by:"par",certified:"Certifié par",closeButton:"Cliquer pour fermer",downloadLink:"Télécharger le certificat au format JSON",dragAndDropHint:"(vous pouvez aussi glisser et déposer votre fichier).",fileUpload:"Choisir un fichier JSON",issued:"Émis le",issueDate:"Date d'émission",issuerName:"Émetteur",issuerPublicKey:"Clé publique de l'émetteur",item:"point contrôlé",itemPlural:"points contrôlés",metadataButton:"Voir les métadata",metadataTitle:"Métadata",motto:"Blockcerts, The Open Standard for Blockchain Credentials",recipient:"Titulaire",share:"Partager sur",shareButton:"Partager sur les réseaux sociaux",signed:"Signé par",substepsListClose:"Fermer",substepsListHint:"Afficher les sous-étapes",transactionId:"Identifiant de transaction",urlInput:"Entrez l'URL du certificat",urlInputPlaceholder:"URL du certificat",verificationStepProgress:"Vérification en cours...",verify:"Vérifier",verifyAgain:"Vérifier de nouveau",verifyOther:"Vérifier un autre certificat",viewRecord:"Voir le certificat"},date:{months:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Aout","Sept","Oct","Nov","Déc"],pattern:"DD MM YYYY"}},it:{errors:{errorLabel:"Errore",invalidBlockcerts:"Non è una definizione valida di Blockcerts.",invalidBlockcertsUrl:"Non è un URL di certificato valido.",invalidFormatDragAndDrop:"Sono accettati solo file JSON",invalidUrl:"Questo non sembra essere un URL valido.",noDownloadLink:"Link per il download non fornito!",noMetadata:"Nessun Metadata specificato per questo record",noShareUrl:"Non c'è un URL da condividere!",noTransactionId:"Nessun ID transazione"},text:{brandName:"Blockcerts",blockcertsHint:"Visita il sito Web Blockcerts",by:"da",certified:"Certificato da",closeButton:"Fai clic per chiudere",downloadLink:"Scarica il Record in formato JSON",dragAndDropHint:"(puoi anche trascinare il file).",fileUpload:"Scegli il file JSON",issued:"Rilasciato il",issueDate:"Data",issuerName:"Organizzazione Issuer",issuerPublicKey:"Chiave pubblica del Issuer",item:"Elemento",itemPlural:"Elementi",metadataButton:"Visualizza Metadata",metadataTitle:"Metadata",motto:"Blockcerts, The Open Standard for Blockchain Credentials",recipient:"Titolare",share:"Condividi",shareButton:"Condividi sui Social Network",signed:"Firmato da",substepsListClose:"Nascondi",substepsListHint:"Mostra gli step secondari",transactionId:"ID transazione",urlInput:"Inserisci l'URL del certificato",urlInputPlaceholder:"URL del certificato",verificationStepProgress:"Step di verifica...",verify:"Verifica",verifyAgain:"Verifica di nuovo",verifyOther:"Verifica un altro record",viewRecord:"Visualizza il Record"},date:{months:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],pattern:"DD MM YYYY"}}};function G9(){return J9}function X9(e,t,r,n){if(!e)return"";if(e.includes(".")){const r=e.split(".");e=r[0],t=r[1]}if(!t)return"";r&&n>1&&(t+="Plural");const i=G9();return i[W9.locale]?i[W9.locale][e]?i[W9.locale][e][t]?i[W9.locale][e][t]||"":"[missing locale item data]":"[missing locale group data]":"[missing locale data]"}function Y9(e){const t=X9("date","pattern"),r=new Date(e);let n=function(e,t){const r=X9("date","months");return e.replace("MM",r[t])}(t,r.getMonth());return n=function(e,t){return e.replace("DD",t)}(n,r.getDate()),n=function(e,t){return e.replace("YYYY",t)}(n,r.getFullYear()),n}function Q9(e){return e.certificateDefinition}function Z9(e){const t=Q9(e);return t?t.issuedOn:""}function e7(e){return Q9(e)?Y9(Z9(e)):""}function t7(e){const t=Q9(e);return t?t.recipientFullName:""}function r7(e){const t=Q9(e);return t?t.name:""}function n7(e){const t=Q9(e);return t?t.issuer.name:""}function i7(e){const t=Q9(e);return t?t.issuer.image:""}function o7(e){const t=Q9(e);if(!t)return"";const{displayHtml:r,display:n}=t.certificateJson;if(r)return K9(r);if(n)switch(n.contentMediaType){case"text/html":return K9(n.content);case"image/png":case"image/jpeg":case"image/gif":case"image/bmp":return`<img src="data:${n.contentMediaType};${n.contentEncoding},${n.content}"/>`;case"application/pdf":return`<embed width="100%" height="100%" type="application/pdf" src="data:${n.contentMediaType};${n.contentEncoding},${n.content}"/>`;default:return""}return""}function s7(e){const t=Q9(e);return t&&XD(t.recordLink)?t.recordLink:""}function a7(e){const t=s7(e);return t?R8.certificates.download(t):""}function u7(e){const t=Q9(e);if(t)try{return JSON.parse(t.metadataJson)}catch(e){return null}return null}function c7(e){const t=Q9(e);return t?t.transactionLink:""}function l7(e){const t=Q9(e);return t?t.transactionId:""}function h7(e){const t=Q9(e);if(t){const{chain:e}=t;return e.name}return""}function f7(e){const t=h7(e);return"Mocknet"===t||t.includes("Testnet")}function d7(e){return e.verifiedSteps||[]}function p7(e,t){return d7(e).find((e=>e.code===t))}function g7(e){return d7(e).some((e=>e.status===GD.FAILURE))}function m7(e){const t=Q9(e);return t?t.certificateImage:""}function v7(e){const t=Q9(e);return t?t.subtitle:""}function y7(e){const t=Q9(e);return t?t.description:""}function b7(e){const t=Q9(e);return t?t.signatureImage:""}function w7(e){const t=Q9(e);return t?t.sealImage:""}function _7(e){return e.finalStep}function x7(e){const t=Q9(e);return t?t.publicKey:""}function S7(e,t){switch(t.type){case et:return function(e,t){const{resetSteps:r}=t.payload;return{...e,verifiedSteps:r}}(e,t);case Ge:return function(e,t){return{...e,...t.payload.options}}(e,t);case Xe:return function(e,t){return{...e,...t.payload,...t.payload.certificateDefinition&&{verifiedSteps:R8.certificates.initializeVerificationSteps(t.payload.certificateDefinition)}}}(e,t);case Ye:return function(e,t){return{...e,certificateDefinition:t.payload.definition}}(e,t);case Qe:return function(e,t){return{...e,input:{...e.input,certificateUrl:t.payload.url}}}(e,t);case rt:return function(e,t){const{parentStepCode:r,status:n}=t.payload;return p7(e,r).status=n,e}(e,t);case Ze:return function(e,t){return{...e,input:{...e.input,isValid:t.payload.isValid}}}(e,t);case ot:return function(e,t){const{errorMessage:r}=t.payload;return{...e,errorMessage:r}}(e,t);case st:return function(e,t){return{...e,showVerificationModal:t.payload.showVerificationModal}}(e,t);case tt:return function(e,t){const{parentStep:r}=t.payload;return function(e,t){const r=e.subSteps.findIndex((e=>e.code===t.code));e.subSteps[r]=t}(p7(e,r),t.payload),e}(e,t);case nt:return function(e,t){return{...e,verificationStatus:t.payload.status}}(e,t);case it:return function(e,t){return{...e,finalStep:t.payload.finalStep}}(e,t);default:return e}}const E7="full",k7="bright",I7="dark";const A7=function(e=function(e={}){return{input:{},verifiedSteps:[],finalStep:null,verificationStatus:GD.DEFAULT,showVerificationModal:!1,displayMode:"card",theme:k7,...e}}()){return Ie(S7,e,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return function(){var r=e.apply(void 0,arguments),n=function(){throw new Error(_e(15))},i={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},o=t.map((function(e){return e(i)}));return n=Pe.apply(void 0,o)(r.dispatch),we(we({},r),{},{dispatch:n})}}}(...[Oe]))}();function P7(e,{mapDispatchToProps:t={},mapStateToProps:r=(()=>{}),ownProps:n={}}){return class extends(ve(A7)(me)){mapDispatchToProps(){return function(e,t){if("function"==typeof e)return Ae(e,t);if("object"!=typeof e||null===e)throw new Error(_e(16));var r={};for(var n in e){var i=e[n];"function"==typeof i&&(r[n]=Ae(i,t))}return r}(t,A7.dispatch)}mapStateToProps(){return r(A7.getState())}static get properties(){return n}_render(t){const r={...this.mapDispatchToProps(),...this.mapStateToProps(),...t};return he`${e(r)}`}_stateChanged(e){this._requestRender()}}}function T7(e){return{type:ot,payload:{errorMessage:e}}}function O7(e){return function(t,r){if(null==e)return;const n=p7(r(),e);let i=n.status;i===GD.DEFAULT&&function(e){return e.subSteps.some((e=>e.status===GD.SUCCESS))}(n)&&(i=GD.STARTED),i!==GD.DEFAULT&&function(e){return e.subSteps.every((e=>e.status===GD.SUCCESS))}(n)&&(i=GD.SUCCESS),function(e){return e.subSteps.some((e=>e.status===GD.FAILURE))}(n)&&(i=GD.FAILURE),t({type:rt,payload:{parentStepCode:e,status:i}})}}class C7{constructor(){this.queue=[],this.dispatchCb=null,this.isExecuting=!1,this.intervalId=null,this.dispatchNext=this.dispatchNext.bind(this)}registerCb(e){this.dispatchCb=e}push(e){this.queue.push(e)}dispatchNext(){const e=this.queue.shift();e?this.dispatchCb(e):this.intervalId&&(this.isExecuting=!1,clearInterval(this.intervalId))}execute(){!this.isExecuting&&this.queue.length&&(this.isExecuting=!0,this.intervalId=setInterval(this.dispatchNext,200))}}const M7=new C7;function R7(e){return function(t,r){const n=r().verifiedSteps.find((t=>t.subSteps.some((t=>t.code===e.code)))).code,i={...e,...e.errorMessage&&{errorMessage:e.errorMessage},parentStep:n},o=function(e){return function(t){e({type:tt,payload:t}),e(O7(t.parentStep))}}(t);M7.dispatchCb||M7.registerCb(o),M7.push(i),M7.execute()}}function N7(){return function(e,t){const r=Q9(t());let n=[];r&&(n=R8.certificates.initializeVerificationSteps(r)),e({type:et,payload:{resetSteps:n}})}}function L7(e){return{type:nt,payload:{status:e}}}function j7(e){return e.disableVerify}function D7(e){return e.allowDownload}function B7(e){return e.allowSocialShare}function U7(e){return e.showMetadata}function F7(e){return e.displayMode}function H7(e){return e.theme}function z7(e){return e.locale}function V7(e){return e.explorerAPIs}function q7(e){return e.clickableUrls}function K7(e){return e.didResolverUrl}function $7(e){return"string"==typeof e&&(e={label:e}),{type:it,payload:{finalStep:e}}}function W7(){return async function(e,t){const r=t();if(j7(r))return void console.warn("Verification is disabled");e({type:"VERIFY_CERTIFICATE"}),e(L7(GD.STARTED)),e(N7());const n=Q9(r);if(n){R8.events.dispatch("certificate-verify",n);const t=await n.verify((t=>{e(R7(t))}));e($7(t.message)),e(L7(t.status))}}}function J7(e){return{type:st,payload:{showVerificationModal:e}}}function G7(e){return function(t,r){return iB(this,void 0,void 0,(function*(){const n=r(),i={locale:z7(n),explorerAPIs:V7(n),didResolverUrl:K7(n)},{certificateDefinition:o,errorMessage:s}=yield R8.certificates.parse(e,i);t(T7(s)),t({type:Xe,payload:{certificateDefinition:o}}),R8.events.dispatch("certificate-load",o),null!=o&&(yield t((function(e,t){return iB(this,void 0,void 0,(function*(){(function(e){return e.disableAutoVerify})(t())||(e({type:Je}),e(J7(!0))),yield e(W7())}))})))}))}}function X7(e){return async function(t){const r=R8.certificates.isPathToCertificateValidURI(e);var n;if(t((n=r,function(e){e({type:Ze,payload:{isValid:n}}),e(T7(n?null:"errors.invalidUrl"))})),!r)return null;t({type:Qe,payload:{url:e}});const i=await R8.certificates.retrieve(e);i.certificateDefinition?await t(G7(i.certificateDefinition)):t(T7(i.errorMessage))}}const Y7=/(-\w)/g,Q7=e=>e[1].toUpperCase();const Z7={src:String,"disable-auto-verify":Boolean,"disable-verify":Boolean,"allow-download":Boolean,"allow-social-share":Boolean,"display-mode":String,"show-metadata":Boolean,"clickable-urls":Boolean,theme:0,locale:String,explorerAPIs:{},"did-resolver-url":String},eee=Object.keys(Z7).map((function(e){return e.replace(Y7,Q7)})).reduce(((e,t)=>(e[t]=Z7[t],e)),{});function tee(e){let t;const r=Object.keys(J9).map((e=>e.toLowerCase()));if(t=r.indexOf(e.toLowerCase())>-1,!t){const n=e.substr(0,2).toLowerCase(),i=r.map((e=>e.split("-")[0])).indexOf(n);t=i>-1,t&&(e=r[i])}return t||(e=$9),function(e){const t=e.split("-");return t.length>1?`${t[0].toLowerCase()}-${t[1].toUpperCase()}`:t[0].toLowerCase()}(e)}function ree(e){"auto"!==e&&e||(e=navigator.language||navigator.userLanguage||navigator.browserLanguage||$9),W9.locale=tee(e)}var nee=he`<style>.buv-c-input{font-size:15px;color:#031532;border-radius:2px 0 0 2px;padding:12px 15px;background-color:#f3f4f5;border:solid 1px rgba(3,21,50,0.13);box-sizing:border-box;width:100%}.buv-c-input.is-invalid{border:2px solid #f00}.buv-c-input::-moz-placeholder{font-family:'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;color:rgba(3,21,50,0.3);letter-spacing:-.25px}.buv-c-input::-webkit-input-placeholder{font-family:'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;color:rgba(3,21,50,0.3);letter-spacing:-.25px}.buv-c-input:-moz-placeholder{font-family:'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;color:rgba(3,21,50,0.3);letter-spacing:-.25px}.buv-c-input:-ms-input-placeholder{font-family:'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;color:rgba(3,21,50,0.3);letter-spacing:-.25px}.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}
|
|
329
|
-
</style>`;function
|
|
330
|
-
${
|
|
328
|
+
var r=BU.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=BU:(n(BU,t),t.Buffer=i),i.prototype=Object.create(r.prototype),n(r,i),i.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},i.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return BU.SlowBuffer(e)}}));QX.Buffer;var ZX=AH.EventEmitter;function eY(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function tY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var rY=BU.Buffer,nY=QV.inspect,iY=nY&&nY.custom||"inspect";function oY(e,t,r){rY.prototype.copy.call(e,t,r)}var sY=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t;return(t=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return rY.alloc(0);for(var t=rY.allocUnsafe(e>>>0),r=this.head,n=0;r;)oY(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=rY.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:iY,value:function(e,t){return nY(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eY(Object(r),!0).forEach((function(t){tY(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eY(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}();function aY(e,t){cY(e,t),uY(e)}function uY(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function cY(e,t){e.emit("error",t)}var lY=function(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,XU(cY,this,e)):XU(cY,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?XU(uY,r):(r._writableState.errorEmitted=!0,XU(aY,r,e)):XU(aY,r,e):t?(XU(uY,r),t(e)):XU(uY,r)})),this)},hY=function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},fY=function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)},dY={};function pY(e,t,r){r||(r=Error);var n=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);n.prototype.name=r.name,n.prototype.code=e,dY[e]=n}function gY(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}pY("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),pY("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i,o;if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))o="The ".concat(e," ").concat(n," ").concat(gY(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+".".length>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";o='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(gY(t,"type"))}return o+". Received type ".concat(typeof r)}),TypeError),pY("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),pY("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),pY("ERR_STREAM_PREMATURE_CLOSE","Premature close"),pY("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),pY("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),pY("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),pY("ERR_STREAM_WRITE_AFTER_END","write after end"),pY("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),pY("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),pY("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");var mY={codes:dY},vY=mY.codes.ERR_INVALID_OPT_VALUE,yY=function(e,t,r,n){var i=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,n,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new vY(n?r:"highWaterMark",i);return Math.floor(i)}return e.objectMode?16:16384};function bY(e){try{if(!CB.localStorage)return!1}catch(e){return!1}var t=CB.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}var wY,_Y=FY;function xY(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}FY.WritableState=UY;var SY,EY=function(e,t){if(bY("noDeprecation"))return e;var r=!1;return function(){if(!r){if(bY("throwDeprecation"))throw new Error(t);bY("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}},kY=BU.Buffer,IY=CB.Uint8Array||function(){},AY=yY,PY=mY.codes,TY=PY.ERR_INVALID_ARG_TYPE,OY=PY.ERR_METHOD_NOT_IMPLEMENTED,CY=PY.ERR_MULTIPLE_CALLBACK,MY=PY.ERR_STREAM_CANNOT_PIPE,RY=PY.ERR_STREAM_DESTROYED,NY=PY.ERR_STREAM_NULL_VALUES,LY=PY.ERR_STREAM_WRITE_AFTER_END,jY=PY.ERR_UNKNOWN_ENCODING,DY=fY;function BY(){}function UY(e,t,r){wY=wY||JY,e=e||{},"boolean"!=typeof r&&(r=t instanceof wY),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=AY(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=!1===e.decodeStrings;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new CY;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(XU(i,n),XU($Y,e,t),e._writableState.errorEmitted=!0,DY(e,n)):(i(n),e._writableState.errorEmitted=!0,DY(e,n),$Y(e,t))}(e,r,n,t,i);else{var o=qY(r)||e.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||VY(e,r),n?XU(zY,e,r,o,i):zY(e,r,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new xY(this)}function FY(e){var t=this instanceof(wY=wY||JY);if(!t&&!SY.call(FY,this))return new FY(e);this._writableState=new UY(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),ZX.call(this)}function HY(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new RY("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function zY(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),$Y(e,t)}function VY(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,a=!0;r;)i[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;i.allBuffers=a,HY(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new xY(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback;if(HY(e,t,!1,t.objectMode?1:u.length,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function qY(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function KY(e,t){e._final((function(r){t.pendingcb--,r&&DY(e,r),t.prefinished=!0,e.emit("prefinish"),$Y(e,t)}))}function $Y(e,t){var r=qY(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,XU(KY,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}YX(FY,ZX),UY.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(UY.prototype,"buffer",{get:EY((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(SY=Function.prototype[Symbol.hasInstance],Object.defineProperty(FY,Symbol.hasInstance,{value:function(e){return!!SY.call(this,e)||this===FY&&e&&e._writableState instanceof UY}})):SY=function(e){return e instanceof this},FY.prototype.pipe=function(){DY(this,new MY)},FY.prototype.write=function(e,t,r){var n,i=this._writableState,o=!1,s=!i.objectMode&&(n=e,kY.isBuffer(n)||n instanceof IY);return s&&!kY.isBuffer(e)&&(e=function(e){return kY.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=BY),i.ending?function(e,t){var r=new LY;DY(e,r),XU(t,r)}(this,r):(s||function(e,t,r,n){var i;return null===r?i=new NY:"string"==typeof r||t.objectMode||(i=new TY("chunk",["string","Buffer"],r)),!i||(DY(e,i),XU(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,o=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=kY.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else HY(e,t,!1,a,n,i,o);return u}(this,i,s,e,t,r)),o},FY.prototype.cork=function(){this._writableState.corked++},FY.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||VY(this,e))},FY.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new jY(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(FY.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(FY.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),FY.prototype._write=function(e,t,r){r(new OY("_write()"))},FY.prototype._writev=null,FY.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,$Y(e,t),r&&(t.finished?XU(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(FY.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(FY.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),FY.prototype.destroy=lY,FY.prototype._undestroy=hY,FY.prototype._destroy=function(e,t){t(e)};var WY=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t},JY=QY;YX(QY,NQ);for(var GY=WY(_Y.prototype),XY=0;XY<GY.length;XY++){var YY=GY[XY];QY.prototype[YY]||(QY.prototype[YY]=_Y.prototype[YY])}function QY(e){if(!(this instanceof QY))return new QY(e);NQ.call(this,e),_Y.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",ZY)))}function ZY(){this._writableState.ended||XU(eQ,this)}function eQ(e){e.end()}Object.defineProperty(QY.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(QY.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(QY.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(QY.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}});var tQ=QX.Buffer,rQ=tQ.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},nQ=iQ;function iQ(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(tQ.isEncoding===rQ||!rQ(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=aQ,this.end=uQ,t=4;break;case"utf8":this.fillLast=sQ,t=4;break;case"base64":this.text=cQ,this.end=lQ,t=3;break;default:return this.write=hQ,void(this.end=fQ)}this.lastNeed=0,this.lastTotal=0,this.lastChar=tQ.allocUnsafe(t)}function oQ(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function sQ(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function aQ(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function uQ(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function cQ(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function lQ(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function hQ(e){return e.toString(this.encoding)}function fQ(e){return e&&e.length?this.write(e):""}iQ.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},iQ.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},iQ.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=oQ(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=oQ(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=oQ(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},iQ.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};var dQ={StringDecoder:nQ},pQ=mY.codes.ERR_STREAM_PREMATURE_CLOSE;function gQ(){}var mQ,vQ=function e(t,r,n){if("function"==typeof r)return e(t,null,r);r||(r={}),n=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(n||gQ);var i=r.readable||!1!==r.readable&&t.readable,o=r.writable||!1!==r.writable&&t.writable,s=function(){t.writable||u()},a=t._writableState&&t._writableState.finished,u=function(){o=!1,a=!0,i||n.call(t)},c=t._readableState&&t._readableState.endEmitted,l=function(){i=!1,c=!0,o||n.call(t)},h=function(e){n.call(t,e)},f=function(){var e;return i&&!c?(t._readableState&&t._readableState.ended||(e=new pQ),n.call(t,e)):o&&!a?(t._writableState&&t._writableState.ended||(e=new pQ),n.call(t,e)):void 0},d=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",f),t.req?d():t.on("request",d)):o&&!t._writableState&&(t.on("end",s),t.on("close",s)),t.on("end",l),t.on("finish",u),!1!==r.error&&t.on("error",h),t.on("close",f),function(){t.removeListener("complete",u),t.removeListener("abort",f),t.removeListener("request",d),t.req&&t.req.removeListener("finish",u),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",u),t.removeListener("end",l),t.removeListener("error",h),t.removeListener("close",f)}};function yQ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var bQ=Symbol("lastResolve"),wQ=Symbol("lastReject"),_Q=Symbol("error"),xQ=Symbol("ended"),SQ=Symbol("lastPromise"),EQ=Symbol("handlePromise"),kQ=Symbol("stream");function IQ(e,t){return{value:e,done:t}}function AQ(e){var t=e[bQ];if(null!==t){var r=e[kQ].read();null!==r&&(e[SQ]=null,e[bQ]=null,e[wQ]=null,t(IQ(r,!1)))}}function PQ(e){XU(AQ,e)}var TQ,OQ=Object.getPrototypeOf((function(){})),CQ=Object.setPrototypeOf((yQ(mQ={get stream(){return this[kQ]},next:function(){var e=this,t=this[_Q];if(null!==t)return Promise.reject(t);if(this[xQ])return Promise.resolve(IQ(void 0,!0));if(this[kQ].destroyed)return new Promise((function(t,r){XU((function(){e[_Q]?r(e[_Q]):t(IQ(void 0,!0))}))}));var r,n=this[SQ];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[xQ]?r(IQ(void 0,!0)):t[EQ](r,n)}),n)}}(n,this));else{var i=this[kQ].read();if(null!==i)return Promise.resolve(IQ(i,!1));r=new Promise(this[EQ])}return this[SQ]=r,r}},Symbol.asyncIterator,(function(){return this})),yQ(mQ,"return",(function(){var e=this;return new Promise((function(t,r){e[kQ].destroy(null,(function(e){e?r(e):t(IQ(void 0,!0))}))}))})),mQ),OQ),MQ=function(e){var t,r=Object.create(CQ,(yQ(t={},kQ,{value:e,writable:!0}),yQ(t,bQ,{value:null,writable:!0}),yQ(t,wQ,{value:null,writable:!0}),yQ(t,_Q,{value:null,writable:!0}),yQ(t,xQ,{value:e._readableState.endEmitted,writable:!0}),yQ(t,EQ,{value:function(e,t){var n=r[kQ].read();n?(r[SQ]=null,r[bQ]=null,r[wQ]=null,e(IQ(n,!1))):(r[bQ]=e,r[wQ]=t)},writable:!0}),t));return r[SQ]=null,vQ(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[wQ];return null!==t&&(r[SQ]=null,r[bQ]=null,r[wQ]=null,t(e)),void(r[_Q]=e)}var n=r[bQ];null!==n&&(r[SQ]=null,r[bQ]=null,r[wQ]=null,n(IQ(void 0,!0))),r[xQ]=!0})),e.on("readable",PQ.bind(null,r)),r},RQ=function(){throw new Error("Readable.from is not available in the browser")},NQ=YQ;YQ.ReadableState=XQ;var LQ,jQ=function(e,t){return e.listeners(t).length},DQ=BU.Buffer,BQ=CB.Uint8Array||function(){};LQ=QV&&QV.debuglog?QV.debuglog("stream"):function(){};var UQ,FQ,HQ,zQ=yY,VQ=mY.codes,qQ=VQ.ERR_INVALID_ARG_TYPE,KQ=VQ.ERR_STREAM_PUSH_AFTER_EOF,$Q=VQ.ERR_METHOD_NOT_IMPLEMENTED,WQ=VQ.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;YX(YQ,ZX);var JQ=fY,GQ=["error","close","destroy","pause","resume"];function XQ(e,t,r){TQ=TQ||JY,e=e||{},"boolean"!=typeof r&&(r=t instanceof TQ),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=zQ(this,e,"readableHighWaterMark",r),this.buffer=new sY,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(UQ||(UQ=dQ.StringDecoder),this.decoder=new UQ(e.encoding),this.encoding=e.encoding)}function YQ(e){if(TQ=TQ||JY,!(this instanceof YQ))return new YQ(e);var t=this instanceof TQ;this._readableState=new XQ(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),ZX.call(this)}function QQ(e,t,r,n,i){LQ("readableAddChunk",t);var o,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(LQ("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?tZ(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,rZ(e)))}}(e,s);else if(i||(o=function(e,t){var r,n;return n=t,DQ.isBuffer(n)||n instanceof BQ||"string"==typeof t||void 0===t||e.objectMode||(r=new qQ("chunk",["string","Buffer","Uint8Array"],t)),r}(s,t)),o)JQ(e,o);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===DQ.prototype||(t=function(e){return DQ.from(e)}(t)),n)s.endEmitted?JQ(e,new WQ):ZQ(e,s,t,!0);else if(s.ended)JQ(e,new KQ);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?ZQ(e,s,t,!1):nZ(e,s)):ZQ(e,s,t,!1)}else n||(s.reading=!1,nZ(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function ZQ(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&tZ(e)),nZ(e,t)}function eZ(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function tZ(e){var t=e._readableState;LQ("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(LQ("emitReadable",t.flowing),t.emittedReadable=!0,XU(rZ,e))}function rZ(e){var t=e._readableState;LQ("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,uZ(e)}function nZ(e,t){t.readingMore||(t.readingMore=!0,XU(iZ,e,t))}function iZ(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(LQ("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function oZ(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function sZ(e){LQ("readable nexttick read 0"),e.read(0)}function aZ(e,t){LQ("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),uZ(e),t.flowing&&!t.reading&&e.read(0)}function uZ(e){var t=e._readableState;for(LQ("flow",t.flowing);t.flowing&&null!==e.read(););}function cZ(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function lZ(e){var t=e._readableState;LQ("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,XU(hZ,t,e))}function hZ(e,t){if(LQ("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function fZ(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}Object.defineProperty(YQ.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),YQ.prototype.destroy=lY,YQ.prototype._undestroy=hY,YQ.prototype._destroy=function(e,t){t(e)},YQ.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=DQ.from(e,t),t=""),r=!0),QQ(this,e,t,!1,r)},YQ.prototype.unshift=function(e){return QQ(this,e,null,!0,!1)},YQ.prototype.isPaused=function(){return!1===this._readableState.flowing},YQ.prototype.setEncoding=function(e){UQ||(UQ=dQ.StringDecoder);var t=new UQ(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this},YQ.prototype.read=function(e){LQ("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return LQ("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?lZ(this):tZ(this),null;if(0===(e=eZ(e,t))&&t.ended)return 0===t.length&&lZ(this),null;var n,i=t.needReadable;return LQ("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&LQ("length less than watermark",i=!0),t.ended||t.reading?LQ("reading or ended",i=!1):i&&(LQ("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=eZ(r,t))),null===(n=e>0?cZ(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&lZ(this)),null!==n&&this.emit("data",n),n},YQ.prototype._read=function(e){JQ(this,new $Q("_read()"))},YQ.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,LQ("pipe count=%d opts=%j",n.pipesCount,t);var i=t&&!1===t.end||e===cF.stdout||e===cF.stderr?f:o;function o(){LQ("onend"),e.end()}n.endEmitted?XU(i):r.once("end",i),e.on("unpipe",(function t(i,d){LQ("onunpipe"),i===r&&d&&!1===d.hasUnpiped&&(d.hasUnpiped=!0,LQ("cleanup"),e.removeListener("close",l),e.removeListener("finish",h),e.removeListener("drain",s),e.removeListener("error",c),e.removeListener("unpipe",t),r.removeListener("end",o),r.removeListener("end",f),r.removeListener("data",u),a=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||s())}));var s=function(e){return function(){var t=e._readableState;LQ("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&jQ(e,"data")&&(t.flowing=!0,uZ(e))}}(r);e.on("drain",s);var a=!1;function u(t){LQ("ondata");var i=e.write(t);LQ("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==fZ(n.pipes,e))&&!a&&(LQ("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function c(t){LQ("onerror",t),f(),e.removeListener("error",c),0===jQ(e,"error")&&JQ(e,t)}function l(){e.removeListener("finish",h),f()}function h(){LQ("onfinish"),e.removeListener("close",l),f()}function f(){LQ("unpipe"),r.unpipe(e)}return r.on("data",u),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",c),e.once("close",l),e.once("finish",h),e.emit("pipe",r),n.flowing||(LQ("pipe resume"),r.resume()),e},YQ.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=fZ(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},YQ.prototype.on=function(e,t){var r=ZX.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,LQ("on readable",n.length,n.reading),n.length?tZ(this):n.reading||XU(sZ,this))),r},YQ.prototype.addListener=YQ.prototype.on,YQ.prototype.removeListener=function(e,t){var r=ZX.prototype.removeListener.call(this,e,t);return"readable"===e&&XU(oZ,this),r},YQ.prototype.removeAllListeners=function(e){var t=ZX.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||XU(oZ,this),t},YQ.prototype.resume=function(){var e=this._readableState;return e.flowing||(LQ("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,XU(aZ,e,t))}(this,e)),e.paused=!1,this},YQ.prototype.pause=function(){return LQ("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(LQ("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},YQ.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(LQ("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){LQ("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<GQ.length;o++)e.on(GQ[o],this.emit.bind(this,GQ[o]));return this._read=function(t){LQ("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(YQ.prototype[Symbol.asyncIterator]=function(){return void 0===FQ&&(FQ=MQ),FQ(this)}),Object.defineProperty(YQ.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(YQ.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(YQ.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),YQ._fromList=cZ,Object.defineProperty(YQ.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(YQ.from=function(e,t){return void 0===HQ&&(HQ=RQ),HQ(YQ,e,t)});var dZ=wZ,pZ=mY.codes,gZ=pZ.ERR_METHOD_NOT_IMPLEMENTED,mZ=pZ.ERR_MULTIPLE_CALLBACK,vZ=pZ.ERR_TRANSFORM_ALREADY_TRANSFORMING,yZ=pZ.ERR_TRANSFORM_WITH_LENGTH_0;function bZ(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new mZ);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function wZ(e){if(!(this instanceof wZ))return new wZ(e);JY.call(this,e),this._transformState={afterTransform:bZ.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",_Z)}function _Z(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?xZ(this,null,null):this._flush((function(t,r){xZ(e,t,r)}))}function xZ(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new yZ;if(e._transformState.transforming)throw new vZ;return e.push(null)}YX(wZ,JY),wZ.prototype.push=function(e,t){return this._transformState.needTransform=!1,JY.prototype.push.call(this,e,t)},wZ.prototype._transform=function(e,t,r){r(new gZ("_transform()"))},wZ.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},wZ.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},wZ.prototype._destroy=function(e,t){JY.prototype._destroy.call(this,e,(function(e){t(e)}))};var SZ,EZ=kZ;function kZ(e){if(!(this instanceof kZ))return new kZ(e);dZ.call(this,e)}YX(kZ,dZ),kZ.prototype._transform=function(e,t,r){r(null,e)};var IZ=mY.codes,AZ=IZ.ERR_MISSING_ARGS,PZ=IZ.ERR_STREAM_DESTROYED;function TZ(e){if(e)throw e}function OZ(e,t,r,n){n=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(n);var i=!1;e.on("close",(function(){i=!0})),void 0===SZ&&(SZ=vQ),SZ(e,{readable:t,writable:r},(function(e){if(e)return n(e);i=!0,n()}));var o=!1;return function(t){if(!i&&!o)return o=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void n(t||new PZ("pipe"))}}function CZ(e){e()}function MZ(e,t){return e.pipe(t)}function RZ(e){return e.length?"function"!=typeof e[e.length-1]?TZ:e.pop():TZ}var NZ=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=RZ(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new AZ("streams");var o=t.map((function(e,r){var s=r<t.length-1;return OZ(e,s,r>0,(function(e){n||(n=e),e&&o.forEach(CZ),s||(o.forEach(CZ),i(n))}))}));return t.reduce(MZ)},LZ=RB((function(e,t){(t=e.exports=NQ).Stream=t,t.Readable=t,t.Writable=_Y,t.Duplex=JY,t.Transform=dZ,t.PassThrough=EZ,t.finished=vQ,t.pipeline=NZ}));LZ.Stream,LZ.Readable,LZ.Writable,LZ.Duplex,LZ.Transform,LZ.PassThrough,LZ.finished,LZ.pipeline;var jZ=QX.Buffer,DZ=LZ.Transform;function BZ(e){DZ.call(this),this._block=jZ.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}YX(BZ,DZ),BZ.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},BZ.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},BZ.prototype.update=function(e,t){if(function(e,t){if(!jZ.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");jZ.isBuffer(e)||(e=jZ.from(e,t));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=e[n++];this._update(),this._blockOffset=0}for(;n<e.length;)r[this._blockOffset++]=e[n++];for(var o=0,s=8*e.length;s>0;++o)this._length[o]+=s,(s=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*s);return this},BZ.prototype._update=function(){throw new Error("_update is not implemented")},BZ.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},BZ.prototype._digest=function(){throw new Error("_digest is not implemented")};var UZ=BZ,FZ=QX.Buffer,HZ=new Array(16);function zZ(){UZ.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function VZ(e,t){return e<<t|e>>>32-t}function qZ(e,t,r,n,i,o,s){return VZ(e+(t&r|~t&n)+i+o|0,s)+t|0}function KZ(e,t,r,n,i,o,s){return VZ(e+(t&n|r&~n)+i+o|0,s)+t|0}function $Z(e,t,r,n,i,o,s){return VZ(e+(t^r^n)+i+o|0,s)+t|0}function WZ(e,t,r,n,i,o,s){return VZ(e+(r^(t|~n))+i+o|0,s)+t|0}YX(zZ,UZ),zZ.prototype._update=function(){for(var e=HZ,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=qZ(r,n,i,o,e[0],3614090360,7),o=qZ(o,r,n,i,e[1],3905402710,12),i=qZ(i,o,r,n,e[2],606105819,17),n=qZ(n,i,o,r,e[3],3250441966,22),r=qZ(r,n,i,o,e[4],4118548399,7),o=qZ(o,r,n,i,e[5],1200080426,12),i=qZ(i,o,r,n,e[6],2821735955,17),n=qZ(n,i,o,r,e[7],4249261313,22),r=qZ(r,n,i,o,e[8],1770035416,7),o=qZ(o,r,n,i,e[9],2336552879,12),i=qZ(i,o,r,n,e[10],4294925233,17),n=qZ(n,i,o,r,e[11],2304563134,22),r=qZ(r,n,i,o,e[12],1804603682,7),o=qZ(o,r,n,i,e[13],4254626195,12),i=qZ(i,o,r,n,e[14],2792965006,17),r=KZ(r,n=qZ(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=KZ(o,r,n,i,e[6],3225465664,9),i=KZ(i,o,r,n,e[11],643717713,14),n=KZ(n,i,o,r,e[0],3921069994,20),r=KZ(r,n,i,o,e[5],3593408605,5),o=KZ(o,r,n,i,e[10],38016083,9),i=KZ(i,o,r,n,e[15],3634488961,14),n=KZ(n,i,o,r,e[4],3889429448,20),r=KZ(r,n,i,o,e[9],568446438,5),o=KZ(o,r,n,i,e[14],3275163606,9),i=KZ(i,o,r,n,e[3],4107603335,14),n=KZ(n,i,o,r,e[8],1163531501,20),r=KZ(r,n,i,o,e[13],2850285829,5),o=KZ(o,r,n,i,e[2],4243563512,9),i=KZ(i,o,r,n,e[7],1735328473,14),r=$Z(r,n=KZ(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=$Z(o,r,n,i,e[8],2272392833,11),i=$Z(i,o,r,n,e[11],1839030562,16),n=$Z(n,i,o,r,e[14],4259657740,23),r=$Z(r,n,i,o,e[1],2763975236,4),o=$Z(o,r,n,i,e[4],1272893353,11),i=$Z(i,o,r,n,e[7],4139469664,16),n=$Z(n,i,o,r,e[10],3200236656,23),r=$Z(r,n,i,o,e[13],681279174,4),o=$Z(o,r,n,i,e[0],3936430074,11),i=$Z(i,o,r,n,e[3],3572445317,16),n=$Z(n,i,o,r,e[6],76029189,23),r=$Z(r,n,i,o,e[9],3654602809,4),o=$Z(o,r,n,i,e[12],3873151461,11),i=$Z(i,o,r,n,e[15],530742520,16),r=WZ(r,n=$Z(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=WZ(o,r,n,i,e[7],1126891415,10),i=WZ(i,o,r,n,e[14],2878612391,15),n=WZ(n,i,o,r,e[5],4237533241,21),r=WZ(r,n,i,o,e[12],1700485571,6),o=WZ(o,r,n,i,e[3],2399980690,10),i=WZ(i,o,r,n,e[10],4293915773,15),n=WZ(n,i,o,r,e[1],2240044497,21),r=WZ(r,n,i,o,e[8],1873313359,6),o=WZ(o,r,n,i,e[15],4264355552,10),i=WZ(i,o,r,n,e[6],2734768916,15),n=WZ(n,i,o,r,e[13],1309151649,21),r=WZ(r,n,i,o,e[4],4149444226,6),o=WZ(o,r,n,i,e[11],3174756917,10),i=WZ(i,o,r,n,e[2],718787259,15),n=WZ(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},zZ.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=FZ.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};var JZ=zZ,GZ=BU.Buffer,XZ=new Array(16),YZ=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],QZ=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],ZZ=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],e0=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],t0=[0,1518500249,1859775393,2400959708,2840853838],r0=[1352829926,1548603684,1836072691,2053994217,0];function n0(){UZ.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function i0(e,t){return e<<t|e>>>32-t}function o0(e,t,r,n,i,o,s,a){return i0(e+(t^r^n)+o+s|0,a)+i|0}function s0(e,t,r,n,i,o,s,a){return i0(e+(t&r|~t&n)+o+s|0,a)+i|0}function a0(e,t,r,n,i,o,s,a){return i0(e+((t|~r)^n)+o+s|0,a)+i|0}function u0(e,t,r,n,i,o,s,a){return i0(e+(t&n|r&~n)+o+s|0,a)+i|0}function c0(e,t,r,n,i,o,s,a){return i0(e+(t^(r|~n))+o+s|0,a)+i|0}YX(n0,UZ),n0.prototype._update=function(){for(var e=XZ,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,a=0|this._a,u=0|this._b,c=0|this._c,l=0|this._d,h=0|this._e,f=0;f<80;f+=1){var d,p;f<16?(d=o0(r,n,i,o,s,e[YZ[f]],t0[0],ZZ[f]),p=c0(a,u,c,l,h,e[QZ[f]],r0[0],e0[f])):f<32?(d=s0(r,n,i,o,s,e[YZ[f]],t0[1],ZZ[f]),p=u0(a,u,c,l,h,e[QZ[f]],r0[1],e0[f])):f<48?(d=a0(r,n,i,o,s,e[YZ[f]],t0[2],ZZ[f]),p=a0(a,u,c,l,h,e[QZ[f]],r0[2],e0[f])):f<64?(d=u0(r,n,i,o,s,e[YZ[f]],t0[3],ZZ[f]),p=s0(a,u,c,l,h,e[QZ[f]],r0[3],e0[f])):(d=c0(r,n,i,o,s,e[YZ[f]],t0[4],ZZ[f]),p=o0(a,u,c,l,h,e[QZ[f]],r0[4],e0[f])),r=s,s=o,o=i0(i,10),i=n,n=d,a=h,h=l,l=i0(c,10),c=u,u=p}var g=this._b+i+l|0;this._b=this._c+o+h|0,this._c=this._d+s+a|0,this._d=this._e+r+u|0,this._e=this._a+n+c|0,this._a=g},n0.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=GZ.alloc?GZ.alloc(20):new GZ(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e};var l0=n0,h0=QX.Buffer;function f0(e,t){this._block=h0.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}f0.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=h0.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,o=this._len,s=0;s<i;){for(var a=o%n,u=Math.min(i-s,n-a),c=0;c<u;c++)r[a+c]=e[s+c];s+=u,(o+=u)%n==0&&this._update(r)}return this._len+=i,this},f0.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},f0.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var d0=f0,p0=QX.Buffer,g0=[1518500249,1859775393,-1894007588,-899497514],m0=new Array(80);function v0(){this.init(),this._w=m0,d0.call(this,64,56)}function y0(e){return e<<30|e>>>2}function b0(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}YX(v0,d0),v0.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},v0.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,u=0;u<16;++u)r[u]=e.readInt32BE(4*u);for(;u<80;++u)r[u]=r[u-3]^r[u-8]^r[u-14]^r[u-16];for(var c=0;c<80;++c){var l=~~(c/20),h=0|((t=n)<<5|t>>>27)+b0(l,i,o,s)+a+r[c]+g0[l];a=s,s=o,o=y0(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},v0.prototype._hash=function(){var e=p0.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var w0=v0,_0=QX.Buffer,x0=[1518500249,1859775393,-1894007588,-899497514],S0=new Array(80);function E0(){this.init(),this._w=S0,d0.call(this,64,56)}function k0(e){return e<<5|e>>>27}function I0(e){return e<<30|e>>>2}function A0(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}YX(E0,d0),E0.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},E0.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,a=0|this._e,u=0;u<16;++u)r[u]=e.readInt32BE(4*u);for(;u<80;++u)r[u]=(t=r[u-3]^r[u-8]^r[u-14]^r[u-16])<<1|t>>>31;for(var c=0;c<80;++c){var l=~~(c/20),h=k0(n)+A0(l,i,o,s)+a+r[c]+x0[l]|0;a=s,s=o,o=I0(i),i=n,n=h}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},E0.prototype._hash=function(){var e=_0.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e};var P0=E0,T0=QX.Buffer,O0=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],C0=new Array(64);function M0(){this.init(),this._w=C0,d0.call(this,64,56)}function R0(e,t,r){return r^e&(t^r)}function N0(e,t,r){return e&t|r&(e|t)}function L0(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function j0(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function D0(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function B0(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}YX(M0,d0),M0.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},M0.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,a=0|this._f,u=0|this._g,c=0|this._h,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<64;++l)t[l]=B0(t[l-2])+t[l-7]+D0(t[l-15])+t[l-16]|0;for(var h=0;h<64;++h){var f=c+j0(s)+R0(s,a,u)+O0[h]+t[h]|0,d=L0(r)+N0(r,n,i)|0;c=u,u=a,a=s,s=o+f|0,o=i,i=n,n=r,r=f+d|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=a+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0},M0.prototype._hash=function(){var e=T0.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var U0=M0,F0=QX.Buffer,H0=new Array(64);function z0(){this.init(),this._w=H0,d0.call(this,64,56)}YX(z0,U0),z0.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},z0.prototype._hash=function(){var e=F0.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var V0=z0,q0=QX.Buffer,K0=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],$0=new Array(160);function W0(){this.init(),this._w=$0,d0.call(this,128,112)}function J0(e,t,r){return r^e&(t^r)}function G0(e,t,r){return e&t|r&(e|t)}function X0(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Y0(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Q0(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Z0(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function e1(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function t1(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function r1(e,t){return e>>>0<t>>>0?1:0}YX(W0,d0),W0.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},W0.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,a=0|this._fh,u=0|this._gh,c=0|this._hh,l=0|this._al,h=0|this._bl,f=0|this._cl,d=0|this._dl,p=0|this._el,g=0|this._fl,m=0|this._gl,v=0|this._hl,y=0;y<32;y+=2)t[y]=e.readInt32BE(4*y),t[y+1]=e.readInt32BE(4*y+4);for(;y<160;y+=2){var b=t[y-30],w=t[y-30+1],_=Q0(b,w),x=Z0(w,b),S=e1(b=t[y-4],w=t[y-4+1]),E=t1(w,b),k=t[y-14],I=t[y-14+1],A=t[y-32],P=t[y-32+1],T=x+I|0,O=_+k+r1(T,x)|0;O=(O=O+S+r1(T=T+E|0,E)|0)+A+r1(T=T+P|0,P)|0,t[y]=O,t[y+1]=T}for(var C=0;C<160;C+=2){O=t[C],T=t[C+1];var M=G0(r,n,i),R=G0(l,h,f),N=X0(r,l),L=X0(l,r),j=Y0(s,p),D=Y0(p,s),B=K0[C],U=K0[C+1],F=J0(s,a,u),H=J0(p,g,m),z=v+D|0,V=c+j+r1(z,v)|0;V=(V=(V=V+F+r1(z=z+H|0,H)|0)+B+r1(z=z+U|0,U)|0)+O+r1(z=z+T|0,T)|0;var q=L+R|0,K=N+M+r1(q,L)|0;c=u,v=m,u=a,m=g,a=s,g=p,s=o+V+r1(p=d+z|0,d)|0,o=i,d=f,i=n,f=h,n=r,h=l,r=V+K+r1(l=z+q|0,z)|0}this._al=this._al+l|0,this._bl=this._bl+h|0,this._cl=this._cl+f|0,this._dl=this._dl+d|0,this._el=this._el+p|0,this._fl=this._fl+g|0,this._gl=this._gl+m|0,this._hl=this._hl+v|0,this._ah=this._ah+r+r1(this._al,l)|0,this._bh=this._bh+n+r1(this._bl,h)|0,this._ch=this._ch+i+r1(this._cl,f)|0,this._dh=this._dh+o+r1(this._dl,d)|0,this._eh=this._eh+s+r1(this._el,p)|0,this._fh=this._fh+a+r1(this._fl,g)|0,this._gh=this._gh+u+r1(this._gl,m)|0,this._hh=this._hh+c+r1(this._hl,v)|0},W0.prototype._hash=function(){var e=q0.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var n1=W0,i1=QX.Buffer,o1=new Array(160);function s1(){this.init(),this._w=o1,d0.call(this,128,112)}YX(s1,n1),s1.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},s1.prototype._hash=function(){var e=i1.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var a1=s1,u1=RB((function(e){var t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};t.sha=w0,t.sha1=P0,t.sha224=V0,t.sha256=U0,t.sha384=a1,t.sha512=n1})),c1=QX.Buffer,l1=Az.Transform,h1=qH.StringDecoder;function f1(e){l1.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}YX(f1,l1),f1.prototype.update=function(e,t,r){"string"==typeof e&&(e=c1.from(e,t));var n=this._update(e);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},f1.prototype.setAutoPadding=function(){},f1.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},f1.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},f1.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},f1.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},f1.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},f1.prototype._finalOrDigest=function(e){var t=this.__final()||c1.alloc(0);return e&&(t=this._toString(t,e,!0)),t},f1.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new h1(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n};var d1=f1;function p1(e){d1.call(this,"digest"),this._hash=e}YX(p1,d1),p1.prototype._update=function(e){this._hash.update(e)},p1.prototype._final=function(){return this._hash.digest()};var g1=function(e){return"md5"===(e=e.toLowerCase())?new JZ:"rmd160"===e||"ripemd160"===e?new l0:new p1(u1(e))},m1=QX.Buffer,v1=m1.alloc(128);function y1(e,t){d1.call(this,"digest"),"string"==typeof t&&(t=m1.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=m1.concat([t,v1],64));for(var r=this._ipad=m1.allocUnsafe(64),n=this._opad=m1.allocUnsafe(64),i=0;i<64;i++)r[i]=54^t[i],n[i]=92^t[i];this._hash=[r]}YX(y1,d1),y1.prototype._update=function(e){this._hash.push(e)},y1.prototype._final=function(){var e=this._alg(m1.concat(this._hash));return this._alg(m1.concat([this._opad,e]))};var b1=y1,w1=function(e){return(new JZ).update(e).digest()},_1=QX.Buffer,x1=_1.alloc(128);function S1(e,t){d1.call(this,"digest"),"string"==typeof t&&(t=_1.from(t));var r="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>r?t=("rmd160"===e?new l0:u1(e)).update(t).digest():t.length<r&&(t=_1.concat([t,x1],r));for(var n=this._ipad=_1.allocUnsafe(r),i=this._opad=_1.allocUnsafe(r),o=0;o<r;o++)n[o]=54^t[o],i[o]=92^t[o];this._hash="rmd160"===e?new l0:u1(e),this._hash.update(n)}YX(S1,d1),S1.prototype._update=function(e){this._hash.update(e)},S1.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new l0:u1(this._alg)).update(this._opad).update(e).digest()};var E1=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new S1("rmd160",t):"md5"===e?new b1(w1,t):new S1(e,t)},k1=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.hash160=function(e){const t=g1("sha256").update(e).digest();try{return g1("rmd160").update(t).digest()}catch(e){return g1("ripemd160").update(t).digest()}},t.hmacSHA512=function(e,t){return E1("sha512",e).update(t).digest()}}));MB(k1),k1.hash160,k1.hmacSHA512;var I1=QX.Buffer,A1=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}var s=e.length,a=e.charAt(0),u=Math.log(s)/Math.log(256),c=Math.log(256)/Math.log(s);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return I1.alloc(0);var r=0;if(" "!==e[r]){for(var n=0,i=0;e[r]===a;)n++,r++;for(var o=(e.length-r)*u+1>>>0,c=new Uint8Array(o);e[r];){var l=t[e.charCodeAt(r)];if(255===l)return;for(var h=0,f=o-1;(0!==l||h<i)&&-1!==f;f--,h++)l+=s*c[f]>>>0,c[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=h,r++}if(" "!==e[r]){for(var d=o-i;d!==o&&0===c[d];)d++;var p=I1.allocUnsafe(n+(o-d));p.fill(0,0,n);for(var g=n;d!==o;)p[g++]=c[d++];return p}}}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=I1.from(t)),!I1.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var u=(o-i)*c+1>>>0,l=new Uint8Array(u);i!==o;){for(var h=t[i],f=0,d=u-1;(0!==h||f<n)&&-1!==d;d--,f++)h+=256*l[d]>>>0,l[d]=h%s>>>0,h=h/s>>>0;if(0!==h)throw new Error("Non-zero carry");n=f,i++}for(var p=u-n;p!==u&&0===l[p];)p++;for(var g=a.repeat(r);p<u;++p)g+=e.charAt(l[p]);return g},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),P1=QX.Buffer,T1=function(e){function t(t){var r=t.slice(0,-4),n=t.slice(-4),i=e(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(t){var r=e(t);return A1.encode(P1.concat([t,r],t.length+4))},decode:function(e){var r=t(A1.decode(e));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(e){var r=A1.decodeUnsafe(e);if(r)return t(r)}}}((function(e){var t=g1("sha256").update(e).digest();return g1("sha256").update(t).digest()})),O1=RB((function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:QV.Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))},i.prototype._initNumber=function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===n)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=a(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=a(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l<a;l+=n)c=u(e,l,l+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var h=1;for(c=u(e,l,e.length,t),l=0;l<s;l++)h*=t;this.imuln(h),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c<n;c++){for(var l=u>>>26,h=67108863&u,f=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=f;d++){var p=c-d|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[d])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}i.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);n=0!=(o=a>>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+n:u+n,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var f=l[e],d=h[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(e);n=(p=p.idivn(d)).isZero()?g+n:c[f-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,c=new e(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[a]=s;for(;a<o;a++)c[a]=0}else{for(a=0;a<o-i;a++)c[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),c[o-a-1]=s}return c},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return r(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return r(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var d=function(e,t,r){var n,i,o,s=e.words,a=t.words,u=r.words,c=0,l=0|s[0],h=8191&l,f=l>>>13,d=0|s[1],p=8191&d,g=d>>>13,m=0|s[2],v=8191&m,y=m>>>13,b=0|s[3],w=8191&b,_=b>>>13,x=0|s[4],S=8191&x,E=x>>>13,k=0|s[5],I=8191&k,A=k>>>13,P=0|s[6],T=8191&P,O=P>>>13,C=0|s[7],M=8191&C,R=C>>>13,N=0|s[8],L=8191&N,j=N>>>13,D=0|s[9],B=8191&D,U=D>>>13,F=0|a[0],H=8191&F,z=F>>>13,V=0|a[1],q=8191&V,K=V>>>13,$=0|a[2],W=8191&$,J=$>>>13,G=0|a[3],X=8191&G,Y=G>>>13,Q=0|a[4],Z=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,ce=ae>>>13,le=0|a[8],he=8191&le,fe=le>>>13,de=0|a[9],pe=8191&de,ge=de>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(h,H))|0)+((8191&(i=(i=Math.imul(h,z))+Math.imul(f,H)|0))<<13)|0;c=((o=Math.imul(f,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,H),i=(i=Math.imul(p,z))+Math.imul(g,H)|0,o=Math.imul(g,z);var ve=(c+(n=n+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(f,q)|0))<<13)|0;c=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,H),i=(i=Math.imul(v,z))+Math.imul(y,H)|0,o=Math.imul(y,z),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,K)|0;var ye=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,J)|0)+Math.imul(f,W)|0))<<13)|0;c=((o=o+Math.imul(f,J)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(w,H),i=(i=Math.imul(w,z))+Math.imul(_,H)|0,o=Math.imul(_,z),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,K)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,J)|0;var be=(c+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(f,X)|0))<<13)|0;c=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(S,H),i=(i=Math.imul(S,z))+Math.imul(E,H)|0,o=Math.imul(E,z),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,J)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,J)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,Y)|0;var we=(c+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(f,Z)|0))<<13)|0;c=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,H),i=(i=Math.imul(I,z))+Math.imul(A,H)|0,o=Math.imul(A,z),n=n+Math.imul(S,q)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,K)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,J)|0,n=n+Math.imul(v,X)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(y,X)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,ee)|0;var _e=(c+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(f,re)|0))<<13)|0;c=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(T,H),i=(i=Math.imul(T,z))+Math.imul(O,H)|0,o=Math.imul(O,z),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,J)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(v,Z)|0,i=(i=i+Math.imul(v,ee)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0;var xe=(c+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(f,oe)|0))<<13)|0;c=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(M,H),i=(i=Math.imul(M,z))+Math.imul(R,H)|0,o=Math.imul(R,z),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,J)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(v,re)|0,i=(i=i+Math.imul(v,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,se)|0;var Se=(c+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,ce)|0)+Math.imul(f,ue)|0))<<13)|0;c=((o=o+Math.imul(f,ce)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,H),i=(i=Math.imul(L,z))+Math.imul(j,H)|0,o=Math.imul(j,z),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,J)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(v,oe)|0,i=(i=i+Math.imul(v,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0;var Ee=(c+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,fe)|0)+Math.imul(f,he)|0))<<13)|0;c=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(B,H),i=(i=Math.imul(B,z))+Math.imul(U,H)|0,o=Math.imul(U,z),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,J)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,se)|0,n=n+Math.imul(v,ue)|0,i=(i=i+Math.imul(v,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(g,he)|0,o=o+Math.imul(g,fe)|0;var ke=(c+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ge)|0)+Math.imul(f,pe)|0))<<13)|0;c=((o=o+Math.imul(f,ge)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,K))+Math.imul(U,q)|0,o=Math.imul(U,K),n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,J)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,J)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(R,X)|0,o=o+Math.imul(R,Y)|0,n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(v,he)|0,i=(i=i+Math.imul(v,fe)|0)+Math.imul(y,he)|0,o=o+Math.imul(y,fe)|0;var Ie=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;c=((o=o+Math.imul(g,ge)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,J))+Math.imul(U,W)|0,o=Math.imul(U,J),n=n+Math.imul(L,X)|0,i=(i=i+Math.imul(L,Y)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,se)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,ce)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,ce)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,he)|0,o=o+Math.imul(_,fe)|0;var Ae=(c+(n=n+Math.imul(v,pe)|0)|0)+((8191&(i=(i=i+Math.imul(v,ge)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ge)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,X),i=(i=Math.imul(B,Y))+Math.imul(U,X)|0,o=Math.imul(U,Y),n=n+Math.imul(L,Z)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,ce)|0,n=n+Math.imul(S,he)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(E,he)|0,o=o+Math.imul(E,fe)|0;var Pe=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ge)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,ge)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,ee))+Math.imul(U,Z)|0,o=Math.imul(U,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,fe)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,fe)|0;var Te=(c+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ge)|0)+Math.imul(E,pe)|0))<<13)|0;c=((o=o+Math.imul(E,ge)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,re),i=(i=Math.imul(B,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,se)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,se)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,n=n+Math.imul(T,he)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(O,he)|0,o=o+Math.imul(O,fe)|0;var Oe=(c+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ge)|0)+Math.imul(A,pe)|0))<<13)|0;c=((o=o+Math.imul(A,ge)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(B,oe),i=(i=Math.imul(B,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(L,ue)|0,i=(i=i+Math.imul(L,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,fe)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,fe)|0;var Ce=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ge)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ge)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,ue),i=(i=Math.imul(B,ce))+Math.imul(U,ue)|0,o=Math.imul(U,ce),n=n+Math.imul(L,he)|0,i=(i=i+Math.imul(L,fe)|0)+Math.imul(j,he)|0,o=o+Math.imul(j,fe)|0;var Me=(c+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,ge)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,ge)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,he),i=(i=Math.imul(B,fe))+Math.imul(U,he)|0,o=Math.imul(U,fe);var Re=(c+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,ge)|0)+Math.imul(j,pe)|0))<<13)|0;c=((o=o+Math.imul(j,ge)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(c+(n=Math.imul(B,pe))|0)+((8191&(i=(i=Math.imul(B,ge))+Math.imul(U,pe)|0))<<13)|0;return c=((o=Math.imul(U,ge))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=me,u[1]=ve,u[2]=ye,u[3]=be,u[4]=we,u[5]=_e,u[6]=xe,u[7]=Se,u[8]=Ee,u[9]=ke,u[10]=Ie,u[11]=Ae,u[12]=Pe,u[13]=Te,u[14]=Oe,u[15]=Ce,u[16]=Me,u[17]=Re,u[18]=Ne,0!==c&&(u[19]=c,r.length++),r};function p(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(d=f),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,h=(0|e.words[l])*(0|t.words[c]),f=67108863&h;a=67108863&(f=f+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),c=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var h=u,f=c,d=0;d<s;d++){var p=r[l+d],g=n[l+d],m=r[l+d+s],v=n[l+d+s],y=h*m-f*v;v=h*v+f*m,m=y,r[l+d]=p+m,n[l+d]=g+v,r[l+d+s]=p-m,n[l+d+s]=g-v,d!==a&&(y=u*h-c*f,f=u*f+c*h,h=y)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,n,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],n[2*s]=8191&o,o>>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)n[s]=0;r(0===o),r(0==(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),h=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,c,n),this.transform(s,o,a,u,n,i),this.transform(c,o,l,h,n,i);for(var d=0;d<n;d++){var p=a[d]*l[d]-u[d]*h[d];u[d]=a[d]*h[d]+u[d]*l[d],a[d]=p}return this.conjugate(a,u,n),this.transform(a,u,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),p(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,u=(0|this.words[t])-a<<n;this.words[t]=u|s,s=a>>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},i.prototype.ishln=function(e){return r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,u=n;if(i-=s,i=Math.max(0,i),u){for(var c=0;c<s;c++)u.words[c]=this.words[c];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,c=0;c<this.length;c++)this.words[c]=this.words[c+s];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n||!(this.words[n]&i))},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,n){var i,o,s=e.length+n;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+n])+a;var u=(0|e.words[i])*t;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)a=(o=(0|this.words[i+n])+a)>>26,this.words[i+n]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var a,u=n.length-o.length;if("mod"!==t){(a=new i(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c<a.length;c++)a.words[c]=0}var l=n.clone()._ishlnsubmul(o,1,u);0===l.negative&&(n=l,a&&(a.words[u]=1));for(var h=u-1;h>=0;h--){var f=67108864*(0|n.words[o.length+h])+(0|n.words[o.length+h-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(o,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(o,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n},i.prototype.idivn=function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),s=new i(0),a=new i(0),u=new i(1),c=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++c;for(var l=n.clone(),h=t.clone();!t.isZero();){for(var f=0,d=1;0==(t.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(l),s.isub(h)),o.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(n.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(a),s.isub(u)):(n.isub(t),a.isub(o),u.isub(s))}return{a:a,b:u,gcd:n.iushln(c)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new i(1),a=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,l=1;0==(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0==(n.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(n.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,s=n;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new x(e)},i.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(y,v),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(b,v),n(w,v),n(_,v),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new b;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return m[e]=t,t},x.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},x.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},x.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},x.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},x.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},x.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},x.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},x.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},x.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},x.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},x.prototype.isqr=function(e){return this.imul(e,e.clone())},x.prototype.sqr=function(e){return this.mul(e,e)},x.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,o),f=this.pow(e,o.addn(1).iushrn(1)),d=this.pow(e,o),p=s;0!==d.cmp(a);){for(var g=d,m=0;0!==g.cmp(a);m++)g=g.redSqr();r(m<p);var v=this.pow(h,new i(1).iushln(p-m-1));f=f.redMul(v),h=v.redSqr(),d=d.redMul(h),p=m}return f},x.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},x.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],s=0,a=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var h=c>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===l)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}u=26}return o},x.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},x.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new S(e)},n(S,x),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,CB)})),C1="lib/elliptic.js",M1=["lib"],R1={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},N1={type:"git",url:"git@github.com:indutny/elliptic"},L1=["EC","Elliptic","curve","Cryptography"],j1="Fedor Indutny <fedor@indutny.com>",D1={url:"https://github.com/indutny/elliptic/issues"},B1="https://github.com/indutny/elliptic",U1={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},F1={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},H1={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:C1,files:M1,scripts:R1,repository:N1,keywords:L1,author:j1,license:"MIT",bugs:D1,homepage:B1,devDependencies:U1,dependencies:F1},z1=Object.freeze({__proto__:null,name:"elliptic",version:"6.5.4",description:"EC cryptography",main:C1,files:M1,scripts:R1,repository:N1,keywords:L1,author:j1,license:"MIT",bugs:D1,homepage:B1,devDependencies:U1,dependencies:F1,default:H1}),V1=q1;function q1(e,t){if(!e)throw new Error(t||"Assertion failed")}q1.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var K1,$1=RB((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),W1=RB((function(e,t){var r=t;r.assert=V1,r.toArray=$1.toArray,r.zero2=$1.zero2,r.toHex=$1.toHex,r.encode=$1.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),s=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(s),a=0==(1&c)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new O1(e,"hex","le")}})),J1=function(e){return K1||(K1=new G1(null)),K1.generate(e)};function G1(e){this.rand=e}var X1=G1;if(G1.prototype.generate=function(e){return this._rand(e)},G1.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?G1.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?G1.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(G1.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var Y1=QV;if("function"!=typeof Y1.randomBytes)throw new Error("Not supported");G1.prototype._rand=function(e){return Y1.randomBytes(e)}}catch(oB){}J1.Rand=X1;var Q1=W1.getNAF,Z1=W1.getJSF,e2=W1.assert;function t2(e,t){this.type=e,this.p=new O1(t.p,16),this.red=t.prime?O1.red(t.prime):O1.mont(this.p),this.zero=new O1(0).toRed(this.red),this.one=new O1(1).toRed(this.red),this.two=new O1(2).toRed(this.red),this.n=t.n&&new O1(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var r2=t2;function n2(e,t){this.curve=e,this.type=t,this.precomputed=null}t2.prototype.point=function(){throw new Error("Not implemented")},t2.prototype.validate=function(){throw new Error("Not implemented")},t2.prototype._fixedNafMul=function(e,t){e2(e.precomputed);var r=e._getDoubles(),n=Q1(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,s,a=[];for(o=0;o<n.length;o+=r.step){s=0;for(var u=o+r.step-1;u>=o;u--)s=(s<<1)+n[u];a.push(s)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),h=i;h>0;h--){for(o=0;o<a.length;o++)(s=a[o])===h?l=l.mixedAdd(r.points[o]):s===-h&&(l=l.mixedAdd(r.points[o].neg()));c=c.add(l)}return c.toP()},t2.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=Q1(t,r,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;a>=0;a--){for(var u=0;a>=0&&0===o[a];a--)u++;if(a>=0&&u++,s=s.dblp(u),a<0)break;var c=o[a];e2(0!==c),s="affine"===e.type?c>0?s.mixedAdd(i[c-1>>1]):s.mixedAdd(i[-c-1>>1].neg()):c>0?s.add(i[c-1>>1]):s.add(i[-c-1>>1].neg())}return"affine"===e.type?s.toP():s},t2.prototype._wnafMulAdd=function(e,t,r,n,i){var o,s,a,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,h=0;for(o=0;o<n;o++){var f=(a=t[o])._getNAFPoints(e);u[o]=f.wnd,c[o]=f.points}for(o=n-1;o>=1;o-=2){var d=o-1,p=o;if(1===u[d]&&1===u[p]){var g=[t[d],null,null,t[p]];0===t[d].y.cmp(t[p].y)?(g[1]=t[d].add(t[p]),g[2]=t[d].toJ().mixedAdd(t[p].neg())):0===t[d].y.cmp(t[p].y.redNeg())?(g[1]=t[d].toJ().mixedAdd(t[p]),g[2]=t[d].add(t[p].neg())):(g[1]=t[d].toJ().mixedAdd(t[p]),g[2]=t[d].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],v=Z1(r[d],r[p]);for(h=Math.max(v[0].length,h),l[d]=new Array(h),l[p]=new Array(h),s=0;s<h;s++){var y=0|v[0][s],b=0|v[1][s];l[d][s]=m[3*(y+1)+(b+1)],l[p][s]=0,c[d]=g}}else l[d]=Q1(r[d],u[d],this._bitLength),l[p]=Q1(r[p],u[p],this._bitLength),h=Math.max(l[d].length,h),h=Math.max(l[p].length,h)}var w=this.jpoint(null,null,null),_=this._wnafT4;for(o=h;o>=0;o--){for(var x=0;o>=0;){var S=!0;for(s=0;s<n;s++)_[s]=0|l[s][o],0!==_[s]&&(S=!1);if(!S)break;x++,o--}if(o>=0&&x++,w=w.dblp(x),o<0)break;for(s=0;s<n;s++){var E=_[s];0!==E&&(E>0?a=c[s][E-1>>1]:E<0&&(a=c[s][-E-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(o=0;o<n;o++)c[o]=null;return i?w:w.toP()},t2.BasePoint=n2,n2.prototype.eq=function(){throw new Error("Not implemented")},n2.prototype.validate=function(){return this.curve.validate(this)},t2.prototype.decodePoint=function(e,t){e=W1.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?e2(e[e.length-1]%2==0):7===e[0]&&e2(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},n2.prototype.encodeCompressed=function(e){return this.encode(e,!0)},n2.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},n2.prototype.encode=function(e,t){return W1.encode(this._encode(t),e)},n2.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},n2.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},n2.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},n2.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},n2.prototype._getBeta=function(){return null},n2.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var i2=W1.assert;function o2(e){r2.call(this,"short",e),this.a=new O1(e.a,16).toRed(this.red),this.b=new O1(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}YX(o2,r2);var s2=o2;function a2(e,t,r,n){r2.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new O1(t,16),this.y=new O1(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u2(e,t,r,n){r2.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new O1(0)):(this.x=new O1(t,16),this.y=new O1(r,16),this.z=new O1(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}function c2(e){r2.call(this,"mont",e),this.a=new O1(e.a,16).toRed(this.red),this.b=new O1(e.b,16).toRed(this.red),this.i4=new O1(4).toRed(this.red).redInvm(),this.two=new O1(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}o2.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new O1(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new O1(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],i2(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new O1(e.a,16),b:new O1(e.b,16)}})):this._getEndoBasis(r)}}},o2.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:O1.mont(e),r=new O1(2).toRed(t).redInvm(),n=r.redNeg(),i=new O1(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},o2.prototype._getEndoBasis=function(e){for(var t,r,n,i,o,s,a,u,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,f=this.n.clone(),d=new O1(1),p=new O1(0),g=new O1(0),m=new O1(1),v=0;0!==h.cmpn(0);){var y=f.div(h);u=f.sub(y.mul(h)),c=g.sub(y.mul(d));var b=m.sub(y.mul(p));if(!n&&u.cmp(l)<0)t=a.neg(),r=d,n=u.neg(),i=c;else if(n&&2==++v)break;a=u,f=h,h=u,g=d,d=c,m=p,p=b}o=u.neg(),s=c;var w=n.sqr().add(i.sqr());return o.sqr().add(s.sqr()).cmp(w)>=0&&(o=t,s=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:n,b:i},{a:o,b:s}]},o2.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:u.add(c).neg()}},o2.prototype.pointFromX=function(e,t){(e=new O1(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},o2.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},o2.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return c},YX(a2,r2.BasePoint),o2.prototype.point=function(e,t,r){return new a2(this,e,t,r)},o2.prototype.pointFromJSON=function(e,t){return a2.fromJSON(this,e,t)},a2.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},a2.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},a2.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},a2.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},a2.prototype.isInfinity=function(){return this.inf},a2.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},a2.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},a2.prototype.getX=function(){return this.x.fromRed()},a2.prototype.getY=function(){return this.y.fromRed()},a2.prototype.mul=function(e){return e=new O1(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},a2.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},a2.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},a2.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},a2.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},a2.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},YX(u2,r2.BasePoint),o2.prototype.jpoint=function(e,t,r){return new u2(this,e,t,r)},u2.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},u2.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u2.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),l=c.redMul(a),h=n.redMul(c),f=u.redSqr().redIAdd(l).redISub(h).redISub(h),d=u.redMul(h.redISub(f)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,d,p)},u2.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),c=u.redMul(s),l=r.redMul(u),h=a.redSqr().redIAdd(c).redISub(l).redISub(l),f=a.redMul(l.redISub(h)).redISub(i.redMul(c)),d=this.z.redMul(s);return this.curve.jpoint(h,f,d)},u2.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),c=s.redAdd(s);for(t=0;t<e;t++){var l=o.redSqr(),h=c.redSqr(),f=h.redSqr(),d=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(u)),p=o.redMul(h),g=d.redSqr().redISub(p.redAdd(p)),m=p.redISub(g),v=d.redMul(m);v=v.redIAdd(v).redISub(f);var y=c.redMul(a);t+1<e&&(u=u.redMul(f)),o=g,a=y,c=v}return this.curve.jpoint(o,c.redMul(i),a)},u2.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},u2.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),h=this.y.redSqr(),f=h.redSqr(),d=this.x.redAdd(h).redSqr().redISub(l).redISub(f);d=d.redIAdd(d);var p=l.redAdd(l).redIAdd(l),g=p.redSqr(),m=f.redIAdd(f);m=(m=m.redIAdd(m)).redIAdd(m),e=g.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},u2.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=a.redMul(s.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),h=this.y.redSqr(),f=this.x.redMul(h),d=this.x.redSub(l).redMul(this.x.redAdd(l));d=d.redAdd(d).redIAdd(d);var p=f.redIAdd(f),g=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(g),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(l);var m=h.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=d.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},u2.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(s),l=a.redSqr().redISub(c.redAdd(c)),h=c.redISub(l),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=a.redMul(h).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,d,p)},u2.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),l=t.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var h=this.x.redMul(a).redISub(l);h=(h=h.redIAdd(h)).redIAdd(h);var f=this.y.redMul(c.redMul(u.redISub(c)).redISub(s.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var d=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(h,f,d)},u2.prototype.mul=function(e,t){return e=new O1(e,t),this.curve._wnafMul(this,e)},u2.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},u2.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},u2.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},u2.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},YX(c2,r2);var l2=c2;function h2(e,t,r){r2.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new O1(t,16),this.z=new O1(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}c2.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},YX(h2,r2.BasePoint),c2.prototype.decodePoint=function(e,t){return this.point(W1.toArray(e,t),1)},c2.prototype.point=function(e,t){return new h2(this,e,t)},c2.prototype.pointFromJSON=function(e){return h2.fromJSON(this,e)},h2.prototype.precompute=function(){},h2.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},h2.fromJSON=function(e,t){return new h2(e,t[0],t[1]||e.one)},h2.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},h2.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},h2.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},h2.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},h2.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),u=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},h2.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},h2.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},h2.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},h2.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},h2.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},h2.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var f2=W1.assert;function d2(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,r2.call(this,"edwards",e),this.a=new O1(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new O1(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new O1(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),f2(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}YX(d2,r2);var p2=d2;function g2(e,t,r,n,i){r2.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new O1(t,16),this.y=new O1(r,16),this.z=n?new O1(n,16):this.curve.one,this.t=i&&new O1(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}d2.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},d2.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},d2.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},d2.prototype.pointFromX=function(e,t){(e=new O1(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var a=s.fromRed().isOdd();return(t&&!a||!t&&a)&&(s=s.redNeg()),this.point(e,s)},d2.prototype.pointFromY=function(e,t){(e=new O1(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=o.redSqrt();if(0!==s.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},d2.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},YX(g2,r2.BasePoint),d2.prototype.pointFromJSON=function(e){return g2.fromJSON(this,e)},d2.prototype.point=function(e,t,r,n){return new g2(this,e,t,r,n)},g2.fromJSON=function(e,t){return new g2(e,t[0],t[1],t[2])},g2.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},g2.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},g2.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),u=i.redMul(s),c=o.redMul(a),l=i.redMul(a),h=s.redMul(o);return this.curve.point(u,c,h,l)},g2.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(a)).redAdd(u);this.zOne?(e=s.redSub(a).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=s.redSub(a).redISub(u).redMul(o),t=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=a.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},g2.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},g2.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),u=r.redAdd(t),c=o.redMul(s),l=a.redMul(u),h=o.redMul(u),f=s.redMul(a);return this.curve.point(c,l,f,h)},g2.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),c=i.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),h=n.redMul(u).redMul(l);return this.curve.twisted?(t=n.redMul(c).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(h,t,r)},g2.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},g2.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},g2.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},g2.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},g2.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},g2.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},g2.prototype.getX=function(){return this.normalize(),this.x.fromRed()},g2.prototype.getY=function(){return this.normalize(),this.y.fromRed()},g2.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},g2.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},g2.prototype.toP=g2.prototype.normalize,g2.prototype.mixedAdd=g2.prototype.add;var m2=RB((function(e,t){var r=t;r.base=r2,r.short=s2,r.mont=l2,r.edwards=p2}));function v2(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function y2(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function b2(e){return 1===e.length?"0"+e:e}function w2(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}var _2={inherits:YX,toArray:function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):v2(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},toHex:function(e){for(var t="",r=0;r<e.length;r++)t+=b2(e[r].toString(16));return t},htonl:y2,toHex32:function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=y2(i)),r+=w2(i.toString(16))}return r},zero2:b2,zero8:w2,join32:function(e,t,r,n){var i=r-t;V1(i%4==0);for(var o=new Array(i/4),s=0,a=t;s<o.length;s++,a+=4){var u;u="big"===n?e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3]:e[a+3]<<24|e[a+2]<<16|e[a+1]<<8|e[a],o[s]=u>>>0}return o},split32:function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},rotr32:function(e,t){return e>>>t|e<<32-t},rotl32:function(e,t){return e<<t|e>>>32-t},sum32:function(e,t){return e+t>>>0},sum32_3:function(e,t,r){return e+t+r>>>0},sum32_4:function(e,t,r,n){return e+t+r+n>>>0},sum32_5:function(e,t,r,n,i){return e+t+r+n+i>>>0},sum64:function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},sum64_hi:function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},sum64_lo:function(e,t,r,n){return t+n>>>0},sum64_4_hi:function(e,t,r,n,i,o,s,a){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+s+(u+=(c=c+a>>>0)<a?1:0)>>>0},sum64_4_lo:function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},sum64_5_hi:function(e,t,r,n,i,o,s,a,u,c){var l=0,h=t;return l+=(h=h+n>>>0)<t?1:0,l+=(h=h+o>>>0)<o?1:0,l+=(h=h+a>>>0)<a?1:0,e+r+i+s+u+(l+=(h=h+c>>>0)<c?1:0)>>>0},sum64_5_lo:function(e,t,r,n,i,o,s,a,u,c){return t+n+o+a+c>>>0},rotr64_hi:function(e,t,r){return(t<<32-r|e>>>r)>>>0},rotr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0},shr64_hi:function(e,t,r){return e>>>r},shr64_lo:function(e,t,r){return(e<<32-r|t>>>r)>>>0}};function x2(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}var S2=x2;x2.prototype.update=function(e,t){if(e=_2.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=_2.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},x2.prototype.digest=function(e){return this.update(this._pad()),V1(null===this.pending),this._digest(e)},x2.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n};var E2={BlockHash:S2},k2=_2.rotr32;function I2(e,t,r){return e&t^~e&r}function A2(e,t,r){return e&t^e&r^t&r}function P2(e,t,r){return e^t^r}var T2=function(e,t,r,n){return 0===e?I2(t,r,n):1===e||3===e?P2(t,r,n):2===e?A2(t,r,n):void 0},O2=I2,C2=A2,M2=function(e){return k2(e,2)^k2(e,13)^k2(e,22)},R2=function(e){return k2(e,6)^k2(e,11)^k2(e,25)},N2=function(e){return k2(e,7)^k2(e,18)^e>>>3},L2=function(e){return k2(e,17)^k2(e,19)^e>>>10},j2=_2.rotl32,D2=_2.sum32,B2=_2.sum32_5,U2=T2,F2=E2.BlockHash,H2=[1518500249,1859775393,2400959708,3395469782];function z2(){if(!(this instanceof z2))return new z2;F2.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}_2.inherits(z2,F2);var V2=z2;z2.blockSize=512,z2.outSize=160,z2.hmacStrength=80,z2.padLength=64,z2.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=j2(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4];for(n=0;n<r.length;n++){var c=~~(n/20),l=B2(j2(i,5),U2(c,o,s,a),u,r[n],H2[c]);u=a,a=s,s=j2(o,30),o=i,i=l}this.h[0]=D2(this.h[0],i),this.h[1]=D2(this.h[1],o),this.h[2]=D2(this.h[2],s),this.h[3]=D2(this.h[3],a),this.h[4]=D2(this.h[4],u)},z2.prototype._digest=function(e){return"hex"===e?_2.toHex32(this.h,"big"):_2.split32(this.h,"big")};var q2=_2.sum32,K2=_2.sum32_4,$2=_2.sum32_5,W2=O2,J2=C2,G2=M2,X2=R2,Y2=N2,Q2=L2,Z2=E2.BlockHash,e3=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function t3(){if(!(this instanceof t3))return new t3;Z2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=e3,this.W=new Array(64)}_2.inherits(t3,Z2);var r3=t3;function n3(){if(!(this instanceof n3))return new n3;r3.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}t3.blockSize=512,t3.outSize=256,t3.hmacStrength=192,t3.padLength=64,t3.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=K2(Q2(r[n-2]),r[n-7],Y2(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],c=this.h[5],l=this.h[6],h=this.h[7];for(V1(this.k.length===r.length),n=0;n<r.length;n++){var f=$2(h,X2(u),W2(u,c,l),this.k[n],r[n]),d=q2(G2(i),J2(i,o,s));h=l,l=c,c=u,u=q2(a,f),a=s,s=o,o=i,i=q2(f,d)}this.h[0]=q2(this.h[0],i),this.h[1]=q2(this.h[1],o),this.h[2]=q2(this.h[2],s),this.h[3]=q2(this.h[3],a),this.h[4]=q2(this.h[4],u),this.h[5]=q2(this.h[5],c),this.h[6]=q2(this.h[6],l),this.h[7]=q2(this.h[7],h)},t3.prototype._digest=function(e){return"hex"===e?_2.toHex32(this.h,"big"):_2.split32(this.h,"big")},_2.inherits(n3,r3);var i3=n3;n3.blockSize=512,n3.outSize=224,n3.hmacStrength=192,n3.padLength=64,n3.prototype._digest=function(e){return"hex"===e?_2.toHex32(this.h.slice(0,7),"big"):_2.split32(this.h.slice(0,7),"big")};var o3=_2.rotr64_hi,s3=_2.rotr64_lo,a3=_2.shr64_hi,u3=_2.shr64_lo,c3=_2.sum64,l3=_2.sum64_hi,h3=_2.sum64_lo,f3=_2.sum64_4_hi,d3=_2.sum64_4_lo,p3=_2.sum64_5_hi,g3=_2.sum64_5_lo,m3=E2.BlockHash,v3=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y3(){if(!(this instanceof y3))return new y3;m3.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v3,this.W=new Array(160)}_2.inherits(y3,m3);var b3=y3;function w3(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function _3(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function x3(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function S3(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function E3(e,t){var r=o3(e,t,28)^o3(t,e,2)^o3(t,e,7);return r<0&&(r+=4294967296),r}function k3(e,t){var r=s3(e,t,28)^s3(t,e,2)^s3(t,e,7);return r<0&&(r+=4294967296),r}function I3(e,t){var r=o3(e,t,14)^o3(e,t,18)^o3(t,e,9);return r<0&&(r+=4294967296),r}function A3(e,t){var r=s3(e,t,14)^s3(e,t,18)^s3(t,e,9);return r<0&&(r+=4294967296),r}function P3(e,t){var r=o3(e,t,1)^o3(e,t,8)^a3(e,t,7);return r<0&&(r+=4294967296),r}function T3(e,t){var r=s3(e,t,1)^s3(e,t,8)^u3(e,t,7);return r<0&&(r+=4294967296),r}function O3(e,t){var r=o3(e,t,19)^o3(t,e,29)^a3(e,t,6);return r<0&&(r+=4294967296),r}function C3(e,t){var r=s3(e,t,19)^s3(t,e,29)^u3(e,t,6);return r<0&&(r+=4294967296),r}function M3(){if(!(this instanceof M3))return new M3;b3.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}y3.blockSize=1024,y3.outSize=512,y3.hmacStrength=192,y3.padLength=128,y3.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=O3(r[n-4],r[n-3]),o=C3(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=P3(r[n-30],r[n-29]),c=T3(r[n-30],r[n-29]),l=r[n-32],h=r[n-31];r[n]=f3(i,o,s,a,u,c,l,h),r[n+1]=d3(i,o,s,a,u,c,l,h)}},y3.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],s=this.h[3],a=this.h[4],u=this.h[5],c=this.h[6],l=this.h[7],h=this.h[8],f=this.h[9],d=this.h[10],p=this.h[11],g=this.h[12],m=this.h[13],v=this.h[14],y=this.h[15];V1(this.k.length===r.length);for(var b=0;b<r.length;b+=2){var w=v,_=y,x=I3(h,f),S=A3(h,f),E=w3(h,0,d,0,g),k=_3(0,f,0,p,0,m),I=this.k[b],A=this.k[b+1],P=r[b],T=r[b+1],O=p3(w,_,x,S,E,k,I,A,P,T),C=g3(w,_,x,S,E,k,I,A,P,T);w=E3(n,i),_=k3(n,i),x=x3(n,0,o,0,a),S=S3(0,i,0,s,0,u);var M=l3(w,_,x,S),R=h3(w,_,x,S);v=g,y=m,g=d,m=p,d=h,p=f,h=l3(c,l,O,C),f=h3(l,l,O,C),c=a,l=u,a=o,u=s,o=n,s=i,n=l3(O,C,M,R),i=h3(O,C,M,R)}c3(this.h,0,n,i),c3(this.h,2,o,s),c3(this.h,4,a,u),c3(this.h,6,c,l),c3(this.h,8,h,f),c3(this.h,10,d,p),c3(this.h,12,g,m),c3(this.h,14,v,y)},y3.prototype._digest=function(e){return"hex"===e?_2.toHex32(this.h,"big"):_2.split32(this.h,"big")},_2.inherits(M3,b3);var R3=M3;M3.blockSize=1024,M3.outSize=384,M3.hmacStrength=192,M3.padLength=128,M3.prototype._digest=function(e){return"hex"===e?_2.toHex32(this.h.slice(0,12),"big"):_2.split32(this.h.slice(0,12),"big")};var N3={sha1:V2,sha224:i3,sha256:r3,sha384:R3,sha512:b3},L3=_2.rotl32,j3=_2.sum32,D3=_2.sum32_3,B3=_2.sum32_4,U3=E2.BlockHash;function F3(){if(!(this instanceof F3))return new F3;U3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}_2.inherits(F3,U3);var H3=F3;function z3(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function V3(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function q3(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}F3.blockSize=512,F3.outSize=160,F3.hmacStrength=192,F3.padLength=64,F3.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],s=this.h[4],a=r,u=n,c=i,l=o,h=s,f=0;f<80;f++){var d=j3(L3(B3(r,z3(f,n,i,o),e[K3[f]+t],V3(f)),W3[f]),s);r=s,s=o,o=L3(i,10),i=n,n=d,d=j3(L3(B3(a,z3(79-f,u,c,l),e[$3[f]+t],q3(f)),J3[f]),h),a=h,h=l,l=L3(c,10),c=u,u=d}d=D3(this.h[1],i,l),this.h[1]=D3(this.h[2],o,h),this.h[2]=D3(this.h[3],s,a),this.h[3]=D3(this.h[4],r,u),this.h[4]=D3(this.h[0],n,c),this.h[0]=d},F3.prototype._digest=function(e){return"hex"===e?_2.toHex32(this.h,"little"):_2.split32(this.h,"little")};var K3=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],$3=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],W3=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],J3=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],G3={ripemd160:H3};function X3(e,t,r){if(!(this instanceof X3))return new X3(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(_2.toArray(t,r))}var Y3=X3;X3.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),V1(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},X3.prototype.update=function(e,t){return this.inner.update(e,t),this},X3.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)};var Q3=RB((function(e,t){var r=t;r.utils=_2,r.common=E2,r.sha=N3,r.ripemd=G3,r.hmac=Y3,r.sha1=r.sha.sha1,r.sha256=r.sha.sha256,r.sha224=r.sha.sha224,r.sha384=r.sha.sha384,r.sha512=r.sha.sha512,r.ripemd160=r.ripemd.ripemd160})),Z3={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}},e6=RB((function(e,t){var r,n=t,i=W1.assert;function o(e){"short"===e.type?this.curve=new m2.short(e):"edwards"===e.type?this.curve=new m2.edwards(e):this.curve=new m2.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Q3.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Q3.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Q3.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Q3.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Q3.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Q3.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Q3.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=Z3}catch(e){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Q3.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function t6(e){if(!(this instanceof t6))return new t6(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=$1.toArray(e.entropy,e.entropyEnc||"hex"),r=$1.toArray(e.nonce,e.nonceEnc||"hex"),n=$1.toArray(e.pers,e.persEnc||"hex");V1(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var r6=t6;t6.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},t6.prototype._hmac=function(){return new Q3.hmac(this.hash,this.K)},t6.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},t6.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=$1.toArray(e,t),r=$1.toArray(r,n),V1(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},t6.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=$1.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(r),this._reseed++,$1.encode(o,t)};var n6=W1.assert;function i6(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var o6=i6;i6.fromPublic=function(e,t,r){return t instanceof i6?t:new i6(e,{pub:t,pubEnc:r})},i6.fromPrivate=function(e,t,r){return t instanceof i6?t:new i6(e,{priv:t,privEnc:r})},i6.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},i6.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},i6.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},i6.prototype._importPrivate=function(e,t){this.priv=new O1(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},i6.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n6(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n6(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},i6.prototype.derive=function(e){return e.validate()||n6(e.validate(),"public point not validated"),e.mul(this.priv).getX()},i6.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},i6.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},i6.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var s6=W1.assert;function a6(e,t){if(e instanceof a6)return e;this._importDER(e,t)||(s6(e.r&&e.s,"Signature without r or s"),this.r=new O1(e.r,16),this.s=new O1(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var u6=a6;function c6(){this.place=0}function l6(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function h6(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function f6(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}a6.prototype._importDER=function(e,t){e=W1.toArray(e,t);var r=new c6;if(48!==e[r.place++])return!1;var n=l6(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=l6(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var s=l6(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var a=e.slice(r.place,s+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new O1(o),this.s=new O1(a),this.recoveryParam=null,!0},a6.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=h6(t),r=h6(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f6(n,t.length),(n=n.concat(t)).push(2),f6(n,r.length);var i=n.concat(r),o=[48];return f6(o,i.length),o=o.concat(i),W1.encode(o,e)};var d6=W1.assert;function p6(e){if(!(this instanceof p6))return new p6(e);"string"==typeof e&&(d6(Object.prototype.hasOwnProperty.call(e6,e),"Unknown curve "+e),e=e6[e]),e instanceof e6.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var g6=p6;p6.prototype.keyPair=function(e){return new o6(this,e)},p6.prototype.keyFromPrivate=function(e,t){return o6.fromPrivate(this,e,t)},p6.prototype.keyFromPublic=function(e,t){return o6.fromPublic(this,e,t)},p6.prototype.genKeyPair=function(e){e||(e={});for(var t=new r6({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||J1(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new O1(2));;){var i=new O1(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},p6.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},p6.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new O1(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),s=e.toArray("be",i),a=new r6({hash:this.hash,entropy:o,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new O1(1)),c=0;;c++){var l=n.k?n.k(c):new O1(a.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var h=this.g.mul(l);if(!h.isInfinity()){var f=h.getX(),d=f.umod(this.n);if(0!==d.cmpn(0)){var p=l.invm(this.n).mul(d.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var g=(h.getY().isOdd()?1:0)|(0!==f.cmp(d)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),g^=1),new u6({r:d,s:p,recoveryParam:g})}}}}}},p6.prototype.verify=function(e,t,r,n){e=this._truncateToN(new O1(e,16)),r=this.keyFromPublic(r,n);var i=(t=new u6(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,a=o.invm(this.n),u=a.mul(e).umod(this.n),c=a.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(u,r.getPublic(),c)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(u,r.getPublic(),c)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},p6.prototype.recoverPubKey=function(e,t,r,n){d6((3&r)===r,"The recovery param is more than two bits"),t=new u6(t,n);var i=this.n,o=new O1(e),s=t.r,a=t.s,u=1&r,c=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");s=c?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var l=t.r.invm(i),h=i.sub(o).mul(l).umod(i),f=a.mul(l).umod(i);return this.g.mulAdd(h,s,f)},p6.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new u6(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var m6=W1.assert,v6=W1.parseBytes,y6=W1.cachedProperty;function b6(e,t){this.eddsa=e,this._secret=v6(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=v6(t.pub)}b6.fromPublic=function(e,t){return t instanceof b6?t:new b6(e,{pub:t})},b6.fromSecret=function(e,t){return t instanceof b6?t:new b6(e,{secret:t})},b6.prototype.secret=function(){return this._secret},y6(b6,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),y6(b6,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),y6(b6,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),y6(b6,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),y6(b6,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),y6(b6,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),b6.prototype.sign=function(e){return m6(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},b6.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},b6.prototype.getSecret=function(e){return m6(this._secret,"KeyPair is public only"),W1.encode(this.secret(),e)},b6.prototype.getPublic=function(e){return W1.encode(this.pubBytes(),e)};var w6=b6,_6=W1.assert,x6=W1.cachedProperty,S6=W1.parseBytes;function E6(e,t){this.eddsa=e,"object"!=typeof t&&(t=S6(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),_6(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof O1&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}x6(E6,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),x6(E6,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),x6(E6,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),x6(E6,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),E6.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},E6.prototype.toHex=function(){return W1.encode(this.toBytes(),"hex").toUpperCase()};var k6=E6,I6=W1.assert,A6=W1.parseBytes;function P6(e){if(I6("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof P6))return new P6(e);e=e6[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=Q3.sha512}var T6=P6;P6.prototype.sign=function(e,t){e=A6(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),a=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:a,Rencoded:o})},P6.prototype.verify=function(e,t,r){e=A6(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},P6.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return W1.intFromLE(e.digest()).umod(this.curve.n)},P6.prototype.keyFromPublic=function(e){return w6.fromPublic(this,e)},P6.prototype.keyFromSecret=function(e){return w6.fromSecret(this,e)},P6.prototype.makeSignature=function(e){return e instanceof k6?e:new k6(this,e)},P6.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},P6.prototype.decodePoint=function(e){var t=(e=W1.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=W1.intFromLE(r);return this.curve.pointFromY(i,n)},P6.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},P6.prototype.decodeInt=function(e){return W1.intFromLE(e)},P6.prototype.isPoint=function(e){return e instanceof this.pointClass};var O6=NB(z1),C6=RB((function(e,t){var r=t;r.version=O6.version,r.utils=W1,r.rand=J1,r.curve=m2,r.curves=e6,r.ec=g6,r.eddsa=T6}));const M6=eU.alloc(1,1),R6=eU.alloc(1,0);const N6=new C6.ec("secp256k1"),L6=eU.alloc(32,0),j6=eU.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),D6=eU.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex"),B6=N6.curve.n,U6=B6.shrn(1),F6=N6.curve.g;function H6(e){return jU(e)&&32===e.length}function z6(e){return!!H6(e)&&e.compare(j6)<0}function V6(e){if(!jU(e))return!1;if(e.length<33)return!1;const t=e[0],r=e.slice(1,33);if(0===r.compare(L6))return!1;if(r.compare(D6)>=0)return!1;if((2===t||3===t)&&33===e.length){try{G6(e)}catch(e){return!1}return!0}const n=e.slice(33);return 0!==n.compare(L6)&&!(n.compare(D6)>=0)&&4===t&&65===e.length}function q6(e){return 4!==e[0]}function K6(e){return!!H6(e)&&e.compare(L6)>0&&e.compare(j6)<0}function $6(e,t){return void 0===e&&void 0!==t?q6(t):void 0===e||e}function W6(e){return new O1(e)}function J6(e){return e.toArrayLike(eU,"be",32)}function G6(e){return N6.curve.decodePoint(e)}function X6(e,t){return eU.from(e._encode(t))}function Y6(e,t,r){if(!H6(e))throw new TypeError("Expected Hash");if(!K6(t))throw new TypeError("Expected Private");if(void 0!==r&&!H6(r))throw new TypeError("Expected Extra Data (32 bytes)");const n=W6(t),i=W6(e);let o,s;(function(e,t,r,n,i){let o=eU.alloc(32,0),s=eU.alloc(32,1);o=E1("sha256",o).update(s).update(R6).update(t).update(e).update(i||"").digest(),s=E1("sha256",o).update(s).digest(),o=E1("sha256",o).update(s).update(M6).update(t).update(e).update(i||"").digest(),s=E1("sha256",o).update(s).digest(),s=E1("sha256",o).update(s).digest();let a=s;for(;!n(a)||!r(a);)o=E1("sha256",o).update(s).update(R6).digest(),s=E1("sha256",o).update(s).digest(),s=E1("sha256",o).update(s).digest(),a=s})(e,t,(function(e){const t=W6(e),r=F6.mul(t);return!r.isInfinity()&&(o=r.x.umod(B6),0!==o.isZero()&&(s=t.invm(B6).mul(i.add(n.mul(o))).umod(B6),0!==s.isZero()))}),K6,r),s.cmp(U6)>0&&(s=B6.sub(s));const a=eU.allocUnsafe(64);return J6(o).copy(a,0),J6(s).copy(a,32),a}var Q6={isPoint:V6,isPointCompressed:function(e){return!!V6(e)&&q6(e)},isPrivate:K6,pointAdd:function(e,t,r){if(!V6(e))throw new TypeError("Expected Point");if(!V6(t))throw new TypeError("Expected Point");const n=G6(e),i=G6(t),o=n.add(i);return o.isInfinity()?null:X6(o,$6(r,e))},pointAddScalar:function(e,t,r){if(!V6(e))throw new TypeError("Expected Point");if(!z6(t))throw new TypeError("Expected Tweak");const n=$6(r,e),i=G6(e);if(0===t.compare(L6))return X6(i,n);const o=W6(t),s=F6.mul(o),a=i.add(s);return a.isInfinity()?null:X6(a,n)},pointCompress:function(e,t){if(!V6(e))throw new TypeError("Expected Point");const r=G6(e);if(r.isInfinity())throw new TypeError("Expected Point");return X6(r,$6(t,e))},pointFromScalar:function(e,t){if(!K6(e))throw new TypeError("Expected Private");const r=W6(e),n=F6.mul(r);return n.isInfinity()?null:X6(n,$6(t))},pointMultiply:function(e,t,r){if(!V6(e))throw new TypeError("Expected Point");if(!z6(t))throw new TypeError("Expected Tweak");const n=$6(r,e),i=G6(e),o=W6(t),s=i.mul(o);return s.isInfinity()?null:X6(s,n)},privateAdd:function(e,t){if(!K6(e))throw new TypeError("Expected Private");if(!z6(t))throw new TypeError("Expected Tweak");const r=W6(e),n=W6(t),i=J6(r.add(n).umod(B6));return K6(i)?i:null},privateSub:function(e,t){if(!K6(e))throw new TypeError("Expected Private");if(!z6(t))throw new TypeError("Expected Tweak");const r=W6(e),n=W6(t),i=J6(r.sub(n).umod(B6));return K6(i)?i:null},sign:function(e,t){return Y6(e,t)},signWithEntropy:function(e,t,r){return Y6(e,t,r)},verify:function(e,t,r,n){if(!H6(e))throw new TypeError("Expected Hash");if(!V6(t))throw new TypeError("Expected Point");if(!function(e){const t=e.slice(0,32),r=e.slice(32,64);return jU(e)&&64===e.length&&t.compare(j6)<0&&r.compare(j6)<0}(r))throw new TypeError("Expected Signature");const i=G6(t),o=W6(r.slice(0,32)),s=W6(r.slice(32,64));if(n&&s.cmp(U6)>0)return!1;if(o.gtn(0)<=0)return!1;if(s.gtn(0)<=0)return!1;const a=W6(e),u=s.invm(B6),c=a.mul(u).umod(B6),l=o.mul(u).umod(B6),h=F6.mulAdd(c,i,l);return!h.isInfinity()&&h.x.umod(B6).eq(o)}},Z6={Array:function(e){return null!=e&&e.constructor===Array},Boolean:function(e){return"boolean"==typeof e},Function:function(e){return"function"==typeof e},Nil:function(e){return null==e},Number:function(e){return"number"==typeof e},Object:function(e){return"object"==typeof e},String:function(e){return"string"==typeof e},"":function(){return!0}};for(var e4 in Z6.Null=Z6.Nil,Z6)Z6[e4].toJSON=function(e){return e}.bind(null,e4);var t4=Z6;function r4(e){return e.name||e.toString().match(/function (.*?)\s*\(/)[1]}function n4(e){return t4.Nil(e)?"":r4(e.constructor)}function i4(e,t){Error.captureStackTrace&&Error.captureStackTrace(e,t)}function o4(e){return t4.Function(e)?e.toJSON?e.toJSON():r4(e):t4.Array(e)?"Array":e&&t4.Object(e)?"Object":void 0!==e?e:""}function s4(e,t,r){var n=function(e){return t4.Function(e)?"":t4.String(e)?JSON.stringify(e):e&&t4.Object(e)?"":e}(t);return"Expected "+o4(e)+", got"+(""!==r?" "+r:"")+(""!==n?" "+n:"")}function a4(e,t,r){r=r||n4(t),this.message=s4(e,t,r),i4(this,a4),this.__type=e,this.__value=t,this.__valueTypeName=r}function u4(e,t,r,n,i){e?(i=i||n4(n),this.message=function(e,t,r,n,i){var o='" of type ';return"key"===t&&(o='" with key type '),s4('property "'+o4(r)+o+o4(e),n,i)}(e,r,t,n,i)):this.message='Unexpected property "'+t+'"',i4(this,a4),this.__label=r,this.__property=t,this.__type=e,this.__value=n,this.__valueTypeName=i}a4.prototype=Object.create(Error.prototype),a4.prototype.constructor=a4,u4.prototype=Object.create(Error.prototype),u4.prototype.constructor=a4;var c4=a4,l4=u4,h4=function(e,t){return new a4(e,{},t)},f4=function(e,t,r){return e instanceof u4?(t=t+"."+e.__property,e=new u4(e.__type,t,e.__label,e.__value,e.__valueTypeName)):e instanceof a4&&(e=new u4(e.__type,t,r,e.__value,e.__valueTypeName)),i4(e),e},d4=o4,p4=n4;function g4(e){return jU(e)}function m4(e){return"string"==typeof e&&/^([0-9a-f]{2})+$/i.test(e)}function v4(e,t){var r=e.toJSON();function n(n){if(!e(n))return!1;if(n.length===t)return!0;throw h4(r+"(Length: "+t+")",r+"(Length: "+n.length+")")}return n.toJSON=function(){return r},n}var y4=v4.bind(null,t4.Array),b4=v4.bind(null,g4),w4=v4.bind(null,m4),_4=v4.bind(null,t4.String),x4=Math.pow(2,53)-1,S4={ArrayN:y4,Buffer:g4,BufferN:b4,Finite:function(e){return"number"==typeof e&&isFinite(e)},Hex:m4,HexN:w4,Int8:function(e){return e<<24>>24===e},Int16:function(e){return e<<16>>16===e},Int32:function(e){return(0|e)===e},Int53:function(e){return"number"==typeof e&&e>=-x4&&e<=x4&&Math.floor(e)===e},Range:function(e,t,r){function n(n,i){return r(n,i)&&n>e&&n<t}return r=r||t4.Number,n.toJSON=function(){return`${r.toJSON()} between [${e}, ${t}]`},n},StringN:_4,UInt8:function(e){return(255&e)===e},UInt16:function(e){return(65535&e)===e},UInt32:function(e){return e>>>0===e},UInt53:function(e){return"number"==typeof e&&e>=0&&e<=x4&&Math.floor(e)===e}};for(var E4 in S4)S4[E4].toJSON=function(e){return e}.bind(null,E4);var k4=S4,I4=d4,A4=c4,P4=l4,T4=f4,O4=p4,C4={arrayOf:function(e,t){function r(r,n){return!!t4.Array(r)&&!t4.Nil(r)&&!(void 0!==t.minLength&&r.length<t.minLength)&&!(void 0!==t.maxLength&&r.length>t.maxLength)&&(void 0===t.length||r.length===t.length)&&r.every((function(t,r){try{return R4(e,t,n)}catch(e){throw T4(e,r)}}))}return e=M4(e),t=t||{},r.toJSON=function(){var r="["+I4(e)+"]";return void 0!==t.length?r+="{"+t.length+"}":void 0===t.minLength&&void 0===t.maxLength||(r+="{"+(void 0===t.minLength?0:t.minLength)+","+(void 0===t.maxLength?1/0:t.maxLength)+"}"),r},r},maybe:function e(t){function r(r,n){return t4.Nil(r)||t(r,n,e)}return t=M4(t),r.toJSON=function(){return"?"+I4(t)},r},map:function(e,t){function r(r,n){if(!t4.Object(r))return!1;if(t4.Nil(r))return!1;for(var i in r){try{t&&R4(t,i,n)}catch(e){throw T4(e,i,"key")}try{var o=r[i];R4(e,o,n)}catch(e){throw T4(e,i)}}return!0}return e=M4(e),t&&(t=M4(t)),r.toJSON=t?function(){return"{"+I4(t)+": "+I4(e)+"}"}:function(){return"{"+I4(e)+"}"},r},object:function(e){var t={};for(var r in e)t[r]=M4(e[r]);function n(e,r){if(!t4.Object(e))return!1;if(t4.Nil(e))return!1;var n;try{for(n in t)R4(t[n],e[n],r)}catch(e){throw T4(e,n)}if(r)for(n in e)if(!t[n])throw new P4(void 0,n);return!0}return n.toJSON=function(){return I4(t)},n},anyOf:function(){var e=[].slice.call(arguments).map(M4);function t(t,r){return e.some((function(e){try{return R4(e,t,r)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(I4).join("|")},t},allOf:function(){var e=[].slice.call(arguments).map(M4);function t(t,r){return e.every((function(e){try{return R4(e,t,r)}catch(e){return!1}}))}return t.toJSON=function(){return e.map(I4).join(" & ")},t},quacksLike:function(e){function t(t){return e===O4(t)}return t.toJSON=function(){return e},t},tuple:function(){var e=[].slice.call(arguments).map(M4);function t(t,r){return!t4.Nil(t)&&!t4.Nil(t.length)&&(!r||t.length===e.length)&&e.every((function(e,n){try{return R4(e,t[n],r)}catch(e){throw T4(e,n)}}))}return t.toJSON=function(){return"("+e.map(I4).join(", ")+")"},t},value:function(e){function t(t){return t===e}return t.toJSON=function(){return e},t}};function M4(e){if(t4.String(e))return"?"===e[0]?C4.maybe(e.slice(1)):t4[e]||C4.quacksLike(e);if(e&&t4.Object(e)){if(t4.Array(e)){if(1!==e.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return C4.arrayOf(e[0])}return C4.object(e)}return t4.Function(e)?e:C4.value(e)}function R4(e,t,r,n){if(t4.Function(e)){if(e(t,r))return!0;throw new A4(n||e,t)}return R4(M4(e),t,r)}for(var N4 in C4.oneOf=C4.anyOf,t4)R4[N4]=t4[N4];for(N4 in C4)R4[N4]=C4[N4];for(N4 in k4)R4[N4]=k4[N4];R4.compile=M4,R4.TfTypeError=A4,R4.TfPropertyTypeError=P4;var L4=R4;function j4(e,t){if(void 0!==t&&e[0]!==t)throw new Error("Invalid network version");if(33===e.length)return{version:e[0],privateKey:e.slice(1,33),compressed:!1};if(34!==e.length)throw new Error("Invalid WIF length");if(1!==e[33])throw new Error("Invalid compression flag");return{version:e[0],privateKey:e.slice(1,33),compressed:!0}}function D4(e,t,r){var n=new eU(r?34:33);return n.writeUInt8(e,0),t.copy(n,1),r&&(n[33]=1),n}var B4=function(e,t){return j4(T1.decode(e),t)},U4=function(e,t,r){return"number"==typeof e?T1.encode(D4(e,t,r)):T1.encode(D4(e.version,e.privateKey,e.compressed))},F4=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=L4.BufferN(32),n=L4.compile({wif:L4.UInt8,bip32:{public:L4.UInt32,private:L4.UInt32}}),i={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},o=2147483648,s=Math.pow(2,31)-1;function a(e){return L4.String(e)&&null!==e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function u(e){return L4.UInt32(e)&&e<=s}class c{constructor(e,t,r,i,o=0,s=0,a=0){this.__D=e,this.__Q=t,this.chainCode=r,this.network=i,this.__DEPTH=o,this.__INDEX=s,this.__PARENT_FINGERPRINT=a,L4(n,i),this.lowR=!1}get depth(){return this.__DEPTH}get index(){return this.__INDEX}get parentFingerprint(){return this.__PARENT_FINGERPRINT}get publicKey(){return void 0===this.__Q&&(this.__Q=Q6.pointFromScalar(this.__D,!0)),this.__Q}get privateKey(){return this.__D}get identifier(){return k1.hash160(this.publicKey)}get fingerprint(){return this.identifier.slice(0,4)}get compressed(){return!0}isNeutered(){return void 0===this.__D}neutered(){return f(this.publicKey,this.chainCode,this.network,this.depth,this.index,this.parentFingerprint)}toBase58(){const e=this.network,t=this.isNeutered()?e.bip32.public:e.bip32.private,r=eU.allocUnsafe(78);return r.writeUInt32BE(t,0),r.writeUInt8(this.depth,4),r.writeUInt32BE(this.parentFingerprint,5),r.writeUInt32BE(this.index,9),this.chainCode.copy(r,13),this.isNeutered()?this.publicKey.copy(r,45):(r.writeUInt8(0,45),this.privateKey.copy(r,46)),T1.encode(r)}toWIF(){if(!this.privateKey)throw new TypeError("Missing private key");return U4(this.network.wif,this.privateKey,!0)}derive(e){L4(L4.UInt32,e);const t=e>=o,r=eU.allocUnsafe(37);if(t){if(this.isNeutered())throw new TypeError("Missing private key for hardened child key");r[0]=0,this.privateKey.copy(r,1),r.writeUInt32BE(e,33)}else this.publicKey.copy(r,0),r.writeUInt32BE(e,33);const n=k1.hmacSHA512(this.chainCode,r),i=n.slice(0,32),s=n.slice(32);if(!Q6.isPrivate(i))return this.derive(e+1);let a;if(this.isNeutered()){const t=Q6.pointAddScalar(this.publicKey,i,!0);if(null===t)return this.derive(e+1);a=f(t,s,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}else{const t=Q6.privateAdd(this.privateKey,i);if(null==t)return this.derive(e+1);a=h(t,s,this.network,this.depth+1,e,this.fingerprint.readUInt32BE(0))}return a}deriveHardened(e){return L4(u,e),this.derive(e+o)}derivePath(e){L4(a,e);let t=e.split("/");if("m"===t[0]){if(this.parentFingerprint)throw new TypeError("Expected master, got child");t=t.slice(1)}return t.reduce(((e,t)=>{let r;return"'"===t.slice(-1)?(r=parseInt(t.slice(0,-1),10),e.deriveHardened(r)):(r=parseInt(t,10),e.derive(r))}),this)}sign(e,t){if(!this.privateKey)throw new Error("Missing private key");if(void 0===t&&(t=this.lowR),!1===t)return Q6.sign(e,this.privateKey);{let t=Q6.sign(e,this.privateKey);const r=eU.alloc(32,0);let n=0;for(;t[0]>127;)n++,r.writeUIntLE(n,0,6),t=Q6.signWithEntropy(e,this.privateKey,r);return t}}verify(e,t){return Q6.verify(e,this.publicKey,t)}}function l(e,t,r){return h(e,t,r)}function h(e,t,n,o,s,a){if(L4({privateKey:r,chainCode:r},{privateKey:e,chainCode:t}),n=n||i,!Q6.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return new c(e,void 0,t,n,o,s,a)}function f(e,t,n,o,s,a){if(L4({publicKey:L4.BufferN(33),chainCode:r},{publicKey:e,chainCode:t}),n=n||i,!Q6.isPoint(e))throw new TypeError("Point is not on the curve");return new c(void 0,e,t,n,o,s,a)}t.fromBase58=function(e,t){const r=T1.decode(e);if(78!==r.length)throw new TypeError("Invalid buffer length");t=t||i;const n=r.readUInt32BE(0);if(n!==t.bip32.private&&n!==t.bip32.public)throw new TypeError("Invalid network version");const o=r[4],s=r.readUInt32BE(5);if(0===o&&0!==s)throw new TypeError("Invalid parent fingerprint");const a=r.readUInt32BE(9);if(0===o&&0!==a)throw new TypeError("Invalid index");const u=r.slice(13,45);let c;if(n===t.bip32.private){if(0!==r.readUInt8(45))throw new TypeError("Invalid private key");c=h(r.slice(46,78),u,t,o,a,s)}else c=f(r.slice(45,78),u,t,o,a,s);return c},t.fromPrivateKey=l,t.fromPublicKey=function(e,t,r){return f(e,t,r)},t.fromSeed=function(e,t){if(L4(L4.Buffer,e),e.length<16)throw new TypeError("Seed should be at least 128 bits");if(e.length>64)throw new TypeError("Seed should be at most 512 bits");t=t||i;const r=k1.hmacSHA512(eU.from("Bitcoin seed","utf8"),e);return l(r.slice(0,32),r.slice(32),t)}}));MB(F4),F4.fromBase58,F4.fromPrivateKey,F4.fromPublicKey,F4.fromSeed;var H4=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.fromSeed=F4.fromSeed,t.fromBase58=F4.fromBase58,t.fromPublicKey=F4.fromPublicKey,t.fromPrivateKey=F4.fromPrivateKey}));MB(H4),H4.fromSeed,H4.fromBase58,H4.fromPublicKey,H4.fromPrivateKey;var z4=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},t.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},t.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}}));MB(z4),z4.bitcoin,z4.regtest,z4.testnet;var V4=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e,t,r){t=t||4,r=void 0===r||r;const n=e.length;if(0===n)return 0;if(n>t)throw new TypeError("Script number overflow");if(r&&0==(127&e[n-1])&&(n<=1||0==(128&e[n-2])))throw new Error("Non-minimally encoded script number");if(5===n){const t=e.readUInt32LE(0),r=e.readUInt8(4);return 128&r?-(4294967296*(-129&r)+t):4294967296*r+t}let i=0;for(let t=0;t<n;++t)i|=e[t]<<8*t;return 128&e[n-1]?-(i&~(128<<8*(n-1))):i},t.encode=function(e){let t=Math.abs(e);const r=(n=t)>2147483647?5:n>8388607?4:n>32767?3:n>127?2:n>0?1:0;var n;const i=eU.allocUnsafe(r),o=e<0;for(let e=0;e<r;++e)i.writeUInt8(255&t,e),t>>=8;return 128&i[r-1]?i.writeUInt8(o?128:0,r-1):o&&(i[r-1]|=128),i}}));MB(V4),V4.decode,V4.encode;var q4=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Math.pow(2,31)-1;function n(e){return L4.String(e)&&!!e.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}t.UInt31=function(e){return L4.UInt32(e)&&e<=r},t.BIP32Path=n,n.toJSON=()=>"BIP32 derivation path",t.Signer=function(e){return(L4.Buffer(e.publicKey)||"function"==typeof e.getPublicKey)&&"function"==typeof e.sign},t.Satoshi=function(e){return L4.UInt53(e)&&e<=21e14},t.ECPoint=L4.quacksLike("Point"),t.Network=L4.compile({messagePrefix:L4.oneOf(L4.Buffer,L4.String),bip32:{public:L4.UInt32,private:L4.UInt32},pubKeyHash:L4.UInt8,scriptHash:L4.UInt8,wif:L4.UInt8}),t.Buffer256bit=L4.BufferN(32),t.Hash160bit=L4.BufferN(20),t.Hash256bit=L4.BufferN(32),t.Number=L4.Number,t.Array=L4.Array,t.Boolean=L4.Boolean,t.String=L4.String,t.Buffer=L4.Buffer,t.Hex=L4.Hex,t.maybe=L4.maybe,t.tuple=L4.tuple,t.UInt8=L4.UInt8,t.UInt32=L4.UInt32,t.Function=L4.Function,t.BufferN=L4.BufferN,t.Null=L4.Null,t.oneOf=L4.oneOf}));MB(q4),q4.UInt31,q4.BIP32Path,q4.Signer,q4.Satoshi,q4.ECPoint,q4.Network,q4.Buffer256bit,q4.Hash160bit,q4.Hash256bit,q4.Number,q4.Array,q4.Boolean,q4.String,q4.Buffer,q4.Hex,q4.maybe,q4.tuple,q4.UInt8,q4.UInt32,q4.Function,q4.BufferN,q4.Null,q4.oneOf;var K4=QX.Buffer,$4=function(e){if(e.length<8)return!1;if(e.length>72)return!1;if(48!==e[0])return!1;if(e[1]!==e.length-2)return!1;if(2!==e[2])return!1;var t=e[3];if(0===t)return!1;if(5+t>=e.length)return!1;if(2!==e[4+t])return!1;var r=e[5+t];return!(0===r||6+t+r!==e.length||128&e[4]||t>1&&0===e[4]&&!(128&e[5])||128&e[t+6]||r>1&&0===e[t+6]&&!(128&e[t+7]))},W4=function(e){if(e.length<8)throw new Error("DER sequence length is too short");if(e.length>72)throw new Error("DER sequence length is too long");if(48!==e[0])throw new Error("Expected DER sequence");if(e[1]!==e.length-2)throw new Error("DER sequence length is invalid");if(2!==e[2])throw new Error("Expected DER integer");var t=e[3];if(0===t)throw new Error("R length is zero");if(5+t>=e.length)throw new Error("R length is too long");if(2!==e[4+t])throw new Error("Expected DER integer (2)");var r=e[5+t];if(0===r)throw new Error("S length is zero");if(6+t+r!==e.length)throw new Error("S length is invalid");if(128&e[4])throw new Error("R value is negative");if(t>1&&0===e[4]&&!(128&e[5]))throw new Error("R value excessively padded");if(128&e[t+6])throw new Error("S value is negative");if(r>1&&0===e[t+6]&&!(128&e[t+7]))throw new Error("S value excessively padded");return{r:e.slice(4,4+t),s:e.slice(6+t)}},J4=function(e,t){var r=e.length,n=t.length;if(0===r)throw new Error("R length is zero");if(0===n)throw new Error("S length is zero");if(r>33)throw new Error("R length is too long");if(n>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&t[0])throw new Error("S value is negative");if(r>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(n>1&&0===t[0]&&!(128&t[1]))throw new Error("S value excessively padded");var i=K4.allocUnsafe(6+r+n);return i[0]=48,i[1]=i.length-2,i[2]=2,i[3]=e.length,e.copy(i,4),i[4+r]=2,i[5+r]=t.length,t.copy(i,6+r),i},G4=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=eU.alloc(1,0);function n(e){let t=0;for(;0===e[t];)++t;return t===e.length?r:128&(e=e.slice(t))[0]?eU.concat([r,e],1+e.length):e}function i(e){0===e[0]&&(e=e.slice(1));const t=eU.alloc(32,0),r=Math.max(0,32-e.length);return e.copy(t,r),t}t.decode=function(e){const t=e.readUInt8(e.length-1),r=-129&t;if(r<=0||r>=4)throw new Error("Invalid hashType "+t);const n=W4(e.slice(0,-1)),o=i(n.r),s=i(n.s);return{signature:eU.concat([o,s],64),hashType:t}},t.encode=function(e,t){L4({signature:q4.BufferN(64),hashType:q4.UInt8},{signature:e,hashType:t});const r=-129&t;if(r<=0||r>=4)throw new Error("Invalid hashType "+t);const i=eU.allocUnsafe(1);i.writeUInt8(t,0);const o=n(e.slice(0,32)),s=n(e.slice(32,64));return eU.concat([J4(o,s),i])}}));MB(G4),G4.decode,G4.encode;var X4=NB(Object.freeze({__proto__:null,OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255,default:{OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255}}));function Y4(e){return e<X4.OP_PUSHDATA1?1:e<=255?2:e<=65535?3:5}var Q4={encodingLength:Y4,encode:function(e,t,r){var n=Y4(t);return 1===n?e.writeUInt8(t,r):2===n?(e.writeUInt8(X4.OP_PUSHDATA1,r),e.writeUInt8(t,r+1)):3===n?(e.writeUInt8(X4.OP_PUSHDATA2,r),e.writeUInt16LE(t,r+1)):(e.writeUInt8(X4.OP_PUSHDATA4,r),e.writeUInt32LE(t,r+1)),n},decode:function(e,t){var r,n,i=e.readUInt8(t);if(i<X4.OP_PUSHDATA1)r=i,n=1;else if(i===X4.OP_PUSHDATA1){if(t+2>e.length)return null;r=e.readUInt8(t+1),n=2}else if(i===X4.OP_PUSHDATA2){if(t+3>e.length)return null;r=e.readUInt16LE(t+1),n=3}else{if(t+5>e.length)return null;if(i!==X4.OP_PUSHDATA4)throw new Error("Unexpected opcode");r=e.readUInt32LE(t+1),n=5}return{opcode:i,number:r,size:n}}},Z4={};for(var e5 in X4)Z4[X4[e5]]=e5;var t5=Z4,r5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.OPS=X4;const r=t.OPS.OP_RESERVED;function n(e){return q4.Buffer(e)||function(e){return q4.Number(e)&&(e===t.OPS.OP_0||e>=t.OPS.OP_1&&e<=t.OPS.OP_16||e===t.OPS.OP_1NEGATE)}(e)}function i(e){return q4.Array(e)&&e.every(n)}function o(e){return 0===e.length?t.OPS.OP_0:1===e.length?e[0]>=1&&e[0]<=16?r+e[0]:129===e[0]?t.OPS.OP_1NEGATE:void 0:void 0}function s(e){return jU(e)}function a(e){return jU(e)}function u(e){if(s(e))return e;L4(q4.Array,e);const t=e.reduce(((e,t)=>a(t)?1===t.length&&void 0!==o(t)?e+1:e+Q4.encodingLength(t.length)+t.length:e+1),0),r=eU.allocUnsafe(t);let n=0;if(e.forEach((e=>{if(a(e)){const t=o(e);if(void 0!==t)return r.writeUInt8(t,n),void(n+=1);n+=Q4.encode(r,e.length,n),e.copy(r,n),n+=e.length}else r.writeUInt8(e,n),n+=1})),n!==r.length)throw new Error("Could not decode chunks");return r}function c(e){if(r=e,q4.Array(r))return e;var r;L4(q4.Buffer,e);const n=[];let i=0;for(;i<e.length;){const r=e[i];if(r>t.OPS.OP_0&&r<=t.OPS.OP_PUSHDATA4){const t=Q4.decode(e,i);if(null===t)return null;if(i+=t.size,i+t.number>e.length)return null;const r=e.slice(i,i+t.number);i+=t.number;const s=o(r);void 0!==s?n.push(s):n.push(r)}else n.push(r),i+=1}return n}function l(e){const t=-129&e;return t>0&&t<4}t.isPushOnly=i,t.compile=u,t.decompile=c,t.toASM=function(e){return s(e)&&(e=c(e)),e.map((e=>{if(a(e)){const t=o(e);if(void 0===t)return e.toString("hex");e=t}return t5[e]})).join(" ")},t.fromASM=function(e){return L4(q4.String,e),u(e.split(" ").map((e=>void 0!==t.OPS[e]?t.OPS[e]:(L4(q4.Hex,e),eU.from(e,"hex")))))},t.toStack=function(e){return e=c(e),L4(i,e),e.map((e=>a(e)?e:e===t.OPS.OP_0?eU.allocUnsafe(0):V4.encode(e-r)))},t.isCanonicalPubKey=function(e){return Q6.isPoint(e)},t.isDefinedHashType=l,t.isCanonicalScriptSignature=function(e){return!!jU(e)&&!!l(e[e.length-1])&&$4(e.slice(0,-1))},t.number=V4,t.signature=G4}));MB(r5),r5.OPS,r5.isPushOnly,r5.compile,r5.decompile,r5.toASM,r5.fromASM,r5.toStack,r5.isCanonicalPubKey,r5.isDefinedHashType,r5.isCanonicalScriptSignature,r5.number,r5.signature;var n5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.prop=function(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){const e=r.call(this);return this[t]=e,e},set(e){Object.defineProperty(this,t,{configurable:!0,enumerable:!0,value:e,writable:!0})}})},t.value=function(e){let t;return()=>(void 0!==t||(t=e()),t)}}));MB(n5),n5.prop,n5.value;var i5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS;t.p2data=function(e,t){if(!e.data&&!e.output)throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),L4({network:L4.maybe(L4.Object),output:L4.maybe(L4.Buffer),data:L4.maybe(L4.arrayOf(L4.Buffer))},e);const n={name:"embed",network:e.network||z4.bitcoin};if(n5.prop(n,"output",(()=>{if(e.data)return r5.compile([r.OP_RETURN].concat(e.data))})),n5.prop(n,"data",(()=>{if(e.output)return r5.decompile(e.output).slice(1)})),t.validate&&e.output){const t=r5.decompile(e.output);if(t[0]!==r.OP_RETURN)throw new TypeError("Output is invalid");if(!t.slice(1).every(L4.Buffer))throw new TypeError("Output is invalid");if(e.data&&!function(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}(e.data,n.data))throw new TypeError("Data mismatch")}return Object.assign(n,e)}}));MB(i5),i5.p2data;var o5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS,n=r.OP_RESERVED;function i(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}t.p2ms=function(e,t){if(!(e.input||e.output||e.pubkeys&&void 0!==e.m||e.signatures))throw new TypeError("Not enough data");function o(e){return r5.isCanonicalScriptSignature(e)||void 0!==(t.allowIncomplete&&e===r.OP_0)}t=Object.assign({validate:!0},t||{}),L4({network:L4.maybe(L4.Object),m:L4.maybe(L4.Number),n:L4.maybe(L4.Number),output:L4.maybe(L4.Buffer),pubkeys:L4.maybe(L4.arrayOf(Q6.isPoint)),signatures:L4.maybe(L4.arrayOf(o)),input:L4.maybe(L4.Buffer)},e);const s={network:e.network||z4.bitcoin};let a=[],u=!1;function c(e){u||(u=!0,a=r5.decompile(e),s.m=a[0]-n,s.n=a[a.length-2]-n,s.pubkeys=a.slice(1,-2))}if(n5.prop(s,"output",(()=>{if(e.m&&s.n&&e.pubkeys)return r5.compile([].concat(n+e.m,e.pubkeys,n+s.n,r.OP_CHECKMULTISIG))})),n5.prop(s,"m",(()=>{if(s.output)return c(s.output),s.m})),n5.prop(s,"n",(()=>{if(s.pubkeys)return s.pubkeys.length})),n5.prop(s,"pubkeys",(()=>{if(e.output)return c(e.output),s.pubkeys})),n5.prop(s,"signatures",(()=>{if(e.input)return r5.decompile(e.input).slice(1)})),n5.prop(s,"input",(()=>{if(e.signatures)return r5.compile([r.OP_0].concat(e.signatures))})),n5.prop(s,"witness",(()=>{if(s.input)return[]})),n5.prop(s,"name",(()=>{if(s.m&&s.n)return`p2ms(${s.m} of ${s.n})`})),t.validate){if(e.output){if(c(e.output),!L4.Number(a[0]))throw new TypeError("Output is invalid");if(!L4.Number(a[a.length-2]))throw new TypeError("Output is invalid");if(a[a.length-1]!==r.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(s.m<=0||s.n>16||s.m>s.n||s.n!==a.length-3)throw new TypeError("Output is invalid");if(!s.pubkeys.every((e=>Q6.isPoint(e))))throw new TypeError("Output is invalid");if(void 0!==e.m&&e.m!==s.m)throw new TypeError("m mismatch");if(void 0!==e.n&&e.n!==s.n)throw new TypeError("n mismatch");if(e.pubkeys&&!i(e.pubkeys,s.pubkeys))throw new TypeError("Pubkeys mismatch")}if(e.pubkeys){if(void 0!==e.n&&e.n!==e.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(s.n=e.pubkeys.length,s.n<s.m)throw new TypeError("Pubkey count cannot be less than m")}if(e.signatures){if(e.signatures.length<s.m)throw new TypeError("Not enough signatures provided");if(e.signatures.length>s.m)throw new TypeError("Too many signatures provided")}if(e.input){if(e.input[0]!==r.OP_0)throw new TypeError("Input is invalid");if(0===s.signatures.length||!s.signatures.every(o))throw new TypeError("Input has invalid signature(s)");if(e.signatures&&!i(e.signatures,s.signatures))throw new TypeError("Signature mismatch");if(void 0!==e.m&&e.m!==e.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(s,e)}}));MB(o5),o5.p2ms;var s5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS;t.p2pk=function(e,t){if(!(e.input||e.output||e.pubkey||e.input||e.signature))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),L4({network:L4.maybe(L4.Object),output:L4.maybe(L4.Buffer),pubkey:L4.maybe(Q6.isPoint),signature:L4.maybe(r5.isCanonicalScriptSignature),input:L4.maybe(L4.Buffer)},e);const n=n5.value((()=>r5.decompile(e.input))),i={name:"p2pk",network:e.network||z4.bitcoin};if(n5.prop(i,"output",(()=>{if(e.pubkey)return r5.compile([e.pubkey,r.OP_CHECKSIG])})),n5.prop(i,"pubkey",(()=>{if(e.output)return e.output.slice(1,-1)})),n5.prop(i,"signature",(()=>{if(e.input)return n()[0]})),n5.prop(i,"input",(()=>{if(e.signature)return r5.compile([e.signature])})),n5.prop(i,"witness",(()=>{if(i.input)return[]})),t.validate){if(e.output){if(e.output[e.output.length-1]!==r.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!Q6.isPoint(i.pubkey))throw new TypeError("Output pubkey is invalid");if(e.pubkey&&!e.pubkey.equals(i.pubkey))throw new TypeError("Pubkey mismatch")}if(e.signature&&e.input&&!e.input.equals(i.input))throw new TypeError("Signature mismatch");if(e.input){if(1!==n().length)throw new TypeError("Input is invalid");if(!r5.isCanonicalScriptSignature(i.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(i,e)}}));MB(s5),s5.p2pk;var a5=RB((function(e,t){function r(e){try{return g1("rmd160").update(e).digest()}catch(t){return g1("ripemd160").update(e).digest()}}function n(e){return g1("sha256").update(e).digest()}Object.defineProperty(t,"__esModule",{value:!0}),t.ripemd160=r,t.sha1=function(e){return g1("sha1").update(e).digest()},t.sha256=n,t.hash160=function(e){return r(n(e))},t.hash256=function(e){return n(n(e))}}));MB(a5),a5.ripemd160,a5.sha1,a5.sha256,a5.hash160,a5.hash256;var u5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS;t.p2pkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),L4({network:L4.maybe(L4.Object),address:L4.maybe(L4.String),hash:L4.maybe(L4.BufferN(20)),output:L4.maybe(L4.BufferN(25)),pubkey:L4.maybe(Q6.isPoint),signature:L4.maybe(r5.isCanonicalScriptSignature),input:L4.maybe(L4.Buffer)},e);const n=n5.value((()=>{const t=T1.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}})),i=n5.value((()=>r5.decompile(e.input))),o=e.network||z4.bitcoin,s={name:"p2pkh",network:o};if(n5.prop(s,"address",(()=>{if(!s.hash)return;const e=eU.allocUnsafe(21);return e.writeUInt8(o.pubKeyHash,0),s.hash.copy(e,1),T1.encode(e)})),n5.prop(s,"hash",(()=>e.output?e.output.slice(3,23):e.address?n().hash:e.pubkey||s.pubkey?a5.hash160(e.pubkey||s.pubkey):void 0)),n5.prop(s,"output",(()=>{if(s.hash)return r5.compile([r.OP_DUP,r.OP_HASH160,s.hash,r.OP_EQUALVERIFY,r.OP_CHECKSIG])})),n5.prop(s,"pubkey",(()=>{if(e.input)return i()[1]})),n5.prop(s,"signature",(()=>{if(e.input)return i()[0]})),n5.prop(s,"input",(()=>{if(e.pubkey&&e.signature)return r5.compile([e.signature,e.pubkey])})),n5.prop(s,"witness",(()=>{if(s.input)return[]})),t.validate){let t=eU.from([]);if(e.address){if(n().version!==o.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==n().hash.length)throw new TypeError("Invalid address");t=n().hash}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(25!==e.output.length||e.output[0]!==r.OP_DUP||e.output[1]!==r.OP_HASH160||20!==e.output[2]||e.output[23]!==r.OP_EQUALVERIFY||e.output[24]!==r.OP_CHECKSIG)throw new TypeError("Output is invalid");const n=e.output.slice(3,23);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch");t=n}if(e.pubkey){const r=a5.hash160(e.pubkey);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.input){const r=i();if(2!==r.length)throw new TypeError("Input is invalid");if(!r5.isCanonicalScriptSignature(r[0]))throw new TypeError("Input has invalid signature");if(!Q6.isPoint(r[1]))throw new TypeError("Input has invalid pubkey");if(e.signature&&!e.signature.equals(r[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(r[1]))throw new TypeError("Pubkey mismatch");const n=a5.hash160(r[1]);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch")}}return Object.assign(s,e)}}));MB(u5),u5.p2pkh;var c5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS;t.p2sh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.input))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),L4({network:L4.maybe(L4.Object),address:L4.maybe(L4.String),hash:L4.maybe(L4.BufferN(20)),output:L4.maybe(L4.BufferN(23)),redeem:L4.maybe({network:L4.maybe(L4.Object),output:L4.maybe(L4.Buffer),input:L4.maybe(L4.Buffer),witness:L4.maybe(L4.arrayOf(L4.Buffer))}),input:L4.maybe(L4.Buffer),witness:L4.maybe(L4.arrayOf(L4.Buffer))},e);let n=e.network;n||(n=e.redeem&&e.redeem.network||z4.bitcoin);const i={network:n},o=n5.value((()=>{const t=T1.decode(e.address);return{version:t.readUInt8(0),hash:t.slice(1)}})),s=n5.value((()=>r5.decompile(e.input))),a=n5.value((()=>{const t=s();return{network:n,output:t[t.length-1],input:r5.compile(t.slice(0,-1)),witness:e.witness||[]}}));if(n5.prop(i,"address",(()=>{if(!i.hash)return;const e=eU.allocUnsafe(21);return e.writeUInt8(i.network.scriptHash,0),i.hash.copy(e,1),T1.encode(e)})),n5.prop(i,"hash",(()=>e.output?e.output.slice(2,22):e.address?o().hash:i.redeem&&i.redeem.output?a5.hash160(i.redeem.output):void 0)),n5.prop(i,"output",(()=>{if(i.hash)return r5.compile([r.OP_HASH160,i.hash,r.OP_EQUAL])})),n5.prop(i,"redeem",(()=>{if(e.input)return a()})),n5.prop(i,"input",(()=>{if(e.redeem&&e.redeem.input&&e.redeem.output)return r5.compile([].concat(r5.decompile(e.redeem.input),e.redeem.output))})),n5.prop(i,"witness",(()=>i.redeem&&i.redeem.witness?i.redeem.witness:i.input?[]:void 0)),n5.prop(i,"name",(()=>{const e=["p2sh"];return void 0!==i.redeem&&e.push(i.redeem.name),e.join("-")})),t.validate){let t=eU.from([]);if(e.address){if(o().version!==n.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==o().hash.length)throw new TypeError("Invalid address");t=o().hash}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(23!==e.output.length||e.output[0]!==r.OP_HASH160||20!==e.output[1]||e.output[22]!==r.OP_EQUAL)throw new TypeError("Output is invalid");const n=e.output.slice(2,22);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch");t=n}const i=e=>{if(e.output){const r=r5.decompile(e.output);if(!r||r.length<1)throw new TypeError("Redeem.output too short");const n=a5.hash160(e.output);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch");t=n}if(e.input){const t=e.input.length>0,r=e.witness&&e.witness.length>0;if(!t&&!r)throw new TypeError("Empty input");if(t&&r)throw new TypeError("Input and witness provided");if(t){const t=r5.decompile(e.input);if(!r5.isPushOnly(t))throw new TypeError("Non push-only scriptSig")}}};if(e.input){const e=s();if(!e||e.length<1)throw new TypeError("Input too short");if(!jU(a().output))throw new TypeError("Input is invalid");i(a())}if(e.redeem){if(e.redeem.network&&e.redeem.network!==n)throw new TypeError("Network mismatch");if(e.input){const t=a();if(e.redeem.output&&!e.redeem.output.equals(t.output))throw new TypeError("Redeem.output mismatch");if(e.redeem.input&&!e.redeem.input.equals(t.input))throw new TypeError("Redeem.input mismatch")}i(e.redeem)}if(e.witness&&e.redeem&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}(e.redeem.witness,e.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(i,e)}}));MB(c5),c5.p2sh;for(var l5="qpzry9x8gf2tvdw0s3jn54khce6mua7l",h5={},f5=0;f5<l5.length;f5++){var d5=l5.charAt(f5);if(void 0!==h5[d5])throw new TypeError(d5+" is ambiguous");h5[d5]=f5}function p5(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function g5(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=p5(t)^n>>5}for(t=p5(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=p5(t)^31&i}return t}function m5(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var i=(e=r).lastIndexOf("1");if(-1===i)return"No separator character for "+e;if(0===i)return"Missing prefix for "+e;var o=e.slice(0,i),s=e.slice(i+1);if(s.length<6)return"Data too short";var a=g5(o);if("string"==typeof a)return a;for(var u=[],c=0;c<s.length;++c){var l=s.charAt(c),h=h5[l];if(void 0===h)return"Unknown character "+l;a=p5(a)^h,c+6>=s.length||u.push(h)}return 1!==a?"Invalid checksum for "+e:{prefix:o,words:u}}function v5(e,t,r,n){for(var i=0,o=0,s=(1<<r)-1,a=[],u=0;u<e.length;++u)for(i=i<<t|e[u],o+=t;o>=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<<r-o&s);else{if(o>=t)return"Excess padding";if(i<<r-o&s)return"Non-zero padding"}return a}var y5=function(e){var t=m5.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},b5=function(e,t,r){if(r=r||90,e.length+7+t.length>r)throw new TypeError("Exceeds length limit");var n=g5(e=e.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=e+"1",o=0;o<t.length;++o){var s=t[o];if(s>>5!=0)throw new Error("Non 5-bit word");n=p5(n)^s,i+=l5.charAt(s)}for(o=0;o<6;++o)n=p5(n);for(n^=1,o=0;o<6;++o)i+=l5.charAt(n>>5*(5-o)&31);return i},w5=function(e){var t=v5(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},_5=function(e){var t=v5(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)},x5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS,n=eU.alloc(0);t.p2wpkh=function(e,t){if(!(e.address||e.hash||e.output||e.pubkey||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),L4({address:L4.maybe(L4.String),hash:L4.maybe(L4.BufferN(20)),input:L4.maybe(L4.BufferN(0)),network:L4.maybe(L4.Object),output:L4.maybe(L4.BufferN(22)),pubkey:L4.maybe(Q6.isPoint),signature:L4.maybe(r5.isCanonicalScriptSignature),witness:L4.maybe(L4.arrayOf(L4.Buffer))},e);const i=n5.value((()=>{const t=y5(e.address),r=t.words.shift(),n=_5(t.words);return{version:r,prefix:t.prefix,data:eU.from(n)}})),o=e.network||z4.bitcoin,s={name:"p2wpkh",network:o};if(n5.prop(s,"address",(()=>{if(!s.hash)return;const e=w5(s.hash);return e.unshift(0),b5(o.bech32,e)})),n5.prop(s,"hash",(()=>e.output?e.output.slice(2,22):e.address?i().data:e.pubkey||s.pubkey?a5.hash160(e.pubkey||s.pubkey):void 0)),n5.prop(s,"output",(()=>{if(s.hash)return r5.compile([r.OP_0,s.hash])})),n5.prop(s,"pubkey",(()=>e.pubkey?e.pubkey:e.witness?e.witness[1]:void 0)),n5.prop(s,"signature",(()=>{if(e.witness)return e.witness[0]})),n5.prop(s,"input",(()=>{if(s.witness)return n})),n5.prop(s,"witness",(()=>{if(e.pubkey&&e.signature)return[e.signature,e.pubkey]})),t.validate){let t=eU.from([]);if(e.address){if(o&&o.bech32!==i().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(0!==i().version)throw new TypeError("Invalid address version");if(20!==i().data.length)throw new TypeError("Invalid address data");t=i().data}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(22!==e.output.length||e.output[0]!==r.OP_0||20!==e.output[1])throw new TypeError("Output is invalid");if(t.length>0&&!t.equals(e.output.slice(2)))throw new TypeError("Hash mismatch");t=e.output.slice(2)}if(e.pubkey){const r=a5.hash160(e.pubkey);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");if(t=r,!Q6.isPoint(e.pubkey)||33!==e.pubkey.length)throw new TypeError("Invalid pubkey for p2wpkh")}if(e.witness){if(2!==e.witness.length)throw new TypeError("Witness is invalid");if(!r5.isCanonicalScriptSignature(e.witness[0]))throw new TypeError("Witness has invalid signature");if(!Q6.isPoint(e.witness[1])||33!==e.witness[1].length)throw new TypeError("Witness has invalid pubkey");if(e.signature&&!e.signature.equals(e.witness[0]))throw new TypeError("Signature mismatch");if(e.pubkey&&!e.pubkey.equals(e.witness[1]))throw new TypeError("Pubkey mismatch");const r=a5.hash160(e.witness[1]);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch")}}return Object.assign(s,e)}}));MB(x5),x5.p2wpkh;var S5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS,n=eU.alloc(0);function i(e){return!(!jU(e)||65!==e.length||4!==e[0]||!Q6.isPoint(e))}t.p2wsh=function(e,t){if(!(e.address||e.hash||e.output||e.redeem||e.witness))throw new TypeError("Not enough data");t=Object.assign({validate:!0},t||{}),L4({network:L4.maybe(L4.Object),address:L4.maybe(L4.String),hash:L4.maybe(L4.BufferN(32)),output:L4.maybe(L4.BufferN(34)),redeem:L4.maybe({input:L4.maybe(L4.Buffer),network:L4.maybe(L4.Object),output:L4.maybe(L4.Buffer),witness:L4.maybe(L4.arrayOf(L4.Buffer))}),input:L4.maybe(L4.BufferN(0)),witness:L4.maybe(L4.arrayOf(L4.Buffer))},e);const o=n5.value((()=>{const t=y5(e.address),r=t.words.shift(),n=_5(t.words);return{version:r,prefix:t.prefix,data:eU.from(n)}})),s=n5.value((()=>r5.decompile(e.redeem.input)));let a=e.network;a||(a=e.redeem&&e.redeem.network||z4.bitcoin);const u={network:a};if(n5.prop(u,"address",(()=>{if(!u.hash)return;const e=w5(u.hash);return e.unshift(0),b5(a.bech32,e)})),n5.prop(u,"hash",(()=>e.output?e.output.slice(2):e.address?o().data:u.redeem&&u.redeem.output?a5.sha256(u.redeem.output):void 0)),n5.prop(u,"output",(()=>{if(u.hash)return r5.compile([r.OP_0,u.hash])})),n5.prop(u,"redeem",(()=>{if(e.witness)return{output:e.witness[e.witness.length-1],input:n,witness:e.witness.slice(0,-1)}})),n5.prop(u,"input",(()=>{if(u.witness)return n})),n5.prop(u,"witness",(()=>{if(e.redeem&&e.redeem.input&&e.redeem.input.length>0&&e.redeem.output&&e.redeem.output.length>0){const t=r5.toStack(s());return u.redeem=Object.assign({witness:t},e.redeem),u.redeem.input=n,[].concat(t,e.redeem.output)}if(e.redeem&&e.redeem.output&&e.redeem.witness)return[].concat(e.redeem.witness,e.redeem.output)})),n5.prop(u,"name",(()=>{const e=["p2wsh"];return void 0!==u.redeem&&e.push(u.redeem.name),e.join("-")})),t.validate){let t=eU.from([]);if(e.address){if(o().prefix!==a.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==o().version)throw new TypeError("Invalid address version");if(32!==o().data.length)throw new TypeError("Invalid address data");t=o().data}if(e.hash){if(t.length>0&&!t.equals(e.hash))throw new TypeError("Hash mismatch");t=e.hash}if(e.output){if(34!==e.output.length||e.output[0]!==r.OP_0||32!==e.output[1])throw new TypeError("Output is invalid");const n=e.output.slice(2);if(t.length>0&&!t.equals(n))throw new TypeError("Hash mismatch");t=n}if(e.redeem){if(e.redeem.network&&e.redeem.network!==a)throw new TypeError("Network mismatch");if(e.redeem.input&&e.redeem.input.length>0&&e.redeem.witness&&e.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(e.redeem.output){if(0===r5.decompile(e.redeem.output).length)throw new TypeError("Redeem.output is invalid");const r=a5.sha256(e.redeem.output);if(t.length>0&&!t.equals(r))throw new TypeError("Hash mismatch");t=r}if(e.redeem.input&&!r5.isPushOnly(s()))throw new TypeError("Non push-only scriptSig");if(e.witness&&e.redeem.witness&&!function(e,t){return e.length===t.length&&e.every(((e,r)=>e.equals(t[r])))}(e.witness,e.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(e.redeem.input&&s().some(i)||e.redeem.output&&(r5.decompile(e.redeem.output)||[]).some(i))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(e.witness&&e.witness.length>0){const t=e.witness[e.witness.length-1];if(e.redeem&&e.redeem.output&&!e.redeem.output.equals(t))throw new TypeError("Witness and redeem.output mismatch");if(e.witness.some(i)||(r5.decompile(t)||[]).some(i))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(u,e)}}));MB(S5),S5.p2wsh;var E5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.embed=i5.p2data,t.p2ms=o5.p2ms,t.p2pk=s5.p2pk,t.p2pkh=u5.p2pkh,t.p2sh=c5.p2sh,t.p2wpkh=x5.p2wpkh,t.p2wsh=S5.p2wsh}));MB(E5),E5.embed,E5.p2ms,E5.p2pk,E5.p2pkh,E5.p2sh,E5.p2wpkh,E5.p2wsh;var k5=RB((function(e,t){function r(e){const t=T1.decode(e);if(t.length<21)throw new TypeError(e+" is too short");if(t.length>21)throw new TypeError(e+" is too long");return{version:t.readUInt8(0),hash:t.slice(1)}}function n(e){const t=y5(e),r=_5(t.words.slice(1));return{version:t.words[0],prefix:t.prefix,data:eU.from(r)}}Object.defineProperty(t,"__esModule",{value:!0}),t.fromBase58Check=r,t.fromBech32=n,t.toBase58Check=function(e,t){L4(q4.tuple(q4.Hash160bit,q4.UInt8),arguments);const r=eU.allocUnsafe(21);return r.writeUInt8(t,0),e.copy(r,1),T1.encode(r)},t.toBech32=function(e,t,r){const n=w5(e);return n.unshift(t),b5(r,n)},t.fromOutputScript=function(e,t){t=t||z4.bitcoin;try{return E5.p2pkh({output:e,network:t}).address}catch(e){}try{return E5.p2sh({output:e,network:t}).address}catch(e){}try{return E5.p2wpkh({output:e,network:t}).address}catch(e){}try{return E5.p2wsh({output:e,network:t}).address}catch(e){}throw new Error(r5.toASM(e)+" has no matching Address")},t.toOutputScript=function(e,t){let i,o;t=t||z4.bitcoin;try{i=r(e)}catch(e){}if(i){if(i.version===t.pubKeyHash)return E5.p2pkh({hash:i.hash}).output;if(i.version===t.scriptHash)return E5.p2sh({hash:i.hash}).output}else{try{o=n(e)}catch(e){}if(o){if(o.prefix!==t.bech32)throw new Error(e+" has an invalid prefix");if(0===o.version){if(20===o.data.length)return E5.p2wpkh({hash:o.data}).output;if(32===o.data.length)return E5.p2wsh({hash:o.data}).output}}}throw new Error(e+" has no matching Script")}}));MB(k5),k5.fromBase58Check,k5.fromBech32,k5.toBase58Check,k5.toBech32,k5.fromOutputScript,k5.toOutputScript;var I5=RB((function(e){var t=65536,r=QX.Buffer,n=CB.crypto||CB.msCrypto;n&&n.getRandomValues?e.exports=function(e,i){if(e>4294967295)throw new RangeError("requested too many random bytes");var o=r.allocUnsafe(e);if(e>0)if(e>t)for(var s=0;s<e;s+=t)n.getRandomValues(o.slice(s,s+t));else n.getRandomValues(o);return"function"==typeof i?XU((function(){i(null,o)})):o}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}})),A5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=L4.maybe(L4.compile({compressed:q4.maybe(q4.Boolean),network:q4.maybe(q4.Network)}));class n{constructor(e,t,r){this.__D=e,this.__Q=t,this.lowR=!1,void 0===r&&(r={}),this.compressed=void 0===r.compressed||r.compressed,this.network=r.network||z4.bitcoin,void 0!==t&&(this.__Q=Q6.pointCompress(t,this.compressed))}get privateKey(){return this.__D}get publicKey(){return this.__Q||(this.__Q=Q6.pointFromScalar(this.__D,this.compressed)),this.__Q}toWIF(){if(!this.__D)throw new Error("Missing private key");return U4(this.network.wif,this.__D,this.compressed)}sign(e,t){if(!this.__D)throw new Error("Missing private key");if(void 0===t&&(t=this.lowR),!1===t)return Q6.sign(e,this.__D);{let t=Q6.sign(e,this.__D);const r=eU.alloc(32,0);let n=0;for(;t[0]>127;)n++,r.writeUIntLE(n,0,6),t=Q6.signWithEntropy(e,this.__D,r);return t}}verify(e,t){return Q6.verify(e,this.publicKey,t)}}function i(e,t){if(L4(q4.Buffer256bit,e),!Q6.isPrivate(e))throw new TypeError("Private key not in range [1, n)");return L4(r,t),new n(e,void 0,t)}t.fromPrivateKey=i,t.fromPublicKey=function(e,t){return L4(Q6.isPoint,e),L4(r,t),new n(void 0,e,t)},t.fromWIF=function(e,t){const r=B4(e),n=r.version;if(q4.Array(t)){if(!(t=t.filter((e=>n===e.wif)).pop()))throw new Error("Unknown network version")}else if(t=t||z4.bitcoin,n!==t.wif)throw new Error("Invalid network version");return i(r.privateKey,{compressed:r.compressed,network:t})},t.makeRandom=function(e){L4(r,e),void 0===e&&(e={});const t=e.rng||I5;let n;do{n=t(32),L4(q4.Buffer256bit,n)}while(!Q6.isPrivate(n));return i(n,e)}}));MB(A5),A5.fromPrivateKey,A5.fromPublicKey,A5.fromWIF,A5.makeRandom;var P5=QX.Buffer;function T5(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function O5(e){return T5(e),e<253?1:e<=65535?3:e<=4294967295?5:9}var C5={encode:function e(t,r,n){if(T5(t),r||(r=P5.allocUnsafe(O5(t))),!P5.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return n||(n=0),t<253?(r.writeUInt8(t,n),e.bytes=1):t<=65535?(r.writeUInt8(253,n),r.writeUInt16LE(t,n+1),e.bytes=3):t<=4294967295?(r.writeUInt8(254,n),r.writeUInt32LE(t,n+1),e.bytes=5):(r.writeUInt8(255,n),r.writeUInt32LE(t>>>0,n+1),r.writeUInt32LE(t/4294967296|0,n+5),e.bytes=9),r},decode:function e(t,r){if(!P5.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var n=t.readUInt8(r);if(n<253)return e.bytes=1,n;if(253===n)return e.bytes=3,t.readUInt16LE(r+1);if(254===n)return e.bytes=5,t.readUInt32LE(r+1);e.bytes=9;var i=t.readUInt32LE(r+1),o=4294967296*t.readUInt32LE(r+5)+i;return T5(o),o},encodingLength:O5},M5=RB((function(e,t){function r(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}function n(e,t){const n=e.readUInt32LE(t);let i=e.readUInt32LE(t+4);return i*=4294967296,r(i+n,9007199254740991),i+n}function i(e,t,n){return r(t,9007199254740991),e.writeInt32LE(-1&t,n),e.writeUInt32LE(Math.floor(t/4294967296),n+4),n+8}Object.defineProperty(t,"__esModule",{value:!0}),t.readUInt64LE=n,t.writeUInt64LE=i,t.reverseBuffer=function(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.cloneBuffer=function(e){const t=eU.allocUnsafe(e.length);return e.copy(t),t},t.BufferWriter=class{constructor(e,t=0){this.buffer=e,this.offset=t,L4(q4.tuple(q4.Buffer,q4.UInt32),[e,t])}writeUInt8(e){this.offset=this.buffer.writeUInt8(e,this.offset)}writeInt32(e){this.offset=this.buffer.writeInt32LE(e,this.offset)}writeUInt32(e){this.offset=this.buffer.writeUInt32LE(e,this.offset)}writeUInt64(e){this.offset=i(this.buffer,e,this.offset)}writeVarInt(e){C5.encode(e,this.buffer,this.offset),this.offset+=C5.encode.bytes}writeSlice(e){if(this.buffer.length<this.offset+e.length)throw new Error("Cannot write slice out of bounds");this.offset+=e.copy(this.buffer,this.offset)}writeVarSlice(e){this.writeVarInt(e.length),this.writeSlice(e)}writeVector(e){this.writeVarInt(e.length),e.forEach((e=>this.writeVarSlice(e)))}},t.BufferReader=class{constructor(e,t=0){this.buffer=e,this.offset=t,L4(q4.tuple(q4.Buffer,q4.UInt32),[e,t])}readUInt8(){const e=this.buffer.readUInt8(this.offset);return this.offset++,e}readInt32(){const e=this.buffer.readInt32LE(this.offset);return this.offset+=4,e}readUInt32(){const e=this.buffer.readUInt32LE(this.offset);return this.offset+=4,e}readUInt64(){const e=n(this.buffer,this.offset);return this.offset+=8,e}readVarInt(){const e=C5.decode(this.buffer,this.offset);return this.offset+=C5.decode.bytes,e}readSlice(e){if(this.buffer.length<this.offset+e)throw new Error("Cannot read slice out of bounds");const t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t}readVarSlice(){return this.readSlice(this.readVarInt())}readVector(){const e=this.readVarInt(),t=[];for(let r=0;r<e;r++)t.push(this.readVarSlice());return t}}}));MB(M5),M5.readUInt64LE,M5.writeUInt64LE,M5.reverseBuffer,M5.cloneBuffer,M5.BufferWriter,M5.BufferReader;var R5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5;function n(e){const t=e.length;return C5.encodingLength(t)+t}const i=eU.allocUnsafe(0),o=[],s=eU.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),a=eU.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),u=eU.from("ffffffffffffffff","hex"),c={script:i,valueBuffer:u};class l{constructor(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}static fromBuffer(e,t){const r=new M5.BufferReader(e),n=new l;n.version=r.readInt32();const i=r.readUInt8(),s=r.readUInt8();let a=!1;i===l.ADVANCED_TRANSACTION_MARKER&&s===l.ADVANCED_TRANSACTION_FLAG?a=!0:r.offset-=2;const u=r.readVarInt();for(let e=0;e<u;++e)n.ins.push({hash:r.readSlice(32),index:r.readUInt32(),script:r.readVarSlice(),sequence:r.readUInt32(),witness:o});const c=r.readVarInt();for(let e=0;e<c;++e)n.outs.push({value:r.readUInt64(),script:r.readVarSlice()});if(a){for(let e=0;e<u;++e)n.ins[e].witness=r.readVector();if(!n.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(n.locktime=r.readUInt32(),t)return n;if(r.offset!==e.length)throw new Error("Transaction has unexpected data");return n}static fromHex(e){return l.fromBuffer(eU.from(e,"hex"),!1)}static isCoinbaseHash(e){L4(q4.Hash256bit,e);for(let t=0;t<32;++t)if(0!==e[t])return!1;return!0}isCoinbase(){return 1===this.ins.length&&l.isCoinbaseHash(this.ins[0].hash)}addInput(e,t,r,n){return L4(q4.tuple(q4.Hash256bit,q4.UInt32,q4.maybe(q4.UInt32),q4.maybe(q4.Buffer)),arguments),q4.Null(r)&&(r=l.DEFAULT_SEQUENCE),this.ins.push({hash:e,index:t,script:n||i,sequence:r,witness:o})-1}addOutput(e,t){return L4(q4.tuple(q4.Buffer,q4.Satoshi),arguments),this.outs.push({script:e,value:t})-1}hasWitnesses(){return this.ins.some((e=>0!==e.witness.length))}weight(){return 3*this.byteLength(!1)+this.byteLength(!0)}virtualSize(){return Math.ceil(this.weight()/4)}byteLength(e=!0){const t=e&&this.hasWitnesses();return(t?10:8)+C5.encodingLength(this.ins.length)+C5.encodingLength(this.outs.length)+this.ins.reduce(((e,t)=>e+40+n(t.script)),0)+this.outs.reduce(((e,t)=>e+8+n(t.script)),0)+(t?this.ins.reduce(((e,t)=>e+function(e){const t=e.length;return C5.encodingLength(t)+e.reduce(((e,t)=>e+n(t)),0)}(t.witness)),0):0)}clone(){const e=new l;return e.version=this.version,e.locktime=this.locktime,e.ins=this.ins.map((e=>({hash:e.hash,index:e.index,script:e.script,sequence:e.sequence,witness:e.witness}))),e.outs=this.outs.map((e=>({script:e.script,value:e.value}))),e}hashForSignature(e,t,n){if(L4(q4.tuple(q4.UInt32,q4.Buffer,q4.Number),arguments),e>=this.ins.length)return a;const o=r5.compile(r5.decompile(t).filter((e=>e!==r.OPS.OP_CODESEPARATOR))),s=this.clone();if((31&n)===l.SIGHASH_NONE)s.outs=[],s.ins.forEach(((t,r)=>{r!==e&&(t.sequence=0)}));else if((31&n)===l.SIGHASH_SINGLE){if(e>=this.outs.length)return a;s.outs.length=e+1;for(let t=0;t<e;t++)s.outs[t]=c;s.ins.forEach(((t,r)=>{r!==e&&(t.sequence=0)}))}n&l.SIGHASH_ANYONECANPAY?(s.ins=[s.ins[e]],s.ins[0].script=o):(s.ins.forEach((e=>{e.script=i})),s.ins[e].script=o);const u=eU.allocUnsafe(s.byteLength(!1)+4);return u.writeInt32LE(n,u.length-4),s.__toBuffer(u,0,!1),a5.hash256(u)}hashForWitnessV0(e,t,r,i){L4(q4.tuple(q4.UInt32,q4.Buffer,q4.Satoshi,q4.UInt32),arguments);let o,a=eU.from([]),u=s,c=s,h=s;if(i&l.SIGHASH_ANYONECANPAY||(a=eU.allocUnsafe(36*this.ins.length),o=new M5.BufferWriter(a,0),this.ins.forEach((e=>{o.writeSlice(e.hash),o.writeUInt32(e.index)})),c=a5.hash256(a)),i&l.SIGHASH_ANYONECANPAY||(31&i)===l.SIGHASH_SINGLE||(31&i)===l.SIGHASH_NONE||(a=eU.allocUnsafe(4*this.ins.length),o=new M5.BufferWriter(a,0),this.ins.forEach((e=>{o.writeUInt32(e.sequence)})),h=a5.hash256(a)),(31&i)!==l.SIGHASH_SINGLE&&(31&i)!==l.SIGHASH_NONE){const e=this.outs.reduce(((e,t)=>e+8+n(t.script)),0);a=eU.allocUnsafe(e),o=new M5.BufferWriter(a,0),this.outs.forEach((e=>{o.writeUInt64(e.value),o.writeVarSlice(e.script)})),u=a5.hash256(a)}else if((31&i)===l.SIGHASH_SINGLE&&e<this.outs.length){const t=this.outs[e];a=eU.allocUnsafe(8+n(t.script)),o=new M5.BufferWriter(a,0),o.writeUInt64(t.value),o.writeVarSlice(t.script),u=a5.hash256(a)}a=eU.allocUnsafe(156+n(t)),o=new M5.BufferWriter(a,0);const f=this.ins[e];return o.writeUInt32(this.version),o.writeSlice(c),o.writeSlice(h),o.writeSlice(f.hash),o.writeUInt32(f.index),o.writeVarSlice(t),o.writeUInt64(r),o.writeUInt32(f.sequence),o.writeSlice(u),o.writeUInt32(this.locktime),o.writeUInt32(i),a5.hash256(a)}getHash(e){return e&&this.isCoinbase()?eU.alloc(32,0):a5.hash256(this.__toBuffer(void 0,void 0,e))}getId(){return M5.reverseBuffer(this.getHash(!1)).toString("hex")}toBuffer(e,t){return this.__toBuffer(e,t,!0)}toHex(){return this.toBuffer(void 0,void 0).toString("hex")}setInputScript(e,t){L4(q4.tuple(q4.Number,q4.Buffer),arguments),this.ins[e].script=t}setWitness(e,t){L4(q4.tuple(q4.Number,[q4.Buffer]),arguments),this.ins[e].witness=t}__toBuffer(e,t,r=!1){e||(e=eU.allocUnsafe(this.byteLength(r)));const n=new M5.BufferWriter(e,t||0);n.writeInt32(this.version);const i=r&&this.hasWitnesses();return i&&(n.writeUInt8(l.ADVANCED_TRANSACTION_MARKER),n.writeUInt8(l.ADVANCED_TRANSACTION_FLAG)),n.writeVarInt(this.ins.length),this.ins.forEach((e=>{n.writeSlice(e.hash),n.writeUInt32(e.index),n.writeVarSlice(e.script),n.writeUInt32(e.sequence)})),n.writeVarInt(this.outs.length),this.outs.forEach((e=>{void 0!==e.value?n.writeUInt64(e.value):n.writeSlice(e.valueBuffer),n.writeVarSlice(e.script)})),i&&this.ins.forEach((e=>{n.writeVector(e.witness)})),n.writeUInt32(this.locktime),void 0!==t?e.slice(t,n.offset):e}}l.DEFAULT_SEQUENCE=4294967295,l.SIGHASH_ALL=1,l.SIGHASH_NONE=2,l.SIGHASH_SINGLE=3,l.SIGHASH_ANYONECANPAY=128,l.ADVANCED_TRANSACTION_MARKER=0,l.ADVANCED_TRANSACTION_FLAG=1,t.Transaction=l}));MB(R5),R5.Transaction;var N5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=new TypeError("Cannot compute merkle root for zero transactions"),n=new TypeError("Cannot compute witness commit for non-segwit block");class i{constructor(){this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}static fromBuffer(e){if(e.length<80)throw new Error("Buffer too small (< 80 bytes)");const t=new M5.BufferReader(e),r=new i;if(r.version=t.readInt32(),r.prevHash=t.readSlice(32),r.merkleRoot=t.readSlice(32),r.timestamp=t.readUInt32(),r.bits=t.readUInt32(),r.nonce=t.readUInt32(),80===e.length)return r;const n=()=>{const e=R5.Transaction.fromBuffer(t.buffer.slice(t.offset),!0);return t.offset+=e.byteLength(),e},o=t.readVarInt();r.transactions=[];for(let e=0;e<o;++e){const e=n();r.transactions.push(e)}const s=r.getWitnessCommit();return s&&(r.witnessCommit=s),r}static fromHex(e){return i.fromBuffer(eU.from(e,"hex"))}static calculateTarget(e){const t=((4278190080&e)>>24)-3,r=8388607&e,n=eU.alloc(32,0);return n.writeUIntBE(r,29-t,3),n}static calculateMerkleRoot(e,t){if(L4([{getHash:q4.Function}],e),0===e.length)throw r;if(t&&!o(e))throw n;const i=function(e,t){if(!Array.isArray(e))throw TypeError("Expected values Array");if("function"!=typeof t)throw TypeError("Expected digest Function");for(var r=e.length,n=e.concat();r>1;){for(var i=0,o=0;o<r;o+=2,++i){var s=n[o],a=o+1===r?s:n[o+1],u=eU.concat([s,a]);n[i]=t(u)}r=i}return n[0]}(e.map((e=>e.getHash(t))),a5.hash256);return t?a5.hash256(eU.concat([i,e[0].ins[0].witness[0]])):i}getWitnessCommit(){if(!o(this.transactions))return null;const e=this.transactions[0].outs.filter((e=>e.script.slice(0,6).equals(eU.from("6a24aa21a9ed","hex")))).map((e=>e.script.slice(6,38)));if(0===e.length)return null;const t=e[e.length-1];return t instanceof eU&&32===t.length?t:null}hasWitnessCommit(){return this.witnessCommit instanceof eU&&32===this.witnessCommit.length||null!==this.getWitnessCommit()}hasWitness(){return(e=this.transactions)instanceof Array&&e.some((e=>"object"==typeof e&&e.ins instanceof Array&&e.ins.some((e=>"object"==typeof e&&e.witness instanceof Array&&e.witness.length>0))));var e}weight(){return 3*this.byteLength(!1,!1)+this.byteLength(!1,!0)}byteLength(e,t=!0){return e||!this.transactions?80:80+C5.encodingLength(this.transactions.length)+this.transactions.reduce(((e,r)=>e+r.byteLength(t)),0)}getHash(){return a5.hash256(this.toBuffer(!0))}getId(){return M5.reverseBuffer(this.getHash()).toString("hex")}getUTCDate(){const e=new Date(0);return e.setUTCSeconds(this.timestamp),e}toBuffer(e){const t=eU.allocUnsafe(this.byteLength(e)),r=new M5.BufferWriter(t);return r.writeInt32(this.version),r.writeSlice(this.prevHash),r.writeSlice(this.merkleRoot),r.writeUInt32(this.timestamp),r.writeUInt32(this.bits),r.writeUInt32(this.nonce),e||!this.transactions||(C5.encode(this.transactions.length,t,r.offset),r.offset+=C5.encode.bytes,this.transactions.forEach((e=>{const n=e.byteLength();e.toBuffer(t,r.offset),r.offset+=n}))),t}toHex(e){return this.toBuffer(e).toString("hex")}checkTxRoots(){const e=this.hasWitnessCommit();return!(!e&&this.hasWitness())&&this.__checkMerkleRoot()&&(!e||this.__checkWitnessCommit())}checkProofOfWork(){const e=M5.reverseBuffer(this.getHash()),t=i.calculateTarget(this.bits);return e.compare(t)<=0}__checkMerkleRoot(){if(!this.transactions)throw r;const e=i.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(e)}__checkWitnessCommit(){if(!this.transactions)throw r;if(!this.hasWitnessCommit())throw n;const e=i.calculateMerkleRoot(this.transactions,!0);return 0===this.witnessCommit.compare(e)}}function o(e){return e instanceof Array&&e[0]&&e[0].ins&&e[0].ins instanceof Array&&e[0].ins[0]&&e[0].ins[0].witness&&e[0].ins[0].witness instanceof Array&&e[0].ins[0].witness.length>0}t.Block=i}));MB(N5),N5.Block;var L5=RB((function(e,t){var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),(r=t.GlobalTypes||(t.GlobalTypes={}))[r.UNSIGNED_TX=0]="UNSIGNED_TX",r[r.GLOBAL_XPUB=1]="GLOBAL_XPUB",t.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"],(n=t.InputTypes||(t.InputTypes={}))[n.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",n[n.WITNESS_UTXO=1]="WITNESS_UTXO",n[n.PARTIAL_SIG=2]="PARTIAL_SIG",n[n.SIGHASH_TYPE=3]="SIGHASH_TYPE",n[n.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",n[n.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",n[n.BIP32_DERIVATION=6]="BIP32_DERIVATION",n[n.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",n[n.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",n[n.POR_COMMITMENT=9]="POR_COMMITMENT",t.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment"],(i=t.OutputTypes||(t.OutputTypes={}))[i.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",i[i.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",i[i.BIP32_DERIVATION=2]="BIP32_DERIVATION",t.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation"]}));MB(L5),L5.GlobalTypes,L5.GLOBAL_TYPE_NAMES,L5.InputTypes,L5.INPUT_TYPE_NAMES,L5.OutputTypes,L5.OUTPUT_TYPE_NAMES;var j5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+e.key.toString("hex"));if(79!==e.key.length||![2,3].includes(e.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+e.key.toString("hex"));if(e.value.length/4%1!=0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");const t=e.key.slice(1),r={masterFingerprint:e.value.slice(0,4),extendedPubkey:t,path:"m"};for(const t of(e=>[...Array(e).keys()])(e.value.length/4-1)){const n=e.value.readUInt32LE(4*t+4),i=!!(2147483648&n),o=2147483647&n;r.path+="/"+o.toString(10)+(i?"'":"")}return r},t.encode=function(e){const t=eU.from([L5.GlobalTypes.GLOBAL_XPUB]),r=eU.concat([t,e.extendedPubkey]),n=e.path.split("/"),i=eU.allocUnsafe(4*n.length);e.masterFingerprint.copy(i,0);let o=4;return n.slice(1).forEach((e=>{const t="'"===e.slice(-1);let r=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(r+=2147483648),i.writeUInt32LE(r,o),o+=4})),{key:r,value:i}},t.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }",t.check=function(e){const t=e.extendedPubkey,r=e.masterFingerprint,n=e.path;return jU(t)&&78===t.length&&[2,3].indexOf(t[45])>-1&&jU(r)&&4===r.length&&"string"==typeof n&&!!n.match(/^m(\/\d+'?)+$/)},t.canAddToArray=function(e,t,r){const n=t.extendedPubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter((e=>e.extendedPubkey.equals(t.extendedPubkey))).length)}}));MB(j5),j5.decode,j5.encode,j5.expected,j5.check,j5.canAddToArray;var D5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.encode=function(e){return{key:eU.from([L5.GlobalTypes.UNSIGNED_TX]),value:e.toBuffer()}}}));MB(D5),D5.encode;var B5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:eU.from([L5.InputTypes.FINAL_SCRIPTSIG]),value:e}},t.expected="Buffer",t.check=function(e){return jU(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptSig}}));MB(B5),B5.decode,B5.encode,B5.expected,B5.check,B5.canAdd;var U5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:eU.from([L5.InputTypes.FINAL_SCRIPTWITNESS]),value:e}},t.expected="Buffer",t.check=function(e){return jU(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.finalScriptWitness}}));MB(U5),U5.decode,U5.encode,U5.expected,U5.check,U5.canAdd;var F5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+e.key.toString("hex"));return e.value},t.encode=function(e){return{key:eU.from([L5.InputTypes.NON_WITNESS_UTXO]),value:e}},t.expected="Buffer",t.check=function(e){return jU(e)},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.nonWitnessUtxo}}));MB(F5),F5.decode,F5.encode,F5.expected,F5.check,F5.canAdd;var H5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+e.key.toString("hex"));if(34!==e.key.length&&66!==e.key.length||![2,3,4].includes(e.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+e.key.toString("hex"));return{pubkey:e.key.slice(1),signature:e.value}},t.encode=function(e){const t=eU.from([L5.InputTypes.PARTIAL_SIG]);return{key:eU.concat([t,e.pubkey]),value:e.signature}},t.expected="{ pubkey: Buffer; signature: Buffer; }",t.check=function(e){return jU(e.pubkey)&&jU(e.signature)&&[33,65].includes(e.pubkey.length)&&[2,3,4].includes(e.pubkey[0])&&function(e){if(!jU(e)||e.length<9)return!1;if(48!==e[0])return!1;if(e.length!==e[1]+3)return!1;if(2!==e[2])return!1;const t=e[3];if(t>33||t<1)return!1;if(2!==e[3+t+1])return!1;const r=e[3+t+2];return!(r>33||r<1)&&e.length===3+t+2+r+2}(e.signature)},t.canAddToArray=function(e,t,r){const n=t.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter((e=>e.pubkey.equals(t.pubkey))).length)}}));MB(H5),H5.decode,H5.encode,H5.expected,H5.check,H5.canAddToArray;var z5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+e.key.toString("hex"));return e.value.toString("utf8")},t.encode=function(e){return{key:eU.from([L5.InputTypes.POR_COMMITMENT]),value:eU.from(e,"utf8")}},t.expected="string",t.check=function(e){return"string"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.porCommitment}}));MB(z5),z5.decode,z5.encode,z5.expected,z5.check,z5.canAdd;var V5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+e.key.toString("hex"));return e.value.readUInt32LE(0)},t.encode=function(e){const t=eU.from([L5.InputTypes.SIGHASH_TYPE]),r=eU.allocUnsafe(4);return r.writeUInt32LE(e,0),{key:t,value:r}},t.expected="number",t.check=function(e){return"number"==typeof e},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.sighashType}}));MB(V5),V5.decode,V5.encode,V5.expected,V5.check,V5.canAdd;var q5=RB((function(e,t){function r(e){if(e<0||e>9007199254740991||e%1!=0)throw new RangeError("value out of range")}function n(e){return r(e),e<253?1:e<=65535?3:e<=4294967295?5:9}Object.defineProperty(t,"__esModule",{value:!0}),t.encode=function e(t,i,o){if(r(t),i||(i=eU.allocUnsafe(n(t))),!jU(i))throw new TypeError("buffer must be a Buffer instance");return o||(o=0),t<253?(i.writeUInt8(t,o),Object.assign(e,{bytes:1})):t<=65535?(i.writeUInt8(253,o),i.writeUInt16LE(t,o+1),Object.assign(e,{bytes:3})):t<=4294967295?(i.writeUInt8(254,o),i.writeUInt32LE(t,o+1),Object.assign(e,{bytes:5})):(i.writeUInt8(255,o),i.writeUInt32LE(t>>>0,o+1),i.writeUInt32LE(t/4294967296|0,o+5),Object.assign(e,{bytes:9})),i},t.decode=function e(t,n){if(!jU(t))throw new TypeError("buffer must be a Buffer instance");n||(n=0);const i=t.readUInt8(n);if(i<253)return Object.assign(e,{bytes:1}),i;if(253===i)return Object.assign(e,{bytes:3}),t.readUInt16LE(n+1);if(254===i)return Object.assign(e,{bytes:5}),t.readUInt32LE(n+1);{Object.assign(e,{bytes:9});const i=t.readUInt32LE(n+1),o=4294967296*t.readUInt32LE(n+5)+i;return r(o),o}},t.encodingLength=n}));MB(q5),q5.encode,q5.decode,q5.encodingLength;var K5=RB((function(e,t){function r(e){const t=e.key.length,r=e.value.length,n=q5.encodingLength(t),i=q5.encodingLength(r),o=eU.allocUnsafe(n+t+i+r);return q5.encode(t,o,0),e.key.copy(o,n),q5.encode(r,o,n+t),e.value.copy(o,n+t+i),o}function n(e,t){if("number"!=typeof e)throw new Error("cannot write a non-number as a number");if(e<0)throw new Error("specified a negative value for writing an unsigned value");if(e>t)throw new Error("RangeError: value out of range");if(Math.floor(e)!==e)throw new Error("value has a fractional component")}Object.defineProperty(t,"__esModule",{value:!0}),t.range=e=>[...Array(e).keys()],t.reverseBuffer=function(e){if(e.length<1)return e;let t=e.length-1,r=0;for(let n=0;n<e.length/2;n++)r=e[n],e[n]=e[t],e[t]=r,t--;return e},t.keyValsToBuffer=function(e){const t=e.map(r);return t.push(eU.from([0])),eU.concat(t)},t.keyValToBuffer=r,t.readUInt64LE=function(e,t){const r=e.readUInt32LE(t);let i=e.readUInt32LE(t+4);return i*=4294967296,n(i+r,9007199254740991),i+r},t.writeUInt64LE=function(e,t,r){return n(t,9007199254740991),e.writeInt32LE(-1&t,r),e.writeUInt32LE(Math.floor(t/4294967296),r+4),r+8}}));MB(K5),K5.range,K5.reverseBuffer,K5.keyValsToBuffer,K5.keyValToBuffer,K5.readUInt64LE,K5.writeUInt64LE;var $5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.decode=function(e){if(e.key[0]!==L5.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+e.key.toString("hex"));const t=K5.readUInt64LE(e.value,0);let r=8;const n=q5.decode(e.value,r);r+=q5.encodingLength(n);const i=e.value.slice(r);if(i.length!==n)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:i,value:t}},t.encode=function(e){const{script:t,value:r}=e,n=q5.encodingLength(t.length),i=eU.allocUnsafe(8+n+t.length);return K5.writeUInt64LE(i,r,0),q5.encode(t.length,i,8),t.copy(i,8+n),{key:eU.from([L5.InputTypes.WITNESS_UTXO]),value:i}},t.expected="{ script: Buffer; value: number; }",t.check=function(e){return jU(e.script)&&"number"==typeof e.value},t.canAdd=function(e,t){return!!e&&!!t&&void 0===e.witnessUtxo}}));MB($5),$5.decode,$5.encode,$5.expected,$5.check,$5.canAdd;var W5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+t.key.toString("hex"));if(34!==t.key.length&&66!==t.key.length||![2,3,4].includes(t.key[1]))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+t.key.toString("hex"));if(t.value.length/4%1!=0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");const r=t.key.slice(1),n={masterFingerprint:t.value.slice(0,4),pubkey:r,path:"m"};for(const e of(e=>[...Array(e).keys()])(t.value.length/4-1)){const r=t.value.readUInt32LE(4*e+4),i=!!(2147483648&r),o=2147483647&r;n.path+="/"+o.toString(10)+(i?"'":"")}return n},encode:function(t){const r=eU.from([e]),n=eU.concat([r,t.pubkey]),i=t.path.split("/"),o=eU.allocUnsafe(4*i.length);t.masterFingerprint.copy(o,0);let s=4;return i.slice(1).forEach((e=>{const t="'"===e.slice(-1);let r=2147483647&parseInt(t?e.slice(0,-1):e,10);t&&(r+=2147483648),o.writeUInt32LE(r,s),s+=4})),{key:n,value:o}},check:function(e){return jU(e.pubkey)&&jU(e.masterFingerprint)&&"string"==typeof e.path&&[33,65].includes(e.pubkey.length)&&[2,3,4].includes(e.pubkey[0])&&4===e.masterFingerprint.length},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }",canAddToArray:function(e,t,r){const n=t.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===e.filter((e=>e.pubkey.equals(t.pubkey))).length)}}}}));MB(W5),W5.makeConverter;var J5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeChecker=function(e){return function(t){let r;if(e.includes(t.key[0])&&(r=t.key.slice(1),33!==r.length&&65!==r.length||![2,3,4].includes(r[0])))throw new Error("Format Error: invalid pubkey in key 0x"+t.key.toString("hex"));return r}}}));MB(J5),J5.makeChecker;var G5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode redeemScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:eU.from([e]),value:t}},check:function(e){return jU(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.redeemScript}}}}));MB(G5),G5.makeConverter;var X5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode witnessScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(t){return{key:eU.from([e]),value:t}},check:function(e){return jU(e)},expected:"Buffer",canAdd:function(e,t){return!!e&&!!t&&void 0===e.witnessScript}}}}));MB(X5),X5.makeConverter;var Y5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r={unsignedTx:D5,globalXpub:j5,checkPubkey:J5.makeChecker([])};t.globals=r;const n={nonWitnessUtxo:F5,partialSig:H5,sighashType:V5,finalScriptSig:B5,finalScriptWitness:U5,porCommitment:z5,witnessUtxo:$5,bip32Derivation:W5.makeConverter(L5.InputTypes.BIP32_DERIVATION),redeemScript:G5.makeConverter(L5.InputTypes.REDEEM_SCRIPT),witnessScript:X5.makeConverter(L5.InputTypes.WITNESS_SCRIPT),checkPubkey:J5.makeChecker([L5.InputTypes.PARTIAL_SIG,L5.InputTypes.BIP32_DERIVATION])};t.inputs=n;const i={bip32Derivation:W5.makeConverter(L5.OutputTypes.BIP32_DERIVATION),redeemScript:G5.makeConverter(L5.OutputTypes.REDEEM_SCRIPT),witnessScript:X5.makeConverter(L5.OutputTypes.WITNESS_SCRIPT),checkPubkey:J5.makeChecker([L5.OutputTypes.BIP32_DERIVATION])};t.outputs=i}));MB(Y5),Y5.globals,Y5.inputs,Y5.outputs;var Q5=RB((function(e,t){function r(e,t,r){if(!t.equals(eU.from([r])))throw new Error(`Format Error: Invalid ${e} key: ${t.toString("hex")}`)}function n(e,{globalMapKeyVals:t,inputKeyVals:n,outputKeyVals:i}){const o={unsignedTx:e};let s=0;for(const e of t)switch(e.key[0]){case L5.GlobalTypes.UNSIGNED_TX:if(r("global",e.key,L5.GlobalTypes.UNSIGNED_TX),s>0)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");s++;break;case L5.GlobalTypes.GLOBAL_XPUB:void 0===o.globalXpub&&(o.globalXpub=[]),o.globalXpub.push(Y5.globals.globalXpub.decode(e));break;default:o.unknownKeyVals||(o.unknownKeyVals=[]),o.unknownKeyVals.push(e)}const a=n.length,u=i.length,c=[],l=[];for(const e of K5.range(a)){const t={};for(const i of n[e])switch(Y5.inputs.checkPubkey(i),i.key[0]){case L5.InputTypes.NON_WITNESS_UTXO:if(r("input",i.key,L5.InputTypes.NON_WITNESS_UTXO),void 0!==t.nonWitnessUtxo)throw new Error("Format Error: Input has multiple NON_WITNESS_UTXO");t.nonWitnessUtxo=Y5.inputs.nonWitnessUtxo.decode(i);break;case L5.InputTypes.WITNESS_UTXO:if(r("input",i.key,L5.InputTypes.WITNESS_UTXO),void 0!==t.witnessUtxo)throw new Error("Format Error: Input has multiple WITNESS_UTXO");t.witnessUtxo=Y5.inputs.witnessUtxo.decode(i);break;case L5.InputTypes.PARTIAL_SIG:void 0===t.partialSig&&(t.partialSig=[]),t.partialSig.push(Y5.inputs.partialSig.decode(i));break;case L5.InputTypes.SIGHASH_TYPE:if(r("input",i.key,L5.InputTypes.SIGHASH_TYPE),void 0!==t.sighashType)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");t.sighashType=Y5.inputs.sighashType.decode(i);break;case L5.InputTypes.REDEEM_SCRIPT:if(r("input",i.key,L5.InputTypes.REDEEM_SCRIPT),void 0!==t.redeemScript)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");t.redeemScript=Y5.inputs.redeemScript.decode(i);break;case L5.InputTypes.WITNESS_SCRIPT:if(r("input",i.key,L5.InputTypes.WITNESS_SCRIPT),void 0!==t.witnessScript)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");t.witnessScript=Y5.inputs.witnessScript.decode(i);break;case L5.InputTypes.BIP32_DERIVATION:void 0===t.bip32Derivation&&(t.bip32Derivation=[]),t.bip32Derivation.push(Y5.inputs.bip32Derivation.decode(i));break;case L5.InputTypes.FINAL_SCRIPTSIG:r("input",i.key,L5.InputTypes.FINAL_SCRIPTSIG),t.finalScriptSig=Y5.inputs.finalScriptSig.decode(i);break;case L5.InputTypes.FINAL_SCRIPTWITNESS:r("input",i.key,L5.InputTypes.FINAL_SCRIPTWITNESS),t.finalScriptWitness=Y5.inputs.finalScriptWitness.decode(i);break;case L5.InputTypes.POR_COMMITMENT:r("input",i.key,L5.InputTypes.POR_COMMITMENT),t.porCommitment=Y5.inputs.porCommitment.decode(i);break;default:t.unknownKeyVals||(t.unknownKeyVals=[]),t.unknownKeyVals.push(i)}c.push(t)}for(const e of K5.range(u)){const t={};for(const n of i[e])switch(Y5.outputs.checkPubkey(n),n.key[0]){case L5.OutputTypes.REDEEM_SCRIPT:if(r("output",n.key,L5.OutputTypes.REDEEM_SCRIPT),void 0!==t.redeemScript)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");t.redeemScript=Y5.outputs.redeemScript.decode(n);break;case L5.OutputTypes.WITNESS_SCRIPT:if(r("output",n.key,L5.OutputTypes.WITNESS_SCRIPT),void 0!==t.witnessScript)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");t.witnessScript=Y5.outputs.witnessScript.decode(n);break;case L5.OutputTypes.BIP32_DERIVATION:void 0===t.bip32Derivation&&(t.bip32Derivation=[]),t.bip32Derivation.push(Y5.outputs.bip32Derivation.decode(n));break;default:t.unknownKeyVals||(t.unknownKeyVals=[]),t.unknownKeyVals.push(n)}l.push(t)}return{globalMap:o,inputs:c,outputs:l}}Object.defineProperty(t,"__esModule",{value:!0}),t.psbtFromBuffer=function(e,t){let r=0;function i(){const t=q5.decode(e,r);r+=q5.encodingLength(t);const n=e.slice(r,r+t);return r+=t,n}function o(){return{key:i(),value:i()}}function s(){if(r>=e.length)throw new Error("Format Error: Unexpected End of PSBT");const t=0===e.readUInt8(r);return t&&r++,t}if(1886610036!==function(){const t=e.readUInt32BE(r);return r+=4,t}())throw new Error("Format Error: Invalid Magic Number");if(255!==function(){const t=e.readUInt8(r);return r+=1,t}())throw new Error("Format Error: Magic Number must be followed by 0xff separator");const a=[],u={};for(;!s();){const e=o(),t=e.key.toString("hex");if(u[t])throw new Error("Format Error: Keys must be unique for global keymap: key "+t);u[t]=1,a.push(e)}const c=a.filter((e=>e.key[0]===L5.GlobalTypes.UNSIGNED_TX));if(1!==c.length)throw new Error("Format Error: Only one UNSIGNED_TX allowed");const l=t(c[0].value),{inputCount:h,outputCount:f}=l.getInputOutputCounts(),d=[],p=[];for(const e of K5.range(h)){const t={},r=[];for(;!s();){const n=o(),i=n.key.toString("hex");if(t[i])throw new Error("Format Error: Keys must be unique for each input: input index "+e+" key "+i);t[i]=1,r.push(n)}d.push(r)}for(const e of K5.range(f)){const t={},r=[];for(;!s();){const n=o(),i=n.key.toString("hex");if(t[i])throw new Error("Format Error: Keys must be unique for each output: output index "+e+" key "+i);t[i]=1,r.push(n)}p.push(r)}return n(l,{globalMapKeyVals:a,inputKeyVals:d,outputKeyVals:p})},t.checkKeyBuffer=r,t.psbtFromKeyVals=n}));MB(Q5),Q5.psbtFromBuffer,Q5.checkKeyBuffer,Q5.psbtFromKeyVals;var Z5=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.psbtToBuffer=function({globalMap:e,inputs:t,outputs:r}){const{globalKeyVals:n,inputKeyVals:o,outputKeyVals:s}=i({globalMap:e,inputs:t,outputs:r}),a=K5.keyValsToBuffer(n),u=e=>0===e.length?[eU.from([0])]:e.map(K5.keyValsToBuffer),c=u(o),l=u(s),h=eU.allocUnsafe(5);return h.writeUIntBE(482972169471,0,5),eU.concat([h,a].concat(c,l))};const r=(e,t)=>e.key.compare(t.key);function n(e,t){const n=new Set,i=Object.entries(e).reduce(((e,[r,i])=>{if("unknownKeyVals"===r)return e;const o=t[r];if(void 0===o)return e;const s=(Array.isArray(i)?i:[i]).map(o.encode);return s.map((e=>e.key.toString("hex"))).forEach((e=>{if(n.has(e))throw new Error("Serialize Error: Duplicate key: "+e);n.add(e)})),e.concat(s)}),[]),o=e.unknownKeyVals?e.unknownKeyVals.filter((e=>!n.has(e.key.toString("hex")))):[];return i.concat(o).sort(r)}function i({globalMap:e,inputs:t,outputs:r}){return{globalKeyVals:n(e,Y5.globals),inputKeyVals:t.map((e=>n(e,Y5.inputs))),outputKeyVals:r.map((e=>n(e,Y5.outputs)))}}t.psbtToKeyVals=i}));MB(Z5),Z5.psbtToBuffer,Z5.psbtToKeyVals;var e8=RB((function(e,t){function r(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),r(Q5),r(Z5)}));MB(e8);var t8=RB((function(e,t){function r(e,t,r){return n=>{if(e.has(n))return;const i=r.filter((e=>e.key.toString("hex")===n))[0];t.push(i),e.add(n)}}function n(e){return e.globalMap.unsignedTx}function i(e){const t=new Set;return e.forEach((e=>{const r=e.key.toString("hex");if(t.has(r))throw new Error("Combine: KeyValue Map keys should be unique");t.add(r)})),t}Object.defineProperty(t,"__esModule",{value:!0}),t.combine=function(e){const t=e[0],o=e8.psbtToKeyVals(t),s=e.slice(1);if(0===s.length)throw new Error("Combine: Nothing to combine");const a=n(t);if(void 0===a)throw new Error("Combine: Self missing transaction");const u=i(o.globalKeyVals),c=o.inputKeyVals.map(i),l=o.outputKeyVals.map(i);for(const e of s){const t=n(e);if(void 0===t||!t.toBuffer().equals(a.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");const s=e8.psbtToKeyVals(e);i(s.globalKeyVals).forEach(r(u,o.globalKeyVals,s.globalKeyVals)),s.inputKeyVals.map(i).forEach(((e,t)=>e.forEach(r(c[t],o.inputKeyVals[t],s.inputKeyVals[t])))),s.outputKeyVals.map(i).forEach(((e,t)=>e.forEach(r(l[t],o.outputKeyVals[t],s.outputKeyVals[t]))))}return e8.psbtFromKeyVals(a,{globalMapKeyVals:o.globalKeyVals,inputKeyVals:o.inputKeyVals,outputKeyVals:o.outputKeyVals})}}));MB(t8),t8.combine;var r8=RB((function(e,t){function r(e,t){const r=e[t];if(void 0===r)throw new Error(`No input #${t}`);return r}function n(e,t,r,n){throw new Error(`Data for ${e} key ${t} is incorrect: Expected ${r} and got ${JSON.stringify(n)}`)}function i(e){return(t,r)=>{for(const i of Object.keys(t)){const o=t[i],{canAdd:s,canAddToArray:a,check:u,expected:c}=Y5[e+"s"][i]||{},l=!!a;if(u)if(l){if(!Array.isArray(o)||r[i]&&!Array.isArray(r[i]))throw new Error(`Key type ${i} must be an array`);o.every(u)||n(e,i,c,o);const t=r[i]||[],s=new Set;if(!o.every((e=>a(t,e,s))))throw new Error("Can not add duplicate data to array");r[i]=t.concat(o)}else{if(u(o)||n(e,i,c,o),!s(r,o))throw new Error(`Can not add duplicate data to ${e}`);r[i]=o}}}}Object.defineProperty(t,"__esModule",{value:!0}),t.checkForInput=r,t.checkForOutput=function(e,t){const r=e[t];if(void 0===r)throw new Error(`No output #${t}`);return r},t.checkHasKey=function(e,t,r){if(e.key[0]<r)throw new Error("Use the method for your specific key instead of addUnknownKeyVal*");if(t&&0!==t.filter((t=>t.key.equals(e.key))).length)throw new Error(`Duplicate Key: ${e.key.toString("hex")}`)},t.getEnumLength=function(e){let t=0;return Object.keys(e).forEach((e=>{Number(isNaN(Number(e)))&&t++})),t},t.inputCheckUncleanFinalized=function(e,t){let r=!1;if(t.nonWitnessUtxo||t.witnessUtxo){const e=!!t.redeemScript,n=!!t.witnessScript,i=!e||!!t.finalScriptSig,o=!n||!!t.finalScriptWitness,s=!!t.finalScriptSig||!!t.finalScriptWitness;r=i&&o&&s}if(!1===r)throw new Error(`Input #${e} has too much or too little data to clean`)},t.updateGlobal=i("global"),t.updateInput=i("input"),t.updateOutput=i("output"),t.addInputAttributes=function(e,n){const i=r(e,e.length-1);t.updateInput(n,i)},t.addOutputAttributes=function(e,n){const i=r(e,e.length-1);t.updateOutput(n,i)},t.defaultVersionSetter=function(e,t){if(!jU(t)||t.length<4)throw new Error("Set Version: Invalid Transaction");return t.writeUInt32LE(e,0),t},t.defaultLocktimeSetter=function(e,t){if(!jU(t)||t.length<4)throw new Error("Set Locktime: Invalid Transaction");return t.writeUInt32LE(e,t.length-4),t}}));MB(r8),r8.checkForInput,r8.checkForOutput,r8.checkHasKey,r8.getEnumLength,r8.inputCheckUncleanFinalized,r8.updateGlobal,r8.updateInput,r8.updateOutput,r8.addInputAttributes,r8.addOutputAttributes,r8.defaultVersionSetter,r8.defaultLocktimeSetter;var n8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Psbt=class{constructor(e){this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:e}}static fromBase64(e,t){const r=eU.from(e,"base64");return this.fromBuffer(r,t)}static fromHex(e,t){const r=eU.from(e,"hex");return this.fromBuffer(r,t)}static fromBuffer(e,t){const r=e8.psbtFromBuffer(e,t),n=new this(r.globalMap.unsignedTx);return Object.assign(n,r),n}toBase64(){return this.toBuffer().toString("base64")}toHex(){return this.toBuffer().toString("hex")}toBuffer(){return e8.psbtToBuffer(this)}updateGlobal(e){return r8.updateGlobal(e,this.globalMap),this}updateInput(e,t){const r=r8.checkForInput(this.inputs,e);return r8.updateInput(t,r),this}updateOutput(e,t){const r=r8.checkForOutput(this.outputs,e);return r8.updateOutput(t,r),this}addUnknownKeyValToGlobal(e){return r8.checkHasKey(e,this.globalMap.unknownKeyVals,r8.getEnumLength(L5.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(e),this}addUnknownKeyValToInput(e,t){const r=r8.checkForInput(this.inputs,e);return r8.checkHasKey(t,r.unknownKeyVals,r8.getEnumLength(L5.InputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(t),this}addUnknownKeyValToOutput(e,t){const r=r8.checkForOutput(this.outputs,e);return r8.checkHasKey(t,r.unknownKeyVals,r8.getEnumLength(L5.OutputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(t),this}addInput(e){this.globalMap.unsignedTx.addInput(e),this.inputs.push({unknownKeyVals:[]});const t=e.unknownKeyVals||[],r=this.inputs.length-1;if(!Array.isArray(t))throw new Error("unknownKeyVals must be an Array");return t.forEach((e=>this.addUnknownKeyValToInput(r,e))),r8.addInputAttributes(this.inputs,e),this}addOutput(e){this.globalMap.unsignedTx.addOutput(e),this.outputs.push({unknownKeyVals:[]});const t=e.unknownKeyVals||[],r=this.outputs.length-1;if(!Array.isArray(t))throw new Error("unknownKeyVals must be an Array");return t.forEach((e=>this.addUnknownKeyValToInput(r,e))),r8.addOutputAttributes(this.outputs,e),this}clearFinalizedInput(e){const t=r8.checkForInput(this.inputs,e);r8.inputCheckUncleanFinalized(e,t);for(const e of Object.keys(t))["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(e)||delete t[e];return this}combine(...e){const t=t8.combine([this].concat(e));return Object.assign(this,t),this}getTransaction(){return this.globalMap.unsignedTx.toBuffer()}}}));MB(n8),n8.Psbt;var i8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r={network:z4.bitcoin,maximumFeeRate:5e3};class n{constructor(e={},t=new n8.Psbt(new o)){this.data=t,this.opts=Object.assign({},r,e),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},0===this.data.inputs.length&&this.setVersion(2);const n=(e,t,r,n)=>Object.defineProperty(e,t,{enumerable:r,writable:n});n(this,"__CACHE",!1,!0),n(this,"opts",!1,!0)}static fromBase64(e,t={}){const r=eU.from(e,"base64");return this.fromBuffer(r,t)}static fromHex(e,t={}){const r=eU.from(e,"hex");return this.fromBuffer(r,t)}static fromBuffer(e,t={}){const r=n8.Psbt.fromBuffer(e,i),o=new n(t,r);var s,a;return s=o.__CACHE.__TX,a=o.__CACHE,s.ins.forEach((e=>{b(a,e)})),o}get inputCount(){return this.data.inputs.length}get version(){return this.__CACHE.__TX.version}set version(e){this.setVersion(e)}get locktime(){return this.__CACHE.__TX.locktime}set locktime(e){this.setLocktime(e)}get txInputs(){return this.__CACHE.__TX.ins.map((e=>({hash:M5.cloneBuffer(e.hash),index:e.index,sequence:e.sequence})))}get txOutputs(){return this.__CACHE.__TX.outs.map((e=>{let t;try{t=k5.fromOutputScript(e.script,this.opts.network)}catch(e){}return{script:M5.cloneBuffer(e.script),value:e.value,address:t}}))}combine(...e){return this.data.combine(...e.map((e=>e.data))),this}clone(){const e=n.fromBuffer(this.data.toBuffer());return e.opts=JSON.parse(JSON.stringify(this.opts)),e}setMaximumFeeRate(e){m(e),this.opts.maximumFeeRate=e}setVersion(e){m(e),v(this.data.inputs,"setVersion");const t=this.__CACHE;return t.__TX.version=e,t.__EXTRACTED_TX=void 0,this}setLocktime(e){m(e),v(this.data.inputs,"setLocktime");const t=this.__CACHE;return t.__TX.locktime=e,t.__EXTRACTED_TX=void 0,this}setInputSequence(e,t){m(t),v(this.data.inputs,"setInputSequence");const r=this.__CACHE;if(r.__TX.ins.length<=e)throw new Error("Input index too high");return r.__TX.ins[e].sequence=t,r.__EXTRACTED_TX=void 0,this}addInputs(e){return e.forEach((e=>this.addInput(e))),this}addInput(e){if(arguments.length>1||!e||void 0===e.hash||void 0===e.index)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");v(this.data.inputs,"addInput"),e.witnessScript&&L(e.witnessScript);const t=this.__CACHE;this.data.addInput(e),b(t,t.__TX.ins[t.__TX.ins.length-1]);const r=this.data.inputs.length-1,n=this.data.inputs[r];return n.nonWitnessUtxo&&T(this.__CACHE,n,r),t.__FEE=void 0,t.__FEE_RATE=void 0,t.__EXTRACTED_TX=void 0,this}addOutputs(e){return e.forEach((e=>this.addOutput(e))),this}addOutput(e){if(arguments.length>1||!e||void 0===e.value||void 0===e.address&&void 0===e.script)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");v(this.data.inputs,"addOutput");const{address:t}=e;if("string"==typeof t){const{network:r}=this.opts,n=k5.toOutputScript(t,r);e=Object.assign(e,{script:n})}const r=this.__CACHE;return this.data.addOutput(e),r.__FEE=void 0,r.__FEE_RATE=void 0,r.__EXTRACTED_TX=void 0,this}extractTransaction(e){if(!this.data.inputs.every(a))throw new Error("Not finalized");const t=this.__CACHE;if(e||function(e,t,r){const n=t.__FEE_RATE||e.getFeeRate(),i=t.__EXTRACTED_TX.virtualSize(),o=n*i;if(n>=r.maximumFeeRate)throw new Error(`Warning: You are paying around ${(o/1e8).toFixed(8)} in fees, which is ${n} satoshi per byte for a transaction with a VSize of ${i} bytes (segwit counted as 0.25 byte per byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction.`)}(this,t,this.opts),t.__EXTRACTED_TX)return t.__EXTRACTED_TX;const r=t.__TX.clone();return O(this.data.inputs,r,t,!0),r}getFeeRate(){return S("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}getFee(){return S("__FEE","fee",this.data.inputs,this.__CACHE)}finalizeAllInputs(){return r8.checkForInput(this.data.inputs,0),B(this.data.inputs.length).forEach((e=>this.finalizeInput(e))),this}finalizeInput(e,t=E){const r=r8.checkForInput(this.data.inputs,e),{script:n,isP2SH:i,isP2WSH:o,isSegwit:s}=function(e,t,r){const n=r.__TX,i={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(i.isP2SH=!!t.redeemScript,i.isP2WSH=!!t.witnessScript,t.witnessScript)i.script=t.witnessScript;else if(t.redeemScript)i.script=t.redeemScript;else if(t.nonWitnessUtxo){const o=C(r,t,e),s=n.ins[e].index;i.script=o.outs[s].script}else t.witnessUtxo&&(i.script=t.witnessUtxo.script);return(t.witnessScript||f(i.script))&&(i.isSegwit=!0),i}(e,r,this.__CACHE);if(!n)throw new Error(`No script found for input #${e}`);!function(e){if(!e.sighashType||!e.partialSig)return;const{partialSig:t,sighashType:r}=e;t.forEach((e=>{const{hashType:t}=r5.signature.decode(e.signature);if(r!==t)throw new Error("Signature sighash does not match input sighash type")}))}(r);const{finalScriptSig:a,finalScriptWitness:u}=t(e,r,n,s,i,o);if(a&&this.data.updateInput(e,{finalScriptSig:a}),u&&this.data.updateInput(e,{finalScriptWitness:u}),!a&&!u)throw new Error(`Unknown error finalizing input #${e}`);return this.data.clearFinalizedInput(e),this}getInputType(e){const t=r8.checkForInput(this.data.inputs,e),r=N(M(e,t,this.__CACHE),e,"input",t.redeemScript||function(e){if(!e)return;const t=r5.decompile(e);if(!t)return;const r=t[t.length-1];if(!jU(r)||R(r)||(n=r,r5.isCanonicalScriptSignature(n)))return;var n;return r5.decompile(r)?r:void 0}(t.finalScriptSig),t.witnessScript||function(e){if(!e)return;const t=P(e),r=t[t.length-1];if(R(r))return;return r5.decompile(r)?r:void 0}(t.finalScriptWitness));return("raw"===r.type?"":r.type+"-")+D(r.meaningfulScript)}inputHasPubkey(e,t){return function(e,t,r,n){const i=M(r,t,n),{meaningfulScript:o}=N(i,r,"input",t.redeemScript,t.witnessScript);return j(e,o)}(t,r8.checkForInput(this.data.inputs,e),e,this.__CACHE)}inputHasHDKey(e,t){const r=r8.checkForInput(this.data.inputs,e),n=g(t);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}outputHasPubkey(e,t){return function(e,t,r,n){const i=n.__TX.outs[r].script,{meaningfulScript:o}=N(i,r,"output",t.redeemScript,t.witnessScript);return j(e,o)}(t,r8.checkForOutput(this.data.outputs,e),e,this.__CACHE)}outputHasHDKey(e,t){const r=r8.checkForOutput(this.data.outputs,e),n=g(t);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}validateSignaturesOfAllInputs(){return r8.checkForInput(this.data.inputs,0),B(this.data.inputs.length).map((e=>this.validateSignaturesOfInput(e))).reduce(((e,t)=>!0===t&&e),!0)}validateSignaturesOfInput(e,t){const r=this.data.inputs[e],n=(r||{}).partialSig;if(!r||!n||n.length<1)throw new Error("No signatures to validate");const i=t?n.filter((e=>e.pubkey.equals(t))):n;if(i.length<1)throw new Error("No signatures for this pubkey");const o=[];let s,a,u;for(const t of i){const n=r5.signature.decode(t.signature),{hash:i,script:c}=u!==n.hashType?I(e,Object.assign({},r,{sighashType:n.hashType}),this.__CACHE,!0):{hash:s,script:a};u=n.hashType,s=i,a=c,y(t.pubkey,c,"verify");const l=A5.fromPublicKey(t.pubkey);o.push(l.verify(i,n.signature))}return o.every((e=>!0===e))}signAllInputsHD(e,t=[R5.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey||!e.fingerprint)throw new Error("Need HDSigner to sign input");const r=[];for(const n of B(this.data.inputs.length))try{this.signInputHD(n,e,t),r.push(!0)}catch(e){r.push(!1)}if(r.every((e=>!1===e)))throw new Error("No inputs were signed");return this}signAllInputsHDAsync(e,t=[R5.Transaction.SIGHASH_ALL]){return new Promise(((r,n)=>{if(!e||!e.publicKey||!e.fingerprint)return n(new Error("Need HDSigner to sign input"));const i=[],o=[];for(const r of B(this.data.inputs.length))o.push(this.signInputHDAsync(r,e,t).then((()=>{i.push(!0)}),(()=>{i.push(!1)})));return Promise.all(o).then((()=>{if(i.every((e=>!1===e)))return n(new Error("No inputs were signed"));r()}))}))}signInputHD(e,t,r=[R5.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");return A(e,this.data.inputs,t).forEach((t=>this.signInput(e,t,r))),this}signInputHDAsync(e,t,r=[R5.Transaction.SIGHASH_ALL]){return new Promise(((n,i)=>{if(!t||!t.publicKey||!t.fingerprint)return i(new Error("Need HDSigner to sign input"));const o=A(e,this.data.inputs,t).map((t=>this.signInputAsync(e,t,r)));return Promise.all(o).then((()=>{n()})).catch(i)}))}signAllInputs(e,t=[R5.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey)throw new Error("Need Signer to sign input");const r=[];for(const n of B(this.data.inputs.length))try{this.signInput(n,e,t),r.push(!0)}catch(e){r.push(!1)}if(r.every((e=>!1===e)))throw new Error("No inputs were signed");return this}signAllInputsAsync(e,t=[R5.Transaction.SIGHASH_ALL]){return new Promise(((r,n)=>{if(!e||!e.publicKey)return n(new Error("Need Signer to sign input"));const i=[],o=[];for(const[r]of this.data.inputs.entries())o.push(this.signInputAsync(r,e,t).then((()=>{i.push(!0)}),(()=>{i.push(!1)})));return Promise.all(o).then((()=>{if(i.every((e=>!1===e)))return n(new Error("No inputs were signed"));r()}))}))}signInput(e,t,r=[R5.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const{hash:n,sighashType:i}=k(this.data.inputs,e,t.publicKey,this.__CACHE,r),o=[{pubkey:t.publicKey,signature:r5.signature.encode(t.sign(n),i)}];return this.data.updateInput(e,{partialSig:o}),this}signInputAsync(e,t,r=[R5.Transaction.SIGHASH_ALL]){return Promise.resolve().then((()=>{if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const{hash:n,sighashType:i}=k(this.data.inputs,e,t.publicKey,this.__CACHE,r);return Promise.resolve(t.sign(n)).then((r=>{const n=[{pubkey:t.publicKey,signature:r5.signature.encode(r,i)}];this.data.updateInput(e,{partialSig:n})}))}))}toBuffer(){return s(this.__CACHE),this.data.toBuffer()}toHex(){return s(this.__CACHE),this.data.toHex()}toBase64(){return s(this.__CACHE),this.data.toBase64()}updateGlobal(e){return this.data.updateGlobal(e),this}updateInput(e,t){return t.witnessScript&&L(t.witnessScript),this.data.updateInput(e,t),t.nonWitnessUtxo&&T(this.__CACHE,this.data.inputs[e],e),this}updateOutput(e,t){return this.data.updateOutput(e,t),this}addUnknownKeyValToGlobal(e){return this.data.addUnknownKeyValToGlobal(e),this}addUnknownKeyValToInput(e,t){return this.data.addUnknownKeyValToInput(e,t),this}addUnknownKeyValToOutput(e,t){return this.data.addUnknownKeyValToOutput(e,t),this}clearFinalizedInput(e){return this.data.clearFinalizedInput(e),this}}t.Psbt=n;const i=e=>new o(e);class o{constructor(e=eU.from([2,0,0,0,0,0,0,0,0,0])){this.tx=R5.Transaction.fromBuffer(e),function(e){if(!e.ins.every((e=>e.script&&0===e.script.length&&e.witness&&0===e.witness.length)))throw new Error("Format Error: Transaction ScriptSigs are not empty")}(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}getInputOutputCounts(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}addInput(e){if(void 0===e.hash||void 0===e.index||!jU(e.hash)&&"string"!=typeof e.hash||"number"!=typeof e.index)throw new Error("Error adding input.");const t="string"==typeof e.hash?M5.reverseBuffer(eU.from(e.hash,"hex")):e.hash;this.tx.addInput(t,e.index,e.sequence)}addOutput(e){if(void 0===e.script||void 0===e.value||!jU(e.script)||"number"!=typeof e.value)throw new Error("Error adding output.");this.tx.addOutput(e.script,e.value)}toBuffer(){return this.tx.toBuffer()}}function s(e){if(!1!==e.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Not BIP174 compliant, can not export")}function a(e){return!!e.finalScriptSig||!!e.finalScriptWitness}function u(e){return t=>{try{return e({output:t}),!0}catch(e){return!1}}}const c=u(E5.p2ms),l=u(E5.p2pk),h=u(E5.p2pkh),f=u(E5.p2wpkh),d=u(E5.p2wsh),p=u(E5.p2sh);function g(e){return t=>!!t.masterFingerprint.equals(e.fingerprint)&&!!e.derivePath(t.path).publicKey.equals(t.pubkey)}function m(e){if("number"!=typeof e||e!==Math.floor(e)||e>4294967295||e<0)throw new Error("Invalid 32 bit integer")}function v(e,t){e.forEach((e=>{let r=!1,n=[];if(0===(e.partialSig||[]).length){if(!e.finalScriptSig&&!e.finalScriptWitness)return;n=function(e){const t=e.finalScriptSig&&r5.decompile(e.finalScriptSig)||[],r=e.finalScriptWitness&&r5.decompile(e.finalScriptWitness)||[];return t.concat(r).filter((e=>jU(e)&&r5.isCanonicalScriptSignature(e))).map((e=>({signature:e})))}(e)}else n=e.partialSig;if(n.forEach((e=>{const{hashType:n}=r5.signature.decode(e.signature),i=[];switch(n&R5.Transaction.SIGHASH_ANYONECANPAY&&i.push("addInput"),31&n){case R5.Transaction.SIGHASH_ALL:break;case R5.Transaction.SIGHASH_SINGLE:case R5.Transaction.SIGHASH_NONE:i.push("addOutput"),i.push("setInputSequence")}-1===i.indexOf(t)&&(r=!0)})),r)throw new Error("Can not modify transaction, signatures exist.")}))}function y(e,t,r){if(!j(e,t))throw new Error(`Can not ${r} for this input with the key ${e.toString("hex")}`)}function b(e,t){const r=M5.reverseBuffer(eU.from(t.hash)).toString("hex")+":"+t.index;if(e.__TX_IN_CACHE[r])throw new Error("Duplicate input detected.");e.__TX_IN_CACHE[r]=1}function w(e,t){return(r,n,i,o)=>{const s=e({redeem:{output:i}}).output;if(!n.equals(s))throw new Error(`${t} for ${o} #${r} doesn't match the scriptPubKey in the prevout`)}}const _=w(E5.p2sh,"Redeem script"),x=w(E5.p2wsh,"Witness script");function S(e,t,r,n){if(!r.every(a))throw new Error(`PSBT must be finalized to calculate ${t}`);if("__FEE_RATE"===e&&n.__FEE_RATE)return n.__FEE_RATE;if("__FEE"===e&&n.__FEE)return n.__FEE;let i,o=!0;return n.__EXTRACTED_TX?(i=n.__EXTRACTED_TX,o=!1):i=n.__TX.clone(),O(r,i,n,o),"__FEE_RATE"===e?n.__FEE_RATE:"__FEE"===e?n.__FEE:void 0}function E(e,t,r,n,i,o){D(r);throw new Error(`Can not finalize input #${e}`)}function k(e,t,r,n,i){const o=r8.checkForInput(e,t),{hash:s,sighashType:a,script:u}=I(t,o,n,!1,i);return y(r,u,"sign"),{hash:s,sighashType:a}}function I(e,t,r,n,i){const o=r.__TX,s=t.sighashType||R5.Transaction.SIGHASH_ALL;if(i&&i.indexOf(s)<0){const e=function(e){let t=e&R5.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";switch(31&e){case R5.Transaction.SIGHASH_ALL:t+="SIGHASH_ALL";break;case R5.Transaction.SIGHASH_SINGLE:t+="SIGHASH_SINGLE";break;case R5.Transaction.SIGHASH_NONE:t+="SIGHASH_NONE"}return t}(s);throw new Error(`Sighash type is not allowed. Retry the sign method passing the sighashTypes array of whitelisted types. Sighash type: ${e}`)}let a,u;if(t.nonWitnessUtxo){const n=C(r,t,e),i=o.ins[e].hash,s=n.getHash();if(!i.equals(s))throw new Error(`Non-witness UTXO hash for input #${e} doesn't match the hash specified in the prevout`);const a=o.ins[e].index;u=n.outs[a]}else{if(!t.witnessUtxo)throw new Error("Need a Utxo input item for signing");u=t.witnessUtxo}const{meaningfulScript:c,type:l}=N(u.script,e,"input",t.redeemScript,t.witnessScript);if(["p2sh-p2wsh","p2wsh"].indexOf(l)>=0)a=o.hashForWitnessV0(e,c,u.value,s);else if(f(c)){const t=E5.p2pkh({hash:c.slice(2)}).output;a=o.hashForWitnessV0(e,t,u.value,s)}else{if(void 0===t.nonWitnessUtxo&&!1===r.__UNSAFE_SIGN_NONSEGWIT)throw new Error(`Input #${e} has witnessUtxo but non-segwit script: ${c.toString("hex")}`);n||!1===r.__UNSAFE_SIGN_NONSEGWIT||console.warn("Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as the old TransactionBuilder class when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n*********************"),a=o.hashForSignature(e,c,s)}return{script:c,sighashType:s,hash:a}}function A(e,t,r){const n=r8.checkForInput(t,e);if(!n.bip32Derivation||0===n.bip32Derivation.length)throw new Error("Need bip32Derivation to sign with HD");const i=n.bip32Derivation.map((e=>e.masterFingerprint.equals(r.fingerprint)?e:void 0)).filter((e=>!!e));if(0===i.length)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return i.map((e=>{const t=r.derivePath(e.path);if(!e.pubkey.equals(t.publicKey))throw new Error("pubkey did not match bip32Derivation");return t}))}function P(e){let t=0;function r(){const r=q5.decode(e,t);return t+=q5.decode.bytes,r}function n(){return function(r){return t+=r,e.slice(t-r,t)}(r())}return function(){const e=r(),t=[];for(let r=0;r<e;r++)t.push(n());return t}()}function T(e,t,r){e.__NON_WITNESS_UTXO_BUF_CACHE[r]=t.nonWitnessUtxo;const n=R5.Transaction.fromBuffer(t.nonWitnessUtxo);e.__NON_WITNESS_UTXO_TX_CACHE[r]=n;const i=e,o=r;delete t.nonWitnessUtxo,Object.defineProperty(t,"nonWitnessUtxo",{enumerable:!0,get(){const e=i.__NON_WITNESS_UTXO_BUF_CACHE[o],t=i.__NON_WITNESS_UTXO_TX_CACHE[o];if(void 0!==e)return e;{const e=t.toBuffer();return i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e,e}},set(e){i.__NON_WITNESS_UTXO_BUF_CACHE[o]=e}})}function O(e,t,r,n){let i=0;e.forEach(((e,o)=>{if(n&&e.finalScriptSig&&(t.ins[o].script=e.finalScriptSig),n&&e.finalScriptWitness&&(t.ins[o].witness=P(e.finalScriptWitness)),e.witnessUtxo)i+=e.witnessUtxo.value;else if(e.nonWitnessUtxo){const n=C(r,e,o),s=t.ins[o].index,a=n.outs[s];i+=a.value}}));const o=t.outs.reduce(((e,t)=>e+t.value),0),s=i-o;if(s<0)throw new Error("Outputs are spending more than Inputs");const a=t.virtualSize();r.__FEE=s,r.__EXTRACTED_TX=t,r.__FEE_RATE=Math.floor(s/a)}function C(e,t,r){const n=e.__NON_WITNESS_UTXO_TX_CACHE;return n[r]||T(e,t,r),n[r]}function M(e,t,r){if(void 0!==t.witnessUtxo)return t.witnessUtxo.script;if(void 0!==t.nonWitnessUtxo)return C(r,t,e).outs[r.__TX.ins[e].index].script;throw new Error("Can't find pubkey in input without Utxo data")}function R(e){return 33===e.length&&r5.isCanonicalPubKey(e)}function N(e,t,r,n,i){const o=p(e),s=o&&n&&d(n),a=d(e);if(o&&void 0===n)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((a||s)&&void 0===i)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");let u;return s?(u=i,_(t,e,n,r),x(t,n,i,r),L(u)):a?(u=i,x(t,e,i,r),L(u)):o?(u=n,_(t,e,n,r)):u=e,{meaningfulScript:u,type:s?"p2sh-p2wsh":o?"p2sh":a?"p2wsh":"raw"}}function L(e){if(f(e)||p(e))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function j(e,t){const r=a5.hash160(e),n=r5.decompile(t);if(null===n)throw new Error("Unknown script error");return n.some((t=>"number"!=typeof t&&(t.equals(e)||t.equals(r))))}function D(e){return f(e)?"witnesspubkeyhash":h(e)?"pubkeyhash":c(e)?"multisig":l(e)?"pubkey":"nonstandard"}function B(e){return[...Array(e).keys()]}}));MB(i8),i8.Psbt;var o8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5;function n(e){return e===r.OPS.OP_0||r5.isCanonicalScriptSignature(e)}function i(e,t){const i=r5.decompile(e);return!(i.length<2)&&i[0]===r.OPS.OP_0&&(t?i.slice(1).every(n):i.slice(1).every(r5.isCanonicalScriptSignature))}t.check=i,i.toJSON=()=>"multisig input"}));MB(o8),o8.check;var s8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5,n=r.OPS.OP_RESERVED;function i(e,t){const i=r5.decompile(e);if(i.length<4)return!1;if(i[i.length-1]!==r.OPS.OP_CHECKMULTISIG)return!1;if(!q4.Number(i[0]))return!1;if(!q4.Number(i[i.length-2]))return!1;const o=i[0]-n,s=i[i.length-2]-n;return!(o<=0)&&(!(s>16)&&(!(o>s)&&(s===i.length-3&&(!!t||i.slice(1,-2).every(r5.isCanonicalPubKey)))))}t.check=i,i.toJSON=()=>"multi-sig output"}));MB(s8),s8.check;var a8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=o8,t.output=s8}));MB(a8),a8.input,a8.output;var u8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5.OPS;function n(e){const t=r5.compile(e);return t.length>1&&t[0]===r.OP_RETURN}t.check=n,n.toJSON=()=>"null data output";const i={check:n};t.output=i}));MB(u8),u8.check,u8.output;var c8=RB((function(e,t){function r(e){const t=r5.decompile(e);return 1===t.length&&r5.isCanonicalScriptSignature(t[0])}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"pubKey input"}));MB(c8),c8.check;var l8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5;function n(e){const t=r5.decompile(e);return 2===t.length&&r5.isCanonicalPubKey(t[0])&&t[1]===r.OPS.OP_CHECKSIG}t.check=n,n.toJSON=()=>"pubKey output"}));MB(l8),l8.check;var h8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=c8,t.output=l8}));MB(h8),h8.input,h8.output;var f8=RB((function(e,t){function r(e){const t=r5.decompile(e);return 2===t.length&&r5.isCanonicalScriptSignature(t[0])&&r5.isCanonicalPubKey(t[1])}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"pubKeyHash input"}));MB(f8),f8.check;var d8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5;function n(e){const t=r5.compile(e);return 25===t.length&&t[0]===r.OPS.OP_DUP&&t[1]===r.OPS.OP_HASH160&&20===t[2]&&t[23]===r.OPS.OP_EQUALVERIFY&&t[24]===r.OPS.OP_CHECKSIG}t.check=n,n.toJSON=()=>"pubKeyHash output"}));MB(d8),d8.check;var p8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=f8,t.output=d8}));MB(p8),p8.input,p8.output;var g8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5;function n(e){const t=r5.compile(e);return 22===t.length&&t[0]===r.OPS.OP_0&&20===t[1]}t.check=n,n.toJSON=()=>"Witness pubKeyHash output"}));MB(g8),g8.check;var m8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5;function n(e){const t=r5.compile(e);return 34===t.length&&t[0]===r.OPS.OP_0&&32===t[1]}t.check=n,n.toJSON=()=>"Witness scriptHash output"}));MB(m8),m8.check;var v8=RB((function(e,t){function r(e,t){const r=r5.decompile(e);if(r.length<1)return!1;const n=r[r.length-1];if(!jU(n))return!1;const i=r5.decompile(r5.compile(r.slice(0,-1))),o=r5.decompile(n);return!!o&&!!r5.isPushOnly(i)&&(1===r.length?m8.check(o)||g8.check(o):!(!p8.input.check(i)||!p8.output.check(o))||!(!a8.input.check(i,t)||!a8.output.check(o))||!(!h8.input.check(i)||!h8.output.check(o)))}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"scriptHash input"}));MB(v8),v8.check;var y8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5;function n(e){const t=r5.compile(e);return 23===t.length&&t[0]===r.OPS.OP_HASH160&&20===t[1]&&t[22]===r.OPS.OP_EQUAL}t.check=n,n.toJSON=()=>"scriptHash output"}));MB(y8),y8.check;var b8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=v8,t.output=y8}));MB(b8),b8.input,b8.output;var w8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5,n=eU.from("aa21a9ed","hex");function i(e){const t=r5.compile(e);return t.length>37&&t[0]===r.OPS.OP_RETURN&&36===t[1]&&t.slice(2,6).equals(n)}t.check=i,i.toJSON=()=>"Witness commitment output",t.encode=function(e){L4(q4.Hash256bit,e);const t=eU.allocUnsafe(36);return n.copy(t,0),e.copy(t,4),r5.compile([r.OPS.OP_RETURN,t])},t.decode=function(e){return L4(i,e),r5.decompile(e)[1].slice(4,36)}}));MB(w8),w8.check,w8.encode,w8.decode;var _8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.output=w8}));MB(_8),_8.output;var x8=RB((function(e,t){function r(e){const t=r5.decompile(e);return 2===t.length&&r5.isCanonicalScriptSignature(t[0])&&(r=t[1],r5.isCanonicalPubKey(r)&&33===r.length);var r}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"witnessPubKeyHash input"}));MB(x8),x8.check;var S8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=x8,t.output=g8}));MB(S8),S8.input,S8.output;var E8=RB((function(e,t){function r(e,t){if(L4(L4.Array,e),e.length<1)return!1;const r=e[e.length-1];if(!jU(r))return!1;const n=r5.decompile(r);if(!n||0===n.length)return!1;const i=r5.compile(e.slice(0,-1));return!(!p8.input.check(i)||!p8.output.check(n))||!(!a8.input.check(i,t)||!a8.output.check(n))||!(!h8.input.check(i)||!h8.output.check(n))}Object.defineProperty(t,"__esModule",{value:!0}),t.check=r,r.toJSON=()=>"witnessScriptHash input"}));MB(E8),E8.check;var k8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.input=E8,t.output=m8}));MB(k8),k8.input,k8.output;var I8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r={P2MS:"multisig",NONSTANDARD:"nonstandard",NULLDATA:"nulldata",P2PK:"pubkey",P2PKH:"pubkeyhash",P2SH:"scripthash",P2WPKH:"witnesspubkeyhash",P2WSH:"witnessscripthash",WITNESS_COMMITMENT:"witnesscommitment"};t.types=r,t.output=function(e){if(S8.output.check(e))return r.P2WPKH;if(k8.output.check(e))return r.P2WSH;if(p8.output.check(e))return r.P2PKH;if(b8.output.check(e))return r.P2SH;const t=r5.decompile(e);if(!t)throw new TypeError("Invalid script");return a8.output.check(t)?r.P2MS:h8.output.check(t)?r.P2PK:_8.output.check(t)?r.WITNESS_COMMITMENT:u8.output.check(t)?r.NULLDATA:r.NONSTANDARD},t.input=function(e,t){const n=r5.decompile(e);if(!n)throw new TypeError("Invalid script");return p8.input.check(n)?r.P2PKH:b8.input.check(n,t)?r.P2SH:a8.input.check(n,t)?r.P2MS:h8.input.check(n)?r.P2PK:r.NONSTANDARD},t.witness=function(e,t){const n=r5.decompile(e);if(!n)throw new TypeError("Invalid script");return S8.input.check(n)?r.P2WPKH:k8.input.check(n,t)?r.P2WSH:r.NONSTANDARD}}));MB(I8),I8.types,I8.output,I8.input,I8.witness;var A8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=r5,n=I8.types,i=new Set(["p2pkh","p2pk","p2wpkh","p2ms","p2sh-p2pkh","p2sh-p2pk","p2sh-p2wpkh","p2sh-p2ms","p2wsh-p2pkh","p2wsh-p2pk","p2wsh-p2ms","p2sh-p2wsh-p2pkh","p2sh-p2wsh-p2pk","p2sh-p2wsh-p2ms"]);function o(e,t,r){try{L4(e,t)}catch(e){throw new Error(r)}}class s{constructor(e=z4.bitcoin,t=2500){this.network=e,this.maximumFeeRate=t,this.__PREV_TX_SET={},this.__INPUTS=[],this.__TX=new R5.Transaction,this.__TX.version=2,this.__USE_LOW_R=!1,console.warn("Deprecation Warning: TransactionBuilder will be removed in the future. (v6.x.x or later) Please use the Psbt class instead. Examples of usage are available in the transactions-psbt.js integration test file on our Github. A high level explanation is available in the psbt.ts and psbt.js files as well.")}static fromTransaction(e,t){const r=new s(t);return r.setVersion(e.version),r.setLockTime(e.locktime),e.outs.forEach((e=>{r.addOutput(e.script,e.value)})),e.ins.forEach((e=>{r.__addInputUnsafe(e.hash,e.index,{sequence:e.sequence,script:e.script,witness:e.witness})})),r.__INPUTS.forEach(((t,r)=>{!function(e,t,r){if(e.redeemScriptType!==n.P2MS||!e.redeemScript)return;if(e.pubkeys.length===e.signatures.length)return;const i=e.signatures.concat();e.signatures=e.pubkeys.map((n=>{const o=A5.fromPublicKey(n);let s;return i.some(((n,a)=>{if(!n)return!1;const u=r5.signature.decode(n),c=t.hashForSignature(r,e.redeemScript,u.hashType);return!!o.verify(c,u.signature)&&(i[a]=void 0,s=n,!0)})),s}))}(t,e,r)})),r}setLowR(e){return L4(L4.maybe(L4.Boolean),e),void 0===e&&(e=!0),this.__USE_LOW_R=e,e}setLockTime(e){if(L4(q4.UInt32,e),this.__INPUTS.some((e=>!!e.signatures&&e.signatures.some((e=>void 0!==e)))))throw new Error("No, this would invalidate signatures");this.__TX.locktime=e}setVersion(e){L4(q4.UInt32,e),this.__TX.version=e}addInput(e,t,r,n){if(!this.__canModifyInputs())throw new Error("No, this would invalidate signatures");let i;if("string"==typeof(o=e)||o instanceof String)e=M5.reverseBuffer(eU.from(e,"hex"));else if(function(e){return e instanceof R5.Transaction}(e)){const r=e.outs[t];n=r.script,i=r.value,e=e.getHash(!1)}var o;return this.__addInputUnsafe(e,t,{sequence:r,prevOutScript:n,value:i})}addOutput(e,t){if(!this.__canModifyOutputs())throw new Error("No, this would invalidate signatures");return"string"==typeof e&&(e=k5.toOutputScript(e,this.network)),this.__TX.addOutput(e,t)}build(){return this.__build(!1)}buildIncomplete(){return this.__build(!0)}sign(e,t,r,s,a,c){!function({input:e,ourPubKey:t,keyPair:r,signatureHash:n,hashType:i,useLowR:o}){let s=!1;for(const[a,u]of e.pubkeys.entries()){if(!t.equals(u))continue;if(e.signatures[a])throw new Error("Signature already exists");if(33!==t.length&&e.hasWitness)throw new Error("BIP143 rejects uncompressed public keys in P2WPKH or P2WSH");const c=r.sign(n,o);e.signatures[a]=r5.signature.encode(c,i),s=!0}if(!s)throw new Error("Key pair cannot sign for this input")}(function(e,t,r,s,a,c,h,f,d,p,g){let m;if("number"==typeof a)console.warn("DEPRECATED: TransactionBuilder sign method arguments will change in v6, please use the TxbSignArg interface"),m=a;else{if("object"!=typeof a)throw new TypeError("TransactionBuilder sign first arg must be TxbSignArg or number");!function(e,t){if(!i.has(t.prevOutScriptType))throw new TypeError(`Unknown prevOutScriptType "${t.prevOutScriptType}"`);o(L4.Number,t.vin,"sign must include vin parameter as Number (input index)"),o(q4.Signer,t.keyPair,"sign must include keyPair parameter as Signer interface"),o(L4.maybe(L4.Number),t.hashType,"sign hashType parameter must be a number");const r=(e[t.vin]||[]).prevOutType,n=t.prevOutScriptType;switch(n){case"p2pkh":if(r&&"pubkeyhash"!==r)throw new TypeError(`input #${t.vin} is not of type p2pkh: ${r}`);o(L4.value(void 0),t.witnessScript,`${n} requires NO witnessScript`),o(L4.value(void 0),t.redeemScript,`${n} requires NO redeemScript`),o(L4.value(void 0),t.witnessValue,`${n} requires NO witnessValue`);break;case"p2pk":if(r&&"pubkey"!==r)throw new TypeError(`input #${t.vin} is not of type p2pk: ${r}`);o(L4.value(void 0),t.witnessScript,`${n} requires NO witnessScript`),o(L4.value(void 0),t.redeemScript,`${n} requires NO redeemScript`),o(L4.value(void 0),t.witnessValue,`${n} requires NO witnessValue`);break;case"p2wpkh":if(r&&"witnesspubkeyhash"!==r)throw new TypeError(`input #${t.vin} is not of type p2wpkh: ${r}`);o(L4.value(void 0),t.witnessScript,`${n} requires NO witnessScript`),o(L4.value(void 0),t.redeemScript,`${n} requires NO redeemScript`),o(q4.Satoshi,t.witnessValue,`${n} requires witnessValue`);break;case"p2ms":if(r&&"multisig"!==r)throw new TypeError(`input #${t.vin} is not of type p2ms: ${r}`);o(L4.value(void 0),t.witnessScript,`${n} requires NO witnessScript`),o(L4.value(void 0),t.redeemScript,`${n} requires NO redeemScript`),o(L4.value(void 0),t.witnessValue,`${n} requires NO witnessValue`);break;case"p2sh-p2wpkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type p2sh-p2wpkh: ${r}`);o(L4.value(void 0),t.witnessScript,`${n} requires NO witnessScript`),o(L4.Buffer,t.redeemScript,`${n} requires redeemScript`),o(q4.Satoshi,t.witnessValue,`${n} requires witnessValue`);break;case"p2sh-p2ms":case"p2sh-p2pk":case"p2sh-p2pkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);o(L4.value(void 0),t.witnessScript,`${n} requires NO witnessScript`),o(L4.Buffer,t.redeemScript,`${n} requires redeemScript`),o(L4.value(void 0),t.witnessValue,`${n} requires NO witnessValue`);break;case"p2wsh-p2ms":case"p2wsh-p2pk":case"p2wsh-p2pkh":if(r&&"witnessscripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);o(L4.Buffer,t.witnessScript,`${n} requires witnessScript`),o(L4.value(void 0),t.redeemScript,`${n} requires NO redeemScript`),o(q4.Satoshi,t.witnessValue,`${n} requires witnessValue`);break;case"p2sh-p2wsh-p2ms":case"p2sh-p2wsh-p2pk":case"p2sh-p2wsh-p2pkh":if(r&&"scripthash"!==r)throw new TypeError(`input #${t.vin} is not of type ${n}: ${r}`);o(L4.Buffer,t.witnessScript,`${n} requires witnessScript`),o(L4.Buffer,t.redeemScript,`${n} requires witnessScript`),o(q4.Satoshi,t.witnessValue,`${n} requires witnessScript`)}}(t,a),({vin:m,keyPair:c,redeemScript:h,hashType:f,witnessValue:d,witnessScript:p}=a)}if(void 0===c)throw new Error("sign requires keypair");if(c.network&&c.network!==e)throw new TypeError("Inconsistent network");if(!t[m])throw new Error("No input at index: "+m);if(r(f=f||R5.Transaction.SIGHASH_ALL))throw new Error("Transaction needs outputs");const v=t[m];if(void 0!==v.redeemScript&&h&&!v.redeemScript.equals(h))throw new Error("Inconsistent redeemScript");const y=c.publicKey||c.getPublicKey&&c.getPublicKey();if(!l(v)){if(void 0!==d){if(void 0!==v.value&&v.value!==d)throw new Error("Input did not match witnessValue");L4(q4.Satoshi,d),v.value=d}if(!l(v)){const e=function(e,t,r,i){if(r&&i){const o=E5.p2wsh({redeem:{output:i}}),s=E5.p2wsh({output:r}),a=E5.p2sh({redeem:{output:r}}),c=E5.p2sh({redeem:o});if(!o.hash.equals(s.hash))throw new Error("Witness script inconsistent with prevOutScript");if(!a.hash.equals(c.hash))throw new Error("Redeem script inconsistent with prevOutScript");const l=u(o.redeem.output,t);if(!l.pubkeys)throw new Error(l.type+" not supported as witnessScript ("+r5.toASM(i)+")");e.signatures&&e.signatures.some((e=>void 0!==e))&&(l.signatures=e.signatures);const h=i;if(l.type===n.P2WPKH)throw new Error("P2SH(P2WSH(P2WPKH)) is a consensus failure");return{redeemScript:r,redeemScriptType:n.P2WSH,witnessScript:i,witnessScriptType:l.type,prevOutType:n.P2SH,prevOutScript:a.output,hasWitness:!0,signScript:h,signType:l.type,pubkeys:l.pubkeys,signatures:l.signatures,maxSignatures:l.maxSignatures}}if(r){const i=E5.p2sh({redeem:{output:r}});if(e.prevOutScript){let t;try{t=E5.p2sh({output:e.prevOutScript})}catch(e){throw new Error("PrevOutScript must be P2SH")}if(!i.hash.equals(t.hash))throw new Error("Redeem script inconsistent with prevOutScript")}const o=u(i.redeem.output,t);if(!o.pubkeys)throw new Error(o.type+" not supported as redeemScript ("+r5.toASM(r)+")");e.signatures&&e.signatures.some((e=>void 0!==e))&&(o.signatures=e.signatures);let s=r;return o.type===n.P2WPKH&&(s=E5.p2pkh({pubkey:o.pubkeys[0]}).output),{redeemScript:r,redeemScriptType:o.type,prevOutType:n.P2SH,prevOutScript:i.output,hasWitness:o.type===n.P2WPKH,signScript:s,signType:o.type,pubkeys:o.pubkeys,signatures:o.signatures,maxSignatures:o.maxSignatures}}if(i){const r=E5.p2wsh({redeem:{output:i}});if(e.prevOutScript){const t=E5.p2wsh({output:e.prevOutScript});if(!r.hash.equals(t.hash))throw new Error("Witness script inconsistent with prevOutScript")}const o=u(r.redeem.output,t);if(!o.pubkeys)throw new Error(o.type+" not supported as witnessScript ("+r5.toASM(i)+")");e.signatures&&e.signatures.some((e=>void 0!==e))&&(o.signatures=e.signatures);const s=i;if(o.type===n.P2WPKH)throw new Error("P2WSH(P2WPKH) is a consensus failure");return{witnessScript:i,witnessScriptType:o.type,prevOutType:n.P2WSH,prevOutScript:r.output,hasWitness:!0,signScript:s,signType:o.type,pubkeys:o.pubkeys,signatures:o.signatures,maxSignatures:o.maxSignatures}}if(e.prevOutType&&e.prevOutScript){if(e.prevOutType===n.P2SH)throw new Error("PrevOutScript is "+e.prevOutType+", requires redeemScript");if(e.prevOutType===n.P2WSH)throw new Error("PrevOutScript is "+e.prevOutType+", requires witnessScript");if(!e.prevOutScript)throw new Error("PrevOutScript is missing");const r=u(e.prevOutScript,t);if(!r.pubkeys)throw new Error(r.type+" not supported ("+r5.toASM(e.prevOutScript)+")");e.signatures&&e.signatures.some((e=>void 0!==e))&&(r.signatures=e.signatures);let i=e.prevOutScript;return r.type===n.P2WPKH&&(i=E5.p2pkh({pubkey:r.pubkeys[0]}).output),{prevOutType:r.type,prevOutScript:e.prevOutScript,hasWitness:r.type===n.P2WPKH,signScript:i,signType:r.type,pubkeys:r.pubkeys,signatures:r.signatures,maxSignatures:r.maxSignatures}}const o=E5.p2pkh({pubkey:t}).output;return{prevOutType:n.P2PKH,prevOutScript:o,hasWitness:!1,signScript:o,signType:n.P2PKH,pubkeys:[t],signatures:[void 0]}}(v,y,h,p);Object.assign(v,e)}if(!l(v))throw Error(v.prevOutType+" not supported")}let b;return b=v.hasWitness?s.hashForWitnessV0(m,v.signScript,v.value,f):s.hashForSignature(m,v.signScript,f),{input:v,ourPubKey:y,keyPair:c,signatureHash:b,hashType:f,useLowR:!!g}}(this.network,this.__INPUTS,this.__needsOutputs.bind(this),this.__TX,e,t,r,s,a,c,this.__USE_LOW_R))}__addInputUnsafe(e,t,r){if(R5.Transaction.isCoinbaseHash(e))throw new Error("coinbase inputs not supported");const n=e.toString("hex")+":"+t;if(void 0!==this.__PREV_TX_SET[n])throw new Error("Duplicate TxOut: "+n);let i={};if(void 0!==r.script&&(i=a(r.script,r.witness||[])),void 0!==r.value&&(i.value=r.value),!i.prevOutScript&&r.prevOutScript){let e;if(!i.pubkeys&&!i.signatures){const t=u(r.prevOutScript);t.pubkeys&&(i.pubkeys=t.pubkeys,i.signatures=t.signatures),e=t.type}i.prevOutScript=r.prevOutScript,i.prevOutType=e||I8.output(r.prevOutScript)}const o=this.__TX.addInput(e,t,r.sequence,r.scriptSig);return this.__INPUTS[o]=i,this.__PREV_TX_SET[n]=!0,o}__build(e){if(!e){if(!this.__TX.ins.length)throw new Error("Transaction has no inputs");if(!this.__TX.outs.length)throw new Error("Transaction has no outputs")}const t=this.__TX.clone();if(this.__INPUTS.forEach(((r,i)=>{if(!r.prevOutType&&!e)throw new Error("Transaction is not complete");const o=c(r.prevOutType,r,e);if(o)t.setInputScript(i,o.input),t.setWitness(i,o.witness);else{if(!e&&r.prevOutType===n.NONSTANDARD)throw new Error("Unknown input type");if(!e)throw new Error("Not enough information")}})),!e&&this.__overMaximumFees(t.virtualSize()))throw new Error("Transaction has absurd fees");return t}__canModifyInputs(){return this.__INPUTS.every((e=>!e.signatures||e.signatures.every((e=>!e||0!=(h(e)&R5.Transaction.SIGHASH_ANYONECANPAY)))))}__needsOutputs(e){return e===R5.Transaction.SIGHASH_ALL?0===this.__TX.outs.length:0===this.__TX.outs.length&&this.__INPUTS.some((e=>!!e.signatures&&e.signatures.some((e=>!!e&&!(h(e)&R5.Transaction.SIGHASH_NONE)))))}__canModifyOutputs(){const e=this.__TX.ins.length,t=this.__TX.outs.length;return this.__INPUTS.every((r=>void 0===r.signatures||r.signatures.every((r=>{if(!r)return!0;const n=31&h(r);return n===R5.Transaction.SIGHASH_NONE||n===R5.Transaction.SIGHASH_SINGLE&&e<=t}))))}__overMaximumFees(e){return(this.__INPUTS.reduce(((e,t)=>e+(t.value>>>0)),0)-this.__TX.outs.reduce(((e,t)=>e+t.value),0))/e>this.maximumFeeRate}}function a(e,t,r,i){if(0===e.length&&0===t.length)return{};if(!r){let i=I8.input(e,!0),o=I8.witness(t,!0);i===n.NONSTANDARD&&(i=void 0),o===n.NONSTANDARD&&(o=void 0),r=i||o}switch(r){case n.P2WPKH:{const{output:e,pubkey:r,signature:i}=E5.p2wpkh({witness:t});return{prevOutScript:e,prevOutType:n.P2WPKH,pubkeys:[r],signatures:[i]}}case n.P2PKH:{const{output:t,pubkey:r,signature:i}=E5.p2pkh({input:e});return{prevOutScript:t,prevOutType:n.P2PKH,pubkeys:[r],signatures:[i]}}case n.P2PK:{const{signature:t}=E5.p2pk({input:e});return{prevOutType:n.P2PK,pubkeys:[void 0],signatures:[t]}}case n.P2MS:{const{m:t,pubkeys:r,signatures:o}=E5.p2ms({input:e,output:i},{allowIncomplete:!0});return{prevOutType:n.P2MS,pubkeys:r,signatures:o,maxSignatures:t}}}if(r===n.P2SH){const{output:r,redeem:i}=E5.p2sh({input:e,witness:t}),o=I8.output(i.output),s=a(i.input,i.witness,o,i.output);return s.prevOutType?{prevOutScript:r,prevOutType:n.P2SH,redeemScript:i.output,redeemScriptType:s.prevOutType,witnessScript:s.witnessScript,witnessScriptType:s.witnessScriptType,pubkeys:s.pubkeys,signatures:s.signatures}:{}}if(r===n.P2WSH){const{output:r,redeem:i}=E5.p2wsh({input:e,witness:t}),o=I8.output(i.output);let s;return s=o===n.P2WPKH?a(i.input,i.witness,o):a(r5.compile(i.witness),[],o,i.output),s.prevOutType?{prevOutScript:r,prevOutType:n.P2WSH,witnessScript:i.output,witnessScriptType:s.prevOutType,pubkeys:s.pubkeys,signatures:s.signatures}:{}}return{prevOutType:n.NONSTANDARD,prevOutScript:e}}function u(e,t){L4(q4.Buffer,e);const r=I8.output(e);switch(r){case n.P2PKH:{if(!t)return{type:r};const n=E5.p2pkh({output:e}).hash,i=a5.hash160(t);return n.equals(i)?{type:r,pubkeys:[t],signatures:[void 0]}:{type:r}}case n.P2WPKH:{if(!t)return{type:r};const n=E5.p2wpkh({output:e}).hash,i=a5.hash160(t);return n.equals(i)?{type:r,pubkeys:[t],signatures:[void 0]}:{type:r}}case n.P2PK:return{type:r,pubkeys:[E5.p2pk({output:e}).pubkey],signatures:[void 0]};case n.P2MS:{const t=E5.p2ms({output:e});return{type:r,pubkeys:t.pubkeys,signatures:t.pubkeys.map((()=>{})),maxSignatures:t.m}}}return{type:r}}function c(e,t,i){const o=t.pubkeys||[];let s=t.signatures||[];switch(e){case n.P2PKH:if(0===o.length)break;if(0===s.length)break;return E5.p2pkh({pubkey:o[0],signature:s[0]});case n.P2WPKH:if(0===o.length)break;if(0===s.length)break;return E5.p2wpkh({pubkey:o[0],signature:s[0]});case n.P2PK:if(0===o.length)break;if(0===s.length)break;return E5.p2pk({signature:s[0]});case n.P2MS:{const e=t.maxSignatures;s=i?s.map((e=>e||r.OPS.OP_0)):s.filter((e=>e));const n=!i||e===s.length;return E5.p2ms({m:e,pubkeys:o,signatures:s},{allowIncomplete:i,validate:n})}case n.P2SH:{const e=c(t.redeemScriptType,t,i);if(!e)return;return E5.p2sh({redeem:{output:e.output||t.redeemScript,input:e.input,witness:e.witness}})}case n.P2WSH:{const e=c(t.witnessScriptType,t,i);if(!e)return;return E5.p2wsh({redeem:{output:t.witnessScript,input:e.input,witness:e.witness}})}}}function l(e){return void 0!==e.signScript&&void 0!==e.signType&&void 0!==e.pubkeys&&void 0!==e.signatures&&e.signatures.length===e.pubkeys.length&&e.pubkeys.length>0&&(!1===e.hasWitness||void 0!==e.value)}function h(e){return e.readUInt8(e.length-1)}t.TransactionBuilder=s}));MB(A8),A8.TransactionBuilder;var P8=RB((function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.bip32=H4,t.address=k5,t.crypto=a5,t.ECPair=A5,t.networks=z4,t.payments=E5,t.script=r5,t.Block=N5.Block,t.Psbt=i8.Psbt;var r=r5;t.opcodes=r.OPS,t.Transaction=R5.Transaction,t.TransactionBuilder=A8.TransactionBuilder}));MB(P8),P8.bitcoin,P8.bip32,P8.address,P8.crypto,P8.ECPair,P8.networks,P8.payments,P8.script,P8.Block,P8.Psbt,P8.opcodes,P8.Transaction,P8.TransactionBuilder;const T8=Hz("Verifier");class O8{constructor({certificateJson:e,chain:t,expires:r,id:n,issuer:i,receipt:o,revocationKey:s,transactionId:a,version:u,explorerAPIs:c}){this.chain=t,this.expires=r,this.id=n,this.issuer=i,this.receipt=o,this.revocationKey=s,this.version=u,this.transactionId=a,this.explorerAPIs=c;let l=e.document;l||(l=this._retrieveDocumentBeforeIssuance(e)),this.documentToVerify=Object.assign({},l),this._stepsStatuses=[]}verify(e=(()=>{})){return oB(this,void 0,void 0,(function*(){if(this._stepCallback=e,this.version===aB.V1_1)throw new TB("","Verification of 1.1 certificates is not supported by this component. See the python cert-verifier for legacy verification");xV.chains.isMockChain(this.chain)?yield this._verifyV2Mock():yield this._verifyMain();const t=this._stepsStatuses.find((e=>"failure"===e.status));return t?this._failed(t):this._succeed()}))}_getRevocationListUrl(e){var t;return(null===(t=this.issuer)||void 0===t?void 0:t.revocationList)?this.issuer.revocationList:e.revocationList}_doAction(e,t){return oB(this,void 0,void 0,(function*(){if(this._isFailing())return;let r;e&&(r=xV.i18n.getText("subSteps",`${e}LabelPending`),T8(r),this._updateStatusCallback(e,r,"starting"));try{const n=yield t();return e&&(this._updateStatusCallback(e,r,"success"),this._stepsStatuses.push({step:e,label:r,status:"success"})),n}catch(t){e&&(this._updateStatusCallback(e,r,"failure",t.message),this._stepsStatuses.push({code:e,label:r,status:"failure",errorMessage:t.message}))}}))}_stepCallback(e){}_verifyMain(){return oB(this,void 0,void 0,(function*(){yield this.getTransactionId(),yield this.computeLocalHash(),yield this.fetchRemoteHash(),yield this.getIssuerProfile(),yield this.parseIssuerKeys(),yield this.compareHashes(),yield this.checkMerkleRoot(),yield this.checkReceipt(),yield this.checkRevokedStatus(),yield this.checkAuthenticity(),yield this.checkExpiresDate()}))}_verifyV2Mock(){return oB(this,void 0,void 0,(function*(){yield this.computeLocalHash(),yield this.compareHashes(),yield this.checkReceipt(),yield this.checkExpiresDate()}))}getTransactionId(){return oB(this,void 0,void 0,(function*(){yield this._doAction("getTransactionId",(()=>function(e){if("string"==typeof e&&e.length>0)return e;throw new TB("getTransactionId",SB("errors","isTransactionIdValid"))}(this.transactionId)))}))}computeLocalHash(){return oB(this,void 0,void 0,(function*(){this.localHash=yield this._doAction("computeLocalHash",(()=>oB(this,void 0,void 0,(function*(){return yield function(e,t){return oB(this,void 0,void 0,(function*(){let r=e["@context"];const n=e;!function(e){return e===rB.V1_1||e===rB.V1_2}(t)&&(r.find((e=>e===Object(e)&&"@vocab"in e))?r=null:r.push({"@vocab":"http://fallback.org/"}));const i="undefined"!=typeof window&&void 0!==window.XMLHttpRequest?$X.documentLoaders.xhr():$X.documentLoaders.node();$X.documentLoader=function(e,t){return e in bB?t(null,{contextUrl:null,document:bB[e],documentUrl:e}):i(e,t)};const o={algorithm:"URDNA2015",format:"application/nquads"};return r&&(o.expandContext=r),new Promise(((e,t)=>{$X.normalize(n,o,((r,n)=>{if(r)console.error(r),t(new TB("computeLocalHash",SB("errors","failedJsonLdNormalization")));else{const r=function(e){const t=/<http:\/\/fallback\.org\/(.*)>/.exec(e);if(t){const e=[];for(let r=0;r<t.length;r++)e.push(t[r]);return e}return null}(n);r?t(new TB("computeLocalHash",`${SB("errors","foundUnmappedFields")}: ${r.join(", ")}`)):e(GX(function(e){const t=[];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<55296||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&e.charCodeAt(r)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}(n)))}}))}))}))}(this.documentToVerify,this.version)}))))}))}fetchRemoteHash(){return oB(this,void 0,void 0,(function*(){this.txData=yield this._doAction("fetchRemoteHash",(()=>oB(this,void 0,void 0,(function*(){return yield xV.verifier.lookForTx({transactionId:this.transactionId,chain:this.chain.code,explorerAPIs:this.explorerAPIs})}))))}))}getIssuerProfile(){return oB(this,void 0,void 0,(function*(){this.issuer=yield this._doAction("getIssuerProfile",(()=>oB(this,void 0,void 0,(function*(){return yield xV.verifier.getIssuerProfile(this.issuer)}))))}))}parseIssuerKeys(){return oB(this,void 0,void 0,(function*(){this.issuerPublicKeyList=yield this._doAction("parseIssuerKeys",(()=>xV.verifier.parseIssuerKeys(this.issuer)))}))}compareHashes(){return oB(this,void 0,void 0,(function*(){yield this._doAction("compareHashes",(()=>{!function(e,t){if(e!==t)throw new TB("compareHashes",SB("errors","ensureHashesEqual"))}(this.localHash,this.receipt.targetHash)}))}))}checkMerkleRoot(){return oB(this,void 0,void 0,(function*(){yield this._doAction("checkMerkleRoot",(()=>function(e,t){if(e!==t)throw new TB("checkMerkleRoot",SB("errors","ensureMerkleRootEqual"));return!0}(this.receipt.merkleRoot,this.txData.remoteHash)))}))}checkReceipt(){return oB(this,void 0,void 0,(function*(){yield this._doAction("checkReceipt",(()=>function(e){let t=e.targetHash;const r=e.merkleRoot;try{const r=e.proof||e.path;if(r)for(const e in r){const n=r[e];let i;if(void 0!==n.left)i=XX(`${n.left}${t}`),t=GX(i);else{if(void 0===n.right)throw new TB("checkReceipt","Trigger catch error.");i=XX(`${t}${n.right}`),t=GX(i)}}}catch(e){throw new TB("checkReceipt",SB("errors","ensureValidReceipt"))}if(t!==r)throw new TB("checkReceipt",SB("errors","invalidMerkleReceipt"))}(this.receipt)))}))}checkRevokedStatus(){var e;return oB(this,void 0,void 0,(function*(){let t,r;this.version===aB.V1_2?(r=(null===(e=this.txData)||void 0===e?void 0:e.revokedAddresses)||[],t=[xV.verifier.parseRevocationKey(this.issuer),this.revocationKey]):(r=yield this._doAction(null,(()=>oB(this,void 0,void 0,(function*(){return yield xV.verifier.getRevokedAssertions(this._getRevocationListUrl(this.issuer),this.id)})))),t=this.id),yield this._doAction("checkRevokedStatus",(()=>function(e,t){if(!e||!t)return;Array.isArray(t)||(t=[t]);const r=function(e=[],t=[]){return e.filter((e=>-1!==t.indexOf(e))).filter(((e,t,r)=>r.indexOf(e)===t))}(t=t.filter((e=>null!=e)),e.map((e=>e.id)));if(r.length>0){const t=e.findIndex((e=>e.id===r[0]));if(t>-1)throw new TB("checkRevokedStatus",xV.certificates.generateRevocationReason(e[t].revocationReason))}}(r,t)))}))}checkAuthenticity(){return oB(this,void 0,void 0,(function*(){yield this._doAction("checkAuthenticity",(()=>function(e,t,r){let n="";const i=function(e,t){let r=null;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&n.toLowerCase()===t.toLowerCase()&&(r=n);return e[r]}(e,t),o=wV(r);if(i?(i.created&&o<=i.created&&(n="invalidIssuingAddressCreationTime"),i.revoked&&o>=i.revoked&&(n="invalidIssuingAddressRevoked"),i.expires&&o>=i.expires&&(n="invalidIssuingAddressExpired")):n="invalidIssuingAddressUnknown",n)throw new TB("checkAuthenticity",SB("errors",n))}(this.issuerPublicKeyList,this.txData.issuingAddress,this.txData.time)))}))}checkExpiresDate(){return oB(this,void 0,void 0,(function*(){yield this._doAction("checkExpiresDate",(()=>function(e=null){if(!e)return;const t=wV(e);if(new Date>=t)throw new TB("checkExpiresDate",SB("errors","ensureNotExpired"))}(this.expires)))}))}_failed(e){const t=e.errorMessage;return T8(`failure:${t}`),this._setFinalStep({status:"failure",message:t})}_isFailing(){return this._stepsStatuses.some((e=>"failure"===e.status))}_retrieveDocumentBeforeIssuance(e){const t=Object.assign({},e);return delete t.signature,t}_succeed(){const e=xV.chains.isMockChain(this.chain)?xV.i18n.getText("success","mocknet"):xV.i18n.getText("success","blockchain");return T8(e),this._setFinalStep({status:"success",message:e})}_setFinalStep({status:e,message:t}){return{code:"final",status:e,message:t}}_updateStatusCallback(e,t,r,n=""){if(null!=e){const i={code:e,label:t,status:r};n&&(i.errorMessage=n),this._stepCallback(i)}}}class C8{constructor(e,t={}){if(this.explorerAPIs=[],this._setOptions(t),"object"!=typeof e)try{e=JSON.parse(e)}catch(e){throw new Error(xV.i18n.getText("errors","certificateNotValid"))}this.certificateJson=jB(e)}init(){return oB(this,void 0,void 0,(function*(){yield this.parseJson(this.certificateJson)}))}parseJson(e){return oB(this,void 0,void 0,(function*(){const t=yield EV(e);if(!t.isFormatValid)throw new Error(t.error);this._setProperties(t)}))}verify(e){return oB(this,void 0,void 0,(function*(){const t=new O8({certificateJson:this.certificateJson,chain:this.chain,expires:this.expires,id:this.id,issuer:this.issuer,receipt:this.receipt,revocationKey:this.revocationKey,transactionId:this.transactionId,version:this.version,explorerAPIs:jB(this.explorerAPIs)});return yield t.verify(e)}))}_setOptions(e){this.options=Object.assign({},wB,e),this.locale=xV.i18n.ensureIsSupported("auto"===this.options.locale?xV.i18n.detectLocale():this.options.locale),this.explorerAPIs=this.options.explorerAPIs||[],xB.locale=this.locale}_setProperties({certificateImage:e,chain:t,description:r,expires:n,id:i,isFormatValid:o,issuedOn:s,issuer:a,metadataJson:u,name:c,publicKey:l,receipt:h,recipientFullName:f,recordLink:d,revocationKey:p,sealImage:g,signature:m,signatureImage:v,subtitle:y,version:b}){this.isFormatValid=o,this.certificateImage=e,this.chain=t,this.description=r,this.expires=n,this.id=i,this.issuedOn=s,this.issuer=a,this.metadataJson=u,this.name=c,this.publicKey=l,this.receipt=h,this.recipientFullName=f,this.recordLink=d,this.revocationKey=p,this.sealImage=g,this.signature=m,this.signatureImage=v,this.subtitle=y,this.verificationSteps=xV.certificates.getVerificationMap(t),this.version=b,this._setTransactionDetails()}_setTransactionDetails(){this.transactionId=xV.certificates.getTransactionId(this.receipt),this.rawTransactionLink=xV.certificates.getTransactionLink(this.transactionId,this.chain,!0),this.transactionLink=xV.certificates.getTransactionLink(this.transactionId,this.chain)}}var M8=Object.freeze({__proto__:null,displayHtmlHasNoWidthConstraint:function(e){const t=(new DOMParser).parseFromString(e,"text/html");return t.body.childElementCount===t.body.querySelectorAll(ut.map((e=>`section[class*="${e}"]`)).join(", ")).length},download:function(e){return e+ct},initializeVerificationSteps:function(e){const t=JSON.parse(JSON.stringify(e.verificationSteps));return t.map(((e,r)=>({...e,isLast:r===t.length-1,status:GD.DEFAULT})))},retrieve:function(e){return XD(e)||YD(e)?fetch(e+ct).then((e=>e.text())).then((e=>{try{return{certificateDefinition:JSON.parse(e)}}catch(e){return console.log(e),{certificateDefinition:null,errorMessage:"errors.invalidBlockcertsUrl"}}})).catch(QD):(console.error("Invalid url to retrieve:",e),null)},read:async function(e){if(!e)return;const t=await function(e){return new Promise((function(t,r){const n=new FileReader;n.onload=function(e){t(e.target.result)},n.onerror=n.onabort=r,n.readAsText(e)}))}(e);return t},parse:function(e,t={}){return iB(this,void 0,void 0,(function*(){t.locale||(t.locale="auto");try{let r;return r=1===Fh(e["@context"]).versionNumber?new C8(e,t):new JD(e,t),yield r.init(),{certificateDefinition:r}}catch(e){return console.error(e),{certificateDefinition:null,errorMessage:"errors.invalidBlockcerts"}}}))},isPathToCertificateValidURI:function(e){return XD(e)||YD(e)}});var R8=((e={})=>{if(!window.Proxy){const t=function(){let e=null;function t(e){return!!e&&("object"==typeof e||"function"==typeof e)}const r=function(r,n){if(!t(r)||!t(n))throw new TypeError("Cannot create proxy with a non-object as target or handler");let i=function(){};e=function(){i=function(e){throw new TypeError(`Cannot perform '${e}' on a proxy that has been revoked`)}};const o=n;n={get:null,set:null,apply:null,construct:null};for(const e in o)e in n&&(n[e]=o[e]);"function"==typeof o&&(n.apply=o.apply.bind(o));let s=this,a=!1,u=!1;"function"==typeof r?(s=function(){const e=this&&this.constructor===s,t=Array.prototype.slice.call(arguments);return i(e?"construct":"apply"),e&&n.construct?n.construct.call(this,r,t):!e&&n.apply?n.apply(r,this,t):e?(t.unshift(r),new(r.bind.apply(r,t))):r.apply(this,t)},a=!0):r instanceof Array&&(s=[],u=!0);const c=n.get?function(e){return i("get"),n.get(this,e,s)}:function(e){return i("get"),this[e]},l=n.set?function(e,t){i("set"),n.set(this,e,t,s)}:function(e,t){i("set"),this[e]=t},h=Object.getOwnPropertyNames(r),f={};h.forEach((function(e){if((a||u)&&e in s)return;const t={enumerable:!!Object.getOwnPropertyDescriptor(r,e).enumerable,get:c.bind(r,e),set:l.bind(r,e)};Object.defineProperty(s,e,t),f[e]=!0}));let d=!0;if(Object.setPrototypeOf?Object.setPrototypeOf(s,Object.getPrototypeOf(r)):s.__proto__?s.__proto__=r.__proto__:d=!1,n.get||!d)for(const e in r)f[e]||Object.defineProperty(s,e,{get:c.bind(r,e)});return Object.seal(r),Object.seal(s),s};return r.revocable=function(t,n){return{proxy:new r(t,n),revoke:e}},r}();return new t(e,at)}return new Proxy(e,at)})({certificates:M8,events:Object.freeze({__proto__:null,dispatch:function(e="",t=null,r){if(!e||"string"!=typeof e)return;if(!t||"object"!=typeof t)return;const n=new CustomEvent(e,{detail:{certificateDefinition:t,...r}});window.dispatchEvent(n)}})});function N8(e,t){return e(t={exports:{}},t.exports),t.exports}function L8(){var e={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return e}var j8=/javascript\s*\:/gim;var D8={whiteList:L8(),getDefaultWhiteList:L8,onAttr:function(e,t,r){},onIgnoreAttr:function(e,t,r){},safeAttrValue:function(e,t){return j8.test(t)?"":t}},B8=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},U8=function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")};var F8=function(e,t){";"!==(e=U8(e))[e.length-1]&&(e+=";");var r=e.length,n=!1,i=0,o=0,s="";function a(){if(!n){var r=B8(e.slice(i,o)),a=r.indexOf(":");if(-1!==a){var u=B8(r.slice(0,a)),c=B8(r.slice(a+1));if(u){var l=t(i,s.length,u,c,r);l&&(s+=l+"; ")}}}i=o+1}for(;o<r;o++){var u=e[o];if("/"===u&&"*"===e[o+1]){var c=e.indexOf("*/",o+2);if(-1===c)break;i=(o=c+1)+1,n=!1}else"("===u?n=!0:")"===u?n=!1:";"===u?n||a():"\n"===u&&a()}return B8(s)};function H8(e){return null==e}function z8(e){e=function(e){var t={};for(var r in e)t[r]=e[r];return t}(e||{}),e.whiteList=e.whiteList||D8.whiteList,e.onAttr=e.onAttr||D8.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||D8.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||D8.safeAttrValue,this.options=e}z8.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,r=t.whiteList,n=t.onAttr,i=t.onIgnoreAttr,o=t.safeAttrValue;return F8(e,(function(e,t,s,a,u){var c=r[s],l=!1;if(!0===c?l=c:"function"==typeof c?l=c(a):c instanceof RegExp&&(l=c.test(a)),!0!==l&&(l=!1),a=o(s,a)){var h,f={position:t,sourcePosition:e,source:u,isWhite:l};return l?H8(h=n(s,a,f))?s+":"+a:h:H8(h=i(s,a,f))?void 0:h}}))};var V8=z8,q8=N8((function(e,t){for(var r in t=e.exports=function(e,t){return new V8(t).process(e)},t.FilterCSS=V8,D8)t[r]=D8[r];"undefined"!=typeof window&&(window.filterCSS=e.exports)}));q8.cssfilter,q8.FilterCSS;var K8=function(e,t){var r,n;if(Array.prototype.indexOf)return e.indexOf(t);for(r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1},$8=function(e,t,r){var n,i;if(Array.prototype.forEach)return e.forEach(t,r);for(n=0,i=e.length;n<i;n++)t.call(r,e[n],n,e)},W8=function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},J8=function(e){var t=/\s|\n|\t/.exec(e);return t?t.index:-1},G8=q8.FilterCSS,X8=q8.getDefaultWhiteList;function Y8(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var Q8=new G8;function Z8(e){return e.replace(e9,"<").replace(t9,">")}var e9=/</g,t9=/>/g,r9=/"/g,n9=/"/g,i9=/&#([a-zA-Z0-9]*);?/gim,o9=/:?/gim,s9=/&newline;?/gim,a9=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi,u9=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,c9=/u\s*r\s*l\s*\(.*/gi;function l9(e){return e.replace(r9,""")}function h9(e){return e.replace(n9,'"')}function f9(e){return e.replace(i9,(function(e,t){return"x"===t[0]||"X"===t[0]?String.fromCharCode(parseInt(t.substr(1),16)):String.fromCharCode(parseInt(t,10))}))}function d9(e){return e.replace(o9,":").replace(s9," ")}function p9(e){for(var t="",r=0,n=e.length;r<n;r++)t+=e.charCodeAt(r)<32?" ":e.charAt(r);return W8(t)}function g9(e){return e=p9(e=d9(e=f9(e=h9(e))))}function m9(e){return e=Z8(e=l9(e))}var v9=function(e,t,r,n){if(r=g9(r),"href"===t||"src"===t){if("#"===(r=W8(r)))return"#";if("http://"!==r.substr(0,7)&&"https://"!==r.substr(0,8)&&"mailto:"!==r.substr(0,7)&&"tel:"!==r.substr(0,4)&&"data:image/"!==r.substr(0,11)&&"ftp://"!==r.substr(0,6)&&"./"!==r.substr(0,2)&&"../"!==r.substr(0,3)&&"#"!==r[0]&&"/"!==r[0])return""}else if("background"===t){if(a9.lastIndex=0,a9.test(r))return""}else if("style"===t){if(u9.lastIndex=0,u9.test(r))return"";if(c9.lastIndex=0,c9.test(r)&&(a9.lastIndex=0,a9.test(r)))return"";!1!==n&&(r=(n=n||Q8).process(r))}return r=m9(r)},y9=function(e,t){"function"!=typeof t&&(t=function(){});var r=!Array.isArray(e),n=[],i=!1;return{onIgnoreTag:function(o,s,a){if(function(t){return!!r||-1!==K8(e,t)}(o)){if(a.isClosing){var u="[/removed]",c=a.position+u.length;return n.push([!1!==i?i:a.position,c]),i=!1,u}return i||(i=a.position),"[removed]"}return t(o,s,a)},remove:function(e){var t="",r=0;return $8(n,(function(n){t+=e.slice(r,n[0]),r=n[1]})),t+=e.slice(r)}}},b9=function(e){for(var t="",r=0;r<e.length;){var n=e.indexOf("\x3c!--",r);if(-1===n){t+=e.slice(r);break}t+=e.slice(r,n);var i=e.indexOf("--\x3e",n);if(-1===i)break;r=i+3}return t},w9=function(e){var t=e.split("");return t=t.filter((function(e){var t=e.charCodeAt(0);return 127!==t&&(!(t<=31)||(10===t||13===t))})),t.join("")},_9={whiteList:{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},getDefaultWhiteList:Y8,onTag:function(e,t,r){},onIgnoreTag:function(e,t,r){},onTagAttr:function(e,t,r){},onIgnoreTagAttr:function(e,t,r){},safeAttrValue:v9,escapeHtml:Z8,escapeQuote:l9,unescapeQuote:h9,escapeHtmlEntities:f9,escapeDangerHtml5Entities:d9,clearNonPrintableCharacter:p9,friendlyAttrValue:g9,escapeAttrValue:m9,onIgnoreTagStripAll:function(){return""},StripTagBody:y9,stripCommentTag:b9,stripBlankChar:w9,cssFilter:Q8,getDefaultCSSWhiteList:X8};function x9(e){var t=J8(e);if(-1===t)var r=e.slice(1,-1);else r=e.slice(1,t+1);return"/"===(r=W8(r).toLowerCase()).slice(0,1)&&(r=r.slice(1)),"/"===r.slice(-1)&&(r=r.slice(0,-1)),r}function S9(e){return"</"===e.slice(0,2)}var E9=/[^a-zA-Z0-9_:\.\-]/gim;function k9(e,t){for(;t<e.length;t++){var r=e[t];if(" "!==r)return"="===r?t:-1}}function I9(e,t){for(;t>0;t--){var r=e[t];if(" "!==r)return"="===r?t:-1}}function A9(e){return function(e){return'"'===e[0]&&'"'===e[e.length-1]||"'"===e[0]&&"'"===e[e.length-1]}(e)?e.substr(1,e.length-2):e}var P9=function(e,t,r){var n="",i=0,o=!1,s=!1,a=0,u=e.length,c="",l="";e:for(a=0;a<u;a++){var h=e.charAt(a);if(!1===o){if("<"===h){o=a;continue}}else if(!1===s){if("<"===h){n+=r(e.slice(i,a)),o=a,i=a;continue}if(">"===h){n+=r(e.slice(i,o)),c=x9(l=e.slice(o,a+1)),n+=t(o,n.length,c,l,S9(l)),i=a+1,o=!1;continue}if('"'===h||"'"===h)for(var f=1,d=e.charAt(a-f);""===d.trim()||"="===d;){if("="===d){s=h;continue e}d=e.charAt(a-++f)}}else if(h===s){s=!1;continue}}return i<e.length&&(n+=r(e.substr(i))),n},T9=function(e,t){var r=0,n=[],i=!1,o=e.length;function s(e,r){if(!((e=(e=W8(e)).replace(E9,"").toLowerCase()).length<1)){var i=t(e,r||"");i&&n.push(i)}}for(var a=0;a<o;a++){var u,c=e.charAt(a);if(!1!==i||"="!==c)if(!1===i||a!==r||'"'!==c&&"'"!==c||"="!==e.charAt(a-1))if(/\s|\n|\t/.test(c)){if(e=e.replace(/\s|\n|\t/g," "),!1===i){if(-1===(u=k9(e,a))){s(W8(e.slice(r,a))),i=!1,r=a+1;continue}a=u-1;continue}if(-1===(u=I9(e,a-1))){s(i,A9(W8(e.slice(r,a)))),i=!1,r=a+1;continue}}else;else{if(-1===(u=e.indexOf(c,a+1)))break;s(i,W8(e.slice(r+1,u))),i=!1,r=(a=u)+1}else i=e.slice(r,a),r=a+1}return r<e.length&&(!1===i?s(e.slice(r)):s(i,A9(W8(e.slice(r))))),W8(n.join(" "))},O9={parseTag:P9,parseAttr:T9},C9=q8.FilterCSS,M9=O9.parseTag,R9=O9.parseAttr;function N9(e){return null==e}function L9(e){e=function(e){var t={};for(var r in e)t[r]=e[r];return t}(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=_9.onIgnoreTagStripAll),e.whiteList=e.whiteList||_9.whiteList,e.onTag=e.onTag||_9.onTag,e.onTagAttr=e.onTagAttr||_9.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||_9.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||_9.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||_9.safeAttrValue,e.escapeHtml=e.escapeHtml||_9.escapeHtml,this.options=e,!1===e.css?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new C9(e.css))}L9.prototype.process=function(e){if(!(e=(e=e||"").toString()))return"";var t=this.options,r=t.whiteList,n=t.onTag,i=t.onIgnoreTag,o=t.onTagAttr,s=t.onIgnoreTagAttr,a=t.safeAttrValue,u=t.escapeHtml,c=this.cssFilter;t.stripBlankChar&&(e=_9.stripBlankChar(e)),t.allowCommentTag||(e=_9.stripCommentTag(e));var l=!1;if(t.stripIgnoreTagBody){l=_9.StripTagBody(t.stripIgnoreTagBody,i);i=l.onIgnoreTag}var h=M9(e,(function(e,t,l,h,f){var d,p={sourcePosition:e,position:t,isClosing:f,isWhite:r.hasOwnProperty(l)};if(!N9(d=n(l,h,p)))return d;if(p.isWhite){if(p.isClosing)return"</"+l+">";var g=function(e){var t=J8(e);if(-1===t)return{html:"",closing:"/"===e[e.length-2]};var r="/"===(e=W8(e.slice(t+1,-1)))[e.length-1];return r&&(e=W8(e.slice(0,-1))),{html:e,closing:r}}(h),m=r[l],v=R9(g.html,(function(e,t){var r,n=-1!==K8(m,e);return N9(r=o(l,e,t,n))?n?(t=a(l,e,t,c))?e+'="'+t+'"':e:N9(r=s(l,e,t,n))?void 0:r:r}));h="<"+l;return v&&(h+=" "+v),g.closing&&(h+=" /"),h+=">"}return N9(d=i(l,h,p))?u(h):d}),u);return l&&(h=l.remove(h)),h};var j9=L9,D9=N8((function(e,t){function r(e,t){return new j9(t).process(e)}for(var n in(t=e.exports=r).filterXSS=r,t.FilterXSS=j9,_9)t[n]=_9[n];for(var n in O9)t[n]=O9[n];"undefined"!=typeof window&&(window.filterXSS=e.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=e.exports)}));D9.xss,D9.filterXSS,D9.FilterXSS;const B9={...q8.getDefaultWhiteList(),bottom:!0,left:!0,float:!0,overflow:!0,position:!0,right:!0,top:!0,transform:!0,opacity:!0,"transform-origin":!0,"flex-direction":!0,"flex-wrap":!0,"justify-content":!0,"align-items":!0,"white-space":!0,"line-height":!0,"grid-template-columns":!0,"grid-template-rows":!0,"grid-column":!0,"grid-row":!0,"grid-area":!0,"align-self":!0,"justify-self":!0,span:!0};var U9=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,F9=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,H9=/u\s*r\s*l\s*\(.*/gi;const z9={whiteList:function(){const e=D9.getDefaultWhiteList();return Object.keys(e).forEach((t=>{e[t].push("style"),e[t].push("class"),e[t].push("download")})),e}(),css:!1,stripIgnoreTagBody:!0,onTagAttr:function(e,t,r,n){if("style"===t)return`${t}="${q8(r,{whiteList:B9}).replace(/; /g,";")}"`;if("img"===e&&"src"===t&&function(e){return!!e.match(/^data:.+;base64,/)}(r)){const e=function(e){return e.split("base64,")[1]}(r);try{return atob(e),`${t}="${r}"`}catch(e){return t}}},safeAttrValue:function(e,t,r,n){if(r=D9.friendlyAttrValue(r),"href"===t||"src"===t){if("#"===(r=function(e){if(String.prototype.trim)return e.trim();return e.replace(/(^\s*)|(\s*$)/g,"")}(r)))return"#";if(!function(e){return["http://","https://","mailto:","tel:","data:","#","/"].some((t=>e.substr(0,t.length)===t))}(r))return""}else if("background"===t){if(U9.lastIndex=0,U9.test(r))return""}else if("style"===t){if(F9.lastIndex=0,F9.test(r))return"";if(H9.lastIndex=0,H9.test(r)&&(U9.lastIndex=0,U9.test(r)))return"";!1!==n&&(r=(n=n||D9.getDefaultCSSWhiteList()).process(r))}return r=D9.escapeAttrValue(r)}},V9=new D9.FilterXSS(z9);function q9(e){return V9.process(e)}const K9="en";var $9={locale:K9};const W9={en:{errors:{errorLabel:"Error",invalidBlockcerts:"Not a valid Blockcerts credential. Please check with the issuer or recipient that has provided this credential.",invalidBlockcertsUrl:"Not a valid credential URL.",invalidFormatDragAndDrop:"Only JSON files are accepted",invalidUrl:"This does not seem to be a valid URL.",noDownloadLink:"No link provided for download!",noMetadata:"No metadata specified for this record",noShareUrl:"No URL to share!",noTransactionId:"No transaction ID"},text:{brandName:"Blockcerts",blockcertsHint:"Visit Blockcerts website",by:"by",certified:"Certified by",closeButton:"Click to close",downloadLink:"Download Record in JSON format",dragAndDropHint:"(you can also drag & drop your file).",fileUpload:"Choose JSON file",issued:"Issued on",issueDate:"Issue Date",issuerName:"Issuer",issuerPublicKey:"Issuer's public key",item:"Item",itemPlural:"Items",metadataButton:"View Metadata",metadataTitle:"Metadata",motto:"Blockcerts, The Open Standard for Blockchain Credentials",recipient:"Recipient",share:"Share on",shareButton:"Share on Social Networks",signed:"Signed by",substepsListClose:"Hide",substepsListHint:"Toggle open list of substeps",transactionId:"Transaction ID",urlInput:"Enter the certificate URL",urlInputPlaceholder:"Certificate URL",verificationStepProgress:"Verifying step...",verify:"Verify",verifyAgain:"Verify again",verifyOther:"Verify another record",viewRecord:"View Record"},date:{months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],pattern:"MM DD, YYYY"}},es:{errors:{errorLabel:"Error",invalidBlockcerts:"No es una credencial válida de Blockcerts. Verifique con el emisor o el destinatario que ha proporcionado esta credencial.",invalidBlockcertsUrl:"No es URL de certificado valido.",invalidFormatDragAndDrop:"Solo se aceptan archivos JSON",invalidUrl:"Esto no parece ser un URL válido.",noDownloadLink:"Enlace para descargar no proporcionado!",noMetadata:"No se han especificado metadatos para este registro",noShareUrl:"No hay URL para compartir!",noTransactionId:"No ID de transacción"},text:{brandName:"Blockcerts",blockcertsHint:"Visite el sitio web de Blockcerts",by:"por",certified:"Certificado por",closeButton:"Haz Click para cerrar",downloadLink:"Descarga el Registro en formato JSON",dragAndDropHint:"(también puedes arrastrar y soltar tu archivo).",fileUpload:"Escoge archivo JSON",issued:"Emitido el",issueDate:"Fecha de Emisión",issuerName:"Emisor",issuerPublicKey:"Llave publica del Emisor",item:"Elemento",itemPlural:"Elementos",metadataButton:"Ver Metadata",metadataTitle:"Metadata",motto:"Blockcerts, El Estándar Abierto para Credenciales Blockchain",recipient:"Recipiente",share:"Comparte en",shareButton:"Comparte en Redes Sociales",signed:"Firmado Por",substepsListClose:"Esconde",substepsListHint:"Pasa lista abierta de sub-pasos",transactionId:"ID de Transacción",urlInput:"Ingrese el URL del certificado",urlInputPlaceholder:"Certificado del URL",verificationStepProgress:"Paso de verificación...",verify:"Verifica",verifyAgain:"Verifica nuevamente",verifyOther:"Verifica otro registro",viewRecord:"Ver Registro"},date:{months:["enero","feb","marzo","abr","mayo","jun","jul","agosto","set","oct","nov","dic"],pattern:"MM DD, YYYY"}},fr:{errors:{errorLabel:"Erreur",invalidBlockcerts:"Ceci n'est pas un certificat Blockcerts valide. Veuillez s'il vous plaît contrôler avec l'organisme émetteur ou le récipiendaire de ce certificat.",invalidBlockcertsUrl:"Ceci n'est pas une URL de certificat valide.",invalidFormatDragAndDrop:"Seul le format JSON est accepté",invalidUrl:"URL invalide",noDownloadLink:"Aucun lien disponible pour le téléchargement!",noMetadata:"Ce certificat ne contient pas de métadata",noShareUrl:"Pas d'URL à partager!",noTransactionId:"Pas d'identifiant de transaction"},text:{brandName:"Blockcerts",blockcertsHint:"Visiter le site de Blockcerts",by:"par",certified:"Certifié par",closeButton:"Cliquer pour fermer",downloadLink:"Télécharger le certificat au format JSON",dragAndDropHint:"(vous pouvez aussi glisser et déposer votre fichier).",fileUpload:"Choisir un fichier JSON",issued:"Émis le",issueDate:"Date d'émission",issuerName:"Émetteur",issuerPublicKey:"Clé publique de l'émetteur",item:"point contrôlé",itemPlural:"points contrôlés",metadataButton:"Voir les métadata",metadataTitle:"Métadata",motto:"Blockcerts, The Open Standard for Blockchain Credentials",recipient:"Titulaire",share:"Partager sur",shareButton:"Partager sur les réseaux sociaux",signed:"Signé par",substepsListClose:"Fermer",substepsListHint:"Afficher les sous-étapes",transactionId:"Identifiant de transaction",urlInput:"Entrez l'URL du certificat",urlInputPlaceholder:"URL du certificat",verificationStepProgress:"Vérification en cours...",verify:"Vérifier",verifyAgain:"Vérifier de nouveau",verifyOther:"Vérifier un autre certificat",viewRecord:"Voir le certificat"},date:{months:["Jan","Fév","Mar","Avr","Mai","Juin","Juil","Aout","Sept","Oct","Nov","Déc"],pattern:"DD MM YYYY"}},it:{errors:{errorLabel:"Errore",invalidBlockcerts:"Non è una definizione valida di Blockcerts.",invalidBlockcertsUrl:"Non è un URL di certificato valido.",invalidFormatDragAndDrop:"Sono accettati solo file JSON",invalidUrl:"Questo non sembra essere un URL valido.",noDownloadLink:"Link per il download non fornito!",noMetadata:"Nessun Metadata specificato per questo record",noShareUrl:"Non c'è un URL da condividere!",noTransactionId:"Nessun ID transazione"},text:{brandName:"Blockcerts",blockcertsHint:"Visita il sito Web Blockcerts",by:"da",certified:"Certificato da",closeButton:"Fai clic per chiudere",downloadLink:"Scarica il Record in formato JSON",dragAndDropHint:"(puoi anche trascinare il file).",fileUpload:"Scegli il file JSON",issued:"Rilasciato il",issueDate:"Data",issuerName:"Organizzazione Issuer",issuerPublicKey:"Chiave pubblica del Issuer",item:"Elemento",itemPlural:"Elementi",metadataButton:"Visualizza Metadata",metadataTitle:"Metadata",motto:"Blockcerts, The Open Standard for Blockchain Credentials",recipient:"Titolare",share:"Condividi",shareButton:"Condividi sui Social Network",signed:"Firmato da",substepsListClose:"Nascondi",substepsListHint:"Mostra gli step secondari",transactionId:"ID transazione",urlInput:"Inserisci l'URL del certificato",urlInputPlaceholder:"URL del certificato",verificationStepProgress:"Step di verifica...",verify:"Verifica",verifyAgain:"Verifica di nuovo",verifyOther:"Verifica un altro record",viewRecord:"Visualizza il Record"},date:{months:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],pattern:"DD MM YYYY"}}};function J9(){return W9}function G9(e,t,r,n){if(!e)return"";if(e.includes(".")){const r=e.split(".");e=r[0],t=r[1]}if(!t)return"";r&&n>1&&(t+="Plural");const i=J9();return i[$9.locale]?i[$9.locale][e]?i[$9.locale][e][t]?i[$9.locale][e][t]||"":"[missing locale item data]":"[missing locale group data]":"[missing locale data]"}function X9(e){const t=G9("date","pattern"),r=new Date(e);let n=function(e,t){const r=G9("date","months");return e.replace("MM",r[t])}(t,r.getMonth());return n=function(e,t){return e.replace("DD",t)}(n,r.getDate()),n=function(e,t){return e.replace("YYYY",t)}(n,r.getFullYear()),n}function Y9(e){return e.certificateDefinition}function Q9(e){const t=Y9(e);return t?t.issuedOn:""}function Z9(e){return Y9(e)?X9(Q9(e)):""}function e7(e){const t=Y9(e);return t?t.recipientFullName:""}function t7(e){const t=Y9(e);return t?t.name:""}function r7(e){const t=Y9(e);return t?t.issuer.name:""}function n7(e){const t=Y9(e);return t?t.issuer.image:""}function i7(e){const t=Y9(e);if(!t)return"";const{displayHtml:r,display:n}=t.certificateJson;if(r)return q9(r);if(n)switch(n.contentMediaType){case"text/html":return q9(n.content);case"image/png":case"image/jpeg":case"image/gif":case"image/bmp":return`<img src="data:${n.contentMediaType};${n.contentEncoding},${n.content}"/>`;case"application/pdf":return`<embed width="100%" height="100%" type="application/pdf" src="data:${n.contentMediaType};${n.contentEncoding},${n.content}"/>`;default:return""}return""}function o7(e){const t=Y9(e);return t&&XD(t.recordLink)?t.recordLink:""}function s7(e){const t=o7(e);return t?R8.certificates.download(t):""}function a7(e){const t=Y9(e);if(t)try{return JSON.parse(t.metadataJson)}catch(e){return null}return null}function u7(e){const t=Y9(e);return t?t.transactionLink:""}function c7(e){const t=Y9(e);return t?t.transactionId:""}function l7(e){const t=Y9(e);if(t){const{chain:e}=t;return e.name}return""}function h7(e){const t=l7(e);return"Mocknet"===t||t.includes("Testnet")}function f7(e){return e.verifiedSteps||[]}function d7(e,t){return f7(e).find((e=>e.code===t))}function p7(e){return f7(e).some((e=>e.status===GD.FAILURE))}function g7(e){const t=Y9(e);return t?t.certificateImage:""}function m7(e){const t=Y9(e);return t?t.subtitle:""}function v7(e){const t=Y9(e);return t?t.description:""}function y7(e){const t=Y9(e);return t?t.signatureImage:""}function b7(e){const t=Y9(e);return t?t.sealImage:""}function w7(e){return e.finalStep}function _7(e){const t=Y9(e);return t?t.publicKey:""}function x7(e,t){switch(t.type){case et:return function(e,t){const{resetSteps:r}=t.payload;return{...e,verifiedSteps:r}}(e,t);case Ge:return function(e,t){return{...e,...t.payload.options}}(e,t);case Xe:return function(e,t){return{...e,...t.payload,...t.payload.certificateDefinition&&{verifiedSteps:R8.certificates.initializeVerificationSteps(t.payload.certificateDefinition)}}}(e,t);case Ye:return function(e,t){return{...e,certificateDefinition:t.payload.definition}}(e,t);case Qe:return function(e,t){return{...e,input:{...e.input,certificateUrl:t.payload.url}}}(e,t);case rt:return function(e,t){const{parentStepCode:r,status:n}=t.payload;return d7(e,r).status=n,e}(e,t);case Ze:return function(e,t){return{...e,input:{...e.input,isValid:t.payload.isValid}}}(e,t);case ot:return function(e,t){const{errorMessage:r}=t.payload;return{...e,errorMessage:r}}(e,t);case st:return function(e,t){return{...e,showVerificationModal:t.payload.showVerificationModal}}(e,t);case tt:return function(e,t){const{parentStep:r}=t.payload;return function(e,t){const r=e.subSteps.findIndex((e=>e.code===t.code));e.subSteps[r]=t}(d7(e,r),t.payload),e}(e,t);case nt:return function(e,t){return{...e,verificationStatus:t.payload.status}}(e,t);case it:return function(e,t){return{...e,finalStep:t.payload.finalStep}}(e,t);default:return e}}const S7="full",E7="bright",k7="dark";const I7=function(e=function(e={}){return{input:{},verifiedSteps:[],finalStep:null,verificationStatus:GD.DEFAULT,showVerificationModal:!1,displayMode:"card",theme:E7,...e}}()){return Ie(x7,e,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return function(){var r=e.apply(void 0,arguments),n=function(){throw new Error(_e(15))},i={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},o=t.map((function(e){return e(i)}));return n=Pe.apply(void 0,o)(r.dispatch),we(we({},r),{},{dispatch:n})}}}(...[Oe]))}();function A7(e,{mapDispatchToProps:t={},mapStateToProps:r=(()=>{}),ownProps:n={}}){return class extends(ve(I7)(me)){mapDispatchToProps(){return function(e,t){if("function"==typeof e)return Ae(e,t);if("object"!=typeof e||null===e)throw new Error(_e(16));var r={};for(var n in e){var i=e[n];"function"==typeof i&&(r[n]=Ae(i,t))}return r}(t,I7.dispatch)}mapStateToProps(){return r(I7.getState())}static get properties(){return n}_render(t){const r={...this.mapDispatchToProps(),...this.mapStateToProps(),...t};return he`${e(r)}`}_stateChanged(e){this._requestRender()}}}function P7(e){return{type:ot,payload:{errorMessage:e}}}function T7(e){return function(t,r){if(null==e)return;const n=d7(r(),e);let i=n.status;i===GD.DEFAULT&&function(e){return e.subSteps.some((e=>e.status===GD.SUCCESS))}(n)&&(i=GD.STARTED),i!==GD.DEFAULT&&function(e){return e.subSteps.every((e=>e.status===GD.SUCCESS))}(n)&&(i=GD.SUCCESS),function(e){return e.subSteps.some((e=>e.status===GD.FAILURE))}(n)&&(i=GD.FAILURE),t({type:rt,payload:{parentStepCode:e,status:i}})}}class O7{constructor(){this.queue=[],this.dispatchCb=null,this.isExecuting=!1,this.intervalId=null,this.dispatchNext=this.dispatchNext.bind(this)}registerCb(e){this.dispatchCb=e}push(e){this.queue.push(e)}dispatchNext(){const e=this.queue.shift();e?this.dispatchCb(e):this.intervalId&&(this.isExecuting=!1,clearInterval(this.intervalId))}execute(){!this.isExecuting&&this.queue.length&&(this.isExecuting=!0,this.intervalId=setInterval(this.dispatchNext,200))}}const C7=new O7;function M7(e){return function(t,r){const n=r().verifiedSteps.find((t=>t.subSteps.some((t=>t.code===e.code)))).code,i={...e,...e.errorMessage&&{errorMessage:e.errorMessage},parentStep:n},o=function(e){return function(t){e({type:tt,payload:t}),e(T7(t.parentStep))}}(t);C7.dispatchCb||C7.registerCb(o),C7.push(i),C7.execute()}}function R7(){return function(e,t){const r=Y9(t());let n=[];r&&(n=R8.certificates.initializeVerificationSteps(r)),e({type:et,payload:{resetSteps:n}})}}function N7(e){return{type:nt,payload:{status:e}}}function L7(e){return e.disableVerify}function j7(e){return e.allowDownload}function D7(e){return e.allowSocialShare}function B7(e){return e.showMetadata}function U7(e){return e.displayMode}function F7(e){return e.theme}function H7(e){return e.locale}function z7(e){return e.explorerAPIs}function V7(e){return e.clickableUrls}function q7(e){return e.didResolverUrl}function K7(e){return"string"==typeof e&&(e={label:e}),{type:it,payload:{finalStep:e}}}function $7(){return async function(e,t){const r=t();if(L7(r))return void console.warn("Verification is disabled");e({type:"VERIFY_CERTIFICATE"}),e(N7(GD.STARTED)),e(R7());const n=Y9(r);if(n){R8.events.dispatch("certificate-verify",n);const t=await n.verify((t=>{e(M7(t))}));e(K7(t.message)),e(N7(t.status))}}}function W7(e){return{type:st,payload:{showVerificationModal:e}}}function J7(e){return function(t,r){return iB(this,void 0,void 0,(function*(){const n=r(),i={locale:H7(n),explorerAPIs:z7(n),didResolverUrl:q7(n)},{certificateDefinition:o,errorMessage:s}=yield R8.certificates.parse(e,i);t(P7(s)),t({type:Xe,payload:{certificateDefinition:o}}),R8.events.dispatch("certificate-load",o),null!=o&&(yield t((function(e,t){return iB(this,void 0,void 0,(function*(){(function(e){return e.disableAutoVerify})(t())||(e({type:Je}),e(W7(!0))),yield e($7())}))})))}))}}function G7(e){return async function(t){const r=R8.certificates.isPathToCertificateValidURI(e);var n;if(t((n=r,function(e){e({type:Ze,payload:{isValid:n}}),e(P7(n?null:"errors.invalidUrl"))})),!r)return null;t({type:Qe,payload:{url:e}});const i=await R8.certificates.retrieve(e);i.certificateDefinition?await t(J7(i.certificateDefinition)):t(P7(i.errorMessage))}}const X7=/(-\w)/g,Y7=e=>e[1].toUpperCase();const Q7={src:String,"disable-auto-verify":Boolean,"disable-verify":Boolean,"allow-download":Boolean,"allow-social-share":Boolean,"display-mode":String,"show-metadata":Boolean,"clickable-urls":Boolean,theme:0,locale:String,explorerAPIs:{},"did-resolver-url":String},Z7=Object.keys(Q7).map((function(e){return e.replace(X7,Y7)})).reduce(((e,t)=>(e[t]=Q7[t],e)),{});function eee(e){let t;const r=Object.keys(W9).map((e=>e.toLowerCase()));if(t=r.indexOf(e.toLowerCase())>-1,!t){const n=e.substr(0,2).toLowerCase(),i=r.map((e=>e.split("-")[0])).indexOf(n);t=i>-1,t&&(e=r[i])}return t||(e=K9),function(e){const t=e.split("-");return t.length>1?`${t[0].toLowerCase()}-${t[1].toUpperCase()}`:t[0].toLowerCase()}(e)}function tee(e){"auto"!==e&&e||(e=navigator.language||navigator.userLanguage||navigator.browserLanguage||K9),$9.locale=eee(e)}var ree=he`<style>.buv-c-input{font-size:15px;color:#031532;border-radius:2px 0 0 2px;padding:12px 15px;background-color:#f3f4f5;border:solid 1px rgba(3,21,50,0.13);box-sizing:border-box;width:100%}.buv-c-input.is-invalid{border:2px solid #f00}.buv-c-input::-moz-placeholder{font-family:'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;color:rgba(3,21,50,0.3);letter-spacing:-.25px}.buv-c-input::-webkit-input-placeholder{font-family:'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;color:rgba(3,21,50,0.3);letter-spacing:-.25px}.buv-c-input:-moz-placeholder{font-family:'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;color:rgba(3,21,50,0.3);letter-spacing:-.25px}.buv-c-input:-ms-input-placeholder{font-family:'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;color:rgba(3,21,50,0.3);letter-spacing:-.25px}.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}
|
|
329
|
+
</style>`;function nee(e){return void 0===e.input.isValid||e.input.isValid}const iee=A7((({onInput:e=(()=>{}),isValid:t=!0}={})=>{const r="buv-c-input "+(t?"":"is-invalid");return he`
|
|
330
|
+
${ree}
|
|
331
331
|
<label
|
|
332
332
|
for='certificate-json-url'
|
|
333
|
-
class='buv-u-visually-hidden'>${
|
|
333
|
+
class='buv-u-visually-hidden'>${G9("text.urlInput")}</label>
|
|
334
334
|
<input
|
|
335
335
|
type='text'
|
|
336
336
|
id='certificate-json-url'
|
|
337
|
-
placeholder='${
|
|
337
|
+
placeholder='${G9("text.urlInputPlaceholder")}'
|
|
338
338
|
class$='${r}'
|
|
339
339
|
on-input='${t=>{e(t.target.value)}}'
|
|
340
340
|
/>
|
|
341
|
-
`}),{mapDispatchToProps:{onInput:
|
|
342
|
-
</style>`;const
|
|
343
|
-
${
|
|
341
|
+
`}),{mapDispatchToProps:{onInput:G7},mapStateToProps:e=>({isValid:nee(e)})});window.customElements.define("buv-input",iee);var oee=he`<style>.buv-c-verify-button{background-color:#2ab27b;border-radius:0 2px 2px 0;color:#fff;cursor:pointer;display:block;font-size:15px;font-weight:400;padding:12px 38px;border:1px solid #2ab27b;width:100%}.buv-c-verify-button__label{cursor:pointer}.buv-c-verify-button--hollow{background:#fff;color:#2ab27b;font-weight:100;text-transform:uppercase;padding:12px 30px;font-size:13px}.buv-c-verify-button--link{background:none;color:#031532;border:0;text-decoration:underline;padding:0;margin-top:5px;font-size:13px}.buv-c-verify-button.is-disabled{pointer-events:none}
|
|
342
|
+
</style>`;const see={onClick:function(){return function(e,t){e({type:"START_VERFICATION_PROCESS"}),e(W7(!0)),e($7())}}},aee=A7((function({isHollow:e=!1,isDisabled:t=!1,onClick:r=(()=>{}),type:n=""}={}){const i=["buv-c-verify-button",e?"buv-c-verify-button--hollow":"",t?"is-disabled":"","link"===n?"buv-c-verify-button--link":""].join(" ");return he`
|
|
343
|
+
${oee}
|
|
344
344
|
<button class$='${i}' on-click='${r}' disabled?='${t}'>
|
|
345
|
-
<label class='buv-c-verify-button__label'><slot>${
|
|
345
|
+
<label class='buv-c-verify-button__label'><slot>${G9("text.verify")}</slot></label>
|
|
346
346
|
</button>
|
|
347
|
-
`}),{mapDispatchToProps:
|
|
348
|
-
</style>`;const
|
|
349
|
-
${
|
|
347
|
+
`}),{mapDispatchToProps:see,mapStateToProps:e=>({isDisabled:L7(e)||!Y9(e)}),ownProps:{isHollow:Boolean,type:String}});window.customElements.define("buv-verify-button",aee);var uee=he`<style>.buv-c-certificate-input{display:flex;width:100%;padding:40px 30px;background-color:rgba(255,255,255,0.1);border:1px solid rgba(0,0,0,0.1);box-sizing:border-box}@media only screen and (max-width: 600px){.buv-c-certificate-input{flex-direction:column;grid-row-gap:10px;height:162px;padding:30px;justify-content:space-between}}.buv-c-certificate-input__input{width:100%}
|
|
348
|
+
</style>`;const cee=A7((({showInput:e=!0})=>e?he`
|
|
349
|
+
${uee}
|
|
350
350
|
<section class="buv-c-certificate-input buv-qa-certificate-input">
|
|
351
351
|
<buv-input class="buv-c-certificate-input__input"></buv-input><buv-verify-button></buv-verify-button>
|
|
352
352
|
</section>
|
|
353
|
-
`:null),{mapStateToProps:e=>({showInput:!
|
|
354
|
-
</style>`;const
|
|
355
|
-
${
|
|
353
|
+
`:null),{mapStateToProps:e=>({showInput:!Y9(e)})});window.customElements.define("buv-certificate-input",cee);var lee=he`<style>.buv-o-button-link{display:block;cursor:pointer;border:0;background-color:transparent}.buv-o-button-link__label{display:block;font-size:13px;cursor:pointer}.buv-o-button-link.is-disabled,.buv-o-button-link:disabled{cursor:help;opacity:.6}.buv-c-download-link{text-decoration:none;color:currentColor}.buv-c-download-link--icon{background-image:url("data:image/svg+xml,%3Csvg%20version%3D%221.1%22%20id%3D%22Capa%5f1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%0A%09%20width%3D%22433.5px%22%20height%3D%22433.5px%22%20fill%3D%22%236e7e8e%22%20viewBox%3D%220%200%20433.5%20433.5%22%20style%3D%22enable-background%3Anew%200%200%20433.5%20433.5%3B%22%20xml%3Aspace%3D%22preserve%22%0A%09%3E%3Cg%3E%3Cg%20id%3D%22file-download%22%3E%3Cpath%20d%3D%22M395.25%2C153h-102V0h-153v153h-102l178.5%2C178.5L395.25%2C153z%20M38.25%2C382.5v51h357v-51H38.25z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E");width:17px;height:17px;background-size:17px}.buv-c-download-link.is-disabled{pointer-events:none}.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}
|
|
354
|
+
</style>`;const hee=A7((function({downloadLink:e,display:t=""}){const r="plaintext"===t,n=G9(e?"text.downloadLink":"errors.noDownloadLink"),i=["buv-c-download-link","buv-o-button-link",e?"":"is-disabled",r?"":"buv-c-download-link--icon"].join(" ");return he`
|
|
355
|
+
${lee}
|
|
356
356
|
<a class$='${i}' href='${e}' title$='${n}' aria-disabled?='${!e}'>
|
|
357
357
|
<span class$='${r?"buv-o-button-link__label":"buv-u-visually-hidden"}'>${n}</span>
|
|
358
|
-
</a>`}),{mapStateToProps:e=>({downloadLink:
|
|
359
|
-
</style>`,
|
|
360
|
-
</style>`;const
|
|
361
|
-
${
|
|
358
|
+
</a>`}),{mapStateToProps:e=>({downloadLink:s7(e)}),ownProps:{display:String}});window.customElements.define("buv-download-link",hee);var fee=he`<style>.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-o-button-link{display:block;cursor:pointer;border:0;background-color:transparent}.buv-o-button-link__label{display:block;font-size:13px;cursor:pointer}.buv-o-button-link.is-disabled,.buv-o-button-link:disabled{cursor:help;opacity:.6}.buv-o-overlay{z-index:100;box-shadow:0 0 30px rgba(0,0,0,0.25);background-color:#fff}.buv-c-metadata-container{box-sizing:border-box;padding:47px;height:100%;width:400px;position:fixed;top:0;right:-400px;display:flex;flex-direction:column}.buv-c-metadata-container__close-button{top:52px;right:47px}.buv-c-metadata-container__title{border-bottom:solid 1px #e8e9eb;padding-bottom:38px;font-weight:300;margin:0 0 38px}.buv-c-metadata-link{padding:0}.buv-c-metadata-link--icon{background-image:url("data:image/svg+xml,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%0A%0A%09%20width%3D%22512px%22%20fill%3D%22%236e7e8e%22%20height%3D%22512px%22%20viewBox%3D%220%200%20512%20512%22%20enable-background%3D%22new%200%200%20512%20512%22%20xml%3Aspace%3D%22preserve%22%3E%0A%0A%3Cpath%20id%3D%22info-2-icon%22%20d%3D%22M255.998%2C90.001c91.74%2C0%2C166.002%2C74.241%2C166.002%2C165.998c0%2C91.741-74.245%2C166-166.002%2C166%0A%0A%09c-91.74%2C0-165.998-74.243-165.998-166C90%2C164.259%2C164.243%2C90.001%2C255.998%2C90.001%20M255.998%2C50.001%0A%0A%09C142.229%2C50.001%2C50%2C142.229%2C50%2C255.999c0%2C113.771%2C92.229%2C206%2C205.998%2C206c113.771%2C0%2C206.002-92.229%2C206.002-206%0A%0A%09C462%2C142.229%2C369.77%2C50.001%2C255.998%2C50.001L255.998%2C50.001z%20M285.822%2C367.567h-57.646V230.6h57.646V367.567z%20M257%2C202.268%0A%09c-17.522%2C0-31.729-14.206-31.729-31.73c0-17.522%2C14.206-31.729%2C31.729-31.729c17.524%2C0%2C31.728%2C14.206%2C31.728%2C31.729%0A%09C288.728%2C188.062%2C274.524%2C202.268%2C257%2C202.268z%22%2F%3E%3C%2Fsvg%3E");width:22px;height:22px;background-size:22px}.buv-c-metadata-list{margin:0;overflow:auto;flex:1}.buv-c-metadata-list__title{color:#999;line-height:15px}.buv-c-metadata-list__detail{margin:0 0 20px}.buv-c-metadata-list__detail-text{white-space:pre-wrap;word-wrap:break-word;font:inherit;margin:0}.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}.buv-u-slide-from-right{opacity:0;-webkit-transition:right ease .5s, opacity .2s;-moz-transition:right ease .5s, opacity .2s;-ms-transition:right ease .5s, opacity .2s;-o-transition:right ease .5s, opacity .2s;transition:right ease .5s, opacity .2s}.buv-u-slide-from-right.is-active{right:0;opacity:1}
|
|
359
|
+
</style>`,dee=he`<style>.buv-c-close-button{display:inline-block;overflow:hidden;cursor:pointer;border:0;width:20px;height:20px;position:absolute;background-color:transparent}.buv-c-close-button::before,.buv-c-close-button::after{content:'';position:absolute;height:2px;width:100%;top:50%;left:0;margin-top:-1px;background:#000}.buv-c-close-button::before{transform:rotate(45deg)}.buv-c-close-button::after{transform:rotate(-45deg)}.buv-c-close-button--big{transform:scale(3)}.buv-c-close-button--hairline::before,.buv-c-close-button--hairline::after{height:1px}.buv-c-close-button--thick::before,.buv-c-close-button--thick::after{height:4px;margin-top:-2px}.buv-c-close-button--black::before,.buv-c-close-button--black::after{height:8px;margin-top:-4px}.buv-c-close-button--heavy::before,.buv-c-close-button--heavy::after{height:12px;margin-top:-6px}.buv-c-close-button--pointy::before,.buv-c-close-button--pointy::after{width:200%;left:-50%}.buv-c-close-button--rounded::before,.buv-c-close-button--rounded::after{border-radius:5px}.buv-c-close-button--blades::before,.buv-c-close-button--blades::after{border-radius:5px 0}.buv-c-close-button--warp::before,.buv-c-close-button--warp::after{border-radius:120% 0}.buv-c-close-button--fat::before,.buv-c-close-button--fat::after{border-radius:100%}.buv-c-close-button--position{position:relative}.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}
|
|
360
|
+
</style>`;const pee=({onClick:e=(()=>{}),className:t=""}={})=>he`
|
|
361
|
+
${dee}
|
|
362
362
|
<button onclick='${e}' class$='${`buv-c-close-button buv-c-close-button--hairline ${t||"buv-c-close-button--position"} `}'>
|
|
363
|
-
<label class='buv-u-visually-hidden'>${
|
|
363
|
+
<label class='buv-u-visually-hidden'>${G9("text.closeButton")}</label>
|
|
364
364
|
</button>
|
|
365
365
|
`;window.customElements.define("buv-metadata-raw",class extends me{constructor(){super(),this.isOpen=!1,this.toggleOpen=this.toggleOpen.bind(this)}static get properties(){return{isOpen:Boolean,metadataList:Object,display:String}}toggleOpen(){this.isOpen=!this.isOpen}_render({metadataList:e,display:t}){const r=["buv-o-overlay","buv-c-metadata-container","buv-u-slide-from-right",this.isOpen?"is-active":""].join(" ");let n="";if(e){const t=function(e){return e.schema.properties.certificate.properties}(e);n=e.displayOrder.map((r=>{const n=r.split(".")[1],i=function(e,t){const r=t.split(".");return function e(t,r,n){const i=n.indexOf(r)+1,o=n[i];return o?Object.prototype.hasOwnProperty.call(t[r],o)?e(t[r],o,n):void 0:t[r]}(e,r[0],r)}(e,r);return function(e,t){let{title:r,format:n,type:i}=e;Array.isArray(i)&&(i=i[0]);const o=he`<dt class='buv-c-metadata-list__title'>${r}</dt>`;let s=!1,a="",u=t;if("string"===i)switch(n){case"uri":s=!0,a=t;break;case"email":a=`mailto:${t}`;break;case"phoneNumber":a=`tel:${t}`}a&&(u=he`<a href="${a}" target="${s?"_blank":""}" >${t}</a>`);const c=he`<dd class='buv-c-metadata-list__detail'>
|
|
366
|
-
<pre class='buv-c-metadata-list__detail-text'>${u}</pre></dd>`;return he`${o}${c}`}(t[n],i)}))}const i="plaintext"===t,o=
|
|
367
|
-
${
|
|
366
|
+
<pre class='buv-c-metadata-list__detail-text'>${u}</pre></dd>`;return he`${o}${c}`}(t[n],i)}))}const i="plaintext"===t,o=G9(e?"text.metadataButton":"errors.noMetadata"),s=["buv-c-metadata-link","buv-o-button-link",i?"":"buv-c-metadata-link--icon"].join(" ");return he`
|
|
367
|
+
${fee}
|
|
368
368
|
<button onclick='${this.toggleOpen}'
|
|
369
369
|
class$='${s}'
|
|
370
370
|
disabled?='${!e}'
|
|
@@ -373,15 +373,15 @@ var r=BU.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){retur
|
|
|
373
373
|
<label class$='${i?"buv-o-button-link__label":"buv-u-visually-hidden"}'>${o}</label>
|
|
374
374
|
</button>
|
|
375
375
|
<section class$='${r}'>
|
|
376
|
-
<h1 class='buv-c-metadata-container__title'>${
|
|
377
|
-
${
|
|
376
|
+
<h1 class='buv-c-metadata-container__title'>${G9("text.metadataTitle")}</h1>
|
|
377
|
+
${pee({onClick:this.toggleOpen,className:"buv-c-metadata-container__close-button"})}
|
|
378
378
|
<dl class='buv-c-metadata-list buv-o-text-12'>${n}</dl>
|
|
379
379
|
</section>
|
|
380
|
-
`}});const
|
|
380
|
+
`}});const gee=A7((function(e){return he`
|
|
381
381
|
<buv-metadata-raw
|
|
382
382
|
metadataList='${e.metadataList}'
|
|
383
383
|
display='${e.display}'
|
|
384
|
-
></buv-metadata-raw>`}),{mapStateToProps:e=>({metadataList:
|
|
384
|
+
></buv-metadata-raw>`}),{mapStateToProps:e=>({metadataList:a7(e)}),ownProps:{display:String}});window.customElements.define("buv-metadata",gee);var mee=he`<style>.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-o-button-link{display:block;cursor:pointer;border:0;background-color:transparent}.buv-o-button-link__label{display:block;font-size:13px;cursor:pointer}.buv-o-button-link.is-disabled,.buv-o-button-link:disabled{cursor:help;opacity:.6}.buv-o-link{cursor:pointer;text-decoration:none;color:currentColor}.buv-o-link__text--underline{border-bottom:1px solid}.buv-o-overlay{z-index:100;box-shadow:0 0 30px rgba(0,0,0,0.25);background-color:#fff}.buv-c-social-share-link{width:17px;height:17px;background-size:17px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' id='Capa_1' x='0px' y='0px' viewBox='0 0 473.932 473.932' style='enable-background:new 0 0 473.932 473.932;' xml:space='preserve' width='24px' height='24px'%3E%3Cg%3E%3Cg%3E%3Cpath d='M385.513,301.214c-27.438,0-51.64,13.072-67.452,33.09l-146.66-75.002 c1.92-7.161,3.3-14.56,3.3-22.347c0-8.477-1.639-16.458-3.926-24.224l146.013-74.656c15.725,20.924,40.553,34.6,68.746,34.6 c47.758,0,86.391-38.633,86.391-86.348C471.926,38.655,433.292,0,385.535,0c-47.65,0-86.326,38.655-86.326,86.326 c0,7.809,1.381,15.229,3.322,22.412L155.892,183.74c-15.833-20.039-40.079-33.154-67.56-33.154 c-47.715,0-86.326,38.676-86.326,86.369s38.612,86.348,86.326,86.348c28.236,0,53.043-13.719,68.832-34.664l145.948,74.656 c-2.287,7.744-3.947,15.79-3.947,24.289c0,47.693,38.676,86.348,86.326,86.348c47.758,0,86.391-38.655,86.391-86.348 C471.904,339.848,433.271,301.214,385.513,301.214z' fill='%236e7e8e'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A")}.buv-c-social-share-modal{position:absolute;padding:38px 34px 34px;width:120px}.buv-c-social-share-modal__close-button{top:10px;right:10px}.buv-c-social-share-modal__list{list-style-type:none;margin:0;padding:0}.buv-c-social-share-modal__list-item{margin-bottom:24px}.buv-c-social-share-modal__list-item--plaintext{margin-bottom:5px;font-size:13px}.buv-c-social-share-modal__list-item:last-child{margin-bottom:0}.buv-c-social-share-modal__link{text-decoration:none}.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}
|
|
385
385
|
</style>`;window.customElements.define("buv-social-share-raw",class extends me{constructor(){super(),this.isOpen=!1,this.toggleOpen=this.toggleOpen.bind(this)}static get properties(){return{url:String,isOpen:String,onShare:Function,display:String}}toggleOpen(){this.isOpen=!this.isOpen}sharingTemplate({url:e,onShare:t,display:r}){if(!this.isOpen)return;if(!e)return;const n="plaintext"===r,i=[{name:"LinkedIn",shareUrl:`https://www.linkedin.com/shareArticle?url=${e}&mini=true`},{name:"Facebook",shareUrl:`https://www.facebook.com/sharer/sharer.php?u=${e}`},{name:"Twitter",shareUrl:`https://twitter.com/intent/tweet?url=${e}`}].map((e=>he`<li class$='buv-c-social-share-modal__list-item ${n?"buv-c-social-share-modal__list-item--plaintext":""}'>
|
|
386
386
|
<a
|
|
387
387
|
href='${e.shareUrl}'
|
|
@@ -390,14 +390,14 @@ var r=BU.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){retur
|
|
|
390
390
|
target='_blank'
|
|
391
391
|
onclick='${()=>{t(e.name)}}'
|
|
392
392
|
>
|
|
393
|
-
<span>${
|
|
393
|
+
<span>${G9("text.share")} ${e.name}</span>
|
|
394
394
|
</a>
|
|
395
395
|
</li>`)),o=he`<ul class='buv-c-social-share-modal__list'>
|
|
396
396
|
${i}
|
|
397
397
|
</ul>`;return n?o:he`<div class='buv-c-social-share-modal buv-o-text-12 buv-o-overlay'>
|
|
398
|
-
${
|
|
398
|
+
${pee({onClick:this.toggleOpen,className:"buv-c-social-share-modal__close-button"})}
|
|
399
399
|
${o}
|
|
400
|
-
</div>`}sharingButton({url:e,display:t}){if("plaintext"===t)return void(this.isOpen=!0);const r=!!e,n=
|
|
400
|
+
</div>`}sharingButton({url:e,display:t}){if("plaintext"===t)return void(this.isOpen=!0);const r=!!e,n=G9(r?"text.shareButton":"text.noShareUrl");return he`<button
|
|
401
401
|
onclick='${this.toggleOpen}'
|
|
402
402
|
class='buv-c-social-share-link buv-o-button-link'
|
|
403
403
|
disabled?='${!r}'
|
|
@@ -406,28 +406,28 @@ var r=BU.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){retur
|
|
|
406
406
|
>
|
|
407
407
|
<label class='buv-u-visually-hidden'>${n}</label>
|
|
408
408
|
</button>`}_render(e){return he`
|
|
409
|
-
${
|
|
409
|
+
${mee}
|
|
410
410
|
${this.sharingButton(e)}
|
|
411
411
|
${this.sharingTemplate(e)}
|
|
412
|
-
`}});const
|
|
412
|
+
`}});const vee={onShare:function(e){return function(t,r){const n=Y9(r());R8.events.dispatch("certificate-share",n,{socialNetwork:e}),t({type:"SHARE_SOCIAL_NETWORK"})}}},yee=A7((function(e){return he`
|
|
413
413
|
<buv-social-share-raw
|
|
414
414
|
url='${e.url}'
|
|
415
415
|
onShare='${e.onShare}'
|
|
416
416
|
display='${e.display}'
|
|
417
|
-
></buv-social-share-raw>`}),{mapDispatchToProps:
|
|
418
|
-
</style>`;const
|
|
419
|
-
${
|
|
417
|
+
></buv-social-share-raw>`}),{mapDispatchToProps:vee,mapStateToProps:e=>({url:o7(e)}),ownProps:{display:String}});window.customElements.define("buv-social-share",yee);var bee=he`<style>.buv-c-action-menu{display:flex;align-items:center;padding:0}.buv-c-action-menu-item{flex-basis:30px}
|
|
418
|
+
</style>`;const wee=A7((({allowDownload:e,allowSocialShare:t,showMetadata:r,isVisible:n})=>(e||t||r||(n=!1),n?he`
|
|
419
|
+
${bee}
|
|
420
420
|
<menu class='buv-c-action-menu'>
|
|
421
421
|
${r?he`<menuitem class='buv-c-action-menu-item'><buv-metadata></buv-metadata></menuitem>`:""}
|
|
422
422
|
${e?he`<menuitem class='buv-c-action-menu-item'><buv-download-link></buv-download-link></menuitem>`:""}
|
|
423
423
|
${t?he`<menuitem class='buv-c-action-menu-item'><buv-social-share></buv-social-share></menuitem>`:""}
|
|
424
424
|
</menu>
|
|
425
|
-
`:null)),{mapStateToProps:e=>({allowDownload:
|
|
426
|
-
</style>`,
|
|
427
|
-
</style>`;let
|
|
428
|
-
${
|
|
425
|
+
`:null)),{mapStateToProps:e=>({allowDownload:j7(e),allowSocialShare:D7(e),showMetadata:B7(e),isVisible:U7(e)===S7&&!!Y9(e)})});window.customElements.define("buv-action-menu",wee);var _ee=he`<style>.buv-c-verification-modal__process{display:flex;justify-content:space-around}.buv-c-verification-modal__separator{margin-bottom:30px;background-color:rgba(3,21,50,0.05);height:1px;border:0 none}.buv-c-verification-modal__content{max-height:100vh;padding-bottom:43px;box-sizing:border-box;overflow:auto}@media only screen and (max-width: 600px){.buv-c-verification-modal__content{max-height:calc(100vh - 120px)}}
|
|
426
|
+
</style>`,xee=he`<style>.buv-o-link{cursor:pointer;text-decoration:none;color:currentColor}.buv-o-link__text--underline{border-bottom:1px solid}.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}
|
|
427
|
+
</style>`;let See=!1,Eee=!1;function kee(e){return async function(t){t({type:"UPLOAD_CERTIFICATE_DEFINITION"});const r=await R8.certificates.read(e);t(J7(JSON.parse(r)))}}const Iee=A7((function({onChange:e=(()=>{}),hideFileUpload:t=!1}){return t?null:he`
|
|
428
|
+
${xee}
|
|
429
429
|
<label for='buv-json-file-upload' class='buv-o-link buv-o-text-12'>
|
|
430
|
-
<span class='buv-o-link__text--underline'>${
|
|
430
|
+
<span class='buv-o-link__text--underline'>${G9("text.fileUpload")}</span>
|
|
431
431
|
<input
|
|
432
432
|
type='file'
|
|
433
433
|
accept='application/json'
|
|
@@ -436,17 +436,17 @@ var r=BU.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){retur
|
|
|
436
436
|
onchange='${t=>{e(t.target.files[0])}}'
|
|
437
437
|
/>
|
|
438
438
|
</label>
|
|
439
|
-
${(Eee
|
|
440
|
-
</style>`;const
|
|
441
|
-
${
|
|
439
|
+
${(See?Eee:(See=!0,!("ontouchstart"in document.createElement("div"))&&(Eee=!0,Eee)))?he`<span class="buv-o-text-12 qa-drag-and-drop-hint">${G9("text.dragAndDropHint")}</span>`:""}`}),{mapDispatchToProps:{onChange:kee},mapStateToProps:e=>({hideFileUpload:Y9(e)})});function Aee(){return function(e){e(R7()),e((function(e){e({type:"RESET_VERIFICATION_STATUS"}),e(N7(GD.DEFAULT)),e(K7(null))})),e({type:Ye,payload:{definition:null}})}}window.customElements.define("buv-file-upload",Iee);var Pee=he`<style>.buv-o-link{cursor:pointer;text-decoration:none;color:currentColor}.buv-o-link__text--underline{border-bottom:1px solid}.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-c-verify-other-certificate{display:block}
|
|
440
|
+
</style>`;const Tee=A7((function({onClick:e=(()=>{}),isVisible:t=!1}={}){return t?he`
|
|
441
|
+
${Pee}
|
|
442
442
|
<a onclick='${e}' class='buv-o-text-12 buv-o-link buv-c-verify-other-certificate buv-qa-verify-other-certificate'>
|
|
443
|
-
<span class='buv-o-link__text--underline'>${
|
|
443
|
+
<span class='buv-o-link__text--underline'>${G9("text.verifyOther")}</span>
|
|
444
444
|
</a>
|
|
445
|
-
`:null}),{mapDispatchToProps:{onClick:
|
|
446
|
-
</style>`,
|
|
447
|
-
</style>`;const
|
|
448
|
-
${
|
|
449
|
-
<a href='https://www.blockcerts.org' title='${
|
|
445
|
+
`:null}),{mapDispatchToProps:{onClick:Aee},mapStateToProps:e=>({isVisible:!!Y9(e)})});window.customElements.define("buv-verify-other-certificate",Tee);var Oee=he`<style>.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-c-footer{width:100%;height:60px;background-color:rgba(0,0,0,0.1);color:#031532;fill:#111;display:flex;justify-content:space-between;align-items:center;padding:0 30px;box-sizing:border-box}.buv-c-footer a{line-height:1}.buv-c-footer--dark{color:#fff;fill:#fff}.buv-c-footer--forced{position:absolute;bottom:0;left:0;margin-top:0;justify-content:flex-end}
|
|
446
|
+
</style>`,Cee=he`<style>.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}.buv-c-logo{color:currentColor;text-decoration:none}.buv-c-logo--small{width:113px;height:16px}.buv-c-logo--medium{width:66%}.buv-c-logo__motto{font-size:12px}
|
|
447
|
+
</style>`;const Mee=({className:e,showMotto:t=!1}={})=>he`
|
|
448
|
+
${Cee}
|
|
449
|
+
<a href='https://www.blockcerts.org' title='${G9("text.blockcertsHint")}' class$='buv-c-logo ${e}'>
|
|
450
450
|
${t?he`
|
|
451
451
|
<svg class='buv-qa-logo--branded buv-c-logo--medium' version="1.1" viewBox="0 0 686 163" xmlns="http://www.w3.org/2000/svg">
|
|
452
452
|
<g fill="none" fill-rule="evenodd">
|
|
@@ -472,7 +472,7 @@ var r=BU.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){retur
|
|
|
472
472
|
</g>
|
|
473
473
|
</g>
|
|
474
474
|
</svg>
|
|
475
|
-
<span class='buv-u-visually-hidden'>${
|
|
475
|
+
<span class='buv-u-visually-hidden'>${G9("text.motto")}</span>
|
|
476
476
|
`:he`
|
|
477
477
|
<svg class='buv-qa-logo--simple buv-c-logo--small' viewBox="0 0 113 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
478
478
|
<defs></defs>
|
|
@@ -495,40 +495,40 @@ var r=BU.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){retur
|
|
|
495
495
|
</g>
|
|
496
496
|
</g>
|
|
497
497
|
</svg>
|
|
498
|
-
<span class='buv-u-visually-hidden'>${
|
|
498
|
+
<span class='buv-u-visually-hidden'>${G9("text.brandname")}</span>
|
|
499
499
|
`}
|
|
500
|
-
</a>`,
|
|
501
|
-
${
|
|
500
|
+
</a>`,Ree=A7((({forceInPlace:e=!1,interactive:t=!1,theme:r}={})=>{const n=["buv-c-footer",e?"buv-c-footer--forced":"",r===k7?"buv-c-footer--dark":""].join(" ");return he`
|
|
501
|
+
${Oee}
|
|
502
502
|
<footer class$='${n}'>
|
|
503
503
|
${t?he`<section>
|
|
504
504
|
<buv-file-upload></buv-file-upload>
|
|
505
505
|
<buv-verify-other-certificate></buv-verify-other-certificate>
|
|
506
506
|
</section>`:""}
|
|
507
|
-
${
|
|
508
|
-
</footer>`}),{mapStateToProps:e=>({theme:
|
|
507
|
+
${Mee()}
|
|
508
|
+
</footer>`}),{mapStateToProps:e=>({theme:F7(e)}),ownProps:{forceInPlace:Boolean,interactive:Boolean}});window.customElements.define("buv-footer",Ree);var Nee=he`<style>.buv-o-overlay{z-index:100;box-shadow:0 0 30px rgba(0,0,0,0.25);background-color:#fff}.buv-c-modal{position:fixed;width:100%;height:100%;background-color:rgba(3,21,50,0.7);top:0;left:0;z-index:1000}.buv-c-modal.is-hidden{display:none}.buv-c-modal__content{position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);width:100vw;min-width:300px;max-width:600px;min-height:calc(600px - 50px);padding:49px 38px 98px;box-sizing:border-box}@media only screen and (max-width: 600px){.buv-c-modal__content{height:100vh;min-height:100vh;top:0;left:0;transform:none}}.buv-c-modal__close-button{top:25px;right:25px}
|
|
509
509
|
</style>`;window.customElements.define("buv-modal",class extends me{constructor(){super(),this.isOpen=!1,this.handleClick=this.handleClick.bind(this)}static get properties(){return{isOpen:Boolean,onClose:Function}}close(){this.isOpen=!1}handleClick(){this.close(),this._props.onClose()}_propertiesChanged(e,t,r){this._props=e,super._propertiesChanged(e,t,r)}_render(){const e=["buv-c-modal","buv-qa-modal",this.isOpen?"":"is-hidden"].join(" ");return he`
|
|
510
|
-
${
|
|
510
|
+
${Nee}
|
|
511
511
|
<div class$='${e}' onclick='${this.handleClick}'>
|
|
512
512
|
<div class='buv-c-modal__content buv-o-overlay' onclick='${e=>{e.stopPropagation()}}'>
|
|
513
|
-
${
|
|
513
|
+
${pee({className:"buv-c-modal__close-button",onClick:this.handleClick})}
|
|
514
514
|
<slot></slot>
|
|
515
515
|
</div>
|
|
516
516
|
</div>
|
|
517
|
-
`}});var
|
|
518
|
-
</style>`,
|
|
519
|
-
</style>`;function
|
|
520
|
-
${
|
|
517
|
+
`}});var Lee=he`<style>.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-c-badge{position:relative}.buv-c-badge::before{content:'';position:absolute;left:-32px;top:0;width:12px;height:12px;background-color:#fff;border-radius:50%;-webkit-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out;z-index:2;box-sizing:content-box;box-shadow:0 2px 4px 0 rgba(22,40,55,0.21)}.buv-c-badge--medium::before{left:-38px;top:-4px;width:24px;height:24px}.buv-c-badge--large::before{width:38px;height:38px;left:-45px;top:-9px}.buv-c-verification-step{position:relative;margin:15px 0 5px;font-weight:600}.buv-c-verification-step.is-first{margin-top:0}.buv-c-verification-substep{margin:0;font-weight:400;color:rgba(3,21,50,0.7);padding:3px 0 0;line-height:1.71428571}.buv-c-verification-step.is-success::before,.buv-c-verification-step.is-failure::before{left:-38px;top:-4px;width:24px;height:24px}.buv-c-verification-substep::before{left:-28px;top:10px;width:4px;height:4px;background-color:rgba(255,255,255,0.8)}.buv-c-verification-step::after{content:'';position:absolute;z-index:3;-webkit-transition:opacity .3s ease-out .2s;-o-transition:opacity .3s ease-out .2s;transition:opacity .3s ease-out .2s;opacity:0}.buv-c-verification-step.is-success::after,.buv-c-verification-step.is-failure::after{opacity:1}.buv-c-verification-step.is-success::after{border:solid #2ab27b;border-width:0 2px 2px 0;left:-29px;width:5px;height:11px;transform:rotate(45deg)}.buv-c-verification-step.is-success.is-test::after{border-color:#031532}.buv-c-verification-step.is-failure::after{content:'\\274C';left:-32px;top:-1px;font-size:11px;color:#d0021b}@supports (-ms-ime-align: auto){.buv-c-verification-step.is-failure::after{left:-34px}}
|
|
518
|
+
</style>`,jee=he`<style>.buv-c-error-message{background:rgba(208,2,27,0.1);border-radius:2px;letter-spacing:.05px;padding:10px}.buv-c-error-message--solid{background:#fff;border-radius:2px 2px 0 0;margin:0}.buv-c-error-message-title{color:#d0021b;font-weight:bold;display:block;margin-bottom:5px;font-size:15px}
|
|
519
|
+
</style>`;function Dee(e,t=!1){if(null==e)return null;const r=["buv-c-error-message","buv-qa-error-message",t?"buv-c-error-message--solid":""].join(" ");return he`
|
|
520
|
+
${jee}
|
|
521
521
|
<p class$='${r}'>
|
|
522
|
-
<span class='buv-c-error-message-title'>${
|
|
523
|
-
${function(e){return function(e){return e.indexOf(".")>-1&&-1===e.indexOf(" ")}(e)?
|
|
524
|
-
</p>`}function
|
|
522
|
+
<span class='buv-c-error-message-title'>${G9("errors.errorLabel")}</span>
|
|
523
|
+
${function(e){return function(e){return e.indexOf(".")>-1&&-1===e.indexOf(" ")}(e)?G9(e):e}(e)}
|
|
524
|
+
</p>`}function Bee({label:e,code:t,status:r,errorMessage:n,isParent:i,isFirst:o,isTestChain:s}){const a=["buv-o-text-15","buv-c-verification-step","buv-c-badge",o?"is-first":"",`is-${r}`,s?"is-test":""].join(" ");let u;return u=i?he`${Lee}<dt class$='${a}'>${e}</dt>`:he`${Lee}<dd class='buv-c-verification-step buv-c-verification-substep buv-o-text-12'>
|
|
525
525
|
${e}
|
|
526
|
-
${
|
|
527
|
-
</dd>`,he`${u}`}var
|
|
528
|
-
</style>`;function
|
|
526
|
+
${Dee(n)}
|
|
527
|
+
</dd>`,he`${u}`}var Uee=he`<style>.buv-o-link{cursor:pointer;text-decoration:none;color:currentColor}.buv-o-link__text--underline{border-bottom:1px solid}.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-c-badge{position:relative}.buv-c-badge::before{content:'';position:absolute;left:-32px;top:0;width:12px;height:12px;background-color:#fff;border-radius:50%;-webkit-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out;z-index:2;box-sizing:content-box;box-shadow:0 2px 4px 0 rgba(22,40,55,0.21)}.buv-c-badge--medium::before{left:-38px;top:-4px;width:24px;height:24px}.buv-c-badge--large::before{width:38px;height:38px;left:-45px;top:-9px}.buv-c-verification-step{position:relative;margin:15px 0 5px;font-weight:600}.buv-c-verification-step.is-first{margin-top:0}.buv-c-verification-substep{margin:0;font-weight:400;color:rgba(3,21,50,0.7);padding:3px 0 0;line-height:1.71428571}.buv-c-verification-step.is-success::before,.buv-c-verification-step.is-failure::before{left:-38px;top:-4px;width:24px;height:24px}.buv-c-verification-substep::before{left:-28px;top:10px;width:4px;height:4px;background-color:rgba(255,255,255,0.8)}.buv-c-verification-step::after{content:'';position:absolute;z-index:3;-webkit-transition:opacity .3s ease-out .2s;-o-transition:opacity .3s ease-out .2s;transition:opacity .3s ease-out .2s;opacity:0}.buv-c-verification-step.is-success::after,.buv-c-verification-step.is-failure::after{opacity:1}.buv-c-verification-step.is-success::after{border:solid #2ab27b;border-width:0 2px 2px 0;left:-29px;width:5px;height:11px;transform:rotate(45deg)}.buv-c-verification-step.is-success.is-test::after{border-color:#031532}.buv-c-verification-step.is-failure::after{content:'\\274C';left:-32px;top:-1px;font-size:11px;color:#d0021b}@supports (-ms-ime-align: auto){.buv-c-verification-step.is-failure::after{left:-34px}}.buv-c-final-verification-step{white-space:nowrap;opacity:0;position:relative;font-weight:600;font-size:15px;color:#031532;margin-top:15px}.buv-c-final-verification-step.is-success{font-size:21px;color:#2ab27b;line-height:19px}.buv-c-final-verification-step--standalone{margin-top:0}.buv-c-final-verification-step.is-test,.buv-c-final-verification-step--standalone.is-success{font-size:15px;color:#031532}.buv-c-final-verification-step.is-failure{font-size:13px;font-weight:400}.buv-c-verification-step__description{margin:0}.buv-c-final-verification-step.is-visible{opacity:1}.buv-c-final-verification-step.is-visible::after{opacity:1}.buv-c-final-verification-step::after{position:absolute;content:'';height:26px;width:23px;left:-37px;top:-3px;background-image:url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjBweCIgaGVpZ2h0PSIyM3B4IiB2aWV3Qm94PSIwIDAgMjAgMjMiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8ZyBpZD0iVmVyaWZpY2F0aW9uIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iMyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTI1NC4wMDAwMDAsIC00NzQuMDAwMDAwKSIgZmlsbD0iIzJBQjI3QiI+CiAgICAgICAgICAgIDxnIGlkPSJHcm91cCIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjQ4LjAwMDAwMCwgNDY5LjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHBhdGggZD0iTTE2LDUgTDYsOS4xODE4MTgxOCBMNiwxNS40NTQ1NDU1IEM2LDIxLjI1NjgxODIgMTAuMjY2NjY2NywyNi42ODI3MjczIDE2LDI4IEMyMS43MzMzMzMzLDI2LjY4MjcyNzMgMjYsMjEuMjU2ODE4MiAyNiwxNS40NTQ1NDU1IEwyNiw5LjE4MTgxODE4IEwxNiw1IEwxNiw1IFogTTksMTcuNzUzNzE1NSBMMTAuNTI3NSwxNi4yNTY5MDAyIEwxMy4zMzMzMzMzLDE4Ljk5NTc1MzcgTDIwLjQ3MjUsMTIgTDIyLDEzLjUwNzQzMSBMMTMuMzMzMzMzMywyMiBMOSwxNy43NTM3MTU1IFoiIGlkPSJTaGFwZSI+PC9wYXRoPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=");background-repeat:no-repeat;background-position:center;background-size:contain;z-index:3}.buv-c-final-verification-step.is-test::after{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4IiBmaWxsPSIjRjVBNjIzIj48cGF0aCBkPSJNLjUgMTZoMTdMOSAxIC41IDE2em05LjUtMkg4di0yaDJ2MnptMC0zSDhWN2gydjR6Ii8+PC9zdmc+IA==")}.buv-c-final-verification-step.is-failure::after{content:'\\274C';font-size:17px;top:-1px;color:#d0021b;background:none}.buv-c-final-verification-step--standalone-wrapper{padding:10px;box-sizing:border-box;border-left:3px solid}.buv-c-final-verification-step--standalone-wrapper.is-success{background-color:rgba(42,178,123,0.1);border-color:#2ab27b}.buv-c-final-verification-step--standalone-wrapper.is-failure{background-color:rgba(208,2,27,0.1);border-color:#d0021b}.buv-c-final-verification-step--standalone-wrapper.is-test{background-color:rgba(245,166,35,0.1);border-color:#f5a623}.buv-c-final-verification-step--standalone{margin:0 0 5px 30px;white-space:unset}.buv-c-final-verification-step--standalone.is-failure{margin-bottom:0}.buv-c-final-verification-step--standalone::after{left:-30px}.buv-c-verification-substep.is-final{display:none;line-height:1.35}.buv-c-verification-substep.is-final.is-visible{display:block}.buv-c-verification-substep::after{display:none}.buv-u-excluded-from-flow{position:absolute}.buv-u-full-width{width:100%}
|
|
528
|
+
</style>`;function Fee(e){return e.verificationStatus}function Hee(e){return e.showVerificationModal}const zee=A7((function({chain:e="",transactionLink:t="",isTestChain:r,isVisible:n=!1,finalStep:i=null,hideLink:o=!1,status:s=!1,standalone:a=!1}={}){if(!i)return;const u=[a?"buv-c-final-verification-step--standalone-wrapper":"",`is-${s}`,r?"is-test":""].join(" "),c=["buv-c-final-verification-step","buv-qa-final-verification-step",a?"buv-c-final-verification-step--standalone":"","buv-qa-verification-step",n?"is-visible":"",r?"is-test":"",`is-${s}`,s&&!a?"buv-c-badge buv-c-badge--large":""].join(" "),l=["buv-c-verification-substep",a?"":"buv-u-excluded-from-flow","buv-u-full-width","buv-o-text-12","is-final",n?"is-visible":""].join(" "),h=i.label,f=function(e,t){return e.description?he`<p class='buv-c-verification-step__description buv-qa-final-step-description'>${e.description.replace("${chain}",t)}</p>`:""}(i,e),d=!o&&i.linkText?he`<a class='buv-o-link' href='${t}' hidden?='${!t}'>
|
|
529
529
|
<span class='buv-o-link__text--underline buv-qa-transaction-link'>${i.linkText}</span>
|
|
530
530
|
</a>`:"";return he`
|
|
531
|
-
${
|
|
531
|
+
${Uee}
|
|
532
532
|
<div class$='${u}'>
|
|
533
533
|
<dt class$='${c}'>${h}</dt>
|
|
534
534
|
<dd class$='${l}'>
|
|
@@ -537,24 +537,24 @@ var r=BU.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){retur
|
|
|
537
537
|
</dd>
|
|
538
538
|
<slot></slot>
|
|
539
539
|
</div>
|
|
540
|
-
`}),{mapStateToProps:e=>({finalStep:
|
|
541
|
-
</style>`;window.customElements.define("buv-substeps-list",class extends me{constructor(){super(),this.isOpen=!1,this.wasForcedOpen=!1,this.resetOpen=!1,this.toggleOpen=this.toggleOpen.bind(this),this.totalHeight=0,this.heightWasReset=!1}static get properties(){return{subSteps:[],isOpen:Boolean,hasError:Boolean}}toggleOpen(){this.wasForcedOpen&&!this.resetOpen&&(this.isOpen=!0,this.resetOpen=!0),this.isOpen=!this.isOpen}_didRender(){if(!this.totalHeight){const e=this.shadowRoot.querySelectorAll(".buv-js-substeps-list__list")[0],t=e?Array.from(e.childNodes):[];this.totalHeight=t.reduce(((e,t)=>t.getBoundingClientRect?e+t.getBoundingClientRect().height:e),0),this.wasForcedOpen&&!this.heightWasReset&&(e.style.maxHeight=this.totalHeight+"px",this.heightWasReset=!0)}}_render({subSteps:e,hasError:t}){if(!e)return null;let r=this.isOpen;!this.wasForcedOpen&&t&&(r=!0,this.wasForcedOpen=!0);const n=e.filter((e=>e.status)),i=n.length,o=`${i} ${
|
|
542
|
-
${
|
|
543
|
-
<a title='${
|
|
544
|
-
<span class='buv-o-link__text--underline'>${r?
|
|
540
|
+
`}),{mapStateToProps:e=>({finalStep:w7(e),chain:l7(e),transactionLink:u7(e),isTestChain:h7(e),status:Fee(e)}),ownProps:{isVisible:Boolean,hideLink:Boolean,standalone:Boolean}});window.customElements.define("buv-final-verification-step",zee);var Vee=he`<style>.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-o-link{cursor:pointer;text-decoration:none;color:currentColor}.buv-o-link__text--underline{border-bottom:1px solid}.buv-c-substeps-list__link::after{content:'';width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid #768087;display:inline-block;vertical-align:2px;margin:0 6px;-webkit-transition:-webkit-transform .3s ease-in;-o-transition:transform .3s ease-in;transition:transform .3s ease-in}.buv-c-substeps-list__link.is-open::after{transform:rotate(180deg)}.buv-c-substeps-list__list{max-height:0;overflow:hidden;-webkit-transition:max-height .3s ease-in;-o-transition:max-height .3s ease-in;transition:max-height .3s ease-in;padding-left:50px;margin-left:-50px;padding-top:5px}.buv-c-substeps-list__list.is-open{height:auto}
|
|
541
|
+
</style>`;window.customElements.define("buv-substeps-list",class extends me{constructor(){super(),this.isOpen=!1,this.wasForcedOpen=!1,this.resetOpen=!1,this.toggleOpen=this.toggleOpen.bind(this),this.totalHeight=0,this.heightWasReset=!1}static get properties(){return{subSteps:[],isOpen:Boolean,hasError:Boolean}}toggleOpen(){this.wasForcedOpen&&!this.resetOpen&&(this.isOpen=!0,this.resetOpen=!0),this.isOpen=!this.isOpen}_didRender(){if(!this.totalHeight){const e=this.shadowRoot.querySelectorAll(".buv-js-substeps-list__list")[0],t=e?Array.from(e.childNodes):[];this.totalHeight=t.reduce(((e,t)=>t.getBoundingClientRect?e+t.getBoundingClientRect().height:e),0),this.wasForcedOpen&&!this.heightWasReset&&(e.style.maxHeight=this.totalHeight+"px",this.heightWasReset=!0)}}_render({subSteps:e,hasError:t}){if(!e)return null;let r=this.isOpen;!this.wasForcedOpen&&t&&(r=!0,this.wasForcedOpen=!0);const n=e.filter((e=>e.status)),i=n.length,o=`${i} ${G9("text","item",!0,i)}`,s=r?this.totalHeight:1,a=["buv-o-text-12","buv-o-link","buv-c-substeps-list__link",r?"is-open":""].join(" "),u=["buv-c-substeps-list__list","buv-js-substeps-list__list",r?"is-open":""].join(" ");return he`
|
|
542
|
+
${Vee}
|
|
543
|
+
<a title='${G9("text.substepsListHint")}' onclick='${this.toggleOpen}' class$='${a}'>
|
|
544
|
+
<span class='buv-o-link__text--underline'>${r?G9("text.substepsListClose"):o}</span>
|
|
545
545
|
</a>
|
|
546
546
|
<div class$='${u}' style$='max-height: ${s}px'>
|
|
547
|
-
${n.map((e=>he`${
|
|
547
|
+
${n.map((e=>he`${Bee(e)}`))}
|
|
548
548
|
</div>
|
|
549
|
-
`}});var
|
|
549
|
+
`}});var qee=he`<style>.buv-c-verification-process{position:relative}.buv-c-verification-progress-bar{position:absolute;left:13px;top:0;width:14px;display:flex;flex-direction:column;height:100%}.buv-c-verification-progress-bar__tube{min-height:14px;transition:flex .4s ease-in-out, max-height .4s ease-in;background-color:#2ab27b;border-radius:7px;flex-grow:0;opacity:0}.buv-c-verification-progress-bar__tube.has-started{flex-grow:1;opacity:1}.buv-c-verification-progress-bar__tube.is-test{background-color:#d8d8d8}.buv-c-verification-progress-bar__tube.has-errored{background-color:#d0021b}.buv-c-verification-progress-bar.no-transition{-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.buv-c-verification-process__step-list{padding-left:46px;margin-top:0}.buv-u-visually-hidden{position:absolute !important;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height:1px !important;width:1px !important;overflow:hidden}
|
|
550
550
|
</style>`;window.customElements.define("buv-verification-process-raw",class extends me{static get properties(){return{steps:[],transactionLink:String,hasError:Boolean,isTestChain:Boolean}}verificationInProgressTemplate(){return he`
|
|
551
|
-
<span class='buv-u-visually-hidden'>${
|
|
551
|
+
<span class='buv-u-visually-hidden'>${G9("text.verificationStepProgress")}</span>
|
|
552
552
|
<svg width='20' height='7' viewBox='0 0 120 30' xmlns='http://www.w3.org/2000/svg'><circle cx='15' cy='15' r='15'><animate attributeName='r' from='15' to='15' begin='0s' dur='0.8s' values='15;9;15' calcMode='linear' repeatCount='indefinite'/><animate attributeName='fill-opacity' from='1' to='1' begin='0s' dur='0.8s' values='1;.5;1' calcMode='linear' repeatCount='indefinite'/></circle><circle cx='60' cy='15' r='9' fill-opacity=''.9'><animate attributeName='r' from='9' to='9' begin='0s' dur='0.8s' values='9;15;9' calcMode='linear' repeatCount='indefinite'/><animate attributeName='fill-opacity' from=''.5' to='.5' begin='0s' dur='0.8s' values='.5;1;.5' calcMode='linear' repeatCount='indefinite'/></circle><circle cx='105' cy='15' r='15'><animate attributeName='r' from='15' to='15' begin='0s' dur='0.8s' values='15;9;15' calcMode='linear' repeatCount='indefinite'/><animate attributeName='fill-opacity' from='1' to='1' begin='0s' dur='0.8s' values='1;.5;1' calcMode='linear' repeatCount='indefinite'/></circle></svg>
|
|
553
553
|
`}_didRender(){this.listElement||(this.listElement=this.shadowRoot.querySelectorAll(".buv-js-verification-process__step-list")[0])}_render({steps:e,transactionLink:t,hasError:r,isTestChain:n}){const i=e.filter((e=>e.status!==GD.DEFAULT)).map(((e,t)=>he`
|
|
554
|
-
${
|
|
554
|
+
${Bee({...e,isParent:!0,isFirst:0===t,isTestChain:n})}
|
|
555
555
|
${e.status===GD.STARTED?he`${this.verificationInProgressTemplate()}`:he`<buv-substeps-list subSteps='${e.subSteps}' hasError?='${r}'></buv-substeps-list>`}
|
|
556
556
|
`)),o=["buv-c-verification-progress-bar__tube","buv-qa-verification-progress-bar__tube",r?"has-errored":"",n?"is-test":"",i.length?"has-started":""].join(" ");let s=`${this.listElement?this.listElement.getBoundingClientRect().height:0}px`;const a=e.every((e=>e.status===GD.SUCCESS))||e.some((e=>e.status===GD.FAILURE));return a&&(s="100%"),he`
|
|
557
|
-
${
|
|
557
|
+
${qee}
|
|
558
558
|
<section class='buv-c-verification-process'>
|
|
559
559
|
<div class='buv-c-verification-progress-bar' >
|
|
560
560
|
<div class$='${o}' style$='max-height: ${s}'></div>
|
|
@@ -564,13 +564,13 @@ var r=BU.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){retur
|
|
|
564
564
|
<buv-final-verification-step isVisible='${a&&!r}'></buv-final-verification-step>
|
|
565
565
|
</dl>
|
|
566
566
|
</section>
|
|
567
|
-
`}});const
|
|
567
|
+
`}});const Kee=A7((function({steps:e,transactionLink:t,hasError:r,isTestChain:n}){return he`<buv-verification-process-raw
|
|
568
568
|
steps='${e}'
|
|
569
569
|
hasError?='${r}'
|
|
570
570
|
isTestChain?='${n}'
|
|
571
571
|
style='max-width: 100%;'
|
|
572
|
-
></buv-verification-process-raw>`}),{mapStateToProps:e=>({steps:JSON.parse(JSON.stringify(
|
|
573
|
-
${
|
|
572
|
+
></buv-verification-process-raw>`}),{mapStateToProps:e=>({steps:JSON.parse(JSON.stringify(f7(e))),isTestChain:h7(e),hasError:p7(e)})});window.customElements.define("buv-verification-process",Kee);const $ee=A7((function({isOpen:e,onClose:t}){return he`
|
|
573
|
+
${_ee}
|
|
574
574
|
<buv-modal isOpen?='${e}' onClose='${t}'>
|
|
575
575
|
<div class='buv-c-verification-modal__content'>
|
|
576
576
|
<buv-card-certificate class='buv-c-verification-modal__certificate' hideRecordLink hideVerifyButton></buv-card-certificate>
|
|
@@ -579,9 +579,9 @@ var r=BU.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){retur
|
|
|
579
579
|
</div>
|
|
580
580
|
<buv-footer forceInPlace></buv-footer>
|
|
581
581
|
</buv-modal>
|
|
582
|
-
`}),{mapDispatchToProps:{onClose:
|
|
583
|
-
</style>`;window.customElements.define("buv-drag-and-drop-raw",class extends me{constructor(){super(),this.isDraggedOver=!1,this.denyDrop=!1,this.handleDragEnter=this.handleDragEnter.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragLeave=this.handleDragLeave.bind(this),this.handleDrop=this.handleDrop.bind(this)}static get properties(){return{isDraggedOver:Boolean,denyDrop:Boolean,onDrop:Function}}handleDragEnter(){this.isDraggedOver=!0}handleDragOver(e){e.preventDefault()}handleDragLeave(){this.isDraggedOver=!1}handleDrop(e){e.preventDefault(),this.isDraggedOver=!1;const t=e.dataTransfer.files[0];this.denyDrop=!function(e){const{name:t}=e;return"json"===t.substr(t.length-4,4)}(t),this.denyDrop||this._props.onDrop(t)}_propertiesChanged(e,t,r){this._props=e,super._propertiesChanged(e,t,r)}_render(){const e=["buv-c-drag-and-drop__droparea",this.isDraggedOver?"is-active":""].join(" "),t=this.denyDrop?
|
|
584
|
-
${
|
|
582
|
+
`}),{mapDispatchToProps:{onClose:W7.bind(null,!1)},mapStateToProps:e=>({isOpen:Hee(e)})});window.customElements.define("buv-verification-modal",$ee);var Wee=he`<style>.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-c-drag-and-drop__droparea{z-index:100;background-color:rgba(0,0,0,0.1);display:none;position:absolute;top:0;left:0;width:100%;height:100%}.buv-c-drag-and-drop__droparea.is-active{display:block}
|
|
583
|
+
</style>`;window.customElements.define("buv-drag-and-drop-raw",class extends me{constructor(){super(),this.isDraggedOver=!1,this.denyDrop=!1,this.handleDragEnter=this.handleDragEnter.bind(this),this.handleDragOver=this.handleDragOver.bind(this),this.handleDragLeave=this.handleDragLeave.bind(this),this.handleDrop=this.handleDrop.bind(this)}static get properties(){return{isDraggedOver:Boolean,denyDrop:Boolean,onDrop:Function}}handleDragEnter(){this.isDraggedOver=!0}handleDragOver(e){e.preventDefault()}handleDragLeave(){this.isDraggedOver=!1}handleDrop(e){e.preventDefault(),this.isDraggedOver=!1;const t=e.dataTransfer.files[0];this.denyDrop=!function(e){const{name:t}=e;return"json"===t.substr(t.length-4,4)}(t),this.denyDrop||this._props.onDrop(t)}_propertiesChanged(e,t,r){this._props=e,super._propertiesChanged(e,t,r)}_render(){const e=["buv-c-drag-and-drop__droparea",this.isDraggedOver?"is-active":""].join(" "),t=this.denyDrop?G9("errors.invalidFormatDragAndDrop"):"";return he`
|
|
584
|
+
${Wee}
|
|
585
585
|
<div ondragenter='${this.handleDragEnter}'>
|
|
586
586
|
<div class$='${e}'
|
|
587
587
|
ondragover='${this.handleDragOver}'
|
|
@@ -590,15 +590,15 @@ var r=BU.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){retur
|
|
|
590
590
|
></div>
|
|
591
591
|
<span>${t}</span>
|
|
592
592
|
<slot></slot>
|
|
593
|
-
</div>`}});const
|
|
593
|
+
</div>`}});const Jee=A7((function(e){return he`
|
|
594
594
|
<buv-drag-and-drop-raw
|
|
595
595
|
onDrop='${e.onDrop}'
|
|
596
596
|
>
|
|
597
597
|
<slot></slot>
|
|
598
|
-
</buv-drag-and-drop-raw>`}),{mapDispatchToProps:{onDrop:
|
|
599
|
-
</style>`,
|
|
600
|
-
</style>`;const
|
|
601
|
-
${
|
|
598
|
+
</buv-drag-and-drop-raw>`}),{mapDispatchToProps:{onDrop:kee}});window.customElements.define("buv-drag-and-drop",Jee);var Gee=he`<style>.buv-c-verifier-main{font-family:'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;color:#031532;position:relative}.buv-c-verifier-layout{display:flex;flex-direction:column}.buv-c-verifier-body{background-color:#fff;flex-grow:1}.buv-c-verifier-body--padded{padding:20px}
|
|
599
|
+
</style>`,Xee=he`<style>.buv-o-link{cursor:pointer;text-decoration:none;color:currentColor}.buv-o-link__text--underline{border-bottom:1px solid}.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-c-card{position:relative;display:flex;margin-bottom:20px}.buv-c-card__img-wrapper{margin-right:1.5vw;min-width:50px;width:20%}.buv-c-card__img{max-width:100%;max-height:100%}.buv-c-card__title-wrapper{display:flex;flex-direction:column;justify-content:center}.buv-c-card__title{font-size:calc(16px + 0.5vw);margin-top:0;margin-bottom:0;font-weight:400;padding-right:100px}.buv-c-card__title--no-padding{padding:0}.buv-c-card__recipient{font-weight:600;margin:6px 0 12px}.buv-c-card__record-link{position:absolute;top:0;right:0;line-height:30px}.buv-c-card__record-link::after{content:'';border:solid currentColor;border-width:0 2px 2px 0;width:5px;height:5px;transform:rotate(-45deg);font-weight:bold;display:inline-block;margin-left:5px}.buv-c-card__verify-button{float:right}@media only screen and (max-width: 600px){.buv-c-card__title{font-size:16px}.buv-c-card__recipient{margin:6px 0}.buv-c-card__img-wrapper{margin-right:18px}}
|
|
600
|
+
</style>`;const Yee=A7((function(e){const{hasCertificateDefinition:t,recipientName:r,certificateTitle:n,issuedOn:i,issueDate:o,issuerName:s,recordLink:a,hideVerifyButton:u}=e;let{hideRecordLink:c}=e;if(!t)return null;a||c||(c=!0);const l=["buv-c-card__title",c?"buv-c-card__title--no-padding":""].join(" ");return he`
|
|
601
|
+
${Xee}
|
|
602
602
|
<section class='buv-c-card'>
|
|
603
603
|
<div class='buv-c-card__img-wrapper'>
|
|
604
604
|
${function(e){return new Promise((t=>{const r=new Image;r.addEventListener("load",(()=>{t(he`<img src='${e.issuerLogo}' alt='${e.issuerName}' class='buv-c-card__img'/>`)})),r.addEventListener("error",(()=>{t(he`<p class='buv-o-text-15'>${e.issuerName}</p>`)})),r.src=e.issuerLogo}))}(e)}
|
|
@@ -606,16 +606,16 @@ var r=BU.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){retur
|
|
|
606
606
|
<div class='buv-c-card__title-wrapper'>
|
|
607
607
|
<h1 class$=${l}>${n}</h1>
|
|
608
608
|
<h2 class$='${l} buv-c-card__recipient'>${r}</h2>
|
|
609
|
-
<span class='buv-o-text-12'>${
|
|
609
|
+
<span class='buv-o-text-12'>${G9("text.issued")} <time datetime$='${i}'>${o}</time> ${G9("text.by")} ${s}</span>
|
|
610
610
|
</div>
|
|
611
611
|
${c?"":he`<a class='buv-o-text-12 buv-o-link buv-c-card__record-link qa-card-record-link' href='${a}' target='_blank'>
|
|
612
|
-
<span class='buv-o-link__text--underline'>${
|
|
612
|
+
<span class='buv-o-link__text--underline'>${G9("text.viewRecord")}</span>
|
|
613
613
|
</a>`}
|
|
614
614
|
</section>
|
|
615
615
|
${u?"":he`<buv-final-verification-step class='buv-c-fullscreen-certificate__verification-status' isVisible hideLink standalone>
|
|
616
|
-
<buv-verify-button type='link'>${
|
|
616
|
+
<buv-verify-button type='link'>${G9("text.verifyAgain")}</buv-verify-button>
|
|
617
617
|
</buv-final-verification-step>`}
|
|
618
|
-
`}),{mapStateToProps:e=>({hasCertificateDefinition:!!
|
|
618
|
+
`}),{mapStateToProps:e=>({hasCertificateDefinition:!!Y9(e),recipientName:e7(e),certificateTitle:t7(e),issueDate:Z9(e),issuedOn:Q9(e),issuerName:r7(e),issuerLogo:n7(e),recordLink:o7(e)}),ownProps:{hideRecordLink:Boolean,hideVerifyButton:Boolean}});window.customElements.define("buv-card-certificate",Yee);
|
|
619
619
|
/**
|
|
620
620
|
* @license
|
|
621
621
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -629,29 +629,29 @@ var r=BU.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function i(e,t,n){retur
|
|
|
629
629
|
* subject to an additional IP rights grant found at
|
|
630
630
|
* http://polymer.github.io/PATENTS.txt
|
|
631
631
|
*/
|
|
632
|
-
const
|
|
633
|
-
</style>`,
|
|
634
|
-
</style>`;function
|
|
632
|
+
const Qee=e=>(e=>(e.__litDirective=!0,e))((t=>{const r=document.createElement("template");r.innerHTML=e,t.setValue(document.importNode(r.content,!0))}));var Zee=he`<style>.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-c-certificate--fixed-width{max-width:460px;min-width:0;margin:0 auto}.buv-c-full-certificate{box-shadow:0 1px 5px rgba(0,0,0,0.15);padding:20px;background-color:#fff;display:block;font-family:serif;text-align:center;color:#49555f;font-size:12px;overflow:auto;word-wrap:break-word;height:100vh;max-height:calc(100vh - 150px);line-height:initial}.buv-c-full-certificate section{max-width:100%;padding:0}.buv-c-full-certificate img{max-width:100%;height:auto;width:inherit}@media only screen and (min-width: 640px){.buv-c-full-certificate{font-size:16px}}.buv-c-full-certificate__button{margin-top:15px}.buv-c-full-certificate__details{display:flex;justify-content:space-between;margin-top:15px}.buv-c-full-certificate__details-list{min-width:calc(100% - 190px);width:calc(100% - 105px)}
|
|
633
|
+
</style>`,ete=he`<style>.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-c-certificate-details{display:flex;margin:0;position:relative;padding-bottom:60px}@media only screen and (max-width: 750px){.buv-c-certificate-details{flex-direction:column;padding-bottom:0}}.buv-c-certificate-details--column{flex-direction:column;padding-bottom:0}.buv-c-certificate-details__group{box-sizing:border-box;padding-right:15px;margin-top:15px}.buv-c-certificate-details__group--row{max-width:33%;margin-top:0}@media only screen and (max-width: 750px){.buv-c-certificate-details__group--row{max-width:100%}}.buv-c-certificate-details__title{margin-bottom:5px;text-transform:uppercase;font-weight:600}.buv-c-certificate-details__value{margin:0;word-break:break-all}.buv-c-certificate-details__standalone{position:absolute;bottom:0}@media only screen and (max-width: 750px){.buv-c-certificate-details__standalone{position:initial;margin-top:15px}}.buv-c-certificate-details--inline{display:inline-block;margin:0 0 5px}
|
|
634
|
+
</style>`;function tte({title:e,value:t,isDisplayColumn:r,renderInline:n=!1}){const i=["buv-c-certificate-details__group",r?"":"buv-c-certificate-details__group--row"].join(" "),o=["buv-c-certificate-details__title",r?"":"buv-o-text-11"].join(" "),s=["buv-c-certificate-details__value",n?"buv-c-certificate-details--inline":""].join(" ");return he`<div class$='${i}'>
|
|
635
635
|
<dt class$='${o}'>${e}</dt>
|
|
636
636
|
<dd class$='${s}'>${t}</dd>
|
|
637
|
-
</div>`}const
|
|
638
|
-
${
|
|
637
|
+
</div>`}const rte=A7((function({recipientName:e,issuedOn:t,issueDate:r,issuerName:n,issuerPublicKey:i,transactionLink:o,transactionId:s,direction:a,hideRecipientName:u}){const c=[];u||c.push({title:G9("text.recipient"),value:e}),c.push({title:G9("text.issueDate"),value:he`<time datetime$='${t}'>${r}</time>`},{title:G9("text.issuerName"),value:n},{title:G9("text.issuerPublicKey"),value:i});const l="column"===a,h=c.map((e=>tte(Object.assign(Object.assign({},e),{isDisplayColumn:l})))),f=["buv-c-certificate-details","buv-o-text-13",l?"buv-c-certificate-details--column":""].join(" ");return he`
|
|
638
|
+
${ete}
|
|
639
639
|
<dl class$='${f}'>
|
|
640
640
|
${h}
|
|
641
|
-
${function({title:e,value:t,transactionLink:r,isDisplayColumn:n}){return r.includes(" ")?he`<span>${
|
|
641
|
+
${function({title:e,value:t,transactionLink:r,isDisplayColumn:n}){return r.includes(" ")?he`<span>${G9("errors.noTransactionId")}</span>`:n?tte({title:e,value:t,isDisplayColumn:n,renderInline:!0}):he`
|
|
642
642
|
<div class='buv-c-certificate-details__standalone buv-o-text-11'>
|
|
643
643
|
<dt class='buv-c-certificate-details__title buv-c-certificate-details--inline'>${e}</dt>
|
|
644
644
|
<dd class='buv-c-certificate-details--inline'>${t}</dd>
|
|
645
|
-
</div>`}({transactionLink:o,title:`${
|
|
645
|
+
</div>`}({transactionLink:o,title:`${G9("text.transactionId")}:`,value:s,isDisplayColumn:l})}
|
|
646
646
|
</dl>
|
|
647
|
-
`}),{mapStateToProps:e=>({recipientName:
|
|
648
|
-
</style>`;const
|
|
647
|
+
`}),{mapStateToProps:e=>({recipientName:e7(e),issueDate:Z9(e),issuedOn:Q9(e),issuerName:r7(e),transactionLink:u7(e),transactionId:c7(e),issuerPublicKey:_7(e)}),ownProps:{direction:String,hideRecipientName:Boolean}});window.customElements.define("buv-certificate-details",rte);var nte=he`<style>.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-c-certificate--fixed-width{max-width:460px;min-width:0;margin:0 auto}.buv-c-full-certificate{box-shadow:0 1px 5px rgba(0,0,0,0.15);padding:20px;background-color:#fff;display:block;font-family:serif;text-align:center;color:#49555f;font-size:12px;overflow:auto;word-wrap:break-word;height:100vh;max-height:calc(100vh - 150px);line-height:initial}.buv-c-full-certificate section{max-width:100%;padding:0}.buv-c-full-certificate img{max-width:100%;height:auto;width:inherit}@media only screen and (min-width: 640px){.buv-c-full-certificate{font-size:16px}}.buv-c-full-certificate__button{margin-top:15px}.buv-c-full-certificate__details{display:flex;justify-content:space-between;margin-top:15px}.buv-c-full-certificate__details-list{min-width:calc(100% - 190px);width:calc(100% - 105px)}.buv-c-full-certificate .buv-c-full-certificate-img{max-width:125px;max-height:125px}.buv-c-full-certificate__titles::before,.buv-c-full-certificate__titles::after{content:' ';display:block;background-color:#edf1f4;width:30%;text-align:center;margin:20px auto;height:2px}.buv-c-full-certificate__title{font-weight:normal;margin:0}.buv-c-full-certificate__title--name{color:#000;font-size:30px;margin-bottom:10px}.buv-c-full-certificate__title--main{font-size:21px;margin-bottom:10px}.buv-c-full-certificate__title--sub{font-size:16px;font-style:italic}.buv-c-full-certificate__description{margin:0 0 40px;line-height:1.5}.buv-c-full-certificate-signatures{list-style-type:none;display:flex;justify-content:space-around;width:100%;margin:0 0 20px;padding:0}.buv-c-full-certificate-signatures__signature{margin-right:30px;display:flex;flex-direction:column;justify-content:center}.buv-c-full-certificate-signatures__signature:last-child{margin:0}.buv-c-full-certificate-img--secondary{max-width:150px;max-height:150px}
|
|
648
|
+
</style>`;const ite=A7((function({hasCertificateDefinition:e,certificateImage:t,certificateTitle:r,certificateSeal:n,certificateSignatures:i,certificateSubtitle:o,certificateDescription:s,recipientName:a,issuerName:u}){if(!e)return null;const c=i.map((e=>he`
|
|
649
649
|
<li class='buv-c-full-certificate-signatures__signature'>
|
|
650
|
-
<img class='buv-c-full-certificate-img--secondary' src='${e.image}' alt='${
|
|
650
|
+
<img class='buv-c-full-certificate-img--secondary' src='${e.image}' alt='${G9("text.signed")} ${e.jobTitle}'/>
|
|
651
651
|
<span class='buv-o-text-12'>${e.jobTitle}</span>
|
|
652
652
|
</li>
|
|
653
653
|
`));return he`
|
|
654
|
-
${
|
|
654
|
+
${nte}
|
|
655
655
|
<section class='buv-c-full-certificate'>
|
|
656
656
|
<img class='buv-c-full-certificate-img' src='${t}' alt='${r}'/>
|
|
657
657
|
<div class='buv-c-full-certificate__titles'>
|
|
@@ -663,51 +663,51 @@ const Zee=e=>(e=>(e.__litDirective=!0,e))((t=>{const r=document.createElement("t
|
|
|
663
663
|
<ul class='buv-c-full-certificate-signatures'>
|
|
664
664
|
${c}
|
|
665
665
|
</ul>
|
|
666
|
-
<img class='buv-c-full-certificate-img--secondary' src='${n}' alt='${
|
|
666
|
+
<img class='buv-c-full-certificate-img--secondary' src='${n}' alt='${G9("text.certified")} ${u}'/>
|
|
667
667
|
</section>
|
|
668
|
-
`}),{mapStateToProps:e=>({hasCertificateDefinition:!!Q9(e),certificateImage:m7(e),certificateTitle:r7(e),certificateSubtitle:v7(e),certificateDescription:y7(e),certificateSeal:w7(e),certificateSignatures:b7(e),recipientName:t7(e),issuerName:n7(e)})});function ste(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function ate(e,t){for(var r=e.length-1;r>=0;r--)!0===t(e[r])&&e.splice(r,1)}function ute(e){throw new Error("Unhandled case for value: '"+e+"'")}window.customElements.define("buv-full-certificate-v1",ote);var cte=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,r=this.getClass(),n=this.whitespaceRegex,i=r?r.split(n):[],o=e.split(n);t=o.shift();)-1===ste(i,t)&&i.push(t);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(e){for(var t,r=this.getClass(),n=this.whitespaceRegex,i=r?r.split(n):[],o=e.split(n);i.length&&(t=o.shift());){var s=ste(i,t);-1!==s&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")},e}();var lte,hte=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new cte({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},r=this.createCssClass(e);return r&&(t.class=r),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var r=[t],n=e.getCssClassSuffixes(),i=0,o=n.length;i<o;i++)r.push(t+"-"+n[i]);return r.join(" ")}return""},e.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var r=t.length,n=t.location;return"smart"===n?function(e,t,r){var n,i;null==r?(r="…",i=3,n=8):(i=r.length,n=r.length);var o=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t},s=function(e,t){var n=t/2,i=Math.ceil(n),o=-1*Math.floor(n),s="";return o<0&&(s=e.substr(o)),e.substr(0,i)+r+s};if(e.length<=t)return e;var a=t-i,u=function(e){var t={},r=e,n=r.match(/^([a-z]+):\/\//i);return n&&(t.scheme=n[1],r=r.substr(n[0].length)),(n=r.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(t.host=n[1],r=r.substr(n[0].length)),(n=r.match(/^\/(.*?)(?=(\?|#|$))/i))&&(t.path=n[1],r=r.substr(n[0].length)),(n=r.match(/^\?(.*?)(?=(#|$))/i))&&(t.query=n[1],r=r.substr(n[0].length)),(n=r.match(/^#(.*?)$/i))&&(t.fragment=n[1]),t}(e);if(u.query){var c=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);c&&(u.query=u.query.substr(0,c[1].length),e=o(u))}if(e.length<=t)return e;if(u.host&&(u.host=u.host.replace(/^www\./,""),e=o(u)),e.length<=t)return e;var l="";if(u.host&&(l+=u.host),l.length>=a)return u.host.length==t?(u.host.substr(0,t-i)+r).substr(0,a+n):s(l,a).substr(0,a+n);var h="";if(u.path&&(h+="/"+u.path),u.query&&(h+="?"+u.query),h){if((l+h).length>=a)return(l+h).length==t?(l+h).substr(0,t):(l+s(h,a-l.length)).substr(0,a+n);l+=h}if(u.fragment){var f="#"+u.fragment;if((l+f).length>=a)return(l+f).length==t?(l+f).substr(0,t):(l+s(f,a-l.length)).substr(0,a+n);l+=f}if(u.scheme&&u.host){var d=u.scheme+"://";if((l+d).length<a)return(d+l).substr(0,t)}if(l.length<=t)return l;var p="";return a>0&&(p=l.substr(-1*Math.floor(a/2))),(l.substr(0,Math.ceil(a/2))+r+p).substr(0,a+n)}(e,r):"middle"===n?function(e,t,r){if(e.length<=t)return e;var n,i;null==r?(r="…",n=8,i=3):(n=r.length,i=r.length);var o=t-i,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+r+s).substr(0,o+n)}(e,r):function(e,t,r){return function(e,t,r){var n;return e.length>t&&(null==r?(r="…",n=3):n=r.length,e=e.substring(0,t-n)+r),e}(e,t,r)}(e,r)},e}(),fte=function(){function e(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(e){this.offset=e},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.getType()]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}(),dte=function(e){function t(t){var r=e.call(this,t)||this;return r.email="",r.email=t.email,r}return eB(t,e),t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(fte),pte=function(e){function t(t){var r=e.call(this,t)||this;return r.serviceName="",r.hashtag="",r.serviceName=t.serviceName,r.hashtag=t.hashtag,r}return eB(t,e),t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;default:throw new Error("Unknown service name to point hashtag to: "+e)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t}(fte),gte=function(e){function t(t){var r=e.call(this,t)||this;return r.serviceName="twitter",r.mention="",r.mention=t.mention,r.serviceName=t.serviceName,r}return eB(t,e),t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var t=e.prototype.getCssClassSuffixes.call(this),r=this.getServiceName();return r&&t.push(r),t},t}(fte),mte=function(e){function t(t){var r=e.call(this,t)||this;return r.number="",r.plusSign=!1,r.number=t.number,r.plusSign=t.plusSign,r}return eB(t,e),t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(fte),vte=function(e){function t(t){var r=e.call(this,t)||this;return r.url="",r.urlMatchType="scheme",r.protocolUrlMatch=!1,r.protocolRelativeMatch=!1,r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.schemePrefixRegex=/^(https?:\/\/)?/i,r.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,r.protocolRelativeRegex=/^\/\//,r.protocolPrepended=!1,r.urlMatchType=t.urlMatchType,r.url=t.url,r.protocolUrlMatch=t.protocolUrlMatch,r.protocolRelativeMatch=t.protocolRelativeMatch,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return eB(t,e),t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},t.prototype.getAnchorHref=function(){return this.getUrl().replace(/&/g,"&")},t.prototype.getAnchorText=function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix.scheme&&(e=this.stripSchemePrefix(e)),this.stripPrefix.www&&(e=this.stripWwwPrefix(e)),this.stripTrailingSlash&&(e=this.removeTrailingSlash(e)),this.decodePercentEncoding&&(e=this.removePercentEncoding(e)),e},t.prototype.stripSchemePrefix=function(e){return e.replace(this.schemePrefixRegex,"")},t.prototype.stripWwwPrefix=function(e){return e.replace(this.wwwPrefixRegex,"$1")},t.prototype.stripProtocolRelativePrefix=function(e){return e.replace(this.protocolRelativeRegex,"")},t.prototype.removeTrailingSlash=function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e},t.prototype.removePercentEncoding=function(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch(e){return t}},t}(fte),yte=function(e){this.__jsduckDummyDocProp=null,this.tagBuilder=e.tagBuilder},bte=/[A-Za-z]/,wte=/[\d]/,_te=/[\D]/,xte=/\s/,Ste=/['"]/,Ete=/[\x00-\x1F\x7F]/,kte=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,Ite=kte+/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source+/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,Ate=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,Pte=Ite+Ate,Tte=Ite+Ate,Ote="(?:["+Ate+"]{1,3}\\.){3}["+Ate+"]{1,3}",Cte="["+Tte+"](?:["+Tte+"\\-]{0,61}["+Tte+"])?",Mte=function(e){return"(?=("+Cte+"))\\"+e},Rte=function(e){return"(?:"+Mte(e)+"(?:\\."+Mte(e+1)+"){0,126}|"+Ote+")"},Nte=new RegExp("["+Tte+"]"),Lte=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,jte=new RegExp("["+Tte+"!#$%&'*+/=?^_`{|}~-]"),Dte=new RegExp("^"+Lte.source+"$"),Bte=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.localPartCharRegex=jte,t.strictTldRegex=Dte,t}return eB(t,e),t.prototype.parseMatches=function(e){for(var t=this.tagBuilder,r=this.localPartCharRegex,n=this.strictTldRegex,i=[],o=e.length,s=new Ute,a={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},u=0,c=0,l=s;u<o;){var h=e.charAt(u);switch(c){case 0:f(h);break;case 1:d(e.charAt(u-1),h);break;case 2:p(h);break;case 3:g(h);break;case 4:m(h);break;case 5:v(h);break;case 6:y(h);break;case 7:b(h);break;default:ute(c)}u++}return x(),i;function f(e){"m"===e?w(1):r.test(e)&&w()}function d(e,t){":"===e?r.test(t)?(c=2,l=new Ute(nB(nB({},l),{hasMailtoPrefix:!0}))):_():a[e]===t||(r.test(t)?c=2:"."===t?c=3:"@"===t?c=4:_())}function p(e){"."===e?c=3:"@"===e?c=4:r.test(e)||_()}function g(e){"."===e||"@"===e?_():r.test(e)?c=2:_()}function m(e){Nte.test(e)?c=5:_()}function v(e){"."===e?c=7:"-"===e?c=6:Nte.test(e)||x()}function y(e){"-"===e||"."===e?x():Nte.test(e)?c=5:x()}function b(e){"."===e||"-"===e?x():Nte.test(e)?(c=5,l=new Ute(nB(nB({},l),{hasDomainDot:!0}))):x()}function w(e){void 0===e&&(e=2),c=e,l=new Ute({idx:u})}function _(){c=0,l=s}function x(){if(l.hasDomainDot){var r=e.slice(l.idx,u);/[-.]$/.test(r)&&(r=r.slice(0,-1));var o=l.hasMailtoPrefix?r.slice("mailto:".length):r;(function(e){var t=(e.split(".").pop()||"").toLowerCase();return n.test(t)})(o)&&i.push(new dte({tagBuilder:t,matchedText:r,offset:l.idx,email:o}))}_()}},t}(yte),Ute=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.hasMailtoPrefix=!!e.hasMailtoPrefix,this.hasDomainDot=!!e.hasDomainDot},Fte=function(){function e(){}return e.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},e.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},e.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},e.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),r=t&&t[0].toLowerCase();return"javascript:"!==r&&"vbscript:"!==r},e.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},e.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t)&&(!this.hasFullProtocolRegex.test(t)&&!this.hasWordCharAfterProtocolRegex.test(e))},e.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,e.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,e.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+kte+"]"),e.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,e}(),Hte=(lte=new RegExp("[/?#](?:["+Tte+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+Tte+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,Rte(2),")","|","(","(//)?",/(?:www\.)/.source,Rte(6),")","|","(","(//)?",Rte(10)+"\\.",Lte.source,"(?![-"+Pte+"])",")",")","(?::[0-9]+)?","(?:"+lte.source+")?"].join(""),"gi")),zte=new RegExp("["+Tte+"]"),Vte=function(e){function t(t){var r=e.call(this,t)||this;return r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.matcherRegex=Hte,r.wordCharRegExp=zte,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return eB(t,e),t.prototype.parseMatches=function(e){for(var t,r=this.matcherRegex,n=this.stripPrefix,i=this.stripTrailingSlash,o=this.decodePercentEncoding,s=this.tagBuilder,a=[],u=function(){var r=t[0],u=t[1],l=t[4],h=t[5],f=t[9],d=t.index,p=h||f,g=e.charAt(d-1);if(!Fte.isValid(r,u))return"continue";if(d>0&&"@"===g)return"continue";if(d>0&&p&&c.wordCharRegExp.test(g))return"continue";if(/\?$/.test(r)&&(r=r.substr(0,r.length-1)),c.matchHasUnbalancedClosingParen(r))r=r.substr(0,r.length-1);else{var m=c.matchHasInvalidCharAfterTld(r,u);m>-1&&(r=r.substr(0,m))}var v=["http://","https://"].find((function(e){return!!u&&-1!==u.indexOf(e)}));if(v){var y=r.indexOf(v);r=r.substr(y),u=u.substr(y),d+=y}var b=u?"scheme":l?"www":"tld",w=!!u;a.push(new vte({tagBuilder:s,matchedText:r,offset:d,urlMatchType:b,url:r,protocolUrlMatch:w,protocolRelativeMatch:!!p,stripPrefix:n,stripTrailingSlash:i,decodePercentEncoding:o}))},c=this;null!==(t=r.exec(e));)u();return a},t.prototype.matchHasUnbalancedClosingParen=function(e){var t,r=e.charAt(e.length-1);if(")"===r)t="(";else if("]"===r)t="[";else{if("}"!==r)return!1;t="{"}for(var n=0,i=0,o=e.length-1;i<o;i++){var s=e.charAt(i);s===t?n++:s===r&&(n=Math.max(n-1,0))}return 0===n},t.prototype.matchHasInvalidCharAfterTld=function(e,t){if(!e)return-1;var r=0;t&&(r=e.indexOf(":"),e=e.slice(r));var n=new RegExp("^((.?//)?[-."+Tte+"]*[-"+Tte+"]\\.[-"+Tte+"]+)").exec(e);return null===n?-1:(r+=n[1].length,e=e.slice(n[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(e)?r:-1)},t}(yte),qte=new RegExp("#[_"+Tte+"]{1,139}(?![_"+Tte+"])","g"),Kte=new RegExp("[^"+Tte+"]"),$te=function(e){function t(t){var r=e.call(this,t)||this;return r.serviceName="twitter",r.matcherRegex=qte,r.nonWordCharRegex=Kte,r.serviceName=t.serviceName,r}return eB(t,e),t.prototype.parseMatches=function(e){for(var t,r=this.matcherRegex,n=this.nonWordCharRegex,i=this.serviceName,o=this.tagBuilder,s=[];null!==(t=r.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||n.test(u)){var c=t[0],l=t[0].slice(1);s.push(new pte({tagBuilder:o,matchedText:c,offset:a,serviceName:i,hashtag:l}))}}return s},t}(yte),Wte=new RegExp(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source+"|"+/(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source,"g"),Jte=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.matcherRegex=Wte,t}return eB(t,e),t.prototype.parseMatches=function(e){for(var t,r=this.matcherRegex,n=this.tagBuilder,i=[];null!==(t=r.exec(e));){var o=t[0],s=o.replace(/[^0-9,;#]/g,""),a=!(!t[1]&&!t[2]),u=0==t.index?"":e.substr(t.index-1,1),c=e.substr(t.index+o.length,1),l=!u.match(/\d/)&&!c.match(/\d/);this.testMatch(t[3])&&this.testMatch(o)&&l&&i.push(new mte({tagBuilder:n,matchedText:o,offset:t.index,number:s,plusSign:a}))}return i},t.prototype.testMatch=function(e){return _te.test(e)},t}(yte),Gte=new RegExp("@[_"+Tte+"]{1,50}(?![_"+Tte+"])","g"),Xte=new RegExp("@[_."+Tte+"]{1,30}(?![_"+Tte+"])","g"),Yte=new RegExp("@[-_."+Tte+"]{1,50}(?![-_"+Tte+"])","g"),Qte=new RegExp("[^"+Tte+"]"),Zte=function(e){function t(t){var r=e.call(this,t)||this;return r.serviceName="twitter",r.matcherRegexes={twitter:Gte,instagram:Xte,soundcloud:Yte},r.nonWordCharRegex=Qte,r.serviceName=t.serviceName,r}return eB(t,e),t.prototype.parseMatches=function(e){var t,r=this.serviceName,n=this.matcherRegexes[this.serviceName],i=this.nonWordCharRegex,o=this.tagBuilder,s=[];if(!n)return s;for(;null!==(t=n.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||i.test(u)){var c=t[0].replace(/\.+$/g,""),l=c.slice(1);s.push(new gte({tagBuilder:o,matchedText:c,offset:a,serviceName:r,mention:l}))}}return s},t}(yte);function ere(e,t){for(var r,n=t.onOpenTag,i=t.onCloseTag,o=t.onText,s=t.onComment,a=t.onDoctype,u=new tre,c=0,l=e.length,h=0,f=0,d=u;c<l;){var p=e.charAt(c);switch(h){case 0:g(p);break;case 1:m(p);break;case 2:y(p);break;case 3:v(p);break;case 4:b(p);break;case 5:w(p);break;case 6:_(p);break;case 7:x(p);break;case 8:S(p);break;case 9:E(p);break;case 10:k(p);break;case 11:I(p);break;case 12:A(p);break;case 13:P();break;case 14:T(p);break;case 15:O(p);break;case 16:C(p);break;case 17:M(p);break;case 18:R(p);break;case 19:N(p);break;case 20:L(p);break;default:ute(h)}c++}function g(e){"<"===e&&D()}function m(e){"!"===e?h=13:"/"===e?(h=2,d=new tre(nB(nB({},d),{isClosing:!0}))):"<"===e?D():bte.test(e)?(h=3,d=new tre(nB(nB({},d),{isOpening:!0}))):(h=0,d=u)}function v(e){xte.test(e)?(d=new tre(nB(nB({},d),{name:U()})),h=4):"<"===e?D():"/"===e?(d=new tre(nB(nB({},d),{name:U()})),h=12):">"===e?(d=new tre(nB(nB({},d),{name:U()})),B()):bte.test(e)||wte.test(e)||":"===e||j()}function y(e){">"===e?j():bte.test(e)?h=3:j()}function b(e){xte.test(e)||("/"===e?h=12:">"===e?B():"<"===e?D():"="===e||Ste.test(e)||Ete.test(e)?j():h=5)}function w(e){xte.test(e)?h=6:"/"===e?h=12:"="===e?h=7:">"===e?B():"<"===e?D():Ste.test(e)&&j()}function _(e){xte.test(e)||("/"===e?h=12:"="===e?h=7:">"===e?B():"<"===e?D():Ste.test(e)?j():h=5)}function x(e){xte.test(e)||('"'===e?h=8:"'"===e?h=9:/[>=`]/.test(e)?j():"<"===e?D():h=10)}function S(e){'"'===e&&(h=11)}function E(e){"'"===e&&(h=11)}function k(e){xte.test(e)?h=4:">"===e?B():"<"===e&&D()}function I(e){xte.test(e)?h=4:"/"===e?h=12:">"===e?B():"<"===e?D():(h=4,c--)}function A(e){">"===e?(d=new tre(nB(nB({},d),{isClosing:!0})),B()):h=4}function P(t){"--"===e.substr(c,2)?(c+=2,d=new tre(nB(nB({},d),{type:"comment"})),h=14):"DOCTYPE"===e.substr(c,7).toUpperCase()?(c+=7,d=new tre(nB(nB({},d),{type:"doctype"})),h=20):j()}function T(e){"-"===e?h=15:">"===e?j():h=16}function O(e){"-"===e?h=18:">"===e?j():h=16}function C(e){"-"===e&&(h=17)}function M(e){h="-"===e?18:16}function R(e){">"===e?B():"!"===e?h=19:"-"===e||(h=16)}function N(e){"-"===e?h=17:">"===e?B():h=16}function L(e){">"===e?B():"<"===e&&D()}function j(){h=0,d=u}function D(){h=1,d=new tre({idx:c})}function B(){var t=e.slice(f,d.idx);t&&o(t,f),"comment"===d.type?s(d.idx):"doctype"===d.type?a(d.idx):(d.isOpening&&n(d.name,d.idx),d.isClosing&&i(d.name,d.idx)),j(),f=c+1}function U(){var t=d.idx+(d.isClosing?2:1);return e.slice(t,c).toLowerCase()}f<c&&(r=e.slice(f,c),o(r,f),f=c+1)}var tre=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.type=e.type||"tag",this.name=e.name||"",this.isOpening=!!e.isOpening,this.isClosing=!!e.isClosing},rre=function(){function e(t){void 0===t&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(t.urls),this.email="boolean"==typeof t.email?t.email:this.email,this.phone="boolean"==typeof t.phone?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow="boolean"==typeof t.newWindow?t.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(t.stripPrefix),this.stripTrailingSlash="boolean"==typeof t.stripTrailingSlash?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding="boolean"==typeof t.decodePercentEncoding?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var r=this.mention;if(!1!==r&&"twitter"!==r&&"instagram"!==r&&"soundcloud"!==r)throw new Error("invalid `mention` cfg - see docs");var n=this.hashtag;if(!1!==n&&"twitter"!==n&&"facebook"!==n&&"instagram"!==n)throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,r){return new e(r).link(t)},e.parse=function(t,r){return new e(r).parse(t)},e.prototype.normalizeUrlsCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},e.prototype.normalizeStripPrefixCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{scheme:e,www:e}:{scheme:"boolean"!=typeof e.scheme||e.scheme,www:"boolean"!=typeof e.www||e.www}},e.prototype.normalizeTruncateCfg=function(e){return"number"==typeof e?{length:e,location:"end"}:function(e,t){for(var r in t)t.hasOwnProperty(r)&&void 0===e[r]&&(e[r]=t[r]);return e}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},e.prototype.parse=function(e){var t=this,r=["a","style","script"],n=0,i=[];return ere(e,{onOpenTag:function(e){r.indexOf(e)>=0&&n++},onText:function(e,r){if(0===n){var o=function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var r,n=[],i=0;r=t.exec(e);)n.push(e.substring(i,r.index)),n.push(r[0]),i=r.index+r[0].length;return n.push(e.substring(i)),n}(e,/( | |<|<|>|>|"|"|')/gi),s=r;o.forEach((function(e,r){if(r%2==0){var n=t.parseText(e,s);i.push.apply(i,n)}s+=e.length}))}},onCloseTag:function(e){r.indexOf(e)>=0&&(n=Math.max(n-1,0))},onComment:function(e){},onDoctype:function(e){}}),i=this.compactMatches(i),i=this.removeUnwantedMatches(i)},e.prototype.compactMatches=function(e){e.sort((function(e,t){return e.getOffset()-t.getOffset()}));for(var t=0;t<e.length-1;t++){var r=e[t],n=r.getOffset(),i=r.getMatchedText().length,o=n+i;if(t+1<e.length){if(e[t+1].getOffset()===n){var s=e[t+1].getMatchedText().length>i?t:t+1;e.splice(s,1);continue}e[t+1].getOffset()<o&&e.splice(t+1,1)}}return e},e.prototype.removeUnwantedMatches=function(e){return this.hashtag||ate(e,(function(e){return"hashtag"===e.getType()})),this.email||ate(e,(function(e){return"email"===e.getType()})),this.phone||ate(e,(function(e){return"phone"===e.getType()})),this.mention||ate(e,(function(e){return"mention"===e.getType()})),this.urls.schemeMatches||ate(e,(function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()})),this.urls.wwwMatches||ate(e,(function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()})),this.urls.tldMatches||ate(e,(function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()})),e},e.prototype.parseText=function(e,t){void 0===t&&(t=0),t=t||0;for(var r=this.getMatchers(),n=[],i=0,o=r.length;i<o;i++){for(var s=r[i].parseMatches(e),a=0,u=s.length;a<u;a++)s[a].setOffset(t+s[a].getOffset());n.push.apply(n,s)}return n},e.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"<").replace(/>/g,">"));for(var t=this.parse(e),r=[],n=0,i=0,o=t.length;i<o;i++){var s=t[i];r.push(e.substring(n,s.getOffset())),r.push(this.createMatchReturnVal(s)),n=s.getOffset()+s.getMatchedText().length}return r.push(e.substring(n)),r.join("")},e.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof cte?t.toAnchorString():e.buildTag().toAnchorString()},e.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new $te({tagBuilder:e,serviceName:this.hashtag}),new Bte({tagBuilder:e}),new Jte({tagBuilder:e}),new Zte({tagBuilder:e,serviceName:this.mention}),new Vte({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},e.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new hte({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},e.version="3.14.3",e.AnchorTagBuilder=hte,e.HtmlTag=cte,e.matcher={Email:Bte,Hashtag:$te,Matcher:yte,Mention:Zte,Phone:Jte,Url:Vte},e.match={Email:dte,Hashtag:pte,Match:fte,Mention:gte,Phone:mte,Url:vte},e}();function nre(e){return rre.link(e,{stripPrefix:!1,email:!1,phone:!1})}const ire=P7((function({clickableUrls:e,hasCertificateDefinition:t,displayHTML:r}){return t?he`
|
|
669
|
-
${
|
|
670
|
-
${r?function(e,t){const r=["buv-c-full-certificate","qa-fullscreen-certificate"];R8.certificates.displayHtmlHasNoWidthConstraint(e)&&r.push("buv-c-certificate--fixed-width");const n=t?
|
|
668
|
+
`}),{mapStateToProps:e=>({hasCertificateDefinition:!!Y9(e),certificateImage:g7(e),certificateTitle:t7(e),certificateSubtitle:m7(e),certificateDescription:v7(e),certificateSeal:b7(e),certificateSignatures:y7(e),recipientName:e7(e),issuerName:r7(e)})});function ote(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function ste(e,t){for(var r=e.length-1;r>=0;r--)!0===t(e[r])&&e.splice(r,1)}function ate(e){throw new Error("Unhandled case for value: '"+e+"'")}window.customElements.define("buv-full-certificate-v1",ite);var ute=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,r=this.getClass(),n=this.whitespaceRegex,i=r?r.split(n):[],o=e.split(n);t=o.shift();)-1===ote(i,t)&&i.push(t);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(e){for(var t,r=this.getClass(),n=this.whitespaceRegex,i=r?r.split(n):[],o=e.split(n);i.length&&(t=o.shift());){var s=ote(i,t);-1!==s&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")},e}();var cte,lte=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new ute({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},r=this.createCssClass(e);return r&&(t.class=r),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var r=[t],n=e.getCssClassSuffixes(),i=0,o=n.length;i<o;i++)r.push(t+"-"+n[i]);return r.join(" ")}return""},e.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var r=t.length,n=t.location;return"smart"===n?function(e,t,r){var n,i;null==r?(r="…",i=3,n=8):(i=r.length,n=r.length);var o=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t},s=function(e,t){var n=t/2,i=Math.ceil(n),o=-1*Math.floor(n),s="";return o<0&&(s=e.substr(o)),e.substr(0,i)+r+s};if(e.length<=t)return e;var a=t-i,u=function(e){var t={},r=e,n=r.match(/^([a-z]+):\/\//i);return n&&(t.scheme=n[1],r=r.substr(n[0].length)),(n=r.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(t.host=n[1],r=r.substr(n[0].length)),(n=r.match(/^\/(.*?)(?=(\?|#|$))/i))&&(t.path=n[1],r=r.substr(n[0].length)),(n=r.match(/^\?(.*?)(?=(#|$))/i))&&(t.query=n[1],r=r.substr(n[0].length)),(n=r.match(/^#(.*?)$/i))&&(t.fragment=n[1]),t}(e);if(u.query){var c=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);c&&(u.query=u.query.substr(0,c[1].length),e=o(u))}if(e.length<=t)return e;if(u.host&&(u.host=u.host.replace(/^www\./,""),e=o(u)),e.length<=t)return e;var l="";if(u.host&&(l+=u.host),l.length>=a)return u.host.length==t?(u.host.substr(0,t-i)+r).substr(0,a+n):s(l,a).substr(0,a+n);var h="";if(u.path&&(h+="/"+u.path),u.query&&(h+="?"+u.query),h){if((l+h).length>=a)return(l+h).length==t?(l+h).substr(0,t):(l+s(h,a-l.length)).substr(0,a+n);l+=h}if(u.fragment){var f="#"+u.fragment;if((l+f).length>=a)return(l+f).length==t?(l+f).substr(0,t):(l+s(f,a-l.length)).substr(0,a+n);l+=f}if(u.scheme&&u.host){var d=u.scheme+"://";if((l+d).length<a)return(d+l).substr(0,t)}if(l.length<=t)return l;var p="";return a>0&&(p=l.substr(-1*Math.floor(a/2))),(l.substr(0,Math.ceil(a/2))+r+p).substr(0,a+n)}(e,r):"middle"===n?function(e,t,r){if(e.length<=t)return e;var n,i;null==r?(r="…",n=8,i=3):(n=r.length,i=r.length);var o=t-i,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+r+s).substr(0,o+n)}(e,r):function(e,t,r){return function(e,t,r){var n;return e.length>t&&(null==r?(r="…",n=3):n=r.length,e=e.substring(0,t-n)+r),e}(e,t,r)}(e,r)},e}(),hte=function(){function e(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(e){this.offset=e},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.getType()]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}(),fte=function(e){function t(t){var r=e.call(this,t)||this;return r.email="",r.email=t.email,r}return eB(t,e),t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(hte),dte=function(e){function t(t){var r=e.call(this,t)||this;return r.serviceName="",r.hashtag="",r.serviceName=t.serviceName,r.hashtag=t.hashtag,r}return eB(t,e),t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;default:throw new Error("Unknown service name to point hashtag to: "+e)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t}(hte),pte=function(e){function t(t){var r=e.call(this,t)||this;return r.serviceName="twitter",r.mention="",r.mention=t.mention,r.serviceName=t.serviceName,r}return eB(t,e),t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var t=e.prototype.getCssClassSuffixes.call(this),r=this.getServiceName();return r&&t.push(r),t},t}(hte),gte=function(e){function t(t){var r=e.call(this,t)||this;return r.number="",r.plusSign=!1,r.number=t.number,r.plusSign=t.plusSign,r}return eB(t,e),t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(hte),mte=function(e){function t(t){var r=e.call(this,t)||this;return r.url="",r.urlMatchType="scheme",r.protocolUrlMatch=!1,r.protocolRelativeMatch=!1,r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.schemePrefixRegex=/^(https?:\/\/)?/i,r.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,r.protocolRelativeRegex=/^\/\//,r.protocolPrepended=!1,r.urlMatchType=t.urlMatchType,r.url=t.url,r.protocolUrlMatch=t.protocolUrlMatch,r.protocolRelativeMatch=t.protocolRelativeMatch,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return eB(t,e),t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},t.prototype.getAnchorHref=function(){return this.getUrl().replace(/&/g,"&")},t.prototype.getAnchorText=function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix.scheme&&(e=this.stripSchemePrefix(e)),this.stripPrefix.www&&(e=this.stripWwwPrefix(e)),this.stripTrailingSlash&&(e=this.removeTrailingSlash(e)),this.decodePercentEncoding&&(e=this.removePercentEncoding(e)),e},t.prototype.stripSchemePrefix=function(e){return e.replace(this.schemePrefixRegex,"")},t.prototype.stripWwwPrefix=function(e){return e.replace(this.wwwPrefixRegex,"$1")},t.prototype.stripProtocolRelativePrefix=function(e){return e.replace(this.protocolRelativeRegex,"")},t.prototype.removeTrailingSlash=function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e},t.prototype.removePercentEncoding=function(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch(e){return t}},t}(hte),vte=function(e){this.__jsduckDummyDocProp=null,this.tagBuilder=e.tagBuilder},yte=/[A-Za-z]/,bte=/[\d]/,wte=/[\D]/,_te=/\s/,xte=/['"]/,Ste=/[\x00-\x1F\x7F]/,Ete=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,kte=Ete+/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source+/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,Ite=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,Ate=kte+Ite,Pte=kte+Ite,Tte="(?:["+Ite+"]{1,3}\\.){3}["+Ite+"]{1,3}",Ote="["+Pte+"](?:["+Pte+"\\-]{0,61}["+Pte+"])?",Cte=function(e){return"(?=("+Ote+"))\\"+e},Mte=function(e){return"(?:"+Cte(e)+"(?:\\."+Cte(e+1)+"){0,126}|"+Tte+")"},Rte=new RegExp("["+Pte+"]"),Nte=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,Lte=new RegExp("["+Pte+"!#$%&'*+/=?^_`{|}~-]"),jte=new RegExp("^"+Nte.source+"$"),Dte=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.localPartCharRegex=Lte,t.strictTldRegex=jte,t}return eB(t,e),t.prototype.parseMatches=function(e){for(var t=this.tagBuilder,r=this.localPartCharRegex,n=this.strictTldRegex,i=[],o=e.length,s=new Bte,a={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},u=0,c=0,l=s;u<o;){var h=e.charAt(u);switch(c){case 0:f(h);break;case 1:d(e.charAt(u-1),h);break;case 2:p(h);break;case 3:g(h);break;case 4:m(h);break;case 5:v(h);break;case 6:y(h);break;case 7:b(h);break;default:ate(c)}u++}return x(),i;function f(e){"m"===e?w(1):r.test(e)&&w()}function d(e,t){":"===e?r.test(t)?(c=2,l=new Bte(nB(nB({},l),{hasMailtoPrefix:!0}))):_():a[e]===t||(r.test(t)?c=2:"."===t?c=3:"@"===t?c=4:_())}function p(e){"."===e?c=3:"@"===e?c=4:r.test(e)||_()}function g(e){"."===e||"@"===e?_():r.test(e)?c=2:_()}function m(e){Rte.test(e)?c=5:_()}function v(e){"."===e?c=7:"-"===e?c=6:Rte.test(e)||x()}function y(e){"-"===e||"."===e?x():Rte.test(e)?c=5:x()}function b(e){"."===e||"-"===e?x():Rte.test(e)?(c=5,l=new Bte(nB(nB({},l),{hasDomainDot:!0}))):x()}function w(e){void 0===e&&(e=2),c=e,l=new Bte({idx:u})}function _(){c=0,l=s}function x(){if(l.hasDomainDot){var r=e.slice(l.idx,u);/[-.]$/.test(r)&&(r=r.slice(0,-1));var o=l.hasMailtoPrefix?r.slice("mailto:".length):r;(function(e){var t=(e.split(".").pop()||"").toLowerCase();return n.test(t)})(o)&&i.push(new fte({tagBuilder:t,matchedText:r,offset:l.idx,email:o}))}_()}},t}(vte),Bte=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.hasMailtoPrefix=!!e.hasMailtoPrefix,this.hasDomainDot=!!e.hasDomainDot},Ute=function(){function e(){}return e.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},e.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},e.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},e.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),r=t&&t[0].toLowerCase();return"javascript:"!==r&&"vbscript:"!==r},e.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},e.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t)&&(!this.hasFullProtocolRegex.test(t)&&!this.hasWordCharAfterProtocolRegex.test(e))},e.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,e.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,e.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+Ete+"]"),e.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,e}(),Fte=(cte=new RegExp("[/?#](?:["+Pte+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+Pte+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,Mte(2),")","|","(","(//)?",/(?:www\.)/.source,Mte(6),")","|","(","(//)?",Mte(10)+"\\.",Nte.source,"(?![-"+Ate+"])",")",")","(?::[0-9]+)?","(?:"+cte.source+")?"].join(""),"gi")),Hte=new RegExp("["+Pte+"]"),zte=function(e){function t(t){var r=e.call(this,t)||this;return r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.matcherRegex=Fte,r.wordCharRegExp=Hte,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return eB(t,e),t.prototype.parseMatches=function(e){for(var t,r=this.matcherRegex,n=this.stripPrefix,i=this.stripTrailingSlash,o=this.decodePercentEncoding,s=this.tagBuilder,a=[],u=function(){var r=t[0],u=t[1],l=t[4],h=t[5],f=t[9],d=t.index,p=h||f,g=e.charAt(d-1);if(!Ute.isValid(r,u))return"continue";if(d>0&&"@"===g)return"continue";if(d>0&&p&&c.wordCharRegExp.test(g))return"continue";if(/\?$/.test(r)&&(r=r.substr(0,r.length-1)),c.matchHasUnbalancedClosingParen(r))r=r.substr(0,r.length-1);else{var m=c.matchHasInvalidCharAfterTld(r,u);m>-1&&(r=r.substr(0,m))}var v=["http://","https://"].find((function(e){return!!u&&-1!==u.indexOf(e)}));if(v){var y=r.indexOf(v);r=r.substr(y),u=u.substr(y),d+=y}var b=u?"scheme":l?"www":"tld",w=!!u;a.push(new mte({tagBuilder:s,matchedText:r,offset:d,urlMatchType:b,url:r,protocolUrlMatch:w,protocolRelativeMatch:!!p,stripPrefix:n,stripTrailingSlash:i,decodePercentEncoding:o}))},c=this;null!==(t=r.exec(e));)u();return a},t.prototype.matchHasUnbalancedClosingParen=function(e){var t,r=e.charAt(e.length-1);if(")"===r)t="(";else if("]"===r)t="[";else{if("}"!==r)return!1;t="{"}for(var n=0,i=0,o=e.length-1;i<o;i++){var s=e.charAt(i);s===t?n++:s===r&&(n=Math.max(n-1,0))}return 0===n},t.prototype.matchHasInvalidCharAfterTld=function(e,t){if(!e)return-1;var r=0;t&&(r=e.indexOf(":"),e=e.slice(r));var n=new RegExp("^((.?//)?[-."+Pte+"]*[-"+Pte+"]\\.[-"+Pte+"]+)").exec(e);return null===n?-1:(r+=n[1].length,e=e.slice(n[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(e)?r:-1)},t}(vte),Vte=new RegExp("#[_"+Pte+"]{1,139}(?![_"+Pte+"])","g"),qte=new RegExp("[^"+Pte+"]"),Kte=function(e){function t(t){var r=e.call(this,t)||this;return r.serviceName="twitter",r.matcherRegex=Vte,r.nonWordCharRegex=qte,r.serviceName=t.serviceName,r}return eB(t,e),t.prototype.parseMatches=function(e){for(var t,r=this.matcherRegex,n=this.nonWordCharRegex,i=this.serviceName,o=this.tagBuilder,s=[];null!==(t=r.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||n.test(u)){var c=t[0],l=t[0].slice(1);s.push(new dte({tagBuilder:o,matchedText:c,offset:a,serviceName:i,hashtag:l}))}}return s},t}(vte),$te=new RegExp(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source+"|"+/(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source,"g"),Wte=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.matcherRegex=$te,t}return eB(t,e),t.prototype.parseMatches=function(e){for(var t,r=this.matcherRegex,n=this.tagBuilder,i=[];null!==(t=r.exec(e));){var o=t[0],s=o.replace(/[^0-9,;#]/g,""),a=!(!t[1]&&!t[2]),u=0==t.index?"":e.substr(t.index-1,1),c=e.substr(t.index+o.length,1),l=!u.match(/\d/)&&!c.match(/\d/);this.testMatch(t[3])&&this.testMatch(o)&&l&&i.push(new gte({tagBuilder:n,matchedText:o,offset:t.index,number:s,plusSign:a}))}return i},t.prototype.testMatch=function(e){return wte.test(e)},t}(vte),Jte=new RegExp("@[_"+Pte+"]{1,50}(?![_"+Pte+"])","g"),Gte=new RegExp("@[_."+Pte+"]{1,30}(?![_"+Pte+"])","g"),Xte=new RegExp("@[-_."+Pte+"]{1,50}(?![-_"+Pte+"])","g"),Yte=new RegExp("[^"+Pte+"]"),Qte=function(e){function t(t){var r=e.call(this,t)||this;return r.serviceName="twitter",r.matcherRegexes={twitter:Jte,instagram:Gte,soundcloud:Xte},r.nonWordCharRegex=Yte,r.serviceName=t.serviceName,r}return eB(t,e),t.prototype.parseMatches=function(e){var t,r=this.serviceName,n=this.matcherRegexes[this.serviceName],i=this.nonWordCharRegex,o=this.tagBuilder,s=[];if(!n)return s;for(;null!==(t=n.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||i.test(u)){var c=t[0].replace(/\.+$/g,""),l=c.slice(1);s.push(new pte({tagBuilder:o,matchedText:c,offset:a,serviceName:r,mention:l}))}}return s},t}(vte);function Zte(e,t){for(var r,n=t.onOpenTag,i=t.onCloseTag,o=t.onText,s=t.onComment,a=t.onDoctype,u=new ere,c=0,l=e.length,h=0,f=0,d=u;c<l;){var p=e.charAt(c);switch(h){case 0:g(p);break;case 1:m(p);break;case 2:y(p);break;case 3:v(p);break;case 4:b(p);break;case 5:w(p);break;case 6:_(p);break;case 7:x(p);break;case 8:S(p);break;case 9:E(p);break;case 10:k(p);break;case 11:I(p);break;case 12:A(p);break;case 13:P();break;case 14:T(p);break;case 15:O(p);break;case 16:C(p);break;case 17:M(p);break;case 18:R(p);break;case 19:N(p);break;case 20:L(p);break;default:ate(h)}c++}function g(e){"<"===e&&D()}function m(e){"!"===e?h=13:"/"===e?(h=2,d=new ere(nB(nB({},d),{isClosing:!0}))):"<"===e?D():yte.test(e)?(h=3,d=new ere(nB(nB({},d),{isOpening:!0}))):(h=0,d=u)}function v(e){_te.test(e)?(d=new ere(nB(nB({},d),{name:U()})),h=4):"<"===e?D():"/"===e?(d=new ere(nB(nB({},d),{name:U()})),h=12):">"===e?(d=new ere(nB(nB({},d),{name:U()})),B()):yte.test(e)||bte.test(e)||":"===e||j()}function y(e){">"===e?j():yte.test(e)?h=3:j()}function b(e){_te.test(e)||("/"===e?h=12:">"===e?B():"<"===e?D():"="===e||xte.test(e)||Ste.test(e)?j():h=5)}function w(e){_te.test(e)?h=6:"/"===e?h=12:"="===e?h=7:">"===e?B():"<"===e?D():xte.test(e)&&j()}function _(e){_te.test(e)||("/"===e?h=12:"="===e?h=7:">"===e?B():"<"===e?D():xte.test(e)?j():h=5)}function x(e){_te.test(e)||('"'===e?h=8:"'"===e?h=9:/[>=`]/.test(e)?j():"<"===e?D():h=10)}function S(e){'"'===e&&(h=11)}function E(e){"'"===e&&(h=11)}function k(e){_te.test(e)?h=4:">"===e?B():"<"===e&&D()}function I(e){_te.test(e)?h=4:"/"===e?h=12:">"===e?B():"<"===e?D():(h=4,c--)}function A(e){">"===e?(d=new ere(nB(nB({},d),{isClosing:!0})),B()):h=4}function P(t){"--"===e.substr(c,2)?(c+=2,d=new ere(nB(nB({},d),{type:"comment"})),h=14):"DOCTYPE"===e.substr(c,7).toUpperCase()?(c+=7,d=new ere(nB(nB({},d),{type:"doctype"})),h=20):j()}function T(e){"-"===e?h=15:">"===e?j():h=16}function O(e){"-"===e?h=18:">"===e?j():h=16}function C(e){"-"===e&&(h=17)}function M(e){h="-"===e?18:16}function R(e){">"===e?B():"!"===e?h=19:"-"===e||(h=16)}function N(e){"-"===e?h=17:">"===e?B():h=16}function L(e){">"===e?B():"<"===e&&D()}function j(){h=0,d=u}function D(){h=1,d=new ere({idx:c})}function B(){var t=e.slice(f,d.idx);t&&o(t,f),"comment"===d.type?s(d.idx):"doctype"===d.type?a(d.idx):(d.isOpening&&n(d.name,d.idx),d.isClosing&&i(d.name,d.idx)),j(),f=c+1}function U(){var t=d.idx+(d.isClosing?2:1);return e.slice(t,c).toLowerCase()}f<c&&(r=e.slice(f,c),o(r,f),f=c+1)}var ere=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.type=e.type||"tag",this.name=e.name||"",this.isOpening=!!e.isOpening,this.isClosing=!!e.isClosing},tre=function(){function e(t){void 0===t&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(t.urls),this.email="boolean"==typeof t.email?t.email:this.email,this.phone="boolean"==typeof t.phone?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow="boolean"==typeof t.newWindow?t.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(t.stripPrefix),this.stripTrailingSlash="boolean"==typeof t.stripTrailingSlash?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding="boolean"==typeof t.decodePercentEncoding?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var r=this.mention;if(!1!==r&&"twitter"!==r&&"instagram"!==r&&"soundcloud"!==r)throw new Error("invalid `mention` cfg - see docs");var n=this.hashtag;if(!1!==n&&"twitter"!==n&&"facebook"!==n&&"instagram"!==n)throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,r){return new e(r).link(t)},e.parse=function(t,r){return new e(r).parse(t)},e.prototype.normalizeUrlsCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},e.prototype.normalizeStripPrefixCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{scheme:e,www:e}:{scheme:"boolean"!=typeof e.scheme||e.scheme,www:"boolean"!=typeof e.www||e.www}},e.prototype.normalizeTruncateCfg=function(e){return"number"==typeof e?{length:e,location:"end"}:function(e,t){for(var r in t)t.hasOwnProperty(r)&&void 0===e[r]&&(e[r]=t[r]);return e}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},e.prototype.parse=function(e){var t=this,r=["a","style","script"],n=0,i=[];return Zte(e,{onOpenTag:function(e){r.indexOf(e)>=0&&n++},onText:function(e,r){if(0===n){var o=function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var r,n=[],i=0;r=t.exec(e);)n.push(e.substring(i,r.index)),n.push(r[0]),i=r.index+r[0].length;return n.push(e.substring(i)),n}(e,/( | |<|<|>|>|"|"|')/gi),s=r;o.forEach((function(e,r){if(r%2==0){var n=t.parseText(e,s);i.push.apply(i,n)}s+=e.length}))}},onCloseTag:function(e){r.indexOf(e)>=0&&(n=Math.max(n-1,0))},onComment:function(e){},onDoctype:function(e){}}),i=this.compactMatches(i),i=this.removeUnwantedMatches(i)},e.prototype.compactMatches=function(e){e.sort((function(e,t){return e.getOffset()-t.getOffset()}));for(var t=0;t<e.length-1;t++){var r=e[t],n=r.getOffset(),i=r.getMatchedText().length,o=n+i;if(t+1<e.length){if(e[t+1].getOffset()===n){var s=e[t+1].getMatchedText().length>i?t:t+1;e.splice(s,1);continue}e[t+1].getOffset()<o&&e.splice(t+1,1)}}return e},e.prototype.removeUnwantedMatches=function(e){return this.hashtag||ste(e,(function(e){return"hashtag"===e.getType()})),this.email||ste(e,(function(e){return"email"===e.getType()})),this.phone||ste(e,(function(e){return"phone"===e.getType()})),this.mention||ste(e,(function(e){return"mention"===e.getType()})),this.urls.schemeMatches||ste(e,(function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()})),this.urls.wwwMatches||ste(e,(function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()})),this.urls.tldMatches||ste(e,(function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()})),e},e.prototype.parseText=function(e,t){void 0===t&&(t=0),t=t||0;for(var r=this.getMatchers(),n=[],i=0,o=r.length;i<o;i++){for(var s=r[i].parseMatches(e),a=0,u=s.length;a<u;a++)s[a].setOffset(t+s[a].getOffset());n.push.apply(n,s)}return n},e.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"<").replace(/>/g,">"));for(var t=this.parse(e),r=[],n=0,i=0,o=t.length;i<o;i++){var s=t[i];r.push(e.substring(n,s.getOffset())),r.push(this.createMatchReturnVal(s)),n=s.getOffset()+s.getMatchedText().length}return r.push(e.substring(n)),r.join("")},e.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof ute?t.toAnchorString():e.buildTag().toAnchorString()},e.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new Kte({tagBuilder:e,serviceName:this.hashtag}),new Dte({tagBuilder:e}),new Wte({tagBuilder:e}),new Qte({tagBuilder:e,serviceName:this.mention}),new zte({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},e.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new lte({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},e.version="3.14.3",e.AnchorTagBuilder=lte,e.HtmlTag=ute,e.matcher={Email:Dte,Hashtag:Kte,Matcher:vte,Mention:Qte,Phone:Wte,Url:zte},e.match={Email:fte,Hashtag:dte,Match:hte,Mention:pte,Phone:gte,Url:mte},e}();function rre(e){return tre.link(e,{stripPrefix:!1,email:!1,phone:!1})}const nre=A7((function({clickableUrls:e,hasCertificateDefinition:t,displayHTML:r}){return t?he`
|
|
669
|
+
${Zee}
|
|
670
|
+
${r?function(e,t){const r=["buv-c-full-certificate","qa-fullscreen-certificate"];R8.certificates.displayHtmlHasNoWidthConstraint(e)&&r.push("buv-c-certificate--fixed-width");const n=t?rre(e):e;return he`<section class$=${r.join(" ")}>${Qee(n)}</section>`}(r,e):he`<buv-full-certificate-v1></buv-full-certificate-v1>`}
|
|
671
671
|
<div class='buv-c-full-certificate__details'>
|
|
672
672
|
<buv-certificate-details class='buv-c-full-certificate__details-list'></buv-certificate-details>
|
|
673
673
|
<buv-final-verification-step class='buv-c-fullscreen-certificate__verification-status' isVisible hideLink standalone>
|
|
674
|
-
<buv-verify-button type='link'>${
|
|
674
|
+
<buv-verify-button type='link'>${G9("text.verifyAgain")}</buv-verify-button>
|
|
675
675
|
</buv-final-verification-step>
|
|
676
676
|
</div>
|
|
677
|
-
`:null}),{mapStateToProps:e=>({hasCertificateDefinition:!!
|
|
678
|
-
</style>`;const
|
|
679
|
-
${
|
|
677
|
+
`:null}),{mapStateToProps:e=>({hasCertificateDefinition:!!Y9(e),displayHTML:i7(e),clickableUrls:V7(e)})});window.customElements.define("buv-full-certificate",nre);var ire=he`<style>.buv-o-text-11{font-size:11px}.buv-o-text-12{font-size:12px}.buv-o-text-13{font-size:13px}.buv-o-text-15{font-size:15px;line-height:20px}.buv-c-certificate--fixed-width{max-width:460px;min-width:0;margin:0 auto}.buv-c-fullscreen-certificate{z-index:200;position:fixed;top:0;left:0;background-color:#fff;width:100vw;height:100vh;overflow:auto;box-sizing:border-box}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate{padding-top:170px}}.buv-c-fullscreen-certificate-header{box-shadow:0 1px 5px rgba(0,0,0,0.15);width:100%;background-color:#fff}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate-header{position:fixed;top:0;z-index:10}}.buv-c-fullscreen-certificate-header__content{max-width:1440px;margin:0 auto;padding:20px;display:flex;align-items:center;position:relative;box-sizing:border-box}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate-header__content{flex-direction:column;justify-content:left;align-items:unset}}.buv-c-fullscreen-certificate__title{margin:0 30px 0 0}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__title{margin-bottom:10px}}.buv-c-fullscreen-certificate__close{top:27px;right:20px}.buv-c-fullscreen-certificate__content{padding:20px;display:flex;max-width:1440px;margin:20px auto 0}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__content{flex-direction:column-reverse;margin-top:0}}.buv-c-fullscreen-certificate__details{display:flex;flex-grow:1;flex-direction:column;max-width:280px;min-width:220px;margin-right:20px}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__details{max-width:100vw;margin:20px 0 0}}.buv-c-fullscreen-certificate__verification-status{margin-bottom:15px}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__verification-status{position:absolute;top:90px;width:calc(100% - 40px);margin:0}}.buv-c-fullscreen-certificate__details-item{margin-top:5px}.buv-c-fullscreen-certificate__separator{margin-top:30px;padding-top:30px;border-top:1px solid #f1f2f3}.buv-c-fullscreen-certificate__certificate{box-shadow:0 1px 5px rgba(0,0,0,0.15);padding:20px;background-color:#fff;font-family:serif;text-align:center;color:#49555f;font-size:12px;word-wrap:break-word;min-height:calc(100vh - 145px);box-sizing:border-box;margin:0 auto;min-width:600px;line-height:initial}@media only screen and (max-width: 750px){.buv-c-fullscreen-certificate__certificate{min-width:unset;width:100%;overflow:auto}}.buv-c-fullscreen-certificate__verify-other{margin-top:20px}
|
|
678
|
+
</style>`;const ore=A7((function({clickableUrls:e,hasCertificateDefinition:t,recipientName:r,displayHTML:n,onClose:i}){if(!t)return null;const o=["buv-c-fullscreen-certificate__certificate","qa-fullscreen-certificate"];return n&&R8.certificates.displayHtmlHasNoWidthConstraint(n)&&o.push("buv-c-certificate--fixed-width"),he`
|
|
679
|
+
${ire}
|
|
680
680
|
<section class='buv-c-fullscreen-certificate'>
|
|
681
681
|
<header class='buv-c-fullscreen-certificate-header'>
|
|
682
682
|
<div class='buv-c-fullscreen-certificate-header__content'>
|
|
683
683
|
<h1 class='buv-c-fullscreen-certificate__title'>${r}</h1>
|
|
684
|
-
${
|
|
684
|
+
${pee({onClick:i,className:"buv-c-fullscreen-certificate__close"})}
|
|
685
685
|
</div>
|
|
686
686
|
</header>
|
|
687
687
|
<section class='buv-c-fullscreen-certificate__content'>
|
|
688
688
|
<div class='buv-c-fullscreen-certificate__details'>
|
|
689
689
|
<buv-final-verification-step class='buv-c-fullscreen-certificate__verification-status' isVisible hideLink standalone>
|
|
690
|
-
<buv-verify-button type='link'>${
|
|
690
|
+
<buv-verify-button type='link'>${G9("text.verifyAgain")}</buv-verify-button>
|
|
691
691
|
</buv-final-verification-step>
|
|
692
692
|
<buv-certificate-details direction='column' hideRecipientName></buv-certificate-details>
|
|
693
693
|
<buv-metadata class='buv-c-fullscreen-certificate__details-item buv-c-fullscreen-certificate__separator' display='plaintext'></buv-metadata>
|
|
694
694
|
<buv-download-link class='buv-c-fullscreen-certificate__details-item' display='plaintext'></buv-download-link>
|
|
695
695
|
<buv-social-share class='buv-c-fullscreen-certificate__details-item' display='plaintext'></buv-social-share>
|
|
696
|
-
${
|
|
696
|
+
${Mee({className:"buv-c-fullscreen-certificate__separator",showMotto:!0,logoSize:"medium"})}
|
|
697
697
|
<buv-verify-other-certificate class='buv-c-fullscreen-certificate__verify-other'></buv-verify-other-certificate>
|
|
698
698
|
</div>
|
|
699
699
|
<div class$=${o.join(" ")}>
|
|
700
|
-
${n?function(e,t){const r=t?
|
|
700
|
+
${n?function(e,t){const r=t?rre(e):e;return he`${Qee(r)}`}(n,e):he`<buv-full-certificate-v1></buv-full-certificate-v1>`}
|
|
701
701
|
</div>
|
|
702
702
|
</section>
|
|
703
703
|
</section>
|
|
704
|
-
`}),{mapDispatchToProps:{onClose:
|
|
705
|
-
${
|
|
704
|
+
`}),{mapDispatchToProps:{onClose:Aee},mapStateToProps:e=>({recipientName:e7(e),hasCertificateDefinition:!!Y9(e),displayHTML:i7(e),clickableUrls:V7(e)})});window.customElements.define("buv-fullscreen-certificate",ore);class sre extends me{constructor(){super(),this.hasRenderedOnce=!1}static get properties(){return{onLoad:Function,errorMessage:String,hasCertificate:Boolean,...Z7}}_firstRendered(){this.onLoad(this._props),this.hasRenderedOnce=!0}_propertiesChanged(e,t,r){this._props=e,super._propertiesChanged(e,t,r),t.src!==r.src&&this.hasRenderedOnce&&this.onLoad({src:t.src}),t.explorerAPIs&&!r.explorerAPIs&&this.onLoad({explorerAPIs:t.explorerAPIs})}renderCertificate(e){switch(e.displayMode){case S7:return he`<buv-full-certificate></buv-full-certificate>`;case"fullscreen":return he`<buv-fullscreen-certificate></buv-fullscreen-certificate>`;default:return he`<buv-card-certificate></buv-card-certificate>`}}_render(e){const t=e.hasCertificate?"buv-c-verifier-body buv-c-verifier-body--padded":"";return he`
|
|
705
|
+
${Gee}
|
|
706
706
|
<section class='buv-c-verifier-main'>
|
|
707
707
|
<buv-drag-and-drop>
|
|
708
708
|
<div class='buv-c-verifier-layout'>
|
|
709
709
|
<section class$='${t}'>
|
|
710
|
-
${
|
|
710
|
+
${Dee(e.errorMessage,!0)}
|
|
711
711
|
<buv-certificate-input></buv-certificate-input>
|
|
712
712
|
<buv-action-menu></buv-action-menu>
|
|
713
713
|
${this.renderCertificate(e)}
|
|
@@ -717,7 +717,7 @@ const Zee=e=>(e=>(e.__litDirective=!0,e))((t=>{const r=document.createElement("t
|
|
|
717
717
|
</div>
|
|
718
718
|
</buv-drag-and-drop>
|
|
719
719
|
</section>
|
|
720
|
-
`}}function
|
|
720
|
+
`}}function are(e){return e.errorMessage}window.customElements.define("buv-raw",sre);const ure={onLoad:function(e={}){return function(t){const r=function(e){return Object.keys(Z7).reduce(((t,r)=>(e[r]&&(t[r]=e[r]),t)),{})}(e),{src:n,locale:i}=r;t({type:Ge,payload:{options:r}}),R8.certificates.isPathToCertificateValidURI(n)?t(G7(n)):function(e){try{return JSON.parse(e),!0}catch(e){return!1}}(n)&&t(J7(JSON.parse(n))),tee(i)}}},cre=A7((function(e={}){return he`<buv-raw
|
|
721
721
|
src='${e.src}'
|
|
722
722
|
onLoad='${e.onLoad}'
|
|
723
723
|
errorMessage='${e.errorMessage}'
|
|
@@ -733,4 +733,4 @@ const Zee=e=>(e=>(e.__litDirective=!0,e))((t=>{const r=document.createElement("t
|
|
|
733
733
|
locale='${e.locale}'
|
|
734
734
|
explorerAPIs='${e.explorerAPIs}'
|
|
735
735
|
didResolverUrl='${e["did-resolver-url"]}'
|
|
736
|
-
></buv-raw>`}),{mapDispatchToProps:
|
|
736
|
+
></buv-raw>`}),{mapDispatchToProps:ure,mapStateToProps:e=>({errorMessage:are(e),hasCertificate:!!Y9(e)}),ownProps:Object.assign(Object.assign({},sre.properties),Q7)});window.customElements.define("blockcerts-verifier",cre)}();
|