@sekyro/elements 0.1.0-rc.16 → 0.1.0-rc.17
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 +11 -0
- package/dist/cdn/chunks/{camera-trait-V4UAOPIQ-TFCPOCSU.js → camera-trait-DELAK3YN-4I2GHAFU.js} +1 -1
- package/dist/cdn/chunks/{capture-session-doc-LKMMJG4H-GQNWHWDA.js → capture-session-doc-MGDYUASI-LYQ23KS6.js} +1 -1
- package/dist/cdn/chunks/{chunk-TDAUIJGS.js → chunk-2MJOW3FG.js} +1 -1
- package/dist/cdn/chunks/chunk-2TFK736S.js +1 -0
- package/dist/cdn/chunks/{chunk-UTTEUW7M.js → chunk-3APQX7OW.js} +1 -1
- package/dist/cdn/chunks/chunk-3S7YMUPU.js +1 -0
- package/dist/cdn/chunks/{chunk-IO5LQDY2.js → chunk-4RGDPCRE.js} +2 -2
- package/dist/cdn/chunks/chunk-6L4TYBV7.js +1 -0
- package/dist/cdn/chunks/chunk-6TIQ2463.js +1 -0
- package/dist/cdn/chunks/chunk-BDRBGJA3.js +3 -0
- package/dist/cdn/chunks/{chunk-XFUL5N47.js → chunk-DCTDTKG7.js} +1 -1
- package/dist/cdn/chunks/{chunk-TGVU2IVC.js → chunk-E5JQU363.js} +1 -1
- package/dist/cdn/chunks/chunk-E5YZMFCZ.js +1 -0
- package/dist/cdn/chunks/{chunk-VGBSCCXD.js → chunk-HM65LKWB.js} +1 -1
- package/dist/cdn/chunks/{chunk-Z25MPNSU.js → chunk-IGZCP7OY.js} +1 -1
- package/dist/cdn/chunks/chunk-NPTVQXUW.js +1 -0
- package/dist/cdn/chunks/chunk-PND4F7JQ.js +1 -0
- package/dist/cdn/chunks/{chunk-YLCUWE22.js → chunk-PRMQUJTM.js} +1 -1
- package/dist/cdn/chunks/chunk-RPMVDYDV.js +1 -0
- package/dist/cdn/chunks/{chunk-7T4LO7VD.js → chunk-SI6GIBVC.js} +1 -1
- package/dist/cdn/chunks/chunk-SLLJX5QK.js +1 -0
- package/dist/cdn/chunks/{chunk-R5I4TYXJ.js → chunk-Z5QOJL3W.js} +1 -1
- package/dist/cdn/chunks/create-document-capture-KISF6XD3-R6PFAJU6.js +1 -0
- package/dist/cdn/chunks/{detector-scanic-GGIKCF6B-OP62MOM6.js → detector-scanic-JC25DD3A-YZ3NPKMQ.js} +1 -1
- package/dist/cdn/chunks/document-capture-view-7ZSM7YTT-UHYBVOQI.js +1 -0
- package/dist/cdn/chunks/eid-view-ZM7QAEME-DIL3UVBB.js +1 -0
- package/dist/cdn/chunks/email-otp-view-EYS26ZZM-UNGUBHFI.js +1 -0
- package/dist/cdn/chunks/flow-views-7SAYQQ62-2TENAJ6C.js +1 -0
- package/dist/cdn/chunks/form-view-Y5KA6R5T-KUDCNJNS.js +1 -0
- package/dist/cdn/chunks/plan-runner-NWK4LZFI-CDXUYVEW.js +1 -0
- package/dist/cdn/chunks/portrait-capture-view-E5LKQQ5Y-3HNPCMBJ.js +1 -0
- package/dist/cdn/chunks/{portrait-review-view-NJHH2E4W-5UKV267T.js → portrait-review-view-NJHH2E4W-B3RFT2PG.js} +1 -1
- package/dist/cdn/chunks/print-DCYX3CZD-DLQCPZZE.js +11 -0
- package/dist/cdn/chunks/{proof-of-address-view-LS3JZUTD-WPPCFOIG.js → proof-of-address-view-LS3JZUTD-MDTXER25.js} +1 -1
- package/dist/cdn/define.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/{chunk-4JHVEBTX.js → chunk-2EMXU2MG.js} +1 -1
- package/dist/define.cjs +5 -5
- package/dist/define.js +1 -1
- package/dist/{document-capture-view-I72R2TZK-LCX5EQJR.js → document-capture-view-7ZSM7YTT-GLHWVI3B.js} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/cdn/chunks/chunk-3NOBU7TE.js +0 -1
- package/dist/cdn/chunks/chunk-DQGAOSBX.js +0 -1
- package/dist/cdn/chunks/chunk-EMKK7NJU.js +0 -1
- package/dist/cdn/chunks/chunk-F5GIBIWU.js +0 -1
- package/dist/cdn/chunks/chunk-H5T4U7DM.js +0 -1
- package/dist/cdn/chunks/chunk-HOSTJBJM.js +0 -1
- package/dist/cdn/chunks/chunk-KVTY4E6J.js +0 -1
- package/dist/cdn/chunks/chunk-QWPURAKS.js +0 -1
- package/dist/cdn/chunks/chunk-TIOXYUT7.js +0 -3
- package/dist/cdn/chunks/create-document-capture-PG6NLCPH-SB25EXKH.js +0 -1
- package/dist/cdn/chunks/document-capture-view-I72R2TZK-IPPKCL3Y.js +0 -1
- package/dist/cdn/chunks/eid-view-ZM7QAEME-HFAGVDCQ.js +0 -1
- package/dist/cdn/chunks/email-otp-view-EYS26ZZM-5WX42RSL.js +0 -1
- package/dist/cdn/chunks/flow-views-7SAYQQ62-4RKPVVBZ.js +0 -1
- package/dist/cdn/chunks/form-view-Y5KA6R5T-KP2XRJQ7.js +0 -1
- package/dist/cdn/chunks/plan-runner-BZ7LODPB-KXZ5UKVT.js +0 -1
- package/dist/cdn/chunks/portrait-capture-view-E5LKQQ5Y-MZ3BOZEU.js +0 -1
- package/dist/cdn/chunks/print-SEWS3VHQ-HWJTHADG.js +0 -11
package/dist/define.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"./chunk-
|
|
1
|
+
import{g as e}from"./chunk-2EMXU2MG.js";import"./chunk-VJZANYM3.js";import"./chunk-YVGOUZ7T.js";import"./chunk-734Y6RUV.js";import"./chunk-ZUFN5VIE.js";import"./chunk-5NSMKCTW.js";import"./chunk-MWTOWGEI.js";import"./chunk-6NNMOFMF.js";import"./chunk-D3TZZ4SI.js";import"./chunk-YZ6YGLNN.js";import"./chunk-XI37ATRU.js";import"./chunk-2WYXQYNY.js";import"./chunk-AJHRPKD4.js";import"./chunk-SSU37LFQ.js";e();export{e as defineSekyroElements};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{a as Ke}from"./chunk-ICJ544T4.js";import{d as Fe}from"./chunk-YVGOUZ7T.js";import{a as Ve,b as je,c as Ge}from"./chunk-MWTOWGEI.js";import"./chunk-6NNMOFMF.js";import{a as Ye}from"./chunk-XI37ATRU.js";import"./chunk-2WYXQYNY.js";import{E as Ae,F as Re,G as Be,I as Ee,K as ye,L as ke,a as St,b as Nt,c as E,o as De,q as Ue,v as V,w as me,y as ve}from"./chunk-AJHRPKD4.js";import{a as d,c as Oe,i as s}from"./chunk-SSU37LFQ.js";var i=Oe(St(),1),n=Oe(Nt(),1);import{acceptedTypesFor as xt}from"@sekyro/web";var $t={image:'<path d="M2 12C2 7.29 2 4.93 3.46 3.46C4.93 2 7.29 2 12 2C16.71 2 19.07 2 20.54 3.46C22 4.93 22 7.29 22 12C22 16.71 22 19.07 20.54 20.54C19.07 22 16.71 22 12 22C7.29 22 4.93 22 3.46 20.54C2 19.07 2 16.71 2 12Z" stroke="currentColor"/><path d="M14 8A2 2 0 1 0 18 8A2 2 0 1 0 14 8Z" stroke="currentColor"/><path d="M2 12.5L3.75 10.97C4.66 10.17 6.04 10.22 6.89 11.07L11.18 15.36C11.87 16.05 12.95 16.14 13.75 15.58L14.04 15.37C15.19 14.57 16.74 14.66 17.78 15.6L21 18.5" stroke="currentColor" stroke-linecap="round"/>',flashlight:'<path d="M9 11.66V19C9 19.93 9 20.4 9.15 20.77C9.36 21.26 9.74 21.64 10.23 21.85C10.6 22 11.07 22 12 22C12.93 22 13.4 22 13.77 21.85C14.26 21.64 14.64 21.26 14.85 20.77C15 20.4 15 19.93 15 19V11.66C15 10.84 15 10.43 15.15 10.06C15.3 9.7 15.59 9.41 16.17 8.83L16.17 8.83L19.41 5.59C19.7 5.3 19.85 5.15 19.92 4.97C20 4.78 20 4.58 20 4.17V4C20 3.06 20 2.59 19.71 2.29C19.41 2 18.94 2 18 2H6C5.06 2 4.59 2 4.29 2.29C4 2.59 4 3.06 4 4V4.17C4 4.58 4 4.78 4.08 4.97C4.15 5.15 4.3 5.3 4.59 5.59L7.83 8.83C8.41 9.41 8.7 9.7 8.85 10.06C9 10.43 9 10.84 9 11.66Z" stroke="currentColor" stroke-linecap="round"/><path d="M15 10H9" stroke="currentColor" stroke-linecap="round"/><path d="M12 13V15" stroke="currentColor" stroke-linecap="round"/><path d="M4.5 5H19.5" stroke="currentColor" stroke-linecap="round"/>'},Tt={"dcv3.mrz.searching":"ضع صفحة جواز السفر كاملة داخل الإطار","dcv3.mrz.showMrzSide":"اعرض الوجه الذي يحتوي على سطرين أو ثلاثة أسطر من الحروف","dcv3.mrz.reading":"جارٍ قراءة الوثيقة… ثبّتها","dcv3.mrz.moveCloser":"اقترب حتى تملأ أسطر الحروف الإطار","dcv3.mrz.turnSideways":"أدر هاتفك أفقيًا لقراءة أسطر الحروف","dcv3.mrz.glare":"أمِل الوثيقة لإزالة الانعكاس","dcv3.mrz.holdStill":"لا تتحرك","dcv3.mrz.valid":"تمت قراءة الوثيقة. جارٍ التقاط الصورة","dcv3.mrz.looksLikePassport":"يبدو أن هذا جواز سفر","dcv3.mrz.looksLikeCard":"يبدو أن هذه بطاقة تعريف أو بطاقة إقامة"},ne={"dcv3.mrz.searching":"Fit the whole passport page in the frame","dcv3.mrz.showMrzSide":"Show the side with the two or three lines of characters","dcv3.mrz.reading":"Reading the document… hold it steady","dcv3.mrz.moveCloser":"Move closer so the lines of characters fill the frame","dcv3.mrz.turnSideways":"Turn your phone sideways to read the lines of characters","dcv3.mrz.glare":"Tilt the document to remove the reflection","dcv3.mrz.holdStill":"Hold still","dcv3.mrz.valid":"Document read. Taking the photo","dcv3.mrz.looksLikePassport":"This looks like a passport","dcv3.mrz.looksLikeCard":"This looks like an identity card or residence permit"},Mt={"dcv3.mrz.searching":"Cadrez toute la page du passeport","dcv3.mrz.showMrzSide":"Montrez la face avec les deux ou trois lignes de caractères","dcv3.mrz.reading":"Lecture du document… tenez-le immobile","dcv3.mrz.moveCloser":"Rapprochez-vous pour que les lignes de caractères remplissent le cadre","dcv3.mrz.turnSideways":"Tournez votre téléphone à l’horizontale pour lire les lignes de caractères","dcv3.mrz.glare":"Inclinez le document pour supprimer le reflet","dcv3.mrz.holdStill":"Ne bougez plus","dcv3.mrz.valid":"Document lu. Prise de la photo","dcv3.mrz.looksLikePassport":"Ceci ressemble à un passeport","dcv3.mrz.looksLikeCard":"Ceci ressemble à une carte d’identité ou un titre de séjour"},Lt={"doc.uploadInstead":"رفع صورة بدلًا من ذلك","doc.uploadTitle":"ارفع صورة لوثيقتك","doc.uploadHint":"صورة واضحة للوثيقة كاملة، ملتقطة بكاميرا.","doc.uploadUnsupported":"اختر صورة للوثيقة بصيغة JPEG أو PNG أو HEIC.","doc.uploadFailed":"تعذّر إرسال هذه الصورة. أعد المحاولة.","doc.source.title":"كيف تريد إضافة وثيقتك؟","doc.source.description":"التقط صورة بالكاميرا، أو ارفع صورة للوثيقة من هذا الجهاز.","doc.source.camera":"التقاط صورة","doc.source.upload":"رفع صورة"},ae={"doc.uploadInstead":"Upload a photo instead","doc.uploadTitle":"Upload a photo of your document","doc.uploadHint":"A clear photo of the whole document, taken with a camera.","doc.uploadUnsupported":"Choose a JPEG, PNG or HEIC photo of the document.","doc.uploadFailed":"We could not send this photo. Try again.","doc.source.title":"How do you want to add your document?","doc.source.description":"Take a photo with the camera, or upload a photo of the document from this device.","doc.source.camera":"Take a photo","doc.source.upload":"Upload a photo"},Pt={"doc.uploadInstead":"Téléverser une photo à la place","doc.uploadTitle":"Téléversez une photo de votre document","doc.uploadHint":"Une photo nette du document entier, prise avec un appareil photo.","doc.uploadUnsupported":"Choisissez une photo JPEG, PNG ou HEIC du document.","doc.uploadFailed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","doc.source.title":"Comment voulez-vous ajouter votre document ?","doc.source.description":"Prenez une photo avec la caméra, ou importez une photo du document depuis cet appareil.","doc.source.camera":"Prendre une photo","doc.source.upload":"Importer une photo"},It={"native.doc.introTitle":"سنلتقط صورة لوثيقتك","native.doc.introLead":"تُلتقط الصورة تلقائيًا عندما تكون الوثيقة داخل الإطار.","native.doc.tip.flat":"ضع الوثيقة مسطحة على سطح داكن.","native.doc.tip.glare":"تجنّب انعكاسات الضوء.","native.doc.tip.frame":"أبقِ الوثيقة كاملة داخل الإطار.","native.doc.openCamera":"افتح الكاميرا","native.doc.changeDocument":"تغيير الوثيقة","native.doc.titleOf.carte_identite":"صوّر بطاقة هويتك","native.doc.titleOf.passport":"صوّر جواز سفرك","native.doc.titleOf.residence_permit":"صوّر بطاقة إقامتك","native.doc.titleOf.drivers_license":"صوّر رخصة قيادتك","native.doc.onlyType.carte_identite":"{country}: تُقبل بطاقة الهوية فقط هنا.","native.doc.onlyType.passport":"{country}: يُقبل جواز السفر فقط هنا.","native.doc.onlyType.residence_permit":"{country}: تُقبل بطاقة الإقامة فقط هنا.","native.doc.onlyType.drivers_license":"{country}: تُقبل رخصة القيادة فقط هنا.","native.scan.closer":"اقترب قليلًا","native.scan.farther":"ابتعد قليلًا","native.scan.glare":"أمِل البطاقة قليلًا","native.scan.dark":"الإضاءة ضعيفة. شغّل المصباح.","native.scan.blurry":"الصورة غير واضحة. ثبّت الهاتف.","native.scan.holdStill":"لا تتحرك","native.scan.reading":"جارٍ التحقق من وثيقتك…","native.scan.putDown":"يمكنك وضع وثيقتك جانبًا.","native.scan.retry":"لنحاول مرة أخرى","native.scan.seenPassport":"يبدو أن هذا جواز سفر","native.scan.seenCard":"يبدو أن هذه بطاقة هوية أو بطاقة إقامة","native.scan.showInstead.carte_identite":"أظهر بطاقة هويتك بدلًا منها","native.scan.showInstead.passport":"أظهر صفحة الصورة في جواز سفرك بدلًا منها","native.scan.showInstead.residence_permit":"أظهر بطاقة إقامتك بدلًا منها","native.scan.showInstead.drivers_license":"أظهر رخصة قيادتك بدلًا منها"},oe={"native.doc.introTitle":"Photograph your document","native.doc.introLead":"The photo is taken by itself once the document is in the frame.","native.doc.tip.flat":"Lay it flat on a dark surface.","native.doc.tip.glare":"Avoid glare from lights.","native.doc.tip.frame":"Keep all of it in the frame.","native.doc.openCamera":"Open the camera","native.doc.changeDocument":"Change document","native.doc.titleOf.carte_identite":"Photograph your identity card","native.doc.titleOf.passport":"Photograph your passport","native.doc.titleOf.residence_permit":"Photograph your residence permit","native.doc.titleOf.drivers_license":"Photograph your driver's license","native.doc.onlyType.carte_identite":"{country}: only an identity card is accepted here.","native.doc.onlyType.passport":"{country}: only a passport is accepted here.","native.doc.onlyType.residence_permit":"{country}: only a residence permit is accepted here.","native.doc.onlyType.drivers_license":"{country}: only a driver's license is accepted here.","native.scan.closer":"Move a little closer","native.scan.farther":"Move back a little","native.scan.glare":"Tilt the card a little","native.scan.dark":"Too dark. Turn on the light.","native.scan.blurry":"Blurry image. Hold the phone still.","native.scan.holdStill":"Hold still","native.scan.reading":"Checking your document…","native.scan.putDown":"You can put your document down.","native.scan.retry":"Let's try that again","native.scan.seenPassport":"This looks like a passport","native.scan.seenCard":"This looks like an identity card or residence permit","native.scan.showInstead.carte_identite":"Show your identity card instead","native.scan.showInstead.passport":"Show the photo page of your passport instead","native.scan.showInstead.residence_permit":"Show your residence permit instead","native.scan.showInstead.drivers_license":"Show your driver's license instead"},Ht={"native.doc.introTitle":"Photographiez votre pièce","native.doc.introLead":"La photo se prend toute seule quand la pièce est bien cadrée.","native.doc.tip.flat":"Posez la pièce à plat sur fond sombre.","native.doc.tip.glare":"Évitez les reflets de lumière.","native.doc.tip.frame":"Gardez toute la pièce dans le cadre.","native.doc.openCamera":"Ouvrir la caméra","native.doc.changeDocument":"Changer de document","native.doc.titleOf.carte_identite":"Photographiez votre carte d'identité","native.doc.titleOf.passport":"Photographiez votre passeport","native.doc.titleOf.residence_permit":"Photographiez votre titre de séjour","native.doc.titleOf.drivers_license":"Photographiez votre permis de conduire","native.doc.onlyType.carte_identite":"{country} : seule la carte d'identité est acceptée ici.","native.doc.onlyType.passport":"{country} : seul le passeport est accepté ici.","native.doc.onlyType.residence_permit":"{country} : seul le titre de séjour est accepté ici.","native.doc.onlyType.drivers_license":"{country} : seul le permis de conduire est accepté ici.","native.scan.closer":"Approchez un peu","native.scan.farther":"Reculez un peu","native.scan.glare":"Inclinez un peu la carte","native.scan.dark":"Trop sombre. Allumez la lampe.","native.scan.blurry":"Image floue. Tenez le téléphone immobile.","native.scan.holdStill":"Ne bougez plus","native.scan.reading":"Vérification de votre document…","native.scan.putDown":"Vous pouvez poser votre pièce.","native.scan.retry":"Réessayons","native.scan.seenPassport":"Ceci ressemble à un passeport","native.scan.seenCard":"Ceci ressemble à une carte d'identité ou un titre de séjour","native.scan.showInstead.carte_identite":"Montrez plutôt votre carte d'identité","native.scan.showInstead.passport":"Montrez plutôt la page photo de votre passeport","native.scan.showInstead.residence_permit":"Montrez plutôt votre titre de séjour","native.scan.showInstead.drivers_license":"Montrez plutôt votre permis de conduire"},F,We=(F=class{constructor(){this.shown=null,this.shownAt=0,this.yielded=null}present(e,a,o,r){(e===null||e.key!==this.yielded)&&(this.yielded=null);let u=this.shown;return e!==null&&this.yielded===null?u?.kind==="problem"&&u.key===e.key&&u.action===e.action?!e.blocking&&a!==null&&r-this.shownAt>=3e3?(this.yielded=e.key,this.show({kind:"hint",key:a,action:null},r)):u:this.show({kind:"problem",key:e.key,action:e.action},r):u?.kind==="problem"&&e===null&&(o||r-this.shownAt<3e3)?u:a===null?this.show(null,r):u?.kind==="hint"&&u.key===a?u:this.show({kind:"hint",key:a,action:null},r)}show(e,a){return this.shown=e,this.shownAt=a,e}},d(F,"ge"),F);s(We,"NoticeBand");var Ot=We,Dt=["locking","capturing"],K,Xe=(K=class{constructor(){this.shown={hint:null,locking:!1,card:null,manualShutter:!1},this.candidate=null,this.candidateSince=0,this.hintShownAt=0,this.lockLostAt=null,this.detectedSince=null,this.lostSince=null,this.shutterSince=null}present(e,a){return this.presentHint(e,a),this.presentLock(e,a),this.presentCard(e,a),this.shutterSince=e.manualShutter?this.shutterSince??a:null,this.shown={...this.shown,manualShutter:this.shutterSince!==null&&a-this.shutterSince>=1e3},this.shown}presentHint(e,a){let o=e.phase==="framing"&&!(e.hint==="blurry"&&e.card===null)?e.hint:null;if(e.phase!=="framing"){this.shown={...this.shown,hint:null},this.candidate=null;return}if(o!==this.candidate&&(this.candidate=o,this.candidateSince=a),o===this.shown.hint)return;let r=a-this.candidateSince>=(o===null?0:350),u=this.shown.hint===null||a-this.hintShownAt>=2500;r&&u&&(this.shown={...this.shown,hint:o},this.hintShownAt=a)}presentLock(e,a){if(Dt.includes(e.phase)){this.shown={...this.shown,locking:!0},this.lockLostAt=null;return}if(this.shown.locking){if(e.phase!=="framing"){this.shown={...this.shown,locking:!1},this.lockLostAt=null;return}this.lockLostAt??(this.lockLostAt=a),a-this.lockLostAt>=300&&(this.shown={...this.shown,locking:!1},this.lockLostAt=null)}}presentCard(e,a){let o=e.card;if(o===null||e.phase!=="framing"){if(e.phase!=="framing"){this.shown={...this.shown,card:null},this.detectedSince=null,this.lostSince=null;return}this.detectedSince=null,this.lostSince??(this.lostSince=a),a-this.lostSince>=300&&(this.shown={...this.shown,card:null});return}if(this.lostSince=null,this.detectedSince??(this.detectedSince=a),a-this.detectedSince<250)return;let r=this.shown.card;if(r===null){this.shown={...this.shown,card:{...o}};return}let u=.35;this.shown={...this.shown,card:{fill:r.fill+(o.fill-r.fill)*u,offsetX:r.offsetX+(o.offsetX-r.offsetX)*u,offsetY:r.offsetY+(o.offsetY-r.offsetY)*u}}}},d(K,"Se"),K);s(Xe,"ScanPresenter");var Ut=Xe,At={en:oe,fr:Ht,ar:It,es:oe,pt:oe,de:oe},Rt=450,ge=s(t=>(e,a)=>Ye(t.strings[e]??At[t.locale][e]??"",a),"useScanCopy");function Qe(t,e){try{return new Intl.DisplayNames([e],{type:"region"}).of(t)??t}catch{return t}}d(Qe,"Nt");s(Qe,"regionName");function Ze(t){let e=t.documentType,a=e===null?"native.doc.introTitle":`native.doc.titleOf.${e}`,o=e!==null&&t.issuer!==null&&xt(t.documents,t.issuer).length===1;return{titleKey:a,onlyKey:o?`native.doc.onlyType.${e}`:null}}d(Ze,"Dt");s(Ze,"introCopy");function Q({name:t}){return(0,n.jsx)("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:$t[t]}})}d(Q,"se");s(Q,"ScanGlyph");var Bt={en:ne,fr:Mt,ar:Tt,es:ne,pt:ne,de:ne},Et={en:ae,fr:Pt,ar:Lt,es:ae,pt:ae,de:ae},Vt="image/jpeg,image/png,image/heic,image/heif";function j(t){let e=t.strings,a=s(o=>e[o]??Et[t.locale][o],"text");return{t:s(o=>a(o)??"","t")}}d(j,"W");s(j,"uploadCopy");function qe(t,e){return t===null||t.state==="fallback"||t.state==="mismatch"?null:t.state==="searching"?e?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":t.state==="valid"?"dcv3.mrz.valid":t.coach==="holdStill"?"dcv3.mrz.holdStill":"dcv3.mrz.reading"}d(qe,"Mt");s(qe,"mrzInstruction");function Je(t){return t?.state==="reading"&&t.coach!==void 0&&t.coach!=="holdStill"?`mrz:${t.coach}`:null}d(Je,"Pt");s(Je,"mrzHint");function et(t){return t==="carte_identite"||t==="passport"||t==="residence_permit"||t==="drivers_license"?`native.scan.showInstead.${t}`:null}d(et,"It");s(et,"showInsteadKey");var jt={document_type_mismatch:"doc.reason_document_type_mismatch",document_number_invalid:"doc.reason_document_number_invalid",provider_unavailable:"doc.reason_provider_unavailable",document_type_not_supported:"doc.reason_document_type_not_supported",document_sides_mismatch:"doc.reason_document_sides_mismatch"};function re(t){if(t.reason==="unreadable")return"doc.reason_unreadable";let e=t.reason!==void 0?jt[t.reason]:void 0;return e!==void 0?e:t.reason==="tester_document_mismatch"?"reasons.tester_document_mismatch":t.reason!==void 0&&t.reason!=="side_missing"?Ue(t.reason):null}d(re,"be");s(re,"reasonOf");var tt=new Set(["document_type_not_accepted","tester_document_mismatch","document_type_mismatch","provider_unavailable","document_type_not_supported","document_sides_mismatch"]);function Gt({step:t,i18n:e,liveMrz:a,barcodeAssetBaseUrl:o,ageLead:r,...u}){let[w,h]=(0,i.useState)(!1),y=(0,i.useRef)(-1),[f,g]=(0,i.useState)("idle"),N=(0,i.useRef)(null),_=typeof t.uploadDocument=="function",z=_?t.photo?.source??"camera":"camera",M=_&&z!=="camera"&&t.photo?.uploadOffered===!0,[C,G]=(0,i.useState)(null),H=z==="upload"?"upload":z==="choice"?C??t.photo?.pick??"source":"camera",O=f==="sending"?void 0:()=>N.current?.click(),k=s(async D=>{let q=D.currentTarget.files?.[0];if(D.currentTarget.value="",q!==void 0){h(!1),g("sending");try{await t.uploadDocument(q),g("idle")}catch(X){g(X instanceof TypeError&&X.message==="unsupported_file"?"unsupported":"failed")}}},"onFile"),Z=M?(0,n.jsx)("input",{ref:N,type:"file",accept:Vt,hidden:!0,"data-testid":"sekyro-doc-upload","aria-label":j(e).t("doc.uploadTitle"),onChange:d(D=>{k(D)},"onChange")}):null,x=j(e),W=t.photo?.cameraOnPhone===!0;return H==="camera"&&W?(0,n.jsx)(Fe,{i18n:e,lead:e.t("handoff.lead.document"),refresh:t.refresh,actions:(0,n.jsx)(E,{kind:"ghost",full:!0,onClick:d(()=>G("upload"),"onClick"),children:x.t("doc.source.upload")})}):H==="source"?(0,n.jsx)(Ke,{testId:"sekyro-doc-source",title:x.t("doc.source.title"),lead:x.t("doc.source.description"),cameraLabel:W?e.t("capture.source.phone"):x.t("doc.source.camera"),onPhone:W,uploadLabel:x.t("doc.source.upload"),notice:(0,n.jsx)(ie,{step:t,i18n:e}),onCamera:d(()=>G("camera"),"onCamera"),onUpload:d(()=>G("upload"),"onUpload")}):H==="upload"?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ot,{step:t,i18n:e,ageLead:r===!0,upload:f,offered:M,onPick:d(()=>N.current?.click(),"onPick"),...z==="choice"?{onCamera:s(()=>G("camera"),"onCamera")}:{},...u}),Z]}):(0,n.jsxs)(n.Fragment,{children:[w?(0,n.jsx)(rt,{step:t,i18n:e,attempts:y,...a!==void 0?{liveMrz:a}:{},...o!==void 0?{barcodeAssetBaseUrl:o}:{},...M&&O!==void 0?{onUpload:O}:{},onClose:d(()=>h(!1),"onClose")}):(0,n.jsx)(at,{step:t,i18n:e,ageLead:r===!0,onOpen:d(()=>h(!0),"onOpen"),upload:f,...M&&O!==void 0?{onUpload:O}:{},...u}),Z]})}d(Gt,"Pn");s(Gt,"DocumentCaptureView");function we({passport:t}){let e=Math.round(228/(t?1.42:1.586));return(0,n.jsxs)("svg",{className:`sekyro-mark sekyro-mark--card${t?" sekyro-mark--passport":""}`,viewBox:`-12 ${t?-22:-12} 252 ${e+(t?34:24)}`,"aria-hidden":"true",focusable:"false",children:[(0,n.jsx)("defs",{children:(0,n.jsx)("clipPath",{id:"sekyro-card-clip",children:(0,n.jsx)("rect",{width:228,height:e,rx:"12.5"})})}),t?(0,n.jsx)("rect",{className:"sekyro-mark__page",x:"10",y:"-14",width:208,height:e,rx:"10"}):null,(0,n.jsx)("rect",{className:"sekyro-mark__card",width:228,height:e,rx:"12.5"}),(0,n.jsx)("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:e*(t?.5:.62),rx:"6"}),[0,1,2].map(a=>(0,n.jsx)("rect",{className:"sekyro-mark__text",x:"88",y:23+a*e*.12,width:100-a*20,height:"6",rx:"3"},a)),t?[0,1].map(a=>(0,n.jsx)("line",{className:"sekyro-mark__code",x1:"17",x2:211,y1:e*.75+a*11,y2:e*.75+a*11},a)):(0,n.jsx)("rect",{className:"sekyro-mark__text",x:"88",y:23+3*e*.12,width:"60",height:"6",rx:"3"}),(0,n.jsx)("g",{clipPath:"url(#sekyro-card-clip)",children:(0,n.jsx)("g",{className:"sekyro-mark__read",style:{"--sekyro-read-w":"228px"},children:(0,n.jsx)("rect",{x:"-1",width:"2",height:e,className:"sekyro-mark__beam"})})}),(0,n.jsx)("path",{className:"sekyro-mark__brackets",d:nt(-10,-10,248,e+20,16,30)})]})}d(we,"rt");s(we,"ScanMark");function nt(t,e,a,o,r,u){let w=Math.min(r,u*.6);return[[t,e,1,1],[t+a,e,-1,1],[t,e+o,1,-1],[t+a,e+o,-1,-1]].map(([h,y,f,g])=>`M${h} ${y+g*u}V${y+g*w}Q${h} ${y} ${h+f*w} ${y}H${h+f*u}`).join("")}d(nt,"Ht");s(nt,"brackets");function at({step:t,i18n:e,ageLead:a,onOpen:o,onChangeCountry:r,onChangeDocument:u,upload:w,onUpload:h}){let y=ge(e),f=j(e),g=t.documentType==="passport",N=Ze(t),_=re(t),z=w==="sending",M=(0,i.useContext)(Re)?.busy===!0;return(0,n.jsxs)("section",{className:"sekyro-step sekyro-step--doc-intro","data-testid":"sekyro-document",children:[(0,n.jsx)(we,{passport:g}),(0,n.jsx)(me,{title:y(N.titleKey)||y("native.doc.introTitle"),lead:a?e.t("doc.ageStepUp"):y("native.doc.introLead")}),N.onlyKey!==null&&t.issuer!==null?(0,n.jsx)("p",{className:"sekyro-text-muted sekyro-doc-only",children:y(N.onlyKey,{country:Qe(t.issuer,e.locale)})}):null,(0,n.jsx)(ie,{step:t,i18n:e}),t.reason!==void 0&&tt.has(t.reason)?null:(0,n.jsxs)("ul",{className:"sekyro-tiprows",children:[(0,n.jsxs)("li",{children:[(0,n.jsx)(V,{name:g?"passport":"card"}),y("native.doc.tip.flat")]}),(0,n.jsxs)("li",{children:[(0,n.jsx)(V,{name:"light"}),y("native.doc.tip.glare")]}),(0,n.jsxs)("li",{children:[(0,n.jsx)(Q,{name:"image"}),y("native.doc.tip.frame")]})]}),(0,n.jsx)(Ce,{i18n:e,...u!==void 0?{onChangeDocument:u}:{},...r!==void 0?{onChangeCountry:r}:{}}),(0,n.jsx)(be,{i18n:e,upload:w}),z?(0,n.jsx)("p",{className:"sekyro-text-muted",role:"status",children:e.t("doc.uploading")}):h!==void 0?(0,n.jsx)("p",{className:"sekyro-text-muted",children:f.t("doc.uploadHint")}):null,(0,n.jsxs)(ve,{children:[(0,n.jsxs)(E,{full:!0,onClick:o,disabled:z||M,children:[(0,n.jsx)(V,{name:"camera"}),y("native.doc.openCamera")]}),h!==void 0?(0,n.jsxs)(E,{full:!0,kind:"ghost",onClick:h,children:[(0,n.jsx)(Q,{name:"image"}),f.t("doc.uploadInstead")]}):null]})]})}d(at,"Ot");s(at,"DocumentIntro");function ie({step:t,i18n:e}){let a=re(t);return a===null?null:(0,n.jsxs)(ye,{tone:"warning",children:[(0,n.jsx)("span",{children:e.t(a)}),(0,n.jsx)("span",{children:ke(e,t.attemptsRemaining,t.attemptsExhausted)})]})}d(ie,"_e");s(ie,"ReasonNotice");function Ce({i18n:t,onChangeCountry:e,onChangeDocument:a}){let o=ge(t);return a===void 0&&e===void 0?null:(0,n.jsxs)("div",{className:"sekyro-links",children:[a!==void 0?(0,n.jsx)("button",{type:"button",className:"sekyro-link",onClick:a,children:o("native.doc.changeDocument")}):null,e!==void 0?(0,n.jsx)("button",{type:"button",className:"sekyro-link",onClick:e,children:t.t("native.doc.changeCountry")}):null]})}d(Ce,"at");s(Ce,"ChangeLinks");function be({i18n:t,upload:e}){return e!=="unsupported"&&e!=="failed"?null:(0,n.jsx)(ye,{tone:"warning",children:(0,n.jsx)("span",{children:j(t).t(e==="unsupported"?"doc.uploadUnsupported":"doc.uploadFailed")})})}d(be,"st");s(be,"UploadNotice");function ot({step:t,i18n:e,ageLead:a,upload:o,offered:r,onPick:u,onCamera:w,onChangeCountry:h,onChangeDocument:y}){let f=j(e),g=o==="sending";return(0,n.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-doc-upload-screen",children:[(0,n.jsx)(we,{passport:t.documentType==="passport"}),(0,n.jsx)(me,{title:f.t("doc.uploadTitle"),lead:a?e.t("doc.ageStepUp"):f.t("doc.uploadHint")}),a?(0,n.jsx)("p",{className:"sekyro-text-muted",children:f.t("doc.uploadHint")}):null,(0,n.jsx)(ie,{step:t,i18n:e}),(0,n.jsx)(Ce,{i18n:e,...y!==void 0?{onChangeDocument:y}:{},...h!==void 0?{onChangeCountry:h}:{}}),(0,n.jsx)(be,{i18n:e,upload:o}),g?(0,n.jsx)("p",{className:"sekyro-text-muted",role:"status",children:e.t("doc.uploading")}):null,(0,n.jsxs)(ve,{children:[(0,n.jsxs)(E,{full:!0,onClick:u,disabled:g||!r||t.attemptsExhausted,children:[(0,n.jsx)(Q,{name:"image"}),f.t("doc.source.upload")]}),w!==void 0?(0,n.jsxs)(E,{full:!0,kind:"ghost",onClick:w,disabled:g,children:[(0,n.jsx)(V,{name:"camera"}),f.t("doc.source.camera")]}):null]})]})}d(ot,"Rt");s(ot,"DocumentUploadScreen");function fe(t,e,a){let o=t*.88,r=o/a;return{x:(t-o)/2,y:e*.42-r/2,w:o,h:r}}d(fe,"tt");s(fe,"guideRect");var Yt={"mrz:moveCloser":"dcv3.mrz.moveCloser","mrz:turnSideways":"dcv3.mrz.turnSideways","mrz:glare":"dcv3.mrz.glare",too_far:"native.scan.closer",too_close:"native.scan.farther",focus_far:"native.scan.farther",glare:"native.scan.glare",too_bright:"native.scan.glare",too_dark:"native.scan.dark",blurry:"native.scan.blurry"},Ft=s(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function rt({step:t,i18n:e,liveMrz:a,barcodeAssetBaseUrl:o,onClose:r,attempts:u,onUpload:w}){let h=ge(e),y=(0,i.useContext)(Ve),f=(0,i.useRef)(y);f.current=y;let g=(0,i.useRef)(null),N=(0,i.useRef)(null),_=(0,i.useRef)(null),[z,M]=(0,i.useState)("idle"),[C,G]=(0,i.useState)(null),[H,O]=(0,i.useState)(null),[k,Z]=(0,i.useState)({w:0,h:0}),[x,W]=(0,i.useState)({hint:null,locking:!1,card:null,manualShutter:!1}),[D,q]=(0,i.useState)({}),[X,ut]=(0,i.useState)(null),[_e,ht]=(0,i.useState)(null),[ze,Se]=(0,i.useState)(0),[Ne,xe]=(0,i.useState)(null),[se,pt]=(0,i.useState)(null),[le,mt]=(0,i.useState)(0),$e=(0,i.useRef)(0);$e.current=le;let U=t.documentType==="passport",J=U?1.42:1.586;Ae(!0),(0,i.useLayoutEffect)(()=>{let c=g.current;if(c===null)return;let m=s(()=>Z({w:c.clientWidth,h:c.clientHeight}),"measure");if(m(),typeof ResizeObserver>"u")return;let p=new ResizeObserver(m);return p.observe(c),()=>p.disconnect()},[]);let l=fe(k.w,k.h,J);(0,i.useEffect)(()=>{k.w===0||k.h===0||_.current?.setGuide?.({viewAspect:k.w/k.h,rect:{x:l.x/k.w,y:l.y/k.h,width:l.w/k.w,height:l.h/k.h}})},[k.w,k.h,l.x,l.y,l.w,l.h]),(0,i.useEffect)(()=>{let c=N.current;if(c===null)return;let m=t.capture({video:c,...a!==void 0?{liveMrz:a}:{},...o!==void 0?{barcodeAssetBaseUrl:o}:{}});_.current=m;let p=g.current;if(p!==null&&p.clientWidth>0&&p.clientHeight>0){let v=fe(p.clientWidth,p.clientHeight,J);m.setGuide?.({viewAspect:p.clientWidth/p.clientHeight,rect:{x:v.x/p.clientWidth,y:v.y/p.clientHeight,width:v.w/p.clientWidth,height:v.h/p.clientHeight}})}let P=new Ut,b={scan:null,feedback:null,gate:null,mrz:null},I=s(v=>{b={...b,...v};let $=b.gate?.guide,zt={phase:b.scan?.phase??"framing",hint:b.feedback?.reticle==="coaching"?b.feedback.key:t.documentType==="drivers_license"?null:Je(b.mrz),card:$?.detected?{fill:$.fill,offsetX:$.offsetX,offsetY:$.offsetY}:null,manualShutter:b.scan?.manualShutter??!1},R=P.present(zt,performance.now());W(B=>B.hint===R.hint&&B.locking===R.locking&&B.manualShutter===R.manualShutter&&B.card?.fill===R.card?.fill&&B.card?.offsetX===R.card?.offsetX&&B.card?.offsetY===R.card?.offsetY?B:R)},"present"),_t=[m.on("state",M),m.on("feedback",v=>I({feedback:v})),m.on("gate",v=>I({gate:v})),m.on("scan",v=>{G(v),I({scan:v})}),m.on("captured",v=>{mt($=>$+1),q($=>({...$,[lt(v.side,U,$)]:v.previewDataUrl})),ut(v.previewDataUrl),ht(dt(c))}),m.on("error",v=>{O(v);let $=f.current;$!==null&&Ge($,je("document",v,Math.max(0,u.current)))}),m.on("mrz",v=>{v.state==="mismatch"?pt({format:v.format??null,at:$e.current}):(xe(v),I({mrz:v}))})];return u.current+=1,m.start().catch(()=>{}),()=>{for(let v of _t)v();m.destroy(),_.current=null}},[t.issuer,t.documentType]);let T=C?.phase??"framing",L=T==="reading"||T==="result",ce=T==="flipCue"||T==="reaskRecto",A=x.locking,Te=C?.captured.length??0;(0,i.useEffect)(()=>{A&&Se(c=>c+1)},[A]),(0,i.useEffect)(()=>{Te>0&&Se(c=>c+1)},[Te]);let vt=C?.expected??null;(0,i.useEffect)(()=>{xe(null)},[vt]);let de=ce||L||t.documentType==="drivers_license"?null:qe(Ne,U),Me=s(c=>e.strings[c]??Bt[e.locale][c],"liveText"),yt=s(c=>c.startsWith("dcv3.")?Me(c):h(c),"copy"),ue=de!==null?Me(de):h(T==="flipCue"?"doc.flip":T==="reaskRecto"?"doc.reaskRecto":L?"native.scan.reading":T==="locking"||T==="capturing"||A?"native.scan.holdStill":U?"doc.showPage":"doc.showSide"),ee=re(t),Le=s(c=>({key:h(c),action:ke(e,t.attemptsRemaining,t.attemptsExhausted),blocking:t.reason!==void 0&&tt.has(t.reason)}),"reasonProblem"),Pe=et(t.documentType),kt=se!==null&&le<=se.at+1?{key:h(se.format==="TD3"?"native.scan.seenPassport":"native.scan.seenCard"),action:Pe===null?null:h(Pe),blocking:!0}:C?.notice==="same_face"?{key:h("doc.sameFace"),action:null,blocking:!1}:C?.notice==="reread"?ee!==null?Le(ee):{key:h("doc.reread"),action:null,blocking:!1}:C?.notice==="technical"?{key:h("native.scan.retry"),action:null,blocking:!1}:C?.notice==="blurry"?{key:h("native.scan.blurry"),action:null,blocking:!1}:ee!==null&&le===0?Le(ee):null,ft=x.hint===null?null:yt(Yt[x.hint]??`dcv2.${x.hint}`),Ie=it(kt,ft,A||T==="capturing"||L),Y=x.card,S=l;if(!A&&Y!==null&&Y.fill>=.45&&Y.fill<=1.25&&!Ft()){let c=l.w*Y.fill,m=c/J,p=l.x+l.w/2+l.w*Math.max(-.25,Math.min(.25,Y.offsetX)),P=l.y+l.h/2+l.h*Math.max(-.25,Math.min(.25,Y.offsetY));S={x:p-c/2,y:P-m/2,w:c,h:m}}let te=l.w*.045,he=28,He=Math.min(te,he*.6),gt=[[S.x,S.y,1,1],[S.x+S.w,S.y,-1,1],[S.x,S.y+S.h,1,-1],[S.x+S.w,S.y+S.h,-1,-1]],wt=A?"is-locked":Ie!==null?"is-coaching":"",Ct=U?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],bt=l.y+l.h+16,pe={insetInlineStart:l.x,insetBlockStart:l.y,inlineSize:l.w,blockSize:l.h,borderRadius:te};return(0,n.jsx)("section",{className:"sekyro-lm","aria-label":ue,"data-testid":"sekyro-document",children:(0,n.jsxs)("div",{ref:g,className:`sekyro-lm-stage${L?" is-reading":""}${ce?" is-flip":""}`,style:{"--sekyro-guide-w":`${l.w}px`},children:[(0,n.jsx)("video",{ref:N,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:d(c=>{let m=c.currentTarget,p=m.getBoundingClientRect(),P=Math.max(p.width/(m.videoWidth||1),p.height/(m.videoHeight||1)),b=m.videoWidth*P,I=m.videoHeight*P;b>0&&I>0&&_.current?.focusAt((c.clientX-p.left+(b-p.width)/2)/b,(c.clientY-p.top+(I-p.height)/2)/I)},"onPointerUp")}),k.w>0?(0,n.jsxs)(n.Fragment,{children:[L&&_e!==null?(0,n.jsx)("img",{className:"sekyro-lm-scene",src:_e,alt:""}):null,L&&X!==null?(0,n.jsx)("img",{className:"sekyro-lm-frozen",src:X,alt:"",style:pe}):null,(0,n.jsxs)("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${k.w} ${k.h}`,"aria-hidden":"true",focusable:"false",children:[(0,n.jsxs)("defs",{children:[(0,n.jsxs)("linearGradient",{id:"sekyro-lm-top",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,n.jsx)("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0.85"}),(0,n.jsx)("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0"})]}),(0,n.jsxs)("linearGradient",{id:"sekyro-lm-bottom",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,n.jsx)("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0"}),(0,n.jsx)("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0.9"})]})]}),(0,n.jsx)("path",{className:"sekyro-lm-scrim",fillRule:"evenodd",d:`M0 0H${k.w}V${k.h}H0Z${ct(l,te)}`}),(0,n.jsx)("rect",{width:k.w,height:Math.max(0,l.y),fill:"url(#sekyro-lm-top)"}),(0,n.jsx)("rect",{y:l.y+l.h,width:k.w,height:Math.max(0,k.h-l.y-l.h),fill:"url(#sekyro-lm-bottom)"}),(0,n.jsx)("g",{className:`sekyro-lm-brackets ${wt}`,children:gt.map(([c,m,p,P],b)=>(0,n.jsx)("path",{style:{transform:`translate(${c}px, ${m}px) scale(${p}, ${P})`},d:`M0 ${he}V${He}Q0 0 ${He} 0H${he}`},b))}),A?(0,n.jsx)("rect",{className:"sekyro-lm-trace",x:l.x,y:l.y,width:l.w,height:l.h,rx:te,pathLength:"1",style:{animationDuration:`${Rt}ms`}}):null]}),(0,n.jsx)("div",{className:"sekyro-lm-slot",style:pe,"aria-hidden":"true",children:L?(0,n.jsx)("span",{className:"sekyro-lm-read is-repeating"}):ze>0?(0,n.jsx)("span",{className:"sekyro-lm-read"},ze):null})]}):null,de!==null?(0,n.jsx)("div",{className:"sekyro-lm-slot",style:pe,"aria-hidden":"true",children:(0,n.jsx)("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${U?" is-page":""}${Ne?.state==="valid"?" is-valid":""}`})}):null,(0,n.jsx)("div",{className:"sekyro-lm-instruction",style:{insetBlockStart:l.y-64},children:(0,n.jsx)("div",{role:"status","aria-live":"polite","data-testid":"sekyro-scan-instruction",children:(0,n.jsx)(Ee,{swapKey:ue,className:"sekyro-lm-line",children:ue})})}),(0,n.jsxs)("div",{className:"sekyro-lm-below",style:{insetBlockStart:bt,inlineSize:l.w,insetInlineStart:l.x},children:[(0,n.jsx)(st,{band:Ie}),L?(0,n.jsxs)("p",{className:"sekyro-lm-note",children:[(0,n.jsx)("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),h("native.scan.putDown")]}):ce?(0,n.jsx)("div",{className:`sekyro-lm-flip${T==="reaskRecto"?" is-toFront":""}`,"data-testid":"sekyro-flip-cue","aria-hidden":"true",children:(0,n.jsxs)("span",{className:"sekyro-lm-flip-card",style:{aspectRatio:String(J)},children:[(0,n.jsx)("span",{className:"sekyro-lm-flip-front"}),(0,n.jsx)("span",{className:"sekyro-lm-flip-back"})]})}):null]}),(0,n.jsxs)("div",{className:"sekyro-lm-controls",children:[(0,n.jsxs)("div",{className:"sekyro-lm-bar",children:[(0,n.jsx)("button",{type:"button",className:"sekyro-glass","aria-label":e.t("native.close"),onClick:r,children:(0,n.jsx)(V,{name:"close"})}),C?.torchAvailable?(0,n.jsx)("button",{type:"button",className:`sekyro-glass${C.torch?" is-on":""}`,"aria-label":e.t("doc.torchOn"),"aria-pressed":C.torch,onClick:d(()=>_.current?.setTorch(!C.torch),"onClick"),children:(0,n.jsx)(Q,{name:"flashlight"})}):null]}),H!==null?(0,n.jsxs)("div",{className:"sekyro-lm-error",role:"alert",children:[(0,n.jsx)("p",{children:e.t("doc.cameraBlocked")}),(0,n.jsx)("p",{children:e.t(H.kind==="permission"?"doc.cameraBlockedHint":De(H.kind))}),(0,n.jsx)(E,{onClick:d(()=>{O(null),u.current+=1,_.current?.retry()},"onClick"),children:e.t("doc.retryCamera")})]}):null,x.manualShutter?(0,n.jsx)("button",{type:"button",className:"sekyro-shutter","aria-label":e.t("doc.shutter"),onClick:d(()=>_.current?.shutter(),"onClick")}):null,(0,n.jsx)("ol",{className:"sekyro-lm-tray",children:Ct.map(({side:c,label:m})=>{let p=C?.captured.includes(c)??!1;return(0,n.jsxs)("li",{className:p?"is-done":void 0,"aria-current":!p&&(U||C?.expected===c)?"step":void 0,children:[p?(0,n.jsxs)("span",{className:"sekyro-lm-thumb",children:[D[c]!==void 0?(0,n.jsx)("img",{src:D[c],alt:""}):null,(0,n.jsx)("svg",{className:"sekyro-lm-check",viewBox:"0 0 18 18","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})]}):null,h(m)]},c)})}),w!==void 0?(0,n.jsx)("button",{type:"button",className:"sekyro-lm-upload",onClick:w,children:j(e).t("doc.uploadInstead")}):null,z==="uploading"||z==="checking"?null:(0,n.jsx)(Be,{onStop:r})]}),z==="uploading"||z==="checking"?(0,n.jsx)("span",{className:"sekyro-visually-hidden",role:"status",children:z==="uploading"?e.t("doc.uploading"):h("native.scan.reading")}):null]})})}d(rt,"Kt");s(rt,"LumiereScan");function it(t,e,a){let o=(0,i.useRef)(null);o.current??(o.current=new Ot);let[r,u]=(0,i.useState)(null),w=(0,i.useRef)({problem:t,hint:e,busy:a});w.current={problem:t,hint:e,busy:a};let h=t===null?null:`${t.blocking}|${t.key}|${t.action??""}`;return(0,i.useEffect)(()=>{let y=s(()=>{let{problem:g,hint:N,busy:_}=w.current;u(o.current?.present(g,N,_,performance.now())??null)},"run");y();let f=setInterval(y,250);return()=>clearInterval(f)},[h,e,a]),r}d(it,"At");s(it,"useNoticeBand");function st({band:t}){let[e,a]=(0,i.useState)(t);(0,i.useEffect)(()=>{t!==null&&a(t)},[t]);let o=t??e;return(0,n.jsx)("div",{className:`sekyro-lm-band${t!==null?" is-open":""}`,"data-testid":"sekyro-scan-notice",children:(0,n.jsx)("div",{role:"status","aria-live":"polite","aria-atomic":"true",children:o!==null?(0,n.jsxs)("div",{className:"sekyro-notice sekyro-notice--warning","data-kind":o.kind,"aria-hidden":t===null||void 0,children:[(0,n.jsx)("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:(0,n.jsx)(V,{name:"warning"})}),(0,n.jsxs)("div",{className:"sekyro-notice__body",children:[(0,n.jsx)("span",{children:o.key}),o.action!==null&&o.action!==""?(0,n.jsx)("span",{children:o.action}):null]})]}):null})})}d(st,"Bt");s(st,"NoticeBandView");function lt(t,e,a){return e?"single":t==="recto"||t==="verso"?t:a.recto===void 0?"recto":"verso"}d(lt,"Vt");s(lt,"slotOf");function ct({x:t,y:e,w:a,h:o},r){return`M${t+r} ${e}H${t+a-r}Q${t+a} ${e} ${t+a} ${e+r}V${e+o-r}Q${t+a} ${e+o} ${t+a-r} ${e+o}H${t+r}Q${t} ${e+o} ${t} ${e+o-r}V${e+r}Q${t} ${e} ${t+r} ${e}Z`}d(ct,"Gt");s(ct,"roundedRect");function dt(t){let e=Math.round(t.videoWidth/4),a=Math.round(t.videoHeight/4);if(e===0||a===0||typeof document>"u")return null;try{let o=document.createElement("canvas");o.width=e,o.height=a;let r=o.getContext("2d");return r===null?null:(r.drawImage(t,0,0,e,a),o.toDataURL("image/jpeg",.7))}catch{return null}}d(dt,"Yt");s(dt,"sceneSnapshot");export{Gt as DocumentCaptureView,Rt as LOCK_TRACE_MS,Vt as UPLOAD_ACCEPT,fe as guideRect,Ze as introCopy,Je as mrzHint,qe as mrzInstruction,et as showInsteadKey,lt as slotOf};
|
|
1
|
+
"use client";import{a as We}from"./chunk-ICJ544T4.js";import{d as Ke}from"./chunk-YVGOUZ7T.js";import{a as Fe,b as Ge,c as Xe}from"./chunk-MWTOWGEI.js";import"./chunk-6NNMOFMF.js";import{a as Ye}from"./chunk-XI37ATRU.js";import"./chunk-2WYXQYNY.js";import{E as Re,F as Be,G as Ve,I as Ee,K as ye,L as ke,a as xt,b as $t,c as R,o as De,q as Ue,v as B,w as me,y as ve}from"./chunk-AJHRPKD4.js";import{a as l,c as Ae,i as s}from"./chunk-SSU37LFQ.js";var i=Ae(xt(),1),n=Ae($t(),1);import{acceptedTypesFor as Tt}from"@sekyro/web";var Mt={image:'<path d="M2 12C2 7.29 2 4.93 3.46 3.46C4.93 2 7.29 2 12 2C16.71 2 19.07 2 20.54 3.46C22 4.93 22 7.29 22 12C22 16.71 22 19.07 20.54 20.54C19.07 22 16.71 22 12 22C7.29 22 4.93 22 3.46 20.54C2 19.07 2 16.71 2 12Z" stroke="currentColor"/><path d="M14 8A2 2 0 1 0 18 8A2 2 0 1 0 14 8Z" stroke="currentColor"/><path d="M2 12.5L3.75 10.97C4.66 10.17 6.04 10.22 6.89 11.07L11.18 15.36C11.87 16.05 12.95 16.14 13.75 15.58L14.04 15.37C15.19 14.57 16.74 14.66 17.78 15.6L21 18.5" stroke="currentColor" stroke-linecap="round"/>',flashlight:'<path d="M9 11.66V19C9 19.93 9 20.4 9.15 20.77C9.36 21.26 9.74 21.64 10.23 21.85C10.6 22 11.07 22 12 22C12.93 22 13.4 22 13.77 21.85C14.26 21.64 14.64 21.26 14.85 20.77C15 20.4 15 19.93 15 19V11.66C15 10.84 15 10.43 15.15 10.06C15.3 9.7 15.59 9.41 16.17 8.83L16.17 8.83L19.41 5.59C19.7 5.3 19.85 5.15 19.92 4.97C20 4.78 20 4.58 20 4.17V4C20 3.06 20 2.59 19.71 2.29C19.41 2 18.94 2 18 2H6C5.06 2 4.59 2 4.29 2.29C4 2.59 4 3.06 4 4V4.17C4 4.58 4 4.78 4.08 4.97C4.15 5.15 4.3 5.3 4.59 5.59L7.83 8.83C8.41 9.41 8.7 9.7 8.85 10.06C9 10.43 9 10.84 9 11.66Z" stroke="currentColor" stroke-linecap="round"/><path d="M15 10H9" stroke="currentColor" stroke-linecap="round"/><path d="M12 13V15" stroke="currentColor" stroke-linecap="round"/><path d="M4.5 5H19.5" stroke="currentColor" stroke-linecap="round"/>'},Lt={"dcv3.mrz.searching":"ضع صفحة جواز السفر كاملة داخل الإطار","dcv3.mrz.showMrzSide":"اعرض الوجه الذي يحتوي على سطرين أو ثلاثة أسطر من الحروف","dcv3.mrz.reading":"جارٍ قراءة الوثيقة… ثبّتها","dcv3.mrz.moveCloser":"اقترب حتى تملأ أسطر الحروف الإطار","dcv3.mrz.turnSideways":"أدر هاتفك أفقيًا لقراءة أسطر الحروف","dcv3.mrz.glare":"أمِل الوثيقة لإزالة الانعكاس","dcv3.mrz.holdStill":"لا تتحرك","dcv3.mrz.valid":"تمت قراءة الوثيقة. جارٍ التقاط الصورة","dcv3.mrz.looksLikePassport":"يبدو أن هذا جواز سفر","dcv3.mrz.looksLikeCard":"يبدو أن هذه بطاقة تعريف أو بطاقة إقامة"},ne={"dcv3.mrz.searching":"Fit the whole passport page in the frame","dcv3.mrz.showMrzSide":"Show the side with the two or three lines of characters","dcv3.mrz.reading":"Reading the document… hold it steady","dcv3.mrz.moveCloser":"Move closer so the lines of characters fill the frame","dcv3.mrz.turnSideways":"Turn your phone sideways to read the lines of characters","dcv3.mrz.glare":"Tilt the document to remove the reflection","dcv3.mrz.holdStill":"Hold still","dcv3.mrz.valid":"Document read. Taking the photo","dcv3.mrz.looksLikePassport":"This looks like a passport","dcv3.mrz.looksLikeCard":"This looks like an identity card or residence permit"},It={"dcv3.mrz.searching":"Cadrez toute la page du passeport","dcv3.mrz.showMrzSide":"Montrez la face avec les deux ou trois lignes de caractères","dcv3.mrz.reading":"Lecture du document… tenez-le immobile","dcv3.mrz.moveCloser":"Rapprochez-vous pour que les lignes de caractères remplissent le cadre","dcv3.mrz.turnSideways":"Tournez votre téléphone à l’horizontale pour lire les lignes de caractères","dcv3.mrz.glare":"Inclinez le document pour supprimer le reflet","dcv3.mrz.holdStill":"Ne bougez plus","dcv3.mrz.valid":"Document lu. Prise de la photo","dcv3.mrz.looksLikePassport":"Ceci ressemble à un passeport","dcv3.mrz.looksLikeCard":"Ceci ressemble à une carte d’identité ou un titre de séjour"},Pt={"doc.uploadInstead":"رفع صورة بدلًا من ذلك","doc.uploadTitle":"ارفع صورة لوثيقتك","doc.uploadHint":"صورة واضحة للوثيقة كاملة، ملتقطة بكاميرا.","doc.uploadUnsupported":"اختر صورة للوثيقة بصيغة JPEG أو PNG أو HEIC.","doc.uploadFailed":"تعذّر إرسال هذه الصورة. أعد المحاولة.","doc.source.title":"كيف تريد إضافة وثيقتك؟","doc.source.description":"التقط صورة بالكاميرا، أو ارفع صورة للوثيقة من هذا الجهاز.","doc.source.camera":"التقاط صورة","doc.source.upload":"رفع صورة"},ae={"doc.uploadInstead":"Upload a photo instead","doc.uploadTitle":"Upload a photo of your document","doc.uploadHint":"A clear photo of the whole document, taken with a camera.","doc.uploadUnsupported":"Choose a JPEG, PNG or HEIC photo of the document.","doc.uploadFailed":"We could not send this photo. Try again.","doc.source.title":"How do you want to add your document?","doc.source.description":"Take a photo with the camera, or upload a photo of the document from this device.","doc.source.camera":"Take a photo","doc.source.upload":"Upload a photo"},Ht={"doc.uploadInstead":"Téléverser une photo à la place","doc.uploadTitle":"Téléversez une photo de votre document","doc.uploadHint":"Une photo nette du document entier, prise avec un appareil photo.","doc.uploadUnsupported":"Choisissez une photo JPEG, PNG ou HEIC du document.","doc.uploadFailed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","doc.source.title":"Comment voulez-vous ajouter votre document ?","doc.source.description":"Prenez une photo avec la caméra, ou importez une photo du document depuis cet appareil.","doc.source.camera":"Prendre une photo","doc.source.upload":"Importer une photo"},Ot={"native.doc.introTitle":"سنلتقط صورة لوثيقتك","native.doc.introLead":"تُلتقط الصورة تلقائيًا عندما تكون الوثيقة داخل الإطار.","native.doc.tip.flat":"ضع الوثيقة مسطحة على سطح داكن.","native.doc.tip.glare":"تجنّب انعكاسات الضوء.","native.doc.tip.frame":"أبقِ الوثيقة كاملة داخل الإطار.","native.doc.openCamera":"افتح الكاميرا","native.doc.changeDocument":"تغيير الوثيقة","native.doc.titleOf.carte_identite":"صوّر بطاقة هويتك","native.doc.titleOf.passport":"صوّر جواز سفرك","native.doc.titleOf.residence_permit":"صوّر بطاقة إقامتك","native.doc.titleOf.drivers_license":"صوّر رخصة قيادتك","native.doc.onlyType.carte_identite":"{country}: تُقبل بطاقة الهوية فقط هنا.","native.doc.onlyType.passport":"{country}: يُقبل جواز السفر فقط هنا.","native.doc.onlyType.residence_permit":"{country}: تُقبل بطاقة الإقامة فقط هنا.","native.doc.onlyType.drivers_license":"{country}: تُقبل رخصة القيادة فقط هنا.","native.scan.closer":"اقترب قليلًا","native.scan.farther":"ابتعد قليلًا","native.scan.glare":"أمِل البطاقة قليلًا","native.scan.dark":"الإضاءة ضعيفة. شغّل المصباح.","native.scan.blurry":"الصورة غير واضحة. ثبّت الهاتف.","native.scan.holdStill":"لا تتحرك","native.scan.reading":"جارٍ التحقق من وثيقتك…","native.scan.putDown":"يمكنك وضع وثيقتك جانبًا.","native.scan.retry":"لنحاول مرة أخرى","native.scan.seenPassport":"يبدو أن هذا جواز سفر","native.scan.seenCard":"يبدو أن هذه بطاقة هوية أو بطاقة إقامة","native.scan.showInstead.carte_identite":"أظهر بطاقة هويتك بدلًا منها","native.scan.showInstead.passport":"أظهر صفحة الصورة في جواز سفرك بدلًا منها","native.scan.showInstead.residence_permit":"أظهر بطاقة إقامتك بدلًا منها","native.scan.showInstead.drivers_license":"أظهر رخصة قيادتك بدلًا منها"},oe={"native.doc.introTitle":"Photograph your document","native.doc.introLead":"The photo is taken by itself once the document is in the frame.","native.doc.tip.flat":"Lay it flat on a dark surface.","native.doc.tip.glare":"Avoid glare from lights.","native.doc.tip.frame":"Keep all of it in the frame.","native.doc.openCamera":"Open the camera","native.doc.changeDocument":"Change document","native.doc.titleOf.carte_identite":"Photograph your identity card","native.doc.titleOf.passport":"Photograph your passport","native.doc.titleOf.residence_permit":"Photograph your residence permit","native.doc.titleOf.drivers_license":"Photograph your driver's license","native.doc.onlyType.carte_identite":"{country}: only an identity card is accepted here.","native.doc.onlyType.passport":"{country}: only a passport is accepted here.","native.doc.onlyType.residence_permit":"{country}: only a residence permit is accepted here.","native.doc.onlyType.drivers_license":"{country}: only a driver's license is accepted here.","native.scan.closer":"Move a little closer","native.scan.farther":"Move back a little","native.scan.glare":"Tilt the card a little","native.scan.dark":"Too dark. Turn on the light.","native.scan.blurry":"Blurry image. Hold the phone still.","native.scan.holdStill":"Hold still","native.scan.reading":"Checking your document…","native.scan.putDown":"You can put your document down.","native.scan.retry":"Let's try that again","native.scan.seenPassport":"This looks like a passport","native.scan.seenCard":"This looks like an identity card or residence permit","native.scan.showInstead.carte_identite":"Show your identity card instead","native.scan.showInstead.passport":"Show the photo page of your passport instead","native.scan.showInstead.residence_permit":"Show your residence permit instead","native.scan.showInstead.drivers_license":"Show your driver's license instead"},At={"native.doc.introTitle":"Photographiez votre pièce","native.doc.introLead":"La photo se prend toute seule quand la pièce est bien cadrée.","native.doc.tip.flat":"Posez la pièce à plat sur fond sombre.","native.doc.tip.glare":"Évitez les reflets de lumière.","native.doc.tip.frame":"Gardez toute la pièce dans le cadre.","native.doc.openCamera":"Ouvrir la caméra","native.doc.changeDocument":"Changer de document","native.doc.titleOf.carte_identite":"Photographiez votre carte d'identité","native.doc.titleOf.passport":"Photographiez votre passeport","native.doc.titleOf.residence_permit":"Photographiez votre titre de séjour","native.doc.titleOf.drivers_license":"Photographiez votre permis de conduire","native.doc.onlyType.carte_identite":"{country} : seule la carte d'identité est acceptée ici.","native.doc.onlyType.passport":"{country} : seul le passeport est accepté ici.","native.doc.onlyType.residence_permit":"{country} : seul le titre de séjour est accepté ici.","native.doc.onlyType.drivers_license":"{country} : seul le permis de conduire est accepté ici.","native.scan.closer":"Approchez un peu","native.scan.farther":"Reculez un peu","native.scan.glare":"Inclinez un peu la carte","native.scan.dark":"Trop sombre. Allumez la lampe.","native.scan.blurry":"Image floue. Tenez le téléphone immobile.","native.scan.holdStill":"Ne bougez plus","native.scan.reading":"Vérification de votre document…","native.scan.putDown":"Vous pouvez poser votre pièce.","native.scan.retry":"Réessayons","native.scan.seenPassport":"Ceci ressemble à un passeport","native.scan.seenCard":"Ceci ressemble à une carte d'identité ou un titre de séjour","native.scan.showInstead.carte_identite":"Montrez plutôt votre carte d'identité","native.scan.showInstead.passport":"Montrez plutôt la page photo de votre passeport","native.scan.showInstead.residence_permit":"Montrez plutôt votre titre de séjour","native.scan.showInstead.drivers_license":"Montrez plutôt votre permis de conduire"},G,je=(G=class{constructor(){this.shown=null,this.shownAt=0,this.yielded=null}present(e,a,o,r){(e===null||e.key!==this.yielded)&&(this.yielded=null);let u=this.shown;return e!==null&&this.yielded===null?u?.kind==="problem"&&u.key===e.key&&u.action===e.action?!e.blocking&&a!==null&&r-this.shownAt>=3e3?(this.yielded=e.key,this.show({kind:"hint",key:a,action:null},r)):u:this.show({kind:"problem",key:e.key,action:e.action},r):u?.kind==="problem"&&e===null&&(o||r-this.shownAt<3e3)?u:a===null?this.show(null,r):u?.kind==="hint"&&u.key===a?u:this.show({kind:"hint",key:a,action:null},r)}show(e,a){return this.shown=e,this.shownAt=a,e}},l(G,"ge"),G);s(je,"NoticeBand");var Dt=je,Ut=["locking","capturing"],X,Qe=(X=class{constructor(){this.shown={hint:null,locking:!1,card:null,manualShutter:!1},this.candidate=null,this.candidateSince=0,this.hintShownAt=0,this.lockLostAt=null,this.detectedSince=null,this.lostSince=null,this.shutterSince=null}present(e,a){return this.presentHint(e,a),this.presentLock(e,a),this.presentCard(e,a),this.shutterSince=e.manualShutter?this.shutterSince??a:null,this.shown={...this.shown,manualShutter:this.shutterSince!==null&&a-this.shutterSince>=1e3},this.shown}presentHint(e,a){let o=e.phase==="framing"&&!(e.hint==="blurry"&&e.card===null)?e.hint:null;if(e.phase!=="framing"){this.shown={...this.shown,hint:null},this.candidate=null;return}if(o!==this.candidate&&(this.candidate=o,this.candidateSince=a),o===this.shown.hint)return;let r=a-this.candidateSince>=(o===null?0:350),u=this.shown.hint===null||a-this.hintShownAt>=2500;r&&u&&(this.shown={...this.shown,hint:o},this.hintShownAt=a)}presentLock(e,a){if(Ut.includes(e.phase)){this.shown={...this.shown,locking:!0},this.lockLostAt=null;return}if(this.shown.locking){if(e.phase!=="framing"){this.shown={...this.shown,locking:!1},this.lockLostAt=null;return}this.lockLostAt??(this.lockLostAt=a),a-this.lockLostAt>=300&&(this.shown={...this.shown,locking:!1},this.lockLostAt=null)}}presentCard(e,a){let o=e.card;if(o===null||e.phase!=="framing"){if(e.phase!=="framing"){this.shown={...this.shown,card:null},this.detectedSince=null,this.lostSince=null;return}this.detectedSince=null,this.lostSince??(this.lostSince=a),a-this.lostSince>=300&&(this.shown={...this.shown,card:null});return}if(this.lostSince=null,this.detectedSince??(this.detectedSince=a),a-this.detectedSince<250)return;let r=this.shown.card;if(r===null){this.shown={...this.shown,card:{...o}};return}let u=.35;this.shown={...this.shown,card:{fill:r.fill+(o.fill-r.fill)*u,offsetX:r.offsetX+(o.offsetX-r.offsetX)*u,offsetY:r.offsetY+(o.offsetY-r.offsetY)*u}}}},l(X,"Se"),X);s(Qe,"ScanPresenter");var Rt=Qe,Bt={en:oe,fr:At,ar:Ot,es:oe,pt:oe,de:oe},Vt=450,we=s(t=>(e,a)=>Ye(t.strings[e]??Bt[t.locale][e]??"",a),"useScanCopy");function Ze(t,e){try{return new Intl.DisplayNames([e],{type:"region"}).of(t)??t}catch{return t}}l(Ze,"Dt");s(Ze,"regionName");function qe(t){let e=t.documentType,a=e===null?"native.doc.introTitle":`native.doc.titleOf.${e}`,o=e!==null&&t.issuer!==null&&Tt(t.documents,t.issuer).length===1;return{titleKey:a,onlyKey:o?`native.doc.onlyType.${e}`:null}}l(qe,"xt");s(qe,"introCopy");function Q({name:t}){return(0,n.jsx)("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:Mt[t]}})}l(Q,"se");s(Q,"ScanGlyph");var Et={en:ne,fr:It,ar:Lt,es:ne,pt:ne,de:ne},Ft={en:ae,fr:Ht,ar:Pt,es:ae,pt:ae,de:ae},Gt="image/jpeg,image/png,image/heic,image/heif";function V(t){let e=t.strings,a=s(o=>e[o]??Ft[t.locale][o],"text");return{t:s(o=>a(o)??"","t")}}l(V,"G");s(V,"uploadCopy");function Je(t,e){return t===null||t.state==="fallback"||t.state==="mismatch"?null:t.state==="searching"?e?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":t.state==="valid"?"dcv3.mrz.valid":t.coach==="holdStill"?"dcv3.mrz.holdStill":"dcv3.mrz.reading"}l(Je,"Pt");s(Je,"mrzInstruction");function et(t){return t?.state==="reading"&&t.coach!==void 0&&t.coach!=="holdStill"?`mrz:${t.coach}`:null}l(et,"It");s(et,"mrzHint");function tt(t){return t==="carte_identite"||t==="passport"||t==="residence_permit"||t==="drivers_license"?`native.scan.showInstead.${t}`:null}l(tt,"$t");s(tt,"showInsteadKey");var Xt={document_type_mismatch:"doc.reason_document_type_mismatch",document_number_invalid:"doc.reason_document_number_invalid",provider_unavailable:"doc.reason_provider_unavailable",document_type_not_supported:"doc.reason_document_type_not_supported",document_sides_mismatch:"doc.reason_document_sides_mismatch"};function re(t){if(t.reason==="unreadable")return"doc.reason_unreadable";let e=t.reason!==void 0?Xt[t.reason]:void 0;return e!==void 0?e:t.reason==="tester_document_mismatch"?"reasons.tester_document_mismatch":t.reason!==void 0&&t.reason!=="side_missing"?Ue(t.reason):null}l(re,"_e");s(re,"reasonOf");var nt=new Set(["document_type_not_accepted","tester_document_mismatch","document_type_mismatch","provider_unavailable","document_type_not_supported","document_sides_mismatch"]);function Yt({step:t,i18n:e,liveMrz:a,barcodeAssetBaseUrl:o,ageLead:r,...u}){let[w,h]=(0,i.useState)(!1),y=(0,i.useRef)(-1),[f,g]=(0,i.useState)("idle"),N=(0,i.useRef)(null),_=typeof t.uploadDocument=="function",z=_?t.photo?.source??"camera":"camera",M=_&&z!=="camera"&&t.photo?.uploadOffered===!0,[C,E]=(0,i.useState)(null),H=z==="upload"?"upload":z==="choice"?C??t.photo?.pick??"source":"camera",O=f==="sending"?void 0:()=>N.current?.click(),k=s(async A=>{let q=A.currentTarget.files?.[0];if(A.currentTarget.value="",q!==void 0){h(!1),g("sending");try{await t.uploadDocument(q),g("idle")}catch(K){g(K instanceof TypeError&&K.message==="unsupported_file"?"unsupported":"failed")}}},"onFile"),Z=M?(0,n.jsx)("input",{ref:N,type:"file",accept:Gt,hidden:!0,"data-testid":"sekyro-doc-upload","aria-label":V(e).t("doc.uploadTitle"),onChange:l(A=>{k(A)},"onChange")}):null,x=V(e),Y=t.photo?.cameraOnPhone===!0;return H==="camera"&&Y?(0,n.jsx)(Ke,{i18n:e,lead:e.t("handoff.lead.document"),refresh:t.refresh,actions:(0,n.jsx)(R,{kind:"ghost",full:!0,onClick:l(()=>E("upload"),"onClick"),children:x.t("doc.source.upload")})}):H==="source"?(0,n.jsx)(We,{testId:"sekyro-doc-source",title:x.t("doc.source.title"),lead:x.t("doc.source.description"),cameraLabel:Y?e.t("capture.source.phone"):x.t("doc.source.camera"),onPhone:Y,uploadLabel:x.t("doc.source.upload"),notice:(0,n.jsx)(ie,{step:t,i18n:e}),onCamera:l(()=>E("camera"),"onCamera"),onUpload:l(()=>E("upload"),"onUpload")}):H==="upload"?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(rt,{step:t,i18n:e,ageLead:r===!0,upload:f,offered:M,onPick:l(()=>N.current?.click(),"onPick"),...z==="choice"?{onCamera:s(()=>E("camera"),"onCamera")}:{},...u}),Z]}):(0,n.jsxs)(n.Fragment,{children:[w?(0,n.jsx)(it,{step:t,i18n:e,attempts:y,...a!==void 0?{liveMrz:a}:{},...o!==void 0?{barcodeAssetBaseUrl:o}:{},...M&&O!==void 0?{onUpload:O}:{},onClose:l(()=>h(!1),"onClose")}):(0,n.jsx)(ot,{step:t,i18n:e,ageLead:r===!0,onOpen:l(()=>h(!0),"onOpen"),upload:f,...M&&O!==void 0?{onUpload:O}:{},...u}),Z]})}l(Yt,"$n");s(Yt,"DocumentCaptureView");function Ce({passport:t}){let e=Math.round(228/(t?1.42:1.586));return(0,n.jsxs)("svg",{className:`sekyro-mark sekyro-mark--card${t?" sekyro-mark--passport":""}`,viewBox:`-12 ${t?-22:-12} 252 ${e+(t?34:24)}`,"aria-hidden":"true",focusable:"false",children:[(0,n.jsx)("defs",{children:(0,n.jsx)("clipPath",{id:"sekyro-card-clip",children:(0,n.jsx)("rect",{width:228,height:e,rx:"12.5"})})}),t?(0,n.jsx)("rect",{className:"sekyro-mark__page",x:"10",y:"-14",width:208,height:e,rx:"10"}):null,(0,n.jsx)("rect",{className:"sekyro-mark__card",width:228,height:e,rx:"12.5"}),(0,n.jsx)("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:e*(t?.5:.62),rx:"6"}),[0,1,2].map(a=>(0,n.jsx)("rect",{className:"sekyro-mark__text",x:"88",y:23+a*e*.12,width:100-a*20,height:"6",rx:"3"},a)),t?[0,1].map(a=>(0,n.jsx)("line",{className:"sekyro-mark__code",x1:"17",x2:211,y1:e*.75+a*11,y2:e*.75+a*11},a)):(0,n.jsx)("rect",{className:"sekyro-mark__text",x:"88",y:23+3*e*.12,width:"60",height:"6",rx:"3"}),(0,n.jsx)("g",{clipPath:"url(#sekyro-card-clip)",children:(0,n.jsx)("g",{className:"sekyro-mark__read",style:{"--sekyro-read-w":"228px"},children:(0,n.jsx)("rect",{x:"-1",width:"2",height:e,className:"sekyro-mark__beam"})})}),(0,n.jsx)("path",{className:"sekyro-mark__brackets",d:at(-10,-10,248,e+20,16,30)})]})}l(Ce,"at");s(Ce,"ScanMark");function at(t,e,a,o,r,u){let w=Math.min(r,u*.6);return[[t,e,1,1],[t+a,e,-1,1],[t,e+o,1,-1],[t+a,e+o,-1,-1]].map(([h,y,f,g])=>`M${h} ${y+g*u}V${y+g*w}Q${h} ${y} ${h+f*w} ${y}H${h+f*u}`).join("")}l(at,"Ot");s(at,"brackets");function ot({step:t,i18n:e,ageLead:a,onOpen:o,onChangeCountry:r,onChangeDocument:u,upload:w,onUpload:h}){let y=we(e),f=V(e),g=t.documentType==="passport",N=qe(t),_=re(t),z=w==="sending",M=(0,i.useContext)(Be)?.busy===!0;return(0,n.jsxs)("section",{className:"sekyro-step sekyro-step--doc-intro","data-testid":"sekyro-document",children:[(0,n.jsx)(Ce,{passport:g}),(0,n.jsx)(me,{title:y(N.titleKey)||y("native.doc.introTitle"),lead:a?e.t("doc.ageStepUp"):y("native.doc.introLead")}),N.onlyKey!==null&&t.issuer!==null?(0,n.jsx)("p",{className:"sekyro-text-muted sekyro-doc-only",children:y(N.onlyKey,{country:Ze(t.issuer,e.locale)})}):null,(0,n.jsx)(ie,{step:t,i18n:e}),t.reason!==void 0&&nt.has(t.reason)?null:(0,n.jsxs)("ul",{className:"sekyro-tiprows",children:[(0,n.jsxs)("li",{children:[(0,n.jsx)(B,{name:g?"passport":"card"}),y("native.doc.tip.flat")]}),(0,n.jsxs)("li",{children:[(0,n.jsx)(B,{name:"light"}),y("native.doc.tip.glare")]}),(0,n.jsxs)("li",{children:[(0,n.jsx)(Q,{name:"image"}),y("native.doc.tip.frame")]})]}),(0,n.jsx)(be,{i18n:e,...u!==void 0?{onChangeDocument:u}:{},...r!==void 0?{onChangeCountry:r}:{}}),(0,n.jsx)(_e,{i18n:e,upload:w}),z?(0,n.jsx)("p",{className:"sekyro-text-muted",role:"status",children:e.t("doc.uploading")}):h!==void 0?(0,n.jsx)("p",{className:"sekyro-text-muted",children:f.t("doc.uploadHint")}):null,(0,n.jsxs)(ve,{children:[(0,n.jsxs)(R,{full:!0,onClick:o,disabled:z||M,children:[(0,n.jsx)(B,{name:"camera"}),y("native.doc.openCamera")]}),h!==void 0?(0,n.jsxs)(R,{full:!0,kind:"ghost",onClick:h,children:[(0,n.jsx)(Q,{name:"image"}),f.t("doc.uploadInstead")]}):null]})]})}l(ot,"Rt");s(ot,"DocumentIntro");function ie({step:t,i18n:e}){let a=re(t);return a===null?null:(0,n.jsxs)(ye,{tone:"warning",children:[(0,n.jsx)("span",{children:e.t(a)}),(0,n.jsx)("span",{children:ke(e,t.attemptsRemaining,t.attemptsExhausted)})]})}l(ie,"Ce");s(ie,"ReasonNotice");function be({i18n:t,onChangeCountry:e,onChangeDocument:a}){let o=we(t);return a===void 0&&e===void 0?null:(0,n.jsxs)("div",{className:"sekyro-links",children:[a!==void 0?(0,n.jsx)("button",{type:"button",className:"sekyro-link",onClick:a,children:o("native.doc.changeDocument")}):null,e!==void 0?(0,n.jsx)("button",{type:"button",className:"sekyro-link",onClick:e,children:t.t("native.doc.changeCountry")}):null]})}l(be,"st");s(be,"ChangeLinks");function _e({i18n:t,upload:e}){return e!=="unsupported"&&e!=="failed"?null:(0,n.jsx)(ye,{tone:"warning",children:(0,n.jsx)("span",{children:V(t).t(e==="unsupported"?"doc.uploadUnsupported":"doc.uploadFailed")})})}l(_e,"it");s(_e,"UploadNotice");function rt({step:t,i18n:e,ageLead:a,upload:o,offered:r,onPick:u,onCamera:w,onChangeCountry:h,onChangeDocument:y}){let f=V(e),g=o==="sending";return(0,n.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-doc-upload-screen",children:[(0,n.jsx)(Ce,{passport:t.documentType==="passport"}),(0,n.jsx)(me,{title:f.t("doc.uploadTitle"),lead:a?e.t("doc.ageStepUp"):f.t("doc.uploadHint")}),a?(0,n.jsx)("p",{className:"sekyro-text-muted",children:f.t("doc.uploadHint")}):null,(0,n.jsx)(ie,{step:t,i18n:e}),(0,n.jsx)(be,{i18n:e,...y!==void 0?{onChangeDocument:y}:{},...h!==void 0?{onChangeCountry:h}:{}}),(0,n.jsx)(_e,{i18n:e,upload:o}),g?(0,n.jsx)("p",{className:"sekyro-text-muted",role:"status",children:e.t("doc.uploading")}):null,(0,n.jsxs)(ve,{children:[(0,n.jsxs)(R,{full:!0,onClick:u,disabled:g||!r||t.attemptsExhausted,children:[(0,n.jsx)(Q,{name:"image"}),f.t("doc.source.upload")]}),w!==void 0?(0,n.jsxs)(R,{full:!0,kind:"ghost",onClick:w,disabled:g,children:[(0,n.jsx)(B,{name:"camera"}),f.t("doc.source.camera")]}):null]})]})}l(rt,"Et");s(rt,"DocumentUploadScreen");function ge(t,e,a){let o=t*.88,r=o/a;return{x:(t-o)/2,y:e*.42-r/2,w:o,h:r}}l(ge,"nt");s(ge,"guideRect");var Kt={"mrz:moveCloser":"dcv3.mrz.moveCloser","mrz:turnSideways":"dcv3.mrz.turnSideways","mrz:glare":"dcv3.mrz.glare",too_far:"native.scan.closer",too_close:"native.scan.farther",focus_far:"native.scan.farther",glare:"native.scan.glare",too_bright:"native.scan.glare",too_dark:"native.scan.dark",blurry:"native.scan.blurry"},Wt=s(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function it({step:t,i18n:e,liveMrz:a,barcodeAssetBaseUrl:o,onClose:r,attempts:u,onUpload:w}){let h=we(e),y=(0,i.useContext)(Fe),f=(0,i.useRef)(y);f.current=y;let g=(0,i.useRef)(null),N=(0,i.useRef)(null),_=(0,i.useRef)(null),[z,M]=(0,i.useState)("idle"),[C,E]=(0,i.useState)(null),[H,O]=(0,i.useState)(null),[k,Z]=(0,i.useState)({w:0,h:0}),[x,Y]=(0,i.useState)({hint:null,locking:!1,card:null,manualShutter:!1}),[A,q]=(0,i.useState)({}),[K,pt]=(0,i.useState)(null),[ze,mt]=(0,i.useState)(null),[Se,Ne]=(0,i.useState)(0),[xe,$e]=(0,i.useState)(null),[se,vt]=(0,i.useState)(null),[le,yt]=(0,i.useState)(0),Te=(0,i.useRef)(0);Te.current=le;let D=t.documentType==="passport",J=D?1.42:1.586;Re(!0),(0,i.useLayoutEffect)(()=>{let d=g.current;if(d===null)return;let m=s(()=>Z({w:d.clientWidth,h:d.clientHeight}),"measure");if(m(),typeof ResizeObserver>"u")return;let p=new ResizeObserver(m);return p.observe(d),()=>p.disconnect()},[]);let c=ge(k.w,k.h,J);(0,i.useEffect)(()=>{k.w===0||k.h===0||_.current?.setGuide?.({viewAspect:k.w/k.h,rect:{x:c.x/k.w,y:c.y/k.h,width:c.w/k.w,height:c.h/k.h}})},[k.w,k.h,c.x,c.y,c.w,c.h]),(0,i.useEffect)(()=>{let d=N.current;if(d===null)return;let m=t.capture({video:d,...a!==void 0?{liveMrz:a}:{},...o!==void 0?{barcodeAssetBaseUrl:o}:{}});_.current=m;let p=g.current;if(p!==null&&p.clientWidth>0&&p.clientHeight>0){let v=ge(p.clientWidth,p.clientHeight,J);m.setGuide?.({viewAspect:p.clientWidth/p.clientHeight,rect:{x:v.x/p.clientWidth,y:v.y/p.clientHeight,width:v.w/p.clientWidth,height:v.h/p.clientHeight}})}let I=new Rt,b={scan:null,feedback:null,gate:null,mrz:null},P=s(v=>{b={...b,...v};let $=b.gate?.guide,Nt={phase:b.scan?.phase??"framing",hint:b.feedback?.reticle==="coaching"?b.feedback.key:t.documentType==="drivers_license"?null:et(b.mrz),card:$?.detected?{fill:$.fill,offsetX:$.offsetX,offsetY:$.offsetY}:null,manualShutter:b.scan?.manualShutter??!1},W=I.present(Nt,performance.now());Y(j=>j.hint===W.hint&&j.locking===W.locking&&j.manualShutter===W.manualShutter&&ut(j.card,W.card)?j:W)},"present"),St=[m.on("state",M),m.on("feedback",v=>P({feedback:v})),m.on("gate",v=>P({gate:v})),m.on("scan",v=>{E(v),P({scan:v})}),m.on("captured",v=>{yt($=>$+1),q($=>({...$,[ct(v.side,D,$)]:v.previewDataUrl})),pt(v.previewDataUrl),mt(ht(d))}),m.on("error",v=>{O(v);let $=f.current;$!==null&&Xe($,Ge("document",v,Math.max(0,u.current)))}),m.on("mrz",v=>{v.state==="mismatch"?vt({format:v.format??null,at:Te.current}):($e(v),P({mrz:v}))})];return u.current+=1,m.start().catch(()=>{}),()=>{for(let v of St)v();m.destroy(),_.current=null}},[t.issuer,t.documentType]);let T=C?.phase??"framing",L=T==="reading"||T==="result",ce=T==="flipCue"||T==="reaskRecto",U=x.locking,Me=C?.captured.length??0;(0,i.useEffect)(()=>{U&&Ne(d=>d+1)},[U]),(0,i.useEffect)(()=>{Me>0&&Ne(d=>d+1)},[Me]);let kt=C?.expected??null;(0,i.useEffect)(()=>{$e(null)},[kt]);let de=ce||L||t.documentType==="drivers_license"?null:Je(xe,D),Le=s(d=>e.strings[d]??Et[e.locale][d],"liveText"),ft=s(d=>d.startsWith("dcv3.")?Le(d):h(d),"copy"),ue=de!==null?Le(de):h(T==="flipCue"?"doc.flip":T==="reaskRecto"?"doc.reaskRecto":L?"native.scan.reading":T==="locking"||T==="capturing"||U?"native.scan.holdStill":D?"doc.showPage":"doc.showSide"),ee=re(t),Ie=s(d=>({key:h(d),action:ke(e,t.attemptsRemaining,t.attemptsExhausted),blocking:t.reason!==void 0&&nt.has(t.reason)}),"reasonProblem"),Pe=tt(t.documentType),gt=se!==null&&le<=se.at+1?{key:h(se.format==="TD3"?"native.scan.seenPassport":"native.scan.seenCard"),action:Pe===null?null:h(Pe),blocking:!0}:C?.notice==="same_face"?{key:h("doc.sameFace"),action:null,blocking:!1}:C?.notice==="reread"?ee!==null?Ie(ee):{key:h("doc.reread"),action:null,blocking:!1}:C?.notice==="technical"?{key:h("native.scan.retry"),action:null,blocking:!1}:C?.notice==="blurry"?{key:h("native.scan.blurry"),action:null,blocking:!1}:ee!==null&&le===0?Ie(ee):null,wt=x.hint===null?null:ft(Kt[x.hint]??`dcv2.${x.hint}`),He=st(gt,wt,U||T==="capturing"||L),F=x.card,S=c;if(!U&&F!==null&&F.fill>=.45&&F.fill<=1.25&&!Wt()){let d=c.w*F.fill,m=d/J,p=c.x+c.w/2+c.w*Math.max(-.25,Math.min(.25,F.offsetX)),I=c.y+c.h/2+c.h*Math.max(-.25,Math.min(.25,F.offsetY));S={x:p-d/2,y:I-m/2,w:d,h:m}}let te=c.w*.045,he=28,Oe=Math.min(te,he*.6),Ct=[[S.x,S.y,1,1],[S.x+S.w,S.y,-1,1],[S.x,S.y+S.h,1,-1],[S.x+S.w,S.y+S.h,-1,-1]],bt=U?"is-locked":He!==null?"is-coaching":"",_t=D?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],zt=c.y+c.h+16,pe={insetInlineStart:c.x,insetBlockStart:c.y,inlineSize:c.w,blockSize:c.h,borderRadius:te};return(0,n.jsx)("section",{className:"sekyro-lm","aria-label":ue,"data-testid":"sekyro-document",children:(0,n.jsxs)("div",{ref:g,className:`sekyro-lm-stage${L?" is-reading":""}${ce?" is-flip":""}`,style:{"--sekyro-guide-w":`${c.w}px`},children:[(0,n.jsx)("video",{ref:N,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:l(d=>{let m=d.currentTarget,p=m.getBoundingClientRect(),I=Math.max(p.width/(m.videoWidth||1),p.height/(m.videoHeight||1)),b=m.videoWidth*I,P=m.videoHeight*I;b>0&&P>0&&_.current?.focusAt((d.clientX-p.left+(b-p.width)/2)/b,(d.clientY-p.top+(P-p.height)/2)/P)},"onPointerUp")}),k.w>0?(0,n.jsxs)(n.Fragment,{children:[L&&ze!==null?(0,n.jsx)("img",{className:"sekyro-lm-scene",src:ze,alt:""}):null,L&&K!==null?(0,n.jsx)("img",{className:"sekyro-lm-frozen",src:K,alt:"",style:pe}):null,(0,n.jsxs)("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${k.w} ${k.h}`,"aria-hidden":"true",focusable:"false",children:[(0,n.jsxs)("defs",{children:[(0,n.jsxs)("linearGradient",{id:"sekyro-lm-top",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,n.jsx)("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0.85"}),(0,n.jsx)("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0"})]}),(0,n.jsxs)("linearGradient",{id:"sekyro-lm-bottom",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,n.jsx)("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0"}),(0,n.jsx)("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0.9"})]})]}),(0,n.jsx)("path",{className:"sekyro-lm-scrim",fillRule:"evenodd",d:`M0 0H${k.w}V${k.h}H0Z${dt(c,te)}`}),(0,n.jsx)("rect",{width:k.w,height:Math.max(0,c.y),fill:"url(#sekyro-lm-top)"}),(0,n.jsx)("rect",{y:c.y+c.h,width:k.w,height:Math.max(0,k.h-c.y-c.h),fill:"url(#sekyro-lm-bottom)"}),(0,n.jsx)("g",{className:`sekyro-lm-brackets ${bt}`,children:Ct.map(([d,m,p,I],b)=>(0,n.jsx)("path",{style:{transform:`translate(${d}px, ${m}px) scale(${p}, ${I})`},d:`M0 ${he}V${Oe}Q0 0 ${Oe} 0H${he}`},b))}),U?(0,n.jsx)("rect",{className:"sekyro-lm-trace",x:c.x,y:c.y,width:c.w,height:c.h,rx:te,pathLength:"1",style:{animationDuration:`${Vt}ms`}}):null]}),(0,n.jsx)("div",{className:"sekyro-lm-slot",style:pe,"aria-hidden":"true",children:L?(0,n.jsx)("span",{className:"sekyro-lm-read is-repeating"}):Se>0?(0,n.jsx)("span",{className:"sekyro-lm-read"},Se):null})]}):null,de!==null?(0,n.jsx)("div",{className:"sekyro-lm-slot",style:pe,"aria-hidden":"true",children:(0,n.jsx)("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${D?" is-page":""}${xe?.state==="valid"?" is-valid":""}`})}):null,(0,n.jsx)("div",{className:"sekyro-lm-instruction",style:{insetBlockStart:c.y-64},children:(0,n.jsx)("div",{role:"status","aria-live":"polite","data-testid":"sekyro-scan-instruction",children:(0,n.jsx)(Ee,{swapKey:ue,className:"sekyro-lm-line",children:ue})})}),(0,n.jsxs)("div",{className:"sekyro-lm-below",style:{insetBlockStart:zt,inlineSize:c.w,insetInlineStart:c.x},children:[(0,n.jsx)(lt,{band:He}),L?(0,n.jsxs)("p",{className:"sekyro-lm-note",children:[(0,n.jsx)("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),h("native.scan.putDown")]}):ce?(0,n.jsx)("div",{className:`sekyro-lm-flip${T==="reaskRecto"?" is-toFront":""}`,"data-testid":"sekyro-flip-cue","aria-hidden":"true",children:(0,n.jsxs)("span",{className:"sekyro-lm-flip-card",style:{aspectRatio:String(J)},children:[(0,n.jsx)("span",{className:"sekyro-lm-flip-front"}),(0,n.jsx)("span",{className:"sekyro-lm-flip-back"})]})}):null]}),(0,n.jsxs)("div",{className:"sekyro-lm-controls",children:[(0,n.jsxs)("div",{className:"sekyro-lm-bar",children:[(0,n.jsx)("button",{type:"button",className:"sekyro-glass","aria-label":e.t("native.close"),onClick:r,children:(0,n.jsx)(B,{name:"close"})}),C?.torchAvailable?(0,n.jsx)("button",{type:"button",className:`sekyro-glass${C.torch?" is-on":""}`,"aria-label":e.t("doc.torchOn"),"aria-pressed":C.torch,onClick:l(()=>_.current?.setTorch(!C.torch),"onClick"),children:(0,n.jsx)(Q,{name:"flashlight"})}):null]}),H!==null?(0,n.jsxs)("div",{className:"sekyro-lm-error",role:"alert",children:[(0,n.jsx)("p",{children:e.t("doc.cameraBlocked")}),(0,n.jsx)("p",{children:e.t(H.kind==="permission"?"doc.cameraBlockedHint":De(H.kind))}),(0,n.jsx)(R,{onClick:l(()=>{O(null),u.current+=1,_.current?.retry()},"onClick"),children:e.t("doc.retryCamera")})]}):null,x.manualShutter?(0,n.jsx)("button",{type:"button",className:"sekyro-shutter","aria-label":e.t("doc.shutter"),onClick:l(()=>_.current?.shutter(),"onClick")}):null,(0,n.jsx)("ol",{className:"sekyro-lm-tray",children:_t.map(({side:d,label:m})=>{let p=C?.captured.includes(d)??!1;return(0,n.jsxs)("li",{className:p?"is-done":void 0,"aria-current":!p&&(D||C?.expected===d)?"step":void 0,children:[p?(0,n.jsxs)("span",{className:"sekyro-lm-thumb",children:[A[d]!==void 0?(0,n.jsx)("img",{src:A[d],alt:""}):null,(0,n.jsx)("svg",{className:"sekyro-lm-check",viewBox:"0 0 18 18","aria-hidden":"true",children:(0,n.jsx)("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})]}):null,h(m)]},d)})}),w!==void 0?(0,n.jsx)("button",{type:"button",className:"sekyro-lm-upload",onClick:w,children:V(e).t("doc.uploadInstead")}):null,z==="uploading"||z==="checking"?null:(0,n.jsx)(Ve,{onStop:r})]}),z==="uploading"||z==="checking"?(0,n.jsx)("span",{className:"sekyro-visually-hidden",role:"status",children:z==="uploading"?e.t("doc.uploading"):h("native.scan.reading")}):null]})})}l(it,"At");s(it,"LumiereScan");function st(t,e,a){let o=(0,i.useRef)(null);o.current??(o.current=new Dt);let[r,u]=(0,i.useState)(null),w=(0,i.useRef)({problem:t,hint:e,busy:a});w.current={problem:t,hint:e,busy:a};let h=t===null?null:`${t.blocking}|${t.key}|${t.action??""}`;return(0,i.useEffect)(()=>{let y=s(()=>{let{problem:g,hint:N,busy:_}=w.current;u(o.current?.present(g,N,_,performance.now())??null)},"run");y();let f=setInterval(y,250);return()=>clearInterval(f)},[h,e,a]),r}l(st,"Bt");s(st,"useNoticeBand");function lt({band:t}){let[e,a]=(0,i.useState)(t);(0,i.useEffect)(()=>{t!==null&&a(t)},[t]);let o=t??e;return(0,n.jsx)("div",{className:`sekyro-lm-band${t!==null?" is-open":""}`,"data-testid":"sekyro-scan-notice",children:(0,n.jsx)("div",{role:"status","aria-live":"polite","aria-atomic":"true",children:o!==null?(0,n.jsxs)("div",{className:"sekyro-notice sekyro-notice--warning","data-kind":o.kind,"aria-hidden":t===null||void 0,children:[(0,n.jsx)("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:(0,n.jsx)(B,{name:"warning"})}),(0,n.jsxs)("div",{className:"sekyro-notice__body",children:[(0,n.jsx)("span",{children:o.key}),o.action!==null&&o.action!==""?(0,n.jsx)("span",{children:o.action}):null]})]}):null})})}l(lt,"Vt");s(lt,"NoticeBandView");function ct(t,e,a){return e?"single":t==="recto"||t==="verso"?t:a.recto===void 0?"recto":"verso"}l(ct,"Yt");s(ct,"slotOf");function dt({x:t,y:e,w:a,h:o},r){return`M${t+r} ${e}H${t+a-r}Q${t+a} ${e} ${t+a} ${e+r}V${e+o-r}Q${t+a} ${e+o} ${t+a-r} ${e+o}H${t+r}Q${t} ${e+o} ${t} ${e+o-r}V${e+r}Q${t} ${e} ${t+r} ${e}Z`}l(dt,"Gt");s(dt,"roundedRect");var fe=.004;function ut(t,e){return t===null||e===null?t===e:Math.abs(t.fill-e.fill)<fe&&Math.abs(t.offsetX-e.offsetX)<fe&&Math.abs(t.offsetY-e.offsetY)<fe}l(ut,"Ft");s(ut,"sameCard");function ht(t){let e=Math.round(t.videoWidth/4),a=Math.round(t.videoHeight/4);if(e===0||a===0||typeof document>"u")return null;try{let o=document.createElement("canvas");o.width=e,o.height=a;let r=o.getContext("2d");return r===null?null:(r.drawImage(t,0,0,e,a),o.toDataURL("image/jpeg",.7))}catch{return null}}l(ht,"Xt");s(ht,"sceneSnapshot");export{Yt as DocumentCaptureView,Vt as LOCK_TRACE_MS,Gt as UPLOAD_ACCEPT,ge as guideRect,qe as introCopy,et as mrzHint,Je as mrzInstruction,ut as sameCard,tt as showInsteadKey,ct as slotOf};
|