1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./B7uzyEHU.js","./CE1G-McA.js"])))=>i.map(i=>d[i]); 2import{_ as I}from"./W7INl7CO.js";const $=e=>{if(!e)return"";const t=new Date(e),r=("0"+(t.getUTCMonth()+1)).slice(-2),n=("0"+t.getUTCDate()).slice(-2);return`${t.getUTCFullYear()}-${r}-${n}`},T=new RegExp('^((?:[A-Za-z0-9!#$%&\'*+\\-/=?^_`{|}~]|(?<=^|\\.)"|"(?=$|\\.|@)|(?<=".*)[ .](?=.*")|(?<!\\.)\\.){1,64})(@)((?:[A-Za-z0-9.-])*(?:[A-Za-z0-9])\\.(?:[A-Za-z0-9]){2,})$'),A=e=>T.test(e),f=/^[0][xX]([a-zA-Z0-9]{8}|[a-zA-Z0-9]{16})$/,D=e=>f.test(e),R=e=>e.split("_").map((t,r)=>r===0?t.toLowerCase():t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()).join(""),i="crt",p="cer",u="pem",d="asc",l="der",y="vcf",v=e=>!!(e.endsWith(`.${p}`)||e.endsWith(`.${i}`)||e.endsWith(`.${d}`)||e.endsWith(`.${l}`)||e.endsWith(`.${u}`)),h=async e=>{if(!e)return null;const t=await I(()=>import("./B7uzyEHU.js").then(r=>r.i),__vite__mapDeps([0,1]),import.meta.url);return t.util?.binary?.raw.decode(t.pki.pemToDer(e).data)};async function N(e,t,r=h){if(!e||!t)throw new Error("There is no data to create the certificate text.");const n=[];if(t===i||t===p||t===u)return n.push("-----BEGIN CERTIFICATE-----"),n.push(e),n.push("-----END CERTIFICATE-----"),n.join(` 3`);if(t===d)return e;if(t===l){const a=e.split(` 4`).join("");n.push("-----BEGIN CERTIFICATE-----"),n.push(a),n.push("-----END CERTIFICATE-----");const o=n.join("");return await r(o)}if(t===y)return e;throw new Error("The text of the certificate could not be composed due to an incorrect file extension.")}function w(e){if(e===p||e===i||e===u||e===d)return"application/octet-stream";if(e===l)return"application/binary";if(e===y)return"text/vcard";throw new Error("The Blob type could not be generated due to wrong file extension.")}function E(e,t){const r=document.createElement("a"),n=URL.createObjectURL(e);r.href=n,r.download=t,document.body.appendChild(r),r.click(),setTimeout(function(){document.body.removeChild(r),window.URL.revokeObjectURL(n)},0)}function g(e,t,r){const n=new Blob([e],{type:r});E(n,t)}async function L(e,t,r,n=N,a=w,o=g){const c=await n(e,r),s=a(r);c&&o(c,t,s)}function x(e,t,r=L){const n=`FN;ENCODING=QUOTED-PRINTABLE;CHARSET=WINDOWS-1252:${e.name}`,a=`N;ENCODING=QUOTED-PRINTABLE;CHARSET=WINDOWS-1252:${e.name}`,o=`EMAIL;TYPE=internet;TYPE=pref:${e.emails[0]}`,c=`KEY;ENCODING=BASE64;TYPE=x509:${t}`,s=`BEGIN:VCARD 5VERSION:2.1 6${n} 7${a} 8${o} 9${c} 10END:VCARD`;r(s,`${e.emails[0]}-${e.certId.substring(0,7)}.vcf`,y)}async function F(e,t,r=E){const n=await $fetch("/api/certificates/download",{method:"POST",headers:{Accept:"application/x-pkcs7-certificates","Content-Type":"application/json"},body:JSON.stringify({x509Cert:e})});r(n,t)}function S(e){if(!e||Object.keys(e).length===0)throw new Error("The certificate object was not passed as an argument or an empty object was passed.");if("certificateBeanInfo"in e){const t=e.certificateBeanInfo;if(t.certFormat==="x509"){if("x509Certificate"in e)return"applicationContext"in t&&t.applicationContext?.toUpperCase()==="EDI_ENERGY"?{x509Certificate:e.x509Certificate,certType:t.certType,applicationContext:t.applicationContext}:{x509Certificate:e.x509Certificate,certType:t.certType};throw new Error("x509Certificate property is missing on SearchResultX509.")}else if(t.certFormat==="pgp"&&"pgpKey"in e)return e.pgpKey}throw new Error("Invalid certificate object format.")}const B=e=>e.map(t=>({type:"x509",certificateName:t.caName,validationBody:encodeURIComponent(t.caSubject)})),U=e=>[{type:"pgp",certificateName:`${e.userIDs[0]?.email??""} - ${e.shortKeyID}`,validationBody:e.keyID}],k=e=>{const r=e.split(".")[3]?.split("_").join("")??"";return r?(r[0]?.toLowerCase()??"")+r.slice(1):""};function P(e){return/^\d+(\.\d+)*$/.test(e)}const O=async(e,t,r)=>{let n;e.certFormat==="x509"?n={certId:e.certId,certType:`${e.certType}-certificate`,locale:r}:n={keyId:t.keyInfo.keyID,keyType:t.keyInfo.type,locale:r},await $fetch(`/api/certificates/${e.certFormat}/opt-out`,{method:"POST",body:n})},X=e=>{const t=e.applicationContext?.toUpperCase()==="EDI_ENERGY";return e.certFormat==="pgp"&&!t&&e.certType==="user"?"PGP_USER":e.certFormat==="pgp"&&!t&&e.certType==="domain"?"PGP_DOMAIN":e.certFormat==="x509"&&!t&&e.certType==="user"?"X509_USER":e.certFormat==="x509"&&!t&&e.certType==="domain"?"X509_DOMAIN":"UNKNOWN"};function G(e,t){const r=t.toLowerCase();return e.sort((n,a)=>{const o=m(n,r),c=m(a,r);if(o.matchLevel!==c.matchLevel)return o.matchLevel-c.matchLevel;if(o.certTypeLevel!==c.certTypeLevel)return o.certTypeLevel-c.certTypeLevel;const s=n.certificateBeanInfo.createTime||0;return(a.certificateBeanInfo.createTime||0)-s})}function m(e,t){const r=e.certificateBeanInfo,n=r.emails?.map(C=>C.toLowerCase())??[],a="x509Certificate"in e,o=r.certType==="user";let c=1;n.includes(t)&&(c=0);let s=3;return a&&o?s=0:!a&&o?s=1:a&&!o?s=2:s=3,{matchLevel:c,certTypeLevel:s}}export{D as a,X as b,A as c,L as d,v as e,$ as f,S as g,F as h,P as i,x as j,k as m,U as p,O as r,G as s,R as u,B as x};
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.