From 418cb0c6b7bbe65c544c77d093560f5dd69ca6f6 Mon Sep 17 00:00:00 2001 From: Leo <5376265+leoherzog@users.noreply.github.com> Date: Mon, 17 Apr 2023 18:46:52 +0000 Subject: [PATCH] Update Dependencies --- bin/bundle.js | 13 ++++++++----- bin/bundle.min.js | 10 +++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/bin/bundle.js b/bin/bundle.js index dc691c2..aea264a 100644 --- a/bin/bundle.js +++ b/bin/bundle.js @@ -1,7 +1,7 @@ (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i0&&c(a.width)/e.offsetWidth||1,l=e.offsetHeight>0&&c(a.height)/e.offsetHeight||1);var p=(n(e)?t(e):window).visualViewport,d=!u()&&s,f=(a.left+(d&&p?p.offsetLeft:0))/o,h=(a.top+(d&&p?p.offsetTop:0))/l,m=a.width/o,b=a.height/l;return{width:m,height:b,top:h,right:f+m,bottom:h+b,left:f,x:f,y:h}}function d(e){var i=t(e);return{scrollLeft:i.pageXOffset,scrollTop:i.pageYOffset}}function f(e){return e?(e.nodeName||"").toLowerCase():null}function h(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function m(e){return p(h(e)).left+d(e).scrollLeft}function b(e){return t(e).getComputedStyle(e)}function v(e){var t=b(e),i=t.overflow,n=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function g(e,i,n){void 0===n&&(n=!1);var s,a,o=r(i),l=r(i)&&function(e){var t=e.getBoundingClientRect(),i=c(t.width)/e.offsetWidth||1,n=c(t.height)/e.offsetHeight||1;return 1!==i||1!==n}(i),u=h(i),b=p(e,l,n),g={scrollLeft:0,scrollTop:0},y={x:0,y:0};return(o||!o&&!n)&&(("body"!==f(i)||v(u))&&(g=(s=i)!==t(s)&&r(s)?{scrollLeft:(a=s).scrollLeft,scrollTop:a.scrollTop}:d(s)),r(i)?((y=p(i,!0)).x+=i.clientLeft,y.y+=i.clientTop):u&&(y.x=m(u))),{x:b.left+g.scrollLeft-y.x,y:b.top+g.scrollTop-y.y,width:b.width,height:b.height}}function y(e){var t=p(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function x(e){return"html"===f(e)?e:e.assignedSlot||e.parentNode||(s(e)?e.host:null)||h(e)}function _(e){return["html","body","#document"].indexOf(f(e))>=0?e.ownerDocument.body:r(e)&&v(e)?e:_(x(e))}function w(e,i){var n;void 0===i&&(i=[]);var r=_(e),s=r===(null==(n=e.ownerDocument)?void 0:n.body),a=t(r),o=s?[a].concat(a.visualViewport||[],v(r)?r:[]):r,c=i.concat(o);return s?c:c.concat(w(x(o)))}function k(e){return["table","td","th"].indexOf(f(e))>=0}function E(e){return r(e)&&"fixed"!==b(e).position?e.offsetParent:null}function S(e){for(var i=t(e),n=E(e);n&&k(n)&&"static"===b(n).position;)n=E(n);return n&&("html"===f(n)||"body"===f(n)&&"static"===b(n).position)?i:n||function(e){var t=/firefox/i.test(l());if(/Trident/i.test(l())&&r(e)&&"fixed"===b(e).position)return null;var i=x(e);for(s(i)&&(i=i.host);r(i)&&["html","body"].indexOf(f(i))<0;){var n=b(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(e)||i}var M="top",A="bottom",j="right",I="left",T="auto",C=[M,A,j,I],B="start",R="end",L="clippingParents",O="viewport",P="popper",U="reference",q=C.reduce((function(e,t){return e.concat([t+"-"+B,t+"-"+R])}),[]),N=[].concat(C,[T]).reduce((function(e,t){return e.concat([t,t+"-"+B,t+"-"+R])}),[]),D=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function z(e){var t=new Map,i=new Set,n=[];function r(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!i.has(e)){var n=t.get(e);n&&r(n)}})),n.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){i.has(e.name)||r(e)})),n}function H(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n=0&&r(e)?S(e):e;return n(i)?t.filter((function(e){return n(e)&&$(e,i)&&"body"!==f(e)})):[]}(e):[].concat(t),l=[].concat(c,[i]),u=l[0],p=l.reduce((function(t,i){var n=X(e,i,s);return t.top=a(n.top,t.top),t.right=o(n.right,t.right),t.bottom=o(n.bottom,t.bottom),t.left=a(n.left,t.left),t}),X(e,u,s));return p.width=p.right-p.left,p.height=p.bottom-p.top,p.x=p.left,p.y=p.top,p}function Z(e){return e.split("-")[1]}function J(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Q(e){var t,i=e.reference,n=e.element,r=e.placement,s=r?K(r):null,a=r?Z(r):null,o=i.x+i.width/2-n.width/2,c=i.y+i.height/2-n.height/2;switch(s){case M:t={x:o,y:i.y-n.height};break;case A:t={x:o,y:i.y+i.height};break;case j:t={x:i.x+i.width,y:c};break;case I:t={x:i.x-n.width,y:c};break;default:t={x:i.x,y:i.y}}var l=s?J(s):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case B:t[l]=t[l]-(i[u]/2-n[u]/2);break;case R:t[l]=t[l]+(i[u]/2-n[u]/2)}}return t}function ee(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function te(e,t){return t.reduce((function(t,i){return t[i]=e,t}),{})}function ie(e,t){void 0===t&&(t={});var i=t,r=i.placement,s=void 0===r?e.placement:r,a=i.strategy,o=void 0===a?e.strategy:a,c=i.boundary,l=void 0===c?L:c,u=i.rootBoundary,d=void 0===u?O:u,f=i.elementContext,m=void 0===f?P:f,b=i.altBoundary,v=void 0!==b&&b,g=i.padding,y=void 0===g?0:g,x=ee("number"!=typeof y?y:te(y,C)),_=m===P?U:P,w=e.rects.popper,k=e.elements[v?_:m],E=Y(n(k)?k:k.contextElement||h(e.elements.popper),l,d,o),S=p(e.elements.reference),I=Q({reference:S,element:w,strategy:"absolute",placement:s}),T=G(Object.assign({},w,I)),B=m===P?T:S,R={top:E.top-B.top+x.top,bottom:B.bottom-E.bottom+x.bottom,left:E.left-B.left+x.left,right:B.right-E.right+x.right},q=e.modifiersData.offset;if(m===P&&q){var N=q[s];Object.keys(R).forEach((function(e){var t=[j,A].indexOf(e)>=0?1:-1,i=[M,A].indexOf(e)>=0?"y":"x";R[e]+=N[i]*t}))}return R}var ne="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",re="Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.",se={placement:"bottom",modifiers:[],strategy:"absolute"};function ae(){for(var e=arguments.length,t=new Array(e),i=0;i100){console.error(re);break}if(!0!==l.reset){var a=l.orderedModifiers[s],o=a.fn,c=a.options,u=void 0===c?{}:c,f=a.name;"function"==typeof o&&(l=o({state:l,options:u,name:f,instance:d})||l)}else l.reset=!1,s=-1}}else"production"!==e.env.NODE_ENV&&console.error(ne)}},update:(a=function(){return new Promise((function(e){d.forceUpdate(),e(l)}))},function(){return c||(c=new Promise((function(e){Promise.resolve().then((function(){c=void 0,e(a())}))}))),c}),destroy:function(){f(),p=!0}};if(!ae(t,i))return"production"!==e.env.NODE_ENV&&console.error(ne),d;function f(){u.forEach((function(e){return e()})),u=[]}return d.setOptions(r).then((function(e){!p&&r.onFirstUpdate&&r.onFirstUpdate(e)})),d}}var ce={passive:!0};var le={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var i=e.state,n=e.instance,r=e.options,s=r.scroll,a=void 0===s||s,o=r.resize,c=void 0===o||o,l=t(i.elements.popper),u=[].concat(i.scrollParents.reference,i.scrollParents.popper);return a&&u.forEach((function(e){e.addEventListener("scroll",n.update,ce)})),c&&l.addEventListener("resize",n.update,ce),function(){a&&u.forEach((function(e){e.removeEventListener("scroll",n.update,ce)})),c&&l.removeEventListener("resize",n.update,ce)}},data:{}};var ue={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=Q({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},pe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function de(e){var i,n=e.popper,r=e.popperRect,s=e.placement,a=e.variation,o=e.offsets,l=e.position,u=e.gpuAcceleration,p=e.adaptive,d=e.roundOffsets,f=e.isFixed,m=o.x,v=void 0===m?0:m,g=o.y,y=void 0===g?0:g,x="function"==typeof d?d({x:v,y:y}):{x:v,y:y};v=x.x,y=x.y;var _=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),k=I,E=M,T=window;if(p){var C=S(n),B="clientHeight",L="clientWidth";if(C===t(n)&&"static"!==b(C=h(n)).position&&"absolute"===l&&(B="scrollHeight",L="scrollWidth"),s===M||(s===I||s===j)&&a===R)E=A,y-=(f&&C===T&&T.visualViewport?T.visualViewport.height:C[B])-r.height,y*=u?1:-1;if(s===I||(s===M||s===A)&&a===R)k=j,v-=(f&&C===T&&T.visualViewport?T.visualViewport.width:C[L])-r.width,v*=u?1:-1}var O,P=Object.assign({position:l},p&&pe),U=!0===d?function(e){var t=e.x,i=e.y,n=window.devicePixelRatio||1;return{x:c(t*n)/n||0,y:c(i*n)/n||0}}({x:v,y:y}):{x:v,y:y};return v=U.x,y=U.y,u?Object.assign({},P,((O={})[E]=w?"0":"",O[k]=_?"0":"",O.transform=(T.devicePixelRatio||1)<=1?"translate("+v+"px, "+y+"px)":"translate3d("+v+"px, "+y+"px, 0)",O)):Object.assign({},P,((i={})[E]=w?y+"px":"",i[k]=_?v+"px":"",i.transform="",i))}var fe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var i=t.state,n=t.options,r=n.gpuAcceleration,s=void 0===r||r,a=n.adaptive,o=void 0===a||a,c=n.roundOffsets,l=void 0===c||c;if("production"!==e.env.NODE_ENV){var u=b(i.elements.popper).transitionProperty||"";o&&["transform","top","right","bottom","left"].some((function(e){return u.indexOf(e)>=0}))&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',"\n\n",'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.","\n\n","We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var p={placement:K(i.placement),variation:Z(i.placement),popper:i.elements.popper,popperRect:i.rects.popper,gpuAcceleration:s,isFixed:"fixed"===i.options.strategy};null!=i.modifiersData.popperOffsets&&(i.styles.popper=Object.assign({},i.styles.popper,de(Object.assign({},p,{offsets:i.modifiersData.popperOffsets,position:i.options.strategy,adaptive:o,roundOffsets:l})))),null!=i.modifiersData.arrow&&(i.styles.arrow=Object.assign({},i.styles.arrow,de(Object.assign({},p,{offsets:i.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),i.attributes.popper=Object.assign({},i.attributes.popper,{"data-popper-placement":i.placement})},data:{}};var he={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var i=t.styles[e]||{},n=t.attributes[e]||{},s=t.elements[e];r(s)&&f(s)&&(Object.assign(s.style,i),Object.keys(n).forEach((function(e){var t=n[e];!1===t?s.removeAttribute(e):s.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach((function(e){var n=t.elements[e],s=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce((function(e,t){return e[t]="",e}),{});r(n)&&f(n)&&(Object.assign(n.style,a),Object.keys(s).forEach((function(e){n.removeAttribute(e)})))}))}},requires:["computeStyles"]};var me={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,n=e.name,r=i.offset,s=void 0===r?[0,0]:r,a=N.reduce((function(e,i){return e[i]=function(e,t,i){var n=K(e),r=[I,M].indexOf(n)>=0?-1:1,s="function"==typeof i?i(Object.assign({},t,{placement:e})):i,a=s[0],o=s[1];return a=a||0,o=(o||0)*r,[I,j].indexOf(n)>=0?{x:o,y:a}:{x:a,y:o}}(i,t.rects,s),e}),{}),o=a[t.placement],c=o.x,l=o.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[n]=a}},be={left:"right",right:"left",bottom:"top",top:"bottom"};function ve(e){return e.replace(/left|right|bottom|top/g,(function(e){return be[e]}))}var ge={start:"end",end:"start"};function ye(e){return e.replace(/start|end/g,(function(e){return ge[e]}))}function xe(t,i){void 0===i&&(i={});var n=i,r=n.placement,s=n.boundary,a=n.rootBoundary,o=n.padding,c=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?N:l,p=Z(r),d=p?c?q:q.filter((function(e){return Z(e)===p})):C,f=d.filter((function(e){return u.indexOf(e)>=0}));0===f.length&&(f=d,"production"!==e.env.NODE_ENV&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var h=f.reduce((function(e,i){return e[i]=ie(t,{placement:i,boundary:s,rootBoundary:a,padding:o})[K(i)],e}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var _e={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var r=i.mainAxis,s=void 0===r||r,a=i.altAxis,o=void 0===a||a,c=i.fallbackPlacements,l=i.padding,u=i.boundary,p=i.rootBoundary,d=i.altBoundary,f=i.flipVariations,h=void 0===f||f,m=i.allowedAutoPlacements,b=t.options.placement,v=K(b),g=c||(v===b||!h?[ve(b)]:function(e){if(K(e)===T)return[];var t=ve(e);return[ye(e),t,ye(t)]}(b)),y=[b].concat(g).reduce((function(e,i){return e.concat(K(i)===T?xe(t,{placement:i,boundary:u,rootBoundary:p,padding:l,flipVariations:h,allowedAutoPlacements:m}):i)}),[]),x=t.rects.reference,_=t.rects.popper,w=new Map,k=!0,E=y[0],S=0;S=0,P=O?"width":"height",U=ie(t,{placement:C,boundary:u,rootBoundary:p,altBoundary:d,padding:l}),q=O?L?j:I:L?A:M;x[P]>_[P]&&(q=ve(q));var N=ve(q),D=[];if(s&&D.push(U[R]<=0),o&&D.push(U[q]<=0,U[N]<=0),D.every((function(e){return e}))){E=C,k=!1;break}w.set(C,D)}if(k)for(var z=function(e){var t=y.find((function(t){var i=w.get(t);if(i)return i.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},H=h?3:1;H>0;H--){if("break"===z(H))break}t.placement!==E&&(t.modifiersData[n]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function we(e,t,i){return a(e,o(t,i))}var ke={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name,r=i.mainAxis,s=void 0===r||r,c=i.altAxis,l=void 0!==c&&c,u=i.boundary,p=i.rootBoundary,d=i.altBoundary,f=i.padding,h=i.tether,m=void 0===h||h,b=i.tetherOffset,v=void 0===b?0:b,g=ie(t,{boundary:u,rootBoundary:p,padding:f,altBoundary:d}),x=K(t.placement),_=Z(t.placement),w=!_,k=J(x),E="x"===k?"y":"x",T=t.modifiersData.popperOffsets,C=t.rects.reference,R=t.rects.popper,L="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,O="number"==typeof L?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),P=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,U={x:0,y:0};if(T){if(s){var q,N="y"===k?M:I,D="y"===k?A:j,z="y"===k?"height":"width",H=T[k],F=H+g[N],W=H-g[D],V=m?-R[z]/2:0,$=_===B?C[z]:R[z],G=_===B?-R[z]:-C[z],X=t.elements.arrow,Y=m&&X?y(X):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Q[N],te=Q[D],ne=we(0,C[z],Y[z]),re=w?C[z]/2-V-ne-ee-O.mainAxis:$-ne-ee-O.mainAxis,se=w?-C[z]/2+V+ne+te+O.mainAxis:G+ne+te+O.mainAxis,ae=t.elements.arrow&&S(t.elements.arrow),oe=ae?"y"===k?ae.clientTop||0:ae.clientLeft||0:0,ce=null!=(q=null==P?void 0:P[k])?q:0,le=H+se-ce,ue=we(m?o(F,H+re-ce-oe):F,H,m?a(W,le):W);T[k]=ue,U[k]=ue-H}if(l){var pe,de="x"===k?M:I,fe="x"===k?A:j,he=T[E],me="y"===E?"height":"width",be=he+g[de],ve=he-g[fe],ge=-1!==[M,I].indexOf(x),ye=null!=(pe=null==P?void 0:P[E])?pe:0,xe=ge?be:he-C[me]-R[me]-ye+O.altAxis,_e=ge?he+C[me]+R[me]-ye-O.altAxis:ve,ke=m&&ge?function(e,t,i){var n=we(e,t,i);return n>i?i:n}(xe,he,_e):we(m?xe:be,he,m?_e:ve);T[E]=ke,U[E]=ke-he}t.modifiersData[n]=U}},requiresIfExists:["offset"]},Ee=function(e,t){return ee("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:te(e,C))};var Se={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,n=e.name,r=e.options,s=i.elements.arrow,a=i.modifiersData.popperOffsets,o=K(i.placement),c=J(o),l=[I,j].indexOf(o)>=0?"height":"width";if(s&&a){var u=Ee(r.padding,i),p=y(s),d="y"===c?M:I,f="y"===c?A:j,h=i.rects.reference[l]+i.rects.reference[c]-a[c]-i.rects.popper[l],m=a[c]-i.rects.reference[c],b=S(s),v=b?"y"===c?b.clientHeight||0:b.clientWidth||0:0,g=h/2-m/2,x=u[d],_=v-p[l]-u[f],w=v/2-p[l]/2+g,k=we(x,w,_),E=c;i.modifiersData[n]=((t={})[E]=k,t.centerOffset=k-w,t)}},effect:function(t){var i=t.state,n=t.options.element,s=void 0===n?"[data-popper-arrow]":n;null!=s&&("string"!=typeof s||(s=i.elements.popper.querySelector(s)))&&("production"!==e.env.NODE_ENV&&(r(s)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),$(i.elements.popper,s)?i.elements.arrow=s:"production"!==e.env.NODE_ENV&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" ")))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Me(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function Ae(e){return[M,j,A,I].some((function(t){return e[t]>=0}))}var je={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,n=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,a=ie(t,{elementContext:"reference"}),o=ie(t,{altBoundary:!0}),c=Me(a,n),l=Me(o,r,s),u=Ae(c),p=Ae(l);t.modifiersData[i]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}},Ie=oe({defaultModifiers:[le,ue,fe,he]}),Te=[le,ue,fe,he,me,_e,ke,Se,je],Ce=oe({defaultModifiers:Te});i.applyStyles=he,i.arrow=Se,i.computeStyles=fe,i.createPopper=Ce,i.createPopperLite=Ie,i.defaultModifiers=Te,i.detectOverflow=ie,i.eventListeners=le,i.flip=_e,i.hide=je,i.offset=me,i.popperGenerator=oe,i.popperOffsets=ue,i.preventOverflow=ke}).call(this)}).call(this,e("_process"))},{_process:296}],2:[function(e,t,i){const n=/^\[?([^\]]+)]?:(\d+)$/;let r=new Map;t.exports=function(e){if(1e5===r.size&&r.clear(),!r.has(e)){const t=n.exec(e);if(!t)throw new Error(`invalid addr: ${e}`);r.set(e,[t[1],Number(t[2])])}return r.get(e)}},{}],3:[function(e,t,i){"use strict";const n=i;n.bignum=e("bn.js"),n.define=e("./asn1/api").define,n.base=e("./asn1/base"),n.constants=e("./asn1/constants"),n.decoders=e("./asn1/decoders"),n.encoders=e("./asn1/encoders")},{"./asn1/api":4,"./asn1/base":6,"./asn1/constants":10,"./asn1/decoders":12,"./asn1/encoders":15,"bn.js":17}],4:[function(e,t,i){"use strict";const n=e("./encoders"),r=e("./decoders"),s=e("inherits");function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}i.define=function(e,t){return new a(e,t)},a.prototype._createNamed=function(e){const t=this.name;function i(e){this._initNamed(e,t)}return s(i,e),i.prototype._initNamed=function(t,i){e.call(this,t,i)},new i(this)},a.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(r[e])),this.decoders[e]},a.prototype.decode=function(e,t,i){return this._getDecoder(t).decode(e,i)},a.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},a.prototype.encode=function(e,t,i){return this._getEncoder(t).encode(e,i)}},{"./decoders":12,"./encoders":15,inherits:217}],5:[function(e,t,i){"use strict";const n=e("inherits"),r=e("../base/reporter").Reporter,s=e("safer-buffer").Buffer;function a(e,t){r.call(this,t),s.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function o(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return o.isEncoderBuffer(e)||(e=new o(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=s.byteLength(e);else{if(!s.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(a,r),i.DecoderBuffer=a,a.isDecoderBuffer=function(e){if(e instanceof a)return!0;return"object"==typeof e&&s.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},a.prototype.save=function(){return{offset:this.offset,reporter:r.prototype.save.call(this)}},a.prototype.restore=function(e){const t=new a(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,r.prototype.restore.call(this,e.reporter),t},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},a.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const i=new a(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+e,this.offset+=e,i},a.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},i.EncoderBuffer=o,o.isEncoderBuffer=function(e){if(e instanceof o)return!0;return"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},o.prototype.join=function(e,t){return e||(e=s.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(i){i.join(e,t),t+=i.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):s.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},{"../base/reporter":8,inherits:217,"safer-buffer":339}],6:[function(e,t,i){"use strict";const n=i;n.Reporter=e("./reporter").Reporter,n.DecoderBuffer=e("./buffer").DecoderBuffer,n.EncoderBuffer=e("./buffer").EncoderBuffer,n.Node=e("./node")},{"./buffer":5,"./node":7,"./reporter":8}],7:[function(e,t,i){"use strict";const n=e("../base/reporter").Reporter,r=e("../base/buffer").EncoderBuffer,s=e("../base/buffer").DecoderBuffer,a=e("minimalistic-assert"),o=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o);function l(e,t,i){const n={};this._baseState=n,n.name=i,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}t.exports=l;const u=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];l.prototype.clone=function(){const e=this._baseState,t={};u.forEach((function(i){t[i]=e[i]}));const i=new this.constructor(t.parent);return i._baseState=t,i},l.prototype._wrap=function(){const e=this._baseState;c.forEach((function(t){this[t]=function(){const i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}}),this)},l.prototype._init=function(e){const t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),a.equal(t.children.length,1,"Root node can have only one child")},l.prototype._useArgs=function(e){const t=this._baseState,i=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==i.length&&(a(null===t.children),t.children=i,i.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(i){i==(0|i)&&(i|=0);const n=e[i];t[n]=i})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){l.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),o.forEach((function(e){l.prototype[e]=function(){const t=this._baseState,i=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(i),this}})),l.prototype.use=function(e){a(e);const t=this._baseState;return a(null===t.use),t.use=e,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(e){const t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},l.prototype.explicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},l.prototype.implicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},l.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},l.prototype.key=function(e){const t=this._baseState;return a(null===t.key),t.key=e,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(e){const t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},l.prototype.contains=function(e){const t=this._baseState;return a(null===t.use),t.contains=e,this},l.prototype._decode=function(e,t){const i=this._baseState;if(null===i.parent)return e.wrapResult(i.children[0]._decode(e,t));let n,r=i.default,a=!0,o=null;if(null!==i.key&&(o=e.enterKey(i.key)),i.optional){let n=null;if(null!==i.explicit?n=i.explicit:null!==i.implicit?n=i.implicit:null!==i.tag&&(n=i.tag),null!==n||i.any){if(a=this._peekTag(e,n,i.any),e.isError(a))return a}else{const n=e.save();try{null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t),a=!0}catch(e){a=!1}e.restore(n)}}if(i.obj&&a&&(n=e.enterObject()),a){if(null!==i.explicit){const t=this._decodeTag(e,i.explicit);if(e.isError(t))return t;e=t}const n=e.offset;if(null===i.use&&null===i.choice){let t;i.any&&(t=e.save());const n=this._decodeTag(e,null!==i.implicit?i.implicit:i.tag,i.any);if(e.isError(n))return n;i.any?r=e.raw(t):e=n}if(t&&t.track&&null!==i.tag&&t.track(e.path(),n,e.length,"tagged"),t&&t.track&&null!==i.tag&&t.track(e.path(),e.offset,e.length,"content"),i.any||(r=null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t)),e.isError(r))return r;if(i.any||null!==i.choice||null===i.children||i.children.forEach((function(i){i._decode(e,t)})),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){const n=new s(r);r=this._getUse(i.contains,e._reporterState.obj)._decode(n,t)}}return i.obj&&a&&(r=e.leaveObject(n)),null===i.key||null===r&&!0!==a?null!==o&&e.exitKey(o):e.leaveKey(o,i.key,r),r},l.prototype._decodeGeneric=function(e,t,i){const n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],i):/str$/.test(e)?this._decodeStr(t,e,i):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],i):"objid"===e?this._decodeObjid(t,null,null,i):"gentime"===e||"utctime"===e?this._decodeTime(t,e,i):"null_"===e?this._decodeNull(t,i):"bool"===e?this._decodeBool(t,i):"objDesc"===e?this._decodeStr(t,e,i):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],i):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,i):t.error("unknown tag: "+e)},l.prototype._getUse=function(e,t){const i=this._baseState;return i.useDecoder=this._use(e,t),a(null===i.useDecoder._baseState.parent),i.useDecoder=i.useDecoder._baseState.children[0],i.implicit!==i.useDecoder._baseState.implicit&&(i.useDecoder=i.useDecoder.clone(),i.useDecoder._baseState.implicit=i.implicit),i.useDecoder},l.prototype._decodeChoice=function(e,t){const i=this._baseState;let n=null,r=!1;return Object.keys(i.choice).some((function(s){const a=e.save(),o=i.choice[s];try{const i=o._decode(e,t);if(e.isError(i))return!1;n={type:s,value:i},r=!0}catch(t){return e.restore(a),!1}return!0}),this),r?n:e.error("Choice not matched")},l.prototype._createEncoderBuffer=function(e){return new r(e,this.reporter)},l.prototype._encode=function(e,t,i){const n=this._baseState;if(null!==n.default&&n.default===e)return;const r=this._encodeValue(e,t,i);return void 0===r||this._skipDefault(r,t,i)?void 0:r},l.prototype._encodeValue=function(e,t,i){const r=this._baseState;if(null===r.parent)return r.children[0]._encode(e,t||new n);let s=null;if(this.reporter=t,r.optional&&void 0===e){if(null===r.default)return;e=r.default}let a=null,o=!1;if(r.any)s=this._createEncoderBuffer(e);else if(r.choice)s=this._encodeChoice(e,t);else if(r.contains)a=this._getUse(r.contains,i)._encode(e,t),o=!0;else if(r.children)a=r.children.map((function(i){if("null_"===i._baseState.tag)return i._encode(null,t,e);if(null===i._baseState.key)return t.error("Child should have a key");const n=t.enterKey(i._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const r=i._encode(e[i._baseState.key],t,e);return t.leaveKey(n),r}),this).filter((function(e){return e})),a=this._createEncoderBuffer(a);else if("seqof"===r.tag||"setof"===r.tag){if(!r.args||1!==r.args.length)return t.error("Too many args for : "+r.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const i=this.clone();i._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(i){const n=this._baseState;return this._getUse(n.args[0],e)._encode(i,t)}),i))}else null!==r.use?s=this._getUse(r.use,i)._encode(e,t):(a=this._encodePrimitive(r.tag,e),o=!0);if(!r.any&&null===r.choice){const e=null!==r.implicit?r.implicit:r.tag,i=null===r.implicit?"universal":"context";null===e?null===r.use&&t.error("Tag could be omitted only for .use()"):null===r.use&&(s=this._encodeComposite(e,o,i,a))}return null!==r.explicit&&(s=this._encodeComposite(r.explicit,!1,"context",s)),s},l.prototype._encodeChoice=function(e,t){const i=this._baseState,n=i.choice[e.type];return n||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(i.choice))),n._encode(e.value,t)},l.prototype._encodePrimitive=function(e,t){const i=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&i.args)return this._encodeObjid(t,i.reverseArgs[0],i.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,i.args&&i.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},l.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},l.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},{"../base/buffer":5,"../base/reporter":8,"minimalistic-assert":256}],8:[function(e,t,i){"use strict";const n=e("inherits");function r(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function s(e,t){this.path=e,this.rethrow(t)}i.Reporter=r,r.prototype.isError=function(e){return e instanceof s},r.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},r.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},r.prototype.enterKey=function(e){return this._reporterState.path.push(e)},r.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},r.prototype.leaveKey=function(e,t,i){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=i)},r.prototype.path=function(){return this._reporterState.path.join("/")},r.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},r.prototype.leaveObject=function(e){const t=this._reporterState,i=t.obj;return t.obj=e,i},r.prototype.error=function(e){let t;const i=this._reporterState,n=e instanceof s;if(t=n?e:new s(i.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!i.options.partial)throw t;return n||i.errors.push(t),t},r.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(s,Error),s.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,s),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},{inherits:217}],9:[function(e,t,i){"use strict";function n(e){const t={};return Object.keys(e).forEach((function(i){(0|i)==i&&(i|=0);const n=e[i];t[n]=i})),t}i.tagClass={0:"universal",1:"application",2:"context",3:"private"},i.tagClassByName=n(i.tagClass),i.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},i.tagByName=n(i.tag)},{}],10:[function(e,t,i){"use strict";const n=i;n._reverse=function(e){const t={};return Object.keys(e).forEach((function(i){(0|i)==i&&(i|=0);const n=e[i];t[n]=i})),t},n.der=e("./der")},{"./der":9}],11:[function(e,t,i){"use strict";const n=e("inherits"),r=e("bn.js"),s=e("../base/buffer").DecoderBuffer,a=e("../base/node"),o=e("../constants/der");function c(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new l,this.tree._init(e.body)}function l(e){a.call(this,"der",e)}function u(e,t){let i=e.readUInt8(t);if(e.isError(i))return i;const n=o.tagClass[i>>6],r=0==(32&i);if(31==(31&i)){let n=i;for(i=0;128==(128&n);){if(n=e.readUInt8(t),e.isError(n))return n;i<<=7,i|=127&n}}else i&=31;return{cls:n,primitive:r,tag:i,tagStr:o.tag[i]}}function p(e,t,i){let n=e.readUInt8(i);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;const r=127&n;if(r>4)return e.error("length octect is too long");n=0;for(let t=0;t=31)return n.error("Multi-octet tag encoding unsupported");t||(r|=32);return r|=a.tagClassByName[i||"universal"]<<6,r}(e,t,i,this.reporter);if(n.length<128){const e=r.alloc(2);return e[0]=s,e[1]=n.length,this._createEncoderBuffer([e,n])}let o=1;for(let e=n.length;e>=256;e>>=8)o++;const c=r.alloc(2+o);c[0]=s,c[1]=128|o;for(let e=1+o,t=n.length;t>0;e--,t>>=8)c[e]=255&t;return this._createEncoderBuffer([c,n])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=r.alloc(2*e.length);for(let i=0;i=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let n=0;for(let t=0;t=128;i>>=7)n++}const s=r.alloc(n);let a=s.length-1;for(let t=e.length-1;t>=0;t--){let i=e[t];for(s[a--]=127&i;(i>>=7)>0;)s[a--]=128|127&i}return this._createEncoderBuffer(s)},c.prototype._encodeTime=function(e,t){let i;const n=new Date(e);return"gentime"===t?i=[l(n.getUTCFullYear()),l(n.getUTCMonth()+1),l(n.getUTCDate()),l(n.getUTCHours()),l(n.getUTCMinutes()),l(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?i=[l(n.getUTCFullYear()%100),l(n.getUTCMonth()+1),l(n.getUTCDate()),l(n.getUTCHours()),l(n.getUTCMinutes()),l(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(i,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!r.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=r.from(t)}if(r.isBuffer(e)){let t=e.length;0===e.length&&t++;const i=r.alloc(t);return e.copy(i),0===e.length&&(i[0]=0),this._createEncoderBuffer(i)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let i=1;for(let t=e;t>=256;t>>=8)i++;const n=new Array(i);for(let t=n.length-1;t>=0;t--)n[t]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(r.from(n))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,i){const n=this._baseState;let r;if(null===n.default)return!1;const s=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,i).join()),s.length!==n.defaultBuffer.length)return!1;for(r=0;r=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function c(e,t,i){var n=o(e,i);return i-1>=t&&(n|=o(e,i-1)<<4),n}function l(e,t,i,n){for(var r=0,s=Math.min(e.length,i),a=t;a=49?o-49+10:o>=17?o-17+10:o}return r}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)a=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[s]|=a<>>26-o&67108863,(o+=24)>=26&&(o-=26,s++);else if("le"===i)for(r=0,s=0;r>>26-o&67108863,(o+=24)>=26&&(o-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t,i){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)r=c(e,t,n)<=18?(s-=18,a+=1,this.words[a]|=r>>>26):s+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(s-=18,a+=1,this.words[a]|=r>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var n=0,r=1;r<=67108863;r*=t)n++;n--,r=r/t|0;for(var s=e.length-i,a=s%n,o=Math.min(s,s-a)+i,c=0,u=i;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var u=["","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"],p=[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],d=[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,i){i.negative=t.negative^e.negative;var n=e.length+t.length|0;i.length=n,n=n-1|0;var r=0|e.words[0],s=0|t.words[0],a=r*s,o=67108863&a,c=a/67108864|0;i.words[0]=o;for(var l=1;l>>26,p=67108863&c,d=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=d;f++){var h=l-f|0;u+=(a=(r=0|e.words[h])*(s=0|t.words[f])+p)/67108864|0,p=67108863&a}i.words[l]=0|p,c=0|u}return 0!==c?i.words[l]=0|c:i.length--,i.strip()}s.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var r=0,s=0,a=0;a>>24-r&16777215)||a!==this.length-1?u[6-c.length]+c+i:c+i,(r+=2)>=26&&(r-=26,a--)}for(0!==s&&(i=s.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var l=p[e],f=d[e];i="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modn(f).toString(e);i=(h=h.idivn(f)).isZero()?m+i:u[l-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}n(!1,"Base should be between 2 and 36")},s.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,i){var r=this.byteLength(),s=i||Math.max(1,r);n(r<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0"),this.strip();var a,o,c="le"===t,l=new e(s),u=this.clone();if(c){for(o=0;!u.isZero();o++)a=u.andln(255),u.iushrn(8),l[o]=a;for(;o=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return 0==(8191&t)&&(i+=13,t>>>=13),0==(127&t)&&(i+=7,t>>>=7),0==(15&t)&&(i+=4,t>>>=4),0==(3&t)&&(i+=2,t>>>=2),0==(1&t)&&i++,i},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;ie.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,i;this.length>e.length?(t=this,i=e):(t=e,i=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var i=e/26|0,r=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<e.length?(i=this,n=e):(i=e,n=this);for(var r=0,s=0;s>>26;for(;0!==r&&s>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.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 i,n,r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,n=e):(i=e,n=this);for(var s=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==s&&a>26,this.words[a]=67108863&t;if(0===s&&a>>13,f=0|a[1],h=8191&f,m=f>>>13,b=0|a[2],v=8191&b,g=b>>>13,y=0|a[3],x=8191&y,_=y>>>13,w=0|a[4],k=8191&w,E=w>>>13,S=0|a[5],M=8191&S,A=S>>>13,j=0|a[6],I=8191&j,T=j>>>13,C=0|a[7],B=8191&C,R=C>>>13,L=0|a[8],O=8191&L,P=L>>>13,U=0|a[9],q=8191&U,N=U>>>13,D=0|o[0],z=8191&D,H=D>>>13,F=0|o[1],W=8191&F,V=F>>>13,K=0|o[2],$=8191&K,G=K>>>13,X=0|o[3],Y=8191&X,Z=X>>>13,J=0|o[4],Q=8191&J,ee=J>>>13,te=0|o[5],ie=8191&te,ne=te>>>13,re=0|o[6],se=8191&re,ae=re>>>13,oe=0|o[7],ce=8191&oe,le=oe>>>13,ue=0|o[8],pe=8191&ue,de=ue>>>13,fe=0|o[9],he=8191&fe,me=fe>>>13;i.negative=e.negative^t.negative,i.length=19;var be=(l+(n=Math.imul(p,z))|0)+((8191&(r=(r=Math.imul(p,H))+Math.imul(d,z)|0))<<13)|0;l=((s=Math.imul(d,H))+(r>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(h,z),r=(r=Math.imul(h,H))+Math.imul(m,z)|0,s=Math.imul(m,H);var ve=(l+(n=n+Math.imul(p,W)|0)|0)+((8191&(r=(r=r+Math.imul(p,V)|0)+Math.imul(d,W)|0))<<13)|0;l=((s=s+Math.imul(d,V)|0)+(r>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,z),r=(r=Math.imul(v,H))+Math.imul(g,z)|0,s=Math.imul(g,H),n=n+Math.imul(h,W)|0,r=(r=r+Math.imul(h,V)|0)+Math.imul(m,W)|0,s=s+Math.imul(m,V)|0;var ge=(l+(n=n+Math.imul(p,$)|0)|0)+((8191&(r=(r=r+Math.imul(p,G)|0)+Math.imul(d,$)|0))<<13)|0;l=((s=s+Math.imul(d,G)|0)+(r>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(x,z),r=(r=Math.imul(x,H))+Math.imul(_,z)|0,s=Math.imul(_,H),n=n+Math.imul(v,W)|0,r=(r=r+Math.imul(v,V)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,V)|0,n=n+Math.imul(h,$)|0,r=(r=r+Math.imul(h,G)|0)+Math.imul(m,$)|0,s=s+Math.imul(m,G)|0;var ye=(l+(n=n+Math.imul(p,Y)|0)|0)+((8191&(r=(r=r+Math.imul(p,Z)|0)+Math.imul(d,Y)|0))<<13)|0;l=((s=s+Math.imul(d,Z)|0)+(r>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(k,z),r=(r=Math.imul(k,H))+Math.imul(E,z)|0,s=Math.imul(E,H),n=n+Math.imul(x,W)|0,r=(r=r+Math.imul(x,V)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,V)|0,n=n+Math.imul(v,$)|0,r=(r=r+Math.imul(v,G)|0)+Math.imul(g,$)|0,s=s+Math.imul(g,G)|0,n=n+Math.imul(h,Y)|0,r=(r=r+Math.imul(h,Z)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,Z)|0;var xe=(l+(n=n+Math.imul(p,Q)|0)|0)+((8191&(r=(r=r+Math.imul(p,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((s=s+Math.imul(d,ee)|0)+(r>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(M,z),r=(r=Math.imul(M,H))+Math.imul(A,z)|0,s=Math.imul(A,H),n=n+Math.imul(k,W)|0,r=(r=r+Math.imul(k,V)|0)+Math.imul(E,W)|0,s=s+Math.imul(E,V)|0,n=n+Math.imul(x,$)|0,r=(r=r+Math.imul(x,G)|0)+Math.imul(_,$)|0,s=s+Math.imul(_,G)|0,n=n+Math.imul(v,Y)|0,r=(r=r+Math.imul(v,Z)|0)+Math.imul(g,Y)|0,s=s+Math.imul(g,Z)|0,n=n+Math.imul(h,Q)|0,r=(r=r+Math.imul(h,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var _e=(l+(n=n+Math.imul(p,ie)|0)|0)+((8191&(r=(r=r+Math.imul(p,ne)|0)+Math.imul(d,ie)|0))<<13)|0;l=((s=s+Math.imul(d,ne)|0)+(r>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,z),r=(r=Math.imul(I,H))+Math.imul(T,z)|0,s=Math.imul(T,H),n=n+Math.imul(M,W)|0,r=(r=r+Math.imul(M,V)|0)+Math.imul(A,W)|0,s=s+Math.imul(A,V)|0,n=n+Math.imul(k,$)|0,r=(r=r+Math.imul(k,G)|0)+Math.imul(E,$)|0,s=s+Math.imul(E,G)|0,n=n+Math.imul(x,Y)|0,r=(r=r+Math.imul(x,Z)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,Z)|0,n=n+Math.imul(v,Q)|0,r=(r=r+Math.imul(v,ee)|0)+Math.imul(g,Q)|0,s=s+Math.imul(g,ee)|0,n=n+Math.imul(h,ie)|0,r=(r=r+Math.imul(h,ne)|0)+Math.imul(m,ie)|0,s=s+Math.imul(m,ne)|0;var we=(l+(n=n+Math.imul(p,se)|0)|0)+((8191&(r=(r=r+Math.imul(p,ae)|0)+Math.imul(d,se)|0))<<13)|0;l=((s=s+Math.imul(d,ae)|0)+(r>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(B,z),r=(r=Math.imul(B,H))+Math.imul(R,z)|0,s=Math.imul(R,H),n=n+Math.imul(I,W)|0,r=(r=r+Math.imul(I,V)|0)+Math.imul(T,W)|0,s=s+Math.imul(T,V)|0,n=n+Math.imul(M,$)|0,r=(r=r+Math.imul(M,G)|0)+Math.imul(A,$)|0,s=s+Math.imul(A,G)|0,n=n+Math.imul(k,Y)|0,r=(r=r+Math.imul(k,Z)|0)+Math.imul(E,Y)|0,s=s+Math.imul(E,Z)|0,n=n+Math.imul(x,Q)|0,r=(r=r+Math.imul(x,ee)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,ee)|0,n=n+Math.imul(v,ie)|0,r=(r=r+Math.imul(v,ne)|0)+Math.imul(g,ie)|0,s=s+Math.imul(g,ne)|0,n=n+Math.imul(h,se)|0,r=(r=r+Math.imul(h,ae)|0)+Math.imul(m,se)|0,s=s+Math.imul(m,ae)|0;var ke=(l+(n=n+Math.imul(p,ce)|0)|0)+((8191&(r=(r=r+Math.imul(p,le)|0)+Math.imul(d,ce)|0))<<13)|0;l=((s=s+Math.imul(d,le)|0)+(r>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(O,z),r=(r=Math.imul(O,H))+Math.imul(P,z)|0,s=Math.imul(P,H),n=n+Math.imul(B,W)|0,r=(r=r+Math.imul(B,V)|0)+Math.imul(R,W)|0,s=s+Math.imul(R,V)|0,n=n+Math.imul(I,$)|0,r=(r=r+Math.imul(I,G)|0)+Math.imul(T,$)|0,s=s+Math.imul(T,G)|0,n=n+Math.imul(M,Y)|0,r=(r=r+Math.imul(M,Z)|0)+Math.imul(A,Y)|0,s=s+Math.imul(A,Z)|0,n=n+Math.imul(k,Q)|0,r=(r=r+Math.imul(k,ee)|0)+Math.imul(E,Q)|0,s=s+Math.imul(E,ee)|0,n=n+Math.imul(x,ie)|0,r=(r=r+Math.imul(x,ne)|0)+Math.imul(_,ie)|0,s=s+Math.imul(_,ne)|0,n=n+Math.imul(v,se)|0,r=(r=r+Math.imul(v,ae)|0)+Math.imul(g,se)|0,s=s+Math.imul(g,ae)|0,n=n+Math.imul(h,ce)|0,r=(r=r+Math.imul(h,le)|0)+Math.imul(m,ce)|0,s=s+Math.imul(m,le)|0;var Ee=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(r=(r=r+Math.imul(p,de)|0)+Math.imul(d,pe)|0))<<13)|0;l=((s=s+Math.imul(d,de)|0)+(r>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(q,z),r=(r=Math.imul(q,H))+Math.imul(N,z)|0,s=Math.imul(N,H),n=n+Math.imul(O,W)|0,r=(r=r+Math.imul(O,V)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,V)|0,n=n+Math.imul(B,$)|0,r=(r=r+Math.imul(B,G)|0)+Math.imul(R,$)|0,s=s+Math.imul(R,G)|0,n=n+Math.imul(I,Y)|0,r=(r=r+Math.imul(I,Z)|0)+Math.imul(T,Y)|0,s=s+Math.imul(T,Z)|0,n=n+Math.imul(M,Q)|0,r=(r=r+Math.imul(M,ee)|0)+Math.imul(A,Q)|0,s=s+Math.imul(A,ee)|0,n=n+Math.imul(k,ie)|0,r=(r=r+Math.imul(k,ne)|0)+Math.imul(E,ie)|0,s=s+Math.imul(E,ne)|0,n=n+Math.imul(x,se)|0,r=(r=r+Math.imul(x,ae)|0)+Math.imul(_,se)|0,s=s+Math.imul(_,ae)|0,n=n+Math.imul(v,ce)|0,r=(r=r+Math.imul(v,le)|0)+Math.imul(g,ce)|0,s=s+Math.imul(g,le)|0,n=n+Math.imul(h,pe)|0,r=(r=r+Math.imul(h,de)|0)+Math.imul(m,pe)|0,s=s+Math.imul(m,de)|0;var Se=(l+(n=n+Math.imul(p,he)|0)|0)+((8191&(r=(r=r+Math.imul(p,me)|0)+Math.imul(d,he)|0))<<13)|0;l=((s=s+Math.imul(d,me)|0)+(r>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(q,W),r=(r=Math.imul(q,V))+Math.imul(N,W)|0,s=Math.imul(N,V),n=n+Math.imul(O,$)|0,r=(r=r+Math.imul(O,G)|0)+Math.imul(P,$)|0,s=s+Math.imul(P,G)|0,n=n+Math.imul(B,Y)|0,r=(r=r+Math.imul(B,Z)|0)+Math.imul(R,Y)|0,s=s+Math.imul(R,Z)|0,n=n+Math.imul(I,Q)|0,r=(r=r+Math.imul(I,ee)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,ee)|0,n=n+Math.imul(M,ie)|0,r=(r=r+Math.imul(M,ne)|0)+Math.imul(A,ie)|0,s=s+Math.imul(A,ne)|0,n=n+Math.imul(k,se)|0,r=(r=r+Math.imul(k,ae)|0)+Math.imul(E,se)|0,s=s+Math.imul(E,ae)|0,n=n+Math.imul(x,ce)|0,r=(r=r+Math.imul(x,le)|0)+Math.imul(_,ce)|0,s=s+Math.imul(_,le)|0,n=n+Math.imul(v,pe)|0,r=(r=r+Math.imul(v,de)|0)+Math.imul(g,pe)|0,s=s+Math.imul(g,de)|0;var Me=(l+(n=n+Math.imul(h,he)|0)|0)+((8191&(r=(r=r+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;l=((s=s+Math.imul(m,me)|0)+(r>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(q,$),r=(r=Math.imul(q,G))+Math.imul(N,$)|0,s=Math.imul(N,G),n=n+Math.imul(O,Y)|0,r=(r=r+Math.imul(O,Z)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,Z)|0,n=n+Math.imul(B,Q)|0,r=(r=r+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,s=s+Math.imul(R,ee)|0,n=n+Math.imul(I,ie)|0,r=(r=r+Math.imul(I,ne)|0)+Math.imul(T,ie)|0,s=s+Math.imul(T,ne)|0,n=n+Math.imul(M,se)|0,r=(r=r+Math.imul(M,ae)|0)+Math.imul(A,se)|0,s=s+Math.imul(A,ae)|0,n=n+Math.imul(k,ce)|0,r=(r=r+Math.imul(k,le)|0)+Math.imul(E,ce)|0,s=s+Math.imul(E,le)|0,n=n+Math.imul(x,pe)|0,r=(r=r+Math.imul(x,de)|0)+Math.imul(_,pe)|0,s=s+Math.imul(_,de)|0;var Ae=(l+(n=n+Math.imul(v,he)|0)|0)+((8191&(r=(r=r+Math.imul(v,me)|0)+Math.imul(g,he)|0))<<13)|0;l=((s=s+Math.imul(g,me)|0)+(r>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(q,Y),r=(r=Math.imul(q,Z))+Math.imul(N,Y)|0,s=Math.imul(N,Z),n=n+Math.imul(O,Q)|0,r=(r=r+Math.imul(O,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,n=n+Math.imul(B,ie)|0,r=(r=r+Math.imul(B,ne)|0)+Math.imul(R,ie)|0,s=s+Math.imul(R,ne)|0,n=n+Math.imul(I,se)|0,r=(r=r+Math.imul(I,ae)|0)+Math.imul(T,se)|0,s=s+Math.imul(T,ae)|0,n=n+Math.imul(M,ce)|0,r=(r=r+Math.imul(M,le)|0)+Math.imul(A,ce)|0,s=s+Math.imul(A,le)|0,n=n+Math.imul(k,pe)|0,r=(r=r+Math.imul(k,de)|0)+Math.imul(E,pe)|0,s=s+Math.imul(E,de)|0;var je=(l+(n=n+Math.imul(x,he)|0)|0)+((8191&(r=(r=r+Math.imul(x,me)|0)+Math.imul(_,he)|0))<<13)|0;l=((s=s+Math.imul(_,me)|0)+(r>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(q,Q),r=(r=Math.imul(q,ee))+Math.imul(N,Q)|0,s=Math.imul(N,ee),n=n+Math.imul(O,ie)|0,r=(r=r+Math.imul(O,ne)|0)+Math.imul(P,ie)|0,s=s+Math.imul(P,ne)|0,n=n+Math.imul(B,se)|0,r=(r=r+Math.imul(B,ae)|0)+Math.imul(R,se)|0,s=s+Math.imul(R,ae)|0,n=n+Math.imul(I,ce)|0,r=(r=r+Math.imul(I,le)|0)+Math.imul(T,ce)|0,s=s+Math.imul(T,le)|0,n=n+Math.imul(M,pe)|0,r=(r=r+Math.imul(M,de)|0)+Math.imul(A,pe)|0,s=s+Math.imul(A,de)|0;var Ie=(l+(n=n+Math.imul(k,he)|0)|0)+((8191&(r=(r=r+Math.imul(k,me)|0)+Math.imul(E,he)|0))<<13)|0;l=((s=s+Math.imul(E,me)|0)+(r>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(q,ie),r=(r=Math.imul(q,ne))+Math.imul(N,ie)|0,s=Math.imul(N,ne),n=n+Math.imul(O,se)|0,r=(r=r+Math.imul(O,ae)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,ae)|0,n=n+Math.imul(B,ce)|0,r=(r=r+Math.imul(B,le)|0)+Math.imul(R,ce)|0,s=s+Math.imul(R,le)|0,n=n+Math.imul(I,pe)|0,r=(r=r+Math.imul(I,de)|0)+Math.imul(T,pe)|0,s=s+Math.imul(T,de)|0;var Te=(l+(n=n+Math.imul(M,he)|0)|0)+((8191&(r=(r=r+Math.imul(M,me)|0)+Math.imul(A,he)|0))<<13)|0;l=((s=s+Math.imul(A,me)|0)+(r>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(q,se),r=(r=Math.imul(q,ae))+Math.imul(N,se)|0,s=Math.imul(N,ae),n=n+Math.imul(O,ce)|0,r=(r=r+Math.imul(O,le)|0)+Math.imul(P,ce)|0,s=s+Math.imul(P,le)|0,n=n+Math.imul(B,pe)|0,r=(r=r+Math.imul(B,de)|0)+Math.imul(R,pe)|0,s=s+Math.imul(R,de)|0;var Ce=(l+(n=n+Math.imul(I,he)|0)|0)+((8191&(r=(r=r+Math.imul(I,me)|0)+Math.imul(T,he)|0))<<13)|0;l=((s=s+Math.imul(T,me)|0)+(r>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(q,ce),r=(r=Math.imul(q,le))+Math.imul(N,ce)|0,s=Math.imul(N,le),n=n+Math.imul(O,pe)|0,r=(r=r+Math.imul(O,de)|0)+Math.imul(P,pe)|0,s=s+Math.imul(P,de)|0;var Be=(l+(n=n+Math.imul(B,he)|0)|0)+((8191&(r=(r=r+Math.imul(B,me)|0)+Math.imul(R,he)|0))<<13)|0;l=((s=s+Math.imul(R,me)|0)+(r>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(q,pe),r=(r=Math.imul(q,de))+Math.imul(N,pe)|0,s=Math.imul(N,de);var Re=(l+(n=n+Math.imul(O,he)|0)|0)+((8191&(r=(r=r+Math.imul(O,me)|0)+Math.imul(P,he)|0))<<13)|0;l=((s=s+Math.imul(P,me)|0)+(r>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Le=(l+(n=Math.imul(q,he))|0)+((8191&(r=(r=Math.imul(q,me))+Math.imul(N,he)|0))<<13)|0;return l=((s=Math.imul(N,me))+(r>>>13)|0)+(Le>>>26)|0,Le&=67108863,c[0]=be,c[1]=ve,c[2]=ge,c[3]=ye,c[4]=xe,c[5]=_e,c[6]=we,c[7]=ke,c[8]=Ee,c[9]=Se,c[10]=Me,c[11]=Ae,c[12]=je,c[13]=Ie,c[14]=Te,c[15]=Ce,c[16]=Be,c[17]=Re,c[18]=Le,0!==l&&(c[19]=l,i.length++),i};function m(e,t,i){return(new b).mulp(e,t,i)}function b(e,t){this.x=e,this.y=t}Math.imul||(h=f),s.prototype.mulTo=function(e,t){var i,n=this.length+e.length;return i=10===this.length&&10===e.length?h(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,i){i.negative=t.negative^e.negative,i.length=e.length+t.length;for(var n=0,r=0,s=0;s>>26)|0)>>>26,a&=67108863}i.words[s]=o,n=a,a=r}return 0!==n?i.words[s]=n:i.length--,i.strip()}(this,e,t):m(this,e,t),i},b.prototype.makeRBT=function(e){for(var t=new Array(e),i=s.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,i,n,r,s){for(var a=0;a>>=1)r++;return 1<>>=13,i[2*a+1]=8191&s,s>>>=13;for(a=2*t;a>=26,t+=r/67108864|0,t+=s>>>26,this.words[i]=67108863&s}return 0!==t&&(this.words[i]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),i=0;i>>r}return t}(e);if(0===t.length)return new s(1);for(var i=this,n=0;n=0);var t,i=e%26,r=(e-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){var a=0;for(t=0;t>>26-i}a&&(this.words[t]=a,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var s=e%26,a=Math.min((e-s)/26,this.length),o=67108863^67108863>>>s<a)for(this.length-=a,l=0;l=0&&(0!==u||l>=r);l--){var p=0|this.words[l];this.words[l]=u<<26-s|p>>>s,u=p&o}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,i){return n(0===this.negative),this.iushrn(e,t,i)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,r=1<=0);var t=e%26,i=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var r=67108863^67108863>>>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},s.prototype.isubn=function(e){if(n("number"==typeof e),n(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>26)-(c/67108864|0),this.words[r+i]=67108863&s}for(;r>26,this.words[r+i]=67108863&s;if(0===o)return this.strip();for(n(-1===o),o=0,r=0;r>26,this.words[r]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var i=(this.length,e.length),n=this.clone(),r=e,a=0|r.words[r.length-1];0!==(i=26-this._countBits(a))&&(r=r.ushln(i),n.iushln(i),a=0|r.words[r.length-1]);var o,c=n.length-r.length;if("mod"!==t){(o=new s(null)).length=c+1,o.words=new Array(o.length);for(var l=0;l=0;p--){var d=67108864*(0|n.words[r.length+p])+(0|n.words[r.length+p-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(r,d,p);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(r,1,p),n.isZero()||(n.negative^=1);o&&(o.words[p]=d)}return o&&o.strip(),n.strip(),"div"!==t&&0!==i&&n.iushrn(i),{div:o||null,mod:n}},s.prototype.divmod=function(e,t,i){return n(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(r=o.div.neg()),"div"!==t&&(a=o.mod.neg(),i&&0!==a.negative&&a.iadd(e)),{div:r,mod:a}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(a=o.mod.neg(),i&&0!==a.negative&&a.isub(e)),{div:o.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,a,o},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var i=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),r=e.andln(1),s=i.cmp(n);return s<0||1===r&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,i=0,r=this.length-1;r>=0;r--)i=(t*i+(0|this.words[r]))%e;return i},s.prototype.idivn=function(e){n(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*t;this.words[i]=r/e|0,t=r%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new s(1),a=new s(0),o=new s(0),c=new s(1),l=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++l;for(var u=i.clone(),p=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(r.isOdd()||a.isOdd())&&(r.iadd(u),a.isub(p)),r.iushrn(1),a.iushrn(1);for(var h=0,m=1;0==(i.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(i.iushrn(h);h-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(u),c.isub(p)),o.iushrn(1),c.iushrn(1);t.cmp(i)>=0?(t.isub(i),r.isub(o),a.isub(c)):(i.isub(t),o.isub(r),c.isub(a))}return{a:o,b:c,gcd:i.iushln(l)}},s.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,a=new s(1),o=new s(0),c=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,u=1;0==(t.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var p=0,d=1;0==(i.words[0]&d)&&p<26;++p,d<<=1);if(p>0)for(i.iushrn(p);p-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(i)>=0?(t.isub(i),a.isub(o)):(i.isub(t),o.isub(a))}return(r=0===t.cmpn(1)?a:o).cmpn(0)<0&&r.iadd(e),r},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),i=e.clone();t.negative=0,i.negative=0;for(var n=0;t.isEven()&&i.isEven();n++)t.iushrn(1),i.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;i.isEven();)i.iushrn(1);var r=t.cmp(i);if(r<0){var s=t;t=i,i=s}else if(0===r||0===i.cmpn(1))break;t.isub(i)}return i.iushln(n)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,i=(e-t)/26,r=1<>>26,o&=67108863,this.words[a]=o}return 0!==s&&(this.words[a]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),n(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;i--){var n=0|this.words[i],r=0|e.words[i];if(n!==r){nr&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new k(e)},s.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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)}g.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,i=e;do{this.split(i,this.tmp),t=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},r(y,g),y.prototype.split=function(e,t){for(var i=4194303,n=Math.min(e.length,9),r=0;r>>22,s=a}s>>>=22,e.words[r-10]=s,0===s&&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,i=0;i>>=26,e.words[i]=r,t=n}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new x;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return v[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var i=e.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var i=e.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i},k.prototype.sub=function(e,t){this._verify2(e,t);var i=e.sub(t);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var i=e.isub(t);return i.cmpn(0)<0&&i.iadd(this.m),i},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var i=this.m.add(new s(1)).iushrn(2);return this.pow(e,i)}for(var r=this.m.subn(1),a=0;!r.isZero()&&0===r.andln(1);)a++,r.iushrn(1);n(!r.isZero());var o=new s(1).toRed(this),c=o.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);0!==this.pow(u,l).cmp(c);)u.redIAdd(c);for(var p=this.pow(u,r),d=this.pow(e,r.addn(1).iushrn(1)),f=this.pow(e,r),h=a;0!==f.cmp(o);){for(var m=f,b=0;0!==m.cmp(o);b++)m=m.redSqr();n(b=0;n--){for(var l=t.words[n],u=c-1;u>=0;u--){var p=l>>u&1;r!==i[0]&&(r=this.sqr(r)),0!==p||0!==a?(a<<=1,a|=p,(4===++o||0===n&&0===u)&&(r=this.mul(r,i[a]),o=0,a=0)):o=0}c=26}return r},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new E(e)},r(E,k),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(n).iushrn(this.shift),s=r;return r.cmp(this.m)>=0?s=r.isub(this.m):r.cmpn(0)<0&&(s=r.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var i=e.mul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(n).iushrn(this.shift),a=r;return r.cmp(this.m)>=0?a=r.isub(this.m):r.cmpn(0)<0&&(a=r.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:67}],18:[function(e,t,i){"use strict";i.byteLength=function(e){var t=l(e),i=t[0],n=t[1];return 3*(i+n)/4-n},i.toByteArray=function(e){var t,i,n=l(e),a=n[0],o=n[1],c=new s(function(e,t,i){return 3*(t+i)/4-i}(0,a,o)),u=0,p=o>0?a-4:a;for(i=0;i>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===o&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,c[u++]=255&t);1===o&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},i.fromByteArray=function(e){for(var t,i=e.length,r=i%3,s=[],a=16383,o=0,c=i-r;oc?c:o+a));1===r?(t=e[i-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return s.join("")};for(var n=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,c=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function u(e,t,i){for(var r,s,a=[],o=t;o>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},{}],19:[function(e,t,i){(function(e){(function(){function i(e,t,i){let n=0,r=1;for(let s=t;s=48)n=10*n+(i-48);else if(s!==t||43!==i){if(s!==t||45!==i){if(46===i)break;throw new Error("not a number: buffer["+s+"] = "+i)}r=-1}}return n*r}function n(t,i,r,s){return null==t||0===t.length?null:("number"!=typeof i&&null==s&&(s=i,i=void 0),"number"!=typeof r&&null==s&&(s=r,r=void 0),n.position=0,n.encoding=s||null,n.data=e.isBuffer(t)?t.slice(i,r):e.from(t),n.bytes=n.data.length,n.next())}n.bytes=0,n.position=0,n.data=null,n.encoding=null,n.next=function(){switch(n.data[n.position]){case 100:return n.dictionary();case 108:return n.list();case 105:return n.integer();default:return n.buffer()}},n.find=function(e){let t=n.position;const i=n.data.length,r=n.data;for(;t{const r=t.split("-").map((e=>parseInt(e)));return e.concat(((e,t=e)=>Array.from({length:t-e+1},((t,i)=>i+e)))(...r))}),[])}t.exports=n,t.exports.parse=n,t.exports.compose=function(e){return e.reduce(((e,t,i,n)=>(0!==i&&t===n[i-1]+1||e.push([]),e[e.length-1].push(t),e)),[]).map((e=>e.length>1?`${e[0]}-${e[e.length-1]}`:`${e[0]}`))}},{}],25:[function(e,t,i){t.exports=function(e,t,i,n,r){var s,a;if(void 0===n)n=0;else if((n|=0)<0||n>=e.length)throw new RangeError("invalid lower bound");if(void 0===r)r=e.length-1;else if((r|=0)=e.length)throw new RangeError("invalid upper bound");for(;n<=r;)if((a=+i(e[s=n+(r-n>>>1)],t,s,e))<0)n=s+1;else{if(!(a>0))return s;r=s-1}return~n}},{}],26:[function(e,t,i){"use strict";function n(e){var t=e>>3;return e%8!=0&&t++,t}Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function e(e,t){void 0===e&&(e=0);var i=null==t?void 0:t.grow;this.grow=i&&isFinite(i)&&n(i)||i||0,this.buffer="number"==typeof e?new Uint8Array(n(e)):e}return e.prototype.get=function(e){var t=e>>3;return t>e%8)},e.prototype.set=function(e,t){void 0===t&&(t=!0);var i=e>>3;if(t){if(this.buffer.length>e%8}else i>e%8))},e.prototype.forEach=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=8*this.buffer.length);for(var n=t,r=n>>3,s=128>>n%8,a=this.buffer[r];n>1},e}();i.default=r},{}],27:[function(e,t,i){(function(i){(function(){ +!function e(t,i,n){function r(a,o){if(!i[a]){if(!t[a]){var c="function"==typeof require&&require;if(!o&&c)return c(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=i[a]={exports:{}};t[a][0].call(u.exports,(function(e){return r(t[a][1][e]||e)}),u,u.exports,e,t,i,n)}return i[a].exports}for(var s="function"==typeof require&&require,a=0;a0&&c(a.width)/e.offsetWidth||1,l=e.offsetHeight>0&&c(a.height)/e.offsetHeight||1);var p=(n(e)?t(e):window).visualViewport,d=!u()&&s,f=(a.left+(d&&p?p.offsetLeft:0))/o,h=(a.top+(d&&p?p.offsetTop:0))/l,m=a.width/o,b=a.height/l;return{width:m,height:b,top:h,right:f+m,bottom:h+b,left:f,x:f,y:h}}function d(e){var i=t(e);return{scrollLeft:i.pageXOffset,scrollTop:i.pageYOffset}}function f(e){return e?(e.nodeName||"").toLowerCase():null}function h(e){return((n(e)?e.ownerDocument:e.document)||window.document).documentElement}function m(e){return p(h(e)).left+d(e).scrollLeft}function b(e){return t(e).getComputedStyle(e)}function v(e){var t=b(e),i=t.overflow,n=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+r+n)}function g(e,i,n){void 0===n&&(n=!1);var s,a,o=r(i),l=r(i)&&function(e){var t=e.getBoundingClientRect(),i=c(t.width)/e.offsetWidth||1,n=c(t.height)/e.offsetHeight||1;return 1!==i||1!==n}(i),u=h(i),b=p(e,l,n),g={scrollLeft:0,scrollTop:0},y={x:0,y:0};return(o||!o&&!n)&&(("body"!==f(i)||v(u))&&(g=(s=i)!==t(s)&&r(s)?{scrollLeft:(a=s).scrollLeft,scrollTop:a.scrollTop}:d(s)),r(i)?((y=p(i,!0)).x+=i.clientLeft,y.y+=i.clientTop):u&&(y.x=m(u))),{x:b.left+g.scrollLeft-y.x,y:b.top+g.scrollTop-y.y,width:b.width,height:b.height}}function y(e){var t=p(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function x(e){return"html"===f(e)?e:e.assignedSlot||e.parentNode||(s(e)?e.host:null)||h(e)}function _(e){return["html","body","#document"].indexOf(f(e))>=0?e.ownerDocument.body:r(e)&&v(e)?e:_(x(e))}function w(e,i){var n;void 0===i&&(i=[]);var r=_(e),s=r===(null==(n=e.ownerDocument)?void 0:n.body),a=t(r),o=s?[a].concat(a.visualViewport||[],v(r)?r:[]):r,c=i.concat(o);return s?c:c.concat(w(x(o)))}function k(e){return["table","td","th"].indexOf(f(e))>=0}function E(e){return r(e)&&"fixed"!==b(e).position?e.offsetParent:null}function S(e){for(var i=t(e),n=E(e);n&&k(n)&&"static"===b(n).position;)n=E(n);return n&&("html"===f(n)||"body"===f(n)&&"static"===b(n).position)?i:n||function(e){var t=/firefox/i.test(l());if(/Trident/i.test(l())&&r(e)&&"fixed"===b(e).position)return null;var i=x(e);for(s(i)&&(i=i.host);r(i)&&["html","body"].indexOf(f(i))<0;){var n=b(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(e)||i}var M="top",A="bottom",j="right",I="left",T="auto",C=[M,A,j,I],B="start",R="end",L="clippingParents",O="viewport",P="popper",U="reference",q=C.reduce((function(e,t){return e.concat([t+"-"+B,t+"-"+R])}),[]),N=[].concat(C,[T]).reduce((function(e,t){return e.concat([t,t+"-"+B,t+"-"+R])}),[]),D=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function z(e){var t=new Map,i=new Set,n=[];function r(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!i.has(e)){var n=t.get(e);n&&r(n)}})),n.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){i.has(e.name)||r(e)})),n}function H(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n=0&&r(e)?S(e):e;return n(i)?t.filter((function(e){return n(e)&&$(e,i)&&"body"!==f(e)})):[]}(e):[].concat(t),l=[].concat(c,[i]),u=l[0],p=l.reduce((function(t,i){var n=X(e,i,s);return t.top=a(n.top,t.top),t.right=o(n.right,t.right),t.bottom=o(n.bottom,t.bottom),t.left=a(n.left,t.left),t}),X(e,u,s));return p.width=p.right-p.left,p.height=p.bottom-p.top,p.x=p.left,p.y=p.top,p}function Z(e){return e.split("-")[1]}function J(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Q(e){var t,i=e.reference,n=e.element,r=e.placement,s=r?K(r):null,a=r?Z(r):null,o=i.x+i.width/2-n.width/2,c=i.y+i.height/2-n.height/2;switch(s){case M:t={x:o,y:i.y-n.height};break;case A:t={x:o,y:i.y+i.height};break;case j:t={x:i.x+i.width,y:c};break;case I:t={x:i.x-n.width,y:c};break;default:t={x:i.x,y:i.y}}var l=s?J(s):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case B:t[l]=t[l]-(i[u]/2-n[u]/2);break;case R:t[l]=t[l]+(i[u]/2-n[u]/2)}}return t}function ee(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function te(e,t){return t.reduce((function(t,i){return t[i]=e,t}),{})}function ie(e,t){void 0===t&&(t={});var i=t,r=i.placement,s=void 0===r?e.placement:r,a=i.strategy,o=void 0===a?e.strategy:a,c=i.boundary,l=void 0===c?L:c,u=i.rootBoundary,d=void 0===u?O:u,f=i.elementContext,m=void 0===f?P:f,b=i.altBoundary,v=void 0!==b&&b,g=i.padding,y=void 0===g?0:g,x=ee("number"!=typeof y?y:te(y,C)),_=m===P?U:P,w=e.rects.popper,k=e.elements[v?_:m],E=Y(n(k)?k:k.contextElement||h(e.elements.popper),l,d,o),S=p(e.elements.reference),I=Q({reference:S,element:w,strategy:"absolute",placement:s}),T=G(Object.assign({},w,I)),B=m===P?T:S,R={top:E.top-B.top+x.top,bottom:B.bottom-E.bottom+x.bottom,left:E.left-B.left+x.left,right:B.right-E.right+x.right},q=e.modifiersData.offset;if(m===P&&q){var N=q[s];Object.keys(R).forEach((function(e){var t=[j,A].indexOf(e)>=0?1:-1,i=[M,A].indexOf(e)>=0?"y":"x";R[e]+=N[i]*t}))}return R}var ne="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",re={placement:"bottom",modifiers:[],strategy:"absolute"};function se(){for(var e=arguments.length,t=new Array(e),i=0;i100){console.error("Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.");break}if(!0!==l.reset){var a=l.orderedModifiers[s],o=a.fn,c=a.options,u=void 0===c?{}:c,f=a.name;"function"==typeof o&&(l=o({state:l,options:u,name:f,instance:d})||l)}else l.reset=!1,s=-1}}else"production"!==e.env.NODE_ENV&&console.error(ne)}},update:(a=function(){return new Promise((function(e){d.forceUpdate(),e(l)}))},function(){return c||(c=new Promise((function(e){Promise.resolve().then((function(){c=void 0,e(a())}))}))),c}),destroy:function(){f(),p=!0}};if(!se(t,i))return"production"!==e.env.NODE_ENV&&console.error(ne),d;function f(){u.forEach((function(e){return e()})),u=[]}return d.setOptions(r).then((function(e){!p&&r.onFirstUpdate&&r.onFirstUpdate(e)})),d}}var oe={passive:!0};var ce={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var i=e.state,n=e.instance,r=e.options,s=r.scroll,a=void 0===s||s,o=r.resize,c=void 0===o||o,l=t(i.elements.popper),u=[].concat(i.scrollParents.reference,i.scrollParents.popper);return a&&u.forEach((function(e){e.addEventListener("scroll",n.update,oe)})),c&&l.addEventListener("resize",n.update,oe),function(){a&&u.forEach((function(e){e.removeEventListener("scroll",n.update,oe)})),c&&l.removeEventListener("resize",n.update,oe)}},data:{}};var le={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=Q({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},ue={top:"auto",right:"auto",bottom:"auto",left:"auto"};function pe(e){var i,n=e.popper,r=e.popperRect,s=e.placement,a=e.variation,o=e.offsets,l=e.position,u=e.gpuAcceleration,p=e.adaptive,d=e.roundOffsets,f=e.isFixed,m=o.x,v=void 0===m?0:m,g=o.y,y=void 0===g?0:g,x="function"==typeof d?d({x:v,y:y}):{x:v,y:y};v=x.x,y=x.y;var _=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),k=I,E=M,T=window;if(p){var C=S(n),B="clientHeight",L="clientWidth";if(C===t(n)&&"static"!==b(C=h(n)).position&&"absolute"===l&&(B="scrollHeight",L="scrollWidth"),s===M||(s===I||s===j)&&a===R)E=A,y-=(f&&C===T&&T.visualViewport?T.visualViewport.height:C[B])-r.height,y*=u?1:-1;if(s===I||(s===M||s===A)&&a===R)k=j,v-=(f&&C===T&&T.visualViewport?T.visualViewport.width:C[L])-r.width,v*=u?1:-1}var O,P=Object.assign({position:l},p&&ue),U=!0===d?function(e,t){var i=e.x,n=e.y,r=t.devicePixelRatio||1;return{x:c(i*r)/r||0,y:c(n*r)/r||0}}({x:v,y:y},t(n)):{x:v,y:y};return v=U.x,y=U.y,u?Object.assign({},P,((O={})[E]=w?"0":"",O[k]=_?"0":"",O.transform=(T.devicePixelRatio||1)<=1?"translate("+v+"px, "+y+"px)":"translate3d("+v+"px, "+y+"px, 0)",O)):Object.assign({},P,((i={})[E]=w?y+"px":"",i[k]=_?v+"px":"",i.transform="",i))}var de={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var i=t.state,n=t.options,r=n.gpuAcceleration,s=void 0===r||r,a=n.adaptive,o=void 0===a||a,c=n.roundOffsets,l=void 0===c||c;if("production"!==e.env.NODE_ENV){var u=b(i.elements.popper).transitionProperty||"";o&&["transform","top","right","bottom","left"].some((function(e){return u.indexOf(e)>=0}))&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',"\n\n",'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.","\n\n","We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var p={placement:K(i.placement),variation:Z(i.placement),popper:i.elements.popper,popperRect:i.rects.popper,gpuAcceleration:s,isFixed:"fixed"===i.options.strategy};null!=i.modifiersData.popperOffsets&&(i.styles.popper=Object.assign({},i.styles.popper,pe(Object.assign({},p,{offsets:i.modifiersData.popperOffsets,position:i.options.strategy,adaptive:o,roundOffsets:l})))),null!=i.modifiersData.arrow&&(i.styles.arrow=Object.assign({},i.styles.arrow,pe(Object.assign({},p,{offsets:i.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),i.attributes.popper=Object.assign({},i.attributes.popper,{"data-popper-placement":i.placement})},data:{}};var fe={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var i=t.styles[e]||{},n=t.attributes[e]||{},s=t.elements[e];r(s)&&f(s)&&(Object.assign(s.style,i),Object.keys(n).forEach((function(e){var t=n[e];!1===t?s.removeAttribute(e):s.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach((function(e){var n=t.elements[e],s=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce((function(e,t){return e[t]="",e}),{});r(n)&&f(n)&&(Object.assign(n.style,a),Object.keys(s).forEach((function(e){n.removeAttribute(e)})))}))}},requires:["computeStyles"]};var he={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,n=e.name,r=i.offset,s=void 0===r?[0,0]:r,a=N.reduce((function(e,i){return e[i]=function(e,t,i){var n=K(e),r=[I,M].indexOf(n)>=0?-1:1,s="function"==typeof i?i(Object.assign({},t,{placement:e})):i,a=s[0],o=s[1];return a=a||0,o=(o||0)*r,[I,j].indexOf(n)>=0?{x:o,y:a}:{x:a,y:o}}(i,t.rects,s),e}),{}),o=a[t.placement],c=o.x,l=o.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[n]=a}},me={left:"right",right:"left",bottom:"top",top:"bottom"};function be(e){return e.replace(/left|right|bottom|top/g,(function(e){return me[e]}))}var ve={start:"end",end:"start"};function ge(e){return e.replace(/start|end/g,(function(e){return ve[e]}))}function ye(t,i){void 0===i&&(i={});var n=i,r=n.placement,s=n.boundary,a=n.rootBoundary,o=n.padding,c=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?N:l,p=Z(r),d=p?c?q:q.filter((function(e){return Z(e)===p})):C,f=d.filter((function(e){return u.indexOf(e)>=0}));0===f.length&&(f=d,"production"!==e.env.NODE_ENV&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var h=f.reduce((function(e,i){return e[i]=ie(t,{placement:i,boundary:s,rootBoundary:a,padding:o})[K(i)],e}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var xe={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var r=i.mainAxis,s=void 0===r||r,a=i.altAxis,o=void 0===a||a,c=i.fallbackPlacements,l=i.padding,u=i.boundary,p=i.rootBoundary,d=i.altBoundary,f=i.flipVariations,h=void 0===f||f,m=i.allowedAutoPlacements,b=t.options.placement,v=K(b),g=c||(v===b||!h?[be(b)]:function(e){if(K(e)===T)return[];var t=be(e);return[ge(e),t,ge(t)]}(b)),y=[b].concat(g).reduce((function(e,i){return e.concat(K(i)===T?ye(t,{placement:i,boundary:u,rootBoundary:p,padding:l,flipVariations:h,allowedAutoPlacements:m}):i)}),[]),x=t.rects.reference,_=t.rects.popper,w=new Map,k=!0,E=y[0],S=0;S=0,P=O?"width":"height",U=ie(t,{placement:C,boundary:u,rootBoundary:p,altBoundary:d,padding:l}),q=O?L?j:I:L?A:M;x[P]>_[P]&&(q=be(q));var N=be(q),D=[];if(s&&D.push(U[R]<=0),o&&D.push(U[q]<=0,U[N]<=0),D.every((function(e){return e}))){E=C,k=!1;break}w.set(C,D)}if(k)for(var z=function(e){var t=y.find((function(t){var i=w.get(t);if(i)return i.slice(0,e).every((function(e){return e}))}));if(t)return E=t,"break"},H=h?3:1;H>0;H--){if("break"===z(H))break}t.placement!==E&&(t.modifiersData[n]._skip=!0,t.placement=E,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function _e(e,t,i){return a(e,o(t,i))}var we={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name,r=i.mainAxis,s=void 0===r||r,c=i.altAxis,l=void 0!==c&&c,u=i.boundary,p=i.rootBoundary,d=i.altBoundary,f=i.padding,h=i.tether,m=void 0===h||h,b=i.tetherOffset,v=void 0===b?0:b,g=ie(t,{boundary:u,rootBoundary:p,padding:f,altBoundary:d}),x=K(t.placement),_=Z(t.placement),w=!_,k=J(x),E="x"===k?"y":"x",T=t.modifiersData.popperOffsets,C=t.rects.reference,R=t.rects.popper,L="function"==typeof v?v(Object.assign({},t.rects,{placement:t.placement})):v,O="number"==typeof L?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),P=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,U={x:0,y:0};if(T){if(s){var q,N="y"===k?M:I,D="y"===k?A:j,z="y"===k?"height":"width",H=T[k],F=H+g[N],W=H-g[D],V=m?-R[z]/2:0,$=_===B?C[z]:R[z],G=_===B?-R[z]:-C[z],X=t.elements.arrow,Y=m&&X?y(X):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Q[N],te=Q[D],ne=_e(0,C[z],Y[z]),re=w?C[z]/2-V-ne-ee-O.mainAxis:$-ne-ee-O.mainAxis,se=w?-C[z]/2+V+ne+te+O.mainAxis:G+ne+te+O.mainAxis,ae=t.elements.arrow&&S(t.elements.arrow),oe=ae?"y"===k?ae.clientTop||0:ae.clientLeft||0:0,ce=null!=(q=null==P?void 0:P[k])?q:0,le=H+se-ce,ue=_e(m?o(F,H+re-ce-oe):F,H,m?a(W,le):W);T[k]=ue,U[k]=ue-H}if(l){var pe,de="x"===k?M:I,fe="x"===k?A:j,he=T[E],me="y"===E?"height":"width",be=he+g[de],ve=he-g[fe],ge=-1!==[M,I].indexOf(x),ye=null!=(pe=null==P?void 0:P[E])?pe:0,xe=ge?be:he-C[me]-R[me]-ye+O.altAxis,we=ge?he+C[me]+R[me]-ye-O.altAxis:ve,ke=m&&ge?function(e,t,i){var n=_e(e,t,i);return n>i?i:n}(xe,he,we):_e(m?xe:be,he,m?we:ve);T[E]=ke,U[E]=ke-he}t.modifiersData[n]=U}},requiresIfExists:["offset"]};var ke={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,n=e.name,r=e.options,s=i.elements.arrow,a=i.modifiersData.popperOffsets,o=K(i.placement),c=J(o),l=[I,j].indexOf(o)>=0?"height":"width";if(s&&a){var u=function(e,t){return ee("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:te(e,C))}(r.padding,i),p=y(s),d="y"===c?M:I,f="y"===c?A:j,h=i.rects.reference[l]+i.rects.reference[c]-a[c]-i.rects.popper[l],m=a[c]-i.rects.reference[c],b=S(s),v=b?"y"===c?b.clientHeight||0:b.clientWidth||0:0,g=h/2-m/2,x=u[d],_=v-p[l]-u[f],w=v/2-p[l]/2+g,k=_e(x,w,_),E=c;i.modifiersData[n]=((t={})[E]=k,t.centerOffset=k-w,t)}},effect:function(t){var i=t.state,n=t.options.element,s=void 0===n?"[data-popper-arrow]":n;null!=s&&("string"!=typeof s||(s=i.elements.popper.querySelector(s)))&&("production"!==e.env.NODE_ENV&&(r(s)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),$(i.elements.popper,s)?i.elements.arrow=s:"production"!==e.env.NODE_ENV&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" ")))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ee(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function Se(e){return[M,j,A,I].some((function(t){return e[t]>=0}))}var Me={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,n=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,a=ie(t,{elementContext:"reference"}),o=ie(t,{altBoundary:!0}),c=Ee(a,n),l=Ee(o,r,s),u=Se(c),p=Se(l);t.modifiersData[i]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}},Ae=ae({defaultModifiers:[ce,le,de,fe]}),je=[ce,le,de,fe,he,xe,we,ke,Me],Ie=ae({defaultModifiers:je});i.applyStyles=fe,i.arrow=ke,i.computeStyles=de,i.createPopper=Ie,i.createPopperLite=Ae,i.defaultModifiers=je,i.detectOverflow=ie,i.eventListeners=ce,i.flip=xe,i.hide=Me,i.offset=he,i.popperGenerator=ae,i.popperOffsets=le,i.preventOverflow=we}).call(this)}).call(this,e("_process"))},{_process:296}],2:[function(e,t,i){const n=/^\[?([^\]]+)]?:(\d+)$/;let r=new Map;t.exports=function(e){if(1e5===r.size&&r.clear(),!r.has(e)){const t=n.exec(e);if(!t)throw new Error(`invalid addr: ${e}`);r.set(e,[t[1],Number(t[2])])}return r.get(e)}},{}],3:[function(e,t,i){"use strict";const n=i;n.bignum=e("bn.js"),n.define=e("./asn1/api").define,n.base=e("./asn1/base"),n.constants=e("./asn1/constants"),n.decoders=e("./asn1/decoders"),n.encoders=e("./asn1/encoders")},{"./asn1/api":4,"./asn1/base":6,"./asn1/constants":10,"./asn1/decoders":12,"./asn1/encoders":15,"bn.js":17}],4:[function(e,t,i){"use strict";const n=e("./encoders"),r=e("./decoders"),s=e("inherits");function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}i.define=function(e,t){return new a(e,t)},a.prototype._createNamed=function(e){const t=this.name;function i(e){this._initNamed(e,t)}return s(i,e),i.prototype._initNamed=function(t,i){e.call(this,t,i)},new i(this)},a.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(r[e])),this.decoders[e]},a.prototype.decode=function(e,t,i){return this._getDecoder(t).decode(e,i)},a.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},a.prototype.encode=function(e,t,i){return this._getEncoder(t).encode(e,i)}},{"./decoders":12,"./encoders":15,inherits:217}],5:[function(e,t,i){"use strict";const n=e("inherits"),r=e("../base/reporter").Reporter,s=e("safer-buffer").Buffer;function a(e,t){r.call(this,t),s.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function o(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return o.isEncoderBuffer(e)||(e=new o(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=s.byteLength(e);else{if(!s.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(a,r),i.DecoderBuffer=a,a.isDecoderBuffer=function(e){if(e instanceof a)return!0;return"object"==typeof e&&s.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},a.prototype.save=function(){return{offset:this.offset,reporter:r.prototype.save.call(this)}},a.prototype.restore=function(e){const t=new a(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,r.prototype.restore.call(this,e.reporter),t},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},a.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const i=new a(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+e,this.offset+=e,i},a.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},i.EncoderBuffer=o,o.isEncoderBuffer=function(e){if(e instanceof o)return!0;return"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},o.prototype.join=function(e,t){return e||(e=s.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(i){i.join(e,t),t+=i.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):s.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},{"../base/reporter":8,inherits:217,"safer-buffer":339}],6:[function(e,t,i){"use strict";const n=i;n.Reporter=e("./reporter").Reporter,n.DecoderBuffer=e("./buffer").DecoderBuffer,n.EncoderBuffer=e("./buffer").EncoderBuffer,n.Node=e("./node")},{"./buffer":5,"./node":7,"./reporter":8}],7:[function(e,t,i){"use strict";const n=e("../base/reporter").Reporter,r=e("../base/buffer").EncoderBuffer,s=e("../base/buffer").DecoderBuffer,a=e("minimalistic-assert"),o=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o);function l(e,t,i){const n={};this._baseState=n,n.name=i,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}t.exports=l;const u=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];l.prototype.clone=function(){const e=this._baseState,t={};u.forEach((function(i){t[i]=e[i]}));const i=new this.constructor(t.parent);return i._baseState=t,i},l.prototype._wrap=function(){const e=this._baseState;c.forEach((function(t){this[t]=function(){const i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}}),this)},l.prototype._init=function(e){const t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),a.equal(t.children.length,1,"Root node can have only one child")},l.prototype._useArgs=function(e){const t=this._baseState,i=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==i.length&&(a(null===t.children),t.children=i,i.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(i){i==(0|i)&&(i|=0);const n=e[i];t[n]=i})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){l.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),o.forEach((function(e){l.prototype[e]=function(){const t=this._baseState,i=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(i),this}})),l.prototype.use=function(e){a(e);const t=this._baseState;return a(null===t.use),t.use=e,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(e){const t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},l.prototype.explicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},l.prototype.implicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},l.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},l.prototype.key=function(e){const t=this._baseState;return a(null===t.key),t.key=e,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(e){const t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},l.prototype.contains=function(e){const t=this._baseState;return a(null===t.use),t.contains=e,this},l.prototype._decode=function(e,t){const i=this._baseState;if(null===i.parent)return e.wrapResult(i.children[0]._decode(e,t));let n,r=i.default,a=!0,o=null;if(null!==i.key&&(o=e.enterKey(i.key)),i.optional){let n=null;if(null!==i.explicit?n=i.explicit:null!==i.implicit?n=i.implicit:null!==i.tag&&(n=i.tag),null!==n||i.any){if(a=this._peekTag(e,n,i.any),e.isError(a))return a}else{const n=e.save();try{null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t),a=!0}catch(e){a=!1}e.restore(n)}}if(i.obj&&a&&(n=e.enterObject()),a){if(null!==i.explicit){const t=this._decodeTag(e,i.explicit);if(e.isError(t))return t;e=t}const n=e.offset;if(null===i.use&&null===i.choice){let t;i.any&&(t=e.save());const n=this._decodeTag(e,null!==i.implicit?i.implicit:i.tag,i.any);if(e.isError(n))return n;i.any?r=e.raw(t):e=n}if(t&&t.track&&null!==i.tag&&t.track(e.path(),n,e.length,"tagged"),t&&t.track&&null!==i.tag&&t.track(e.path(),e.offset,e.length,"content"),i.any||(r=null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t)),e.isError(r))return r;if(i.any||null!==i.choice||null===i.children||i.children.forEach((function(i){i._decode(e,t)})),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){const n=new s(r);r=this._getUse(i.contains,e._reporterState.obj)._decode(n,t)}}return i.obj&&a&&(r=e.leaveObject(n)),null===i.key||null===r&&!0!==a?null!==o&&e.exitKey(o):e.leaveKey(o,i.key,r),r},l.prototype._decodeGeneric=function(e,t,i){const n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],i):/str$/.test(e)?this._decodeStr(t,e,i):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],i):"objid"===e?this._decodeObjid(t,null,null,i):"gentime"===e||"utctime"===e?this._decodeTime(t,e,i):"null_"===e?this._decodeNull(t,i):"bool"===e?this._decodeBool(t,i):"objDesc"===e?this._decodeStr(t,e,i):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],i):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,i):t.error("unknown tag: "+e)},l.prototype._getUse=function(e,t){const i=this._baseState;return i.useDecoder=this._use(e,t),a(null===i.useDecoder._baseState.parent),i.useDecoder=i.useDecoder._baseState.children[0],i.implicit!==i.useDecoder._baseState.implicit&&(i.useDecoder=i.useDecoder.clone(),i.useDecoder._baseState.implicit=i.implicit),i.useDecoder},l.prototype._decodeChoice=function(e,t){const i=this._baseState;let n=null,r=!1;return Object.keys(i.choice).some((function(s){const a=e.save(),o=i.choice[s];try{const i=o._decode(e,t);if(e.isError(i))return!1;n={type:s,value:i},r=!0}catch(t){return e.restore(a),!1}return!0}),this),r?n:e.error("Choice not matched")},l.prototype._createEncoderBuffer=function(e){return new r(e,this.reporter)},l.prototype._encode=function(e,t,i){const n=this._baseState;if(null!==n.default&&n.default===e)return;const r=this._encodeValue(e,t,i);return void 0===r||this._skipDefault(r,t,i)?void 0:r},l.prototype._encodeValue=function(e,t,i){const r=this._baseState;if(null===r.parent)return r.children[0]._encode(e,t||new n);let s=null;if(this.reporter=t,r.optional&&void 0===e){if(null===r.default)return;e=r.default}let a=null,o=!1;if(r.any)s=this._createEncoderBuffer(e);else if(r.choice)s=this._encodeChoice(e,t);else if(r.contains)a=this._getUse(r.contains,i)._encode(e,t),o=!0;else if(r.children)a=r.children.map((function(i){if("null_"===i._baseState.tag)return i._encode(null,t,e);if(null===i._baseState.key)return t.error("Child should have a key");const n=t.enterKey(i._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const r=i._encode(e[i._baseState.key],t,e);return t.leaveKey(n),r}),this).filter((function(e){return e})),a=this._createEncoderBuffer(a);else if("seqof"===r.tag||"setof"===r.tag){if(!r.args||1!==r.args.length)return t.error("Too many args for : "+r.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const i=this.clone();i._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(i){const n=this._baseState;return this._getUse(n.args[0],e)._encode(i,t)}),i))}else null!==r.use?s=this._getUse(r.use,i)._encode(e,t):(a=this._encodePrimitive(r.tag,e),o=!0);if(!r.any&&null===r.choice){const e=null!==r.implicit?r.implicit:r.tag,i=null===r.implicit?"universal":"context";null===e?null===r.use&&t.error("Tag could be omitted only for .use()"):null===r.use&&(s=this._encodeComposite(e,o,i,a))}return null!==r.explicit&&(s=this._encodeComposite(r.explicit,!1,"context",s)),s},l.prototype._encodeChoice=function(e,t){const i=this._baseState,n=i.choice[e.type];return n||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(i.choice))),n._encode(e.value,t)},l.prototype._encodePrimitive=function(e,t){const i=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&i.args)return this._encodeObjid(t,i.reverseArgs[0],i.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,i.args&&i.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},l.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},l.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},{"../base/buffer":5,"../base/reporter":8,"minimalistic-assert":256}],8:[function(e,t,i){"use strict";const n=e("inherits");function r(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function s(e,t){this.path=e,this.rethrow(t)}i.Reporter=r,r.prototype.isError=function(e){return e instanceof s},r.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},r.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},r.prototype.enterKey=function(e){return this._reporterState.path.push(e)},r.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},r.prototype.leaveKey=function(e,t,i){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=i)},r.prototype.path=function(){return this._reporterState.path.join("/")},r.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},r.prototype.leaveObject=function(e){const t=this._reporterState,i=t.obj;return t.obj=e,i},r.prototype.error=function(e){let t;const i=this._reporterState,n=e instanceof s;if(t=n?e:new s(i.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!i.options.partial)throw t;return n||i.errors.push(t),t},r.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(s,Error),s.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,s),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},{inherits:217}],9:[function(e,t,i){"use strict";function n(e){const t={};return Object.keys(e).forEach((function(i){(0|i)==i&&(i|=0);const n=e[i];t[n]=i})),t}i.tagClass={0:"universal",1:"application",2:"context",3:"private"},i.tagClassByName=n(i.tagClass),i.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},i.tagByName=n(i.tag)},{}],10:[function(e,t,i){"use strict";const n=i;n._reverse=function(e){const t={};return Object.keys(e).forEach((function(i){(0|i)==i&&(i|=0);const n=e[i];t[n]=i})),t},n.der=e("./der")},{"./der":9}],11:[function(e,t,i){"use strict";const n=e("inherits"),r=e("bn.js"),s=e("../base/buffer").DecoderBuffer,a=e("../base/node"),o=e("../constants/der");function c(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new l,this.tree._init(e.body)}function l(e){a.call(this,"der",e)}function u(e,t){let i=e.readUInt8(t);if(e.isError(i))return i;const n=o.tagClass[i>>6],r=0==(32&i);if(31==(31&i)){let n=i;for(i=0;128==(128&n);){if(n=e.readUInt8(t),e.isError(n))return n;i<<=7,i|=127&n}}else i&=31;return{cls:n,primitive:r,tag:i,tagStr:o.tag[i]}}function p(e,t,i){let n=e.readUInt8(i);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;const r=127&n;if(r>4)return e.error("length octect is too long");n=0;for(let t=0;t=31)return n.error("Multi-octet tag encoding unsupported");t||(r|=32);return r|=a.tagClassByName[i||"universal"]<<6,r}(e,t,i,this.reporter);if(n.length<128){const e=r.alloc(2);return e[0]=s,e[1]=n.length,this._createEncoderBuffer([e,n])}let o=1;for(let e=n.length;e>=256;e>>=8)o++;const c=r.alloc(2+o);c[0]=s,c[1]=128|o;for(let e=1+o,t=n.length;t>0;e--,t>>=8)c[e]=255&t;return this._createEncoderBuffer([c,n])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=r.alloc(2*e.length);for(let i=0;i=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let n=0;for(let t=0;t=128;i>>=7)n++}const s=r.alloc(n);let a=s.length-1;for(let t=e.length-1;t>=0;t--){let i=e[t];for(s[a--]=127&i;(i>>=7)>0;)s[a--]=128|127&i}return this._createEncoderBuffer(s)},c.prototype._encodeTime=function(e,t){let i;const n=new Date(e);return"gentime"===t?i=[l(n.getUTCFullYear()),l(n.getUTCMonth()+1),l(n.getUTCDate()),l(n.getUTCHours()),l(n.getUTCMinutes()),l(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?i=[l(n.getUTCFullYear()%100),l(n.getUTCMonth()+1),l(n.getUTCDate()),l(n.getUTCHours()),l(n.getUTCMinutes()),l(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(i,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!r.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=r.from(t)}if(r.isBuffer(e)){let t=e.length;0===e.length&&t++;const i=r.alloc(t);return e.copy(i),0===e.length&&(i[0]=0),this._createEncoderBuffer(i)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let i=1;for(let t=e;t>=256;t>>=8)i++;const n=new Array(i);for(let t=n.length-1;t>=0;t--)n[t]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(r.from(n))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,i){const n=this._baseState;let r;if(null===n.default)return!1;const s=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,i).join()),s.length!==n.defaultBuffer.length)return!1;for(r=0;r=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function c(e,t,i){var n=o(e,i);return i-1>=t&&(n|=o(e,i-1)<<4),n}function l(e,t,i,n){for(var r=0,s=Math.min(e.length,i),a=t;a=49?o-49+10:o>=17?o-17+10:o}return r}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)a=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[s]|=a<>>26-o&67108863,(o+=24)>=26&&(o-=26,s++);else if("le"===i)for(r=0,s=0;r>>26-o&67108863,(o+=24)>=26&&(o-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t,i){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)r=c(e,t,n)<=18?(s-=18,a+=1,this.words[a]|=r>>>26):s+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(s-=18,a+=1,this.words[a]|=r>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var n=0,r=1;r<=67108863;r*=t)n++;n--,r=r/t|0;for(var s=e.length-i,a=s%n,o=Math.min(s,s-a)+i,c=0,u=i;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var u=["","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"],p=[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],d=[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,i){i.negative=t.negative^e.negative;var n=e.length+t.length|0;i.length=n,n=n-1|0;var r=0|e.words[0],s=0|t.words[0],a=r*s,o=67108863&a,c=a/67108864|0;i.words[0]=o;for(var l=1;l>>26,p=67108863&c,d=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=d;f++){var h=l-f|0;u+=(a=(r=0|e.words[h])*(s=0|t.words[f])+p)/67108864|0,p=67108863&a}i.words[l]=0|p,c=0|u}return 0!==c?i.words[l]=0|c:i.length--,i.strip()}s.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var r=0,s=0,a=0;a>>24-r&16777215)||a!==this.length-1?u[6-c.length]+c+i:c+i,(r+=2)>=26&&(r-=26,a--)}for(0!==s&&(i=s.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var l=p[e],f=d[e];i="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modn(f).toString(e);i=(h=h.idivn(f)).isZero()?m+i:u[l-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}n(!1,"Base should be between 2 and 36")},s.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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,i){var r=this.byteLength(),s=i||Math.max(1,r);n(r<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0"),this.strip();var a,o,c="le"===t,l=new e(s),u=this.clone();if(c){for(o=0;!u.isZero();o++)a=u.andln(255),u.iushrn(8),l[o]=a;for(;o=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return 0==(8191&t)&&(i+=13,t>>>=13),0==(127&t)&&(i+=7,t>>>=7),0==(15&t)&&(i+=4,t>>>=4),0==(3&t)&&(i+=2,t>>>=2),0==(1&t)&&i++,i},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;ie.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,i;this.length>e.length?(t=this,i=e):(t=e,i=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var i=e/26|0,r=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<e.length?(i=this,n=e):(i=e,n=this);for(var r=0,s=0;s>>26;for(;0!==r&&s>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.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 i,n,r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,n=e):(i=e,n=this);for(var s=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==s&&a>26,this.words[a]=67108863&t;if(0===s&&a>>13,f=0|a[1],h=8191&f,m=f>>>13,b=0|a[2],v=8191&b,g=b>>>13,y=0|a[3],x=8191&y,_=y>>>13,w=0|a[4],k=8191&w,E=w>>>13,S=0|a[5],M=8191&S,A=S>>>13,j=0|a[6],I=8191&j,T=j>>>13,C=0|a[7],B=8191&C,R=C>>>13,L=0|a[8],O=8191&L,P=L>>>13,U=0|a[9],q=8191&U,N=U>>>13,D=0|o[0],z=8191&D,H=D>>>13,F=0|o[1],W=8191&F,V=F>>>13,K=0|o[2],$=8191&K,G=K>>>13,X=0|o[3],Y=8191&X,Z=X>>>13,J=0|o[4],Q=8191&J,ee=J>>>13,te=0|o[5],ie=8191&te,ne=te>>>13,re=0|o[6],se=8191&re,ae=re>>>13,oe=0|o[7],ce=8191&oe,le=oe>>>13,ue=0|o[8],pe=8191&ue,de=ue>>>13,fe=0|o[9],he=8191&fe,me=fe>>>13;i.negative=e.negative^t.negative,i.length=19;var be=(l+(n=Math.imul(p,z))|0)+((8191&(r=(r=Math.imul(p,H))+Math.imul(d,z)|0))<<13)|0;l=((s=Math.imul(d,H))+(r>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(h,z),r=(r=Math.imul(h,H))+Math.imul(m,z)|0,s=Math.imul(m,H);var ve=(l+(n=n+Math.imul(p,W)|0)|0)+((8191&(r=(r=r+Math.imul(p,V)|0)+Math.imul(d,W)|0))<<13)|0;l=((s=s+Math.imul(d,V)|0)+(r>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,z),r=(r=Math.imul(v,H))+Math.imul(g,z)|0,s=Math.imul(g,H),n=n+Math.imul(h,W)|0,r=(r=r+Math.imul(h,V)|0)+Math.imul(m,W)|0,s=s+Math.imul(m,V)|0;var ge=(l+(n=n+Math.imul(p,$)|0)|0)+((8191&(r=(r=r+Math.imul(p,G)|0)+Math.imul(d,$)|0))<<13)|0;l=((s=s+Math.imul(d,G)|0)+(r>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(x,z),r=(r=Math.imul(x,H))+Math.imul(_,z)|0,s=Math.imul(_,H),n=n+Math.imul(v,W)|0,r=(r=r+Math.imul(v,V)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,V)|0,n=n+Math.imul(h,$)|0,r=(r=r+Math.imul(h,G)|0)+Math.imul(m,$)|0,s=s+Math.imul(m,G)|0;var ye=(l+(n=n+Math.imul(p,Y)|0)|0)+((8191&(r=(r=r+Math.imul(p,Z)|0)+Math.imul(d,Y)|0))<<13)|0;l=((s=s+Math.imul(d,Z)|0)+(r>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(k,z),r=(r=Math.imul(k,H))+Math.imul(E,z)|0,s=Math.imul(E,H),n=n+Math.imul(x,W)|0,r=(r=r+Math.imul(x,V)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,V)|0,n=n+Math.imul(v,$)|0,r=(r=r+Math.imul(v,G)|0)+Math.imul(g,$)|0,s=s+Math.imul(g,G)|0,n=n+Math.imul(h,Y)|0,r=(r=r+Math.imul(h,Z)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,Z)|0;var xe=(l+(n=n+Math.imul(p,Q)|0)|0)+((8191&(r=(r=r+Math.imul(p,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((s=s+Math.imul(d,ee)|0)+(r>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(M,z),r=(r=Math.imul(M,H))+Math.imul(A,z)|0,s=Math.imul(A,H),n=n+Math.imul(k,W)|0,r=(r=r+Math.imul(k,V)|0)+Math.imul(E,W)|0,s=s+Math.imul(E,V)|0,n=n+Math.imul(x,$)|0,r=(r=r+Math.imul(x,G)|0)+Math.imul(_,$)|0,s=s+Math.imul(_,G)|0,n=n+Math.imul(v,Y)|0,r=(r=r+Math.imul(v,Z)|0)+Math.imul(g,Y)|0,s=s+Math.imul(g,Z)|0,n=n+Math.imul(h,Q)|0,r=(r=r+Math.imul(h,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var _e=(l+(n=n+Math.imul(p,ie)|0)|0)+((8191&(r=(r=r+Math.imul(p,ne)|0)+Math.imul(d,ie)|0))<<13)|0;l=((s=s+Math.imul(d,ne)|0)+(r>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(I,z),r=(r=Math.imul(I,H))+Math.imul(T,z)|0,s=Math.imul(T,H),n=n+Math.imul(M,W)|0,r=(r=r+Math.imul(M,V)|0)+Math.imul(A,W)|0,s=s+Math.imul(A,V)|0,n=n+Math.imul(k,$)|0,r=(r=r+Math.imul(k,G)|0)+Math.imul(E,$)|0,s=s+Math.imul(E,G)|0,n=n+Math.imul(x,Y)|0,r=(r=r+Math.imul(x,Z)|0)+Math.imul(_,Y)|0,s=s+Math.imul(_,Z)|0,n=n+Math.imul(v,Q)|0,r=(r=r+Math.imul(v,ee)|0)+Math.imul(g,Q)|0,s=s+Math.imul(g,ee)|0,n=n+Math.imul(h,ie)|0,r=(r=r+Math.imul(h,ne)|0)+Math.imul(m,ie)|0,s=s+Math.imul(m,ne)|0;var we=(l+(n=n+Math.imul(p,se)|0)|0)+((8191&(r=(r=r+Math.imul(p,ae)|0)+Math.imul(d,se)|0))<<13)|0;l=((s=s+Math.imul(d,ae)|0)+(r>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(B,z),r=(r=Math.imul(B,H))+Math.imul(R,z)|0,s=Math.imul(R,H),n=n+Math.imul(I,W)|0,r=(r=r+Math.imul(I,V)|0)+Math.imul(T,W)|0,s=s+Math.imul(T,V)|0,n=n+Math.imul(M,$)|0,r=(r=r+Math.imul(M,G)|0)+Math.imul(A,$)|0,s=s+Math.imul(A,G)|0,n=n+Math.imul(k,Y)|0,r=(r=r+Math.imul(k,Z)|0)+Math.imul(E,Y)|0,s=s+Math.imul(E,Z)|0,n=n+Math.imul(x,Q)|0,r=(r=r+Math.imul(x,ee)|0)+Math.imul(_,Q)|0,s=s+Math.imul(_,ee)|0,n=n+Math.imul(v,ie)|0,r=(r=r+Math.imul(v,ne)|0)+Math.imul(g,ie)|0,s=s+Math.imul(g,ne)|0,n=n+Math.imul(h,se)|0,r=(r=r+Math.imul(h,ae)|0)+Math.imul(m,se)|0,s=s+Math.imul(m,ae)|0;var ke=(l+(n=n+Math.imul(p,ce)|0)|0)+((8191&(r=(r=r+Math.imul(p,le)|0)+Math.imul(d,ce)|0))<<13)|0;l=((s=s+Math.imul(d,le)|0)+(r>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(O,z),r=(r=Math.imul(O,H))+Math.imul(P,z)|0,s=Math.imul(P,H),n=n+Math.imul(B,W)|0,r=(r=r+Math.imul(B,V)|0)+Math.imul(R,W)|0,s=s+Math.imul(R,V)|0,n=n+Math.imul(I,$)|0,r=(r=r+Math.imul(I,G)|0)+Math.imul(T,$)|0,s=s+Math.imul(T,G)|0,n=n+Math.imul(M,Y)|0,r=(r=r+Math.imul(M,Z)|0)+Math.imul(A,Y)|0,s=s+Math.imul(A,Z)|0,n=n+Math.imul(k,Q)|0,r=(r=r+Math.imul(k,ee)|0)+Math.imul(E,Q)|0,s=s+Math.imul(E,ee)|0,n=n+Math.imul(x,ie)|0,r=(r=r+Math.imul(x,ne)|0)+Math.imul(_,ie)|0,s=s+Math.imul(_,ne)|0,n=n+Math.imul(v,se)|0,r=(r=r+Math.imul(v,ae)|0)+Math.imul(g,se)|0,s=s+Math.imul(g,ae)|0,n=n+Math.imul(h,ce)|0,r=(r=r+Math.imul(h,le)|0)+Math.imul(m,ce)|0,s=s+Math.imul(m,le)|0;var Ee=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(r=(r=r+Math.imul(p,de)|0)+Math.imul(d,pe)|0))<<13)|0;l=((s=s+Math.imul(d,de)|0)+(r>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(q,z),r=(r=Math.imul(q,H))+Math.imul(N,z)|0,s=Math.imul(N,H),n=n+Math.imul(O,W)|0,r=(r=r+Math.imul(O,V)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,V)|0,n=n+Math.imul(B,$)|0,r=(r=r+Math.imul(B,G)|0)+Math.imul(R,$)|0,s=s+Math.imul(R,G)|0,n=n+Math.imul(I,Y)|0,r=(r=r+Math.imul(I,Z)|0)+Math.imul(T,Y)|0,s=s+Math.imul(T,Z)|0,n=n+Math.imul(M,Q)|0,r=(r=r+Math.imul(M,ee)|0)+Math.imul(A,Q)|0,s=s+Math.imul(A,ee)|0,n=n+Math.imul(k,ie)|0,r=(r=r+Math.imul(k,ne)|0)+Math.imul(E,ie)|0,s=s+Math.imul(E,ne)|0,n=n+Math.imul(x,se)|0,r=(r=r+Math.imul(x,ae)|0)+Math.imul(_,se)|0,s=s+Math.imul(_,ae)|0,n=n+Math.imul(v,ce)|0,r=(r=r+Math.imul(v,le)|0)+Math.imul(g,ce)|0,s=s+Math.imul(g,le)|0,n=n+Math.imul(h,pe)|0,r=(r=r+Math.imul(h,de)|0)+Math.imul(m,pe)|0,s=s+Math.imul(m,de)|0;var Se=(l+(n=n+Math.imul(p,he)|0)|0)+((8191&(r=(r=r+Math.imul(p,me)|0)+Math.imul(d,he)|0))<<13)|0;l=((s=s+Math.imul(d,me)|0)+(r>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(q,W),r=(r=Math.imul(q,V))+Math.imul(N,W)|0,s=Math.imul(N,V),n=n+Math.imul(O,$)|0,r=(r=r+Math.imul(O,G)|0)+Math.imul(P,$)|0,s=s+Math.imul(P,G)|0,n=n+Math.imul(B,Y)|0,r=(r=r+Math.imul(B,Z)|0)+Math.imul(R,Y)|0,s=s+Math.imul(R,Z)|0,n=n+Math.imul(I,Q)|0,r=(r=r+Math.imul(I,ee)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,ee)|0,n=n+Math.imul(M,ie)|0,r=(r=r+Math.imul(M,ne)|0)+Math.imul(A,ie)|0,s=s+Math.imul(A,ne)|0,n=n+Math.imul(k,se)|0,r=(r=r+Math.imul(k,ae)|0)+Math.imul(E,se)|0,s=s+Math.imul(E,ae)|0,n=n+Math.imul(x,ce)|0,r=(r=r+Math.imul(x,le)|0)+Math.imul(_,ce)|0,s=s+Math.imul(_,le)|0,n=n+Math.imul(v,pe)|0,r=(r=r+Math.imul(v,de)|0)+Math.imul(g,pe)|0,s=s+Math.imul(g,de)|0;var Me=(l+(n=n+Math.imul(h,he)|0)|0)+((8191&(r=(r=r+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;l=((s=s+Math.imul(m,me)|0)+(r>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(q,$),r=(r=Math.imul(q,G))+Math.imul(N,$)|0,s=Math.imul(N,G),n=n+Math.imul(O,Y)|0,r=(r=r+Math.imul(O,Z)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,Z)|0,n=n+Math.imul(B,Q)|0,r=(r=r+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,s=s+Math.imul(R,ee)|0,n=n+Math.imul(I,ie)|0,r=(r=r+Math.imul(I,ne)|0)+Math.imul(T,ie)|0,s=s+Math.imul(T,ne)|0,n=n+Math.imul(M,se)|0,r=(r=r+Math.imul(M,ae)|0)+Math.imul(A,se)|0,s=s+Math.imul(A,ae)|0,n=n+Math.imul(k,ce)|0,r=(r=r+Math.imul(k,le)|0)+Math.imul(E,ce)|0,s=s+Math.imul(E,le)|0,n=n+Math.imul(x,pe)|0,r=(r=r+Math.imul(x,de)|0)+Math.imul(_,pe)|0,s=s+Math.imul(_,de)|0;var Ae=(l+(n=n+Math.imul(v,he)|0)|0)+((8191&(r=(r=r+Math.imul(v,me)|0)+Math.imul(g,he)|0))<<13)|0;l=((s=s+Math.imul(g,me)|0)+(r>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(q,Y),r=(r=Math.imul(q,Z))+Math.imul(N,Y)|0,s=Math.imul(N,Z),n=n+Math.imul(O,Q)|0,r=(r=r+Math.imul(O,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,n=n+Math.imul(B,ie)|0,r=(r=r+Math.imul(B,ne)|0)+Math.imul(R,ie)|0,s=s+Math.imul(R,ne)|0,n=n+Math.imul(I,se)|0,r=(r=r+Math.imul(I,ae)|0)+Math.imul(T,se)|0,s=s+Math.imul(T,ae)|0,n=n+Math.imul(M,ce)|0,r=(r=r+Math.imul(M,le)|0)+Math.imul(A,ce)|0,s=s+Math.imul(A,le)|0,n=n+Math.imul(k,pe)|0,r=(r=r+Math.imul(k,de)|0)+Math.imul(E,pe)|0,s=s+Math.imul(E,de)|0;var je=(l+(n=n+Math.imul(x,he)|0)|0)+((8191&(r=(r=r+Math.imul(x,me)|0)+Math.imul(_,he)|0))<<13)|0;l=((s=s+Math.imul(_,me)|0)+(r>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(q,Q),r=(r=Math.imul(q,ee))+Math.imul(N,Q)|0,s=Math.imul(N,ee),n=n+Math.imul(O,ie)|0,r=(r=r+Math.imul(O,ne)|0)+Math.imul(P,ie)|0,s=s+Math.imul(P,ne)|0,n=n+Math.imul(B,se)|0,r=(r=r+Math.imul(B,ae)|0)+Math.imul(R,se)|0,s=s+Math.imul(R,ae)|0,n=n+Math.imul(I,ce)|0,r=(r=r+Math.imul(I,le)|0)+Math.imul(T,ce)|0,s=s+Math.imul(T,le)|0,n=n+Math.imul(M,pe)|0,r=(r=r+Math.imul(M,de)|0)+Math.imul(A,pe)|0,s=s+Math.imul(A,de)|0;var Ie=(l+(n=n+Math.imul(k,he)|0)|0)+((8191&(r=(r=r+Math.imul(k,me)|0)+Math.imul(E,he)|0))<<13)|0;l=((s=s+Math.imul(E,me)|0)+(r>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(q,ie),r=(r=Math.imul(q,ne))+Math.imul(N,ie)|0,s=Math.imul(N,ne),n=n+Math.imul(O,se)|0,r=(r=r+Math.imul(O,ae)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,ae)|0,n=n+Math.imul(B,ce)|0,r=(r=r+Math.imul(B,le)|0)+Math.imul(R,ce)|0,s=s+Math.imul(R,le)|0,n=n+Math.imul(I,pe)|0,r=(r=r+Math.imul(I,de)|0)+Math.imul(T,pe)|0,s=s+Math.imul(T,de)|0;var Te=(l+(n=n+Math.imul(M,he)|0)|0)+((8191&(r=(r=r+Math.imul(M,me)|0)+Math.imul(A,he)|0))<<13)|0;l=((s=s+Math.imul(A,me)|0)+(r>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(q,se),r=(r=Math.imul(q,ae))+Math.imul(N,se)|0,s=Math.imul(N,ae),n=n+Math.imul(O,ce)|0,r=(r=r+Math.imul(O,le)|0)+Math.imul(P,ce)|0,s=s+Math.imul(P,le)|0,n=n+Math.imul(B,pe)|0,r=(r=r+Math.imul(B,de)|0)+Math.imul(R,pe)|0,s=s+Math.imul(R,de)|0;var Ce=(l+(n=n+Math.imul(I,he)|0)|0)+((8191&(r=(r=r+Math.imul(I,me)|0)+Math.imul(T,he)|0))<<13)|0;l=((s=s+Math.imul(T,me)|0)+(r>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(q,ce),r=(r=Math.imul(q,le))+Math.imul(N,ce)|0,s=Math.imul(N,le),n=n+Math.imul(O,pe)|0,r=(r=r+Math.imul(O,de)|0)+Math.imul(P,pe)|0,s=s+Math.imul(P,de)|0;var Be=(l+(n=n+Math.imul(B,he)|0)|0)+((8191&(r=(r=r+Math.imul(B,me)|0)+Math.imul(R,he)|0))<<13)|0;l=((s=s+Math.imul(R,me)|0)+(r>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(q,pe),r=(r=Math.imul(q,de))+Math.imul(N,pe)|0,s=Math.imul(N,de);var Re=(l+(n=n+Math.imul(O,he)|0)|0)+((8191&(r=(r=r+Math.imul(O,me)|0)+Math.imul(P,he)|0))<<13)|0;l=((s=s+Math.imul(P,me)|0)+(r>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Le=(l+(n=Math.imul(q,he))|0)+((8191&(r=(r=Math.imul(q,me))+Math.imul(N,he)|0))<<13)|0;return l=((s=Math.imul(N,me))+(r>>>13)|0)+(Le>>>26)|0,Le&=67108863,c[0]=be,c[1]=ve,c[2]=ge,c[3]=ye,c[4]=xe,c[5]=_e,c[6]=we,c[7]=ke,c[8]=Ee,c[9]=Se,c[10]=Me,c[11]=Ae,c[12]=je,c[13]=Ie,c[14]=Te,c[15]=Ce,c[16]=Be,c[17]=Re,c[18]=Le,0!==l&&(c[19]=l,i.length++),i};function m(e,t,i){return(new b).mulp(e,t,i)}function b(e,t){this.x=e,this.y=t}Math.imul||(h=f),s.prototype.mulTo=function(e,t){var i,n=this.length+e.length;return i=10===this.length&&10===e.length?h(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,i){i.negative=t.negative^e.negative,i.length=e.length+t.length;for(var n=0,r=0,s=0;s>>26)|0)>>>26,a&=67108863}i.words[s]=o,n=a,a=r}return 0!==n?i.words[s]=n:i.length--,i.strip()}(this,e,t):m(this,e,t),i},b.prototype.makeRBT=function(e){for(var t=new Array(e),i=s.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,i,n,r,s){for(var a=0;a>>=1)r++;return 1<>>=13,i[2*a+1]=8191&s,s>>>=13;for(a=2*t;a>=26,t+=r/67108864|0,t+=s>>>26,this.words[i]=67108863&s}return 0!==t&&(this.words[i]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),i=0;i>>r}return t}(e);if(0===t.length)return new s(1);for(var i=this,n=0;n=0);var t,i=e%26,r=(e-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){var a=0;for(t=0;t>>26-i}a&&(this.words[t]=a,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var s=e%26,a=Math.min((e-s)/26,this.length),o=67108863^67108863>>>s<a)for(this.length-=a,l=0;l=0&&(0!==u||l>=r);l--){var p=0|this.words[l];this.words[l]=u<<26-s|p>>>s,u=p&o}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,i){return n(0===this.negative),this.iushrn(e,t,i)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,r=1<=0);var t=e%26,i=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var r=67108863^67108863>>>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},s.prototype.isubn=function(e){if(n("number"==typeof e),n(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>26)-(c/67108864|0),this.words[r+i]=67108863&s}for(;r>26,this.words[r+i]=67108863&s;if(0===o)return this.strip();for(n(-1===o),o=0,r=0;r>26,this.words[r]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var i=(this.length,e.length),n=this.clone(),r=e,a=0|r.words[r.length-1];0!==(i=26-this._countBits(a))&&(r=r.ushln(i),n.iushln(i),a=0|r.words[r.length-1]);var o,c=n.length-r.length;if("mod"!==t){(o=new s(null)).length=c+1,o.words=new Array(o.length);for(var l=0;l=0;p--){var d=67108864*(0|n.words[r.length+p])+(0|n.words[r.length+p-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(r,d,p);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(r,1,p),n.isZero()||(n.negative^=1);o&&(o.words[p]=d)}return o&&o.strip(),n.strip(),"div"!==t&&0!==i&&n.iushrn(i),{div:o||null,mod:n}},s.prototype.divmod=function(e,t,i){return n(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(r=o.div.neg()),"div"!==t&&(a=o.mod.neg(),i&&0!==a.negative&&a.iadd(e)),{div:r,mod:a}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(a=o.mod.neg(),i&&0!==a.negative&&a.isub(e)),{div:o.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,a,o},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var i=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),r=e.andln(1),s=i.cmp(n);return s<0||1===r&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,i=0,r=this.length-1;r>=0;r--)i=(t*i+(0|this.words[r]))%e;return i},s.prototype.idivn=function(e){n(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*t;this.words[i]=r/e|0,t=r%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new s(1),a=new s(0),o=new s(0),c=new s(1),l=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++l;for(var u=i.clone(),p=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(r.isOdd()||a.isOdd())&&(r.iadd(u),a.isub(p)),r.iushrn(1),a.iushrn(1);for(var h=0,m=1;0==(i.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(i.iushrn(h);h-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(u),c.isub(p)),o.iushrn(1),c.iushrn(1);t.cmp(i)>=0?(t.isub(i),r.isub(o),a.isub(c)):(i.isub(t),o.isub(r),c.isub(a))}return{a:o,b:c,gcd:i.iushln(l)}},s.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,a=new s(1),o=new s(0),c=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,u=1;0==(t.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var p=0,d=1;0==(i.words[0]&d)&&p<26;++p,d<<=1);if(p>0)for(i.iushrn(p);p-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(i)>=0?(t.isub(i),a.isub(o)):(i.isub(t),o.isub(a))}return(r=0===t.cmpn(1)?a:o).cmpn(0)<0&&r.iadd(e),r},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),i=e.clone();t.negative=0,i.negative=0;for(var n=0;t.isEven()&&i.isEven();n++)t.iushrn(1),i.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;i.isEven();)i.iushrn(1);var r=t.cmp(i);if(r<0){var s=t;t=i,i=s}else if(0===r||0===i.cmpn(1))break;t.isub(i)}return i.iushln(n)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,i=(e-t)/26,r=1<>>26,o&=67108863,this.words[a]=o}return 0!==s&&(this.words[a]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),n(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;i--){var n=0|this.words[i],r=0|e.words[i];if(n!==r){nr&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new k(e)},s.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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)}g.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,i=e;do{this.split(i,this.tmp),t=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},r(y,g),y.prototype.split=function(e,t){for(var i=4194303,n=Math.min(e.length,9),r=0;r>>22,s=a}s>>>=22,e.words[r-10]=s,0===s&&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,i=0;i>>=26,e.words[i]=r,t=n}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new x;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return v[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var i=e.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var i=e.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i},k.prototype.sub=function(e,t){this._verify2(e,t);var i=e.sub(t);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var i=e.isub(t);return i.cmpn(0)<0&&i.iadd(this.m),i},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var i=this.m.add(new s(1)).iushrn(2);return this.pow(e,i)}for(var r=this.m.subn(1),a=0;!r.isZero()&&0===r.andln(1);)a++,r.iushrn(1);n(!r.isZero());var o=new s(1).toRed(this),c=o.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);0!==this.pow(u,l).cmp(c);)u.redIAdd(c);for(var p=this.pow(u,r),d=this.pow(e,r.addn(1).iushrn(1)),f=this.pow(e,r),h=a;0!==f.cmp(o);){for(var m=f,b=0;0!==m.cmp(o);b++)m=m.redSqr();n(b=0;n--){for(var l=t.words[n],u=c-1;u>=0;u--){var p=l>>u&1;r!==i[0]&&(r=this.sqr(r)),0!==p||0!==a?(a<<=1,a|=p,(4===++o||0===n&&0===u)&&(r=this.mul(r,i[a]),o=0,a=0)):o=0}c=26}return r},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new E(e)},r(E,k),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(n).iushrn(this.shift),s=r;return r.cmp(this.m)>=0?s=r.isub(this.m):r.cmpn(0)<0&&(s=r.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var i=e.mul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(n).iushrn(this.shift),a=r;return r.cmp(this.m)>=0?a=r.isub(this.m):r.cmpn(0)<0&&(a=r.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:67}],18:[function(e,t,i){"use strict";i.byteLength=function(e){var t=l(e),i=t[0],n=t[1];return 3*(i+n)/4-n},i.toByteArray=function(e){var t,i,n=l(e),a=n[0],o=n[1],c=new s(function(e,t,i){return 3*(t+i)/4-i}(0,a,o)),u=0,p=o>0?a-4:a;for(i=0;i>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===o&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,c[u++]=255&t);1===o&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},i.fromByteArray=function(e){for(var t,i=e.length,r=i%3,s=[],a=16383,o=0,c=i-r;oc?c:o+a));1===r?(t=e[i-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return s.join("")};for(var n=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,c=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function u(e,t,i){for(var r,s,a=[],o=t;o>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},{}],19:[function(e,t,i){(function(e){(function(){function i(e,t,i){let n=0,r=1;for(let s=t;s=48)n=10*n+(i-48);else if(s!==t||43!==i){if(s!==t||45!==i){if(46===i)break;throw new Error("not a number: buffer["+s+"] = "+i)}r=-1}}return n*r}function n(t,i,r,s){return null==t||0===t.length?null:("number"!=typeof i&&null==s&&(s=i,i=void 0),"number"!=typeof r&&null==s&&(s=r,r=void 0),n.position=0,n.encoding=s||null,n.data=e.isBuffer(t)?t.slice(i,r):e.from(t),n.bytes=n.data.length,n.next())}n.bytes=0,n.position=0,n.data=null,n.encoding=null,n.next=function(){switch(n.data[n.position]){case 100:return n.dictionary();case 108:return n.list();case 105:return n.integer();default:return n.buffer()}},n.find=function(e){let t=n.position;const i=n.data.length,r=n.data;for(;t{const r=t.split("-").map((e=>parseInt(e)));return e.concat(((e,t=e)=>Array.from({length:t-e+1},((t,i)=>i+e)))(...r))}),[])}t.exports=n,t.exports.parse=n,t.exports.compose=function(e){return e.reduce(((e,t,i,n)=>(0!==i&&t===n[i-1]+1||e.push([]),e[e.length-1].push(t),e)),[]).map((e=>e.length>1?`${e[0]}-${e[e.length-1]}`:`${e[0]}`))}},{}],25:[function(e,t,i){t.exports=function(e,t,i,n,r){var s,a;if(void 0===n)n=0;else if((n|=0)<0||n>=e.length)throw new RangeError("invalid lower bound");if(void 0===r)r=e.length-1;else if((r|=0)=e.length)throw new RangeError("invalid upper bound");for(;n<=r;)if((a=+i(e[s=n+(r-n>>>1)],t,s,e))<0)n=s+1;else{if(!(a>0))return s;r=s-1}return~n}},{}],26:[function(e,t,i){"use strict";function n(e){var t=e>>3;return e%8!=0&&t++,t}Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function e(e,t){void 0===e&&(e=0);var i=null==t?void 0:t.grow;this.grow=i&&isFinite(i)&&n(i)||i||0,this.buffer="number"==typeof e?new Uint8Array(n(e)):e}return e.prototype.get=function(e){var t=e>>3;return t>e%8)},e.prototype.set=function(e,t){void 0===t&&(t=!0);var i=e>>3;if(t){if(this.buffer.length>e%8}else i>e%8))},e.prototype.forEach=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=8*this.buffer.length);for(var n=t,r=n>>3,s=128>>n%8,a=this.buffer[r];n>1},e}();i.default=r},{}],27:[function(e,t,i){(function(i){(function(){ /*! bittorrent-protocol. MIT License. WebTorrent LLC */ const n=e("unordered-array-remove"),r=e("bencode"),s=e("bitfield").default,a=e("crypto"),o=e("debug")("bittorrent-protocol"),c=e("randombytes"),l=e("simple-sha1"),u=e("speedometer"),p=e("readable-stream"),d=e("rc4"),f=i.from("BitTorrent protocol"),h=i.from([0,0,0,0]),m=i.from([0,0,0,1,0]),b=i.from([0,0,0,1,1]),v=i.from([0,0,0,1,2]),g=i.from([0,0,0,1,3]),y=[0,0,0,0,0,0,0,0],x=[0,0,0,3,9,0,0],_=i.from([0,0,0,1,14]),w=i.from([0,0,0,1,15]),k=i.from([0,0,0,0,0,0,0,0]),E=i.from([0,0,1,2]),S=i.from([0,0,0,2]);function M(e,t){for(let i=e.length;i--;)e[i]^=t[i];return e}class A{constructor(e,t,i,n){this.piece=e,this.offset=t,this.length=i,this.callback=n}}class j{constructor(){this.buffer=new Uint8Array}get(e){return!0}set(e){}}class I extends p.Duplex{constructor(e=null,t=0,i=!1){super(),this._debugId=c(4).toString("hex"),this._debug("new wire"),this.peerId=null,this.peerIdBuffer=null,this.type=e,this.amChoking=!0,this.amInterested=!1,this.peerChoking=!0,this.peerInterested=!1,this.peerPieces=new s(0,{grow:4e5}),this.extensions={},this.peerExtensions={},this.requests=[],this.peerRequests=[],this.extendedMapping={},this.peerExtendedMapping={},this.extendedHandshake={},this.peerExtendedHandshake={},this.hasFast=!1,this.allowedFastSet=[],this.peerAllowedFastSet=[],this._ext={},this._nextExt=1,this.uploaded=0,this.downloaded=0,this.uploadSpeed=u(),this.downloadSpeed=u(),this._keepAliveInterval=null,this._timeout=null,this._timeoutMs=0,this._timeoutExpiresAt=null,this.destroyed=!1,this._finished=!1,this._parserSize=0,this._parser=null,this._buffer=[],this._bufferSize=0,this._peEnabled=i,i?(this._dh=a.createDiffieHellman("ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a36210000000000090563","hex",2),this._myPubKey=this._dh.generateKeys("hex")):this._myPubKey=null,this._peerPubKey=null,this._sharedSecret=null,this._peerCryptoProvide=[],this._cryptoHandshakeDone=!1,this._cryptoSyncPattern=null,this._waitMaxBytes=null,this._encryptionMethod=null,this._encryptGenerator=null,this._decryptGenerator=null,this._setGenerators=!1,this.once("finish",(()=>this._onFinish())),this.on("finish",this._onFinish),this._debug("type:",this.type),"tcpIncoming"===this.type&&this._peEnabled?this._determineHandshakeType():"tcpOutgoing"===this.type&&this._peEnabled&&0===t?this._parsePe2():this._parseHandshake(null)}setKeepAlive(e){this._debug("setKeepAlive %s",e),clearInterval(this._keepAliveInterval),!1!==e&&(this._keepAliveInterval=setInterval((()=>{this.keepAlive()}),55e3))}setTimeout(e,t){this._debug("setTimeout ms=%d unref=%s",e,t),this._timeoutMs=e,this._timeoutUnref=!!t,this._resetTimeout(!0)}destroy(){if(!this.destroyed)return this.destroyed=!0,this._debug("destroy"),this.emit("close"),this.end(),this}end(...e){return this._debug("end"),this._onUninterested(),this._onChoke(),super.end(...e)}use(e){const t=e.prototype.name;if(!t)throw new Error('Extension class requires a "name" property on the prototype');this._debug("use extension.name=%s",t);const i=this._nextExt,n=new e(this);function r(){}"function"!=typeof n.onHandshake&&(n.onHandshake=r),"function"!=typeof n.onExtendedHandshake&&(n.onExtendedHandshake=r),"function"!=typeof n.onMessage&&(n.onMessage=r),this.extendedMapping[i]=t,this._ext[t]=n,this[t]=n,this._nextExt+=1}keepAlive(){this._debug("keep-alive"),this._push(h)}sendPe1(){if(this._peEnabled){const e=Math.floor(513*Math.random()),t=c(e);this._push(i.concat([i.from(this._myPubKey,"hex"),t]))}}sendPe2(){const e=Math.floor(513*Math.random()),t=c(e);this._push(i.concat([i.from(this._myPubKey,"hex"),t]))}sendPe3(e){this.setEncrypt(this._sharedSecret,e);const t=i.from(l.sync(i.from(this._utfToHex("req1")+this._sharedSecret,"hex")),"hex"),n=M(i.from(l.sync(i.from(this._utfToHex("req2")+e,"hex")),"hex"),i.from(l.sync(i.from(this._utfToHex("req3")+this._sharedSecret,"hex")),"hex")),r=c(2).readUInt16BE(0)%512,s=c(r);let a=i.alloc(14+r+2);k.copy(a),E.copy(a,8),a.writeInt16BE(r,12),s.copy(a,14),a.writeInt16BE(0,14+r),a=this._encryptHandshake(a),this._push(i.concat([t,n,a]))}sendPe4(e){this.setEncrypt(this._sharedSecret,e);const t=c(2).readUInt16BE(0)%512,n=c(t);let r=i.alloc(14+t);k.copy(r),S.copy(r,8),r.writeInt16BE(t,12),n.copy(r,14),r=this._encryptHandshake(r),this._push(r),this._cryptoHandshakeDone=!0,this._debug("completed crypto handshake")}handshake(e,t,n){let r,s;if("string"==typeof e?(e=e.toLowerCase(),r=i.from(e,"hex")):(r=e,e=r.toString("hex")),"string"==typeof t?s=i.from(t,"hex"):(s=t,t=s.toString("hex")),this._infoHash=r,20!==r.length||20!==s.length)throw new Error("infoHash and peerId MUST have length 20");this._debug("handshake i=%s p=%s exts=%o",e,t,n);const a=i.from(y);this.extensions={extended:!0,dht:!(!n||!n.dht),fast:!(!n||!n.fast)},a[5]|=16,this.extensions.dht&&(a[7]|=1),this.extensions.fast&&(a[7]|=4),this.extensions.fast&&this.peerExtensions.fast&&(this._debug("fast extension is enabled"),this.hasFast=!0),this._push(i.concat([f,a,r,s])),this._handshakeSent=!0,this.peerExtensions.extended&&!this._extendedHandshakeSent&&this._sendExtendedHandshake()}_sendExtendedHandshake(){const e=Object.assign({},this.extendedHandshake);e.m={};for(const t in this.extendedMapping){const i=this.extendedMapping[t];e.m[i]=Number(t)}this.extended(0,r.encode(e)),this._extendedHandshakeSent=!0}choke(){if(!this.amChoking)if(this.amChoking=!0,this._debug("choke"),this._push(m),this.hasFast){let e=0;for(;this.peerRequests.length>e;){const t=this.peerRequests[e];this.allowedFastSet.includes(t.piece)?++e:this.reject(t.piece,t.offset,t.length)}}else for(;this.peerRequests.length;)this.peerRequests.pop()}unchoke(){this.amChoking&&(this.amChoking=!1,this._debug("unchoke"),this._push(b))}interested(){this.amInterested||(this.amInterested=!0,this._debug("interested"),this._push(v))}uninterested(){this.amInterested&&(this.amInterested=!1,this._debug("uninterested"),this._push(g))}have(e){this._debug("have %d",e),this._message(4,[e],null)}bitfield(e){this._debug("bitfield"),i.isBuffer(e)||(e=e.buffer),this._message(5,[],e)}request(e,t,i,n){return n||(n=()=>{}),this._finished?n(new Error("wire is closed")):!this.peerChoking||this.hasFast&&this.peerAllowedFastSet.includes(e)?(this._debug("request index=%d offset=%d length=%d",e,t,i),this.requests.push(new A(e,t,i,n)),this._timeout||this._resetTimeout(!0),void this._message(6,[e,t,i],null)):n(new Error("peer is choking"))}piece(e,t,i){this._debug("piece index=%d offset=%d",e,t),this._message(7,[e,t],i),this.uploaded+=i.length,this.uploadSpeed(i.length),this.emit("upload",i.length)}cancel(e,t,i){this._debug("cancel index=%d offset=%d length=%d",e,t,i),this._callback(this._pull(this.requests,e,t,i),new Error("request was cancelled"),null),this._message(8,[e,t,i],null)}port(e){this._debug("port %d",e);const t=i.from(x);t.writeUInt16BE(e,5),this._push(t)}suggest(e){if(!this.hasFast)throw Error("fast extension is disabled");this._debug("suggest %d",e),this._message(13,[e],null)}haveAll(){if(!this.hasFast)throw Error("fast extension is disabled");this._debug("have-all"),this._push(_)}haveNone(){if(!this.hasFast)throw Error("fast extension is disabled");this._debug("have-none"),this._push(w)}reject(e,t,i){if(!this.hasFast)throw Error("fast extension is disabled");this._debug("reject index=%d offset=%d length=%d",e,t,i),this._pull(this.peerRequests,e,t,i),this._message(16,[e,t,i],null)}allowedFast(e){if(!this.hasFast)throw Error("fast extension is disabled");this._debug("allowed-fast %d",e),this.allowedFastSet.includes(e)||this.allowedFastSet.push(e),this._message(17,[e],null)}extended(e,t){if(this._debug("extended ext=%s",e),"string"==typeof e&&this.peerExtendedMapping[e]&&(e=this.peerExtendedMapping[e]),"number"!=typeof e)throw new Error(`Unrecognized extension: ${e}`);{const n=i.from([e]),s=i.isBuffer(t)?t:r.encode(t);this._message(20,[],i.concat([n,s]))}}setEncrypt(e,t){let n,r,s,a,o,c;switch(this.type){case"tcpIncoming":n=l.sync(i.from(this._utfToHex("keyB")+e+t,"hex")),r=l.sync(i.from(this._utfToHex("keyA")+e+t,"hex")),s=i.from(n,"hex"),a=[];for(const e of s.values())a.push(e);o=i.from(r,"hex"),c=[];for(const e of o.values())c.push(e);this._encryptGenerator=new d(a),this._decryptGenerator=new d(c);break;case"tcpOutgoing":n=l.sync(i.from(this._utfToHex("keyA")+e+t,"hex")),r=l.sync(i.from(this._utfToHex("keyB")+e+t,"hex")),s=i.from(n,"hex"),a=[];for(const e of s.values())a.push(e);o=i.from(r,"hex"),c=[];for(const e of o.values())c.push(e);this._encryptGenerator=new d(a),this._decryptGenerator=new d(c);break;default:return!1}for(let e=0;e<1024;e++)this._encryptGenerator.randomByte(),this._decryptGenerator.randomByte();return this._setGenerators=!0,!0}_read(){}_message(e,t,n){const r=n?n.length:0,s=i.allocUnsafe(5+4*t.length);s.writeUInt32BE(s.length+r-4,0),s[4]=e;for(let e=0;e{if(r===this._pull(this.peerRequests,e,t,i))return n?(this._debug("error satisfying request index=%d offset=%d length=%d (%s)",e,t,i,n.message),void(this.hasFast&&this.reject(e,t,i))):void this.piece(e,t,s)},r=new A(e,t,i,n);this.peerRequests.push(r),this.emit("request",e,t,i,n)}_onPiece(e,t,i){this._debug("got piece index=%d offset=%d",e,t),this._callback(this._pull(this.requests,e,t,i.length),null,i),this.downloaded+=i.length,this.downloadSpeed(i.length),this.emit("download",i.length),this.emit("piece",e,t,i)}_onCancel(e,t,i){this._debug("got cancel index=%d offset=%d length=%d",e,t,i),this._pull(this.peerRequests,e,t,i),this.emit("cancel",e,t,i)}_onPort(e){this._debug("got port %d",e),this.emit("port",e)}_onSuggest(e){if(!this.hasFast)return this._debug("Error: got suggest whereas fast extension is disabled"),void this.destroy();this._debug("got suggest %d",e),this.emit("suggest",e)}_onHaveAll(){if(!this.hasFast)return this._debug("Error: got have-all whereas fast extension is disabled"),void this.destroy();this._debug("got have-all"),this.peerPieces=new j,this.emit("have-all")}_onHaveNone(){if(!this.hasFast)return this._debug("Error: got have-none whereas fast extension is disabled"),void this.destroy();this._debug("got have-none"),this.emit("have-none")}_onReject(e,t,i){if(!this.hasFast)return this._debug("Error: got reject whereas fast extension is disabled"),void this.destroy();this._debug("got reject index=%d offset=%d length=%d",e,t,i),this._callback(this._pull(this.requests,e,t,i),new Error("request was rejected"),null),this.emit("reject",e,t,i)}_onAllowedFast(e){if(!this.hasFast)return this._debug("Error: got allowed-fast whereas fast extension is disabled"),void this.destroy();this._debug("got allowed-fast %d",e),this.peerAllowedFastSet.includes(e)||this.peerAllowedFastSet.push(e),this.peerAllowedFastSet.length>100&&this.peerAllowedFastSet.shift(),this.emit("allowed-fast",e)}_onExtended(e,t){if(0===e){let e;try{e=r.decode(t)}catch(e){this._debug("ignoring invalid extended handshake: %s",e.message||e)}if(!e)return;if(this.peerExtendedHandshake=e,"object"==typeof e.m)for(const t in e.m)this.peerExtendedMapping[t]=Number(e.m[t].toString());for(const e in this._ext)this.peerExtendedMapping[e]&&this._ext[e].onExtendedHandshake(this.peerExtendedHandshake);this._debug("got extended handshake"),this.emit("extended","handshake",this.peerExtendedHandshake)}else this.extendedMapping[e]&&(e=this.extendedMapping[e],this._ext[e]&&this._ext[e].onMessage(t)),this._debug("got extended message ext=%s",e),this.emit("extended",e,t)}_onTimeout(){this._debug("request timed out"),this._callback(this.requests.shift(),new Error("request has timed out"),null),this.emit("timeout")}_write(e,t,n){if(2===this._encryptionMethod&&this._cryptoHandshakeDone&&(e=this._decrypt(e)),this._bufferSize+=e.length,this._buffer.push(e),this._buffer.length>1&&(this._buffer=[i.concat(this._buffer,this._bufferSize)]),this._cryptoSyncPattern){const t=this._buffer[0].indexOf(this._cryptoSyncPattern);if(-1!==t)this._buffer[0]=this._buffer[0].slice(t+this._cryptoSyncPattern.length),this._bufferSize-=t+this._cryptoSyncPattern.length,this._cryptoSyncPattern=null;else if(this._bufferSize+e.length>this._waitMaxBytes+this._cryptoSyncPattern.length)return this._debug("Error: could not resynchronize"),void this.destroy()}for(;this._bufferSize>=this._parserSize&&!this._cryptoSyncPattern;)if(0===this._parserSize)this._parser(i.from([]));else{const e=this._buffer[0];this._bufferSize-=this._parserSize,this._buffer=this._bufferSize?[e.slice(this._parserSize)]:[],this._parser(e.slice(0,this._parserSize))}n(null)}_callback(e,t,i){e&&(this._resetTimeout(!this.peerChoking&&!this._finished),e.callback(t,i))}_resetTimeout(e){if(!e||!this._timeoutMs||!this.requests.length)return clearTimeout(this._timeout),this._timeout=null,void(this._timeoutExpiresAt=null);const t=Date.now()+this._timeoutMs;if(this._timeout){if(t-this._timeoutExpiresAt<.05*this._timeoutMs)return;clearTimeout(this._timeout)}this._timeoutExpiresAt=t,this._timeout=setTimeout((()=>this._onTimeout()),this._timeoutMs),this._timeoutUnref&&this._timeout.unref&&this._timeout.unref()}_parse(e,t){this._parserSize=e,this._parser=t}_parseUntil(e,t){this._cryptoSyncPattern=e,this._waitMaxBytes=t}_onMessageLength(e){const t=e.readUInt32BE(0);t>0?this._parse(t,this._onMessage):(this._onKeepAlive(),this._parse(4,this._onMessageLength))}_onMessage(e){switch(this._parse(4,this._onMessageLength),e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 13:return this._onSuggest(e.readUInt32BE(1));case 14:return this._onHaveAll();case 15:return this._onHaveNone();case 16:return this._onReject(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 17:return this._onAllowedFast(e.readUInt32BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:return this._debug("got unknown message"),this.emit("unknownmessage",e)}}_determineHandshakeType(){this._parse(1,(e=>{const t=e.readUInt8(0);19===t?this._parse(t+48,this._onHandshakeBuffer):this._parsePe1(e)}))}_parsePe1(e){this._parse(95,(t=>{this._onPe1(i.concat([e,t])),this._parsePe3()}))}_parsePe2(){this._parse(96,(e=>{for(this._onPe2(e);!this._setGenerators;);this._parsePe4()}))}_parsePe3(){const e=i.from(l.sync(i.from(this._utfToHex("req1")+this._sharedSecret,"hex")),"hex");this._parseUntil(e,512),this._parse(20,(e=>{for(this._onPe3(e);!this._setGenerators;);this._parsePe3Encrypted()}))}_parsePe3Encrypted(){this._parse(14,(e=>{const t=this._decryptHandshake(e.slice(0,8)),i=this._decryptHandshake(e.slice(8,12)),n=this._decryptHandshake(e.slice(12,14)).readUInt16BE(0);this._parse(n,(e=>{e=this._decryptHandshake(e),this._parse(2,(n=>{const r=this._decryptHandshake(n).readUInt16BE(0);this._parse(r,(n=>{n=this._decryptHandshake(n),this._onPe3Encrypted(t,i,e,n);const s=r?n.readUInt8(0):null,a=r?n.slice(1,20):null;19===s&&"BitTorrent protocol"===a.toString()?this._onHandshakeBuffer(n.slice(1)):this._parseHandshake()}))}))}))}))}_parsePe4(){const e=this._decryptHandshake(k);this._parseUntil(e,512),this._parse(6,(e=>{const t=this._decryptHandshake(e.slice(0,4)),i=this._decryptHandshake(e.slice(4,6)).readUInt16BE(0);this._parse(i,(e=>{this._decryptHandshake(e),this._onPe4(t),this._parseHandshake(null)}))}))}_parseHandshake(){this._parse(1,(e=>{const t=e.readUInt8(0);if(19!==t)return this._debug("Error: wire not speaking BitTorrent protocol (%s)",t.toString()),void this.end();this._parse(t+48,this._onHandshakeBuffer)}))}_onHandshakeBuffer(e){const t=e.slice(0,19);if("BitTorrent protocol"!==t.toString())return this._debug("Error: wire not speaking BitTorrent protocol (%s)",t.toString()),void this.end();e=e.slice(19),this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(1&e[7]),fast:!!(4&e[7]),extended:!!(16&e[5])}),this._parse(4,this._onMessageLength)}_onFinish(){for(this._finished=!0,this.push(null);this.read(););for(clearInterval(this._keepAliveInterval),this._parse(Number.MAX_VALUE,(()=>{}));this.peerRequests.length;)this.peerRequests.pop();for(;this.requests.length;)this._callback(this.requests.pop(),new Error("wire was closed"),null)}_debug(...e){e[0]=`[${this._debugId}] ${e[0]}`,o(...e)}_pull(e,t,i,r){for(let s=0;s2?"one of ".concat(t," ").concat(e.slice(0,i-1).join(", "),", or ")+e[i-1]:2===i?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,i){var n,r,a,o;if("string"==typeof t&&(r="not ",t.substr(!a||a<0?0:+a,r.length)===r)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,i){return(void 0===i||i>e.length)&&(i=e.length),e.substring(i-t.length,i)===t}(e," argument"))o="The ".concat(e," ").concat(n," ").concat(s(t,"type"));else{var c=function(e,t,i){return"number"!=typeof i&&(i=0),!(i+t.length>e.length)&&-1!==e.indexOf(t,i)}(e,".")?"property":"argument";o='The "'.concat(e,'" ').concat(c," ").concat(n," ").concat(s(t,"type"))}return o+=". Received type ".concat(typeof i)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],29:[function(e,t,i){(function(i){(function(){"use strict";var n=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};t.exports=l;var r=e("./_stream_readable"),s=e("./_stream_writable");e("inherits")(l,r);for(var a=n(s.prototype),o=0;o0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===o.prototype||(t=function(e){return o.from(e)}(t)),n)a.endEmitted?w(e,new _):A(e,a,t,!0);else if(a.ended)w(e,new y);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!i?(t=a.decoder.write(t),a.objectMode||0!==t.length?A(e,a,t,!1):B(e,a)):A(e,a,t,!1)}else n||(a.reading=!1,B(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=j?e=j:(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 T(e){var t=e._readableState;l("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(C,e))}function C(e){var t=e._readableState;l("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,U(e)}function B(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function O(e){l("readable nexttick read 0"),e.read(0)}function P(e,t){l("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),U(e),t.flowing&&!t.reading&&e.read(0)}function U(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function q(e,t){return 0===t.length?null:(t.objectMode?i=t.buffer.shift():!e||e>=t.length?(i=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):i=t.buffer.consume(e,t.decoder),i);var i}function N(e){var t=e._readableState;l("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(D,t,e))}function D(e,t){if(l("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var i=t._writableState;(!i||i.autoDestroy&&i.finished)&&t.destroy()}}function z(e,t){for(var i=0,n=e.length;i=t.highWaterMark:t.length>0)||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?N(this):T(this),null;if(0===(e=I(e,t))&&t.ended)return 0===t.length&&N(this),null;var n,r=t.needReadable;return l("need readable",r),(0===t.length||t.length-e0?q(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),i!==e&&t.ended&&N(this)),null!==n&&this.emit("data",n),n},S.prototype._read=function(e){w(this,new x("_read()"))},S.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,l("pipe count=%d opts=%j",r.pipesCount,t);var a=(!t||!1!==t.end)&&e!==i.stdout&&e!==i.stderr?c:b;function o(t,i){l("onunpipe"),t===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,l("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),e.removeListener("drain",u),e.removeListener("error",f),e.removeListener("unpipe",o),n.removeListener("end",c),n.removeListener("end",b),n.removeListener("data",d),p=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function c(){l("onend"),e.end()}r.endEmitted?i.nextTick(a):n.once("end",a),e.on("unpipe",o);var u=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,U(e))}}(n);e.on("drain",u);var p=!1;function d(t){l("ondata");var i=e.write(t);l("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==z(r.pipes,e))&&!p&&(l("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function f(t){l("onerror",t),b(),e.removeListener("error",f),0===s(e,"error")&&w(e,t)}function h(){e.removeListener("finish",m),b()}function m(){l("onfinish"),e.removeListener("close",h),b()}function b(){l("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,i){if("function"==typeof e.prependListener)return e.prependListener(t,i);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]:e.on(t,i)}(e,"error",f),e.once("close",h),e.once("finish",m),e.emit("pipe",n),r.flowing||(l("pipe resume"),n.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,i={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,i)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,l("on readable",r.length,r.reading),r.length?T(this):r.reading||i.nextTick(O,this))),n},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(L,this),n},S.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(L,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(P,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,i=this._readableState,n=!1;for(var r in e.on("end",(function(){if(l("wrapped end"),i.decoder&&!i.ended){var e=i.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(r){(l("wrapped data"),i.decoder&&(r=i.decoder.write(r)),i.objectMode&&null==r)||(i.objectMode||r&&r.length)&&(t.push(r)||(n=!0,e.pause()))})),e)void 0===this[r]&&"function"==typeof e[r]&&(this[r]=function(t){return function(){return e[t].apply(e,arguments)}}(r));for(var s=0;s-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,i){i(new m("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,C(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=p.destroy,S.prototype._undestroy=p.undestroy,S.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":28,"./_stream_duplex":29,"./internal/streams/destroy":36,"./internal/streams/state":40,"./internal/streams/stream":41,_process:296,buffer:110,inherits:217,"util-deprecate":440}],34:[function(e,t,i){(function(i){(function(){"use strict";var n;function r(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var s=e("./end-of-stream"),a=Symbol("lastResolve"),o=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),u=Symbol("lastPromise"),p=Symbol("handlePromise"),d=Symbol("stream");function f(e,t){return{value:e,done:t}}function h(e){var t=e[a];if(null!==t){var i=e[d].read();null!==i&&(e[u]=null,e[a]=null,e[o]=null,t(f(i,!1)))}}function m(e){i.nextTick(h,e)}var b=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((r(n={get stream(){return this[d]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise((function(t,n){i.nextTick((function(){e[c]?n(e[c]):t(f(void 0,!0))}))}));var n,r=this[u];if(r)n=new Promise(function(e,t){return function(i,n){e.then((function(){t[l]?i(f(void 0,!0)):t[p](i,n)}),n)}}(r,this));else{var s=this[d].read();if(null!==s)return Promise.resolve(f(s,!1));n=new Promise(this[p])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),r(n,"return",(function(){var e=this;return new Promise((function(t,i){e[d].destroy(null,(function(e){e?i(e):t(f(void 0,!0))}))}))})),n),b);t.exports=function(e){var t,i=Object.create(v,(r(t={},d,{value:e,writable:!0}),r(t,a,{value:null,writable:!0}),r(t,o,{value:null,writable:!0}),r(t,c,{value:null,writable:!0}),r(t,l,{value:e._readableState.endEmitted,writable:!0}),r(t,p,{value:function(e,t){var n=i[d].read();n?(i[u]=null,i[a]=null,i[o]=null,e(f(n,!1))):(i[a]=e,i[o]=t)},writable:!0}),t));return i[u]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=i[o];return null!==t&&(i[u]=null,i[a]=null,i[o]=null,t(e)),void(i[c]=e)}var n=i[a];null!==n&&(i[u]=null,i[a]=null,i[o]=null,n(f(void 0,!0))),i[l]=!0})),e.on("readable",m.bind(null,i)),i}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":37,_process:296}],35:[function(e,t,i){"use strict";function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function r(e){for(var t=1;t0?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,i=""+t.data;t=t.next;)i+=e+t.data;return i}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t,i,n,r=c.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,i=r,n=a,c.prototype.copy.call(t,i,n),a+=s.data.length,s=s.next;return r}},{key:"consume",value:function(e,t){var i;return er.length?r.length:e;if(s===r.length?n+=r:n+=r.slice(0,e),0==(e-=s)){s===r.length?(++i,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=r.slice(s));break}++i}return this.length-=i,n}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),i=this.head,n=1;for(i.data.copy(t),e-=i.data.length;i=i.next;){var r=i.data,s=e>r.length?r.length:e;if(r.copy(t,t.length-e,0,s),0==(e-=s)){s===r.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=r.slice(s));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return l(this,r(r({},t),{},{depth:0,customInspect:!1}))}}])&&a(t.prototype,i),n&&a(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},{buffer:110,util:67}],36:[function(e,t,i){(function(e){(function(){"use strict";function i(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}t.exports={destroy:function(t,s){var a=this,o=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return o||c?(s?s(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(r,this,t)):e.nextTick(r,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!s&&t?a._writableState?a._writableState.errorEmitted?e.nextTick(n,a):(a._writableState.errorEmitted=!0,e.nextTick(i,a,t)):e.nextTick(i,a,t):s?(e.nextTick(n,a),s(t)):e.nextTick(n,a)})),this)},undestroy: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)},errorOrDestroy:function(e,t){var i=e._readableState,n=e._writableState;i&&i.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:296}],37:[function(e,t,i){"use strict";var n=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function r(){}t.exports=function e(t,i,s){if("function"==typeof i)return e(t,null,i);i||(i={}),s=function(e){var t=!1;return function(){if(!t){t=!0;for(var i=arguments.length,n=new Array(i),r=0;r0,(function(e){u||(u=e),e&&d.forEach(c),s||(d.forEach(c),p(u))}))}));return i.reduce(l)}},{"../../../errors":28,"./end-of-stream":37}],40:[function(e,t,i){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,i,r){var s=function(e,t,i){return null!=e.highWaterMark?e.highWaterMark:t?e[i]:null}(t,r,i);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new n(r?i:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},{"../../../errors":28}],41:[function(e,t,i){t.exports=e("events").EventEmitter},{events:178}],42:[function(e,t,i){(i=t.exports=e("./lib/_stream_readable.js")).Stream=i,i.Readable=i,i.Writable=e("./lib/_stream_writable.js"),i.Duplex=e("./lib/_stream_duplex.js"),i.Transform=e("./lib/_stream_transform.js"),i.PassThrough=e("./lib/_stream_passthrough.js"),i.finished=e("./lib/internal/streams/end-of-stream.js"),i.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":29,"./lib/_stream_passthrough.js":30,"./lib/_stream_readable.js":31,"./lib/_stream_transform.js":32,"./lib/_stream_writable.js":33,"./lib/internal/streams/end-of-stream.js":37,"./lib/internal/streams/pipeline.js":39}],43:[function(e,t,i){(function(i,n){(function(){const r=e("debug")("bittorrent-tracker:client"),s=e("events"),a=e("once"),o=e("run-parallel"),c=e("simple-peer"),l=e("queue-microtask"),u=e("./lib/common"),p=e("./lib/client/http-tracker"),d=e("./lib/client/udp-tracker"),f=e("./lib/client/websocket-tracker");class h extends s{constructor(e={}){if(super(),!e.peerId)throw new Error("Option `peerId` is required");if(!e.infoHash)throw new Error("Option `infoHash` is required");if(!e.announce)throw new Error("Option `announce` is required");if(!i.browser&&!e.port)throw new Error("Option `port` is required");this.peerId="string"==typeof e.peerId?e.peerId:e.peerId.toString("hex"),this._peerIdBuffer=n.from(this.peerId,"hex"),this._peerIdBinary=this._peerIdBuffer.toString("binary"),this.infoHash="string"==typeof e.infoHash?e.infoHash.toLowerCase():e.infoHash.toString("hex"),this._infoHashBuffer=n.from(this.infoHash,"hex"),this._infoHashBinary=this._infoHashBuffer.toString("binary"),r("new client %s",this.infoHash),this.destroyed=!1,this._port=e.port,this._getAnnounceOpts=e.getAnnounceOpts,this._rtcConfig=e.rtcConfig,this._userAgent=e.userAgent,this._proxyOpts=e.proxyOpts,this._wrtc="function"==typeof e.wrtc?e.wrtc():e.wrtc;let t="string"==typeof e.announce?[e.announce]:null==e.announce?[]:e.announce;t=t.map((e=>("/"===(e=e.toString())[e.length-1]&&(e=e.substring(0,e.length-1)),e))),t=Array.from(new Set(t));const s=!1!==this._wrtc&&(!!this._wrtc||c.WEBRTC_SUPPORT),a=e=>{l((()=>{this.emit("warning",e)}))};this._trackers=t.map((e=>{let t;try{t=u.parseUrl(e)}catch(t){return a(new Error(`Invalid tracker URL: ${e}`)),null}const i=t.port;if(i<0||i>65535)return a(new Error(`Invalid tracker port: ${e}`)),null;const n=t.protocol;return"http:"!==n&&"https:"!==n||"function"!=typeof p?"udp:"===n&&"function"==typeof d?new d(this,e):"ws:"!==n&&"wss:"!==n||!s||"ws:"===n&&"undefined"!=typeof window&&"https:"===window.location.protocol?(a(new Error(`Unsupported tracker protocol: ${e}`)),null):new f(this,e):new p(this,e)})).filter(Boolean)}start(e){(e=this._defaultAnnounceOpts(e)).event="started",r("send `start` %o",e),this._announce(e),this._trackers.forEach((e=>{e.setInterval()}))}stop(e){(e=this._defaultAnnounceOpts(e)).event="stopped",r("send `stop` %o",e),this._announce(e)}complete(e){e||(e={}),(e=this._defaultAnnounceOpts(e)).event="completed",r("send `complete` %o",e),this._announce(e)}update(e){(e=this._defaultAnnounceOpts(e)).event&&delete e.event,r("send `update` %o",e),this._announce(e)}_announce(e){this._trackers.forEach((t=>{t.announce(e)}))}scrape(e){r("send `scrape`"),e||(e={}),this._trackers.forEach((t=>{t.scrape(e)}))}setInterval(e){r("setInterval %d",e),this._trackers.forEach((t=>{t.setInterval(e)}))}destroy(e){if(this.destroyed)return;this.destroyed=!0,r("destroy");const t=this._trackers.map((e=>t=>{e.destroy(t)}));o(t,e),this._trackers=[],this._getAnnounceOpts=null}_defaultAnnounceOpts(e={}){return null==e.numwant&&(e.numwant=u.DEFAULT_ANNOUNCE_PEERS),null==e.uploaded&&(e.uploaded=0),null==e.downloaded&&(e.downloaded=0),this._getAnnounceOpts&&(e=Object.assign({},e,this._getAnnounceOpts())),e}}h.scrape=(e,t)=>{if(t=a(t),!e.infoHash)throw new Error("Option `infoHash` is required");if(!e.announce)throw new Error("Option `announce` is required");const i=Object.assign({},e,{infoHash:Array.isArray(e.infoHash)?e.infoHash[0]:e.infoHash,peerId:n.from("01234567890123456789"),port:6881}),r=new h(i);r.once("error",t),r.once("warning",t);let s=Array.isArray(e.infoHash)?e.infoHash.length:1;const o={};return r.on("scrape",(e=>{if(s-=1,o[e.infoHash]=e,0===s){r.destroy();const e=Object.keys(o);1===e.length?t(null,o[e[0]]):t(null,o)}})),e.infoHash=Array.isArray(e.infoHash)?e.infoHash.map((e=>n.from(e,"hex"))):n.from(e.infoHash,"hex"),r.scrape({infoHash:e.infoHash}),r},t.exports=h}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/client/http-tracker":67,"./lib/client/udp-tracker":67,"./lib/client/websocket-tracker":45,"./lib/common":46,_process:296,buffer:110,debug:146,events:178,once:281,"queue-microtask":309,"run-parallel":336,"simple-peer":350}],44:[function(e,t,i){const n=e("events");t.exports=class extends n{constructor(e,t){super(),this.client=e,this.announceUrl=t,this.interval=null,this.destroyed=!1}setInterval(e){null==e&&(e=this.DEFAULT_ANNOUNCE_INTERVAL),clearInterval(this.interval),e&&(this.interval=setInterval((()=>{this.announce(this.client._defaultAnnounceOpts())}),e),this.interval.unref&&this.interval.unref())}}},{events:178}],45:[function(e,t,i){const n=e("clone"),r=e("debug")("bittorrent-tracker:websocket-tracker"),s=e("simple-peer"),a=e("randombytes"),o=e("simple-websocket"),c=e("socks"),l=e("../common"),u=e("./tracker"),p={};class d extends u{constructor(e,t){super(e,t),r("new websocket tracker %s",t),this.peers={},this.socket=null,this.reconnecting=!1,this.retries=0,this.reconnectTimer=null,this.expectingResponse=!1,this._openSocket()}announce(e){if(this.destroyed||this.reconnecting)return;if(!this.socket.connected)return void this.socket.once("connect",(()=>{this.announce(e)}));const t=Object.assign({},e,{action:"announce",info_hash:this.client._infoHashBinary,peer_id:this.client._peerIdBinary});if(this._trackerId&&(t.trackerid=this._trackerId),"stopped"===e.event||"completed"===e.event)this._send(t);else{const i=Math.min(e.numwant,5);this._generateOffers(i,(e=>{t.numwant=i,t.offers=e,this._send(t)}))}}scrape(e){if(this.destroyed||this.reconnecting)return;if(!this.socket.connected)return void this.socket.once("connect",(()=>{this.scrape(e)}));const t={action:"scrape",info_hash:Array.isArray(e.infoHash)&&e.infoHash.length>0?e.infoHash.map((e=>e.toString("binary"))):e.infoHash&&e.infoHash.toString("binary")||this.client._infoHashBinary};this._send(t)}destroy(e=f){if(this.destroyed)return e(null);this.destroyed=!0,clearInterval(this.interval),clearTimeout(this.reconnectTimer);for(const e in this.peers){const t=this.peers[e];clearTimeout(t.trackerTimeout),t.destroy()}if(this.peers=null,this.socket&&(this.socket.removeListener("connect",this._onSocketConnectBound),this.socket.removeListener("data",this._onSocketDataBound),this.socket.removeListener("close",this._onSocketCloseBound),this.socket.removeListener("error",this._onSocketErrorBound),this.socket=null),this._onSocketConnectBound=null,this._onSocketErrorBound=null,this._onSocketDataBound=null,this._onSocketCloseBound=null,p[this.announceUrl]&&(p[this.announceUrl].consumers-=1),p[this.announceUrl].consumers>0)return e();let t,i=p[this.announceUrl];if(delete p[this.announceUrl],i.on("error",f),i.once("close",e),!this.expectingResponse)return n();function n(){t&&(clearTimeout(t),t=null),i.removeListener("data",n),i.destroy(),i=null}t=setTimeout(n,l.DESTROY_TIMEOUT),i.once("data",n)}_openSocket(){if(this.destroyed=!1,this.peers||(this.peers={}),this._onSocketConnectBound=()=>{this._onSocketConnect()},this._onSocketErrorBound=e=>{this._onSocketError(e)},this._onSocketDataBound=e=>{this._onSocketData(e)},this._onSocketCloseBound=()=>{this._onSocketClose()},this.socket=p[this.announceUrl],this.socket)p[this.announceUrl].consumers+=1,this.socket.connected&&this._onSocketConnectBound();else{const e=new URL(this.announceUrl);let t;this.client._proxyOpts&&(t="wss:"===e.protocol?this.client._proxyOpts.httpsAgent:this.client._proxyOpts.httpAgent,!t&&this.client._proxyOpts.socksProxy&&(t=new c.Agent(n(this.client._proxyOpts.socksProxy),"wss:"===e.protocol))),this.socket=p[this.announceUrl]=new o({url:this.announceUrl,agent:t}),this.socket.consumers=1,this.socket.once("connect",this._onSocketConnectBound)}this.socket.on("data",this._onSocketDataBound),this.socket.once("close",this._onSocketCloseBound),this.socket.once("error",this._onSocketErrorBound)}_onSocketConnect(){this.destroyed||this.reconnecting&&(this.reconnecting=!1,this.retries=0,this.announce(this.client._defaultAnnounceOpts()))}_onSocketData(e){if(!this.destroyed){this.expectingResponse=!1;try{e=JSON.parse(e)}catch(e){return void this.client.emit("warning",new Error("Invalid tracker response"))}"announce"===e.action?this._onAnnounceResponse(e):"scrape"===e.action?this._onScrapeResponse(e):this._onSocketError(new Error(`invalid action in WS response: ${e.action}`))}}_onAnnounceResponse(e){if(e.info_hash!==this.client._infoHashBinary)return void r("ignoring websocket data from %s for %s (looking for %s: reused socket)",this.announceUrl,l.binaryToHex(e.info_hash),this.client.infoHash);if(e.peer_id&&e.peer_id===this.client._peerIdBinary)return;r("received %s from %s for %s",JSON.stringify(e),this.announceUrl,this.client.infoHash);const t=e["failure reason"];if(t)return this.client.emit("warning",new Error(t));const i=e["warning message"];i&&this.client.emit("warning",new Error(i));const n=e.interval||e["min interval"];n&&this.setInterval(1e3*n);const s=e["tracker id"];if(s&&(this._trackerId=s),null!=e.complete){const t=Object.assign({},e,{announce:this.announceUrl,infoHash:l.binaryToHex(e.info_hash)});this.client.emit("update",t)}let a;if(e.offer&&e.peer_id&&(r("creating peer (from remote offer)"),a=this._createPeer(),a.id=l.binaryToHex(e.peer_id),a.once("signal",(t=>{const i={action:"announce",info_hash:this.client._infoHashBinary,peer_id:this.client._peerIdBinary,to_peer_id:e.peer_id,answer:t,offer_id:e.offer_id};this._trackerId&&(i.trackerid=this._trackerId),this._send(i)})),this.client.emit("peer",a),a.signal(e.offer)),e.answer&&e.peer_id){const t=l.binaryToHex(e.offer_id);a=this.peers[t],a?(a.id=l.binaryToHex(e.peer_id),this.client.emit("peer",a),a.signal(e.answer),clearTimeout(a.trackerTimeout),a.trackerTimeout=null,delete this.peers[t]):r(`got unexpected answer: ${JSON.stringify(e.answer)}`)}}_onScrapeResponse(e){e=e.files||{};const t=Object.keys(e);0!==t.length?t.forEach((t=>{const i=Object.assign(e[t],{announce:this.announceUrl,infoHash:l.binaryToHex(t)});this.client.emit("scrape",i)})):this.client.emit("warning",new Error("invalid scrape response"))}_onSocketClose(){this.destroyed||(this.destroy(),this._startReconnectTimer())}_onSocketError(e){this.destroyed||(this.destroy(),this.client.emit("warning",e),this._startReconnectTimer())}_startReconnectTimer(){const e=Math.floor(3e5*Math.random())+Math.min(1e4*Math.pow(2,this.retries),36e5);this.reconnecting=!0,clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout((()=>{this.retries++,this._openSocket()}),e),this.reconnectTimer.unref&&this.reconnectTimer.unref(),r("reconnecting socket in %s ms",e)}_send(e){if(this.destroyed)return;this.expectingResponse=!0;const t=JSON.stringify(e);r("send %s",t),this.socket.send(t)}_generateOffers(e,t){const i=this,n=[];r("generating %s offers",e);for(let t=0;t{n.push({offer:t,offer_id:l.hexToBinary(e)}),o()})),t.trackerTimeout=setTimeout((()=>{r("tracker timeout: destroying peer"),t.trackerTimeout=null,delete i.peers[e],t.destroy()}),5e4),t.trackerTimeout.unref&&t.trackerTimeout.unref()}function o(){n.length===e&&(r("generated %s offers",e),t(n))}o()}_createPeer(e){const t=this;e=Object.assign({trickle:!1,config:t.client._rtcConfig,wrtc:t.client._wrtc},e);const i=new s(e);return i.once("error",n),i.once("connect",(function e(){i.removeListener("error",n),i.removeListener("connect",e)})),i;function n(e){t.client.emit("warning",new Error(`Connection error: ${e.message}`)),i.destroy()}}}function f(){}d.prototype.DEFAULT_ANNOUNCE_INTERVAL=3e4,d._socketPool=p,t.exports=d},{"../common":46,"./tracker":44,clone:136,debug:146,randombytes:312,"simple-peer":350,"simple-websocket":368,socks:67}],46:[function(e,t,i){(function(t){(function(){i.DEFAULT_ANNOUNCE_PEERS=50,i.MAX_ANNOUNCE_PEERS=82,i.binaryToHex=e=>("string"!=typeof e&&(e=String(e)),t.from(e,"binary").toString("hex")),i.hexToBinary=e=>("string"!=typeof e&&(e=String(e)),t.from(e,"hex").toString("binary")),i.parseUrl=e=>{const t=new URL(e.replace(/^udp:/,"http:"));return e.match(/^udp:/)&&Object.defineProperties(t,{href:{value:t.href.replace(/^http/,"udp")},protocol:{value:t.protocol.replace(/^http/,"udp")},origin:{value:t.origin.replace(/^http/,"udp")}}),t};const n=e("./common-node");Object.assign(i,n)}).call(this)}).call(this,e("buffer").Buffer)},{"./common-node":67,buffer:110}],47:[function(e,t,i){(function(e){(function(){ /*! blob-to-buffer. MIT License. Feross Aboukhadijeh */ @@ -25,9 +25,9 @@ const n=e("lru"),r=e("queue-microtask");t.exports=class{constructor(e,t){if(this * * Licensed MIT © Zeno Rocha */ -var n,r;n=this,r=function(){return function(){var e={686:function(e,t,i){"use strict";i.d(t,{default:function(){return w}});var n=i(279),r=i.n(n),s=i(370),a=i.n(s),o=i(817),c=i.n(o);function l(e){try{return document.execCommand(e)}catch(e){return!1}}var u=function(e){var t=c()(e);return l("cut"),t},p=function(e,t){var i=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),i=document.createElement("textarea");i.style.fontSize="12pt",i.style.border="0",i.style.padding="0",i.style.margin="0",i.style.position="absolute",i.style[t?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;return i.style.top="".concat(n,"px"),i.setAttribute("readonly",""),i.value=e,i}(e);t.container.appendChild(i);var n=c()(i);return l("copy"),i.remove(),n},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},i="";return"string"==typeof e?i=p(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?i=p(e.value,t):(i=c()(e),l("copy")),i};function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}var h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,i=void 0===t?"copy":t,n=e.container,r=e.target,s=e.text;if("copy"!==i&&"cut"!==i)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==r){if(!r||"object"!==f(r)||1!==r.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===i&&r.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===i&&(r.hasAttribute("readonly")||r.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return s?d(s,{container:n}):r?"cut"===i?u(r):d(r,{container:n}):void 0};function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function b(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===m(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=a()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,i=this.action(t)||"copy",n=h({action:i,container:this.container,target:this.target(t),text:this.text(t)});this.emit(n?"success":"error",{action:i,text:n,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return x("action",e)}},{key:"defaultTarget",value:function(e){var t=x("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return x("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],n=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return d(e,t)}},{key:"cut",value:function(e){return u(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,i=!!document.queryCommandSupported;return t.forEach((function(e){i=i&&!!document.queryCommandSupported(e)})),i}}],i&&b(t.prototype,i),n&&b(t,n),s}(r()),w=_},828:function(e){var t=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}e.exports=function(e,i){for(;e&&e.nodeType!==t;){if("function"==typeof e.matches&&e.matches(i))return e;e=e.parentNode}}},438:function(e,t,i){var n=i(828);function r(e,t,i,n,r){var a=s.apply(this,arguments);return e.addEventListener(i,a,r),{destroy:function(){e.removeEventListener(i,a,r)}}}function s(e,t,i,r){return function(i){i.delegateTarget=n(i.target,t),i.delegateTarget&&r.call(e,i)}}e.exports=function(e,t,i,n,s){return"function"==typeof e.addEventListener?r.apply(null,arguments):"function"==typeof i?r.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return r(e,t,i,n,s)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var i=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===i||"[object HTMLCollection]"===i)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,i){var n=i(879),r=i(438);e.exports=function(e,t,i){if(!e&&!t&&!i)throw new Error("Missing required arguments");if(!n.string(t))throw new TypeError("Second argument must be a String");if(!n.fn(i))throw new TypeError("Third argument must be a Function");if(n.node(e))return function(e,t,i){return e.addEventListener(t,i),{destroy:function(){e.removeEventListener(t,i)}}}(e,t,i);if(n.nodeList(e))return function(e,t,i){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,i)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,i)}))}}}(e,t,i);if(n.string(e))return function(e,t,i){return r(document.body,e,t,i)}(e,t,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var i=e.hasAttribute("readonly");i||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),i||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),n.removeAllRanges(),n.addRange(r),t=n.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,i){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:i}),this},once:function(e,t,i){var n=this;function r(){n.off(e,r),t.apply(i,arguments)}return r._=t,this.on(e,r,i)},emit:function(e){for(var t=[].slice.call(arguments,1),i=((this.e||(this.e={}))[e]||[]).slice(),n=0,r=i.length;ni)?t=("rmd160"===e?new c:l(e)).update(t).digest():t.lengtho?t=e(t):t.length1&&void 0!==arguments[1]?arguments[1]:{container:document.body},i="";return"string"==typeof e?i=p(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?i=p(e.value,t):(i=c()(e),l("copy")),i};function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}var h=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,i=void 0===t?"copy":t,n=e.container,r=e.target,s=e.text;if("copy"!==i&&"cut"!==i)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==r){if(!r||"object"!==f(r)||1!==r.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===i&&r.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===i&&(r.hasAttribute("readonly")||r.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return s?d(s,{container:n}):r?"cut"===i?u(r):d(r,{container:n}):void 0};function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function b(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===m(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=a()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,i=this.action(t)||"copy",n=h({action:i,container:this.container,target:this.target(t),text:this.text(t)});this.emit(n?"success":"error",{action:i,text:n,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return x("action",e)}},{key:"defaultTarget",value:function(e){var t=x("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return x("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],n=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return d(e,t)}},{key:"cut",value:function(e){return u(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,i=!!document.queryCommandSupported;return t.forEach((function(e){i=i&&!!document.queryCommandSupported(e)})),i}}],i&&b(t.prototype,i),n&&b(t,n),s}(r()),w=_},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,i){var n=i(828);function r(e,t,i,n,r){var a=s.apply(this,arguments);return e.addEventListener(i,a,r),{destroy:function(){e.removeEventListener(i,a,r)}}}function s(e,t,i,r){return function(i){i.delegateTarget=n(i.target,t),i.delegateTarget&&r.call(e,i)}}e.exports=function(e,t,i,n,s){return"function"==typeof e.addEventListener?r.apply(null,arguments):"function"==typeof i?r.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return r(e,t,i,n,s)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var i=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===i||"[object HTMLCollection]"===i)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,i){var n=i(879),r=i(438);e.exports=function(e,t,i){if(!e&&!t&&!i)throw new Error("Missing required arguments");if(!n.string(t))throw new TypeError("Second argument must be a String");if(!n.fn(i))throw new TypeError("Third argument must be a Function");if(n.node(e))return function(e,t,i){return e.addEventListener(t,i),{destroy:function(){e.removeEventListener(t,i)}}}(e,t,i);if(n.nodeList(e))return function(e,t,i){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,i)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,i)}))}}}(e,t,i);if(n.string(e))return function(e,t,i){return r(document.body,e,t,i)}(e,t,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var i=e.hasAttribute("readonly");i||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),i||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),n.removeAllRanges(),n.addRange(r),t=n.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,i){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:i}),this},once:function(e,t,i){var n=this;function r(){n.off(e,r),t.apply(i,arguments)}return r._=t,this.on(e,r,i)},emit:function(e){for(var t=[].slice.call(arguments,1),i=((this.e||(this.e={}))[e]||[]).slice(),n=0,r=i.length;ni)?t=("rmd160"===e?new c:l(e)).update(t).digest():t.lengtho?t=e(t):t.length */ -const n=e("bencode"),r=e("block-iterator"),s=e("piece-length"),a=e("path"),o=e("is-file"),c=e("junk"),l=e("join-async-iterator"),u=e("run-parallel"),p=e("queue-microtask"),d=e("simple-sha1");e("fast-readable-async-iterator");const f=e("./get-files");const h=Symbol("itemPath");function m(e,t,n){var r;if(r=e,"undefined"!=typeof FileList&&r instanceof FileList&&(e=Array.from(e)),Array.isArray(e)||(e=[e]),0===e.length)throw new Error("invalid input type");e.forEach((e=>{if(null==e)throw new Error(`invalid input type: ${e}`)})),1!==(e=e.map((e=>y(e)&&"string"==typeof e.path&&"function"==typeof f?e.path:e))).length||"string"==typeof e[0]||e[0].name||(e[0].name=t.name);let s=null;e.forEach(((t,i)=>{if("string"==typeof t)return;let n=t.fullPath||t.name;n||(n=`Unknown File ${i+1}`,t.unknownName=!0),t[h]=n.split("/"),t[h][0]||t[h].shift(),t[h].length<2?s=null:0===i&&e.length>1?s=t[h][0]:t[h][0]!==s&&(s=null)}));(void 0===t.filterJunkFiles||t.filterJunkFiles)&&(e=e.filter((e=>"string"==typeof e||!v(e[h])))),s&&e.forEach((e=>{const t=(i.isBuffer(e)||x(e))&&!e[h];"string"==typeof e||t||e[h].shift()})),!t.name&&s&&(t.name=s),t.name||e.some((e=>"string"==typeof e?(t.name=a.basename(e),!0):!e.unknownName&&(t.name=e[h][e[h].length-1],!0))),t.name||(t.name=`Unnamed Torrent ${Date.now()}`);const c=e.reduce(((e,t)=>e+Number("string"==typeof t)),0);let l=1===e.length;if(1===e.length&&"string"==typeof e[0]){if("function"!=typeof f)throw new Error("filesystem paths do not work in the browser");o(e[0],((e,t)=>{if(e)return n(e);l=t,d()}))}else p(d);function d(){u(e.map((e=>t=>{const n={};if(y(e))n.getStream=e.stream(),n.length=e.size;else if(i.isBuffer(e))n.getStream=[e],n.length=e.length;else{if(!x(e)){if("string"==typeof e){if("function"!=typeof f)throw new Error("filesystem paths do not work in the browser");return void f(e,c>1||l,t)}throw new Error("invalid input type")}n.getStream=async function*(e,t){for await(const i of e)t.length+=i.length,yield i}(e,n),n.length=0}n.path=e[h],t(null,n)})),((e,t)=>{if(e)return n(e);t=t.flat(),n(null,t,l)}))}}const b=5;function v(e){const t=e[e.length-1];return"."===t[0]&&c.is(t)}function g(e,t){return e+t.length}function y(e){return"undefined"!=typeof Blob&&e instanceof Blob}function x(e){return"object"==typeof e&&null!=e&&"function"==typeof e.pipe}t.exports=function(e,a,o){"function"==typeof a&&([a,o]=[o,a]),m(e,a=a?Object.assign({},a):{},((e,c,u)=>{if(e)return o(e);a.singleFileTorrent=u,function(e,a,o){let c=a.announceList;c||("string"==typeof a.announce?c=[[a.announce]]:Array.isArray(a.announce)&&(c=a.announce.map((e=>[e]))));c||(c=[]);globalThis.WEBTORRENT_ANNOUNCE&&("string"==typeof globalThis.WEBTORRENT_ANNOUNCE?c.push([[globalThis.WEBTORRENT_ANNOUNCE]]):Array.isArray(globalThis.WEBTORRENT_ANNOUNCE)&&(c=c.concat(globalThis.WEBTORRENT_ANNOUNCE.map((e=>[e])))));void 0===a.announce&&void 0===a.announceList&&(c=c.concat(t.exports.announceList));"string"==typeof a.urlList&&(a.urlList=[a.urlList]);const u={info:{name:a.name},"creation date":Math.ceil((Number(a.creationDate)||Date.now())/1e3),encoding:"UTF-8"};0!==c.length&&(u.announce=c[0][0],u["announce-list"]=c);void 0!==a.comment&&(u.comment=a.comment);void 0!==a.createdBy&&(u["created by"]=a.createdBy);void 0!==a.private&&(u.info.private=Number(a.private));void 0!==a.info&&Object.assign(u.info,a.info);void 0!==a.sslCert&&(u.info["ssl-cert"]=a.sslCert);void 0!==a.urlList&&(u["url-list"]=a.urlList);const p=e.reduce(g,0),f=a.pieceLength||s(p);u.info["piece length"]=f,async function(e,t,n,s,a){const o=[];let c=0,u=0;const p=e.map((e=>e.getStream)),f=s.onProgress;let h=0,m=0,v=!1;const g=r(l(p),t,{zeroPadding:!1});try{for await(const e of g)await new Promise((t=>{c+=e.length;const r=m;++m,++h{o[r]=s,--h,u+=e.length,f&&f(u,n),t(),v&&0===h&&a(null,i.from(o.join(""),"hex"),c)}))}));if(0===h)return a(null,i.from(o.join(""),"hex"),c);v=!0}catch(e){a(e)}}(e,f,p,a,((t,i,r)=>{if(t)return o(t);u.info.pieces=i,e.forEach((e=>{delete e.getStream})),a.singleFileTorrent?u.info.length=r:u.info.files=e,o(null,n.encode(u))}))}(c,a,o)}))},t.exports.parseInput=function(e,t,i){"function"==typeof t&&([t,i]=[i,t]),m(e,t=t?Object.assign({},t):{},i)},t.exports.announceList=[["udp://tracker.leechers-paradise.org:6969"],["udp://tracker.coppersurfer.tk:6969"],["udp://tracker.opentrackr.org:1337"],["udp://explodie.org:6969"],["udp://tracker.empire-js.us:1337"],["wss://tracker.btorrent.xyz"],["wss://tracker.openwebtorrent.com"]],t.exports.isJunkPath=v}).call(this)}).call(this,e("buffer").Buffer)},{"./get-files":67,bencode:22,"block-iterator":48,buffer:110,"fast-readable-async-iterator":183,"is-file":67,"join-async-iterator":220,junk:221,path:288,"piece-length":295,"queue-microtask":309,"run-parallel":336,"simple-sha1":366}],145:[function(e,t,i){"use strict";i.randomBytes=i.rng=i.pseudoRandomBytes=i.prng=e("randombytes"),i.createHash=i.Hash=e("create-hash"),i.createHmac=i.Hmac=e("create-hmac");var n=e("browserify-sign/algos"),r=Object.keys(n),s=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(r);i.getHashes=function(){return s};var a=e("pbkdf2");i.pbkdf2=a.pbkdf2,i.pbkdf2Sync=a.pbkdf2Sync;var o=e("browserify-cipher");i.Cipher=o.Cipher,i.createCipher=o.createCipher,i.Cipheriv=o.Cipheriv,i.createCipheriv=o.createCipheriv,i.Decipher=o.Decipher,i.createDecipher=o.createDecipher,i.Decipheriv=o.Decipheriv,i.createDecipheriv=o.createDecipheriv,i.getCiphers=o.getCiphers,i.listCiphers=o.listCiphers;var c=e("diffie-hellman");i.DiffieHellmanGroup=c.DiffieHellmanGroup,i.createDiffieHellmanGroup=c.createDiffieHellmanGroup,i.getDiffieHellman=c.getDiffieHellman,i.createDiffieHellman=c.createDiffieHellman,i.DiffieHellman=c.DiffieHellman;var l=e("browserify-sign");i.createSign=l.createSign,i.Sign=l.Sign,i.createVerify=l.createVerify,i.Verify=l.Verify,i.createECDH=e("create-ecdh");var u=e("public-encrypt");i.publicEncrypt=u.publicEncrypt,i.privateEncrypt=u.privateEncrypt,i.publicDecrypt=u.publicDecrypt,i.privateDecrypt=u.privateDecrypt;var p=e("randomfill");i.randomFill=p.randomFill,i.randomFillSync=p.randomFillSync,i.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},i.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":85,"browserify-sign":92,"browserify-sign/algos":89,"create-ecdh":138,"create-hash":140,"create-hmac":142,"diffie-hellman":154,pbkdf2:289,"public-encrypt":297,randombytes:312,randomfill:313}],146:[function(e,t,i){(function(n){(function(){i.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;e.splice(1,0,i,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(r=n))})),e.splice(r,0,i)},i.save=function(e){try{e?i.storage.setItem("debug",e):i.storage.removeItem("debug")}catch(e){}},i.load=function(){let e;try{e=i.storage.getItem("debug")}catch(e){}!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG);return e},i.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},i.storage=function(){try{return localStorage}catch(e){}}(),i.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),i.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],i.log=console.debug||console.log||(()=>{}),t.exports=e("./common")(i);const{formatters:r}=t.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this)}).call(this,e("_process"))},{"./common":147,_process:296}],147:[function(e,t,i){t.exports=function(t){function i(e){let t,r,s,a=null;function o(...e){if(!o.enabled)return;const n=o,r=Number(new Date),s=r-(t||r);n.diff=s,n.prev=t,n.curr=r,t=r,e[0]=i.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,r)=>{if("%%"===t)return"%";a++;const s=i.formatters[r];if("function"==typeof s){const i=e[a];t=s.call(n,i),e.splice(a,1),a--}return t})),i.formatArgs.call(n,e);(n.log||i.log).apply(n,e)}return o.namespace=e,o.useColors=i.useColors(),o.color=i.selectColor(e),o.extend=n,o.destroy=i.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(r!==i.namespaces&&(r=i.namespaces,s=i.enabled(e)),s),set:e=>{a=e}}),"function"==typeof i.init&&i.init(o),o}function n(e,t){const n=i(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return i.debug=i,i.default=i,i.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},i.disable=function(){const e=[...i.names.map(r),...i.skips.map(r).map((e=>"-"+e))].join(",");return i.enable(""),e},i.enable=function(e){let t;i.save(e),i.namespaces=e,i.names=[],i.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length;for(t=0;t{i[e]=t[e]})),i.names=[],i.skips=[],i.formatters={},i.selectColor=function(e){let t=0;for(let i=0;i0;n--)t+=this._buffer(e,t),i+=this._flushBuffer(r,i);return t+=this._buffer(e,t),r},r.prototype.final=function(e){var t,i;return e&&(t=this.update(e)),i="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(i):i},r.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>1];i=s.r28shl(i,o),r=s.r28shl(r,o),s.pc2(i,r,e.keys,a)}},c.prototype._update=function(e,t,i,n){var r=this._desState,a=s.readUInt32BE(e,t),o=s.readUInt32BE(e,t+4);s.ip(a,o,r.tmp,0),a=r.tmp[0],o=r.tmp[1],"encrypt"===this.type?this._encrypt(r,a,o,r.tmp,0):this._decrypt(r,a,o,r.tmp,0),a=r.tmp[0],o=r.tmp[1],s.writeUInt32BE(i,a,n),s.writeUInt32BE(i,o,n+4)},c.prototype._pad=function(e,t){for(var i=e.length-t,n=t;n>>0,a=d}s.rip(o,a,n,r)},c.prototype._decrypt=function(e,t,i,n,r){for(var a=i,o=t,c=e.keys.length-2;c>=0;c-=2){var l=e.keys[c],u=e.keys[c+1];s.expand(a,e.tmp,0),l^=e.tmp[0],u^=e.tmp[1];var p=s.substitute(l,u),d=a;a=(o^s.permute(p))>>>0,o=d}s.rip(a,o,n,r)}},{"./cipher":150,"./utils":153,inherits:217,"minimalistic-assert":256}],152:[function(e,t,i){"use strict";var n=e("minimalistic-assert"),r=e("inherits"),s=e("./cipher"),a=e("./des");function o(e,t){n.equal(t.length,24,"Invalid key length");var i=t.slice(0,8),r=t.slice(8,16),s=t.slice(16,24);this.ciphers="encrypt"===e?[a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:r}),a.create({type:"encrypt",key:s})]:[a.create({type:"decrypt",key:s}),a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:i})]}function c(e){s.call(this,e);var t=new o(this.type,this.options.key);this._edeState=t}r(c,s),t.exports=c,c.create=function(e){return new c(e)},c.prototype._update=function(e,t,i,n){var r=this._edeState;r.ciphers[0]._update(e,t,i,n),r.ciphers[1]._update(i,n,i,n),r.ciphers[2]._update(i,n,i,n)},c.prototype._pad=a.prototype._pad,c.prototype._unpad=a.prototype._unpad},{"./cipher":150,"./des":151,inherits:217,"minimalistic-assert":256}],153:[function(e,t,i){"use strict";i.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},i.writeUInt32BE=function(e,t,i){e[0+i]=t>>>24,e[1+i]=t>>>16&255,e[2+i]=t>>>8&255,e[3+i]=255&t},i.ip=function(e,t,i,n){for(var r=0,s=0,a=6;a>=0;a-=2){for(var o=0;o<=24;o+=8)r<<=1,r|=t>>>o+a&1;for(o=0;o<=24;o+=8)r<<=1,r|=e>>>o+a&1}for(a=6;a>=0;a-=2){for(o=1;o<=25;o+=8)s<<=1,s|=t>>>o+a&1;for(o=1;o<=25;o+=8)s<<=1,s|=e>>>o+a&1}i[n+0]=r>>>0,i[n+1]=s>>>0},i.rip=function(e,t,i,n){for(var r=0,s=0,a=0;a<4;a++)for(var o=24;o>=0;o-=8)r<<=1,r|=t>>>o+a&1,r<<=1,r|=e>>>o+a&1;for(a=4;a<8;a++)for(o=24;o>=0;o-=8)s<<=1,s|=t>>>o+a&1,s<<=1,s|=e>>>o+a&1;i[n+0]=r>>>0,i[n+1]=s>>>0},i.pc1=function(e,t,i,n){for(var r=0,s=0,a=7;a>=5;a--){for(var o=0;o<=24;o+=8)r<<=1,r|=t>>o+a&1;for(o=0;o<=24;o+=8)r<<=1,r|=e>>o+a&1}for(o=0;o<=24;o+=8)r<<=1,r|=t>>o+a&1;for(a=1;a<=3;a++){for(o=0;o<=24;o+=8)s<<=1,s|=t>>o+a&1;for(o=0;o<=24;o+=8)s<<=1,s|=e>>o+a&1}for(o=0;o<=24;o+=8)s<<=1,s|=e>>o+a&1;i[n+0]=r>>>0,i[n+1]=s>>>0},i.r28shl=function(e,t){return e<>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];i.pc2=function(e,t,i,r){for(var s=0,a=0,o=n.length>>>1,c=0;c>>n[c]&1;for(c=o;c>>n[c]&1;i[r+0]=s>>>0,i[r+1]=a>>>0},i.expand=function(e,t,i){var n=0,r=0;n=(1&e)<<5|e>>>27;for(var s=23;s>=15;s-=4)n<<=6,n|=e>>>s&63;for(s=11;s>=3;s-=4)r|=e>>>s&63,r<<=6;r|=(31&e)<<1|e>>>31,t[i+0]=n>>>0,t[i+1]=r>>>0};var r=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];i.substitute=function(e,t){for(var i=0,n=0;n<4;n++){i<<=4,i|=r[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){i<<=4,i|=r[256+64*n+(t>>>18-6*n&63)]}return i>>>0};var s=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];i.permute=function(e){for(var t=0,i=0;i>>s[i]&1;return t>>>0},i.padSplit=function(e,t,i){for(var n=e.toString(2);n.lengthe;)i.ishrn(1);if(i.isEven()&&i.iadd(o),i.testn(1)||i.iadd(c),t.cmp(c)){if(!t.cmp(l))for(;i.mod(u).cmp(p);)i.iadd(f)}else for(;i.mod(s).cmp(d);)i.iadd(f);if(b(h=i.shrn(1))&&b(i)&&v(h)&&v(i)&&a.test(h)&&a.test(i))return i}}},{"bn.js":158,"miller-rabin":247,randombytes:312}],157:[function(e,t,i){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],158:[function(e,t,i){arguments[4][17][0].apply(i,arguments)},{buffer:67,dup:17}],159:[function(e,t,i){"use strict";var n=i;n.version=e("../package.json").version,n.utils=e("./elliptic/utils"),n.rand=e("brorand"),n.curve=e("./elliptic/curve"),n.curves=e("./elliptic/curves"),n.ec=e("./elliptic/ec"),n.eddsa=e("./elliptic/eddsa")},{"../package.json":175,"./elliptic/curve":162,"./elliptic/curves":165,"./elliptic/ec":166,"./elliptic/eddsa":169,"./elliptic/utils":173,brorand:66}],160:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("../utils"),s=r.getNAF,a=r.getJSF,o=r.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(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 i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function l(e,t){this.curve=e,this.type=t,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){o(e.precomputed);var i=e._getDoubles(),n=s(t,1,this._bitLength),r=(1<=a;u--)c=(c<<1)+n[u];l.push(c)}for(var p=this.jpoint(null,null,null),d=this.jpoint(null,null,null),f=r;f>0;f--){for(a=0;a=0;l--){for(var u=0;l>=0&&0===a[l];l--)u++;if(l>=0&&u++,c=c.dblp(u),l<0)break;var p=a[l];o(0!==p),c="affine"===e.type?p>0?c.mixedAdd(r[p-1>>1]):c.mixedAdd(r[-p-1>>1].neg()):p>0?c.add(r[p-1>>1]):c.add(r[-p-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,i,n,r){var o,c,l,u=this._wnafT1,p=this._wnafT2,d=this._wnafT3,f=0;for(o=0;o=1;o-=2){var m=o-1,b=o;if(1===u[m]&&1===u[b]){var v=[t[m],null,null,t[b]];0===t[m].y.cmp(t[b].y)?(v[1]=t[m].add(t[b]),v[2]=t[m].toJ().mixedAdd(t[b].neg())):0===t[m].y.cmp(t[b].y.redNeg())?(v[1]=t[m].toJ().mixedAdd(t[b]),v[2]=t[m].add(t[b].neg())):(v[1]=t[m].toJ().mixedAdd(t[b]),v[2]=t[m].toJ().mixedAdd(t[b].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=a(i[m],i[b]);for(f=Math.max(y[0].length,f),d[m]=new Array(f),d[b]=new Array(f),c=0;c=0;o--){for(var E=0;o>=0;){var S=!0;for(c=0;c=0&&E++,w=w.dblp(E),o<0)break;for(c=0;c0?l=p[c][M-1>>1]:M<0&&(l=p[c][-M-1>>1].neg()),w="affine"===l.type?w.mixedAdd(l):w.add(l))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},l.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,r=0;r":""},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),r=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),s=n.redAdd(t),a=s.redSub(i),o=n.redSub(t),c=r.redMul(a),l=s.redMul(o),u=r.redMul(o),p=a.redMul(s);return this.curve.point(c,l,p,u)},l.prototype._projDbl=function(){var e,t,i,n,r,s,a=this.x.redAdd(this.y).redSqr(),o=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var l=(n=this.curve._mulA(o)).redAdd(c);this.zOne?(e=a.redSub(o).redSub(c).redMul(l.redSub(this.curve.two)),t=l.redMul(n.redSub(c)),i=l.redSqr().redSub(l).redSub(l)):(r=this.z.redSqr(),s=l.redSub(r).redISub(r),e=a.redSub(o).redISub(c).redMul(s),t=l.redMul(n.redSub(c)),i=l.redMul(s))}else n=o.redAdd(c),r=this.curve._mulC(this.z).redSqr(),s=n.redSub(r).redSub(r),e=this.curve._mulC(a.redISub(n)).redMul(s),t=this.curve._mulC(n).redMul(o.redISub(c)),i=n.redMul(s);return this.curve.point(e,t,i)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),r=this.z.redMul(e.z.redAdd(e.z)),s=i.redSub(t),a=r.redSub(n),o=r.redAdd(n),c=i.redAdd(t),l=s.redMul(a),u=o.redMul(c),p=s.redMul(c),d=a.redMul(o);return this.curve.point(l,u,d,p)},l.prototype._projAdd=function(e){var t,i,n=this.z.redMul(e.z),r=n.redSqr(),s=this.x.redMul(e.x),a=this.y.redMul(e.y),o=this.curve.d.redMul(s).redMul(a),c=r.redSub(o),l=r.redAdd(o),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(s).redISub(a),p=n.redMul(c).redMul(u);return this.curve.twisted?(t=n.redMul(l).redMul(a.redSub(this.curve._mulA(s))),i=c.redMul(l)):(t=n.redMul(l).redMul(a.redSub(s)),i=this.curve._mulC(c).redMul(l)),this.curve.point(p,t,i)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)},l.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)},l.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},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},{"../utils":173,"./base":160,"bn.js":174,inherits:217}],162:[function(e,t,i){"use strict";var n=i;n.base=e("./base"),n.short=e("./short"),n.mont=e("./mont"),n.edwards=e("./edwards")},{"./base":160,"./edwards":161,"./mont":163,"./short":164}],163:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("inherits"),s=e("./base"),a=e("../utils");function o(e){s.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,i){s.BasePoint.call(this,e,"projective"),null===t&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}r(o,s),t.exports=o,o.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),n=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},r(c,s.BasePoint),o.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},o.prototype.point=function(e,t){return new c(this,e,t)},o.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),i=e.redSub(t),n=e.redMul(t),r=i.redMul(t.redAdd(this.curve.a24.redMul(i)));return this.curve.point(n,r)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),r=e.x.redAdd(e.z),s=e.x.redSub(e.z).redMul(i),a=r.redMul(n),o=t.z.redMul(s.redAdd(a).redSqr()),c=t.x.redMul(s.redISub(a).redSqr());return this.curve.point(o,c)},c.prototype.mul=function(e){for(var t=e.clone(),i=this,n=this.curve.point(null,null),r=[];0!==t.cmpn(0);t.iushrn(1))r.push(t.andln(1));for(var s=r.length-1;s>=0;s--)0===r[s]?(i=i.diffAdd(n,this),n=n.dbl()):(n=i.diffAdd(n,this),i=i.dbl());return n},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":173,"./base":160,"bn.js":174,inherits:217}],164:[function(e,t,i){"use strict";var n=e("../utils"),r=e("bn.js"),s=e("inherits"),a=e("./base"),o=n.assert;function c(e){a.call(this,"short",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(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)}function l(e,t,i,n){a.BasePoint.call(this,e,"affine"),null===t&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new r(t,16),this.y=new r(i,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 u(e,t,i,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===i&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new r(0)):(this.x=new r(t,16),this.y=new r(i,16),this.z=new r(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}s(c,a),t.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,i;if(e.beta)t=new r(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)i=new r(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))?i=s[0]:(i=s[1],o(0===this.g.mul(i).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:i,basis:e.basis?e.basis.map((function(e){return{a:new r(e.a,16),b:new r(e.b,16)}})):this._getEndoBasis(i)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:r.mont(e),i=new r(2).toRed(t).redInvm(),n=i.redNeg(),s=new r(3).toRed(t).redNeg().redSqrt().redMul(i);return[n.redAdd(s).fromRed(),n.redSub(s).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,i,n,s,a,o,c,l,u,p=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,f=this.n.clone(),h=new r(1),m=new r(0),b=new r(0),v=new r(1),g=0;0!==d.cmpn(0);){var y=f.div(d);l=f.sub(y.mul(d)),u=b.sub(y.mul(h));var x=v.sub(y.mul(m));if(!n&&l.cmp(p)<0)t=c.neg(),i=h,n=l.neg(),s=u;else if(n&&2==++g)break;c=l,f=d,d=l,b=h,h=u,v=m,m=x}a=l.neg(),o=u;var _=n.sqr().add(s.sqr());return a.sqr().add(o.sqr()).cmp(_)>=0&&(a=t,o=i),n.negative&&(n=n.neg(),s=s.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:n,b:s},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],n=t[1],r=n.b.mul(e).divRound(this.n),s=i.b.neg().mul(e).divRound(this.n),a=r.mul(i.a),o=s.mul(n.a),c=r.mul(i.b),l=s.mul(n.b);return{k1:e.sub(a).sub(o),k2:c.add(l).neg()}},c.prototype.pointFromX=function(e,t){(e=new r(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(0!==n.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var s=n.fromRed().isOdd();return(t&&!s||!t&&s)&&(n=n.redNeg()),this.point(e,n)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,n=this.a.redMul(t),r=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===i.redSqr().redISub(r).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,i){for(var n=this._endoWnafT1,r=this._endoWnafT2,s=0;s":""},l.prototype.isInfinity=function(){return this.inf},l.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 i=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)},l.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,i=this.x.redSqr(),n=e.redInvm(),r=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(n),s=r.redSqr().redISub(this.x.redAdd(this.x)),a=r.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,a)},l.prototype.getX=function(){return this.x.fromRed()},l.prototype.getY=function(){return this.y.fromRed()},l.prototype.mul=function(e){return e=new r(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)},l.prototype.mulAdd=function(e,t,i){var n=[this,t],r=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,r):this.curve._wnafMulAdd(1,n,r,2)},l.prototype.jmulAdd=function(e,t,i){var n=[this,t],r=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,r,!0):this.curve._wnafMulAdd(1,n,r,2,!0)},l.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))},l.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return t},l.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(u,a.BasePoint),c.prototype.jpoint=function(e,t,i){return new u(this,e,t,i)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(i,n)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(t),r=e.x.redMul(i),s=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(i.redMul(this.z)),o=n.redSub(r),c=s.redSub(a);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=o.redSqr(),u=l.redMul(o),p=n.redMul(l),d=c.redSqr().redIAdd(u).redISub(p).redISub(p),f=c.redMul(p.redISub(d)).redISub(s.redMul(u)),h=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(d,f,h)},u.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,n=e.x.redMul(t),r=this.y,s=e.y.redMul(t).redMul(this.z),a=i.redSub(n),o=r.redSub(s);if(0===a.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),l=c.redMul(a),u=i.redMul(c),p=o.redSqr().redIAdd(l).redISub(u).redISub(u),d=o.redMul(u.redISub(p)).redISub(r.redMul(l)),f=this.z.redMul(a);return this.curve.jpoint(p,d,f)},u.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 i=this;for(t=0;t=0)return!1;if(i.redIAdd(r),0===this.x.cmp(i))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":173,"./base":160,"bn.js":174,inherits:217}],165:[function(e,t,i){"use strict";var n,r=i,s=e("hash.js"),a=e("./curve"),o=e("./utils").assert;function c(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function l(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var i=new c(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:i}),i}})}r.PresetCurve=c,l("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:s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),l("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:s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),l("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:s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),l("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:s.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"]}),l("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:s.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"]}),l("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["9"]}),l("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:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=e("./precomputed/secp256k1")}catch(e){n=void 0}l("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:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"./curve":162,"./precomputed/secp256k1":172,"./utils":173,"hash.js":201}],166:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("hmac-drbg"),s=e("../utils"),a=e("../curves"),o=e("brorand"),c=s.assert,l=e("./key"),u=e("./signature");function p(e){if(!(this instanceof p))return new p(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.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}t.exports=p,p.prototype.keyPair=function(e){return new l(this,e)},p.prototype.keyFromPrivate=function(e,t){return l.fromPrivate(this,e,t)},p.prototype.keyFromPublic=function(e,t){return l.fromPublic(this,e,t)},p.prototype.genKeyPair=function(e){e||(e={});for(var t=new r({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),s=this.n.sub(new n(2));;){var a=new n(t.generate(i));if(!(a.cmp(s)>0))return a.iaddn(1),this.keyFromPrivate(a)}},p.prototype._truncateToN=function(e,t){var i=8*e.byteLength()-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},p.prototype.sign=function(e,t,i,s){"object"==typeof i&&(s=i,i=null),s||(s={}),t=this.keyFromPrivate(t,i),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),o=t.getPrivate().toArray("be",a),c=e.toArray("be",a),l=new r({hash:this.hash,entropy:o,nonce:c,pers:s.pers,persEnc:s.persEnc||"utf8"}),p=this.n.sub(new n(1)),d=0;;d++){var f=s.k?s.k(d):new n(l.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(p)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var m=h.getX(),b=m.umod(this.n);if(0!==b.cmpn(0)){var v=f.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var g=(h.getY().isOdd()?1:0)|(0!==m.cmp(b)?2:0);return s.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),g^=1),new u({r:b,s:v,recoveryParam:g})}}}}}},p.prototype.verify=function(e,t,i,r){e=this._truncateToN(new n(e,16)),i=this.keyFromPublic(i,r);var s=(t=new u(t,"hex")).r,a=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var o,c=a.invm(this.n),l=c.mul(e).umod(this.n),p=c.mul(s).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(l,i.getPublic(),p)).isInfinity()&&o.eqXToP(s):!(o=this.g.mulAdd(l,i.getPublic(),p)).isInfinity()&&0===o.getX().umod(this.n).cmp(s)},p.prototype.recoverPubKey=function(e,t,i,r){c((3&i)===i,"The recovery param is more than two bits"),t=new u(t,r);var s=this.n,a=new n(e),o=t.r,l=t.s,p=1&i,d=i>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");o=d?this.curve.pointFromX(o.add(this.curve.n),p):this.curve.pointFromX(o,p);var f=t.r.invm(s),h=s.sub(a).mul(f).umod(s),m=l.mul(f).umod(s);return this.g.mulAdd(h,o,m)},p.prototype.getKeyRecoveryParam=function(e,t,i,n){if(null!==(t=new u(t,n)).recoveryParam)return t.recoveryParam;for(var r=0;r<4;r++){var s;try{s=this.recoverPubKey(e,t,r)}catch(e){continue}if(s.eq(i))return r}throw new Error("Unable to find valid recovery factor")}},{"../curves":165,"../utils":173,"./key":167,"./signature":168,"bn.js":174,brorand:66,"hmac-drbg":213}],167:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("../utils").assert;function s(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)}t.exports=s,s.fromPublic=function(e,t,i){return t instanceof s?t:new s(e,{pub:t,pubEnc:i})},s.fromPrivate=function(e,t,i){return t instanceof s?t:new s(e,{priv:t,privEnc:i})},s.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"}},s.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},s.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?r(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||r(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)},s.prototype.derive=function(e){return e.validate()||r(e.validate(),"public point not validated"),e.mul(this.priv).getX()},s.prototype.sign=function(e,t,i){return this.ec.sign(e,this,t,i)},s.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},s.prototype.inspect=function(){return""}},{"../utils":173,"bn.js":174}],168:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("../utils"),s=r.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(s(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function o(){this.place=0}function c(e,t){var i=e[t.place++];if(!(128&i))return i;var n=15&i;if(0===n||n>4)return!1;for(var r=0,s=0,a=t.place;s>>=0;return!(r<=127)&&(t.place=a,r)}function l(e){for(var t=0,i=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|i);--i;)e.push(t>>>(i<<3)&255);e.push(t)}}t.exports=a,a.prototype._importDER=function(e,t){e=r.toArray(e,t);var i=new o;if(48!==e[i.place++])return!1;var s=c(e,i);if(!1===s)return!1;if(s+i.place!==e.length)return!1;if(2!==e[i.place++])return!1;var a=c(e,i);if(!1===a)return!1;var l=e.slice(i.place,a+i.place);if(i.place+=a,2!==e[i.place++])return!1;var u=c(e,i);if(!1===u)return!1;if(e.length!==u+i.place)return!1;var p=e.slice(i.place,u+i.place);if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}if(0===p[0]){if(!(128&p[1]))return!1;p=p.slice(1)}return this.r=new n(l),this.s=new n(p),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&i[0]&&(i=[0].concat(i)),t=l(t),i=l(i);!(i[0]||128&i[1]);)i=i.slice(1);var n=[2];u(n,t.length),(n=n.concat(t)).push(2),u(n,i.length);var s=n.concat(i),a=[48];return u(a,s.length),a=a.concat(s),r.encode(a,e)}},{"../utils":173,"bn.js":174}],169:[function(e,t,i){"use strict";var n=e("hash.js"),r=e("../curves"),s=e("../utils"),a=s.assert,o=s.parseBytes,c=e("./key"),l=e("./signature");function u(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof u))return new u(e);e=r[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=n.sha512}t.exports=u,u.prototype.sign=function(e,t){e=o(e);var i=this.keyFromSecret(t),n=this.hashInt(i.messagePrefix(),e),r=this.g.mul(n),s=this.encodePoint(r),a=this.hashInt(s,i.pubBytes(),e).mul(i.priv()),c=n.add(a).umod(this.curve.n);return this.makeSignature({R:r,S:c,Rencoded:s})},u.prototype.verify=function(e,t,i){e=o(e),t=this.makeSignature(t);var n=this.keyFromPublic(i),r=this.hashInt(t.Rencoded(),n.pubBytes(),e),s=this.g.mul(t.S());return t.R().add(n.pub().mul(r)).eq(s)},u.prototype.hashInt=function(){for(var e=this.hash(),t=0;t(r>>1)-1?(r>>1)-c:c,s.isubn(o)):o=0,n[a]=o,s.iushrn(1)}return n},n.getJSF=function(e,t){var i=[[],[]];e=e.clone(),t=t.clone();for(var n,r=0,s=0;e.cmpn(-r)>0||t.cmpn(-s)>0;){var a,o,c=e.andln(3)+r&3,l=t.andln(3)+s&3;3===c&&(c=-1),3===l&&(l=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+r&7)&&5!==n||2!==l?c:-c,i[0].push(a),o=0==(1&l)?0:3!==(n=t.andln(7)+s&7)&&5!==n||2!==c?l:-l,i[1].push(o),2*r===a+1&&(r=1-r),2*s===o+1&&(s=1-s),e.iushrn(1),t.iushrn(1)}return i},n.cachedProperty=function(e,t,i){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=i.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new r(e,"hex","le")}},{"bn.js":174,"minimalistic-assert":256,"minimalistic-crypto-utils":257}],174:[function(e,t,i){arguments[4][17][0].apply(i,arguments)},{buffer:67,dup:17}],175:[function(e,t,i){t.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{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/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny ",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{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"},dependencies:{"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"}}},{}],176:[function(e,t,i){(function(i){(function(){var n=e("once"),r=function(){},s=function(e,t,a){if("function"==typeof t)return s(e,null,t);t||(t={}),a=n(a||r);var o=e._writableState,c=e._readableState,l=t.readable||!1!==t.readable&&e.readable,u=t.writable||!1!==t.writable&&e.writable,p=!1,d=function(){e.writable||f()},f=function(){u=!1,l||a.call(e)},h=function(){l=!1,u||a.call(e)},m=function(t){a.call(e,t?new Error("exited with error code: "+t):null)},b=function(t){a.call(e,t)},v=function(){i.nextTick(g)},g=function(){if(!p)return(!l||c&&c.ended&&!c.destroyed)&&(!u||o&&o.ended&&!o.destroyed)?void 0:a.call(e,new Error("premature close"))},y=function(){e.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?u&&!o&&(e.on("end",d),e.on("close",d)):(e.on("complete",f),e.on("abort",v),e.req?y():e.on("request",y)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",m),e.on("end",h),e.on("finish",f),!1!==t.error&&e.on("error",b),e.on("close",v),function(){p=!0,e.removeListener("complete",f),e.removeListener("abort",v),e.removeListener("request",y),e.req&&e.req.removeListener("finish",f),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",f),e.removeListener("exit",m),e.removeListener("end",h),e.removeListener("error",b),e.removeListener("close",v)}};t.exports=s}).call(this)}).call(this,e("_process"))},{_process:296,once:281}],177:[function(e,t,i){"use strict";function n(e,t){for(const i in t)Object.defineProperty(e,i,{value:t[i],enumerable:!0,configurable:!0});return e}t.exports=function(e,t,i){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code");i||(i={}),"object"==typeof t&&(i=t,t=""),t&&(i.code=t);try{return n(e,i)}catch(t){i.message=e.message,i.stack=e.stack;const r=function(){};r.prototype=Object.create(Object.getPrototypeOf(e));return n(new r,i)}}},{}],178:[function(e,t,i){"use strict";var n,r="object"==typeof Reflect?Reflect:null,s=r&&"function"==typeof r.apply?r.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(e,t){return new Promise((function(i,n){function r(i){e.removeListener(t,s),n(i)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",r),i([].slice.call(arguments))}v(e,t,s,{once:!0}),"error"!==t&&function(e,t,i){"function"==typeof e.on&&v(e,"error",t,i)}(e,r,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var c=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function p(e,t,i,n){var r,s,a,o;if(l(i),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),s=e._events),a=s[t]),void 0===a)a=s[t]=i,++e._eventsCount;else if("function"==typeof a?a=s[t]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),(r=u(e))>0&&a.length>r&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,o=c,console&&console.warn&&console.warn(o)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=d.bind(n);return r.listener=i,n.wrapFn=r,r}function h(e,t,i){var n=e._events;if(void 0===n)return[];var r=n[t];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(e){for(var t=new Array(e.length),i=0;i0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var c=r[e];if(void 0===c)return!1;if("function"==typeof c)s(c,this,t);else{var l=c.length,u=b(c,l);for(i=0;i=0;s--)if(i[s]===t||i[s].listener===t){a=i[s].listener,r=s;break}if(r<0)return this;0===r?i.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},o.prototype.listenerCount=m,o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],179:[function(e,t,i){var n=e("safe-buffer").Buffer,r=e("md5.js");t.exports=function(e,t,i,s){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=i/8,o=n.alloc(a),c=n.alloc(s||0),l=n.alloc(0);a>0||s>0;){var u=new r;u.update(l),u.update(e),t&&u.update(t),l=u.digest();var p=0;if(a>0){var d=o.length-a;p=Math.min(a,l.length),l.copy(o,d,0,p),a-=p}if(p0){var f=c.length-s,h=Math.min(s,l.length-p);l.copy(c,f,p,p+h),s-=h}}return l.fill(0),{key:o,iv:c}}},{"md5.js":229,"safe-buffer":338}],180:[function(e,t,i){const{Readable:n,Writable:r}=e("streamx");e("fast-readable-async-iterator");t.exports={BlobWriteStream:class extends r{constructor(e,t={}){super(Object.assign({decodeStrings:!1},t)),this.chunks=[];const i=t.mimeType;this.once("close",(()=>{const t=null!=i?new Blob(this.chunks,{type:i}):new Blob(this.chunks);e(t),this.emit("blob",t)}))}_write(e,t){this.chunks.push(e),t()}},BlobReadStream:function(e,t={}){return n.from(e.stream(),t)}}},{"fast-readable-async-iterator":183,streamx:426}],181:[function(e,t,i){t.exports=class{constructor(e){if(!(e>0)||0!=(e-1&e))throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return void 0===this.buffer[this.top]&&(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){const e=this.buffer[this.btm];if(void 0!==e)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}peek(){return this.buffer[this.btm]}isEmpty(){return void 0===this.buffer[this.btm]}}},{}],182:[function(e,t,i){const n=e("./fixed-size");t.exports=class{constructor(e){this.hwm=e||16,this.head=new n(this.hwm),this.tail=this.head}push(e){if(!this.head.push(e)){const t=this.head;this.head=t.next=new n(2*this.head.buffer.length),this.head.push(e)}}shift(){const e=this.tail.shift();if(void 0===e&&this.tail.next){const e=this.tail.next;return this.tail.next=null,this.tail=e,this.tail.shift()}return e}peek(){return this.tail.peek()}isEmpty(){return this.head.isEmpty()}}},{"./fixed-size":181}],183:[function(e,t,i){"undefined"==typeof ReadableStream||ReadableStream.prototype[Symbol.asyncIterator]||(ReadableStream.prototype[Symbol.asyncIterator]=function(){const e=this.getReader();let t=e.read();return{next(){const i=t;return t=e.read(),i},return(){t.then((()=>e.releaseLock()))},throw(e){throw this.return(),e},[Symbol.asyncIterator](){return this}}})},{}],184:[function(e,t,i){t.exports=function(){if("undefined"==typeof globalThis)return null;var e={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},{}],185:[function(e,t,i){"use strict";var n=e("safe-buffer").Buffer,r=e("readable-stream").Transform;function s(e){r.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}e("inherits")(s,r),s.prototype._transform=function(e,t,i){var n=null;try{this.update(e,t)}catch(e){n=e}i(n)},s.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},s.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var i=this._block,r=0;this._blockOffset+e.length-r>=this._blockSize;){for(var s=this._blockOffset;s0;++a)this._length[a]+=o,(o=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*o);return this},s.prototype._update=function(){throw new Error("_update is not implemented")},s.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 i=0;i<4;++i)this._length[i]=0;return t},s.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=s},{inherits:217,"readable-stream":200,"safe-buffer":338}],186:[function(e,t,i){arguments[4][28][0].apply(i,arguments)},{dup:28}],187:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{"./_stream_readable":189,"./_stream_writable":191,_process:296,dup:29,inherits:217}],188:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_transform":190,dup:30,inherits:217}],189:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"../errors":186,"./_stream_duplex":187,"./internal/streams/async_iterator":192,"./internal/streams/buffer_list":193,"./internal/streams/destroy":194,"./internal/streams/from":196,"./internal/streams/state":198,"./internal/streams/stream":199,_process:296,buffer:110,dup:31,events:178,inherits:217,"string_decoder/":427,util:67}],190:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":186,"./_stream_duplex":187,dup:32,inherits:217}],191:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":186,"./_stream_duplex":187,"./internal/streams/destroy":194,"./internal/streams/state":198,"./internal/streams/stream":199,_process:296,buffer:110,dup:33,inherits:217,"util-deprecate":440}],192:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"./end-of-stream":195,_process:296,dup:34}],193:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{buffer:110,dup:35,util:67}],194:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{_process:296,dup:36}],195:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{"../../../errors":186,dup:37}],196:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{dup:38}],197:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{"../../../errors":186,"./end-of-stream":195,dup:39}],198:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":186,dup:40}],199:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{dup:41,events:178}],200:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{"./lib/_stream_duplex.js":187,"./lib/_stream_passthrough.js":188,"./lib/_stream_readable.js":189,"./lib/_stream_transform.js":190,"./lib/_stream_writable.js":191,"./lib/internal/streams/end-of-stream.js":195,"./lib/internal/streams/pipeline.js":197,dup:42}],201:[function(e,t,i){var n=i;n.utils=e("./hash/utils"),n.common=e("./hash/common"),n.sha=e("./hash/sha"),n.ripemd=e("./hash/ripemd"),n.hmac=e("./hash/hmac"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},{"./hash/common":202,"./hash/hmac":203,"./hash/ripemd":204,"./hash/sha":205,"./hash/utils":212}],202:[function(e,t,i){"use strict";var n=e("./utils"),r=e("minimalistic-assert");function s(){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}i.BlockHash=s,s.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var i=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-i,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-i,this.endian);for(var r=0;r>>24&255,n[r++]=e>>>16&255,n[r++]=e>>>8&255,n[r++]=255&e}else for(n[r++]=255&e,n[r++]=e>>>8&255,n[r++]=e>>>16&255,n[r++]=e>>>24&255,n[r++]=0,n[r++]=0,n[r++]=0,n[r++]=0,s=8;sthis.blockSize&&(e=(new this.Hash).update(e).digest()),r(e.length<=this.blockSize);for(var t=e.length;t>>3},i.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},{"../utils":212}],212:[function(e,t,i){"use strict";var n=e("minimalistic-assert"),r=e("inherits");function s(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function c(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}i.inherits=r,i.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),r=0;r>6|192,i[n++]=63&a|128):s(e,r)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++r)),i[n++]=a>>18|240,i[n++]=a>>12&63|128,i[n++]=a>>6&63|128,i[n++]=63&a|128):(i[n++]=a>>12|224,i[n++]=a>>6&63|128,i[n++]=63&a|128)}else for(r=0;r>>0}return a},i.split32=function(e,t){for(var i=new Array(4*e.length),n=0,r=0;n>>24,i[r+1]=s>>>16&255,i[r+2]=s>>>8&255,i[r+3]=255&s):(i[r+3]=s>>>24,i[r+2]=s>>>16&255,i[r+1]=s>>>8&255,i[r]=255&s)}return i},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,i){return e+t+i>>>0},i.sum32_4=function(e,t,i,n){return e+t+i+n>>>0},i.sum32_5=function(e,t,i,n,r){return e+t+i+n+r>>>0},i.sum64=function(e,t,i,n){var r=e[t],s=n+e[t+1]>>>0,a=(s>>0,e[t+1]=s},i.sum64_hi=function(e,t,i,n){return(t+n>>>0>>0},i.sum64_lo=function(e,t,i,n){return t+n>>>0},i.sum64_4_hi=function(e,t,i,n,r,s,a,o){var c=0,l=t;return c+=(l=l+n>>>0)>>0)>>0)>>0},i.sum64_4_lo=function(e,t,i,n,r,s,a,o){return t+n+s+o>>>0},i.sum64_5_hi=function(e,t,i,n,r,s,a,o,c,l){var u=0,p=t;return u+=(p=p+n>>>0)>>0)>>0)>>0)>>0},i.sum64_5_lo=function(e,t,i,n,r,s,a,o,c,l){return t+n+s+o+l>>>0},i.rotr64_hi=function(e,t,i){return(t<<32-i|e>>>i)>>>0},i.rotr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0},i.shr64_hi=function(e,t,i){return e>>>i},i.shr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0}},{inherits:217,"minimalistic-assert":256}],213:[function(e,t,i){"use strict";var n=e("hash.js"),r=e("minimalistic-crypto-utils"),s=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(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=r.toArray(e.entropy,e.entropyEnc||"hex"),i=r.toArray(e.nonce,e.nonceEnc||"hex"),n=r.toArray(e.pers,e.persEnc||"hex");s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,i,n)}t.exports=a,a.prototype._init=function(e,t,i){var n=e.concat(t).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var r=0;r=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},a.prototype.generate=function(e,t,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=i,i=t,t=null),i&&(i=r.toArray(i,n||"hex"),this._update(i));for(var s=[];s.length{if(null==e)throw new Error(`invalid input type: ${e}`)})),1!==(e=e.map((e=>y(e)&&"string"==typeof e.path&&"function"==typeof f?e.path:e))).length||"string"==typeof e[0]||e[0].name||(e[0].name=t.name);let s=null;e.forEach(((t,i)=>{if("string"==typeof t)return;let n=t.fullPath||t.name;n||(n=`Unknown File ${i+1}`,t.unknownName=!0),t[h]=n.split("/"),t[h][0]||t[h].shift(),t[h].length<2?s=null:0===i&&e.length>1?s=t[h][0]:t[h][0]!==s&&(s=null)}));(void 0===t.filterJunkFiles||t.filterJunkFiles)&&(e=e.filter((e=>"string"==typeof e||!v(e[h])))),s&&e.forEach((e=>{const t=(i.isBuffer(e)||x(e))&&!e[h];"string"==typeof e||t||e[h].shift()})),!t.name&&s&&(t.name=s),t.name||e.some((e=>"string"==typeof e?(t.name=a.basename(e),!0):!e.unknownName&&(t.name=e[h][e[h].length-1],!0))),t.name||(t.name=`Unnamed Torrent ${Date.now()}`);const c=e.reduce(((e,t)=>e+Number("string"==typeof t)),0);let l=1===e.length;if(1===e.length&&"string"==typeof e[0]){if("function"!=typeof f)throw new Error("filesystem paths do not work in the browser");o(e[0],((e,t)=>{if(e)return n(e);l=t,d()}))}else p(d);function d(){u(e.map((e=>t=>{const n={};if(y(e))n.getStream=e.stream(),n.length=e.size;else if(i.isBuffer(e))n.getStream=[e],n.length=e.length;else{if(!x(e)){if("string"==typeof e){if("function"!=typeof f)throw new Error("filesystem paths do not work in the browser");return void f(e,c>1||l,t)}throw new Error("invalid input type")}n.getStream=async function*(e,t){for await(const i of e)t.length+=i.length,yield i}(e,n),n.length=0}n.path=e[h],t(null,n)})),((e,t)=>{if(e)return n(e);t=t.flat(),n(null,t,l)}))}}const b=5;function v(e){const t=e[e.length-1];return"."===t[0]&&c.is(t)}function g(e,t){return e+t.length}function y(e){return"undefined"!=typeof Blob&&e instanceof Blob}function x(e){return"object"==typeof e&&null!=e&&"function"==typeof e.pipe}t.exports=function(e,a,o){"function"==typeof a&&([a,o]=[o,a]),m(e,a=a?Object.assign({},a):{},((e,c,u)=>{if(e)return o(e);a.singleFileTorrent=u,function(e,a,o){let c=a.announceList;c||("string"==typeof a.announce?c=[[a.announce]]:Array.isArray(a.announce)&&(c=a.announce.map((e=>[e]))));c||(c=[]);globalThis.WEBTORRENT_ANNOUNCE&&("string"==typeof globalThis.WEBTORRENT_ANNOUNCE?c.push([[globalThis.WEBTORRENT_ANNOUNCE]]):Array.isArray(globalThis.WEBTORRENT_ANNOUNCE)&&(c=c.concat(globalThis.WEBTORRENT_ANNOUNCE.map((e=>[e])))));void 0===a.announce&&void 0===a.announceList&&(c=c.concat(t.exports.announceList));"string"==typeof a.urlList&&(a.urlList=[a.urlList]);const u={info:{name:a.name},"creation date":Math.ceil((Number(a.creationDate)||Date.now())/1e3),encoding:"UTF-8"};0!==c.length&&(u.announce=c[0][0],u["announce-list"]=c);void 0!==a.comment&&(u.comment=a.comment);void 0!==a.createdBy&&(u["created by"]=a.createdBy);void 0!==a.private&&(u.info.private=Number(a.private));void 0!==a.info&&Object.assign(u.info,a.info);void 0!==a.sslCert&&(u.info["ssl-cert"]=a.sslCert);void 0!==a.urlList&&(u["url-list"]=a.urlList);const p=e.reduce(g,0),f=a.pieceLength||s(p);u.info["piece length"]=f,async function(e,t,n,s,a){const o=[];let c=0,u=0;const p=e.map((e=>e.getStream)),f=s.onProgress;let h=0,m=0,v=!1;const g=r(l(p),t,{zeroPadding:!1});try{for await(const e of g)await new Promise((t=>{c+=e.length;const r=m;++m,++h{o[r]=s,--h,u+=e.length,f&&f(u,n),t(),v&&0===h&&a(null,i.from(o.join(""),"hex"),c)}))}));if(0===h)return a(null,i.from(o.join(""),"hex"),c);v=!0}catch(e){a(e)}}(e,f,p,a,((t,i,r)=>{if(t)return o(t);u.info.pieces=i,e.forEach((e=>{delete e.getStream})),a.singleFileTorrent?u.info.length=r:u.info.files=e,o(null,n.encode(u))}))}(c,a,o)}))},t.exports.parseInput=function(e,t,i){"function"==typeof t&&([t,i]=[i,t]),m(e,t=t?Object.assign({},t):{},i)},t.exports.announceList=[["udp://tracker.leechers-paradise.org:6969"],["udp://tracker.coppersurfer.tk:6969"],["udp://tracker.opentrackr.org:1337"],["udp://explodie.org:6969"],["udp://tracker.empire-js.us:1337"],["wss://tracker.btorrent.xyz"],["wss://tracker.openwebtorrent.com"]],t.exports.isJunkPath=v}).call(this)}).call(this,e("buffer").Buffer)},{"./get-files":67,bencode:22,"block-iterator":48,buffer:110,"fast-readable-async-iterator":183,"is-file":67,"join-async-iterator":220,junk:221,path:288,"piece-length":295,"queue-microtask":309,"run-parallel":336,"simple-sha1":366}],145:[function(e,t,i){"use strict";i.randomBytes=i.rng=i.pseudoRandomBytes=i.prng=e("randombytes"),i.createHash=i.Hash=e("create-hash"),i.createHmac=i.Hmac=e("create-hmac");var n=e("browserify-sign/algos"),r=Object.keys(n),s=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(r);i.getHashes=function(){return s};var a=e("pbkdf2");i.pbkdf2=a.pbkdf2,i.pbkdf2Sync=a.pbkdf2Sync;var o=e("browserify-cipher");i.Cipher=o.Cipher,i.createCipher=o.createCipher,i.Cipheriv=o.Cipheriv,i.createCipheriv=o.createCipheriv,i.Decipher=o.Decipher,i.createDecipher=o.createDecipher,i.Decipheriv=o.Decipheriv,i.createDecipheriv=o.createDecipheriv,i.getCiphers=o.getCiphers,i.listCiphers=o.listCiphers;var c=e("diffie-hellman");i.DiffieHellmanGroup=c.DiffieHellmanGroup,i.createDiffieHellmanGroup=c.createDiffieHellmanGroup,i.getDiffieHellman=c.getDiffieHellman,i.createDiffieHellman=c.createDiffieHellman,i.DiffieHellman=c.DiffieHellman;var l=e("browserify-sign");i.createSign=l.createSign,i.Sign=l.Sign,i.createVerify=l.createVerify,i.Verify=l.Verify,i.createECDH=e("create-ecdh");var u=e("public-encrypt");i.publicEncrypt=u.publicEncrypt,i.privateEncrypt=u.privateEncrypt,i.publicDecrypt=u.publicDecrypt,i.privateDecrypt=u.privateDecrypt;var p=e("randomfill");i.randomFill=p.randomFill,i.randomFillSync=p.randomFillSync,i.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},i.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":85,"browserify-sign":92,"browserify-sign/algos":89,"create-ecdh":138,"create-hash":140,"create-hmac":142,"diffie-hellman":154,pbkdf2:289,"public-encrypt":297,randombytes:312,randomfill:313}],146:[function(e,t,i){(function(n){(function(){i.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;e.splice(1,0,i,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(r=n))})),e.splice(r,0,i)},i.save=function(e){try{e?i.storage.setItem("debug",e):i.storage.removeItem("debug")}catch(e){}},i.load=function(){let e;try{e=i.storage.getItem("debug")}catch(e){}!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG);return e},i.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},i.storage=function(){try{return localStorage}catch(e){}}(),i.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),i.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],i.log=console.debug||console.log||(()=>{}),t.exports=e("./common")(i);const{formatters:r}=t.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this)}).call(this,e("_process"))},{"./common":147,_process:296}],147:[function(e,t,i){t.exports=function(t){function i(e){let t,r,s,a=null;function o(...e){if(!o.enabled)return;const n=o,r=Number(new Date),s=r-(t||r);n.diff=s,n.prev=t,n.curr=r,t=r,e[0]=i.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,r)=>{if("%%"===t)return"%";a++;const s=i.formatters[r];if("function"==typeof s){const i=e[a];t=s.call(n,i),e.splice(a,1),a--}return t})),i.formatArgs.call(n,e);(n.log||i.log).apply(n,e)}return o.namespace=e,o.useColors=i.useColors(),o.color=i.selectColor(e),o.extend=n,o.destroy=i.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(r!==i.namespaces&&(r=i.namespaces,s=i.enabled(e)),s),set:e=>{a=e}}),"function"==typeof i.init&&i.init(o),o}function n(e,t){const n=i(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return i.debug=i,i.default=i,i.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},i.disable=function(){const e=[...i.names.map(r),...i.skips.map(r).map((e=>"-"+e))].join(",");return i.enable(""),e},i.enable=function(e){let t;i.save(e),i.namespaces=e,i.names=[],i.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length;for(t=0;t{i[e]=t[e]})),i.names=[],i.skips=[],i.formatters={},i.selectColor=function(e){let t=0;for(let i=0;i0;n--)t+=this._buffer(e,t),i+=this._flushBuffer(r,i);return t+=this._buffer(e,t),r},r.prototype.final=function(e){var t,i;return e&&(t=this.update(e)),i="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(i):i},r.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>1];i=s.r28shl(i,o),r=s.r28shl(r,o),s.pc2(i,r,e.keys,a)}},c.prototype._update=function(e,t,i,n){var r=this._desState,a=s.readUInt32BE(e,t),o=s.readUInt32BE(e,t+4);s.ip(a,o,r.tmp,0),a=r.tmp[0],o=r.tmp[1],"encrypt"===this.type?this._encrypt(r,a,o,r.tmp,0):this._decrypt(r,a,o,r.tmp,0),a=r.tmp[0],o=r.tmp[1],s.writeUInt32BE(i,a,n),s.writeUInt32BE(i,o,n+4)},c.prototype._pad=function(e,t){for(var i=e.length-t,n=t;n>>0,a=d}s.rip(o,a,n,r)},c.prototype._decrypt=function(e,t,i,n,r){for(var a=i,o=t,c=e.keys.length-2;c>=0;c-=2){var l=e.keys[c],u=e.keys[c+1];s.expand(a,e.tmp,0),l^=e.tmp[0],u^=e.tmp[1];var p=s.substitute(l,u),d=a;a=(o^s.permute(p))>>>0,o=d}s.rip(a,o,n,r)}},{"./cipher":150,"./utils":153,inherits:217,"minimalistic-assert":256}],152:[function(e,t,i){"use strict";var n=e("minimalistic-assert"),r=e("inherits"),s=e("./cipher"),a=e("./des");function o(e,t){n.equal(t.length,24,"Invalid key length");var i=t.slice(0,8),r=t.slice(8,16),s=t.slice(16,24);this.ciphers="encrypt"===e?[a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:r}),a.create({type:"encrypt",key:s})]:[a.create({type:"decrypt",key:s}),a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:i})]}function c(e){s.call(this,e);var t=new o(this.type,this.options.key);this._edeState=t}r(c,s),t.exports=c,c.create=function(e){return new c(e)},c.prototype._update=function(e,t,i,n){var r=this._edeState;r.ciphers[0]._update(e,t,i,n),r.ciphers[1]._update(i,n,i,n),r.ciphers[2]._update(i,n,i,n)},c.prototype._pad=a.prototype._pad,c.prototype._unpad=a.prototype._unpad},{"./cipher":150,"./des":151,inherits:217,"minimalistic-assert":256}],153:[function(e,t,i){"use strict";i.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},i.writeUInt32BE=function(e,t,i){e[0+i]=t>>>24,e[1+i]=t>>>16&255,e[2+i]=t>>>8&255,e[3+i]=255&t},i.ip=function(e,t,i,n){for(var r=0,s=0,a=6;a>=0;a-=2){for(var o=0;o<=24;o+=8)r<<=1,r|=t>>>o+a&1;for(o=0;o<=24;o+=8)r<<=1,r|=e>>>o+a&1}for(a=6;a>=0;a-=2){for(o=1;o<=25;o+=8)s<<=1,s|=t>>>o+a&1;for(o=1;o<=25;o+=8)s<<=1,s|=e>>>o+a&1}i[n+0]=r>>>0,i[n+1]=s>>>0},i.rip=function(e,t,i,n){for(var r=0,s=0,a=0;a<4;a++)for(var o=24;o>=0;o-=8)r<<=1,r|=t>>>o+a&1,r<<=1,r|=e>>>o+a&1;for(a=4;a<8;a++)for(o=24;o>=0;o-=8)s<<=1,s|=t>>>o+a&1,s<<=1,s|=e>>>o+a&1;i[n+0]=r>>>0,i[n+1]=s>>>0},i.pc1=function(e,t,i,n){for(var r=0,s=0,a=7;a>=5;a--){for(var o=0;o<=24;o+=8)r<<=1,r|=t>>o+a&1;for(o=0;o<=24;o+=8)r<<=1,r|=e>>o+a&1}for(o=0;o<=24;o+=8)r<<=1,r|=t>>o+a&1;for(a=1;a<=3;a++){for(o=0;o<=24;o+=8)s<<=1,s|=t>>o+a&1;for(o=0;o<=24;o+=8)s<<=1,s|=e>>o+a&1}for(o=0;o<=24;o+=8)s<<=1,s|=e>>o+a&1;i[n+0]=r>>>0,i[n+1]=s>>>0},i.r28shl=function(e,t){return e<>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];i.pc2=function(e,t,i,r){for(var s=0,a=0,o=n.length>>>1,c=0;c>>n[c]&1;for(c=o;c>>n[c]&1;i[r+0]=s>>>0,i[r+1]=a>>>0},i.expand=function(e,t,i){var n=0,r=0;n=(1&e)<<5|e>>>27;for(var s=23;s>=15;s-=4)n<<=6,n|=e>>>s&63;for(s=11;s>=3;s-=4)r|=e>>>s&63,r<<=6;r|=(31&e)<<1|e>>>31,t[i+0]=n>>>0,t[i+1]=r>>>0};var r=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];i.substitute=function(e,t){for(var i=0,n=0;n<4;n++){i<<=4,i|=r[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){i<<=4,i|=r[256+64*n+(t>>>18-6*n&63)]}return i>>>0};var s=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];i.permute=function(e){for(var t=0,i=0;i>>s[i]&1;return t>>>0},i.padSplit=function(e,t,i){for(var n=e.toString(2);n.lengthe;)i.ishrn(1);if(i.isEven()&&i.iadd(o),i.testn(1)||i.iadd(c),t.cmp(c)){if(!t.cmp(l))for(;i.mod(u).cmp(p);)i.iadd(f)}else for(;i.mod(s).cmp(d);)i.iadd(f);if(b(h=i.shrn(1))&&b(i)&&v(h)&&v(i)&&a.test(h)&&a.test(i))return i}}},{"bn.js":158,"miller-rabin":247,randombytes:312}],157:[function(e,t,i){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],158:[function(e,t,i){arguments[4][17][0].apply(i,arguments)},{buffer:67,dup:17}],159:[function(e,t,i){"use strict";var n=i;n.version=e("../package.json").version,n.utils=e("./elliptic/utils"),n.rand=e("brorand"),n.curve=e("./elliptic/curve"),n.curves=e("./elliptic/curves"),n.ec=e("./elliptic/ec"),n.eddsa=e("./elliptic/eddsa")},{"../package.json":175,"./elliptic/curve":162,"./elliptic/curves":165,"./elliptic/ec":166,"./elliptic/eddsa":169,"./elliptic/utils":173,brorand:66}],160:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("../utils"),s=r.getNAF,a=r.getJSF,o=r.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(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 i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function l(e,t){this.curve=e,this.type=t,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){o(e.precomputed);var i=e._getDoubles(),n=s(t,1,this._bitLength),r=(1<=a;u--)c=(c<<1)+n[u];l.push(c)}for(var p=this.jpoint(null,null,null),d=this.jpoint(null,null,null),f=r;f>0;f--){for(a=0;a=0;l--){for(var u=0;l>=0&&0===a[l];l--)u++;if(l>=0&&u++,c=c.dblp(u),l<0)break;var p=a[l];o(0!==p),c="affine"===e.type?p>0?c.mixedAdd(r[p-1>>1]):c.mixedAdd(r[-p-1>>1].neg()):p>0?c.add(r[p-1>>1]):c.add(r[-p-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,i,n,r){var o,c,l,u=this._wnafT1,p=this._wnafT2,d=this._wnafT3,f=0;for(o=0;o=1;o-=2){var m=o-1,b=o;if(1===u[m]&&1===u[b]){var v=[t[m],null,null,t[b]];0===t[m].y.cmp(t[b].y)?(v[1]=t[m].add(t[b]),v[2]=t[m].toJ().mixedAdd(t[b].neg())):0===t[m].y.cmp(t[b].y.redNeg())?(v[1]=t[m].toJ().mixedAdd(t[b]),v[2]=t[m].add(t[b].neg())):(v[1]=t[m].toJ().mixedAdd(t[b]),v[2]=t[m].toJ().mixedAdd(t[b].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=a(i[m],i[b]);for(f=Math.max(y[0].length,f),d[m]=new Array(f),d[b]=new Array(f),c=0;c=0;o--){for(var E=0;o>=0;){var S=!0;for(c=0;c=0&&E++,w=w.dblp(E),o<0)break;for(c=0;c0?l=p[c][M-1>>1]:M<0&&(l=p[c][-M-1>>1].neg()),w="affine"===l.type?w.mixedAdd(l):w.add(l))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},l.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,r=0;r":""},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),r=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),s=n.redAdd(t),a=s.redSub(i),o=n.redSub(t),c=r.redMul(a),l=s.redMul(o),u=r.redMul(o),p=a.redMul(s);return this.curve.point(c,l,p,u)},l.prototype._projDbl=function(){var e,t,i,n,r,s,a=this.x.redAdd(this.y).redSqr(),o=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var l=(n=this.curve._mulA(o)).redAdd(c);this.zOne?(e=a.redSub(o).redSub(c).redMul(l.redSub(this.curve.two)),t=l.redMul(n.redSub(c)),i=l.redSqr().redSub(l).redSub(l)):(r=this.z.redSqr(),s=l.redSub(r).redISub(r),e=a.redSub(o).redISub(c).redMul(s),t=l.redMul(n.redSub(c)),i=l.redMul(s))}else n=o.redAdd(c),r=this.curve._mulC(this.z).redSqr(),s=n.redSub(r).redSub(r),e=this.curve._mulC(a.redISub(n)).redMul(s),t=this.curve._mulC(n).redMul(o.redISub(c)),i=n.redMul(s);return this.curve.point(e,t,i)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),r=this.z.redMul(e.z.redAdd(e.z)),s=i.redSub(t),a=r.redSub(n),o=r.redAdd(n),c=i.redAdd(t),l=s.redMul(a),u=o.redMul(c),p=s.redMul(c),d=a.redMul(o);return this.curve.point(l,u,d,p)},l.prototype._projAdd=function(e){var t,i,n=this.z.redMul(e.z),r=n.redSqr(),s=this.x.redMul(e.x),a=this.y.redMul(e.y),o=this.curve.d.redMul(s).redMul(a),c=r.redSub(o),l=r.redAdd(o),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(s).redISub(a),p=n.redMul(c).redMul(u);return this.curve.twisted?(t=n.redMul(l).redMul(a.redSub(this.curve._mulA(s))),i=c.redMul(l)):(t=n.redMul(l).redMul(a.redSub(s)),i=this.curve._mulC(c).redMul(l)),this.curve.point(p,t,i)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)},l.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)},l.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},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},{"../utils":173,"./base":160,"bn.js":174,inherits:217}],162:[function(e,t,i){"use strict";var n=i;n.base=e("./base"),n.short=e("./short"),n.mont=e("./mont"),n.edwards=e("./edwards")},{"./base":160,"./edwards":161,"./mont":163,"./short":164}],163:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("inherits"),s=e("./base"),a=e("../utils");function o(e){s.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,i){s.BasePoint.call(this,e,"projective"),null===t&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}r(o,s),t.exports=o,o.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),n=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},r(c,s.BasePoint),o.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},o.prototype.point=function(e,t){return new c(this,e,t)},o.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),i=e.redSub(t),n=e.redMul(t),r=i.redMul(t.redAdd(this.curve.a24.redMul(i)));return this.curve.point(n,r)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),r=e.x.redAdd(e.z),s=e.x.redSub(e.z).redMul(i),a=r.redMul(n),o=t.z.redMul(s.redAdd(a).redSqr()),c=t.x.redMul(s.redISub(a).redSqr());return this.curve.point(o,c)},c.prototype.mul=function(e){for(var t=e.clone(),i=this,n=this.curve.point(null,null),r=[];0!==t.cmpn(0);t.iushrn(1))r.push(t.andln(1));for(var s=r.length-1;s>=0;s--)0===r[s]?(i=i.diffAdd(n,this),n=n.dbl()):(n=i.diffAdd(n,this),i=i.dbl());return n},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":173,"./base":160,"bn.js":174,inherits:217}],164:[function(e,t,i){"use strict";var n=e("../utils"),r=e("bn.js"),s=e("inherits"),a=e("./base"),o=n.assert;function c(e){a.call(this,"short",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(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)}function l(e,t,i,n){a.BasePoint.call(this,e,"affine"),null===t&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new r(t,16),this.y=new r(i,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 u(e,t,i,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===i&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new r(0)):(this.x=new r(t,16),this.y=new r(i,16),this.z=new r(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}s(c,a),t.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,i;if(e.beta)t=new r(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)i=new r(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))?i=s[0]:(i=s[1],o(0===this.g.mul(i).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:i,basis:e.basis?e.basis.map((function(e){return{a:new r(e.a,16),b:new r(e.b,16)}})):this._getEndoBasis(i)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:r.mont(e),i=new r(2).toRed(t).redInvm(),n=i.redNeg(),s=new r(3).toRed(t).redNeg().redSqrt().redMul(i);return[n.redAdd(s).fromRed(),n.redSub(s).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,i,n,s,a,o,c,l,u,p=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,f=this.n.clone(),h=new r(1),m=new r(0),b=new r(0),v=new r(1),g=0;0!==d.cmpn(0);){var y=f.div(d);l=f.sub(y.mul(d)),u=b.sub(y.mul(h));var x=v.sub(y.mul(m));if(!n&&l.cmp(p)<0)t=c.neg(),i=h,n=l.neg(),s=u;else if(n&&2==++g)break;c=l,f=d,d=l,b=h,h=u,v=m,m=x}a=l.neg(),o=u;var _=n.sqr().add(s.sqr());return a.sqr().add(o.sqr()).cmp(_)>=0&&(a=t,o=i),n.negative&&(n=n.neg(),s=s.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:n,b:s},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],n=t[1],r=n.b.mul(e).divRound(this.n),s=i.b.neg().mul(e).divRound(this.n),a=r.mul(i.a),o=s.mul(n.a),c=r.mul(i.b),l=s.mul(n.b);return{k1:e.sub(a).sub(o),k2:c.add(l).neg()}},c.prototype.pointFromX=function(e,t){(e=new r(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(0!==n.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var s=n.fromRed().isOdd();return(t&&!s||!t&&s)&&(n=n.redNeg()),this.point(e,n)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,n=this.a.redMul(t),r=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===i.redSqr().redISub(r).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,i){for(var n=this._endoWnafT1,r=this._endoWnafT2,s=0;s":""},l.prototype.isInfinity=function(){return this.inf},l.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 i=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)},l.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,i=this.x.redSqr(),n=e.redInvm(),r=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(n),s=r.redSqr().redISub(this.x.redAdd(this.x)),a=r.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,a)},l.prototype.getX=function(){return this.x.fromRed()},l.prototype.getY=function(){return this.y.fromRed()},l.prototype.mul=function(e){return e=new r(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)},l.prototype.mulAdd=function(e,t,i){var n=[this,t],r=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,r):this.curve._wnafMulAdd(1,n,r,2)},l.prototype.jmulAdd=function(e,t,i){var n=[this,t],r=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,r,!0):this.curve._wnafMulAdd(1,n,r,2,!0)},l.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))},l.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return t},l.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(u,a.BasePoint),c.prototype.jpoint=function(e,t,i){return new u(this,e,t,i)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(i,n)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(t),r=e.x.redMul(i),s=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(i.redMul(this.z)),o=n.redSub(r),c=s.redSub(a);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=o.redSqr(),u=l.redMul(o),p=n.redMul(l),d=c.redSqr().redIAdd(u).redISub(p).redISub(p),f=c.redMul(p.redISub(d)).redISub(s.redMul(u)),h=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(d,f,h)},u.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,n=e.x.redMul(t),r=this.y,s=e.y.redMul(t).redMul(this.z),a=i.redSub(n),o=r.redSub(s);if(0===a.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),l=c.redMul(a),u=i.redMul(c),p=o.redSqr().redIAdd(l).redISub(u).redISub(u),d=o.redMul(u.redISub(p)).redISub(r.redMul(l)),f=this.z.redMul(a);return this.curve.jpoint(p,d,f)},u.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 i=this;for(t=0;t=0)return!1;if(i.redIAdd(r),0===this.x.cmp(i))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":173,"./base":160,"bn.js":174,inherits:217}],165:[function(e,t,i){"use strict";var n,r=i,s=e("hash.js"),a=e("./curve"),o=e("./utils").assert;function c(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function l(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var i=new c(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:i}),i}})}r.PresetCurve=c,l("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:s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),l("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:s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),l("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:s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),l("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:s.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"]}),l("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:s.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"]}),l("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["9"]}),l("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:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=e("./precomputed/secp256k1")}catch(e){n=void 0}l("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:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"./curve":162,"./precomputed/secp256k1":172,"./utils":173,"hash.js":201}],166:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("hmac-drbg"),s=e("../utils"),a=e("../curves"),o=e("brorand"),c=s.assert,l=e("./key"),u=e("./signature");function p(e){if(!(this instanceof p))return new p(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.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}t.exports=p,p.prototype.keyPair=function(e){return new l(this,e)},p.prototype.keyFromPrivate=function(e,t){return l.fromPrivate(this,e,t)},p.prototype.keyFromPublic=function(e,t){return l.fromPublic(this,e,t)},p.prototype.genKeyPair=function(e){e||(e={});for(var t=new r({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),s=this.n.sub(new n(2));;){var a=new n(t.generate(i));if(!(a.cmp(s)>0))return a.iaddn(1),this.keyFromPrivate(a)}},p.prototype._truncateToN=function(e,t){var i=8*e.byteLength()-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},p.prototype.sign=function(e,t,i,s){"object"==typeof i&&(s=i,i=null),s||(s={}),t=this.keyFromPrivate(t,i),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),o=t.getPrivate().toArray("be",a),c=e.toArray("be",a),l=new r({hash:this.hash,entropy:o,nonce:c,pers:s.pers,persEnc:s.persEnc||"utf8"}),p=this.n.sub(new n(1)),d=0;;d++){var f=s.k?s.k(d):new n(l.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(p)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var m=h.getX(),b=m.umod(this.n);if(0!==b.cmpn(0)){var v=f.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var g=(h.getY().isOdd()?1:0)|(0!==m.cmp(b)?2:0);return s.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),g^=1),new u({r:b,s:v,recoveryParam:g})}}}}}},p.prototype.verify=function(e,t,i,r){e=this._truncateToN(new n(e,16)),i=this.keyFromPublic(i,r);var s=(t=new u(t,"hex")).r,a=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var o,c=a.invm(this.n),l=c.mul(e).umod(this.n),p=c.mul(s).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(l,i.getPublic(),p)).isInfinity()&&o.eqXToP(s):!(o=this.g.mulAdd(l,i.getPublic(),p)).isInfinity()&&0===o.getX().umod(this.n).cmp(s)},p.prototype.recoverPubKey=function(e,t,i,r){c((3&i)===i,"The recovery param is more than two bits"),t=new u(t,r);var s=this.n,a=new n(e),o=t.r,l=t.s,p=1&i,d=i>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");o=d?this.curve.pointFromX(o.add(this.curve.n),p):this.curve.pointFromX(o,p);var f=t.r.invm(s),h=s.sub(a).mul(f).umod(s),m=l.mul(f).umod(s);return this.g.mulAdd(h,o,m)},p.prototype.getKeyRecoveryParam=function(e,t,i,n){if(null!==(t=new u(t,n)).recoveryParam)return t.recoveryParam;for(var r=0;r<4;r++){var s;try{s=this.recoverPubKey(e,t,r)}catch(e){continue}if(s.eq(i))return r}throw new Error("Unable to find valid recovery factor")}},{"../curves":165,"../utils":173,"./key":167,"./signature":168,"bn.js":174,brorand:66,"hmac-drbg":213}],167:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("../utils").assert;function s(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)}t.exports=s,s.fromPublic=function(e,t,i){return t instanceof s?t:new s(e,{pub:t,pubEnc:i})},s.fromPrivate=function(e,t,i){return t instanceof s?t:new s(e,{priv:t,privEnc:i})},s.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"}},s.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},s.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?r(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||r(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)},s.prototype.derive=function(e){return e.validate()||r(e.validate(),"public point not validated"),e.mul(this.priv).getX()},s.prototype.sign=function(e,t,i){return this.ec.sign(e,this,t,i)},s.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},s.prototype.inspect=function(){return""}},{"../utils":173,"bn.js":174}],168:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("../utils"),s=r.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(s(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function o(){this.place=0}function c(e,t){var i=e[t.place++];if(!(128&i))return i;var n=15&i;if(0===n||n>4)return!1;for(var r=0,s=0,a=t.place;s>>=0;return!(r<=127)&&(t.place=a,r)}function l(e){for(var t=0,i=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|i);--i;)e.push(t>>>(i<<3)&255);e.push(t)}}t.exports=a,a.prototype._importDER=function(e,t){e=r.toArray(e,t);var i=new o;if(48!==e[i.place++])return!1;var s=c(e,i);if(!1===s)return!1;if(s+i.place!==e.length)return!1;if(2!==e[i.place++])return!1;var a=c(e,i);if(!1===a)return!1;var l=e.slice(i.place,a+i.place);if(i.place+=a,2!==e[i.place++])return!1;var u=c(e,i);if(!1===u)return!1;if(e.length!==u+i.place)return!1;var p=e.slice(i.place,u+i.place);if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}if(0===p[0]){if(!(128&p[1]))return!1;p=p.slice(1)}return this.r=new n(l),this.s=new n(p),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&i[0]&&(i=[0].concat(i)),t=l(t),i=l(i);!(i[0]||128&i[1]);)i=i.slice(1);var n=[2];u(n,t.length),(n=n.concat(t)).push(2),u(n,i.length);var s=n.concat(i),a=[48];return u(a,s.length),a=a.concat(s),r.encode(a,e)}},{"../utils":173,"bn.js":174}],169:[function(e,t,i){"use strict";var n=e("hash.js"),r=e("../curves"),s=e("../utils"),a=s.assert,o=s.parseBytes,c=e("./key"),l=e("./signature");function u(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof u))return new u(e);e=r[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=n.sha512}t.exports=u,u.prototype.sign=function(e,t){e=o(e);var i=this.keyFromSecret(t),n=this.hashInt(i.messagePrefix(),e),r=this.g.mul(n),s=this.encodePoint(r),a=this.hashInt(s,i.pubBytes(),e).mul(i.priv()),c=n.add(a).umod(this.curve.n);return this.makeSignature({R:r,S:c,Rencoded:s})},u.prototype.verify=function(e,t,i){e=o(e),t=this.makeSignature(t);var n=this.keyFromPublic(i),r=this.hashInt(t.Rencoded(),n.pubBytes(),e),s=this.g.mul(t.S());return t.R().add(n.pub().mul(r)).eq(s)},u.prototype.hashInt=function(){for(var e=this.hash(),t=0;t(r>>1)-1?(r>>1)-c:c,s.isubn(o)):o=0,n[a]=o,s.iushrn(1)}return n},n.getJSF=function(e,t){var i=[[],[]];e=e.clone(),t=t.clone();for(var n,r=0,s=0;e.cmpn(-r)>0||t.cmpn(-s)>0;){var a,o,c=e.andln(3)+r&3,l=t.andln(3)+s&3;3===c&&(c=-1),3===l&&(l=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+r&7)&&5!==n||2!==l?c:-c,i[0].push(a),o=0==(1&l)?0:3!==(n=t.andln(7)+s&7)&&5!==n||2!==c?l:-l,i[1].push(o),2*r===a+1&&(r=1-r),2*s===o+1&&(s=1-s),e.iushrn(1),t.iushrn(1)}return i},n.cachedProperty=function(e,t,i){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=i.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new r(e,"hex","le")}},{"bn.js":174,"minimalistic-assert":256,"minimalistic-crypto-utils":257}],174:[function(e,t,i){arguments[4][17][0].apply(i,arguments)},{buffer:67,dup:17}],175:[function(e,t,i){t.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{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/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny ",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{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"},dependencies:{"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"}}},{}],176:[function(e,t,i){(function(i){(function(){var n=e("once"),r=function(){},s=function(e,t,a){if("function"==typeof t)return s(e,null,t);t||(t={}),a=n(a||r);var o=e._writableState,c=e._readableState,l=t.readable||!1!==t.readable&&e.readable,u=t.writable||!1!==t.writable&&e.writable,p=!1,d=function(){e.writable||f()},f=function(){u=!1,l||a.call(e)},h=function(){l=!1,u||a.call(e)},m=function(t){a.call(e,t?new Error("exited with error code: "+t):null)},b=function(t){a.call(e,t)},v=function(){i.nextTick(g)},g=function(){if(!p)return(!l||c&&c.ended&&!c.destroyed)&&(!u||o&&o.ended&&!o.destroyed)?void 0:a.call(e,new Error("premature close"))},y=function(){e.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?u&&!o&&(e.on("end",d),e.on("close",d)):(e.on("complete",f),e.on("abort",v),e.req?y():e.on("request",y)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",m),e.on("end",h),e.on("finish",f),!1!==t.error&&e.on("error",b),e.on("close",v),function(){p=!0,e.removeListener("complete",f),e.removeListener("abort",v),e.removeListener("request",y),e.req&&e.req.removeListener("finish",f),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",f),e.removeListener("exit",m),e.removeListener("end",h),e.removeListener("error",b),e.removeListener("close",v)}};t.exports=s}).call(this)}).call(this,e("_process"))},{_process:296,once:281}],177:[function(e,t,i){"use strict";function n(e,t){for(const i in t)Object.defineProperty(e,i,{value:t[i],enumerable:!0,configurable:!0});return e}t.exports=function(e,t,i){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code");i||(i={}),"object"==typeof t&&(i=t,t=""),t&&(i.code=t);try{return n(e,i)}catch(t){i.message=e.message,i.stack=e.stack;const r=function(){};r.prototype=Object.create(Object.getPrototypeOf(e));return n(new r,i)}}},{}],178:[function(e,t,i){"use strict";var n,r="object"==typeof Reflect?Reflect:null,s=r&&"function"==typeof r.apply?r.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(e,t){return new Promise((function(i,n){function r(i){e.removeListener(t,s),n(i)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",r),i([].slice.call(arguments))}v(e,t,s,{once:!0}),"error"!==t&&function(e,t,i){"function"==typeof e.on&&v(e,"error",t,i)}(e,r,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var c=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function p(e,t,i,n){var r,s,a,o;if(l(i),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),s=e._events),a=s[t]),void 0===a)a=s[t]=i,++e._eventsCount;else if("function"==typeof a?a=s[t]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),(r=u(e))>0&&a.length>r&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,o=c,console&&console.warn&&console.warn(o)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=d.bind(n);return r.listener=i,n.wrapFn=r,r}function h(e,t,i){var n=e._events;if(void 0===n)return[];var r=n[t];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(e){for(var t=new Array(e.length),i=0;i0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var c=r[e];if(void 0===c)return!1;if("function"==typeof c)s(c,this,t);else{var l=c.length,u=b(c,l);for(i=0;i=0;s--)if(i[s]===t||i[s].listener===t){a=i[s].listener,r=s;break}if(r<0)return this;0===r?i.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},o.prototype.listenerCount=m,o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],179:[function(e,t,i){var n=e("safe-buffer").Buffer,r=e("md5.js");t.exports=function(e,t,i,s){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=i/8,o=n.alloc(a),c=n.alloc(s||0),l=n.alloc(0);a>0||s>0;){var u=new r;u.update(l),u.update(e),t&&u.update(t),l=u.digest();var p=0;if(a>0){var d=o.length-a;p=Math.min(a,l.length),l.copy(o,d,0,p),a-=p}if(p0){var f=c.length-s,h=Math.min(s,l.length-p);l.copy(c,f,p,p+h),s-=h}}return l.fill(0),{key:o,iv:c}}},{"md5.js":229,"safe-buffer":338}],180:[function(e,t,i){const{Readable:n,Writable:r}=e("streamx");e("fast-readable-async-iterator");t.exports={BlobWriteStream:class extends r{constructor(e,t={}){super(Object.assign({decodeStrings:!1},t)),this.chunks=[];const i=t.mimeType;this.once("close",(()=>{const t=null!=i?new Blob(this.chunks,{type:i}):new Blob(this.chunks);e(t),this.emit("blob",t)}))}_write(e,t){this.chunks.push(e),t()}},BlobReadStream:function(e,t={}){return n.from(e.stream(),t)}}},{"fast-readable-async-iterator":183,streamx:426}],181:[function(e,t,i){t.exports=class{constructor(e){if(!(e>0)||0!=(e-1&e))throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return void 0===this.buffer[this.top]&&(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){const e=this.buffer[this.btm];if(void 0!==e)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}peek(){return this.buffer[this.btm]}isEmpty(){return void 0===this.buffer[this.btm]}}},{}],182:[function(e,t,i){const n=e("./fixed-size");t.exports=class{constructor(e){this.hwm=e||16,this.head=new n(this.hwm),this.tail=this.head,this.length=0}push(e){if(this.length++,!this.head.push(e)){const t=this.head;this.head=t.next=new n(2*this.head.buffer.length),this.head.push(e)}}shift(){0!==this.length&&this.length--;const e=this.tail.shift();if(void 0===e&&this.tail.next){const e=this.tail.next;return this.tail.next=null,this.tail=e,this.tail.shift()}return e}peek(){return this.tail.peek()}isEmpty(){return this.head.isEmpty()}}},{"./fixed-size":181}],183:[function(e,t,i){"undefined"==typeof ReadableStream||ReadableStream.prototype[Symbol.asyncIterator]||(ReadableStream.prototype[Symbol.asyncIterator]=function(){const e=this.getReader();let t=e.read();return{next(){const i=t;return t=e.read(),i},return(){t.then((()=>e.releaseLock()))},throw(e){throw this.return(),e},[Symbol.asyncIterator](){return this}}})},{}],184:[function(e,t,i){t.exports=function(){if("undefined"==typeof globalThis)return null;var e={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},{}],185:[function(e,t,i){"use strict";var n=e("safe-buffer").Buffer,r=e("readable-stream").Transform;function s(e){r.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}e("inherits")(s,r),s.prototype._transform=function(e,t,i){var n=null;try{this.update(e,t)}catch(e){n=e}i(n)},s.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},s.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var i=this._block,r=0;this._blockOffset+e.length-r>=this._blockSize;){for(var s=this._blockOffset;s0;++a)this._length[a]+=o,(o=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*o);return this},s.prototype._update=function(){throw new Error("_update is not implemented")},s.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 i=0;i<4;++i)this._length[i]=0;return t},s.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=s},{inherits:217,"readable-stream":200,"safe-buffer":338}],186:[function(e,t,i){arguments[4][28][0].apply(i,arguments)},{dup:28}],187:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{"./_stream_readable":189,"./_stream_writable":191,_process:296,dup:29,inherits:217}],188:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_transform":190,dup:30,inherits:217}],189:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"../errors":186,"./_stream_duplex":187,"./internal/streams/async_iterator":192,"./internal/streams/buffer_list":193,"./internal/streams/destroy":194,"./internal/streams/from":196,"./internal/streams/state":198,"./internal/streams/stream":199,_process:296,buffer:110,dup:31,events:178,inherits:217,"string_decoder/":427,util:67}],190:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":186,"./_stream_duplex":187,dup:32,inherits:217}],191:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":186,"./_stream_duplex":187,"./internal/streams/destroy":194,"./internal/streams/state":198,"./internal/streams/stream":199,_process:296,buffer:110,dup:33,inherits:217,"util-deprecate":440}],192:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"./end-of-stream":195,_process:296,dup:34}],193:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{buffer:110,dup:35,util:67}],194:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{_process:296,dup:36}],195:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{"../../../errors":186,dup:37}],196:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{dup:38}],197:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{"../../../errors":186,"./end-of-stream":195,dup:39}],198:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":186,dup:40}],199:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{dup:41,events:178}],200:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{"./lib/_stream_duplex.js":187,"./lib/_stream_passthrough.js":188,"./lib/_stream_readable.js":189,"./lib/_stream_transform.js":190,"./lib/_stream_writable.js":191,"./lib/internal/streams/end-of-stream.js":195,"./lib/internal/streams/pipeline.js":197,dup:42}],201:[function(e,t,i){var n=i;n.utils=e("./hash/utils"),n.common=e("./hash/common"),n.sha=e("./hash/sha"),n.ripemd=e("./hash/ripemd"),n.hmac=e("./hash/hmac"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},{"./hash/common":202,"./hash/hmac":203,"./hash/ripemd":204,"./hash/sha":205,"./hash/utils":212}],202:[function(e,t,i){"use strict";var n=e("./utils"),r=e("minimalistic-assert");function s(){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}i.BlockHash=s,s.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var i=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-i,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-i,this.endian);for(var r=0;r>>24&255,n[r++]=e>>>16&255,n[r++]=e>>>8&255,n[r++]=255&e}else for(n[r++]=255&e,n[r++]=e>>>8&255,n[r++]=e>>>16&255,n[r++]=e>>>24&255,n[r++]=0,n[r++]=0,n[r++]=0,n[r++]=0,s=8;sthis.blockSize&&(e=(new this.Hash).update(e).digest()),r(e.length<=this.blockSize);for(var t=e.length;t>>3},i.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},{"../utils":212}],212:[function(e,t,i){"use strict";var n=e("minimalistic-assert"),r=e("inherits");function s(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function c(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}i.inherits=r,i.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),r=0;r>6|192,i[n++]=63&a|128):s(e,r)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++r)),i[n++]=a>>18|240,i[n++]=a>>12&63|128,i[n++]=a>>6&63|128,i[n++]=63&a|128):(i[n++]=a>>12|224,i[n++]=a>>6&63|128,i[n++]=63&a|128)}else for(r=0;r>>0}return a},i.split32=function(e,t){for(var i=new Array(4*e.length),n=0,r=0;n>>24,i[r+1]=s>>>16&255,i[r+2]=s>>>8&255,i[r+3]=255&s):(i[r+3]=s>>>24,i[r+2]=s>>>16&255,i[r+1]=s>>>8&255,i[r]=255&s)}return i},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,i){return e+t+i>>>0},i.sum32_4=function(e,t,i,n){return e+t+i+n>>>0},i.sum32_5=function(e,t,i,n,r){return e+t+i+n+r>>>0},i.sum64=function(e,t,i,n){var r=e[t],s=n+e[t+1]>>>0,a=(s>>0,e[t+1]=s},i.sum64_hi=function(e,t,i,n){return(t+n>>>0>>0},i.sum64_lo=function(e,t,i,n){return t+n>>>0},i.sum64_4_hi=function(e,t,i,n,r,s,a,o){var c=0,l=t;return c+=(l=l+n>>>0)>>0)>>0)>>0},i.sum64_4_lo=function(e,t,i,n,r,s,a,o){return t+n+s+o>>>0},i.sum64_5_hi=function(e,t,i,n,r,s,a,o,c,l){var u=0,p=t;return u+=(p=p+n>>>0)>>0)>>0)>>0)>>0},i.sum64_5_lo=function(e,t,i,n,r,s,a,o,c,l){return t+n+s+o+l>>>0},i.rotr64_hi=function(e,t,i){return(t<<32-i|e>>>i)>>>0},i.rotr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0},i.shr64_hi=function(e,t,i){return e>>>i},i.shr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0}},{inherits:217,"minimalistic-assert":256}],213:[function(e,t,i){"use strict";var n=e("hash.js"),r=e("minimalistic-crypto-utils"),s=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(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=r.toArray(e.entropy,e.entropyEnc||"hex"),i=r.toArray(e.nonce,e.nonceEnc||"hex"),n=r.toArray(e.pers,e.persEnc||"hex");s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,i,n)}t.exports=a,a.prototype._init=function(e,t,i){var n=e.concat(t).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var r=0;r=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},a.prototype.generate=function(e,t,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=i,i=t,t=null),i&&(i=r.toArray(i,n||"hex"),this._update(i));for(var s=[];s.length */ i.read=function(e,t,i,n,r){var s,a,o=8*r-n-1,c=(1<>1,u=-7,p=i?r-1:0,d=i?-1:1,f=e[t+p];for(p+=d,s=f&(1<<-u)-1,f>>=-u,u+=o;u>0;s=256*s+e[t+p],p+=d,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=n;u>0;a=256*a+e[t+p],p+=d,u-=8);if(0===s)s=1-l;else{if(s===c)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),s-=l}return(f?-1:1)*a*Math.pow(2,s-n)},i.write=function(e,t,i,n,r,s){var a,o,c,l=8*s-r-1,u=(1<>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,h=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+p>=1?d/c:d*Math.pow(2,1-p))*c>=2&&(a++,c/=2),a+p>=u?(o=0,a=u):a+p>=1?(o=(t*c-1)*Math.pow(2,r),a+=p):(o=t*Math.pow(2,p-1)*Math.pow(2,r),a=0));r>=8;e[i+f]=255&o,f+=h,o/=256,r-=8);for(a=a<0;e[i+f]=255&a,f+=h,a/=256,l-=8);e[i+f-h]|=128*m}},{}],216:[function(e,t,i){ /*! immediate-chunk-store. MIT License. Feross Aboukhadijeh */ @@ -91,13 +91,13 @@ t.exports=async function(e,t){const i=await n(e,t);return URL.createObjectURL(i) /*! stream-to-blob. MIT License. Feross Aboukhadijeh */ t.exports=function(e,t){if(null!=t&&"string"!=typeof t)throw new Error("Invalid mimetype, expected string.");return new Promise(((i,n)=>{const r=[];e.on("data",(e=>r.push(e))).once("end",(()=>{const e=null!=t?new Blob(r,{type:t}):new Blob(r);i(e)})).once("error",n)}))}},{}],425:[function(e,t,i){(function(i){(function(){ /*! stream-with-known-length-to-buffer. MIT License. Feross Aboukhadijeh */ -var n=e("once");t.exports=function(e,t,r){r=n(r);var s=i.alloc(t),a=0;e.on("data",(function(e){e.copy(s,a),a+=e.length})).on("end",(function(){r(null,s)})).on("error",r)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,once:281}],426:[function(e,t,i){const{EventEmitter:n}=e("events"),r=new Error("Stream was destroyed"),s=new Error("Premature close"),a=e("queue-tick"),o=e("fast-fifo"),c=67108863,l=4,u=8,p=1^c,d=16,f=32,h=64,m=128,b=256,v=512,g=1024,y=2048,x=4096,_=8192,w=16384,k=32784,E=65536,S=b|v,M=d|h,A=d|h|E,j=f|d,I=67108847,T=c^(f|E),C=c^h,B=c^S,R=67076079,L=1<<17,O=2<<17,P=4<<17,U=8<<17,q=16<<17,N=32<<17,D=64<<17,z=129<<17,H=256<<17,F=66977791,W=c^P,V=c^O,K=c^q,$=50200575,G=131088,X=66977775,Y=w|N,Z=l|u|2,J=1|Z,Q=Z|Y,ee=V&(c^f),te=16941072,ie=J|te&X,ne=J|g|w,re=J|w|m,se=J|g|m,ae=J|x|m|_,oe=J|d|g|w|E,ce=Z|g|w,le=J|H|N,ue=U|q,pe=1179648,de=U|q|J|L,fe=J|L|U,he=O|L,me=L|P,be=J|H|pe|N,ve=q|Z|H|N,ge=Symbol.asyncIterator||Symbol("asyncIterator");class ye{constructor(e,{highWaterMark:t=16384,map:i=null,mapWritable:n,byteLength:r,byteLengthWritable:s}={}){this.stream=e,this.queue=new o,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.byteLength=s||r||De,this.map=n||i,this.afterWrite=Me.bind(this),this.afterUpdateNextTick=Ie.bind(this)}get ended(){return 0!=(this.stream._duplexState&N)}push(e){return null!==this.map&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),this.buffered=e._readableState.highWaterMark}static isPaused(e){return 0==(e._duplexState&b)}[ge](){const e=this;let t=null,i=null,n=null;return this.on("error",(e=>{t=e})),this.on("readable",(function(){null!==i&&s(e.read())})),this.on("close",(function(){null!==i&&s(null)})),{[ge](){return this},next:()=>new Promise((function(t,r){i=t,n=r;const a=e.read();null!==a?s(a):0!=(e._duplexState&u)&&s(null)})),return:()=>a(null),throw:e=>a(e)};function s(s){null!==n&&(t?n(t):null===s&&0==(e._duplexState&w)?n(r):i({value:s,done:null===s}),n=i=null)}function a(t){return e.destroy(t),new Promise(((i,n)=>{if(e._duplexState&u)return i({value:void 0,done:!0});e.once("close",(function(){t?n(t):i({value:void 0,done:!0})}))}))}}}class Le extends Re{constructor(e){super(e),this._duplexState=1,this._writableState=new ye(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final))}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}}class Oe extends Le{constructor(e){super(e),this._transformState=new _e(this),e&&(e.transform&&(this._transform=e.transform),e.flush&&(this._flush=e.flush))}_write(e,t){this._readableState.buffered>=this._readableState.highWaterMark?this._transformState.data=e:this._transform(e,this._transformState.afterTransform)}_read(e){if(null!==this._transformState.data){const t=this._transformState.data;this._transformState.data=null,e(null),this._transform(t,this._transformState.afterTransform)}else e(null)}_transform(e,t){t(null,e)}_flush(e){e(null)}_final(e){this._transformState.afterFinal=e,this._flush(Pe.bind(this))}}function Pe(e,t){const i=this._transformState.afterFinal;if(e)return i(e);null!=t&&this.push(t),this.push(null),i(null)}function Ue(e,...t){const i=Array.isArray(e)?[...e,...t]:[e,...t],n=i.length&&"function"==typeof i[i.length-1]?i.pop():null;if(i.length<2)throw new Error("Pipeline requires at least 2 streams");let r=i[0],a=null,o=null;for(let e=1;e1,l),r.pipe(a)),r=a;if(n){let e=!1;a.on("finish",(()=>{e=!0})),a.on("error",(e=>{o=o||e})),a.on("close",(()=>n(o||(e?null:s))))}return a;function c(e,t,i,n){e.on("error",n),e.on("close",(function(){if(t&&e._readableState&&!e._readableState.ended)return n(s);if(i&&e._writableState&&!e._writableState.ended)return n(s)}))}function l(e){if(e&&!o){o=e;for(const t of i)t.destroy(e)}}}function qe(e){return!!e._readableState||!!e._writableState}function Ne(e){return"number"==typeof e._duplexState&&qe(e)}function De(e){return function(e){return"object"==typeof e&&null!==e&&"number"==typeof e.byteLength}(e)?e.byteLength:1024}function ze(){}function He(){this.destroy(new Error("Stream aborted."))}t.exports={pipeline:Ue,pipelinePromise:function(...e){return new Promise(((t,i)=>Ue(...e,(e=>{if(e)return i(e);t()}))))},isStream:qe,isStreamx:Ne,getStreamError:function(e){return e._readableState&&e._readableState.error||e._writableState&&e._writableState.error},Stream:Be,Writable:class extends Be{constructor(e){super(e),this._duplexState|=16385,this._writableState=new ye(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final))}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}static isBackpressured(e){return 0!=(e._duplexState&ve)}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}},Readable:Re,Duplex:Le,Transform:Oe,PassThrough:class extends Oe{}}},{events:178,"fast-fifo":182,"queue-tick":310}],427:[function(e,t,i){"use strict";var n=e("safe-buffer").Buffer,r=n.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}};function s(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&&(n.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=l,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=u,this.end=p,t=3;break;default:return this.write=d,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,i=function(e,t,i){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!==i?i: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 c(e,t){if((e.length-t)%2==0){var i=e.toString("utf16le",t);if(i){var n=i.charCodeAt(i.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],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}function u(e,t){var i=(e.length-t)%3;return 0===i?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,1===i?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-i))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}i.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,i;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i=0)return r>0&&(e.lastNeed=r-1),r;if(--n=0)return r>0&&(e.lastNeed=r-2),r;if(--n=0)return r>0&&(2===r?r=0:e.lastNeed=r-3),r;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var n=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},s.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}},{"safe-buffer":338}],428:[function(e,t,i){var n=e("./thirty-two");i.encode=n.encode,i.decode=n.decode},{"./thirty-two":429}],429:[function(e,t,i){(function(e){(function(){"use strict";var t=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];i.encode=function(t){e.isBuffer(t)||(t=new e(t));for(var i,n,r=0,s=0,a=0,o=0,c=new e(8*(i=t,n=Math.floor(i.length/5),i.length%5==0?n:n+1));r3?(o=(o=l&255>>a)<<(a=(a+5)%8)|(r+1>8-a,r++):(o=l>>8-(a+5)&31,0===(a=(a+5)%8)&&r++),c[s]="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".charCodeAt(o),s++}for(r=s;r>>(r=(r+5)%8),o[a]=n,a++,n=255&s<<8-r)}return o.slice(0,a)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],430:[function(e,t,i){const n=100;function r(e){return(+Date.now()-e)/n&65535}t.exports=function(e){const t=+Date.now(),i=10*(e||5),n=[0];let s=1,a=r(t)-1&65535;return function(e){const o=r(t);let c=o-a&65535;for(c>i&&(c=i),a=o;c--;)s===i&&(s=0),n[s]=n[0===s?i-1:s-1],s++;e&&(n[s-1]+=e);const l=n[s-1],u=n.length=e._readableState.highWaterMark}static isPaused(e){return 0==(e._duplexState&h)}[ee](){const e=this;let t=null,i=null,n=null;return this.on("error",(e=>{t=e})),this.on("readable",(function(){null!==i&&s(e.read())})),this.on("close",(function(){null!==i&&s(null)})),{[ee](){return this},next:()=>new Promise((function(t,r){i=t,n=r;const a=e.read();null!==a?s(a):0!=(e._duplexState&u)&&s(null)})),return:()=>a(null),throw:e=>a(e)};function s(s){null!==n&&(t?n(t):null===s&&0==(e._duplexState&y)?n(r):i({value:s,done:null===s}),n=i=null)}function a(t){return e.destroy(t),new Promise(((i,n)=>{if(e._duplexState&u)return i({value:void 0,done:!0});e.once("close",(function(){t?n(t):i({value:void 0,done:!0})}))}))}}}class be extends me{constructor(e){super(e),this._duplexState=1,this._writableState=new te(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final))}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}}class ve extends be{constructor(e){super(e),this._transformState=new ne(this),e&&(e.transform&&(this._transform=e.transform),e.flush&&(this._flush=e.flush))}_write(e,t){this._readableState.buffered>=this._readableState.highWaterMark?this._transformState.data=e:this._transform(e,this._transformState.afterTransform)}_read(e){if(null!==this._transformState.data){const t=this._transformState.data;this._transformState.data=null,e(null),this._transform(t,this._transformState.afterTransform)}else e(null)}_transform(e,t){t(null,e)}_flush(e){e(null)}_final(e){this._transformState.afterFinal=e,this._flush(ge.bind(this))}}function ge(e,t){const i=this._transformState.afterFinal;if(e)return i(e);null!=t&&this.push(t),this.push(null),i(null)}function ye(e,...t){const i=Array.isArray(e)?[...e,...t]:[e,...t],n=i.length&&"function"==typeof i[i.length-1]?i.pop():null;if(i.length<2)throw new Error("Pipeline requires at least 2 streams");let r=i[0],a=null,o=null;for(let e=1;e1,l),r.pipe(a)),r=a;if(n){let e=!1;a.on("finish",(()=>{e=!0})),a.on("error",(e=>{o=o||e})),a.on("close",(()=>n(o||(e?null:s))))}return a;function c(e,t,i,n){e.on("error",n),e.on("close",(function(){if(t&&e._readableState&&!e._readableState.ended)return n(s);if(i&&e._writableState&&!e._writableState.ended)return n(s)}))}function l(e){if(e&&!o){o=e;for(const t of i)t.destroy(e)}}}function xe(e){return!!e._readableState||!!e._writableState}function _e(e){return"number"==typeof e._duplexState&&xe(e)}function we(e){return function(e){return"object"==typeof e&&null!==e&&"number"==typeof e.byteLength}(e)?e.byteLength:1024}function ke(){}function Ee(){this.destroy(new Error("Stream aborted."))}t.exports={pipeline:ye,pipelinePromise:function(...e){return new Promise(((t,i)=>ye(...e,(e=>{if(e)return i(e);t()}))))},isStream:xe,isStreamx:_e,getStreamError:function(e){return e._readableState&&e._readableState.error||e._writableState&&e._writableState.error},Stream:he,Writable:class extends he{constructor(e){super(e),this._duplexState|=16385,this._writableState=new te(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final))}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}static isBackpressured(e){return 0!=(e._duplexState&Q)}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}},Readable:me,Duplex:be,Transform:ve,PassThrough:class extends ve{}}},{events:178,"fast-fifo":182,"queue-tick":310}],427:[function(e,t,i){"use strict";var n=e("safe-buffer").Buffer,r=n.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}};function s(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&&(n.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=l,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=u,this.end=p,t=3;break;default:return this.write=d,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,i=function(e,t,i){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!==i?i: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 c(e,t){if((e.length-t)%2==0){var i=e.toString("utf16le",t);if(i){var n=i.charCodeAt(i.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],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}function u(e,t){var i=(e.length-t)%3;return 0===i?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,1===i?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-i))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}i.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,i;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i=0)return r>0&&(e.lastNeed=r-1),r;if(--n=0)return r>0&&(e.lastNeed=r-2),r;if(--n=0)return r>0&&(2===r?r=0:e.lastNeed=r-3),r;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var n=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},s.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}},{"safe-buffer":338}],428:[function(e,t,i){var n=e("./thirty-two");i.encode=n.encode,i.decode=n.decode},{"./thirty-two":429}],429:[function(e,t,i){(function(e){(function(){"use strict";var t=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];i.encode=function(t){e.isBuffer(t)||(t=new e(t));for(var i,n,r=0,s=0,a=0,o=0,c=new e(8*(i=t,n=Math.floor(i.length/5),i.length%5==0?n:n+1));r3?(o=(o=l&255>>a)<<(a=(a+5)%8)|(r+1>8-a,r++):(o=l>>8-(a+5)&31,0===(a=(a+5)%8)&&r++),c[s]="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".charCodeAt(o),s++}for(r=s;r>>(r=(r+5)%8),o[a]=n,a++,n=255&s<<8-r)}return o.slice(0,a)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],430:[function(e,t,i){function n(e){return(+Date.now()-e)/100&65535}t.exports=function(e){const t=+Date.now(),i=10*(e||5),r=[0];let s=1,a=n(t)-1&65535;return function(e){const o=n(t);let c=o-a&65535;for(c>i&&(c=i),a=o;c--;)s===i&&(s=0),r[s]=r[0===s?i-1:s-1],s++;e&&(r[s-1]+=e);const l=r[s-1],u=r.length-1}function f(e,t){return"function"==typeof e?e.apply(void 0,t):e}function h(e,t){return 0===t?e:function(n){clearTimeout(i),i=setTimeout((function(){e(n)}),t)};var i}function m(e,t){var i=Object.assign({},e);return t.forEach((function(e){delete i[e]})),i}function b(e){return[].concat(e)}function v(e,t){-1===e.indexOf(t)&&e.push(t)}function g(e){return e.split("-")[0]}function y(e){return[].slice.call(e)}function x(e){return Object.keys(e).reduce((function(t,i){return void 0!==e[i]&&(t[i]=e[i]),t}),{})}function _(){return document.createElement("div")}function w(e){return["Element","Fragment"].some((function(t){return d(e,t)}))}function k(e){return d(e,"MouseEvent")}function E(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function S(e){return w(e)?[e]:function(e){return d(e,"NodeList")}(e)?y(e):Array.isArray(e)?e:y(document.querySelectorAll(e))}function M(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function A(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function j(e){var t,i=b(e)[0];return null!=i&&null!=(t=i.ownerDocument)&&t.body?i.ownerDocument:document}function I(e,t,i){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[n](t,i)}))}function T(e,t){for(var i=t;i;){var n;if(e.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var C={isTouch:!1},B=0;function R(){C.isTouch||(C.isTouch=!0,window.performance&&document.addEventListener("mousemove",L))}function L(){var e=performance.now();e-B<20&&(C.isTouch=!1,document.removeEventListener("mousemove",L)),B=e}function O(){var e=document.activeElement;if(E(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var P,U=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;function q(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function N(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function D(e){return N("\n %ctippy.js\n\n %c"+N(e)+"\n\n %c👷‍ This is a development-only message. It will be removed in production.\n ")}function z(e){return[D(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function H(e,t){var i;e&&!P.has(t)&&(P.add(t),(i=console).warn.apply(i,z(t)))}function F(e,t){var i;e&&!P.has(t)&&(P.add(t),(i=console).error.apply(i,z(t)))}"production"!==t.env.NODE_ENV&&(P=new Set);var W={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},V=Object.assign({appendTo:u,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},W,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),K=Object.keys(V);function $(e){var t=(e.plugins||[]).reduce((function(t,i){var n,r=i.name,s=i.defaultValue;r&&(t[r]=void 0!==e[r]?e[r]:null!=(n=V[r])?n:s);return t}),{});return Object.assign({},e,t)}function G(e,t){var i=Object.assign({},t,{content:f(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys($(Object.assign({},V,{plugins:t}))):K).reduce((function(t,i){var n=(e.getAttribute("data-tippy-"+i)||"").trim();if(!n)return t;if("content"===i)t[i]=n;else try{t[i]=JSON.parse(n)}catch(e){t[i]=n}return t}),{})}(e,t.plugins));return i.aria=Object.assign({},V.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?t.interactive:i.aria.expanded,content:"auto"===i.aria.content?t.interactive?null:"describedby":i.aria.content},i}function X(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach((function(e){var i,n,r=m(V,Object.keys(W)),s=(i=r,n=e,!{}.hasOwnProperty.call(i,n));s&&(s=0===t.filter((function(t){return t.name===e})).length),H(s,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))}))}var Y=function(){return"innerHTML"};function Z(e,t){e[Y()]=t}function J(e){var t=_();return!0===e?t.className=o:(t.className=c,w(e)?t.appendChild(e):Z(t,e)),t}function Q(e,t){w(t.content)?(Z(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Z(e,t.content):e.textContent=t.content)}function ee(e){var t=e.firstElementChild,i=y(t.children);return{box:t,content:i.find((function(e){return e.classList.contains(s)})),arrow:i.find((function(e){return e.classList.contains(o)||e.classList.contains(c)})),backdrop:i.find((function(e){return e.classList.contains(a)}))}}function te(e){var t=_(),i=_();i.className=r,i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=_();function a(i,n){var r=ee(t),s=r.box,a=r.content,o=r.arrow;n.theme?s.setAttribute("data-theme",n.theme):s.removeAttribute("data-theme"),"string"==typeof n.animation?s.setAttribute("data-animation",n.animation):s.removeAttribute("data-animation"),n.inertia?s.setAttribute("data-inertia",""):s.removeAttribute("data-inertia"),s.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?s.setAttribute("role",n.role):s.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Q(a,e.props),n.arrow?o?i.arrow!==n.arrow&&(s.removeChild(o),s.appendChild(J(n.arrow))):s.appendChild(J(n.arrow)):o&&s.removeChild(o)}return n.className=s,n.setAttribute("data-state","hidden"),Q(n,e.props),t.appendChild(i),i.appendChild(n),a(e.props,e.props),{popper:t,onUpdate:a}}te.$$tippy=!0;var ie=1,ne=[],re=[];function se(e,i){var r,s,a,o,c,d,m,w,E=G(e,Object.assign({},V,$(x(i)))),S=!1,B=!1,R=!1,L=!1,O=[],P=h(Ee,E.interactiveDebounce),N=ie++,D=(w=E.plugins).filter((function(e,t){return w.indexOf(e)===t})),z={id:N,reference:e,popper:_(),popperInstance:null,props:E,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:D,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(s),cancelAnimationFrame(a)},setProps:function(i){"production"!==t.env.NODE_ENV&&H(z.state.isDestroyed,q("setProps"));if(z.state.isDestroyed)return;ue("onBeforeUpdate",[z,i]),we();var n=z.props,r=G(e,Object.assign({},n,x(i),{ignoreAttributes:!0}));z.props=r,_e(),n.interactiveDebounce!==r.interactiveDebounce&&(fe(),P=h(Ee,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?b(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");de(),le(),X&&X(n,r);z.popperInstance&&(je(),Te().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));ue("onAfterUpdate",[z,i])},setContent:function(e){z.setProps({content:e})},show:function(){"production"!==t.env.NODE_ENV&&H(z.state.isDestroyed,q("show"));var e=z.state.isVisible,i=z.state.isDestroyed,n=!z.state.isEnabled,r=C.isTouch&&!z.props.touch,s=p(z.props.duration,0,V.duration);if(e||i||n||r)return;if(se().hasAttribute("disabled"))return;if(ue("onShow",[z],!1),!1===z.props.onShow(z))return;z.state.isVisible=!0,te()&&(K.style.visibility="visible");le(),ve(),z.state.isMounted||(K.style.transition="none");if(te()){var a=oe();M([a.box,a.content],0)}d=function(){var e;if(z.state.isVisible&&!L){if(L=!0,K.offsetHeight,K.style.transition=z.props.moveTransition,te()&&z.props.animation){var t=oe(),i=t.box,n=t.content;M([i,n],s),A([i,n],"visible")}pe(),de(),v(re,z),null==(e=z.popperInstance)||e.forceUpdate(),ue("onMount",[z]),z.props.animation&&te()&&function(e,t){ye(e,t)}(s,(function(){z.state.isShown=!0,ue("onShown",[z])}))}},function(){var e,i=z.props.appendTo,n=se();e=z.props.interactive&&i===u||"parent"===i?n.parentNode:f(i,[n]);e.contains(K)||e.appendChild(K);z.state.isMounted=!0,je(),"production"!==t.env.NODE_ENV&&H(z.props.interactive&&i===V.appendTo&&n.nextElementSibling!==K,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper
or tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}()},hide:function(){"production"!==t.env.NODE_ENV&&H(z.state.isDestroyed,q("hide"));var e=!z.state.isVisible,i=z.state.isDestroyed,n=!z.state.isEnabled,r=p(z.props.duration,1,V.duration);if(e||i||n)return;if(ue("onHide",[z],!1),!1===z.props.onHide(z))return;z.state.isVisible=!1,z.state.isShown=!1,L=!1,S=!1,te()&&(K.style.visibility="hidden");if(fe(),ge(),le(!0),te()){var s=oe(),a=s.box,o=s.content;z.props.animation&&(M([a,o],r),A([a,o],"hidden"))}pe(),de(),z.props.animation?te()&&function(e,t){ye(e,(function(){!z.state.isVisible&&K.parentNode&&K.parentNode.contains(K)&&t()}))}(r,z.unmount):z.unmount()},hideWithInteractivity:function(e){"production"!==t.env.NODE_ENV&&H(z.state.isDestroyed,q("hideWithInteractivity"));ae().addEventListener("mousemove",P),v(ne,P),P(e)},enable:function(){z.state.isEnabled=!0},disable:function(){z.hide(),z.state.isEnabled=!1},unmount:function(){"production"!==t.env.NODE_ENV&&H(z.state.isDestroyed,q("unmount"));z.state.isVisible&&z.hide();if(!z.state.isMounted)return;Ie(),Te().forEach((function(e){e._tippy.unmount()})),K.parentNode&&K.parentNode.removeChild(K);re=re.filter((function(e){return e!==z})),z.state.isMounted=!1,ue("onHidden",[z])},destroy:function(){"production"!==t.env.NODE_ENV&&H(z.state.isDestroyed,q("destroy"));if(z.state.isDestroyed)return;z.clearDelayTimeouts(),z.unmount(),we(),delete e._tippy,z.state.isDestroyed=!0,ue("onDestroy",[z])}};if(!E.render)return"production"!==t.env.NODE_ENV&&F(!0,"render() function has not been supplied."),z;var W=E.render(z),K=W.popper,X=W.onUpdate;K.setAttribute("data-tippy-root",""),K.id="tippy-"+z.id,z.popper=K,e._tippy=z,K._tippy=z;var Y=D.map((function(e){return e.fn(z)})),Z=e.hasAttribute("aria-expanded");return _e(),de(),le(),ue("onCreate",[z]),E.showOnCreate&&Ce(),K.addEventListener("mouseenter",(function(){z.props.interactive&&z.state.isVisible&&z.clearDelayTimeouts()})),K.addEventListener("mouseleave",(function(){z.props.interactive&&z.props.trigger.indexOf("mouseenter")>=0&&ae().addEventListener("mousemove",P)})),z;function J(){var e=z.props.touch;return Array.isArray(e)?e:[e,0]}function Q(){return"hold"===J()[0]}function te(){var e;return!(null==(e=z.props.render)||!e.$$tippy)}function se(){return m||e}function ae(){var e=se().parentNode;return e?j(e):document}function oe(){return ee(K)}function ce(e){return z.state.isMounted&&!z.state.isVisible||C.isTouch||o&&"focus"===o.type?0:p(z.props.delay,e?0:1,V.delay)}function le(e){void 0===e&&(e=!1),K.style.pointerEvents=z.props.interactive&&!e?"":"none",K.style.zIndex=""+z.props.zIndex}function ue(e,t,i){var n;(void 0===i&&(i=!0),Y.forEach((function(i){i[e]&&i[e].apply(i,t)})),i)&&(n=z.props)[e].apply(n,t)}function pe(){var t=z.props.aria;if(t.content){var i="aria-"+t.content,n=K.id;b(z.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(i);if(z.state.isVisible)e.setAttribute(i,t?t+" "+n:n);else{var r=t&&t.replace(n,"").trim();r?e.setAttribute(i,r):e.removeAttribute(i)}}))}}function de(){!Z&&z.props.aria.expanded&&b(z.props.triggerTarget||e).forEach((function(e){z.props.interactive?e.setAttribute("aria-expanded",z.state.isVisible&&e===se()?"true":"false"):e.removeAttribute("aria-expanded")}))}function fe(){ae().removeEventListener("mousemove",P),ne=ne.filter((function(e){return e!==P}))}function he(t){if(!C.isTouch||!R&&"mousedown"!==t.type){var i=t.composedPath&&t.composedPath()[0]||t.target;if(!z.props.interactive||!T(K,i)){if(b(z.props.triggerTarget||e).some((function(e){return T(e,i)}))){if(C.isTouch)return;if(z.state.isVisible&&z.props.trigger.indexOf("click")>=0)return}else ue("onClickOutside",[z,t]);!0===z.props.hideOnClick&&(z.clearDelayTimeouts(),z.hide(),B=!0,setTimeout((function(){B=!1})),z.state.isMounted||ge())}}}function me(){R=!0}function be(){R=!1}function ve(){var e=ae();e.addEventListener("mousedown",he,!0),e.addEventListener("touchend",he,l),e.addEventListener("touchstart",be,l),e.addEventListener("touchmove",me,l)}function ge(){var e=ae();e.removeEventListener("mousedown",he,!0),e.removeEventListener("touchend",he,l),e.removeEventListener("touchstart",be,l),e.removeEventListener("touchmove",me,l)}function ye(e,t){var i=oe().box;function n(e){e.target===i&&(I(i,"remove",n),t())}if(0===e)return t();I(i,"remove",c),I(i,"add",n),c=n}function xe(t,i,n){void 0===n&&(n=!1),b(z.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,i,n),O.push({node:e,eventType:t,handler:i,options:n})}))}function _e(){var e;Q()&&(xe("touchstart",ke,{passive:!0}),xe("touchend",Se,{passive:!0})),(e=z.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(xe(e,ke),e){case"mouseenter":xe("mouseleave",Se);break;case"focus":xe(U?"focusout":"blur",Me);break;case"focusin":xe("focusout",Me)}}))}function we(){O.forEach((function(e){var t=e.node,i=e.eventType,n=e.handler,r=e.options;t.removeEventListener(i,n,r)})),O=[]}function ke(e){var t,i=!1;if(z.state.isEnabled&&!Ae(e)&&!B){var n="focus"===(null==(t=o)?void 0:t.type);o=e,m=e.currentTarget,de(),!z.state.isVisible&&k(e)&&ne.forEach((function(t){return t(e)})),"click"===e.type&&(z.props.trigger.indexOf("mouseenter")<0||S)&&!1!==z.props.hideOnClick&&z.state.isVisible?i=!0:Ce(e),"click"===e.type&&(S=!i),i&&!n&&Be(e)}}function Ee(e){var t=e.target,i=se().contains(t)||K.contains(t);if("mousemove"!==e.type||!i){var n=Te().concat(K).map((function(e){var t,i=null==(t=e._tippy.popperInstance)?void 0:t.state;return i?{popperRect:e.getBoundingClientRect(),popperState:i,props:E}:null})).filter(Boolean);(function(e,t){var i=t.clientX,n=t.clientY;return e.every((function(e){var t=e.popperRect,r=e.popperState,s=e.props.interactiveBorder,a=g(r.placement),o=r.modifiersData.offset;if(!o)return!0;var c="bottom"===a?o.top.y:0,l="top"===a?o.bottom.y:0,u="right"===a?o.left.x:0,p="left"===a?o.right.x:0,d=t.top-n+c>s,f=n-t.bottom-l>s,h=t.left-i+u>s,m=i-t.right-p>s;return d||f||h||m}))})(n,e)&&(fe(),Be(e))}}function Se(e){Ae(e)||z.props.trigger.indexOf("click")>=0&&S||(z.props.interactive?z.hideWithInteractivity(e):Be(e))}function Me(e){z.props.trigger.indexOf("focusin")<0&&e.target!==se()||z.props.interactive&&e.relatedTarget&&K.contains(e.relatedTarget)||Be(e)}function Ae(e){return!!C.isTouch&&Q()!==e.type.indexOf("touch")>=0}function je(){Ie();var t=z.props,i=t.popperOptions,r=t.placement,s=t.offset,a=t.getReferenceClientRect,o=t.moveTransition,c=te()?ee(K).arrow:null,l=a?{getBoundingClientRect:a,contextElement:a.contextElement||se()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(te()){var i=oe().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?i.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?i.setAttribute("data-"+e,""):i.removeAttribute("data-"+e)})),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!o}},u];te()&&c&&p.push({name:"arrow",options:{element:c,padding:3}}),p.push.apply(p,(null==i?void 0:i.modifiers)||[]),z.popperInstance=n.createPopper(l,K,Object.assign({},i,{placement:r,onFirstUpdate:d,modifiers:p}))}function Ie(){z.popperInstance&&(z.popperInstance.destroy(),z.popperInstance=null)}function Te(){return y(K.querySelectorAll("[data-tippy-root]"))}function Ce(e){z.clearDelayTimeouts(),e&&ue("onTrigger",[z,e]),ve();var t=ce(!0),i=J(),n=i[0],s=i[1];C.isTouch&&"hold"===n&&s&&(t=s),t?r=setTimeout((function(){z.show()}),t):z.show()}function Be(e){if(z.clearDelayTimeouts(),ue("onUntrigger",[z,e]),z.state.isVisible){if(!(z.props.trigger.indexOf("mouseenter")>=0&&z.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&S)){var t=ce(!1);t?s=setTimeout((function(){z.state.isVisible&&z.hide()}),t):a=requestAnimationFrame((function(){z.hide()}))}}else ge()}}function ae(e,i){void 0===i&&(i={});var n=V.plugins.concat(i.plugins||[]);"production"!==t.env.NODE_ENV&&(!function(e){var t=!e,i="[object Object]"===Object.prototype.toString.call(e)&&!e.addEventListener;F(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),F(i,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}(e),X(i,n)),document.addEventListener("touchstart",R,l),window.addEventListener("blur",O);var r=Object.assign({},i,{plugins:n}),s=S(e);if("production"!==t.env.NODE_ENV){var a=w(r.content),o=s.length>1;H(a&&o,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "))}var c=s.reduce((function(e,t){var i=t&&se(t,r);return i&&e.push(i),e}),[]);return w(e)?c[0]:c}ae.defaultProps=V,ae.setDefaultProps=function(e){"production"!==t.env.NODE_ENV&&X(e,[]),Object.keys(e).forEach((function(t){V[t]=e[t]}))},ae.currentInput=C;var oe=Object.assign({},n.applyStyles,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),ce={mouseover:"mouseenter",focusin:"focus",click:"click"};var le={name:"animateFill",defaultValue:!1,fn:function(e){var i;if(null==(i=e.props.render)||!i.$$tippy)return"production"!==t.env.NODE_ENV&&F(e.props.animateFill,"The `animateFill` plugin requires the default render function."),{};var n=ee(e.popper),r=n.box,s=n.content,o=e.props.animateFill?function(){var e=_();return e.className=a,A([e],"hidden"),e}():null;return{onCreate:function(){o&&(r.insertBefore(o,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",e.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(o){var e=r.style.transitionDuration,t=Number(e.replace("ms",""));s.style.transitionDelay=Math.round(t/10)+"ms",o.style.transitionDuration=e,A([o],"visible")}},onShow:function(){o&&(o.style.transitionDuration="0ms")},onHide:function(){o&&A([o],"hidden")}}}};var ue={clientX:0,clientY:0},pe=[];function de(e){var t=e.clientX,i=e.clientY;ue={clientX:t,clientY:i}}var fe={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,i=j(e.props.triggerTarget||t),n=!1,r=!1,s=!0,a=e.props;function o(){return"initial"===e.props.followCursor&&e.state.isVisible}function c(){i.addEventListener("mousemove",p)}function l(){i.removeEventListener("mousemove",p)}function u(){n=!0,e.setProps({getReferenceClientRect:null}),n=!1}function p(i){var n=!i.target||t.contains(i.target),r=e.props.followCursor,s=i.clientX,a=i.clientY,o=t.getBoundingClientRect(),c=s-o.left,l=a-o.top;!n&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),i=s,n=a;"initial"===r&&(i=e.left+c,n=e.top+l);var o="horizontal"===r?e.top:n,u="vertical"===r?e.right:i,p="horizontal"===r?e.bottom:n,d="vertical"===r?e.left:i;return{width:u-d,height:p-o,top:o,right:u,bottom:p,left:d}}})}function d(){e.props.followCursor&&(pe.push({instance:e,doc:i}),function(e){e.addEventListener("mousemove",de)}(i))}function f(){0===(pe=pe.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===i})).length&&function(e){e.removeEventListener("mousemove",de)}(i)}return{onCreate:d,onDestroy:f,onBeforeUpdate:function(){a=e.props},onAfterUpdate:function(t,i){var s=i.followCursor;n||void 0!==s&&a.followCursor!==s&&(f(),s?(d(),!e.state.isMounted||r||o()||c()):(l(),u()))},onMount:function(){e.props.followCursor&&!r&&(s&&(p(ue),s=!1),o()||c())},onTrigger:function(e,t){k(t)&&(ue={clientX:t.clientX,clientY:t.clientY}),r="focus"===t.type},onHidden:function(){e.props.followCursor&&(u(),l(),s=!0)}}}};var he={name:"inlinePositioning",defaultValue:!1,fn:function(e){var t,i=e.reference;var n=-1,r=!1,s=[],a={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(r){var a=r.state;e.props.inlinePositioning&&(-1!==s.indexOf(a.placement)&&(s=[]),t!==a.placement&&-1===s.indexOf(a.placement)&&(s.push(a.placement),e.setProps({getReferenceClientRect:function(){return function(e){return function(e,t,i,n){if(i.length<2||null===e)return t;if(2===i.length&&n>=0&&i[0].left>i[1].right)return i[n]||t;switch(e){case"top":case"bottom":var r=i[0],s=i[i.length-1],a="top"===e,o=r.top,c=s.bottom,l=a?r.left:s.left,u=a?r.right:s.right;return{top:o,bottom:c,left:l,right:u,width:u-l,height:c-o};case"left":case"right":var p=Math.min.apply(Math,i.map((function(e){return e.left}))),d=Math.max.apply(Math,i.map((function(e){return e.right}))),f=i.filter((function(t){return"left"===e?t.left===p:t.right===d})),h=f[0].top,m=f[f.length-1].bottom;return{top:h,bottom:m,left:p,right:d,width:d-p,height:m-h};default:return t}}(g(e),i.getBoundingClientRect(),y(i.getClientRects()),n)}(a.placement)}})),t=a.placement)}};function o(){var t;r||(t=function(e,t){var i;return{popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat(((null==(i=e.popperOptions)?void 0:i.modifiers)||[]).filter((function(e){return e.name!==t.name})),[t])})}}(e.props,a),r=!0,e.setProps(t),r=!1)}return{onCreate:o,onAfterUpdate:o,onTrigger:function(t,i){if(k(i)){var r=y(e.reference.getClientRects()),s=r.find((function(e){return e.left-2<=i.clientX&&e.right+2>=i.clientX&&e.top-2<=i.clientY&&e.bottom+2>=i.clientY})),a=r.indexOf(s);n=a>-1?a:n}},onHidden:function(){n=-1}}}};var me={name:"sticky",defaultValue:!1,fn:function(e){var t=e.reference,i=e.popper;function n(t){return!0===e.props.sticky||e.props.sticky===t}var r=null,s=null;function a(){var o=n("reference")?(e.popperInstance?e.popperInstance.state.elements.reference:t).getBoundingClientRect():null,c=n("popper")?i.getBoundingClientRect():null;(o&&be(r,o)||c&&be(s,c))&&e.popperInstance&&e.popperInstance.update(),r=o,s=c,e.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){e.props.sticky&&a()}}}};function be(e,t){return!e||!t||(e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left)}ae.setDefaultProps({render:te}),i.animateFill=le,i.createSingleton=function(e,i){var n;void 0===i&&(i={}),"production"!==t.env.NODE_ENV&&F(!Array.isArray(e),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(e)].join(" "));var r,s=e,a=[],o=[],c=i.overrides,l=[],u=!1;function p(){o=s.map((function(e){return b(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function d(){a=s.map((function(e){return e.reference}))}function f(e){s.forEach((function(t){e?t.enable():t.disable()}))}function h(e){return s.map((function(t){var i=t.setProps;return t.setProps=function(n){i(n),t.reference===r&&e.setProps(n)},function(){t.setProps=i}}))}function v(e,t){var i=o.indexOf(t);if(t!==r){r=t;var n=(c||[]).concat("content").reduce((function(e,t){return e[t]=s[i].props[t],e}),{});e.setProps(Object.assign({},n,{getReferenceClientRect:"function"==typeof n.getReferenceClientRect?n.getReferenceClientRect:function(){var e;return null==(e=a[i])?void 0:e.getBoundingClientRect()}}))}}f(!1),d(),p();var g={fn:function(){return{onDestroy:function(){f(!0)},onHidden:function(){r=null},onClickOutside:function(e){e.props.showOnCreate&&!u&&(u=!0,r=null)},onShow:function(e){e.props.showOnCreate&&!u&&(u=!0,v(e,a[0]))},onTrigger:function(e,t){v(e,t.currentTarget)}}}},y=ae(_(),Object.assign({},m(i,["overrides"]),{plugins:[g].concat(i.plugins||[]),triggerTarget:o,popperOptions:Object.assign({},i.popperOptions,{modifiers:[].concat((null==(n=i.popperOptions)?void 0:n.modifiers)||[],[oe])})})),x=y.show;y.show=function(e){if(x(),!r&&null==e)return v(y,a[0]);if(!r||null!=e){if("number"==typeof e)return a[e]&&v(y,a[e]);if(s.indexOf(e)>=0){var t=e.reference;return v(y,t)}return a.indexOf(e)>=0?v(y,e):void 0}},y.showNext=function(){var e=a[0];if(!r)return y.show(0);var t=a.indexOf(r);y.show(a[t+1]||e)},y.showPrevious=function(){var e=a[a.length-1];if(!r)return y.show(e);var t=a.indexOf(r),i=a[t-1]||e;y.show(i)};var w=y.setProps;return y.setProps=function(e){c=e.overrides||c,w(e)},y.setInstances=function(e){f(!0),l.forEach((function(e){return e()})),s=e,f(!1),d(),p(),l=h(y),y.setProps({triggerTarget:o})},l=h(y),y},i.default=ae,i.delegate=function(e,i){"production"!==t.env.NODE_ENV&&F(!(i&&i.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a tippy."].join(" "));var n=[],r=[],s=!1,a=i.target,o=m(i,["target"]),c=Object.assign({},o,{trigger:"manual",touch:!1}),u=Object.assign({touch:V.touch},o,{showOnCreate:!0}),p=ae(e,c);function d(e){if(e.target&&!s){var t=e.target.closest(a);if(t){var n=t.getAttribute("data-tippy-trigger")||i.trigger||V.trigger;if(!t._tippy&&!("touchstart"===e.type&&"boolean"==typeof u.touch||"touchstart"!==e.type&&n.indexOf(ce[e.type])<0)){var o=ae(t,u);o&&(r=r.concat(o))}}}}function f(e,t,i,r){void 0===r&&(r=!1),e.addEventListener(t,i,r),n.push({node:e,eventType:t,handler:i,options:r})}return b(p).forEach((function(e){var t=e.destroy,i=e.enable,a=e.disable;e.destroy=function(e){void 0===e&&(e=!0),e&&r.forEach((function(e){e.destroy()})),r=[],n.forEach((function(e){var t=e.node,i=e.eventType,n=e.handler,r=e.options;t.removeEventListener(i,n,r)})),n=[],t()},e.enable=function(){i(),r.forEach((function(e){return e.enable()})),s=!1},e.disable=function(){a(),r.forEach((function(e){return e.disable()})),s=!0},function(e){var t=e.reference;f(t,"touchstart",d,l),f(t,"mouseover",d),f(t,"focusin",d),f(t,"click",d)}(e)})),p},i.followCursor=fe,i.hideAll=function(e){var t=void 0===e?{}:e,i=t.exclude,n=t.duration;re.forEach((function(e){var t=!1;if(i&&(t=E(i)?e.reference===i:e.popper===i.popper),!t){var r=e.props.duration;e.setProps({duration:n}),e.hide(),e.state.isDestroyed||e.setProps({duration:r})}}))},i.inlinePositioning=he,i.roundArrow='',i.sticky=me}).call(this)}).call(this,e("_process"))},{"@popperjs/core":1,_process:296}],432:[function(e,t,i){var n=e("buffer").Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(n.isBuffer(e)){for(var t=new Uint8Array(e.length),i=e.length,r=0;r-1}function d(e,t){return"function"==typeof e?e.apply(void 0,t):e}function f(e,t){return 0===t?e:function(n){clearTimeout(i),i=setTimeout((function(){e(n)}),t)};var i}function h(e,t){var i=Object.assign({},e);return t.forEach((function(e){delete i[e]})),i}function m(e){return[].concat(e)}function b(e,t){-1===e.indexOf(t)&&e.push(t)}function v(e){return e.split("-")[0]}function g(e){return[].slice.call(e)}function y(e){return Object.keys(e).reduce((function(t,i){return void 0!==e[i]&&(t[i]=e[i]),t}),{})}function x(){return document.createElement("div")}function _(e){return["Element","Fragment"].some((function(t){return p(e,t)}))}function w(e){return p(e,"MouseEvent")}function k(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function E(e){return _(e)?[e]:function(e){return p(e,"NodeList")}(e)?g(e):Array.isArray(e)?e:g(document.querySelectorAll(e))}function S(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function M(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function A(e){var t,i=m(e)[0];return null!=i&&null!=(t=i.ownerDocument)&&t.body?i.ownerDocument:document}function j(e,t,i){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[n](t,i)}))}function I(e,t){for(var i=t;i;){var n;if(e.contains(i))return!0;i=null==i.getRootNode||null==(n=i.getRootNode())?void 0:n.host}return!1}var T={isTouch:!1},C=0;function B(){T.isTouch||(T.isTouch=!0,window.performance&&document.addEventListener("mousemove",R))}function R(){var e=performance.now();e-C<20&&(T.isTouch=!1,document.removeEventListener("mousemove",R)),C=e}function L(){var e=document.activeElement;if(k(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var O,P=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;function U(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function q(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function N(e){return q("\n %ctippy.js\n\n %c"+q(e)+"\n\n %c👷‍ This is a development-only message. It will be removed in production.\n ")}function D(e){return[N(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function z(e,t){var i;e&&!O.has(t)&&(O.add(t),(i=console).warn.apply(i,D(t)))}function H(e,t){var i;e&&!O.has(t)&&(O.add(t),(i=console).error.apply(i,D(t)))}"production"!==t.env.NODE_ENV&&(O=new Set);var F={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},W=Object.assign({appendTo:l,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},F,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),V=Object.keys(W);function K(e){var t=(e.plugins||[]).reduce((function(t,i){var n,r=i.name,s=i.defaultValue;r&&(t[r]=void 0!==e[r]?e[r]:null!=(n=W[r])?n:s);return t}),{});return Object.assign({},e,t)}function $(e,t){var i=Object.assign({},t,{content:d(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(K(Object.assign({},W,{plugins:t}))):V).reduce((function(t,i){var n=(e.getAttribute("data-tippy-"+i)||"").trim();if(!n)return t;if("content"===i)t[i]=n;else try{t[i]=JSON.parse(n)}catch(e){t[i]=n}return t}),{})}(e,t.plugins));return i.aria=Object.assign({},W.aria,i.aria),i.aria={expanded:"auto"===i.aria.expanded?t.interactive:i.aria.expanded,content:"auto"===i.aria.content?t.interactive?null:"describedby":i.aria.content},i}function G(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach((function(e){var i,n,r=h(W,Object.keys(F)),s=(i=r,n=e,!{}.hasOwnProperty.call(i,n));s&&(s=0===t.filter((function(t){return t.name===e})).length),z(s,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))}))}var X=function(){return"innerHTML"};function Y(e,t){e[X()]=t}function Z(e){var t=x();return!0===e?t.className=a:(t.className=o,_(e)?t.appendChild(e):Y(t,e)),t}function J(e,t){_(t.content)?(Y(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?Y(e,t.content):e.textContent=t.content)}function Q(e){var t=e.firstElementChild,i=g(t.children);return{box:t,content:i.find((function(e){return e.classList.contains(r)})),arrow:i.find((function(e){return e.classList.contains(a)||e.classList.contains(o)})),backdrop:i.find((function(e){return e.classList.contains(s)}))}}function ee(e){var t=x(),i=x();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=x();function s(i,n){var r=Q(t),s=r.box,a=r.content,o=r.arrow;n.theme?s.setAttribute("data-theme",n.theme):s.removeAttribute("data-theme"),"string"==typeof n.animation?s.setAttribute("data-animation",n.animation):s.removeAttribute("data-animation"),n.inertia?s.setAttribute("data-inertia",""):s.removeAttribute("data-inertia"),s.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?s.setAttribute("role",n.role):s.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||J(a,e.props),n.arrow?o?i.arrow!==n.arrow&&(s.removeChild(o),s.appendChild(Z(n.arrow))):s.appendChild(Z(n.arrow)):o&&s.removeChild(o)}return n.className=r,n.setAttribute("data-state","hidden"),J(n,e.props),t.appendChild(i),i.appendChild(n),s(e.props,e.props),{popper:t,onUpdate:s}}ee.$$tippy=!0;var te=1,ie=[],ne=[];function re(e,i){var r,s,a,o,p,h,_,k,E=$(e,Object.assign({},W,K(y(i)))),C=!1,B=!1,R=!1,L=!1,O=[],q=f(Ee,E.interactiveDebounce),N=te++,D=(k=E.plugins).filter((function(e,t){return k.indexOf(e)===t})),F={id:N,reference:e,popper:x(),popperInstance:null,props:E,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:D,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(s),cancelAnimationFrame(a)},setProps:function(i){"production"!==t.env.NODE_ENV&&z(F.state.isDestroyed,U("setProps"));if(F.state.isDestroyed)return;ue("onBeforeUpdate",[F,i]),we();var n=F.props,r=$(e,Object.assign({},n,y(i),{ignoreAttributes:!0}));F.props=r,_e(),n.interactiveDebounce!==r.interactiveDebounce&&(fe(),q=f(Ee,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?m(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");de(),le(),X&&X(n,r);F.popperInstance&&(je(),Te().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));ue("onAfterUpdate",[F,i])},setContent:function(e){F.setProps({content:e})},show:function(){"production"!==t.env.NODE_ENV&&z(F.state.isDestroyed,U("show"));var e=F.state.isVisible,i=F.state.isDestroyed,n=!F.state.isEnabled,r=T.isTouch&&!F.props.touch,s=u(F.props.duration,0,W.duration);if(e||i||n||r)return;if(se().hasAttribute("disabled"))return;if(ue("onShow",[F],!1),!1===F.props.onShow(F))return;F.state.isVisible=!0,re()&&(G.style.visibility="visible");le(),ve(),F.state.isMounted||(G.style.transition="none");if(re()){var a=oe();S([a.box,a.content],0)}h=function(){var e;if(F.state.isVisible&&!L){if(L=!0,G.offsetHeight,G.style.transition=F.props.moveTransition,re()&&F.props.animation){var t=oe(),i=t.box,n=t.content;S([i,n],s),M([i,n],"visible")}pe(),de(),b(ne,F),null==(e=F.popperInstance)||e.forceUpdate(),ue("onMount",[F]),F.props.animation&&re()&&function(e,t){ye(e,t)}(s,(function(){F.state.isShown=!0,ue("onShown",[F])}))}},function(){var e,i=F.props.appendTo,n=se();e=F.props.interactive&&i===l||"parent"===i?n.parentNode:d(i,[n]);e.contains(G)||e.appendChild(G);F.state.isMounted=!0,je(),"production"!==t.env.NODE_ENV&&z(F.props.interactive&&i===W.appendTo&&n.nextElementSibling!==G,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper
or tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}()},hide:function(){"production"!==t.env.NODE_ENV&&z(F.state.isDestroyed,U("hide"));var e=!F.state.isVisible,i=F.state.isDestroyed,n=!F.state.isEnabled,r=u(F.props.duration,1,W.duration);if(e||i||n)return;if(ue("onHide",[F],!1),!1===F.props.onHide(F))return;F.state.isVisible=!1,F.state.isShown=!1,L=!1,C=!1,re()&&(G.style.visibility="hidden");if(fe(),ge(),le(!0),re()){var s=oe(),a=s.box,o=s.content;F.props.animation&&(S([a,o],r),M([a,o],"hidden"))}pe(),de(),F.props.animation?re()&&function(e,t){ye(e,(function(){!F.state.isVisible&&G.parentNode&&G.parentNode.contains(G)&&t()}))}(r,F.unmount):F.unmount()},hideWithInteractivity:function(e){"production"!==t.env.NODE_ENV&&z(F.state.isDestroyed,U("hideWithInteractivity"));ae().addEventListener("mousemove",q),b(ie,q),q(e)},enable:function(){F.state.isEnabled=!0},disable:function(){F.hide(),F.state.isEnabled=!1},unmount:function(){"production"!==t.env.NODE_ENV&&z(F.state.isDestroyed,U("unmount"));F.state.isVisible&&F.hide();if(!F.state.isMounted)return;Ie(),Te().forEach((function(e){e._tippy.unmount()})),G.parentNode&&G.parentNode.removeChild(G);ne=ne.filter((function(e){return e!==F})),F.state.isMounted=!1,ue("onHidden",[F])},destroy:function(){"production"!==t.env.NODE_ENV&&z(F.state.isDestroyed,U("destroy"));if(F.state.isDestroyed)return;F.clearDelayTimeouts(),F.unmount(),we(),delete e._tippy,F.state.isDestroyed=!0,ue("onDestroy",[F])}};if(!E.render)return"production"!==t.env.NODE_ENV&&H(!0,"render() function has not been supplied."),F;var V=E.render(F),G=V.popper,X=V.onUpdate;G.setAttribute("data-tippy-root",""),G.id="tippy-"+F.id,F.popper=G,e._tippy=F,G._tippy=F;var Y=D.map((function(e){return e.fn(F)})),Z=e.hasAttribute("aria-expanded");return _e(),de(),le(),ue("onCreate",[F]),E.showOnCreate&&Ce(),G.addEventListener("mouseenter",(function(){F.props.interactive&&F.state.isVisible&&F.clearDelayTimeouts()})),G.addEventListener("mouseleave",(function(){F.props.interactive&&F.props.trigger.indexOf("mouseenter")>=0&&ae().addEventListener("mousemove",q)})),F;function J(){var e=F.props.touch;return Array.isArray(e)?e:[e,0]}function ee(){return"hold"===J()[0]}function re(){var e;return!(null==(e=F.props.render)||!e.$$tippy)}function se(){return _||e}function ae(){var e=se().parentNode;return e?A(e):document}function oe(){return Q(G)}function ce(e){return F.state.isMounted&&!F.state.isVisible||T.isTouch||o&&"focus"===o.type?0:u(F.props.delay,e?0:1,W.delay)}function le(e){void 0===e&&(e=!1),G.style.pointerEvents=F.props.interactive&&!e?"":"none",G.style.zIndex=""+F.props.zIndex}function ue(e,t,i){var n;(void 0===i&&(i=!0),Y.forEach((function(i){i[e]&&i[e].apply(i,t)})),i)&&(n=F.props)[e].apply(n,t)}function pe(){var t=F.props.aria;if(t.content){var i="aria-"+t.content,n=G.id;m(F.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(i);if(F.state.isVisible)e.setAttribute(i,t?t+" "+n:n);else{var r=t&&t.replace(n,"").trim();r?e.setAttribute(i,r):e.removeAttribute(i)}}))}}function de(){!Z&&F.props.aria.expanded&&m(F.props.triggerTarget||e).forEach((function(e){F.props.interactive?e.setAttribute("aria-expanded",F.state.isVisible&&e===se()?"true":"false"):e.removeAttribute("aria-expanded")}))}function fe(){ae().removeEventListener("mousemove",q),ie=ie.filter((function(e){return e!==q}))}function he(t){if(!T.isTouch||!R&&"mousedown"!==t.type){var i=t.composedPath&&t.composedPath()[0]||t.target;if(!F.props.interactive||!I(G,i)){if(m(F.props.triggerTarget||e).some((function(e){return I(e,i)}))){if(T.isTouch)return;if(F.state.isVisible&&F.props.trigger.indexOf("click")>=0)return}else ue("onClickOutside",[F,t]);!0===F.props.hideOnClick&&(F.clearDelayTimeouts(),F.hide(),B=!0,setTimeout((function(){B=!1})),F.state.isMounted||ge())}}}function me(){R=!0}function be(){R=!1}function ve(){var e=ae();e.addEventListener("mousedown",he,!0),e.addEventListener("touchend",he,c),e.addEventListener("touchstart",be,c),e.addEventListener("touchmove",me,c)}function ge(){var e=ae();e.removeEventListener("mousedown",he,!0),e.removeEventListener("touchend",he,c),e.removeEventListener("touchstart",be,c),e.removeEventListener("touchmove",me,c)}function ye(e,t){var i=oe().box;function n(e){e.target===i&&(j(i,"remove",n),t())}if(0===e)return t();j(i,"remove",p),j(i,"add",n),p=n}function xe(t,i,n){void 0===n&&(n=!1),m(F.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,i,n),O.push({node:e,eventType:t,handler:i,options:n})}))}function _e(){var e;ee()&&(xe("touchstart",ke,{passive:!0}),xe("touchend",Se,{passive:!0})),(e=F.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(xe(e,ke),e){case"mouseenter":xe("mouseleave",Se);break;case"focus":xe(P?"focusout":"blur",Me);break;case"focusin":xe("focusout",Me)}}))}function we(){O.forEach((function(e){var t=e.node,i=e.eventType,n=e.handler,r=e.options;t.removeEventListener(i,n,r)})),O=[]}function ke(e){var t,i=!1;if(F.state.isEnabled&&!Ae(e)&&!B){var n="focus"===(null==(t=o)?void 0:t.type);o=e,_=e.currentTarget,de(),!F.state.isVisible&&w(e)&&ie.forEach((function(t){return t(e)})),"click"===e.type&&(F.props.trigger.indexOf("mouseenter")<0||C)&&!1!==F.props.hideOnClick&&F.state.isVisible?i=!0:Ce(e),"click"===e.type&&(C=!i),i&&!n&&Be(e)}}function Ee(e){var t=e.target,i=se().contains(t)||G.contains(t);if("mousemove"!==e.type||!i){var n=Te().concat(G).map((function(e){var t,i=null==(t=e._tippy.popperInstance)?void 0:t.state;return i?{popperRect:e.getBoundingClientRect(),popperState:i,props:E}:null})).filter(Boolean);(function(e,t){var i=t.clientX,n=t.clientY;return e.every((function(e){var t=e.popperRect,r=e.popperState,s=e.props.interactiveBorder,a=v(r.placement),o=r.modifiersData.offset;if(!o)return!0;var c="bottom"===a?o.top.y:0,l="top"===a?o.bottom.y:0,u="right"===a?o.left.x:0,p="left"===a?o.right.x:0,d=t.top-n+c>s,f=n-t.bottom-l>s,h=t.left-i+u>s,m=i-t.right-p>s;return d||f||h||m}))})(n,e)&&(fe(),Be(e))}}function Se(e){Ae(e)||F.props.trigger.indexOf("click")>=0&&C||(F.props.interactive?F.hideWithInteractivity(e):Be(e))}function Me(e){F.props.trigger.indexOf("focusin")<0&&e.target!==se()||F.props.interactive&&e.relatedTarget&&G.contains(e.relatedTarget)||Be(e)}function Ae(e){return!!T.isTouch&&ee()!==e.type.indexOf("touch")>=0}function je(){Ie();var t=F.props,i=t.popperOptions,r=t.placement,s=t.offset,a=t.getReferenceClientRect,o=t.moveTransition,c=re()?Q(G).arrow:null,l=a?{getBoundingClientRect:a,contextElement:a.contextElement||se()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(re()){var i=oe().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?i.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?i.setAttribute("data-"+e,""):i.removeAttribute("data-"+e)})),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!o}},u];re()&&c&&p.push({name:"arrow",options:{element:c,padding:3}}),p.push.apply(p,(null==i?void 0:i.modifiers)||[]),F.popperInstance=n.createPopper(l,G,Object.assign({},i,{placement:r,onFirstUpdate:h,modifiers:p}))}function Ie(){F.popperInstance&&(F.popperInstance.destroy(),F.popperInstance=null)}function Te(){return g(G.querySelectorAll("[data-tippy-root]"))}function Ce(e){F.clearDelayTimeouts(),e&&ue("onTrigger",[F,e]),ve();var t=ce(!0),i=J(),n=i[0],s=i[1];T.isTouch&&"hold"===n&&s&&(t=s),t?r=setTimeout((function(){F.show()}),t):F.show()}function Be(e){if(F.clearDelayTimeouts(),ue("onUntrigger",[F,e]),F.state.isVisible){if(!(F.props.trigger.indexOf("mouseenter")>=0&&F.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&C)){var t=ce(!1);t?s=setTimeout((function(){F.state.isVisible&&F.hide()}),t):a=requestAnimationFrame((function(){F.hide()}))}}else ge()}}function se(e,i){void 0===i&&(i={});var n=W.plugins.concat(i.plugins||[]);"production"!==t.env.NODE_ENV&&(!function(e){var t=!e,i="[object Object]"===Object.prototype.toString.call(e)&&!e.addEventListener;H(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),H(i,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}(e),G(i,n)),document.addEventListener("touchstart",B,c),window.addEventListener("blur",L);var r=Object.assign({},i,{plugins:n}),s=E(e);if("production"!==t.env.NODE_ENV){var a=_(r.content),o=s.length>1;z(a&&o,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "))}var l=s.reduce((function(e,t){var i=t&&re(t,r);return i&&e.push(i),e}),[]);return _(e)?l[0]:l}se.defaultProps=W,se.setDefaultProps=function(e){"production"!==t.env.NODE_ENV&&G(e,[]),Object.keys(e).forEach((function(t){W[t]=e[t]}))},se.currentInput=T;var ae=Object.assign({},n.applyStyles,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),oe={mouseover:"mouseenter",focusin:"focus",click:"click"};var ce={name:"animateFill",defaultValue:!1,fn:function(e){var i;if(null==(i=e.props.render)||!i.$$tippy)return"production"!==t.env.NODE_ENV&&H(e.props.animateFill,"The `animateFill` plugin requires the default render function."),{};var n=Q(e.popper),r=n.box,a=n.content,o=e.props.animateFill?function(){var e=x();return e.className=s,M([e],"hidden"),e}():null;return{onCreate:function(){o&&(r.insertBefore(o,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",e.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(o){var e=r.style.transitionDuration,t=Number(e.replace("ms",""));a.style.transitionDelay=Math.round(t/10)+"ms",o.style.transitionDuration=e,M([o],"visible")}},onShow:function(){o&&(o.style.transitionDuration="0ms")},onHide:function(){o&&M([o],"hidden")}}}};var le={clientX:0,clientY:0},ue=[];function pe(e){var t=e.clientX,i=e.clientY;le={clientX:t,clientY:i}}var de={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,i=A(e.props.triggerTarget||t),n=!1,r=!1,s=!0,a=e.props;function o(){return"initial"===e.props.followCursor&&e.state.isVisible}function c(){i.addEventListener("mousemove",p)}function l(){i.removeEventListener("mousemove",p)}function u(){n=!0,e.setProps({getReferenceClientRect:null}),n=!1}function p(i){var n=!i.target||t.contains(i.target),r=e.props.followCursor,s=i.clientX,a=i.clientY,o=t.getBoundingClientRect(),c=s-o.left,l=a-o.top;!n&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),i=s,n=a;"initial"===r&&(i=e.left+c,n=e.top+l);var o="horizontal"===r?e.top:n,u="vertical"===r?e.right:i,p="horizontal"===r?e.bottom:n,d="vertical"===r?e.left:i;return{width:u-d,height:p-o,top:o,right:u,bottom:p,left:d}}})}function d(){e.props.followCursor&&(ue.push({instance:e,doc:i}),function(e){e.addEventListener("mousemove",pe)}(i))}function f(){0===(ue=ue.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===i})).length&&function(e){e.removeEventListener("mousemove",pe)}(i)}return{onCreate:d,onDestroy:f,onBeforeUpdate:function(){a=e.props},onAfterUpdate:function(t,i){var s=i.followCursor;n||void 0!==s&&a.followCursor!==s&&(f(),s?(d(),!e.state.isMounted||r||o()||c()):(l(),u()))},onMount:function(){e.props.followCursor&&!r&&(s&&(p(le),s=!1),o()||c())},onTrigger:function(e,t){w(t)&&(le={clientX:t.clientX,clientY:t.clientY}),r="focus"===t.type},onHidden:function(){e.props.followCursor&&(u(),l(),s=!0)}}}};var fe={name:"inlinePositioning",defaultValue:!1,fn:function(e){var t,i=e.reference;var n=-1,r=!1,s=[],a={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(r){var a=r.state;e.props.inlinePositioning&&(-1!==s.indexOf(a.placement)&&(s=[]),t!==a.placement&&-1===s.indexOf(a.placement)&&(s.push(a.placement),e.setProps({getReferenceClientRect:function(){return function(e){return function(e,t,i,n){if(i.length<2||null===e)return t;if(2===i.length&&n>=0&&i[0].left>i[1].right)return i[n]||t;switch(e){case"top":case"bottom":var r=i[0],s=i[i.length-1],a="top"===e,o=r.top,c=s.bottom,l=a?r.left:s.left,u=a?r.right:s.right;return{top:o,bottom:c,left:l,right:u,width:u-l,height:c-o};case"left":case"right":var p=Math.min.apply(Math,i.map((function(e){return e.left}))),d=Math.max.apply(Math,i.map((function(e){return e.right}))),f=i.filter((function(t){return"left"===e?t.left===p:t.right===d})),h=f[0].top,m=f[f.length-1].bottom;return{top:h,bottom:m,left:p,right:d,width:d-p,height:m-h};default:return t}}(v(e),i.getBoundingClientRect(),g(i.getClientRects()),n)}(a.placement)}})),t=a.placement)}};function o(){var t;r||(t=function(e,t){var i;return{popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat(((null==(i=e.popperOptions)?void 0:i.modifiers)||[]).filter((function(e){return e.name!==t.name})),[t])})}}(e.props,a),r=!0,e.setProps(t),r=!1)}return{onCreate:o,onAfterUpdate:o,onTrigger:function(t,i){if(w(i)){var r=g(e.reference.getClientRects()),s=r.find((function(e){return e.left-2<=i.clientX&&e.right+2>=i.clientX&&e.top-2<=i.clientY&&e.bottom+2>=i.clientY})),a=r.indexOf(s);n=a>-1?a:n}},onHidden:function(){n=-1}}}};var he={name:"sticky",defaultValue:!1,fn:function(e){var t=e.reference,i=e.popper;function n(t){return!0===e.props.sticky||e.props.sticky===t}var r=null,s=null;function a(){var o=n("reference")?(e.popperInstance?e.popperInstance.state.elements.reference:t).getBoundingClientRect():null,c=n("popper")?i.getBoundingClientRect():null;(o&&me(r,o)||c&&me(s,c))&&e.popperInstance&&e.popperInstance.update(),r=o,s=c,e.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){e.props.sticky&&a()}}}};function me(e,t){return!e||!t||(e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left)}se.setDefaultProps({render:ee}),i.animateFill=ce,i.createSingleton=function(e,i){var n;void 0===i&&(i={}),"production"!==t.env.NODE_ENV&&H(!Array.isArray(e),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(e)].join(" "));var r,s=e,a=[],o=[],c=i.overrides,l=[],u=!1;function p(){o=s.map((function(e){return m(e.props.triggerTarget||e.reference)})).reduce((function(e,t){return e.concat(t)}),[])}function d(){a=s.map((function(e){return e.reference}))}function f(e){s.forEach((function(t){e?t.enable():t.disable()}))}function b(e){return s.map((function(t){var i=t.setProps;return t.setProps=function(n){i(n),t.reference===r&&e.setProps(n)},function(){t.setProps=i}}))}function v(e,t){var i=o.indexOf(t);if(t!==r){r=t;var n=(c||[]).concat("content").reduce((function(e,t){return e[t]=s[i].props[t],e}),{});e.setProps(Object.assign({},n,{getReferenceClientRect:"function"==typeof n.getReferenceClientRect?n.getReferenceClientRect:function(){var e;return null==(e=a[i])?void 0:e.getBoundingClientRect()}}))}}f(!1),d(),p();var g={fn:function(){return{onDestroy:function(){f(!0)},onHidden:function(){r=null},onClickOutside:function(e){e.props.showOnCreate&&!u&&(u=!0,r=null)},onShow:function(e){e.props.showOnCreate&&!u&&(u=!0,v(e,a[0]))},onTrigger:function(e,t){v(e,t.currentTarget)}}}},y=se(x(),Object.assign({},h(i,["overrides"]),{plugins:[g].concat(i.plugins||[]),triggerTarget:o,popperOptions:Object.assign({},i.popperOptions,{modifiers:[].concat((null==(n=i.popperOptions)?void 0:n.modifiers)||[],[ae])})})),_=y.show;y.show=function(e){if(_(),!r&&null==e)return v(y,a[0]);if(!r||null!=e){if("number"==typeof e)return a[e]&&v(y,a[e]);if(s.indexOf(e)>=0){var t=e.reference;return v(y,t)}return a.indexOf(e)>=0?v(y,e):void 0}},y.showNext=function(){var e=a[0];if(!r)return y.show(0);var t=a.indexOf(r);y.show(a[t+1]||e)},y.showPrevious=function(){var e=a[a.length-1];if(!r)return y.show(e);var t=a.indexOf(r),i=a[t-1]||e;y.show(i)};var w=y.setProps;return y.setProps=function(e){c=e.overrides||c,w(e)},y.setInstances=function(e){f(!0),l.forEach((function(e){return e()})),s=e,f(!1),d(),p(),l=b(y),y.setProps({triggerTarget:o})},l=b(y),y},i.default=se,i.delegate=function(e,i){"production"!==t.env.NODE_ENV&&H(!(i&&i.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a tippy."].join(" "));var n=[],r=[],s=!1,a=i.target,o=h(i,["target"]),l=Object.assign({},o,{trigger:"manual",touch:!1}),u=Object.assign({touch:W.touch},o,{showOnCreate:!0}),p=se(e,l);function d(e){if(e.target&&!s){var t=e.target.closest(a);if(t){var n=t.getAttribute("data-tippy-trigger")||i.trigger||W.trigger;if(!t._tippy&&!("touchstart"===e.type&&"boolean"==typeof u.touch||"touchstart"!==e.type&&n.indexOf(oe[e.type])<0)){var o=se(t,u);o&&(r=r.concat(o))}}}}function f(e,t,i,r){void 0===r&&(r=!1),e.addEventListener(t,i,r),n.push({node:e,eventType:t,handler:i,options:r})}return m(p).forEach((function(e){var t=e.destroy,i=e.enable,a=e.disable;e.destroy=function(e){void 0===e&&(e=!0),e&&r.forEach((function(e){e.destroy()})),r=[],n.forEach((function(e){var t=e.node,i=e.eventType,n=e.handler,r=e.options;t.removeEventListener(i,n,r)})),n=[],t()},e.enable=function(){i(),r.forEach((function(e){return e.enable()})),s=!1},e.disable=function(){a(),r.forEach((function(e){return e.disable()})),s=!0},function(e){var t=e.reference;f(t,"touchstart",d,c),f(t,"mouseover",d),f(t,"focusin",d),f(t,"click",d)}(e)})),p},i.followCursor=de,i.hideAll=function(e){var t=void 0===e?{}:e,i=t.exclude,n=t.duration;ne.forEach((function(e){var t=!1;if(i&&(t=k(i)?e.reference===i:e.popper===i.popper),!t){var r=e.props.duration;e.setProps({duration:n}),e.hide(),e.state.isDestroyed||e.setProps({duration:r})}}))},i.inlinePositioning=fe,i.roundArrow='',i.sticky=he}).call(this)}).call(this,e("_process"))},{"@popperjs/core":1,_process:296}],432:[function(e,t,i){var n=e("buffer").Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(n.isBuffer(e)){for(var t=new Uint8Array(e.length),i=e.length,r=0;r */ const n=e("debug")("torrent-discovery"),r=e("bittorrent-dht/client"),s=e("events").EventEmitter,a=e("run-parallel"),o=e("bittorrent-tracker/client"),c=e("bittorrent-lsd");t.exports=class extends s{constructor(e){if(super(),!e.peerId)throw new Error("Option `peerId` is required");if(!e.infoHash)throw new Error("Option `infoHash` is required");if(!i.browser&&!e.port)throw new Error("Option `port` is required");this.peerId="string"==typeof e.peerId?e.peerId:e.peerId.toString("hex"),this.infoHash="string"==typeof e.infoHash?e.infoHash.toLowerCase():e.infoHash.toString("hex"),this._port=e.port,this._userAgent=e.userAgent,this.destroyed=!1,this._announce=e.announce||[],this._intervalMs=e.intervalMs||9e5,this._trackerOpts=null,this._dhtAnnouncing=!1,this._dhtTimeout=!1,this._internalDHT=!1,this._onWarning=e=>{this.emit("warning",e)},this._onError=e=>{this.emit("error",e)},this._onDHTPeer=(e,t)=>{t.toString("hex")===this.infoHash&&this.emit("peer",`${e.host}:${e.port}`,"dht")},this._onTrackerPeer=e=>{this.emit("peer",e,"tracker")},this._onTrackerAnnounce=()=>{this.emit("trackerAnnounce")},this._onLSDPeer=(e,t)=>{this.emit("peer",e,"lsd")};const t=(e,t)=>{const i=new r(t);return i.on("warning",this._onWarning),i.on("error",this._onError),i.listen(e),this._internalDHT=!0,i};!1===e.tracker?this.tracker=null:e.tracker&&"object"==typeof e.tracker?(this._trackerOpts=Object.assign({},e.tracker),this.tracker=this._createTracker()):this.tracker=this._createTracker(),!1===e.dht||"function"!=typeof r?this.dht=null:e.dht&&"function"==typeof e.dht.addNode?this.dht=e.dht:e.dht&&"object"==typeof e.dht?this.dht=t(e.dhtPort,e.dht):this.dht=t(e.dhtPort),this.dht&&(this.dht.on("peer",this._onDHTPeer),this._dhtAnnounce()),!1===e.lsd||"function"!=typeof c?this.lsd=null:this.lsd=this._createLSD()}updatePort(e){e!==this._port&&(this._port=e,this.dht&&this._dhtAnnounce(),this.tracker&&(this.tracker.stop(),this.tracker.destroy((()=>{this.tracker=this._createTracker()}))))}complete(e){this.tracker&&this.tracker.complete(e)}destroy(e){if(this.destroyed)return;this.destroyed=!0,clearTimeout(this._dhtTimeout);const t=[];this.tracker&&(this.tracker.stop(),this.tracker.removeListener("warning",this._onWarning),this.tracker.removeListener("error",this._onError),this.tracker.removeListener("peer",this._onTrackerPeer),this.tracker.removeListener("update",this._onTrackerAnnounce),t.push((e=>{this.tracker.destroy(e)}))),this.dht&&this.dht.removeListener("peer",this._onDHTPeer),this._internalDHT&&(this.dht.removeListener("warning",this._onWarning),this.dht.removeListener("error",this._onError),t.push((e=>{this.dht.destroy(e)}))),this.lsd&&(this.lsd.removeListener("warning",this._onWarning),this.lsd.removeListener("error",this._onError),this.lsd.removeListener("peer",this._onLSDPeer),t.push((e=>{this.lsd.destroy(e)}))),a(t,e),this.dht=null,this.tracker=null,this.lsd=null,this._announce=null}_createTracker(){const e=Object.assign({},this._trackerOpts,{infoHash:this.infoHash,announce:this._announce,peerId:this.peerId,port:this._port,userAgent:this._userAgent}),t=new o(e);return t.on("warning",this._onWarning),t.on("error",this._onError),t.on("peer",this._onTrackerPeer),t.on("update",this._onTrackerAnnounce),t.setInterval(this._intervalMs),t.start(),t}_dhtAnnounce(){this._dhtAnnouncing||(n("dht announce"),this._dhtAnnouncing=!0,clearTimeout(this._dhtTimeout),this.dht.announce(this.infoHash,this._port,(e=>{this._dhtAnnouncing=!1,n("dht announce complete"),e&&this.emit("warning",e),this.emit("dhtAnnounce"),this.destroyed||(this._dhtTimeout=setTimeout((()=>{this._dhtAnnounce()}),this._intervalMs+Math.floor(Math.random()*this._intervalMs/5)),this._dhtTimeout.unref&&this._dhtTimeout.unref())})))}_createLSD(){const e=Object.assign({},{infoHash:this.infoHash,peerId:this.peerId,port:this._port}),t=new c(e);return t.on("warning",this._onWarning),t.on("error",this._onError),t.on("peer",this._onLSDPeer),t.start(),t}}}).call(this)}).call(this,e("_process"))},{_process:296,"bittorrent-dht/client":67,"bittorrent-lsd":67,"bittorrent-tracker/client":43,debug:146,events:178,"run-parallel":336}],434:[function(e,t,i){(function(e){(function(){ /*! torrent-piece. MIT License. WebTorrent LLC */