@sekyro/elements 0.1.0-rc.30 → 0.1.0-rc.31
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-NJKFAWHW-5ISANLWB.js → capture-session-doc-2JNGYSH6-GFUM3RZY.js} +1 -1
- package/dist/cdn/chunks/challenge-frame-HTZ2ZBIE-5JRAFZOU.js +1 -0
- package/dist/cdn/chunks/chunk-44UA2IDQ.js +1 -0
- package/dist/cdn/chunks/{chunk-4GDGJEJ6.js → chunk-4MHDMYKP.js} +1 -1
- package/dist/cdn/chunks/chunk-5AGMJYMI.js +1 -0
- package/dist/cdn/chunks/{chunk-W2IBE5PM.js → chunk-5OPKZZON.js} +1 -1
- package/dist/cdn/chunks/chunk-6T7VBPLY.js +3 -0
- package/dist/cdn/chunks/{chunk-KEO772AF.js → chunk-7V3YMJPI.js} +1 -1
- package/dist/cdn/chunks/{chunk-XZKF2U76.js → chunk-AKU6DWJM.js} +1 -1
- package/dist/cdn/chunks/{chunk-GR6JK2ML.js → chunk-DO66BOHU.js} +1 -1
- package/dist/cdn/chunks/{chunk-2HKOE6CN.js → chunk-EB2QC3GA.js} +1 -1
- package/dist/cdn/chunks/chunk-EGCT7K5E.js +1 -0
- package/dist/cdn/chunks/{chunk-FOPIRIC2.js → chunk-HTIKUYTU.js} +1 -1
- package/dist/cdn/chunks/{chunk-IWRPGU4X.js → chunk-JICBF2XL.js} +1 -1
- package/dist/cdn/chunks/{chunk-JU4XNPJJ.js → chunk-LBEHJATK.js} +1 -1
- package/dist/cdn/chunks/chunk-PRZX4CTP.js +33 -0
- package/dist/cdn/chunks/{chunk-4H47RI64.js → chunk-PWGUNXYH.js} +1 -1
- package/dist/cdn/chunks/{chunk-52X5ZO4S.js → chunk-SOCYEC7N.js} +1 -1
- package/dist/cdn/chunks/{chunk-5KTQLZKN.js → chunk-SYUAQ7BF.js} +1 -1
- package/dist/cdn/chunks/{chunk-5JSOPXYS.js → chunk-T5IBMUSY.js} +1 -1
- package/dist/cdn/chunks/chunk-V6PELUV7.js +1 -0
- package/dist/cdn/chunks/{chunk-DEDYOTBZ.js → chunk-XVHJIXFH.js} +1 -1
- package/dist/cdn/chunks/{chunk-TBQUAM5Z.js → chunk-Y6MS7VVL.js} +1 -1
- package/dist/cdn/chunks/chunk-ZWGMVZWP.js +1 -0
- package/dist/cdn/chunks/create-document-capture-DNJSSCWA-M73L4ODE.js +1 -0
- package/dist/cdn/chunks/{create-portrait-capture-5VGYZUOK-KTCFCHTN.js → create-portrait-capture-3MHP4DGA-4XIQSUJ3.js} +1 -1
- package/dist/cdn/chunks/{document-capture-view-SCXJCJET-YFWA53XE.js → document-capture-view-RFBBBM3S-MO6WL377.js} +1 -1
- package/dist/cdn/chunks/{eid-view-F75DTWPK-AE6YBJNY.js → eid-view-XM5VHPPM-6KKXEHDA.js} +1 -1
- package/dist/cdn/chunks/{email-otp-view-T3NRXENJ-K6FY5XVU.js → email-otp-view-RQV5WU3T-TP222TAL.js} +1 -1
- package/dist/cdn/chunks/flow-views-GYVML5BT-MTJUSGHX.js +1 -0
- package/dist/cdn/chunks/{form-view-7NPB2AJE-TCOF3XPH.js → form-view-Z7ODA3GO-2R5H32O2.js} +1 -1
- package/dist/cdn/chunks/overlay-de-ZQRK2WPD-YEE555KF.js +1 -0
- package/dist/cdn/chunks/overlay-es-XSQAIH32-DCYWAHRS.js +1 -0
- package/dist/cdn/chunks/overlay-pt-2LMQDJ4F-EWEOFJ27.js +1 -0
- package/dist/cdn/chunks/plan-runner-JXCJC5MM-BF6RMCBJ.js +1 -0
- package/dist/cdn/chunks/{portrait-capture-view-4HUAQUIA-G3YLZEHM.js → portrait-capture-view-ZBOXEM6H-LSOMBP5R.js} +1 -1
- package/dist/cdn/chunks/{portrait-review-view-VKRWP4HK-6NZPPDWZ.js → portrait-review-view-BWCMLEID-JA7RWO6C.js} +1 -1
- package/dist/cdn/chunks/{proof-of-address-view-BXQ4O2CU-RFNWZRUP.js → proof-of-address-view-LW5RYD5I-Q3UXH6YT.js} +1 -1
- package/dist/cdn/chunks/session-events-W5DRVA6F-BNHYAEHE.js +8 -0
- package/dist/cdn/chunks/session-watch-7HMFAHQI-WNCXXNDK.js +1 -0
- package/dist/cdn/define.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/{chunk-Q47EK3FL.js → chunk-35LCXJCF.js} +1 -1
- package/dist/chunk-3DAPWPSR.js +1 -0
- package/dist/{chunk-2XRKOCPR.js → chunk-A5EHF3BR.js} +1 -1
- package/dist/{chunk-RSXZISUG.js → chunk-BA2AJKJM.js} +1 -1
- package/dist/{chunk-QDHTMKLS.js → chunk-CMJWPBX6.js} +1 -1
- package/dist/chunk-H7LR746C.js +33 -0
- package/dist/chunk-JGYTOIH7.js +1 -0
- package/dist/{chunk-ZG77WO25.js → chunk-JREXIOVU.js} +1 -1
- package/dist/{chunk-5MOE4EK4.js → chunk-QEDULGVW.js} +1 -1
- package/dist/{chunk-YHJQJMRS.js → chunk-SVNDR2JE.js} +1 -1
- package/dist/{chunk-7GCPE3LG.js → chunk-W4G27O4B.js} +1 -1
- package/dist/{chunk-SCZ22CNO.js → chunk-WQIU4I3K.js} +1 -1
- package/dist/{chunk-D2KOFFZS.js → chunk-YHNEYMR2.js} +1 -1
- package/dist/{chunk-L7NFG55Y.js → chunk-YLWJXCPT.js} +1 -1
- package/dist/define.cjs +5 -5
- package/dist/define.js +1 -1
- package/dist/{document-capture-view-SCXJCJET-WFZYQEU2.js → document-capture-view-RFBBBM3S-ZNPUP6QX.js} +1 -1
- package/dist/{eid-view-F75DTWPK-QMS64USC.js → eid-view-XM5VHPPM-XKR4NZTZ.js} +1 -1
- package/dist/{email-otp-view-T3NRXENJ-WF5ZRHQS.js → email-otp-view-RQV5WU3T-JY72E4XM.js} +1 -1
- package/dist/flow-views-GYVML5BT-WVKFYYSN.js +1 -0
- package/dist/{form-view-7NPB2AJE-5GEBWQJ7.js → form-view-Z7ODA3GO-2ONECUO5.js} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +1 -1
- package/dist/overlay-de-ZQRK2WPD-FMRJWQQX.js +1 -0
- package/dist/overlay-es-XSQAIH32-VTIW3L6E.js +1 -0
- package/dist/overlay-pt-2LMQDJ4F-BB366XXI.js +1 -0
- package/dist/{portrait-capture-view-4HUAQUIA-LYTXJIEX.js → portrait-capture-view-ZBOXEM6H-PNCYH3WV.js} +1 -1
- package/dist/{portrait-review-view-VKRWP4HK-4XFARABZ.js → portrait-review-view-BWCMLEID-MAO4RY74.js} +1 -1
- package/dist/{proof-of-address-view-BXQ4O2CU-455UQJ3O.js → proof-of-address-view-LW5RYD5I-RDTH7FUR.js} +1 -1
- package/dist/styles.css +2 -1
- package/package.json +3 -3
- package/sbom.cdx.json +4 -4
- package/dist/cdn/chunks/challenge-frame-LWDSKM5K-J3CNO3XT.js +0 -1
- package/dist/cdn/chunks/chunk-GORELL4J.js +0 -1
- package/dist/cdn/chunks/chunk-IAPQGT6L.js +0 -1
- package/dist/cdn/chunks/chunk-JB27ZDFD.js +0 -1
- package/dist/cdn/chunks/chunk-KPUG7TMO.js +0 -33
- package/dist/cdn/chunks/chunk-LNE2P3TV.js +0 -1
- package/dist/cdn/chunks/chunk-RVL4N5KZ.js +0 -1
- package/dist/cdn/chunks/chunk-X6SULJS2.js +0 -3
- package/dist/cdn/chunks/create-document-capture-3DB2Y3GP-SMSQUDH2.js +0 -1
- package/dist/cdn/chunks/flow-views-TVG4PFSE-2UL4L6TO.js +0 -1
- package/dist/cdn/chunks/overlay-de-SYWE2LZE-AZG4RYMA.js +0 -1
- package/dist/cdn/chunks/overlay-es-D43QR7EF-ZODSTOP2.js +0 -1
- package/dist/cdn/chunks/overlay-pt-2YUWBZX7-UTMWWMN7.js +0 -1
- package/dist/cdn/chunks/plan-runner-432VPNQW-OBQFQCWK.js +0 -1
- package/dist/chunk-3SFLN33V.js +0 -1
- package/dist/chunk-4BQSPVSM.js +0 -33
- package/dist/chunk-CX7T4ADY.js +0 -1
- package/dist/flow-views-TVG4PFSE-OWVBXJ2R.js +0 -1
- package/dist/overlay-de-SYWE2LZE-QIFDHKT6.js +0 -1
- package/dist/overlay-es-D43QR7EF-FZNYZGGS.js +0 -1
- package/dist/overlay-pt-2YUWBZX7-4AFNZWV2.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as nt}from"./chunk-V6PELUV7.js";import{a as tt,l as rt}from"./chunk-JICBF2XL.js";import{t as _e,u as et}from"./chunk-XKZZC74I.js";import"./chunk-W5WWCOOW.js";import"./chunk-5Y7NCFTK.js";import"./chunk-37BKUH3E.js";import"./chunk-YZWLMKXA.js";import{e as Xe}from"./chunk-T5IBMUSY.js";import"./chunk-IO7MUUC6.js";import"./chunk-Q5ZVLMKQ.js";import"./chunk-L244IUB3.js";import"./chunk-Y6PC7FZV.js";import"./chunk-KHSYTJ46.js";import{A as ze,B as qe,E as Ke,F as ve,G as Y,H as me,I as Ge,J as $e,L as He,M as Ze,a as Z,b as Ne,e as de,f as ue,h as ye,i as Oe,j as pe,k as Ve,l as Ue,m as Fe,o as Le,p as ge,r as fe,s as be,u as De,v as Be,w as te}from"./chunk-44UA2IDQ.js";import"./chunk-5OPKZZON.js";import{a as he}from"./chunk-EGCT7K5E.js";import{b as We,c as Qe,d as Ye}from"./chunk-P7K7ELYZ.js";import{m as Je}from"./chunk-6MYG4HWP.js";import"./chunk-JS2IXPNL.js";import"./chunk-SLLJX5QK.js";import{a as n}from"./chunk-4FHWXBOB.js";var ne={fp12:"936b9c4ccc4a",engine:"sekyro-ocr-1",precision:"fp32",files:{"sekyro-ocr.wasm":{bytes:3550687,sha256:"00d6b1a4e42da8146e662ab0283b97485397811acc806299046933ce1943fb09",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"},"v5-latin-fp16.param":{bytes:19800,sha256:"843964335e9863681bb17d876c69e7315844e0850e3c04f91b11a3f0c2a57bc6",tier:"lazy",group:"latin",contentType:"text/plain"},"v5-latin-fp16.bin":{bytes:3995900,sha256:"0516474d30cff75a6365869992699d27fbc03f00fcf3d7274c3eed651ee6ea90",tier:"lazy",group:"latin",contentType:"application/octet-stream"},"latin.dict.txt":{bytes:2615,sha256:"c3ab00106e4a4d151a8575b1129b91901a68a35b79a81fd63faab00418b87d75",tier:"lazy",group:"latin",contentType:"text/plain"},"v5-arabic-fp16.param":{bytes:19791,sha256:"1d1e219d277bb1a76909741573f56cfae465f11b61a9be4ca4c29580758c8760",tier:"lazy",group:"arabic",contentType:"text/plain"},"v5-arabic-fp16.bin":{bytes:3974364,sha256:"4ced47b32ab4e7ad16ddebc074f31594eb42b912465a8ed7458bb2842af9efe1",tier:"lazy",group:"arabic",contentType:"application/octet-stream"},"arabic.dict.txt":{bytes:2368,sha256:"8f239c13f6c8b1bdf15f332a65a05002ddd4d99b9286a4bfaf6f0327c36ebbec",tier:"lazy",group:"arabic",contentType:"text/plain"},"v5-cyrillic-fp16.param":{bytes:19806,sha256:"c87b42bfa343509b319dd193dcca4c0e20bb13b1d07bfbf4925a9f5d045966d4",tier:"lazy",group:"cyrillic",contentType:"text/plain"},"v5-cyrillic-fp16.bin":{bytes:3999288,sha256:"97446e221c0d2d84cb76dca6d4217a850efad4d5ec85e3fadc78db353cf97afa",tier:"lazy",group:"cyrillic",contentType:"application/octet-stream"},"cyrillic.dict.txt":{bytes:2780,sha256:"2de016b31edd687acfc1bf72170f4feff9f0c4893edac87cef30b2c5a82443ec",tier:"lazy",group:"cyrillic",contentType:"text/plain"},"v5-greek-fp16.param":{bytes:19815,sha256:"1cc1d47d3aa3fce86d3dbe901a553fd29412f44934a4919d986c155d23f63207",tier:"lazy",group:"greek",contentType:"text/plain"},"v5-greek-fp16.bin":{bytes:3879256,sha256:"04190cd4ee2b023665346d4cd239ee118965f837812108869d3d9894d30c4db3",tier:"lazy",group:"greek",contentType:"application/octet-stream"},"greek.dict.txt":{bytes:1102,sha256:"60e017885fd98fd0fb5c402da86179f1fe24ae229b374b3b96d313f99a09de59",tier:"lazy",group:"greek",contentType:"text/plain"},"v5-devanagari-fp16.param":{bytes:19807,sha256:"c6540a818cbb46c5b511dc4dd20ebfeae9038ec64e5cf175cd2d25f1b9f95c51",tier:"lazy",group:"devanagari",contentType:"text/plain"},"v5-devanagari-fp16.bin":{bytes:3931044,sha256:"d3086391eb2298c4d4e5a6d20a7fc58a8d0f3ce0a12395c88e9d485c5d595828",tier:"lazy",group:"devanagari",contentType:"application/octet-stream"},"devanagari.dict.txt":{bytes:1942,sha256:"c66d17ef6ced6fbfb4413810e75f0f788cfde37d4192bd17af7923fa190066c8",tier:"lazy",group:"devanagari",contentType:"text/plain"},"v5-thai-fp16.param":{bytes:19786,sha256:"4422df9dcc960e42082166adcca42da2aa6df62abebc75daf0c887e89381c039",tier:"lazy",group:"thai",contentType:"text/plain"},"v5-thai-fp16.bin":{bytes:3920396,sha256:"3458d7c5f0a7f88cb804d084c6596dea3f67c5ea99082654938d71a4eb72a079",tier:"lazy",group:"thai",contentType:"application/octet-stream"},"thai.dict.txt":{bytes:1766,sha256:"e0f32101004cc828ed4505bba80126be06e282700c4c79175ed2b21a4d454dfa",tier:"lazy",group:"thai",contentType:"text/plain"},"v5-hangul-fp16.param":{bytes:19804,sha256:"8daec1a4aa09d3bc92a476438330921c910263b8e61d62334d79e2d1dd14247c",tier:"lazy",group:"hangul",contentType:"text/plain"},"v5-hangul-fp16.bin":{bytes:6684280,sha256:"1d38192b59765cf71c1909ea4b972ee3c8588537a53844e6830f57fbf47976a4",tier:"lazy",group:"hangul",contentType:"application/octet-stream"},"hangul.dict.txt":{bytes:47450,sha256:"a7872c929cd25cf615cdfea08579cf800db1943900fe683468df4dcff6f848bb",tier:"lazy",group:"hangul",contentType:"text/plain"}},scripts:{latin:{classes:838,rtl:!1,param:"v5-latin-fp16.param",bin:"v5-latin-fp16.bin",dict:"latin.dict.txt"},arabic:{classes:749,rtl:!0,param:"v5-arabic-fp16.param",bin:"v5-arabic-fp16.bin",dict:"arabic.dict.txt"},cyrillic:{classes:852,rtl:!1,param:"v5-cyrillic-fp16.param",bin:"v5-cyrillic-fp16.bin",dict:"cyrillic.dict.txt"},greek:{classes:356,rtl:!1,param:"v5-greek-fp16.param",bin:"v5-greek-fp16.bin",dict:"greek.dict.txt"},devanagari:{classes:570,rtl:!1,param:"v5-devanagari-fp16.param",bin:"v5-devanagari-fp16.bin",dict:"devanagari.dict.txt"},thai:{classes:526,rtl:!1,param:"v5-thai-fp16.param",bin:"v5-thai-fp16.bin",dict:"thai.dict.txt"},hangul:{classes:11947,rtl:!1,param:"v5-hangul-fp16.param",bin:"v5-hangul-fp16.bin",dict:"hangul.dict.txt"}}};var Gn=Object.keys(ne.files).filter(e=>ne.files[e].tier==="live"),$n=Object.keys(ne.files).filter(e=>ne.files[e].tier==="lazy");function it(e,t){return e==="hosted"?"/models-ocr":t==="live"?"https://assets.sekyro.ai/sdk/web/ocr":"https://assets-staging.sekyro.ai/sdk/web/ocr"}n(it,"E");var Nt=["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"],Ot=["carte_identite","passport","residence_permit","drivers_license"],Vt=["carte_identite","passport","residence_permit"];function Me(e,t){let r=e.byIssuer?.[t]??e.default;return Ot.filter(o=>r==="*"?Vt.includes(o):r.includes(o))}n(Me,"gt");function mt(e,t=Nt){return[...new Set([...t,...Object.keys(e.byIssuer??{})])].filter(r=>Me(e,r).length>0).sort()}n(mt,"Bn");function Ut(e){if(e.acceptedDocuments)return e.acceptedDocuments;let t=e.acceptedDocumentTypes?.length?[...e.acceptedDocumentTypes]:["carte_identite","passport"];return{default:[],byIssuer:{MR:t}}}n(Ut,"Fe");var Ft=640,Lt=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),ot=6,at=1500,lt={sharpness:1,exposure:1,meanLuma:128},we=null;function Dt(e,t){try{we??(we=document.createElement("canvas"));let r=we,o=96/Math.max(1,t.width);r.width=Math.max(1,Math.round(t.width*o)),r.height=Math.max(1,Math.round(t.height*o));let i=r.getContext("2d");if(i===null)return lt;i.drawImage(e,t.x,t.y,t.width,t.height,0,0,r.width,r.height);let l=i.getImageData(0,0,r.width,r.height);return{sharpness:Qe(l),exposure:Ye(l),meanLuma:We(l)}}catch{return lt}}n(Dt,"bt");async function Bt(e,t){let r=e.source;return"convertToBlob"in r?r.convertToBlob({type:"image/jpeg",quality:t}):new Promise((o,i)=>{r.toBlob(l=>l===null?i(new Error("encode failed")):o(l),"image/jpeg",t)})}n(Bt,"_t");function ht(e,t={}){let r=t.now??(()=>performance.now()),o=t.setTimer??((p,k)=>setTimeout(p,k)),i=t.clearTimer??(p=>clearTimeout(p)),l=t.encode??Bt,s=t.quality??Dt,u=e.tuningVersion??null,g=new Set,w=!1,f=e.video??null,b=null,m=t.grabFrame??null,y=null,T=1e3/ot,M=null,B=null,C=!1,V=!1,D=Number.NEGATIVE_INFINITY,j=null,W=0,_=null,S=null,K=Promise.all([import("./icao-gate-T3BTOKFJ-BWMLKL7A.js"),import("./icao-tuning-4ETMF53W-FRBTB5R7.js"),import("./create-portrait-capture-3MHP4DGA-4XIQSUJ3.js"),import("./landmarker-KB7LVXAU-F7BQTP3H.js"),import("./background-monitor-A7FKJOAG-K3WF3C2D.js")]).then(async([p,k,I,x,N])=>{let E=k.resolveIcaoTuning(e.tuning,e.tuningVersion??void 0);E.background.required&&(B=N.createBackgroundMonitor({tuning:E.backgroundCheck,assetBaseUrl:e.assetBaseUrl??"/models-v3",...t.createSegmenter!==void 0?{createSegmenter:t.createSegmenter}:{},now:r})),b=p.createIcaoGate(E,{policy:e.policy??"reject"}),m??(m=I.defaultGrabber()),y=I.observe,T=1e3/Math.min(ot,E.cadenceHz);let G=(t.createLandmarker??x.createFaceLandmarker)(e.assetBaseUrl??"/models-v3"),O=await new Promise((A,a)=>{let d=setTimeout(()=>{a(new Error("landmarker init timeout")),G.then(c=>c.close(),()=>{})},x.LANDMARKER_INIT_TIMEOUT_MS);G.then(c=>{clearTimeout(d),A(c)},c=>{clearTimeout(d),a(c)})});w?O.close():M=O}).catch(()=>{C=!0}),U=n(p=>{for(let k of g)k({holding:V||C,update:p})},"Q"),P=n(()=>{if(j=null,!(w||M===null||b===null||m===null||y===null||f===null)){if(r()-D>at){U(null);return}try{let p=m(f,Ft);if(p!==null){let k=Math.max(r(),W+1);W=k;let I=M.detect(p.source,k),x=f.videoWidth||p.width,N=f.videoHeight||p.height,E=y(I,p,x,N);E.geometry!==null&&B!==null&&(E.backgroundCheck=B.measure(p,E.geometry.box,x,N));let G=b.push(E,r());V=G.ready,U(G)}}catch{}j=o(P,T)}},"B"),F=n(()=>{let p=r()-D>at;D=r(),p&&(b?.reset(),V=!1,_=null,S=null),j===null&&M!==null&&!w&&(j=o(P,0))},"re"),J=n(()=>{let p=m===null||f===null?null:m(f,null);if(p===null||b===null||Math.max(p.width,p.height)<e.still.minLongSidePx)return Promise.resolve(null);let k=b.summary();return l(p,e.still.jpegQuality).then(I=>({image:I,width:p.width,height:p.height,gate:k}),()=>null)},"$"),h=null;return{engineOptions:{measureQuality:n((p,k)=>{f=p,F();let I=s(p,k);return V||C?I:{...I,sharpness:0}},"measureQuality"),telemetry:n(p=>{if(p.type!=="fired"||w)return;_=J();let k=h;k!==null&&_.then(I=>I===null?void 0:k(I).catch(()=>{})),V=!1,j!==null&&i(j),j=null,D=Number.NEGATIVE_INFINITY},"telemetry")},decorate:n(p=>{let k=new WeakMap,I=new Map,x=n(O=>{let A=k.get(O);return A===void 0&&(A=(async()=>{let a=await te(p,"image","image/jpeg",O.image.size,{engine:"portrait"});return await p.uploadToSpaces(a.uploadUrl,O.image,"image/jpeg"),(await p.completeMedia(a.key)).key})(),A.catch(()=>k.delete(O)),k.set(O,A)),A},"v");h=x;let N=n(async O=>{let A;try{A=await x(O)}catch(a){let d=a?.code;if(typeof d=="string"&&Lt.has(d))throw a;return null}return{media:{portrait:A},gate:ue(O.gate),...u!==null?{tuningVersion:u}:{}}},"D"),E=p.submitCheck.bind(p),G=n((async(O,A,a)=>{if(O!=="liveness")return E(O,A,a);let d=a?.idempotencyKey,c=d===void 0?void 0:I.get(d);if(c===void 0){let L=_;c=L===null?Promise.resolve(null):L.then($=>$===null?null:N($)),d!==void 0&&(I.set(d,c),c.catch(()=>I.delete(d)))}let v=await c;if(v===null)return E("liveness",A,a);let R=await E("liveness",{...A,portraitIcao:v},a);return S=v,R}),"T");return new Proxy(p,{get(O,A){if(A==="submitCheck")return G;let a=Reflect.get(O,A);return typeof a=="function"?a.bind(O):a}})},"decorate"),onGate:n(p=>(g.add(p),()=>g.delete(p)),"onGate"),lastPortraitInput:n(()=>S,"lastPortraitInput"),destroy:n(()=>{w=!0,_=null,S=null,j!==null&&i(j),j=null,g.clear(),K.then(()=>{M?.close(),M=null,B?.close(),B=null})},"destroy")}}n(ht,"Zn");function zt(e){return e.idNumberBound??e.nniBound}n(zt,"Ue");function qt(e){return e===void 0?void 0:e.idNumberFromDocument??e.nniFromDocument}n(qt,"Ke");function Kt(e){let t=e.idNumberMasked??e.nniMasked;return typeof t=="string"&&t!==""?t:void 0}n(Kt,"je");var yt=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"}),Gt=new Map(Object.entries(yt)),Yn=new Map(Object.entries(yt).map(([e,t])=>[t,e]));function $t(e){return Gt.get(e)??e}n($t,"Ze");var q={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",remoteOptions:30,remoteFilterAbove:12,remoteOther:120,remoteValue:128},Ht=new Set(["full_name","birth_date","email","phone","address","country","occupation"]),Zt=new Set(["short_text","long_text","single_choice","multiple_choice","yes_no","date","number","remote_choice"]),Jt=new Set(["ar","fa","he","ur"]);function Wt(e){return Jt.has(e.split("-")[0]?.toLowerCase()??"")?"rtl":"ltr"}n(Wt,"Ye");function Qt(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 r=t.consents??[];if(!Array.isArray(r))return null;for(let i of t.questions)if(!Yt(i))return null;for(let i of r)if(!er(i))return null;let o={locale:t.locale,questions:t.questions,consents:r};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}n(Qt,"We");function Yt(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"&&Ht.has(t.field):t.kind!=="custom"||typeof t.type!="string"||!Zt.has(t.type)||typeof t.label!="string"?!1:t.type==="remote_choice"?Xt(t.remote):t.type==="single_choice"||t.type==="multiple_choice"?Array.isArray(t.choices)&&t.choices.length>=2&&t.choices.every(r=>typeof r=="object"&&r!==null&&typeof r.value=="string"&&typeof r.label=="string"):!0}n(Yt,"wt");function Xt(e){if(typeof e!="object"||e===null)return!1;let t=e;return typeof t.allowOther!="boolean"||!Array.isArray(t.options)||t.options.length>q.remoteOptions||t.otherLabel!==void 0&&typeof t.otherLabel!="string"||t.options.length===0&&!t.allowOther?!1:t.options.every(r=>{if(typeof r!="object"||r===null)return!1;let o=r;return typeof o.value=="string"&&typeof o.label=="string"&&(o.title===void 0||typeof o.title=="string")&&(o.description===void 0||typeof o.description=="string")&&(o.icon===void 0||typeof o.icon=="string")&&(o.imageUrl===void 0||typeof o.imageUrl=="string"&&/^https:\/\//.test(o.imageUrl))})}n(Xt,"xt");function gt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&typeof e.other=="string"&&Object.keys(e).length===1}n(gt,"Qe");function er(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 r=t.link;return typeof r=="object"&&r!==null&&typeof r.url=="string"&&/^https:\/\//.test(r.url)&&typeof r.label=="string"}n(er,"Rt");var tr=/^(\d{4})-(\d{2})-(\d{2})$/;function rr(e){if(typeof e!="string")return!1;let t=tr.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>=q.dateMin&&e<=q.dateMax}n(rr,"Mt");function nr(e){return typeof e=="number"&&Number.isFinite(e)&&Math.abs(e)<q.number&&Math.round(e*100)/100===e}n(nr,"It");function bt(e){for(let t of e.matchAll(/\d[\d -]{11,}\d/g)){let r=t[0].replace(/[ -]/g,"");if(r.length>=13&&r.length<=19&&ir(r))return!0}return!1}n(bt,"$e");function ir(e){let t=0;for(let r=0;r<e.length;r++){let o=Number(e[e.length-1-r]);r%2===1&&(o*=2,o>9&&(o-=9)),t+=o}return t%10===0}n(ir,"Ot");var or=/^[^\s@]+@[^\s@.]+(\.[^\s@.]+)+$/,ar=/^\+[1-9]\d{6,14}$/,vt=/^[A-Z]{2}$/,lr=n(e=>e===void 0||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0||gt(e)&&e.other.trim()==="","vt");function _t(e=Date.now()){return new Date(e).toISOString().slice(0,10)}n(_t,"ze");function xe(e,t,r=_t()){let o=[];for(let i of e.questions){let l=t.answers[i.id];if(lr(l)){i.required&&o.push({id:i.id,code:"required"});continue}let s=i.kind==="field"?sr(i.field,l,r):dr(i,l,r);s!==null&&o.push({id:i.id,...s})}for(let i of e.consents)i.required&&t.consents[i.id]!==!0&&o.push({id:i.id,code:"consent_required"});return o}n(xe,"ee");function ie(e,t,r=1){if(typeof e!="string")return{code:"required"};let o=e.trim();return[...o].length>t?{code:"too_long",params:{max:t}}:[...o].length<r?{code:"too_short",params:{min:r}}:bt(o)?{code:"card_number"}:null}n(ie,"W");function wt(e,t,r={}){return rr(e)?r.period==="past"&&e>=t?{code:"date_not_past"}:r.period==="future"&&e<=t?{code:"date_not_future"}:r.min!==void 0&&e<r.min?{code:"date_too_early",params:{date:r.min}}:r.max!==void 0&&e>r.max?{code:"date_too_late",params:{date:r.max}}:null:{code:"date_invalid"}}n(wt,"Xe");function sr(e,t,r){switch(e){case"full_name":return ie(t,q.fullName,q.fullNameMin);case"occupation":return ie(t,q.occupation);case"birth_date":return wt(t,r,{period:"past"});case"email":return typeof t=="string"&&t.trim().length<=q.email&&or.test(t.trim())?null:{code:"email_invalid"};case"phone":return typeof t=="string"&&ar.test(t)?null:{code:"phone_invalid"};case"country":return typeof t=="string"&&vt.test(t)?null:{code:"choice_invalid"};case"address":return cr(t)?null:{code:"address_invalid"};default:return null}}n(sr,"Vt");function cr(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,r=Array.isArray(t.lines)?t.lines.filter(o=>typeof o=="string"&&o.trim()!==""):[];return typeof t.country=="string"&&vt.test(t.country)&&typeof t.city=="string"&&t.city.trim()!==""&&t.city.trim().length<=q.city&&r.length>=1&&r.length<=q.addressLines&&r.every(o=>o.trim().length<=q.addressLine&&!bt(o))&&(t.postcode===void 0||typeof t.postcode=="string"&&t.postcode.trim().length<=q.postcode)}n(cr,"Lt");function dr(e,t,r){let o=new Set((e.choices??[]).map(i=>i.value));switch(e.type){case"short_text":return ie(t,q.shortText);case"long_text":return ie(t,q.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 wt(t,r,{...typeof i.min=="string"?{min:i.min}:{},...typeof i.max=="string"?{max:i.max}:{},...i.period==="past"||i.period==="future"?{period:i.period}:{}})}case"remote_choice":{let i=e.remote;return gt(t)?i?.allowOther?ie(t.other,q.remoteOther):{code:"choice_invalid"}:typeof t=="string"&&(i?.options??[]).some(l=>l.value===t)?null:{code:"choice_invalid"}}case"number":{if(typeof t!="number"||!Number.isFinite(t)||Math.abs(t)>=q.number)return{code:"number_invalid"};let i=e.options??{};return i.integer===!0&&!Number.isInteger(t)?{code:"number_not_integer"}:nr(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}}n(dr,"Ft");function ur(e,t,r,o=_t()){let i=e?.errors;return Array.isArray(i)?i.flatMap(l=>{if(typeof l!="object"||l===null)return[];let{id:s,code:u}=l;return typeof s!="string"||typeof u!="string"?[]:[fr(s,u,t,r)]}):xe(t,r,o)}n(ur,"et");var pr={remote_choice:q.remoteOther,full_name:q.fullName,occupation:q.occupation,email:q.email,short_text:q.shortText,long_text:q.longText};function fr(e,t,r,o){let i=r.questions.find(g=>g.id===e),l=i===void 0?void 0:i.kind==="field"?i.field:i.type,s=o.answers[e],u=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"?q.fullNameMin:1}};case"too_long":{let g=l===void 0?void 0:pr[l];return g===void 0?{id:e,code:t}:{id:e,code:t,params:{max:g}}}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 mr(e,l,s,u);case"invalid":return i===void 0?r.consents.some(g=>g.id===e)?{id:e,code:"consent_required"}:{id:e,code:t}:{id:e,code:hr(l,s)};default:return{id:e,code:t}}}n(fr,"Dt");function mr(e,t,r,o){if(t==="date"){let s=typeof o.min=="string"?o.min:void 0,u=typeof o.max=="string"?o.max:void 0;return u!==void 0&&(s===void 0||typeof r=="string"&&r>u)?{id:e,code:"date_too_late",params:{date:u}}:s!==void 0?{id:e,code:"date_too_early",params:{date:s}}:{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 r=="number"&&r>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"}}n(mr,"Gt");function hr(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)<q.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"}}n(hr,"Bt");var yr=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"]),gr=new Set(["supplied_identity","aml_screening","face_dedup","age_estimation"]),Te=["document","population_registry","national_eid"],Se=["phone_otp","email_otp"],kt={identity_method:Te,contact:Se},br=["population_registry","document"],Pe="platform_unsupported",vr=new Set(["prefilled","user_entered","prefilled_or_entered"]),_r={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 X(e){return e.section??_r[e.checkType]??null}n(X,"L");function xt(e,t){let r=e.plan?.choice;if(r===void 0||r.locked)return;let o=r.options.find(i=>i.id!==r.selected&&i.available!==!1&&t.includes(i.service));return o===void 0?void 0:{nodeId:r.nodeId,option:o}}n(xt,"le");function Ce(e){let t=e.plan,r=t?.choice;if(t===void 0||r===void 0||r.locked||t.current===null||t.current===r.nodeId||ge(e))return null;let o=kt[r.kind]??[...Te,...Se],i=r.options.flatMap(u=>{if(u.available===!1||!o.includes(u.service))return[];let g=u.nationalEid!=null?{id:u.id,service:u.service,nationalEid:u.nationalEid}:{id:u.id,service:u.service};return u.names!=null&&Object.keys(u.names).length>0&&(g.names=u.names),[g]}),l=t.steps.find(u=>u.id===t.current)?.service,s=r.selected??i.find(u=>u.service===l)?.id??null;return i.some(u=>u.id!==s)?{nodeId:r.nodeId,kind:r.kind,current:s,options:i}:null}n(Ce,"pe");function At(e){return e==null?[]:e.options.filter(t=>t.id!==e.current)}n(At,"it");function st(e,t=!1){return{kind:"elsewhere",key:"elsewhere",context:e!==null?Mt(e):{sessionId:"",orgName:"",sandbox:!1,returning:!1,consentRecorded:!0,expiresAt:"",sections:[],progress:[],purpose:"identity"},section:null,ended:t}}n(st,"fe");function wr(e){let t=e.simulation;if(typeof t!="object"||t===null)return;let{otpCode:r,skipCapture:o}=t;if(!(typeof r!="string"||r===""||typeof o!="boolean"))return{otpCode:r,skipCapture:o}}n(wr,"Yt");function kr(e){let t=e.levelTarget?.max;return typeof t=="number"&&t<=1?"contact":e.purpose??"identity"}n(kr,"Wt");function Mt(e){let t=(e.plan?.sections??[]).map(u=>({id:u.id,state:u.state})),r={sessionId:be(e.sessionId),orgName:e.orgName,sandbox:e.sandbox===!0,returning:e.returning===!0,consentRecorded:e.consentRecorded,expiresAt:e.expiresAt,sections:t.map(u=>u.id),progress:t,purpose:e.purpose??"identity",levelName:kr(e)};e.branding!==void 0&&(r.branding=e.branding),e.cameraUnavailableHandled===!0&&(r.cameraUnavailableHandled=!0);let o=wr(e);o!==void 0&&(r.simulation=o);let i=e.testerGate;i?.offered===!0&&typeof i.attemptsLeft=="number"&&i.attemptsLeft>0&&(r.testerGate={attemptsLeft:i.attemptsLeft});let l=Be(e);l!==void 0&&(r.sandboxRun=l);let s=Ce(e);return s!==null&&(r.switchable=s),r}n(Mt,"st");function xr(e){let t={attemptsRemaining:Ue(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}n(xr,"Qt");var Tt={phone_otp:"phone",email_otp:"email"};function Ar(e,t){let r=xt(e,[t==="phone_otp"?"email_otp":"phone_otp"]);return r===void 0?void 0:Tt[r.option.service]}n(Ar,"$t");function Mr(e,t,r,o){let i=t.checkType==="email_otp",l=(i?t.emailOtp:t.otp)??{},s=i?t.emailOtp?.emailSource:t.otp?.numberSource,u=s!==void 0&&vr.has(s)?s:i?"prefilled_or_entered":"user_entered",g=typeof l.sentToMasked=="string"&&l.sentToMasked.length>0,w=l.prefilled===!0,f=Ar(e,i?"email_otp":"phone_otp"),b={key:t.checkType,context:r,section:X(t),phase:g?"verify":"send",canSwitch:f!==void 0,...o},m=i?{kind:"email_otp",...b,emailSource:u,needsEmail:u!=="prefilled"&&!w}:{kind:"phone_otp",...b,numberSource:u,needsPhone:u!=="prefilled"&&!w,channels:(t.otp?.channels??[]).filter(y=>y==="whatsapp"||y==="sms")};if(f!==void 0&&(m.switchChannel=f),w&&(m.prefilled=!0),g&&(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(y=>typeof y=="string"&&/^[A-Z]{2}$/.test(y))),!i&&Array.isArray(t.phoneRules)){let y=m.phoneCountries??[];m.phoneRules=t.phoneRules.flatMap(T=>{let M=Pr(T);return M!==void 0&&y.includes(M.code)?[M]:[]})}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}n(Mr,"Jt");var Tr=/^[\d[\]\-|()?:^]{1,64}$/;function Sr(e){try{return typeof e=="string"&&Tr.test(e)&&new RegExp(e)!==null}catch{return!1}}n(Sr,"Xt");var ct=n(e=>typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=15,"tt");function Pr(e){let{code:t,dial:r,trunk:o,lengths:i,formats:l}=e??{};if(typeof t!="string"||typeof r!="string"||!/^\d{1,3}$/.test(r)||o!==void 0&&(typeof o!="string"||!/^\d{1,3}$/.test(o))||!Array.isArray(i)||i.length===0||!i.every(ct))return;let s={code:t,dial:r,lengths:[...i].sort((u,g)=>u-g)};if(o!==void 0&&(s.trunk=o),l!==void 0){if(!(Array.isArray(l)&&l.length<=8&&l.every(u=>Sr(u?.leading)&&Array.isArray(u.groups)&&u.groups.every(ct)&&i.includes(u.groups.reduce((g,w)=>g+w,0)))))return;s.formats=l.map(u=>({leading:u.leading,groups:[...u.groups]}))}return s}n(Pr,"en");function Cr(e,t,r,o){let i=zt(e)===!0?"bound":qt(t)===!0?"document":"typed",l=i==="typed"&&t.state==="input_required"&&t.reason!==void 0&&$t(t.reason)==="id_number_recheck",s=At(Ce(e)),u=!o.attemptsExhausted&&s.length===1&&s[0]?.service==="document";return{kind:"registry",key:"registry",context:r,section:X(t),state:t.state==="input_required"?"input_required":"pending",source:i,recheck:l,canUseDocument:u,...o}}n(Cr,"tn");function Ir(e,t,r,o,i){let l=[...t.acceptedSides??[]],s={kind:"document",key:"document",context:r,section:X(t),side:l.includes("recto")?"verso":"recto",acceptedSides:l,documents:Ut(e),photo:Ee(Ie(e.documents),i),...o};e.detectedCountry!==void 0&&(s.detectedCountry=e.detectedCountry);let u=St(e);return u!==void 0&&(s.acceptedNationalities=u),jr(e)&&(s.ageStepUp=!0),s}n(Ir,"nn");function Ie(e,t=!0){let r=e?.source==="upload"||e?.source==="choice"?e.source:"camera",o=e?.sourcePick==="camera"||e?.sourcePick==="upload"?e.sourcePick:null;return{source:r,pick:o,uploadOffered:t&&e?.uploadOffered===!0}}n(Ie,"me");function Ee(e,t){return t?{...e,cameraOnPhone:!0}:e}n(Ee,"he");var Er=10*1024*1024;function Rr(e,t,r,o,i){let l=e.proofOfAddress,s=l?.pdf?.maxBytes,u=l?.phase==="holder_letter"?"holder_letter":"document";return{kind:"proof_of_address",key:"proof_of_address",context:r,section:X(t),phase:u,rule:l?.rule??{country:null,countryFrom:"global",source:"preset_global",kinds:[]},nameMatch:l?.nameMatch??"exact_person",photo:Ee(Ie(l),i),maxPages:3,pdf:{maxBytes:typeof s=="number"&&s>0?s:Er,maxPages:3},licenceAddressAccepted:u==="document"&&l?.licenceAddressAccepted===!0,...o}}n(Rr,"on");function jr(e){let t=Ve(e).find(o=>o.checkType==="age_estimation"),r=t?.reason;return t?.state==="failed"&&(r==="age_uncertain"||r==="age_unavailable")}n(jr,"sn");function Nr(e){let t=fe(e,"liveness");return t?.state==="passed"||t?.state==="review"}n(Nr,"an");function dt(e,t,r,o,i,l=!1){let s=t.icao?.report,u=e.portrait,g=i==="capture"?u?.pendingFix??null:null;g!==null&&(i="review");let w=oe(e);return{kind:"portrait",key:`portrait:${i}`,context:r,section:X(t),phase:i,report:Array.isArray(s)?s:null,review:t.state==="review",tuning:e.capture?.icao??null,tuningVersion:e.capture?.tuningVersion??null,icao:de(e),retakeOnly:i==="capture"&&t.state==="input_required"&&w===void 0&&e.capture?.livePhoto?.oneCapture===!0&&Nr(e),photo:Ee(Ie(u,i==="capture"),l&&i==="capture"),pendingFix:g,...w!==void 0?{captureMode:w}:{},...u?.reuse?.pending===!0?{reuse:!0}:{},...o}}n(dt,"nt");function oe(e){let t=e.portrait?.captureMode;return t==="self"||t==="assisted"||t==="choice"?t:void 0}n(oe,"ut");var ke={minLongSidePx:1280,jpegQuality:.95};function Or(e,t){let r=e.capture?.livePhoto;if(r?.oneCapture!==!0)return null;let o=fe(e,"portrait_icao"),i=r.still??ke;return{icao:t==="liveness"&&de(e)!==null&&oe(e)===void 0&&o!==void 0&&o.state==="pending"&&o.reason===void 0,still:{minLongSidePx:i.minLongSidePx??ke.minLongSidePx,jpegQuality:i.jpegQuality??ke.jpegQuality}}}n(Or,"un");function Vr(e,t,r,o){let i=t.eid,l=X(t);if(i===void 0||i.challenge!=="app_code")return{kind:"unsupported",key:"unsupported:eid_auth",context:r,section:l,checkType:"eid_auth",reason:"update_required"};let s=At(Ce(e)),u=s.length===1&&br.includes(s[0]?.service??"")?s[0]:void 0,g=u===void 0?void 0:pe[u.service],w=g!==void 0,f={kind:"eid",key:"eid",context:r,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&&(f.cameraMethod=g),i.expiresAt!==void 0&&(f.codeExpiresAt=i.expiresAt),i.resendAvailableAt!==void 0&&(f.resendAvailableAt=i.resendAvailableAt),i.resendsRemaining!==void 0&&(f.resendsRemaining=i.resendsRemaining),i.codeAttemptsRemaining!==void 0&&(f.codeAttemptsRemaining=i.codeAttemptsRemaining),f}n(Vr,"cn");function Ur(e,t){if(t.checkType!=="face_match"||t.reason!==void 0)return null;let r=fe(e,"portrait_icao");return r!==void 0&&(r.state==="passed"||r.state==="review")?r:null}n(Ur,"dn");var Fr={rejected:"rejected",inconclusive:"inconclusive",unavailable:"unavailable",abandoned:"expired",not_opened:"expired",cancelled:"expired",superseded:"expired",policy:"policy"};function Lr(e){return e.reasonCode===Pe?"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?Fr[e.reason]:void 0)??"rejected"}n(Lr,"pn");function Dr(e,t){let r=Lr(e),o=r==="platform_unsupported"?{sessionId:be(e.sessionId),status:"unavailable",reasonCode:Pe}:De(e,{autoRetry:!1}),i={kind:"result",key:"result",context:t,section:null,display:r,result:o};e.status==="not_verified"&&e.reason!==void 0&&(i.reason=e.reason),e.reasonCode!==void 0&&(i.reasonCode=e.reasonCode);let l=Br(e);l!==void 0&&(i.missing=l),e.status==="not_verified"&&e.step!==void 0&&(i.step=e.step),e.retryAfter!==void 0&&(i.retryAfter=e.retryAfter);let s=St(e);return s!==void 0&&(i.acceptedNationalities=s),i}n(Dr,"fn");function Br(e){if(e.reasonCode!=="tester_incomplete")return;let t=e.reasonDetails?.missing,r=Array.isArray(t)?t.filter(o=>o==="idNumber"||o==="registry"):[];return r.length>0?r:void 0}n(Br,"mn");function St(e){let t=Array.isArray(e.acceptedNationalities)?e.acceptedNationalities.filter(r=>typeof r=="string"&&/^[A-Z]{2}$/.test(r)):[];return t.length>0?t:void 0}n(St,"ct");function zr(e,t,r){let o=e.identitySummary;if(o==null)return null;let i={kind:"identity_summary",key:"identity_summary",context:t,section:r??"identity",summaryKind:o.kind==="partial"?"partial":o.kind??"full",source:o.source,portraitAvailable:o.portrait?.available===!0,retakeAvailable:o.retakeAvailable===!0};for(let s of qr){let u=o[s];typeof u=="string"&&u!==""&&(i[s]=u)}let l=Kt(o);return l!==void 0&&(i.idNumberMasked=l,i.nniMasked=l),i}n(zr,"hn");var qr=["fullName","fullNameAr","birthDate","birthYear","nationality","documentType","documentNumberMasked","expiryDate","retakeTarget"];function ee(e,t,r,o){return{kind:"unsupported",key:`unsupported:${r}`,context:e,section:t,checkType:r,reason:o}}n(ee,"U");function Kr(e){return e.kind==="contact"?"contact":(e.kind,"identity")}n(Kr,"yn");function Gr(e,t){let r=kt[e.kind]??[...Te,...Se],o=Kr(e),i=e.options.flatMap(s=>{if(s.available===!1||!r.includes(s.service))return[];let u={id:s.id,service:s.service};s.nationalEid!=null&&(u.nationalEid=s.nationalEid),s.names!=null&&Object.keys(s.names).length>0&&(u.names=s.names);let g=(s.channels??[]).filter(w=>w==="whatsapp"||w==="sms");return s.service==="phone_otp"&&g.length>0&&(u.channels=g),[u]});if(i.length===0){let s=e.options.length>0&&e.options.every(u=>u.service==="nfc");return ee(t,o,"choice",s?"platform_unsupported":"update_required")}let l={nodeId:e.nodeId,kind:e.kind,selected:e.selected,options:i};if(e.kind==="identity_method"){let s={kind:"method",key:"method",context:t,section:o,options:i.map(g=>pe[g.service]),choice:l},u=i.find(g=>g.nationalEid!==void 0)?.nationalEid;return u!==void 0&&(s.nationalEid=u),s}return e.kind==="contact"?{kind:"contact_choice",key:"contact_choice",context:t,section:o,options:i.map(s=>Tt[s.service]),selected:null,locked:!1,choice:l}:{kind:"choice",key:`choice:${e.nodeId}`,context:t,section:o,choice:l}}n(Gr,"Sn");function ut(e,t,r,o){let i=e.nativeApp,l=typeof i=="object"&&i!==null?i:{},s={sekyroApp:l.sekyroApp===!0};return typeof l.link=="string"&&l.link!==""&&(s.link=l.link),s.sekyroApp&&typeof l.sekyroAppLink=="string"&&l.sekyroAppLink.startsWith("sekyro://")&&(s.sekyroAppLink=l.sekyroAppLink),{kind:"native_app_required",key:`native_app_required:${o}`,context:t,section:r,checkType:o,nativeApp:s}}n(ut,"rt");function Q(e,t={}){let r=Mt(e);if(ge(e)||e.reasonCode===Pe)return Dr(e,r);if(e.sandbox===!0&&e.sandboxMode?.choice===!0)return{kind:"sandbox_mode",key:"sandbox_mode",context:r,section:null,testersAvailable:e.sandboxMode.testersAvailable===!0};let o=e.testerGate;if(e.sandbox===!0&&o?.offered===!0&&o.required===!0){if(e.plan?.steps?.find(T=>T.checkType==="liveness")?.requiresNativeApp===!0)return ut(e,r,null,"liveness");if(t.isMobile===!1)return{kind:"mobile_required",key:"mobile_required",context:r,section:null,checkType:"liveness"};let y=typeof o.attemptsLeft=="number"&&o.attemptsLeft>0?o.attemptsLeft:0;return{kind:"tester_check",key:"tester_check",context:r,section:null,attemptsLeft:y}}let i=e.plan;if(i===void 0||!Array.isArray(i.sections))return ee(r,null,"plan","update_required");let l=Fe(e);if(l!==null)return Gr(l,r);let s=i.current===null?void 0:i.steps.find(y=>y.id===i.current),u=n(y=>{let T={kind:"processing",key:"processing",context:r,section:y!==void 0?X(y):i.sections.find(M=>M.state==="current")?.id??null,stalled:!1};return typeof y?.service=="string"&&y.service!==""&&(T.service=y.service),T},"d");if(i.current===null)return u(i.steps.find(y=>y.state==="processing"));if(s===void 0)return ee(r,null,"step","update_required");if(!yr.has(s.service))return s.interaction==="server"?u(s):ee(r,X(s),s.service,"update_required");if(gr.has(s.service)||!Le(s))return u(s);let g=s,w=xr(g),f=g.checkType,b=X(g);if(g.requiresNativeApp===!0)return ut(e,r,b,f);let m=t.isMobile===!1?Ge(e,g):null;if(m==="phone")return{kind:"mobile_required",key:"mobile_required",context:r,section:b,checkType:f};switch(f){case"phone_otp":case"email_otp":return Mr(e,g,r,w);case"population_registry":return Cr(e,g,r,w);case"eid_auth":return Vr(e,g,r,w);case"doc_ocr":return Ir(e,g,r,w,m==="upload_or_phone");case"identity_confirm":return zr(e,r,b)??u(g);case"portrait_icao":return dt(e,g,r,w,"capture",m==="upload_or_phone");case"liveness":case"face_match":{let y=Ur(e,g);if(y!==null)return dt(e,y,r,w,"match");let T=g.requiresMobile===!0,M=de(e);return{kind:"liveness",key:"biometric",context:r,section:b,mode:f==="face_match"?"selfie":"liveness",requiresMobile:T,instructions:M===null?"standard":"icao",icao:M,livePhoto:Or(e,f),...w}}case"poa":return Rr(e,g,r,w,m==="upload_or_phone");case"form":{let y=Qt(g.form);return y===null?ee(r,b,f,"update_required"):{kind:"form",key:"form",context:r,section:b,form:y,dir:Wt(y.locale),...w}}case"nfc_chip":return ee(r,b,f,"platform_unsupported");default:return ee(r,b,f,"update_required")}}n(Q,"te");var $r=/^[A-Z0-9][A-Z0-9 -]{0,39}$/,Hr=Object.freeze({normalize:n(e=>e.trim().toUpperCase().replace(/\s+/g," "),"normalize"),check:n(e=>$r.test(e),"check"),registrySources:Object.freeze([]),describe:"number must be 1 to 40 letters, digits, spaces or hyphens"}),Zr=/^[A-Z0-9]{4,20}$/,Ae=n(e=>e.trim().toUpperCase().replace(/[\s-]+/g,""),"ge"),Jr=Object.freeze({normalize:Ae,check:n(e=>Zr.test(Ae(e)),"check"),registrySources:Object.freeze([]),describe:"number must be 4 to 20 letters or digits"});function Wr(e){return typeof e=="string"&&/^\d{10}$/.test(e)&&Number(e)%97===1}n(Wr,"An");var Qr={trim:n(e=>e.trim(),"trim"),upper_single_space:n(e=>e.trim().toUpperCase().replace(/\s+/g," "),"upper_single_space"),upper_no_space_or_hyphen:Ae},Yr={mr_nni_mod97:n(e=>Wr(e),"mr_nni_mod97")};function Xr(e){let t=new RegExp(e.pattern,"u"),r=e.check===null?void 0:Yr[e.check];return Object.freeze({normalize:Qr[e.normalize],check:n(o=>t.test(o.trim())&&(r===void 0||r(o)),"check"),registrySources:Object.freeze([...e.registrySources]),describe:e.describe})}n(Xr,"xn");var en=Object.freeze(Object.fromEntries(Object.entries(Ze).map(([e,t])=>[e,Xr(t)])));function Pt(e,t){return en[`${e.toUpperCase()}:${t}`]??(t==="drivers_license"?Jr:Hr)}n(Pt,"ye");var tn=Object.freeze({JPN:"JP",MRT:"MR"});function rn(e,t){let r=e.trim().toUpperCase();return Pt(tn[r]??r,t)}n(rn,"dt");function nn(e){let t=rn(e.issuingCountry,e.type);return t.check(t.normalize(e.number))}n(nn,"lt");function on(e){return Pt("MR","national_id").check(e)}n(on,"pt");function pt(e){let t="";for(let r of e){let o=r.codePointAt(0)??0;o>=1632&&o<=1641?t+=String(o-1632):o>=1776&&o<=1785?t+=String(o-1776):r!==" "&&r!=="-"&&r!==" "&&(t+=r)}return t}n(pt,"Se");var an=[1e3,2e3,4e3,8e3,15e3],ln=3e4,sn=/^\+[1-9]\d{6,14}$/,cn=/^\d{6}$/,dn=/^\d{6}$/,un=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,ft=new Set(["session_not_active","check_not_found","check_already_finalized","check_out_of_order","identity_confirm_locked","choice_locked","choice_option_unavailable","choice_not_found","step_not_on_path","check_not_active","native_app_required"]),pn={simulatedCapture:!0},fn=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]);function Ct(e){let t=!1,r=null,o="",i=!1,l=!1,s=!1,u={},g={},w=new Set,f=!1,b=!1,m=null,y="idle",T=new Map,M=new Map,B=n((a,d,c)=>{let v=`${a}.${d}`,R=T.get(v);if(R!==void 0)return R;let L=M.get(a),$=(L===void 0?c():L.then(c)).finally(()=>{T.delete(v)});T.set(v,$);let z=$.then(()=>{},()=>{});return M.set(a,z),z.then(()=>{M.get(a)===z&&M.delete(a)}),$},"O"),C=n(async(a,d,c)=>{await e.ensureConsent();let v;try{v=await qe(e.runtime,d)}catch(L){if(L instanceof Z&&ft.has(L.code)){await e.refreshView();return}throw L}if(c?.(v),e.destroyed())return;let R=v;R.plan!==void 0&&e.setView!==void 0?e.setView(R):await e.refreshView()},"N"),V=n(async a=>{await e.ensureConsent();let d;try{try{d=await a(e.runtime.client)}catch(c){if(!(c instanceof Z)||c.code!=="consent_required")throw c;await e.runtime.ensureConsent({force:!0}),d=await a(e.runtime.client)}}catch(c){if(c instanceof Z&&ft.has(c.code)){await e.refreshView();return}throw c}e.destroyed()||(d!==void 0&&e.setView!==void 0?e.setView(d):await e.refreshView())},"F"),D=n((a,d)=>B("choice",`${a}:${d}`,()=>V(c=>c.choose(a,d))),"G"),j=n((a,d)=>a.options.some(c=>c.id===d)?D(a.nodeId,d):Promise.reject(new RangeError(`option ${String(d)} is not offered`)),"E"),W=n((a,d)=>{let c=e.currentView(),v=c===null?void 0:xt(c,a);return v===void 0?Promise.reject(new RangeError(`the ${d} is not offered`)):D(v.nodeId,v.option.id)},"K"),_=n(a=>B("identity",a,()=>V(d=>d.confirmIdentity===void 0?Promise.reject(new Error("identity confirmation is not available in this build")):d.confirmIdentity(a))),"H"),S=n((a,d)=>{let c=xe(a.form,d);if(c.length>0)return Promise.reject(new ve(c,"client"));let v={answers:{...d.answers},consents:{}};for(let R of a.form.consents)v.consents[R.id]=d.consents[R.id]===!0;return B("form","submit",()=>C("form",(R,L)=>R.submitCheck("form",v,{idempotencyKey:L})).catch(R=>{throw R instanceof Z&&R.code===Ke?new ve(ur(R.details,a.form,v),"server"):R}))},"j"),K=n((a,d)=>{let c=a.kind,v=c==="phone_otp",R=v?"phone":"email",L={action:"send"};if(v?a.needsPhone:a.needsEmail){let $=d[R]??g[c],z=v?$?.replace(/[\s().-]/g,""):$?.trim();if(z!==void 0||a.phase!=="verify"){if(z===void 0||!(v?sn:un).test(z))return Promise.reject(v?new Y("phone","format"):new me("email","format"));L[R]=z}}if(v){let $=a.channels,z=d.channel??($.length===1?$[0]:void 0);if($.length>0){if(z===void 0)return Promise.reject(new me("channel","required"));if(!$.includes(z))return Promise.reject(new me("channel","unavailable"))}z!==void 0&&(L.channel=z),L.phoneRules=1}return B(c,"send",()=>C(c,($,z)=>$.submitCheck(c,L,{idempotencyKey:z}),$=>{hn($,c)||(u[c]=e.now(),L[R]!==void 0&&(g[c]=L[R]))}))},"ne"),U=n((a,d)=>cn.test(d)?B(a,"verify",()=>C(a,(c,v)=>c.submitCheck(a,{action:"verify",code:d},{idempotencyKey:v}))):Promise.reject(new Y("code","format")),"Q"),P=n((a,d)=>B("eid_auth",a,()=>C("eid_auth",(c,v)=>c.submitCheck("eid_auth",d,{idempotencyKey:v}))),"B"),F=n((a,d)=>{if(a.identifierBound)return P("start",{action:"start"});let c=pt(d??"");if(a.country==="MR"){if(!/^\d{10}$/.test(c))return Promise.reject(new Y("nni","format"));if(!on(c))return Promise.reject(new Y("nni","check_digit"))}else if(c==="")return Promise.reject(new Y("nni","format"));return P("start",{action:"start",identifier:c})},"re"),J=n((a,d,c)=>{if(a.source!=="typed")return Promise.reject(new RangeError("this session already holds the ID number"));let v=pt(d);return/^\d{10}$/.test(v)?nn({type:"national_id",issuingCountry:"MR",number:v})?B("population_registry","submitIdNumber",()=>C("population_registry",(R,L)=>R.submitCheck("population_registry",{idNumber:v,nni:v},{idempotencyKey:L}),()=>{m=`••••••${v.slice(-4)}`})):Promise.reject(new Y(c,"check_digit")):Promise.reject(new Y(c,"format"))},"$"),h=n(a=>(e.stopCameras?.(),B(a,"skipCapture",()=>C(a,(d,c)=>d.submitCheck(a,pn,{idempotencyKey:c}),()=>{(a==="liveness"||a==="portrait_icao")&&(f=!0)}))),"J"),p=n(a=>{if(a.kind==="result"||a.context.simulation?.skipCapture!==!0)return a;let d=mn(a);return d===null?a:{...a,skipCapture:n(()=>h(d),"skipCapture")}},"be"),k=n(a=>((a.kind==="document"||a.kind==="portrait"||a.kind==="proof_of_address")&&a.photo?.cameraOnPhone===!0&&(a.refresh=async()=>{await e.refreshView()}),a),"f"),I=n(a=>{switch(a.kind){case"phone_otp":case"email_otp":{let d={...a,send:n((v={})=>K(a,v),"send"),verify:n(v=>U(a.kind,v),"verify"),switchTo:n(()=>a.canSwitch&&a.switchChannel!==void 0?W([a.switchChannel==="email"?"email_otp":"phone_otp"],"other contact option"):Promise.reject(new RangeError("this session has no other contact option")),"switchTo")},c=u[a.kind];return d.resendAvailableAt===void 0&&c!==void 0&&(d.resendAvailableAt=new Date(c+ln).toISOString()),d}case"eid":return{...a,start:n(d=>F(a,d),"start"),verify:n(d=>dn.test(d)?P("verify",{action:"verify",code:d}):Promise.reject(new Y("code","format")),"verify"),resend:n(()=>a.resendsRemaining===0?Promise.reject(new RangeError("no new code can be sent for this session")):P("resend",{action:"resend"}),"resend"),useCamera:n(()=>a.canUseCamera&&a.cameraMethod!==void 0?W(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:n(d=>{let c=a.choice.options.find(v=>pe[v.service]===d);return c!==void 0?j(a.choice,c.id):Promise.reject(new RangeError(`method ${String(d)} is not offered`))},"select"),choose:n(d=>j(a.choice,d),"choose")};case"choice":return{...a,choose:n(d=>j(a.choice,d),"choose")};case"registry":return{...a,submitIdNumber:n(d=>J(a,d,"idNumber"),"submitIdNumber"),submitNni:n(d=>J(a,d,"nni"),"submitNni"),confirm:n(()=>B("population_registry","confirm",()=>C("population_registry",(d,c)=>d.submitCheck("population_registry",{},{idempotencyKey:c}))),"confirm"),useDocument:n(()=>a.canUseDocument?W(["document"],"document method"):Promise.reject(new RangeError("the document method is not offered")),"useDocument")};case"document":return e.bindDocument!==void 0?k(e.bindDocument(a,A)):{...a,issuer:null,documentType:null,captureSide:null,selectDocument:n(()=>{throw new Error("document capture is not available in this build")},"selectDocument"),capture:n(()=>{throw new Error("document capture is not available in this build")},"capture"),uploadDocument:n(()=>Promise.reject(new Error("document upload is not available in this build")),"uploadDocument")};case"portrait":return e.bindPortrait!==void 0?k(e.bindPortrait(a,A)):{...a,uploadFailed:!1,resubmit:n(()=>Promise.resolve(),"resubmit"),capture:n(()=>{throw new Error("portrait capture is not available in this build")},"capture"),uploadPortrait:n(()=>Promise.reject(new Error("portrait upload is not available in this build")),"uploadPortrait"),confirmFix:n(()=>Promise.reject(new Error("portrait review is not available in this build")),"confirmFix")};case"proof_of_address":return e.bindProofOfAddress!==void 0?k(e.bindProofOfAddress(a,A)):{...a,uploadPages:n(()=>Promise.reject(new Error("proof of address upload is not available in this build")),"uploadPages"),uploadHolderLetter:n(()=>Promise.reject(new Error("proof of address upload is not available in this build")),"uploadHolderLetter"),capturePage:n(()=>{throw new Error("proof of address capture is not available in this build")},"capturePage")};case"form":return{...a,validate:n(d=>xe(a.form,d),"validate"),submit:n(d=>S(a,d),"submit")};case"contact_choice":return{...a,select:n(d=>{let c=d==="phone"?"phone_otp":d==="email"?"email_otp":void 0,v=a.choice.options.find(R=>R.service===c);return v!==void 0?j(a.choice,v.id):Promise.reject(new RangeError(`contact ${String(d)} is not offered`))},"select"),choose:n(d=>j(a.choice,d),"choose")};case"identity_summary":return{...a,...a.idNumberMasked===void 0&&a.summaryKind==="partial"&&m!==null?{idNumberMasked:m,nniMasked:m}:{},portrait:n(async()=>{let d=e.runtime.client;if(!a.portraitAvailable||d.identityPortrait===void 0)return null;try{return await d.identityPortrait()}catch{return null}},"portrait"),confirm:n(()=>_("confirm"),"confirm"),retake:n(()=>a.retakeAvailable?_("retake"):Promise.reject(new RangeError("no retake is left")),"retake")};case"liveness":return{...a,capture:n(d=>e.liveness(d),"capture"),onLivePhoto:n(d=>a.livePhoto?.icao===!0&&e.onLivePhoto!==void 0?e.onLivePhoto(d):()=>{},"onLivePhoto")};case"mobile_required":case"native_app_required":case"processing":return{...a,refresh:n(async()=>{i=!1,await e.refreshView()},"refresh")};case"elsewhere":return{...a,retry:n(()=>e.retryElsewhere?.()??e.refreshView().then(()=>{}),"retry")};case"unsupported":case"result":case"sandbox_mode":case"tester_check":return{...a};default:{let d=a;throw new Error(`runner: unhandled step ${JSON.stringify(d)}`)}}},"w"),x=n(a=>p(I(a)),"x"),N=n(async()=>{if(!l){l=!0;try{for(let a of an){if(await e.sleep(a),!t||e.destroyed())return;let d=e.following?.()===!0?e.currentView():await e.refreshView().catch(()=>null);if(d!==null&&Q(d,{isMobile:e.isMobile()}).kind!=="processing")return}i=!0,A()}finally{l=!1}}},"v"),E=n(a=>{if(a.kind!=="liveness"||a.mode!=="selfie")return null;let d={kind:"processing",key:"processing",context:a.context,section:a.section,stalled:!1};if(y==="inflight")return d;if(!b||y==="done")return null;let c=e.keptFaceKey?.()??null;return c===null?null:(y="inflight",C("face_match",(v,R)=>v.submitCheck("face_match",{imageKey:c},{idempotencyKey:R}),()=>{y="done"}).then(()=>{y==="inflight"&&(y="done",A())},()=>{y="done",A()}),d)},"D"),G=n(a=>{if(!t||e.destroyed())return;let d=x(st(a,e.elsewhereEnded?.()===!0)),c=JSON.stringify(d);c!==o&&(o=c,r=d,e.emitStep(d))},"M"),O=n((a,d=!1)=>{if(e.elsewhere?.()===!0){G(a);return}if(!t||e.destroyed()||e.chainBusy())return;let c=Q(a,{isMobile:e.isMobile()});c.kind==="registry"&&c.recheck&&(b=!0,y="idle"),c=E(c)??c,c.kind==="processing"?c.stalled=i:i=!1;let v=x(c),R=c.kind==="result"?void 0:c.context.switchable,L=R===void 0?v:{...v,chooseOption:n(z=>j({nodeId:R.nodeId,kind:R.kind,selected:R.current,options:R.options},z),"chooseOption")},$=JSON.stringify(L);c.kind==="registry"&&c.source==="document"&&c.state==="pending"&&!w.has("registry")&&(w.add("registry"),L.confirm().catch(z=>{(!(z instanceof Z)||fn.has(z.code))&&w.delete("registry")})),!(!d&&$===o)&&(o=$,r=L,e.emitStep(L),c.kind==="processing"&&!i&&y!=="inflight"&&N(),c.kind==="result"&&!s&&(s=!0,e.emitResult(c.result)))},"T");function A(){let a=e.currentView();a!==null&&O(a,!0)}return n(A,"b"),{run:n(async()=>{if(e.destroyed())throw new Error("verification destroyed");t=!0;let a;try{a=await e.ensureView()}catch(d){if(!Ne(d)||e.elsewhere?.()!==!0)throw d;return G(e.currentView()),r??x(st(null,e.elsewhereEnded?.()===!0))}return r===null&&O(a),r??x(Q(a,{isMobile:e.isMobile()}))},"run"),showElsewhere:n(()=>{e.stopCameras?.(),G(e.currentView())},"showElsewhere"),current:n(()=>r,"current"),onView:n(a=>O(a),"onView"),onChainIdle:n(()=>{let a=e.currentView();a!==null&&O(a)},"onChainIdle"),republish:A,submit:C,faceProbeSkipped:n(()=>f,"faceProbeSkipped")}}n(Ct,"Sr");function mn(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}}n(mn,"Fn");function hn(e,t){let r=e,o=r?.plan?.steps??r?.steps;return Array.isArray(o)?o.some(i=>i.checkType===t&&typeof i.reason=="string"):!1}n(hn,"Hn");var yn=2e4,gn=new Set(["media_type_unsupported","media_type_mismatch"]),It=new Set(["document_upload_not_allowed","portrait_source_not_allowed","uploaded_media_not_allowed"]);function bn(e){let t=null,r=Promise.resolve(),o=!1,i=null,l=null,s=!1,u=null,g=!1,w=!1,f=n(()=>{t?.controller.handle.destroy(),t=null},"M"),b=n(()=>{let _=e.currentView(),S=_===null?null:Q(_,{isMobile:e.isMobile()});return S?.kind==="portrait"?S:null},"n"),m=n(()=>{if(e.destroyed())return"self";let _=e.currentView(),S=_===null?void 0:oe(_);return S==="self"||S==="assisted"?S:S==="choice"&&e.captureModeSwitch!==void 0?e.captureModeSwitch.pick()??"self":e.cameraMode?.()??He(S??$e(_),null)},"i"),y=e.captureModeSwitch,T=y===void 0?void 0:{session:n(()=>{let _=e.currentView();return _!==null&&oe(_)==="choice"?"choice":m()},"session"),onModeChange:n(_=>y.choose(_),"onModeChange")},M=n(async(_,S)=>{if(e.destroyed())return;let K=m();S.setFlowState("uploading"),o=!1;let U=null;try{await e.runner().submit("portrait_icao",async(F,J)=>{if(U===null){let p=await te(F,"image","image/jpeg",_.image.size,{engine:"portrait"});await F.uploadToSpaces(p.uploadUrl,_.image,"image/jpeg"),U=(await F.completeMedia(p.key)).key}S.setFlowState("checking");let h={media:{portrait:U},gate:ue(_.gate),..._.tuningVersion!==void 0?{tuningVersion:_.tuningVersion}:{},source:"camera",capture:{mode:K,facingMode:_.facingMode}};return F.submitCheck("portrait_icao",h,{idempotencyKey:J})})}catch(F){o=!0,F instanceof Z&&It.has(F.code)&&await e.refreshView?.().catch(()=>{})}if(S.setFlowState("done"),e.destroyed())return;let P=b();(P===null||P.phase!=="capture")&&t?.controller===S&&f(),e.runner().republish()},"k"),B=n(_=>e.runner().submit("face_match",(S,K)=>S.submitCheck("face_match",e.runner().faceProbeSkipped()?{simulatedCapture:!0}:{},{idempotencyKey:K})).then(()=>{},()=>{o=!0,_()}),"B"),C=null,V=n(async _=>{let S=b();if(S===null||S.phase!=="capture"||!S.photo.uploadOffered)throw new RangeError("upload_not_offered");let{prepareUploadFile:K}=await import("./upload-file-EGXXM6TQ-NNVVB5QQ.js"),U=await K(_,e.uploadInternals);if(e.destroyed())return;f(),o=!1;let P=null;try{await e.runner().submit("portrait_icao",async(F,J)=>{if(P===null){let p=await F.presign("image",U.contentType,U.blob.size,{source:"upload"});await F.uploadToSpaces(p.uploadUrl,U.blob,U.contentType),P=(await F.completeMedia(p.key)).key}let h={media:{portrait:P},source:"upload"};return F.submitCheck("portrait_icao",h,{idempotencyKey:J})})}catch(F){throw F instanceof Z&&gn.has(F.code)?new TypeError("unsupported_file"):(F instanceof Z&&It.has(F.code)&&await e.refreshView?.().catch(()=>{}),F)}},"I"),D=null,j=n(_=>{if(D!==null)return D;let S=b();if(S===null||S.phase!=="review")return Promise.reject(new RangeError("no_pending_fix"));let K={fixReview:{accept:_}},U=e.runner().submit("portrait_icao",(P,F)=>P.submitCheck("portrait_icao",K,{idempotencyKey:F})).catch(async P=>{throw P instanceof Z&&P.code==="portrait_no_pending_fix"&&await e.refreshView?.().catch(()=>{}),P}).finally(()=>{D=null});return D=U,U},"O"),W=n(_=>{let S=n(()=>V(_),"g"),K=(C===null?S():C.then(S,S)).finally(()=>{C===K&&(C=null)});return C=K,K},"j");return{bind:n((_,S)=>{if(_.phase==="review")return f(),{..._,uploadFailed:o,resubmit:n(()=>Promise.resolve(),"resubmit"),capture:n(()=>{throw new Error("the adjusted photo waits for confirmFix()")},"capture"),uploadPortrait:n(()=>Promise.reject(new RangeError("upload_not_offered")),"uploadPortrait"),confirmFix:j};if(_.phase==="match")return f(),i!==_.attemptsRemaining&&!o&&(i=_.attemptsRemaining,B(S)),{..._,uploadFailed:o,resubmit:n(()=>(o=!1,i=_.attemptsRemaining,S(),B(S)),"resubmit"),capture:n(()=>{throw new Error("the portrait was already accepted")},"capture"),uploadPortrait:n(()=>Promise.reject(new RangeError("upload_not_offered")),"uploadPortrait"),confirmFix:j};if(i=null,_.reuse===!0&&_.phase==="capture")return f(),!g&&u!==_.attemptsRemaining&&(u=_.attemptsRemaining,g=!0,e.runner().submit("portrait_icao",(U,P)=>U.submitCheck("portrait_icao",{},{idempotencyKey:P})).then(()=>{w=!1},()=>{w=!0}).finally(()=>{g=!1,S()})),{kind:"processing",key:"processing",context:_.context,section:_.section,stalled:w&&!g,refresh:n(()=>(w=!1,u=null,S(),Promise.resolve()),"refresh")};let K=e.keptPortraitInput?.()??null;return K!==null&&(s||K!==l&&_.report===null&&_.reason===void 0&&!_.retakeOnly)?(s||(l=K,s=!0,e.runner().submit("portrait_icao",(U,P)=>U.submitCheck("portrait_icao",K,{idempotencyKey:P})).catch(()=>{}).finally(()=>{s=!1,S()})),{kind:"processing",key:"processing",context:_.context,section:_.section,stalled:!1,refresh:n(()=>Promise.resolve(),"refresh")}):{..._,uploadFailed:o,resubmit:n(()=>Promise.resolve(),"resubmit"),capture:n(U=>{if(t!==null&&t.video===U.video)return t.controller.handle;f(),o=!1;let P=Xe({video:U.video,tuning:_.tuning,tuningVersion:_.tuningVersion,..._.icao!=null?{policy:_.icao.policy}:{},...U.keepScreenAwake!==void 0?{keepScreenAwake:U.keepScreenAwake}:{},...U.assetBaseUrl!==void 0?{assetBaseUrl:U.assetBaseUrl}:{}},e.internals,m,T);t={video:U.video,controller:P};let F=P.handle.destroy;P.handle.destroy=()=>{t?.controller===P&&(t=null),F()},P.handle.on("error",p=>{e.reportCaptureIssue?.(ye("portrait",p,0))});let J=!1,h=n((p,k)=>{let I=P.gateScores();I!==null&&e.reportGate?.({kind:"portrait_gate",platform:"web",outcome:p,...k!==null?{failing:k}:{},...I})},"a");return P.handle.on("gate",p=>{!J&&!p.ready&&(P.gateScores()?.elapsedMs??0)>=yn&&(J=!0,h("stuck",p.failing))}),P.handle.on("captured",p=>{h("captured",null),J=!1,r=r.then(()=>M(p,P)).catch(()=>{})}),P.handle},"capture"),uploadPortrait:W,confirmFix:j}},"bind"),destroy:f}}n(bn,"Ce");var vn=.92,_n=n(()=>Je("environment",{width:{ideal:1920},height:{ideal:1080}},{getUserMedia:n(e=>navigator.mediaDevices.getUserMedia(e),"getUserMedia"),enumerateDevices:n(()=>navigator.mediaDevices.enumerateDevices(),"enumerateDevices")}),"Be"),wn=n(e=>{let t=document.createElement("canvas");t.width=e.videoWidth,t.height=e.videoHeight;let r=t.getContext("2d");return r===null||t.width===0||t.height===0?Promise.reject(new Error("the camera has no frame yet")):(r.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",vn)))},"He"),kn=n((e,t)=>{try{e.muted=!0,e.playsInline=!0,e.srcObject=t,e.play().catch(()=>{})}catch{}},"Ge");function xn(e){let t=null,r=null,o=n(b=>{let m=(r===null?b():r.then(b,b)).finally(()=>{r===m&&(r=null)});return r=m,m},"l"),i=n(()=>{t?.handle.destroy(),t=null},"m"),l=n(()=>{let b=e.currentView(),m=b===null?null:Q(b,{isMobile:e.isMobile()});return m?.kind==="proof_of_address"?m:null},"c"),s=n(async(b,m)=>{if(m.length===0)throw new RangeError("no_pages");if(m.length>b.maxPages)throw new RangeError("too_many_pages");let{pdfFileKind:y,prepareUploadFile:T}=await import("./upload-file-EGXXM6TQ-NNVVB5QQ.js"),M=await Promise.all(m.map(C=>y(C)));if(M.includes("bad"))throw new TypeError("unsupported_file");if(M.includes("pdf")){if(m.length>1)throw new RangeError("too_many_pages");let C=m[0];if(C.size>b.pdf.maxBytes)throw new RangeError("file_too_large");return[{kind:"document_file",blob:C,contentType:"application/pdf"}]}let B=[];for(let C of m){let V=await T(C,e.uploadInternals);B.push({kind:"image",blob:V.blob,contentType:V.contentType})}return B},"f"),u=n(async(b,m,y)=>{let T=null;try{await e.runner().submit("poa",async(M,B)=>{if(T===null){let V=[];for(let D of y){let j=m==="upload"?await M.presign(D.kind,D.contentType,D.blob.size,{source:"upload"}):await te(M,D.kind,D.contentType,D.blob.size,{engine:"poa_page"});await M.uploadToSpaces(j.uploadUrl,D.blob,D.contentType),V.push((await M.completeMedia(j.key)).key)}T=V}let C=y[0]?.kind==="document_file"?{part:b,source:"upload",pdfKey:T[0]}:{part:b,source:m,imageKeys:T};return M.submitCheck("poa",C,{idempotencyKey:B})})}catch(M){throw M instanceof Z&&(M.code==="media_type_unsupported"||M.code==="media_type_mismatch")?new TypeError("unsupported_file"):(M instanceof Z&&(M.code==="document_upload_not_allowed"||M.code==="uploaded_media_not_allowed")&&await e.refreshView?.().catch(()=>{}),M)}},"_"),g=n(async(b,m)=>{let y=l();if(y===null||!y.photo.uploadOffered)throw new RangeError("upload_not_offered");if(b==="holder_letter"&&y.phase!=="holder_letter")throw new RangeError("holder_letter_not_requested");let T=await s(y,m);e.destroyed()||(i(),await u(b,"upload",T))},"A"),w=n((b,m)=>{let y=null,T=[],M=!0,B=n(()=>{for(let V of y?.getTracks()??[])V.stop();y=null},"B"),C={get pages(){return T},start:n(async()=>{if(!M||y!==null)return;let V=await(e.pageCamera?.open??_n)();if(!M){for(let D of V.getTracks())D.stop();return}y=V,(e.pageCamera?.attach??kn)(b,V)},"start"),takePage:n(async()=>{if(T.length>=m)throw new RangeError("too_many_pages");let V=await(e.pageCamera?.grab??wn)(b);if(T.length>=m)throw new RangeError("too_many_pages");return T=[...T,V],V},"takePage"),removePage:n(V=>{T=T.filter((D,j)=>j!==V)},"removePage"),submitPages:n(()=>o(async()=>{if(T.length===0)throw new RangeError("no_pages");let V=l();if(V===null)throw new RangeError("camera_not_offered");let D=V.phase==="holder_letter"?"holder_letter":"document";await u(D,"camera",T.map(j=>({kind:"image",blob:j,contentType:"image/jpeg"}))),t?.handle===C?i():C.destroy()}),"submitPages"),destroy:n(()=>{M=!1,T=[],B(),t?.handle===C&&(t=null)},"destroy")};return C},"R"),f=n(async()=>{let b=l();if(b===null||!b.licenceAddressAccepted)throw new RangeError("licence_address_not_accepted");if(e.destroyed())return;i();let m={part:"document"};await e.runner().submit("poa",(y,T)=>y.submitCheck("poa",m,{idempotencyKey:T}))},"M");return{bind:n(b=>({...b,...b.licenceAddressAccepted?{useLicenceAddress:n(()=>o(f),"useLicenceAddress")}:{},uploadPages:n(m=>o(()=>g("document",m)),"uploadPages"),uploadHolderLetter:n(m=>o(()=>g("holder_letter",m)),"uploadHolderLetter"),capturePage:n(m=>{if(b.photo.source==="upload")throw new RangeError("camera_not_offered");if(t!==null&&t.video===m.video)return t.handle;i();let y=w(m.video,b.maxPages);return t={video:m.video,handle:y},y},"capturePage")}),"bind"),destroy:i}}n(xn,"_e");function An(e,t){let r=e!==null&&typeof e=="object"?e:{};if(r.refuseExpired!==!0||typeof r.serverTime!="string")return null;let o=Date.parse(r.serverTime);return!Number.isFinite(o)||!Number.isFinite(t)||Math.abs(t-o)>864e5?null:new Date(o-1*864e5).toISOString().slice(0,10)}n(An,"Ie");function Mn(e,t){let r=null,o=null,i=!1,l=null,s=null,u=[],g=n((f,b)=>{f.off=b.on(f.event,f.handler)},"A"),w=n(()=>(o??(o=e.then(f=>{if(i)return null;let b=t(f),m=b.handle;for(let y of u)y.removed||g(y,m);return l!==null&&m.setSide(l),s!==null&&m.setGuide(s.guide),r=b,m}).catch(()=>{if(o=null,!i)for(let f of u)!f.removed&&f.event==="error"&&f.handler({kind:"generic",retryable:!0});return null})),o),"R");return{handle:{get state(){return r?.handle.state??"idle"},on:n((f,b)=>{let m={event:f,handler:b,off:null,removed:!1};return u.push(m),r!==null&&g(m,r.handle),()=>{m.removed=!0,m.off?.()}},"on"),start:n(async()=>{let f=await w();f!==null&&!i&&await f.start()},"start"),retry:n(()=>{r!==null?r.handle.retry():w().then(f=>f?.start())},"retry"),setSide:n(f=>{r!==null?r.handle.setSide(f):l=f},"setSide"),shutter:n(()=>r?.handle.shutter(),"shutter"),setTorch:n(f=>r?.handle.setTorch(f),"setTorch"),focusAt:n((f,b)=>r?.handle.focusAt(f,b),"focusAt"),setGuide:n(f=>{r!==null?r.handle.setGuide(f):s={guide:f}},"setGuide"),destroy:n(()=>{i=!0,r?.handle.destroy(),u.length=0},"destroy")},get plan(){return r?.plan??null},setFlowState:n(f=>r?.setFlowState(f),"setFlowState"),settle:n((f,b,m)=>r?.settle(f,b,m),"settle"),dropped:n(f=>r?.dropped(f)??!1,"dropped"),serverHeld:n(f=>r?.serverHeld(f),"serverHeld"),takeDeviceRead:n(f=>r?.takeDeviceRead(f)??null,"takeDeviceRead"),traceUpload:n((f,b)=>r?.traceUpload(f,b),"traceUpload"),traceAnswer:n((f,b,m,y)=>r?.traceAnswer(f,b,m,y),"traceAnswer"),shotFacts:n(f=>r?.shotFacts(f)??null,"shotFacts")}}n(Mn,"De");var Tn=1500,Sn=["ID-1","ID-2","ID-3"],Pn=["recto","verso","single"],Cn=["td1","td2","td3"],In=["pdf417","qr","datamatrix","aztec"],En=["yes","no","some"],Rn=["dmy","mdy","ymd"],jn=["gregorian","hijri","solar_hijri","thai_buddhist"],Nn=24,ae=n(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"X"),re=n((e,t)=>typeof e=="string"&&t.includes(e),"K"),Et=n((e,t)=>e===null||re(e,t),"Me");function On(e){if(!ae(e))return null;let{side:t,portrait:r,mrz:o,barcode:i,scripts:l}=e;return!re(t,Pn)||typeof r!="boolean"||!Et(o,Cn)||!Et(i,In)||!Array.isArray(l)||!l.every(s=>typeof s=="string")?null:{side:t,portrait:r,mrz:o,barcode:i,scripts:[...l]}}n(On,"qe");function Vn(e){if(!ae(e))return null;let{id:t,format:r,mrzCode:o,chip:i,dates:l,sides:s}=e;if(typeof t!="string"||!re(r,Sn)||!(o===null||typeof o=="string")||!re(i,En)||!ae(l)||!re(l.order,Rn)||!re(l.calendar,jn)||!Array.isArray(s)||s.length<1||s.length>2)return null;let u=s.map(On);return u.some(g=>g===null)?null:{id:t,format:r,mrzCode:o,chip:i,dates:{order:l.order,calendar:l.calendar},sides:u}}n(Vn,"Qe");function Un(e,t,r){if(!ae(e)||e.country!==t||e.documentType!==r)return null;let{version:o,series:i}=e;if(typeof o!="number"||!Number.isInteger(o)||!Array.isArray(i)||i.length>Nn)return null;let l=i.map(Vn);return l.some(s=>s===null)?null:{country:t,documentType:r,version:o,series:l}}n(Un,"Je");function Fn(e){return e.series.map(t=>({format:t.format,sides:t.sides}))}n(Fn,"Re");function Ln(e){return ae(e)&&"success"in e&&"data"in e?e.data:e}n(Ln,"et");function Dn(e,t={}){let r=e;if(r===null||typeof r.apiOrigin!="string"||typeof r.sessionToken!="string")return;let o=r.apiOrigin,i=r.sessionToken,l=t.timeoutMs??Tn;return(s,u)=>{let g=t.fetchImpl??(typeof fetch=="function"?fetch:void 0);if(g===void 0)return Promise.resolve(null);let w=typeof AbortController=="function"?new AbortController:void 0,f,b=new Promise(y=>{f=setTimeout(()=>{w?.abort(),y(null)},l)}),m=(async()=>{let y=`country=${encodeURIComponent(s)}&type=${encodeURIComponent(u)}`,T=await g(`${o}/api/v2/hosted/document-facts?${y}`,{method:"GET",headers:{"x-session-token":i,"x-sekyro-sdk":`@sekyro/web/${he}`},cache:"default",...w!==void 0?{signal:w.signal}:{}});return T.ok?Un(Ln(await T.json()),s,u):null})().catch(()=>null);return Promise.race([m,b]).finally(()=>clearTimeout(f))}}n(Dn,"Fe");function Bn(e,t){let r=t!==null&&typeof t=="object"?t:{},o=n((i,l,s,u)=>typeof i=="number"&&Number.isFinite(i)&&i>=l&&i<=s?i:u,"l");return{guide:et(_e(e,t)),safetyNetMs:o(r.safetyNetMs,2e3,2e4,6e3),sideChangeMs:o(r.sideChangeMs,100,2e3,300)}}n(Bn,"tt");function Re(e){let t=e;if(typeof t.apiOrigin!="string"||typeof t.sessionToken!="string")return;let r=`${t.apiOrigin}/api/v2/hosted/capture-reports`,o=t.sessionToken;return i=>{try{fetch(r,{method:"POST",headers:{"content-type":"application/json","x-session-token":o,"x-sekyro-sdk":`@sekyro/web/${he}`},body:JSON.stringify({reports:i}),keepalive:!0}).catch(()=>{})}catch{}}}n(Re,"ae");function Rt(e){let t=e.apiOrigin;return it("sdk",typeof t=="string"&&/staging|sandbox|localhost/.test(t)?"sandbox":"live")}n(Rt,"Te");function zn(e){return Rt(e).replace(/\/ocr$/,"/barcode")}n(zn,"nt");function fi(e){let t=null,r=null,o={issuer:"",documentType:""},i=new Set(["document_type_mismatch","document_kind_not_accepted","document_type_not_accepted","document_type_not_supported"]),l=null,s=null,u=Oe(),g=Promise.resolve(),w=n(()=>{s?.flow.handle.destroy(),s=null},"R"),f=null,b=n((h,p)=>new Promise(k=>{if(s?.flow!==h){k(!1);return}let I=n(x=>{f?.flow===h&&(f=null,k(x),e.destroyed()||t.republish())},"T");f={code:ze(p)==="clock_wrong"?"clock_wrong":"failed",flow:h,retry:n(()=>I(!0),"retry"),end:I},t.republish()}),"n"),m=null,y=n(()=>e.documentInternals?.catalogCapture??e.currentView()?.capture?.document?.catalog===!0,"u"),T=n((h,p)=>{let k=`${h}:${p}`;if(m?.key===k)return m;if(m=null,!y()||e.documentInternals?.captureSeries!==void 0)return null;let I=e.documentFacts??Dn(e.runtime.client);if(I===void 0)return null;let x={key:k,promise:Promise.resolve(null),settled:!1,value:null};return x.promise=I(h,p).catch(()=>null).then(N=>(x.value=N,x.settled=!0,N)),m=x,x},"h"),M=n(h=>h===null?{}:{documentType:h.documentType,documentCountry:h.issuer},"k"),B=n(async(h,p,k)=>{if(e.destroyed()||p.dropped(h))return;p.traceUpload(h,"send");let I=(()=>{let H=e.currentView(),se=H===null?null:Q(H,{isMobile:e.isMobile()});return se?.kind==="document"?se.acceptedSides:[]})();p.setFlowState("uploading");let x=null,N=M(k),E,G=!1,O=!1,A=e.currentView()?.documents!==void 0,a=n(()=>t.submit("doc_ocr",async(H,se)=>{if(x===null){p.traceUpload(h,"upload");let je=await te(H,"image","image/jpeg",h.image.size,{engine:"document"});p.traceUpload(h,"put"),await H.uploadToSpaces(je.uploadUrl,h.image,"image/jpeg"),p.traceUpload(h,"putDone"),x=(await H.completeMedia(je.key)).key,p.traceUpload(h,"uploaded")}p.setFlowState("checking"),E===void 0&&(E=p.takeDeviceRead(h));let ce=p.shotFacts(h);p.traceUpload(h,"submit");let jt=await H.submitCheck("doc_ocr",{imageKey:x,side:h.side,...E!==null?{deviceRead:E}:{},...A?{source:"camera"}:{},...ce!==null?{torch:ce.torch,...ce.glareZone!==void 0?{glareZone:ce.glareZone}:{}}:{},...N},{idempotencyKey:se});return p.traceUpload(h,"answered"),l=k,jt}),"Y");try{for(;;)try{await a();break}catch(H){if(e.destroyed()||!(H instanceof Z)||H.code!=="attestation_invalid")throw H;if(!await b(p,H)){O=!0;break}}}catch{G=!0}finally{p.setFlowState("done")}if(e.destroyed()||O)return;if(G){p.settle(h.side,{ok:!1,issue:"technical"},h);return}let d=e.currentView(),c=d===null?null:Q(d,{isMobile:e.isMobile()});if(p.traceAnswer(h,c?.kind==="document"?c.acceptedSides:null,c?.kind==="document"?c.reason:void 0,x),c?.kind!=="document"){p.settle(h.side,{ok:!0},h),s?.flow===p?w():p.handle.destroy();return}if(l=c.reason!==void 0?k:null,c.reason==="document_type_not_accepted"||c.reason==="document_type_not_supported"){r=null,s?.flow===p&&w(),t.republish();return}let v=c.acceptedSides,R=h.side!=="single"&&c.side!==h.side&&(v.includes(h.side)||c.reason==="side_missing")&&!(v.includes("recto")&&v.includes("verso")),L=h.side==="recto"?"verso":h.side==="verso"?"recto":null,$=L!==null&&c.side===h.side&&v.includes(L)&&!v.includes(h.side)&&!I.includes(L),z=v.filter(H=>H==="recto"||H==="verso"),le=n(()=>p.serverHeld(z),"q");if(R){let H=r?.documentType!=="passport";p.settle(h.side,H?{ok:!0,held:z}:{ok:!0},h),H&&(le(),p.handle.setSide(c.side))}else $?(p.settle(h.side,{ok:!0,heldAs:L,held:z},h),le(),p.handle.setSide(c.side)):h.side!=="single"&&v.length===0?(p.settle(h.side,{ok:!1,issue:"reread"},h),p.handle.retry()):(p.settle(h.side,{ok:!1,issue:"reread"},h),h.side!=="single"&&le());p.handle.state==="done"&&!e.destroyed()&&s?.flow===p&&(p.handle.retry(),h.side!=="single"&&(le(),p.handle.setSide(c.side)))},"B"),C=null,V=n(async h=>{let p=e.currentView(),k=p===null?null:Q(p,{isMobile:e.isMobile()});if(p===null||k?.kind!=="document")throw new RangeError("upload_not_offered");if(!k.photo.uploadOffered)throw new RangeError("upload_not_offered");let I=r,x=I?.documentType==="passport"?"single":k.side,{prepareUploadFile:N}=await import("./upload-file-EGXXM6TQ-NNVVB5QQ.js"),E=await N(h,e.uploadInternals);if(e.destroyed())return;w();let G=null,O=M(I);try{await t.submit("doc_ocr",async(A,a)=>{if(G===null){let c=await A.presign("image",E.contentType,E.blob.size,{source:"upload"});await A.uploadToSpaces(c.uploadUrl,E.blob,E.contentType),G=(await A.completeMedia(c.key)).key}let d=await A.submitCheck("doc_ocr",{imageKey:G,side:x,source:"upload",...O},{idempotencyKey:a});return l=I,d})}catch(A){throw A instanceof Z&&(A.code==="media_type_unsupported"||A.code==="media_type_mismatch")?new TypeError("unsupported_file"):(A instanceof Z&&(A.code==="document_upload_not_allowed"||A.code==="uploaded_media_not_allowed")&&await e.refreshView().catch(()=>{}),A)}},"I"),D=n((h,p)=>{h.reason===void 0?l=null:l===null&&(l=r??(i.has(h.reason)?o:null));let k=r!==null&&l!==null&&(l===o||r.issuer!==l.issuer||r.documentType!==l.documentType),I={...h};return k&&delete I.reason,{...I,...k?{reasonHidden:!0}:{},...f!==null?{browserCheck:{code:f.code,retry:f.retry}}:{},uploadDocument:n(x=>{let N=n(()=>V(x),"S"),E=(C===null?N():C.then(N,N)).finally(()=>{C===E&&(C=null)});return C=E,E},"uploadDocument"),issuer:r?.issuer??null,documentType:r?.documentType??null,captureSide:r===null?null:r.documentType==="passport"?"single":h.side,selectDocument:n((x,N)=>{if(!mt(h.documents).includes(x)||!Me(h.documents,x).includes(N))throw new RangeError(`${N} from ${x} is not accepted`);(r?.issuer!==x||r.documentType!==N)&&w(),r={issuer:x,documentType:N},T(x,N),p()},"selectDocument"),capture:n(x=>{if(r===null)throw new Error("selectDocument() first");if(s!==null&&s.video===x.video)return s.flow.handle;w();let N=r,E=N.documentType==="passport"?"single":h.acceptedSides.length>0?h.side:void 0,G=n(d=>nt({video:x.video,documentType:N.documentType,issuer:N.issuer,...E!==void 0?{side:E}:{},...x.keepScreenAwake!==void 0?{keepScreenAwake:x.keepScreenAwake}:{},...x.liveMrz!==void 0?{liveMrz:x.liveMrz}:{},...x.barcodeAssetBaseUrl!==void 0?{barcodeAssetBaseUrl:x.barcodeAssetBaseUrl}:{}},{...e.documentInternals??{},...(()=>{let c=e.currentView()?.capture?.document,v=e.documentInternals?.blurRefuseSharpnessMax??c?.scan?.blurRefuseSharpnessMax;return{engineOptions:{camera:tt(c?.camera),shutter:rt(c?.scan),guideLock:_e(c?.guide,c?.scan),...e.documentInternals?.engineOptions??{}},...typeof v=="number"&&Number.isFinite(v)&&v>=0&&v<=1?{blurRefuseSharpnessMax:v}:{},catalogCapture:e.documentInternals?.catalogCapture??c?.catalog===!0,...d!==null&&e.documentInternals?.captureSeries===void 0?{captureSeries:Fn(d)}:{},...c?.secondSide?.enabled===!0&&e.documentInternals?.secondSide===void 0?{secondSide:Bn(c.guide,c.scan)}:{},...(()=>{if(e.documentInternals?.expiredBefore!==void 0)return{};let R=An(c,Date.now());return R===null?{}:{expiredBefore:R}})()}})(),deferRead:!0,...(()=>{if(e.documentInternals?.traceSink!==void 0)return{};let c=Re(e.runtime.client);return c!==void 0?{traceSink:c}:{}})(),...e.documentInternals?.barcode!==void 0?{}:{barcode:{assetBaseUrl:zn(e.runtime.client)}},...(()=>{let c=e.currentView();if(c===null||e.documentInternals?.webOcr!==void 0)return{};let v=Re(e.runtime.client);return{webOcr:{captureDocument:c.capture?.document,salt:c.sessionId,baseUrl:Rt(e.runtime.client),...v!==void 0?{reports:v}:{}}}})()}),"H"),O=T(N.issuer,N.documentType),A=O===null||O.settled?G(O?.value??null):Mn(O.promise,G);s={video:x.video,flow:A};let a=A.handle.destroy;return A.handle.destroy=()=>{s?.flow===A&&(s=null),a(),f?.flow===A&&f.end(!1)},u.newHandle(),A.handle.on("state",d=>u.note(d)),A.handle.on("error",d=>{u.noteError(),e.reportCaptureIssue?.(ye("document",d,u.value))}),A.handle.on("captured",d=>{g=g.then(()=>B(d,A,N)).catch(()=>{})}),A.handle},"capture")}},"F"),j=null,W=null,_=new Set,S=e.runtime.client;e.runtime.client=new Proxy(S,{get(h,p){if(p==="submitCheck")return(W??h).submitCheck.bind(W??h);let k=Reflect.get(h,p);return typeof k=="function"?k.bind(h):k}});let K=n(()=>{j?.destroy(),j=null,W=null},"g"),U=n(h=>{let p=e.currentView(),k=p===null?null:Q(p,{isMobile:e.isMobile()});if(p===null||k?.kind!=="liveness"||k.livePhoto?.icao!==!0)return;if(j===null){let E=ht({tuning:p.capture?.icao??null,tuningVersion:p.capture?.tuningVersion??null,...k.icao!=null?{policy:k.icao.policy}:{},still:k.livePhoto.still,...h.assetBaseUrl!==void 0?{assetBaseUrl:h.assetBaseUrl}:{}},e.livePhotoInternals);j=E,W=E.decorate(S),E.onGate(G=>{for(let O of _)O(G)})}let I=j,x=e.baseCapture??{},N=x.engineOptions?.telemetry;return{...x,engineOptions:{...x.engineOptions??{},measureQuality:I.engineOptions.measureQuality,telemetry:n(E=>{N?.(E),I.engineOptions.telemetry(E)},"telemetry")}}},"E"),P=bn({keptPortraitInput:n(()=>j?.lastPortraitInput()??null,"keptPortraitInput"),runner:n(()=>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:n(()=>e.refreshView(),"refreshView"),...e.reportCaptureIssue!==void 0?{reportCaptureIssue:e.reportCaptureIssue}:{},reportGate:n(h=>Re(e.runtime.client)?.([h]),"reportGate")}),F=xn({runner:n(()=>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:n(()=>e.refreshView(),"refreshView")}),J=Ct({...e,bindDocument:D,bindPortrait:P.bind,bindProofOfAddress:F.bind,stopCameras:n(()=>{w(),P.destroy(),F.destroy(),K(),e.stopLiveness?.()},"stopCameras"),onLivePhoto:n(h=>(_.add(h),()=>_.delete(h)),"onLivePhoto")});return t=J,{...J,captureInternals:U,destroy:n(()=>{w(),P.destroy(),F.destroy(),K(),_.clear()},"destroy")}}n(fi,"Vt");export{zn as barcodeAssetBase,fi as createPlanRunner,Re as reportSink,Rt as sdkAssetBase};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a as N}from"./chunk-
|
|
1
|
+
"use client";import{a as N}from"./chunk-SOCYEC7N.js";import"./chunk-HTIKUYTU.js";import{a as te}from"./chunk-XVHJIXFH.js";import{c as X}from"./chunk-SYUAQ7BF.js";import"./chunk-LBEHJATK.js";import{a as ae,b as re,c as ie}from"./chunk-DO66BOHU.js";import"./chunk-Y6MS7VVL.js";import"./chunk-6T7VBPLY.js";import"./chunk-PWGUNXYH.js";import{B as Y,G as Z,K as f,L as ee,a as ke,b as ye,c as C,t as Q}from"./chunk-EB2QC3GA.js";import{a as n}from"./chunk-5QL6W6FW.js";import"./chunk-44UA2IDQ.js";import"./chunk-5OPKZZON.js";import"./chunk-EGCT7K5E.js";import"./chunk-P7K7ELYZ.js";import"./chunk-6MYG4HWP.js";import"./chunk-JS2IXPNL.js";import"./chunk-SLLJX5QK.js";import{a as S,c as O}from"./chunk-4FHWXBOB.js";var i=O(ke(),1),e=O(ye(),1);var x=["pose","eyes","mouth","lighting","background","resolution"],se="occlusion";function le(r){return r?.startsWith("icao_")===!0?r.slice(5):null}S(le,"Se");n(le,"reasonCriterion");function ve({step:r,i18n:c,assetBaseUrl:M,onUpload:P}){let{t:a}=c,B=(0,i.useRef)(null),p=(0,i.useRef)(null),[s,oe]=(0,i.useState)("idle"),[k,L]=(0,i.useState)(null),[_,y]=(0,i.useState)(null),[$,E]=(0,i.useState)({facing:"user",assisted:!1}),[F,ne]=(0,i.useState)(!1),[de,I]=(0,i.useState)(!1),[j,ce]=(0,i.useState)(!1),pe=Q(),T=(0,i.useContext)(Y),U=(0,i.useContext)(ae),A=(0,i.useRef)(U);A.current=U,(0,i.useEffect)(()=>{let t=B.current;if(t===null)return;let l=r.capture({video:t,...M!==void 0?{assetBaseUrl:M}:{}});p.current=l;let g=n(()=>E({facing:l.facingMode??"user",assisted:l.captureMode==="assisted"}),"readCamera");g();let fe=[l.on("state",o=>{g(),o==="mode_switch"?I(!0):o!=="starting"&&o!=="gating"&&I(!1),oe(o)}),l.on("gate",L),l.on("error",o=>{y(o);let K=A.current;K!==null&&ie(K,re("portrait",o,0))})],J=!0;return Promise.resolve(l.canSwitchCaptureMode?.()??!1).catch(()=>!1).then(o=>{J&&ne(o===!0)}),l.start().catch(()=>{}),()=>{J=!1;for(let o of fe)o();l.destroy(),p.current=null}},[]);let u=s==="uploading"||s==="checking",h=s==="done",v=h&&r.reason!==void 0&&!r.uploadFailed,ue=s==="starting"||s==="idle"||s==="mode_switch"?"portrait.starting":s==="captured"?"portrait.taken":s==="uploading"?"portrait.uploading":s==="checking"?"portrait.checking":`portrait.coach.${k?.coach??"no_face"}`,R=(r.report??[]).filter(t=>!t.pass),V=r.reason!==void 0?`reasons.${r.reason}`:null,m=le(r.reason),q=R.filter(t=>t.criterion!==m),H=new Set([...R.map(t=>t.criterion),...m!==null?[m]:[]]),he=H.has(se),W=n(()=>{y(null),p.current?.retry()},"retake"),w=n(t=>{let l=k?.criteria.find(g=>g.criterion===t);return l!==void 0&&(l.held||l.waived)},"met"),me=k?.ready||s==="captured"||u?1:x.filter(w).length/x.length;v&&!j&&ce(!0);let z=V!==null&&(v||s==="gating"&&(m===null||!j)),ge=!v,D=s==="starting"||s==="gating"||s==="error"||s==="mode_switch",d=$.assisted?"self":"assisted",G=F&&D?{to:d,label:a(d==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelfPhoto"),description:a(d==="assisted"?"capture.modeSwitch.toAssistedLabelPhoto":"capture.modeSwitch.toSelfLabelPhoto"),onSwitch:n(()=>{let t=p.current;t?.setCaptureMode(d).then(l=>{l&&(y(null),L(null),E({facing:t.facingMode??"user",assisted:d==="assisted"}))})},"onSwitch")}:null,b=de&&D?a("capture.modeSwitch.restarted"):null;return(0,e.jsxs)(te,{testId:"sekyro-portrait",video:(0,e.jsx)("video",{ref:B,className:`sekyro-lm-video sekyro-fc-video${$.facing==="environment"?" is-rear":""}`,playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true"}),instruction:a(ue),...b!==null?{note:b}:{},...F?{status:b}:{},progress:me,closeLabel:a("native.close"),...T!==void 0?{onClose:T}:{},...G!==null?{end:(0,e.jsx)(X,{view:G,className:"sekyro-glass sekyro-glass--label"})}:{},children:[(0,e.jsx)("h2",{ref:pe,tabIndex:-1,className:"sekyro-visually-hidden",children:a(r.reason!==void 0?"portrait.retryTitle":"session.steps.portrait.title")}),z||_!==null||h&&(r.uploadFailed||!r.attemptsExhausted)?(0,e.jsxs)("div",{className:"sekyro-fc-panel",children:[z?(0,e.jsxs)(f,{tone:"warning",children:[(0,e.jsx)("span",{children:N(c)(V)||a("portrait.retryTitle")}),q.length>0?(0,e.jsxs)("span",{children:[a("portrait.reportTitle"),": ",q.map(t=>a(`portrait.report.${t.criterion}`)).join(", ")]}):null,(0,e.jsx)("span",{children:ee(c,r.attemptsRemaining,r.attemptsExhausted)})]}):null,_!==null?(0,e.jsxs)(f,{tone:"danger",children:[(0,e.jsx)("span",{children:a("portrait.cameraBlocked")}),(0,e.jsx)("span",{children:a("portrait.cameraBlockedHint")}),(0,e.jsx)(C,{kind:"secondary",onClick:W,children:a("portrait.retryCamera")})]}):null,r.uploadFailed&&h?(0,e.jsx)(f,{tone:"danger",children:(0,e.jsx)("span",{children:a("portrait.uploadFailed")})}):null,h&&!r.attemptsExhausted?(0,e.jsx)(C,{full:!0,onClick:W,disabled:u,children:a("portrait.retake")}):null]}):null,ge?(0,e.jsxs)("ul",{className:"sekyro-fc-checks","aria-label":a("portrait.checksLabel"),children:[x.map(t=>(0,e.jsxs)("li",{className:w(t)?"is-met":H.has(t)?"is-flagged":void 0,"data-criterion":t,children:[(0,e.jsx)("span",{className:"sekyro-fc-mark","aria-hidden":"true",children:(0,e.jsx)("svg",{viewBox:"0 0 18 18",children:(0,e.jsx)("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})}),(0,e.jsx)("span",{children:a(`portrait.criteria.${t}`)}),(0,e.jsx)("span",{className:"sekyro-visually-hidden",children:a(w(t)?"portrait.met":"portrait.notMet")})]},t)),he?(0,e.jsxs)("li",{className:"is-flagged","data-criterion":se,children:[(0,e.jsx)("span",{className:"sekyro-fc-mark","aria-hidden":"true",children:(0,e.jsx)("svg",{viewBox:"0 0 18 18",children:(0,e.jsx)("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})}),(0,e.jsx)("span",{children:a("portrait.report.occlusion")}),(0,e.jsx)("span",{className:"sekyro-visually-hidden",children:a("portrait.notMet")})]}):null]}):null,P!==void 0&&!u?(0,e.jsx)("button",{type:"button",className:"sekyro-lm-upload",onClick:P,"data-testid":"sekyro-portrait-upload-instead",children:N(c)("portrait.source.uploadInstead")}):null,u?null:(0,e.jsx)(Z,{})]})}S(ve,"Le");n(ve,"PortraitCaptureView");export{ve as PortraitCaptureView};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a as r,b as t,c as i,d as o,e as a}from"./chunk-
|
|
1
|
+
"use client";import{a as r,b as t,c as i,d as o,e as a}from"./chunk-SOCYEC7N.js";import"./chunk-HTIKUYTU.js";import"./chunk-LBEHJATK.js";import"./chunk-Y6MS7VVL.js";import"./chunk-EB2QC3GA.js";import"./chunk-5QL6W6FW.js";import"./chunk-4FHWXBOB.js";export{o as PortraitReviewView,a as PortraitScreens,t as PortraitSourceView,i as PortraitUploadView,r as portraitCopy};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a as J}from"./chunk-FOPIRIC2.js";import{a as O}from"./chunk-SIBJ56BG.js";import{a as M}from"./chunk-RVL4N5KZ.js";import"./chunk-4H47RI64.js";import{d as S}from"./chunk-JU4XNPJJ.js";import"./chunk-TBQUAM5Z.js";import{K as b,L as q,a as j,b as G,c as k,v as N,w as D,y as R}from"./chunk-2HKOE6CN.js";import{a as p}from"./chunk-5QL6W6FW.js";import{a as l,c as x}from"./chunk-4FHWXBOB.js";var v=x(j(),1),f=x(j(),1),o=x(G(),1),t=x(G(),1);var ee={"poa.title":"إثبات العنوان","poa.lead":"ارفع وثيقة حديثة تُظهر اسمك وعنوانك الحالي.","poa.accepted":"الوثائق المقبولة","poa.acceptedFor":"مقبول في {country}","poa.kindDated":"{kind}، صادر خلال آخر {days} يومًا","poa.kinds.utility_bill":"فاتورة كهرباء أو ماء أو غاز","poa.kinds.telecom_bill":"فاتورة هاتف أو إنترنت","poa.kinds.bank_statement":"كشف حساب بنكي","poa.kinds.tax_notice":"إشعار ضريبي","poa.kinds.rental_agreement":"عقد إيجار","poa.kinds.government_certificate":"شهادة السكن","poa.kinds.insurance_statement":"وثيقة تأمين","poa.source.camera":"التقاط صورة","poa.source.upload":"رفع ملف","poa.source.lead":"صورة للوثيقة، أو ملف PDF أو صورة من جهازك","poa.upload.hint":"PDF أو JPEG أو PNG، بحد أقصى 3 صفحات و10 ميغابايت","poa.upload.choose":"اختيار ملف","poa.upload.addPage":"إضافة صفحة","poa.upload.pages":"{count} من 3 صفحات","poa.upload.send":"إرسال الوثيقة","poa.upload.sending":"جارٍ إرسال وثيقتك…","poa.upload.unsupported":"نوع الملف هذا غير مقبول. اختر ملف PDF أو JPEG أو PNG","poa.upload.tooManyPages":"أرسل 3 صفحات على الأكثر. احذف صفحة أو اختر ملفًا أقصر","poa.upload.tooLarge":"حجم الملف يتجاوز 10 ميغابايت. اختر ملفًا أصغر","poa.upload.failed":"تعذّر إرسال الوثيقة. تحقّق من اتصالك وحاول مرة أخرى","poa.camera.lead":"ضع الوثيقة بشكل مسطّح واملأ الإطار. التقط صورة واحدة لكل صفحة","poa.camera.capture":"التقاط الصورة","poa.camera.retake":"إعادة الالتقاط","poa.camera.next":"الصفحة التالية","poa.camera.page":"الصفحة {number}","poa.letter.title":"رسالة من صاحب الفاتورة","poa.letter.lead":"الوثيقة باسم شخص آخر. أضف رسالة موقّعة من هذا الشخص تفيد بأنك تسكن في هذا العنوان","poa.letter.send":"إرسال الرسالة","poa.licence.use":"استخدام العنوان المذكور في رخصة القيادة","poa.licence.note":"قرأنا هذا العنوان من رخصتك. لا تحتاج إلى وثيقة أخرى.","poa.retry.document_too_old":"هذه الوثيقة أقدم من المسموح. ارفع وثيقة أحدث من القائمة أدناه","poa.retry.document_date_invalid":"تاريخ الوثيقة في المستقبل. ارفع وثيقة بتاريخ اليوم أو قبله","poa.retry.document_kind_not_accepted":"نوع هذه الوثيقة غير مقبول. ارفع إحدى الوثائق المذكورة أدناه","poa.retry.name_mismatch":"الاسم في الوثيقة لا يطابق اسمك. ارفع وثيقة باسمك","poa.retry.address_mismatch":"العنوان في الوثيقة لا يطابق العنوان الذي وصلنا. ارفع وثيقة لهذا العنوان","poa.retry.holder_letter_missing":"يجب أن تكون الرسالة موقّعة وأن تذكر اسمك واسم صاحب الفاتورة. ارفع رسالة كاملة","poa.retry.unreadable":"تعذّرت قراءة الوثيقة. ارفع نسخة كاملة وأكثر وضوحًا","poa.retry.pdf_protected":"أزل كلمة المرور من ملف PDF وحاول مرة أخرى","poa.retry.provider_unavailable":"تعذّر فحص الوثيقة حاليًا. حاول مرة أخرى بعد قليل","poa.hint.blurry":"الصورة غير واضحة","poa.hint.cropped":"جزء من الوثيقة مقطوع","poa.hint.glare":"يوجد انعكاس ضوء على الوثيقة","reasons.provider_unavailable":"تعذّر فحص الوثيقة حاليًا","reasons.pdf_protected":"ملف PDF محمي بكلمة مرور أو يحتوي على محتوى نشط","reasons.document_kind_not_accepted":"نوع الوثيقة غير مقبول","reasons.document_date_invalid":"تاريخ الوثيقة في المستقبل","reasons.document_too_old":"الوثيقة قديمة جدًا","reasons.document_tampered":"يبدو أن الوثيقة قد عُدّلت","reasons.holder_letter_required":"يلزم تقديم رسالة من صاحب الفاتورة","reasons.holder_letter_missing":"رسالة صاحب الفاتورة مفقودة أو غير مكتملة","reasons.address_mismatch":"العنوان لا يطابق العنوان المقدَّم"},U={"poa.title":"Proof of address","poa.lead":"Upload a recent document that shows your name and your current address.","poa.accepted":"Accepted documents","poa.acceptedFor":"Accepted for {country}","poa.kindDated":"{kind}, dated within the last {days} days","poa.kinds.utility_bill":"Electricity, water or gas bill","poa.kinds.telecom_bill":"Phone or internet bill","poa.kinds.bank_statement":"Bank statement","poa.kinds.tax_notice":"Tax notice","poa.kinds.rental_agreement":"Rental agreement","poa.kinds.government_certificate":"Residence certificate","poa.kinds.insurance_statement":"Insurance statement","poa.source.camera":"Take a photo","poa.source.upload":"Upload a file","poa.source.lead":"A photo of the document, or a PDF or image from your device","poa.upload.hint":"PDF, JPEG or PNG, up to 3 pages and 10 MB","poa.upload.choose":"Choose a file","poa.upload.addPage":"Add a page","poa.upload.pages":"{count} of 3 pages","poa.upload.send":"Send document","poa.upload.sending":"Sending your document…","poa.upload.unsupported":"This file type is not accepted. Choose a PDF, JPEG or PNG","poa.upload.tooManyPages":"Send at most 3 pages. Remove a page or choose a shorter file","poa.upload.tooLarge":"The file is over 10 MB. Choose a smaller file","poa.upload.failed":"We could not send the document. Check your connection and try again","poa.camera.lead":"Lay the document flat and fill the frame. Take one photo per page","poa.camera.capture":"Take photo","poa.camera.retake":"Retake","poa.camera.next":"Next page","poa.camera.page":"Page {number}","poa.letter.title":"Letter from the bill holder","poa.letter.lead":"The document is in another person's name. Add a signed letter from that person saying that you live at this address","poa.letter.send":"Send letter","poa.licence.use":"Use the address on my driver's license","poa.licence.note":"We read this address from your license. You don't need another document.","poa.retry.document_too_old":"This document is older than allowed. Upload a more recent one from the list below","poa.retry.document_date_invalid":"The date on the document is in the future. Upload a document with today's date or earlier","poa.retry.document_kind_not_accepted":"This document type is not accepted. Upload one of the documents listed below","poa.retry.name_mismatch":"The name on the document does not match yours. Upload a document in your name","poa.retry.address_mismatch":"The address on the document does not match the one we were given. Upload a document for that address","poa.retry.holder_letter_missing":"The letter must be signed and name both you and the bill holder. Upload a complete letter","poa.retry.unreadable":"We could not read the document. Upload a sharper, complete copy","poa.retry.pdf_protected":"Remove the password from the PDF and try again","poa.retry.provider_unavailable":"The document could not be checked right now. Try again in a moment","poa.hint.blurry":"The image is blurry","poa.hint.cropped":"Part of the document is cut off","poa.hint.glare":"There is glare on the document","reasons.provider_unavailable":"The document could not be checked right now","reasons.pdf_protected":"The PDF is password-protected or contains active content","reasons.document_kind_not_accepted":"The document type is not accepted","reasons.document_date_invalid":"The document date is in the future","reasons.document_too_old":"The document is too old","reasons.document_tampered":"The document appears to have been edited","reasons.holder_letter_required":"A letter from the bill holder is needed","reasons.holder_letter_missing":"The letter from the bill holder is missing or incomplete","reasons.address_mismatch":"The address does not match the one supplied"},ae={"poa.title":"Justificatif de domicile","poa.lead":"Importez un document récent qui indique votre nom et votre adresse actuelle.","poa.accepted":"Documents acceptés","poa.acceptedFor":"Accepté pour {country}","poa.kindDated":"{kind}, daté des {days} derniers jours","poa.kinds.utility_bill":"Facture d'électricité, d'eau ou de gaz","poa.kinds.telecom_bill":"Facture de téléphone ou d'internet","poa.kinds.bank_statement":"Relevé bancaire","poa.kinds.tax_notice":"Avis d'imposition","poa.kinds.rental_agreement":"Bail ou quittance de loyer","poa.kinds.government_certificate":"Certificat de résidence","poa.kinds.insurance_statement":"Attestation d'assurance","poa.source.camera":"Prendre une photo","poa.source.upload":"Importer un fichier","poa.source.lead":"Une photo du document, ou un PDF ou une image depuis votre appareil","poa.upload.hint":"PDF, JPEG ou PNG, 3 pages et 10 Mo au maximum","poa.upload.choose":"Choisir un fichier","poa.upload.addPage":"Ajouter une page","poa.upload.pages":"{count} sur 3 pages","poa.upload.send":"Envoyer le document","poa.upload.sending":"Envoi de votre document…","poa.upload.unsupported":"Ce type de fichier n'est pas accepté. Choisissez un PDF, un JPEG ou un PNG","poa.upload.tooManyPages":"Envoyez 3 pages au maximum. Retirez une page ou choisissez un fichier plus court","poa.upload.tooLarge":"Le fichier dépasse 10 Mo. Choisissez un fichier plus léger","poa.upload.failed":"Nous n'avons pas pu envoyer le document. Vérifiez votre connexion et réessayez","poa.camera.lead":"Posez le document à plat et remplissez le cadre. Prenez une photo par page","poa.camera.capture":"Prendre la photo","poa.camera.retake":"Reprendre","poa.camera.next":"Page suivante","poa.camera.page":"Page {number}","poa.letter.title":"Lettre du titulaire de la facture","poa.letter.lead":"Le document est au nom d'une autre personne. Ajoutez une lettre signée de cette personne attestant que vous habitez à cette adresse","poa.letter.send":"Envoyer la lettre","poa.licence.use":"Utiliser l'adresse de mon permis de conduire","poa.licence.note":"Nous avons lu cette adresse sur votre permis. Vous n'avez pas besoin d'un autre document.","poa.retry.document_too_old":"Ce document est plus ancien que la limite. Importez un document plus récent parmi ceux de la liste ci-dessous","poa.retry.document_date_invalid":"La date du document est dans le futur. Importez un document daté d'aujourd'hui ou d'avant","poa.retry.document_kind_not_accepted":"Ce type de document n'est pas accepté. Importez l'un des documents de la liste ci-dessous","poa.retry.name_mismatch":"Le nom sur le document ne correspond pas au vôtre. Importez un document à votre nom","poa.retry.address_mismatch":"L'adresse du document ne correspond pas à celle qui nous a été transmise. Importez un document pour cette adresse","poa.retry.holder_letter_missing":"La lettre doit être signée et nommer à la fois vous et le titulaire de la facture. Importez une lettre complète","poa.retry.unreadable":"Nous n'avons pas pu lire le document. Importez une copie plus nette et complète","poa.retry.pdf_protected":"Retirez le mot de passe du PDF et réessayez","poa.retry.provider_unavailable":"Le document n'a pas pu être vérifié pour le moment. Réessayez dans un instant","poa.hint.blurry":"L'image est floue","poa.hint.cropped":"Une partie du document est coupée","poa.hint.glare":"Il y a un reflet sur le document","reasons.provider_unavailable":"Le document n'a pas pu être vérifié pour le moment","reasons.pdf_protected":"Le PDF est protégé par un mot de passe ou contient du contenu actif","reasons.document_kind_not_accepted":"Ce type de document n'est pas accepté","reasons.document_date_invalid":"La date du document est dans le futur","reasons.document_too_old":"Le document est trop ancien","reasons.document_tampered":"Le document semble avoir été modifié","reasons.holder_letter_required":"Une lettre du titulaire de la facture est nécessaire","reasons.holder_letter_missing":"La lettre du titulaire de la facture est absente ou incomplète","reasons.address_mismatch":"L'adresse ne correspond pas à celle qui a été transmise"};function B({blob:a,label:n}){let[e,r]=(0,f.useState)(void 0);return(0,f.useEffect)(()=>{if(typeof URL.createObjectURL!="function")return;let d=URL.createObjectURL(a);return r(d),()=>URL.revokeObjectURL(d)},[a]),(0,o.jsx)("img",{src:e,alt:n})}l(B,"Q");p(B,"PageThumb");function $({step:a,i18n:n,c:e,title:r,notice:d,intro:m,onUpload:i}){let y=(0,f.useRef)(null),s=(0,f.useRef)(null),[c,_]=(0,f.useState)([]),[h,P]=(0,f.useState)(!1),[L,C]=(0,f.useState)("idle"),[K,F]=(0,f.useState)(!1),A=p(u=>{P(!1),u.start().catch(()=>P(!0))},"open");(0,f.useEffect)(()=>{let u=y.current;if(u===null)return;let g;try{g=a.capturePage({video:u})}catch{P(!0);return}return s.current=g,A(g),()=>{g.destroy(),s.current=null}},[]);let E=c.length>=a.maxPages,Q=p(async()=>{let u=s.current;if(!(u===null||E)){C("taking"),F(!1);try{await u.takePage()}catch{}_([...u.pages]),C("idle")}},"take"),X=p(u=>{let g=s.current;g!==null&&(g.removePage(u),_([...g.pages]))},"retake"),Z=p(async()=>{let u=s.current;if(!(u===null||c.length===0)){C("sending"),F(!1);try{await u.submitPages()}catch{F(!0)}C("idle")}},"send"),T=L==="sending";return(0,o.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-poa-camera",children:[(0,o.jsx)(D,{title:r,lead:e("poa.camera.lead")}),d,K?(0,o.jsx)(b,{tone:"danger",children:(0,o.jsx)("span",{children:e("poa.upload.failed")})}):null,h?(0,o.jsxs)(b,{tone:"danger",children:[(0,o.jsx)("span",{children:e("doc.cameraBlocked")}),(0,o.jsx)("span",{children:e("doc.cameraBlockedHint")}),s.current!==null?(0,o.jsx)(k,{kind:"secondary",onClick:l(()=>s.current!==null&&A(s.current),"onClick"),children:e("doc.retryCamera")}):null]}):null,c.length===0?m:null,(0,o.jsx)("video",{ref:y,className:"sekyro-poa-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true"}),c.length>0?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{className:"sekyro-text-muted",role:"status",children:e("poa.upload.pages",{count:c.length})}),(0,o.jsx)("ul",{className:"sekyro-poa-pages",children:c.map((u,g)=>{let I=e("poa.camera.page",{number:g+1});return(0,o.jsxs)("li",{children:[(0,o.jsx)(B,{blob:u,label:I}),(0,o.jsx)(k,{kind:"ghost",onClick:l(()=>X(g),"onClick"),disabled:T,"aria-label":`${e("poa.camera.retake")} ${I}`,children:e("poa.camera.retake")})]},g)})})]}):null,T?(0,o.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:e("poa.upload.sending")}):null,(0,o.jsxs)(R,{children:[(0,o.jsxs)(k,{full:!0,kind:c.length>0?"secondary":"primary",onClick:l(()=>{Q()},"onClick"),disabled:E||h||L!=="idle"||a.attemptsExhausted,"aria-busy":L==="taking"||void 0,children:[(0,o.jsx)(N,{name:"camera"}),e("poa.camera.capture")]}),c.length>0?(0,o.jsx)(k,{full:!0,onClick:l(()=>{Z()},"onClick"),disabled:L!=="idle","aria-busy":T||void 0,children:e("poa.upload.send")}):null,i!==void 0?(0,o.jsx)(k,{full:!0,kind:"ghost",onClick:i,disabled:T,children:e("poa.source.upload")}):null]})]})}l($,"J");p($,"PageCamera");var te={en:U,fr:ae,ar:ee,es:U,pt:U,de:U},oe="image/jpeg,image/png,image/heic,image/heif,application/pdf";function V(a){let n=a.strings,e=te[a.locale];return(r,d)=>M(n[r]??e[r]??"",d)}l(V,"ae");p(V,"poaCopy");function z({step:a,i18n:n,c:e}){if(a.reason===void 0)return null;let r=e(`poa.retry.${a.reason}`)||e(`reasons.${a.reason}`)||e("poa.retry.unreadable");return(0,t.jsxs)(b,{tone:"warning",children:[(0,t.jsx)("span",{children:r}),(0,t.jsx)("span",{children:q(n,a.attemptsRemaining,a.attemptsExhausted)})]})}l(z,"U");p(z,"RetryNotice");function w({step:a,i18n:n,c:e}){let r=(0,v.useId)(),{country:d}=a.rule,m=d===null?e("poa.accepted"):e("poa.acceptedFor",{country:O(d,n.locale)});return(0,t.jsxs)("div",{className:"sekyro-poa-accepted",children:[(0,t.jsx)("p",{id:r,className:"sekyro-poa-accepted__title",children:m}),(0,t.jsx)("ul",{className:"sekyro-poa-list","aria-labelledby":r,children:a.rule.kinds.map(i=>(0,t.jsx)("li",{children:e("poa.kindDated",{kind:e(`poa.kinds.${i.kind}`)||i.kind,days:i.maxAgeDays})},i.kind))})]})}l(w,"j");p(w,"AcceptedList");var re={unsupported:"poa.upload.unsupported",tooMany:"poa.upload.tooManyPages",tooLarge:"poa.upload.tooLarge",failed:"poa.upload.failed"};function W(a){return a instanceof TypeError&&a.message==="unsupported_file"?"unsupported":a instanceof RangeError&&a.message==="file_too_large"?"tooLarge":a instanceof RangeError&&(a.message==="too_many_pages"||a.message==="no_pages")?"tooMany":"failed"}l(W,"re");p(W,"refusalOf");function H({step:a,i18n:n,c:e,letter:r,onCamera:d}){let m=(0,v.useRef)(null),[i,y]=(0,v.useState)("idle"),s=i==="sending",c=p(async _=>{let h=Array.from(_.currentTarget.files??[]);if(_.currentTarget.value="",h.length!==0){if(h.length>a.maxPages){y("tooMany");return}y("sending");try{await(r?a.uploadHolderLetter(h):a.uploadPages(h)),y("idle")}catch(P){y(W(P))}}},"onFiles");return(0,t.jsxs)("section",{className:"sekyro-step","data-testid":r?"sekyro-poa-letter":"sekyro-poa-upload",children:[(0,t.jsx)(D,{title:e(r?"poa.letter.title":"poa.title"),lead:e(r?"poa.letter.lead":"poa.lead")}),i==="idle"||s?(0,t.jsx)(z,{step:a,i18n:n,c:e}):null,i!=="idle"&&!s?(0,t.jsx)(b,{tone:"danger",children:(0,t.jsx)("span",{children:e(re[i])})}):null,r?null:(0,t.jsx)(w,{step:a,i18n:n,c:e}),(0,t.jsx)("p",{className:"sekyro-text-muted",children:e("poa.upload.hint")}),s?(0,t.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:e("poa.upload.sending")}):null,(0,t.jsx)("input",{ref:m,type:"file",accept:oe,multiple:!0,hidden:!0,"data-testid":"sekyro-poa-file","aria-label":e(r?"poa.letter.title":"poa.title"),onChange:l(_=>{c(_)},"onChange")}),(0,t.jsxs)(R,{children:[(0,t.jsx)(k,{full:!0,onClick:l(()=>m.current?.click(),"onClick"),disabled:s||!a.photo.uploadOffered||a.attemptsExhausted,"aria-busy":s||void 0,children:e("poa.upload.choose")}),d!==void 0?(0,t.jsxs)(k,{full:!0,kind:"ghost",onClick:d,disabled:s,children:[(0,t.jsx)(N,{name:a.photo.cameraOnPhone===!0?"smartphone":"camera"}),a.photo.cameraOnPhone===!0?e("capture.source.phone"):e("poa.source.camera")]}):null]})]})}l(H,"se");p(H,"UploadScreen");function Y({step:a,c:n}){let[e,r]=(0,v.useState)("idle"),d=a.useLicenceAddress;if(d===void 0)return null;let m=p(async()=>{r("sending");try{await d(),r("idle")}catch{r("failed")}},"onUse");return(0,t.jsxs)("div",{className:"sekyro-poa-licence","data-testid":"sekyro-poa-licence",children:[(0,t.jsx)("p",{className:"sekyro-text-muted",children:n("poa.licence.note")}),e==="failed"?(0,t.jsx)(b,{tone:"danger",children:(0,t.jsx)("span",{children:n("poa.upload.failed")})}):null,(0,t.jsx)(k,{full:!0,kind:"secondary",onClick:l(()=>{m()},"onClick"),disabled:e==="sending"||a.attemptsExhausted,"aria-busy":e==="sending"||void 0,children:n("poa.licence.use")})]})}l(Y,"de");p(Y,"LicenceShortcut");function ne({step:a,i18n:n}){let e=V(n),[r,d]=(0,v.useState)(null),m=a.phase==="holder_letter",i=a.photo.source,y=i==="choice"?r??a.photo.pick:i,s=a.photo.cameraOnPhone===!0,c=a.photo.uploadOffered?()=>d("upload"):void 0,_=e(m?"poa.letter.title":"poa.title"),h;return y===null?h=(0,t.jsx)(J,{testId:"sekyro-poa-source",title:_,lead:e("poa.source.lead"),cameraLabel:e(s?"capture.source.phone":"poa.source.camera"),uploadLabel:e("poa.source.upload"),onPhone:s,notice:(0,t.jsx)(z,{step:a,i18n:n,c:e}),onCamera:l(()=>d("camera"),"onCamera"),onUpload:l(()=>d("upload"),"onUpload")}):y==="camera"&&s?h=(0,t.jsx)(S,{i18n:n,lead:e("handoff.lead.poa"),refresh:a.refresh,actions:c!==void 0?(0,t.jsx)(k,{kind:"ghost",full:!0,onClick:c,children:e("poa.source.upload")}):null}):y==="camera"?h=(0,t.jsx)($,{step:a,i18n:n,c:e,title:_,notice:(0,t.jsx)(z,{step:a,i18n:n,c:e}),intro:m?null:(0,t.jsx)(w,{step:a,i18n:n,c:e}),...i==="choice"&&c!==void 0?{onUpload:c}:{}}):h=(0,t.jsx)(H,{step:a,i18n:n,c:e,letter:m,...i==="choice"?{onCamera:p(()=>d("camera"),"onCamera")}:{}}),(0,t.jsxs)(t.Fragment,{children:[m?null:(0,t.jsx)(Y,{step:a,c:e}),h]})}l(ne,"we");p(ne,"ProofOfAddressView");export{oe as POA_UPLOAD_ACCEPT,ne as ProofOfAddressView,V as poaCopy};
|
|
1
|
+
"use client";import{a as J}from"./chunk-HTIKUYTU.js";import{d as S}from"./chunk-LBEHJATK.js";import{a as O}from"./chunk-SIBJ56BG.js";import"./chunk-Y6MS7VVL.js";import{a as M}from"./chunk-ZWGMVZWP.js";import"./chunk-PWGUNXYH.js";import{K as b,L as q,a as j,b as G,c as k,v as N,w as D,y as R}from"./chunk-EB2QC3GA.js";import{a as p}from"./chunk-5QL6W6FW.js";import{a as l,c as x}from"./chunk-4FHWXBOB.js";var v=x(j(),1),f=x(j(),1),o=x(G(),1),t=x(G(),1);var ee={"poa.title":"إثبات العنوان","poa.lead":"ارفع وثيقة حديثة تُظهر اسمك وعنوانك الحالي.","poa.accepted":"الوثائق المقبولة","poa.acceptedFor":"مقبول في {country}","poa.kindDated":"{kind}، صادر خلال آخر {days} يومًا","poa.kinds.utility_bill":"فاتورة كهرباء أو ماء أو غاز","poa.kinds.telecom_bill":"فاتورة هاتف أو إنترنت","poa.kinds.bank_statement":"كشف حساب بنكي","poa.kinds.tax_notice":"إشعار ضريبي","poa.kinds.rental_agreement":"عقد إيجار","poa.kinds.government_certificate":"شهادة السكن","poa.kinds.insurance_statement":"وثيقة تأمين","poa.source.camera":"التقاط صورة","poa.source.upload":"رفع ملف","poa.source.lead":"صورة للوثيقة، أو ملف PDF أو صورة من جهازك","poa.upload.hint":"PDF أو JPEG أو PNG، بحد أقصى 3 صفحات و10 ميغابايت","poa.upload.choose":"اختيار ملف","poa.upload.addPage":"إضافة صفحة","poa.upload.pages":"{count} من 3 صفحات","poa.upload.send":"إرسال الوثيقة","poa.upload.sending":"جارٍ إرسال وثيقتك…","poa.upload.unsupported":"نوع الملف هذا غير مقبول. اختر ملف PDF أو JPEG أو PNG","poa.upload.tooManyPages":"أرسل 3 صفحات على الأكثر. احذف صفحة أو اختر ملفًا أقصر","poa.upload.tooLarge":"حجم الملف يتجاوز 10 ميغابايت. اختر ملفًا أصغر","poa.upload.failed":"تعذّر إرسال الوثيقة. تحقّق من اتصالك وحاول مرة أخرى","poa.camera.lead":"ضع الوثيقة بشكل مسطّح واملأ الإطار. التقط صورة واحدة لكل صفحة","poa.camera.capture":"التقاط الصورة","poa.camera.retake":"إعادة الالتقاط","poa.camera.next":"الصفحة التالية","poa.camera.page":"الصفحة {number}","poa.letter.title":"رسالة من صاحب الفاتورة","poa.letter.lead":"الوثيقة باسم شخص آخر. أضف رسالة موقّعة من هذا الشخص تفيد بأنك تسكن في هذا العنوان","poa.letter.send":"إرسال الرسالة","poa.licence.use":"استخدام العنوان المذكور في رخصة القيادة","poa.licence.note":"قرأنا هذا العنوان من رخصتك. لا تحتاج إلى وثيقة أخرى.","poa.retry.document_too_old":"هذه الوثيقة أقدم من المسموح. ارفع وثيقة أحدث من القائمة أدناه","poa.retry.document_date_invalid":"تاريخ الوثيقة في المستقبل. ارفع وثيقة بتاريخ اليوم أو قبله","poa.retry.document_kind_not_accepted":"نوع هذه الوثيقة غير مقبول. ارفع إحدى الوثائق المذكورة أدناه","poa.retry.name_mismatch":"الاسم في الوثيقة لا يطابق اسمك. ارفع وثيقة باسمك","poa.retry.address_mismatch":"العنوان في الوثيقة لا يطابق العنوان الذي وصلنا. ارفع وثيقة لهذا العنوان","poa.retry.holder_letter_missing":"يجب أن تكون الرسالة موقّعة وأن تذكر اسمك واسم صاحب الفاتورة. ارفع رسالة كاملة","poa.retry.unreadable":"تعذّرت قراءة الوثيقة. ارفع نسخة كاملة وأكثر وضوحًا","poa.retry.pdf_protected":"أزل كلمة المرور من ملف PDF وحاول مرة أخرى","poa.retry.provider_unavailable":"تعذّر فحص الوثيقة حاليًا. حاول مرة أخرى بعد قليل","poa.hint.blurry":"الصورة غير واضحة","poa.hint.cropped":"جزء من الوثيقة مقطوع","poa.hint.glare":"يوجد انعكاس ضوء على الوثيقة","reasons.provider_unavailable":"تعذّر فحص الوثيقة حاليًا","reasons.pdf_protected":"ملف PDF محمي بكلمة مرور أو يحتوي على محتوى نشط","reasons.document_kind_not_accepted":"نوع الوثيقة غير مقبول","reasons.document_date_invalid":"تاريخ الوثيقة في المستقبل","reasons.document_too_old":"الوثيقة قديمة جدًا","reasons.document_tampered":"يبدو أن الوثيقة قد عُدّلت","reasons.holder_letter_required":"يلزم تقديم رسالة من صاحب الفاتورة","reasons.holder_letter_missing":"رسالة صاحب الفاتورة مفقودة أو غير مكتملة","reasons.address_mismatch":"العنوان لا يطابق العنوان المقدَّم"},U={"poa.title":"Proof of address","poa.lead":"Upload a recent document that shows your name and your current address.","poa.accepted":"Accepted documents","poa.acceptedFor":"Accepted for {country}","poa.kindDated":"{kind}, dated within the last {days} days","poa.kinds.utility_bill":"Electricity, water or gas bill","poa.kinds.telecom_bill":"Phone or internet bill","poa.kinds.bank_statement":"Bank statement","poa.kinds.tax_notice":"Tax notice","poa.kinds.rental_agreement":"Rental agreement","poa.kinds.government_certificate":"Residence certificate","poa.kinds.insurance_statement":"Insurance statement","poa.source.camera":"Take a photo","poa.source.upload":"Upload a file","poa.source.lead":"A photo of the document, or a PDF or image from your device","poa.upload.hint":"PDF, JPEG or PNG, up to 3 pages and 10 MB","poa.upload.choose":"Choose a file","poa.upload.addPage":"Add a page","poa.upload.pages":"{count} of 3 pages","poa.upload.send":"Send document","poa.upload.sending":"Sending your document…","poa.upload.unsupported":"This file type is not accepted. Choose a PDF, JPEG or PNG","poa.upload.tooManyPages":"Send at most 3 pages. Remove a page or choose a shorter file","poa.upload.tooLarge":"The file is over 10 MB. Choose a smaller file","poa.upload.failed":"We could not send the document. Check your connection and try again","poa.camera.lead":"Lay the document flat and fill the frame. Take one photo per page","poa.camera.capture":"Take photo","poa.camera.retake":"Retake","poa.camera.next":"Next page","poa.camera.page":"Page {number}","poa.letter.title":"Letter from the bill holder","poa.letter.lead":"The document is in another person's name. Add a signed letter from that person saying that you live at this address","poa.letter.send":"Send letter","poa.licence.use":"Use the address on my driver's license","poa.licence.note":"We read this address from your license. You don't need another document.","poa.retry.document_too_old":"This document is older than allowed. Upload a more recent one from the list below","poa.retry.document_date_invalid":"The date on the document is in the future. Upload a document with today's date or earlier","poa.retry.document_kind_not_accepted":"This document type is not accepted. Upload one of the documents listed below","poa.retry.name_mismatch":"The name on the document does not match yours. Upload a document in your name","poa.retry.address_mismatch":"The address on the document does not match the one we were given. Upload a document for that address","poa.retry.holder_letter_missing":"The letter must be signed and name both you and the bill holder. Upload a complete letter","poa.retry.unreadable":"We could not read the document. Upload a sharper, complete copy","poa.retry.pdf_protected":"Remove the password from the PDF and try again","poa.retry.provider_unavailable":"The document could not be checked right now. Try again in a moment","poa.hint.blurry":"The image is blurry","poa.hint.cropped":"Part of the document is cut off","poa.hint.glare":"There is glare on the document","reasons.provider_unavailable":"The document could not be checked right now","reasons.pdf_protected":"The PDF is password-protected or contains active content","reasons.document_kind_not_accepted":"The document type is not accepted","reasons.document_date_invalid":"The document date is in the future","reasons.document_too_old":"The document is too old","reasons.document_tampered":"The document appears to have been edited","reasons.holder_letter_required":"A letter from the bill holder is needed","reasons.holder_letter_missing":"The letter from the bill holder is missing or incomplete","reasons.address_mismatch":"The address does not match the one supplied"},ae={"poa.title":"Justificatif de domicile","poa.lead":"Importez un document récent qui indique votre nom et votre adresse actuelle.","poa.accepted":"Documents acceptés","poa.acceptedFor":"Accepté pour {country}","poa.kindDated":"{kind}, daté des {days} derniers jours","poa.kinds.utility_bill":"Facture d'électricité, d'eau ou de gaz","poa.kinds.telecom_bill":"Facture de téléphone ou d'internet","poa.kinds.bank_statement":"Relevé bancaire","poa.kinds.tax_notice":"Avis d'imposition","poa.kinds.rental_agreement":"Bail ou quittance de loyer","poa.kinds.government_certificate":"Certificat de résidence","poa.kinds.insurance_statement":"Attestation d'assurance","poa.source.camera":"Prendre une photo","poa.source.upload":"Importer un fichier","poa.source.lead":"Une photo du document, ou un PDF ou une image depuis votre appareil","poa.upload.hint":"PDF, JPEG ou PNG, 3 pages et 10 Mo au maximum","poa.upload.choose":"Choisir un fichier","poa.upload.addPage":"Ajouter une page","poa.upload.pages":"{count} sur 3 pages","poa.upload.send":"Envoyer le document","poa.upload.sending":"Envoi de votre document…","poa.upload.unsupported":"Ce type de fichier n'est pas accepté. Choisissez un PDF, un JPEG ou un PNG","poa.upload.tooManyPages":"Envoyez 3 pages au maximum. Retirez une page ou choisissez un fichier plus court","poa.upload.tooLarge":"Le fichier dépasse 10 Mo. Choisissez un fichier plus léger","poa.upload.failed":"Nous n'avons pas pu envoyer le document. Vérifiez votre connexion et réessayez","poa.camera.lead":"Posez le document à plat et remplissez le cadre. Prenez une photo par page","poa.camera.capture":"Prendre la photo","poa.camera.retake":"Reprendre","poa.camera.next":"Page suivante","poa.camera.page":"Page {number}","poa.letter.title":"Lettre du titulaire de la facture","poa.letter.lead":"Le document est au nom d'une autre personne. Ajoutez une lettre signée de cette personne attestant que vous habitez à cette adresse","poa.letter.send":"Envoyer la lettre","poa.licence.use":"Utiliser l'adresse de mon permis de conduire","poa.licence.note":"Nous avons lu cette adresse sur votre permis. Vous n'avez pas besoin d'un autre document.","poa.retry.document_too_old":"Ce document est plus ancien que la limite. Importez un document plus récent parmi ceux de la liste ci-dessous","poa.retry.document_date_invalid":"La date du document est dans le futur. Importez un document daté d'aujourd'hui ou d'avant","poa.retry.document_kind_not_accepted":"Ce type de document n'est pas accepté. Importez l'un des documents de la liste ci-dessous","poa.retry.name_mismatch":"Le nom sur le document ne correspond pas au vôtre. Importez un document à votre nom","poa.retry.address_mismatch":"L'adresse du document ne correspond pas à celle qui nous a été transmise. Importez un document pour cette adresse","poa.retry.holder_letter_missing":"La lettre doit être signée et nommer à la fois vous et le titulaire de la facture. Importez une lettre complète","poa.retry.unreadable":"Nous n'avons pas pu lire le document. Importez une copie plus nette et complète","poa.retry.pdf_protected":"Retirez le mot de passe du PDF et réessayez","poa.retry.provider_unavailable":"Le document n'a pas pu être vérifié pour le moment. Réessayez dans un instant","poa.hint.blurry":"L'image est floue","poa.hint.cropped":"Une partie du document est coupée","poa.hint.glare":"Il y a un reflet sur le document","reasons.provider_unavailable":"Le document n'a pas pu être vérifié pour le moment","reasons.pdf_protected":"Le PDF est protégé par un mot de passe ou contient du contenu actif","reasons.document_kind_not_accepted":"Ce type de document n'est pas accepté","reasons.document_date_invalid":"La date du document est dans le futur","reasons.document_too_old":"Le document est trop ancien","reasons.document_tampered":"Le document semble avoir été modifié","reasons.holder_letter_required":"Une lettre du titulaire de la facture est nécessaire","reasons.holder_letter_missing":"La lettre du titulaire de la facture est absente ou incomplète","reasons.address_mismatch":"L'adresse ne correspond pas à celle qui a été transmise"};function B({blob:a,label:n}){let[e,r]=(0,f.useState)(void 0);return(0,f.useEffect)(()=>{if(typeof URL.createObjectURL!="function")return;let d=URL.createObjectURL(a);return r(d),()=>URL.revokeObjectURL(d)},[a]),(0,o.jsx)("img",{src:e,alt:n})}l(B,"Q");p(B,"PageThumb");function $({step:a,i18n:n,c:e,title:r,notice:d,intro:m,onUpload:i}){let y=(0,f.useRef)(null),s=(0,f.useRef)(null),[c,_]=(0,f.useState)([]),[h,P]=(0,f.useState)(!1),[L,C]=(0,f.useState)("idle"),[K,F]=(0,f.useState)(!1),A=p(u=>{P(!1),u.start().catch(()=>P(!0))},"open");(0,f.useEffect)(()=>{let u=y.current;if(u===null)return;let g;try{g=a.capturePage({video:u})}catch{P(!0);return}return s.current=g,A(g),()=>{g.destroy(),s.current=null}},[]);let E=c.length>=a.maxPages,Q=p(async()=>{let u=s.current;if(!(u===null||E)){C("taking"),F(!1);try{await u.takePage()}catch{}_([...u.pages]),C("idle")}},"take"),X=p(u=>{let g=s.current;g!==null&&(g.removePage(u),_([...g.pages]))},"retake"),Z=p(async()=>{let u=s.current;if(!(u===null||c.length===0)){C("sending"),F(!1);try{await u.submitPages()}catch{F(!0)}C("idle")}},"send"),T=L==="sending";return(0,o.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-poa-camera",children:[(0,o.jsx)(D,{title:r,lead:e("poa.camera.lead")}),d,K?(0,o.jsx)(b,{tone:"danger",children:(0,o.jsx)("span",{children:e("poa.upload.failed")})}):null,h?(0,o.jsxs)(b,{tone:"danger",children:[(0,o.jsx)("span",{children:e("doc.cameraBlocked")}),(0,o.jsx)("span",{children:e("doc.cameraBlockedHint")}),s.current!==null?(0,o.jsx)(k,{kind:"secondary",onClick:l(()=>s.current!==null&&A(s.current),"onClick"),children:e("doc.retryCamera")}):null]}):null,c.length===0?m:null,(0,o.jsx)("video",{ref:y,className:"sekyro-poa-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true"}),c.length>0?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{className:"sekyro-text-muted",role:"status",children:e("poa.upload.pages",{count:c.length})}),(0,o.jsx)("ul",{className:"sekyro-poa-pages",children:c.map((u,g)=>{let I=e("poa.camera.page",{number:g+1});return(0,o.jsxs)("li",{children:[(0,o.jsx)(B,{blob:u,label:I}),(0,o.jsx)(k,{kind:"ghost",onClick:l(()=>X(g),"onClick"),disabled:T,"aria-label":`${e("poa.camera.retake")} ${I}`,children:e("poa.camera.retake")})]},g)})})]}):null,T?(0,o.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:e("poa.upload.sending")}):null,(0,o.jsxs)(R,{children:[(0,o.jsxs)(k,{full:!0,kind:c.length>0?"secondary":"primary",onClick:l(()=>{Q()},"onClick"),disabled:E||h||L!=="idle"||a.attemptsExhausted,"aria-busy":L==="taking"||void 0,children:[(0,o.jsx)(N,{name:"camera"}),e("poa.camera.capture")]}),c.length>0?(0,o.jsx)(k,{full:!0,onClick:l(()=>{Z()},"onClick"),disabled:L!=="idle","aria-busy":T||void 0,children:e("poa.upload.send")}):null,i!==void 0?(0,o.jsx)(k,{full:!0,kind:"ghost",onClick:i,disabled:T,children:e("poa.source.upload")}):null]})]})}l($,"J");p($,"PageCamera");var te={en:U,fr:ae,ar:ee,es:U,pt:U,de:U},oe="image/jpeg,image/png,image/heic,image/heif,application/pdf";function V(a){let n=a.strings,e=te[a.locale];return(r,d)=>M(n[r]??e[r]??"",d)}l(V,"ae");p(V,"poaCopy");function z({step:a,i18n:n,c:e}){if(a.reason===void 0)return null;let r=e(`poa.retry.${a.reason}`)||e(`reasons.${a.reason}`)||e("poa.retry.unreadable");return(0,t.jsxs)(b,{tone:"warning",children:[(0,t.jsx)("span",{children:r}),(0,t.jsx)("span",{children:q(n,a.attemptsRemaining,a.attemptsExhausted)})]})}l(z,"U");p(z,"RetryNotice");function w({step:a,i18n:n,c:e}){let r=(0,v.useId)(),{country:d}=a.rule,m=d===null?e("poa.accepted"):e("poa.acceptedFor",{country:O(d,n.locale)});return(0,t.jsxs)("div",{className:"sekyro-poa-accepted",children:[(0,t.jsx)("p",{id:r,className:"sekyro-poa-accepted__title",children:m}),(0,t.jsx)("ul",{className:"sekyro-poa-list","aria-labelledby":r,children:a.rule.kinds.map(i=>(0,t.jsx)("li",{children:e("poa.kindDated",{kind:e(`poa.kinds.${i.kind}`)||i.kind,days:i.maxAgeDays})},i.kind))})]})}l(w,"j");p(w,"AcceptedList");var re={unsupported:"poa.upload.unsupported",tooMany:"poa.upload.tooManyPages",tooLarge:"poa.upload.tooLarge",failed:"poa.upload.failed"};function W(a){return a instanceof TypeError&&a.message==="unsupported_file"?"unsupported":a instanceof RangeError&&a.message==="file_too_large"?"tooLarge":a instanceof RangeError&&(a.message==="too_many_pages"||a.message==="no_pages")?"tooMany":"failed"}l(W,"re");p(W,"refusalOf");function H({step:a,i18n:n,c:e,letter:r,onCamera:d}){let m=(0,v.useRef)(null),[i,y]=(0,v.useState)("idle"),s=i==="sending",c=p(async _=>{let h=Array.from(_.currentTarget.files??[]);if(_.currentTarget.value="",h.length!==0){if(h.length>a.maxPages){y("tooMany");return}y("sending");try{await(r?a.uploadHolderLetter(h):a.uploadPages(h)),y("idle")}catch(P){y(W(P))}}},"onFiles");return(0,t.jsxs)("section",{className:"sekyro-step","data-testid":r?"sekyro-poa-letter":"sekyro-poa-upload",children:[(0,t.jsx)(D,{title:e(r?"poa.letter.title":"poa.title"),lead:e(r?"poa.letter.lead":"poa.lead")}),i==="idle"||s?(0,t.jsx)(z,{step:a,i18n:n,c:e}):null,i!=="idle"&&!s?(0,t.jsx)(b,{tone:"danger",children:(0,t.jsx)("span",{children:e(re[i])})}):null,r?null:(0,t.jsx)(w,{step:a,i18n:n,c:e}),(0,t.jsx)("p",{className:"sekyro-text-muted",children:e("poa.upload.hint")}),s?(0,t.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:e("poa.upload.sending")}):null,(0,t.jsx)("input",{ref:m,type:"file",accept:oe,multiple:!0,hidden:!0,"data-testid":"sekyro-poa-file","aria-label":e(r?"poa.letter.title":"poa.title"),onChange:l(_=>{c(_)},"onChange")}),(0,t.jsxs)(R,{children:[(0,t.jsx)(k,{full:!0,onClick:l(()=>m.current?.click(),"onClick"),disabled:s||!a.photo.uploadOffered||a.attemptsExhausted,"aria-busy":s||void 0,children:e("poa.upload.choose")}),d!==void 0?(0,t.jsxs)(k,{full:!0,kind:"ghost",onClick:d,disabled:s,children:[(0,t.jsx)(N,{name:a.photo.cameraOnPhone===!0?"smartphone":"camera"}),a.photo.cameraOnPhone===!0?e("capture.source.phone"):e("poa.source.camera")]}):null]})]})}l(H,"se");p(H,"UploadScreen");function Y({step:a,c:n}){let[e,r]=(0,v.useState)("idle"),d=a.useLicenceAddress;if(d===void 0)return null;let m=p(async()=>{r("sending");try{await d(),r("idle")}catch{r("failed")}},"onUse");return(0,t.jsxs)("div",{className:"sekyro-poa-licence","data-testid":"sekyro-poa-licence",children:[(0,t.jsx)("p",{className:"sekyro-text-muted",children:n("poa.licence.note")}),e==="failed"?(0,t.jsx)(b,{tone:"danger",children:(0,t.jsx)("span",{children:n("poa.upload.failed")})}):null,(0,t.jsx)(k,{full:!0,kind:"secondary",onClick:l(()=>{m()},"onClick"),disabled:e==="sending"||a.attemptsExhausted,"aria-busy":e==="sending"||void 0,children:n("poa.licence.use")})]})}l(Y,"de");p(Y,"LicenceShortcut");function ne({step:a,i18n:n}){let e=V(n),[r,d]=(0,v.useState)(null),m=a.phase==="holder_letter",i=a.photo.source,y=i==="choice"?r??a.photo.pick:i,s=a.photo.cameraOnPhone===!0,c=a.photo.uploadOffered?()=>d("upload"):void 0,_=e(m?"poa.letter.title":"poa.title"),h;return y===null?h=(0,t.jsx)(J,{testId:"sekyro-poa-source",title:_,lead:e("poa.source.lead"),cameraLabel:e(s?"capture.source.phone":"poa.source.camera"),uploadLabel:e("poa.source.upload"),onPhone:s,notice:(0,t.jsx)(z,{step:a,i18n:n,c:e}),onCamera:l(()=>d("camera"),"onCamera"),onUpload:l(()=>d("upload"),"onUpload")}):y==="camera"&&s?h=(0,t.jsx)(S,{i18n:n,lead:e("handoff.lead.poa"),refresh:a.refresh,actions:c!==void 0?(0,t.jsx)(k,{kind:"ghost",full:!0,onClick:c,children:e("poa.source.upload")}):null}):y==="camera"?h=(0,t.jsx)($,{step:a,i18n:n,c:e,title:_,notice:(0,t.jsx)(z,{step:a,i18n:n,c:e}),intro:m?null:(0,t.jsx)(w,{step:a,i18n:n,c:e}),...i==="choice"&&c!==void 0?{onUpload:c}:{}}):h=(0,t.jsx)(H,{step:a,i18n:n,c:e,letter:m,...i==="choice"?{onCamera:p(()=>d("camera"),"onCamera")}:{}}),(0,t.jsxs)(t.Fragment,{children:[m?null:(0,t.jsx)(Y,{step:a,c:e}),h]})}l(ne,"we");p(ne,"ProofOfAddressView");export{oe as POA_UPLOAD_ACCEPT,ne as ProofOfAddressView,V as poaCopy};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as o}from"./chunk-4FHWXBOB.js";function f(a){let n="message",s=[];for(let t of a.split(`
|
|
2
|
+
`)){if(t===""||t.startsWith(":"))continue;let i=t.indexOf(":"),r=i===-1?t:t.slice(0,i),l=i===-1?"":t.slice(i+1);l.startsWith(" ")&&(l=l.slice(1)),r==="event"?n=l:r==="data"&&s.push(l)}if(s.length===0)return null;let e;try{e=JSON.parse(s.join(`
|
|
3
|
+
`))}catch{return null}if(n==="view"&&typeof e=="object"&&e!==null)return{type:"view",view:e};if(n==="replaced")return{type:"replaced"};if(n==="closed"){let t=e?.reason;return{type:"closed",reason:typeof t=="string"?t:"reconnect"}}return null}o(f,"c");async function*d(a){let n=a.getReader(),s=new TextDecoder,e="";try{for(;;){let{value:t,done:i}=await n.read();if(i)break;e+=s.decode(t,{stream:!0}).replace(/\r\n?/g,`
|
|
4
|
+
`);let r=e.indexOf(`
|
|
5
|
+
|
|
6
|
+
`);for(;r!==-1;){let l=e.slice(0,r);e=e.slice(r+2);let c=f(l);c!==null&&(yield c),r=e.indexOf(`
|
|
7
|
+
|
|
8
|
+
`)}}}finally{n.releaseLock()}}o(d,"d");export{f as parseSessionEvent,d as readSessionEvents};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"./chunk-4FHWXBOB.js";var w=[5e3,15e3,3e4],T=[1e3,3e3],S=12e4;function _(e){let t="stopped",n=null,y=null,p=0,b=i(()=>e.hidden?.()===!0,"v"),a=i(()=>{t="stopped",n?.abort(),n=null,y?.(),y=null},"r"),g=i(async(l,c,A)=>{let r=i(()=>!l.aborted&&c===p,"o");if(A)try{let d=await e.read();if(!r())return;if(e.apply(d),e.isTerminal(d))return a()}catch{}let o=0,m=0,h=0;for(;r();){if(t!=="polling"||e.now()>=h){t="stream";let s=!1,u=null;try{for await(let f of e.events(l)){if(!r())return;if(s=!0,o=0,m=0,f.type==="view"){if(e.apply(f.view),e.isTerminal(f.view))return a()}else{u=f;break}}}catch{if(!r())return}if(u?.type==="closed"&&u.reason!=="reconnect")return a();if(u?.type==="replaced")t="polling",h=Number.POSITIVE_INFINITY;else{if(u?.type==="closed")continue;if(o=s?1:o+1,o<=T.length){await e.sleep(T[o-1],l).catch(()=>{});continue}t="polling",h=e.now()+S}}let d=w[Math.min(m,w.length-1)];if(m+=1,await e.sleep(d,l).catch(()=>{}),!r())return;try{let s=await e.read();if(!r())return;if(e.apply(s),e.isTerminal(s))return a()}catch{}}},"w"),v=i(l=>{if(n?.abort(),b()){t="paused",n=null;return}let c=new AbortController;n=c,p+=1,t="stream",g(c.signal,p,l)},"y");return{start:i(()=>{t==="stopped"&&(y=e.onVisibility?.(()=>{t!=="stopped"&&(b()?(n?.abort(),n=null,p+=1,t="paused"):t==="paused"&&v(!0))})??null,v(!1))},"start"),stop:a,mode:i(()=>t,"mode")}}i(_,"A");var E={hidden:i(()=>typeof document<"u"&&document.visibilityState==="hidden","hidden"),onVisibility:i(e=>typeof document>"u"?()=>{}:(document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)),"onVisibility")};export{w as WATCH_FALLBACK_MS,T as WATCH_REOPEN_MS,S as WATCH_STREAM_RETRY_MS,_ as createSessionWatch,E as documentVisibility};
|
package/dist/cdn/define.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"./chunks/chunk-
|
|
1
|
+
import{g as e}from"./chunks/chunk-PRZX4CTP.js";import"./chunks/chunk-XVHJIXFH.js";import"./chunks/chunk-4MHDMYKP.js";import"./chunks/chunk-5AGMJYMI.js";import"./chunks/chunk-SYUAQ7BF.js";import"./chunks/chunk-7V3YMJPI.js";import"./chunks/chunk-AKU6DWJM.js";import"./chunks/chunk-7UCVVWRT.js";import"./chunks/chunk-LBEHJATK.js";import"./chunks/chunk-SIBJ56BG.js";import"./chunks/chunk-DO66BOHU.js";import"./chunks/chunk-Y6MS7VVL.js";import"./chunks/chunk-6T7VBPLY.js";import"./chunks/chunk-ZWGMVZWP.js";import"./chunks/chunk-PWGUNXYH.js";import"./chunks/chunk-EB2QC3GA.js";import"./chunks/chunk-5QL6W6FW.js";import"./chunks/chunk-44UA2IDQ.js";import"./chunks/chunk-5OPKZZON.js";import"./chunks/chunk-EGCT7K5E.js";import"./chunks/chunk-P7K7ELYZ.js";import"./chunks/chunk-6MYG4HWP.js";import"./chunks/chunk-JS2IXPNL.js";import"./chunks/chunk-SLLJX5QK.js";import"./chunks/chunk-4FHWXBOB.js";e();export{e as defineSekyroElements};
|
package/dist/cdn/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as r,c as t,d as o,e as i,f as a,g as f}from"./chunks/chunk-
|
|
1
|
+
import{a as e,b as r,c as t,d as o,e as i,f as a,g as f}from"./chunks/chunk-PRZX4CTP.js";import"./chunks/chunk-XVHJIXFH.js";import"./chunks/chunk-4MHDMYKP.js";import"./chunks/chunk-5AGMJYMI.js";import"./chunks/chunk-SYUAQ7BF.js";import"./chunks/chunk-7V3YMJPI.js";import"./chunks/chunk-AKU6DWJM.js";import"./chunks/chunk-7UCVVWRT.js";import"./chunks/chunk-LBEHJATK.js";import"./chunks/chunk-SIBJ56BG.js";import"./chunks/chunk-DO66BOHU.js";import"./chunks/chunk-Y6MS7VVL.js";import{a as n}from"./chunks/chunk-6T7VBPLY.js";import"./chunks/chunk-ZWGMVZWP.js";import"./chunks/chunk-PWGUNXYH.js";import"./chunks/chunk-EB2QC3GA.js";import"./chunks/chunk-5QL6W6FW.js";import"./chunks/chunk-44UA2IDQ.js";import"./chunks/chunk-5OPKZZON.js";import"./chunks/chunk-EGCT7K5E.js";import"./chunks/chunk-P7K7ELYZ.js";import"./chunks/chunk-6MYG4HWP.js";import"./chunks/chunk-JS2IXPNL.js";import"./chunks/chunk-SLLJX5QK.js";import"./chunks/chunk-4FHWXBOB.js";export{r as ATTRIBUTES,i as EVENTS,t as PROPERTIES,o as SLOTS,a as SekyroVerificationElement,e as TAG_NAME,n as createVerification,f as defineSekyroElements};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b,c as t,v as s,w as i,y as l}from"./chunk-
|
|
1
|
+
import{b,c as t,v as s,w as i,y as l}from"./chunk-BA2AJKJM.js";import{a as o,c as k,i as r}from"./chunk-SSU37LFQ.js";var a=k(b(),1);function x({title:n,lead:d,cameraLabel:c,uploadLabel:m,notice:p,testId:e,onCamera:h,onUpload:u,onPhone:f=!1}){return(0,a.jsxs)("section",{className:"sekyro-step","data-testid":e,children:[(0,a.jsx)(i,{title:n,lead:d}),p,(0,a.jsxs)(l,{children:[(0,a.jsxs)(t,{full:!0,onClick:h,"data-testid":`${e}-camera`,children:[(0,a.jsx)(s,{name:f?"smartphone":"camera"}),c]}),(0,a.jsx)(t,{full:!0,kind:"ghost",onClick:u,"data-testid":`${e}-upload`,children:m})]})]})}o(x,"k");r(x,"PhotoSourceView");export{x as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as Cr,d as _r}from"./chunk-QEDULGVW.js";import{b as Sr,c as xt}from"./chunk-CMJWPBX6.js";import{a as xr}from"./chunk-XXCBLQ53.js";import{c as at}from"./chunk-JGYTOIH7.js";import{a as vr,b as kr,c as br,d as Le}from"./chunk-YHNEYMR2.js";import{F as wr,K as wt,L as St,a as Z,b as de,c as J,m as fr,n as $e,p as mr,q as nt,r as yr,s as gr,t as Ct,u as le,v as me,w as De,y as _t}from"./chunk-BA2AJKJM.js";import{a as l,c as T,i as a}from"./chunk-SSU37LFQ.js";var Nr=T(Z(),1),g=T(de(),1),ne=T(de(),1),ve=T(Z(),1),G=T(de(),1),_=T(Z(),1),y=T(Z(),1),ot=T(Z(),1),ye=T(de(),1),Qr=T(Z(),1),ee=T(Z(),1),ct=T(Z(),1),Se=T(de(),1),xe=T(de(),1),P=T(de(),1),ut=T(Z(),1),pe=T(Z(),1),Y=T(Z(),1),E=T(Z(),1),ge=T(Z(),1),He=T(Z(),1),Et=T(de(),1),k=T(de(),1);import{subscribeCameraPermission as $n}from"@sekyro/web";import{getLivenessAssetsStatus as Dn,preloadLivenessAssets as Gn,subscribeLivenessAssets as Kn}from"@sekyro/web";import{createLivenessCapture as Zn}from"@sekyro/web";function ce({className:e,children:t}){return(0,g.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})}l(ce,"ne");a(ce,"Svg");var It="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 Mr(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,g.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"})]})}l(Mr,"pn");a(Mr,"SunIcon");function Ar(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,g.jsx)("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}l(Ar,"fn");a(Ar,"FaceUncoveredIcon");function Lr(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),(0,g.jsx)("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),(0,g.jsx)("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}l(Lr,"mn");a(Lr,"PhoneEyeLevelIcon");function Er(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.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,g.jsx)("circle",{cx:"12",cy:"12",r:"2.8"})]})}l(Er,"yn");a(Er,"LookStraightIcon");function Ir(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("path",{d:It}),(0,g.jsx)("path",{d:"M9 13l2 2 4-4"})]})}l(Ir,"gn");a(Ir,"CameraCheckIcon");function Ur(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("path",{d:It}),(0,g.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"})]})}l(Ur,"hn");a(Ur,"CameraAskIcon");function jr(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("path",{d:It}),(0,g.jsx)("path",{d:"M3 3l18 18"})]})}l(jr,"vn");a(jr,"CameraBlockedIcon");function it({off:e,className:t}){return(0,g.jsxs)(ce,{className:t,children:[(0,g.jsx)("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?(0,g.jsx)("path",{d:"M4 4l16 16"}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),(0,g.jsx)("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}l(it,"Ve");a(it,"SpeakerIcon");function Tr(e){return(0,g.jsx)(ce,{...e,children:(0,g.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}l(Tr,"Cn");a(Tr,"CheckIcon");function Hr(e){return(0,g.jsxs)(ce,{className:e.className??"sekyro-spinner",children:[(0,g.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),(0,g.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}l(Hr,"kn");a(Hr,"SpinnerIcon");var Rt=["light","uncover","eyeLevel","straight"],jn={light:{key:"capture.tips.light",icon:a(()=>(0,ne.jsx)(Mr,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:a(()=>(0,ne.jsx)(Ar,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:a(()=>(0,ne.jsx)(Lr,{}),"icon")},straight:{key:"capture.tips.straight",icon:a(()=>(0,ne.jsx)(Er,{}),"icon")}};function Or({tips:e}){let t=Le(),n=(0,Nr.useId)();return e.length===0?null:(0,ne.jsxs)("section",{className:"sekyro-tips","aria-labelledby":n,"data-testid":"sekyro-tips",children:[(0,ne.jsx)("p",{className:"sekyro-tips__title",id:n,children:t("capture.tips.title")}),(0,ne.jsx)("ul",{className:"sekyro-tips__list",children:e.map(r=>{let s=typeof r=="string"?jn[r]:void 0,i=typeof r=="string"?r:r.id,c=s!==void 0?s.icon():typeof r=="string"?void 0:r.icon,p=s!==void 0?t(s.key):typeof r=="string"?r:r.text;return(0,ne.jsxs)("li",{className:"sekyro-tips__item",children:[c!=null?(0,ne.jsx)("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:c}):null,(0,ne.jsx)("span",{children:p})]},i)})})]})}l(Or,"Sn");a(Or,"TipList");var Tn=220;function Pr({title:e,description:t,options:n,busy:r,error:s,focus:i,testId:c,look:p="cards",marked:w,onChoose:h}){let m=(0,ve.useId)(),R=Ct(),[x,U]=(0,ve.useState)(null),M=(0,ve.useRef)(null);(0,ve.useEffect)(()=>{s!==null&&U(null)},[s]),(0,ve.useEffect)(()=>()=>{M.current!==null&&clearTimeout(M.current)},[]);let B=a(A=>{r||x!==null||(U(A),M.current=setTimeout(()=>{M.current=null,U(null),h(A)},Tn))},"choose");return(0,G.jsxs)("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":m,"data-testid":c,children:[(0,G.jsxs)("div",{className:p==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[(0,G.jsx)("h2",{id:m,ref:i?R:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?(0,G.jsx)("p",{className:"sekyro-text-muted",children:t}):null]}),s!==null?(0,G.jsx)(le,{tone:"danger",children:(0,G.jsx)("span",{children:s})}):null,p==="buttons"?(0,G.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:n.map((A,te)=>(0,G.jsx)(J,{kind:te===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:l(()=>h(A.id),"onClick"),children:A.label},A.id))}):(0,G.jsx)("div",{className:"sekyro-choices",children:n.map(A=>(0,G.jsxs)("button",{type:"button",className:"sekyro-card","aria-pressed":(x??w)===A.id,"aria-busy":r||void 0,disabled:r||x!==null&&x!==A.id,onClick:l(()=>B(A.id),"onClick"),children:[A.glyph!==void 0?(0,G.jsx)("span",{className:"sekyro-card__tile",children:A.glyph}):null,(0,G.jsxs)("span",{className:"sekyro-card__body",children:[(0,G.jsx)("span",{className:"sekyro-card__title",children:A.label}),A.sub!==void 0?(0,G.jsx)("span",{className:"sekyro-card__sub",children:A.sub}):null]}),(0,G.jsx)("span",{className:"sekyro-radio","aria-hidden":"true"})]},A.id))})]})}l(Pr,"Vn");a(Pr,"ChoiceScreen");var Br=["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 lt(e){return e!==null&&Br.includes(e)}l(lt,"he");a(lt,"isVoiceKey");var Hn=a((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 s=e[n];r=s!=null&&Hn(s,t)?s[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}l(je,"we");a(je,"resolveClip");var On="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",Pn={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function oe(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}l(oe,"re");a(oe,"synth");function qr(){return oe()!==null&&typeof SpeechSynthesisUtterance=="function"}l(qr,"Ir");a(qr,"speechAvailable");function Nt(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}l(Nt,"wn");a(Nt,"baseLang");function Ut(e,t){let n=a(s=>s.replace(/_/g,"-").toLowerCase(),"norm"),r=Nt(t);return e.find(s=>n(s.lang)===n(t))??e.find(s=>Nt(s.lang)===r)}l(Ut,"_n");a(Ut,"pickVoice");function Vr(e){if(!qr())return!1;let t=[];try{t=oe()?.getVoices()??[]}catch{return!0}return t.length===0||Ut(t,e)!==void 0}l(Vr,"In");a(Vr,"speechUsable");function Fr(e){let t=oe();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}l(Fr,"xn");a(Fr,"subscribeVoices");function Ke(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}`}}l(Ke,"He");a(Ke,"clipIdentity");function Mt(e){e.pause(),e.removeAttribute("src"),e.load()}l(Mt,"Mn");a(Mt,"release");function $r(){let e=null,t=null,n=0,r=null,s=null,i=null,c=!1,p=null,w=[],h=new Map,m=a(()=>{w=oe()?.getVoices()??[]},"loadVoices"),R=!1,x=a(()=>{let f=oe();R||f===null||(R=!0,m(),f.addEventListener?.("voiceschanged",m))},"bindVoices"),U=a(()=>(e??(e=new Audio),e),"element"),M=a((f,N,S,b)=>{let u=oe();if(u!==null&&f!==""&&typeof SpeechSynthesisUtterance=="function"){x();let L=Ut(w,N);if(w.length===0||L!==void 0){u.cancel();let j=new SpeechSynthesisUtterance(f);j.lang=N,L!==void 0&&(j.voice=L),j.rate=.95,S!==void 0&&(j.onend=S),(S!==void 0||b!==void 0)&&(j.onerror=F=>{b!==void 0&&F.error==="not-allowed"?b():S?.()}),u.speak(j);return}}S?.()},"speak"),B=a(()=>{n+=1,r=null,s=i=null,e!==null&&(e.pause(),e.currentTime=0),oe()?.cancel()},"stop"),A=a(f=>{for(let N of f){let S=Ke(N);if(h.has(S))continue;let b=new Audio;b.preload="auto",b.src=N,h.set(S,b)}},"warmClips"),te=a((f,N,S)=>{let b={utterance:f,generation:N,end:S};p=b;let u=a(()=>N===n&&p===b,"live"),L=a(()=>{u()&&(s=b)},"block");if(oe()?.cancel(),f.url!==null){let j=U();j.pause(),j.muted=!1,j.src=f.url,j.currentTime=0,j.onended=S??null;let F=a(()=>{i===b&&(i=null)},"settled"),o=j.play();if(o===void 0)return;i=b,o.then(F,H=>{if(F(),!u())return;let O=H?.name;if(O!=="AbortError"){if(O==="NotAllowedError")return L();f.speech?M(f.text,f.lang,S,L):S?.()}});return}f.speech?M(f.text,f.lang,S,L):S?.()},"start");return{say(f){let N=f.url!==null?Ke(f.url):`tts:${f.lang}:${f.text}`;if(N===r)return;r=N,s=i=null,n+=1;let S=n,b=f.onEnd;te(f,S,b!==void 0?()=>{S===n&&b()}:void 0)},unlock({lang:f,speech:N,prefetch:S}){let b=s??(c?null:i);c=!0;let u=b!==null&&b.generation===n?b:null;s=i=null,u!==null&&te(u.utterance,u.generation,u.end);let L=U();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let H=Uint8Array.from(atob(On),O=>O.charCodeAt(0));t=URL.createObjectURL(new Blob([H],{type:"audio/wav"}))}let j=L.paused===!1&&t!==null&&L.src!==t;t!==null&&!j&&(u===null||u.utterance.url===null)&&(L.muted=!0,L.onended=null,L.src=t,L.play()?.catch(()=>{}));let F=oe(),o=u!==null&&u.utterance.url===null;if(N&&!o&&F!==null&&typeof SpeechSynthesisUtterance=="function"){x();let H=new SpeechSynthesisUtterance(" ");H.volume=0,H.lang=f,F.speak(H)}A(S??[])},prefetch:A,stop:B,dispose(){B(),R&&oe()?.removeEventListener?.("voiceschanged",m),R=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&Mt(e),e=null;for(let f of h.values())Mt(f);h.clear()}}}l($r,"En");a($r,"createVoicePlayer");var Bn="sekyro.voiceGuidance";function Dr(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}}l(Dr,"Nn");a(Dr,"readVoicePreference");function Gr(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}l(Gr,"Pn");a(Gr,"writeVoicePreference");var Ge="capture.tips.summary",qn=typeof window<"u"?_.useLayoutEffect:_.useEffect,Vn=Object.freeze({});function st(e,t){let n=new Set,r=[];for(let s of Br){let i=s===Ge?null:je(e,s,t);i===null||n.has(Ke(i))||(n.add(Ke(i)),r.push(i))}return r}l(st,"vt");a(st,"resolvedClipUrls");function Kr({locale:e,defaultClips:t,options:n}){let r=n===!1,s=r?{}:n??{},i=s.storageKey===void 0?Bn:s.storageKey,[c,p]=(0,_.useState)(s.defaultEnabled??!0),w=(0,_.useRef)(c),[h,m]=(0,_.useState)(!1),[R,x]=(0,_.useState)("none"),[U,M]=(0,_.useState)(!1),B=(0,_.useRef)(!1),[A,te]=(0,_.useState)(0),f=(0,_.useRef)(null),N=(0,_.useCallback)(()=>(f.current??(f.current=$r()),f.current),[]),S=Pn[e],b=s.speechFallback,u=b===void 0||b===!0?!0:b===!1?!1:b.includes(e),L=s.clips??t??Vn,j=(0,_.useRef)(!1),F=(0,_.useRef)(L);qn(()=>{F.current=L,w.current=c}),(0,_.useEffect)(()=>{if(r||i===null)return;let I=Dr(i);I!==null&&(w.current=I,p(I))},[r,i]),(0,_.useEffect)(()=>{if(!(r||!u))return Fr(()=>te(I=>I+1))},[r,u]);let o=s.clips;(0,_.useEffect)(()=>{if(r)return;let I=u&&Vr(S);m(st(L,e).length>0||I),x(o!==void 0&&je(o,Ge,e)!==null?"partner":je(L,Ge,e)!==null||I?"default":"none")},[r,L,o,e,u,S,A]),(0,_.useEffect)(()=>{if(r||!c||!j.current)return;let I=st(L,e);I.length>0&&N().prefetch(I)},[r,c,L,e,N]),(0,_.useEffect)(()=>()=>{f.current?.dispose(),f.current=null,j.current=!1},[]);let H=(0,_.useCallback)(I=>{r||(j.current=!0,N().unlock({lang:S,speech:u,...I?{prefetch:st(F.current,e)}:{}}))},[r,N,S,u,e]),O=(0,_.useCallback)(()=>H(w.current),[H]),W=(0,_.useCallback)(()=>{B.current=!1,M(!1)},[]),$=(0,_.useCallback)(()=>{W(),f.current?.stop()},[W]),ke=(0,_.useCallback)(()=>{B.current&&$()},[$]),he=(0,_.useCallback)((I,Re)=>{if(r)return;if(B.current){$();return}let be=N();be.stop(),B.current=!0,M(!0);let q=Re?.clip===!1?null:je(F.current,Ge,e);be.say({url:q,text:I,lang:S,speech:u,onEnd:W})},[r,$,N,e,S,u,W]),Q=(0,_.useCallback)(I=>{r||(I?H(!0):$(),i!==null&&Gr(i,I),w.current=I,p(I))},[r,H,$,i]),X=(0,_.useCallback)(()=>Q(!w.current),[Q]),ae=(0,_.useCallback)((I,Re)=>{if(r||!c)return;B.current&&W();let be=je(F.current,I,e);N().say({url:be,text:Re,lang:S,speech:u})},[r,c,e,N,S,u,W]);return(0,_.useMemo)(()=>({supported:!r&&h,enabled:!r&&c,setEnabled:Q,toggle:X,unlock:O,speakKey:ae,stop:$,summary:r?"none":R,summaryPlaying:U,toggleSummary:he,stopSummary:ke}),[r,h,c,Q,X,O,ae,$,R,U,he,ke])}l(Kr,"Ct");a(Kr,"useVoiceGuidance");function zr(e,t,n,r){let{speakKey:s,stop:i,enabled:c}=e,p=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!r||!c){p.current&&i(),p.current=!1;return}p.current=!0,lt(t)&&t!==Ge&&n!==""&&s(t,n)},[r,c,t,n,s,i])}l(zr,"kt");a(zr,"useSpeakGuidance");function ze(e,t){let n=Zr(e);return n==="face"&&(t==="lighting"||e==="liveness_inconclusive")?"again":n}l(ze,"On");a(ze,"retryCoachingOf");function Zr(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"}}l(Zr,"Kr");a(Zr,"coachingOfReason");var Te={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},again:{title:"capture.retryTips.title",tips:["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 Wr({showCoaching:e,coaching:t="face",attemptsText:n,showRetake:r,onRetake:s}){let i=Le(),c=(0,ot.useRef)(null);return(0,ot.useEffect)(()=>{r&&c.current?.focus()},[r]),!e&&!r?null:(0,ye.jsxs)("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?(0,ye.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,ye.jsx)("p",{className:"sekyro-text-body",children:i(Te[t].title)}),(0,ye.jsx)("ul",{className:"sekyro-coaching",children:Te[t].tips.map(p=>(0,ye.jsx)("li",{children:i(p)},p))}),n!==null?(0,ye.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:n}):null]}):null,r?(0,ye.jsx)(J,{ref:c,className:"sekyro-btn--start",onClick:s,children:i("capture.recordAgain")}):null]})}l(Wr,"Hn");a(Wr,"CapturedPanel");function jt(){try{return!1}catch{return!1}}l(jt,"rt");a(jt,"isDevBuild");var Fn=(0,Qr.createContext)(null);function Xr({state:e}){let t=Le(),[n,r]=(0,ct.useState)(!1);(0,ct.useEffect)(()=>{e!=="unknown"&&r(!0)},[e]);let s=e==="granted"?(0,Se.jsx)(Ir,{}):e==="denied"?(0,Se.jsx)(jr,{}):(0,Se.jsx)(Ur,{});return(0,Se.jsxs)("div",{role:n?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[(0,Se.jsx)("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:s}),(0,Se.jsx)("span",{children:t(`capture.permission.${e}`)})]})}l(Xr,"Gn");a(Xr,"PermissionRow");function Jr({voice:e}){let t=Le();if(!e.supported)return null;let n=e.enabled;return(0,xe.jsxs)("button",{type:"button",role:"switch","aria-checked":n,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:l(()=>e.toggle(),"onClick"),children:[(0,xe.jsxs)("span",{className:"sekyro-switch__label",children:[(0,xe.jsx)(it,{off:!n}),t("capture.voiceGuidance")]}),(0,xe.jsx)("span",{className:"sekyro-switch__track","aria-hidden":"true",children:(0,xe.jsx)("span",{className:"sekyro-switch__thumb",children:n?(0,xe.jsx)(Tr,{className:"sekyro-switch__check"}):null})})]})}l(Jr,"Fn");a(Jr,"VoiceSwitch");function Yr({assets:e,onRetryAssets:t,permission:n,captureMode:r="self",voice:s,tips:i,summary:c,startLabel:p,startDisabled:w,onStart:h}){let m=Le(),R=(0,ee.useRef)(c?.stop);R.current=c?.stop,(0,ee.useEffect)(()=>()=>R.current?.(),[]);let x=(0,ee.useRef)(null),U=(0,ee.useRef)(null),M=(0,ee.useRef)(null),B=(0,ee.useRef)(e),A=(0,ee.useRef)(!1);(0,ee.useEffect)(()=>{let u=B.current;if(B.current=e,u===e)return;let L=A.current;e!=="loading"&&(A.current=!1),en(x.current)&&(e==="failed"?M.current?.focus():L&&U.current?.focus())},[e]);let te=(0,ee.useCallback)(()=>{A.current=!0,t()},[t]),f=e==="loading",N=f||w,S=(0,ee.useCallback)(()=>{N||(R.current?.(),h())},[N,h]),b;return e==="failed"?b=(0,P.jsxs)(le,{tone:"danger",testId:"sekyro-assets-error",children:[(0,P.jsx)("p",{className:"sekyro-text-body",children:m("fcv2.err.models")}),(0,P.jsx)(J,{kind:"ghost",ref:M,className:"sekyro-btn--start",onClick:te,"data-testid":"sekyro-assets-retry",children:m("common.retry")})]}):b=(0,P.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,P.jsx)(J,{ref:U,full:!0,"data-testid":"sekyro-start","aria-disabled":N?"true":void 0,"aria-busy":f?"true":void 0,onClick:S,children:f?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Hr,{}),m("capture.preparing.title")]}):p??m("capture.start")}),f?(0,P.jsx)("p",{className:"sekyro-text-muted",children:m("capture.preparing.hint")}):null]}),(0,P.jsxs)("div",{ref:x,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?(0,P.jsxs)("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[(0,P.jsx)("h2",{className:"sekyro-text-body",children:m("capture.assisted.title")}),(0,P.jsx)("p",{className:"sekyro-text-muted",children:m("capture.assisted.lead")})]}):null,i!==!1?(0,P.jsx)(Or,{tips:i}):null,c!==void 0?(0,P.jsxs)(J,{kind:"ghost",className:"sekyro-btn--start",onClick:c.toggle,"data-testid":"sekyro-tips-listen",children:[(0,P.jsx)(it,{off:!1}),m(c.playing?"capture.tips.stop":"capture.tips.listen")]}):null,(0,P.jsx)(Xr,{state:n}),(0,P.jsx)(Jr,{voice:s}),(0,P.jsx)("p",{className:"sekyro-text-muted",children:m("capture.securityNote")}),b,(0,P.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?m("capture.preparing.title"):e==="ready"?m("capture.ready"):""})]})}l(Yr,"jn");a(Yr,"PreCaptureScreen");function en(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}l(en,"Br");a(en,"focusIsOurs");function tn(){let[e,t]=(0,ut.useState)({state:"unknown",settled:!1});return(0,ut.useEffect)(()=>$n(n=>t({state:n,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}l(tn,"Yn");a(tn,"useCameraStatus");function rn(e){return Tt(e,"mobileRequired")}l(rn,"$n");a(rn,"useMobileRequired");function nn(e){return Tt(e,"returning").required}l(nn,"zn");a(nn,"useReturning");function Tt(e,t){let[n,r]=(0,pe.useState)({required:!1,settled:e===void 0});return(0,pe.useEffect)(()=>{let s=e?.[t];if(e===void 0||typeof s!="function"){r({required:!1,settled:!0});return}let i=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>s.call(e)).then(c=>{i&&r({required:c===!0,settled:!0})},()=>{i&&r({required:!1,settled:!0})}),()=>{i=!1}},[e,t]),n}l(Tt,"Zn");a(Tt,"useFlag");function an(e){let t=a(()=>e?.captureChoice??null,"initialChoice"),[n,r]=(0,pe.useState)(()=>({session:"self",choice:t(),settled:e===void 0}));(0,pe.useEffect)(()=>{let i=e?.captureMode,c=e?.captureChoice??null;if(e===void 0||typeof i!="function"){r({session:"self",choice:c,settled:!0});return}let p=!0;return r({session:"self",choice:c,settled:!1}),Promise.resolve().then(()=>i.call(e)).then(w=>{let h=e.captureChoice??null;p&&r({session:h!==null&&w===h?"choice":w==="assisted"||w==="choice"?w:"self",choice:h,settled:!0})},()=>{p&&r({session:"self",choice:null,settled:!0})}),()=>{p=!1}},[e]);let s=(0,pe.useCallback)(i=>{e?.chooseCaptureMode?.(i),r(c=>({...c,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:s}}l(an,"Wn");a(an,"useCaptureMode");function sn(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)),s=e.on("result",()=>n(!1));return()=>{r(),s()}},[e]),t}l(sn,"Qn");a(sn,"useBusy");var zn=a(()=>"idle","serverSnapshot");function At(e){return Gn(e!==void 0?{assetBaseUrl:e}:{})}l(At,"er");a(At,"preload");function ln(e,t=!0){let n=(0,Y.useSyncExternalStore)((0,Y.useCallback)(h=>Kn(h,e),[e]),()=>Dn(e),zn),[r,s]=(0,Y.useState)(null),i=(0,Y.useRef)(!1),c=(0,Y.useCallback)(()=>{At(e).then(h=>{i.current&&h==="idle"&&s({base:e})})},[e]);(0,Y.useEffect)(()=>(i.current=!0,c(),()=>{i.current=!1}),[c]);let p=(0,Y.useRef)(null);(0,Y.useEffect)(()=>{if(n!=="idle"){p.current={base:e};return}!t||p.current===null||p.current.base!==e||(p.current=null,c())},[n,e,c,t]);let w=(0,Y.useCallback)(()=>{At(e)},[e]);return{gate:r!==null&&r.base===e&&n==="idle"||n==="ready"?"ready":n==="failed"?"failed":"loading",retry:w}}l(ln,"tr");a(ln,"useLivenessAssets");var Rr={progress:0,hint:null,faceDetected:!1};function on(e){let{videoRef:t,assetBaseUrl:n}=e,r=(0,E.useRef)(e.verification).current,s=(0,E.useRef)(!1);e.verification!==r&&!s.current&&jt()&&(s.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,E.useRef)(null),[c,p]=(0,E.useState)("idle"),[w,h]=(0,E.useState)(Rr),[m,R]=(0,E.useState)(!1),[x,U]=(0,E.useState)(!1),[M,B]=(0,E.useState)(null),[A,te]=(0,E.useState)(!1),[f,N]=(0,E.useState)(null),[S,b]=(0,E.useState)(null),[u,L]=(0,E.useState)(null),[j,F]=(0,E.useState)(null),[o,H]=(0,E.useState)(null),[O,W]=(0,E.useState)(!1),$=(0,E.useRef)(null),ke=(0,E.useRef)("idle"),he=(0,E.useRef)(-1),[Q,X]=(0,E.useState)(0),ae=(0,E.useRef)(e);ae.current=e,(0,E.useEffect)(()=>{let re=t.current;if(re===null)return;let ue={video:re,...n!==void 0?{assetBaseUrl:n}:{}},K=r!==void 0?r.liveness(ue):Zn(ue);i.current=K;let Ne=a(()=>H(K.facingMode??null),"readFacing");Ne();let Ze=[K.on("state",C=>{C==="mode_switch"?W(!0):C!=="starting"&&C!=="gating"&&W(!1),C==="starting"?(ke.current!=="starting"&&(he.current+=1,X(Math.max(0,he.current))),b(null),L(null),h(Rr),U(!1),R(!1),B(null),N(null),$.current=null):C==="gating"&&ke.current==="recording"&&(U(!1),R(!1),B(null),$.current=null),ke.current=C,Ne(),p(C),ae.current.onStateChange?.(C)}),K.on("gate",C=>{let Ce=$.current;$.current=C.progress,R(Ce!==null&&C.progress<Ce-.001&&C.progress>0&&C.progress<1),C.progress>=1&&U(!0),h(C)}),K.on("frozen",({previewDataUrl:C})=>B(C)),K.on("profile",({animations:C})=>te(C==="reduced")),K.on("ramp",({colour:C})=>N(C)),K.on("captured",C=>{b(C),F(null),ae.current.onCaptured?.(C)}),K.on("error",C=>{L(C);let Ce=r?.reportCaptureIssue;Ce!==void 0&&xt(Ee=>Ce.call(r,Ee),Sr("liveness",C,Math.max(0,he.current))),ae.current.onError?.(C)}),r?.on("result",C=>{F(C),ae.current.onResult?.(C)})];return()=>{for(let C of Ze)C?.();i.current=null,K.destroy()}},[r,t,n]);let I=(0,E.useCallback)(()=>{i.current?.start()},[]),Re=(0,E.useCallback)(()=>{i.current?.retry()},[]),be=(0,E.useCallback)(async()=>{let re=i.current;return re===null||typeof re.canSwitchCaptureMode!="function"?!1:await re.canSwitchCaptureMode().catch(()=>!1)===!0},[]),q=(0,E.useCallback)(async re=>{let ue=i.current;if(ue===null||typeof ue.setCaptureMode!="function")return!1;let K=await ue.setCaptureMode(re).catch(()=>!1)===!0;return K&&H(ue.facingMode??null),K},[]);return{state:c,gate:w,draining:m,gateLocked:x,frozenPreview:M,reduceMotion:A,rampColour:f,artifacts:S,error:u,result:j,facingMode:o,start:I,retry:Re,canSwitchCaptureMode:be,setCaptureMode:q,modeRestarted:O,attempt:Q}}l(on,"rr");a(on,"useLivenessHandle");var Wn=new Set(["national_number"]);function Lt(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(n=>Wn.has(n));return t.length>0?{...e,options:t}:null}l(Lt,"or");a(Lt,"pending");function cn(e){let[t,n]=(0,ge.useState)(null),[r,s]=(0,ge.useState)(e===void 0),[i,c]=(0,ge.useState)(!1),[p,w]=(0,ge.useState)(!1);(0,ge.useEffect)(()=>{if(n(null),e===void 0){s(!0);return}let R=!0,x=e.methodChoice;typeof x=="function"?(s(!1),Promise.resolve().then(()=>x.call(e)).then(M=>{R&&n(Lt(M))},()=>{}).finally(()=>{R&&s(!0)})):s(!0);let U=e.on("method",M=>n(Lt(M)));return()=>{R=!1,U()}},[e]);let h=(0,ge.useCallback)(async R=>{if(e===void 0)return!1;c(!0),w(!1);try{return await e.selectMethod(R),n(null),!0}catch{return w(!0),!1}finally{c(!1)}},[e]),m=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:m==="national_number"&&!p?m:null,settled:r,busy:i,failed:p,select:h}}l(cn,"sr");a(cn,"useMethodChoice");var Qn=["ar","fr","en"];function un(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}}l(un,"co");a(un,"isClipUrl");function dn(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let n={};for(let r of Qn){let s=t[r];if(!(typeof s!="object"||s===null))for(let[i,c]of Object.entries(s))!lt(i)||!un(c)||((n[r]??(n[r]={}))[i]=c)}return Object.keys(n).length>0?n:null}l(dn,"lo");a(dn,"toVoiceClipMap");function pn(e){let[t,n]=(0,He.useState)(null);(0,He.useEffect)(()=>{if(n(null),e===void 0)return;let s=!0,i=a(p=>{if(!s)return;let w=typeof p=="object"&&p!==null&&typeof p.setId=="string"?p:null;n(h=>h?.setId===w?.setId?h:w)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(i,()=>i(null))}catch{i(null)}let c=e.on("view",p=>i(p.voice));return()=>{s=!1,c()}},[e]);let r=(0,He.useMemo)(()=>t!==null?dn(t):null,[t]);return e===void 0?null:r}l(pn,"ir");a(pn,"useServerVoiceClips");function hn({voice:e}){let t=Le();return(0,Et.jsx)(J,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:l(()=>e.toggle(),"onClick"),children:(0,Et.jsx)(it,{off:!e.enabled,className:"sekyro-icon"})})}l(hn,"cr");a(hn,"VoiceChip");var Xn=new Set(["abandoned","not_opened","cancelled","superseded"]),Jn=800,Yn="capture.lookAtColours";function fn(e){return e===void 0||e!==!1&&e.length===Rt.length&&Rt.every(t=>e.includes(t))}l(fn,"go");a(fn,"isDefaultTips");function mn(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}l(mn,"ho");a(mn,"carriesActivation");function yn(e){return typeof e=="object"&&e!==null&&!(0,y.isValidElement)(e)&&"tone"in e&&"text"in e}l(yn,"vo");a(yn,"isNoticeObject");var ea=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function gn(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}l(gn,"ko");a(gn,"isCapturing");function vn(e){return e==="captured"||e==="uploading"||e==="checking"}l(vn,"bo");a(vn,"isPostCapture");function ta({verification:e,locale:t,dir:n,strings:r,slots:s,autoStart:i=!1,notice:c,startDisabled:p=!1,startLabel:w,tips:h,tipsSummary:m,coach:R,voice:x,onGuidance:U,onCaptured:M,onResult:B,onError:A,onStateChange:te,assetBaseUrl:f,className:N}){let S=kr(t),b=(0,y.useMemo)(()=>vr(t,r),[t,r,S]),u=(0,y.useMemo)(()=>v=>b[v]??"",[b]),L=n??(t==="ar"?"rtl":"ltr"),j=(0,y.useRef)(null),F=(0,y.useContext)(Fn),o=on({verification:e,videoRef:j,assetBaseUrl:f,onCaptured:M,onResult:B,onError:A,onStateChange:te}),H=ln(f,o.state==="idle"&&o.error===null),O=cn(e),W=O.choice!==null,$=rn(e),ke=nn(e),he=sn(e),Q=tn(),X=an(e),ae=X.session==="choice",I=X.mode==="assisted",Re=x!==!1&&x?.clips===void 0,be=pn(Re?e:void 0),q=Kr({locale:t,defaultClips:be,options:x}),re=I?"environment":"user",ue=X.settled,K=(0,y.useRef)(null),Ne=(0,y.useRef)(!1),Ze=(0,y.useRef)(q.unlock);Ze.current=q.unlock,(0,y.useEffect)(()=>{let v=K.current;if(v===null)return;let ie=["pointerup","touchend","click","keydown"],we=a(()=>{for(let Fe of ie)v.removeEventListener(Fe,Ae,!0)},"disarm");function Ae(Fe){if(Ne.current){we();return}mn(Fe)&&(Ne.current=!0,we(),Ze.current())}l(Ae,"Re"),a(Ae,"onGesture");for(let Fe of ie)v.addEventListener(Fe,Ae,{capture:!0,passive:!0});return we},[]);let C=(0,y.useCallback)(()=>{Ne.current||(Ne.current=!0,q.unlock()),o.start()},[q.unlock,o.start]),Ce=(0,y.useCallback)(()=>o.start(),[o.start]),Ee=(0,y.useRef)(!1),Oe=o.state==="idle"&&o.error===null,Bt=!W&&!$.required&&(i===!0||i==="when-permitted"&&Q.permission==="granted"),qt=Bt&&O.settled&&$.settled&&ue,xn=i==="when-permitted"&&!Q.permissionSettled&&!Ee.current,Vt=Bt&&Oe&&!Ee.current,pt=(xn||Vt||!ue)&&H.gate==="ready"?"loading":H.gate;(0,y.useEffect)(()=>{!qt||!Oe||H.gate!=="ready"||Ee.current||(Ee.current=!0,Ce())},[qt,Oe,H.gate,Ce]);let Rn=Oe&&!W&&!$.required&&!(Vt&&H.gate==="ready"),[Ft,$t]=(0,y.useState)(!1),{canSwitchCaptureMode:Dt,setCaptureMode:Gt}=o;(0,y.useEffect)(()=>{if(!X.settled||!ae){$t(!1);return}let v=!0;return Dt().then(ie=>{v&&$t(ie)}),()=>{v=!1}},[X.settled,ae,Dt]);let{choose:Kt}=X,Ie=I?"self":"assisted",Nn=(0,y.useCallback)(async()=>{await Gt(Ie)&&Kt(Ie)},[Gt,Kt,Ie]),zt=o.state!=="idle"&&o.facingMode!==null?o.facingMode:re;(0,y.useEffect)(()=>{let v=j.current?.style;zt==="user"?v?.removeProperty("transform"):v&&(v.transform="none")},[zt]);let We=(0,y.useMemo)(()=>o.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(o.artifacts.keyframe):null,[o.artifacts]);(0,y.useEffect)(()=>{if(We!==null)return()=>URL.revokeObjectURL(We)},[We]);let Zt=o.frozenPreview??We,Ue=e!==void 0,D=gn(o.state),fe=vn(o.state),Pe=D||fe,se=o.result,Wt=o.state==="done"&&se!==null,Qe=D&&o.rampColour!==null,ht=o.state==="recording"&&o.frozenPreview!==null&&!Qe,Be=F!==null,Qt=Ft&&D&&!ht?{to:Ie,label:u(Ie==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:u(Ie==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:a(()=>{Nn()},"onSwitch")}:null,Xe=o.modeRestarted&&D?u("capture.modeSwitch.restarted"):null,qe=fe||ht,Xt=fe?"checking":ht?"frozen":o.state==="recording"||Qe?"recording":o.gateLocked||o.gate.progress>=1?"locked":o.gate.faceDetected?"aligning":"seeking",Je=D?o.gate.hint:null,Ye=o.state==="starting"?"capture.preparing.title":Je===null?null:Je==="center"&&!o.gate.faceDetected?"fcv3.no_face":fr(Je),[Mn,Jt]=(0,y.useState)(null);(0,y.useEffect)(()=>{if(Ye!=="fcv3.no_face"){Jt(Ye);return}if(!D)return;let v=setTimeout(()=>Jt(Ye),Jn);return()=>clearTimeout(v)},[Ye,D]);let ft=D&&!Qe&&typeof R=="string"&&R!=="",Yt=I&&D?u("capture.assisted.stage"):null,Me=D&&!ft?Qe?Yn:Mn:null,mt=ft?R:Me===null?"":u(Me);zr(q,Me,mt,D);let er=(0,y.useRef)(U);er.current=U,(0,y.useEffect)(()=>{if(lt(Me))try{er.current?.(Me)}catch(v){console.error("[@sekyro/react] onGuidance threw:",v)}},[Me]);let Ve=(0,y.useMemo)(()=>({supported:q.supported,enabled:q.enabled,setEnabled:q.setEnabled,toggle:q.toggle}),[q.supported,q.enabled,q.setEnabled,q.toggle]),yt=s?.voicePrompt,tr=yt!==void 0,rr=x===void 0,nr=(0,y.useRef)(!1);(0,y.useEffect)(()=>{!tr||!rr||nr.current||!jt()||(nr.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."))},[tr,rr]);let An=yt!==void 0?(v,ie,we)=>yt(v,ie,we,Ve):q.supported?()=>(0,k.jsx)(hn,{voice:Ve}):void 0,{summary:gt,summaryPlaying:ar,toggleSummary:sr,stopSummary:ir}=q,et=m!==void 0&&m!=="",lr=et?m:u("capture.tips.summary"),or=et?gt!=="none":gt==="partner"||gt==="default"&&fn(h),Ln=(0,y.useMemo)(()=>or?{playing:ar,toggle:a(()=>sr(lr,{clip:!et}),"toggle"),stop:ir}:void 0,[or,ar,sr,lr,ir,et]),cr=(0,y.useMemo)(()=>({assets:pt,retryAssets:H.retry,permission:Q.permission,permissionSettled:Q.permissionSettled,captureMode:X.mode,facing:re,voice:Ve}),[pt,H.retry,Q.permission,Q.permissionSettled,X.mode,re,Ve]),En=yn(c)?(0,k.jsx)(le,{tone:c.tone,testId:"sekyro-host-notice",children:(0,k.jsx)("span",{children:c.text})}):c??null,V=se!==null&&se.status==="retry"?se:null,tt=V!==null&&s?.intro!==void 0&&!D&&!fe&&o.error===null,ur=V===null?void 0:{reason:String(V.reasonCode??""),...V.retakeHint!==void 0?{retakeHint:V.retakeHint}:{},...V.attemptsRemaining!==void 0?{attemptsRemaining:V.attemptsRemaining}:{}},z=Wt&&se.status==="unavailable"&&!W&&se.reasonCode!=="portrait_required"?se:null,_e=Wt&&(se.status==="verified"||se.status==="not_verified"||se.status==="review")?se:null,vt=a((v,ie)=>{if(v===void 0)return null;if(v==="device_cooldown"){let Ae=yr(t,ie);if(Ae!==null)return u(Ae.key).replace("{time}",Ae.time)}let we=nt(v);return we===null?null:u(we)},"reasonText"),kt=a(v=>{let ie=v.retakeHint===void 0?null:$e(v.retakeHint);return ie===null?vt(v.reasonCode):u(ie)},"retryText"),dr=_e===null?null:vt(_e.reasonCode,_e.retryAfter)??(_e.status==="not_verified"&&_e.reason!==void 0&&Xn.has(_e.reason)?u("errors.session_expired"):null),In=z!==null&&z.reasonCode!==void 0&&z.reasonCode!=="nni_unbound"&&z.reasonCode!=="id_number_unbound"&&z.reasonCode!=="method_required"&&z.reasonCode!=="mobile_required"&&!(z.reasonCode==="no_recorder"&&o.artifacts?.degraded==="NO_RECORDER"),rt=z?.reasonCode,pr=o.attempt;(0,y.useEffect)(()=>{z===null||rt===void 0||e?.reportCaptureIssue===void 0||ea.has(rt)||xt(v=>e.reportCaptureIssue?.(v),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:rt,attempt:Math.min(1e3,pr)})},[z,rt,pr,e]);let hr=Ct(),Un=W&&O.auto===null&&!D&&!fe&&o.error===null,bt=(0,y.useCallback)(async v=>{await O.select(v)&&o.state==="done"&&o.retry()},[O.select,o.state,o.retry]);return(0,y.useEffect)(()=>{O.auto!==null&&!O.busy&&!D&&!fe&&bt(O.auto)},[O.auto,O.busy,D,fe,bt]),(0,k.jsx)(br,{value:u,children:(0,k.jsxs)("div",{ref:K,className:N===void 0?"sekyro-capture":`sekyro-capture ${N}`,dir:L,lang:t,"data-testid":"sekyro-liveness-capture","data-state":o.state,children:[s?.header,V!==null&&kt(V)!==null&&!(Be&&Pe)&&!tt?(0,k.jsx)(le,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:(0,k.jsx)("span",{children:kt(V)})}):null,Xe!==null&&!Be?(0,k.jsx)(le,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:(0,k.jsx)("span",{children:Xe})}):null,he&&fe&&!Be?(0,k.jsx)(le,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:(0,k.jsx)("span",{children:u("capture.busy")})}):null,$.required&&Oe?(0,k.jsx)(le,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:(0,k.jsx)("span",{children:u("reasons.mobile_required")})}):null,o.error!==null?s?.errorPanel!==void 0?s.errorPanel(o.error,o.retry):(0,k.jsxs)(le,{tone:"danger",testId:"sekyro-error-notice",children:[(0,k.jsx)("span",{children:u(mr(o.error))}),o.error.retryable?(0,k.jsx)(J,{ref:hr,kind:"ghost",className:"sekyro-btn--start",onClick:o.retry,children:u("common.retry")}):null]}):null,z!==null?(0,k.jsxs)(le,{tone:"danger",testId:"sekyro-unavailable-notice",children:[(0,k.jsx)("span",{children:(z.reasonCode==="attestation"&&z.attestationError==="clock_wrong"?u("errors.device_clock"):vt(z.reasonCode))??u(z.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),In?(0,k.jsx)(J,{ref:hr,kind:"ghost",className:"sekyro-btn--start",onClick:o.retry,children:u(z.reasonCode==="attestation"?"common.retry":"capture.recordAgain")}):null]}):null,dr!==null&&_e!==null?(0,k.jsx)(le,{tone:_e.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:(0,k.jsx)("span",{children:dr})}):null,(0,k.jsx)("div",{className:Pe?void 0:"sekyro-hidden","data-capture-live":Pe?"":void 0,children:Be?F({videoRef:j,guidance:qe&&Ue?u("capture.checking"):mt,coached:ft&&!(qe&&Ue),note:qe?Ue?u(he?"capture.busy":"capture.checkingHint"):null:Xe??Yt,settled:qe&&Ue,progress:o.gate.progress,phase:Xt,still:qe?Zt:null,live:Pe,modeSwitch:Qt,...Ft||V!==null?{status:Xe??(V!==null&&D?kt(V):null)}:{},ramp:o.rampColour===null?null:{colour:o.rampColour}}):(0,k.jsx)(Cr,{videoRef:j,guidanceText:mt,guidanceHint:Je,guidanceKey:Me,progress:o.gate.progress,phase:Xt,draining:o.draining,stillUrl:Zt,showChecking:Ue,operatorText:Yt,voicePrompt:An,overlay:l(v=>(0,k.jsxs)(k.Fragment,{children:[s?.stageOverlay?.(v),(0,k.jsx)(_r,{colour:o.rampColour})]}),"overlay"),reduceMotion:o.reduceMotion,modeSwitch:Qt})}),Un&&O.choice!==null?(0,k.jsx)(Pr,{title:u("method.title"),description:u("method.description"),options:O.choice.options.map(v=>({id:v,label:u(`method.${v}`)})),busy:O.busy,error:O.failed?u("errors.network_error"):null,focus:o.state==="done",testId:"sekyro-method",look:"buttons",onChoose:l(v=>{bt(v)},"onChoose")}):null,tt&&s?.intro!==void 0&&ur!==void 0?s.intro(o.retry,{...cr,retry:ur}):null,Rn?(0,k.jsxs)(k.Fragment,{children:[ke&&s?.header===void 0&&s?.intro===void 0?(0,k.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,k.jsx)("h2",{className:"sekyro-text-body",children:u("returning.title")}),(0,k.jsx)("p",{className:"sekyro-text-muted",children:u("returning.description")})]}):null,En,s?.intro!==void 0?s.intro(C,cr):(0,k.jsx)(Yr,{assets:pt,onRetryAssets:H.retry,permission:Q.permission,captureMode:X.mode,voice:Ve,tips:h??Rt,summary:Ln,startLabel:w,startDisabled:p,onStart:C})]}):null,(0,k.jsx)(Wr,{showCoaching:V!==null&&!(Be&&Pe)&&!tt,coaching:ze(V?.reasonCode,V?.retakeHint),attemptsText:V?.attemptsRemaining!==void 0?gr(b,t,V.attemptsRemaining):null,showRetake:V!==null&&!D&&!fe&&!tt||!Ue&&o.state==="captured",onRetake:o.retry}),s?.footer]})})}l(ta,"Ni");a(ta,"LivenessCapture");var Ht=T(Z(),1),dt=T(Z(),1),d=T(de(),1);import{methodNameOf as kn}from"@sekyro/web";import{isInAppBrowser as ca}from"@sekyro/web/client";var Aa={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function ra(e,t){switch(e.service){case"document":return t.t("method.document_photo");case"population_registry":return kn(e,t.locale)??t.t("method.nationalNumber");case"national_eid":return kn(e,t.locale)??t.t("method.nationalEid");default:return null}}l(ra,"J");a(ra,"identityLabel");function na(e,t){let[n,r]=(0,Ht.useState)(!1),[s,i]=(0,Ht.useState)(null);return{busy:n,error:s,run:a(c=>{r(!0),i(null),c().then(()=>r(!1),p=>{r(!1),i(e.t(xr(p,e.strings))),t?.(p)})},"run")}}l(na,"Q");a(na,"useChoiceAction");function Ot(){let e=`sekyro-face-light-${(0,dt.useId)().replace(/[^A-Za-z0-9_-]/g,"")}`;return(0,d.jsxs)("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("defs",{children:(0,d.jsx)("mask",{id:e,children:(0,d.jsx)("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),(0,d.jsx)("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),(0,d.jsx)("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),(0,d.jsx)("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),(0,d.jsx)("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}l(Ot,"O");a(Ot,"FaceMark");var aa={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function sa(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}}l(sa,"le");a(sa,"faceIntroRetryOf");var Cn={"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 ia({start:e,context:t,tips:n,tipsTitle:r,human:s=!1,returning:i=!1,notice:c,retry:p}){let w=at(),{t:h}=w,m=p??wn(t),R=(0,dt.useContext)(wr)?.busy===!0;if(m!==void 0&&c===void 0&&t.captureMode!=="assisted")return(0,d.jsx)(Sn,{retry:m,start:e,context:t,disabled:R});let x=m===void 0?"face":ze(m.reason,m.retakeHint),U=x==="face"?null:Te[x].tips;return(0,d.jsxs)("section",{className:"sekyro-step",children:[(0,d.jsx)(Ot,{}),t.captureMode==="assisted"?(0,d.jsx)(De,{title:h("capture.assisted.heading"),lead:h("capture.assisted.lead")}):i?(0,d.jsx)(De,{title:h("returning.heading"),lead:h("returning.description")}):(0,d.jsx)(De,{title:h(s?"native.face.humanIntroTitle":"native.face.introTitle"),lead:h(s?"native.face.humanIntroLead":"native.face.introLead")}),m!==void 0?(0,d.jsx)(_n,{retry:m,title:Te[x].title}):null,r!==void 0&&U===null?(0,d.jsx)("p",{className:"sekyro-section-label",children:r}):null,(0,d.jsx)("ul",{className:"sekyro-tiprows",children:U!==null?U.map(M=>(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:Cn[M]??"face"}),h(M)]},M)):n!==void 0?n.map(M=>(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:aa[M.id]??"face"}),M.text]},M.id)):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:"light"}),h("capture.tips.light")]}),(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:"jGlasses"}),h("capture.tips.uncover")]}),(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:"smartphone"}),h("capture.tips.eyeLevel")]})]})}),c??null,c!==void 0?null:t.assets==="failed"?(0,d.jsx)(J,{kind:"secondary",full:!0,onClick:t.retryAssets,children:h("common.retry")}):null,c!==void 0?null:(0,d.jsx)(_t,{children:(0,d.jsxs)(J,{full:!0,disabled:t.assets!=="ready"||R,"aria-busy":t.assets==="loading"||void 0,onClick:e,children:[(0,d.jsx)(me,{name:"camera"}),h("capture.start")]})})]})}l(ia,"ue");a(ia,"FaceIntro");var la=new Set(["match_inconclusive","no_face_source","below_threshold"]);function Pt(e){return e==="probe_not_from_liveness"?"capture.retrySamePerson.message":e==="faces_differ"?"reasons.faces_differ":la.has(e)?"capture.retryMatch.message":nt(e)}l(Pt,"F");a(Pt,"retryReasonKey");function _n({retry:e,title:t}){let n=at(),r=e.retakeHint===void 0?null:$e(e.retakeHint),s=Pt(e.reason);return(0,d.jsxs)(wt,{tone:"warning",children:[r!==null?(0,d.jsx)("span",{children:n.t(r)}):s!==null?(0,d.jsx)("span",{children:n.t(s)}):null,r===null?(0,d.jsx)("span",{children:n.t(t)}):null,(0,d.jsx)("span",{children:St(n,e.attemptsRemaining,e.attemptsExhausted)})]})}l(_n,"U");a(_n,"RetryNotice");function wn(e){let t=e.retry;if(t!==void 0)return{reason:t.reason,...t.retakeHint!==void 0?{retakeHint:t.retakeHint}:{},attemptsRemaining:t.attemptsRemaining??0,attemptsExhausted:t.attemptsRemaining===0}}l(wn,"G");a(wn,"faceIntroRetryOfContext");var bn=[{key:"capture.retryCoaching.light",icon:"light"},{key:"capture.retryCoaching.eyeLevel",icon:"smartphone"},{key:"capture.retryCoaching.head",icon:"face"}],oa={appearance:"hintTitles.appearance",motion:"hintTitles.motion",lighting:"hintTitles.lighting",framing:"hintTitles.framing"};function Sn({retry:e,start:t,context:n,disabled:r}){let s=at(),{t:i}=s,c=ze(e.reason,e.retakeHint),p=c==="face"?bn:Te[c].tips.map(x=>({key:x,icon:bn.find(U=>U.key===x)?.icon??Cn[x]??"face"})),w=e.retakeHint===void 0?null:$e(e.retakeHint),h=Pt(e.reason),m=w!==null?i(w):h!==null?i(h):void 0,R=i((e.retakeHint!==void 0?oa[e.retakeHint]:void 0)??"hintTitles.default");return(0,d.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-face-retry",children:[(0,d.jsx)(Ot,{}),(0,d.jsx)(De,{title:R}),m!==void 0?(0,d.jsx)(wt,{tone:"warning",children:(0,d.jsx)("span",{children:m})}):null,(0,d.jsx)("ul",{className:"sekyro-tiprows",children:p.slice(0,3).map(x=>(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:x.icon}),i(x.key)]},x.key))}),n.assets==="failed"?(0,d.jsx)(J,{kind:"secondary",full:!0,onClick:n.retryAssets,children:i("common.retry")}):null,(0,d.jsxs)(_t,{children:[(0,d.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:St(s,e.attemptsRemaining,e.attemptsExhausted)}),(0,d.jsxs)(J,{full:!0,disabled:n.assets!=="ready"||r||e.attemptsExhausted,"aria-busy":n.assets==="loading"||void 0,onClick:t,children:[(0,d.jsx)(me,{name:"camera"}),i("capture.recordAgain")]})]})]})}l(Sn,"q");a(Sn,"FaceRetry");function ua(e){return ca(e)}l(ua,"ye");a(ua,"isInAppBrowser");function da(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 s=r.protocol.slice(0,-1);return`intent://${r.host}${r.pathname}${r.search}#Intent;scheme=${s};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}l(da,"ge");a(da,"androidBrowserIntent");export{Pr as a,jt as b,Fn as c,an as d,ta as e,Aa as f,ra as g,na as h,sa as i,ia as j,ua as k,da as l};
|