1var Ne=Object.defineProperty;var Ce=e=>{throw TypeError(e)};var Me=(e,t,r)=>t in e?Ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var U=(e,t,r)=>Me(e,typeof t!="symbol"?t+"":t,r),we=(e,t,r)=>t.has(e)||Ce("Cannot "+r);var d=(e,t,r)=>(we(e,t,"read from private field"),r?r.call(e):t.get(e)),K=(e,t,r)=>t.has(e)?Ce("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),E=(e,t,r,a)=>(we(e,t,"write to private field"),a?a.call(e,r):t.set(e,r),r);import{_ as Ue,e3 as We,ag as Ve,ah as Be,bR as Re,r as W,o as f,n as p,f as g,e as o,N as X,q as x,a7 as re,dv as ae,F as Fe,p as De,w as y,c as Q,a6 as ge,g as C,aC as ke,R as Oe,e4 as Je,e5 as Le,V as Ye,aF as ne,e6 as se,au as R,e7 as Y,m as Ge,a1 as Ae,Z as ze,dZ as be,e8 as je,e9 as qe,dM as Ze,bo as Xe,bf as Qe,bn as $e,$ as ie,aE as et,a2 as tt,aR as G,ab as rt,bX as at}from"./bootstrap-DrNmaS0x.js";import{d as nt,f as st,g as it,h as ot}from"./validation.helper-CprwdYaz.js";import{f as ct}from"./cybs.defaults-LmArecL-.js";import{L as lt}from"./LoadingDots-Cn7RhUCW.js";import{A as dt}from"./Agreement-xlJpWSn4.js";const V=new TextEncoder,ce=new TextDecoder,ee=2**32;function q(...e){const t=e.reduce((s,{length:n})=>s+n,0),r=new Uint8Array(t);let a=0;for(const s of e)r.set(s,a),a+=s.length;return r}function le(e,t,r){if(t<0||t>=ee)throw new RangeError("value must be >= 0 and <= ".concat(ee-1,". Received ").concat(t));e.set([t>>>24,t>>>16,t>>>8,t&255],r)}function ht(e){const t=Math.floor(e/ee),r=e%ee,a=new Uint8Array(8);return le(a,t,0),le(a,r,4),a}function ue(e){const t=new Uint8Array(4);return le(t,e),t}function ut(e){if(Uint8Array.prototype.toBase64)return e.toBase64();const t=32768,r=[];for(let a=0;a<e.length;a+=t)r.push(String.fromCharCode.apply(null,e.subarray(a,a+t)));return btoa(r.join(""))}function ft(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),r=new Uint8Array(t.length);for(let a=0;a<t.length;a++)r[a]=t.charCodeAt(a);return r}function mt(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e=="string"?e:ce.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=ce.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return ft(t)}catch(r){throw new TypeError("The input to be decoded is not correctly encoded.")}}function S(e){let t=e;return typeof t=="string"&&(t=V.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):ut(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}class fe extends Error{constructor(r,a){var s;super(r,a);U(this,"code","ERR_JOSE_GENERIC");this.name=this.constructor.name,(s=Error.captureStackTrace)==null||s.call(Error,this,this.constructor)}}U(fe,"code","ERR_JOSE_GENERIC");class A extends fe{constructor(){super(...arguments);U(this,"code","ERR_JOSE_NOT_SUPPORTED")}}U(A,"code","ERR_JOSE_NOT_SUPPORTED");class _ extends fe{constructor(){super(...arguments);U(this,"code","ERR_JWE_INVALID")}}U(_,"code","ERR_JWE_INVALID");function Ke(e){switch(e){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new A("Unsupported JWE Algorithm: ".concat(e))}}const pt=e=>crypto.getRandomValues(new Uint8Array(Ke(e)>>3)),yt=(e,t)=>{if(t.length<<3!==Ke(e))throw new _("Invalid Initialization Vector length")},Ee=(e,t)=>{const r=e.byteLength<<3;if(r!==t)throw new _("Invalid Content Encryption Key length. Expected ".concat(t," bits, got ").concat(r," bits"))};function M(e,t="algorithm.name"){return new TypeError("CryptoKey does not support this operation, its ".concat(t," must be ").concat(e))}function $(e,t){return e.name===t}function Ct(e){return parseInt(e.name.slice(4),10)}function wt(e,t){if(t&&!e.usages.includes(t))throw new TypeError("CryptoKey does not support this operation, its usages must include ".concat(t,"."))}function L(e,t,r){switch(t){case"A128GCM":case"A192GCM":case"A256GCM":{if(!$(e.algorithm,"AES-GCM"))throw M("AES-GCM");const a=parseInt(t.slice(1,4),10);if(e.algorithm.length!==a)throw M(a,"algorithm.length");break}
1case"A128KW":case"A192KW":case"A256KW":{if(!$(e.algorithm,"AES-KW"))throw M("AES-KW");const a=parseInt(t.slice(1,4),10);if(e.algorithm.length!==a)throw M(a,"algorithm.length");break}case"ECDH":{switch(e.algorithm.name){case"ECDH":case"X25519":break;default:throw M("ECDH or X25519")}break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!$(e.algorithm,"PBKDF2"))throw M("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!$(e.algorithm,"RSA-OAEP"))throw M("RSA-OAEP");const a=parseInt(t.slice(9),10)||1;if(Ct(e.algorithm.hash)!==a)throw M("SHA-".concat(a),"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}wt(e,r)}function xe(e,t,...r){var a;if(r=r.filter(Boolean),r.length>2){const s=r.pop();e+="one of type ".concat(r.join(", "),", or ").concat(s,".")}else r.length===2?e+="one of type ".concat(r[0]," or ").concat(r[1],"."):e+="of type ".concat(r[0],".");return t==null?e+=" Received ".concat(t):typeof t=="function"&&t.name?e+=" Received function ".concat(t.name):typeof t=="object"&&t!=null&&(a=t.constructor)!=null&&a.name&&(e+=" Received an instance of ".concat(t.constructor.name)),e}const me=(e,...t)=>xe("Key must be ",e,...t);function Ie(e,t,...r){return xe("Key for the ".concat(e," algorithm must be "),t,...r)}function Se(e){if(!Z(e))throw new Error("CryptoKey instance expected")}function Z(e){return(e==null?void 0:e[Symbol.toStringTag])==="CryptoKey"}function pe(e){return(e==null?void 0:e[Symbol.toStringTag])==="KeyObject"}const Pe=e=>Z(e)||pe(e),gt=(...e)=>{const t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let r;for(const a of t){const s=Object.keys(a);if(!r||r.size===0){r=new Set(s);continue}for(const n of s){if(r.has(n))return!1;r.add(n)}}return!0};function At(e){return typeof e=="object"&&e!==null}const bt=e=>{if(!At(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t};function Et(e,t){if(e.algorithm.length!==parseInt(t.slice(1,4),10))throw new TypeError("Invalid key size for alg: ".concat(t))}function St(e,t,r){return e instanceof Uint8Array?crypto.subtle.importKey("raw",e,"AES-KW",!0,[r]):(L(e,t,r),e)}async function de(e,t,r){const a=await St(t,e,"wrapKey");Et(a,e);const s=await crypto.subtle.importKey("raw",r,{hash:"SHA-256",name:"HMAC"},!0,["sign"]);return new Uint8Array(await crypto.subtle.wrapKey("raw",s,a,"AES-KW"))}const vt=async(e,t)=>{const r="SHA-".concat(e.slice(-3));return new Uint8Array(await crypto.subtle.digest(r,t))};function oe(e){return q(ue(e.length),e)}async function Kt(e,t,r){const a=t>>3,s=32,n=Math.ceil(a/s),i=new Uint8Array(n*s);for(let c=1;c<=n;c++){const l=new Uint8Array(4+e.length+r.length);l.set(ue(c),0),l.set(e,4),l.set(r,4+e.length);const u=await vt("sha256",l);i.set(u,(c-1)*s)}return i.slice(0,a)}async function xt(e,t,r,a,s=new Uint8Array(0),n=new Uint8Array(0)){L(e,"ECDH"),L(t,"ECDH","deriveBits");const i=oe(V.encode(r)),c=oe(s),l=oe(n),u=ue(a),m=new Uint8Array(0),H=q(i,c,l,u,m),N=new Uint8Array(await crypto.subtle.deriveBits({name:e.algorithm.name,public:e},t,It(e)));return Kt(N,a,H)}function It(e){return e.algorithm.name==="X25519"?256:Math.ceil(parseInt(e.algorithm.namedCurve.slice(-3),10)/8)<<3}function Pt(e){switch(e.algorithm.namedCurve){case"P-256":case"P-384":case"P-521":return!0;default:return e.algorithm.name==="X25519"}}function Tt(e,t){return e instanceof Uint8Array?crypto.subtle.importKey("raw",e,"PBKDF2",!1,["deriveBits"]):(L(e,t,"deriveBits"),e)}const _t=(e,t)=>q(V.encode(e),new Uint8Array([0]),t);async function Ht(e,t,r,a){if(!(e instanceof Uint8Array)||e.length<8)throw new _("PBES2 Salt Input must be 8 or more octets");const s=_t(t,e),n=parseInt(t.slice(13,16),10),i={hash:"SHA-".concat(t.slice(8,11)),iterations:r,name:"PBKDF2",salt:s},c=await Tt(a,t);return new Uint8Array(await crypto.subtle.deriveBits(i,c,n))}async function Nt(e,t,r,a=2048,s=crypto.getRandomValues(new Uint8Array(16))){const n=await Ht(s,e,a,t);return{encryptedKey:await de(e.slice(-6),n,r),p2c:a,p2s:S(s)}}const Mt=(e,t)=>
1{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:r}=t.algorithm;if(typeof r!="number"||r<2048)throw new TypeError("".concat(e," requires key modulusLength to be 2048 bits or larger"))}},Ut=e=>{switch(e){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return"RSA-OAEP";default:throw new A("alg ".concat(e," is not supported either by JOSE or your javascript runtime"))}};async function Wt(e,t,r){return L(t,e,"encrypt"),Mt(e,t),new Uint8Array(await crypto.subtle.encrypt(Ut(e),t,r))}function Te(e){switch(e){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new A("Unsupported JWE Algorithm: ".concat(e))}}const z=e=>crypto.getRandomValues(new Uint8Array(Te(e)>>3));function Vt(e){let t,r;switch(e.kty){case"AKP":{switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},r=e.priv?["sign"]:["verify"];break;default:throw new A('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"RSA":{switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:"SHA-".concat(e.alg.slice(-3))},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(e.alg.slice(-3))},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(e.alg.slice(-3),10)||1)},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new A('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},r=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},r=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new A('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}
1case"OKP":{switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new A('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new A('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}const Bt=async e=>{var s,n;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:t,keyUsages:r}=Vt(e),a={...e};return a.kty!=="AKP"&&delete a.alg,delete a.use,crypto.subtle.importKey("jwk",a,t,(s=e.ext)!=null?s:!(e.d||e.priv),(n=e.key_ops)!=null?n:r)};async function Rt(e,t,r,a,s){if(!(r instanceof Uint8Array))throw new TypeError(me(r,"Uint8Array"));const n=parseInt(e.slice(1,4),10),i=await crypto.subtle.importKey("raw",r.subarray(n>>3),"AES-CBC",!1,["encrypt"]),c=await crypto.subtle.importKey("raw",r.subarray(0,n>>3),{hash:"SHA-".concat(n<<1),name:"HMAC"},!1,["sign"]),l=new Uint8Array(await crypto.subtle.encrypt({iv:a,name:"AES-CBC"},i,t)),u=q(s,a,l,ht(s.length<<3)),m=new Uint8Array((await crypto.subtle.sign("HMAC",c,u)).slice(0,n>>3));return{ciphertext:l,tag:m,iv:a}}async function Ft(e,t,r,a,s){let n;r instanceof Uint8Array?n=await crypto.subtle.importKey("raw",r,"AES-GCM",!1,["encrypt"]):(L(r,e,"encrypt"),n=r);const i=new Uint8Array(await crypto.subtle.encrypt({additionalData:s,iv:a,name:"AES-GCM",tagLength:128},n,t)),c=i.slice(-16);return{ciphertext:i.slice(0,-16),tag:c,iv:a}}const _e=async(e,t,r,a,s)=>{if(!Z(r)&&!(r instanceof Uint8Array))throw new TypeError(me(r,"CryptoKey","KeyObject","Uint8Array","JSON Web Key"));switch(a?yt(e,a):a=pt(e),e){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return r instanceof Uint8Array&&Ee(r,parseInt(e.slice(-3),10)),Rt(e,t,r,a,s);case"A128GCM":case"A192GCM":case"A256GCM":return r instanceof Uint8Array&&Ee(r,parseInt(e.slice(1,4),10)),Ft(e,t,r,a,s);default:throw new A("Unsupported JWE Content Encryption Algorithm")}};async function Dt(e,t,r,a){const s=e.slice(0,7),n=await _e(s,r,t,a,new Uint8Array(0));return{encryptedKey:n.ciphertext,iv:S(n.iv),tag:S(n.tag)}}const kt=(e,t,r,a,s)=>{if(s.crit!==void 0&&(a==null?void 0:a.crit)===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!a||a.crit===void 0)return new Set;if(!Array.isArray(a.crit)||a.crit.length===0||a.crit.some(i=>typeof i!="string"||i.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let n;r!==void 0?n=new Map([...Object.entries(r),...t.entries()]):n=t;for(const i of a.crit){if(!n.has(i))throw new A('Extension Header Parameter "'.concat(i,'" is not recognized'));if(s[i]===void 0)throw new e('Extension Header Parameter "'.concat(i,'" is missing'));if(n.get(i)&&a[i]===void 0)throw new e('Extension Header Parameter "'.concat(i,'" MUST be integrity protected'))}return new Set(a.crit)};function ye(e){return bt(e)&&typeof e.kty=="string"}function Ot(e){return e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string")}function Jt(e){return e.kty!=="oct"&&typeof e.d>"u"&&typeof e.priv>"u"}function Lt(e){return e.kty==="oct"&&typeof e.k=="string"}let D;const ve=async(e,t,r,a=!1)=>{D||(D=new WeakMap);let s=D.get(e);if(s!=null&&s[r])return s[r];const n=await Bt({...t,alg:r});return a&&Object.freeze(e),s?s[r]=n:D.set(e,{[r]:n}),n},Yt=(e,t)=>{var i;D||(D=new WeakMap);let r=D.get(e);if(r!=null&&r[t])return r[t];const a=e.type==="public",s=!!a;let n;if(e.asymmetricKeyType==="x25519"){switch(t){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}n=e.toCryptoKey(e.asymmetricKeyType,s,a?[]:["deriveBits"])}if(e.asymmetricKeyType==="ed25519"){if(t!=="EdDSA"&&t!=="Ed25519")throw new TypeError("given KeyObject instance cannot be used for this algorithm");n=e.toCryptoKey(e.asymmetricKeyType,s,[a?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":{if(t!==e.asymmetricKeyType.toUpperCase())throw new TypeError("given KeyObject instance cannot be used for this algorithm");n=e.toCryptoKey(e.asymmetricKeyType,s,[a?"verify":"sign"])}}if(e.asymmetricKeyType==="rsa"){let c;switch(t){case"RSA-OAEP":c="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":c="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":c="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":c="SHA-512";break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:c},s,a?["encrypt"]:["decrypt"]);n=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:c},s,[a?"verify":"sign"])}if(e.asymmetricKeyType==="ec"){const l=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get((i=e.asymmetricKeyDetails)==null?void 0:i.namedCurve);if(!l)throw new TypeError("given KeyObject instance cannot be used for this algorithm");t==="ES256"&&l==="P-256"&&(n=e.toCryptoKey({name:"ECDSA",namedCurve:l},s,[a?"verify":"sign"])),t==="ES384"&&l==="P-384"&&(n=e.toCryptoKey({name:"ECDSA",namedCurve:l},s,[a?"verify":"sign"])),t==="ES512"&&l==="P-521"&&(n=e.toCryptoKey({name:"ECDSA",namedCurve:l},s,[a?"verify":"sign"])),t.startsWith("ECDH-ES")&&(n=e.toCryptoKey({name:"ECDH",namedCurve:l},s,a?[]:["deriveBits"]))}if(!n)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return r?r[t]=n:D.set(e,{[t]:n}),n},He=async(e,t)=>{if(e instanceof Uint8Array||Z(e))return e;if(pe(e)){if(e.type==="secret")return e.export();if("toCryptoKey"in e&&typeof e.toCryptoKey=="function")try{return Yt(e,t)}catch(a){if(a instanceof TypeError)throw a}let r=e.export({format:"jwk"});return ve(e,r,t)}if(ye(e))return e.k?mt(e.k):ve(e,e,t,!0);throw new Error("unreachable")},F=e=>e==null?void 0:e[Symbol.toStringTag],he=(e,t,r)=>{var a,s;if(t.use!==void 0){let n;switch(r){case"sign":case"verify":n="sig";break;case"encrypt":case"decrypt":n="enc";break}if(t.use!==n)throw new TypeError('Invalid key for this operation, its "use" must be "'.concat(n,'" when present'))}if(t.alg!==void 0&&t.alg!==e)throw new TypeError('Invalid key for this operation, its "alg" must be "'.concat(e,'" when present'));if(Array.isArray(t.key_ops)){let n;switch(!0){case r==="verify":case e==="dir":case e.includes("CBC-HS"):n=r;break;case e.startsWith("PBES2"):n="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):!e.includes("GCM")&&e.endsWith("KW")?n="wrapKey":n=r;break;case e.startsWith("RSA"):n="wrapKey";break;case r==="decrypt":n=e.startsWith("RSA")?"unwrapKey":"deriveBits";break}if(n&&((s=(a=t.key_ops)==null?void 0:a.includes)==null?void 0:s.call(a,n))===!1)throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(n,'" when present'))}return!0},Gt=(e,t,r)=>{if(!(t instanceof Uint8Array)){if(ye(t)){if(Lt(t)&&he(e,t,r))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Pe(t))throw new TypeError(Ie(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(t.type!=="secret")throw new TypeError("".concat(F(t),' instances for symmetric algorithms must be of type "secret"'))}},zt=(e,t,r)=>{if(ye(t))switch(r){case"decrypt":case"sign":if(Ot(t)&&he(e,t,r))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"encrypt":case"verify":if(Jt(t)&&he(e,t,r))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!Pe(t))throw new TypeError(Ie(e,t,"CryptoKey","KeyObject","JSON Web Key"));if(t.type==="secret")throw new TypeError("".concat(F(t),' instances for asymmetric algorithms must not be of type "secret"'));if(t.type==="public")switch(r){case"sign":throw new TypeError("".concat(F(t),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(F(t),' instances for asymmetric algorithm decryption must be of type "private"'))}if(t.type==="private")switch(r){case"verify":throw new TypeError("".concat(F(t),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(F(t),' instances for asymmetric algorithm encryption must be of type "public"'))}},jt=(e,t,r)=>{e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(e)||/^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(e)?Gt(e,t,r):zt(e,t,r)},qt=Symbol();async function Zt(e){if(pe(e))if(e.type==="secret")e=e.export();else return e.export({format:"jwk"});if(e instanceof Uint8Array)return{kty:"oct",k:S(e)};if(!Z(e))throw new TypeError(me(e,"CryptoKey","KeyObject","Uint8Array"));if(!e.extractable)throw new TypeError("non-extractable CryptoKey cannot be exported as a JWK");const{ext:t,key_ops:r,alg:a,use:s,...n}=await crypto.subtle.exportKey("jwk",e);return n.kty==="AKP"&&(n.alg=a),n}async function Xt(e){return Zt(e)}const Qt=async(e,t,r,a,s={})=>{let n,i,c;switch(e){case"dir":{c=r;break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(Se(r),!Pt(r))throw new A("ECDH with the provided key is not allowed or not supported by your javascript runtime");const{apu:l,apv:u}=s;let m;s.epk?m=await He(s.epk,e):m=(await crypto.subtle.generateKey(r.algorithm,!0,["deriveBits"])).privateKey;const{x:H,y:N,crv:h,kty:v}=await Xt(m),P=await xt(r,m,e==="ECDH-ES"?t:e,e==="ECDH-ES"?Te(t):parseInt(e.slice(-5,-2),10),l,u);if(i={epk:{x:H,crv:h,kty:v}},v==="EC"&&(i.epk.y=N),l&&(i.apu=S(l)),u&&(i.apv=S(u)),e==="ECDH-ES"){c=P;break}c=a||z(t);const te=e.slice(-6);n=await de(te,P,c);break}case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{c=a||z(t),Se(r),n=await Wt(e,r,c);break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{c=a||z(t);const{p2c:l,p2s:u}=s;({encryptedKey:n,...i}=await Nt(e,r,c,l,u));break}
1case"A128KW":case"A192KW":case"A256KW":{c=a||z(t),n=await de(e,r,c);break}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{c=a||z(t);const{iv:l}=s;({encryptedKey:n,...i}=await Dt(e,r,c,l));break}default:throw new A('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek:c,encryptedKey:n,parameters:i}};var j,w,I,b,k,B,O,J;class $t{constructor(t){K(this,j);K(this,w);K(this,I);K(this,b);K(this,k);K(this,B);K(this,O);K(this,J);if(!(t instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");E(this,j,t)}setKeyManagementParameters(t){if(d(this,J))throw new TypeError("setKeyManagementParameters can only be called once");return E(this,J,t),this}setProtectedHeader(t){if(d(this,w))throw new TypeError("setProtectedHeader can only be called once");return E(this,w,t),this}setSharedUnprotectedHeader(t){if(d(this,I))throw new TypeError("setSharedUnprotectedHeader can only be called once");return E(this,I,t),this}setUnprotectedHeader(t){if(d(this,b))throw new TypeError("setUnprotectedHeader can only be called once");return E(this,b,t),this}setAdditionalAuthenticatedData(t){return E(this,k,t),this}setContentEncryptionKey(t){if(d(this,B))throw new TypeError("setContentEncryptionKey can only be called once");return E(this,B,t),this}setInitializationVector(t){if(d(this,O))throw new TypeError("setInitializationVector can only be called once");return E(this,O,t),this}async encrypt(t,r){if(!d(this,w)&&!d(this,b)&&!d(this,I))throw new _("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!gt(d(this,w),d(this,b),d(this,I)))throw new _("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");const a={...d(this,w),...d(this,b),...d(this,I)};if(kt(_,new Map,r==null?void 0:r.crit,d(this,w),a),a.zip!==void 0)throw new A('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');const{alg:s,enc:n}=a;if(typeof s!="string"||!s)throw new _('JWE "alg" (Algorithm) Header Parameter missing or invalid');if(typeof n!="string"||!n)throw new _('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let i;if(d(this,B)&&(s==="dir"||s==="ECDH-ES"))throw new TypeError('setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header '.concat(s));jt(s==="dir"?n:s,t,"encrypt");let c;{let P;const te=await He(t,s);({cek:c,encryptedKey:i,parameters:P}=await Qt(s,n,te,d(this,B),d(this,J))),P&&(r&&qt in r?d(this,b)?E(this,b,{...d(this,b),...P}):this.setUnprotectedHeader(P):d(this,w)?E(this,w,{...d(this,w),...P}):this.setProtectedHeader(P))}let l,u,m;d(this,w)?u=V.encode(S(JSON.stringify(d(this,w)))):u=V.encode(""),d(this,k)?(m=S(d(this,k)),l=q(u,V.encode("."),V.encode(m))):l=u;const{ciphertext:H,tag:N,iv:h}=await _e(n,d(this,j),c,d(this,O),l),v={ciphertext:S(H)};return h&&(v.iv=S(h)),N&&(v.tag=S(N)),i&&(v.encrypted_key=S(i)),m&&(v.aad=m),d(this,w)&&(v.protected=ce.decode(u)),d(this,I)&&(v.unprotected=d(this,I)),d(this,b)&&(v.header=d(this,b)),v}}j=new WeakMap,w=new WeakMap,I=new WeakMap,b=new WeakMap,k=new WeakMap,B=new WeakMap,O=new WeakMap,J=new WeakMap;var T;class er{constructor(t){K(this,T);E(this,T,new $t(t))}setContentEncryptionKey(t){return d(this,T).setContentEncryptionKey(t),this}setInitializationVector(t){return d(this,T).setInitializationVector(t),this}setProtectedHeader(t){return d(this,T).setProtectedHeader(t),this}setKeyManagementParameters(t){return d(this,T).setKeyManagementParameters(t),this}async encrypt(t,r){const a=await d(this,T).encrypt(t,r);return[a.protected,a.encrypted_key,a.iv,a.ciphertext,a.tag].join(".")}}T=new WeakMap;const tr={name:"FlexForm",components:{LoadingDots:lt,Agreement:dt,BPopover:Re,BFormInput:Be,BFormGroup:Ve,BFormInvalidFeedback:We},inject:["checkoutState"],emits:["blur"],setup(){const e=rt(!1);return{isFlexSdkLoaded:e,loadFlexSDK:async r=>{var i,c;if(!((c=(i=r==null?void 0:r.ctx)==null?void 0:i[0])!=null&&c.data))throw new Error("Invalid capture context");const{clientLibrary:a,clientLibraryIntegrity:s}=r.ctx[0].data,{load:n}=at(a,()=>{},{manual:!0,attrs:{integrity:s,crossorigin:"anonymous"}});try{await n(!0),e.value=!0}catch(l){throw e.value=!1,new Error("Failed to load Flex SDK: ".concat(l.message))}}}},data(){return{keyInfo:"",loading:!0,loadingMessage:"",microformInstance:null,cardInfo:{cardExpiry:"",cardName:"",cardCvv:"",cardNumber:"",validSecurityCode:null},validCardNumber:null,hasErrors:!1,flexErrors:[],card:null,amexImageUrl:G("/f/293203740241008/7050a41b53/amex.png"),mastercardImageUrl:G("/f/293203740241008/c23e396373/mastercard.png"),visaImageUrl:G("/f/293203740241008/f31936b5b3/visa.png"),cvvBackImageUrl:G("/f/293203740241008/66cc738478/cvv-back.png"),cvvFrontImageUrl:G("/f/293203740241008/de87ca7933/cvv-front.png"),forceFeedback:!1,showPopover:!1,flexAPikey:null}},computed:{...ie(tt,["isAuth"]),...ie(Ae,["storeInfo","flexApiToken"]),...ie(et,["settings"]),cardNumberClass(){if(typeof this.hasCardNumber=="boolean")return this.hasCardNumber?"flex-microform-valid-custom":"flex-microform-invalid-custom"},securityCodeClass(){if(typeof this.hasCardCvv=="boolean")return this.hasCardCvv?"flex-microform-valid-custom":"flex-microform-invalid-custom"},hasCardName(){return ot(this.cardInfo.cardName,this.forceFeedback)},hasCardExpiry(){return it(this.cardInfo.cardExpiry,this.forceFeedback)},hasCardCvv(){if(this.cardInfo.validSecurityCode!==null||this.forceFeedback)return!!this.cardInfo.validSecurityCode},hasCardNumber(){if(this.validCardNumber!==null||this.forceFeedback)return!!(this.validCardNumber&&this.validCardType)},hasCardInfo(){const e=Xe((a,s)=>a&&s,!0),r=Qe(e,$e(a=>!!a));return this.isCapacitorNativePlatform?r([this.hasCardName,this.hasValidCreditCard,this.hasCardExpiry,this.hasValidCvv]):r([this.hasCardName,this.hasCardExpiry,this.hasCardCvv,this.hasCardNumber])},minHeight(){const e=this.$refs.flexForm;return this.loading&&e?e.clientHeight:0},cardBrandName(){var e;return((e=this.card)==null?void 0:e.brandedName)||""},cardImg(){var e,t;return this.card?(t=Y((e=this.card)==null?void 0:e.cybsCardType))==null?void 0:t.img:null},validCardType(){return this.card?!!be(this.storeInfo).find(e=>this.card.name.toLowerCase()===e.toLowerCase()):null},isAmex(){var e;return((e=this.card)==null?void 0:e.name)==="amex"||this.cardName==="amex"},isUnknown(){var e;return((e=this.card)==null?void 0:e.id)==="CreditCard"},isCapacitorNativePlatform(){return Ze()},cardNumber(){return this.cardInfo.cardNumber.replace(/\s/g,"")},cardBrand(){return this.cardName==="unknown"?"This card":qe(this.cardName)},cardName(){return je(this.cardNumber)},cardImage(){var e;return this.hasValidCreditCard?(e=Y(se(this.cardName)))==null?void 0:e.img:null},hasValidCreditCard(){return st(this.cardNumber,this.forceFeedback)&&this.hasValidCardType},hasValidCardType(){return!!be(this.storeInfo).find(e=>this.cardName===e.toLowerCase())},hasValidCvv(){return nt(this.cardInfo.cardCvv,Y(se(this.cardName)).code.length,this.forceFeedback)}},watch:{hasCardInfo:{handler(e){e?this.isCapacitorNativePlatform?this.checkFlexApi():this.checkFlex():this.checkoutState.hasSelectedPayment=!1}}},async mounted(){try{ze.$on("forceFeedback",this.handleForceFeedback),this.checkoutState.hasSelectedPayment=!1,this.isCapacitorNativePlatform?this.flexAPikey=await this.initFlexApi():await this.initialiseMicroform()}catch(e){console.error(e),this.alertValidationError(e)}finally{this.loading=!1}},methods:{...Ge(Ae,{initFlex:"initialiseFlex",initFlexApi:"initialiseFlexApi",verifyFlex:"verifyFlex",setFlexApiToken:"setFlexApiToken",createTransientToken:"createTransientToken"}),async initialiseMicroform(){this.keyInfo=await this.initFlex(),await this.loadFlexSDK(JSON.parse(atob(this.keyInfo.split(".")[1]))),this.isFlexSdkLoaded&&(window!=null&&window.Flex)&&this.keyInfo&&this.$refs.cardNumberContainer&&this.initialiseFlexInstance()},initialiseFlexInstance(){const e={...ct},t=new window.Flex(this.keyInfo);this.microformInstance=t.microform({styles:e.styles});const r=this.microformInstance.createField("number",{placeholder:""}),a=this.microformInstance.createField("securityCode",{placeholder:""});r.on("change",s=>{this.validCardNumber=s.valid,this.card=s.card?s.card[0]:null}),a.on("change",s=>{this.cardInfo.validSecurityCode=s.valid}),r.load(this.$refs.cardNumberContainer),a.load(this.$refs.securityCodeContainer)},checkFlex(){this.loading=!0,this.loadingMessage=ne.BASKET.BASKET_CARD_VERIFICATION.text,this.checkoutState.orderInfo.paymentInfo.expiry=R(this.cardInfo.cardExpiry,"MM/YY").format("MM/YYYY");const e={expirationMonth:R(this.cardInfo.cardExpiry,"MM/YY").format("MM"),expirationYear:R(this.cardInfo.cardExpiry,"MM/YY").format("YYYY")};this.microformInstance.createToken(e,(t,r)=>{t?(this.loading=!1,this.hasErrors=!0,this.flexErrors=t.details.responseStatus.details.length?this.formatFlexErrors(t.details.responseStatus.details):[{message:t.details.responseStatus.message}]):this.verifyFlex({transientToken:r,captureContextToken:this.keyInfo}).then(({paymentInfo:a})=>{this.hasErrors=!1,this.flexErrors=[],this.checkoutState.hasSelectedPayment=!0,this.checkoutState.orderInfo.paymentInfo.paymentToken=a.paymentToken,this.checkoutState.orderInfo.paymentInfo.transientToken=a.transientToken,this.checkoutState.orderInfo.paymentInfo.maskedCard=a.maskedCard,this.checkoutState.orderInfo.paymentInfo.cardType=a.cardType,this.checkoutState.orderInfo.paymentInfo.bin=a.bin,this.checkoutState.orderInfo.paymentInfo.paymentType=Y(a.cardType).id}).catch(this.alertValidationError).finally(()=>{this.loading=!1})})},async checkFlexApi(){var r,a;if(!((r=this.flexAPikey)!=null&&r.captureContext)&&!((a=this.flexAPikey)!=null&&a.tokenUrl)){this.alertValidationError();return}this.loading=!0,this.loadingMessage=ne.BASKET.BASKET_CARD_VERIFICATION.text;const e=JSON.parse(atob(this.flexAPikey.captureContext.split(".")[1])).flx.jwk,t={data:{paymentInformation:{card:{number:this.cardNumber,expirationMonth:R(this.cardInfo.cardExpiry,"MM/YY").format("MM"),expirationYear:R(this.cardInfo.cardExpiry,"MM/YY").format("YYYY"),type:se(this.cardName),securityCode:this.cardInfo.cardCvv}}},context:this.flexAPikey.captureContext,index:0};try{const s=await this.jsonToJwe(t,e),n=await this.createTransientToken({jwePayload:s}),{paymentInfo:i}=await this.verifyFlex({transientToken:n,captureContextToken:this.flexAPikey.captureContext});this.hasErrors=!1,this.flexErrors=[],this.checkoutState.hasSelectedPayment=!0,this.checkoutState.orderInfo.paymentInfo.transientToken=i.transientToken,this.checkoutState.orderInfo.paymentInfo.cardType=i.cardType,this.checkoutState.orderInfo.paymentInfo.paymentType=Y(i.cardType).id,this.checkoutState.orderInfo.paymentInfo.maskedCard=i.maskedCard,this.checkoutState.orderInfo.paymentInfo.expiry=R(this.cardInfo.cardExpiry,"MM/YY").format("MM/YYYY")}catch(s){this.alertValidationError()}finally{this.loading=!1}},async jsonToJwe(e,t){const r={alg:"RSA-OAEP",enc:"A256GCM",kid:t.kid};return await new er(new TextEncoder().encode(JSON.stringify(e))).setProtectedHeader(r).encrypt
1(t)},alertValidationError(e){var t,r;Ye.showSnackbar({active:!0,message:(r=(t=e==null?void 0:e.response)==null?void 0:t.data)!=null&&r.message?e.response.data.message:ne.BASKET.BASKET_VALIDATION_ERROR.text,theme:"danger"})},formatFlexErrors(e){return e.filter(t=>t.location!=="cardInfo.cardType").map(t=>t.location==="cardInfo.cardNumber"?{...t,message:"Credit Card Number field is empty"}:t)},expiryFormatter(e){return Le(e)},cardFormatter(e){return Je(e)},handleForceFeedback(){this.forceFeedback=!0},togglePopover(e){this.showPopover=e},onBlur(e){this.$emit("blur",e)}}},rr={key:0,class:"d-flex justify-content-center align-items-center flex-column"},ar={class:"mt-2"},nr={class:"container p-0"},sr={key:0,class:"row"},ir={class:"col"},or={class:"row"},cr={class:"col"},lr={class:"cardNumber-wrapper"},dr=["src"],hr={key:0},ur={key:1},fr={class:"cardNumber-wrapper"},mr=["src"],pr={class:"accepted-cards"},yr=["src"],Cr=["src"],wr=["src"],gr={key:0},Ar={key:1},br={class:"row"},Er={class:"col-6"},Sr={class:"col-6"},vr={class:"text-end"},Kr={key:0,class:"popover-content"},xr=["src"],Ir={key:1,class:"popover-content mt-2"},Pr=["src"],Tr={class:"text-end"},_r={key:0,class:"popover-content"},Hr={class:"popover-text"},Nr={key:0},Mr=["src"],Ur={key:1,class:"popover-content mt-2"},Wr={class:"popover-text"},Vr={key:0},Br=["src"],Rr={key:1,class:"row"},Fr={class:"col"};function Dr(e,t,r,a,s,n){const i=W("loading-dots"),c=W("b-form-input"),l=W("b-form-group"),u=W("b-form-invalid-feedback"),m=W("font-awesome-icon"),H=W("b-popover"),N=W("agreement");return f(),p("form",{ref:"flexForm",style:Oe({"min-height":n.minHeight+"px"}),class:"flex-form d-flex justify-content-center align-items-center",onSubmit:t[7]||(t[7]=ke((...h)=>e.handleSubmit&&e.handleSubmit(...h),["prevent"]))},[s.loading?(f(),p("div",rr,[g(i),o("p",ar,X(s.loadingMessage),1)])):x("",!0),re(o("div",nr,[s.hasErrors?(f(),p("div",sr,[o("div",ir,[(f(!0),p(Fe,null,De(s.flexErrors,h=>(f(),p("p",{key:h.location,class:"alert alert-danger"},X(h.message),1))),128))])])):x("",!0),o("div",or,[o("div",cr,[g(l,{label:"Name on Card","invalid-feedback":"Please enter a valid name.",state:n.hasCardName},{default:y(()=>[g(c,{modelValue:s.cardInfo.cardName,"onUpdate:modelValue":t[0]||(t[0]=h=>s.cardInfo.cardName=h),state:n.hasCardName,class:"card-name",placeholder:"John Smith",name:"ccname",required:""},null,8,["modelValue","state"])]),_:1},8,["state"]),n.isCapacitorNativePlatform?(f(),Q(l,{key:0,label:"Credit Card Number",state:n.hasValidCreditCard},{default:y(()=>[o("div",lr,[t[8]||(t[8]=o("svg",{id:"card-img",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[o("path",{d:"M22.6375 5.73755V18.2876C22.6375 18.9384 22.4061 19.4928 21.9433 19.9507C21.4805 20.4086 20.9202 20.6376 20.2625 20.6376H3.71249C3.06165 20.6376 2.50728 20.4086 2.04936 19.9507C1.59145 19.4928 1.36249 18.9384 1.36249 18.2876V5.73755C1.36249 5.07983 1.59145 4.51957 2.04936 4.05677C2.50728 3.59396 3.06165 3.36255 3.71249 3.36255H20.2625C20.9202 3.36255 21.4805 3.59396 21.9433 4.05677C22.4061 4.51957 22.6375 5.07983 22.6375 5.73755ZM3.71249 8.18755H20.2625V5.73755H3.71249V8.18755ZM3.71249 11.4125V18.2876H20.2625V11.4125H3.71249Z",fill:"#191A1B"})],-1)),g(c,{id:"flexCardNumber-container",modelValue:s.cardInfo.cardNumber,"onUpdate:modelValue":t[1]||(t[1]=h=>s.cardInfo.cardNumber=h),state:n.hasValidCreditCard,formatter:n.cardFormatter,inputmode:"numeric",class:"card-number",placeholder:"Enter card number",name:"ccnumber",required:""},null,8,["modelValue","state","formatter"]),re(o("img",{id:"cardtype-img",src:n.cardImage,alt:"Card Image"},null,8,dr),[[ae,n.cardImage]])]),g(u,{state:n.hasCardNumber},{default:y(()=>[n.hasValidCreditCard?n.hasValidCardType?x("",!0):(f(),p("span",ur,X(n.cardBrand)+" is not supported by this store",1)):(f(),p("span",hr,"Please enter a valid card number."))]),_:1},8,["state"])]),_:1},8,["state"])):(f(),Q(l,{key:1},{default:y(()=>[t[10]||(t[10]=o("legend",{id:"cardNumber-label",class:"col-form-label pt-0",for:"cardNumber-container"}," Credit Card Number ",-1)),o("div",fr,[t[9]||(t[9]=o("svg",{id:"card-img",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},[o("path",{d:"M22.6375 5.73755V18.2876C22.6375 18.9384 22.4061 19.4928 21.9433 19.9507C21.4805 20.4086 20.9202 20.6376 20.2625 20.6376H3.71249C3.06165 20.6376 2.50728 20.4086 2.04936 19.9507C1.59145 19.4928 1.36249 18.9384 1.36249 18.2876V5.73755C1.36249 5.07983 1.59145 4.51957 2.04936 4.05677C2.50728 3.59396 3.06165 3.36255 3.71249 3.36255H20.2625C20.9202 3.36255 21.4805 3.59396 21.9433 4.05677C22.4061 4.51957 22.6375 5.07983 22.6375 5.73755ZM3.71249 8.18755H20.2625V5.73755H3.71249V8.18755ZM3.71249 11.4125V18.2876H20.2625V11.4125H3.71249Z",fill:"#191A1B"})],-1)),o("div",{id:"cardNumber-container",ref:"cardNumberContainer",class:ge(n.cardNumberClass)},null,2),re(o("img",{id:"cardtype-img",src:n.cardImg,alt:"Card Image"},null,8,mr),[[ae,n.cardImg]]),o("div",pr,[o("img",{src:s.amexImageUrl,class:"me-1",alt:"Amex"},null,8,yr),o("img",{src:s.mastercardImageUrl,class:"me-1",alt:"MasterCard"},null,8,Cr),o("img",{src:s.visaImageUrl,alt:"Visa"},null,8,wr)])]),g(u,{state:n.hasCardNumber},{default:y(()=>[n.validCardType===!1?(f(),p("span",gr,X(n.cardBrandName||"This card")+" is not supported by this
1store.",1)):(f(),p("span",Ar,"Please enter a valid card number."))]),_:1},8,["state"])]),_:1}))])]),o("div",br,[o("div",Er,[g(l,{label:"Expiry Date (mm/yy)","invalid-feedback":"Please enter a valid expiry.",state:n.hasCardExpiry},{default:y(()=>[g(c,{modelValue:s.cardInfo.cardExpiry,"onUpdate:modelValue":t[2]||(t[2]=h=>s.cardInfo.cardExpiry=h),state:n.hasCardExpiry,formatter:n.expiryFormatter,inputmode:"numeric",pattern:"[0-9]*",class:"card-exp",name:"cc-exp",autocomplete:"cc-exp",required:""},null,8,["modelValue","state","formatter"])]),_:1},8,["state"])]),o("div",Sr,[n.isCapacitorNativePlatform?(f(),Q(l,{key:0,label:"CVV",state:n.hasValidCvv,"invalid-feedback":"Please enter a valid CVV."},{label:y(()=>[t[13]||(t[13]=C(" CVV ",-1)),g(H,{target:"popover-cvv",placement:"auto",triggers:"click blur"},{title:y(()=>[o("div",vr,[o("button",{class:"close-popover",onClick:t[3]||(t[3]=h=>n.togglePopover(!1))},[g(m,{icon:["fal","times-circle"],size:"lg"})])])]),default:y(()=>[n.cardName==="unknown"||n.cardName!=="amex"?(f(),p("div",Kr,[t[11]||(t[11]=o("p",{class:"popover-text"},[o("span",null,"For Visa, and Mastercard,"),C(" the "),o("strong",null,"3 digits"),C(" on the "),o("em",null,"back"),C(" of your card. ")],-1)),o("img",{src:s.cvvBackImageUrl,alt:""},null,8,xr)])):x("",!0),n.cardName==="unknown"||n.cardName==="amex"?(f(),p("div",Ir,[t[12]||(t[12]=o("p",{class:"popover-text"},[o("span",null,"For American Express,"),C(" the "),o("strong",null,"4 digits"),C(" on the "),o("em",null,"front"),C(" of your card. ")],-1)),o("img",{src:s.cvvFrontImageUrl,alt:""},null,8,Pr)])):x("",!0)]),_:1})]),default:y(()=>[g(c,{id:"flexSecurityCode-container",modelValue:s.cardInfo.cardCvv,"onUpdate:modelValue":t[4]||(t[4]=h=>s.cardInfo.cardCvv=h),state:n.hasValidCvv,inputmode:"numeric",maxlength:n.isAmex?4:3,class:"card-security",placeholder:"Enter 3 or 4 digits",name:"ccsercurity",required:""},null,8,["modelValue","state","maxlength"])]),_:1},8,["state"])):(f(),Q(l,{key:1,state:n.hasCardCvv,label:"CVV","label-for":"securityCode","label-class":"payment-form-form-group","invalid-feedback":"Please enter a valid CVV."},{label:y(()=>[t[24]||(t[24]=C(" CVV ",-1)),g(H,{target:"popover-cvv",placement:"auto",triggers:"click blur"},{title:y(()=>[o("div",Tr,[o("button",{class:"close-popover",onClick:t[5]||(t[5]=h=>n.togglePopover(!1))},[g(m,{icon:["fal","times-circle"],size:"lg"})])])]),default:y(()=>[s.card===null||n.isUnknown||!n.isAmex?(f(),p("div",_r,[o("p",Hr,[s.card?x("",!0):(f(),p("span",Nr,"For Visa, and Mastercard,")),t[14]||(t[14]=C(" the ",-1)),t[15]||(t[15]=o("strong",null,"3 digits",-1)),t[16]||(t[16]=C(" on the ",-1)),t[17]||(t[17]=o("em",null,"back",-1)),t[18]||(t[18]=C(" of your card. ",-1))]),o("img",{src:s.cvvBackImageUrl,alt:""},null,8,Mr)])):x("",!0),s.card===null||n.isUnknown||n.isAmex?(f(),p("div",Ur,[o("p",Wr,[s.card?x("",!0):(f(),p("span",Vr,"For American Express,")),t[19]||(t[19]=C(" the ",-1)),t[20]||(t[20]=o("strong",null,"4 digits",-1)),t[21]||(t[21]=C(" on the ",-1)),t[22]||(t[22]=o("em",null,"front",-1)),t[23]||(t[23]=C(" of your card. ",-1))]),o("img",{src:s.cvvFrontImageUrl,alt:""},null,8,Br)])):x("",!0)]),_:1})]),default:y(()=>[o("div",{id:"securityCode-container",ref:"securityCodeContainer",class:ge(n.securityCodeClass)},null,2)]),_:1},8,["state"]))])]),e.isAuth?(f(),p("div",Rr,[o("div",Fr,[g(N,{modelValue:n.checkoutState.saveCard,"onUpdate:modelValue":t[6]||(t[6]=h=>n.checkoutState.saveCard=h),condition:"save-card"},{label:y(()=>[...t[25]||(t[25]=[C("Save payment details for future orders.",-1)])]),_:1},8,["modelValue"])])])):x("",!0)],512),[[ae,!s.loading]])],36)}const zr=Ue(tr,[["render",Dr],["__scopeId","data-v-a7c78fca"]]);export{zr as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.