@sekyro/elements 0.1.0-rc.26 → 0.1.0-rc.27

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.
Files changed (76) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cdn/chunks/{capture-session-doc-GMJHALX2-ARC4FOZR.js → capture-session-doc-BT2W22H5-TWRWJRRR.js} +1 -1
  3. package/dist/cdn/chunks/{chunk-FD543JGD.js → chunk-2IYNWMYV.js} +1 -1
  4. package/dist/cdn/chunks/{chunk-TD4WLFWX.js → chunk-2PCS4H3E.js} +1 -1
  5. package/dist/cdn/chunks/{chunk-HW2VL6K5.js → chunk-2RVF3WJ3.js} +1 -1
  6. package/dist/cdn/chunks/{chunk-DFGFFVZV.js → chunk-2RXQBUDC.js} +2 -2
  7. package/dist/cdn/chunks/{chunk-H6JCZ7X4.js → chunk-2SXFB7OS.js} +1 -1
  8. package/dist/cdn/chunks/chunk-35AXFJCG.js +1 -0
  9. package/dist/cdn/chunks/chunk-5H2LBGA7.js +25 -0
  10. package/dist/cdn/chunks/{chunk-RTFEIA57.js → chunk-66K4ELX6.js} +1 -1
  11. package/dist/cdn/chunks/{chunk-S6RK76P5.js → chunk-ATYTAIFS.js} +1 -1
  12. package/dist/cdn/chunks/{chunk-NEULQ5JV.js → chunk-B737CEIX.js} +1 -1
  13. package/dist/cdn/chunks/{chunk-IYEBJ2ZV.js → chunk-DM2IEIG4.js} +1 -1
  14. package/dist/cdn/chunks/{chunk-4LUARCPT.js → chunk-EHVBCFRB.js} +1 -1
  15. package/dist/cdn/chunks/{chunk-5EMGDVL5.js → chunk-FCQZZSGE.js} +1 -1
  16. package/dist/cdn/chunks/chunk-IJKJJDVP.js +1 -0
  17. package/dist/cdn/chunks/{chunk-EP25HO5D.js → chunk-JPREVWIF.js} +1 -1
  18. package/dist/cdn/chunks/{chunk-3YI7B3GE.js → chunk-LKG2GOWP.js} +1 -1
  19. package/dist/cdn/chunks/{chunk-WQA4EGMT.js → chunk-N6TFSAF3.js} +1 -1
  20. package/dist/cdn/chunks/{chunk-BLRCS3XB.js → chunk-TV7CW7VL.js} +1 -1
  21. package/dist/cdn/chunks/{chunk-5MZT6V5W.js → chunk-URRHIQLF.js} +2 -2
  22. package/dist/cdn/chunks/{chunk-SA3JLP6W.js → chunk-UYEEBLOW.js} +1 -1
  23. package/dist/cdn/chunks/chunk-ZEUQQLSO.js +1 -0
  24. package/dist/cdn/chunks/{chunk-SX74G3GE.js → chunk-ZYXKVMFC.js} +1 -1
  25. package/dist/cdn/chunks/{create-document-capture-AFUM53J2-RHFJOKSG.js → create-document-capture-R3H5TJD5-FZDYMF5Q.js} +1 -1
  26. package/dist/cdn/chunks/{document-capture-view-C7G76Z5Z-47KQFEKS.js → document-capture-view-RR4DTGYF-DE3CFMWM.js} +1 -1
  27. package/dist/cdn/chunks/{eid-view-I7JWDMJ4-NLMOCQTP.js → eid-view-5M34JRB3-JW2ZYCJG.js} +1 -1
  28. package/dist/cdn/chunks/{email-otp-view-WVQSVKW4-UAEN7WJP.js → email-otp-view-ULR3QWIN-SSLNYDY6.js} +1 -1
  29. package/dist/cdn/chunks/{flow-views-OQMWGGG3-HT4WAHJ2.js → flow-views-V3OXW6PI-COAN2VQJ.js} +1 -1
  30. package/dist/cdn/chunks/{form-view-GA2TGOJL-UO5HMK5Q.js → form-view-426ISA4K-AKPX7G27.js} +1 -1
  31. package/dist/cdn/chunks/{overlay-de-OC3UDZ6R-Y4PL6NJC.js → overlay-de-OWNOVFUK-G2EPYZKC.js} +1 -1
  32. package/dist/cdn/chunks/{overlay-es-SYZKGHMP-WWIOE7ES.js → overlay-es-POP2QZLC-6H5GQA7F.js} +1 -1
  33. package/dist/cdn/chunks/{overlay-pt-CTVAN7HT-ESRXIQKH.js → overlay-pt-IKCWBDLR-4R2H3Y7Q.js} +1 -1
  34. package/dist/cdn/chunks/plan-runner-EY7VTTUP-RLLA2EQK.js +1 -0
  35. package/dist/cdn/chunks/{portrait-capture-view-O6M7N32A-BNCHYVMO.js → portrait-capture-view-6K6W3USJ-MT7SJLT2.js} +1 -1
  36. package/dist/cdn/chunks/{portrait-review-view-TI34GIXN-EFM6O45B.js → portrait-review-view-PZQZZCYH-NEHNS5VW.js} +1 -1
  37. package/dist/cdn/chunks/{proof-of-address-view-BTCXADNY-LJ5HXDRA.js → proof-of-address-view-MX5Q2XV2-S4FLPL4A.js} +1 -1
  38. package/dist/cdn/define.js +1 -1
  39. package/dist/cdn/index.js +1 -1
  40. package/dist/{chunk-SBLYDU3J.js → chunk-C6FGUALJ.js} +1 -1
  41. package/dist/{chunk-AIQISJXO.js → chunk-CCJXGVIL.js} +1 -1
  42. package/dist/{chunk-RUGMWI6S.js → chunk-FXWTWHNX.js} +1 -1
  43. package/dist/{chunk-3AB3BDSC.js → chunk-G3M7C3QG.js} +1 -1
  44. package/dist/{chunk-K7FZ3SWO.js → chunk-GQIZ42ZI.js} +1 -1
  45. package/dist/{chunk-SAH7S6QH.js → chunk-JPVADGVQ.js} +1 -1
  46. package/dist/{chunk-2UKKUNLM.js → chunk-JRZE2IZT.js} +1 -1
  47. package/dist/{chunk-EHI6A6IC.js → chunk-KN3AOAYL.js} +2 -2
  48. package/dist/{chunk-NZB3FFMJ.js → chunk-PNC5GJ4N.js} +1 -1
  49. package/dist/{chunk-2IOKT6MW.js → chunk-R57PCZSZ.js} +1 -1
  50. package/dist/{chunk-BBMKEHE2.js → chunk-RDCMAYQA.js} +1 -1
  51. package/dist/{chunk-K2HD46BJ.js → chunk-XDH4CTRQ.js} +1 -1
  52. package/dist/{chunk-MGZU2EY6.js → chunk-YQXEEIWM.js} +1 -1
  53. package/dist/chunk-Z5TRMVOP.js +25 -0
  54. package/dist/define.cjs +1 -1
  55. package/dist/define.js +1 -1
  56. package/dist/{document-capture-view-C7G76Z5Z-B37X2GAQ.js → document-capture-view-RR4DTGYF-5PXLLNJY.js} +1 -1
  57. package/dist/{eid-view-I7JWDMJ4-KZ5TCWLJ.js → eid-view-5M34JRB3-QXLAE3HM.js} +1 -1
  58. package/dist/{email-otp-view-WVQSVKW4-PC7XV2PN.js → email-otp-view-ULR3QWIN-UCGDMZIL.js} +1 -1
  59. package/dist/{flow-views-OQMWGGG3-5QDNKNYP.js → flow-views-V3OXW6PI-BFMDN2IB.js} +1 -1
  60. package/dist/{form-view-GA2TGOJL-Y6LZSZ57.js → form-view-426ISA4K-CTBMZ6MO.js} +1 -1
  61. package/dist/index.cjs +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/{overlay-de-OC3UDZ6R-2XA2EF5R.js → overlay-de-OWNOVFUK-QY6M35JN.js} +1 -1
  64. package/dist/{overlay-es-SYZKGHMP-WPBHUSMV.js → overlay-es-POP2QZLC-325Q4JIU.js} +1 -1
  65. package/dist/{overlay-pt-CTVAN7HT-GQFAZU5I.js → overlay-pt-IKCWBDLR-2YDKPIHK.js} +1 -1
  66. package/dist/{portrait-capture-view-O6M7N32A-DITR3Z7I.js → portrait-capture-view-6K6W3USJ-IHLY62OK.js} +1 -1
  67. package/dist/{portrait-review-view-TI34GIXN-XA4FB3UB.js → portrait-review-view-PZQZZCYH-WJPV3V7H.js} +1 -1
  68. package/dist/{proof-of-address-view-BTCXADNY-RLSTG7XR.js → proof-of-address-view-MX5Q2XV2-NADFPD37.js} +1 -1
  69. package/package.json +2 -2
  70. package/sbom.cdx.json +4 -4
  71. package/dist/cdn/chunks/chunk-6RG5RG7Q.js +0 -1
  72. package/dist/cdn/chunks/chunk-CTQAORJP.js +0 -25
  73. package/dist/cdn/chunks/chunk-T5ZB7FLK.js +0 -1
  74. package/dist/cdn/chunks/chunk-VP7GHHEK.js +0 -1
  75. package/dist/cdn/chunks/plan-runner-B75OACFY-IKQWQZK2.js +0 -1
  76. package/dist/chunk-JHCWF5SC.js +0 -25
package/dist/define.js CHANGED
@@ -1 +1 @@
1
- import{g as e}from"./chunk-EHI6A6IC.js";import"./chunk-HBK2ROSI.js";import"./chunk-RUGMWI6S.js";import"./chunk-MGZU2EY6.js";import"./chunk-2UKKUNLM.js";import"./chunk-P223YKM3.js";import"./chunk-2IOKT6MW.js";import"./chunk-SBLYDU3J.js";import"./chunk-SAH7S6QH.js";import"./chunk-K2HD46BJ.js";import"./chunk-AIQISJXO.js";import"./chunk-XXCBLQ53.js";import"./chunk-BBMKEHE2.js";import"./chunk-3AB3BDSC.js";import"./chunk-JHCWF5SC.js";import"./chunk-SSU37LFQ.js";e();export{e as defineSekyroElements};
1
+ import{g as e}from"./chunk-KN3AOAYL.js";import"./chunk-HBK2ROSI.js";import"./chunk-FXWTWHNX.js";import"./chunk-YQXEEIWM.js";import"./chunk-JRZE2IZT.js";import"./chunk-P223YKM3.js";import"./chunk-R57PCZSZ.js";import"./chunk-C6FGUALJ.js";import"./chunk-JPVADGVQ.js";import"./chunk-XDH4CTRQ.js";import"./chunk-CCJXGVIL.js";import"./chunk-XXCBLQ53.js";import"./chunk-RDCMAYQA.js";import"./chunk-G3M7C3QG.js";import"./chunk-Z5TRMVOP.js";import"./chunk-SSU37LFQ.js";e();export{e as defineSekyroElements};
@@ -1 +1 @@
1
- "use client";import{a as at}from"./chunk-K7FZ3SWO.js";import{a as Xe}from"./chunk-HBK2ROSI.js";import{d as nt}from"./chunk-MGZU2EY6.js";import"./chunk-P223YKM3.js";import{a as qe,b as Je,c as et}from"./chunk-SAH7S6QH.js";import"./chunk-K2HD46BJ.js";import{a as tt}from"./chunk-BBMKEHE2.js";import"./chunk-3AB3BDSC.js";import{E as Ke,F as je,G as Qe,I as Ze,K as Q,L as le,a as Ut,b as Bt,c as A,o as We,q as Ye,v as O,w as _e,y as Ce}from"./chunk-JHCWF5SC.js";import{a as l,c as Ge,i as s}from"./chunk-SSU37LFQ.js";var i=Ge(Ut(),1),n=Ge(Bt(),1);import{acceptedTypesFor as Et}from"@sekyro/web";var Vt={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"/>'},Ft={"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":"يبدو أن هذه بطاقة تعريف أو بطاقة إقامة"},ce={"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"},Gt={"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"},Xt={"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":"رفع صورة"},de={"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"},Wt={"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"},Yt={"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.darkNoLight":"الإضاءة ضعيفة. انتقل إلى مكان أفضل إضاءة.","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":"أظهر رخصة قيادتك بدلًا منها","native.scan.expired":"انتهت صلاحية هذه الوثيقة. امسح وثيقة سارية.","native.scan.surface":"الحواف غير واضحة. ضع البطاقة على سطح أغمق."},ue={"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. Move to better light or turn on the light.","native.scan.darkNoLight":"Too dark. Move to better 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","native.scan.expired":"This document has expired. Scan a valid document.","native.scan.surface":"The edges are hard to see. Put the card on a darker surface."},Kt={"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. Allez dans un endroit mieux éclairé ou allumez la lampe.","native.scan.darkNoLight":"Trop sombre. Allez dans un endroit mieux éclairé.","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","native.scan.expired":"Ce document a expiré. Scannez un document valide.","native.scan.surface":"Les bords se voient mal. Posez la carte sur une surface plus sombre."},G,ot=(G=class{constructor(){this.shown=null,this.shownAt=0,this.yielded=null,this.shownPhotos=0}present(t,a,o,r,m=0){(t===null||t.key!==this.yielded)&&(this.yielded=null);let y=this.shown;return t!==null&&this.yielded===null?y?.kind==="problem"&&y.key===t.key&&y.action===t.action?(this.shownPhotos=m,!t.blocking&&a!==null&&r-this.shownAt>=3e3?(this.yielded=t.key,this.show({kind:"hint",key:a,action:null},r,m)):y):this.show({kind:"problem",key:t.key,action:t.action},r,m):y?.kind==="problem"&&t===null&&m===this.shownPhotos&&(o||r-this.shownAt<3e3)?y:a===null?this.show(null,r):y?.kind==="hint"&&y.key===a?y:this.show({kind:"hint",key:a,action:null},r)}show(t,a,o=this.shownPhotos){return this.shown=t,this.shownAt=a,this.shownPhotos=o,t}},l(G,"_e"),G);s(ot,"NoticeBand");var jt=ot,Qt=["locking","capturing"],X,rt=(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(t,a){return this.presentHint(t,a),this.presentLock(t,a),this.presentCard(t,a),this.shutterSince=t.manualShutter?this.shutterSince??a:null,this.shown={...this.shown,manualShutter:this.shutterSince!==null&&a-this.shutterSince>=1e3},this.shown}presentHint(t,a){let o=t.phase==="framing"&&!(t.hint==="blurry"&&t.card===null)?t.hint:null;if(t.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),m=this.shown.hint===null||a-this.hintShownAt>=2500;r&&m&&(this.shown={...this.shown,hint:o},this.hintShownAt=a)}presentLock(t,a){if(Qt.includes(t.phase)){this.shown={...this.shown,locking:!0},this.lockLostAt=null;return}if(this.shown.locking){if(t.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(t,a){let o=t.card;if(o===null||t.phase!=="framing"){if(t.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 m=.35;this.shown={...this.shown,card:{fill:r.fill+(o.fill-r.fill)*m,offsetX:r.offsetX+(o.offsetX-r.offsetX)*m,offsetY:r.offsetY+(o.offsetY-r.offsetY)*m}}}},l(X,"Ce"),X);s(rt,"ScanPresenter");var Zt=rt,qt={en:ue,fr:Kt,ar:Yt,es:ue,pt:ue,de:ue},Jt=450,Ne=s(e=>(t,a)=>tt(e.strings[t]??qt[e.locale][t]??"",a),"useScanCopy");function it(e,t){try{return new Intl.DisplayNames([t],{type:"region"}).of(e)??e}catch{return e}}l(it,"Ut");s(it,"regionName");function st(e){let t=e.documentType,a=t===null?"native.doc.introTitle":`native.doc.titleOf.${t}`,o=t!==null&&e.issuer!==null&&Et(e.documents,e.issuer).length===1;return{titleKey:a,onlyKey:o?`native.doc.onlyType.${t}`:null}}l(st,"Et");s(st,"introCopy");function Z({name:e}){return(0,n.jsx)("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:Vt[e]}})}l(Z,"me");s(Z,"ScanGlyph");var en={en:ce,fr:Gt,ar:Ft,es:ce,pt:ce,de:ce},tn={en:de,fr:Wt,ar:Xt,es:de,pt:de,de},nn="image/jpeg,image/png,image/heic,image/heif";function B(e){let t=e.strings,a=s(o=>t[o]??tn[e.locale][o],"text");return{t:s(o=>a(o)??"","t")}}l(B,"G");s(B,"uploadCopy");function lt(e,t){return e===null||e.state==="fallback"||e.state==="mismatch"||e.state==="expired"?null:e.state==="searching"?t?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":e.state==="valid"?"dcv3.mrz.valid":e.coach==="holdStill"?"dcv3.mrz.holdStill":"dcv3.mrz.reading"}l(lt,"Vt");s(lt,"mrzInstruction");function ct(e){return e?.state==="reading"&&e.coach!==void 0&&e.coach!=="holdStill"?`mrz:${e.coach}`:null}l(ct,"Yt");s(ct,"mrzHint");function dt(e){return e==="carte_identite"||e==="passport"||e==="residence_permit"||e==="drivers_license"?`native.scan.showInstead.${e}`:null}l(dt,"Gt");s(dt,"showInsteadKey");var an={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",document_side_not_read:"doc.reason_document_side_not_read",document_too_dark:"doc.reason_document_too_dark"};function he(e){if(e.reason==="unreadable")return"doc.reason_unreadable";let t=e.reason!==void 0?an[e.reason]:void 0;return t!==void 0?t:e.reason==="tester_document_mismatch"?"reasons.tester_document_mismatch":e.reason!==void 0&&e.reason!=="side_missing"?Ye(e.reason):null}l(he,"xe");s(he,"reasonOf");var ut=new Set(["document_type_not_accepted","tester_document_mismatch","document_type_mismatch","provider_unavailable","document_type_not_supported","document_sides_mismatch","document_side_not_read"]);function on({step:e,i18n:t,liveMrz:a,barcodeAssetBaseUrl:o,ageLead:r,...m}){let[y,h]=(0,i.useState)(!1),k=(0,i.useRef)(-1),[w,_]=(0,i.useState)("idle"),$=(0,i.useRef)(null),S=typeof e.uploadDocument=="function",b=S?e.photo?.source??"camera":"camera",L=S&&b!=="camera"&&e.photo?.uploadOffered===!0,[f,E]=(0,i.useState)(null),I=b==="upload"?"upload":b==="choice"?f??e.photo?.pick??"source":"camera",D=w==="sending"?void 0:()=>$.current?.click(),g=s(async V=>{let Y=V.currentTarget.files?.[0];if(V.currentTarget.value="",Y!==void 0){h(!1),_("sending");try{await e.uploadDocument(Y),_("idle")}catch(J){_(J instanceof TypeError&&J.message==="unsupported_file"?"unsupported":"failed")}}},"onFile"),q=L?(0,n.jsx)("input",{ref:$,type:"file",accept:nn,hidden:!0,"data-testid":"sekyro-doc-upload","aria-label":B(t).t("doc.uploadTitle"),onChange:l(V=>{g(V)},"onChange")}):null,z=B(t),W=e.photo?.cameraOnPhone===!0;return I==="camera"&&W?(0,n.jsx)(nt,{i18n:t,lead:t.t("handoff.lead.document"),refresh:e.refresh,actions:(0,n.jsx)(A,{kind:"ghost",full:!0,onClick:l(()=>E("upload"),"onClick"),children:z.t("doc.source.upload")})}):I==="source"?(0,n.jsx)(at,{testId:"sekyro-doc-source",title:z.t("doc.source.title"),lead:z.t("doc.source.description"),cameraLabel:W?t.t("capture.source.phone"):z.t("doc.source.camera"),onPhone:W,uploadLabel:z.t("doc.source.upload"),notice:(0,n.jsx)(pe,{step:e,i18n:t}),onCamera:l(()=>E("camera"),"onCamera"),onUpload:l(()=>E("upload"),"onUpload")}):I==="upload"?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(mt,{step:e,i18n:t,ageLead:r===!0,upload:w,offered:L,onPick:l(()=>$.current?.click(),"onPick"),...b==="choice"?{onCamera:s(()=>E("camera"),"onCamera")}:{},...m}),q]}):(0,n.jsxs)(n.Fragment,{children:[y?(0,n.jsx)(vt,{step:e,i18n:t,attempts:k,...a!==void 0?{liveMrz:a}:{},...o!==void 0?{barcodeAssetBaseUrl:o}:{},...L&&D!==void 0?{onUpload:D}:{},onClose:l(()=>h(!1),"onClose")}):(0,n.jsx)(pt,{step:e,i18n:t,ageLead:r===!0,onOpen:l(()=>h(!0),"onOpen"),upload:w,...L&&D!==void 0?{onUpload:D}:{},...m}),q]})}l(on,"Xn");s(on,"DocumentCaptureView");function Se({passport:e}){let t=Math.round(228/(e?1.42:1.586));return(0,n.jsxs)("svg",{className:`sekyro-mark sekyro-mark--card${e?" sekyro-mark--passport":""}`,viewBox:`-12 ${e?-22:-12} 252 ${t+(e?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:t,rx:"12.5"})})}),e?(0,n.jsx)("rect",{className:"sekyro-mark__page",x:"10",y:"-14",width:208,height:t,rx:"10"}):null,(0,n.jsx)("rect",{className:"sekyro-mark__card",width:228,height:t,rx:"12.5"}),(0,n.jsx)("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:t*(e?.5:.62),rx:"6"}),[0,1,2].map(a=>(0,n.jsx)("rect",{className:"sekyro-mark__text",x:"88",y:23+a*t*.12,width:100-a*20,height:"6",rx:"3"},a)),e?[0,1].map(a=>(0,n.jsx)("line",{className:"sekyro-mark__code",x1:"17",x2:211,y1:t*.75+a*11,y2:t*.75+a*11},a)):(0,n.jsx)("rect",{className:"sekyro-mark__text",x:"88",y:23+3*t*.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:t,className:"sekyro-mark__beam"})})}),(0,n.jsx)("path",{className:"sekyro-mark__brackets",d:ht(-10,-10,248,t+20,16,30)})]})}l(Se,"ht");s(Se,"ScanMark");function ht(e,t,a,o,r,m){let y=Math.min(r,m*.6);return[[e,t,1,1],[e+a,t,-1,1],[e,t+o,1,-1],[e+a,t+o,-1,-1]].map(([h,k,w,_])=>`M${h} ${k+_*m}V${k+_*y}Q${h} ${k} ${h+w*y} ${k}H${h+w*m}`).join("")}l(ht,"Xt");s(ht,"brackets");function pt({step:e,i18n:t,ageLead:a,onOpen:o,onChangeCountry:r,onChangeDocument:m,upload:y,onUpload:h}){let k=Ne(t),w=B(t),_=e.documentType==="passport",$=st(e),S=he(e),b=y==="sending",L=(0,i.useContext)(je)?.busy===!0,f=Xe(e.acceptedNationalities,t);return(0,n.jsxs)("section",{className:"sekyro-step sekyro-step--doc-intro","data-testid":"sekyro-document",children:[(0,n.jsx)(Se,{passport:_}),(0,n.jsx)(_e,{title:k($.titleKey)||k("native.doc.introTitle"),lead:a?t.t("doc.ageStepUp"):k("native.doc.introLead")}),$.onlyKey!==null&&e.issuer!==null?(0,n.jsx)("p",{className:"sekyro-text-muted sekyro-doc-only",children:k($.onlyKey,{country:it(e.issuer,t.locale)})}):null,f!==null?(0,n.jsx)(Q,{tone:"info",children:f}):null,(0,n.jsx)(pe,{step:e,i18n:t}),e.reason!==void 0&&ut.has(e.reason)?null:(0,n.jsxs)("ul",{className:"sekyro-tiprows",children:[(0,n.jsxs)("li",{children:[(0,n.jsx)(O,{name:_?"passport":"card"}),k("native.doc.tip.flat")]}),(0,n.jsxs)("li",{children:[(0,n.jsx)(O,{name:"light"}),k("native.doc.tip.glare")]}),(0,n.jsxs)("li",{children:[(0,n.jsx)(Z,{name:"image"}),k("native.doc.tip.frame")]})]}),(0,n.jsx)(xe,{i18n:t,...m!==void 0?{onChangeDocument:m}:{},...r!==void 0?{onChangeCountry:r}:{}}),(0,n.jsx)($e,{i18n:t,upload:y}),b?(0,n.jsx)("p",{className:"sekyro-text-muted",role:"status",children:t.t("doc.uploading")}):h!==void 0?(0,n.jsx)("p",{className:"sekyro-text-muted",children:w.t("doc.uploadHint")}):null,(0,n.jsxs)(Ce,{children:[(0,n.jsxs)(A,{full:!0,onClick:o,disabled:b||L,children:[(0,n.jsx)(O,{name:"camera"}),k("native.doc.openCamera")]}),h!==void 0?(0,n.jsxs)(A,{full:!0,kind:"ghost",onClick:h,children:[(0,n.jsx)(Z,{name:"image"}),w.t("doc.uploadInstead")]}):null]})]})}l(pt,"Wt");s(pt,"DocumentIntro");function pe({step:e,i18n:t}){let a=he(e);return a===null&&e.reasonHidden===!0?(0,n.jsx)(Q,{tone:"info",children:(0,n.jsx)("span",{children:le(t,e.attemptsRemaining,e.attemptsExhausted)})}):a===null?null:(0,n.jsxs)(Q,{tone:"warning",children:[(0,n.jsx)("span",{children:t.t(a)}),(0,n.jsx)("span",{children:le(t,e.attemptsRemaining,e.attemptsExhausted)})]})}l(pe,"Le");s(pe,"ReasonNotice");function xe({i18n:e,onChangeCountry:t,onChangeDocument:a}){let o=Ne(e);return a===void 0&&t===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,t!==void 0?(0,n.jsx)("button",{type:"button",className:"sekyro-link",onClick:t,children:e.t("native.doc.changeCountry")}):null]})}l(xe,"ft");s(xe,"ChangeLinks");function $e({i18n:e,upload:t}){return t!=="unsupported"&&t!=="failed"?null:(0,n.jsx)(Q,{tone:"warning",children:(0,n.jsx)("span",{children:B(e).t(t==="unsupported"?"doc.uploadUnsupported":"doc.uploadFailed")})})}l($e,"yt");s($e,"UploadNotice");function mt({step:e,i18n:t,ageLead:a,upload:o,offered:r,onPick:m,onCamera:y,onChangeCountry:h,onChangeDocument:k}){let w=B(t),_=o==="sending";return(0,n.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-doc-upload-screen",children:[(0,n.jsx)(Se,{passport:e.documentType==="passport"}),(0,n.jsx)(_e,{title:w.t("doc.uploadTitle"),lead:a?t.t("doc.ageStepUp"):w.t("doc.uploadHint")}),a?(0,n.jsx)("p",{className:"sekyro-text-muted",children:w.t("doc.uploadHint")}):null,(0,n.jsx)(pe,{step:e,i18n:t}),(0,n.jsx)(xe,{i18n:t,...k!==void 0?{onChangeDocument:k}:{},...h!==void 0?{onChangeCountry:h}:{}}),(0,n.jsx)($e,{i18n:t,upload:o}),_?(0,n.jsx)("p",{className:"sekyro-text-muted",role:"status",children:t.t("doc.uploading")}):null,(0,n.jsxs)(Ce,{children:[(0,n.jsxs)(A,{full:!0,onClick:m,disabled:_||!r||e.attemptsExhausted,children:[(0,n.jsx)(Z,{name:"image"}),w.t("doc.source.upload")]}),y!==void 0?(0,n.jsxs)(A,{full:!0,kind:"ghost",onClick:y,disabled:_,children:[(0,n.jsx)(O,{name:"camera"}),w.t("doc.source.camera")]}):null]})]})}l(mt,"jt");s(mt,"DocumentUploadScreen");function ze(e,t,a){let o=e*.88,r=o/a;return{x:(e-o)/2,y:t*.42-r/2,w:o,h:r}}l(ze,"ut");s(ze,"guideRect");var rn={"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",low_contrast:"native.scan.surface"},sn=s(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function vt({step:e,i18n:t,liveMrz:a,barcodeAssetBaseUrl:o,onClose:r,attempts:m,onUpload:y}){let h=Ne(t),k=(0,i.useContext)(qe),w=(0,i.useRef)(k);w.current=k;let _=(0,i.useRef)(null),$=(0,i.useRef)(null),S=(0,i.useRef)(null),[b,L]=(0,i.useState)("idle"),[f,E]=(0,i.useState)(null),[I,D]=(0,i.useState)(null),[g,q]=(0,i.useState)({w:0,h:0}),[z,W]=(0,i.useState)({hint:null,locking:!1,card:null,manualShutter:!1}),[V,Y]=(0,i.useState)({}),[J,Te]=(0,i.useState)({}),[Le,Me]=(0,i.useState)(null),[Pe,bt]=(0,i.useState)(null),[Ie,He]=(0,i.useState)(0),[me,Ae]=(0,i.useState)(null),[ve,zt]=(0,i.useState)(null),[ee,Nt]=(0,i.useState)(0),te=(0,i.useRef)(0);te.current=ee;let[St,Oe]=(0,i.useState)(0),De=(0,i.useRef)(0),ne=(0,i.useRef)(null);(0,i.useEffect)(()=>{Oe(te.current)},[e.reason,e.attemptsRemaining]);let R=e.documentType==="passport",ae=R?1.42:1.586;Ke(!0),(0,i.useLayoutEffect)(()=>{let d=_.current;if(d===null)return;let v=s(()=>q({w:d.clientWidth,h:d.clientHeight}),"measure");if(v(),typeof ResizeObserver>"u")return;let p=new ResizeObserver(v);return p.observe(d),()=>p.disconnect()},[]);let c=ze(g.w,g.h,ae);(0,i.useEffect)(()=>{g.w===0||g.h===0||S.current?.setGuide?.({viewAspect:g.w/g.h,rect:{x:c.x/g.w,y:c.y/g.h,width:c.w/g.w,height:c.h/g.h}})},[g.w,g.h,c.x,c.y,c.w,c.h]),(0,i.useEffect)(()=>{let d=$.current;if(d===null)return;let v=e.capture({video:d,...a!==void 0?{liveMrz:a}:{},...o!==void 0?{barcodeAssetBaseUrl:o}:{}});S.current=v,Y({}),Te({}),Me(null);let p=_.current;if(p!==null&&p.clientWidth>0&&p.clientHeight>0){let u=ze(p.clientWidth,p.clientHeight,ae);v.setGuide?.({viewAspect:p.clientWidth/p.clientHeight,rect:{x:u.x/p.clientWidth,y:u.y/p.clientHeight,width:u.w/p.clientWidth,height:u.h/p.clientHeight}})}let T=new Zt,N={scan:null,feedback:null,gate:null,mrz:null},H=s(u=>{N={...N,...u};let C=N.gate?.guide,Rt={phase:N.scan?.phase??"framing",hint:N.feedback?.reticle==="coaching"?N.feedback.key:e.documentType==="drivers_license"?null:ct(N.mrz),card:C?.detected?{fill:C.fill,offsetX:C.offsetX,offsetY:C.offsetY}:null,manualShutter:N.scan?.manualShutter??!1},K=T.present(Rt,performance.now());W(j=>j.hint===K.hint&&j.locking===K.locking&&j.manualShutter===K.manualShutter&&_t(j.card,K.card)?j:K)},"present"),Dt=[v.on("state",L),v.on("feedback",u=>H({feedback:u})),v.on("gate",u=>H({gate:u})),v.on("scan",u=>{u.captured.length===0&&De.current>0&&Oe(te.current),De.current=u.captured.length,ne.current=(ne.current??u.captured).filter(C=>u.captured.includes(C)),E(u),H({scan:u})}),v.on("captured",u=>{Nt(C=>C+1),Y(C=>({...C,[gt(u.side,R,C)]:u.previewDataUrl})),u.photo!==void 0&&Te(C=>({...C,[u.photo]:u.previewDataUrl})),Me(u.previewDataUrl),bt(Ct(d))}),v.on("error",u=>{D(u);let C=w.current;C!==null&&et(C,Je("document",u,Math.max(0,m.current)))}),v.on("mrz",u=>{u.state==="mismatch"?zt({format:u.format??null,at:te.current}):(Ae(u),H({mrz:u}))})];return m.current+=1,v.start().catch(()=>{}),()=>{ne.current=null;for(let u of Dt)u();v.destroy(),S.current=null}},[e.issuer,e.documentType]);let M=f?.phase??"framing",P=M==="reading"||M==="result",oe=M==="flipCue"||M==="reaskRecto",U=z.locking,Re=f?.captured.length??0;(0,i.useEffect)(()=>{U&&He(d=>d+1)},[U]),(0,i.useEffect)(()=>{Re>0&&He(d=>d+1)},[Re]);let xt=f?.expected??null;(0,i.useEffect)(()=>{Ae(null)},[xt]);let ye=oe||P||e.documentType==="drivers_license"?null:lt(me,R),Ue=s(d=>t.strings[d]??en[t.locale][d],"liveText"),$t=s(d=>d.startsWith("dcv3.")?Ue(d):h(d),"copy"),ke=ye!==null?Ue(ye):h(M==="flipCue"?"doc.flip":M==="reaskRecto"?"doc.reaskRecto":P?"native.scan.reading":M==="locking"||M==="capturing"||U?"native.scan.holdStill":R?"doc.showPage":"doc.showSide"),re=e.browserCheck??null,fe=re!==null&&P,ie=he(e),Be=s(d=>({key:h(d),action:le(t,e.attemptsRemaining,e.attemptsExhausted),blocking:e.reason!==void 0&&ut.has(e.reason)}),"reasonProblem"),Ee=dt(e.documentType),Tt=me?.state==="expired"&&!oe&&!P?{key:h("native.scan.expired"),action:null,blocking:!0}:ve!==null&&ee<=ve.at+1?{key:h(ve.format==="TD3"?"native.scan.seenPassport":"native.scan.seenCard"),action:Ee===null?null:h(Ee),blocking:!0}:f?.notice==="same_face"?{key:h("doc.sameFace"),action:null,blocking:!1}:f?.notice==="reread"?ie!==null?Be(ie):{key:h("doc.reread"),action:null,blocking:!1}:f?.notice==="technical"?{key:h("native.scan.retry"),action:null,blocking:!1}:f?.notice==="blurry"?{key:h("native.scan.blurry"),action:null,blocking:!1}:ie!==null&&ee===St?Be(ie):null,Lt=f?.torchAvailable===!0&&f.torch!==!0?"native.scan.dark":"native.scan.darkNoLight",Mt=z.hint===null?null:$t(z.hint==="too_dark"?Lt:rn[z.hint]??`dcv2.${z.hint}`),Pt=z.hint==="too_dark"&&f?.torch!==!0,Ve=yt(Tt,Mt,U||M==="capturing"||P,ee),F=z.card,x=c;if(!U&&F!==null&&F.fill>=.45&&F.fill<=1.25&&!sn()){let d=c.w*F.fill,v=d/ae,p=c.x+c.w/2+c.w*Math.max(-.25,Math.min(.25,F.offsetX)),T=c.y+c.h/2+c.h*Math.max(-.25,Math.min(.25,F.offsetY));x={x:p-d/2,y:T-v/2,w:d,h:v}}let se=c.w*.045,ge=28,Fe=Math.min(se,ge*.6),It=[[x.x,x.y,1,1],[x.x+x.w,x.y,-1,1],[x.x,x.y+x.h,1,-1],[x.x+x.w,x.y+x.h,-1,-1]],Ht=U?"is-locked":Ve!==null?"is-coaching":"",At=R?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],Ot=c.y+c.h+16,we={insetInlineStart:c.x,insetBlockStart:c.y,inlineSize:c.w,blockSize:c.h,borderRadius:se};return(0,n.jsx)("section",{className:"sekyro-lm","aria-label":ke,"data-testid":"sekyro-document",children:(0,n.jsxs)("div",{ref:_,className:`sekyro-lm-stage${P?" is-reading":""}${oe?" is-flip":""}`,style:{"--sekyro-guide-w":`${c.w}px`},children:[(0,n.jsx)("video",{ref:$,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:l(d=>{let v=d.currentTarget,p=v.getBoundingClientRect(),T=Math.max(p.width/(v.videoWidth||1),p.height/(v.videoHeight||1)),N=v.videoWidth*T,H=v.videoHeight*T;N>0&&H>0&&S.current?.focusAt((d.clientX-p.left+(N-p.width)/2)/N,(d.clientY-p.top+(H-p.height)/2)/H)},"onPointerUp")}),g.w>0?(0,n.jsxs)(n.Fragment,{children:[P&&Pe!==null?(0,n.jsx)("img",{className:"sekyro-lm-scene",src:Pe,alt:""}):null,P&&Le!==null?(0,n.jsx)("img",{className:"sekyro-lm-frozen",src:Le,alt:"",style:we}):null,(0,n.jsxs)("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${g.w} ${g.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${g.w}V${g.h}H0Z${wt(c,se)}`}),(0,n.jsx)("rect",{width:g.w,height:Math.max(0,c.y),fill:"url(#sekyro-lm-top)"}),(0,n.jsx)("rect",{y:c.y+c.h,width:g.w,height:Math.max(0,g.h-c.y-c.h),fill:"url(#sekyro-lm-bottom)"}),(0,n.jsx)("g",{className:`sekyro-lm-brackets ${Ht}`,children:It.map(([d,v,p,T],N)=>(0,n.jsx)("path",{style:{transform:`translate(${d}px, ${v}px) scale(${p}, ${T})`},d:`M0 ${ge}V${Fe}Q0 0 ${Fe} 0H${ge}`},N))}),U?(0,n.jsx)("rect",{className:"sekyro-lm-trace",x:c.x,y:c.y,width:c.w,height:c.h,rx:se,pathLength:"1",style:{animationDuration:`${Jt}ms`}}):null]}),(0,n.jsx)("div",{className:"sekyro-lm-slot",style:we,"aria-hidden":"true",children:P?(0,n.jsx)("span",{className:"sekyro-lm-read is-repeating"}):Ie>0?(0,n.jsx)("span",{className:"sekyro-lm-read"},Ie):null})]}):null,ye!==null?(0,n.jsx)("div",{className:"sekyro-lm-slot",style:we,"aria-hidden":"true",children:(0,n.jsx)("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${R?" is-page":""}${me?.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:fe?null:(0,n.jsx)(Ze,{swapKey:ke,className:"sekyro-lm-line",children:ke})})}),(0,n.jsxs)("div",{className:"sekyro-lm-below",style:{insetBlockStart:Ot,inlineSize:c.w,insetInlineStart:c.x},children:[(0,n.jsx)(kt,{band:Ve}),fe?null:P?(0,n.jsxs)("p",{className:"sekyro-lm-note",children:[(0,n.jsx)("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),h("native.scan.putDown")]}):oe?(0,n.jsx)("div",{className:`sekyro-lm-flip${M==="reaskRecto"?" is-toFront":""}`,"data-testid":"sekyro-flip-cue","aria-hidden":"true",children:(0,n.jsxs)("span",{className:"sekyro-lm-flip-card",style:{aspectRatio:String(ae)},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":t.t("native.close"),onClick:r,children:(0,n.jsx)(O,{name:"close"})}),f?.torchAvailable?(0,n.jsx)("button",{type:"button",className:`sekyro-glass${f.torch?" is-on":""}${Pt?" is-cue":""}`,"aria-label":t.t("doc.torchOn"),"aria-pressed":f.torch,onClick:l(()=>S.current?.setTorch(!f.torch),"onClick"),children:(0,n.jsx)(Z,{name:"flashlight"})}):null]}),I!==null?(0,n.jsxs)("div",{className:"sekyro-lm-error",role:"alert",children:[(0,n.jsx)("p",{children:t.t("doc.cameraBlocked")}),(0,n.jsx)("p",{children:t.t(I.kind==="permission"?"doc.cameraBlockedHint":We(I.kind))}),(0,n.jsx)(A,{onClick:l(()=>{D(null),m.current+=1,S.current?.retry()},"onClick"),children:t.t("doc.retryCamera")})]}):null,re!==null&&I===null?(0,n.jsxs)("div",{className:"sekyro-lm-error",role:"alert","data-testid":"sekyro-doc-browser-check",children:[(0,n.jsx)("p",{children:t.t(re.code==="clock_wrong"?"errors.device_clock":"errors.attestation_invalid")}),(0,n.jsx)(A,{onClick:re.retry,children:t.t("common.retry")})]}):null,z.manualShutter?(0,n.jsx)("button",{type:"button",className:"sekyro-shutter","aria-label":t.t("doc.shutter"),onClick:l(()=>S.current?.shutter(),"onClick")}):null,(0,n.jsx)("ol",{className:"sekyro-lm-tray",children:At.map(({side:d,label:v})=>{let p=f?.captured.includes(d)??!1,T=ft(d,f,J,V);return(0,n.jsxs)("li",{className:p?"is-done":void 0,"aria-current":!p&&(R||f?.expected===d)?"step":void 0,children:[p?(0,n.jsxs)("span",{className:"sekyro-lm-thumb",children:[T!==void 0?(0,n.jsx)("img",{src:T,alt:""}):(0,n.jsx)(O,{name:"card"}),(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(v),p&&T===void 0&&ne.current?.includes(d)?(0,n.jsx)("span",{className:"sekyro-lm-received",children:h("doc.sideReceived")}):null]},d)})}),y!==void 0?(0,n.jsx)("button",{type:"button",className:"sekyro-lm-upload",onClick:y,children:B(t).t("doc.uploadInstead")}):null,b==="uploading"||b==="checking"?null:(0,n.jsx)(Qe,{onStop:r})]}),!fe&&(b==="uploading"||b==="checking")?(0,n.jsx)("span",{className:"sekyro-visually-hidden",role:"status",children:b==="uploading"?t.t("doc.uploading"):h("native.scan.reading")}):null]})})}l(vt,"Jt");s(vt,"LumiereScan");function yt(e,t,a,o){let r=(0,i.useRef)(null);r.current??(r.current=new jt);let[m,y]=(0,i.useState)(null),h=(0,i.useRef)({problem:e,hint:t,busy:a,photos:o});h.current={problem:e,hint:t,busy:a,photos:o};let k=e===null?null:`${e.blocking}|${e.key}|${e.action??""}`;return(0,i.useEffect)(()=>{let w=s(()=>{let{problem:$,hint:S,busy:b,photos:L}=h.current;y(r.current?.present($,S,b,performance.now(),L)??null)},"run");w();let _=setInterval(w,250);return()=>clearInterval(_)},[k,t,a,o]),m}l(yt,"qt");s(yt,"useNoticeBand");function kt({band:e}){let[t,a]=(0,i.useState)(e);(0,i.useEffect)(()=>{e!==null&&a(e)},[e]);let o=e??t;return(0,n.jsx)("div",{className:`sekyro-lm-band${e!==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":e===null||void 0,children:[(0,n.jsx)("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:(0,n.jsx)(O,{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(kt,"en");s(kt,"NoticeBandView");function ft(e,t,a,o){if(t?.photos===void 0)return o[e];let r=t.photos[e];return r===void 0?void 0:a[r]}l(ft,"tn");s(ft,"thumbOf");function gt(e,t,a){return t?"single":e==="recto"||e==="verso"?e:a.recto===void 0?"recto":"verso"}l(gt,"nn");s(gt,"slotOf");function wt({x:e,y:t,w:a,h:o},r){return`M${e+r} ${t}H${e+a-r}Q${e+a} ${t} ${e+a} ${t+r}V${t+o-r}Q${e+a} ${t+o} ${e+a-r} ${t+o}H${e+r}Q${e} ${t+o} ${e} ${t+o-r}V${t+r}Q${e} ${t} ${e+r} ${t}Z`}l(wt,"on");s(wt,"roundedRect");var be=.004;function _t(e,t){return e===null||t===null?e===t:Math.abs(e.fill-t.fill)<be&&Math.abs(e.offsetX-t.offsetX)<be&&Math.abs(e.offsetY-t.offsetY)<be}l(_t,"rn");s(_t,"sameCard");function Ct(e){let t=Math.round(e.videoWidth/4),a=Math.round(e.videoHeight/4);if(t===0||a===0||typeof document>"u")return null;try{let o=document.createElement("canvas");o.width=t,o.height=a;let r=o.getContext("2d");return r===null?null:(r.drawImage(e,0,0,t,a),o.toDataURL("image/jpeg",.7))}catch{return null}}l(Ct,"an");s(Ct,"sceneSnapshot");export{on as DocumentCaptureView,Jt as LOCK_TRACE_MS,nn as UPLOAD_ACCEPT,ze as guideRect,st as introCopy,ct as mrzHint,lt as mrzInstruction,_t as sameCard,dt as showInsteadKey,gt as slotOf,ft as thumbOf};
1
+ "use client";import{a as at}from"./chunk-GQIZ42ZI.js";import{a as Xe}from"./chunk-HBK2ROSI.js";import{d as nt}from"./chunk-YQXEEIWM.js";import"./chunk-P223YKM3.js";import{a as qe,b as Je,c as et}from"./chunk-JPVADGVQ.js";import"./chunk-XDH4CTRQ.js";import{a as tt}from"./chunk-RDCMAYQA.js";import"./chunk-G3M7C3QG.js";import{E as Ke,F as je,G as Qe,I as Ze,K as Q,L as le,a as Ut,b as Bt,c as A,o as We,q as Ye,v as O,w as _e,y as Ce}from"./chunk-Z5TRMVOP.js";import{a as l,c as Ge,i as s}from"./chunk-SSU37LFQ.js";var i=Ge(Ut(),1),n=Ge(Bt(),1);import{acceptedTypesFor as Et}from"@sekyro/web";var Vt={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"/>'},Ft={"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":"يبدو أن هذه بطاقة تعريف أو بطاقة إقامة"},ce={"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"},Gt={"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"},Xt={"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":"رفع صورة"},de={"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"},Wt={"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"},Yt={"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.darkNoLight":"الإضاءة ضعيفة. انتقل إلى مكان أفضل إضاءة.","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":"أظهر رخصة قيادتك بدلًا منها","native.scan.expired":"انتهت صلاحية هذه الوثيقة. امسح وثيقة سارية.","native.scan.surface":"الحواف غير واضحة. ضع البطاقة على سطح أغمق."},ue={"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. Move to better light or turn on the light.","native.scan.darkNoLight":"Too dark. Move to better 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","native.scan.expired":"This document has expired. Scan a valid document.","native.scan.surface":"The edges are hard to see. Put the card on a darker surface."},Kt={"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. Allez dans un endroit mieux éclairé ou allumez la lampe.","native.scan.darkNoLight":"Trop sombre. Allez dans un endroit mieux éclairé.","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","native.scan.expired":"Ce document a expiré. Scannez un document valide.","native.scan.surface":"Les bords se voient mal. Posez la carte sur une surface plus sombre."},G,ot=(G=class{constructor(){this.shown=null,this.shownAt=0,this.yielded=null,this.shownPhotos=0}present(t,a,o,r,m=0){(t===null||t.key!==this.yielded)&&(this.yielded=null);let y=this.shown;return t!==null&&this.yielded===null?y?.kind==="problem"&&y.key===t.key&&y.action===t.action?(this.shownPhotos=m,!t.blocking&&a!==null&&r-this.shownAt>=3e3?(this.yielded=t.key,this.show({kind:"hint",key:a,action:null},r,m)):y):this.show({kind:"problem",key:t.key,action:t.action},r,m):y?.kind==="problem"&&t===null&&m===this.shownPhotos&&(o||r-this.shownAt<3e3)?y:a===null?this.show(null,r):y?.kind==="hint"&&y.key===a?y:this.show({kind:"hint",key:a,action:null},r)}show(t,a,o=this.shownPhotos){return this.shown=t,this.shownAt=a,this.shownPhotos=o,t}},l(G,"_e"),G);s(ot,"NoticeBand");var jt=ot,Qt=["locking","capturing"],X,rt=(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(t,a){return this.presentHint(t,a),this.presentLock(t,a),this.presentCard(t,a),this.shutterSince=t.manualShutter?this.shutterSince??a:null,this.shown={...this.shown,manualShutter:this.shutterSince!==null&&a-this.shutterSince>=1e3},this.shown}presentHint(t,a){let o=t.phase==="framing"&&!(t.hint==="blurry"&&t.card===null)?t.hint:null;if(t.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),m=this.shown.hint===null||a-this.hintShownAt>=2500;r&&m&&(this.shown={...this.shown,hint:o},this.hintShownAt=a)}presentLock(t,a){if(Qt.includes(t.phase)){this.shown={...this.shown,locking:!0},this.lockLostAt=null;return}if(this.shown.locking){if(t.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(t,a){let o=t.card;if(o===null||t.phase!=="framing"){if(t.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 m=.35;this.shown={...this.shown,card:{fill:r.fill+(o.fill-r.fill)*m,offsetX:r.offsetX+(o.offsetX-r.offsetX)*m,offsetY:r.offsetY+(o.offsetY-r.offsetY)*m}}}},l(X,"Ce"),X);s(rt,"ScanPresenter");var Zt=rt,qt={en:ue,fr:Kt,ar:Yt,es:ue,pt:ue,de:ue},Jt=450,Ne=s(e=>(t,a)=>tt(e.strings[t]??qt[e.locale][t]??"",a),"useScanCopy");function it(e,t){try{return new Intl.DisplayNames([t],{type:"region"}).of(e)??e}catch{return e}}l(it,"Ut");s(it,"regionName");function st(e){let t=e.documentType,a=t===null?"native.doc.introTitle":`native.doc.titleOf.${t}`,o=t!==null&&e.issuer!==null&&Et(e.documents,e.issuer).length===1;return{titleKey:a,onlyKey:o?`native.doc.onlyType.${t}`:null}}l(st,"Et");s(st,"introCopy");function Z({name:e}){return(0,n.jsx)("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:Vt[e]}})}l(Z,"me");s(Z,"ScanGlyph");var en={en:ce,fr:Gt,ar:Ft,es:ce,pt:ce,de:ce},tn={en:de,fr:Wt,ar:Xt,es:de,pt:de,de},nn="image/jpeg,image/png,image/heic,image/heif";function B(e){let t=e.strings,a=s(o=>t[o]??tn[e.locale][o],"text");return{t:s(o=>a(o)??"","t")}}l(B,"G");s(B,"uploadCopy");function lt(e,t){return e===null||e.state==="fallback"||e.state==="mismatch"||e.state==="expired"?null:e.state==="searching"?t?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":e.state==="valid"?"dcv3.mrz.valid":e.coach==="holdStill"?"dcv3.mrz.holdStill":"dcv3.mrz.reading"}l(lt,"Vt");s(lt,"mrzInstruction");function ct(e){return e?.state==="reading"&&e.coach!==void 0&&e.coach!=="holdStill"?`mrz:${e.coach}`:null}l(ct,"Yt");s(ct,"mrzHint");function dt(e){return e==="carte_identite"||e==="passport"||e==="residence_permit"||e==="drivers_license"?`native.scan.showInstead.${e}`:null}l(dt,"Gt");s(dt,"showInsteadKey");var an={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",document_side_not_read:"doc.reason_document_side_not_read",document_too_dark:"doc.reason_document_too_dark"};function he(e){if(e.reason==="unreadable")return"doc.reason_unreadable";let t=e.reason!==void 0?an[e.reason]:void 0;return t!==void 0?t:e.reason==="tester_document_mismatch"?"reasons.tester_document_mismatch":e.reason!==void 0&&e.reason!=="side_missing"?Ye(e.reason):null}l(he,"xe");s(he,"reasonOf");var ut=new Set(["document_type_not_accepted","tester_document_mismatch","document_type_mismatch","provider_unavailable","document_type_not_supported","document_sides_mismatch","document_side_not_read"]);function on({step:e,i18n:t,liveMrz:a,barcodeAssetBaseUrl:o,ageLead:r,...m}){let[y,h]=(0,i.useState)(!1),k=(0,i.useRef)(-1),[w,_]=(0,i.useState)("idle"),$=(0,i.useRef)(null),S=typeof e.uploadDocument=="function",b=S?e.photo?.source??"camera":"camera",L=S&&b!=="camera"&&e.photo?.uploadOffered===!0,[f,E]=(0,i.useState)(null),I=b==="upload"?"upload":b==="choice"?f??e.photo?.pick??"source":"camera",D=w==="sending"?void 0:()=>$.current?.click(),g=s(async V=>{let Y=V.currentTarget.files?.[0];if(V.currentTarget.value="",Y!==void 0){h(!1),_("sending");try{await e.uploadDocument(Y),_("idle")}catch(J){_(J instanceof TypeError&&J.message==="unsupported_file"?"unsupported":"failed")}}},"onFile"),q=L?(0,n.jsx)("input",{ref:$,type:"file",accept:nn,hidden:!0,"data-testid":"sekyro-doc-upload","aria-label":B(t).t("doc.uploadTitle"),onChange:l(V=>{g(V)},"onChange")}):null,z=B(t),W=e.photo?.cameraOnPhone===!0;return I==="camera"&&W?(0,n.jsx)(nt,{i18n:t,lead:t.t("handoff.lead.document"),refresh:e.refresh,actions:(0,n.jsx)(A,{kind:"ghost",full:!0,onClick:l(()=>E("upload"),"onClick"),children:z.t("doc.source.upload")})}):I==="source"?(0,n.jsx)(at,{testId:"sekyro-doc-source",title:z.t("doc.source.title"),lead:z.t("doc.source.description"),cameraLabel:W?t.t("capture.source.phone"):z.t("doc.source.camera"),onPhone:W,uploadLabel:z.t("doc.source.upload"),notice:(0,n.jsx)(pe,{step:e,i18n:t}),onCamera:l(()=>E("camera"),"onCamera"),onUpload:l(()=>E("upload"),"onUpload")}):I==="upload"?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(mt,{step:e,i18n:t,ageLead:r===!0,upload:w,offered:L,onPick:l(()=>$.current?.click(),"onPick"),...b==="choice"?{onCamera:s(()=>E("camera"),"onCamera")}:{},...m}),q]}):(0,n.jsxs)(n.Fragment,{children:[y?(0,n.jsx)(vt,{step:e,i18n:t,attempts:k,...a!==void 0?{liveMrz:a}:{},...o!==void 0?{barcodeAssetBaseUrl:o}:{},...L&&D!==void 0?{onUpload:D}:{},onClose:l(()=>h(!1),"onClose")}):(0,n.jsx)(pt,{step:e,i18n:t,ageLead:r===!0,onOpen:l(()=>h(!0),"onOpen"),upload:w,...L&&D!==void 0?{onUpload:D}:{},...m}),q]})}l(on,"Xn");s(on,"DocumentCaptureView");function Se({passport:e}){let t=Math.round(228/(e?1.42:1.586));return(0,n.jsxs)("svg",{className:`sekyro-mark sekyro-mark--card${e?" sekyro-mark--passport":""}`,viewBox:`-12 ${e?-22:-12} 252 ${t+(e?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:t,rx:"12.5"})})}),e?(0,n.jsx)("rect",{className:"sekyro-mark__page",x:"10",y:"-14",width:208,height:t,rx:"10"}):null,(0,n.jsx)("rect",{className:"sekyro-mark__card",width:228,height:t,rx:"12.5"}),(0,n.jsx)("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:t*(e?.5:.62),rx:"6"}),[0,1,2].map(a=>(0,n.jsx)("rect",{className:"sekyro-mark__text",x:"88",y:23+a*t*.12,width:100-a*20,height:"6",rx:"3"},a)),e?[0,1].map(a=>(0,n.jsx)("line",{className:"sekyro-mark__code",x1:"17",x2:211,y1:t*.75+a*11,y2:t*.75+a*11},a)):(0,n.jsx)("rect",{className:"sekyro-mark__text",x:"88",y:23+3*t*.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:t,className:"sekyro-mark__beam"})})}),(0,n.jsx)("path",{className:"sekyro-mark__brackets",d:ht(-10,-10,248,t+20,16,30)})]})}l(Se,"ht");s(Se,"ScanMark");function ht(e,t,a,o,r,m){let y=Math.min(r,m*.6);return[[e,t,1,1],[e+a,t,-1,1],[e,t+o,1,-1],[e+a,t+o,-1,-1]].map(([h,k,w,_])=>`M${h} ${k+_*m}V${k+_*y}Q${h} ${k} ${h+w*y} ${k}H${h+w*m}`).join("")}l(ht,"Xt");s(ht,"brackets");function pt({step:e,i18n:t,ageLead:a,onOpen:o,onChangeCountry:r,onChangeDocument:m,upload:y,onUpload:h}){let k=Ne(t),w=B(t),_=e.documentType==="passport",$=st(e),S=he(e),b=y==="sending",L=(0,i.useContext)(je)?.busy===!0,f=Xe(e.acceptedNationalities,t);return(0,n.jsxs)("section",{className:"sekyro-step sekyro-step--doc-intro","data-testid":"sekyro-document",children:[(0,n.jsx)(Se,{passport:_}),(0,n.jsx)(_e,{title:k($.titleKey)||k("native.doc.introTitle"),lead:a?t.t("doc.ageStepUp"):k("native.doc.introLead")}),$.onlyKey!==null&&e.issuer!==null?(0,n.jsx)("p",{className:"sekyro-text-muted sekyro-doc-only",children:k($.onlyKey,{country:it(e.issuer,t.locale)})}):null,f!==null?(0,n.jsx)(Q,{tone:"info",children:f}):null,(0,n.jsx)(pe,{step:e,i18n:t}),e.reason!==void 0&&ut.has(e.reason)?null:(0,n.jsxs)("ul",{className:"sekyro-tiprows",children:[(0,n.jsxs)("li",{children:[(0,n.jsx)(O,{name:_?"passport":"card"}),k("native.doc.tip.flat")]}),(0,n.jsxs)("li",{children:[(0,n.jsx)(O,{name:"light"}),k("native.doc.tip.glare")]}),(0,n.jsxs)("li",{children:[(0,n.jsx)(Z,{name:"image"}),k("native.doc.tip.frame")]})]}),(0,n.jsx)(xe,{i18n:t,...m!==void 0?{onChangeDocument:m}:{},...r!==void 0?{onChangeCountry:r}:{}}),(0,n.jsx)($e,{i18n:t,upload:y}),b?(0,n.jsx)("p",{className:"sekyro-text-muted",role:"status",children:t.t("doc.uploading")}):h!==void 0?(0,n.jsx)("p",{className:"sekyro-text-muted",children:w.t("doc.uploadHint")}):null,(0,n.jsxs)(Ce,{children:[(0,n.jsxs)(A,{full:!0,onClick:o,disabled:b||L,children:[(0,n.jsx)(O,{name:"camera"}),k("native.doc.openCamera")]}),h!==void 0?(0,n.jsxs)(A,{full:!0,kind:"ghost",onClick:h,children:[(0,n.jsx)(Z,{name:"image"}),w.t("doc.uploadInstead")]}):null]})]})}l(pt,"Wt");s(pt,"DocumentIntro");function pe({step:e,i18n:t}){let a=he(e);return a===null&&e.reasonHidden===!0?(0,n.jsx)(Q,{tone:"info",children:(0,n.jsx)("span",{children:le(t,e.attemptsRemaining,e.attemptsExhausted)})}):a===null?null:(0,n.jsxs)(Q,{tone:"warning",children:[(0,n.jsx)("span",{children:t.t(a)}),(0,n.jsx)("span",{children:le(t,e.attemptsRemaining,e.attemptsExhausted)})]})}l(pe,"Le");s(pe,"ReasonNotice");function xe({i18n:e,onChangeCountry:t,onChangeDocument:a}){let o=Ne(e);return a===void 0&&t===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,t!==void 0?(0,n.jsx)("button",{type:"button",className:"sekyro-link",onClick:t,children:e.t("native.doc.changeCountry")}):null]})}l(xe,"ft");s(xe,"ChangeLinks");function $e({i18n:e,upload:t}){return t!=="unsupported"&&t!=="failed"?null:(0,n.jsx)(Q,{tone:"warning",children:(0,n.jsx)("span",{children:B(e).t(t==="unsupported"?"doc.uploadUnsupported":"doc.uploadFailed")})})}l($e,"yt");s($e,"UploadNotice");function mt({step:e,i18n:t,ageLead:a,upload:o,offered:r,onPick:m,onCamera:y,onChangeCountry:h,onChangeDocument:k}){let w=B(t),_=o==="sending";return(0,n.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-doc-upload-screen",children:[(0,n.jsx)(Se,{passport:e.documentType==="passport"}),(0,n.jsx)(_e,{title:w.t("doc.uploadTitle"),lead:a?t.t("doc.ageStepUp"):w.t("doc.uploadHint")}),a?(0,n.jsx)("p",{className:"sekyro-text-muted",children:w.t("doc.uploadHint")}):null,(0,n.jsx)(pe,{step:e,i18n:t}),(0,n.jsx)(xe,{i18n:t,...k!==void 0?{onChangeDocument:k}:{},...h!==void 0?{onChangeCountry:h}:{}}),(0,n.jsx)($e,{i18n:t,upload:o}),_?(0,n.jsx)("p",{className:"sekyro-text-muted",role:"status",children:t.t("doc.uploading")}):null,(0,n.jsxs)(Ce,{children:[(0,n.jsxs)(A,{full:!0,onClick:m,disabled:_||!r||e.attemptsExhausted,children:[(0,n.jsx)(Z,{name:"image"}),w.t("doc.source.upload")]}),y!==void 0?(0,n.jsxs)(A,{full:!0,kind:"ghost",onClick:y,disabled:_,children:[(0,n.jsx)(O,{name:"camera"}),w.t("doc.source.camera")]}):null]})]})}l(mt,"jt");s(mt,"DocumentUploadScreen");function ze(e,t,a){let o=e*.88,r=o/a;return{x:(e-o)/2,y:t*.42-r/2,w:o,h:r}}l(ze,"ut");s(ze,"guideRect");var rn={"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",low_contrast:"native.scan.surface"},sn=s(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function vt({step:e,i18n:t,liveMrz:a,barcodeAssetBaseUrl:o,onClose:r,attempts:m,onUpload:y}){let h=Ne(t),k=(0,i.useContext)(qe),w=(0,i.useRef)(k);w.current=k;let _=(0,i.useRef)(null),$=(0,i.useRef)(null),S=(0,i.useRef)(null),[b,L]=(0,i.useState)("idle"),[f,E]=(0,i.useState)(null),[I,D]=(0,i.useState)(null),[g,q]=(0,i.useState)({w:0,h:0}),[z,W]=(0,i.useState)({hint:null,locking:!1,card:null,manualShutter:!1}),[V,Y]=(0,i.useState)({}),[J,Te]=(0,i.useState)({}),[Le,Me]=(0,i.useState)(null),[Pe,bt]=(0,i.useState)(null),[Ie,He]=(0,i.useState)(0),[me,Ae]=(0,i.useState)(null),[ve,zt]=(0,i.useState)(null),[ee,Nt]=(0,i.useState)(0),te=(0,i.useRef)(0);te.current=ee;let[St,Oe]=(0,i.useState)(0),De=(0,i.useRef)(0),ne=(0,i.useRef)(null);(0,i.useEffect)(()=>{Oe(te.current)},[e.reason,e.attemptsRemaining]);let R=e.documentType==="passport",ae=R?1.42:1.586;Ke(!0),(0,i.useLayoutEffect)(()=>{let d=_.current;if(d===null)return;let v=s(()=>q({w:d.clientWidth,h:d.clientHeight}),"measure");if(v(),typeof ResizeObserver>"u")return;let p=new ResizeObserver(v);return p.observe(d),()=>p.disconnect()},[]);let c=ze(g.w,g.h,ae);(0,i.useEffect)(()=>{g.w===0||g.h===0||S.current?.setGuide?.({viewAspect:g.w/g.h,rect:{x:c.x/g.w,y:c.y/g.h,width:c.w/g.w,height:c.h/g.h}})},[g.w,g.h,c.x,c.y,c.w,c.h]),(0,i.useEffect)(()=>{let d=$.current;if(d===null)return;let v=e.capture({video:d,...a!==void 0?{liveMrz:a}:{},...o!==void 0?{barcodeAssetBaseUrl:o}:{}});S.current=v,Y({}),Te({}),Me(null);let p=_.current;if(p!==null&&p.clientWidth>0&&p.clientHeight>0){let u=ze(p.clientWidth,p.clientHeight,ae);v.setGuide?.({viewAspect:p.clientWidth/p.clientHeight,rect:{x:u.x/p.clientWidth,y:u.y/p.clientHeight,width:u.w/p.clientWidth,height:u.h/p.clientHeight}})}let T=new Zt,N={scan:null,feedback:null,gate:null,mrz:null},H=s(u=>{N={...N,...u};let C=N.gate?.guide,Rt={phase:N.scan?.phase??"framing",hint:N.feedback?.reticle==="coaching"?N.feedback.key:e.documentType==="drivers_license"?null:ct(N.mrz),card:C?.detected?{fill:C.fill,offsetX:C.offsetX,offsetY:C.offsetY}:null,manualShutter:N.scan?.manualShutter??!1},K=T.present(Rt,performance.now());W(j=>j.hint===K.hint&&j.locking===K.locking&&j.manualShutter===K.manualShutter&&_t(j.card,K.card)?j:K)},"present"),Dt=[v.on("state",L),v.on("feedback",u=>H({feedback:u})),v.on("gate",u=>H({gate:u})),v.on("scan",u=>{u.captured.length===0&&De.current>0&&Oe(te.current),De.current=u.captured.length,ne.current=(ne.current??u.captured).filter(C=>u.captured.includes(C)),E(u),H({scan:u})}),v.on("captured",u=>{Nt(C=>C+1),Y(C=>({...C,[gt(u.side,R,C)]:u.previewDataUrl})),u.photo!==void 0&&Te(C=>({...C,[u.photo]:u.previewDataUrl})),Me(u.previewDataUrl),bt(Ct(d))}),v.on("error",u=>{D(u);let C=w.current;C!==null&&et(C,Je("document",u,Math.max(0,m.current)))}),v.on("mrz",u=>{u.state==="mismatch"?zt({format:u.format??null,at:te.current}):(Ae(u),H({mrz:u}))})];return m.current+=1,v.start().catch(()=>{}),()=>{ne.current=null;for(let u of Dt)u();v.destroy(),S.current=null}},[e.issuer,e.documentType]);let M=f?.phase??"framing",P=M==="reading"||M==="result",oe=M==="flipCue"||M==="reaskRecto",U=z.locking,Re=f?.captured.length??0;(0,i.useEffect)(()=>{U&&He(d=>d+1)},[U]),(0,i.useEffect)(()=>{Re>0&&He(d=>d+1)},[Re]);let xt=f?.expected??null;(0,i.useEffect)(()=>{Ae(null)},[xt]);let ye=oe||P||e.documentType==="drivers_license"?null:lt(me,R),Ue=s(d=>t.strings[d]??en[t.locale][d],"liveText"),$t=s(d=>d.startsWith("dcv3.")?Ue(d):h(d),"copy"),ke=ye!==null?Ue(ye):h(M==="flipCue"?"doc.flip":M==="reaskRecto"?"doc.reaskRecto":P?"native.scan.reading":M==="locking"||M==="capturing"||U?"native.scan.holdStill":R?"doc.showPage":"doc.showSide"),re=e.browserCheck??null,fe=re!==null&&P,ie=he(e),Be=s(d=>({key:h(d),action:le(t,e.attemptsRemaining,e.attemptsExhausted),blocking:e.reason!==void 0&&ut.has(e.reason)}),"reasonProblem"),Ee=dt(e.documentType),Tt=me?.state==="expired"&&!oe&&!P?{key:h("native.scan.expired"),action:null,blocking:!0}:ve!==null&&ee<=ve.at+1?{key:h(ve.format==="TD3"?"native.scan.seenPassport":"native.scan.seenCard"),action:Ee===null?null:h(Ee),blocking:!0}:f?.notice==="same_face"?{key:h("doc.sameFace"),action:null,blocking:!1}:f?.notice==="reread"?ie!==null?Be(ie):{key:h("doc.reread"),action:null,blocking:!1}:f?.notice==="technical"?{key:h("native.scan.retry"),action:null,blocking:!1}:f?.notice==="blurry"?{key:h("native.scan.blurry"),action:null,blocking:!1}:ie!==null&&ee===St?Be(ie):null,Lt=f?.torchAvailable===!0&&f.torch!==!0?"native.scan.dark":"native.scan.darkNoLight",Mt=z.hint===null?null:$t(z.hint==="too_dark"?Lt:rn[z.hint]??`dcv2.${z.hint}`),Pt=z.hint==="too_dark"&&f?.torch!==!0,Ve=yt(Tt,Mt,U||M==="capturing"||P,ee),F=z.card,x=c;if(!U&&F!==null&&F.fill>=.45&&F.fill<=1.25&&!sn()){let d=c.w*F.fill,v=d/ae,p=c.x+c.w/2+c.w*Math.max(-.25,Math.min(.25,F.offsetX)),T=c.y+c.h/2+c.h*Math.max(-.25,Math.min(.25,F.offsetY));x={x:p-d/2,y:T-v/2,w:d,h:v}}let se=c.w*.045,ge=28,Fe=Math.min(se,ge*.6),It=[[x.x,x.y,1,1],[x.x+x.w,x.y,-1,1],[x.x,x.y+x.h,1,-1],[x.x+x.w,x.y+x.h,-1,-1]],Ht=U?"is-locked":Ve!==null?"is-coaching":"",At=R?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],Ot=c.y+c.h+16,we={insetInlineStart:c.x,insetBlockStart:c.y,inlineSize:c.w,blockSize:c.h,borderRadius:se};return(0,n.jsx)("section",{className:"sekyro-lm","aria-label":ke,"data-testid":"sekyro-document",children:(0,n.jsxs)("div",{ref:_,className:`sekyro-lm-stage${P?" is-reading":""}${oe?" is-flip":""}`,style:{"--sekyro-guide-w":`${c.w}px`},children:[(0,n.jsx)("video",{ref:$,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:l(d=>{let v=d.currentTarget,p=v.getBoundingClientRect(),T=Math.max(p.width/(v.videoWidth||1),p.height/(v.videoHeight||1)),N=v.videoWidth*T,H=v.videoHeight*T;N>0&&H>0&&S.current?.focusAt((d.clientX-p.left+(N-p.width)/2)/N,(d.clientY-p.top+(H-p.height)/2)/H)},"onPointerUp")}),g.w>0?(0,n.jsxs)(n.Fragment,{children:[P&&Pe!==null?(0,n.jsx)("img",{className:"sekyro-lm-scene",src:Pe,alt:""}):null,P&&Le!==null?(0,n.jsx)("img",{className:"sekyro-lm-frozen",src:Le,alt:"",style:we}):null,(0,n.jsxs)("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${g.w} ${g.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${g.w}V${g.h}H0Z${wt(c,se)}`}),(0,n.jsx)("rect",{width:g.w,height:Math.max(0,c.y),fill:"url(#sekyro-lm-top)"}),(0,n.jsx)("rect",{y:c.y+c.h,width:g.w,height:Math.max(0,g.h-c.y-c.h),fill:"url(#sekyro-lm-bottom)"}),(0,n.jsx)("g",{className:`sekyro-lm-brackets ${Ht}`,children:It.map(([d,v,p,T],N)=>(0,n.jsx)("path",{style:{transform:`translate(${d}px, ${v}px) scale(${p}, ${T})`},d:`M0 ${ge}V${Fe}Q0 0 ${Fe} 0H${ge}`},N))}),U?(0,n.jsx)("rect",{className:"sekyro-lm-trace",x:c.x,y:c.y,width:c.w,height:c.h,rx:se,pathLength:"1",style:{animationDuration:`${Jt}ms`}}):null]}),(0,n.jsx)("div",{className:"sekyro-lm-slot",style:we,"aria-hidden":"true",children:P?(0,n.jsx)("span",{className:"sekyro-lm-read is-repeating"}):Ie>0?(0,n.jsx)("span",{className:"sekyro-lm-read"},Ie):null})]}):null,ye!==null?(0,n.jsx)("div",{className:"sekyro-lm-slot",style:we,"aria-hidden":"true",children:(0,n.jsx)("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${R?" is-page":""}${me?.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:fe?null:(0,n.jsx)(Ze,{swapKey:ke,className:"sekyro-lm-line",children:ke})})}),(0,n.jsxs)("div",{className:"sekyro-lm-below",style:{insetBlockStart:Ot,inlineSize:c.w,insetInlineStart:c.x},children:[(0,n.jsx)(kt,{band:Ve}),fe?null:P?(0,n.jsxs)("p",{className:"sekyro-lm-note",children:[(0,n.jsx)("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),h("native.scan.putDown")]}):oe?(0,n.jsx)("div",{className:`sekyro-lm-flip${M==="reaskRecto"?" is-toFront":""}`,"data-testid":"sekyro-flip-cue","aria-hidden":"true",children:(0,n.jsxs)("span",{className:"sekyro-lm-flip-card",style:{aspectRatio:String(ae)},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":t.t("native.close"),onClick:r,children:(0,n.jsx)(O,{name:"close"})}),f?.torchAvailable?(0,n.jsx)("button",{type:"button",className:`sekyro-glass${f.torch?" is-on":""}${Pt?" is-cue":""}`,"aria-label":t.t("doc.torchOn"),"aria-pressed":f.torch,onClick:l(()=>S.current?.setTorch(!f.torch),"onClick"),children:(0,n.jsx)(Z,{name:"flashlight"})}):null]}),I!==null?(0,n.jsxs)("div",{className:"sekyro-lm-error",role:"alert",children:[(0,n.jsx)("p",{children:t.t("doc.cameraBlocked")}),(0,n.jsx)("p",{children:t.t(I.kind==="permission"?"doc.cameraBlockedHint":We(I.kind))}),(0,n.jsx)(A,{onClick:l(()=>{D(null),m.current+=1,S.current?.retry()},"onClick"),children:t.t("doc.retryCamera")})]}):null,re!==null&&I===null?(0,n.jsxs)("div",{className:"sekyro-lm-error",role:"alert","data-testid":"sekyro-doc-browser-check",children:[(0,n.jsx)("p",{children:t.t(re.code==="clock_wrong"?"errors.device_clock":"errors.attestation_invalid")}),(0,n.jsx)(A,{onClick:re.retry,children:t.t("common.retry")})]}):null,z.manualShutter?(0,n.jsx)("button",{type:"button",className:"sekyro-shutter","aria-label":t.t("doc.shutter"),onClick:l(()=>S.current?.shutter(),"onClick")}):null,(0,n.jsx)("ol",{className:"sekyro-lm-tray",children:At.map(({side:d,label:v})=>{let p=f?.captured.includes(d)??!1,T=ft(d,f,J,V);return(0,n.jsxs)("li",{className:p?"is-done":void 0,"aria-current":!p&&(R||f?.expected===d)?"step":void 0,children:[p?(0,n.jsxs)("span",{className:"sekyro-lm-thumb",children:[T!==void 0?(0,n.jsx)("img",{src:T,alt:""}):(0,n.jsx)(O,{name:"card"}),(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(v),p&&T===void 0&&ne.current?.includes(d)?(0,n.jsx)("span",{className:"sekyro-lm-received",children:h("doc.sideReceived")}):null]},d)})}),y!==void 0?(0,n.jsx)("button",{type:"button",className:"sekyro-lm-upload",onClick:y,children:B(t).t("doc.uploadInstead")}):null,b==="uploading"||b==="checking"?null:(0,n.jsx)(Qe,{onStop:r})]}),!fe&&(b==="uploading"||b==="checking")?(0,n.jsx)("span",{className:"sekyro-visually-hidden",role:"status",children:b==="uploading"?t.t("doc.uploading"):h("native.scan.reading")}):null]})})}l(vt,"Jt");s(vt,"LumiereScan");function yt(e,t,a,o){let r=(0,i.useRef)(null);r.current??(r.current=new jt);let[m,y]=(0,i.useState)(null),h=(0,i.useRef)({problem:e,hint:t,busy:a,photos:o});h.current={problem:e,hint:t,busy:a,photos:o};let k=e===null?null:`${e.blocking}|${e.key}|${e.action??""}`;return(0,i.useEffect)(()=>{let w=s(()=>{let{problem:$,hint:S,busy:b,photos:L}=h.current;y(r.current?.present($,S,b,performance.now(),L)??null)},"run");w();let _=setInterval(w,250);return()=>clearInterval(_)},[k,t,a,o]),m}l(yt,"qt");s(yt,"useNoticeBand");function kt({band:e}){let[t,a]=(0,i.useState)(e);(0,i.useEffect)(()=>{e!==null&&a(e)},[e]);let o=e??t;return(0,n.jsx)("div",{className:`sekyro-lm-band${e!==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":e===null||void 0,children:[(0,n.jsx)("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:(0,n.jsx)(O,{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(kt,"en");s(kt,"NoticeBandView");function ft(e,t,a,o){if(t?.photos===void 0)return o[e];let r=t.photos[e];return r===void 0?void 0:a[r]}l(ft,"tn");s(ft,"thumbOf");function gt(e,t,a){return t?"single":e==="recto"||e==="verso"?e:a.recto===void 0?"recto":"verso"}l(gt,"nn");s(gt,"slotOf");function wt({x:e,y:t,w:a,h:o},r){return`M${e+r} ${t}H${e+a-r}Q${e+a} ${t} ${e+a} ${t+r}V${t+o-r}Q${e+a} ${t+o} ${e+a-r} ${t+o}H${e+r}Q${e} ${t+o} ${e} ${t+o-r}V${t+r}Q${e} ${t} ${e+r} ${t}Z`}l(wt,"on");s(wt,"roundedRect");var be=.004;function _t(e,t){return e===null||t===null?e===t:Math.abs(e.fill-t.fill)<be&&Math.abs(e.offsetX-t.offsetX)<be&&Math.abs(e.offsetY-t.offsetY)<be}l(_t,"rn");s(_t,"sameCard");function Ct(e){let t=Math.round(e.videoWidth/4),a=Math.round(e.videoHeight/4);if(t===0||a===0||typeof document>"u")return null;try{let o=document.createElement("canvas");o.width=t,o.height=a;let r=o.getContext("2d");return r===null?null:(r.drawImage(e,0,0,t,a),o.toDataURL("image/jpeg",.7))}catch{return null}}l(Ct,"an");s(Ct,"sceneSnapshot");export{on as DocumentCaptureView,Jt as LOCK_TRACE_MS,nn as UPLOAD_ACCEPT,ze as guideRect,st as introCopy,ct as mrzHint,lt as mrzInstruction,_t as sameCard,dt as showInsteadKey,gt as slotOf,ft as thumbOf};
@@ -1 +1 @@
1
- "use client";import{a as j,b as v,c as z}from"./chunk-N2DNXUEA.js";import{a as O,b as W,c as q}from"./chunk-AIQISJXO.js";import{a as U}from"./chunk-XXCBLQ53.js";import{a as E}from"./chunk-BBMKEHE2.js";import"./chunk-3AB3BDSC.js";import{H as T,K as R,a as te,b as oe,c as N,t as P,y as A}from"./chunk-JHCWF5SC.js";import{a as u,c as L,i as o}from"./chunk-SSU37LFQ.js";var a=L(te(),1),i=L(oe(),1);import{isValidNni as ce,normalizeNni as J}from"@sekyro/web";var K={en:v,fr:z,ar:j,es:v,pt:v,de:v},w=6,pe=new Set(["eid_identifier_invalid","eid_code_invalid","eid_locked","eid_not_enrolled"]),Q=o((e,d)=>{if(e===void 0)return 0;let h=Date.parse(e)-d;return Number.isFinite(h)?Math.max(0,Math.ceil(h/1e3)):0},"secondsUntil"),me=o(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss");function ue({step:e,i18n:d,className:h,onError:X}){let C=d.strings,r=o((n,t)=>E(C[n]??K[d.locale][n]??"",t),"t"),I=o((n,t)=>{let se=new Intl.PluralRules(d.locale).select(t),G=`${n}.${se}`,le=C[G]??K[d.locale][G]??r(`${n}.other`);return E(le,{count:new Intl.NumberFormat(d.locale).format(t)})},"plural"),y=o(n=>e.providerName?r(`eid.${n}`,{provider:e.providerName}):r(`eid.${n}Generic`),"named"),[B,Y]=(0,a.useState)(""),[f,_]=(0,a.useState)(""),[c,S]=(0,a.useState)(!1),[b,p]=(0,a.useState)(null),s=e.phase==="code",D=q(s),l=(0,a.useId)(),Z=P(),[ee,ie]=O(e.reason==="eid_code_invalid",e.codeAttemptsRemaining??0,()=>_("")),m=o(async n=>{S(!0),p(null);try{await n()}catch(t){p(U(t,d.strings)),X?.(t)}finally{S(!1)}},"run"),F=(0,a.useRef)(!1);(0,a.useEffect)(()=>{!e.identifierBound||s||e.reason!==void 0||F.current||(F.current=!0,m(()=>e.start()))},[e.identifierBound,s,e.reason]),(0,a.useEffect)(()=>{(e.reason==="eid_code_invalid"||e.codeExpiresAt!==void 0)&&_("")},[e.reason,e.codeExpiresAt,e.codeAttemptsRemaining]);let M=(0,a.useRef)(s);(0,a.useEffect)(()=>{s&&!M.current&&document.getElementById(`${l}-code`)?.focus(),M.current=s},[s,l]);let k=e.reason==="eid_locked",H=Q(e.codeExpiresAt,D),x=s&&e.codeExpiresAt!==void 0&&H===0,$=Q(e.resendAvailableAt,D),V=e.resendsRemaining===0||e.reason==="eid_resend_limit",ne=o(n=>{if(n.preventDefault(),s){f.length===w&&!k&&m(()=>e.verify(f));return}if(e.identifierBound){m(()=>e.start());return}let t=J(B);if(e.country==="MR"){if(!/^\d{10}$/.test(t))return p("population.invalid");if(!ce(t))return p("population.reason_nni_invalid")}m(()=>e.start(t))},"onSubmit"),g=e.reason?.startsWith("eid_")?e.reason:void 0,re=(0,i.jsxs)(i.Fragment,{children:[g!==void 0?(0,i.jsxs)(R,{tone:pe.has(g)?"danger":"warning",children:[(0,i.jsx)("span",{children:r(`reasons.${g}`)}),g==="eid_code_invalid"&&e.codeAttemptsRemaining!==void 0?(0,i.jsx)("span",{children:I("eid.codeAttemptsRemaining",e.codeAttemptsRemaining)}):null,e.canUseCamera?(0,i.jsx)(N,{kind:"secondary",disabled:c,onClick:u(()=>{m(()=>e.useCamera())},"onClick"),children:r("eid.useCamera")}):null]}):null,b!==null?(0,i.jsx)(R,{tone:"danger",children:(0,i.jsx)("span",{children:d.t(b)})}):null]}),[ae,de]=s?[y("codeTitle"),y("codeHelp")]:[y("identifierTitle"),y(e.identifierBound?"boundDescription":"identifierDescription")];return(0,i.jsxs)("form",{className:`sekyro-step sekyro-otp${h?` ${h}`:""}`,"aria-labelledby":l,onSubmit:ne,noValidate:!0,"data-testid":"sekyro-eid",children:[(0,i.jsxs)("div",{className:"sekyro-heading",children:[(0,i.jsx)("h2",{id:l,ref:Z,tabIndex:-1,className:"sekyro-text-body",children:ae}),(0,i.jsx)("p",{className:"sekyro-text-muted",children:s&&e.context.simulation!==void 0?(0,i.jsx)(T,{template:d.t("sandbox.otpHint"),code:e.context.simulation.otpCode}):de}),e.afterPass==="continue"?(0,i.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-eid-continue",children:e.providerName?r("eid.continueHint",{provider:e.providerName}):r("eid.continueHintGeneric")}):null]}),re,s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"sekyro-field",children:[(0,i.jsx)("label",{className:"sekyro-label",htmlFor:`${l}-code`,children:r("eid.codeLabel")}),k?(0,i.jsx)("input",{id:`${l}-code`,className:"sekyro-input sekyro-input--number",dir:"ltr",value:f,disabled:!0,readOnly:!0}):(0,i.jsx)(W,{id:`${l}-code`,value:f,length:w,invalid:ee,onChange:u(n=>{p(null),n!==""&&ie(),_(n)},"onChange")}),e.codeExpiresAt!==void 0?(0,i.jsx)("span",{className:`sekyro-help sekyro-otp-expiry${x?" is-danger":""}`,children:x?r("eid.expired"):r("eid.expiresIn",{time:me(H)})}):null]}),(0,i.jsx)("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:x?r("eid.expired"):""}),(0,i.jsxs)(A,{children:[(0,i.jsx)(N,{type:"submit",full:!0,disabled:c||f.length!==w||k,"aria-busy":c||void 0,children:r("eid.verify")}),(0,i.jsx)("div",{className:"sekyro-resend-row",children:V?(0,i.jsx)("p",{className:"sekyro-resend is-waiting",children:r("eid.noResendsLeft")}):(0,i.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:c||$>0||k,onClick:u(()=>{m(()=>e.resend())},"onClick"),children:$>0?r("eid.resendIn",{seconds:$}):r("eid.resend")})}),!V&&e.resendsRemaining!==void 0?(0,i.jsx)("p",{className:"sekyro-help sekyro-center",children:I("eid.resendsRemaining",e.resendsRemaining)}):null]})]}):(0,i.jsxs)(i.Fragment,{children:[e.identifierBound?null:(0,i.jsxs)("div",{className:"sekyro-field",children:[(0,i.jsx)("label",{className:"sekyro-label",htmlFor:`${l}-nni`,children:d.t("population.label")}),(0,i.jsx)("input",{id:`${l}-nni`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:d.t("population.placeholder"),value:B,"aria-describedby":`${l}-nni-help`,"aria-invalid":b==="population.invalid"||b==="population.reason_nni_invalid"||void 0,onChange:u(n=>{p(null),Y(J(n.target.value).replace(/\D/g,"").slice(0,10))},"onChange")}),(0,i.jsx)("span",{id:`${l}-nni-help`,className:"sekyro-help",children:d.t("population.helper")})]}),(0,i.jsx)(A,{children:(0,i.jsx)(N,{type:"submit",full:!0,disabled:c,"aria-busy":c||void 0,children:r("eid.start")})})]})]})}u(ue,"Ae");o(ue,"EidView");export{ue as EidView};
1
+ "use client";import{a as j,b as v,c as z}from"./chunk-N2DNXUEA.js";import{a as O,b as W,c as q}from"./chunk-CCJXGVIL.js";import{a as U}from"./chunk-XXCBLQ53.js";import{a as E}from"./chunk-RDCMAYQA.js";import"./chunk-G3M7C3QG.js";import{H as T,K as R,a as te,b as oe,c as N,t as P,y as A}from"./chunk-Z5TRMVOP.js";import{a as u,c as L,i as o}from"./chunk-SSU37LFQ.js";var a=L(te(),1),i=L(oe(),1);import{isValidNni as ce,normalizeNni as J}from"@sekyro/web";var K={en:v,fr:z,ar:j,es:v,pt:v,de:v},w=6,pe=new Set(["eid_identifier_invalid","eid_code_invalid","eid_locked","eid_not_enrolled"]),Q=o((e,d)=>{if(e===void 0)return 0;let h=Date.parse(e)-d;return Number.isFinite(h)?Math.max(0,Math.ceil(h/1e3)):0},"secondsUntil"),me=o(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss");function ue({step:e,i18n:d,className:h,onError:X}){let C=d.strings,r=o((n,t)=>E(C[n]??K[d.locale][n]??"",t),"t"),I=o((n,t)=>{let se=new Intl.PluralRules(d.locale).select(t),G=`${n}.${se}`,le=C[G]??K[d.locale][G]??r(`${n}.other`);return E(le,{count:new Intl.NumberFormat(d.locale).format(t)})},"plural"),y=o(n=>e.providerName?r(`eid.${n}`,{provider:e.providerName}):r(`eid.${n}Generic`),"named"),[B,Y]=(0,a.useState)(""),[f,_]=(0,a.useState)(""),[c,S]=(0,a.useState)(!1),[b,p]=(0,a.useState)(null),s=e.phase==="code",D=q(s),l=(0,a.useId)(),Z=P(),[ee,ie]=O(e.reason==="eid_code_invalid",e.codeAttemptsRemaining??0,()=>_("")),m=o(async n=>{S(!0),p(null);try{await n()}catch(t){p(U(t,d.strings)),X?.(t)}finally{S(!1)}},"run"),F=(0,a.useRef)(!1);(0,a.useEffect)(()=>{!e.identifierBound||s||e.reason!==void 0||F.current||(F.current=!0,m(()=>e.start()))},[e.identifierBound,s,e.reason]),(0,a.useEffect)(()=>{(e.reason==="eid_code_invalid"||e.codeExpiresAt!==void 0)&&_("")},[e.reason,e.codeExpiresAt,e.codeAttemptsRemaining]);let M=(0,a.useRef)(s);(0,a.useEffect)(()=>{s&&!M.current&&document.getElementById(`${l}-code`)?.focus(),M.current=s},[s,l]);let k=e.reason==="eid_locked",H=Q(e.codeExpiresAt,D),x=s&&e.codeExpiresAt!==void 0&&H===0,$=Q(e.resendAvailableAt,D),V=e.resendsRemaining===0||e.reason==="eid_resend_limit",ne=o(n=>{if(n.preventDefault(),s){f.length===w&&!k&&m(()=>e.verify(f));return}if(e.identifierBound){m(()=>e.start());return}let t=J(B);if(e.country==="MR"){if(!/^\d{10}$/.test(t))return p("population.invalid");if(!ce(t))return p("population.reason_nni_invalid")}m(()=>e.start(t))},"onSubmit"),g=e.reason?.startsWith("eid_")?e.reason:void 0,re=(0,i.jsxs)(i.Fragment,{children:[g!==void 0?(0,i.jsxs)(R,{tone:pe.has(g)?"danger":"warning",children:[(0,i.jsx)("span",{children:r(`reasons.${g}`)}),g==="eid_code_invalid"&&e.codeAttemptsRemaining!==void 0?(0,i.jsx)("span",{children:I("eid.codeAttemptsRemaining",e.codeAttemptsRemaining)}):null,e.canUseCamera?(0,i.jsx)(N,{kind:"secondary",disabled:c,onClick:u(()=>{m(()=>e.useCamera())},"onClick"),children:r("eid.useCamera")}):null]}):null,b!==null?(0,i.jsx)(R,{tone:"danger",children:(0,i.jsx)("span",{children:d.t(b)})}):null]}),[ae,de]=s?[y("codeTitle"),y("codeHelp")]:[y("identifierTitle"),y(e.identifierBound?"boundDescription":"identifierDescription")];return(0,i.jsxs)("form",{className:`sekyro-step sekyro-otp${h?` ${h}`:""}`,"aria-labelledby":l,onSubmit:ne,noValidate:!0,"data-testid":"sekyro-eid",children:[(0,i.jsxs)("div",{className:"sekyro-heading",children:[(0,i.jsx)("h2",{id:l,ref:Z,tabIndex:-1,className:"sekyro-text-body",children:ae}),(0,i.jsx)("p",{className:"sekyro-text-muted",children:s&&e.context.simulation!==void 0?(0,i.jsx)(T,{template:d.t("sandbox.otpHint"),code:e.context.simulation.otpCode}):de}),e.afterPass==="continue"?(0,i.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-eid-continue",children:e.providerName?r("eid.continueHint",{provider:e.providerName}):r("eid.continueHintGeneric")}):null]}),re,s?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("div",{className:"sekyro-field",children:[(0,i.jsx)("label",{className:"sekyro-label",htmlFor:`${l}-code`,children:r("eid.codeLabel")}),k?(0,i.jsx)("input",{id:`${l}-code`,className:"sekyro-input sekyro-input--number",dir:"ltr",value:f,disabled:!0,readOnly:!0}):(0,i.jsx)(W,{id:`${l}-code`,value:f,length:w,invalid:ee,onChange:u(n=>{p(null),n!==""&&ie(),_(n)},"onChange")}),e.codeExpiresAt!==void 0?(0,i.jsx)("span",{className:`sekyro-help sekyro-otp-expiry${x?" is-danger":""}`,children:x?r("eid.expired"):r("eid.expiresIn",{time:me(H)})}):null]}),(0,i.jsx)("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:x?r("eid.expired"):""}),(0,i.jsxs)(A,{children:[(0,i.jsx)(N,{type:"submit",full:!0,disabled:c||f.length!==w||k,"aria-busy":c||void 0,children:r("eid.verify")}),(0,i.jsx)("div",{className:"sekyro-resend-row",children:V?(0,i.jsx)("p",{className:"sekyro-resend is-waiting",children:r("eid.noResendsLeft")}):(0,i.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:c||$>0||k,onClick:u(()=>{m(()=>e.resend())},"onClick"),children:$>0?r("eid.resendIn",{seconds:$}):r("eid.resend")})}),!V&&e.resendsRemaining!==void 0?(0,i.jsx)("p",{className:"sekyro-help sekyro-center",children:I("eid.resendsRemaining",e.resendsRemaining)}):null]})]}):(0,i.jsxs)(i.Fragment,{children:[e.identifierBound?null:(0,i.jsxs)("div",{className:"sekyro-field",children:[(0,i.jsx)("label",{className:"sekyro-label",htmlFor:`${l}-nni`,children:d.t("population.label")}),(0,i.jsx)("input",{id:`${l}-nni`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:d.t("population.placeholder"),value:B,"aria-describedby":`${l}-nni-help`,"aria-invalid":b==="population.invalid"||b==="population.reason_nni_invalid"||void 0,onChange:u(n=>{p(null),Y(J(n.target.value).replace(/\D/g,"").slice(0,10))},"onChange")}),(0,i.jsx)("span",{id:`${l}-nni-help`,className:"sekyro-help",children:d.t("population.helper")})]}),(0,i.jsx)(A,{children:(0,i.jsx)(N,{type:"submit",full:!0,disabled:c,"aria-busy":c||void 0,children:r("eid.start")})})]})]})}u(ue,"Ae");o(ue,"EidView");export{ue as EidView};
@@ -1 +1 @@
1
- "use client";import{a as B,b as G,c as J}from"./chunk-AIQISJXO.js";import{a as U}from"./chunk-XXCBLQ53.js";import{a as Y}from"./chunk-BBMKEHE2.js";import"./chunk-3AB3BDSC.js";import{A as F,H as P,K as y,L as j,a as ne,b as de,c as x,w as W,y as T}from"./chunk-JHCWF5SC.js";import{a as p,c as M,i as r}from"./chunk-SSU37LFQ.js";var s=M(ne(),1),e=M(de(),1);import{OtpInputError as me}from"@sekyro/web";var pe={"emailOtp.reason_otp_daily_cap_reached":"لا يمكننا إرسال رمز إلى بريدك الإلكتروني اليوم. اختر طريقة أخرى للتحقق إن كانت متاحة، أو حاول مرة أخرى لاحقًا.","emailOtp.reason_payment_method_required":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.reason_spend_cap_reached":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.reason_insufficient_balance":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.reason_account_verification_required":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.sendTitle":"تحقّق من بريدك الإلكتروني","emailOtp.sendDescription":"سنرسل إليك عبر البريد الإلكتروني رمزًا يُستخدم مرة واحدة لتأكيد أن هذا العنوان يخصّك","emailOtp.prefilledNotice":"سنرسل رمز تحقّق إلى بريدك الإلكتروني المسجّل.","emailOtp.emailLabel":"البريد الإلكتروني","emailOtp.emailHelper":"سنرسل رمزًا يُستخدم مرة واحدة إلى هذا العنوان","emailOtp.emailPlaceholder":"عنوان بريدك الإلكتروني","emailOtp.emailInvalid":"أدخل عنوان بريد إلكتروني صالحًا","emailOtp.send":"أرسل لي رمزًا عبر البريد الإلكتروني","emailOtp.verifyTitle":"أدخل الرمز","emailOtp.verifyDescription":"أدخل الرمز المكوّن من 6 أرقام الذي أرسلناه إلى بريدك الإلكتروني لإتمام التحقّق من عنوانك","emailOtp.sentTo":"أرسلنا رمزًا مكوّنًا من 6 أرقام إلى {email}","emailOtp.codeLabel":"رمز التحقّق","emailOtp.codeHelper":"أدخل الرمز المكوّن من 6 أرقام الوارد في الرسالة","emailOtp.verify":"تحقّق من الرمز","emailOtp.resend":"إعادة إرسال الرمز","emailOtp.resendIn":"إعادة إرسال الرمز خلال {seconds} ثانية","emailOtp.expiresIn":"ينتهي الرمز خلال {time}","emailOtp.expired":"انتهت صلاحية الرمز. أعد إرسال رمز جديد","emailOtp.reason_otp_mismatch":"الرمز غير صحيح. تحقّق منه وأعد إدخاله","emailOtp.reason_otp_expired":"انتهت صلاحية الرمز. أعد إرسال رمز جديد للمتابعة","emailOtp.reason_otp_send_failed":"تعذّر إرسال الرسالة. أعد المحاولة لاحقًا. إذا تكرر ذلك، فتواصل مع الجهة التي طلبت منك التحقق.","emailOtp.reason_otp_rate_limited":"طُلبت رموز كثيرة لهذا العنوان. أعد المحاولة لاحقًا أو أدخل عنوانًا آخر.","emailOtp.reason_email_invalid":"لا يمكننا الإرسال إلى هذا العنوان. تحقّق منه أو أدخل عنوانًا آخر","emailOtp.reason_email_disposable":"استخدم بريدًا إلكترونيًا دائمًا، وليس عنوانًا مؤقتًا","emailOtp.changeEmail":"تغيير البريد الإلكتروني","emailOtp.backToCode":"العودة إلى الرمز","emailOtp.reason_otp_resend_limit":"لا يمكنك طلب رموز أخرى. أدخل آخر رمز وصلك"},b={"emailOtp.reason_otp_daily_cap_reached":"We can't email you a code today. Choose another way to verify if one is offered, or try again later.","emailOtp.reason_payment_method_required":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.reason_spend_cap_reached":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.reason_insufficient_balance":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.reason_account_verification_required":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.sendTitle":"Verify your email address","emailOtp.sendDescription":"We'll email you a one-time code to confirm this address is yours","emailOtp.prefilledNotice":"We'll send a verification code to your registered email address.","emailOtp.emailLabel":"Email address","emailOtp.emailHelper":"We'll send a one-time code to this address","emailOtp.emailPlaceholder":"Your email address","emailOtp.emailInvalid":"Enter a valid email address","emailOtp.send":"Email me a code","emailOtp.verifyTitle":"Enter the code","emailOtp.verifyDescription":"Type the 6-digit code we emailed you to finish verifying your address","emailOtp.sentTo":"We sent a 6-digit code to {email}","emailOtp.codeLabel":"Verification code","emailOtp.codeHelper":"Enter the 6-digit code from the email","emailOtp.verify":"Verify code","emailOtp.resend":"Resend code","emailOtp.resendIn":"Resend code in {seconds}s","emailOtp.expiresIn":"Code expires in {time}","emailOtp.expired":"That code has expired. Resend a new one","emailOtp.reason_otp_mismatch":"That code was incorrect. Check it and enter it again","emailOtp.reason_otp_expired":"That code has expired. Resend a new code to continue","emailOtp.reason_otp_send_failed":"We couldn't send the email. Try again later. If it keeps happening, contact the organization that asked you to verify.","emailOtp.reason_otp_rate_limited":"Too many codes were requested for this address. Try again later, or enter another address.","emailOtp.reason_email_invalid":"We can't send to this address. Check it or enter another one","emailOtp.reason_email_disposable":"Use a permanent email address, not a temporary one","emailOtp.changeEmail":"Change email","emailOtp.backToCode":"Back to code","emailOtp.reason_otp_resend_limit":"You can't get more codes. Enter the last code you received"},ce={"emailOtp.reason_otp_daily_cap_reached":"Nous ne pouvons pas vous envoyer de code par e-mail aujourd'hui. Choisissez une autre méthode si elle est proposée, ou réessayez plus tard.","emailOtp.reason_payment_method_required":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.reason_spend_cap_reached":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.reason_insufficient_balance":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.reason_account_verification_required":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.sendTitle":"Vérifiez votre e-mail","emailOtp.sendDescription":"Nous vous enverrons par e-mail un code à usage unique pour confirmer que cette adresse vous appartient","emailOtp.prefilledNotice":"Nous enverrons un code de vérification à votre adresse e-mail enregistrée.","emailOtp.emailLabel":"Adresse e-mail","emailOtp.emailHelper":"Nous enverrons un code à usage unique à cette adresse","emailOtp.emailPlaceholder":"Votre adresse e-mail","emailOtp.emailInvalid":"Saisissez une adresse e-mail valide","emailOtp.send":"M'envoyer un code par e-mail","emailOtp.verifyTitle":"Saisissez le code","emailOtp.verifyDescription":"Saisissez le code à 6 chiffres que nous vous avons envoyé par e-mail pour finaliser la vérification de votre adresse","emailOtp.sentTo":"Nous avons envoyé un code à 6 chiffres à {email}","emailOtp.codeLabel":"Code de vérification","emailOtp.codeHelper":"Saisissez le code à 6 chiffres reçu par e-mail","emailOtp.verify":"Vérifier le code","emailOtp.resend":"Renvoyer le code","emailOtp.resendIn":"Renvoyer le code dans {seconds} s","emailOtp.expiresIn":"Le code expire dans {time}","emailOtp.expired":"Ce code a expiré. Renvoyez-en un nouveau","emailOtp.reason_otp_mismatch":"Ce code est incorrect. Vérifiez-le et saisissez-le à nouveau","emailOtp.reason_otp_expired":"Ce code a expiré. Renvoyez un nouveau code pour continuer","emailOtp.reason_otp_send_failed":"Nous n'avons pas pu envoyer l'e-mail. Réessayez plus tard. Si le problème continue, contactez l'organisation qui vous a demandé de vous vérifier.","emailOtp.reason_otp_rate_limited":"Trop de codes ont été demandés pour cette adresse. Réessayez plus tard ou saisissez une autre adresse.","emailOtp.reason_email_invalid":"Nous ne pouvons pas envoyer à cette adresse. Vérifiez-la ou saisissez-en une autre","emailOtp.reason_email_disposable":"Utilisez une adresse e-mail permanente, pas une adresse temporaire","emailOtp.changeEmail":"Changer d'adresse e-mail","emailOtp.backToCode":"Retour au code","emailOtp.reason_otp_resend_limit":"Vous ne pouvez plus demander de code. Saisissez le dernier code reçu"},ue={en:b,fr:ce,ar:pe,es:b,pt:b,de:b},K=r((a,n,h)=>{if(a===void 0)return 0;let _=Date.parse(a)-n;return Number.isFinite(_)?Math.min(h,Math.max(0,Math.ceil(_/1e3))):0},"secondsUntil"),he=600,_e=60,Oe=r(a=>`${Math.floor(a/60)}:${String(a%60).padStart(2,"0")}`,"mmss"),Q=new Set(["otp_expired","otp_send_failed","otp_rate_limited","otp_resend_limit","email_invalid","email_disposable","otp_daily_cap_reached","payment_method_required","spend_cap_reached","insufficient_balance","account_verification_required"]);function fe({step:a,i18n:n,className:h,defaultEmail:_="",onError:X}){let i=r((t,o)=>Y(n.strings[t]??ue[n.locale][t],o),"t"),[N,Z]=(0,s.useState)(_),[O,z]=(0,s.useState)(""),[l,E]=(0,s.useState)(!1),[w,q]=(0,s.useState)(null),[g,c]=(0,s.useState)(!1),[I,ee]=(0,s.useState)(null),u=(0,s.useRef)(null),f=a.phase==="verify",m=f&&!g,R=J(f),d=(0,s.useId)(),[ae,ie]=B(a.reason==="otp_mismatch",a.attemptsRemaining,()=>z("")),V=f?a.codeExpiresAt??"sent":null;(0,s.useEffect)(()=>{V!==null&&(c(!1),u.current!==null&&!Q.has(a.reason??"")&&ee(u.current),u.current=null)},[V]);let S=r(async t=>{E(!0),q(null);try{await t()}catch(o){q(o instanceof me&&o.field==="email"?i("emailOtp.emailInvalid"):n.t(U(o,n.strings))),X?.(o)}finally{E(!1)}},"run"),$=r(t=>{let o=a.needsEmail?t?I:N.trim():null;u.current=o,S(async()=>{try{await a.send(o!==null?{email:o}:{})}catch(re){throw u.current=null,re}})},"send"),D=r(t=>{S(()=>a.verify(t))},"submitCode"),te=r(t=>{t.preventDefault(),m?D(O):$(!1)},"onSubmit"),k=K(a.codeExpiresAt,R,he),C=K(a.resendAvailableAt,R,_e),v=m&&a.codeExpiresAt!==void 0&&k===0,L=a.needsEmail&&!a.attemptsExhausted,H=f&&(a.codeExpiresAt===void 0||k>0);F(m&&L?()=>c(!0):g&&H?()=>c(!1):null,l);let[se,oe]=i("emailOtp.sentTo").split("{email}"),A=a.context.simulation?.otpCode,le=a.reason==="otp_mismatch"?(0,e.jsxs)(y,{tone:"danger",children:[(0,e.jsx)("span",{children:i("emailOtp.reason_otp_mismatch")}),(0,e.jsx)("span",{children:j(n,a.attemptsRemaining,a.attemptsExhausted)})]}):a.reason!==void 0&&Q.has(a.reason)?(0,e.jsx)(y,{tone:"warning",children:(0,e.jsx)("span",{children:i(`emailOtp.reason_${a.reason}`)})}):null;return(0,e.jsxs)("form",{className:`sekyro-step sekyro-otp${h?` ${h}`:""}`,"aria-labelledby":d,onSubmit:te,noValidate:!0,children:[(0,e.jsx)(W,{id:d,title:i(m?"emailOtp.verifyTitle":"emailOtp.sendTitle"),lead:m&&A!==void 0?(0,e.jsx)(P,{template:n.t("sandbox.otpHint"),code:A}):m?(0,e.jsxs)(e.Fragment,{children:[se,(0,e.jsx)("bdi",{dir:"ltr",className:"sekyro-mono",children:I??a.sentToMasked}),oe]}):i("emailOtp.sendDescription")}),le,w!==null?(0,e.jsx)(y,{tone:"danger",children:(0,e.jsx)("span",{children:w})}):null,m?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"sekyro-field",children:[(0,e.jsx)("label",{className:"sekyro-label",htmlFor:`${d}-code`,children:i("emailOtp.codeLabel")}),(0,e.jsx)(G,{id:`${d}-code`,value:O,invalid:ae,onChange:p(t=>{t!==""&&ie(),z(t),t.length===6&&O.length!==6&&!l&&!a.attemptsExhausted&&D(t)},"onChange")}),(0,e.jsx)("span",{className:`sekyro-help sekyro-otp-expiry${v?" is-danger":""}`,"aria-hidden":!v||void 0,children:v?i("emailOtp.expired"):i("emailOtp.expiresIn",{time:Oe(k)})})]}),(0,e.jsx)("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:v?i("emailOtp.expired"):""}),(0,e.jsxs)(T,{children:[(0,e.jsx)(x,{type:"submit",full:!0,disabled:l||O.length!==6,"aria-busy":l||void 0,children:i("emailOtp.verify")}),(0,e.jsxs)("div",{className:"sekyro-resend-row",children:[(0,e.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:l||C>0,onClick:p(()=>$(!0),"onClick"),children:C>0?i("emailOtp.resendIn",{seconds:C}):i("emailOtp.resend")}),L?(0,e.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:l,onClick:p(()=>c(!0),"onClick"),"data-testid":"sekyro-otp-change",children:i("emailOtp.changeEmail")}):null]})]})]}):(0,e.jsxs)(e.Fragment,{children:[a.needsEmail?(0,e.jsxs)("div",{className:"sekyro-field",children:[(0,e.jsx)("label",{className:"sekyro-label",htmlFor:`${d}-email`,children:i("emailOtp.emailLabel")}),(0,e.jsx)("input",{id:`${d}-email`,className:"sekyro-input",type:"email",dir:"ltr",inputMode:"email",autoComplete:"email",autoCapitalize:"none",spellCheck:!1,placeholder:i("emailOtp.emailPlaceholder"),value:N,"aria-describedby":`${d}-email-help`,onChange:p(t=>Z(t.target.value),"onChange")}),(0,e.jsx)("span",{id:`${d}-email-help`,className:"sekyro-help",children:i("emailOtp.emailHelper")})]}):(0,e.jsx)("p",{className:"sekyro-text-muted",children:i("emailOtp.prefilledNotice")}),(0,e.jsxs)(T,{children:[(0,e.jsx)(x,{type:"submit",full:!0,disabled:l,"aria-busy":l||void 0,children:i("emailOtp.send")}),g&&H?(0,e.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:l,onClick:p(()=>c(!1),"onClick"),"data-testid":"sekyro-otp-back-to-code",children:i("emailOtp.backToCode")}):null]})]})]})}p(fe,"Ve");r(fe,"EmailOtpView");export{fe as EmailOtpView};
1
+ "use client";import{a as B,b as G,c as J}from"./chunk-CCJXGVIL.js";import{a as U}from"./chunk-XXCBLQ53.js";import{a as Y}from"./chunk-RDCMAYQA.js";import"./chunk-G3M7C3QG.js";import{A as F,H as P,K as y,L as j,a as ne,b as de,c as x,w as W,y as T}from"./chunk-Z5TRMVOP.js";import{a as p,c as M,i as r}from"./chunk-SSU37LFQ.js";var s=M(ne(),1),e=M(de(),1);import{OtpInputError as me}from"@sekyro/web";var pe={"emailOtp.reason_otp_daily_cap_reached":"لا يمكننا إرسال رمز إلى بريدك الإلكتروني اليوم. اختر طريقة أخرى للتحقق إن كانت متاحة، أو حاول مرة أخرى لاحقًا.","emailOtp.reason_payment_method_required":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.reason_spend_cap_reached":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.reason_insufficient_balance":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.reason_account_verification_required":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.sendTitle":"تحقّق من بريدك الإلكتروني","emailOtp.sendDescription":"سنرسل إليك عبر البريد الإلكتروني رمزًا يُستخدم مرة واحدة لتأكيد أن هذا العنوان يخصّك","emailOtp.prefilledNotice":"سنرسل رمز تحقّق إلى بريدك الإلكتروني المسجّل.","emailOtp.emailLabel":"البريد الإلكتروني","emailOtp.emailHelper":"سنرسل رمزًا يُستخدم مرة واحدة إلى هذا العنوان","emailOtp.emailPlaceholder":"عنوان بريدك الإلكتروني","emailOtp.emailInvalid":"أدخل عنوان بريد إلكتروني صالحًا","emailOtp.send":"أرسل لي رمزًا عبر البريد الإلكتروني","emailOtp.verifyTitle":"أدخل الرمز","emailOtp.verifyDescription":"أدخل الرمز المكوّن من 6 أرقام الذي أرسلناه إلى بريدك الإلكتروني لإتمام التحقّق من عنوانك","emailOtp.sentTo":"أرسلنا رمزًا مكوّنًا من 6 أرقام إلى {email}","emailOtp.codeLabel":"رمز التحقّق","emailOtp.codeHelper":"أدخل الرمز المكوّن من 6 أرقام الوارد في الرسالة","emailOtp.verify":"تحقّق من الرمز","emailOtp.resend":"إعادة إرسال الرمز","emailOtp.resendIn":"إعادة إرسال الرمز خلال {seconds} ثانية","emailOtp.expiresIn":"ينتهي الرمز خلال {time}","emailOtp.expired":"انتهت صلاحية الرمز. أعد إرسال رمز جديد","emailOtp.reason_otp_mismatch":"الرمز غير صحيح. تحقّق منه وأعد إدخاله","emailOtp.reason_otp_expired":"انتهت صلاحية الرمز. أعد إرسال رمز جديد للمتابعة","emailOtp.reason_otp_send_failed":"تعذّر إرسال الرسالة. أعد المحاولة لاحقًا. إذا تكرر ذلك، فتواصل مع الجهة التي طلبت منك التحقق.","emailOtp.reason_otp_rate_limited":"طُلبت رموز كثيرة لهذا العنوان. أعد المحاولة لاحقًا أو أدخل عنوانًا آخر.","emailOtp.reason_email_invalid":"لا يمكننا الإرسال إلى هذا العنوان. تحقّق منه أو أدخل عنوانًا آخر","emailOtp.reason_email_disposable":"استخدم بريدًا إلكترونيًا دائمًا، وليس عنوانًا مؤقتًا","emailOtp.changeEmail":"تغيير البريد الإلكتروني","emailOtp.backToCode":"العودة إلى الرمز","emailOtp.reason_otp_resend_limit":"لا يمكنك طلب رموز أخرى. أدخل آخر رمز وصلك"},b={"emailOtp.reason_otp_daily_cap_reached":"We can't email you a code today. Choose another way to verify if one is offered, or try again later.","emailOtp.reason_payment_method_required":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.reason_spend_cap_reached":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.reason_insufficient_balance":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.reason_account_verification_required":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.sendTitle":"Verify your email address","emailOtp.sendDescription":"We'll email you a one-time code to confirm this address is yours","emailOtp.prefilledNotice":"We'll send a verification code to your registered email address.","emailOtp.emailLabel":"Email address","emailOtp.emailHelper":"We'll send a one-time code to this address","emailOtp.emailPlaceholder":"Your email address","emailOtp.emailInvalid":"Enter a valid email address","emailOtp.send":"Email me a code","emailOtp.verifyTitle":"Enter the code","emailOtp.verifyDescription":"Type the 6-digit code we emailed you to finish verifying your address","emailOtp.sentTo":"We sent a 6-digit code to {email}","emailOtp.codeLabel":"Verification code","emailOtp.codeHelper":"Enter the 6-digit code from the email","emailOtp.verify":"Verify code","emailOtp.resend":"Resend code","emailOtp.resendIn":"Resend code in {seconds}s","emailOtp.expiresIn":"Code expires in {time}","emailOtp.expired":"That code has expired. Resend a new one","emailOtp.reason_otp_mismatch":"That code was incorrect. Check it and enter it again","emailOtp.reason_otp_expired":"That code has expired. Resend a new code to continue","emailOtp.reason_otp_send_failed":"We couldn't send the email. Try again later. If it keeps happening, contact the organization that asked you to verify.","emailOtp.reason_otp_rate_limited":"Too many codes were requested for this address. Try again later, or enter another address.","emailOtp.reason_email_invalid":"We can't send to this address. Check it or enter another one","emailOtp.reason_email_disposable":"Use a permanent email address, not a temporary one","emailOtp.changeEmail":"Change email","emailOtp.backToCode":"Back to code","emailOtp.reason_otp_resend_limit":"You can't get more codes. Enter the last code you received"},ce={"emailOtp.reason_otp_daily_cap_reached":"Nous ne pouvons pas vous envoyer de code par e-mail aujourd'hui. Choisissez une autre méthode si elle est proposée, ou réessayez plus tard.","emailOtp.reason_payment_method_required":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.reason_spend_cap_reached":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.reason_insufficient_balance":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.reason_account_verification_required":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.sendTitle":"Vérifiez votre e-mail","emailOtp.sendDescription":"Nous vous enverrons par e-mail un code à usage unique pour confirmer que cette adresse vous appartient","emailOtp.prefilledNotice":"Nous enverrons un code de vérification à votre adresse e-mail enregistrée.","emailOtp.emailLabel":"Adresse e-mail","emailOtp.emailHelper":"Nous enverrons un code à usage unique à cette adresse","emailOtp.emailPlaceholder":"Votre adresse e-mail","emailOtp.emailInvalid":"Saisissez une adresse e-mail valide","emailOtp.send":"M'envoyer un code par e-mail","emailOtp.verifyTitle":"Saisissez le code","emailOtp.verifyDescription":"Saisissez le code à 6 chiffres que nous vous avons envoyé par e-mail pour finaliser la vérification de votre adresse","emailOtp.sentTo":"Nous avons envoyé un code à 6 chiffres à {email}","emailOtp.codeLabel":"Code de vérification","emailOtp.codeHelper":"Saisissez le code à 6 chiffres reçu par e-mail","emailOtp.verify":"Vérifier le code","emailOtp.resend":"Renvoyer le code","emailOtp.resendIn":"Renvoyer le code dans {seconds} s","emailOtp.expiresIn":"Le code expire dans {time}","emailOtp.expired":"Ce code a expiré. Renvoyez-en un nouveau","emailOtp.reason_otp_mismatch":"Ce code est incorrect. Vérifiez-le et saisissez-le à nouveau","emailOtp.reason_otp_expired":"Ce code a expiré. Renvoyez un nouveau code pour continuer","emailOtp.reason_otp_send_failed":"Nous n'avons pas pu envoyer l'e-mail. Réessayez plus tard. Si le problème continue, contactez l'organisation qui vous a demandé de vous vérifier.","emailOtp.reason_otp_rate_limited":"Trop de codes ont été demandés pour cette adresse. Réessayez plus tard ou saisissez une autre adresse.","emailOtp.reason_email_invalid":"Nous ne pouvons pas envoyer à cette adresse. Vérifiez-la ou saisissez-en une autre","emailOtp.reason_email_disposable":"Utilisez une adresse e-mail permanente, pas une adresse temporaire","emailOtp.changeEmail":"Changer d'adresse e-mail","emailOtp.backToCode":"Retour au code","emailOtp.reason_otp_resend_limit":"Vous ne pouvez plus demander de code. Saisissez le dernier code reçu"},ue={en:b,fr:ce,ar:pe,es:b,pt:b,de:b},K=r((a,n,h)=>{if(a===void 0)return 0;let _=Date.parse(a)-n;return Number.isFinite(_)?Math.min(h,Math.max(0,Math.ceil(_/1e3))):0},"secondsUntil"),he=600,_e=60,Oe=r(a=>`${Math.floor(a/60)}:${String(a%60).padStart(2,"0")}`,"mmss"),Q=new Set(["otp_expired","otp_send_failed","otp_rate_limited","otp_resend_limit","email_invalid","email_disposable","otp_daily_cap_reached","payment_method_required","spend_cap_reached","insufficient_balance","account_verification_required"]);function fe({step:a,i18n:n,className:h,defaultEmail:_="",onError:X}){let i=r((t,o)=>Y(n.strings[t]??ue[n.locale][t],o),"t"),[N,Z]=(0,s.useState)(_),[O,z]=(0,s.useState)(""),[l,E]=(0,s.useState)(!1),[w,q]=(0,s.useState)(null),[g,c]=(0,s.useState)(!1),[I,ee]=(0,s.useState)(null),u=(0,s.useRef)(null),f=a.phase==="verify",m=f&&!g,R=J(f),d=(0,s.useId)(),[ae,ie]=B(a.reason==="otp_mismatch",a.attemptsRemaining,()=>z("")),V=f?a.codeExpiresAt??"sent":null;(0,s.useEffect)(()=>{V!==null&&(c(!1),u.current!==null&&!Q.has(a.reason??"")&&ee(u.current),u.current=null)},[V]);let S=r(async t=>{E(!0),q(null);try{await t()}catch(o){q(o instanceof me&&o.field==="email"?i("emailOtp.emailInvalid"):n.t(U(o,n.strings))),X?.(o)}finally{E(!1)}},"run"),$=r(t=>{let o=a.needsEmail?t?I:N.trim():null;u.current=o,S(async()=>{try{await a.send(o!==null?{email:o}:{})}catch(re){throw u.current=null,re}})},"send"),D=r(t=>{S(()=>a.verify(t))},"submitCode"),te=r(t=>{t.preventDefault(),m?D(O):$(!1)},"onSubmit"),k=K(a.codeExpiresAt,R,he),C=K(a.resendAvailableAt,R,_e),v=m&&a.codeExpiresAt!==void 0&&k===0,L=a.needsEmail&&!a.attemptsExhausted,H=f&&(a.codeExpiresAt===void 0||k>0);F(m&&L?()=>c(!0):g&&H?()=>c(!1):null,l);let[se,oe]=i("emailOtp.sentTo").split("{email}"),A=a.context.simulation?.otpCode,le=a.reason==="otp_mismatch"?(0,e.jsxs)(y,{tone:"danger",children:[(0,e.jsx)("span",{children:i("emailOtp.reason_otp_mismatch")}),(0,e.jsx)("span",{children:j(n,a.attemptsRemaining,a.attemptsExhausted)})]}):a.reason!==void 0&&Q.has(a.reason)?(0,e.jsx)(y,{tone:"warning",children:(0,e.jsx)("span",{children:i(`emailOtp.reason_${a.reason}`)})}):null;return(0,e.jsxs)("form",{className:`sekyro-step sekyro-otp${h?` ${h}`:""}`,"aria-labelledby":d,onSubmit:te,noValidate:!0,children:[(0,e.jsx)(W,{id:d,title:i(m?"emailOtp.verifyTitle":"emailOtp.sendTitle"),lead:m&&A!==void 0?(0,e.jsx)(P,{template:n.t("sandbox.otpHint"),code:A}):m?(0,e.jsxs)(e.Fragment,{children:[se,(0,e.jsx)("bdi",{dir:"ltr",className:"sekyro-mono",children:I??a.sentToMasked}),oe]}):i("emailOtp.sendDescription")}),le,w!==null?(0,e.jsx)(y,{tone:"danger",children:(0,e.jsx)("span",{children:w})}):null,m?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"sekyro-field",children:[(0,e.jsx)("label",{className:"sekyro-label",htmlFor:`${d}-code`,children:i("emailOtp.codeLabel")}),(0,e.jsx)(G,{id:`${d}-code`,value:O,invalid:ae,onChange:p(t=>{t!==""&&ie(),z(t),t.length===6&&O.length!==6&&!l&&!a.attemptsExhausted&&D(t)},"onChange")}),(0,e.jsx)("span",{className:`sekyro-help sekyro-otp-expiry${v?" is-danger":""}`,"aria-hidden":!v||void 0,children:v?i("emailOtp.expired"):i("emailOtp.expiresIn",{time:Oe(k)})})]}),(0,e.jsx)("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:v?i("emailOtp.expired"):""}),(0,e.jsxs)(T,{children:[(0,e.jsx)(x,{type:"submit",full:!0,disabled:l||O.length!==6,"aria-busy":l||void 0,children:i("emailOtp.verify")}),(0,e.jsxs)("div",{className:"sekyro-resend-row",children:[(0,e.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:l||C>0,onClick:p(()=>$(!0),"onClick"),children:C>0?i("emailOtp.resendIn",{seconds:C}):i("emailOtp.resend")}),L?(0,e.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:l,onClick:p(()=>c(!0),"onClick"),"data-testid":"sekyro-otp-change",children:i("emailOtp.changeEmail")}):null]})]})]}):(0,e.jsxs)(e.Fragment,{children:[a.needsEmail?(0,e.jsxs)("div",{className:"sekyro-field",children:[(0,e.jsx)("label",{className:"sekyro-label",htmlFor:`${d}-email`,children:i("emailOtp.emailLabel")}),(0,e.jsx)("input",{id:`${d}-email`,className:"sekyro-input",type:"email",dir:"ltr",inputMode:"email",autoComplete:"email",autoCapitalize:"none",spellCheck:!1,placeholder:i("emailOtp.emailPlaceholder"),value:N,"aria-describedby":`${d}-email-help`,onChange:p(t=>Z(t.target.value),"onChange")}),(0,e.jsx)("span",{id:`${d}-email-help`,className:"sekyro-help",children:i("emailOtp.emailHelper")})]}):(0,e.jsx)("p",{className:"sekyro-text-muted",children:i("emailOtp.prefilledNotice")}),(0,e.jsxs)(T,{children:[(0,e.jsx)(x,{type:"submit",full:!0,disabled:l,"aria-busy":l||void 0,children:i("emailOtp.send")}),g&&H?(0,e.jsx)("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:l,onClick:p(()=>c(!1),"onClick"),"data-testid":"sekyro-otp-back-to-code",children:i("emailOtp.backToCode")}):null]})]})]})}p(fe,"Ve");r(fe,"EmailOtpView");export{fe as EmailOtpView};