diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 7d8b743..9c01ead 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -1 +1 @@ -!function(){var e={274:function(e,t,r){"use strict";var n,o=(n=r(521))&&n.__esModule?n:{default:n};window.document.addEventListener("DOMContentLoaded",(()=>{(0,o.default)()}))},521:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(648)),o=a(r(919)),i=a(r(599));function a(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{n.default.component.registerMany({TOTPRegister:i.default,TOTPVerify:o.default})}},599:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var n,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,r&&r.set(e,n);return n}(r(294)),i=(n=r(697))&&n.__esModule?n:{default:n},a=r(59),s=r(661),l=r(648);function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}const c="SCAN_CODE",f="VALIDATE_CODE";class d extends o.Component{constructor(e){super(e),this.state={error:e.error,view:e.error?f:c},this.handleBack=this.handleBack.bind(this),this.handleBackToScan=this.handleBackToScan.bind(this),this.handleNext=this.handleNext.bind(this)}handleBack(){this.props.onBack()}handleBackToScan(){this.setState({view:c,error:null})}handleNext(){this.setState({view:f})}renderActionsMenu(){const{ss:{i18n:e}}=window;return o.default.createElement("ul",{className:"mfa-action-list"},o.default.createElement("li",{className:"mfa-action-list__item"},o.default.createElement("button",{type:"button",className:"btn btn-primary",onClick:this.handleNext},e._t("TOTPRegister.NEXT","Next"))),o.default.createElement("li",{className:"mfa-action-list__item"},o.default.createElement("button",{type:"button",className:"btn btn-secondary",onClick:this.handleBack},e._t("TOTPRegister.BACK","Back"))))}renderErrorScreen(){const{errors:e}=this.props;return e.length?o.default.createElement("div",{className:"mfa-totp__errors"},e.join(", ")):null}renderScanCodeScreen(){const{uri:e,code:t,errors:r}=this.props,{view:n}=this.state,{ss:{i18n:i}}=window;if(n!==c||r.length)return null;const l=(0,s.formatCode)(t);return o.default.createElement("div",null,o.default.createElement("div",{className:"mfa-totp__scan"},o.default.createElement("p",null,i._t("TOTPRegister.INTRO","Verification codes are created by an app on your phone. "),this.renderSupportLink()),o.default.createElement("div",{className:"mfa-totp__scan-code"},o.default.createElement("div",{className:"mfa-totp__scan-left"},o.default.createElement(a.QRCodeSVG,{value:e,size:160})),o.default.createElement("div",{className:"mfa-totp__scan-middle"},i._t("TOTPRegister.OR","Or")),o.default.createElement("div",{className:"mfa-totp__scan-right"},o.default.createElement("p",null,i._t("TOTPRegister.MANUAL","Enter manually the following code into authentication app:")),o.default.createElement("p",{className:"mfa-totp__manual-code"},l)))),this.renderActionsMenu())}renderSupportLink(){const{method:{supportLink:e,supportText:t}}=this.props,{ss:{i18n:r}}=window;return e?o.default.createElement("a",{href:e,target:"_blank",rel:"noopener noreferrer"},t||r._t("TOTPRegister.HOW_TO_USE","How to use authenticator apps.")):null}renderBackButtonForVerify(){const{ss:{i18n:e}}=window;return o.default.createElement("button",{type:"button",className:"mfa-actions__action mfa-actions__action--back btn btn-secondary",onClick:this.handleBackToScan},e._t("TOTPRegister.BACK","Back"))}renderValidateCodeScreen(){const{error:e,view:t}=this.state,{TOTPVerifyComponent:r,onCompleteRegistration:n,errors:i}=this.props;if(t!==f||i.length)return null;const a={...this.props,error:e,moreOptionsControl:this.renderBackButtonForVerify(),onCompleteVerification:n,onCompleteRegistration:null};return o.default.createElement(r,a)}render(){return o.default.createElement("div",{className:"mfa-totp__container mfa-totp__container--register"},this.renderErrorScreen(),this.renderScanCodeScreen(),this.renderValidateCodeScreen())}}t.Component=d,d.propTypes={code:i.default.string.isRequired,onBack:i.default.func.isRequired,onCompleteRegistration:i.default.func.isRequired,errors:i.default.arrayOf(i.default.string),method:i.default.object.isRequired,uri:i.default.string.isRequired,TOTPVerifyComponent:i.default.oneOfType([i.default.node,i.default.func]).isRequired},d.defaultProps={code:"",errors:[]},d.displayName="TOTPRegister";var h=(0,l.inject)(["TOTPVerify"],(e=>({TOTPVerifyComponent:e})),(()=>"MFA.Register"))(d);t.default=h},919:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,r&&r.set(e,n);return n}(r(294)),o=a(r(697)),i=a(r(184));function a(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}class l extends n.Component{constructor(e){super(e),this.state={code:""},this.codeInput=null,this.setCodeInput=e=>{this.codeInput=e},this.handleChangeCode=this.handleChangeCode.bind(this),this.handleInputKeyUp=this.handleInputKeyUp.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}componentDidMount(){this.codeInput&&this.codeInput.focus()}handleChangeCode(e){this.setState({code:e.target.value})}handleInputKeyUp(e){this.canSubmit()&&13===e.keyCode&&this.handleSubmit()}handleSubmit(){this.props.onCompleteVerification({code:this.state.code})}canSubmit(){return this.state.code.length===this.props.codeLength}renderActionsMenu(){const{moreOptionsControl:e}=this.props,{ss:{i18n:t}}=window,r=!this.canSubmit();return n.default.createElement("ul",{className:"mfa-action-list"},n.default.createElement("li",{className:"mfa-action-list__item"},n.default.createElement("button",{type:"button",className:"btn btn-primary",disabled:r,onClick:this.handleSubmit},t._t("TOTPVerify.NEXT","Next"))),e&&n.default.createElement("li",{className:"mfa-action-list__item"},e))}renderSupportLink(){const{method:{supportLink:e,supportText:t}}=this.props,{ss:{i18n:r}}=window;return e?n.default.createElement("a",{href:e,target:"_blank",rel:"noopener noreferrer"},t||r._t("TOTPVerify.HOW_TO_USE","How to use authenticator apps.")):null}renderVerifyForm(){const{code:e}=this.state,{codeLength:t,error:r,method:o}=this.props,{ss:{i18n:a}}=window,s=(0,i.default)("mfa-totp__validate-left",{"has-error":!!r});return n.default.createElement("div",{className:"mfa-totp__validate-code"},n.default.createElement("div",{className:s},n.default.createElement("p",null,a._t("TOTPVerify.VERIFY","Use verification code from your authenticator app. "),this.renderSupportLink()),n.default.createElement("label",{htmlFor:"totp-code",className:"control-label"},a.inject(a._t("TOTPVerify.ENTER_CODE","Enter {length}-digit code"),{length:t})),n.default.createElement("input",{id:"totp-code",name:"code",type:"text",autoComplete:"off",maxLength:t,className:"mfa-totp__code text form-control input-lg",value:e,ref:this.setCodeInput,onChange:this.handleChangeCode,onKeyUp:this.handleInputKeyUp}),r&&n.default.createElement("div",{className:"help-block"},r)),o.thumbnail&&n.default.createElement("div",{className:"mfa-totp__validate-right"},n.default.createElement("img",{src:o.thumbnail,alt:o.name,className:"mfa-totp__validate-img"})))}render(){return n.default.createElement("div",{className:"mfa-totp__container mfa-totp__container--verify"},this.renderVerifyForm(),this.renderActionsMenu())}}l.propTypes={codeLength:o.default.number,error:o.default.string,onCompleteVerification:o.default.func.isRequired,method:o.default.object.isRequired},l.defaultProps={codeLength:6,error:null},l.displayName="TOTPVerify";var u=l;t.default=u},661:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatCode=void 0;t.formatCode=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";if(e.length<6)return e;if(e.length%4==0)return e.split(/(.{4})/g).filter((e=>e)).join(t).trim();if(e.length%3==0)return e.split(/(.{3})/g).filter((e=>e)).join(t).trim();const r=4-e.length%4,n=(e.length-3*r)/4,o=[...[...Array(n).keys()].map((()=>4)),...[...Array(r).keys()].map((()=>3))];let i=0;return o.map((t=>e.substring(i,i+=t))).join(t).trim()}},184:function(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;tt in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c=(e,t)=>{for(var r in t||(t={}))s.call(t,r)&&u(e,r,t[r]);if(a)for(var r of a(t))l.call(t,r)&&u(e,r,t[r]);return e},f=(e,t)=>{var r={};for(var n in e)s.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&a)for(var n of a(e))t.indexOf(n)<0&&l.call(e,n)&&(r[n]=e[n]);return r};(e=>{const t=class{constructor(e,r,n,o){if(this.version=e,this.errorCorrectionLevel=r,this.modules=[],this.isFunction=[],et.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let a=[];for(let e=0;e7)throw new RangeError("Invalid value");let c,f;for(c=o;;c++){const n=8*t.getNumDataCodewords(c,r),o=s.getTotalBits(e,c);if(o<=n){f=o;break}if(c>=a)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])u&&f<=8*t.getNumDataCodewords(c,e)&&(r=e);let d=[];for(const t of e){n(t.mode.modeBits,4,d),n(t.numChars,t.mode.numCharCountBits(c),d);for(const e of t.getData())d.push(e)}i(d.length==f);const h=8*t.getNumDataCodewords(c,r);i(d.length<=h),n(0,Math.min(4,h-d.length),d),n(0,(8-d.length%8)%8,d),i(d.length%8==0);for(let e=236;d.lengthp[t>>>3]|=e<<7-(7&t))),new t(c,r,p,l)}getModule(e,t){return 0<=e&&e>>9);const n=21522^(t<<10|r);i(n>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,o(n,e));this.setFunctionModule(8,7,o(n,6)),this.setFunctionModule(8,8,o(n,7)),this.setFunctionModule(7,8,o(n,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,o(n,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,o(n,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,o(n,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){const r=o(t,e),n=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(n,i,r),this.setFunctionModule(i,n,r)}}drawFinderPattern(e,t){for(let r=-4;r<=4;r++)for(let n=-4;n<=4;n++){const o=Math.max(Math.abs(n),Math.abs(r)),i=e+n,a=t+r;0<=i&&i{(e!=u-a||r>=l)&&d.push(t[e])}));return i(d.length==s),d}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let r=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let n=0;n>>3],7-(7&r)),r++)}}i(r==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t5&&e++):(this.finderPenaltyAddHistory(o,i),n||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),n=this.modules[r][a],o=1);e+=this.finderPenaltyTerminateAndCount(n,o,i)*t.PENALTY_N3}for(let r=0;r5&&e++):(this.finderPenaltyAddHistory(o,i),n||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),n=this.modules[a][r],o=1);e+=this.finderPenaltyTerminateAndCount(n,o,i)*t.PENALTY_N3}for(let r=0;re+(t?1:0)),r);const n=this.size*this.size,o=Math.ceil(Math.abs(20*r-10*n)/n)-1;return i(0<=o&&o<=9),e+=o*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let r=[6];for(let n=this.size-7;r.lengtht.MAX_VERSION)throw new RangeError("Version number out of range");let r=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;r-=(25*t-10)*t-55,e>=7&&(r-=36)}return i(208<=r&&r<=29648),r}static getNumDataCodewords(e,r){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let r=[];for(let t=0;t0));for(const o of e){const e=o^n.shift();n.push(0),r.forEach(((r,o)=>n[o]^=t.reedSolomonMultiply(r,e)))}return n}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let r=0;for(let n=7;n>=0;n--)r=r<<1^285*(r>>>7),r^=(t>>>n&1)*e;return i(r>>>8==0),r}finderPenaltyCountPatterns(e){const t=e[1];i(t<=3*this.size);const r=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(r&&e[0]>=4*t&&e[6]>=t?1:0)+(r&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let r=t;function n(e,t,r){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let n=t-1;n>=0;n--)r.push(e>>>n&1)}function o(e,t){return 0!=(e>>>t&1)}function i(e){if(!e)throw new Error("Assertion error")}r.MIN_VERSION=1,r.MAX_VERSION=40,r.PENALTY_N1=3,r.PENALTY_N2=3,r.PENALTY_N3=40,r.PENALTY_N4=10,r.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],r.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=r;const a=class{constructor(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(e){let t=[];for(const r of e)n(r,8,t);return new a(a.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!a.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let r=0;r=1<{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let r=t;r.LOW=new t(0,1),r.MEDIUM=new t(1,0),r.QUARTILE=new t(2,3),r.HIGH=new t(3,2),e.Ecc=r})(t=e.QrCode||(e.QrCode={}))})(n||(n={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let r=t;r.NUMERIC=new t(1,[10,12,14]),r.ALPHANUMERIC=new t(2,[9,11,13]),r.BYTE=new t(4,[8,16,16]),r.KANJI=new t(8,[8,10,12]),r.ECI=new t(7,[0,0,0]),e.Mode=r})(t=e.QrSegment||(e.QrSegment={}))})(n||(n={}));var d=n,h={L:d.QrCode.Ecc.LOW,M:d.QrCode.Ecc.MEDIUM,Q:d.QrCode.Ecc.QUARTILE,H:d.QrCode.Ecc.HIGH},p=128,m="L",y="#FFFFFF",g="#000000",E=!1,_=4,v=.1;function C(e,t=0){const r=[];return e.forEach((function(e,n){let o=null;e.forEach((function(i,a){if(!i&&null!==o)return r.push(`M${o+t} ${n+t}h${a-o}v1H${o+t}z`),void(o=null);if(a!==e.length-1)i&&null===o&&(o=a);else{if(!i)return;null===o?r.push(`M${a+t},${n+t} h1v1H${a+t}z`):r.push(`M${o+t},${n+t} h${a+1-o}v1H${o+t}z`)}}))})),r.join("")}function w(e,t){return e.slice().map(((e,r)=>r=t.y+t.h?e:e.map(((e,r)=>(r=t.x+t.w)&&e))))}function b(e,t,r,n){if(null==n)return null;const o=r?_:0,i=e.length+2*o,a=Math.floor(t*v),s=i/t,l=(n.width||a)*s,u=(n.height||a)*s,c=null==n.x?e.length/2-l/2:n.x*s,f=null==n.y?e.length/2-u/2:n.y*s;let d=null;if(n.excavate){let e=Math.floor(c),t=Math.floor(f);d={x:e,y:t,w:Math.ceil(l+c-e),h:Math.ceil(u+f-t)}}return{x:c,y:f,h:u,w:l,excavation:d}}var R=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function M(e){const t=e,{value:r,size:n=p,level:i=m,bgColor:a=y,fgColor:s=g,includeMargin:l=E,style:u,imageSettings:v}=t,M=f(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),S=null==v?void 0:v.src,O=(0,o.useRef)(null),P=(0,o.useRef)(null),[N,T]=(0,o.useState)(!1);(0,o.useEffect)((()=>{if(null!=O.current){const e=O.current,t=e.getContext("2d");if(!t)return;let o=d.QrCode.encodeText(r,h[i]).getModules();const u=l?_:0,c=o.length+2*u,f=b(o,n,l,v),p=P.current,m=null!=f&&null!==p&&p.complete&&0!==p.naturalHeight&&0!==p.naturalWidth;m&&null!=f.excavation&&(o=w(o,f.excavation));const y=window.devicePixelRatio||1;e.height=e.width=n*y;const g=n/c*y;t.scale(g,g),t.fillStyle=a,t.fillRect(0,0,c,c),t.fillStyle=s,R?t.fill(new Path2D(C(o,u))):o.forEach((function(e,r){e.forEach((function(e,n){e&&t.fillRect(n+u,r+u,1,1)}))})),m&&t.drawImage(p,f.x+u,f.y+u,f.w,f.h)}})),(0,o.useEffect)((()=>{T(!1)}),[S]);const A=c({height:n,width:n},u);let k=null;return null!=S&&(k=o.createElement("img",{src:S,key:S,style:{display:"none"},onLoad:()=>{T(!0)},ref:P})),o.createElement(o.Fragment,null,o.createElement("canvas",c({style:A,height:n,width:n,ref:O},M)),k)}function S(e){const t=e,{value:r,size:n=p,level:i=m,bgColor:a=y,fgColor:s=g,includeMargin:l=E,imageSettings:u}=t,v=f(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let R=d.QrCode.encodeText(r,h[i]).getModules();const M=l?_:0,S=R.length+2*M,O=b(R,n,l,u);let P=null;null!=u&&null!=O&&(null!=O.excavation&&(R=w(R,O.excavation)),P=o.createElement("image",{xlinkHref:u.src,height:O.h,width:O.w,x:O.x+M,y:O.y+M,preserveAspectRatio:"none"}));const N=C(R,M);return o.createElement("svg",c({height:n,width:n,viewBox:`0 0 ${S} ${S}`},v),o.createElement("path",{fill:a,d:`M0,0 h${S}v${S}H0z`,shapeRendering:"crispEdges"}),o.createElement("path",{fill:s,d:N,shapeRendering:"crispEdges"}),P)}var O=e=>{const t=e,{renderAs:r}=t,n=f(t,["renderAs"]);return"svg"===r?o.createElement(S,c({},n)):o.createElement(M,c({},n))}},408:function(e,t){"use strict";var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,y={};function g(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||p}function E(){}function _(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||p}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},E.prototype=g.prototype;var v=_.prototype=new E;v.constructor=_,m(v,g.prototype),v.isPureReactComponent=!0;var C=Array.isArray,w=Object.prototype.hasOwnProperty,b={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function M(e,t,n){var o,i={},a=null,s=null;if(null!=t)for(o in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)w.call(t,o)&&!R.hasOwnProperty(o)&&(i[o]=t[o]);var l=arguments.length-2;if(1===l)i.children=n;else if(1{(0,o.default)()}))},521:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=a(r(648)),o=a(r(919)),i=a(r(599));function a(e){return e&&e.__esModule?e:{default:e}}t.default=()=>{n.default.component.registerMany({TOTPRegister:i.default,TOTPVerify:o.default})}},599:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.Component=void 0;var n,o=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,r&&r.set(e,n);return n}(r(294)),i=(n=r(697))&&n.__esModule?n:{default:n},a=r(59),s=r(661),l=r(648);function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}const c="SCAN_CODE",f="VALIDATE_CODE";class d extends o.Component{constructor(e){super(e),this.state={error:e.error,view:e.error?f:c},this.handleBack=this.handleBack.bind(this),this.handleBackToScan=this.handleBackToScan.bind(this),this.handleNext=this.handleNext.bind(this)}handleBack(){this.props.onBack()}handleBackToScan(){this.setState({view:c,error:null})}handleNext(){this.setState({view:f})}renderActionsMenu(){const{ss:{i18n:e}}=window;return o.default.createElement("ul",{className:"mfa-action-list"},o.default.createElement("li",{className:"mfa-action-list__item"},o.default.createElement("button",{type:"button",className:"btn btn-primary",onClick:this.handleNext},e._t("TOTPRegister.NEXT","Next"))),o.default.createElement("li",{className:"mfa-action-list__item"},o.default.createElement("button",{type:"button",className:"btn btn-secondary",onClick:this.handleBack},e._t("TOTPRegister.BACK","Back"))))}renderErrorScreen(){const{errors:e}=this.props;return e.length?o.default.createElement("div",{className:"mfa-totp__errors"},e.join(", ")):null}renderScanCodeScreen(){const{uri:e,code:t,errors:r}=this.props,{view:n}=this.state,{ss:{i18n:i}}=window;if(n!==c||r.length)return null;const l=(0,s.formatCode)(t);return o.default.createElement("div",null,o.default.createElement("div",{className:"mfa-totp__scan"},o.default.createElement("p",null,i._t("TOTPRegister.INTRO","Verification codes are created by an app on your phone. "),this.renderSupportLink()),o.default.createElement("div",{className:"mfa-totp__scan-code"},o.default.createElement("div",{className:"mfa-totp__scan-left"},o.default.createElement(a.QRCodeSVG,{value:e,size:160})),o.default.createElement("div",{className:"mfa-totp__scan-middle"},i._t("TOTPRegister.OR","Or")),o.default.createElement("div",{className:"mfa-totp__scan-right"},o.default.createElement("p",null,i._t("TOTPRegister.MANUAL","Enter manually the following code into authentication app:")),o.default.createElement("p",{className:"mfa-totp__manual-code"},l)))),this.renderActionsMenu())}renderSupportLink(){const{method:{supportLink:e,supportText:t}}=this.props,{ss:{i18n:r}}=window;return e?o.default.createElement("a",{href:e,target:"_blank",rel:"noopener noreferrer"},t||r._t("TOTPRegister.HOW_TO_USE","How to use authenticator apps.")):null}renderBackButtonForVerify(){const{ss:{i18n:e}}=window;return o.default.createElement("button",{type:"button",className:"mfa-actions__action mfa-actions__action--back btn btn-secondary",onClick:this.handleBackToScan},e._t("TOTPRegister.BACK","Back"))}renderValidateCodeScreen(){const{error:e,view:t}=this.state,{TOTPVerifyComponent:r,onCompleteRegistration:n,errors:i}=this.props;if(t!==f||i.length)return null;const a={...this.props,error:e,moreOptionsControl:this.renderBackButtonForVerify(),onCompleteVerification:n,onCompleteRegistration:null};return o.default.createElement(r,a)}render(){return o.default.createElement("div",{className:"mfa-totp__container mfa-totp__container--register"},this.renderErrorScreen(),this.renderScanCodeScreen(),this.renderValidateCodeScreen())}}t.Component=d,d.propTypes={code:i.default.string.isRequired,onBack:i.default.func.isRequired,onCompleteRegistration:i.default.func.isRequired,errors:i.default.arrayOf(i.default.string),method:i.default.object.isRequired,uri:i.default.string.isRequired,TOTPVerifyComponent:i.default.oneOfType([i.default.node,i.default.func]).isRequired},d.defaultProps={code:"",errors:[]},d.displayName="TOTPRegister";t.default=(0,l.inject)(["TOTPVerify"],(e=>({TOTPVerifyComponent:e})),(()=>"MFA.Register"))(d)},919:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var a=o?Object.getOwnPropertyDescriptor(e,i):null;a&&(a.get||a.set)?Object.defineProperty(n,i,a):n[i]=e[i]}n.default=e,r&&r.set(e,n);return n}(r(294)),o=a(r(697)),i=a(r(184));function a(e){return e&&e.__esModule?e:{default:e}}function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}class l extends n.Component{constructor(e){super(e),this.state={code:""},this.codeInput=null,this.setCodeInput=e=>{this.codeInput=e},this.handleChangeCode=this.handleChangeCode.bind(this),this.handleInputKeyUp=this.handleInputKeyUp.bind(this),this.handleSubmit=this.handleSubmit.bind(this)}componentDidMount(){this.codeInput&&this.codeInput.focus()}handleChangeCode(e){this.setState({code:e.target.value})}handleInputKeyUp(e){this.canSubmit()&&13===e.keyCode&&this.handleSubmit()}handleSubmit(){this.props.onCompleteVerification({code:this.state.code})}canSubmit(){return this.state.code.length===this.props.codeLength}renderActionsMenu(){const{moreOptionsControl:e}=this.props,{ss:{i18n:t}}=window,r=!this.canSubmit();return n.default.createElement("ul",{className:"mfa-action-list"},n.default.createElement("li",{className:"mfa-action-list__item"},n.default.createElement("button",{type:"button",className:"btn btn-primary",disabled:r,onClick:this.handleSubmit},t._t("TOTPVerify.NEXT","Next"))),e&&n.default.createElement("li",{className:"mfa-action-list__item"},e))}renderSupportLink(){const{method:{supportLink:e,supportText:t}}=this.props,{ss:{i18n:r}}=window;return e?n.default.createElement("a",{href:e,target:"_blank",rel:"noopener noreferrer"},t||r._t("TOTPVerify.HOW_TO_USE","How to use authenticator apps.")):null}renderVerifyForm(){const{code:e}=this.state,{codeLength:t,error:r,method:o}=this.props,{ss:{i18n:a}}=window,s=(0,i.default)("mfa-totp__validate-left",{"has-error":!!r});return n.default.createElement("div",{className:"mfa-totp__validate-code"},n.default.createElement("div",{className:s},n.default.createElement("p",null,a._t("TOTPVerify.VERIFY","Use verification code from your authenticator app. "),this.renderSupportLink()),n.default.createElement("label",{htmlFor:"totp-code",className:"control-label"},a.inject(a._t("TOTPVerify.ENTER_CODE","Enter {length}-digit code"),{length:t})),n.default.createElement("input",{id:"totp-code",name:"code",type:"text",autoComplete:"off",maxLength:t,className:"mfa-totp__code text form-control input-lg",value:e,ref:this.setCodeInput,onChange:this.handleChangeCode,onKeyUp:this.handleInputKeyUp}),r&&n.default.createElement("div",{className:"help-block"},r)),o.thumbnail&&n.default.createElement("div",{className:"mfa-totp__validate-right"},n.default.createElement("img",{src:o.thumbnail,alt:o.name,className:"mfa-totp__validate-img"})))}render(){return n.default.createElement("div",{className:"mfa-totp__container mfa-totp__container--verify"},this.renderVerifyForm(),this.renderActionsMenu())}}l.propTypes={codeLength:o.default.number,error:o.default.string,onCompleteVerification:o.default.func.isRequired,method:o.default.object.isRequired},l.defaultProps={codeLength:6,error:null},l.displayName="TOTPVerify";t.default=l},661:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatCode=void 0;t.formatCode=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:" ";if(e.length<6)return e;if(e.length%4==0)return e.split(/(.{4})/g).filter((e=>e)).join(t).trim();if(e.length%3==0)return e.split(/(.{3})/g).filter((e=>e)).join(t).trim();const r=4-e.length%4,n=(e.length-3*r)/4,o=[...[...Array(n).keys()].map((()=>4)),...[...Array(r).keys()].map((()=>3))];let i=0;return o.map((t=>e.substring(i,i+=t))).join(t).trim()}},184:function(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function o(){for(var e=[],t=0;tt in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c=(e,t)=>{for(var r in t||(t={}))s.call(t,r)&&u(e,r,t[r]);if(a)for(var r of a(t))l.call(t,r)&&u(e,r,t[r]);return e},f=(e,t)=>{var r={};for(var n in e)s.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&a)for(var n of a(e))t.indexOf(n)<0&&l.call(e,n)&&(r[n]=e[n]);return r};(e=>{const t=class{constructor(e,r,n,o){if(this.version=e,this.errorCorrectionLevel=r,this.modules=[],this.isFunction=[],et.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let a=[];for(let e=0;e7)throw new RangeError("Invalid value");let c,f;for(c=o;;c++){const n=8*t.getNumDataCodewords(c,r),o=s.getTotalBits(e,c);if(o<=n){f=o;break}if(c>=a)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])u&&f<=8*t.getNumDataCodewords(c,e)&&(r=e);let d=[];for(const t of e){n(t.mode.modeBits,4,d),n(t.numChars,t.mode.numCharCountBits(c),d);for(const e of t.getData())d.push(e)}i(d.length==f);const h=8*t.getNumDataCodewords(c,r);i(d.length<=h),n(0,Math.min(4,h-d.length),d),n(0,(8-d.length%8)%8,d),i(d.length%8==0);for(let e=236;d.lengthp[t>>>3]|=e<<7-(7&t))),new t(c,r,p,l)}getModule(e,t){return 0<=e&&e>>9);const n=21522^(t<<10|r);i(n>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,o(n,e));this.setFunctionModule(8,7,o(n,6)),this.setFunctionModule(8,8,o(n,7)),this.setFunctionModule(7,8,o(n,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,o(n,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,o(n,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,o(n,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;i(t>>>18==0);for(let e=0;e<18;e++){const r=o(t,e),n=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(n,i,r),this.setFunctionModule(i,n,r)}}drawFinderPattern(e,t){for(let r=-4;r<=4;r++)for(let n=-4;n<=4;n++){const o=Math.max(Math.abs(n),Math.abs(r)),i=e+n,a=t+r;0<=i&&i{(e!=u-a||r>=l)&&d.push(t[e])}));return i(d.length==s),d}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let r=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let n=0;n>>3],7-(7&r)),r++)}}i(r==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t5&&e++):(this.finderPenaltyAddHistory(o,i),n||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),n=this.modules[r][a],o=1);e+=this.finderPenaltyTerminateAndCount(n,o,i)*t.PENALTY_N3}for(let r=0;r5&&e++):(this.finderPenaltyAddHistory(o,i),n||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),n=this.modules[a][r],o=1);e+=this.finderPenaltyTerminateAndCount(n,o,i)*t.PENALTY_N3}for(let r=0;re+(t?1:0)),r);const n=this.size*this.size,o=Math.ceil(Math.abs(20*r-10*n)/n)-1;return i(0<=o&&o<=9),e+=o*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let r=[6];for(let n=this.size-7;r.lengtht.MAX_VERSION)throw new RangeError("Version number out of range");let r=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;r-=(25*t-10)*t-55,e>=7&&(r-=36)}return i(208<=r&&r<=29648),r}static getNumDataCodewords(e,r){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let r=[];for(let t=0;t0));for(const o of e){const e=o^n.shift();n.push(0),r.forEach(((r,o)=>n[o]^=t.reedSolomonMultiply(r,e)))}return n}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let r=0;for(let n=7;n>=0;n--)r=r<<1^285*(r>>>7),r^=(t>>>n&1)*e;return i(r>>>8==0),r}finderPenaltyCountPatterns(e){const t=e[1];i(t<=3*this.size);const r=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(r&&e[0]>=4*t&&e[6]>=t?1:0)+(r&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,r){return e&&(this.finderPenaltyAddHistory(t,r),t=0),t+=this.size,this.finderPenaltyAddHistory(t,r),this.finderPenaltyCountPatterns(r)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let r=t;function n(e,t,r){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let n=t-1;n>=0;n--)r.push(e>>>n&1)}function o(e,t){return 0!=(e>>>t&1)}function i(e){if(!e)throw new Error("Assertion error")}r.MIN_VERSION=1,r.MAX_VERSION=40,r.PENALTY_N1=3,r.PENALTY_N2=3,r.PENALTY_N3=40,r.PENALTY_N4=10,r.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],r.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=r;const a=class{constructor(e,t,r){if(this.mode=e,this.numChars=t,this.bitData=r,t<0)throw new RangeError("Invalid argument");this.bitData=r.slice()}static makeBytes(e){let t=[];for(const r of e)n(r,8,t);return new a(a.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!a.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let r=0;r=1<{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let r=t;r.LOW=new t(0,1),r.MEDIUM=new t(1,0),r.QUARTILE=new t(2,3),r.HIGH=new t(3,2),e.Ecc=r})(t=e.QrCode||(e.QrCode={}))})(n||(n={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let r=t;r.NUMERIC=new t(1,[10,12,14]),r.ALPHANUMERIC=new t(2,[9,11,13]),r.BYTE=new t(4,[8,16,16]),r.KANJI=new t(8,[8,10,12]),r.ECI=new t(7,[0,0,0]),e.Mode=r})(t=e.QrSegment||(e.QrSegment={}))})(n||(n={}));var d=n,h={L:d.QrCode.Ecc.LOW,M:d.QrCode.Ecc.MEDIUM,Q:d.QrCode.Ecc.QUARTILE,H:d.QrCode.Ecc.HIGH},p=128,m="L",y="#FFFFFF",g="#000000",E=!1,_=4,v=.1;function C(e,t=0){const r=[];return e.forEach((function(e,n){let o=null;e.forEach((function(i,a){if(!i&&null!==o)return r.push(`M${o+t} ${n+t}h${a-o}v1H${o+t}z`),void(o=null);if(a!==e.length-1)i&&null===o&&(o=a);else{if(!i)return;null===o?r.push(`M${a+t},${n+t} h1v1H${a+t}z`):r.push(`M${o+t},${n+t} h${a+1-o}v1H${o+t}z`)}}))})),r.join("")}function w(e,t){return e.slice().map(((e,r)=>r=t.y+t.h?e:e.map(((e,r)=>(r=t.x+t.w)&&e))))}function b(e,t,r,n){if(null==n)return null;const o=r?_:0,i=e.length+2*o,a=Math.floor(t*v),s=i/t,l=(n.width||a)*s,u=(n.height||a)*s,c=null==n.x?e.length/2-l/2:n.x*s,f=null==n.y?e.length/2-u/2:n.y*s;let d=null;if(n.excavate){let e=Math.floor(c),t=Math.floor(f);d={x:e,y:t,w:Math.ceil(l+c-e),h:Math.ceil(u+f-t)}}return{x:c,y:f,h:u,w:l,excavation:d}}var R=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function M(e){const t=e,{value:r,size:n=p,level:i=m,bgColor:a=y,fgColor:s=g,includeMargin:l=E,style:u,imageSettings:v}=t,M=f(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),S=null==v?void 0:v.src,O=(0,o.useRef)(null),P=(0,o.useRef)(null),[N,T]=(0,o.useState)(!1);(0,o.useEffect)((()=>{if(null!=O.current){const e=O.current,t=e.getContext("2d");if(!t)return;let o=d.QrCode.encodeText(r,h[i]).getModules();const u=l?_:0,c=o.length+2*u,f=b(o,n,l,v),p=P.current,m=null!=f&&null!==p&&p.complete&&0!==p.naturalHeight&&0!==p.naturalWidth;m&&null!=f.excavation&&(o=w(o,f.excavation));const y=window.devicePixelRatio||1;e.height=e.width=n*y;const g=n/c*y;t.scale(g,g),t.fillStyle=a,t.fillRect(0,0,c,c),t.fillStyle=s,R?t.fill(new Path2D(C(o,u))):o.forEach((function(e,r){e.forEach((function(e,n){e&&t.fillRect(n+u,r+u,1,1)}))})),m&&t.drawImage(p,f.x+u,f.y+u,f.w,f.h)}})),(0,o.useEffect)((()=>{T(!1)}),[S]);const A=c({height:n,width:n},u);let k=null;return null!=S&&(k=o.createElement("img",{src:S,key:S,style:{display:"none"},onLoad:()=>{T(!0)},ref:P})),o.createElement(o.Fragment,null,o.createElement("canvas",c({style:A,height:n,width:n,ref:O},M)),k)}function S(e){const t=e,{value:r,size:n=p,level:i=m,bgColor:a=y,fgColor:s=g,includeMargin:l=E,imageSettings:u}=t,v=f(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let R=d.QrCode.encodeText(r,h[i]).getModules();const M=l?_:0,S=R.length+2*M,O=b(R,n,l,u);let P=null;null!=u&&null!=O&&(null!=O.excavation&&(R=w(R,O.excavation)),P=o.createElement("image",{xlinkHref:u.src,height:O.h,width:O.w,x:O.x+M,y:O.y+M,preserveAspectRatio:"none"}));const N=C(R,M);return o.createElement("svg",c({height:n,width:n,viewBox:`0 0 ${S} ${S}`},v),o.createElement("path",{fill:a,d:`M0,0 h${S}v${S}H0z`,shapeRendering:"crispEdges"}),o.createElement("path",{fill:s,d:N,shapeRendering:"crispEdges"}),P)}var O=e=>{const t=e,{renderAs:r}=t,n=f(t,["renderAs"]);return"svg"===r?o.createElement(S,c({},n)):o.createElement(M,c({},n))}},408:function(e,t){"use strict";var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,y={};function g(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||p}function E(){}function _(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||p}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},E.prototype=g.prototype;var v=_.prototype=new E;v.constructor=_,m(v,g.prototype),v.isPureReactComponent=!0;var C=Array.isArray,w=Object.prototype.hasOwnProperty,b={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function M(e,t,n){var o,i={},a=null,s=null;if(null!=t)for(o in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)w.call(t,o)&&!R.hasOwnProperty(o)&&(i[o]=t[o]);var l=arguments.length-2;if(1===l)i.children=n;else if(1=3.0.0 <4.0.0" immutable "^4.0.0" @@ -7198,6 +7264,15 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +set-function-name@^2.0.0, set-function-name@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.1.tgz#12ce38b7954310b9f61faa12701620a0c882793a" + integrity sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== + dependencies: + define-data-property "^1.0.1" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.0" + shallow-clone@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" @@ -7241,14 +7316,14 @@ signal-exit@^4.0.1: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== -sirv@^1.0.7: - version "1.0.19" - resolved "https://registry.yarnpkg.com/sirv/-/sirv-1.0.19.tgz#1d73979b38c7fe91fcba49c85280daa9c2363b49" - integrity sha512-JuLThK3TnZG1TAKDwNIqNq6QA2afLOCcm+iE8D1Kj3GA40pSPsxQjjJl0J8X3tsR7T+CP1GavpzLwYkgVLWrZQ== +sirv@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/sirv/-/sirv-2.0.3.tgz#ca5868b87205a74bef62a469ed0296abceccd446" + integrity sha512-O9jm9BsID1P+0HOi81VpXPoDxYP374pkOLzACAoyUQ/3OUVndNpsz6wMnY2z+yOxzbllCKZrM+9QrWsv4THnyA== dependencies: "@polka/url" "^1.0.0-next.20" mrmime "^1.0.0" - totalist "^1.0.0" + totalist "^3.0.0" sisteransi@^1.0.5: version "1.0.5" @@ -7340,9 +7415,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.13" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz#7189a474c46f8d47c7b0da4b987bb45e908bd2d5" - integrity sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w== + version "3.0.15" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.15.tgz#142460aabaca062bc7cd4cc87b7d50725ed6a4ba" + integrity sha512-lpT8hSQp9jAKp9mhtBU4Xjon8LPGBvLIuBiSVhMEtmLecTh2mO0tlqrAMp47tBXzMr13NJMQ2lf7RpQGLJ3HsQ== sprintf-js@~1.0.2: version "1.0.3" @@ -7421,45 +7496,46 @@ string-width@^5.0.1, string-width@^5.1.2: strip-ansi "^7.0.1" string.prototype.matchall@^4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3" - integrity sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg== + version "4.0.10" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz#a1553eb532221d4180c51581d6072cd65d1ee100" + integrity sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" - get-intrinsic "^1.1.3" + define-properties "^1.2.0" + es-abstract "^1.22.1" + get-intrinsic "^1.2.1" has-symbols "^1.0.3" - internal-slot "^1.0.3" - regexp.prototype.flags "^1.4.3" + internal-slot "^1.0.5" + regexp.prototype.flags "^1.5.0" + set-function-name "^2.0.0" side-channel "^1.0.4" -string.prototype.trim@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz#a68352740859f6893f14ce3ef1bb3037f7a90533" - integrity sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg== +string.prototype.trim@^1.2.8: + version "1.2.8" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz#f9ac6f8af4bd55ddfa8895e6aea92a96395393bd" + integrity sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" -string.prototype.trimend@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz#c4a27fa026d979d79c04f17397f250a462944533" - integrity sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ== +string.prototype.trimend@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.7.tgz#1bb3afc5008661d73e2dc015cd4853732d6c471e" + integrity sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" -string.prototype.trimstart@^1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz#e90ab66aa8e4007d92ef591bbf3cd422c56bdcf4" - integrity sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA== +string.prototype.trimstart@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.7.tgz#d4cdb44b83a4737ffbac2d406e405d43d0184298" + integrity sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg== dependencies: call-bind "^1.0.2" - define-properties "^1.1.4" - es-abstract "^1.20.4" + define-properties "^1.2.0" + es-abstract "^1.22.1" string_decoder@^1.1.1: version "1.3.0" @@ -7587,9 +7663,9 @@ tapable@^2.1.1, tapable@^2.2.0: integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== tar@^6.1.0, tar@^6.1.11, tar@^6.1.2: - version "6.1.15" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.15.tgz#c9738b0b98845a3b344d334b8fa3041aaba53a69" - integrity sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A== + version "6.2.0" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.0.tgz#b14ce49a79cb1cd23bc9b016302dea5474493f73" + integrity sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" @@ -7610,9 +7686,9 @@ terser-webpack-plugin@^5.3.7: terser "^5.16.8" terser@^5.16.8: - version "5.19.2" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.19.2.tgz#bdb8017a9a4a8de4663a7983f45c506534f9234e" - integrity sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA== + version "5.20.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.20.0.tgz#ea42aea62578703e33def47d5c5b93c49772423e" + integrity sha512-e56ETryaQDyebBwJIWYB2TT6f2EZ0fL0sW/JRXNMN26zZdKi2u/E/5my5lG6jNxym6qsrVXfFRmOdV42zlAgLQ== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.8.2" @@ -7660,10 +7736,10 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -totalist@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/totalist/-/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df" - integrity sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g== +totalist@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/totalist/-/totalist-3.0.1.tgz#ba3a3d600c915b1a97872348f79c127475f6acf8" + integrity sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ== tough-cookie@^4.1.2: version "4.1.3" @@ -7856,10 +7932,10 @@ universalify@^0.2.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== -update-browserslist-db@^1.0.11: - version "1.0.11" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" - integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== +update-browserslist-db@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" + integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== dependencies: escalade "^3.1.1" picocolors "^1.0.0" @@ -7962,19 +8038,26 @@ webidl-conversions@^7.0.0: integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== webpack-bundle-analyzer@^4.7.0: - version "4.9.0" - resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.9.0.tgz#fc093c4ab174fd3dcbd1c30b763f56d10141209d" - integrity sha512-+bXGmO1LyiNx0i9enBu3H8mv42sj/BJWhZNFwjz92tVnBa9J3JMGo2an2IXlEleoDOPn/Hofl5hr/xCpObUDtw== + version "4.9.1" + resolved "https://registry.yarnpkg.com/webpack-bundle-analyzer/-/webpack-bundle-analyzer-4.9.1.tgz#d00bbf3f17500c10985084f22f1a2bf45cb2f09d" + integrity sha512-jnd6EoYrf9yMxCyYDPj8eutJvtjQNp8PHmni/e/ulydHBWhT5J3menXt3HEkScsu9YqMAcG4CfFjs3rj5pVU1w== dependencies: "@discoveryjs/json-ext" "0.5.7" acorn "^8.0.4" acorn-walk "^8.0.0" - chalk "^4.1.0" commander "^7.2.0" + escape-string-regexp "^4.0.0" gzip-size "^6.0.0" - lodash "^4.17.20" + is-plain-object "^5.0.0" + lodash.debounce "^4.0.8" + lodash.escape "^4.0.1" + lodash.flatten "^4.4.0" + lodash.invokemap "^4.6.0" + lodash.pullall "^4.2.0" + lodash.uniqby "^4.7.0" opener "^1.5.2" - sirv "^1.0.7" + picocolors "^1.0.0" + sirv "^2.0.3" ws "^7.3.1" webpack-cli@^5.0.0: @@ -8103,7 +8186,7 @@ which-module@^2.0.0: resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.1.tgz#776b1fe35d90aebe99e8ac15eb24093389a4a409" integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ== -which-typed-array@^1.1.10, which-typed-array@^1.1.11, which-typed-array@^1.1.9: +which-typed-array@^1.1.11, which-typed-array@^1.1.9: version "1.1.11" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.11.tgz#99d691f23c72aab6768680805a271b69761ed61a" integrity sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew== @@ -8191,9 +8274,9 @@ ws@^7.3.1: integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== ws@^8.11.0: - version "8.13.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" - integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== + version "8.14.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f" + integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g== xml-name-validator@^4.0.0: version "4.0.0" @@ -8231,9 +8314,9 @@ yallist@^4.0.0: integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== yaml@^2.1.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b" - integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ== + version "2.3.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.2.tgz#f522db4313c671a0ca963a75670f1c12ea909144" + integrity sha512-N/lyzTPaJasoDmfV7YTrYCI0G/3ivm/9wdG0aHuheKowWQwGTsK0Eoiw6utmzAnI6pkJa0DUVygvp3spqqEKXg== yargs-parser@^18.1.2: version "18.1.3"