/*! For license information please see 965.d54e5c0dc94c0b5452c2.chunk.js.LICENSE.txt */
"use strict";(self.webpackChunk_as_client=self.webpackChunk_as_client||[]).push([[965],{2965:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Te});var r=n(4041),o=n(6391),i=n(9690),a=n(1879),s=n(3578),l=n(5506),u=n(7973),c=n(738),d=n(3580),h=n(2663),m=n(7894),p=n(9078),g=n(8081),f=n(9546),A=n(994),w=n(4473),E=n(1219);var x=n(7988),C=n(7011),v=n(6557);let M,y,b,R,N,S,P,I,k,$,O,T,_,L,z,B=e=>e;const F=(0,g.Ay)(s.A)(M||(M=B`
    margin-bottom: 8px;

    color: ${0};
    font-weight: ${0};
    font-size: ${0};
    line-height: 20px;
`),d.A.neutralTextBody,C.A.medium,v.A.small),H=g.Ay.div(y||(y=B`
    position: relative;

    width: min-content;
`)),D=g.Ay.div(b||(b=B`
    display: flex;

    gap: 8px;
`)),U=(0,g.AH)(R||(R=B`
    position: relative;

    &:after {
        position: absolute;
        top: 50%;

        background-color: ${0};

        transform: translateY(-50%);

        content: '';
    }
`),d.A.neutralLight),j=(0,g.AH)(N||(N=B`
    border-color: ${0};

    box-shadow: 0px 1px 2px rgba(59, 145, 241, 0.05), 0px 0px 0px 4px rgba(59, 145, 241, 0.4);
`),d.A.neutralBorderHover),Q=(0,g.AH)(S||(S=B`
    color: ${0};
`),d.A.neutralTextPlaceholder),V=g.Ay.div(P||(P=B`
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 8px;

    color: ${0};
    font-weight: ${0};
    text-align: center;

    background-color: ${0};

    border-color: ${0};
    border-style: solid;
    border-width: 1px;

    border-radius: 8px;

    cursor: default;

    user-select: none;

    ${0}
    ${0}
    ${0}
`),d.A.neutralTextBody,C.A.medium,d.A.neutralWhite,d.A.neutralBorder,(({$divided:e})=>e&&U),(({$selected:e})=>e&&j),(({$unfilled:e})=>e&&Q)),W=(0,g.Ay)(V)((({$divided:e})=>{const t=(0,g.AH)(I||(I=B`
        margin-right: 20px;

        &:after {
            right: -20px;

            width: 10px;
            height: 2px;
        }
    `));return(0,g.AH)(k||(k=B`
        width: 32px;
        height: 32px;

        font-size: 24px;
        line-height: 32px;

        ${0}
    `),e&&t)})),Y=(0,g.Ay)(V)((({$divided:e})=>{const t=(0,g.AH)($||($=B`
        margin-right: 28px;

        &:after {
            right: -28px;

            width: 16px;
            height: 4px;
        }
    `));return(0,g.AH)(O||(O=B`
        width: 56px;
        height: 56px;

        font-size: 48px;
        line-height: 60px;
        letter-spacing: -1.92px;

        ${0}
    `),e&&t)})),G=(0,g.Ay)(V)((({$divided:e})=>{const t=(0,g.AH)(T||(T=B`
        margin-right: 36px;

        &:after {
            right: -33px;

            width: 20px;
            height: 6px;
        }
    `));return(0,g.AH)(_||(_=B`
        width: 80px;
        height: 80px;

        font-size: 60px;
        line-height: 72px;
        letter-spacing: -2.4px;

        ${0}
    `),e&&t)})),K=g.Ay.input(L||(L=B`
    position: absolute;

    width: 100%;
    height: 100%;

    opacity: 0;

    caret-color: transparent;

    &::selection {
        color: inherit;

        background: transparent;
    }

    &[aria-disabled='true'] {
        ${0} {
            color: ${0};

            background-color: ${0};
        }
    }
`),V,d.A.neutralTextPlaceholder,d.A.neutralBg),q=g.Ay.label(z||(z=B`
    display: flex;
    flex-direction: column;

    &[data-invalid='true'] {
        ${0} {
            border-color: ${0};
        }
    }
`),V,d.A.warningBaseHover);var X,Z=n(9344),J=n(1085);function ee(e){return(...t)=>e.map((e=>null==e?void 0:e(...t)))}const te=r.forwardRef((function({size:e="md",autoFocus:t=!1,disabled:n=!1,error:o=!1,pattern:i,value:a,title:s,description:l,onChange:u,onComplete:c,className:d,containerRef:h,id:m,...p},g){var C;const v=(e=>e.split("").map(((t,n)=>"-"===t?"":"-"===e[n+1]?1:0)).filter((e=>""!==e)))(i),M=v.length,y=i.split("-").join(""),[b,R]=(e=>{const[t,n]=r.useState(e);return r.useEffect((()=>{n((t=>t!==e?e:t))}),[`${e}`,n]),[t,n]})(null!=(C=a)?C:""),[N,S]=r.useState(!1),P=r.useRef(null),I=(0,E.A)(g,P);r.useEffect((()=>{var e;t&&(null==(e=I.current)||e.focus())}),[t,I,i]),r.useEffect((()=>{R("")}),[i]);const k=(e=>(0,A.YW)(e).with("sm",(()=>W)).with("md",(()=>Y)).with("lg",(()=>G)).run())(e),$=()=>{var e;null==(e=P.current)||e.focus()};return(0,J.jsxs)(q,{ref:h,"data-invalid":o||void 0,className:(0,f.A)("ovpn-number-input",d),children:[s&&(0,J.jsx)(F,{className:"ovpn-number-input-label",...(0,x.A)(m,"label"),children:s}),(0,J.jsxs)(H,{className:"ovpn-number-input-container",children:[(0,J.jsx)(K,{type:"text",onChange:e=>{const t=e.target.value.replace(/\s/g,"");RegExp(`^[0-9]{0,${M}}$`).test(t)&&(R(t),null==u||u(e),c&&(t.length===M?c(t):c("")))},value:b,ref:I,spellCheck:!1,disabled:n,min:0,max:9,maxLength:v.length,"aria-invalid":o||void 0,"aria-disabled":!!n||void 0,inputMode:"numeric",...(0,x.A)(m),...p,onFocus:ee([p.onFocus,()=>S(!0)]),onBlur:ee([p.onBlur,()=>S(!1)]),onKeyDown:ee([p.onKeyDown,e=>{["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(e.key)&&e.preventDefault()}]),onSelect:ee([p.onSelect,e=>{const{length:t}=e.target.value;e.target.setSelectionRange(t,t)}])}),(0,J.jsx)(D,{onClick:$,className:"ovpn-number-input-fields-group",children:v.map(((e,t)=>{const n=b.length<=t,r=(b.length===t||b.length===t+1&&M===t+1)&&N;return(0,J.jsx)(k,{onClick:$,$selected:r,$unfilled:n,$divided:1===e&&t!==v.length-1,className:"ovpn-number-input-field",children:b[t]||y[t]},`field-${String(t)}`)}))})]}),l&&(0,J.jsxs)(Z.Q,{error:o,success:!1,warning:!1,children:[o&&(X||(X=(0,J.jsx)(w.A,{className:"ovpn-input-description-icon"}))),(0,J.jsxs)(Z.V,{...(0,x.A)(m,"description"),children:[" ",l]})]})]})})),ne=g.Ay.div(["max-width:685px;margin:auto;text-align:center;@media (min-width:","px){max-width:1000px;}"],c.nm.LG),re=g.Ay.div(["max-width:634px;margin:auto;"]),oe=(0,g.Ay)(te)(["margin-bottom:var(--spacing-md,32px);.ovpn-number-input-container{margin:auto;text-align:center;input{left:0;}}.ovpn-number-input-description{max-width:520px;margin:var(--spacing-xxxs,4px) auto auto auto;text-align:left;}"]);var ie,ae=Object.defineProperty,se=Object.getOwnPropertySymbols,le=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,ce=(e,t,n)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;(e=>{const t=class{constructor(e,n,r,o){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.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;e<this.size;e++)a.push(!1);for(let e=0;e<this.size;e++)this.modules.push(a.slice()),this.isFunction.push(a.slice());this.drawFunctionPatterns();const s=this.addEccAndInterleave(r);if(this.drawCodewords(s),-1==o){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(o=t,e=n),this.applyMask(t)}}i(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(n,r){const o=e.QrSegment.makeSegments(n);return t.encodeSegments(o,r)}static encodeBinary(n,r){const o=e.QrSegment.makeBytes(n);return t.encodeSegments([o],r)}static encodeSegments(e,n,o=1,a=40,l=-1,u=!0){if(!(t.MIN_VERSION<=o&&o<=a&&a<=t.MAX_VERSION)||l<-1||l>7)throw new RangeError("Invalid value");let c,d;for(c=o;;c++){const r=8*t.getNumDataCodewords(c,n),o=s.getTotalBits(e,c);if(o<=r){d=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&&d<=8*t.getNumDataCodewords(c,e)&&(n=e);let h=[];for(const t of e){r(t.mode.modeBits,4,h),r(t.numChars,t.mode.numCharCountBits(c),h);for(const e of t.getData())h.push(e)}i(h.length==d);const m=8*t.getNumDataCodewords(c,n);i(h.length<=m),r(0,Math.min(4,m-h.length),h),r(0,(8-h.length%8)%8,h),i(h.length%8==0);for(let e=236;h.length<m;e^=253)r(e,8,h);let p=[];for(;8*p.length<h.length;)p.push(0);return h.forEach(((e,t)=>p[t>>>3]|=e<<7-(7&t))),new t(c,n,p,l)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);i(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,o(r,e));this.setFunctionModule(8,7,o(r,6)),this.setFunctionModule(8,8,o(r,7)),this.setFunctionModule(7,8,o(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,o(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,o(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,o(r,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 n=o(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(n)),i=e+r,a=t+n;0<=i&&i<this.size&&0<=a&&a<this.size&&this.setFunctionModule(i,a,2!=o&&4!=o)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const o=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],a=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),l=o-s%o,u=Math.floor(s/o);let c=[];const d=t.reedSolomonComputeDivisor(a);for(let n=0,r=0;n<o;n++){let o=e.slice(r,r+u-a+(n<l?0:1));r+=o.length;const i=t.reedSolomonComputeRemainder(o,d);n<l&&o.push(0),c.push(o.concat(i))}let h=[];for(let e=0;e<c[0].length;e++)c.forEach(((t,n)=>{(e!=u-a||n>=l)&&h.push(t[e])}));return i(h.length==s),h}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){const a=t-i,s=t+1&2?r:this.size-1-r;!this.isFunction[s][a]&&n<8*e.length&&(this.modules[s][a]=o(e[n>>>3],7-(7&n)),n++)}}i(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[n][a]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),r=this.modules[n][a],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,o=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][n]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,i),r||(e+=this.finderPenaltyCountPatterns(i)*t.PENALTY_N3),r=this.modules[a][n],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,i)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){const o=this.modules[n][r];o==this.modules[n][r+1]&&o==this.modules[n+1][r]&&o==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const r=this.size*this.size,o=Math.ceil(Math.abs(20*n-10*r)/r)-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 n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let o=0;o<e;o++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map((e=>0));for(const o of e){const e=o^r.shift();r.push(0),n.forEach(((n,o)=>r[o]^=t.reedSolomonMultiply(n,e)))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return i(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];i(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function o(e,t){return!!(e>>>t&1)}function i(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.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]],n.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=n;const a=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)r(n,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 n=0;n<e.length;){const o=Math.min(e.length-n,3);r(parseInt(e.substr(n,o),10),3*o+1,t),n+=o}return new a(a.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!a.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let o=45*a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));o+=a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),r(o,11,n)}return t<e.length&&r(a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new a(a.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:a.isNumeric(e)?[a.makeNumeric(e)]:a.isAlphanumeric(e)?[a.makeAlphanumeric(e)]:[a.makeBytes(a.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,t);else if(e<16384)r(2,2,t),r(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,t),r(e,21,t)}return new a(a.Mode.ECI,0,t)}static isNumeric(e){return a.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return a.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let s=a;s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=s})(ie||(ie={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})(t=e.QrCode||(e.QrCode={}))})(ie||(ie={})),(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 n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(t=e.QrSegment||(e.QrSegment={}))})(ie||(ie={}));var de=ie,he={L:de.QrCode.Ecc.LOW,M:de.QrCode.Ecc.MEDIUM,Q:de.QrCode.Ecc.QUARTILE,H:de.QrCode.Ecc.HIGH},me=128,pe="L",ge="#FFFFFF",fe="#000000",Ae=!1;function we(e){const t=e,{value:n,size:o=me,level:i=pe,bgColor:a=ge,fgColor:s=fe,includeMargin:l=Ae,imageSettings:u}=t,c=((e,t)=>{var n={};for(var r in e)le.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&se)for(var r of se(e))t.indexOf(r)<0&&ue.call(e,r)&&(n[r]=e[r]);return n})(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let d=de.QrCode.encodeText(n,he[i]).getModules();const h=l?4:0,m=d.length+2*h,p=function(e,t,n,r){if(null==r)return null;const o=n?4:0,i=e.length+2*o,a=Math.floor(.1*t),s=i/t,l=(r.width||a)*s,u=(r.height||a)*s,c=null==r.x?e.length/2-l/2:r.x*s,d=null==r.y?e.length/2-u/2:r.y*s;let h=null;if(r.excavate){let e=Math.floor(c),t=Math.floor(d);h={x:e,y:t,w:Math.ceil(l+c-e),h:Math.ceil(u+d-t)}}return{x:c,y:d,h:u,w:l,excavation:h}}(d,o,l,u);let g=null;var f,A;null!=u&&null!=p&&(null!=p.excavation&&(f=d,A=p.excavation,d=f.slice().map(((e,t)=>t<A.y||t>=A.y+A.h?e:e.map(((e,t)=>(t<A.x||t>=A.x+A.w)&&e))))),g=r.createElement("image",{xlinkHref:u.src,height:p.h,width:p.w,x:p.x+h,y:p.y+h,preserveAspectRatio:"none"}));const w=function(e,t=0){const n=[];return e.forEach((function(e,r){let o=null;e.forEach((function(i,a){if(!i&&null!==o)return n.push(`M${o+t} ${r+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?n.push(`M${a+t},${r+t} h1v1H${a+t}z`):n.push(`M${o+t},${r+t} h${a+1-o}v1H${o+t}z`)}}))})),n.join("")}(d,h);return r.createElement("svg",((e,t)=>{for(var n in t||(t={}))le.call(t,n)&&ce(e,n,t[n]);if(se)for(var n of se(t))ue.call(t,n)&&ce(e,n,t[n]);return e})({height:o,width:o,viewBox:`0 0 ${m} ${m}`},c),r.createElement("path",{fill:a,d:`M0,0 h${m}v${m}H0z`,shapeRendering:"crispEdges"}),r.createElement("path",{fill:s,d:w,shapeRendering:"crispEdges"}),g)}!function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}}();var Ee=n(6365),xe=n(784);const Ce=g.Ay.div(["margin-bottom:var(--spacing-md,32px);text-align:center;"]),ve=g.Ay.div(["width:","px;margin:0 auto var(--spacing-xs,16px);color:#000000;font-weight:600;"],220),Me=e=>{const{secret:t,authenticatorLink:n,disabled:o,onCopyButtonClick:i,onOpenInAppClick:a}=e;return r.createElement(Ce,null,r.createElement(ve,null,r.createElement(we,{value:n,size:220,fgColor:"#4A5578",bgColor:"transparent","data-testid":"mfa-secret-qr"}),t),r.createElement(l.A,{style:{justifyContent:"center",flexWrap:"wrap"}},r.createElement(u.A,{type:"button",variant:"ghost",size:"sm",disabled:o,"aria-label":"Copy setup key",onClick:i,"data-testid":"copy-to-clipboard",style:{minWidth:"auto"}},r.createElement(Ee.A,null),"  Copy Setup Key"),r.createElement(u.A,{type:"button",variant:"ghost",size:"sm",disabled:o,"aria-label":"Open in app",onClick:a,"data-testid":"open-in-app"},r.createElement(xe.A,null),"  Open In App")))};var ye=n(1411),be=n(306),Re=n(5765);const Ne=e=>{const{error:t,disabled:n,onSubmit:o,onCancel:g}=e,[f,A]=(0,r.useState)(""),w=function(){const{MFASecret:e,userName:t}=(0,ye.$4)(be.Rv),{hostname:n}=window.location,o=`otpauth://totp/${encodeURI(`OpenVPN:${t}@${n}?secret=${e}&issuer=OpenVPN`)}`,i=(0,r.useCallback)((()=>{navigator.clipboard.writeText(e),Re.o.success("Copied to clipboard.")}),[e]),a=(0,r.useCallback)((()=>window.open(o,"_blanc")),[o]);return{secret:e,authenticatorLink:o,onCopyButtonClick:i,onOpenInAppClick:a}}(),E=(0,h.A)({maxWidth:c.nm.SM-1});let x="lg";(0,h.A)({maxWidth:c.nm.MD-1})&&(x="md"),E&&(x="sm");const C=!(e=>6===e.length)(f)||n;return r.createElement(ne,null,r.createElement(m.Z,null,r.createElement(re,null,r.createElement(p.H1,{mb:0},"Enroll in MFA"),r.createElement(a.A,{mt:"var(--spacing-xxxs)",mb:"var(--spacing-md)"},r.createElement(s.A,{color:d.A.neutralTextSubtitle,variant:"textMd"},"You’ll need to use a multi-factor authentication app like Google Authenticator. Using your authentication app, scan the QR code below or enter the setup key manually.")),r.createElement(Me,(0,i.A)({},w,{disabled:Boolean(n)})),r.createElement("form",{id:"mfa-enrollment-form",name:"mfa-enrollment-form",onSubmit:e=>{e.preventDefault(),o(f)}},r.createElement(oe,{title:"Enter the six digit code that your authenticator app provides.",size:x,pattern:"000000",error:Boolean(t),description:t,onComplete:A,autoFocus:!0,"data-testid":"totp-code"}),r.createElement(l.A,{style:{justifyContent:"center"}},r.createElement(u.A,{disabled:C,type:"submit",variant:"primary","data-testid":"submit-form","aria-label":"Confirm"},"Confirm"),r.createElement(u.A,{type:"button",variant:"ghost",disabled:n,"data-data-testid":"cancel-submition",onClick:g,"aria-label":"Cancel"},"Cancel"))))))};var Se=n(6319),Pe=n(5772),Ie=n(3614),ke=n(9594);const $e=e=>e?(0,Se.W)(e)?"MFA setup failed: The code you entered is incorrect. Ensure it matches the provided key.":"Something went wrong.":"",Oe=(e,t)=>e&&!t?Ie.f.downloads:e?void 0:Ie.f.login,Te=()=>{const{isLoading:e,error:t,onSubmit:n,onCancel:i,shouldRedirectTo:a}=function(){const e=(0,ke.jL)(),t=(0,o.W6)(),n=(0,ke.GV)(be.Cd),i=(0,ke.GV)(be.bz),[a,{isLoading:s,error:l,reset:u}]=(0,Pe.Ir)(),c=(0,r.useCallback)((async t=>{u();const r=await a({token:t,authToken:n});"data"in r&&r.data&&(Re.o.success("MFA enabled."),e((0,ye.Wj)(r.data)))}),[n,a,e,u]),d=(0,r.useCallback)((()=>{e((0,ye.D5)()),t.push(Ie.f.login)}),[e,t]);return{isLoading:s,error:$e(l),shouldRedirectTo:Oe(n,i),onSubmit:c,onCancel:d}}();return a?r.createElement(o.rd,{to:a}):r.createElement(Ne,{onSubmit:n,onCancel:i,error:t,disabled:e})}},5772:(e,t,n)=>{n.d(t,{BB:()=>l,I8:()=>s,Ir:()=>d,Km:()=>m,SV:()=>c,eR:()=>h,mg:()=>u});var r=n(323),o=n(6270),i=n(5167);const a=n(2644).U.injectEndpoints({endpoints:e=>({loginWithEmailAndPassword:e.mutation({query:e=>({url:r.M.login,method:"POST",body:e}),transformResponse:e=>(0,i.d)(e)}),loginWithSaml:e.mutation({query:e=>({url:r.M.samlAssertion,method:"POST",body:e}),transformResponse:e=>(0,i.d)(e)}),vpnSamlAuth:e.mutation({query:e=>({url:r.M.vpnSamlAuth,method:"POST",body:e})}),getIdpUrl:e.query({query:e=>({url:r.M.getIdpUrl,params:{relay_state:e}})}),submitMfaChallenge:e.mutation({query:e=>({url:r.M.mfaChallenge,method:"POST",body:e}),transformResponse:e=>(0,i.d)(e)}),changePassword:e.mutation({query:({newPassword:e,token:t,userName:n})=>({url:r.M.passwordChange,method:"POST",body:{username:n,new_password:e},headers:{[o.j]:t}})}),enrollInMfa:e.mutation({query:({token:e,authToken:t})=>({url:r.M.mfaEnroll,method:"POST",body:{token:e},headers:{[o.j]:t}}),transformResponse:e=>(0,i.d)(e)})})}),{useLoginWithEmailAndPasswordMutation:s,useLoginWithSamlMutation:l,useSubmitMfaChallengeMutation:u,useChangePasswordMutation:c,useEnrollInMfaMutation:d,useLazyGetIdpUrlQuery:h,useVpnSamlAuthMutation:m}=a},7894:(e,t,n)=>{n.d(t,{Z:()=>c});var r=n(4041),o=n(8081),i=n(9192),a=n(3580),s=n(738);const l=(0,o.AH)(["margin-right:auto;margin-left:auto;"]),u=o.Ay.div([""," max-width:",";padding:var(--spacing-md,32px) var(--spacing-xs,16px);background:#fff;border:1px solid ",";border-radius:1rem;"," ",""],(0,i.A)("centered")`
       ${l}
    `,(({maxWidth:e})=>(e=>{if(void 0!==e)return"number"==typeof e?`${e}px`:e})(e)),a.A.neutralBorder,s.Ay.moreThen(s.nm.SM)`
        padding: var(--spacing-md, 32px);
        ${(0,i.A)("withShadow")`
            box-shadow: 0px 1px 3px rgba(16, 24, 40, 0.1), 0px 1px 2px rgba(16, 24, 40, 0.06);
        `}
    `,s.Ay.moreThen(s.nm.MD)`
        padding: var(--spacing-md, 32px) var(--spacing-lg, 48px);
    `),c=e=>{const{children:t,...n}=e;return r.createElement(u,n,t)}},9078:(e,t,n)=>{n.d(t,{H1:()=>c});var r=n(9690),o=n(4041),i=n(3580),a=n(8081),s=n(3578),l=n(738);const u=(0,a.Ay)(s.A)(["margin-top:0;margin-bottom:var(--spacing-md,32);letter-spacing:-0.64px;",""],l.Ay.lessThen(l.nm.MD-1)`
        margin-bottom: var(--spacing-sm, 24);
        font-size: 24px;
        line-height: 32px;
        letter-spacing: -0.48px;
    `),c=e=>o.createElement(u,(0,r.A)({color:i.A.neutralTextTitle,inline:!1,variant:"displayLg",center:!0,weight:"semiBold"},e))}}]);