@sekyro/elements 0.1.0-rc.12 → 0.1.0-rc.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cdn/chunks/{capture-session-doc-FAMDLRRZ-QPOFTNTG.js → capture-session-doc-OT5L7P2W-27S5FD3I.js} +1 -1
- package/dist/cdn/chunks/chunk-3HWXZNEO.js +1 -0
- package/dist/cdn/chunks/chunk-3NOBU7TE.js +1 -0
- package/dist/cdn/chunks/{chunk-JI5WT66H.js → chunk-4UHFOHD4.js} +1 -1
- package/dist/cdn/chunks/chunk-6OVZIUQG.js +1 -0
- package/dist/cdn/chunks/{chunk-SDK2YXFV.js → chunk-7NYZYJ65.js} +1 -1
- package/dist/cdn/chunks/chunk-A5SXWFOO.js +1 -0
- package/dist/cdn/chunks/{chunk-YFJBTK3L.js → chunk-ARUBIBVG.js} +1 -1
- package/dist/cdn/chunks/{chunk-CVFJQIMW.js → chunk-CK3CQAFP.js} +1 -1
- package/dist/cdn/chunks/{chunk-GPGK6XZM.js → chunk-DKZUKWGP.js} +1 -1
- package/dist/cdn/chunks/{chunk-4YBL75VD.js → chunk-F7DKVXQW.js} +1 -1
- package/dist/cdn/chunks/{chunk-UN4V3UNQ.js → chunk-FKKDPSQW.js} +1 -1
- package/dist/cdn/chunks/{chunk-LBZCFEU4.js → chunk-IZOPN3L7.js} +2 -2
- package/dist/cdn/chunks/{chunk-BMUUDLFA.js → chunk-PYUD6W3P.js} +1 -1
- package/dist/cdn/chunks/chunk-RUUVQMYA.js +1 -0
- package/dist/cdn/chunks/{chunk-VHNWBOKW.js → chunk-SHOVUF5C.js} +1 -1
- package/dist/cdn/chunks/chunk-SSNEIJXI.js +3 -0
- package/dist/cdn/chunks/{chunk-7JUL7AKT.js → chunk-VI6GYKFP.js} +1 -1
- package/dist/cdn/chunks/chunk-YLKAOH5O.js +1 -0
- package/dist/cdn/chunks/{create-document-capture-WFTNVMCE-QOCPJSAU.js → create-document-capture-UWIOYOJN-HGOY7QHE.js} +1 -1
- package/dist/cdn/chunks/{detector-scanic-S4PB2RNW-3KSM3MW5.js → detector-scanic-F2PZUPJ5-LJIJE4EQ.js} +1 -1
- package/dist/cdn/chunks/{document-capture-view-GENB535Z-YBRM7NWN.js → document-capture-view-57N5YWTH-PK233SM3.js} +1 -1
- package/dist/cdn/chunks/{eid-view-IQRZGEMP-SPGYQDQP.js → eid-view-IQRZGEMP-S4CA2XHE.js} +1 -1
- package/dist/cdn/chunks/{email-otp-view-CL76K5TY-TJMSLYLZ.js → email-otp-view-CL76K5TY-TBSVRBPS.js} +1 -1
- package/dist/cdn/chunks/{flow-views-C3EIMXME-ODOF67JZ.js → flow-views-IAR45I3I-532HULEY.js} +1 -1
- package/dist/cdn/chunks/{form-view-MEYCK437-JBO5DNG5.js → form-view-MEYCK437-HEBYLC2O.js} +1 -1
- package/dist/cdn/chunks/plan-runner-T32MAX5F-UMGOSLJM.js +1 -0
- package/dist/cdn/chunks/{portrait-capture-view-VTN2VU3E-JH34ISLI.js → portrait-capture-view-ZF4YAMA6-ZBYYEIH5.js} +1 -1
- package/dist/cdn/chunks/{portrait-review-view-JTRGDYNV-C2O6OFYY.js → portrait-review-view-LOS5AYBI-XHDB2V3K.js} +1 -1
- package/dist/cdn/chunks/{proof-of-address-view-UQOZZXQO-T3QOIQNE.js → proof-of-address-view-X2EVWZBX-KTHPWCWT.js} +1 -1
- package/dist/cdn/define.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunk-43Y4MKKF.js +1 -0
- package/dist/{chunk-753PBLDK.js → chunk-C7AP2EMK.js} +1 -1
- package/dist/{chunk-LGFZBFVB.js → chunk-NYLIZY4Y.js} +2 -2
- package/dist/{chunk-PYQREZ33.js → chunk-PHI7KVJY.js} +1 -1
- package/dist/define.cjs +4 -4
- package/dist/define.js +1 -1
- package/dist/{document-capture-view-GENB535Z-L5V7YSPP.js → document-capture-view-57N5YWTH-BFPOD3RA.js} +1 -1
- package/dist/{flow-views-C3EIMXME-GGE4OUEO.js → flow-views-IAR45I3I-IFHB5BCY.js} +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.js +1 -1
- package/dist/{portrait-capture-view-VTN2VU3E-2HKWLWRG.js → portrait-capture-view-ZF4YAMA6-XC2X56PD.js} +1 -1
- package/dist/{portrait-review-view-JTRGDYNV-TNR7WBYD.js → portrait-review-view-LOS5AYBI-RP6TNHLA.js} +1 -1
- package/dist/{proof-of-address-view-UQOZZXQO-XJTGU3G6.js → proof-of-address-view-X2EVWZBX-SIJUQ4SR.js} +1 -1
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/cdn/chunks/chunk-2FETDQV5.js +0 -1
- package/dist/cdn/chunks/chunk-FVWYONHZ.js +0 -1
- package/dist/cdn/chunks/chunk-K4BLQMYZ.js +0 -1
- package/dist/cdn/chunks/chunk-Q5BUNNRN.js +0 -3
- package/dist/cdn/chunks/chunk-XDRH4VWV.js +0 -1
- package/dist/cdn/chunks/chunk-XSGZY4JI.js +0 -1
- package/dist/cdn/chunks/chunk-YLH3WX7Y.js +0 -1
- package/dist/cdn/chunks/plan-runner-LSQTIO6L-XZJIKXPZ.js +0 -1
- package/dist/chunk-ZUVOUGIA.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as qe,b as De,i as Ge}from"./chunk-FVWYONHZ.js";import"./chunk-JI5WT66H.js";import"./chunk-YZWLMKXA.js";import{d as $e}from"./chunk-K4BLQMYZ.js";import"./chunk-2FETDQV5.js";import"./chunk-XSGZY4JI.js";import{e as Ke}from"./chunk-5JSOPXYS.js";import"./chunk-IO7MUUC6.js";import"./chunk-Q5ZVLMKQ.js";import"./chunk-L244IUB3.js";import"./chunk-Y6PC7FZV.js";import"./chunk-KHSYTJ46.js";import"./chunk-L22GFJQV.js";import{B as Re,C as ue,D as W,E as ae,F as je,G as Ne,I as Oe,J as Ve,a as $,d as re,e as ne,g as le,h as Ae,i as ie,j as xe,k as Pe,l as Se,n as Te,o as ce,q as oe,r as de,t as Ce,u as Ee,v as X,y as Ie}from"./chunk-YLH3WX7Y.js";import"./chunk-GPGK6XZM.js";import{a as Me}from"./chunk-4YBL75VD.js";import{b as Be,c as Le,d as Fe}from"./chunk-P7K7ELYZ.js";import{m as Ue}from"./chunk-6MYG4HWP.js";import"./chunk-JS2IXPNL.js";import{a as r}from"./chunk-4FHWXBOB.js";var ee={fp12:"08390000c48a",engine:"sekyro-ocr-1",precision:"fp32",files:{"sekyro-ocr.wasm":{bytes:3550608,sha256:"c15968a6de3d2225e2fdbf36d71a9214c2910419056c6878444fd2d0567bb748",tier:"live",contentType:"application/wasm"},"sekyro-ocr.mjs":{bytes:4270,sha256:"209a78d96ca53344996a0c2300aed4ff8a5c69e142713216975a2840eec08cac",tier:"bundled",contentType:"text/javascript"},"det.param":{bytes:24252,sha256:"c39ba0b1195e8ad37cfc5bdd7acedcfc1d9cb901e7b8eb1c9c4f6e5a66c04eb3",tier:"live",contentType:"text/plain"},"det.bin":{bytes:4685856,sha256:"652bafe366565109a1a5766caf482bc46f01481f8044d3a785bd9a1be67c63bb",tier:"live",contentType:"application/octet-stream"},"mrz-rec.param":{bytes:3510,sha256:"bc69b1b9683e35f6605b21001fadeb81468063459c00c0fc83c67c139f23df01",tier:"live",contentType:"text/plain"},"mrz-rec.bin":{bytes:494196,sha256:"de93a2aa2f08670cc7dedd17ba378d2f5d7cf6ae409054a9eac863a02c2febae",tier:"live",contentType:"application/octet-stream"},"mrz_dict.txt":{bytes:73,sha256:"b19858a4de2ccbbbdd4b53982188ea2c7664013183bbd1ae9d20ab52c661f97f",tier:"live",contentType:"text/plain"},"latin-rec.param":{bytes:19602,sha256:"2ae30dfdc7ee482c6cbbc0419c16ee125e880e9eaf69053d61953694bb0fcf4c",tier:"lazy",contentType:"text/plain"},"latin-rec.bin":{bytes:10750388,sha256:"f91ebdcf4d6b58c58a87704160e59d07ae56bc2d5021eae09d095c5a20bf7525",tier:"lazy",contentType:"application/octet-stream"},"ppocr_keys_v1.txt":{bytes:26249,sha256:"28b2362ad4ab2dc38769aa72feb535e3a9ddb3fd2a7585a05920e6393b1dc7f7",tier:"lazy",contentType:"text/plain"},"arabic-rec.param":{bytes:9858,sha256:"4e5cc85667dfaaa0c67d3f308400645a578c08bd43f952cab6c55b7bce143ea9",tier:"lazy",contentType:"text/plain"},"arabic-rec.bin":{bytes:8853572,sha256:"5acc3265a1738dc31316258383830d5dbdfa5e8ebc2e710f9001f832ecfbffb0",tier:"lazy",contentType:"application/octet-stream"},"arabic_dict.txt":{bytes:405,sha256:"637c27c88512c22089bef927b34ada08f748dc132ac70facd68d8202384c2726",tier:"lazy",contentType:"text/plain"}}};var ln=Object.keys(ee.files).filter(e=>ee.files[e].tier==="live"),cn=Object.keys(ee.files).filter(e=>ee.files[e].tier==="lazy");function ze(e,t){return e==="hosted"?"/models-ocr":t==="live"?"https://assets.sekyro.ai/sdk/web/ocr":"https://assets-staging.sekyro.ai/sdk/web/ocr"}r(ze,"E");var yt=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"],gt=["carte_identite","passport","residence_permit","drivers_license"],_t=["carte_identite","passport","residence_permit"];function ye(e,t){let n=e.byIssuer?.[t]??e.default;return gt.filter(o=>n==="*"?_t.includes(o):n.includes(o))}r(ye,"dt");function et(e,t=yt){return[...new Set([...t,...Object.keys(e.byIssuer??{})])].filter(n=>ye(e,n).length>0).sort()}r(et,"Nn");function bt(e){if(e.acceptedDocuments)return e.acceptedDocuments;let t=e.acceptedDocumentTypes?.length?[...e.acceptedDocumentTypes]:["carte_identite","passport"];return{default:[],byIssuer:{MR:t}}}r(bt,"Le");var vt=640,wt=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),He=6,Ze=1500,We={sharpness:1,exposure:1,meanLuma:128},pe=null;function kt(e,t){try{pe??(pe=document.createElement("canvas"));let n=pe,o=96/Math.max(1,t.width);n.width=Math.max(1,Math.round(t.width*o)),n.height=Math.max(1,Math.round(t.height*o));let i=n.getContext("2d");if(i===null)return We;i.drawImage(e,t.x,t.y,t.width,t.height,0,0,n.width,n.height);let l=i.getImageData(0,0,n.width,n.height);return{sharpness:Le(l),exposure:Fe(l),meanLuma:Be(l)}}catch{return We}}r(kt,"ft");async function Mt(e,t){let n=e.source;return"convertToBlob"in n?n.convertToBlob({type:"image/jpeg",quality:t}):new Promise((o,i)=>{n.toBlob(l=>l===null?i(new Error("encode failed")):o(l),"image/jpeg",t)})}r(Mt,"mt");function tt(e,t={}){let n=t.now??(()=>performance.now()),o=t.setTimer??((f,j)=>setTimeout(f,j)),i=t.clearTimer??(f=>clearTimeout(f)),l=t.encode??Mt,c=t.quality??kt,d=e.tuningVersion??null,_=new Set,w=!1,P=e.video??null,v=null,m=t.grabFrame??null,b=null,S=1e3/He,T=null,U=null,I=!1,R=!1,O=Number.NEGATIVE_INFINITY,N=null,k=0,u=null,h=null,M=Promise.all([import("./icao-gate-T3BTOKFJ-BWMLKL7A.js"),import("./icao-tuning-4ETMF53W-FRBTB5R7.js"),import("./create-portrait-capture-5VGYZUOK-KTCFCHTN.js"),import("./landmarker-KB7LVXAU-F7BQTP3H.js"),import("./background-monitor-A7FKJOAG-K3WF3C2D.js")]).then(async([f,j,V,z,Z])=>{let G=j.resolveIcaoTuning(e.tuning,e.tuningVersion??void 0);G.background.required&&(U=Z.createBackgroundMonitor({tuning:G.backgroundCheck,assetBaseUrl:e.assetBaseUrl??"/models-v3",...t.createSegmenter!==void 0?{createSegmenter:t.createSegmenter}:{},now:n})),v=f.createIcaoGate(G,{policy:e.policy??"reject"}),m??(m=V.defaultGrabber()),b=V.observe,S=1e3/Math.min(He,G.cadenceHz);let H=(t.createLandmarker??z.createFaceLandmarker)(e.assetBaseUrl??"/models-v3"),L=await new Promise((a,s)=>{let p=setTimeout(()=>{s(new Error("landmarker init timeout")),H.then(y=>y.close(),()=>{})},z.LANDMARKER_INIT_TIMEOUT_MS);H.then(y=>{clearTimeout(p),a(y)},y=>{clearTimeout(p),s(y)})});w?L.close():T=L}).catch(()=>{I=!0}),A=r(f=>{for(let j of _)j({holding:R||I,update:f})},"Z"),g=r(()=>{if(N=null,!(w||T===null||v===null||m===null||b===null||P===null)){if(n()-O>Ze){A(null);return}try{let f=m(P,vt);if(f!==null){let j=Math.max(n(),k+1);k=j;let V=T.detect(f.source,j),z=P.videoWidth||f.width,Z=P.videoHeight||f.height,G=b(V,f,z,Z);G.geometry!==null&&U!==null&&(G.backgroundCheck=U.measure(f,G.geometry.box,z,Z));let H=v.push(G,n());R=H.ready,A(H)}}catch{}N=o(g,S)}},"G"),x=r(()=>{let f=n()-O>Ze;O=n(),f&&(v?.reset(),R=!1,u=null,h=null),N===null&&T!==null&&!w&&(N=o(g,0))},"ne"),C=r(()=>{let f=m===null||P===null?null:m(P,null);if(f===null||v===null||Math.max(f.width,f.height)<e.still.minLongSidePx)return Promise.resolve(null);let j=v.summary();return l(f,e.still.jpegQuality).then(V=>({image:V,width:f.width,height:f.height,gate:j}),()=>null)},"W"),B=null;return{engineOptions:{measureQuality:r((f,j)=>{P=f,x();let V=c(f,j);return R||I?V:{...V,sharpness:0}},"measureQuality"),telemetry:r(f=>{if(f.type!=="fired"||w)return;u=C();let j=B;j!==null&&u.then(V=>V===null?void 0:j(V).catch(()=>{})),R=!1,N!==null&&i(N),N=null,O=Number.NEGATIVE_INFINITY},"telemetry")},decorate:r(f=>{let j=new WeakMap,V=new Map,z=r(L=>{let a=j.get(L);return a===void 0&&(a=(async()=>{let s=await X(f,"image","image/jpeg",L.image.size,{engine:"portrait"});return await f.uploadToSpaces(s.uploadUrl,L.image,"image/jpeg"),(await f.completeMedia(s.key)).key})(),a.catch(()=>j.delete(L)),j.set(L,a)),a},"T");B=z;let Z=r(async L=>{let a;try{a=await z(L)}catch(s){let p=s?.code;if(typeof p=="string"&&wt.has(p))throw s;return null}return{media:{portrait:a},gate:ne(L.gate),...d!==null?{tuningVersion:d}:{}}},"H"),G=f.submitCheck.bind(f),H=r((async(L,a,s)=>{if(L!=="liveness")return G(L,a,s);let p=s?.idempotencyKey,y=p===void 0?void 0:V.get(p);if(y===void 0){let q=u;y=q===null?Promise.resolve(null):q.then(K=>K===null?null:Z(K)),p!==void 0&&(V.set(p,y),y.catch(()=>V.delete(p)))}let E=await y;if(E===null)return G("liveness",a,s);let F=await G("liveness",{...a,portraitIcao:E},s);return h=E,F}),"M");return new Proxy(f,{get(L,a){if(a==="submitCheck")return H;let s=Reflect.get(L,a);return typeof s=="function"?s.bind(L):s}})},"decorate"),onGate:r(f=>(_.add(f),()=>_.delete(f)),"onGate"),lastPortraitInput:r(()=>h,"lastPortraitInput"),destroy:r(()=>{w=!0,u=null,h=null,N!==null&&i(N),N=null,_.clear(),M.then(()=>{T?.close(),T=null,U?.close(),U=null})},"destroy")}}r(tt,"Dn");function At(e){return e.idNumberBound??e.nniBound}r(At,"Ge");function xt(e){return e===void 0?void 0:e.idNumberFromDocument??e.nniFromDocument}r(xt,"Be");function Pt(e){let t=e.idNumberMasked??e.nniMasked;return typeof t=="string"&&t!==""?t:void 0}r(Pt,"Ue");var rt=Object.freeze({nni_invalid:"id_number_invalid",nni_not_found:"registry_record_not_found",nni_recheck:"id_number_recheck",document_nni_mismatch:"document_id_number_mismatch",nni_locked:"id_number_locked",nni_unbound:"id_number_unbound",missing_nni:"missing_id_number",registry_needs_nni_source:"registry_needs_id_number_source"}),St=new Map(Object.entries(rt)),hn=new Map(Object.entries(rt).map(([e,t])=>[t,e]));function Tt(e){return St.get(e)??e}r(Tt,"je");var D={fullNameMin:2,fullName:200,email:254,occupation:120,shortText:120,longText:1e3,addressLine:120,addressLines:4,city:80,postcode:16,number:1e12,dateMin:"1900-01-01",dateMax:"2100-12-31"},Ct=new Set(["full_name","birth_date","email","phone","address","country","occupation"]),Et=new Set(["short_text","long_text","single_choice","multiple_choice","yes_no","date","number"]),It=new Set(["ar","fa","he","ur"]);function Rt(e){return It.has(e.split("-")[0]?.toLowerCase()??"")?"rtl":"ltr"}r(Rt,"qe");function jt(e){if(typeof e!="object"||e===null)return null;let t=e;if(typeof t.locale!="string"||!Array.isArray(t.questions)||t.questions.length===0)return null;let n=t.consents??[];if(!Array.isArray(n))return null;for(let i of t.questions)if(!Nt(i))return null;for(let i of n)if(!Ot(i))return null;let o={locale:t.locale,questions:t.questions,consents:n};return typeof t.title=="string"&&t.title.trim()!==""&&(o.title=t.title),typeof t.intro=="string"&&t.intro.trim()!==""&&(o.intro=t.intro),typeof t.prefill=="object"&&t.prefill!==null&&!Array.isArray(t.prefill)&&(o.prefill=t.prefill),o}r(jt,"Ye");function Nt(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.id!="string"||typeof t.required!="boolean"?!1:t.kind==="field"?typeof t.field=="string"&&Ct.has(t.field):t.kind!=="custom"||typeof t.type!="string"||!Et.has(t.type)||typeof t.label!="string"?!1:t.type==="single_choice"||t.type==="multiple_choice"?Array.isArray(t.choices)&&t.choices.length>=2&&t.choices.every(n=>typeof n=="object"&&n!==null&&typeof n.value=="string"&&typeof n.label=="string"):!0}r(Nt,"_t");function Ot(e){if(typeof e!="object"||e===null)return!1;let t=e;if(typeof t.id!="string"||typeof t.required!="boolean"||typeof t.text!="string")return!1;if(t.link===void 0)return!0;let n=t.link;return typeof n=="object"&&n!==null&&typeof n.url=="string"&&/^https:\/\//.test(n.url)&&typeof n.label=="string"}r(Ot,"bt");var Vt=/^(\d{4})-(\d{2})-(\d{2})$/;function Ut(e){if(typeof e!="string")return!1;let t=Vt.exec(e);return t===null?!1:new Date(Date.UTC(Number(t[1]),Number(t[2])-1,Number(t[3]))).toISOString().slice(0,10)===e&&e>=D.dateMin&&e<=D.dateMax}r(Ut,"Ct");function Bt(e){return typeof e=="number"&&Number.isFinite(e)&&Math.abs(e)<D.number&&Math.round(e*100)/100===e}r(Bt,"Pt");function nt(e){for(let t of e.matchAll(/\d[\d -]{11,}\d/g)){let n=t[0].replace(/[ -]/g,"");if(n.length>=13&&n.length<=19&&Lt(n))return!0}return!1}r(nt,"Ze");function Lt(e){let t=0;for(let n=0;n<e.length;n++){let o=Number(e[e.length-1-n]);n%2===1&&(o*=2,o>9&&(o-=9)),t+=o}return t%10===0}r(Lt,"At");var Ft=/^[^\s@]+@[^\s@.]+(\.[^\s@.]+)+$/,Kt=/^\+[1-9]\d{6,14}$/,it=/^[A-Z]{2}$/,qt=r(e=>e===void 0||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0,"xt");function ot(e=Date.now()){return new Date(e).toISOString().slice(0,10)}r(ot,"Qe");function fe(e,t,n=ot()){let o=[];for(let i of e.questions){let l=t.answers[i.id];if(qt(l)){i.required&&o.push({id:i.id,code:"required"});continue}let c=i.kind==="field"?Dt(i.field,l,n):$t(i,l,n);c!==null&&o.push({id:i.id,...c})}for(let i of e.consents)i.required&&t.consents[i.id]!==!0&&o.push({id:i.id,code:"consent_required"});return o}r(fe,"X");function se(e,t,n=1){if(typeof e!="string")return{code:"required"};let o=e.trim();return[...o].length>t?{code:"too_long",params:{max:t}}:[...o].length<n?{code:"too_short",params:{min:n}}:nt(o)?{code:"card_number"}:null}r(se,"z");function at(e,t,n={}){return Ut(e)?n.period==="past"&&e>=t?{code:"date_not_past"}:n.period==="future"&&e<=t?{code:"date_not_future"}:n.min!==void 0&&e<n.min?{code:"date_too_early",params:{date:n.min}}:n.max!==void 0&&e>n.max?{code:"date_too_late",params:{date:n.max}}:null:{code:"date_invalid"}}r(at,"$e");function Dt(e,t,n){switch(e){case"full_name":return se(t,D.fullName,D.fullNameMin);case"occupation":return se(t,D.occupation);case"birth_date":return at(t,n,{period:"past"});case"email":return typeof t=="string"&&t.trim().length<=D.email&&Ft.test(t.trim())?null:{code:"email_invalid"};case"phone":return typeof t=="string"&&Kt.test(t)?null:{code:"phone_invalid"};case"country":return typeof t=="string"&&it.test(t)?null:{code:"choice_invalid"};case"address":return Gt(t)?null:{code:"address_invalid"};default:return null}}r(Dt,"Et");function Gt(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=Array.isArray(t.lines)?t.lines.filter(o=>typeof o=="string"&&o.trim()!==""):[];return typeof t.country=="string"&&it.test(t.country)&&typeof t.city=="string"&&t.city.trim()!==""&&t.city.trim().length<=D.city&&n.length>=1&&n.length<=D.addressLines&&n.every(o=>o.trim().length<=D.addressLine&&!nt(o))&&(t.postcode===void 0||typeof t.postcode=="string"&&t.postcode.trim().length<=D.postcode)}r(Gt,"It");function $t(e,t,n){let o=new Set((e.choices??[]).map(i=>i.value));switch(e.type){case"short_text":return se(t,D.shortText);case"long_text":return se(t,D.longText);case"single_choice":return typeof t=="string"&&o.has(t)?null:{code:"choice_invalid"};case"multiple_choice":return Array.isArray(t)&&t.length>0&&new Set(t).size===t.length&&t.every(i=>o.has(i))?null:{code:"choice_invalid"};case"yes_no":return typeof t=="boolean"?null:{code:"choice_invalid"};case"date":{let i=e.options??{};return at(t,n,{...typeof i.min=="string"?{min:i.min}:{},...typeof i.max=="string"?{max:i.max}:{},...i.period==="past"||i.period==="future"?{period:i.period}:{}})}case"number":{if(typeof t!="number"||!Number.isFinite(t)||Math.abs(t)>=D.number)return{code:"number_invalid"};let i=e.options??{};return i.integer===!0&&!Number.isInteger(t)?{code:"number_not_integer"}:Bt(t)?typeof i.min=="number"&&t<i.min?{code:"number_too_small",params:{min:i.min}}:typeof i.max=="number"&&t>i.max?{code:"number_too_large",params:{max:i.max}}:null:{code:"number_decimals"}}default:return null}}r($t,"Mt");function zt(e,t,n,o=ot()){let i=e?.errors;return Array.isArray(i)?i.flatMap(l=>{if(typeof l!="object"||l===null)return[];let{id:c,code:d}=l;return typeof c!="string"||typeof d!="string"?[]:[Zt(c,d,t,n)]}):fe(t,n,o)}r(zt,"Je");var Ht={full_name:D.fullName,occupation:D.occupation,email:D.email,short_text:D.shortText,long_text:D.longText};function Zt(e,t,n,o){let i=n.questions.find(_=>_.id===e),l=i===void 0?void 0:i.kind==="field"?i.field:i.type,c=o.answers[e],d=i!==void 0&&i.kind==="custom"?i.options??{}:{};switch(t){case"required":case"card_number":return{id:e,code:t};case"consent_required":return{id:e,code:"consent_required"};case"too_short":return{id:e,code:t,params:{min:l==="full_name"?D.fullNameMin:1}};case"too_long":{let _=l===void 0?void 0:Ht[l];return _===void 0?{id:e,code:t}:{id:e,code:t,params:{max:_}}}case"not_a_choice":return{id:e,code:"choice_invalid"};case"not_in_past":return{id:e,code:"date_not_past"};case"not_in_future":return{id:e,code:"date_not_future"};case"not_an_integer":return{id:e,code:"number_not_integer"};case"out_of_range":return Wt(e,l,c,d);case"invalid":return i===void 0?n.consents.some(_=>_.id===e)?{id:e,code:"consent_required"}:{id:e,code:t}:{id:e,code:Qt(l,c)};default:return{id:e,code:t}}}r(Zt,"vt");function Wt(e,t,n,o){if(t==="date"){let c=typeof o.min=="string"?o.min:void 0,d=typeof o.max=="string"?o.max:void 0;return d!==void 0&&(c===void 0||typeof n=="string"&&n>d)?{id:e,code:"date_too_late",params:{date:d}}:c!==void 0?{id:e,code:"date_too_early",params:{date:c}}:{id:e,code:"date_invalid"}}let i=typeof o.min=="number"?o.min:void 0,l=typeof o.max=="number"?o.max:void 0;return l!==void 0&&(i===void 0||typeof n=="number"&&n>l)?{id:e,code:"number_too_large",params:{max:l}}:i!==void 0?{id:e,code:"number_too_small",params:{min:i}}:{id:e,code:"number_invalid"}}r(Wt,"Tt");function Qt(e,t){switch(e){case"email":return"email_invalid";case"phone":return"phone_invalid";case"birth_date":case"date":return"date_invalid";case"number":return typeof t=="number"&&Number.isFinite(t)&&Math.abs(t)<D.number?"number_decimals":"number_invalid";case"address":return"address_invalid";case"full_name":case"occupation":case"short_text":case"long_text":return"required";default:return"choice_invalid"}}r(Qt,"Nt");var Yt=new Set(["phone_otp","email_otp","national_eid","document","nfc","population_registry","supplied_identity","summary_confirm","liveness","portrait","face_match","aml_screening","face_dedup","age_estimation","proof_of_address","form"]),Jt=new Set(["supplied_identity","aml_screening","face_dedup","age_estimation"]),ge=["document","population_registry","national_eid"],_e=["phone_otp","email_otp"],st={identity_method:ge,contact:_e},Xt=["population_registry","document"],be="platform_unsupported",er=new Set(["prefilled","user_entered","prefilled_or_entered"]),tr={phone_otp:"contact",email_otp:"contact",eid_auth:"identity",doc_ocr:"identity",nfc_chip:"identity",population_registry:"identity",liveness:"live_photo",portrait_icao:"live_photo",face_match:"live_photo",poa:"documents",form:"form"};function Q(e){return e.section??tr[e.checkType]??null}r(Q,"L");function lt(e,t){let n=e.plan?.choice;if(n===void 0||n.locked)return;let o=n.options.find(i=>i.id!==n.selected&&i.available!==!1&&t.includes(i.service));return o===void 0?void 0:{nodeId:n.nodeId,option:o}}r(lt,"de");function ve(e){let t=e.plan,n=t?.choice;if(t===void 0||n===void 0||n.locked||t.current===null||t.current===n.nodeId||ce(e))return null;let o=st[n.kind]??[...ge,..._e],i=n.options.flatMap(d=>d.available===!1||!o.includes(d.service)?[]:[d.nationalEid!=null?{id:d.id,service:d.service,nationalEid:d.nationalEid}:{id:d.id,service:d.service}]),l=t.steps.find(d=>d.id===t.current)?.service,c=n.selected??i.find(d=>d.service===l)?.id??null;return i.some(d=>d.id!==c)?{nodeId:n.nodeId,kind:n.kind,current:c,options:i}:null}r(ve,"le");function ct(e){return e==null?[]:e.options.filter(t=>t.id!==e.current)}r(ct,"tt");function rr(e){let t=e.simulation;if(typeof t!="object"||t===null)return;let{otpCode:n,skipCapture:o}=t;if(typeof n!="string"||n===""||typeof o!="boolean")return;let i=Ee(e);return i!==void 0?{otpCode:n,skipCapture:o,reason:i}:{otpCode:n,skipCapture:o}}r(rr,"Gt");function nr(e){let t=(e.plan?.sections??[]).map(c=>({id:c.id,state:c.state})),n={sessionId:de(e.sessionId),orgName:e.orgName,sandbox:e.sandbox===!0,returning:e.returning===!0,consentRecorded:e.consentRecorded,expiresAt:e.expiresAt,sections:t.map(c=>c.id),progress:t,purpose:e.purpose??"identity"};e.branding!==void 0&&(n.branding=e.branding),e.cameraUnavailableHandled===!0&&(n.cameraUnavailableHandled=!0);let o=rr(e);o!==void 0&&(n.simulation=o);let i=e.testerGate;i?.offered===!0&&typeof i.attemptsLeft=="number"&&i.attemptsLeft>0&&(n.testerGate={attemptsLeft:i.attemptsLeft});let l=ve(e);return l!==null&&(n.switchable=l),n}r(nr,"Bt");function ir(e){let t={attemptsRemaining:Pe(e),attemptsExhausted:e.attempts.used>=e.attempts.max};return e.reason!==void 0&&(t.reason=e.reason),e.retakeHint!==void 0&&(t.retakeHint=e.retakeHint),t}r(ir,"Ut");var dt={phone_otp:"phone",email_otp:"email"};function or(e,t){let n=lt(e,[t==="phone_otp"?"email_otp":"phone_otp"]);return n===void 0?void 0:dt[n.option.service]}r(or,"Kt");function ar(e,t,n,o){let i=t.checkType==="email_otp",l=(i?t.emailOtp:t.otp)??{},c=i?t.emailOtp?.emailSource:t.otp?.numberSource,d=c!==void 0&&er.has(c)?c:i?"prefilled_or_entered":"user_entered",_=typeof l.sentToMasked=="string"&&l.sentToMasked.length>0,w=l.prefilled===!0,P=or(e,i?"email_otp":"phone_otp"),v={key:t.checkType,context:n,section:Q(t),phase:_?"verify":"send",canSwitch:P!==void 0,...o},m=i?{kind:"email_otp",...v,emailSource:d,needsEmail:d!=="prefilled"&&!w}:{kind:"phone_otp",...v,numberSource:d,needsPhone:d!=="prefilled"&&!w,channels:(t.otp?.channels??[]).filter(b=>b==="whatsapp"||b==="sms")};if(P!==void 0&&(m.switchChannel=P),w&&(m.prefilled=!0),_&&(m.sentToMasked=l.sentToMasked),!i&&t.otp?.channel!==void 0&&(m.channel=t.otp.channel),!i&&Array.isArray(t.phoneCountries)&&(m.phoneCountries=t.phoneCountries.filter(b=>typeof b=="string"&&/^[A-Z]{2}$/.test(b))),!i&&Array.isArray(t.phoneRules)){let b=m.phoneCountries??[];m.phoneRules=t.phoneRules.flatMap(S=>{let T=cr(S);return T!==void 0&&b.includes(T.code)?[T]:[]})}return!i&&t.phoneInternational===!0&&(m.phoneInternational=!0),l.expiresAt!==void 0&&(m.codeExpiresAt=l.expiresAt),l.resendAvailableAt!==void 0&&(m.resendAvailableAt=l.resendAvailableAt),m}r(ar,"jt");var sr=/^[\d[\]\-|()?:^]{1,64}$/;function lr(e){try{return typeof e=="string"&&sr.test(e)&&new RegExp(e)!==null}catch{return!1}}r(lr,"Yt");var Qe=r(e=>typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=15,"ze");function cr(e){let{code:t,dial:n,trunk:o,lengths:i,formats:l}=e??{};if(typeof t!="string"||typeof n!="string"||!/^\d{1,3}$/.test(n)||o!==void 0&&(typeof o!="string"||!/^\d{1,3}$/.test(o))||!Array.isArray(i)||i.length===0||!i.every(Qe))return;let c={code:t,dial:n,lengths:[...i].sort((d,_)=>d-_)};if(o!==void 0&&(c.trunk=o),l!==void 0){if(!(Array.isArray(l)&&l.length<=8&&l.every(d=>lr(d?.leading)&&Array.isArray(d.groups)&&d.groups.every(Qe)&&i.includes(d.groups.reduce((_,w)=>_+w,0)))))return;c.formats=l.map(d=>({leading:d.leading,groups:[...d.groups]}))}return c}r(cr,"Zt");function dr(e,t,n,o){let i=At(e)===!0?"bound":xt(t)===!0?"document":"typed",l=i==="typed"&&t.state==="input_required"&&t.reason!==void 0&&Tt(t.reason)==="id_number_recheck",c=ct(ve(e)),d=!o.attemptsExhausted&&c.length===1&&c[0]?.service==="document";return{kind:"registry",key:"registry",context:n,section:Q(t),state:t.state==="input_required"?"input_required":"pending",source:i,recheck:l,canUseDocument:d,...o}}r(dr,"Wt");function ur(e,t,n,o,i){let l=[...t.acceptedSides??[]],c={kind:"document",key:"document",context:n,section:Q(t),side:l.includes("recto")?"verso":"recto",acceptedSides:l,documents:bt(e),photo:ke(we(e.documents),i),...o};return e.detectedCountry!==void 0&&(c.detectedCountry=e.detectedCountry),fr(e)&&(c.ageStepUp=!0),c}r(ur,"Qt");function we(e,t=!0){let n=e?.source==="upload"||e?.source==="choice"?e.source:"camera",o=e?.sourcePick==="camera"||e?.sourcePick==="upload"?e.sourcePick:null;return{source:n,pick:o,uploadOffered:t&&e?.uploadOffered===!0}}r(we,"pe");function ke(e,t){return t?{...e,cameraOnPhone:!0}:e}r(ke,"fe");var pr=10*1024*1024;function mr(e,t,n,o,i){let l=e.proofOfAddress,c=l?.pdf?.maxBytes,d=l?.phase==="holder_letter"?"holder_letter":"document";return{kind:"proof_of_address",key:"proof_of_address",context:n,section:Q(t),phase:d,rule:l?.rule??{country:null,countryFrom:"global",source:"preset_global",kinds:[]},nameMatch:l?.nameMatch??"exact_person",photo:ke(we(l),i),maxPages:3,pdf:{maxBytes:typeof c=="number"&&c>0?c:pr,maxPages:3},licenceAddressAccepted:d==="document"&&l?.licenceAddressAccepted===!0,...o}}r(mr,"Jt");function fr(e){let t=xe(e).find(o=>o.checkType==="age_estimation"),n=t?.reason;return t?.state==="failed"&&(n==="age_uncertain"||n==="age_unavailable")}r(fr,"zt");function hr(e){let t=oe(e,"liveness");return t?.state==="passed"||t?.state==="review"}r(hr,"Xt");function Ye(e,t,n,o,i,l=!1){let c=t.icao?.report,d=e.portrait,_=i==="capture"?d?.pendingFix??null:null;_!==null&&(i="review");let w=te(e);return{kind:"portrait",key:`portrait:${i}`,context:n,section:Q(t),phase:i,report:Array.isArray(c)?c:null,review:t.state==="review",tuning:e.capture?.icao??null,tuningVersion:e.capture?.tuningVersion??null,icao:re(e),retakeOnly:i==="capture"&&t.state==="input_required"&&w===void 0&&e.capture?.livePhoto?.oneCapture===!0&&hr(e),photo:ke(we(d,i==="capture"),l&&i==="capture"),pendingFix:_,...w!==void 0?{captureMode:w}:{},...d?.reuse?.pending===!0?{reuse:!0}:{},...o}}r(Ye,"Xe");function te(e){let t=e.portrait?.captureMode;return t==="self"||t==="assisted"||t==="choice"?t:void 0}r(te,"rt");var me={minLongSidePx:1280,jpegQuality:.95};function yr(e,t){let n=e.capture?.livePhoto;if(n?.oneCapture!==!0)return null;let o=oe(e,"portrait_icao"),i=n.still??me;return{icao:t==="liveness"&&re(e)!==null&&te(e)===void 0&&o!==void 0&&o.state==="pending"&&o.reason===void 0,still:{minLongSidePx:i.minLongSidePx??me.minLongSidePx,jpegQuality:i.jpegQuality??me.jpegQuality}}}r(yr,"en");function gr(e,t,n,o){let i=t.eid,l=Q(t);if(i===void 0||i.challenge!=="app_code")return{kind:"unsupported",key:"unsupported:eid_auth",context:n,section:l,checkType:"eid_auth",reason:"update_required"};let c=ct(ve(e)),d=c.length===1&&Xt.includes(c[0]?.service??"")?c[0]:void 0,_=d===void 0?void 0:ie[d.service],w=_!==void 0,P={kind:"eid",key:"eid",context:n,section:l,provider:i.provider,providerName:i.providerName,country:i.country,challenge:"app_code",phase:i.awaiting==="code"?"code":"identifier",identifierBound:i.identifierBound===!0,canUseCamera:w,afterPass:i.afterPass==="continue"?"continue":"end",...o};return w&&(P.cameraMethod=_),i.expiresAt!==void 0&&(P.codeExpiresAt=i.expiresAt),i.resendAvailableAt!==void 0&&(P.resendAvailableAt=i.resendAvailableAt),i.resendsRemaining!==void 0&&(P.resendsRemaining=i.resendsRemaining),i.codeAttemptsRemaining!==void 0&&(P.codeAttemptsRemaining=i.codeAttemptsRemaining),P}r(gr,"tn");function _r(e,t){if(t.checkType!=="face_match"||t.reason!==void 0)return null;let n=oe(e,"portrait_icao");return n!==void 0&&(n.state==="passed"||n.state==="review")?n:null}r(_r,"nn");var br={rejected:"rejected",inconclusive:"inconclusive",unavailable:"unavailable",abandoned:"expired",not_opened:"expired",cancelled:"expired",superseded:"expired",policy:"policy"};function vr(e){return e.reasonCode===be?"platform_unsupported":e.status==="review_pending"?"review":e.status==="verified"?"verified":e.reasonCode==="device_cooldown"?"cooldown":e.reasonCode==="starter_credit_claimed"?"policy":(e.status==="not_verified"&&e.reason!==void 0?br[e.reason]:void 0)??"rejected"}r(vr,"on");function wr(e,t){let n=vr(e),o=n==="platform_unsupported"?{sessionId:de(e.sessionId),status:"unavailable",reasonCode:be}:Ce(e,{autoRetry:!1}),i={kind:"result",key:"result",context:t,section:null,display:n,result:o};return e.status==="not_verified"&&e.reason!==void 0&&(i.reason=e.reason),e.reasonCode!==void 0&&(i.reasonCode=e.reasonCode),e.status==="not_verified"&&e.step!==void 0&&(i.step=e.step),e.retryAfter!==void 0&&(i.retryAfter=e.retryAfter),i}r(wr,"sn");function kr(e,t,n){let o=e.identitySummary;if(o==null)return null;let i={kind:"identity_summary",key:"identity_summary",context:t,section:n??"identity",summaryKind:o.kind==="partial"?"partial":o.kind??"full",source:o.source,portraitAvailable:o.portrait?.available===!0,retakeAvailable:o.retakeAvailable===!0};for(let c of Mr){let d=o[c];typeof d=="string"&&d!==""&&(i[c]=d)}let l=Pt(o);return l!==void 0&&(i.idNumberMasked=l,i.nniMasked=l),i}r(kr,"an");var Mr=["fullName","birthDate","birthYear","nationality","documentType","documentNumberMasked","expiryDate","retakeTarget"];function J(e,t,n,o){return{kind:"unsupported",key:`unsupported:${n}`,context:e,section:t,checkType:n,reason:o}}r(J,"B");function Ar(e){return e.kind==="contact"?"contact":(e.kind,"identity")}r(Ar,"cn");function xr(e,t){let n=st[e.kind]??[...ge,..._e],o=Ar(e),i=e.options.flatMap(c=>{if(c.available===!1||!n.includes(c.service))return[];let d={id:c.id,service:c.service};c.nationalEid!=null&&(d.nationalEid=c.nationalEid);let _=(c.channels??[]).filter(w=>w==="whatsapp"||w==="sms");return c.service==="phone_otp"&&_.length>0&&(d.channels=_),[d]});if(i.length===0){let c=e.options.length>0&&e.options.every(d=>d.service==="nfc");return J(t,o,"choice",c?"platform_unsupported":"update_required")}let l={nodeId:e.nodeId,kind:e.kind,selected:e.selected,options:i};if(e.kind==="identity_method"){let c={kind:"method",key:"method",context:t,section:o,options:i.map(_=>ie[_.service]),choice:l},d=i.find(_=>_.nationalEid!==void 0)?.nationalEid;return d!==void 0&&(c.nationalEid=d),c}return e.kind==="contact"?{kind:"contact_choice",key:"contact_choice",context:t,section:o,options:i.map(c=>dt[c.service]),selected:null,locked:!1,choice:l}:{kind:"choice",key:`choice:${e.nodeId}`,context:t,section:o,choice:l}}r(xr,"dn");function Pr(e,t,n,o){let i=e.nativeApp,l=typeof i=="object"&&i!==null?i:{},c={sekyroApp:l.sekyroApp===!0};return typeof l.link=="string"&&l.link!==""&&(c.link=l.link),c.sekyroApp&&typeof l.sekyroAppLink=="string"&&l.sekyroAppLink.startsWith("sekyro://")&&(c.sekyroAppLink=l.sekyroAppLink),{kind:"native_app_required",key:`native_app_required:${o}`,context:t,section:n,checkType:o,nativeApp:c}}r(Pr,"ln");function Y(e,t={}){let n=nr(e);if(ce(e)||e.reasonCode===be)return wr(e,n);let o=e.plan;if(o===void 0||!Array.isArray(o.sections))return J(n,null,"plan","update_required");let i=Se(e);if(i!==null)return xr(i,n);let l=o.current===null?void 0:o.steps.find(m=>m.id===o.current),c=r(m=>{let b={kind:"processing",key:"processing",context:n,section:m!==void 0?Q(m):o.sections.find(S=>S.state==="current")?.id??null,stalled:!1};return typeof m?.service=="string"&&m.service!==""&&(b.service=m.service),b},"d");if(o.current===null)return c(o.steps.find(m=>m.state==="processing"));if(l===void 0)return J(n,null,"step","update_required");if(!Yt.has(l.service))return l.interaction==="server"?c(l):J(n,Q(l),l.service,"update_required");if(Jt.has(l.service)||!Te(l))return c(l);let d=l,_=ir(d),w=d.checkType,P=Q(d);if(d.requiresNativeApp===!0)return Pr(e,n,P,w);let v=t.isMobile===!1?je(e,d):null;if(v==="phone")return{kind:"mobile_required",key:"mobile_required",context:n,section:P,checkType:w};switch(w){case"phone_otp":case"email_otp":return ar(e,d,n,_);case"population_registry":return dr(e,d,n,_);case"eid_auth":return gr(e,d,n,_);case"doc_ocr":return ur(e,d,n,_,v==="upload_or_phone");case"identity_confirm":return kr(e,n,P)??c(d);case"portrait_icao":return Ye(e,d,n,_,"capture",v==="upload_or_phone");case"liveness":case"face_match":{let m=_r(e,d);if(m!==null)return Ye(e,m,n,_,"match");let b=d.requiresMobile===!0,S=re(e);return{kind:"liveness",key:"biometric",context:n,section:P,mode:w==="face_match"?"selfie":"liveness",requiresMobile:b,instructions:S===null?"standard":"icao",icao:S,livePhoto:yr(e,w),..._}}case"poa":return mr(e,d,n,_,v==="upload_or_phone");case"form":{let m=jt(d.form);return m===null?J(n,P,w,"update_required"):{kind:"form",key:"form",context:n,section:P,form:m,dir:Rt(m.locale),..._}}case"nfc_chip":return J(n,P,w,"platform_unsupported");default:return J(n,P,w,"update_required")}}r(Y,"ee");var Sr=/^[A-Z0-9][A-Z0-9 -]{0,39}$/,Tr=Object.freeze({normalize:r(e=>e.trim().toUpperCase().replace(/\s+/g," "),"normalize"),check:r(e=>Sr.test(e),"check"),registrySources:Object.freeze([]),describe:"number must be 1 to 40 letters, digits, spaces or hyphens"}),Cr=/^[A-Z0-9]{4,20}$/,he=r(e=>e.trim().toUpperCase().replace(/[\s-]+/g,""),"me"),Er=Object.freeze({normalize:he,check:r(e=>Cr.test(he(e)),"check"),registrySources:Object.freeze([]),describe:"number must be 4 to 20 letters or digits"});function Ir(e){return typeof e=="string"&&/^\d{10}$/.test(e)&&Number(e)%97===1}r(Ir,"Sn");var Rr={trim:r(e=>e.trim(),"trim"),upper_single_space:r(e=>e.trim().toUpperCase().replace(/\s+/g," "),"upper_single_space"),upper_no_space_or_hyphen:he},jr={mr_nni_mod97:r(e=>Ir(e),"mr_nni_mod97")};function Nr(e){let t=new RegExp(e.pattern,"u"),n=e.check===null?void 0:jr[e.check];return Object.freeze({normalize:Rr[e.normalize],check:r(o=>t.test(o.trim())&&(n===void 0||n(o)),"check"),registrySources:Object.freeze([...e.registrySources]),describe:e.describe})}r(Nr,"_n");var Or=Object.freeze(Object.fromEntries(Object.entries(Ve).map(([e,t])=>[e,Nr(t)])));function ut(e,t){return Or[`${e.toUpperCase()}:${t}`]??(t==="drivers_license"?Er:Tr)}r(ut,"he");var Vr=Object.freeze({MRT:"MR"});function Ur(e,t){let n=e.trim().toUpperCase();return ut(Vr[n]??n,t)}r(Ur,"ot");function Br(e){let t=Ur(e.issuingCountry,e.type);return t.check(t.normalize(e.number))}r(Br,"it");function Lr(e){return ut("MR","national_id").check(e)}r(Lr,"st");function Je(e){let t="";for(let n of e){let o=n.codePointAt(0)??0;o>=1632&&o<=1641?t+=String(o-1632):o>=1776&&o<=1785?t+=String(o-1776):n!==" "&&n!=="-"&&n!==" "&&(t+=n)}return t}r(Je,"Se");var Fr=[1e3,2e3,4e3,8e3,15e3],Kr=3e4,qr=/^\+[1-9]\d{6,14}$/,Dr=/^\d{6}$/,Gr=/^\d{6}$/,$r=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Xe=new Set(["session_not_active","check_not_found","check_already_finalized","check_out_of_order","identity_confirm_required","identity_confirm_locked","choice_locked","choice_option_unavailable","choice_not_found","step_not_on_path","check_not_active","native_app_required"]),zr={simulatedCapture:!0},Hr=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]);function pt(e){let t=!1,n=null,o="",i=!1,l=!1,c=!1,d={},_={},w=new Set,P=!1,v=!1,m=null,b="idle",S=new Map,T=new Map,U=r((a,s,p)=>{let y=`${a}.${s}`,E=S.get(y);if(E!==void 0)return E;let F=T.get(a),q=(F===void 0?p():F.then(p)).finally(()=>{S.delete(y)});S.set(y,q);let K=q.then(()=>{},()=>{});return T.set(a,K),K.then(()=>{T.get(a)===K&&T.delete(a)}),q},"I"),I=r(async(a,s,p)=>{await e.ensureConsent();let y;try{y=await Ie(e.runtime,s)}catch(F){if(F instanceof $&&Xe.has(F.code)){await e.refreshView();return}throw F}if(p?.(y),e.destroyed())return;let E=y;E.plan!==void 0&&e.setView!==void 0?e.setView(E):await e.refreshView()},"v"),R=r(async a=>{await e.ensureConsent();let s;try{try{s=await a(e.runtime.client)}catch(p){if(!(p instanceof $)||p.code!=="consent_required")throw p;await e.runtime.ensureConsent({force:!0}),s=await a(e.runtime.client)}}catch(p){if(p instanceof $&&Xe.has(p.code)){await e.refreshView();return}throw p}e.destroyed()||(s!==void 0&&e.setView!==void 0?e.setView(s):await e.refreshView())},"V"),O=r((a,s)=>U("choice",`${a}:${s}`,()=>R(p=>p.choose(a,s))),"D"),N=r((a,s)=>a.options.some(p=>p.id===s)?O(a.nodeId,s):Promise.reject(new RangeError(`option ${String(s)} is not offered`)),"x"),k=r((a,s)=>{let p=e.currentView(),y=p===null?void 0:lt(p,a);return y===void 0?Promise.reject(new RangeError(`the ${s} is not offered`)):O(y.nodeId,y.option.id)},"U"),u=r(a=>U("identity",a,()=>R(s=>s.confirmIdentity===void 0?Promise.reject(new Error("identity confirmation is not available in this build")):s.confirmIdentity(a))),"F"),h=r((a,s)=>{let p=fe(a.form,s);if(p.length>0)return Promise.reject(new ue(p,"client"));let y={answers:{...s.answers},consents:{}};for(let E of a.form.consents)y.consents[E.id]=s.consents[E.id]===!0;return U("form","submit",()=>I("form",(E,F)=>E.submitCheck("form",y,{idempotencyKey:F})).catch(E=>{throw E instanceof $&&E.code===Re?new ue(zt(E.details,a.form,y),"server"):E}))},"K"),M=r((a,s)=>{let p=a.kind,y=p==="phone_otp",E=y?"phone":"email",F={action:"send"};if(y?a.needsPhone:a.needsEmail){let q=s[E]??_[p],K=y?q?.replace(/[\s().-]/g,""):q?.trim();if(K!==void 0||a.phase!=="verify"){if(K===void 0||!(y?qr:$r).test(K))return Promise.reject(y?new W("phone","format"):new ae("email","format"));F[E]=K}}if(y){let q=a.channels,K=s.channel??(q.length===1?q[0]:void 0);if(q.length>0){if(K===void 0)return Promise.reject(new ae("channel","required"));if(!q.includes(K))return Promise.reject(new ae("channel","unavailable"))}K!==void 0&&(F.channel=K),F.phoneRules=1}return U(p,"send",()=>I(p,(q,K)=>q.submitCheck(p,F,{idempotencyKey:K}),q=>{Wr(q,p)||(d[p]=e.now(),F[E]!==void 0&&(_[p]=F[E]))}))},"te"),A=r((a,s)=>Dr.test(s)?U(a,"verify",()=>I(a,(p,y)=>p.submitCheck(a,{action:"verify",code:s},{idempotencyKey:y}))):Promise.reject(new W("code","format")),"Z"),g=r((a,s)=>U("eid_auth",a,()=>I("eid_auth",(p,y)=>p.submitCheck("eid_auth",s,{idempotencyKey:y}))),"G"),x=r((a,s)=>{if(a.identifierBound)return g("start",{action:"start"});let p=Je(s??"");if(a.country==="MR"){if(!/^\d{10}$/.test(p))return Promise.reject(new W("nni","format"));if(!Lr(p))return Promise.reject(new W("nni","check_digit"))}else if(p==="")return Promise.reject(new W("nni","format"));return g("start",{action:"start",identifier:p})},"ne"),C=r((a,s,p)=>{if(a.source!=="typed")return Promise.reject(new RangeError("this session already holds the ID number"));let y=Je(s);return/^\d{10}$/.test(y)?Br({type:"national_id",issuingCountry:"MR",number:y})?U("population_registry","submitIdNumber",()=>I("population_registry",(E,F)=>E.submitCheck("population_registry",{idNumber:y,nni:y},{idempotencyKey:F}),()=>{m=`••••••${y.slice(-4)}`})):Promise.reject(new W(p,"check_digit")):Promise.reject(new W(p,"format"))},"W"),B=r(a=>(e.stopCameras?.(),U(a,"skipCapture",()=>I(a,(s,p)=>s.submitCheck(a,zr,{idempotencyKey:p}),()=>{(a==="liveness"||a==="portrait_icao")&&(P=!0)}))),"Q"),f=r(a=>{if(a.kind==="result"||a.context.simulation?.skipCapture!==!0)return a;let s=Zr(a);return s===null?a:{...a,skipCapture:r(()=>B(s),"skipCapture")}},"ge"),j=r(a=>((a.kind==="document"||a.kind==="portrait"||a.kind==="proof_of_address")&&a.photo?.cameraOnPhone===!0&&(a.refresh=async()=>{await e.refreshView()}),a),"m"),V=r(a=>{switch(a.kind){case"phone_otp":case"email_otp":{let s={...a,send:r((y={})=>M(a,y),"send"),verify:r(y=>A(a.kind,y),"verify"),switchTo:r(()=>a.canSwitch&&a.switchChannel!==void 0?k([a.switchChannel==="email"?"email_otp":"phone_otp"],"other contact option"):Promise.reject(new RangeError("this session has no other contact option")),"switchTo")},p=d[a.kind];return s.resendAvailableAt===void 0&&p!==void 0&&(s.resendAvailableAt=new Date(p+Kr).toISOString()),s}case"eid":return{...a,start:r(s=>x(a,s),"start"),verify:r(s=>Gr.test(s)?g("verify",{action:"verify",code:s}):Promise.reject(new W("code","format")),"verify"),resend:r(()=>a.resendsRemaining===0?Promise.reject(new RangeError("no new code can be sent for this session")):g("resend",{action:"resend"}),"resend"),useCamera:r(()=>a.canUseCamera&&a.cameraMethod!==void 0?k(a.cameraMethod==="document_photo"?["document"]:["population_registry"],"camera path"):Promise.reject(new RangeError("the camera path is not offered")),"useCamera")};case"method":return{...a,select:r(s=>{let p=a.choice.options.find(y=>ie[y.service]===s);return p!==void 0?N(a.choice,p.id):Promise.reject(new RangeError(`method ${String(s)} is not offered`))},"select"),choose:r(s=>N(a.choice,s),"choose")};case"choice":return{...a,choose:r(s=>N(a.choice,s),"choose")};case"registry":return{...a,submitIdNumber:r(s=>C(a,s,"idNumber"),"submitIdNumber"),submitNni:r(s=>C(a,s,"nni"),"submitNni"),confirm:r(()=>U("population_registry","confirm",()=>I("population_registry",(s,p)=>s.submitCheck("population_registry",{},{idempotencyKey:p}))),"confirm"),useDocument:r(()=>a.canUseDocument?k(["document"],"document method"):Promise.reject(new RangeError("the document method is not offered")),"useDocument")};case"document":return e.bindDocument!==void 0?j(e.bindDocument(a,L)):{...a,issuer:null,documentType:null,captureSide:null,selectDocument:r(()=>{throw new Error("document capture is not available in this build")},"selectDocument"),capture:r(()=>{throw new Error("document capture is not available in this build")},"capture"),uploadDocument:r(()=>Promise.reject(new Error("document upload is not available in this build")),"uploadDocument")};case"portrait":return e.bindPortrait!==void 0?j(e.bindPortrait(a,L)):{...a,uploadFailed:!1,resubmit:r(()=>Promise.resolve(),"resubmit"),capture:r(()=>{throw new Error("portrait capture is not available in this build")},"capture"),uploadPortrait:r(()=>Promise.reject(new Error("portrait upload is not available in this build")),"uploadPortrait"),confirmFix:r(()=>Promise.reject(new Error("portrait review is not available in this build")),"confirmFix")};case"proof_of_address":return e.bindProofOfAddress!==void 0?j(e.bindProofOfAddress(a,L)):{...a,uploadPages:r(()=>Promise.reject(new Error("proof of address upload is not available in this build")),"uploadPages"),uploadHolderLetter:r(()=>Promise.reject(new Error("proof of address upload is not available in this build")),"uploadHolderLetter"),capturePage:r(()=>{throw new Error("proof of address capture is not available in this build")},"capturePage")};case"form":return{...a,validate:r(s=>fe(a.form,s),"validate"),submit:r(s=>h(a,s),"submit")};case"contact_choice":return{...a,select:r(s=>{let p=s==="phone"?"phone_otp":s==="email"?"email_otp":void 0,y=a.choice.options.find(E=>E.service===p);return y!==void 0?N(a.choice,y.id):Promise.reject(new RangeError(`contact ${String(s)} is not offered`))},"select"),choose:r(s=>N(a.choice,s),"choose")};case"identity_summary":return{...a,...a.idNumberMasked===void 0&&a.summaryKind==="partial"&&m!==null?{idNumberMasked:m,nniMasked:m}:{},portrait:r(async()=>{let s=e.runtime.client;if(!a.portraitAvailable||s.identityPortrait===void 0)return null;try{return await s.identityPortrait()}catch{return null}},"portrait"),confirm:r(()=>u("confirm"),"confirm"),retake:r(()=>a.retakeAvailable?u("retake"):Promise.reject(new RangeError("no retake is left")),"retake")};case"liveness":return{...a,capture:r(s=>e.liveness(s),"capture"),onLivePhoto:r(s=>a.livePhoto?.icao===!0&&e.onLivePhoto!==void 0?e.onLivePhoto(s):()=>{},"onLivePhoto")};case"mobile_required":case"native_app_required":case"processing":return{...a,refresh:r(async()=>{i=!1,await e.refreshView()},"refresh")};case"unsupported":case"result":return{...a};default:{let s=a;throw new Error(`runner: unhandled step ${JSON.stringify(s)}`)}}},"k"),z=r(a=>f(V(a)),"A"),Z=r(async()=>{if(!l){l=!0;try{for(let a of Fr){if(await e.sleep(a),!t||e.destroyed())return;let s=await e.refreshView().catch(()=>null);if(s!==null&&Y(s,{isMobile:e.isMobile()}).kind!=="processing")return}i=!0,L()}finally{l=!1}}},"T"),G=r(a=>{if(a.kind!=="liveness"||a.mode!=="selfie")return null;let s={kind:"processing",key:"processing",context:a.context,section:a.section,stalled:!1};if(b==="inflight")return s;if(!v||b==="done")return null;let p=e.keptFaceKey?.()??null;return p===null?null:(b="inflight",I("face_match",(y,E)=>y.submitCheck("face_match",{imageKey:p},{idempotencyKey:E}),()=>{b="done"}).then(()=>{b==="inflight"&&(b="done",L())},()=>{b="done",L()}),s)},"H"),H=r((a,s=!1)=>{if(!t||e.destroyed()||e.chainBusy())return;let p=Y(a,{isMobile:e.isMobile()});p.kind==="registry"&&p.recheck&&(v=!0,b="idle"),p=G(p)??p,p.kind==="processing"?p.stalled=i:i=!1;let y=z(p),E=p.kind==="result"?void 0:p.context.switchable,F=E===void 0?y:{...y,chooseOption:r(K=>N({nodeId:E.nodeId,kind:E.kind,selected:E.current,options:E.options},K),"chooseOption")},q=JSON.stringify(F);p.kind==="registry"&&p.source==="document"&&p.state==="pending"&&!w.has("registry")&&(w.add("registry"),F.confirm().catch(K=>{(!(K instanceof $)||Hr.has(K.code))&&w.delete("registry")})),!(!s&&q===o)&&(o=q,n=F,e.emitStep(F),p.kind==="processing"&&!i&&b!=="inflight"&&Z(),p.kind==="result"&&!c&&(c=!0,e.emitResult(p.result)))},"R");function L(){let a=e.currentView();a!==null&&H(a,!0)}return r(L,"M"),{run:r(async()=>{if(e.destroyed())throw new Error("verification destroyed");t=!0;let a=await e.ensureView();return n===null&&H(a),n??z(Y(a,{isMobile:e.isMobile()}))},"run"),current:r(()=>n,"current"),onView:r(a=>H(a),"onView"),onChainIdle:r(()=>{let a=e.currentView();a!==null&&H(a)},"onChainIdle"),republish:L,submit:I,faceProbeSkipped:r(()=>P,"faceProbeSkipped")}}r(pt,"lr");function Zr(e){switch(e.kind){case"document":return"doc_ocr";case"liveness":return e.mode==="selfie"?"face_match":"liveness";case"portrait":return e.phase==="capture"?"portrait_icao":null;case"proof_of_address":return"poa";case"mobile_required":case"native_app_required":return e.checkType;case"unsupported":return e.checkType==="nfc_chip"?"nfc_chip":null;default:return null}}r(Zr,"Mn");function Wr(e,t){let n=e,o=n?.plan?.steps??n?.steps;return Array.isArray(o)?o.some(i=>i.checkType===t&&typeof i.reason=="string"):!1}r(Wr,"On");var Qr=2e4,Yr=new Set(["media_type_unsupported","media_type_mismatch"]),mt=new Set(["document_upload_not_allowed","portrait_source_not_allowed","uploaded_media_not_allowed"]);function Jr(e){let t=null,n=Promise.resolve(),o=!1,i=null,l=null,c=!1,d=null,_=!1,w=!1,P=r(()=>{t?.controller.handle.destroy(),t=null},"T"),v=r(()=>{let u=e.currentView(),h=u===null?null:Y(u,{isMobile:e.isMobile()});return h?.kind==="portrait"?h:null},"u"),m=r(()=>{if(e.destroyed())return"self";let u=e.currentView(),h=u===null?void 0:te(u);return h==="self"||h==="assisted"?h:h==="choice"&&e.captureModeSwitch!==void 0?e.captureModeSwitch.pick()??"self":e.cameraMode?.()??Oe(h??Ne(u),null)},"a"),b=e.captureModeSwitch,S=b===void 0?void 0:{session:r(()=>{let u=e.currentView();return u!==null&&te(u)==="choice"?"choice":m()},"session"),onModeChange:r(u=>b.choose(u),"onModeChange")},T=r(async(u,h)=>{if(e.destroyed())return;let M=m();h.setFlowState("uploading"),o=!1;let A=null;try{await e.runner().submit("portrait_icao",async(x,C)=>{if(A===null){let f=await X(x,"image","image/jpeg",u.image.size,{engine:"portrait"});await x.uploadToSpaces(f.uploadUrl,u.image,"image/jpeg"),A=(await x.completeMedia(f.key)).key}h.setFlowState("checking");let B={media:{portrait:A},gate:ne(u.gate),...u.tuningVersion!==void 0?{tuningVersion:u.tuningVersion}:{},source:"camera",capture:{mode:M,facingMode:u.facingMode}};return x.submitCheck("portrait_icao",B,{idempotencyKey:C})})}catch(x){o=!0,x instanceof $&&mt.has(x.code)&&await e.refreshView?.().catch(()=>{})}if(h.setFlowState("done"),e.destroyed())return;let g=v();(g===null||g.phase!=="capture")&&t?.controller===h&&P(),e.runner().republish()},"y"),U=r(u=>e.runner().submit("face_match",(h,M)=>h.submitCheck("face_match",e.runner().faceProbeSkipped()?{simulatedCapture:!0}:{},{idempotencyKey:M})).then(()=>{},()=>{o=!0,u()}),"R"),I=null,R=r(async u=>{let h=v();if(h===null||h.phase!=="capture"||!h.photo.uploadOffered)throw new RangeError("upload_not_offered");let{prepareUploadFile:M}=await import("./upload-file-EGXXM6TQ-NNVVB5QQ.js"),A=await M(u,e.uploadInternals);if(e.destroyed())return;P(),o=!1;let g=null;try{await e.runner().submit("portrait_icao",async(x,C)=>{if(g===null){let f=await x.presign("image",A.contentType,A.blob.size,{source:"upload"});await x.uploadToSpaces(f.uploadUrl,A.blob,A.contentType),g=(await x.completeMedia(f.key)).key}let B={media:{portrait:g},source:"upload"};return x.submitCheck("portrait_icao",B,{idempotencyKey:C})})}catch(x){throw x instanceof $&&Yr.has(x.code)?new TypeError("unsupported_file"):(x instanceof $&&mt.has(x.code)&&await e.refreshView?.().catch(()=>{}),x)}},"w"),O=null,N=r(u=>{if(O!==null)return O;let h=v();if(h===null||h.phase!=="review")return Promise.reject(new RangeError("no_pending_fix"));let M={fixReview:{accept:u}},A=e.runner().submit("portrait_icao",(g,x)=>g.submitCheck("portrait_icao",M,{idempotencyKey:x})).catch(async g=>{throw g instanceof $&&g.code==="portrait_no_pending_fix"&&await e.refreshView?.().catch(()=>{}),g}).finally(()=>{O=null});return O=A,A},"I"),k=r(u=>{let h=r(()=>R(u),"n"),M=(I===null?h():I.then(h,h)).finally(()=>{I===M&&(I=null)});return I=M,M},"l");return{bind:r((u,h)=>{if(u.phase==="review")return P(),{...u,uploadFailed:o,resubmit:r(()=>Promise.resolve(),"resubmit"),capture:r(()=>{throw new Error("the adjusted photo waits for confirmFix()")},"capture"),uploadPortrait:r(()=>Promise.reject(new RangeError("upload_not_offered")),"uploadPortrait"),confirmFix:N};if(u.phase==="match")return P(),i!==u.attemptsRemaining&&!o&&(i=u.attemptsRemaining,U(h)),{...u,uploadFailed:o,resubmit:r(()=>(o=!1,i=u.attemptsRemaining,h(),U(h)),"resubmit"),capture:r(()=>{throw new Error("the portrait was already accepted")},"capture"),uploadPortrait:r(()=>Promise.reject(new RangeError("upload_not_offered")),"uploadPortrait"),confirmFix:N};if(i=null,u.reuse===!0&&u.phase==="capture")return P(),!_&&d!==u.attemptsRemaining&&(d=u.attemptsRemaining,_=!0,e.runner().submit("portrait_icao",(A,g)=>A.submitCheck("portrait_icao",{},{idempotencyKey:g})).then(()=>{w=!1},()=>{w=!0}).finally(()=>{_=!1,h()})),{kind:"processing",key:"processing",context:u.context,section:u.section,stalled:w&&!_,refresh:r(()=>(w=!1,d=null,h(),Promise.resolve()),"refresh")};let M=e.keptPortraitInput?.()??null;return M!==null&&(c||M!==l&&u.report===null&&u.reason===void 0&&!u.retakeOnly)?(c||(l=M,c=!0,e.runner().submit("portrait_icao",(A,g)=>A.submitCheck("portrait_icao",M,{idempotencyKey:g})).catch(()=>{}).finally(()=>{c=!1,h()})),{kind:"processing",key:"processing",context:u.context,section:u.section,stalled:!1,refresh:r(()=>Promise.resolve(),"refresh")}):{...u,uploadFailed:o,resubmit:r(()=>Promise.resolve(),"resubmit"),capture:r(A=>{if(t!==null&&t.video===A.video)return t.controller.handle;P(),o=!1;let g=Ke({video:A.video,tuning:u.tuning,tuningVersion:u.tuningVersion,...u.icao!=null?{policy:u.icao.policy}:{},...A.keepScreenAwake!==void 0?{keepScreenAwake:A.keepScreenAwake}:{},...A.assetBaseUrl!==void 0?{assetBaseUrl:A.assetBaseUrl}:{}},e.internals,m,S);t={video:A.video,controller:g};let x=g.handle.destroy;g.handle.destroy=()=>{t?.controller===g&&(t=null),x()},g.handle.on("error",f=>{e.reportCaptureIssue?.(le("portrait",f,0))});let C=!1,B=r((f,j)=>{let V=g.gateScores();V!==null&&e.reportGate?.({kind:"portrait_gate",platform:"web",outcome:f,...j!==null?{failing:j}:{},...V})},"g");return g.handle.on("gate",f=>{!C&&!f.ready&&(g.gateScores()?.elapsedMs??0)>=Qr&&(C=!0,B("stuck",f.failing))}),g.handle.on("captured",f=>{B("captured",null),C=!1,n=n.then(()=>T(f,g)).catch(()=>{})}),g.handle},"capture"),uploadPortrait:k,confirmFix:N}},"bind"),destroy:P}}r(Jr,"re");var Xr=.92,en=r(()=>Ue("environment",{width:{ideal:1920},height:{ideal:1080}},{getUserMedia:r(e=>navigator.mediaDevices.getUserMedia(e),"getUserMedia"),enumerateDevices:r(()=>navigator.mediaDevices.enumerateDevices(),"enumerateDevices")}),"ce"),tn=r(e=>{let t=document.createElement("canvas");t.width=e.videoWidth,t.height=e.videoHeight;let n=t.getContext("2d");return n===null||t.width===0||t.height===0?Promise.reject(new Error("the camera has no frame yet")):(n.drawImage(e,0,0,t.width,t.height),new Promise((o,i)=>t.toBlob(l=>l===null?i(new Error("the still could not be encoded")):o(l),"image/jpeg",Xr)))},"pe"),rn=r((e,t)=>{try{e.muted=!0,e.playsInline=!0,e.srcObject=t,e.play().catch(()=>{})}catch{}},"me");function nn(e){let t=null,n=null,o=r(v=>{let m=(n===null?v():n.then(v,v)).finally(()=>{n===m&&(n=null)});return n=m,m},"c"),i=r(()=>{t?.handle.destroy(),t=null},"_"),l=r(()=>{let v=e.currentView(),m=v===null?null:Y(v,{isMobile:e.isMobile()});return m?.kind==="proof_of_address"?m:null},"S"),c=r(async(v,m)=>{if(m.length===0)throw new RangeError("no_pages");if(m.length>v.maxPages)throw new RangeError("too_many_pages");let{pdfFileKind:b,prepareUploadFile:S}=await import("./upload-file-EGXXM6TQ-NNVVB5QQ.js"),T=await Promise.all(m.map(I=>b(I)));if(T.includes("bad"))throw new TypeError("unsupported_file");if(T.includes("pdf")){if(m.length>1)throw new RangeError("too_many_pages");let I=m[0];if(I.size>v.pdf.maxBytes)throw new RangeError("file_too_large");return[{kind:"document_file",blob:I,contentType:"application/pdf"}]}let U=[];for(let I of m){let R=await S(I,e.uploadInternals);U.push({kind:"image",blob:R.blob,contentType:R.contentType})}return U},"C"),d=r(async(v,m,b)=>{let S=null;try{await e.runner().submit("poa",async(T,U)=>{if(S===null){let R=[];for(let O of b){let N=m==="upload"?await T.presign(O.kind,O.contentType,O.blob.size,{source:"upload"}):await X(T,O.kind,O.contentType,O.blob.size,{engine:"poa_page"});await T.uploadToSpaces(N.uploadUrl,O.blob,O.contentType),R.push((await T.completeMedia(N.key)).key)}S=R}let I=b[0]?.kind==="document_file"?{part:v,source:"upload",pdfKey:S[0]}:{part:v,source:m,imageKeys:S};return T.submitCheck("poa",I,{idempotencyKey:U})})}catch(T){throw T instanceof $&&(T.code==="media_type_unsupported"||T.code==="media_type_mismatch")?new TypeError("unsupported_file"):(T instanceof $&&(T.code==="document_upload_not_allowed"||T.code==="uploaded_media_not_allowed")&&await e.refreshView?.().catch(()=>{}),T)}},"E"),_=r(async(v,m)=>{let b=l();if(b===null||!b.photo.uploadOffered)throw new RangeError("upload_not_offered");if(v==="holder_letter"&&b.phase!=="holder_letter")throw new RangeError("holder_letter_not_requested");let S=await c(b,m);e.destroyed()||(i(),await d(v,"upload",S))},"A"),w=r((v,m)=>{let b=null,S=[],T=!0,U=r(()=>{for(let R of b?.getTracks()??[])R.stop();b=null},"R"),I={get pages(){return S},start:r(async()=>{if(!T||b!==null)return;let R=await(e.pageCamera?.open??en)();if(!T){for(let O of R.getTracks())O.stop();return}b=R,(e.pageCamera?.attach??rn)(v,R)},"start"),takePage:r(async()=>{if(S.length>=m)throw new RangeError("too_many_pages");let R=await(e.pageCamera?.grab??tn)(v);if(S.length>=m)throw new RangeError("too_many_pages");return S=[...S,R],R},"takePage"),removePage:r(R=>{S=S.filter((O,N)=>N!==R)},"removePage"),submitPages:r(()=>o(async()=>{if(S.length===0)throw new RangeError("no_pages");let R=l();if(R===null)throw new RangeError("camera_not_offered");let O=R.phase==="holder_letter"?"holder_letter":"document";await d(O,"camera",S.map(N=>({kind:"image",blob:N,contentType:"image/jpeg"}))),t?.handle===I?i():I.destroy()}),"submitPages"),destroy:r(()=>{T=!1,S=[],U(),t?.handle===I&&(t=null)},"destroy")};return I},"M"),P=r(async()=>{let v=l();if(v===null||!v.licenceAddressAccepted)throw new RangeError("licence_address_not_accepted");if(e.destroyed())return;i();let m={part:"document"};await e.runner().submit("poa",(b,S)=>b.submitCheck("poa",m,{idempotencyKey:S}))},"T");return{bind:r(v=>({...v,...v.licenceAddressAccepted?{useLicenceAddress:r(()=>o(P),"useLicenceAddress")}:{},uploadPages:r(m=>o(()=>_("document",m)),"uploadPages"),uploadHolderLetter:r(m=>o(()=>_("holder_letter",m)),"uploadHolderLetter"),capturePage:r(m=>{if(v.photo.source==="upload")throw new RangeError("camera_not_offered");if(t!==null&&t.video===m.video)return t.handle;i();let b=w(m.video,v.maxPages);return t={video:m.video,handle:b},b},"capturePage")}),"bind"),destroy:i}}r(nn,"oe");function ft(e){let t=e;if(typeof t.apiOrigin!="string"||typeof t.sessionToken!="string")return;let n=`${t.apiOrigin}/api/v2/hosted/capture-reports`,o=t.sessionToken;return i=>{try{fetch(n,{method:"POST",headers:{"content-type":"application/json","x-session-token":o,"x-sekyro-sdk":`@sekyro/web/${Me}`},body:JSON.stringify({reports:i}),keepalive:!0}).catch(()=>{})}catch{}}}r(ft,"ie");function ht(e){let t=e.apiOrigin;return ze("sdk",typeof t=="string"&&/staging|sandbox|localhost/.test(t)?"sandbox":"live")}r(ht,"ae");function on(e){return ht(e).replace(/\/ocr$/,"/barcode")}r(on,"fe");function Sn(e){let t=null,n=null,o=null,i=Ae(),l=Promise.resolve(),c=r(()=>{o?.flow.handle.destroy(),o=null},"C"),d=r(k=>k===null?{}:{documentType:k.documentType,documentCountry:k.issuer},"E"),_=r(async(k,u,h)=>{if(e.destroyed())return;u.setFlowState("uploading");let M=null,A=d(h),g,x=!1,C=e.currentView()?.documents!==void 0;try{await t.submit("doc_ocr",async(V,z)=>{if(M===null){let Z=await X(V,"image","image/jpeg",k.image.size,{engine:"document"});await V.uploadToSpaces(Z.uploadUrl,k.image,"image/jpeg"),M=(await V.completeMedia(Z.key)).key}return u.setFlowState("checking"),g===void 0&&(g=u.takeDeviceRead(k)),V.submitCheck("doc_ocr",{imageKey:M,side:k.side,...g!==null?{deviceRead:g}:{},...C?{source:"camera"}:{},...A},{idempotencyKey:z})})}catch{x=!0}finally{u.setFlowState("done")}if(e.destroyed())return;if(x){u.settle(k.side,{ok:!1,issue:"technical"});return}let B=e.currentView(),f=B===null?null:Y(B,{isMobile:e.isMobile()});if(f?.kind!=="document"){u.settle(k.side,{ok:!0}),o?.flow===u?c():u.handle.destroy();return}if(f.reason==="document_type_not_accepted"||f.reason==="document_type_not_supported"){n=null,o?.flow===u&&c(),t.republish();return}let j=f.acceptedSides;k.side!=="single"&&(j.includes(k.side)||f.reason==="side_missing")&&!(j.includes("recto")&&j.includes("verso"))?(u.settle(k.side,{ok:!0}),n?.documentType!=="passport"&&u.handle.setSide(f.side)):f.reason==="document_sides_mismatch"&&j.length===0?(u.settle(k.side,{ok:!1,issue:"reread"}),u.handle.retry()):u.settle(k.side,{ok:!1,issue:"reread"})},"A"),w=null,P=r(async k=>{let u=e.currentView(),h=u===null?null:Y(u,{isMobile:e.isMobile()});if(u===null||h?.kind!=="document")throw new RangeError("upload_not_offered");if(!h.photo.uploadOffered)throw new RangeError("upload_not_offered");let M=n,A=M?.documentType==="passport"?"single":h.side,{prepareUploadFile:g}=await import("./upload-file-EGXXM6TQ-NNVVB5QQ.js"),x=await g(k,e.uploadInternals);if(e.destroyed())return;c();let C=null,B=d(M);try{await t.submit("doc_ocr",async(f,j)=>{if(C===null){let V=await f.presign("image",x.contentType,x.blob.size,{source:"upload"});await f.uploadToSpaces(V.uploadUrl,x.blob,x.contentType),C=(await f.completeMedia(V.key)).key}return f.submitCheck("doc_ocr",{imageKey:C,side:A,source:"upload",...B},{idempotencyKey:j})})}catch(f){throw f instanceof $&&(f.code==="media_type_unsupported"||f.code==="media_type_mismatch")?new TypeError("unsupported_file"):(f instanceof $&&(f.code==="document_upload_not_allowed"||f.code==="uploaded_media_not_allowed")&&await e.refreshView().catch(()=>{}),f)}},"T"),v=r((k,u)=>({...k,uploadDocument:r(h=>{let M=r(()=>P(h),"n"),A=(w===null?M():w.then(M,M)).finally(()=>{w===A&&(w=null)});return w=A,A},"uploadDocument"),issuer:n?.issuer??null,documentType:n?.documentType??null,captureSide:n===null?null:n.documentType==="passport"?"single":k.side,selectDocument:r((h,M)=>{if(!et(k.documents).includes(h)||!ye(k.documents,h).includes(M))throw new RangeError(`${M} from ${h} is not accepted`);(n?.issuer!==h||n.documentType!==M)&&c(),n={issuer:h,documentType:M},u()},"selectDocument"),capture:r(h=>{if(n===null)throw new Error("selectDocument() first");if(o!==null&&o.video===h.video)return o.flow.handle;c();let M=n,A=M.documentType==="passport"?"single":k.acceptedSides.length>0?k.side:void 0,g=$e({video:h.video,documentType:M.documentType,issuer:M.issuer,...A!==void 0?{side:A}:{},...h.keepScreenAwake!==void 0?{keepScreenAwake:h.keepScreenAwake}:{},...h.liveMrz!==void 0?{liveMrz:h.liveMrz}:{},...h.barcodeAssetBaseUrl!==void 0?{barcodeAssetBaseUrl:h.barcodeAssetBaseUrl}:{}},{...e.documentInternals??{},...(()=>{let C=e.currentView()?.capture?.document,B=e.documentInternals?.blurRefuseSharpnessMax??C?.scan?.blurRefuseSharpnessMax;return{engineOptions:{camera:qe(C?.camera),shutter:Ge(C?.scan),guideLock:De(C?.guide),...e.documentInternals?.engineOptions??{}},...typeof B=="number"&&Number.isFinite(B)&&B>=0&&B<=1?{blurRefuseSharpnessMax:B}:{},catalogCapture:e.documentInternals?.catalogCapture??C?.catalog===!0}})(),deferRead:!0,...e.documentInternals?.barcode!==void 0?{}:{barcode:{assetBaseUrl:on(e.runtime.client)}},...(()=>{let C=e.currentView();if(C===null||e.documentInternals?.webOcr!==void 0)return{};let B=ft(e.runtime.client);return{webOcr:{captureDocument:C.capture?.document,salt:C.sessionId,baseUrl:ht(e.runtime.client),...B!==void 0?{reports:B}:{}}}})()});o={video:h.video,flow:g};let x=g.handle.destroy;return g.handle.destroy=()=>{o?.flow===g&&(o=null),x()},i.newHandle(),g.handle.on("state",C=>i.note(C)),g.handle.on("error",C=>{i.noteError(),e.reportCaptureIssue?.(le("document",C,i.value))}),g.handle.on("captured",C=>{l=l.then(()=>_(C,g,M)).catch(()=>{})}),g.handle},"capture")}),"u"),m=null,b=null,S=new Set,T=e.runtime.client;e.runtime.client=new Proxy(T,{get(k,u){if(u==="submitCheck")return(b??k).submitCheck.bind(b??k);let h=Reflect.get(k,u);return typeof h=="function"?h.bind(k):h}});let U=r(()=>{m?.destroy(),m=null,b=null},"R"),I=r(k=>{let u=e.currentView(),h=u===null?null:Y(u,{isMobile:e.isMobile()});if(u===null||h?.kind!=="liveness"||h.livePhoto?.icao!==!0)return;if(m===null){let x=tt({tuning:u.capture?.icao??null,tuningVersion:u.capture?.tuningVersion??null,...h.icao!=null?{policy:h.icao.policy}:{},still:h.livePhoto.still,...k.assetBaseUrl!==void 0?{assetBaseUrl:k.assetBaseUrl}:{}},e.livePhotoInternals);m=x,b=x.decorate(T),x.onGate(C=>{for(let B of S)B(C)})}let M=m,A=e.baseCapture??{},g=A.engineOptions?.telemetry;return{...A,engineOptions:{...A.engineOptions??{},measureQuality:M.engineOptions.measureQuality,telemetry:r(x=>{g?.(x),M.engineOptions.telemetry(x)},"telemetry")}}},"b"),R=Jr({keptPortraitInput:r(()=>m?.lastPortraitInput()??null,"keptPortraitInput"),runner:r(()=>t,"runner"),currentView:e.currentView,...e.cameraMode!==void 0?{cameraMode:e.cameraMode}:{},...e.captureModeSwitch!==void 0?{captureModeSwitch:e.captureModeSwitch}:{},destroyed:e.destroyed,isMobile:e.isMobile,...e.portraitInternals!==void 0?{internals:e.portraitInternals}:{},...e.uploadInternals!==void 0?{uploadInternals:e.uploadInternals}:{},refreshView:r(()=>e.refreshView(),"refreshView"),...e.reportCaptureIssue!==void 0?{reportCaptureIssue:e.reportCaptureIssue}:{},reportGate:r(k=>ft(e.runtime.client)?.([k]),"reportGate")}),O=nn({runner:r(()=>t,"runner"),currentView:e.currentView,destroyed:e.destroyed,isMobile:e.isMobile,...e.uploadInternals!==void 0?{uploadInternals:e.uploadInternals}:{},...e.pageCameraInternals!==void 0?{pageCamera:e.pageCameraInternals}:{},refreshView:r(()=>e.refreshView(),"refreshView")}),N=pt({...e,bindDocument:v,bindPortrait:R.bind,bindProofOfAddress:O.bind,stopCameras:r(()=>{c(),R.destroy(),O.destroy(),U(),e.stopLiveness?.()},"stopCameras"),onLivePhoto:r(k=>(S.add(k),()=>S.delete(k)),"onLivePhoto")});return t=N,{...N,captureInternals:I,destroy:r(()=>{c(),R.destroy(),O.destroy(),U(),S.clear()},"destroy")}}r(Sn,"ze");export{on as barcodeAssetBase,Sn as createPlanRunner,ft as reportSink,ht as sdkAssetBase};
|
package/dist/chunk-ZUVOUGIA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as hr,d as fr}from"./chunk-FBXU2OZN.js";import{b as kr,c as bt}from"./chunk-W6ODZ5JK.js";import{a as br}from"./chunk-YZ6YGLNN.js";import{c as Ct}from"./chunk-K7PFKAQD.js";import{a as ur,b as dr,c as pr,d as Re}from"./chunk-HLMRVFVD.js";import{F as yr,K as vr,L as gr,a as $,b as de,c as X,m as or,n as Xe,p as ir,q as et,r as lr,s as cr,t as kt,u as se,v as Ae,w as tt,y as mr}from"./chunk-BZGVYIDN.js";import{a as o,c as E,i as s}from"./chunk-SSU37LFQ.js";var _r=E($(),1),v=E(de(),1),ee=E(de(),1),ye=E($(),1),P=E(de(),1),C=E($(),1),y=E($(),1),at=E($(),1),fe=E(de(),1),Dr=E($(),1),J=E($(),1),it=E($(),1),we=E(de(),1),Se=E(de(),1),U=E(de(),1),lt=E($(),1),pe=E($(),1),W=E($(),1),M=E($(),1),me=E($(),1),Te=E($(),1),Mt=E(de(),1),k=E(de(),1);import{subscribeCameraPermission as jn}from"@sekyro/web";import{getLivenessAssetsStatus as Tn,preloadLivenessAssets as Bn,subscribeLivenessAssets as On}from"@sekyro/web";import{createLivenessCapture as qn}from"@sekyro/web";function oe({className:e,children:t}){return(0,v.jsx)("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}o(oe,"te");s(oe,"Svg");var Lt="M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z";function wr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,v.jsx)("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}o(wr,"ln");s(wr,"SunIcon");function Sr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,v.jsx)("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}o(Sr,"un");s(Sr,"FaceUncoveredIcon");function xr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),(0,v.jsx)("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),(0,v.jsx)("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}o(xr,"dn");s(xr,"PhoneEyeLevelIcon");function Nr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),(0,v.jsx)("circle",{cx:"12",cy:"12",r:"2.8"})]})}o(Nr,"pn");s(Nr,"LookStraightIcon");function Mr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("path",{d:Lt}),(0,v.jsx)("path",{d:"M9 13l2 2 4-4"})]})}o(Mr,"fn");s(Mr,"CameraCheckIcon");function Lr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("path",{d:Lt}),(0,v.jsx)("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}o(Lr,"mn");s(Lr,"CameraAskIcon");function Rr(e){return(0,v.jsxs)(oe,{...e,children:[(0,v.jsx)("path",{d:Lt}),(0,v.jsx)("path",{d:"M3 3l18 18"})]})}o(Rr,"yn");s(Rr,"CameraBlockedIcon");function nt({off:e,className:t}){return(0,v.jsxs)(oe,{className:t,children:[(0,v.jsx)("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?(0,v.jsx)("path",{d:"M4 4l16 16"}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),(0,v.jsx)("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}o(nt,"Ve");s(nt,"SpeakerIcon");function Ar(e){return(0,v.jsx)(oe,{...e,children:(0,v.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}o(Ar,"gn");s(Ar,"CheckIcon");function Er(e){return(0,v.jsxs)(oe,{className:e.className??"sekyro-spinner",children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),(0,v.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}o(Er,"hn");s(Er,"SpinnerIcon");var _t=["light","uncover","eyeLevel","straight"],xn={light:{key:"capture.tips.light",icon:s(()=>(0,ee.jsx)(wr,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:s(()=>(0,ee.jsx)(Sr,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:s(()=>(0,ee.jsx)(xr,{}),"icon")},straight:{key:"capture.tips.straight",icon:s(()=>(0,ee.jsx)(Nr,{}),"icon")}};function Ir({tips:e}){let t=Re(),n=(0,_r.useId)();return e.length===0?null:(0,ee.jsxs)("section",{className:"sekyro-tips","aria-labelledby":n,"data-testid":"sekyro-tips",children:[(0,ee.jsx)("p",{className:"sekyro-tips__title",id:n,children:t("capture.tips.title")}),(0,ee.jsx)("ul",{className:"sekyro-tips__list",children:e.map(r=>{let a=typeof r=="string"?xn[r]:void 0,i=typeof r=="string"?r:r.id,l=a!==void 0?a.icon():typeof r=="string"?void 0:r.icon,u=a!==void 0?t(a.key):typeof r=="string"?r:r.text;return(0,ee.jsxs)("li",{className:"sekyro-tips__item",children:[l!=null?(0,ee.jsx)("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:l}):null,(0,ee.jsx)("span",{children:u})]},i)})})]})}o(Ir,"Cn");s(Ir,"TipList");var Nn=220;function Ur({title:e,description:t,options:n,busy:r,error:a,focus:i,testId:l,look:u="cards",marked:S,onChoose:h}){let w=(0,ye.useId)(),x=kt(),[I,d]=(0,ye.useState)(null),N=(0,ye.useRef)(null);(0,ye.useEffect)(()=>{a!==null&&d(null)},[a]),(0,ye.useEffect)(()=>()=>{N.current!==null&&clearTimeout(N.current)},[]);let L=s(p=>{r||I!==null||(d(p),N.current=setTimeout(()=>{N.current=null,d(null),h(p)},Nn))},"choose");return(0,P.jsxs)("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":w,"data-testid":l,children:[(0,P.jsxs)("div",{className:u==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[(0,P.jsx)("h2",{id:w,ref:i?x:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?(0,P.jsx)("p",{className:"sekyro-text-muted",children:t}):null]}),a!==null?(0,P.jsx)(se,{tone:"danger",children:(0,P.jsx)("span",{children:a})}):null,u==="buttons"?(0,P.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:n.map((p,j)=>(0,P.jsx)(X,{kind:j===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:o(()=>h(p.id),"onClick"),children:p.label},p.id))}):(0,P.jsx)("div",{className:"sekyro-choices",children:n.map(p=>(0,P.jsxs)("button",{type:"button",className:"sekyro-card","aria-pressed":(I??S)===p.id,"aria-busy":r||void 0,disabled:r||I!==null&&I!==p.id,onClick:o(()=>L(p.id),"onClick"),children:[p.glyph!==void 0?(0,P.jsx)("span",{className:"sekyro-card__tile",children:p.glyph}):null,(0,P.jsxs)("span",{className:"sekyro-card__body",children:[(0,P.jsx)("span",{className:"sekyro-card__title",children:p.label}),p.sub!==void 0?(0,P.jsx)("span",{className:"sekyro-card__sub",children:p.sub}):null]}),(0,P.jsx)("span",{className:"sekyro-radio","aria-hidden":"true"})]},p.id))})]})}o(Ur,"bn");s(Ur,"ChoiceScreen");var jr=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","fcv3.one_face","capture.tips.summary","capture.lookAtColours"];function st(e){return e!==null&&jr.includes(e)}o(st,"he");s(st,"isVoiceKey");var Mn=s((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function je(e,t,n){let r;try{if(typeof e=="function")r=e(t,n);else{let a=e[n];r=a!=null&&Mn(a,t)?a[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}o(je,"Me");s(je,"resolveClip");var Ln="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",Rn={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function ae(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}o(ae,"ne");s(ae,"synth");function Tr(){return ae()!==null&&typeof SpeechSynthesisUtterance=="function"}o(Tr,"Lr");s(Tr,"speechAvailable");function wt(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}o(wt,"Sn");s(wt,"baseLang");function Rt(e,t){let n=s(a=>a.replace(/_/g,"-").toLowerCase(),"norm"),r=wt(t);return e.find(a=>n(a.lang)===n(t))??e.find(a=>wt(a.lang)===r)}o(Rt,"Mn");s(Rt,"pickVoice");function Br(e){if(!Tr())return!1;let t=[];try{t=ae()?.getVoices()??[]}catch{return!0}return t.length===0||Rt(t,e)!==void 0}o(Br,"wn");s(Br,"speechUsable");function Or(e){let t=ae();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}o(Or,"Ln");s(Or,"subscribeVoices");function Fe(e){try{let t=typeof location<"u"?location.href:"http://localhost/",n=new URL(e,t);return`clip:${n.origin}${n.pathname}`}catch{return`clip:${e}`}}o(Fe,"Ke");s(Fe,"clipIdentity");function St(e){e.pause(),e.removeAttribute("src"),e.load()}o(St,"Rn");s(St,"release");function Pr(){let e=null,t=null,n=0,r=null,a=[],i=new Map,l=s(()=>{a=ae()?.getVoices()??[]},"loadVoices"),u=!1,S=s(()=>{let d=ae();u||d===null||(u=!0,l(),d.addEventListener?.("voiceschanged",l))},"bindVoices"),h=s(()=>(e??(e=new Audio),e),"element"),w=s((d,N,L)=>{let p=ae();if(p!==null&&d!==""&&typeof SpeechSynthesisUtterance=="function"){S();let j=Rt(a,N);if(a.length===0||j!==void 0){p.cancel();let _=new SpeechSynthesisUtterance(d);_.lang=N,j!==void 0&&(_.voice=j),_.rate=.95,L!==void 0&&(_.onend=_.onerror=L),p.speak(_);return}}L?.()},"speak"),x=s(()=>{n+=1,r=null,e!==null&&(e.pause(),e.currentTime=0),ae()?.cancel()},"stop"),I=s(d=>{for(let N of d){let L=Fe(N);if(i.has(L))continue;let p=new Audio;p.preload="auto",p.src=N,i.set(L,p)}},"warmClips");return{say(d){let N=d.url!==null?Fe(d.url):`tts:${d.lang}:${d.text}`;if(N===r)return;r=N,n+=1;let L=n,p=d.onEnd,j=p!==void 0?()=>{L===n&&p()}:void 0;if(ae()?.cancel(),d.url!==null){let _=h();_.pause(),_.muted=!1,_.src=d.url,_.currentTime=0,_.onended=j??null,_.play()?.catch(A=>{L===n&&A?.name!=="AbortError"&&(d.speech?w(d.text,d.lang,j):j?.())});return}d.speech?w(d.text,d.lang,j):j?.()},unlock({lang:d,speech:N,prefetch:L}){let p=h();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let A=Uint8Array.from(atob(Ln),q=>q.charCodeAt(0));t=URL.createObjectURL(new Blob([A],{type:"audio/wav"}))}let j=p.paused===!1&&t!==null&&p.src!==t;t!==null&&!j&&(p.muted=!0,p.onended=null,p.src=t,p.play()?.catch(()=>{}));let _=ae();if(N&&_!==null&&typeof SpeechSynthesisUtterance=="function"){S();let A=new SpeechSynthesisUtterance(" ");A.volume=0,A.lang=d,_.speak(A)}I(L??[])},prefetch:I,stop:x,dispose(){x(),u&&ae()?.removeEventListener?.("voiceschanged",l),u=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&St(e),e=null;for(let d of i.values())St(d);i.clear()}}}o(Pr,"_n");s(Pr,"createVoicePlayer");var An="sekyro.voiceGuidance";function qr(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}o(qr,"xn");s(qr,"readVoicePreference");function Vr(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}o(Vr,"En");s(Vr,"writeVoicePreference");var Ve="capture.tips.summary",En=typeof window<"u"?C.useLayoutEffect:C.useEffect,In=Object.freeze({});function rt(e,t){let n=new Set,r=[];for(let a of jr){let i=a===Ve?null:je(e,a,t);i===null||n.has(Fe(i))||(n.add(Fe(i)),r.push(i))}return r}o(rt,"ht");s(rt,"resolvedClipUrls");function Fr({locale:e,defaultClips:t,options:n}){let r=n===!1,a=r?{}:n??{},i=a.storageKey===void 0?An:a.storageKey,[l,u]=(0,C.useState)(a.defaultEnabled??!0),S=(0,C.useRef)(l),[h,w]=(0,C.useState)(!1),[x,I]=(0,C.useState)("none"),[d,N]=(0,C.useState)(!1),L=(0,C.useRef)(!1),[p,j]=(0,C.useState)(0),_=(0,C.useRef)(null),A=(0,C.useCallback)(()=>(_.current??(_.current=Pr()),_.current),[]),q=Rn[e],D=a.speechFallback,f=D===void 0||D===!0?!0:D===!1?!1:D.includes(e),z=a.clips??t??In,ie=(0,C.useRef)(!1),le=(0,C.useRef)(z);En(()=>{le.current=z,S.current=l}),(0,C.useEffect)(()=>{if(r||i===null)return;let R=qr(i);R!==null&&(S.current=R,u(R))},[r,i]),(0,C.useEffect)(()=>{if(!(r||!f))return Or(()=>j(R=>R+1))},[r,f]);let c=a.clips;(0,C.useEffect)(()=>{if(r)return;let R=f&&Br(q);w(rt(z,e).length>0||R),I(c!==void 0&&je(c,Ve,e)!==null?"partner":je(z,Ve,e)!==null||R?"default":"none")},[r,z,c,e,f,q,p]),(0,C.useEffect)(()=>{if(r||!l||!ie.current)return;let R=rt(z,e);R.length>0&&A().prefetch(R)},[r,l,z,e,A]),(0,C.useEffect)(()=>()=>{_.current?.dispose(),_.current=null,ie.current=!1},[]);let V=(0,C.useCallback)(R=>{r||(ie.current=!0,A().unlock({lang:q,speech:f,...R?{prefetch:rt(le.current,e)}:{}}))},[r,A,q,f,e]),T=(0,C.useCallback)(()=>V(S.current),[V]),K=(0,C.useCallback)(()=>{L.current=!1,N(!1)},[]),O=(0,C.useCallback)(()=>{K(),_.current?.stop()},[K]),ve=(0,C.useCallback)(()=>{L.current&&O()},[O]),he=(0,C.useCallback)((R,xe)=>{if(r)return;if(L.current){O();return}let ge=A();ge.stop(),L.current=!0,N(!0);let B=xe?.clip===!1?null:je(le.current,Ve,e);ge.say({url:B,text:R,lang:q,speech:f,onEnd:K})},[r,O,A,e,q,f,K]),Z=(0,C.useCallback)(R=>{r||(R?V(!0):O(),i!==null&&Vr(i,R),S.current=R,u(R))},[r,V,O,i]),Q=(0,C.useCallback)(()=>Z(!S.current),[Z]),te=(0,C.useCallback)((R,xe)=>{if(r||!l)return;L.current&&K();let ge=je(le.current,R,e);A().say({url:ge,text:xe,lang:q,speech:f})},[r,l,e,A,q,f,K]);return(0,C.useMemo)(()=>({supported:!r&&h,enabled:!r&&l,setEnabled:Z,toggle:Q,unlock:T,speakKey:te,stop:O,summary:r?"none":x,summaryPlaying:d,toggleSummary:he,stopSummary:ve}),[r,h,l,Z,Q,T,te,O,x,d,he,ve])}o(Fr,"vt");s(Fr,"useVoiceGuidance");function Hr(e,t,n,r){let{speakKey:a,stop:i,enabled:l}=e,u=(0,C.useRef)(!1);(0,C.useEffect)(()=>{if(!r||!l){u.current&&i(),u.current=!1;return}u.current=!0,st(t)&&t!==Ve&&n!==""&&a(t,n)},[r,l,t,n,a,i])}o(Hr,"Ct");s(Hr,"useSpeakGuidance");function ot(e){switch(e){case"multiple_faces":return"one_face";case"capture_back_camera":return"front_camera";case"capture_front_camera":return"back_camera";case"capture_not_upright":return"upright";case"media_unreadable":case"clip_too_short":return"recording";case"device_integrity_failed":return"device";default:return"face"}}o(ot,"Pn");s(ot,"retryCoachingOf");var He={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},one_face:{title:"capture.retryTips.title",tips:["capture.retryOneFace.alone","capture.retryOneFace.screens"]},front_camera:{title:"capture.retryTips.title",tips:["capture.retryFrontCamera.screenSide"]},back_camera:{title:"capture.retryTips.title",tips:["capture.retryBackCamera.backSide","capture.retryBackCamera.circle"]},upright:{title:"capture.retryTips.title",tips:["capture.retryUpright.vertical","capture.retryUpright.untilEnd"]},recording:{title:"capture.retryTips.title",tips:["capture.retryRecording.cameraOn","capture.retryRecording.stay","capture.retryRecording.network"]},device:{title:"capture.retryTips.title",tips:["capture.retryDevice.screenRecording","capture.retryDevice.phone"]}};function $r({showCoaching:e,coaching:t="face",attemptsText:n,showRetake:r,onRetake:a}){let i=Re(),l=(0,at.useRef)(null);return(0,at.useEffect)(()=>{r&&l.current?.focus()},[r]),!e&&!r?null:(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,fe.jsx)("p",{className:"sekyro-text-body",children:i(He[t].title)}),(0,fe.jsx)("ul",{className:"sekyro-coaching",children:He[t].tips.map(u=>(0,fe.jsx)("li",{children:i(u)},u))}),n!==null?(0,fe.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:n}):null]}):null,r?(0,fe.jsx)(X,{ref:l,className:"sekyro-btn--start",onClick:a,children:i("capture.recordAgain")}):null]})}o($r,"Tn");s($r,"CapturedPanel");function At(){try{return!1}catch{return!1}}o(At,"nt");s(At,"isDevBuild");var Un=(0,Dr.createContext)(null);function Gr({state:e}){let t=Re(),[n,r]=(0,it.useState)(!1);(0,it.useEffect)(()=>{e!=="unknown"&&r(!0)},[e]);let a=e==="granted"?(0,we.jsx)(Mr,{}):e==="denied"?(0,we.jsx)(Rr,{}):(0,we.jsx)(Lr,{});return(0,we.jsxs)("div",{role:n?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[(0,we.jsx)("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:a}),(0,we.jsx)("span",{children:t(`capture.permission.${e}`)})]})}o(Gr,"On");s(Gr,"PermissionRow");function zr({voice:e}){let t=Re();if(!e.supported)return null;let n=e.enabled;return(0,Se.jsxs)("button",{type:"button",role:"switch","aria-checked":n,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:o(()=>e.toggle(),"onClick"),children:[(0,Se.jsxs)("span",{className:"sekyro-switch__label",children:[(0,Se.jsx)(nt,{off:!n}),t("capture.voiceGuidance")]}),(0,Se.jsx)("span",{className:"sekyro-switch__track","aria-hidden":"true",children:(0,Se.jsx)("span",{className:"sekyro-switch__thumb",children:n?(0,Se.jsx)(Ar,{className:"sekyro-switch__check"}):null})})]})}o(zr,"Hn");s(zr,"VoiceSwitch");function Kr({assets:e,onRetryAssets:t,permission:n,captureMode:r="self",voice:a,tips:i,summary:l,startLabel:u,startDisabled:S,onStart:h}){let w=Re(),x=(0,J.useRef)(l?.stop);x.current=l?.stop,(0,J.useEffect)(()=>()=>x.current?.(),[]);let I=(0,J.useRef)(null),d=(0,J.useRef)(null),N=(0,J.useRef)(null),L=(0,J.useRef)(e),p=(0,J.useRef)(!1);(0,J.useEffect)(()=>{let f=L.current;if(L.current=e,f===e)return;let z=p.current;e!=="loading"&&(p.current=!1),Zr(I.current)&&(e==="failed"?N.current?.focus():z&&d.current?.focus())},[e]);let j=(0,J.useCallback)(()=>{p.current=!0,t()},[t]),_=e==="loading",A=_||S,q=(0,J.useCallback)(()=>{A||(x.current?.(),h())},[A,h]),D;return e==="failed"?D=(0,U.jsxs)(se,{tone:"danger",testId:"sekyro-assets-error",children:[(0,U.jsx)("p",{className:"sekyro-text-body",children:w("fcv2.err.models")}),(0,U.jsx)(X,{kind:"ghost",ref:N,className:"sekyro-btn--start",onClick:j,"data-testid":"sekyro-assets-retry",children:w("common.retry")})]}):D=(0,U.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,U.jsx)(X,{ref:d,full:!0,"data-testid":"sekyro-start","aria-disabled":A?"true":void 0,"aria-busy":_?"true":void 0,onClick:q,children:_?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Er,{}),w("capture.preparing.title")]}):u??w("capture.start")}),_?(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.preparing.hint")}):null]}),(0,U.jsxs)("div",{ref:I,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?(0,U.jsxs)("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[(0,U.jsx)("h2",{className:"sekyro-text-body",children:w("capture.assisted.title")}),(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.assisted.lead")})]}):null,i!==!1?(0,U.jsx)(Ir,{tips:i}):null,l!==void 0?(0,U.jsxs)(X,{kind:"ghost",className:"sekyro-btn--start",onClick:l.toggle,"data-testid":"sekyro-tips-listen",children:[(0,U.jsx)(nt,{off:!1}),w(l.playing?"capture.tips.stop":"capture.tips.listen")]}):null,(0,U.jsx)(Gr,{state:n}),(0,U.jsx)(zr,{voice:a}),(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.securityNote")}),D,(0,U.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?w("capture.preparing.title"):e==="ready"?w("capture.ready"):""})]})}o(Kr,"Fn");s(Kr,"PreCaptureScreen");function Zr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}o(Zr,"Ur");s(Zr,"focusIsOurs");function Qr(){let[e,t]=(0,lt.useState)({state:"unknown",settled:!1});return(0,lt.useEffect)(()=>jn(n=>t({state:n,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}o(Qr,"Dn");s(Qr,"useCameraStatus");function Wr(e){return Et(e,"mobileRequired")}o(Wr,"qn");s(Wr,"useMobileRequired");function Jr(e){return Et(e,"returning").required}o(Jr,"jn");s(Jr,"useReturning");function Et(e,t){let[n,r]=(0,pe.useState)({required:!1,settled:e===void 0});return(0,pe.useEffect)(()=>{let a=e?.[t];if(e===void 0||typeof a!="function"){r({required:!1,settled:!0});return}let i=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>a.call(e)).then(l=>{i&&r({required:l===!0,settled:!0})},()=>{i&&r({required:!1,settled:!0})}),()=>{i=!1}},[e,t]),n}o(Et,"Yn");s(Et,"useFlag");function Yr(e){let t=s(()=>e?.captureChoice??null,"initialChoice"),[n,r]=(0,pe.useState)(()=>({session:"self",choice:t(),settled:e===void 0}));(0,pe.useEffect)(()=>{let i=e?.captureMode,l=e?.captureChoice??null;if(e===void 0||typeof i!="function"){r({session:"self",choice:l,settled:!0});return}let u=!0;return r({session:"self",choice:l,settled:!1}),Promise.resolve().then(()=>i.call(e)).then(S=>{let h=e.captureChoice??null;u&&r({session:h!==null&&S===h?"choice":S==="assisted"||S==="choice"?S:"self",choice:h,settled:!0})},()=>{u&&r({session:"self",choice:null,settled:!0})}),()=>{u=!1}},[e]);let a=(0,pe.useCallback)(i=>{e?.chooseCaptureMode?.(i),r(l=>({...l,choice:i}))},[e]);return{mode:n.session==="choice"?n.choice??"self":n.session==="assisted"?"assisted":"self",session:n.session,choice:n.choice,settled:n.settled,choose:a}}o(Yr,"$n");s(Yr,"useCaptureMode");function Xr(e){let[t,n]=(0,pe.useState)(!1);return(0,pe.useEffect)(()=>{if(n(!1),e===void 0)return;let r=e.on("busy",()=>n(!0)),a=e.on("result",()=>n(!1));return()=>{r(),a()}},[e]),t}o(Xr,"zn");s(Xr,"useBusy");var Pn=s(()=>"idle","serverSnapshot");function xt(e){return Bn(e!==void 0?{assetBaseUrl:e}:{})}o(xt,"Qn");s(xt,"preload");function en(e,t=!0){let n=(0,W.useSyncExternalStore)((0,W.useCallback)(h=>On(h,e),[e]),()=>Tn(e),Pn),[r,a]=(0,W.useState)(null),i=(0,W.useRef)(!1),l=(0,W.useCallback)(()=>{xt(e).then(h=>{i.current&&h==="idle"&&a({base:e})})},[e]);(0,W.useEffect)(()=>(i.current=!0,l(),()=>{i.current=!1}),[l]);let u=(0,W.useRef)(null);(0,W.useEffect)(()=>{if(n!=="idle"){u.current={base:e};return}!t||u.current===null||u.current.base!==e||(u.current=null,l())},[n,e,l,t]);let S=(0,W.useCallback)(()=>{xt(e)},[e]);return{gate:r!==null&&r.base===e&&n==="idle"||n==="ready"?"ready":n==="failed"?"failed":"loading",retry:S}}o(en,"Jn");s(en,"useLivenessAssets");var Cr={progress:0,hint:null,faceDetected:!1};function tn(e){let{videoRef:t,assetBaseUrl:n}=e,r=(0,M.useRef)(e.verification).current,a=(0,M.useRef)(!1);e.verification!==r&&!a.current&&At()&&(a.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: the `verification` prop changed identity after mount. The first instance stays bound (the camera is not rebuilt); create the verification once (useMemo / useState / outside render) instead of on every render."));let i=(0,M.useRef)(null),[l,u]=(0,M.useState)("idle"),[S,h]=(0,M.useState)(Cr),[w,x]=(0,M.useState)(!1),[I,d]=(0,M.useState)(!1),[N,L]=(0,M.useState)(null),[p,j]=(0,M.useState)(!1),[_,A]=(0,M.useState)(null),[q,D]=(0,M.useState)(null),[f,z]=(0,M.useState)(null),[ie,le]=(0,M.useState)(null),[c,V]=(0,M.useState)(null),[T,K]=(0,M.useState)(!1),O=(0,M.useRef)(null),ve=(0,M.useRef)("idle"),he=(0,M.useRef)(-1),[Z,Q]=(0,M.useState)(0),te=(0,M.useRef)(e);te.current=e,(0,M.useEffect)(()=>{let Y=t.current;if(Y===null)return;let ce={video:Y,...n!==void 0?{assetBaseUrl:n}:{}},F=r!==void 0?r.liveness(ce):qn(ce);i.current=F;let Ne=s(()=>V(F.facingMode??null),"readFacing");Ne();let $e=[F.on("state",b=>{b==="mode_switch"?K(!0):b!=="starting"&&b!=="gating"&&K(!1),b==="starting"?(ve.current!=="starting"&&(he.current+=1,Q(Math.max(0,he.current))),D(null),z(null),h(Cr),d(!1),x(!1),L(null),A(null),O.current=null):b==="gating"&&ve.current==="recording"&&(d(!1),x(!1),L(null),O.current=null),ve.current=b,Ne(),u(b),te.current.onStateChange?.(b)}),F.on("gate",b=>{let ke=O.current;O.current=b.progress,x(ke!==null&&b.progress<ke-.001&&b.progress>0&&b.progress<1),b.progress>=1&&d(!0),h(b)}),F.on("frozen",({previewDataUrl:b})=>L(b)),F.on("profile",({animations:b})=>j(b==="reduced")),F.on("ramp",({colour:b})=>A(b)),F.on("captured",b=>{D(b),le(null),te.current.onCaptured?.(b)}),F.on("error",b=>{z(b);let ke=r?.reportCaptureIssue;ke!==void 0&&bt(Ee=>ke.call(r,Ee),kr("liveness",b,Math.max(0,he.current))),te.current.onError?.(b)}),r?.on("result",b=>{le(b),te.current.onResult?.(b)})];return()=>{for(let b of $e)b?.();i.current=null,F.destroy()}},[r,t,n]);let R=(0,M.useCallback)(()=>{i.current?.start()},[]),xe=(0,M.useCallback)(()=>{i.current?.retry()},[]),ge=(0,M.useCallback)(async()=>{let Y=i.current;return Y===null||typeof Y.canSwitchCaptureMode!="function"?!1:await Y.canSwitchCaptureMode().catch(()=>!1)===!0},[]),B=(0,M.useCallback)(async Y=>{let ce=i.current;if(ce===null||typeof ce.setCaptureMode!="function")return!1;let F=await ce.setCaptureMode(Y).catch(()=>!1)===!0;return F&&V(ce.facingMode??null),F},[]);return{state:l,gate:S,draining:w,gateLocked:I,frozenPreview:N,reduceMotion:p,rampColour:_,artifacts:q,error:f,result:ie,facingMode:c,start:R,retry:xe,canSwitchCaptureMode:ge,setCaptureMode:B,modeRestarted:T,attempt:Z}}o(tn,"er");s(tn,"useLivenessHandle");var Vn=new Set(["national_number"]);function Nt(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(n=>Vn.has(n));return t.length>0?{...e,options:t}:null}o(Nt,"tr");s(Nt,"pending");function rn(e){let[t,n]=(0,me.useState)(null),[r,a]=(0,me.useState)(e===void 0),[i,l]=(0,me.useState)(!1),[u,S]=(0,me.useState)(!1);(0,me.useEffect)(()=>{if(n(null),e===void 0){a(!0);return}let x=!0,I=e.methodChoice;typeof I=="function"?(a(!1),Promise.resolve().then(()=>I.call(e)).then(N=>{x&&n(Nt(N))},()=>{}).finally(()=>{x&&a(!0)})):a(!0);let d=e.on("method",N=>n(Nt(N)));return()=>{x=!1,d()}},[e]);let h=(0,me.useCallback)(async x=>{if(e===void 0)return!1;l(!0),S(!1);try{return await e.selectMethod(x),n(null),!0}catch{return S(!0),!1}finally{l(!1)}},[e]),w=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:w==="national_number"&&!u?w:null,settled:r,busy:i,failed:u,select:h}}o(rn,"nr");s(rn,"useMethodChoice");var Fn=["ar","fr","en"];function nn(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}o(nn,"so");s(nn,"isClipUrl");function sn(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let n={};for(let r of Fn){let a=t[r];if(!(typeof a!="object"||a===null))for(let[i,l]of Object.entries(a))!st(i)||!nn(l)||((n[r]??(n[r]={}))[i]=l)}return Object.keys(n).length>0?n:null}o(sn,"io");s(sn,"toVoiceClipMap");function an(e){let[t,n]=(0,Te.useState)(null);(0,Te.useEffect)(()=>{if(n(null),e===void 0)return;let a=!0,i=s(u=>{if(!a)return;let S=typeof u=="object"&&u!==null&&typeof u.setId=="string"?u:null;n(h=>h?.setId===S?.setId?h:S)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(i,()=>i(null))}catch{i(null)}let l=e.on("view",u=>i(u.voice));return()=>{a=!1,l()}},[e]);let r=(0,Te.useMemo)(()=>t!==null?sn(t):null,[t]);return e===void 0?null:r}o(an,"rr");s(an,"useServerVoiceClips");function on({voice:e}){let t=Re();return(0,Mt.jsx)(X,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:o(()=>e.toggle(),"onClick"),children:(0,Mt.jsx)(nt,{off:!e.enabled,className:"sekyro-icon"})})}o(on,"sr");s(on,"VoiceChip");var Hn=new Set(["abandoned","not_opened","cancelled","superseded"]),$n=800,Dn="capture.lookAtColours";function ln(e){return e===void 0||e!==!1&&e.length===_t.length&&_t.every(t=>e.includes(t))}o(ln,"fo");s(ln,"isDefaultTips");function cn(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}o(cn,"mo");s(cn,"carriesActivation");function un(e){return typeof e=="object"&&e!==null&&!(0,y.isValidElement)(e)&&"tone"in e&&"text"in e}o(un,"yo");s(un,"isNoticeObject");var Gn=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function dn(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}o(dn,"ho");s(dn,"isCapturing");function pn(e){return e==="captured"||e==="uploading"||e==="checking"}o(pn,"vo");s(pn,"isPostCapture");function zn({verification:e,locale:t,dir:n,strings:r,slots:a,autoStart:i=!1,notice:l,startDisabled:u=!1,startLabel:S,tips:h,tipsSummary:w,coach:x,voice:I,onGuidance:d,onCaptured:N,onResult:L,onError:p,onStateChange:j,assetBaseUrl:_,className:A}){let q=dr(t),D=(0,y.useMemo)(()=>ur(t,r),[t,r,q]),f=(0,y.useMemo)(()=>g=>D[g]??"",[D]),z=n??(t==="ar"?"rtl":"ltr"),ie=(0,y.useRef)(null),le=(0,y.useContext)(Un),c=tn({verification:e,videoRef:ie,assetBaseUrl:_,onCaptured:N,onResult:L,onError:p,onStateChange:j}),V=en(_,c.state==="idle"&&c.error===null),T=rn(e),K=T.choice!==null,O=Wr(e),ve=Jr(e),he=Xr(e),Z=Qr(),Q=Yr(e),te=Q.session==="choice",R=Q.mode==="assisted",xe=I!==!1&&I?.clips===void 0,ge=an(xe?e:void 0),B=Fr({locale:t,defaultClips:ge,options:I}),Y=R?"environment":"user",ce=Q.settled,F=(0,y.useRef)(null),Ne=(0,y.useRef)(!1),$e=(0,y.useRef)(B.unlock);$e.current=B.unlock,(0,y.useEffect)(()=>{let g=F.current;if(g===null)return;let ne=["pointerup","touchend","click","keydown"],_e=s(()=>{for(let qe of ne)g.removeEventListener(qe,Le,!0)},"disarm");function Le(qe){if(Ne.current){_e();return}cn(qe)&&(Ne.current=!0,_e(),$e.current())}o(Le,"Re"),s(Le,"onGesture");for(let qe of ne)g.addEventListener(qe,Le,{capture:!0,passive:!0});return _e},[]);let b=(0,y.useCallback)(()=>{Ne.current||(Ne.current=!0,B.unlock()),c.start()},[B.unlock,c.start]),ke=(0,y.useCallback)(()=>c.start(),[c.start]),Ee=(0,y.useRef)(!1),Be=c.state==="idle"&&c.error===null,Ut=!K&&!O.required&&(i===!0||i==="when-permitted"&&Z.permission==="granted"),jt=Ut&&T.settled&&O.settled&&ce,mn=i==="when-permitted"&&!Z.permissionSettled&&!Ee.current,Tt=Ut&&Be&&!Ee.current,ut=(mn||Tt||!ce)&&V.gate==="ready"?"loading":V.gate;(0,y.useEffect)(()=>{!jt||!Be||V.gate!=="ready"||Ee.current||(Ee.current=!0,ke())},[jt,Be,V.gate,ke]);let yn=Be&&!K&&!O.required&&!(Tt&&V.gate==="ready"),[Bt,Ot]=(0,y.useState)(!1),{canSwitchCaptureMode:Pt,setCaptureMode:qt}=c;(0,y.useEffect)(()=>{if(!Q.settled||!te){Ot(!1);return}let g=!0;return Pt().then(ne=>{g&&Ot(ne)}),()=>{g=!1}},[Q.settled,te,Pt]);let{choose:Vt}=Q,Ie=R?"self":"assisted",vn=(0,y.useCallback)(async()=>{await qt(Ie)&&Vt(Ie)},[qt,Vt,Ie]),Ft=c.state!=="idle"&&c.facingMode!==null?c.facingMode:Y;(0,y.useEffect)(()=>{let g=ie.current?.style;Ft==="user"?g?.removeProperty("transform"):g&&(g.transform="none")},[Ft]);let De=(0,y.useMemo)(()=>c.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(c.artifacts.keyframe):null,[c.artifacts]);(0,y.useEffect)(()=>{if(De!==null)return()=>URL.revokeObjectURL(De)},[De]);let Ht=c.frozenPreview??De,Ue=e!==void 0,G=dn(c.state),be=pn(c.state),Ge=G||be,re=c.result,$t=c.state==="done"&&re!==null,ze=G&&c.rampColour!==null,dt=c.state==="recording"&&c.frozenPreview!==null&&!ze,Ke=le!==null,Dt=Bt&&G&&!dt?{to:Ie,label:f(Ie==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:f(Ie==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:s(()=>{vn()},"onSwitch")}:null,Ze=c.modeRestarted&&G?f("capture.modeSwitch.restarted"):null,Oe=be||dt,Gt=be?"checking":dt?"frozen":c.state==="recording"||ze?"recording":c.gateLocked||c.gate.progress>=1?"locked":c.gate.faceDetected?"aligning":"seeking",Qe=G?c.gate.hint:null,We=c.state==="starting"?"capture.preparing.title":Qe===null?null:Qe==="center"&&!c.gate.faceDetected?"fcv3.no_face":or(Qe),[gn,zt]=(0,y.useState)(null);(0,y.useEffect)(()=>{if(We!=="fcv3.no_face"){zt(We);return}if(!G)return;let g=setTimeout(()=>zt(We),$n);return()=>clearTimeout(g)},[We,G]);let pt=G&&!ze&&typeof x=="string"&&x!=="",Kt=R&&G?f("capture.assisted.stage"):null,Me=G&&!pt?ze?Dn:gn:null,ht=pt?x:Me===null?"":f(Me);Hr(B,Me,ht,G);let Zt=(0,y.useRef)(d);Zt.current=d,(0,y.useEffect)(()=>{if(st(Me))try{Zt.current?.(Me)}catch(g){console.error("[@sekyro/react] onGuidance threw:",g)}},[Me]);let Pe=(0,y.useMemo)(()=>({supported:B.supported,enabled:B.enabled,setEnabled:B.setEnabled,toggle:B.toggle}),[B.supported,B.enabled,B.setEnabled,B.toggle]),ft=a?.voicePrompt,Qt=ft!==void 0,Wt=I===void 0,Jt=(0,y.useRef)(!1);(0,y.useEffect)(()=>{!Qt||!Wt||Jt.current||!At()||(Jt.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: `slots.voicePrompt` is set and `voice` is undefined, so the component speaks the guidance itself. If your slot plays audio, pass voice={false} or the person hears every hint twice; pass voice={{}} to keep the built-in voice and silence this warning."))},[Qt,Wt]);let kn=ft!==void 0?(g,ne,_e)=>ft(g,ne,_e,Pe):B.supported?()=>(0,k.jsx)(on,{voice:Pe}):void 0,{summary:mt,summaryPlaying:Yt,toggleSummary:Xt,stopSummary:er}=B,Je=w!==void 0&&w!=="",tr=Je?w:f("capture.tips.summary"),rr=Je?mt!=="none":mt==="partner"||mt==="default"&&ln(h),bn=(0,y.useMemo)(()=>rr?{playing:Yt,toggle:s(()=>Xt(tr,{clip:!Je}),"toggle"),stop:er}:void 0,[rr,Yt,Xt,tr,er,Je]),Cn=(0,y.useMemo)(()=>({assets:ut,retryAssets:V.retry,permission:Z.permission,permissionSettled:Z.permissionSettled,captureMode:Q.mode,facing:Y,voice:Pe}),[ut,V.retry,Z.permission,Z.permissionSettled,Q.mode,Y,Pe]),_n=un(l)?(0,k.jsx)(se,{tone:l.tone,testId:"sekyro-host-notice",children:(0,k.jsx)("span",{children:l.text})}):l??null,ue=re!==null&&re.status==="retry"?re:null,H=$t&&re.status==="unavailable"&&!K&&re.reasonCode!=="portrait_required"?re:null,Ce=$t&&(re.status==="verified"||re.status==="not_verified"||re.status==="review")?re:null,yt=s((g,ne)=>{if(g===void 0)return null;if(g==="device_cooldown"){let Le=lr(t,ne);if(Le!==null)return f(Le.key).replace("{time}",Le.time)}let _e=et(g);return _e===null?null:f(_e)},"reasonText"),vt=s(g=>{let ne=g.retakeHint===void 0?null:Xe(g.retakeHint);return ne===null?yt(g.reasonCode):f(ne)},"retryText"),nr=Ce===null?null:yt(Ce.reasonCode,Ce.retryAfter)??(Ce.status==="not_verified"&&Ce.reason!==void 0&&Hn.has(Ce.reason)?f("errors.session_expired"):null),wn=H!==null&&H.reasonCode!==void 0&&H.reasonCode!=="nni_unbound"&&H.reasonCode!=="id_number_unbound"&&H.reasonCode!=="method_required"&&H.reasonCode!=="mobile_required"&&!(H.reasonCode==="no_recorder"&&c.artifacts?.degraded==="NO_RECORDER"),Ye=H?.reasonCode,sr=c.attempt;(0,y.useEffect)(()=>{H===null||Ye===void 0||e?.reportCaptureIssue===void 0||Gn.has(Ye)||bt(g=>e.reportCaptureIssue?.(g),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:Ye,attempt:Math.min(1e3,sr)})},[H,Ye,sr,e]);let ar=kt(),Sn=K&&T.auto===null&&!G&&!be&&c.error===null,gt=(0,y.useCallback)(async g=>{await T.select(g)&&c.state==="done"&&c.retry()},[T.select,c.state,c.retry]);return(0,y.useEffect)(()=>{T.auto!==null&&!T.busy&&!G&&!be&>(T.auto)},[T.auto,T.busy,G,be,gt]),(0,k.jsx)(pr,{value:f,children:(0,k.jsxs)("div",{ref:F,className:A===void 0?"sekyro-capture":`sekyro-capture ${A}`,dir:z,lang:t,"data-testid":"sekyro-liveness-capture","data-state":c.state,children:[a?.header,ue!==null&&vt(ue)!==null&&!(Ke&&Ge)?(0,k.jsx)(se,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:(0,k.jsx)("span",{children:vt(ue)})}):null,Ze!==null&&!Ke?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:(0,k.jsx)("span",{children:Ze})}):null,he&&be&&!Ke?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:(0,k.jsx)("span",{children:f("capture.busy")})}):null,O.required&&Be?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:(0,k.jsx)("span",{children:f("reasons.mobile_required")})}):null,c.error!==null?a?.errorPanel!==void 0?a.errorPanel(c.error,c.retry):(0,k.jsxs)(se,{tone:"danger",testId:"sekyro-error-notice",children:[(0,k.jsx)("span",{children:f(ir(c.error))}),c.error.retryable?(0,k.jsx)(X,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:c.retry,children:f("common.retry")}):null]}):null,H!==null?(0,k.jsxs)(se,{tone:"danger",testId:"sekyro-unavailable-notice",children:[(0,k.jsx)("span",{children:(H.reasonCode==="attestation"&&H.attestationError==="clock_wrong"?f("errors.device_clock"):yt(H.reasonCode))??f(H.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),wn?(0,k.jsx)(X,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:c.retry,children:f(H.reasonCode==="attestation"?"common.retry":"capture.recordAgain")}):null]}):null,nr!==null&&Ce!==null?(0,k.jsx)(se,{tone:Ce.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:(0,k.jsx)("span",{children:nr})}):null,(0,k.jsx)("div",{className:Ge?void 0:"sekyro-hidden","data-capture-live":Ge?"":void 0,children:Ke?le({videoRef:ie,guidance:Oe&&Ue?f("capture.checking"):ht,coached:pt&&!(Oe&&Ue),note:Oe?Ue?f(he?"capture.busy":"capture.checkingHint"):null:Ze??(ue!==null?vt(ue):Kt),settled:Oe&&Ue,progress:c.gate.progress,phase:Gt,still:Oe?Ht:null,live:Ge,modeSwitch:Dt,...Bt?{status:Ze}:{},ramp:c.rampColour===null?null:{colour:c.rampColour}}):(0,k.jsx)(hr,{videoRef:ie,guidanceText:ht,guidanceHint:Qe,guidanceKey:Me,progress:c.gate.progress,phase:Gt,draining:c.draining,stillUrl:Ht,showChecking:Ue,operatorText:Kt,voicePrompt:kn,overlay:o(g=>(0,k.jsxs)(k.Fragment,{children:[a?.stageOverlay?.(g),(0,k.jsx)(fr,{colour:c.rampColour})]}),"overlay"),reduceMotion:c.reduceMotion,modeSwitch:Dt})}),Sn&&T.choice!==null?(0,k.jsx)(Ur,{title:f("method.title"),description:f("method.description"),options:T.choice.options.map(g=>({id:g,label:f(`method.${g}`)})),busy:T.busy,error:T.failed?f("errors.network_error"):null,focus:c.state==="done",testId:"sekyro-method",look:"buttons",onChoose:o(g=>{gt(g)},"onChoose")}):null,yn?(0,k.jsxs)(k.Fragment,{children:[ve&&a?.header===void 0&&a?.intro===void 0?(0,k.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,k.jsx)("h2",{className:"sekyro-text-body",children:f("returning.title")}),(0,k.jsx)("p",{className:"sekyro-text-muted",children:f("returning.description")})]}):null,_n,a?.intro!==void 0?a.intro(b,Cn):(0,k.jsx)(Kr,{assets:ut,onRetryAssets:V.retry,permission:Z.permission,captureMode:Q.mode,voice:Pe,tips:h??_t,summary:bn,startLabel:S,startDisabled:u,onStart:b})]}):null,(0,k.jsx)($r,{showCoaching:ue!==null,coaching:ot(ue?.reasonCode),attemptsText:ue?.attemptsRemaining!==void 0?cr(D,t,ue.attemptsRemaining):null,showRetake:ue!==null&&!G&&!be||!Ue&&c.state==="captured",onRetake:c.retry}),a?.footer]})})}o(zn,"xi");s(zn,"LivenessCapture");var It=E($(),1),ct=E($(),1),m=E(de(),1);import{isInAppBrowser as es}from"@sekyro/web/client";var ks={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function Kn(e,t){switch(e.service){case"document":return t.t("method.document_photo");case"population_registry":return t.t("method.national_number");case"national_eid":{let n=e.nationalEid?.providerName;return n?t.t("method.national_eid",{provider:n}):t.t("method.national_eidGeneric")}default:return null}}o(Kn,"Y");s(Kn,"identityLabel");function Zn(e,t){let[n,r]=(0,It.useState)(!1),[a,i]=(0,It.useState)(null);return{busy:n,error:a,run:s(l=>{r(!0),i(null),l().then(()=>r(!1),u=>{r(!1),i(e.t(br(u,e.strings))),t?.(u)})},"run")}}o(Zn,"q");s(Zn,"useChoiceAction");function hn(){let e=`sekyro-face-light-${(0,ct.useId)().replace(/[^A-Za-z0-9_-]/g,"")}`;return(0,m.jsxs)("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[(0,m.jsx)("defs",{children:(0,m.jsx)("mask",{id:e,children:(0,m.jsx)("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),(0,m.jsx)("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),(0,m.jsx)("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),(0,m.jsx)("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),(0,m.jsx)("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}o(hn,"O");s(hn,"FaceMark");var Qn={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function Wn(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}o(Wn,"te");s(Wn,"faceIntroRetryOf");var Jn={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function Yn({start:e,context:t,tips:n,tipsTitle:r,human:a=!1,returning:i=!1,notice:l,retry:u}){let S=Ct(),{t:h}=S,w=u===void 0?"face":ot(u.reason),x=w==="face"?null:He[w].tips,I=(0,ct.useContext)(yr)?.busy===!0;return(0,m.jsxs)("section",{className:"sekyro-step",children:[(0,m.jsx)(hn,{}),t.captureMode==="assisted"?(0,m.jsx)(tt,{title:h("capture.assisted.heading"),lead:h("capture.assisted.lead")}):i?(0,m.jsx)(tt,{title:h("returning.heading"),lead:h("returning.description")}):(0,m.jsx)(tt,{title:h(a?"native.face.humanIntroTitle":"native.face.introTitle"),lead:h(a?"native.face.humanIntroLead":"native.face.introLead")}),u!==void 0?(0,m.jsx)(fn,{retry:u,title:He[w].title}):null,r!==void 0&&x===null?(0,m.jsx)("p",{className:"sekyro-section-label",children:r}):null,(0,m.jsx)("ul",{className:"sekyro-tiprows",children:x!==null?x.map(d=>(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:Jn[d]??"face"}),h(d)]},d)):n!==void 0?n.map(d=>(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:Qn[d.id]??"face"}),d.text]},d.id)):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"light"}),h("capture.tips.light")]}),(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"jGlasses"}),h("capture.tips.uncover")]}),(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"smartphone"}),h("capture.tips.eyeLevel")]})]})}),l??null,l!==void 0?null:t.assets==="failed"?(0,m.jsx)(X,{kind:"secondary",full:!0,onClick:t.retryAssets,children:h("common.retry")}):null,l!==void 0?null:(0,m.jsx)(mr,{children:(0,m.jsxs)(X,{full:!0,disabled:t.assets!=="ready"||I,"aria-busy":t.assets==="loading"||void 0,onClick:e,children:[(0,m.jsx)(Ae,{name:"camera"}),h("capture.start")]})})]})}o(Yn,"ne");s(Yn,"FaceIntro");var Xn=new Set(["match_inconclusive","no_face_source","below_threshold"]);function fn({retry:e,title:t}){let n=Ct(),r=e.retakeHint===void 0?null:Xe(e.retakeHint),a=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":Xn.has(e.reason)?"capture.retryMatch.message":et(e.reason);return(0,m.jsxs)(vr,{tone:"warning",children:[r!==null?(0,m.jsx)("span",{children:n.t(r)}):a!==null?(0,m.jsx)("span",{children:n.t(a)}):null,r===null?(0,m.jsx)("span",{children:n.t(t)}):null,(0,m.jsx)("span",{children:gr(n,e.attemptsRemaining,e.attemptsExhausted)})]})}o(fn,"T");s(fn,"RetryNotice");function ts(e){return es(e)}o(ts,"se");s(ts,"isInAppBrowser");function rs(e,t){let n=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(n))return null;let r;try{r=new URL(e)}catch{return null}if(r.protocol!=="https:"&&r.protocol!=="http:")return null;let a=r.protocol.slice(0,-1);return`intent://${r.host}${r.pathname}${r.search}#Intent;scheme=${a};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}o(rs,"ce");s(rs,"androidBrowserIntent");export{Ur as a,At as b,Un as c,Yr as d,zn as e,ks as f,Kn as g,Zn as h,Wn as i,Yn as j,ts as k,rs as l};
|