@web3mq/react-components
Version:
web3mq-react-components
7 lines • 813 kB
JavaScript
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@web3mq/client"),n=require("js-sha3"),r=require("react-dom"),i=require("@babel/runtime/helpers/extends"),o=require("react-select"),a=require("starknet"),s=require("@web3mq/dapp-connect"),l=require("@web3mq/dapp-connect-react"),u=require("@walletconnect/sign-client"),c=require("@web3modal/standalone");function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=d(e),f=d(n),A=d(r),m=d(i),p=d(o),g=d(u),v="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function E(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function y(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function w(e,t){return e(t={exports:{}},t.exports),t.exports}var C=w((function(e){function t(n){return e.exports=t="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},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})),b=y(C),x=w((function(e){var t=C.default;e.exports=function(e,n){if("object"!==t(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,n||"default");if("object"!==t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports}));y(x);var I=w((function(e){var t=C.default;e.exports=function(e){var n=x(e,"string");return"symbol"===t(n)?n:String(n)},e.exports.__esModule=!0,e.exports.default=e.exports}));y(I);var M=w((function(e){e.exports=function(e,t,n){return(t=I(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports})),k=y(M),R=w((function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports}));y(R);var B=w((function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}},e.exports.__esModule=!0,e.exports.default=e.exports}));y(B);var N=w((function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports}));y(N);var S=w((function(e){e.exports=function(e,t){if(e){if("string"==typeof e)return N(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?N(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}));y(S);var T=w((function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports}));y(T);var P,L=y(w((function(e){e.exports=function(e,t){return R(e)||B(e,t)||S(e,t)||T()},e.exports.__esModule=!0,e.exports.default=e.exports}))),O=w((function(e){
/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var o=typeof i;if("string"===o||"number"===o)e.push(i);else if(Array.isArray(i)){if(i.length){var a=n.apply(null,i);a&&e.push(a)}}else if("object"===o){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){e.push(i.toString());continue}for(var s in i)t.call(i,s)&&i[s]&&e.push(s)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}));exports.AppTypeEnum=void 0,(P=exports.AppTypeEnum||(exports.AppTypeEnum={})).pc="pc",P.h5="h5",P.mobile="mobile";var D=h.default.createContext(void 0),Q=function(e){var t=e.children,n=e.value;return h.default.createElement(D.Provider,{value:n},t)},U=function(t){var n=e.useContext(D);return n||(console.warn("The useChatContext hook was called outside of the ChatContext provider. Make sure this hook is called within a child of the Chat component. The errored call is located in the ".concat(t," component.")),{})},V=w((function(e){function t(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(i,o){var a=e.apply(n,r);function s(e){t(a,i,o,s,l,"next",e)}function l(e){t(a,i,o,s,l,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports})),j=y(V),_=w((function(e){var t=C.default;function n(){e.exports=n=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var r={},i=Object.prototype,o=i.hasOwnProperty,a=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},l=s.iterator||"@@iterator",u=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,o=Object.create(i.prototype),s=new R(r||[]);return a(o,"_invoke",{value:x(e,n,s)}),o}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}r.wrap=h;var A={};function m(){}function p(){}function g(){}var v={};d(v,l,(function(){return this}));var E=Object.getPrototypeOf,y=E&&E(E(B([])));y&&y!==i&&o.call(y,l)&&(v=y);var w=g.prototype=m.prototype=Object.create(v);function C(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,n){function r(i,a,s,l){var u=f(e[i],e,a);if("throw"!==u.type){var c=u.arg,d=c.value;return d&&"object"==t(d)&&o.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,s,l)}),(function(e){r("throw",e,s,l)})):n.resolve(d).then((function(e){c.value=e,s(c)}),(function(e){return r("throw",e,s,l)}))}l(u.arg)}var i;a(this,"_invoke",{value:function(e,t){function o(){return new n((function(n,i){r(e,t,n,i)}))}return i=i?i.then(o,o):o()}})}function x(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=I(a,n);if(s){if(s===A)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=f(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===A)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function I(e,t){var n=t.method,r=e.iterator[n];if(void 0===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,I(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),A;var i=f(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,A;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,A):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,A)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function B(e){if(e||""===e){var n=e[l];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(o.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}throw new TypeError(t(e)+" is not iterable")}return p.prototype=g,a(w,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:p,configurable:!0}),p.displayName=d(g,c,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,d(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},r.awrap=function(e){return{__await:e}},C(b.prototype),d(b.prototype,u,(function(){return this})),r.AsyncIterator=b,r.async=function(e,t,n,i,o){void 0===o&&(o=Promise);var a=new b(h(e,t,n,i),o);return r.isGeneratorFunction(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},C(w),d(w,c,"Generator"),d(w,l,(function(){return this})),d(w,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},r.values=B,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,A):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),A},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),A}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:B(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),A}},r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}));y(_);var F,H,W=_(),Y=W;try{regeneratorRuntime=W}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=W:Function("r","regeneratorRuntime = r")(W)}!function(e){e.PHONE="phone",e.EMAIL="email",e.LENS="lens",e.ENS="ens",e.DOTBIT="dotbit"}(F||(F={})),function(e){e.PHONE="phone",e.EMAIL="email",e.LENS="lens.xyz",e.DOTBIT="dotbit",e.ENS="ens"}(H||(H={}));var J,K,q="ENS Registrar",G="Lens",Z="Crossbell";!function(e){e.HOME="home",e.VIEW_ALL="view_all_desktop",e.LOGIN="login",e.QR_CODE="qr_code",e.SIGN_UP="sign_up",e.CONNECT_LOADING="connect_loading",e.CONNECT_ERROR="connect_error",e.LOGIN_SIGN_LOADING="login_sign_loading",e.RESET_PASSWORD="reset_password",e.LOGIN_SIGN_ERROR="login_sign_error",e.SIGN_UP_SIGN_LOADING="sign_up_sign_loading",e.SIGN_UP_SIGN_ERROR="sign_up_sign_error",e.REJECT_CONNECT="reject_connect"}(J||(J={})),function(e){e.GET_KEYS_FOR_LOGIN="get_Keys_For_Login",e.GET_KEYS_FOR_REGISTER="get_keys_For_Register",e.REGISTER="register"}(K||(K={}));var z={metamask:"MetaMask",argentX:"Argent X",braavos:"Braavos",dappConnect:"Web3MQ"},X={metamask:"eth",braavos:"starknet",argentX:"starknet",dappConnect:"eth"};!function(e){e.SIGN_LOADING="sign_loading",e.SIGN_ERROR="sign_error",e.READY_SIGN_UP="ready_sign_up",e.READY_BIND="ready_bind",e.DID_BINDING="did_binding",e.DID_BIND_SUCCESS="did_bind_success",e.DID_BIND_ERROR="did_bind_error"}(J||(J={})),function(e){e.READY_AUTH_TO_DAPP="ready_auth_to_dapp",e.AUTH_DAPP_SUCCESS="auth_dapp_success",e.AUTH_DAPP_ERROR="auth_dapp_error",e.AUTHING="authing"}(J||(J={}));var $=function(){var e=j(Y.mark((function e(t){var n,r,i,o,a;return Y.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={method:"GET",headers:{accept:"application/json"}},e.next=3,fetch("https://pregod.rss3.dev/v1/profiles/".concat(t),n).then((function(e){return e.json()})).catch((function(e){return console.error(e)}));case 3:if(!((r=e.sent)&&r.result&&r.result.length>0)){e.next=10;break}return i=r.result,o={avatar:"",lensInfo:i.find((function(e){return e.platform===G})),ensInfo:i.find((function(e){return e.platform===q})),csbInfo:i.find((function(e){return e.platform===Z}))},(a=o.ensInfo?o.ensInfo:o.lensInfo?o.lensInfo:o.csbInfo?o.csbInfo:null)&&a.profile_uri&&a.profile_uri[0]&&(o.avatar=a.profile_uri[0]),e.abrupt("return",o);case 10:return e.abrupt("return",null);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();let ee;const te=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];var ne={getSymbolSize:function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},getSymbolTotalCodewords:function(e){return te[e]},getBCHDigit:function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},setToSJISFunction:function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');ee=e},isKanjiModeEnabled:function(){return void 0!==ee},toSJIS:function(e){return ee(e)}},re=w((function(e,t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return n}}}));function ie(){this.buffer=[],this.length=0}re.L,re.M,re.Q,re.H,re.isValid,ie.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var oe=ie;function ae(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}ae.prototype.set=function(e,t,n,r){const i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},ae.prototype.get=function(e,t){return this.data[e*this.size+t]},ae.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},ae.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var se=ae,le=w((function(e,t){const n=ne.getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];const t=Math.floor(e/7)+2,r=n(e),i=145===r?26:2*Math.ceil((r-13)/(2*t-2)),o=[r-7];for(let e=1;e<t-1;e++)o[e]=o[e-1]-i;return o.push(6),o.reverse()},t.getPositions=function(e){const n=[],r=t.getRowColCoords(e),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)0===e&&0===t||0===e&&t===i-1||e===i-1&&0===t||n.push([r[e],r[t]]);return n}}));le.getRowColCoords,le.getPositions;const ue=ne.getSymbolSize;var ce={getPositions:function(e){const t=ue(e);return[[0,0],[t-7,0],[0,t-7]]}},de=w((function(e,t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const n=3,r=3,i=40,o=10;function a(e,n,r){switch(e){case t.Patterns.PATTERN000:return(n+r)%2==0;case t.Patterns.PATTERN001:return n%2==0;case t.Patterns.PATTERN010:return r%3==0;case t.Patterns.PATTERN011:return(n+r)%3==0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case t.Patterns.PATTERN101:return n*r%2+n*r%3==0;case t.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case t.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){const t=e.size;let r=0,i=0,o=0,a=null,s=null;for(let l=0;l<t;l++){i=o=0,a=s=null;for(let u=0;u<t;u++){let t=e.get(l,u);t===a?i++:(i>=5&&(r+=n+(i-5)),a=t,i=1),t=e.get(u,l),t===s?o++:(o>=5&&(r+=n+(o-5)),s=t,o=1)}i>=5&&(r+=n+(i-5)),o>=5&&(r+=n+(o-5))}return r},t.getPenaltyN2=function(e){const t=e.size;let n=0;for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){const t=e.get(r,i)+e.get(r,i+1)+e.get(r+1,i)+e.get(r+1,i+1);4!==t&&0!==t||n++}return n*r},t.getPenaltyN3=function(e){const t=e.size;let n=0,r=0,o=0;for(let i=0;i<t;i++){r=o=0;for(let a=0;a<t;a++)r=r<<1&2047|e.get(i,a),a>=10&&(1488===r||93===r)&&n++,o=o<<1&2047|e.get(a,i),a>=10&&(1488===o||93===o)&&n++}return n*i},t.getPenaltyN4=function(e){let t=0;const n=e.data.length;for(let r=0;r<n;r++)t+=e.data[r];return Math.abs(Math.ceil(100*t/n/5)-10)*o},t.applyMask=function(e,t){const n=t.size;for(let r=0;r<n;r++)for(let i=0;i<n;i++)t.isReserved(i,r)||t.xor(i,r,a(e,i,r))},t.getBestMask=function(e,n){const r=Object.keys(t.Patterns).length;let i=0,o=1/0;for(let a=0;a<r;a++){n(a),t.applyMask(a,e);const r=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(a,e),r<o&&(o=r,i=a)}return i}}));de.Patterns,de.isValid,de.getPenaltyN1,de.getPenaltyN2,de.getPenaltyN3,de.getPenaltyN4,de.applyMask,de.getBestMask;const he=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],fe=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];var Ae={getBlocksCount:function(e,t){switch(t){case re.L:return he[4*(e-1)+0];case re.M:return he[4*(e-1)+1];case re.Q:return he[4*(e-1)+2];case re.H:return he[4*(e-1)+3];default:return}},getTotalCodewordsCount:function(e,t){switch(t){case re.L:return fe[4*(e-1)+0];case re.M:return fe[4*(e-1)+1];case re.Q:return fe[4*(e-1)+2];case re.H:return fe[4*(e-1)+3];default:return}}};const me=new Uint8Array(512),pe=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)me[t]=e,pe[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)me[e]=me[e-255]}();var ge=function(e){return me[e]},ve=function(e,t){return 0===e||0===t?0:me[pe[e]+pe[t]]},Ee=w((function(e,t){t.mul=function(e,t){const n=new Uint8Array(e.length+t.length-1);for(let r=0;r<e.length;r++)for(let i=0;i<t.length;i++)n[r+i]^=ve(e[r],t[i]);return n},t.mod=function(e,t){let n=new Uint8Array(e);for(;n.length-t.length>=0;){const e=n[0];for(let r=0;r<t.length;r++)n[r]^=ve(t[r],e);let r=0;for(;r<n.length&&0===n[r];)r++;n=n.slice(r)}return n},t.generateECPolynomial=function(e){let n=new Uint8Array([1]);for(let r=0;r<e;r++)n=t.mul(n,new Uint8Array([1,ge(r)]));return n}}));function ye(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}Ee.mul,Ee.mod,Ee.generateECPolynomial,ye.prototype.initialize=function(e){this.degree=e,this.genPoly=Ee.generateECPolynomial(this.degree)},ye.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=Ee.mod(t,this.genPoly),r=this.degree-n.length;if(r>0){const e=new Uint8Array(this.degree);return e.set(n,r),e}return n};var we=ye,Ce=function(e){return!isNaN(e)&&e>=1&&e<=40};const be="[0-9]+";let xe="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";xe=xe.replace(/u/g,"\\u");const Ie="(?:(?![A-Z0-9 $%*+\\-./:]|"+xe+")(?:.|[\r\n]))+";var Me=new RegExp(xe,"g"),ke=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Re=new RegExp(Ie,"g"),Be=new RegExp(be,"g"),Ne=new RegExp("[A-Z $%*+\\-./:]+","g");const Se=new RegExp("^"+xe+"$"),Te=new RegExp("^"+be+"$"),Pe=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");var Le={KANJI:Me,BYTE_KANJI:ke,BYTE:Re,NUMERIC:Be,ALPHANUMERIC:Ne,testKanji:function(e){return Se.test(e)},testNumeric:function(e){return Te.test(e)},testAlphanumeric:function(e){return Pe.test(e)}},Oe=w((function(e,t){t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!Ce(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return Le.testNumeric(e)?t.NUMERIC:Le.testAlphanumeric(e)?t.ALPHANUMERIC:Le.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,n){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return n}}}));Oe.NUMERIC,Oe.ALPHANUMERIC,Oe.BYTE,Oe.KANJI,Oe.MIXED,Oe.getCharCountIndicator,Oe.getBestModeForData,Oe.isValid;var De=w((function(e,t){const n=ne.getBCHDigit(7973);function r(e,t){return Oe.getCharCountIndicator(e,t)+4}function i(e,t){let n=0;return e.forEach((function(e){const i=r(e.mode,t);n+=i+e.getBitsLength()})),n}t.from=function(e,t){return Ce(e)?parseInt(e,10):t},t.getCapacity=function(e,t,n){if(!Ce(e))throw new Error("Invalid QR Code version");void 0===n&&(n=Oe.BYTE);const i=8*(ne.getSymbolTotalCodewords(e)-Ae.getTotalCodewordsCount(e,t));if(n===Oe.MIXED)return i;const o=i-r(n,e);switch(n){case Oe.NUMERIC:return Math.floor(o/10*3);case Oe.ALPHANUMERIC:return Math.floor(o/11*2);case Oe.KANJI:return Math.floor(o/13);case Oe.BYTE:default:return Math.floor(o/8)}},t.getBestVersionForData=function(e,n){let r;const o=re.from(n,re.M);if(Array.isArray(e)){if(e.length>1)return function(e,n){for(let r=1;r<=40;r++)if(i(e,r)<=t.getCapacity(r,n,Oe.MIXED))return r}(e,o);if(0===e.length)return 1;r=e[0]}else r=e;return function(e,n,r){for(let i=1;i<=40;i++)if(n<=t.getCapacity(i,r,e))return i}(r.mode,r.getLength(),o)},t.getEncodedBits=function(e){if(!Ce(e)||e<7)throw new Error("Invalid QR Code version");let t=e<<12;for(;ne.getBCHDigit(t)-n>=0;)t^=7973<<ne.getBCHDigit(t)-n;return e<<12|t}}));De.getCapacity,De.getBestVersionForData,De.getEncodedBits;const Qe=ne.getBCHDigit(1335);var Ue={getEncodedBits:function(e,t){const n=e.bit<<3|t;let r=n<<10;for(;ne.getBCHDigit(r)-Qe>=0;)r^=1335<<ne.getBCHDigit(r)-Qe;return 21522^(n<<10|r)}};function Ve(e){this.mode=Oe.NUMERIC,this.data=e.toString()}Ve.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},Ve.prototype.getLength=function(){return this.data.length},Ve.prototype.getBitsLength=function(){return Ve.getBitsLength(this.data.length)},Ve.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);const i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,3*i+1))};var je=Ve;const _e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Fe(e){this.mode=Oe.ALPHANUMERIC,this.data=e}Fe.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},Fe.prototype.getLength=function(){return this.data.length},Fe.prototype.getBitsLength=function(){return Fe.getBitsLength(this.data.length)},Fe.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=45*_e.indexOf(this.data[t]);n+=_e.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(_e.indexOf(this.data[t]),6)};var He=Fe;function We(e){this.mode=Oe.BYTE,"string"==typeof e&&(e=function(e){for(var t=[],n=e.length,r=0;r<n;r++){var i=e.charCodeAt(r);if(i>=55296&&i<=56319&&n>r+1){var o=e.charCodeAt(r+1);o>=56320&&o<=57343&&(i=1024*(i-55296)+o-56320+65536,r+=1)}i<128?t.push(i):i<2048?(t.push(i>>6|192),t.push(63&i|128)):i<55296||i>=57344&&i<65536?(t.push(i>>12|224),t.push(i>>6&63|128),t.push(63&i|128)):i>=65536&&i<=1114111?(t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(63&i|128)):t.push(239,191,189)}return new Uint8Array(t).buffer}(e)),this.data=new Uint8Array(e)}We.getBitsLength=function(e){return 8*e},We.prototype.getLength=function(){return this.data.length},We.prototype.getBitsLength=function(){return We.getBitsLength(this.data.length)},We.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};var Ye=We;function Je(e){this.mode=Oe.KANJI,this.data=e}Je.getBitsLength=function(e){return 13*e},Je.prototype.getLength=function(){return this.data.length},Je.prototype.getBitsLength=function(){return Je.getBitsLength(this.data.length)},Je.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=ne.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),e.put(n,13)}};var Ke=Je,qe=w((function(e){var t={single_source_shortest_paths:function(e,n,r){var i={},o={};o[n]=0;var a,s,l,u,c,d,h,f=t.PriorityQueue.make();for(f.push(n,0);!f.empty();)for(l in s=(a=f.pop()).value,u=a.cost,c=e[s]||{})c.hasOwnProperty(l)&&(d=u+c[l],h=o[l],(void 0===o[l]||h>d)&&(o[l]=d,f.push(l,d),i[l]=s));if(void 0!==r&&void 0===o[r]){var A=["Could not find a path from ",n," to ",r,"."].join("");throw new Error(A)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,n,r){var i=t.single_source_shortest_paths(e,n,r);return t.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var n,r=t.PriorityQueue,i={};for(n in e=e||{},r)r.hasOwnProperty(n)&&(i[n]=r[n]);return i.queue=[],i.sorter=e.sorter||r.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t})),Ge=w((function(e,t){function n(e){return unescape(encodeURIComponent(e)).length}function r(e,t,n){const r=[];let i;for(;null!==(i=e.exec(n));)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function i(e){const t=r(Le.NUMERIC,Oe.NUMERIC,e),n=r(Le.ALPHANUMERIC,Oe.ALPHANUMERIC,e);let i,o;ne.isKanjiModeEnabled()?(i=r(Le.BYTE,Oe.BYTE,e),o=r(Le.KANJI,Oe.KANJI,e)):(i=r(Le.BYTE_KANJI,Oe.BYTE,e),o=[]);return t.concat(n,i,o).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function o(e,t){switch(t){case Oe.NUMERIC:return je.getBitsLength(e);case Oe.ALPHANUMERIC:return He.getBitsLength(e);case Oe.KANJI:return Ke.getBitsLength(e);case Oe.BYTE:return Ye.getBitsLength(e)}}function a(e,t){let n;const r=Oe.getBestModeForData(e);if(n=Oe.from(t,r),n!==Oe.BYTE&&n.bit<r.bit)throw new Error('"'+e+'" cannot be encoded with mode '+Oe.toString(n)+".\n Suggested mode is: "+Oe.toString(r));switch(n!==Oe.KANJI||ne.isKanjiModeEnabled()||(n=Oe.BYTE),n){case Oe.NUMERIC:return new je(e);case Oe.ALPHANUMERIC:return new He(e);case Oe.KANJI:return new Ke(e);case Oe.BYTE:return new Ye(e)}}t.fromArray=function(e){return e.reduce((function(e,t){return"string"==typeof t?e.push(a(t,null)):t.data&&e.push(a(t.data,t.mode)),e}),[])},t.fromString=function(e,r){const a=function(e){const t=[];for(let r=0;r<e.length;r++){const i=e[r];switch(i.mode){case Oe.NUMERIC:t.push([i,{data:i.data,mode:Oe.ALPHANUMERIC,length:i.length},{data:i.data,mode:Oe.BYTE,length:i.length}]);break;case Oe.ALPHANUMERIC:t.push([i,{data:i.data,mode:Oe.BYTE,length:i.length}]);break;case Oe.KANJI:t.push([i,{data:i.data,mode:Oe.BYTE,length:n(i.data)}]);break;case Oe.BYTE:t.push([{data:i.data,mode:Oe.BYTE,length:n(i.data)}])}}return t}(i(e)),s=function(e,t){const n={},r={start:{}};let i=["start"];for(let a=0;a<e.length;a++){const s=e[a],l=[];for(let e=0;e<s.length;e++){const u=s[e],c=""+a+e;l.push(c),n[c]={node:u,lastCount:0},r[c]={};for(let e=0;e<i.length;e++){const a=i[e];n[a]&&n[a].node.mode===u.mode?(r[a][c]=o(n[a].lastCount+u.length,u.mode)-o(n[a].lastCount,u.mode),n[a].lastCount+=u.length):(n[a]&&(n[a].lastCount=u.length),r[a][c]=o(u.length,u.mode)+4+Oe.getCharCountIndicator(u.mode,t))}}i=l}for(let e=0;e<i.length;e++)r[i[e]].end=0;return{map:r,table:n}}(a,r),l=qe.find_path(s.map,"start","end"),u=[];for(let e=1;e<l.length-1;e++)u.push(s.table[l[e]].node);return t.fromArray(function(e){return e.reduce((function(e,t){const n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}(u))},t.rawSplit=function(e){return t.fromArray(i(e))}}));function Ze(e,t,n){const r=e.size,i=Ue.getEncodedBits(t,n);let o,a;for(o=0;o<15;o++)a=1==(i>>o&1),o<6?e.set(o,8,a,!0):o<8?e.set(o+1,8,a,!0):e.set(r-15+o,8,a,!0),o<8?e.set(8,r-o-1,a,!0):o<9?e.set(8,15-o-1+1,a,!0):e.set(8,15-o-1,a,!0);e.set(r-8,8,1,!0)}function ze(e,t,n){const r=new oe;n.forEach((function(t){r.put(t.mode.bit,4),r.put(t.getLength(),Oe.getCharCountIndicator(t.mode,e)),t.write(r)}));const i=8*(ne.getSymbolTotalCodewords(e)-Ae.getTotalCodewordsCount(e,t));for(r.getLengthInBits()+4<=i&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(0);const o=(i-r.getLengthInBits())/8;for(let e=0;e<o;e++)r.put(e%2?17:236,8);return function(e,t,n){const r=ne.getSymbolTotalCodewords(t),i=Ae.getTotalCodewordsCount(t,n),o=r-i,a=Ae.getBlocksCount(t,n),s=r%a,l=a-s,u=Math.floor(r/a),c=Math.floor(o/a),d=c+1,h=u-c,f=new we(h);let A=0;const m=new Array(a),p=new Array(a);let g=0;const v=new Uint8Array(e.buffer);for(let e=0;e<a;e++){const t=e<l?c:d;m[e]=v.slice(A,A+t),p[e]=f.encode(m[e]),A+=t,g=Math.max(g,t)}const E=new Uint8Array(r);let y,w,C=0;for(y=0;y<g;y++)for(w=0;w<a;w++)y<m[w].length&&(E[C++]=m[w][y]);for(y=0;y<h;y++)for(w=0;w<a;w++)E[C++]=p[w][y];return E}(r,e,t)}function Xe(e,t,n,r){let i;if(Array.isArray(e))i=Ge.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let r=t;if(!r){const t=Ge.rawSplit(e);r=De.getBestVersionForData(t,n)}i=Ge.fromString(e,r||40)}}const o=De.getBestVersionForData(i,n);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<o)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+o+".\n")}else t=o;const a=ze(t,n,i),s=ne.getSymbolSize(t),l=new se(s);return function(e,t){const n=e.size,r=ce.getPositions(t);for(let t=0;t<r.length;t++){const i=r[t][0],o=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)o+r<=-1||n<=o+r||(t>=0&&t<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===t||6===t)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,o+r,!0,!0):e.set(i+t,o+r,!1,!0))}}(l,t),function(e){const t=e.size;for(let n=8;n<t-8;n++){const t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}(l),function(e,t){const n=le.getPositions(t);for(let t=0;t<n.length;t++){const r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)-2===t||2===t||-2===n||2===n||0===t&&0===n?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}(l,t),Ze(l,n,0),t>=7&&function(e,t){const n=e.size,r=De.getEncodedBits(t);let i,o,a;for(let t=0;t<18;t++)i=Math.floor(t/3),o=t%3+n-8-3,a=1==(r>>t&1),e.set(i,o,a,!0),e.set(o,i,a,!0)}(l,t),function(e,t){const n=e.size;let r=-1,i=n-1,o=7,a=0;for(let s=n-1;s>0;s-=2)for(6===s&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;a<t.length&&(r=1==(t[a]>>>o&1)),e.set(i,s-n,r),o--,-1===o&&(a++,o=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}(l,a),isNaN(r)&&(r=de.getBestMask(l,Ze.bind(null,l,n))),de.applyMask(r,l),Ze(l,n,r),{modules:l,version:t,errorCorrectionLevel:n,maskPattern:r,segments:i}}Ge.fromArray,Ge.fromString,Ge.rawSplit;var $e=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let n,r,i=re.M;return void 0!==t&&(i=re.from(t.errorCorrectionLevel,re.M),n=De.from(t.version),r=de.from(t.maskPattern),t.toSJISFunc&&ne.setToSJISFunction(t.toSJISFunc)),Xe(e,n,i,r)},et=w((function(e,t){function n(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:t,color:{dark:n(e.color.dark||"#000000ff"),light:n(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,n){const r=t.getScale(e,n);return Math.floor((e+2*n.margin)*r)},t.qrToImageData=function(e,n,r){const i=n.modules.size,o=n.modules.data,a=t.getScale(i,r),s=Math.floor((i+2*r.margin)*a),l=r.margin*a,u=[r.color.light,r.color.dark];for(let t=0;t<s;t++)for(let n=0;n<s;n++){let c=4*(t*s+n),d=r.color.light;if(t>=l&&n>=l&&t<s-l&&n<s-l){d=u[o[Math.floor((t-l)/a)*i+Math.floor((n-l)/a)]?1:0]}e[c++]=d.r,e[c++]=d.g,e[c++]=d.b,e[c]=d.a}}}));et.getOptions,et.getScale,et.getImageWidth,et.qrToImageData;var tt=w((function(e,t){t.render=function(e,t,n){let r=n,i=t;void 0!==r||t&&t.getContext||(r=t,t=void 0),t||(i=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),r=et.getOptions(r);const o=et.getImageWidth(e.modules.size,r),a=i.getContext("2d"),s=a.createImageData(o,o);return et.qrToImageData(s.data,e,r),function(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}(a,i,o),a.putImageData(s,0,0),i},t.renderToDataURL=function(e,n,r){let i=r;void 0!==i||n&&n.getContext||(i=n,n=void 0),i||(i={});const o=t.render(e,n,i),a=i.type||"image/png",s=i.rendererOpts||{};return o.toDataURL(a,s.quality)}}));function nt(e,t){const n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function rt(e,t,n){let r=e+t;return void 0!==n&&(r+=" "+n),r}tt.render,tt.renderToDataURL;var it=function(e,t,n){const r=et.getOptions(t),i=e.modules.size,o=e.modules.data,a=i+2*r.margin,s=r.color.light.a?"<path "+nt(r.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",l="<path "+nt(r.color.dark,"stroke")+' d="'+function(e,t,n){let r="",i=0,o=!1,a=0;for(let s=0;s<e.length;s++){const l=Math.floor(s%t),u=Math.floor(s/t);l||o||(o=!0),e[s]?(a++,s>0&&l>0&&e[s-1]||(r+=o?rt("M",l+n,.5+u+n):rt("m",i,0),i=0,o=!1),l+1<t&&e[s+1]||(r+=rt("h",a),a=0)):i++}return r}(o,i,r.margin)+'"/>',u='viewBox="0 0 '+a+" "+a+'"',c='<svg xmlns="http://www.w3.org/2000/svg" '+(r.width?'width="'+r.width+'" height="'+r.width+'" ':"")+u+' shape-rendering="crispEdges">'+s+l+"</svg>\n";return"function"==typeof n&&n(null,c),c};function ot(e,t,n,r,i){const o=[].slice.call(arguments,1),a=o.length,s="function"==typeof o[a-1];if(!(s||"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then))throw new Error("Callback required as last argument");if(!s){if(a<1)throw new Error("Too few arguments provided");return 1===a?(n=t,t=r=void 0):2!==a||t.getContext||(r=n,n=t,t=void 0),new Promise((function(i,o){try{const o=$e(n,r);i(e(o,t,r))}catch(e){o(e)}}))}if(a<2)throw new Error("Too few arguments provided");2===a?(i=n,n=t,t=r=void 0):3===a&&(t.getContext&&void 0===i?(i=r,r=void 0):(i=r,r=n,n=t,t=void 0));try{const o=$e(n,r);i(null,e(o,t,r))}catch(e){i(e)}}ot.bind(null,tt.render),ot.bind(null,tt.renderToDataURL),ot.bind(null,(function(e,t,n){return it(e,n)}));var at,st=(at=Object.freeze({__proto__:null,default:{}}))&&at.default||at,lt=w((function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var o;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:st.Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=a(e,n);return n-1>=t&&(r|=a(e,n-1)<<4),r}function l(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),l=t;l<s;l++){var u=e.charCodeAt(l)-48;o*=i,a=u>=49?u-49+10:u>=17?u-17+10:u,n(u>=0&&a<i,"Invalid character"),o+=a}return o}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,o=0,a=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=s(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=s(e,t,r)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var o=e.length-n,a=o%r,s=Math.min(o,o-a)+n,u=0,c=n;c<s;c+=r)u=l(e,c,c+r,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var d=1;for(u=l(e,c,e.length,t),c=0;c<a;c++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){u(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(e){i.prototype.inspect=c}else i.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","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"],h=[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],f=[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];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],l=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?d[6-l.length]+l+r:l+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],c=f[e];r="";var A=this.clone();for(A.negative=0;!A.isZero();){var m=A.modrn(c).toString(e);r=(A=A.idivn(c)).isZero()?m+r:d[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},o&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function A(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,l=a/67108864|0;n.words[0]=s;for(var u=1;u<r;u++){for(var c=l>>>26,d=67108863&l,h=Math.min(u,t.length-1),f=Math.max(0,u-e.length+1);f<=h;f++){var A=u-f|0;c+=(a=(i=0|e.words[A])*(o=0|t.words[f])+d)/67108864|0,d=67108863&a}n.words[u]=0|d,l=0|c}return 0!==l?n.words[u]=0|l:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;e[n++]=255&a,n<e.length&&(e[n++]=a>>8&255),n<e.length&&(e[n++]=a>>16&255),6===o?(n<e.length&&(e[n++]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|r;e[n--]=255&a,n>=0&&(e[n--]=a>>8&255),n>=0&&(e[n--]=a>>16&255),6===o?(n>=0&&(e[n--]=a>>24&255),r=0,o=0):(r=a>>>24,o+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,o=0;o<r.length;o++)t=(0|n.words[o])+(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<n.length;o++)t=(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this