@sekyro/elements 0.1.0-rc.9 → 0.1.0

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 (142) hide show
  1. package/CHANGELOG.md +452 -0
  2. package/README.md +4 -4
  3. package/dist/cdn/chunks/{camera-trait-V4UAOPIQ-TFCPOCSU.js → camera-trait-DELAK3YN-4I2GHAFU.js} +1 -1
  4. package/dist/cdn/chunks/capture-session-doc-7SHEMIO2-UEB3BLJY.js +1 -0
  5. package/dist/cdn/chunks/challenge-frame-HTZ2ZBIE-5JRAFZOU.js +1 -0
  6. package/dist/cdn/chunks/chunk-37BKUH3E.js +1 -0
  7. package/dist/cdn/chunks/chunk-4VGBIKKF.js +3 -0
  8. package/dist/cdn/chunks/{chunk-ZXPJTB7H.js → chunk-4X4DNUJB.js} +1 -1
  9. package/dist/cdn/chunks/chunk-5QOH6NQH.js +1 -0
  10. package/dist/cdn/chunks/{chunk-SMZ7F4L7.js → chunk-5Y7NCFTK.js} +1 -1
  11. package/dist/cdn/chunks/chunk-65WXOD3F.js +33 -0
  12. package/dist/cdn/chunks/chunk-6MYG4HWP.js +1 -0
  13. package/dist/cdn/chunks/{chunk-DASQWRD2.js → chunk-6W6GR7P4.js} +1 -1
  14. package/dist/cdn/chunks/chunk-7UCVVWRT.js +1 -0
  15. package/dist/cdn/chunks/chunk-CIDO7UAK.js +1 -0
  16. package/dist/cdn/chunks/chunk-DDUCV6NE.js +1 -0
  17. package/dist/cdn/chunks/chunk-E7UFFFZO.js +1 -0
  18. package/dist/cdn/chunks/{chunk-A2ZKVVIE.js → chunk-ERJRG52Z.js} +1 -1
  19. package/dist/cdn/chunks/{chunk-O33NXBND.js → chunk-F3BSTTXB.js} +1 -1
  20. package/dist/cdn/chunks/{chunk-E2MOAJT7.js → chunk-G6ICN3K2.js} +1 -1
  21. package/dist/cdn/chunks/chunk-K3XSP444.js +25 -0
  22. package/dist/cdn/chunks/chunk-KQCTXWDO.js +1 -0
  23. package/dist/cdn/chunks/{chunk-RUN75CTZ.js → chunk-MVPBIASR.js} +1 -1
  24. package/dist/cdn/chunks/{chunk-T5IERZBI.js → chunk-MZETEVSB.js} +1 -1
  25. package/dist/cdn/chunks/chunk-NGJMT7M3.js +1 -0
  26. package/dist/cdn/chunks/chunk-OD63YRJW.js +1 -0
  27. package/dist/cdn/chunks/chunk-PND4F7JQ.js +1 -0
  28. package/dist/cdn/chunks/chunk-PQGILDKC.js +1 -0
  29. package/dist/cdn/chunks/chunk-SLLJX5QK.js +1 -0
  30. package/dist/cdn/chunks/{chunk-UQKRYXN5.js → chunk-T5IBMUSY.js} +1 -1
  31. package/dist/cdn/chunks/chunk-W5WWCOOW.js +1 -0
  32. package/dist/cdn/chunks/chunk-XKZZC74I.js +1 -0
  33. package/dist/cdn/chunks/{chunk-DYCKQAZH.js → chunk-XUZB5KEZ.js} +1 -1
  34. package/dist/cdn/chunks/chunk-YHUTESVX.js +1 -0
  35. package/dist/cdn/chunks/create-document-capture-D6MSQXPC-REYSYPDK.js +1 -0
  36. package/dist/cdn/chunks/{create-portrait-capture-5VGYZUOK-N3333DJC.js → create-portrait-capture-3MHP4DGA-4XIQSUJ3.js} +1 -1
  37. package/dist/cdn/chunks/{detector-scanic-SE3CL55N-JIGLCDPS.js → detector-scanic-3VQFGZAA-NF7AFUUP.js} +1 -1
  38. package/dist/cdn/chunks/document-capture-view-HKEUWRPE-LOW3SNGM.js +1 -0
  39. package/dist/cdn/chunks/eid-view-Y5OFAHVC-H2H5O3H4.js +1 -0
  40. package/dist/cdn/chunks/email-otp-view-ZEVLA5UZ-JO2KA6XE.js +1 -0
  41. package/dist/cdn/chunks/flow-views-ARNNXDI4-7BYKNQLO.js +1 -0
  42. package/dist/cdn/chunks/form-view-PQQO4VIK-IE4YHFTL.js +1 -0
  43. package/dist/cdn/chunks/icons-form-R366YPMB-6C7SJPCB.js +1 -0
  44. package/dist/cdn/chunks/mrz-band-IH54XO42-AE4D3F2E.js +1 -0
  45. package/dist/cdn/chunks/overlay-de-QAMFKRTE-YSXFO53C.js +1 -0
  46. package/dist/cdn/chunks/overlay-es-5RUP36SI-HFW77Y5Z.js +1 -0
  47. package/dist/cdn/chunks/overlay-pt-7EUG7TIT-FUKZ7M5O.js +1 -0
  48. package/dist/cdn/chunks/plan-runner-DOJCVU2R-PLBX6YZK.js +1 -0
  49. package/dist/cdn/chunks/{portrait-capture-view-UYISOXXV-HR5FCO4J.js → portrait-capture-view-EKCFW3YQ-DSL42XKH.js} +1 -1
  50. package/dist/cdn/chunks/portrait-review-view-NKIVRFCL-BK65RBU6.js +1 -0
  51. package/dist/cdn/chunks/print-DCYX3CZD-DLQCPZZE.js +11 -0
  52. package/dist/cdn/chunks/proof-of-address-view-HYTT7NHY-73YT3QLR.js +1 -0
  53. package/dist/cdn/chunks/session-events-W5DRVA6F-BNHYAEHE.js +8 -0
  54. package/dist/cdn/chunks/session-watch-7HMFAHQI-WNCXXNDK.js +1 -0
  55. package/dist/cdn/define.js +1 -1
  56. package/dist/cdn/index.js +1 -1
  57. package/dist/{chunk-HOOZLWNR.js → chunk-25BK7D5W.js} +1 -1
  58. package/dist/chunk-2Z5FHSRB.js +33 -0
  59. package/dist/chunk-73ETQUUL.js +1 -0
  60. package/dist/{chunk-IB3NF7H5.js → chunk-B7CZCSMF.js} +1 -1
  61. package/dist/chunk-ENB7AFED.js +25 -0
  62. package/dist/{chunk-UIOHM6CB.js → chunk-FV5OWBNU.js} +1 -1
  63. package/dist/chunk-HBK2ROSI.js +1 -0
  64. package/dist/{chunk-DAAZBRNM.js → chunk-HFOCTDYM.js} +1 -1
  65. package/dist/{chunk-FAZTWW5J.js → chunk-N2BPYCKG.js} +1 -1
  66. package/dist/{chunk-6MLQBNF4.js → chunk-N3WQ4QSD.js} +1 -1
  67. package/dist/chunk-NAURWQ6C.js +1 -0
  68. package/dist/{chunk-THDSSKYQ.js → chunk-RV6PEFNT.js} +1 -1
  69. package/dist/{chunk-JIHK7L54.js → chunk-TC5736OF.js} +1 -1
  70. package/dist/chunk-XXCBLQ53.js +1 -0
  71. package/dist/chunk-Y7JBM2YL.js +1 -0
  72. package/dist/define.cjs +5 -5
  73. package/dist/define.js +1 -1
  74. package/dist/document-capture-view-HKEUWRPE-KB4IVUEE.js +1 -0
  75. package/dist/{eid-view-U2HL2IX7-ONZGT2S5.js → eid-view-Y5OFAHVC-NUZ7QUBA.js} +1 -1
  76. package/dist/{email-otp-view-CMJHROOH-4DBMTA3R.js → email-otp-view-ZEVLA5UZ-LAXHM22A.js} +1 -1
  77. package/dist/flow-views-ARNNXDI4-YXYLG7SQ.js +1 -0
  78. package/dist/form-view-PQQO4VIK-H7PE6SJF.js +1 -0
  79. package/dist/icons-form-R366YPMB-KUTXHC7X.js +1 -0
  80. package/dist/index.cjs +5 -5
  81. package/dist/index.d.cts +112 -17
  82. package/dist/index.d.ts +112 -17
  83. package/dist/index.js +1 -1
  84. package/dist/overlay-de-QAMFKRTE-Q37YV6YD.js +1 -0
  85. package/dist/overlay-es-5RUP36SI-N7N3ULGK.js +1 -0
  86. package/dist/overlay-pt-7EUG7TIT-5S423QBY.js +1 -0
  87. package/dist/portrait-capture-view-EKCFW3YQ-7UBYR6BX.js +1 -0
  88. package/dist/portrait-review-view-NKIVRFCL-IP7ZWZ6B.js +1 -0
  89. package/dist/proof-of-address-view-HYTT7NHY-QFJ33FM2.js +1 -0
  90. package/dist/styles.css +83 -4
  91. package/package.json +3 -3
  92. package/sbom.cdx.json +4 -4
  93. package/dist/cdn/chunks/capture-session-doc-ESEZJBQM-BXCU4HNS.js +0 -1
  94. package/dist/cdn/chunks/challenge-frame-YAQJ5YMB-MHZYRGKY.js +0 -1
  95. package/dist/cdn/chunks/chunk-2FETDQV5.js +0 -1
  96. package/dist/cdn/chunks/chunk-3S4VNKLC.js +0 -1
  97. package/dist/cdn/chunks/chunk-4PBYN632.js +0 -1
  98. package/dist/cdn/chunks/chunk-4ZCLJICC.js +0 -1
  99. package/dist/cdn/chunks/chunk-6NWHU56A.js +0 -33
  100. package/dist/cdn/chunks/chunk-CW56KMMH.js +0 -1
  101. package/dist/cdn/chunks/chunk-CYLXKJUY.js +0 -3
  102. package/dist/cdn/chunks/chunk-ELKN3A2Q.js +0 -1
  103. package/dist/cdn/chunks/chunk-F2MXING6.js +0 -1
  104. package/dist/cdn/chunks/chunk-GTYN5CAI.js +0 -25
  105. package/dist/cdn/chunks/chunk-J6ERQV2N.js +0 -1
  106. package/dist/cdn/chunks/chunk-KMKUWNV6.js +0 -1
  107. package/dist/cdn/chunks/chunk-KVTY4E6J.js +0 -1
  108. package/dist/cdn/chunks/chunk-L22GFJQV.js +0 -1
  109. package/dist/cdn/chunks/chunk-MSENKS6X.js +0 -1
  110. package/dist/cdn/chunks/chunk-OVZDKB3N.js +0 -1
  111. package/dist/cdn/chunks/chunk-PJ2UDPYO.js +0 -1
  112. package/dist/cdn/chunks/chunk-S5NGSYGI.js +0 -1
  113. package/dist/cdn/chunks/create-document-capture-V7XCRRDV-3MGZONM3.js +0 -1
  114. package/dist/cdn/chunks/document-capture-view-5FWUD45F-TTB7XRVE.js +0 -1
  115. package/dist/cdn/chunks/eid-view-U2HL2IX7-EKYQNIVA.js +0 -1
  116. package/dist/cdn/chunks/email-otp-view-CMJHROOH-S7HHGHMS.js +0 -1
  117. package/dist/cdn/chunks/flow-views-O3KBN7YF-37NQVUAE.js +0 -1
  118. package/dist/cdn/chunks/form-view-WVPN7ZUY-WVYV733R.js +0 -1
  119. package/dist/cdn/chunks/mrz-band-VYHOTDHY-VEZ2J5IL.js +0 -1
  120. package/dist/cdn/chunks/overlay-de-PVJMYZGV-JDDHHQJZ.js +0 -1
  121. package/dist/cdn/chunks/overlay-es-PZCE25XM-D7N7YW66.js +0 -1
  122. package/dist/cdn/chunks/overlay-pt-PZ3L6DR7-AD7SQLSO.js +0 -1
  123. package/dist/cdn/chunks/plan-runner-IXCKR4DB-OJHNDXG2.js +0 -1
  124. package/dist/cdn/chunks/portrait-review-view-67VI2Q6K-KD55P5MN.js +0 -1
  125. package/dist/cdn/chunks/print-SEWS3VHQ-HWJTHADG.js +0 -11
  126. package/dist/cdn/chunks/proof-of-address-view-EIQXYYM3-JYSRHJ7R.js +0 -1
  127. package/dist/chunk-DUYCGH4R.js +0 -33
  128. package/dist/chunk-MYYAFIK6.js +0 -1
  129. package/dist/chunk-TOU3UDCB.js +0 -25
  130. package/dist/chunk-V2KMG4IA.js +0 -1
  131. package/dist/chunk-WCPTICNC.js +0 -1
  132. package/dist/chunk-YZ6YGLNN.js +0 -1
  133. package/dist/chunk-ZLREPJUJ.js +0 -1
  134. package/dist/document-capture-view-5FWUD45F-PZAJNUII.js +0 -1
  135. package/dist/flow-views-O3KBN7YF-I2I3K4EY.js +0 -1
  136. package/dist/form-view-WVPN7ZUY-Z523S2WJ.js +0 -1
  137. package/dist/overlay-de-PVJMYZGV-75ZFRADU.js +0 -1
  138. package/dist/overlay-es-PZCE25XM-IEA7Y6EU.js +0 -1
  139. package/dist/overlay-pt-PZ3L6DR7-WMCH3XQV.js +0 -1
  140. package/dist/portrait-capture-view-UYISOXXV-SO3YYR22.js +0 -1
  141. package/dist/portrait-review-view-67VI2Q6K-ELE4HPWJ.js +0 -1
  142. package/dist/proof-of-address-view-EIQXYYM3-HDMZQJCO.js +0 -1
@@ -1 +1 @@
1
- import{a as j}from"./chunk-O33NXBND.js";import{d as U}from"./chunk-MSENKS6X.js";import{K as k,L as I,a as A,b as V,c as h,v as T,w as _,y as C}from"./chunk-GTYN5CAI.js";import{a as n}from"./chunk-5QL6W6FW.js";import{a as s,c as N}from"./chunk-4FHWXBOB.js";var f=N(A(),1),e=N(V(),1);var D={"portrait.source.title":"كيف تريد إضافة صورتك الشخصية؟","portrait.source.description":"التقط صورة جديدة بالكاميرا، أو ارفع صورة حديثة من هذا الجهاز.","portrait.source.camera":"التقاط صورة","portrait.source.upload":"رفع صورة","portrait.source.uploadInstead":"رفع صورة بدلًا من ذلك","portrait.upload.title":"ارفع صورتك الشخصية","portrait.upload.hint":"صورة حديثة لوجهك، تنظر فيها مباشرة إلى الكاميرا، أمام جدار فاتح وبلون واحد.","portrait.upload.choose":"اختيار صورة","portrait.upload.unsupported":"اختر صورة بصيغة JPEG أو PNG أو HEIC.","portrait.upload.failed":"تعذّر إرسال هذه الصورة. حاول مرة أخرى.","portrait.review.title":"تحقّق من صورتك المعدّلة","portrait.review.description":"عدّلنا صورتك لتطابق قواعد صور الهوية. لم نغيّر وجهك.","portrait.review.original":"صورتك","portrait.review.fixed":"الصورة المعدّلة","portrait.review.fixesTitle":"ما الذي غيّرناه","portrait.review.accept":"استخدام هذه الصورة","portrait.review.retake":"إعادة الالتقاط","portrait.review.uploadAnother":"رفع صورة أخرى","portrait.fixes.crop":"قُصّت","portrait.fixes.scale":"غُيّر حجمها","portrait.fixes.straighten":"عُدّل ميلها","portrait.fixes.background":"استُبدلت الخلفية","portrait.fixes.exposure":"عُدّل السطوع","portrait.fixes.white_balance":"وُزنت الألوان","reasons.portrait_morph_suspected":"لا يمكن استخدام هذه الصورة. التقط صورة جديدة للشخص.","reasons.portrait_reference_mismatch":"لا تطابق الصورة المرجع. التقط صورة جديدة للشخص.","reasons.portrait_declined_fix":"التقط صورة أخرى أو ارفعها."},y={"portrait.source.title":"How do you want to add your ID photo?","portrait.source.description":"Take a new photo with the camera, or upload a recent photo from this device.","portrait.source.camera":"Take a photo","portrait.source.upload":"Upload a photo","portrait.source.uploadInstead":"Upload a photo instead","portrait.upload.title":"Upload your ID photo","portrait.upload.hint":"A recent photo of your face, looking straight at the camera, in front of a plain, light wall.","portrait.upload.choose":"Choose a photo","portrait.upload.unsupported":"Choose a JPEG, PNG or HEIC photo.","portrait.upload.failed":"We could not send this photo. Try again.","portrait.review.title":"Check your adjusted photo","portrait.review.description":"We adjusted your photo to meet the ID photo rules. Your face was not changed.","portrait.review.original":"Your photo","portrait.review.fixed":"Adjusted photo","portrait.review.fixesTitle":"What we changed","portrait.review.accept":"Use this photo","portrait.review.retake":"Take another","portrait.review.uploadAnother":"Upload another","portrait.fixes.crop":"Cropped","portrait.fixes.scale":"Resized","portrait.fixes.straighten":"Straightened","portrait.fixes.background":"Background replaced","portrait.fixes.exposure":"Brightness adjusted","portrait.fixes.white_balance":"Colours balanced","reasons.portrait_morph_suspected":"This photo cannot be used. Take a new photo of the person.","reasons.portrait_reference_mismatch":"The photo does not match the reference. Take a new photo of the person.","reasons.portrait_declined_fix":"Take or upload another photo."},G={"portrait.source.title":"Comment voulez-vous ajouter votre photo d'identité ?","portrait.source.description":"Prenez une nouvelle photo avec la caméra, ou importez une photo récente depuis cet appareil.","portrait.source.camera":"Prendre une photo","portrait.source.upload":"Importer une photo","portrait.source.uploadInstead":"Importer une photo à la place","portrait.upload.title":"Importez votre photo d'identité","portrait.upload.hint":"Une photo récente de votre visage, de face, devant un mur clair et uni.","portrait.upload.choose":"Choisir une photo","portrait.upload.unsupported":"Choisissez une photo JPEG, PNG ou HEIC.","portrait.upload.failed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","portrait.review.title":"Vérifiez votre photo ajustée","portrait.review.description":"Nous avons ajusté votre photo pour qu'elle respecte les règles des photos d'identité. Votre visage n'a pas été modifié.","portrait.review.original":"Votre photo","portrait.review.fixed":"Photo ajustée","portrait.review.fixesTitle":"Ce que nous avons modifié","portrait.review.accept":"Utiliser cette photo","portrait.review.retake":"Reprendre","portrait.review.uploadAnother":"Importer une autre","portrait.fixes.crop":"Recadrée","portrait.fixes.scale":"Redimensionnée","portrait.fixes.straighten":"Redressée","portrait.fixes.background":"Fond remplacé","portrait.fixes.exposure":"Luminosité ajustée","portrait.fixes.white_balance":"Couleurs équilibrées","reasons.portrait_morph_suspected":"Cette photo ne peut pas être utilisée. Prenez une nouvelle photo de la personne.","reasons.portrait_reference_mismatch":"La photo ne correspond pas à la référence. Prenez une nouvelle photo de la personne.","reasons.portrait_declined_fix":"Prenez ou importez une autre photo."},H={en:y,fr:G,ar:D,es:y,pt:y,de:y},S="image/jpeg,image/png,image/heic,image/heif";function m(r){let o=r.strings,a=H[r.locale];return t=>o[t]??a[t]??""}s(m,"v");n(m,"portraitCopy");function b({step:r,i18n:o}){if(r.reason===void 0||r.reason==="portrait_fix_review")return null;let a=m(o)(`reasons.${r.reason}`)||o.t("portrait.retryTitle");return(0,e.jsxs)(k,{tone:"warning",children:[(0,e.jsx)("span",{children:a}),(0,e.jsx)("span",{children:I(o,r.attemptsRemaining,r.attemptsExhausted)})]})}s(b,"R");n(b,"ReasonNotice");function z({step:r,i18n:o,onCamera:a,onUpload:t}){let i=m(o),p=r.photo?.cameraOnPhone===!0;return(0,e.jsx)(j,{testId:"sekyro-portrait-source",title:i("portrait.source.title"),lead:i("portrait.source.description"),cameraLabel:p?o.t("capture.source.phone"):i("portrait.source.camera"),onPhone:p,uploadLabel:i("portrait.source.upload"),notice:(0,e.jsx)(b,{step:r,i18n:o}),onCamera:a,onUpload:t})}s(z,"z");n(z,"PortraitSourceView");function R({step:r,i18n:o,onCamera:a}){let t=m(o),i=(0,f.useRef)(null),[p,v]=(0,f.useState)("idle"),u=p==="sending",d=r.photo?.uploadOffered===!0,g=n(async c=>{let x=c.currentTarget.files?.[0];if(c.currentTarget.value="",x!==void 0){v("sending");try{await r.uploadPortrait(x),v("idle")}catch(w){v(w instanceof TypeError&&w.message==="unsupported_file"?"unsupported":"failed")}}},"onFile");return(0,e.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-portrait-upload-screen",children:[(0,e.jsx)(_,{title:t("portrait.upload.title"),lead:t("portrait.upload.hint")}),p==="idle"||p==="sending"?(0,e.jsx)(b,{step:r,i18n:o}):null,p==="unsupported"||p==="failed"?(0,e.jsx)(k,{tone:"warning",children:(0,e.jsx)("span",{children:t(p==="unsupported"?"portrait.upload.unsupported":"portrait.upload.failed")})}):null,u?(0,e.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:o.t("portrait.uploading")}):null,(0,e.jsx)("input",{ref:i,type:"file",accept:S,hidden:!0,"data-testid":"sekyro-portrait-upload","aria-label":t("portrait.upload.title"),onChange:s(c=>{g(c)},"onChange")}),(0,e.jsxs)(C,{children:[(0,e.jsx)(h,{full:!0,onClick:s(()=>i.current?.click(),"onClick"),disabled:u||!d||r.attemptsExhausted,children:t("portrait.upload.choose")}),a!==void 0?(0,e.jsxs)(h,{full:!0,kind:"ghost",onClick:a,disabled:u,children:[(0,e.jsx)(T,{name:"camera"}),t("portrait.source.camera")]}):null]})]})}s(R,"A");n(R,"PortraitUploadView");function E({step:r,i18n:o,onDeclined:a}){let t=m(o),[i,p]=(0,f.useState)(!1),[v,u]=(0,f.useState)(!1),d=r.pendingFix;if(d==null)return null;let g=n(async l=>{p(!0),u(!1);try{await r.confirmFix(l),l||a?.()}catch{u(!0)}finally{p(!1)}},"answer"),c=r.photo?.source==="upload"?t("portrait.review.uploadAnother"):t("portrait.review.retake"),x=n(l=>t(`portrait.fixes.${l}`)||l,"fixName"),w=t("portrait.review.original"),P=t("portrait.review.fixed");return(0,e.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-portrait-review",children:[(0,e.jsx)(_,{title:t("portrait.review.title"),lead:t("portrait.review.description")}),(0,e.jsxs)("div",{className:"sekyro-portrait-pair",children:[(0,e.jsxs)("figure",{className:"sekyro-portrait-pair__item",children:[(0,e.jsx)("img",{src:d.originalUrl,alt:w}),(0,e.jsx)("figcaption",{className:"sekyro-text-muted",children:w})]}),(0,e.jsxs)("figure",{className:"sekyro-portrait-pair__item",children:[(0,e.jsx)("img",{src:d.fixedUrl,alt:P}),(0,e.jsx)("figcaption",{className:"sekyro-text-muted",children:P})]})]}),d.fixes.length>0?(0,e.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,e.jsx)("p",{className:"sekyro-text-body",children:t("portrait.review.fixesTitle")}),(0,e.jsx)("ul",{className:"sekyro-portrait-fixes","data-testid":"sekyro-portrait-fixes",children:d.fixes.map(l=>(0,e.jsx)("li",{children:x(l)},l))})]}):null,v?(0,e.jsx)(k,{tone:"danger",children:(0,e.jsx)("span",{children:o.t("errors.network_error")})}):null,(0,e.jsxs)(C,{children:[(0,e.jsx)(h,{full:!0,onClick:s(()=>{g(!0)},"onClick"),disabled:i,"data-testid":"sekyro-portrait-accept",children:t("portrait.review.accept")}),(0,e.jsx)(h,{full:!0,kind:"ghost",onClick:s(()=>{g(!1)},"onClick"),disabled:i,"data-testid":"sekyro-portrait-decline",children:c})]})]})}s(E,"j");n(E,"PortraitReviewView");function q({screen:r,step:o,i18n:a,onCamera:t,onUpload:i,onDeclined:p}){return r==="phone"?(0,e.jsx)(U,{i18n:a,lead:a.t("handoff.lead.portrait"),refresh:o.refresh,actions:(0,e.jsx)(h,{kind:"ghost",full:!0,onClick:i,children:m(a)("portrait.source.upload")})}):r==="review"?(0,e.jsx)(E,{step:o,i18n:a,onDeclined:p}):r==="upload"?(0,e.jsx)(R,{step:o,i18n:a,...t!==void 0?{onCamera:t}:{}}):(0,e.jsx)(z,{step:o,i18n:a,onCamera:t??i,onUpload:i})}s(q,"Q");n(q,"PortraitScreens");export{m as a,z as b,R as c,E as d,q as e};
1
+ import{a as j}from"./chunk-F3BSTTXB.js";import{f as U}from"./chunk-KQCTXWDO.js";import{K as k,L as I,a as A,b as V,c as h,v as T,w as _,y as C}from"./chunk-K3XSP444.js";import{a as n}from"./chunk-5QL6W6FW.js";import{a as s,c as N}from"./chunk-4FHWXBOB.js";var f=N(A(),1),e=N(V(),1);var D={"portrait.source.title":"كيف تريد إضافة صورتك الشخصية؟","portrait.source.description":"التقط صورة جديدة بالكاميرا، أو ارفع صورة حديثة من هذا الجهاز.","portrait.source.camera":"التقاط صورة","portrait.source.upload":"رفع صورة","portrait.source.uploadInstead":"رفع صورة بدلًا من ذلك","portrait.upload.title":"ارفع صورتك الشخصية","portrait.upload.hint":"صورة حديثة لوجهك، تنظر فيها مباشرة إلى الكاميرا، أمام جدار فاتح وبلون واحد.","portrait.upload.choose":"اختيار صورة","portrait.upload.unsupported":"اختر صورة بصيغة JPEG أو PNG أو HEIC.","portrait.upload.failed":"تعذّر إرسال هذه الصورة. حاول مرة أخرى.","portrait.review.title":"تحقّق من صورتك المعدّلة","portrait.review.description":"عدّلنا صورتك لتطابق قواعد صور الهوية. لم نغيّر وجهك.","portrait.review.original":"صورتك","portrait.review.fixed":"الصورة المعدّلة","portrait.review.fixesTitle":"ما الذي غيّرناه","portrait.review.accept":"استخدام هذه الصورة","portrait.review.retake":"إعادة الالتقاط","portrait.review.uploadAnother":"رفع صورة أخرى","portrait.fixes.crop":"قُصّت","portrait.fixes.scale":"غُيّر حجمها","portrait.fixes.straighten":"عُدّل ميلها","portrait.fixes.background":"استُبدلت الخلفية","portrait.fixes.exposure":"عُدّل السطوع","portrait.fixes.white_balance":"وُزنت الألوان","reasons.portrait_morph_suspected":"لا يمكن استخدام هذه الصورة. التقط صورة جديدة للشخص.","reasons.portrait_reference_mismatch":"لا تطابق الصورة المرجع. التقط صورة جديدة للشخص.","reasons.portrait_declined_fix":"التقط صورة أخرى أو ارفعها."},y={"portrait.source.title":"How do you want to add your ID photo?","portrait.source.description":"Take a new photo with the camera, or upload a recent photo from this device.","portrait.source.camera":"Take a photo","portrait.source.upload":"Upload a photo","portrait.source.uploadInstead":"Upload a photo instead","portrait.upload.title":"Upload your ID photo","portrait.upload.hint":"A recent photo of your face, looking straight at the camera, in front of a plain, light wall.","portrait.upload.choose":"Choose a photo","portrait.upload.unsupported":"Choose a JPEG, PNG or HEIC photo.","portrait.upload.failed":"We could not send this photo. Try again.","portrait.review.title":"Check your adjusted photo","portrait.review.description":"We adjusted your photo to meet the ID photo rules. Your face was not changed.","portrait.review.original":"Your photo","portrait.review.fixed":"Adjusted photo","portrait.review.fixesTitle":"What we changed","portrait.review.accept":"Use this photo","portrait.review.retake":"Take another","portrait.review.uploadAnother":"Upload another","portrait.fixes.crop":"Cropped","portrait.fixes.scale":"Resized","portrait.fixes.straighten":"Straightened","portrait.fixes.background":"Background replaced","portrait.fixes.exposure":"Brightness adjusted","portrait.fixes.white_balance":"Colours balanced","reasons.portrait_morph_suspected":"This photo cannot be used. Take a new photo of the person.","reasons.portrait_reference_mismatch":"The photo does not match the reference. Take a new photo of the person.","reasons.portrait_declined_fix":"Take or upload another photo."},G={"portrait.source.title":"Comment voulez-vous ajouter votre photo d'identité ?","portrait.source.description":"Prenez une nouvelle photo avec la caméra, ou importez une photo récente depuis cet appareil.","portrait.source.camera":"Prendre une photo","portrait.source.upload":"Importer une photo","portrait.source.uploadInstead":"Importer une photo à la place","portrait.upload.title":"Importez votre photo d'identité","portrait.upload.hint":"Une photo récente de votre visage, de face, devant un mur clair et uni.","portrait.upload.choose":"Choisir une photo","portrait.upload.unsupported":"Choisissez une photo JPEG, PNG ou HEIC.","portrait.upload.failed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","portrait.review.title":"Vérifiez votre photo ajustée","portrait.review.description":"Nous avons ajusté votre photo pour qu'elle respecte les règles des photos d'identité. Votre visage n'a pas été modifié.","portrait.review.original":"Votre photo","portrait.review.fixed":"Photo ajustée","portrait.review.fixesTitle":"Ce que nous avons modifié","portrait.review.accept":"Utiliser cette photo","portrait.review.retake":"Reprendre","portrait.review.uploadAnother":"Importer une autre","portrait.fixes.crop":"Recadrée","portrait.fixes.scale":"Redimensionnée","portrait.fixes.straighten":"Redressée","portrait.fixes.background":"Fond remplacé","portrait.fixes.exposure":"Luminosité ajustée","portrait.fixes.white_balance":"Couleurs équilibrées","reasons.portrait_morph_suspected":"Cette photo ne peut pas être utilisée. Prenez une nouvelle photo de la personne.","reasons.portrait_reference_mismatch":"La photo ne correspond pas à la référence. Prenez une nouvelle photo de la personne.","reasons.portrait_declined_fix":"Prenez ou importez une autre photo."},H={en:y,fr:G,ar:D,es:y,pt:y,de:y},S="image/jpeg,image/png,image/heic,image/heif";function m(r){let o=r.strings,a=H[r.locale];return t=>o[t]??a[t]??""}s(m,"v");n(m,"portraitCopy");function b({step:r,i18n:o}){if(r.reason===void 0||r.reason==="portrait_fix_review")return null;let a=m(o)(`reasons.${r.reason}`)||o.t("portrait.retryTitle");return(0,e.jsxs)(k,{tone:"warning",children:[(0,e.jsx)("span",{children:a}),(0,e.jsx)("span",{children:I(o,r.attemptsRemaining,r.attemptsExhausted)})]})}s(b,"R");n(b,"ReasonNotice");function z({step:r,i18n:o,onCamera:a,onUpload:t}){let i=m(o),p=r.photo?.cameraOnPhone===!0;return(0,e.jsx)(j,{testId:"sekyro-portrait-source",title:i("portrait.source.title"),lead:i("portrait.source.description"),cameraLabel:p?o.t("capture.source.phone"):i("portrait.source.camera"),onPhone:p,uploadLabel:i("portrait.source.upload"),notice:(0,e.jsx)(b,{step:r,i18n:o}),onCamera:a,onUpload:t})}s(z,"z");n(z,"PortraitSourceView");function R({step:r,i18n:o,onCamera:a}){let t=m(o),i=(0,f.useRef)(null),[p,v]=(0,f.useState)("idle"),u=p==="sending",d=r.photo?.uploadOffered===!0,g=n(async c=>{let x=c.currentTarget.files?.[0];if(c.currentTarget.value="",x!==void 0){v("sending");try{await r.uploadPortrait(x),v("idle")}catch(w){v(w instanceof TypeError&&w.message==="unsupported_file"?"unsupported":"failed")}}},"onFile");return(0,e.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-portrait-upload-screen",children:[(0,e.jsx)(_,{title:t("portrait.upload.title"),lead:t("portrait.upload.hint")}),p==="idle"||p==="sending"?(0,e.jsx)(b,{step:r,i18n:o}):null,p==="unsupported"||p==="failed"?(0,e.jsx)(k,{tone:"warning",children:(0,e.jsx)("span",{children:t(p==="unsupported"?"portrait.upload.unsupported":"portrait.upload.failed")})}):null,u?(0,e.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:o.t("portrait.uploading")}):null,(0,e.jsx)("input",{ref:i,type:"file",accept:S,hidden:!0,"data-testid":"sekyro-portrait-upload","aria-label":t("portrait.upload.title"),onChange:s(c=>{g(c)},"onChange")}),(0,e.jsxs)(C,{children:[(0,e.jsx)(h,{full:!0,onClick:s(()=>i.current?.click(),"onClick"),disabled:u||!d||r.attemptsExhausted,children:t("portrait.upload.choose")}),a!==void 0?(0,e.jsxs)(h,{full:!0,kind:"ghost",onClick:a,disabled:u,children:[(0,e.jsx)(T,{name:"camera"}),t("portrait.source.camera")]}):null]})]})}s(R,"A");n(R,"PortraitUploadView");function E({step:r,i18n:o,onDeclined:a}){let t=m(o),[i,p]=(0,f.useState)(!1),[v,u]=(0,f.useState)(!1),d=r.pendingFix;if(d==null)return null;let g=n(async l=>{p(!0),u(!1);try{await r.confirmFix(l),l||a?.()}catch{u(!0)}finally{p(!1)}},"answer"),c=r.photo?.source==="upload"?t("portrait.review.uploadAnother"):t("portrait.review.retake"),x=n(l=>t(`portrait.fixes.${l}`)||l,"fixName"),w=t("portrait.review.original"),P=t("portrait.review.fixed");return(0,e.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-portrait-review",children:[(0,e.jsx)(_,{title:t("portrait.review.title"),lead:t("portrait.review.description")}),(0,e.jsxs)("div",{className:"sekyro-portrait-pair",children:[(0,e.jsxs)("figure",{className:"sekyro-portrait-pair__item",children:[(0,e.jsx)("img",{src:d.originalUrl,alt:w}),(0,e.jsx)("figcaption",{className:"sekyro-text-muted",children:w})]}),(0,e.jsxs)("figure",{className:"sekyro-portrait-pair__item",children:[(0,e.jsx)("img",{src:d.fixedUrl,alt:P}),(0,e.jsx)("figcaption",{className:"sekyro-text-muted",children:P})]})]}),d.fixes.length>0?(0,e.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,e.jsx)("p",{className:"sekyro-text-body",children:t("portrait.review.fixesTitle")}),(0,e.jsx)("ul",{className:"sekyro-portrait-fixes","data-testid":"sekyro-portrait-fixes",children:d.fixes.map(l=>(0,e.jsx)("li",{children:x(l)},l))})]}):null,v?(0,e.jsx)(k,{tone:"danger",children:(0,e.jsx)("span",{children:o.t("errors.network_error")})}):null,(0,e.jsxs)(C,{children:[(0,e.jsx)(h,{full:!0,onClick:s(()=>{g(!0)},"onClick"),disabled:i,"data-testid":"sekyro-portrait-accept",children:t("portrait.review.accept")}),(0,e.jsx)(h,{full:!0,kind:"ghost",onClick:s(()=>{g(!1)},"onClick"),disabled:i,"data-testid":"sekyro-portrait-decline",children:c})]})]})}s(E,"j");n(E,"PortraitReviewView");function q({screen:r,step:o,i18n:a,onCamera:t,onUpload:i,onDeclined:p}){return r==="phone"?(0,e.jsx)(U,{i18n:a,lead:a.t("handoff.lead.portrait"),refresh:o.refresh,actions:(0,e.jsx)(h,{kind:"ghost",full:!0,onClick:i,children:m(a)("portrait.source.upload")})}):r==="review"?(0,e.jsx)(E,{step:o,i18n:a,onDeclined:p}):r==="upload"?(0,e.jsx)(R,{step:o,i18n:a,...t!==void 0?{onCamera:t}:{}}):(0,e.jsx)(z,{step:o,i18n:a,onCamera:t??i,onUpload:i})}s(q,"Q");n(q,"PortraitScreens");export{m as a,z as b,R as c,E as d,q as e};
@@ -0,0 +1 @@
1
+ import{b as ee}from"./chunk-NGJMT7M3.js";import{a as F,c as ie,d as D}from"./chunk-DDUCV6NE.js";import{b as te}from"./chunk-6MYG4HWP.js";import{a as r}from"./chunk-4FHWXBOB.js";var b,p=(b=class extends Error{constructor(e){super(e.message),this.name="HostedApiError",this.status=e.status,this.code=e.code,e.retryAfterSeconds!==void 0&&(this.retryAfterSeconds=e.retryAfterSeconds),e.details&&(this.details=e.details)}},r(b,"u"),b);function A(t){return t instanceof p&&t.code==="session_continues_elsewhere"}r(A,"m");var ce=/^[A-Za-z0-9_-]{43}$/,de="sekyro.cs.",Se="sekyro.ct.",le="sekyro.hr.",ue="sekyro.hp.",B=new Map;function he(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}r(he,"K");function q(t){let e=B.get(t);if(e!==void 0)return e;try{return he()?.getItem(t)??void 0}catch{return}}r(q,"g");function P(t,e){try{let i=he();if(i===null)throw new Error("no storage");i.setItem(t,e),B.delete(t)}catch{B.set(t,e)}}r(P,"y");function $(t,e){let i=2166136261,s=16777619^e.length;for(let n=0;n<e.length;n++){let a=e.charCodeAt(n);i=Math.imul(i^a,16777619)>>>0,s=Math.imul(s^a^i&255,16777619)>>>0}return`${t}${i.toString(16).padStart(8,"0")}${s.toString(16).padStart(8,"0")}`}r($,"h");var pe=r(t=>$(Se,t),"V");function Te(t,e){t!==""&&P($(le,t),JSON.stringify(e))}r(Te,"q");function Me(t){if(t!=="")try{let e=q($(le,t));if(e===void 0)return;let i=JSON.parse(e);return typeof i.sessionToken=="string"&&typeof i.sessionId=="string"?{sessionToken:i.sessionToken,sessionId:i.sessionId,...typeof i.locale=="string"?{locale:i.locale}:{}}:void 0}catch{return}}r(Me,"F");function xt(t,e){t!==""&&e!==""&&P($(ue,t),e)}r(xt,"ye");function At(t){return t===""?void 0:q($(ue,t))}r(At,"ge");function se(t){if(t==="")return;let e=q(`${de}${t}`);return e!==void 0&&ce.test(e)?e:void 0}r(se,"_");function L(t,e,i){t===""||!ce.test(e)||(P(`${de}${t}`,e),i!==void 0&&i!==""&&P(pe(i),t))}r(L,"b");function Ie(t){return t===""?void 0:q(pe(t))}r(Ie,"I");function R(t,e,i=Math.random){let s=(t??e)*1e3,n=Math.min(Math.max(s,500),2e4),a=Math.round(n*(1+(i()*2-1)*.25));return Math.min(Math.max(a,500),2e4)}r(R,"C");var ne=6e4,J=4,re=3e4,Ce=9e5,xe=200,Ae=5,$e=400,Ee=new Set(["server_busy","request_timeout"]),Oe=20,Pe=60,Re=600,qe=3,Ne=5,Ke=2;function k(t){return(t.split(";")[0]??"").trim()}r(k,"w");var He={liveness:"clipKey",face_match:"imageKey",doc_ocr:"imageKey"},ae="sekyro-client-secret";function je(t){return typeof t=="object"&&t!==null&&typeof t.sessionId=="string"&&typeof t.status=="string"}r(je,"ce");var ze=`@sekyro/web/${F}`,Fe=ze,De=`@sekyro/web@${F}`,Le=8192;async function U(t){let e={"x-sekyro-sdk":Fe};t!==void 0&&(e["sekyro-client-locale"]=t);try{let s=D.timezone();s!==void 0&&(e["sekyro-client-timezone"]=s)}catch{}e["sekyro-client-form-factor"]=te();let i;try{i=await D.deviceHeader()}catch{i=void 0}return e["sekyro-client-device"]=i!==void 0&&i.length<=Le?i:ie(De),e}r(U,"S");var g,$t=(g=class{constructor(e){this.redeeming=null,this.sessionId=null,this.bootstrap=null,this.captureNonces=[],this.captureFetch=null,this.reportedIssues=new Map,this.issueReports=0,this.issuesPausedUntil=0,this.apiOrigin=e.apiOrigin.replace(/\/+$/,""),this.sessionToken=e.sessionToken;let i=e.fetch;this.fetchImpl=(s,n)=>(i??globalThis.fetch).call(globalThis,s,n),this.requestTimeoutMs=e.requestTimeoutMs??re,this.retryAttempts=e.inProgressRetry?.attempts??Ae,this.retryDelayMs=e.inProgressRetry?.delayMs??$e,this.random=e.random??Math.random,this.clientLocale=e.locale,this.handoffCode=e.handoffCode!==void 0&&e.handoffCode!==""?e.handoffCode:void 0}static async redeemHandoffCode(e,i,s={}){let n=Me(i),a=n===void 0?void 0:se(n.sessionId);if(n!==void 0&&a!==void 0)return{sessionToken:n.sessionToken,sessionId:n.sessionId,clientSecret:a,locale:n.locale??s.locale??"en"};let c=s.fetch,d=await U(s.locale);d["content-type"]="application/json";let o;try{o=await(c??globalThis.fetch).call(globalThis,`${e.replace(/\/+$/,"")}/api/v2/hosted/handoff-codes/redeem`,{method:"POST",headers:d,body:JSON.stringify({code:i}),cache:"no-store",signal:AbortSignal.timeout(s.requestTimeoutMs??re)})}catch(h){throw w(h)}if(!o.ok)throw await G(o);let u;try{u=await o.json()}catch{throw new p({status:o.status,code:"unknown_error",message:`response body was not valid JSON (HTTP ${o.status})`})}let l=oe(u);if(typeof l?.sessionToken!="string"||typeof l.sessionId!="string"||typeof l.clientSecret!="string")throw new p({status:o.status,code:"unknown_error",message:"the redeem answer is incomplete"});return L(l.sessionId,l.clientSecret,l.sessionToken),Te(i,{sessionToken:l.sessionToken,sessionId:l.sessionId,locale:l.locale}),l}async bindClient(){let e=await this.api("POST","/hosted/client",{body:{},busyRetry:!0});if(typeof e.clientSecret=="string"){let i=await this.ensureSessionId();this.clientSecret=e.clientSecret,L(i,e.clientSecret,this.sessionToken)}return{role:e.role}}async createHandoffCode(e={}){let{clientSecret:i,...s}=await this.api("POST","/hosted/handoff-codes",{body:e.target!==void 0?{target:e.target}:{}});if(typeof i=="string"){let n=await this.ensureSessionId();this.clientSecret=i,L(n,i,this.sessionToken)}return s}secretOf(){if(this.clientSecret!==void 0)return this.clientSecret;let e=this.sessionId??Ie(this.sessionToken),i=e===void 0?void 0:se(e);return i!==void 0&&(this.clientSecret=i),i}noteView(e){this.sessionId=e.sessionId}async requestHeaders(){await this.ensureRedeemed();let e={"x-session-token":this.sessionToken,...await U(this.clientLocale)},i=this.secretOf();return i!==void 0&&(e[ae]=i),e}ensureRedeemed(){let e=this.handoffCode;return e===void 0?Promise.resolve():(this.redeeming??(this.redeeming=g.redeemHandoffCode(this.apiOrigin,e,{fetch:this.fetchImpl,requestTimeoutMs:this.requestTimeoutMs,...this.clientLocale!==void 0?{locale:this.clientLocale}:{}}).then(i=>{this.sessionToken=i.sessionToken,this.sessionId=i.sessionId,this.clientSecret=i.clientSecret,this.handoffCode=void 0},i=>{throw i instanceof p&&i.status===0&&(this.redeeming=null),i})),this.redeeming)}async getSession(){return this.api("GET","/hosted/session")}async*sessionEvents(e){await this.ensureRedeemed();let i={...await U(this.clientLocale),"x-session-token":this.sessionToken,accept:"text/event-stream"},s=this.secretOf();s!==void 0&&(i[ae]=s);let n;try{n=await this.fetchImpl(`${this.apiOrigin}/api/v2/hosted/session/events`,{method:"GET",headers:i,cache:"no-store",signal:e})}catch(c){throw w(c)}if(!n.ok)throw await G(n);if(n.body===null||typeof TextDecoder>"u")throw new p({status:0,code:"unknown_error",message:"streamed responses are not supported here"});let{readSessionEvents:a}=await import("./session-events-W5DRVA6F-BNHYAEHE.js");try{for await(let c of a(n.body))c.type==="view"&&this.noteView(c.view),yield c}catch(c){throw w(c)}}async recordConsent(e){let i=await this.api("POST","/hosted/consent",{body:{locale:e},busyRetry:!0}),s=this.captureHold;return this.captureHold=void 0,s&&this.armCapture(s),i}async reportCameraUnavailable(e){return this.api("POST","/hosted/camera-unavailable",{body:{cause:e}})}async testerGate(e){return this.api("POST","/hosted/tester-gate",{body:{input:e}})}async chooseSandboxMode(e){return this.api("POST","/hosted/sandbox-mode",{body:{mode:e}})}async reportCaptureIssue(e){let i=typeof e.name=="string"?e.name.replace(/[^A-Za-z]/g,"").slice(0,40):"",s=typeof e.engineKind=="string"&&/^[a-z_]{1,32}$/.test(e.engineKind)?e.engineKind:void 0,n=typeof e.attempt=="number"&&Number.isInteger(e.attempt)&&e.attempt>=0&&e.attempt<=1e3?e.attempt:void 0,a=e.check==="attestation"?n??"":"",c=[e.check,a,e.kind,i,e.phase??"",s??""].join("|"),d=this.reportedIssues.get(c);if(d!==void 0)return d;if(Date.now()<this.issuesPausedUntil||this.issueReports>=Oe)return;let o={check:e.check,kind:e.kind,...i!==""?{name:i}:{},...e.phase!==void 0?{phase:e.phase}:{},...s!==void 0?{engineKind:s}:{},...n!==void 0?{attempt:n}:{},...e.formFactor!==void 0?{formFactor:e.formFactor}:{},...typeof e.detail=="string"&&/^\d{1,10}$/.test(e.detail)?{detail:e.detail}:{},...V(e.challengeMs)?{challengeMs:e.challengeMs}:{},...V(e.readyMs)?{readyMs:e.readyMs}:{},...e.inApp===!0?{inApp:!0}:{},...e.interactive===!0?{interactive:!0}:{},...typeof e.checks=="number"&&Number.isInteger(e.checks)&&e.checks>=0&&e.checks<=50?{checks:e.checks}:{},...V(e.hiddenMs)?{hiddenMs:e.hiddenMs}:{},...e.hidden===!0?{hidden:!0}:{},...e.stage==="script"||e.stage==="widget"||e.stage==="run"?{stage:e.stage}:{},...e.check==="attestation"?{deviceTime:Date.now()}:{}};this.issueReports+=1;let u=this.api("POST","/hosted/capture-issue",{body:o,empty:!0,noRateRetry:!0}).catch(l=>{if(l instanceof p&&l.status===429){let h=Math.min(Math.max(l.retryAfterSeconds??Pe,0),Re);this.issuesPausedUntil=Math.max(this.issuesPausedUntil,Date.now()+h*1e3);return}(!(l instanceof p)||l.status===0||l.status>=500)&&this.reportedIssues.delete(c)});return this.reportedIssues.set(c,u),u}async choose(e,i){return this.api("POST","/hosted/choice",{body:{nodeId:e,option:i},busyRetry:!0})}async confirmIdentity(e){return this.api("POST","/hosted/identity/confirm",{body:{decision:e}})}async identityPortrait(){return this.api("GET","/hosted/identity/portrait",{blob:!0})}async presign(e,i,s,n={}){let a=await this.ensureSessionId(),c={kind:e,contentType:k(i),contentLength:s,...n.source==="upload"?{source:"upload"}:{}};return this.api("POST",`/sessions/${a}/media`,{body:c})}armCapture(e=2,i){let s=Date.now();this.captureNonces.filter(n=>n.expiresAt-ne>s).length>=e||(this.captureHold===void 0?this.fillCaptureNonces(e,e).catch(n=>{A(n)&&i?.(n)}):this.captureHold=Math.max(this.captureHold,e))}async armRamp(){try{let e=await this.ensureSessionId(),i=await this.api("POST",`/sessions/${e}/media/capture-nonces`,{body:{count:2,ramp:!0}}),s=Date.now(),n=ee(i.screenRamp)?i.screenRamp:void 0,a=s+Math.max(0,i.expiresIn)*1e3;for(let d of Array.isArray(i.nonces)?i.nonces:[])typeof d!="string"||d.length===0||this.captureNonces.push({nonce:d,expiresAt:a,...n!==void 0?{arm:n.nonce}:{}});this.captureNonces=this.captureNonces.slice(-J),this.captureHold=void 0;let c=typeof i.rampExpiresIn=="number"&&i.rampExpiresIn>0?i.rampExpiresIn:0;return{...n!==void 0?{challenge:n}:{},expiresAt:s+c*1e3}}catch(e){if(A(e))throw e;return}}async presignCapture(e,i,s,n={}){let a=await this.ensureSessionId(),c=await this.takeCaptureNonce(n.arm),d=c===void 0?void 0:{nonce:c,...n.engine!==void 0?{engine:n.engine.slice(0,32)}:{},...n.durationMs!==void 0&&Number.isFinite(n.durationMs)?{captureMs:Math.min(36e5,Math.max(0,Math.round(n.durationMs)))}:{}},o={kind:e,contentType:k(i),contentLength:s,capture:d};return this.api("POST",`/sessions/${a}/media`,{body:o})}async takeCaptureNonce(e){let i=r(()=>{let s=Date.now();this.captureNonces=this.captureNonces.filter(a=>a.expiresAt-ne>s);let n=this.captureNonces.findIndex(a=>a.arm===e);return this.captureNonces.splice(n<0?0:n,1)[0]?.nonce},"t");for(let s=0;s<2;s++){let n=i();if(n!==void 0)return n;await this.fillCaptureNonces(1)}return i()}fillCaptureNonces(e,i=0){return this.captureFetch??(this.captureFetch=(async()=>{try{let s=await this.ensureSessionId(),n=await this.api("POST",`/sessions/${s}/media/capture-nonces`,{body:{count:Math.min(J,Math.max(1,e))}}),a=Date.now()+Math.max(0,n.expiresIn)*1e3;for(let c of Array.isArray(n.nonces)?n.nonces:[])typeof c=="string"&&c.length>0&&this.captureNonces.push({nonce:c,expiresAt:a});this.captureNonces=this.captureNonces.slice(-J),this.captureHold=void 0}catch(s){if(A(s))throw s;s instanceof p&&s.code==="consent_required"&&(this.captureHold=Math.max(this.captureHold??0,i))}})().finally(()=>{this.captureFetch=null})),this.captureFetch}async uploadToSpaces(e,i,s){let n;try{n=await this.fetchImpl(e,{method:"PUT",headers:{"content-type":k(s)},body:i,signal:AbortSignal.timeout(Ce)})}catch(a){throw w(a)}if(!n.ok){let a=(await n.text().catch(()=>"")).slice(0,xe);throw new p({status:n.status,code:"upload_failed",message:`media upload failed (HTTP ${n.status})${a?`: ${a}`:""}`})}}async completeMedia(e){let i=await this.ensureSessionId();return this.api("POST",`/sessions/${i}/media/complete`,{body:{key:e}})}async submitCheck(e,i,s={}){let n=await this.ensureSessionId(),a={input:i,forceOutcome:s.forceOutcome};return this.api("POST",`/sessions/${n}/checks/${e}`,{body:a,idempotencyKey:s.idempotencyKey,...s.browserCheckToken!==void 0?{browserCheckToken:s.browserCheckToken}:{},busyRetry:s.idempotencyKey!==void 0})}async uploadAndSubmit(e,i,s,n={}){let a=k(i.contentType),c=await this.presign(i.kind,a,i.blob.size);await this.uploadToSpaces(c.uploadUrl,i.blob,a);let d=await this.completeMedia(c.key),o={...s,[He[e]]:d.key};return this.submitCheck(e,o,n)}async ensureSessionId(){return this.sessionId!==null?this.sessionId:(this.bootstrap??(this.bootstrap=this.getSession().finally(()=>{this.bootstrap=null})),(await this.bootstrap).sessionId)}async api(e,i,s={}){let n=e==="GET"||s.busyRetry===!0,a=e==="GET"||s.noRateRetry===!0?0:qe,c=`${this.apiOrigin}/api/v2${i}`,d=await this.requestHeaders();s.body!==void 0&&(d["content-type"]="application/json"),s.idempotencyKey!==void 0&&(d["x-idempotency-key"]=s.idempotencyKey),s.browserCheckToken!==void 0&&(d["sekyro-browser-check"]=s.browserCheckToken);for(let o=0;;o++){let u;try{u=await this.fetchImpl(c,{method:e,headers:d,...s.body!==void 0?{body:JSON.stringify(s.body)}:{},cache:"no-store",signal:AbortSignal.timeout(this.requestTimeoutMs)})}catch(h){throw w(h)}if(u.ok){if(s.empty===!0)return;if(s.blob===!0)try{return await u.blob()}catch(v){throw w(v)}let h;try{h=await u.json()}catch{throw new p({status:u.status,code:"unknown_error",message:`response body was not valid JSON (HTTP ${u.status})`})}let f=oe(h);return je(f)&&this.noteView(f),f}let l=await G(u);if(l.code==="idempotency_in_progress"&&o<this.retryAttempts){this.retryDelayMs>0&&await Z(this.retryDelayMs);continue}if(a>0&&l.status===429&&l.code==="rate_limit_exceeded"){a-=1,await Z(R(l.retryAfterSeconds,Ne,this.random));continue}if(n&&l.status===503&&Ee.has(l.code)){n=!1,await Z(R(l.retryAfterSeconds,Ke,this.random));continue}throw l}}},r(g,"n"),g);function V(t){return typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=6e5}r(V,"M");function w(t){if((typeof t=="object"&&t!==null?t.name:void 0)==="TimeoutError")return new p({status:0,code:"timeout",message:"request timed out"});let e=t instanceof Error?t.message:String(t);return new p({status:0,code:"network_error",message:`network request failed: ${e}`})}r(w,"p");function oe(t){return t!==null&&typeof t=="object"&&"success"in t&&"data"in t?t.data:t}r(oe,"B");async function G(t){let e="unknown_error",i=`request failed (HTTP ${t.status})`,s=Number.NaN,n;try{let d=await t.json();if(d!==null&&typeof d=="object"){let o=d;typeof o.code=="string"&&o.code.length>0&&(e=o.code),typeof o.message=="string"&&o.message.length>0&&(i=o.message),typeof o.retryAfterSeconds=="number"&&(s=o.retryAfterSeconds),Array.isArray(o.details?.issues)?n=o.details:Array.isArray(o.details?.errors)&&(n={...o.details,issues:[]})}}catch{}let a=t.headers.get("retry-after"),c=a===null?Math.floor(s):Number.parseInt(a,10);return new p({status:t.status,code:e,message:i,...Number.isFinite(c)&&c>=0?{retryAfterSeconds:c}:{},details:n})}r(G,"A");function Z(t){return new Promise(e=>setTimeout(e,t))}r(Z,"v");function Et(t){let e=t?.portrait,i=e?.icao,s=e?.purpose==="id_document";return i==null?s?{policy:"reject",profile:"id_document"}:null:{policy:i.policy==="alert"?"alert":"reject",profile:s||i.profile==="id_document"?"id_document":"selfie"}}r(Et,"Me");function Ot(t){return{...t.baselineEyeOpenness!==void 0?{baselineEyeOpenness:t.baselineEyeOpenness}:{},...t.baselineEyeOpennessLeft!==void 0&&t.baselineEyeOpennessRight!==void 0?{baselineEyeOpennessLeft:t.baselineEyeOpennessLeft,baselineEyeOpennessRight:t.baselineEyeOpennessRight}:{},criteria:t.verdict??{},...t.backgroundCheck!==void 0?{backgroundCheck:t.backgroundCheck}:{}}}r(Ot,"Ae");var Je=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function Nt(t){return Je.has(t)}r(Nt,"ve");function Kt(t,e,i){let s=e.detail;return{check:t,kind:e.kind,...s?.name!==void 0?{name:s.name}:{},...s?.phase!==void 0?{phase:s.phase}:{},...s?.engineKind!==void 0?{engineKind:s.engineKind}:{},attempt:Math.max(0,Math.min(1e3,i))}}r(Kt,"Pe");function Ht(){let t=-1,e="";return{note(i){i==="starting"&&e!=="starting"&&(t+=1),e=i},newHandle(){e=""},noteError(){t<0&&(t=0)},get value(){return t}}}r(Ht,"xe");var Ue={document:"document_photo",nfc:"document_chip",population_registry:"national_number",national_eid:"national_eid"};function y(t){return t.plan?.steps??[]}r(y,"f");function Y(t){return Math.max(0,t.attempts.max-t.attempts.used)}r(Y,"x");function Ve(t){let e=t.plan?.choice;return e!==void 0&&t.plan?.current===e.nodeId?e:null}r(Ve,"W");function jt(t){let e=Ve(t);if(e?.kind!=="identity_method")return null;let i=e.options.map(n=>Ue[n.service]).filter(n=>n!==void 0),s=e.options.find(n=>n.nationalEid)?.nationalEid;return s?{available:!0,selected:null,options:i,nationalEid:s}:{available:!0,selected:null,options:i}}r(jt,"Ve");var Ge=new Set(["liveness","face_match"]);function W(t){return t!==void 0&&(t.state==="pending"||t.state==="input_required")}r(W,"S");function Ze(t){return t.status!=="created"&&t.status!=="in_progress"}r(Ze,"F");function ye(t){let e=t.plan?.current,i=e==null?void 0:y(t).find(s=>s.id===e);return W(i)?i:void 0}r(ye,"M");function j(t,e){return y(t).find(i=>i.checkType===e)}r(j,"g");function H(t){let e=y(t),i=e.findIndex(s=>s.checkType==="liveness");return e.find((s,n)=>n>i&&s.checkType==="face_match")}r(H,"k");function Be(t,e){let i=j(e,"liveness")?.state,s=H(e)?.state;return(H(t)?.state??"pending")==="pending"&&(i==="passed"||i==="review")&&s!==void 0&&s!=="pending"&&s!=="skipped"}r(Be,"O");function fe(t,e){let i=new Map(y(t).map(s=>[s.id,s.state]));return y(e).filter(s=>s.checkType==="face_match"&&(i.get(s.id)??"pending")==="pending"&&s.state!=="pending"&&s.state!=="skipped").map(s=>s.id)}r(fe,"V");var Ye=/^[0-9a-f]{24}$/i;function O(t){return Ye.test(t)?`ses_${t}`:t}r(O,"b");function N(t,e){let i=O(t);return e===void 0?{sessionId:i,status:"unavailable"}:{sessionId:i,status:"unavailable",reasonCode:e}}r(N,"R");function ve(t,e,i){let s=O(t);return i===void 0?{sessionId:s,status:e}:{sessionId:s,status:e,reasonCode:i}}r(ve,"L");function zt(t,e){let i=We(t,e),s=Qe(t);return s!==void 0&&(i.sandbox=s),i}r(zt,"Ee");function Qe(t){if(t.sandbox!==!0)return;let e=t.sandboxRun;if(typeof e!="object"||e===null)return;let{mode:i,testerName:s}=e;if(!(i!=="simulated"&&i!=="tester"))return i==="tester"&&typeof s=="string"&&s.trim()!==""?{mode:i,testerName:s.trim()}:{mode:i}}r(Qe,"Z");function We(t,e){let i=O(t.sessionId);switch(t.status){case"created":case"in_progress":return st(t,e);case"verified":return K(t,{sessionId:i,status:"verified"});case"review_pending":return K(t,ve(i,"review",_e(t,"review")));case"not_verified":return K(t,et(t));default:return K(t,{sessionId:i,status:"not_verified"})}}r(We,"Q");var Xe=new Set([0,1,2,3]);function K(t,e){return Xe.has(t.level)&&(e.level=t.level),typeof t.assurance=="string"&&t.assurance.length>0&&(e.assurance=t.assurance),e}r(K,"v");function et(t){let e={sessionId:O(t.sessionId),status:"not_verified"};return t.reason!==void 0&&(e.reason=t.reason),t.reasonCode!==void 0&&(e.reasonCode=t.reasonCode),t.reasonCode==="device_cooldown"&&t.retryAfter!==void 0&&(e.retryAfter=t.retryAfter),e}r(et,"ne");function tt(t){return t==="rejected"?"rejected":t==="unavailable"?"unavailable":"inconclusive"}r(tt,"te");function it(t,e){if(e===void 0)return!1;let i=y(e).find(s=>s.id===t.id);return i!==void 0&&i.attempts.used===t.attempts.used}r(it,"ie");function st(t,e){let i=O(t.sessionId),s=y(t).find(a=>Ge.has(a.checkType)&&a.state==="input_required"&&a.reason!==void 0);if(s?.reason==="mobile_required")return N(i,"mobile_required");if(s?.reason!==void 0){if(s.result==="unavailable")return N(i,s.reason);let a=e.autoRetry&&(Y(s)>0||it(s,e.previous))?{sessionId:i,status:"retry",reasonCode:s.reason,attemptsRemaining:Y(s)}:{sessionId:i,status:"not_verified",reason:tt(s.result),reasonCode:s.reason,attemptsRemaining:Y(s)};return s.retakeHint!==void 0&&(a.retakeHint=s.retakeHint),a}let n=ye(t);return n===void 0&&y(t).some(a=>a.state==="review")?ve(i,"review",_e(t,"review")):n?.checkType==="portrait_icao"?N(i,"portrait_required"):N(i)}r(st,"re");function _e(t,e){return y(t).find(i=>i.state===e&&i.reason!==void 0)?.reason}r(_e,"N");function ge(t,e,i,s,n){return t.presignCapture!==void 0?t.presignCapture(e,i,s,n):t.presign(e,i,s)}r(ge,"q");function we(t){return{engine:t?.engine,durationMs:t?.clipMs,arm:t?.screenRamp?.nonce}}r(we,"D");var nt=["video/webm","video/mp4"],me="image/jpeg",rt=2,at=1e3,ot=1e4,ct=3,dt=10,lt=3,ut=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),ht=new Set(["session_not_active","check_not_found","check_already_finalized","check_out_of_order","check_not_active","step_not_on_path","native_app_required"]),S,X=(S=class extends Error{constructor(){super("verification destroyed"),this.name="FlowCancelledError"}},r(S,"w"),S);function pt(t){let e=H(t);return j(t,"portrait_icao")?.state!=="pending"&&(e!==void 0?W(e):t.capture?.livePhoto?.oneCapture===!0)}r(pt,"me");var T,E=(T=class extends Error{constructor(e){super(e),this.name="AttestationError"}},r(T,"h"),T),M,ft=(M=class extends E{constructor(e){super(`no attestation token: ${e}`),this.name="AttestationUnavailableError",this.code=e}},r(M,"E"),M);function Ft(t){return new p({status:400,code:"attestation_invalid",message:`browser check: ${t}`,details:{issues:[],browserCheck:t}})}r(Ft,"Oe");function mt(t){if(!(t instanceof p)||t.code!=="attestation_invalid")return;let e=t.details?.browserCheck;return typeof e=="string"?e:void 0}r(mt,"he");async function ke(t,e,i={}){let s=t.uuid(),n=!1,a=!1,c=0,d=0;for(;;)try{return await e(t.client,s)}catch(o){if(o instanceof E){if(a||o instanceof ft)throw o;a=!0,i.onAttestationInvalid?.(),s=t.uuid();continue}if(!(o instanceof p))throw o;if(o.code==="consent_required"&&!n){n=!0,await t.ensureConsent({force:!0}),s=t.uuid();continue}if(o.code==="attestation_invalid"&&!a&&mt(o)===void 0){a=!0,i.onAttestationInvalid?.(),s=t.uuid();continue}if(o.code==="inference_unavailable"&&d<ct){d+=1;let u=R(o.retryAfterSeconds,dt,t.random??Math.random);t.onBusy?.({attempt:d,retryAfterSeconds:u/1e3}),await t.sleep(u),i.onAttestationInvalid?.(),s=t.uuid();continue}if(ut.has(o.code)&&c<rt){c+=1;let u=o.retryAfterSeconds!==void 0?o.retryAfterSeconds*1e3:void 0;await t.sleep(u!==void 0?Math.min(u,ot):at);continue}throw o}}r(ke,"U");var yt=new Set(["passed","review","processing","skipped"]);async function Dt(t){let{artifacts:e}=t,i=e.clip,s=k(e.clipMime??"");if(e.degraded==="NO_RECORDER"||i===void 0||!nt.includes(s))return{kind:"unavailable",reason:"no_recorder"};t.client.armCapture?.(2);let n=vt(t,e.keyframe),a=_t(t,i,s,n),c=gt(t,n),d=!1,o=new Set,u=!0,l=0;for(;;){if(t.isCancelled())return{kind:"cancelled"};let h=t.getView();if(Ze(h))return{kind:"settled"};let f=ye(h),v=f?.checkType,z=v==="liveness"&&!d?"liveness":v==="face_match"&&!o.has(f?.id)&&o.size<2&&u?"face_match":null;if(z===null)return{kind:"settled"};if(z==="liveness"&&e.captureChannel==="desktop")return{kind:"unavailable",reason:"mobile_required"};try{if(z==="liveness"){d=!0;let m=await a();if(t.isCancelled())return{kind:"cancelled"};Be(h,m)&&o.add(H(m)?.id);for(let be of fe(h,m))o.add(be);await t.applySubmit(m,"liveness");let _=j(t.getView(),"liveness")?.state;u=_===void 0||yt.has(_)}else{o.add(f?.id);let m=await c();if(t.isCancelled())return{kind:"cancelled"};for(let _ of fe(h,m))o.add(_);await t.applySubmit(m,"face_match")}}catch(m){if(t.isCancelled()||m instanceof X)return{kind:"cancelled"};let _=St(m);if(_.kind!=="resync"||l>=lt)return _;l+=1,await t.refreshView()}}}r(Dt,"Le");function vt(t,e){let i=null,s=null,n=r(()=>i!==null?Promise.resolve(i):(s??(s=(async()=>{let a=await ge(t.client,"image",me,e.size,we(t.artifacts));return await t.client.uploadToSpaces(a.uploadUrl,e,me),i=(await t.client.completeMedia(a.key)).key,t.onKeyframePromoted?.(i),i})().finally(()=>{s=null})),s),"r");return{ensure:n,attempt:r(()=>n().catch(()=>null),"attempt"),current:r(()=>i,"current")}}r(vt,"_e");function _t(t,e,i,s){let n=t.clipKeys?.get()??null,a,c=null,d=0,o;return()=>ke(t,async(u,l)=>{if(n===null||a===void 0){if(t.isCancelled())throw new X;a===void 0&&!pt(t.getView())&&(a=null),t.onPhase("uploading");let[h,f]=await Promise.all([n!==null?Promise.resolve(n):(async()=>{let v=await ge(u,"clip",i,e.size,we(t.artifacts));return await u.uploadToSpaces(v.uploadUrl,e,i),(await u.completeMedia(v.key)).key})(),a!==void 0?Promise.resolve(a===null?null:a.imageKey):s.attempt()]);n=h,t.clipKeys?.set(h),a===void 0&&(a=f===null?null:{imageKey:f})}if(c===null){let h=performance.now();try{c=await t.getAttestation(),o=t.attestationError?.()}catch(f){throw f instanceof E?f:new E(f instanceof Error?f.message:String(f))}d=Math.round(performance.now()-h)}return t.onPhase("checking"),u.submitCheck("liveness",{clipKey:n,attestation:c,captureChannel:t.artifacts.captureChannel,capture:{...wt(t.artifacts),attestationMs:d,attestationError:o,...bt(t.attestationFacts?.())},...a!==null?{faceMatch:a}:{}},{idempotencyKey:l})},{onAttestationInvalid:r(()=>{c=null},"onAttestationInvalid")})}r(_t,"ye");function gt(t,e){return()=>ke(t,async(i,s)=>{if(e.current()===null){if(t.isCancelled())throw new X;t.onPhase("uploading")}let n=await e.ensure();return t.onPhase("checking"),i.submitCheck("face_match",{imageKey:n},{idempotencyKey:s})})}r(gt,"ke");function wt(t){let e={width:t.width,height:t.height};for(let i of kt)t[i]!==void 0&&(e[i]=t[i]);return e}r(wt,"Se");var kt=["engine","facingMode","mode","formFactor","clipMs","clipFrames","fps","clipRetakes","codec","cameraReadyMs","faceAcquireMs","captureMs","screenRamp","provenance"];function bt(t){return t===void 0?{}:{attestationChecks:t.checks,...t.challengeMs!==void 0?{attestationChallengeMs:t.challengeMs}:{}}}r(bt,"we");function St(t){if(t instanceof E)return{kind:"unavailable",reason:"attestation"};if(A(t))return{kind:"elsewhere"};if(t instanceof p){if(t.code==="attestation_invalid")return{kind:"unavailable",reason:"attestation"};if(t.code==="inference_unavailable")return{kind:"unavailable",reason:"inference_unavailable"};if(t.code==="mobile_required")return{kind:"unavailable",reason:"mobile_required"};if(ht.has(t.code))return{kind:"resync"}}return{kind:"unavailable",reason:"network"}}r(St,"Ce");var Lt="form_answers_invalid",I,Jt=(I=class extends Error{constructor(e,i){super(`form answers refused (${e.map(s=>`${s.id}: ${s.code}`).join(", ")})`),this.name="FormAnswersError",this.issues=e,this.source=i}},r(I,"B"),I),C,Ut=(C=class extends Error{constructor(e,i){super(`invalid ${e} (${i})`),this.name="InvalidInputError",this.field=e,this.kind=i}},r(C,"$"),C),x,Vt=(x=class extends Error{constructor(e,i){super(`invalid ${e} (${i})`),this.name="OtpInputError",this.field=e,this.kind=i}},r(x,"Y"),x);function Q(t){return t?.source==="upload"?null:t?.source==="choice"&&t.sourcePick!=="camera"?"upload_or_phone":"phone"}r(Q,"H");function Gt(t,e){if(e===void 0||!W(e)||e.requiresMobile!==!0)return null;switch(e.checkType){case"liveness":return"phone";case"face_match":{if(e.reason!==void 0)return"phone";let i=j(t,"portrait_icao");return i?.state==="passed"||i?.state==="review"?null:"phone"}case"doc_ocr":return Q(t.documents);case"poa":return Q(t.proofOfAddress);case"portrait_icao":{let i=t.portrait;return i?.pendingFix!==void 0||i?.reuse?.pending===!0?null:Q(i)}default:return null}}r(Gt,"Be");function Tt(t){let e=t?.capture,i=e?.mode;return i==="assisted"||i==="self"||i==="choice"?i:e?.cameraSwitch===!0?"assisted":"self"}r(Tt,"Re");function Zt(t){let e=t?.capture?.pick;return Tt(t)==="choice"&&(e==="self"||e==="assisted")?e:null}r(Zt,"Ye");function Bt(t,e,i=null){return t==="choice"?e??i??"self":t}r(Bt,"ze");var Yt={"JP:drivers_license":{normalize:"upper_no_space_or_hyphen",pattern:"^[0-9]{12}$",check:null,registrySources:[],describe:"number must be the 12-digit Japanese driving licence number"},"JP:residence_permit":{normalize:"upper_no_space_or_hyphen",pattern:"^[A-Z]{2}[0-9]{8}[A-Z]{2}$",check:null,registrySources:[],describe:"number must be the 12-character residence card number: two letters, eight digits, two letters"},"MR:drivers_license":{normalize:"upper_no_space_or_hyphen",pattern:"^[0-9]{8}$",check:null,registrySources:[],describe:"number must be the 8-digit Mauritanian driver's license number"},"MR:national_id":{normalize:"trim",pattern:"^[0-9]{10}$",check:"mr_nni_mod97",registrySources:["MR.anrpts"],describe:"number must be the 10-digit Mauritanian national ID number with a valid check digit"}};export{p as a,A as b,xt as c,At as d,k as e,$t as f,Et as g,Ot as h,Nt as i,Kt as j,Ht as k,Ue as l,y as m,Y as n,Ve as o,jt as p,W as q,Ze as r,ye as s,j as t,O as u,N as v,zt as w,Qe as x,ge as y,nt as z,ft as A,Ft as B,mt as C,ke as D,Dt as E,wt as F,Lt as G,Jt as H,Ut as I,Vt as J,Gt as K,Tt as L,Zt as M,Bt as N,Yt as O};
@@ -1 +1 @@
1
- import{c as M}from"./chunk-OVZDKB3N.js";import{a as c}from"./chunk-P7K7ELYZ.js";import{a as r}from"./chunk-4FHWXBOB.js";var T=480,I=Object.freeze({MIN_AREA_FRAC:.15,EDGE_CLIP_MARGIN_PX:4,STABLE_TICKS:3,IOU_STABLE_MIN:.85,RISE_PER_S:.9,FALL_PER_S:.25,GUIDE_EXPOSURE:.6,GUIDE_SHARPNESS:.35,ID3_BAND_MIN_WIDTH_FRAC:.55,ID3_BAND_ASPECT_MIN:4,ID3_BAND_ASPECT_MAX:40}),x=r(i=>Math.min(1,Math.max(0,i)),"p");function E(i,h,t){let s=[i.topLeft,i.topRight,i.bottomRight,i.bottomLeft],e=0;for(let a=0;a<4;a++){let l=s[a],_=s[(a+1)%4];e+=l.x*_.y-_.x*l.y}let o=h*t;return o>0?Math.abs(e/2)/o:0}r(E,"E");function g(i,h){let t=A(i),s=A(h),e=Math.max(t.x1,s.x1),o=Math.max(t.y1,s.y1),a=Math.min(t.x2,s.x2),l=Math.min(t.y2,s.y2),_=Math.max(0,a-e)*Math.max(0,l-o),d=(t.x2-t.x1)*(t.y2-t.y1),u=(s.x2-s.x1)*(s.y2-s.y1),p=d+u-_;return p>0?_/p:0}r(g,"I");function L(i){let h=A(i);return{width:h.x2-h.x1,height:h.y2-h.y1}}r(L,"R");function A(i){let h=[i.topLeft,i.topRight,i.bottomRight,i.bottomLeft];return{x1:Math.min(...h.map(t=>t.x)),y1:Math.min(...h.map(t=>t.y)),x2:Math.max(...h.map(t=>t.x)),y2:Math.max(...h.map(t=>t.y))}}r(A,"D");function S(i){let h=Math.hypot(i.topRight.x-i.topLeft.x,i.topRight.y-i.topLeft.y),t=Math.hypot(i.bottomRight.x-i.bottomLeft.x,i.bottomRight.y-i.bottomLeft.y),s=Math.hypot(i.bottomLeft.x-i.topLeft.x,i.bottomLeft.y-i.topLeft.y),e=Math.hypot(i.bottomRight.x-i.topRight.x,i.bottomRight.y-i.topRight.y),o=(h+t)/2,a=(s+e)/2;return o<=0||a<=0?0:Math.max(o,a)/Math.min(o,a)}r(S,"M");var n,N=(n=class{constructor(h,t={}){this.p=0,this.lastTickAt=null,this.lastQuad=null,this.streak=0,this.format=h,this.t={...I,...t}}reset(){this.p=0,this.lastTickAt=null,this.lastQuad=null,this.streak=0}tick(h){let{quad:t,quality:s,timestampMs:e}=h,o=this.lastTickAt===null?0:Math.max(0,(e-this.lastTickAt)/1e3);this.lastTickAt=e;let a=null;if(t===null)a="dcv1.no_doc";else if(this.format==="ID-3"){let m=L(t),y=m.height>0?m.width/m.height:0;m.width<this.t.ID3_BAND_MIN_WIDTH_FRAC*h.frameWidth?a="dcv1.come_closer":this.edgeClipped(t,h.frameWidth,h.frameHeight)?a="dcv1.fit_document":(y<this.t.ID3_BAND_ASPECT_MIN||y>this.t.ID3_BAND_ASPECT_MAX)&&(a="dcv1.wrong_shape")}else E(t,h.frameWidth,h.frameHeight)<this.t.MIN_AREA_FRAC?a="dcv1.come_closer":this.edgeClipped(t,h.frameWidth,h.frameHeight)?a="dcv1.fit_document":M(this.format,S(t))||(a="dcv1.wrong_shape");let l=a===null,_=x(s.exposure)>=this.t.GUIDE_EXPOSURE,d=x(s.sharpness)>=this.t.GUIDE_SHARPNESS,u=_&&d;if(l&&u&&t!==null){let m=this.lastQuad===null||g(t,this.lastQuad)>=this.t.IOU_STABLE_MIN;this.streak=m?this.streak+1:1}else this.streak=0;this.lastQuad=t;let p=l&&u;this.p=x(this.p+(p?this.t.RISE_PER_S:-this.t.FALL_PER_S)*o);let R=p&&this.streak>=this.t.STABLE_TICKS,f;if(a!==null)f=a;else if(_)d?f="dcv1.hold_still":f="dcv1.steady";else{let m=(c[0]+c[1])/2;f=s.meanLuma<m?"dcv1.more_light":"dcv1.too_bright"}return{at:e,quad:t,plausible:l,p:this.p,guidanceKey:f,ready:R,stableTicks:this.streak}}edgeClipped(h,t,s){let e=this.t.EDGE_CLIP_MARGIN_PX;return[h.topLeft,h.topRight,h.bottomRight,h.bottomLeft].some(o=>o.x<=e||o.y<=e||o.x>=t-e||o.y>=s-e)}},r(n,"d"),n);export{T as a,I as b,E as c,L as d,N as e};
1
+ import{d as M}from"./chunk-37BKUH3E.js";import{a as c}from"./chunk-P7K7ELYZ.js";import{a as r}from"./chunk-4FHWXBOB.js";var T=480,I=Object.freeze({MIN_AREA_FRAC:.15,EDGE_CLIP_MARGIN_PX:4,STABLE_TICKS:3,IOU_STABLE_MIN:.85,RISE_PER_S:.9,FALL_PER_S:.25,GUIDE_EXPOSURE:.6,GUIDE_SHARPNESS:.35,ID3_BAND_MIN_WIDTH_FRAC:.55,ID3_BAND_ASPECT_MIN:4,ID3_BAND_ASPECT_MAX:40}),x=r(i=>Math.min(1,Math.max(0,i)),"p");function E(i,h,t){let s=[i.topLeft,i.topRight,i.bottomRight,i.bottomLeft],e=0;for(let a=0;a<4;a++){let l=s[a],_=s[(a+1)%4];e+=l.x*_.y-_.x*l.y}let o=h*t;return o>0?Math.abs(e/2)/o:0}r(E,"E");function g(i,h){let t=A(i),s=A(h),e=Math.max(t.x1,s.x1),o=Math.max(t.y1,s.y1),a=Math.min(t.x2,s.x2),l=Math.min(t.y2,s.y2),_=Math.max(0,a-e)*Math.max(0,l-o),d=(t.x2-t.x1)*(t.y2-t.y1),u=(s.x2-s.x1)*(s.y2-s.y1),p=d+u-_;return p>0?_/p:0}r(g,"I");function L(i){let h=A(i);return{width:h.x2-h.x1,height:h.y2-h.y1}}r(L,"R");function A(i){let h=[i.topLeft,i.topRight,i.bottomRight,i.bottomLeft];return{x1:Math.min(...h.map(t=>t.x)),y1:Math.min(...h.map(t=>t.y)),x2:Math.max(...h.map(t=>t.x)),y2:Math.max(...h.map(t=>t.y))}}r(A,"D");function S(i){let h=Math.hypot(i.topRight.x-i.topLeft.x,i.topRight.y-i.topLeft.y),t=Math.hypot(i.bottomRight.x-i.bottomLeft.x,i.bottomRight.y-i.bottomLeft.y),s=Math.hypot(i.bottomLeft.x-i.topLeft.x,i.bottomLeft.y-i.topLeft.y),e=Math.hypot(i.bottomRight.x-i.topRight.x,i.bottomRight.y-i.topRight.y),o=(h+t)/2,a=(s+e)/2;return o<=0||a<=0?0:Math.max(o,a)/Math.min(o,a)}r(S,"M");var n,N=(n=class{constructor(h,t={}){this.p=0,this.lastTickAt=null,this.lastQuad=null,this.streak=0,this.format=h,this.t={...I,...t}}reset(){this.p=0,this.lastTickAt=null,this.lastQuad=null,this.streak=0}tick(h){let{quad:t,quality:s,timestampMs:e}=h,o=this.lastTickAt===null?0:Math.max(0,(e-this.lastTickAt)/1e3);this.lastTickAt=e;let a=null;if(t===null)a="dcv1.no_doc";else if(this.format==="ID-3"){let m=L(t),y=m.height>0?m.width/m.height:0;m.width<this.t.ID3_BAND_MIN_WIDTH_FRAC*h.frameWidth?a="dcv1.come_closer":this.edgeClipped(t,h.frameWidth,h.frameHeight)?a="dcv1.fit_document":(y<this.t.ID3_BAND_ASPECT_MIN||y>this.t.ID3_BAND_ASPECT_MAX)&&(a="dcv1.wrong_shape")}else E(t,h.frameWidth,h.frameHeight)<this.t.MIN_AREA_FRAC?a="dcv1.come_closer":this.edgeClipped(t,h.frameWidth,h.frameHeight)?a="dcv1.fit_document":M(this.format,S(t))||(a="dcv1.wrong_shape");let l=a===null,_=x(s.exposure)>=this.t.GUIDE_EXPOSURE,d=x(s.sharpness)>=this.t.GUIDE_SHARPNESS,u=_&&d;if(l&&u&&t!==null){let m=this.lastQuad===null||g(t,this.lastQuad)>=this.t.IOU_STABLE_MIN;this.streak=m?this.streak+1:1}else this.streak=0;this.lastQuad=t;let p=l&&u;this.p=x(this.p+(p?this.t.RISE_PER_S:-this.t.FALL_PER_S)*o);let R=p&&this.streak>=this.t.STABLE_TICKS,f;if(a!==null)f=a;else if(_)d?f="dcv1.hold_still":f="dcv1.steady";else{let m=(c[0]+c[1])/2;f=s.meanLuma<m?"dcv1.more_light":"dcv1.too_bright"}return{at:e,quad:t,plausible:l,p:this.p,guidanceKey:f,ready:R,stableTicks:this.streak}}edgeClipped(h,t,s){let e=this.t.EDGE_CLIP_MARGIN_PX;return[h.topLeft,h.topRight,h.bottomRight,h.bottomLeft].some(o=>o.x<=e||o.y<=e||o.x>=t-e||o.y>=s-e)}},r(n,"d"),n);export{T as a,I as b,E as c,L as d,N as e};