@sekyro/react 0.1.0-rc.6 → 0.1.0-rc.7

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.
@@ -177,6 +177,7 @@ interface StepStrings {
177
177
  "section.contact": string;
178
178
  "section.identity": string;
179
179
  "section.live_photo": string;
180
+ "section.screening": string;
180
181
  "handoff.copied": string;
181
182
  "needsApp.title": string;
182
183
  "needsApp.description": string;
@@ -318,6 +319,9 @@ interface StepStrings {
318
319
  "native.scan.reading"?: string;
319
320
  "native.scan.putDown"?: string;
320
321
  "native.scan.retry"?: string;
322
+ "choice.title"?: string;
323
+ "choice.description"?: string;
324
+ "choice.switch"?: string;
321
325
  "contact.title"?: string;
322
326
  "contact.description"?: string;
323
327
  "contact.phone"?: string;
@@ -177,6 +177,7 @@ interface StepStrings {
177
177
  "section.contact": string;
178
178
  "section.identity": string;
179
179
  "section.live_photo": string;
180
+ "section.screening": string;
180
181
  "handoff.copied": string;
181
182
  "needsApp.title": string;
182
183
  "needsApp.description": string;
@@ -318,6 +319,9 @@ interface StepStrings {
318
319
  "native.scan.reading"?: string;
319
320
  "native.scan.putDown"?: string;
320
321
  "native.scan.retry"?: string;
322
+ "choice.title"?: string;
323
+ "choice.description"?: string;
324
+ "choice.switch"?: string;
321
325
  "contact.title"?: string;
322
326
  "contact.description"?: string;
323
327
  "contact.phone"?: string;
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{c as re,d as se,e as ie}from"../chunk-ADMDZLPM.js";import{a as We}from"../chunk-AMOZXMUP.js";import{a as Ye}from"../chunk-4INDRENU.js";import{a as Qe}from"../chunk-JAUZKPQO.js";import{a as Ue,c as Ke,f as ze}from"../chunk-BRA6F56P.js";import{a as q}from"../chunk-P2LX7BBE.js";import{a as Nt,b as Ct,c as wt,d as Pt,e as _t,f as ee,g as N}from"../chunk-BJJZ4MO5.js";import{b as $e}from"../chunk-65JA6YKG.js";import{a as Je}from"../chunk-3MBJZSJL.js";import{a as z}from"../chunk-Q232JYNO.js";import{a as $,b as U,c as ae,d as qe,g as Ge}from"../chunk-63NUMQST.js";import{a as w,b as le}from"../chunk-BENNJ4GV.js";import{a as i,b as v,h as Oe,i as He,k as ue,l as ne}from"../chunk-4RUZQW5T.js";import{useEffect as xt,useState as Xe}from"react";function me(e){let[t,o]=Xe(()=>e?.currentStep?.()??null),[s,a]=Xe(null);return xt(()=>{if(e===void 0)return;if(typeof e.run!="function"){a(new Error("The step components need @sekyro/web 0.2 or later (Verification.run)."));return}let r=!0,n=e.on("step",l=>{r&&o(l)});return e.run().then(l=>{r&&o(c=>c??l)},l=>{r&&a(l)}),()=>{r=!1,n()}},[e]),{step:t,error:s}}i(me,"useVerificationStep");import{useEffect as It,useId as Et,useRef as Vt,useState as pe}from"react";import{Fragment as je,jsx as g,jsxs as M}from"react/jsx-runtime";var Ze=i((e,t)=>{if(e===void 0)return 0;let o=Date.parse(e)-t;return Number.isFinite(o)?Math.max(0,Math.ceil(o/1e3)):0},"secondsUntil"),Tt=i(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),Lt=["whatsapp","sms"],Rt=new Set(["otp_expired","otp_send_failed","otp_channel_unavailable","otp_destination_not_allowed","otp_destination_unknown","otp_rate_limited"]),W="+222";function At(e){let t=e.replace(/[\s-]/g,""),o=t.startsWith("+")?t.slice(1):t;return/^\d{8,15}$/.test(o)?`+${o}`:null}i(At,"normalizedPhone");function Dt({id:e,label:t,value:o,onChange:s,placeholder:a}){let r=o.startsWith("+")&&!o.startsWith(W),n=r?o:o.slice(o.startsWith(W)?W.length:0).trim(),l=Vt(null);return It(()=>{let c=setTimeout(()=>l.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(c)},[]),M("div",{className:"sekyro-field",children:[g("label",{className:"sekyro-label",htmlFor:e,children:t}),M("div",{className:"sekyro-phone",dir:"ltr",children:[r?null:M("span",{className:"sekyro-phone__dial",id:`${e}-dial`,children:[g("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:"🇲🇷"}),W]}),g("input",{ref:l,id:e,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel",...r?{}:{"aria-describedby":`${e}-dial`},placeholder:a,value:n,onChange:c=>{let d=c.target.value.replace(/[^\d +]/g,"");s(d.startsWith("+")?d:W+d.replace(/\D/g,""))}})]})]})}i(Dt,"PhoneField");function fe({step:e,locale:t,strings:o,className:s,defaultPhone:a=W,onError:r}){let n=N(t,o),{t:l}=n,[c,d]=pe(a),[y,S]=pe(""),[m,k]=pe(!1),[h,V]=pe(null),P=e.phase==="verify",T=Ye(P),R=Et(),b=i(async _=>{k(!0),V(null);try{await _()}catch(L){V(q(L,n.strings)),r?.(L)}finally{k(!1)}},"run"),u=Lt.filter(_=>(e.channels??[]).includes(_)),f=At(c),x=!e.needsPhone||f!==null,C=i((_,L=!1)=>{b(()=>e.send({...e.needsPhone&&(!L||c!==a)?{phone:f??c}:{},..._!==void 0?{channel:_}:{}}))},"send"),De=i(_=>{b(()=>e.verify(_))},"submitCode"),Be=i(_=>{_.preventDefault(),P?De(y):u.length<=1&&x&&C(u[0])},"onSubmit"),Me=Ze(e.codeExpiresAt,T),j=Ze(e.resendAvailableAt,T),oe=P&&e.codeExpiresAt!==void 0&&Me===0,de=i(_=>l(_==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),[ht,bt]=l("otp.sentTo",{channel:de(e.channel)}).split("{number}"),vt=e.reason==="otp_mismatch"?M(w,{tone:"danger",children:[g("span",{children:l("otp.reason_otp_mismatch")}),g("span",{children:le(n,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&Rt.has(e.reason)?g(w,{tone:"warning",children:g("span",{children:l(`otp.reason_${e.reason}`)})}):null,Fe=M(je,{children:[vt,h!==null?g(w,{tone:"danger",children:g("span",{children:l(h)})}):null]});if(P){let _=u.length===0;return M("form",{className:`sekyro-step sekyro-otp${s?` ${s}`:""}`,"aria-labelledby":R,onSubmit:Be,noValidate:!0,children:[g($,{id:R,title:l("otp.verifyTitle"),lead:M(je,{children:[ht,g("bdi",{dir:"ltr",className:"sekyro-mono",children:e.sentToMasked}),bt]})}),Fe,M("div",{className:"sekyro-field",children:[g("label",{className:"sekyro-label",htmlFor:`${R}-code`,children:l("otp.codeLabel")}),g(We,{id:`${R}-code`,value:y,invalid:e.reason==="otp_mismatch",onChange:L=>{S(L),L.length===6&&y.length!==6&&!m&&!e.attemptsExhausted&&De(L)}}),g("span",{className:`sekyro-help sekyro-otp-expiry${oe?" is-danger":""}`,"aria-hidden":!oe||void 0,children:oe?l("otp.expired"):l("otp.expiresIn",{time:Tt(Me)})})]}),g("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:oe?l("otp.expired"):""}),M(U,{children:[g(v,{type:"submit",full:!0,disabled:m||y.length!==6||e.attemptsExhausted,"aria-busy":m||void 0,children:l("otp.verify")}),_?g("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:m||j>0,onClick:()=>C(void 0,!0),children:j>0?l("otp.resendIn",{seconds:j}):l("otp.resend")}):j>0?g("p",{className:"sekyro-resend is-waiting",children:l("otp.resendIn",{seconds:j})}):g("div",{className:"sekyro-resend-row",children:u.map(L=>g("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:m,onClick:()=>C(L,!0),children:l("otp.resendBy",{channel:de(L)})},L))})]})]})}return M("form",{className:`sekyro-step sekyro-otp${s?` ${s}`:""}`,"aria-labelledby":R,onSubmit:Be,noValidate:!0,children:[g($,{id:R,title:l("otp.sendTitle"),lead:l("otp.sendDescription")}),Fe,e.needsPhone?g(Dt,{id:`${R}-phone`,label:l("otp.phoneLabel"),value:c,onChange:d,placeholder:l("otp.phonePlaceholder").replace(W,"").trim()}):g("p",{className:"sekyro-text-muted",children:l("otp.prefilledNotice")}),g(U,{children:u.length>0?M("div",{className:"sekyro-actions__group",role:"group","aria-label":l("otp.chooseChannel"),children:[g("p",{className:"sekyro-label","aria-hidden":"true",children:l("otp.chooseChannel")}),u.map((_,L)=>g(v,{kind:L===0?"primary":"ghost",full:!0,disabled:m||!x,"aria-busy":L===0&&m||void 0,onClick:()=>C(_),children:l("otp.sendBy",{channel:de(_)})},_))]}):g(v,{type:"submit",full:!0,disabled:m||!x,"aria-busy":m||void 0,children:l("otp.send")})})]})}i(fe,"PhoneOtpStep");import{lazy as Mt,Suspense as Ft,useMemo as Ot,useState as Ht}from"react";import{Component as Bt}from"react";var ye=class ye extends Bt{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(ye,"LoadBoundary");var O=ye;import{jsx as G,jsxs as Ut}from"react/jsx-runtime";var $t={load:i(()=>import("../email-otp-view-TYSBCGUY.js"),"load")};function ke({locale:e,strings:t,...o}){let s=N(e,t),[a,r]=Ht(0),n=Ot(()=>Mt(()=>$t.load().then(c=>({default:c.EmailOtpView}))),[a]),l=Ut(w,{tone:"danger",children:[G("span",{children:s.t("errors.network_error")}),G(v,{kind:"ghost",onClick:()=>r(c=>c+1),children:s.t("common.retry")})]});return G(O,{fallback:l,children:G(Ft,{fallback:G("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:G(n,{...o,i18n:s})})},a)}i(ke,"EmailOtpStep");import{lazy as Kt,Suspense as zt,useMemo as Wt,useState as qt}from"react";import{jsx as Y,jsxs as Yt}from"react/jsx-runtime";var Gt={load:i(()=>import("../eid-view-WIK6KUTY.js"),"load")};function Se({locale:e,strings:t,...o}){let s=N(e,t),[a,r]=qt(0),n=Wt(()=>Kt(()=>Gt.load().then(c=>({default:c.EidView}))),[a]),l=Yt(w,{tone:"danger",children:[Y("span",{children:s.t("errors.network_error")}),Y(v,{kind:"ghost",onClick:()=>r(c=>c+1),children:s.t("common.retry")})]});return Y(O,{fallback:l,children:Y(zt,{fallback:Y("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:Y(n,{...o,i18n:s})})},a)}i(Se,"EidStep");import{useMemo as et,useState as tt}from"react";import{lazy as Qt,Suspense as Jt,useMemo as Xt,useState as Zt}from"react";import{jsx as Q,jsxs as eo}from"react/jsx-runtime";var jt={load:i(()=>import("../flow-views-PCBR5GYS.js"),"load")};function F({view:e,i18n:t,quiet:o,...s}){let[a,r]=Zt(0),n=Xt(()=>Qt(()=>jt.load().then(c=>({default:c[e]}))),[e,a]),l=eo(w,{tone:"danger",children:[Q("span",{children:t.t("errors.network_error")}),Q(v,{kind:"ghost",onClick:()=>r(c=>c+1),children:t.t("common.retry")})]});return Q(O,{fallback:l,children:Q(Jt,{fallback:o===!0?null:Q("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:t.t("common.loading")}),children:Q(n,{...s,i18n:t})})},a)}i(F,"Flow");import{jsx as ge,jsxs as to}from"react/jsx-runtime";function he({step:e,locale:t,strings:o,className:s,onError:a}){let r=N(t,o),[n,l]=tt(!1),[c,d]=tt(!1),y=et(()=>e.options.filter(h=>h!=="document_chip"),[e.options]),S=e.nationalEid?.providerName,m=S?r.t("method.national_eid",{provider:S}):r.t("method.national_eidGeneric"),k=et(()=>h=>r.strings[h]??"",[r]);return to("div",{className:s,children:[ge($e,{value:k,children:ge(Ke,{choice:{available:!0,selected:null,options:y},busy:n,failed:c,focus:!0,eidLabel:m,onSelect:h=>{l(!0),d(!1),e.select(h).then(()=>l(!1),V=>{l(!1),d(!0),a?.(V)})}})}),e.nationalEid?.afterPass==="continue"&&y.includes("national_eid")?ge(F,{view:"EidContinueHint",i18n:r,provider:S,quiet:!0}):null]})}i(he,"MethodChoice");import{isValidNni as oo,normalizeNni as ot}from"@sekyro/web";import{useId as no,useState as be}from"react";import{Fragment as ro,jsx as I,jsxs as J}from"react/jsx-runtime";function ve({step:e,locale:t,strings:o,className:s,onError:a}){let r=N(t,o),{t:n}=r,[l,c]=be(""),[d,y]=be(!1),[S,m]=be(null),k=no(),h=e.attemptsExhausted,V=i(async x=>{y(!0),m(null);try{await x()}catch(C){m(q(C,r.strings)),a?.(C)}finally{y(!1)}},"run"),P=i(x=>{if(x.preventDefault(),e.source!=="typed"){V(()=>e.confirm());return}let C=ot(l);if(!/^\d{10}$/.test(C))return m("population.invalid");if(!oo(C))return m("population.reason_nni_invalid");V(()=>e.submitNni(C))},"onSubmit"),T=le(r,e.attemptsRemaining,h),R=J(ro,{children:[e.reason==="registry_unavailable"?J(w,{tone:"warning",children:[I("span",{children:n("population.reason_registry_unavailable")}),I("span",{children:T})]}):null,e.reason==="nni_not_found"&&e.canUseDocument?J(w,{tone:"warning",children:[I("span",{children:n("population.reason_nni_not_found_or_document")}),I("span",{children:T}),I(v,{kind:"ghost",disabled:d,onClick:()=>{V(()=>e.useDocument())},children:n("population.useDocument")})]}):null,e.reason==="nni_not_found"&&!e.canUseDocument||e.reason==="nni_invalid"?J(w,{tone:"danger",children:[I("span",{children:n(e.reason==="nni_not_found"?"population.reason_nni_not_found":"population.reason_nni_invalid")}),I("span",{children:T})]}):null,h&&e.reason===void 0?I(w,{tone:"danger",children:I("span",{children:T})}):null,S!==null?I(w,{tone:"danger",children:I("span",{children:n(S)})}):null]}),[b,u,f]=e.source==="document"?["population.fromDocument.title","population.fromDocument.description","population.fromDocument.continue"]:e.source==="bound"?["session.steps.population.title","population.bound.description","population.bound.confirm"]:e.recheck?["population.recheck.title","population.recheck.description","population.submit"]:["session.steps.population.title","session.steps.population.description","population.submit"];return J("form",{className:`sekyro-step${s?` ${s}`:""}`,"aria-labelledby":k,onSubmit:P,noValidate:!0,children:[I($,{id:k,title:n(b),lead:n(u)}),R,e.source==="typed"?J("div",{className:"sekyro-field",children:[I("label",{className:"sekyro-label",htmlFor:`${k}-nni`,children:n("population.label")}),I("input",{id:`${k}-nni`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:n("population.placeholder"),value:l,"aria-describedby":`${k}-nni-help`,"aria-invalid":S==="population.invalid"||S==="population.reason_nni_invalid"||void 0,onChange:x=>{m(null),c(ot(x.target.value).replace(/\D/g,"").slice(0,10))}}),I("span",{id:`${k}-nni-help`,className:"sekyro-help",children:n("population.helper")})]}):null,I(U,{children:h?null:I(v,{type:"submit",full:!0,disabled:d,"aria-busy":d||void 0,children:n(f)})})]})}i(ve,"NniEntry");import{acceptedIssuers as co,acceptedTypesFor as uo,warmDocumentCapture as mo}from"@sekyro/web";import{lazy as fo,Suspense as yo,useEffect as ko,useMemo as So,useState as at}from"react";import{acceptedIssuers as so,acceptedTypesFor as Ne}from"@sekyro/web";import{useEffect as nt,useId as io,useMemo as rt,useState as Ce}from"react";import{jsx as E,jsxs as X}from"react/jsx-runtime";var st=i(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),ao=i(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),lo=220;function po(e,t){let o=null;try{o=new Intl.DisplayNames([e],{type:"region"})}catch{}let s=t.map(r=>({code:r,name:o?.of(r)??r})),a=new Intl.Collator(e);return s.sort((r,n)=>r.code==="MR"?-1:n.code==="MR"?1:a.compare(r.name,n.name))}i(po,"countryNames");function it({step:e,i18n:t,issuer:o,onPicked:s}){let{t:a,locale:r}=t,n=rt(()=>so(e.documents),[e.documents]),l=rt(()=>po(r,n),[r,n]),c=n.length===1?n[0]:null,[d,y]=Ce(o??c),[S,m]=Ce(""),[k,h]=Ce(null),V=io(),P=c===null?[]:Ne(e.documents,c),T=c!==null&&P.length===1?P[0]:null;nt(()=>{c!==null&&T!==null&&e.selectDocument(c,T)},[c,T]);let R=i((f,x)=>{e.selectDocument(f,x),s?.()},"pick"),b=i(f=>{let x=Ne(e.documents,f);x.length===1?R(f,x[0]):y(f)},"chooseIssuer");if(nt(()=>{if(k===null||d===null)return;let f=setTimeout(()=>R(d,k),lo);return()=>clearTimeout(f)},[k]),T!==null)return null;if(d===null){let f=st(S.trim()),x=f===""?l:l.filter(C=>st(C.name).includes(f)||C.code.toLowerCase()===f);return X("section",{className:"sekyro-step",children:[E($,{title:a("doc.countryTitle"),lead:a("doc.pickDescription")}),X("div",{className:"sekyro-field",children:[E("label",{className:"sekyro-label",htmlFor:V,children:a("doc.countryLabel")}),E("input",{id:V,type:"search",className:"sekyro-input",placeholder:a("doc.countrySearch"),value:S,onChange:C=>m(C.target.value)})]}),x.length===0?E("p",{className:"sekyro-text-muted",children:a("doc.noCountryMatch")}):E("ul",{className:"sekyro-rows",children:x.map(C=>E("li",{children:X("button",{type:"button",className:"sekyro-row-btn",onClick:()=>b(C.code),children:[E("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:ao(C.code)}),C.name]})},C.code))}),E(U,{children:null})]})}let u=Ne(e.documents,d);return X("section",{className:"sekyro-step",children:[E($,{title:a("doc.pickTitle"),lead:a("native.doc.holdIt")}),E("div",{className:"sekyro-choices",children:u.map(f=>X("button",{type:"button",className:"sekyro-card","aria-pressed":k===f,disabled:k!==null&&k!==f,onClick:()=>h(f),children:[E(z,{name:f==="passport"?"passport":"card"}),X("span",{className:"sekyro-card__body",children:[E("span",{className:"sekyro-card__title",children:a(`doc.type.${f}`)}),E("span",{className:"sekyro-card__sub",children:a(`doc.sub.${f}`)})]}),E("span",{className:"sekyro-radio","aria-hidden":"true"})]},f))}),n.length>1?E("button",{type:"button",className:"sekyro-link",onClick:()=>{y(null),h(null)},children:a("native.doc.changeCountry")}):null,E(U,{children:null})]})}i(it,"DocumentPicker");import{jsx as K,jsxs as ho}from"react/jsx-runtime";var go={load:i(()=>import("../document-capture-view-SKFDM4AQ.js"),"load")};function we({step:e,locale:t,strings:o,className:s,liveMrz:a}){let r=N(t,o),[n,l]=at(0),[c,d]=at(null),y=co(e.documents).length>1,S=e.issuer!==null&&uo(e.documents,e.issuer).length>1,m=So(()=>fo(()=>go.load().then(h=>({default:h.DocumentCaptureView}))),[n]);ko(()=>{mo()},[]);let k=ho(w,{tone:"danger",children:[K("span",{children:r.t("errors.network_error")}),K(v,{kind:"ghost",onClick:()=>l(h=>h+1),children:r.t("doc.retryCamera")})]});return K("div",{className:s,children:e.documentType===null||e.issuer===null||c!==null?K(it,{step:e,i18n:r,...c==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>d(null)}):K(O,{fallback:k,children:K(yo,{fallback:K("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:K(m,{step:e,i18n:r,...a!==void 0?{liveMrz:a}:{},...y?{onChangeCountry:i(()=>d("country"),"onChangeCountry")}:{},...S?{onChangeDocument:i(()=>d("document"),"onChangeDocument")}:{}})})},n)})}i(we,"DocumentCapture");import{warmPortraitCapture as bo}from"@sekyro/web";import{Component as vo,lazy as No,Suspense as Co,useEffect as wo,useMemo as Po,useState as _o}from"react";import{jsx as A,jsxs as _e}from"react/jsx-runtime";var xo={load:i(()=>import("../portrait-capture-view-HYOEOAF4.js"),"load")},Ie=class Ie extends vo{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(Ie,"LoadBoundary");var Pe=Ie;function Io({step:e,i18n:t}){let{t:o}=t,s=ne();return _e("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[A("h2",{ref:s,tabIndex:-1,className:"sekyro-text-body",children:o(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?A("p",{className:"sekyro-text-muted",children:o("portrait.reviewDescription")}):null,e.uploadFailed?_e(w,{tone:"danger",children:[A("span",{children:o("portrait.uploadFailed")}),A(v,{kind:"ghost",onClick:()=>{e.resubmit()},children:o("portrait.sendAgain")})]}):A("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:o("portrait.matching")})]})}i(Io,"MatchPhase");function xe({step:e,locale:t,strings:o,className:s,assetBaseUrl:a}){let r=N(t,o),[n,l]=_o(0),c=Po(()=>No(()=>xo.load().then(y=>({default:y.PortraitCaptureView}))),[n]);if(wo(()=>{e.phase==="capture"&&bo()},[e.phase]),e.phase==="match")return A("div",{className:s,children:A(Io,{step:e,i18n:r})});let d=_e(w,{tone:"danger",children:[A("span",{children:r.t("errors.network_error")}),A(v,{kind:"ghost",onClick:()=>l(y=>y+1),children:r.t("portrait.retryCamera")})]});return A("div",{className:s,children:A(Pe,{fallback:d,children:A(Co,{fallback:A("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:A(c,{step:e,i18n:r,...a!==void 0?{assetBaseUrl:a}:{}})})},n)})}i(xe,"PortraitCapture");import{useCallback as Te,useEffect as kt,useId as zo,useRef as Le,useState as ce}from"react";var D={light:{brand:"#0d3b66",brandFg:"#ffffff",fg:"#13141f",fgMuted:"#4e5270",bg:"#f6f7fb",surface:"#ffffff",ring:"#0d3b66",danger:"#ca0f07",success:"#007a5e",warning:"#735003"},dark:{brand:"#6ea2d3",brandFg:"#051a2e",fg:"#f6f7fb",fgMuted:"#cbcedc",bg:"#13141f",surface:"#1d1e2c",ring:"#6ea2d3",danger:"#ff7c7c",success:"#00c897",warning:"#ffd98a"},roles:{light:{brandSoft:"#eaf2fa",line:"#cbcedc",lineSubtle:"#e2e4ee",lineStrong:"#8c91a9",sunken:"#eeeff5",fgSubtle:"#686d8a"},dark:{brandSoft:"#092b4b",line:"#4e5270",lineSubtle:"#2b2d40",lineStrong:"#686d8a",sunken:"#0b0c14",fgSubtle:"#8c91a9"}},stage:"#051a2e",stageAccent:"#69dfef",radius:"10px",radiusLg:"16px",font:'"Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontDisplay:'"Sekyro Geist", Geist, "Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontArabic:'"Sekyro Cairo", Cairo, "Sekyro Inter", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif'};import{useId as Eo,useState as Vo}from"react";import{jsx as Ee,jsxs as lt}from"react/jsx-runtime";var To=["intro","data","processing","sharing","retention"];function pt({i18n:e}){let{t}=e,[o,s]=Vo(!1),a=Eo(),[r,n=""]=t("consent.short").split("{terms}");return lt("section",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-consent",children:[lt("p",{className:"sekyro-text-muted",children:[r,Ee("button",{type:"button",className:"sekyro-link","aria-expanded":o,"aria-controls":a,onClick:()=>s(l=>!l),children:t("consent.termsLink")}),n]}),Ee("div",{id:a,hidden:!o,className:"sekyro-stack sekyro-stack--1 sekyro-text-muted","data-testid":"sekyro-consent-terms",children:To.map(l=>Ee("p",{children:t(`consent.terms.${l}`)},l))})]})}i(pt,"ConsentNotice");function ct(e){let t=e.trim().split(/\s+/).filter(s=>s!=="");return(t.length>=2?[t[0],t[1]].map(s=>Array.from(s??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}i(ct,"initials");import{useSyncExternalStore as Lo}from"react";var ut=i(e=>({colors:{...e?D.dark:D.light},radius:D.radiusLg,fontFamily:D.font}),"brandTheme"),Ur=ut(!1);function mt(e,t,o){let s=re(e);if(o&&s.colors!==void 0){let{brand:a,brandFg:r}=s.colors;a!==void 0&&Bo(a,D.dark.bg)>=3?s.colors={brand:a,ring:a,...r!==void 0?{brandFg:r}:{}}:delete s.colors}return se(ut(o),s,t)}i(mt,"verificationTheme");function ft(e){let t=Lo(Do,Ao,()=>!1);return e==="dark"||e==="system"&&t}i(ft,"useDarkScheme");var Ro="(prefers-color-scheme: dark)",yt=i(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Ro):null,"media"),Ao=i(()=>yt()?.matches??!1,"prefersDark");function Do(e){let t=yt();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}i(Do,"subscribe");function Bo(e,t){let[o,s]=[dt(e),dt(t)];return(Math.max(o,s)+.05)/(Math.min(o,s)+.05)}i(Bo,"contrast");function dt(e){let t=[1,3,5].map(o=>{let s=Number.parseInt(e.slice(o,o+2),16)/255;return s<=.03928?s/12.92:((s+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}i(dt,"luminance");import{useEffect as Mo,useId as Fo,useState as Oo}from"react";import{jsx as B,jsxs as te}from"react/jsx-runtime";var Ho=new Set(["document_nni_mismatch","name_mismatch","birth_date_mismatch"]),$o={approved:"M6.5 12.5l3.6 3.6 7.4-8.2",review:"M12 7v5l3.2 2",expired:"M8 5h8M8 19h8M9 5c0 4 6 5 6 7s-6 3-6 7M15 5c0 4-6 5-6 7s6 3 6 7",rejected:"M8 8l8 8M16 8l-8 8"};function Uo({outcome:e}){return te("svg",{className:`sekyro-outcome sekyro-outcome--${e}`,viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[B("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"57",pathLength:"1"}),B("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),B("path",{className:"sekyro-outcome__glyph",d:$o[e],pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]})}i(Uo,"OutcomeMark");function Ko({label:e,id:t,copied:o}){let[s,a]=Oo(!1);return Mo(()=>{if(!s)return;let r=setTimeout(()=>a(!1),1600);return()=>clearTimeout(r)},[s]),te("button",{type:"button",className:`sekyro-reference${s?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[B("span",{"aria-live":"polite",children:s?o:e}),B("bdi",{dir:"ltr",children:t}),B(z,{name:"copy"})]})}i(Ko,"ReferenceLine");function Ve({step:e,locale:t,strings:o,className:s,onClose:a}){let r=N(t,o),{t:n}=r,l=Fo(),c=ne(),d=e.context.orgName,y=e.display==="approved"?"approved":e.display==="review"?"review":e.display==="expired"?"expired":"rejected",S;switch(e.display){case"policy_stop":{let m=e.failureReason??"";if(Ho.has(m))S=n("session.result.detailsMismatch",{org:d});else if(m==="device_velocity_exceeded")S=n("session.result.deviceVelocity",{org:d});else{let k=Oe(m);S=k!==null?n(k,{org:d}):n("session.result.rejected.description")}break}case"cooldown":{let m=He(r.locale,e.retryAfter);S=m!==null?n(m.key,{time:m.time}):n("reasons.device_cooldown");break}case"platform_unsupported":S=n("result.platform_unsupported");break;case"attempts_exhausted":S=n("common.noAttemptsLeft");break;default:S=d!==""?n(`native.result.${y}`,{org:d}):n(`session.result.${y}.description`)}return te("section",{className:`sekyro-result${s?` ${s}`:""}`,"aria-labelledby":l,"data-testid":"sekyro-result",children:[te("div",{className:"sekyro-result__body",children:[B(Uo,{outcome:e.display==="cooldown"?"review":y}),te("div",{className:"sekyro-heading",children:[B("h2",{id:l,ref:c,tabIndex:-1,className:"sekyro-text-body",children:n(`session.result.${y}.title`)}),B("p",{className:"sekyro-text-muted",children:S})]}),B(Ko,{label:n("result.referenceLabel"),id:e.context.sessionId,copied:n("native.result.copied")})]}),a!==void 0?B("div",{className:"sekyro-actions",children:B(v,{full:!0,onClick:a,children:d!==""?n("native.result.back",{org:d}):n("native.close")})}):null]})}i(Ve,"VerificationResultScreen");import{Fragment as St,jsx as p,jsxs as H}from"react/jsx-runtime";function Wo(e,t){let o=t?D.dark:D.light,s=t?D.roles.dark:D.roles.light,a=e.colors??{},r={},n=a.fg===o.fg&&a.surface===o.surface;return a.brand===o.brand&&a.surface===o.surface&&(r["--sekyro-color-brand-soft"]=s.brandSoft),n&&(r["--sekyro-color-line"]=s.line,r["--sekyro-color-line-subtle"]=s.lineSubtle,r["--sekyro-color-line-strong"]=s.lineStrong,r["--sekyro-color-sunken"]=s.sunken),a.fgMuted===o.fgMuted&&a.surface===o.surface&&(r["--sekyro-color-fg-subtle"]=s.fgSubtle),e.fontFamily===D.font&&(r["--sekyro-font-display"]=D.fontDisplay),r}i(Wo,"flowRoles");function Re(e){let{verification:t,locale:o,strings:s,onStep:a,onResult:r}=e,{step:n,error:l}=me(t);kt(()=>{n!==null&&a?.(n)},[n,a]),kt(()=>r===void 0?void 0:t.on("result",r),[t,r]);let c=ft(e.colorScheme??"light"),d=mt(n?.context.branding,e.theme,c),[y,S]=ce(!1),m=`sekyro-verification${c?" sekyro-verification--dark":""}${y?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,k=Le(e.onClose);k.current=e.onClose;let h=Le(n);h.current=n;let V=Te(()=>{let P=h.current;k.current?.(P?.kind==="result"?{reason:"finished",result:P.result}:{reason:"cancelled"})},[]);return p(ie,{theme:d,className:m,children:p(ee,{locale:o,...s!==void 0?{strings:s}:{},children:p("div",{dir:e.dir??(o==="ar"?"rtl":"ltr"),lang:o,className:"sekyro-flow",style:Wo(d,c),children:p(qe.Provider,{value:S,children:p(ae.Provider,{value:e.onClose!==void 0?V:void 0,children:p(qo,{...e,step:n,error:l,immersive:y})})})})})})}i(Re,"SekyroVerification");function qo(e){let{step:t,error:o,slots:s,immersive:a}=e,r=N(),{t:n}=r,[l,c]=ce(!1),[d,y]=ce(0),S=Te((u,f)=>p(Qe,{start:u,context:f}),[]),m=Le(""),k=e.livenessProps?.slots?.stageOverlay,h=Te(u=>(u.guidance!==""&&!u.coached&&(m.current=u.guidance),p(Je,{testId:"sekyro-capture-stage",video:p("video",{ref:u.videoRef,playsInline:!0,muted:!0,className:"sekyro-lm-video sekyro-fc-video","aria-hidden":"true","data-testid":"sekyro-capture-video"}),instruction:u.guidance!==""?u.guidance:m.current,note:u.note,busy:u.settled,progress:u.phase==="seeking"||u.phase==="aligning"?u.progress:1,still:u.still,live:u.live,closeLabel:n("native.close"),overlay:k?.(u.videoRef),...u.settled?{}:{onClose:i(()=>y(f=>f+1),"onClose")}})),[n,k]),V=zo();if(o!==null)return p(ue,{tone:"danger",children:p("span",{children:n(q(o,r.strings))})});if(t===null)return p("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:n("common.loading")});let{context:P}=t,T=i(u=>{c(!0),u().finally(()=>c(!1))},"refresh"),R=s?.header??p(Yo,{context:P,headerId:V,end:s?.headerEnd}),b;switch(t.kind){case"phone_otp":b=p(fe,{step:t});break;case"email_otp":b=p(ke,{step:t});break;case"method":b=p(he,{step:t});break;case"registry":b=p(ve,{step:t});break;case"document":b=p(we,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let u=e.livenessProps?.slots?.intro,f={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:u??S},...d>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,...e.dir!==void 0?{dir:e.dir}:{},strings:r.strings,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{},...e.voice!==void 0?{voice:e.voice}:{},...e.onLivenessCaptured!==void 0?{onCaptured:e.onLivenessCaptured}:{}};b=p(Ue.Provider,{value:h,children:t.instructions==="icao"||t.livePhoto?.icao===!0?p(F,{view:"LivePhotoLiveness",i18n:r,step:t,livenessProps:f,sekyroIntro:u===void 0},d):p(ze,{...f},d)});break}case"portrait":b=H(St,{children:[t.retakeOnly?p(F,{view:"PortraitRetakeNotice",i18n:r,quiet:!0}):null,p(xe,{step:t,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":b=p(F,{view:"ContactChoiceView",i18n:r,step:t});break;case"identity_summary":b=p(F,{view:"IdentitySummaryView",i18n:r,step:t});break;case"mobile_required":b=e.handoffUrl!==void 0?p(F,{view:"HandoffView",i18n:r,url:e.handoffUrl,refresh:t.refresh}):H(ue,{tone:"info",children:[p("strong",{children:n("handoff.title")}),p("span",{children:n("reasons.mobile_required")}),p(v,{kind:"ghost",disabled:l,onClick:()=>T(t.refresh),children:n("common.refresh")})]});break;case"processing":b=H("section",{className:"sekyro-stack sekyro-stack--1",role:"status","aria-live":"polite",children:[p("h2",{className:"sekyro-text-body",children:n("session.processing.title")}),p("p",{className:"sekyro-text-muted",children:n("session.processing.description")}),t.stalled?p(v,{kind:"ghost",disabled:l,onClick:()=>T(t.refresh),children:n("common.refresh")}):null]});break;case"eid":b=p(Se,{step:t});break;case"unsupported":{let u=t.reason==="platform_unsupported";b=H("section",{className:"sekyro-stack sekyro-stack--1",children:[p("h2",{className:"sekyro-text-body",children:n(u?"needsApp.title":"unsupported.title")}),p("p",{children:u?P.orgName!==""?n("needsApp.description",{org:P.orgName}):n("needsApp.descriptionNoOrg"):n("unsupported.description",{org:P.orgName})})]});break}case"result":b=s?.result?.(t)??p(Go,{step:t});break;default:{let u=t;b=null}}return H(St,{children:[a?null:R,!a&&t.kind!=="result"&&P.sections.length>1?p(Qo,{sections:P.sections,current:t.section,i18n:r}):null,!a&&!P.consentRecorded&&t.kind!=="result"?p(pt,{i18n:r}):null,p(Ge,{pageKey:t.key,children:b}),!a&&(t.kind==="phone_otp"||t.kind==="email_otp")&&t.canSwitch?p(F,{view:"ContactSwitch",i18n:r,step:t,quiet:!0},t.key):null,a?null:s?.footer!==void 0?s.footer:H("p",{className:"sekyro-footer",children:[p(z,{name:"lock"}),n("shell.verifiedBy")]})]})}i(qo,"Body");function Go({step:e}){return p(ae.Consumer,{children:t=>p(Ve,{step:e,...t!==void 0?{onClose:t}:{}})})}i(Go,"ResultPage");function Yo({context:e,headerId:t,end:o}){let{t:s}=N(),[a,r]=ce(!1),n=a?void 0:e.branding?.logoUrl,l=e.orgName!==""?e.orgName:s(e.returning?"returning.title":"session.title");return H("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:[H("div",{className:"sekyro-org",children:[p("span",{className:"sekyro-org__tile","aria-hidden":"true",children:n!==void 0?p("img",{className:"sekyro-org__logo",src:n,alt:"",onError:()=>r(!0)}):ct(e.orgName)}),H("div",{className:"sekyro-org__text",children:[p("h1",{id:t,className:"sekyro-org__name",children:l}),p("p",{className:"sekyro-org__sub",children:s("shell.subtitle")})]}),o!=null?p("div",{className:"sekyro-org__end",children:o}):null,p(ae.Consumer,{children:c=>c!==void 0?p("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":s("native.close"),onClick:c,children:p(z,{name:"close"})}):null})]}),e.returning?p("p",{className:"sekyro-text-muted",children:s("returning.description")}):null]})}i(Yo,"OrgHeader");function Qo({sections:e,current:t,i18n:o}){let s=t===null?-1:e.indexOf(t);return p("ol",{className:"sekyro-progress__bars","aria-label":o.t("session.progressLabel"),children:e.map((a,r)=>p("li",{className:`sekyro-progress__bar${r<s?" is-done":r===s?" is-current":""}`,...r===s?{"aria-current":"step"}:{},children:p("span",{className:"sekyro-visually-hidden",children:o.strings[`section.${a}`]??a})},a))})}i(Qo,"SectionProgress");import{useEffect as Xo,useState as gt}from"react";var Jo=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function Ae(e){let t=e??(typeof navigator>"u"?"":String(navigator.userAgent??""));return Jo.test(t)}i(Ae,"isInAppBrowser");import{jsx as Z}from"react/jsx-runtime";function Zo(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}i(Zo,"pageUrl");function jo({hostedUrl:e,inAppBrowser:t,...o}){let[s,a]=gt(t===!0);Xo(()=>{t===void 0&&Ae()&&a(!0)},[t]);let[r,n]=gt(!1),l=o.handoffUrl??e??Zo();return s&&!r?Z(ie,{theme:se(re(void 0),o.theme),...o.className!==void 0?{className:o.className}:{},children:Z(ee,{locale:o.locale,...o.strings!==void 0?{strings:o.strings}:{},children:Z("div",{dir:o.dir??(o.locale==="ar"?"rtl":"ltr"),lang:o.locale,className:"sekyro-stack sekyro-stack--4",children:Z(en,{url:l,onContinue:()=>n(!0)})})})}):Z(Re,{...o,...l!==""?{handoffUrl:l}:{}})}i(jo,"SekyroFlow");function en({url:e,onContinue:t}){let o=N();return Z(F,{view:"InAppBrowserPrompt",i18n:o,url:e,onContinue:t})}i(en,"Prompt");export{we as DocumentCapture,Se as EidStep,ke as EmailOtpStep,he as MethodChoice,ve as NniEntry,fe as PhoneOtpStep,xe as PortraitCapture,jo as SekyroFlow,Re as SekyroVerification,ee as StepI18nProvider,Ve as VerificationResultScreen,Nt as arSteps,Ct as enSteps,Pt as formatTemplate,wt as frSteps,Ae as isInAppBrowser,_t as resolveSekyroStrings,N as useStepI18n,me as useVerificationStep};
2
+ import{c as ie,d as ae,e as le}from"../chunk-ADMDZLPM.js";import{a as ze}from"../chunk-AMOZXMUP.js";import{a as Ge}from"../chunk-4INDRENU.js";import{a as Ye,b as Qe,c as Je,d as Xe}from"../chunk-B43EDVOK.js";import{a as $e,c as Ue,f as Ke}from"../chunk-QZAPVO6F.js";import{a as G}from"../chunk-P2LX7BBE.js";import{a as Nt,b as Ct,c as wt,d as Pt,e as xt,f as te,g as b}from"../chunk-5SVCGLYS.js";import"../chunk-65JA6YKG.js";import{a as Ze}from"../chunk-3MBJZSJL.js";import{a as $}from"../chunk-Q232JYNO.js";import{a as K,b as z,c as ce,d as We,g as qe}from"../chunk-63NUMQST.js";import{a as v,b as pe}from"../chunk-BENNJ4GV.js";import{a as i,b as h,h as Fe,i as He,k as me,l as se}from"../chunk-4RUZQW5T.js";import{useEffect as _t,useState as je}from"react";function fe(e){let[t,n]=je(()=>e?.currentStep?.()??null),[s,a]=je(null);return _t(()=>{if(e===void 0)return;if(typeof e.run!="function"){a(new Error("The step components need @sekyro/web 0.2 or later (Verification.run)."));return}let r=!0,o=e.on("step",l=>{r&&n(l)});return e.run().then(l=>{r&&n(p=>p??l)},l=>{r&&a(l)}),()=>{r=!1,o()}},[e]),{step:t,error:s}}i(fe,"useVerificationStep");import{useEffect as It,useId as Et,useRef as Vt,useState as de}from"react";import{Fragment as tt,jsx as g,jsxs as B}from"react/jsx-runtime";var et=i((e,t)=>{if(e===void 0)return 0;let n=Date.parse(e)-t;return Number.isFinite(n)?Math.max(0,Math.ceil(n/1e3)):0},"secondsUntil"),Lt=i(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),Tt=["whatsapp","sms"],Rt=new Set(["otp_expired","otp_send_failed","otp_channel_unavailable","otp_destination_not_allowed","otp_destination_unknown","otp_rate_limited"]),q="+222";function At(e){let t=e.replace(/[\s-]/g,""),n=t.startsWith("+")?t.slice(1):t;return/^\d{8,15}$/.test(n)?`+${n}`:null}i(At,"normalizedPhone");function Dt({id:e,label:t,value:n,onChange:s,placeholder:a}){let r=n.startsWith("+")&&!n.startsWith(q),o=r?n:n.slice(n.startsWith(q)?q.length:0).trim(),l=Vt(null);return It(()=>{let p=setTimeout(()=>l.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(p)},[]),B("div",{className:"sekyro-field",children:[g("label",{className:"sekyro-label",htmlFor:e,children:t}),B("div",{className:"sekyro-phone",dir:"ltr",children:[r?null:B("span",{className:"sekyro-phone__dial",id:`${e}-dial`,children:[g("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:"🇲🇷"}),q]}),g("input",{ref:l,id:e,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel",...r?{}:{"aria-describedby":`${e}-dial`},placeholder:a,value:o,onChange:p=>{let m=p.target.value.replace(/[^\d +]/g,"");s(m.startsWith("+")?m:q+m.replace(/\D/g,""))}})]})]})}i(Dt,"PhoneField");function ye({step:e,locale:t,strings:n,className:s,defaultPhone:a=q,onError:r}){let o=b(t,n),{t:l}=o,[p,m]=de(a),[k,y]=de(""),[f,S]=de(!1),[w,E]=de(null),V=e.phase==="verify",L=Ge(V),N=Et(),F=i(async P=>{S(!0),E(null);try{await P()}catch(I){E(G(I,o.strings)),r?.(I)}finally{S(!1)}},"run"),D=Tt.filter(P=>(e.channels??[]).includes(P)),u=At(p),C=!e.needsPhone||u!==null,d=i((P,I=!1)=>{F(()=>e.send({...e.needsPhone&&(!I||p!==a)?{phone:u??p}:{},...P!==void 0?{channel:P}:{}}))},"send"),H=i(P=>{F(()=>e.verify(P))},"submitCode"),Me=i(P=>{P.preventDefault(),V?H(k):D.length<=1&&C&&d(D[0])},"onSubmit"),Be=et(e.codeExpiresAt,L),ee=et(e.resendAvailableAt,L),re=V&&e.codeExpiresAt!==void 0&&Be===0,ue=i(P=>l(P==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),[ht,bt]=l("otp.sentTo",{channel:ue(e.channel)}).split("{number}"),vt=e.reason==="otp_mismatch"?B(v,{tone:"danger",children:[g("span",{children:l("otp.reason_otp_mismatch")}),g("span",{children:pe(o,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&Rt.has(e.reason)?g(v,{tone:"warning",children:g("span",{children:l(`otp.reason_${e.reason}`)})}):null,Oe=B(tt,{children:[vt,w!==null?g(v,{tone:"danger",children:g("span",{children:l(w)})}):null]});if(V){let P=D.length===0;return B("form",{className:`sekyro-step sekyro-otp${s?` ${s}`:""}`,"aria-labelledby":N,onSubmit:Me,noValidate:!0,children:[g(K,{id:N,title:l("otp.verifyTitle"),lead:B(tt,{children:[ht,g("bdi",{dir:"ltr",className:"sekyro-mono",children:e.sentToMasked}),bt]})}),Oe,B("div",{className:"sekyro-field",children:[g("label",{className:"sekyro-label",htmlFor:`${N}-code`,children:l("otp.codeLabel")}),g(ze,{id:`${N}-code`,value:k,invalid:e.reason==="otp_mismatch",onChange:I=>{y(I),I.length===6&&k.length!==6&&!f&&!e.attemptsExhausted&&H(I)}}),g("span",{className:`sekyro-help sekyro-otp-expiry${re?" is-danger":""}`,"aria-hidden":!re||void 0,children:re?l("otp.expired"):l("otp.expiresIn",{time:Lt(Be)})})]}),g("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:re?l("otp.expired"):""}),B(z,{children:[g(h,{type:"submit",full:!0,disabled:f||k.length!==6||e.attemptsExhausted,"aria-busy":f||void 0,children:l("otp.verify")}),P?g("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:f||ee>0,onClick:()=>d(void 0,!0),children:ee>0?l("otp.resendIn",{seconds:ee}):l("otp.resend")}):ee>0?g("p",{className:"sekyro-resend is-waiting",children:l("otp.resendIn",{seconds:ee})}):g("div",{className:"sekyro-resend-row",children:D.map(I=>g("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:f,onClick:()=>d(I,!0),children:l("otp.resendBy",{channel:ue(I)})},I))})]})]})}return B("form",{className:`sekyro-step sekyro-otp${s?` ${s}`:""}`,"aria-labelledby":N,onSubmit:Me,noValidate:!0,children:[g(K,{id:N,title:l("otp.sendTitle"),lead:l("otp.sendDescription")}),Oe,e.needsPhone?g(Dt,{id:`${N}-phone`,label:l("otp.phoneLabel"),value:p,onChange:m,placeholder:l("otp.phonePlaceholder").replace(q,"").trim()}):g("p",{className:"sekyro-text-muted",children:l("otp.prefilledNotice")}),g(z,{children:D.length>0?B("div",{className:"sekyro-actions__group",role:"group","aria-label":l("otp.chooseChannel"),children:[g("p",{className:"sekyro-label","aria-hidden":"true",children:l("otp.chooseChannel")}),D.map((P,I)=>g(h,{kind:I===0?"primary":"ghost",full:!0,disabled:f||!C,"aria-busy":I===0&&f||void 0,onClick:()=>d(P),children:l("otp.sendBy",{channel:ue(P)})},P))]}):g(h,{type:"submit",full:!0,disabled:f||!C,"aria-busy":f||void 0,children:l("otp.send")})})]})}i(ye,"PhoneOtpStep");import{lazy as Bt,Suspense as Ot,useMemo as Ft,useState as Ht}from"react";import{Component as Mt}from"react";var ke=class ke extends Mt{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(ke,"LoadBoundary");var O=ke;import{jsx as Y,jsxs as Ut}from"react/jsx-runtime";var $t={load:i(()=>import("../email-otp-view-3WZH74UT.js"),"load")};function Se({locale:e,strings:t,...n}){let s=b(e,t),[a,r]=Ht(0),o=Ft(()=>Bt(()=>$t.load().then(p=>({default:p.EmailOtpView}))),[a]),l=Ut(v,{tone:"danger",children:[Y("span",{children:s.t("errors.network_error")}),Y(h,{kind:"ghost",onClick:()=>r(p=>p+1),children:s.t("common.retry")})]});return Y(O,{fallback:l,children:Y(Ot,{fallback:Y("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:Y(o,{...n,i18n:s})})},a)}i(Se,"EmailOtpStep");import{lazy as Kt,Suspense as zt,useMemo as Wt,useState as qt}from"react";import{jsx as Q,jsxs as Yt}from"react/jsx-runtime";var Gt={load:i(()=>import("../eid-view-RFSXIECL.js"),"load")};function ge({locale:e,strings:t,...n}){let s=b(e,t),[a,r]=qt(0),o=Wt(()=>Kt(()=>Gt.load().then(p=>({default:p.EidView}))),[a]),l=Yt(v,{tone:"danger",children:[Q("span",{children:s.t("errors.network_error")}),Q(h,{kind:"ghost",onClick:()=>r(p=>p+1),children:s.t("common.retry")})]});return Q(O,{fallback:l,children:Q(zt,{fallback:Q("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:Q(o,{...n,i18n:s})})},a)}i(ge,"EidStep");import{useMemo as to}from"react";import{lazy as Qt,Suspense as Jt,useMemo as Xt,useState as Zt}from"react";import{jsx as J,jsxs as eo}from"react/jsx-runtime";var jt={load:i(()=>import("../flow-views-N6KYXL4N.js"),"load")};function R({view:e,i18n:t,quiet:n,...s}){let[a,r]=Zt(0),o=Xt(()=>Qt(()=>jt.load().then(p=>({default:p[e]}))),[e,a]),l=eo(v,{tone:"danger",children:[J("span",{children:t.t("errors.network_error")}),J(h,{kind:"ghost",onClick:()=>r(p=>p+1),children:t.t("common.retry")})]});return J(O,{fallback:l,children:J(Jt,{fallback:n===!0?null:J("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:t.t("common.loading")}),children:J(o,{...s,i18n:t})})},a)}i(R,"Flow");import{jsx as he,jsxs as oo}from"react/jsx-runtime";function be({step:e,locale:t,strings:n,className:s,onError:a}){let r=b(t,n),{busy:o,error:l,run:p}=Je(r,a),m=to(()=>e.choice.options.flatMap(y=>{let f=Qe(y,r),S=Ye[y.service];return f===null?[]:[{id:y.id,label:f,...S!==void 0?{glyph:he($,{name:S})}:{}}]}),[e.choice.options,r]),k=e.choice.options.find(y=>y.service==="national_eid");return oo("div",{className:s,children:[he(Ue,{title:r.t("method.title"),description:r.t("method.description"),options:m,busy:o,error:l,focus:!0,testId:"sekyro-method",onChoose:y=>p(()=>e.choose(y))}),k?.nationalEid?.afterPass==="continue"?he(R,{view:"EidContinueHint",i18n:r,provider:k.nationalEid.providerName,quiet:!0}):null]})}i(be,"MethodChoice");import{isValidNni as no,normalizeNni as ot}from"@sekyro/web";import{useId as ro,useState as ve}from"react";import{Fragment as so,jsx as x,jsxs as X}from"react/jsx-runtime";function Ne({step:e,locale:t,strings:n,className:s,onError:a}){let r=b(t,n),{t:o}=r,[l,p]=ve(""),[m,k]=ve(!1),[y,f]=ve(null),S=ro(),w=e.attemptsExhausted,E=i(async C=>{k(!0),f(null);try{await C()}catch(d){f(G(d,r.strings)),a?.(d)}finally{k(!1)}},"run"),V=i(C=>{if(C.preventDefault(),e.source!=="typed"){E(()=>e.confirm());return}let d=ot(l);if(!/^\d{10}$/.test(d))return f("population.invalid");if(!no(d))return f("population.reason_nni_invalid");E(()=>e.submitNni(d))},"onSubmit"),L=pe(r,e.attemptsRemaining,w),N=X(so,{children:[e.reason==="registry_unavailable"?X(v,{tone:"warning",children:[x("span",{children:o("population.reason_registry_unavailable")}),x("span",{children:L})]}):null,e.reason==="nni_not_found"&&e.canUseDocument?X(v,{tone:"warning",children:[x("span",{children:o("population.reason_nni_not_found_or_document")}),x("span",{children:L}),x(h,{kind:"ghost",disabled:m,onClick:()=>{E(()=>e.useDocument())},children:o("population.useDocument")})]}):null,e.reason==="nni_not_found"&&!e.canUseDocument||e.reason==="nni_invalid"?X(v,{tone:"danger",children:[x("span",{children:o(e.reason==="nni_not_found"?"population.reason_nni_not_found":"population.reason_nni_invalid")}),x("span",{children:L})]}):null,w&&e.reason===void 0?x(v,{tone:"danger",children:x("span",{children:L})}):null,y!==null?x(v,{tone:"danger",children:x("span",{children:o(y)})}):null]}),[F,D,u]=e.source==="document"?["population.fromDocument.title","population.fromDocument.description","population.fromDocument.continue"]:e.source==="bound"?["session.steps.population.title","population.bound.description","population.bound.confirm"]:e.recheck?["population.recheck.title","population.recheck.description","population.submit"]:["session.steps.population.title","session.steps.population.description","population.submit"];return X("form",{className:`sekyro-step${s?` ${s}`:""}`,"aria-labelledby":S,onSubmit:V,noValidate:!0,children:[x(K,{id:S,title:o(F),lead:o(D)}),N,e.source==="typed"?X("div",{className:"sekyro-field",children:[x("label",{className:"sekyro-label",htmlFor:`${S}-nni`,children:o("population.label")}),x("input",{id:`${S}-nni`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:o("population.placeholder"),value:l,"aria-describedby":`${S}-nni-help`,"aria-invalid":y==="population.invalid"||y==="population.reason_nni_invalid"||void 0,onChange:C=>{f(null),p(ot(C.target.value).replace(/\D/g,"").slice(0,10))}}),x("span",{id:`${S}-nni-help`,className:"sekyro-help",children:o("population.helper")})]}):null,x(z,{children:w?null:x(h,{type:"submit",full:!0,disabled:m,"aria-busy":m||void 0,children:o(u)})})]})}i(Ne,"NniEntry");import{acceptedIssuers as uo,acceptedTypesFor as mo,warmDocumentCapture as fo}from"@sekyro/web";import{lazy as yo,Suspense as ko,useEffect as So,useMemo as go,useState as at}from"react";import{acceptedIssuers as io,acceptedTypesFor as Ce}from"@sekyro/web";import{useEffect as nt,useId as ao,useMemo as rt,useState as we}from"react";import{jsx as _,jsxs as Z}from"react/jsx-runtime";var st=i(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),lo=i(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),co=220;function po(e,t){let n=null;try{n=new Intl.DisplayNames([e],{type:"region"})}catch{}let s=t.map(r=>({code:r,name:n?.of(r)??r})),a=new Intl.Collator(e);return s.sort((r,o)=>r.code==="MR"?-1:o.code==="MR"?1:a.compare(r.name,o.name))}i(po,"countryNames");function it({step:e,i18n:t,issuer:n,onPicked:s}){let{t:a,locale:r}=t,o=rt(()=>io(e.documents),[e.documents]),l=rt(()=>po(r,o),[r,o]),p=o.length===1?o[0]:null,[m,k]=we(n??p),[y,f]=we(""),[S,w]=we(null),E=ao(),V=p===null?[]:Ce(e.documents,p),L=p!==null&&V.length===1?V[0]:null;nt(()=>{p!==null&&L!==null&&e.selectDocument(p,L)},[p,L]);let N=i((u,C)=>{e.selectDocument(u,C),s?.()},"pick"),F=i(u=>{let C=Ce(e.documents,u);C.length===1?N(u,C[0]):k(u)},"chooseIssuer");if(nt(()=>{if(S===null||m===null)return;let u=setTimeout(()=>N(m,S),co);return()=>clearTimeout(u)},[S]),L!==null)return null;if(m===null){let u=st(y.trim()),C=u===""?l:l.filter(d=>st(d.name).includes(u)||d.code.toLowerCase()===u);return Z("section",{className:"sekyro-step",children:[_(K,{title:a("doc.countryTitle"),lead:a("doc.pickDescription")}),Z("div",{className:"sekyro-field",children:[_("label",{className:"sekyro-label",htmlFor:E,children:a("doc.countryLabel")}),_("input",{id:E,type:"search",className:"sekyro-input",placeholder:a("doc.countrySearch"),value:y,onChange:d=>f(d.target.value)})]}),C.length===0?_("p",{className:"sekyro-text-muted",children:a("doc.noCountryMatch")}):_("ul",{className:"sekyro-rows",children:C.map(d=>_("li",{children:Z("button",{type:"button",className:"sekyro-row-btn",onClick:()=>F(d.code),children:[_("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:lo(d.code)}),d.name]})},d.code))}),_(z,{children:null})]})}let D=Ce(e.documents,m);return Z("section",{className:"sekyro-step",children:[_(K,{title:a("doc.pickTitle"),lead:a("native.doc.holdIt")}),_("div",{className:"sekyro-choices",children:D.map(u=>Z("button",{type:"button",className:"sekyro-card","aria-pressed":S===u,disabled:S!==null&&S!==u,onClick:()=>w(u),children:[_($,{name:u==="passport"?"passport":"card"}),Z("span",{className:"sekyro-card__body",children:[_("span",{className:"sekyro-card__title",children:a(`doc.type.${u}`)}),_("span",{className:"sekyro-card__sub",children:a(`doc.sub.${u}`)})]}),_("span",{className:"sekyro-radio","aria-hidden":"true"})]},u))}),o.length>1?_("button",{type:"button",className:"sekyro-link",onClick:()=>{k(null),w(null)},children:a("native.doc.changeCountry")}):null,_(z,{children:null})]})}i(it,"DocumentPicker");import{jsx as W,jsxs as bo}from"react/jsx-runtime";var ho={load:i(()=>import("../document-capture-view-PT732PJ2.js"),"load")};function Pe({step:e,locale:t,strings:n,className:s,liveMrz:a}){let r=b(t,n),[o,l]=at(0),[p,m]=at(null),k=uo(e.documents).length>1,y=e.issuer!==null&&mo(e.documents,e.issuer).length>1,f=go(()=>yo(()=>ho.load().then(w=>({default:w.DocumentCaptureView}))),[o]);So(()=>{fo()},[]);let S=bo(v,{tone:"danger",children:[W("span",{children:r.t("errors.network_error")}),W(h,{kind:"ghost",onClick:()=>l(w=>w+1),children:r.t("doc.retryCamera")})]});return W("div",{className:s,children:e.documentType===null||e.issuer===null||p!==null?W(it,{step:e,i18n:r,...p==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>m(null)}):W(O,{fallback:S,children:W(ko,{fallback:W("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:W(f,{step:e,i18n:r,...a!==void 0?{liveMrz:a}:{},...k?{onChangeCountry:i(()=>m("country"),"onChangeCountry")}:{},...y?{onChangeDocument:i(()=>m("document"),"onChangeDocument")}:{}})})},o)})}i(Pe,"DocumentCapture");import{warmPortraitCapture as vo}from"@sekyro/web";import{Component as No,lazy as Co,Suspense as wo,useEffect as Po,useMemo as xo,useState as _o}from"react";import{jsx as T,jsxs as _e}from"react/jsx-runtime";var Io={load:i(()=>import("../portrait-capture-view-HYOEOAF4.js"),"load")},Ee=class Ee extends No{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(Ee,"LoadBoundary");var xe=Ee;function Eo({step:e,i18n:t}){let{t:n}=t,s=se();return _e("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[T("h2",{ref:s,tabIndex:-1,className:"sekyro-text-body",children:n(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?T("p",{className:"sekyro-text-muted",children:n("portrait.reviewDescription")}):null,e.uploadFailed?_e(v,{tone:"danger",children:[T("span",{children:n("portrait.uploadFailed")}),T(h,{kind:"ghost",onClick:()=>{e.resubmit()},children:n("portrait.sendAgain")})]}):T("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:n("portrait.matching")})]})}i(Eo,"MatchPhase");function Ie({step:e,locale:t,strings:n,className:s,assetBaseUrl:a}){let r=b(t,n),[o,l]=_o(0),p=xo(()=>Co(()=>Io.load().then(k=>({default:k.PortraitCaptureView}))),[o]);if(Po(()=>{e.phase==="capture"&&vo()},[e.phase]),e.phase==="match")return T("div",{className:s,children:T(Eo,{step:e,i18n:r})});let m=_e(v,{tone:"danger",children:[T("span",{children:r.t("errors.network_error")}),T(h,{kind:"ghost",onClick:()=>l(k=>k+1),children:r.t("portrait.retryCamera")})]});return T("div",{className:s,children:T(xe,{fallback:m,children:T(wo,{fallback:T("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:T(p,{step:e,i18n:r,...a!==void 0?{assetBaseUrl:a}:{}})})},o)})}i(Ie,"PortraitCapture");import{useCallback as Te,useEffect as kt,useId as Wo,useRef as Re,useState as ne}from"react";var A={light:{brand:"#0d3b66",brandFg:"#ffffff",fg:"#13141f",fgMuted:"#4e5270",bg:"#f6f7fb",surface:"#ffffff",ring:"#0d3b66",danger:"#ca0f07",success:"#007a5e",warning:"#735003"},dark:{brand:"#6ea2d3",brandFg:"#051a2e",fg:"#f6f7fb",fgMuted:"#cbcedc",bg:"#13141f",surface:"#1d1e2c",ring:"#6ea2d3",danger:"#ff7c7c",success:"#00c897",warning:"#ffd98a"},roles:{light:{brandSoft:"#eaf2fa",line:"#cbcedc",lineSubtle:"#e2e4ee",lineStrong:"#8c91a9",sunken:"#eeeff5",fgSubtle:"#686d8a"},dark:{brandSoft:"#092b4b",line:"#4e5270",lineSubtle:"#2b2d40",lineStrong:"#686d8a",sunken:"#0b0c14",fgSubtle:"#8c91a9"}},stage:"#051a2e",stageAccent:"#69dfef",radius:"10px",radiusLg:"16px",font:'"Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontDisplay:'"Sekyro Geist", Geist, "Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontArabic:'"Sekyro Cairo", Cairo, "Sekyro Inter", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif'};import{useId as Vo,useState as Lo}from"react";import{jsx as Ve,jsxs as lt}from"react/jsx-runtime";var To=["intro","data","processing","sharing","retention"];function ct({i18n:e}){let{t}=e,[n,s]=Lo(!1),a=Vo(),[r,o=""]=t("consent.short").split("{terms}");return lt("section",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-consent",children:[lt("p",{className:"sekyro-text-muted",children:[r,Ve("button",{type:"button",className:"sekyro-link","aria-expanded":n,"aria-controls":a,onClick:()=>s(l=>!l),children:t("consent.termsLink")}),o]}),Ve("div",{id:a,hidden:!n,className:"sekyro-stack sekyro-stack--1 sekyro-text-muted","data-testid":"sekyro-consent-terms",children:To.map(l=>Ve("p",{children:t(`consent.terms.${l}`)},l))})]})}i(ct,"ConsentNotice");function pt(e){let t=e.trim().split(/\s+/).filter(s=>s!=="");return(t.length>=2?[t[0],t[1]].map(s=>Array.from(s??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}i(pt,"initials");import{useSyncExternalStore as Ro}from"react";var ut=i(e=>({colors:{...e?A.dark:A.light},radius:A.radiusLg,fontFamily:A.font}),"brandTheme"),zr=ut(!1);function mt(e,t,n){let s=ie(e);if(n&&s.colors!==void 0){let{brand:a,brandFg:r}=s.colors;a!==void 0&&Bo(a,A.dark.bg)>=3?s.colors={brand:a,ring:a,...r!==void 0?{brandFg:r}:{}}:delete s.colors}return ae(ut(n),s,t)}i(mt,"verificationTheme");function ft(e){let t=Ro(Mo,Do,()=>!1);return e==="dark"||e==="system"&&t}i(ft,"useDarkScheme");var Ao="(prefers-color-scheme: dark)",yt=i(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Ao):null,"media"),Do=i(()=>yt()?.matches??!1,"prefersDark");function Mo(e){let t=yt();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}i(Mo,"subscribe");function Bo(e,t){let[n,s]=[dt(e),dt(t)];return(Math.max(n,s)+.05)/(Math.min(n,s)+.05)}i(Bo,"contrast");function dt(e){let t=[1,3,5].map(n=>{let s=Number.parseInt(e.slice(n,n+2),16)/255;return s<=.03928?s/12.92:((s+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}i(dt,"luminance");import{useEffect as Oo,useId as Fo,useState as Ho}from"react";import{jsx as M,jsxs as oe}from"react/jsx-runtime";var $o=new Set(["document_nni_mismatch","name_mismatch","birth_date_mismatch"]),Uo={approved:"M6.5 12.5l3.6 3.6 7.4-8.2",review:"M12 7v5l3.2 2",expired:"M8 5h8M8 19h8M9 5c0 4 6 5 6 7s-6 3-6 7M15 5c0 4-6 5-6 7s6 3 6 7",rejected:"M8 8l8 8M16 8l-8 8"};function Ko({outcome:e}){return oe("svg",{className:`sekyro-outcome sekyro-outcome--${e}`,viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[M("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"57",pathLength:"1"}),M("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),M("path",{className:"sekyro-outcome__glyph",d:Uo[e],pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]})}i(Ko,"OutcomeMark");function zo({label:e,id:t,copied:n}){let[s,a]=Ho(!1);return Oo(()=>{if(!s)return;let r=setTimeout(()=>a(!1),1600);return()=>clearTimeout(r)},[s]),oe("button",{type:"button",className:`sekyro-reference${s?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[M("span",{"aria-live":"polite",children:s?n:e}),M("bdi",{dir:"ltr",children:t}),M($,{name:"copy"})]})}i(zo,"ReferenceLine");function Le({step:e,locale:t,strings:n,className:s,onClose:a}){let r=b(t,n),{t:o}=r,l=Fo(),p=se(),m=e.context.orgName,k=e.display==="approved"?"approved":e.display==="review"?"review":e.display==="expired"?"expired":"rejected",y;switch(e.display){case"policy_stop":{let f=e.failureReason??"";if($o.has(f))y=o("session.result.detailsMismatch",{org:m});else if(f==="device_velocity_exceeded")y=o("session.result.deviceVelocity",{org:m});else{let S=Fe(f);y=S!==null?o(S,{org:m}):o("session.result.rejected.description")}break}case"cooldown":{let f=He(r.locale,e.retryAfter);y=f!==null?o(f.key,{time:f.time}):o("reasons.device_cooldown");break}case"platform_unsupported":y=o("result.platform_unsupported");break;case"attempts_exhausted":y=o("common.noAttemptsLeft");break;default:y=m!==""?o(`native.result.${k}`,{org:m}):o(`session.result.${k}.description`)}return oe("section",{className:`sekyro-result${s?` ${s}`:""}`,"aria-labelledby":l,"data-testid":"sekyro-result",children:[oe("div",{className:"sekyro-result__body",children:[M(Ko,{outcome:e.display==="cooldown"?"review":k}),oe("div",{className:"sekyro-heading",children:[M("h2",{id:l,ref:p,tabIndex:-1,className:"sekyro-text-body",children:o(`session.result.${k}.title`)}),M("p",{className:"sekyro-text-muted",children:y})]}),M(zo,{label:o("result.referenceLabel"),id:e.context.sessionId,copied:o("native.result.copied")})]}),a!==void 0?M("div",{className:"sekyro-actions",children:M(h,{full:!0,onClick:a,children:m!==""?o("native.result.back",{org:m}):o("native.close")})}):null]})}i(Le,"VerificationResultScreen");import{Fragment as St,jsx as c,jsxs as U}from"react/jsx-runtime";function qo(e,t){let n=t?A.dark:A.light,s=t?A.roles.dark:A.roles.light,a=e.colors??{},r={},o=a.fg===n.fg&&a.surface===n.surface;return a.brand===n.brand&&a.surface===n.surface&&(r["--sekyro-color-brand-soft"]=s.brandSoft),o&&(r["--sekyro-color-line"]=s.line,r["--sekyro-color-line-subtle"]=s.lineSubtle,r["--sekyro-color-line-strong"]=s.lineStrong,r["--sekyro-color-sunken"]=s.sunken),a.fgMuted===n.fgMuted&&a.surface===n.surface&&(r["--sekyro-color-fg-subtle"]=s.fgSubtle),e.fontFamily===A.font&&(r["--sekyro-font-display"]=A.fontDisplay),r}i(qo,"flowRoles");function Ae(e){let{verification:t,locale:n,strings:s,onStep:a,onResult:r}=e,{step:o,error:l}=fe(t);kt(()=>{o!==null&&a?.(o)},[o,a]),kt(()=>r===void 0?void 0:t.on("result",r),[t,r]);let p=ft(e.colorScheme??"light"),m=mt(o?.context.branding,e.theme,p),[k,y]=ne(!1),f=`sekyro-verification${p?" sekyro-verification--dark":""}${k?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,S=Re(e.onClose);S.current=e.onClose;let w=Re(o);w.current=o;let E=Te(()=>{let V=w.current;S.current?.(V?.kind==="result"?{reason:"finished",result:V.result}:{reason:"cancelled"})},[]);return c(le,{theme:m,className:f,children:c(te,{locale:n,...s!==void 0?{strings:s}:{},children:c("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:qo(m,p),children:c(We.Provider,{value:y,children:c(ce.Provider,{value:e.onClose!==void 0?E:void 0,children:c(Go,{...e,step:o,error:l,immersive:k})})})})})})}i(Ae,"SekyroVerification");function Go(e){let{step:t,error:n,slots:s,immersive:a}=e,r=b(),{t:o}=r,[l,p]=ne(!1),[m,k]=ne(0),[y,f]=ne(null),S=Te((d,H)=>c(Xe,{start:d,context:H}),[]),w=Re(""),E=e.livenessProps?.slots?.stageOverlay,V=Te(d=>(d.guidance!==""&&!d.coached&&(w.current=d.guidance),c(Ze,{testId:"sekyro-capture-stage",video:c("video",{ref:d.videoRef,playsInline:!0,muted:!0,className:"sekyro-lm-video sekyro-fc-video","aria-hidden":"true","data-testid":"sekyro-capture-video"}),instruction:d.guidance!==""?d.guidance:w.current,note:d.note,busy:d.settled,progress:d.phase==="seeking"||d.phase==="aligning"?d.progress:1,still:d.still,live:d.live,closeLabel:o("native.close"),overlay:E?.(d.videoRef),...d.settled?{}:{onClose:i(()=>k(H=>H+1),"onClose")}})),[o,E]),L=Wo();if(n!==null)return c(me,{tone:"danger",children:c("span",{children:o(G(n,r.strings))})});if(t===null)return c("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o("common.loading")});let{context:N}=t,F=i(d=>{p(!0),d().finally(()=>p(!1))},"refresh"),D=s?.header??c(Qo,{context:N,headerId:L,end:s?.headerEnd}),u,C=y===t.key&&t.context.switchable!==void 0;if(C)u=c(R,{view:"LaneChoiceView",i18n:r,step:t,onClose:()=>f(null)});else switch(t.kind){case"phone_otp":u=c(ye,{step:t});break;case"email_otp":u=c(Se,{step:t});break;case"method":u=c(be,{step:t});break;case"registry":u=c(Ne,{step:t});break;case"document":u=c(Pe,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let d=e.livenessProps?.slots?.intro,H={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:d??S},...m>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,...e.dir!==void 0?{dir:e.dir}:{},strings:r.strings,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{},...e.voice!==void 0?{voice:e.voice}:{},...e.onLivenessCaptured!==void 0?{onCaptured:e.onLivenessCaptured}:{}};u=c($e.Provider,{value:V,children:t.instructions==="icao"||t.livePhoto?.icao===!0?c(R,{view:"LivePhotoLiveness",i18n:r,step:t,livenessProps:H,sekyroIntro:d===void 0},m):c(Ke,{...H},m)});break}case"portrait":u=U(St,{children:[t.retakeOnly?c(R,{view:"PortraitRetakeNotice",i18n:r,quiet:!0}):null,c(Ie,{step:t,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":u=c(R,{view:"ContactChoiceView",i18n:r,step:t});break;case"choice":u=c(R,{view:"GenericChoiceView",i18n:r,step:t});break;case"identity_summary":u=c(R,{view:"IdentitySummaryView",i18n:r,step:t});break;case"mobile_required":u=e.handoffUrl!==void 0?c(R,{view:"HandoffView",i18n:r,url:e.handoffUrl,refresh:t.refresh}):U(me,{tone:"info",children:[c("strong",{children:o("handoff.title")}),c("span",{children:o("reasons.mobile_required")}),c(h,{kind:"ghost",disabled:l,onClick:()=>F(t.refresh),children:o("common.refresh")})]});break;case"processing":u=U("section",{className:"sekyro-stack sekyro-stack--1",role:"status","aria-live":"polite",children:[c("h2",{className:"sekyro-text-body",children:o("session.processing.title")}),c("p",{className:"sekyro-text-muted",children:o("session.processing.description")}),t.stalled?c(h,{kind:"ghost",disabled:l,onClick:()=>F(t.refresh),children:o("common.refresh")}):null]});break;case"eid":u=c(ge,{step:t});break;case"unsupported":{let d=t.reason==="platform_unsupported";u=U("section",{className:"sekyro-stack sekyro-stack--1",children:[c("h2",{className:"sekyro-text-body",children:o(d?"needsApp.title":"unsupported.title")}),c("p",{children:d?N.orgName!==""?o("needsApp.description",{org:N.orgName}):o("needsApp.descriptionNoOrg"):o("unsupported.description",{org:N.orgName})})]});break}case"result":u=s?.result?.(t)??c(Yo,{step:t});break;default:{let d=t;u=null}}return U(St,{children:[a?null:D,!a&&t.kind!=="result"&&N.sections.length>1?c(Jo,{context:N,current:t.section,i18n:r}):null,!a&&!N.consentRecorded&&t.kind!=="result"?c(ct,{i18n:r}):null,c(qe,{pageKey:t.key,children:u}),!a&&!C&&t.kind!=="result"&&t.context.switchable!==void 0?c(R,{view:"LaneSwitch",i18n:r,step:t,onOpen:()=>f(t.key),quiet:!0},t.key):null,a?null:s?.footer!==void 0?s.footer:U("p",{className:"sekyro-footer",children:[c($,{name:"lock"}),o("shell.verifiedBy")]})]})}i(Go,"Body");function Yo({step:e}){return c(ce.Consumer,{children:t=>c(Le,{step:e,...t!==void 0?{onClose:t}:{}})})}i(Yo,"ResultPage");function Qo({context:e,headerId:t,end:n}){let{t:s}=b(),[a,r]=ne(!1),o=a?void 0:e.branding?.logoUrl,l=e.orgName!==""?e.orgName:s(e.returning?"returning.title":"session.title");return U("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:[U("div",{className:"sekyro-org",children:[c("span",{className:"sekyro-org__tile","aria-hidden":"true",children:o!==void 0?c("img",{className:"sekyro-org__logo",src:o,alt:"",onError:()=>r(!0)}):pt(e.orgName)}),U("div",{className:"sekyro-org__text",children:[c("h1",{id:t,className:"sekyro-org__name",children:l}),c("p",{className:"sekyro-org__sub",children:s("shell.subtitle")})]}),n!=null?c("div",{className:"sekyro-org__end",children:n}):null,c(ce.Consumer,{children:p=>p!==void 0?c("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":s("native.close"),onClick:p,children:c($,{name:"close"})}):null})]}),e.returning?c("p",{className:"sekyro-text-muted",children:s("returning.description")}):null]})}i(Qo,"OrgHeader");function Jo({context:e,current:t,i18n:n}){let s=t===null?-1:e.sections.indexOf(t),a=e.progress,r=a!==void 0&&a.length===e.sections.length?a:e.sections.map((o,l)=>({id:o,state:l<s?"done":l===s?"current":"upcoming"}));return c("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:r.map(({id:o,state:l})=>c("li",{className:`sekyro-progress__bar${l==="done"?" is-done":l==="current"?" is-current":""}`,...l==="current"?{"aria-current":"step"}:{},children:c("span",{className:"sekyro-visually-hidden",children:n.strings[`section.${o}`]??o})},o))})}i(Jo,"SectionProgress");import{useEffect as Zo,useState as gt}from"react";var Xo=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function De(e){let t=e??(typeof navigator>"u"?"":String(navigator.userAgent??""));return Xo.test(t)}i(De,"isInAppBrowser");import{jsx as j}from"react/jsx-runtime";function jo(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}i(jo,"pageUrl");function en({hostedUrl:e,inAppBrowser:t,...n}){let[s,a]=gt(t===!0);Zo(()=>{t===void 0&&De()&&a(!0)},[t]);let[r,o]=gt(!1),l=n.handoffUrl??e??jo();return s&&!r?j(le,{theme:ae(ie(void 0),n.theme),...n.className!==void 0?{className:n.className}:{},children:j(te,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:j("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-stack sekyro-stack--4",children:j(tn,{url:l,onContinue:()=>o(!0)})})})}):j(Ae,{...n,...l!==""?{handoffUrl:l}:{}})}i(en,"SekyroFlow");function tn({url:e,onContinue:t}){let n=b();return j(R,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}i(tn,"Prompt");export{Pe as DocumentCapture,ge as EidStep,Se as EmailOtpStep,be as MethodChoice,Ne as NniEntry,ye as PhoneOtpStep,Ie as PortraitCapture,en as SekyroFlow,Ae as SekyroVerification,te as StepI18nProvider,Le as VerificationResultScreen,Nt as arSteps,Ct as enSteps,Pt as formatTemplate,wt as frSteps,De as isInAppBrowser,xt as resolveSekyroStrings,b as useStepI18n,fe as useVerificationStep};
@@ -293,6 +293,7 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
293
293
  .sekyro-card[aria-pressed="true"] > .sekyro-glyph { color: var(--sekyro-color-brand); }
294
294
  .sekyro-card[aria-pressed="true"] .sekyro-radio { border-color: var(--sekyro-color-brand); }
295
295
  .sekyro-card[aria-pressed="true"] .sekyro-radio::after { transform: scale(1); opacity: 1; }
296
+ @media (prefers-reduced-motion: reduce) { .sekyro-card, .sekyro-radio::after { transition: none; } }
296
297
  .sekyro-rows { margin: 0; padding: 0; list-style: none; border: 1px solid var(--sekyro-color-line-subtle); border-radius: var(--sekyro-radius); overflow: hidden; }
297
298
  .sekyro-rows > li + li { border-block-start: 1px solid var(--sekyro-color-line-subtle); }
298
299
  .sekyro-row-btn {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sekyro/react",
3
- "version": "0.1.0-rc.6",
3
+ "version": "0.1.0-rc.7",
4
4
  "description": "Sekyro AI React SDK — the themeable, accessible <LivenessCapture /> component over @sekyro/web (ar/fr/en, RTL-safe, WCAG AAA defaults)",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -74,7 +74,7 @@
74
74
  "strings:steps": "node scripts/gen-step-strings.mjs"
75
75
  },
76
76
  "peerDependencies": {
77
- "@sekyro/web": "^0.1.0-rc.8 || ^0.2.0-rc.0",
77
+ "@sekyro/web": "^0.1.0-rc.9 || ^0.2.0-rc.0",
78
78
  "react": ">=18.2",
79
79
  "react-dom": ">=18.2"
80
80
  },
package/sbom.cdx.json CHANGED
@@ -97,8 +97,8 @@
97
97
  "type": "application",
98
98
  "name": "react",
99
99
  "group": "@sekyro",
100
- "version": "0.1.0-rc.6",
101
- "bom-ref": "@sekyro/react@0.1.0-rc.6",
100
+ "version": "0.1.0-rc.7",
101
+ "bom-ref": "@sekyro/react@0.1.0-rc.7",
102
102
  "description": "Sekyro AI React SDK — the themeable, accessible <LivenessCapture /> component over @sekyro/web (ar/fr/en, RTL-safe, WCAG AAA defaults)",
103
103
  "licenses": [
104
104
  {
@@ -108,7 +108,7 @@
108
108
  }
109
109
  }
110
110
  ],
111
- "purl": "pkg:npm/%40sekyro/react@0.1.0-rc.6?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-react",
111
+ "purl": "pkg:npm/%40sekyro/react@0.1.0-rc.7?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-react",
112
112
  "externalReferences": [
113
113
  {
114
114
  "url": "https://github.com/IBTIKAR-Technologies/ibtikar-identity/issues",
@@ -147,7 +147,7 @@
147
147
  "components": [],
148
148
  "dependencies": [
149
149
  {
150
- "ref": "@sekyro/react@0.1.0-rc.6"
150
+ "ref": "@sekyro/react@0.1.0-rc.7"
151
151
  }
152
152
  ]
153
153
  }
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{a}from"./chunk-65JA6YKG.js";import{a as i}from"./chunk-4RUZQW5T.js";var s={"session.title":"تحقّق من هويتك","session.requestedBy":"تطلب {orgName} منك التحقق من هويتك","returning.requestedBy":"تطلب {orgName} منك تأكيد أنك أنت","consent.notice":"بإكمال عملية التحقق من الهوية، فإنك توافق على معالجة بياناتك الشخصية والبيومترية للتحقق من هويتك.","consent.details":"التفاصيل","consent.terms.intro":"تتحقق Sekyro AI من هويتك نيابةً عن الجهة التي أرسلت إليك هذا الرابط. قبل البدء، اطّلع على كيفية استخدام بياناتك.","consent.terms.data":"أثناء التحقق، تجمع Sekyro AI صور وثيقة هويتك، ومقطع فيديو ذاتيًا قصيرًا، وصورة ذاتية، ورقم تعريفك الوطني.","consent.terms.processing":"تُستخدم هذه البيانات للتحقق من هويتك فقط: يُقارَن وجهك بالصورة الموجودة على وثيقتك، ويُطابَق رقمك الوطني مع سجل الحالة المدنية. وقد يفحص بعض الخطوات مراجع بشري مخوَّل.","consent.terms.sharing":"تُبلَّغ الجهة التي طلبت هذا التحقق بنتيجته.","consent.terms.retention":"تُخزَّن بياناتك مشفّرة ولا يُحتفظ بها إلا للمدة التي يقتضيها القانون. لممارسة حقوقك المتعلقة بحماية البيانات، تواصل مع الجهة التي طلبت هذا التحقق.","otp.sendTitle":"تحقّق من رقم هاتفك","otp.sendDescription":"سنرسل إليك رمزًا يُستخدم مرة واحدة لتأكيد أن هذا الرقم يخصّك","otp.prefilledNotice":"سنرسل رمز تحقّق إلى رقم هاتفك المسجّل.","otp.phoneLabel":"رقم الهاتف","otp.phoneHelper":"سنرسل رمزًا يُستخدم مرة واحدة إلى هذا الرقم","otp.phonePlaceholder":"+222 36 00 00 00","otp.send":"إرسال الرمز","otp.channelSms":"رسالة نصية","otp.channelWhatsapp":"واتساب","otp.verifyTitle":"أدخل رمز التحقّق","otp.verifyDescription":"أدخل الرمز المكوّن من 6 أرقام الذي أرسلناه إليك لإتمام التحقّق من رقمك","otp.sentTo":"أرسلنا رمزًا مكوّنًا من 6 أرقام إلى {number} عبر {channel}","otp.codeLabel":"رمز التحقّق","otp.codeHelper":"أدخل الرمز المكوّن من 6 أرقام الذي أرسلناه إليك","otp.verify":"تحقّق من الرمز","otp.resend":"إعادة إرسال الرمز","otp.resendIn":"إعادة إرسال الرمز خلال {seconds} ثانية","otp.expiresIn":"ينتهي الرمز خلال {time}","otp.expired":"انتهت صلاحية الرمز — أعد إرسال رمز جديد","otp.reason_otp_mismatch":"الرمز غير صحيح — تحقّق منه وأعد إدخاله","otp.reason_otp_expired":"انتهت صلاحية الرمز — أعد إرسال رمز جديد للمتابعة","otp.reason_otp_send_failed":"تعذّر إرسال الرمز — أعد المحاولة بعد قليل","otp.chooseChannel":"كيف تريد أن تتلقّى رمزك؟","otp.sendBy":"إرسال الرمز عبر {channel}","otp.resendBy":"إعادة الإرسال عبر {channel}","otp.reason_otp_channel_unavailable":"هذه الوسيلة غير متاحة — اختر طريقة أخرى لتلقّي رمزك","otp.reason_otp_destination_not_allowed":"لا يمكننا إرسال الرموز إلى أرقام هذا البلد — أدخل رقمًا آخر","otp.reason_otp_destination_unknown":"تعذّر التعرّف على هذا الرقم — تحقّق منه وأعد إدخاله مع رمز البلد","otp.reason_otp_rate_limited":"طلبت رموزًا كثيرة — انتظر قليلًا ثم أعد المحاولة","session.steps.population.title":"أدخل رقم تعريفك الوطني","session.steps.population.description":"يُطابَق رقمك الوطني المكوّن من 10 أرقام مع سجل الحالة المدنية","population.label":"الرقم الوطني للتعريف (NNI)","population.helper":"رقم التعريف الوطني المكوّن من 10 أرقام كما هو مطبوع على بطاقتك","population.placeholder":"3501234567","population.submit":"تحقّق من رقمي","population.invalid":"أدخل الأرقام العشرة للرقم الوطني كما هو مطبوع على بطاقة هويتك","population.reason_registry_unavailable":"سجل الحالة المدنية غير متاح مؤقتًا — لم يُتحقَّق من رقمك. أعد المحاولة بعد قليل","population.reason_nni_not_found":"لم يُعثر على هذا الرقم في سجل الحالة المدنية — تأكد من مطابقته تمامًا لبطاقتك","population.reason_nni_invalid":"هذا الرقم ليس رقمًا وطنيًا صالحًا — تحقق من الأرقام العشرة المطبوعة على بطاقة هويتك","population.bound.description":"قدّمت الجهة الطالبة رقمك الوطني للتعريف مسبقًا — أكّد للتحقق منه في سجل الحالة المدنية","population.bound.confirm":"تأكيد ومتابعة","population.reason_nni_not_found_or_document":"لم نعثر على هذا الرقم. تأكّد منه، أو استخدم وثيقتك بدلًا منه.","population.useDocument":"استخدام وثيقتي بدلًا من ذلك","population.fromDocument.title":"التحقق في السجل المدني","population.fromDocument.description":"نتحقق من الرقم الوطني المقروء من وثيقتك في السجل المدني","population.fromDocument.continue":"متابعة","session.steps.doc.titleRecto":"صوّر الوجه الأمامي لوثيقة هويتك","session.steps.doc.titleVerso":"صوّر الوجه الخلفي لوثيقة هويتك","session.steps.doc.description":"استخدم إضاءة جيدة وأبقِ البطاقة كاملة داخل الإطار","doc.pickTitle":"أي وثيقة ستستخدم؟","doc.pickDescription":"اختر وثيقة الهوية التي بحوزتك — ستمسحها بالكاميرا","doc.pickLabel":"نوع الوثيقة","doc.startScan":"بدء المسح","doc.titlePassport":"امسح صفحة بيانات جواز سفرك","doc.reason_side_missing":"حُفظ أحد الوجهين — صوّر الآن الوجه المتبقي من الوثيقة","doc.reason_unreadable":"تعذّرت قراءة الوثيقة — أعد التقاط الصورة بحيث تكون البطاقة كاملة وواضحة داخل الإطار","doc.process_failed":"تعذّرت معالجة هذه الصورة — التقط صورة جديدة وأعد المحاولة","doc.uploading":"جارٍ رفع وثيقتك…","doc.cameraBlocked":"نحتاج إلى الكاميرا لمسح الوثيقة — الوصول إلى الكاميرا محظور أو غير متاح","doc.cameraBlockedHint":"اسمح بالوصول إلى الكاميرا لهذا الموقع من إعدادات المتصفح ثم أعد المحاولة","doc.retryCamera":"إعادة تجربة الكاميرا","doc.holdUpright":"ضع الوثيقة داخل الإطار — سيتم الالتقاط تلقائيًا. للحصول على صورة أوضح، أدر هاتفك أفقيًا","dcv2.sensing":"جارٍ البحث عن الوثيقة — ضعها داخل الإطار","dcv2.too_far":"قرّب الوثيقة حتى تملأ الإطار","dcv2.too_close":"ابتعد قليلًا — أبقِ الوثيقة كاملة داخل الإطار","dcv2.edge_clipped":"أدخل الوثيقة كاملة داخل الإطار — أبقِ الحواف ظاهرة","dcv2.wrong_shape":"هذا لا يبدو صحيحًا — ضع الوثيقة مسطحة باتجاه الكاميرا مباشرة","dcv2.tilted":"أمسك الهاتف بشكل مستوٍ فوق الوثيقة — الزاوية كبيرة جدًا","dcv2.too_dark":"ابحث عن مكان أكثر إضاءة — أنر الوثيقة","dcv2.too_bright":"الإضاءة قوية جدًا — أمل الوثيقة بعيدًا عن الانعكاس","dcv2.blurry":"ثبّت هاتفك — الصورة غير واضحة","dcv2.focus_far":"قريب جدًا للتركيز — أبعد الهاتف قليلًا","dcv2.glare":"الضوء ينعكس على الوثيقة — أملها قليلًا","dcv2.hold_still":"ممتاز — لا تتحرك","dcv2.processing":"جارٍ الالتقاط…","dcv2.side_captured":"تم التقاط هذا الوجه — اقلب الوثيقة إلى الوجه الخلفي","dcv2.captured":"تم الالتقاط","session.processing.title":"جارٍ معالجة عمليات التحقق","session.processing.description":"يستغرق ذلك عادةً بضع ثوانٍ — وستظهر النتيجة هنا","handoff.title":"تابع على هاتفك","session.result.approved.title":"تم التحقق من هويتك","session.result.approved.description":"انتهيت — يمكنك إغلاق هذه الصفحة","session.result.review.title":"تحققك قيد المراجعة","session.result.review.description":"سيتم إرسال النتيجة إلى الجهة التي أرسلت لك هذا الرابط — لا حاجة لأي إجراء آخر.","session.result.rejected.title":"تعذّر التحقق من هويتك","session.result.rejected.description":"تواصل مع الجهة التي أرسلت إليك هذا الرابط إذا كنت تعتقد أن الأمر خطأ","session.result.expired.title":"انتهت صلاحية جلسة التحقق هذه","session.result.expired.description":"اطلب رابطًا جديدًا من الجهة التي أرسلته، ثم ابدأ من جديد","session.result.detailsMismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى {org}. تواصل مع {org}.","session.result.deviceVelocity":"لا يمكن استخدام هذا الجهاز لعملية تحقق أخرى حاليًا. تواصل مع {org}.","result.referenceLabel":"الرمز المرجعي","common.loading":"جارٍ تحميل جلسة التحقق","common.refresh":"حدّث الحالة","common.noAttemptsLeft":"لم تتبقَّ أي محاولة","session.steps.portrait.title":"التقط صورة الهوية","session.steps.portrait.description":"انظر مباشرة إلى الكاميرا بملامح محايدة، أمام جدار سادة وفاتح","portrait.coach.no_face":"ضع وجهك داخل الإطار البيضاوي","portrait.coach.multiple_faces":"تأكد من عدم وجود أي شخص آخر في الصورة","portrait.coach.center":"ضع وجهك في وسط الإطار البيضاوي","portrait.coach.too_close":"ابتعد قليلاً","portrait.coach.pose":"انظر مباشرة إلى الكاميرا","portrait.coach.eyes":"افتح عينيك أكثر قليلاً","portrait.coach.mouth":"أغلق فمك، بتعبير محايد","portrait.coach.glare":"أمِل نظارتك أو انزعها","portrait.coach.lighting":"اجعل وجهك مقابل نافذة أو مصباح","portrait.coach.lighting_side":"تجنّب الإضاءة من جانب واحد","portrait.coach.background":"قف أمام جدار فاتح اللون وسادة","portrait.coach.resolution":"اقترب قليلاً","portrait.coach.hold_still":"لا تتحرك","portrait.coach.hold":"ممتاز — لا تتحرك","portrait.criteria.face":"الوجه داخل الإطار","portrait.criteria.framing":"في الوسط","portrait.criteria.pose":"النظر مباشرة","portrait.criteria.eyes":"العينان مفتوحتان","portrait.criteria.mouth":"تعبير محايد","portrait.criteria.glare":"بلا انعكاس","portrait.criteria.lighting":"إضاءة متساوية","portrait.criteria.background":"خلفية سادة","portrait.criteria.resolution":"قريب بما يكفي","portrait.criteria.sharpness":"ثابت","portrait.report.pose":"وضعية الرأس","portrait.report.eyes":"العينان","portrait.report.mouth":"تعبير الوجه","portrait.report.occlusion":"الوجه مكشوف","portrait.report.glare":"انعكاس النظارة","portrait.report.lighting":"الإضاءة","portrait.report.background":"الخلفية","portrait.report.resolution":"المسافة","portrait.checksLabel":"فحوصات الصورة","portrait.met":"تم","portrait.notMet":"ليس بعد","portrait.starting":"جارٍ تشغيل الكاميرا…","portrait.taken":"تم التقاط الصورة","portrait.uploading":"جارٍ إرسال صورتك…","portrait.checking":"جارٍ التحقق من صورتك…","portrait.retryTitle":"لنلتقط صورتك مرة أخرى","portrait.reportTitle":"ما يجب تصحيحه","portrait.retake":"التقط الصورة مرة أخرى","portrait.uploadFailed":"تعذّر إرسال صورتك. تحقّق من اتصالك ثم أعد المحاولة.","portrait.sendAgain":"أرسل الصورة مرة أخرى","portrait.matching":"جارٍ مقارنة صورتك بوثيقة هويتك…","portrait.reviewTitle":"سنراجع صورتك","portrait.reviewDescription":"سيتحقق أحد أعضاء فريقنا من صورتك. يمكنك المتابعة.","portrait.cameraBlocked":"نحتاج إلى الكاميرا لالتقاط صورة الهوية — الوصول إلى الكاميرا محظور أو غير متاح","portrait.cameraBlockedHint":"اسمح بالوصول إلى الكاميرا لهذا الموقع من إعدادات المتصفح ثم أعد المحاولة","portrait.retryCamera":"إعادة تجربة الكاميرا","reasons.icao_pose":"انظر مباشرة إلى الكاميرا","reasons.icao_eyes":"افتح عينيك أكثر قليلاً","reasons.icao_mouth":"أغلق فمك وحافظ على ملامح محايدة","reasons.icao_occlusion":"أزل ما يغطي وجهك، وأمِل نظارتك أو انزعها","reasons.icao_lighting":"قف مقابل نافذة أو مصباح، وتجنب الضوء من جهة واحدة","reasons.icao_background":"قف أمام جدار سادة وفاتح","reasons.icao_resolution":"اقترب قليلاً من الكاميرا","reasons.portrait_not_from_liveness":"يجب أن تكون الصورة للشخص نفسه الذي أجرى فحص الوجه. التقطها بنفسك مرة أخرى","method.national_eid":"التحقق عبر {provider}","method.national_eidGeneric":"التحقق عبر هويتك الرقمية الوطنية","consent.short":"بالمتابعة، فإنك توافق على {terms}.","consent.termsLink":"الشروط","session.progressLabel":"تقدّم التحقق","section.contact":"تحقق من وسيلة التواصل","section.identity":"تحقق من هويتك","section.live_photo":"التقط صورة حية","handoff.copied":"تم نسخ الرابط — افتحه على هاتفك","needsApp.title":"يتطلب هذا التحقق تطبيقًا على الهاتف","needsApp.description":"تطلب {org} قراءة شريحة مستندك. افتح تطبيق {org} على هاتف يدعم NFC للمتابعة.","needsApp.descriptionNoOrg":"يقرأ هذا التحقق شريحة مستندك. افتح التطبيق على هاتف يدعم NFC للمتابعة.","population.recheck.title":"تحقّق من رقمك الوطني","population.recheck.description":"لم يتطابق وجهك مع السجل الخاص بهذا الرقم. تحقّق من الرقم وأدخله مرة أخرى.","otp.phoneInvalid":"أدخل رقم هاتفك مع رمز البلد، مثل ‎+222 36 00 00 00","otp.codeInvalid":"أدخل الرمز المكوّن من 6 أرقام","doc.countryTitle":"ما البلد الذي أصدر وثيقتك؟","doc.countryLabel":"بلد الإصدار","doc.countrySearch":"ابحث عن بلد","doc.noCountryMatch":"لا يوجد بلد يطابق بحثك","doc.type.carte_identite":"بطاقة الهوية","doc.type.residence_permit":"بطاقة الإقامة","doc.type.passport":"جواز السفر","doc.showSide":"اعرض أحد وجهي البطاقة","doc.showPage":"اعرض صفحة الصورة","doc.flip":"اقلب البطاقة","doc.sameFace":"الوجه نفسه · اقلب البطاقة","doc.reaskRecto":"اعرض الوجه الأمامي مرة أخرى","doc.reread":"تعذّرت قراءة هذا الوجه · ثبّت البطاقة في إضاءة جيدة","doc.photoTaken":"تم التقاط الصورة","doc.frontCaptured":"تم التقاط الوجه الأمامي","doc.backCaptured":"تم التقاط الوجه الخلفي","doc.pageCaptured":"تم التقاط الصفحة","doc.progressFront":"الأمام","doc.progressBack":"الخلف","doc.progressPage":"صفحة الصورة","doc.shutter":"التقط الصورة","doc.torchOn":"شغّل الضوء","doc.torchOff":"أطفئ الضوء","result.platform_unsupported":"يتطلب هذا التحقق تطبيقًا على الهاتف.","unsupported.title":"يلزم التحديث","unsupported.description":"تتطلب هذه الخطوة إصدارًا أحدث من هذه الصفحة. تواصل مع {org}.","shell.subtitle":"التحقق من الهوية","shell.verifiedBy":"تم التحقق بواسطة Sekyro AI","doc.sub.carte_identite":"الوجه والظهر","doc.sub.residence_permit":"الوجه والظهر","doc.sub.passport":"الصفحة التي تحمل صورتك","native.close":"إغلاق","native.face.introTitle":"لنتحقق الآن من وجهك","native.face.introLead":"لقطة واحدة دون أي حركة خاصة: انظر إلى الشاشة فقط.","native.doc.holdIt":"احتفظ بوثيقتك في متناول يدك.","native.doc.changeCountry":"تغيير البلد","native.result.approved":"اكتمل التحقق. يمكنك العودة إلى {org}.","native.result.review":"ستُرسل النتيجة إلى {org}. لا يلزمك فعل أي شيء آخر.","native.result.rejected":"تواصل مع {org} إذا كنت تعتقد أن هذا خطأ.","native.result.expired":"ابدأ من جديد من {org} للحصول على جلسة جديدة.","native.result.copied":"تم النسخ","native.result.back":"العودة إلى {org}"};var c={"session.title":"Verify your identity","session.requestedBy":"{orgName} asks you to verify your identity","returning.requestedBy":"{orgName} asks you to confirm it's you","consent.notice":"By completing this identity verification, you consent to the processing of your personal and biometric data to verify your identity.","consent.details":"Learn more","consent.terms.intro":"Sekyro AI verifies your identity on behalf of the organization that sent you this link. Before you start, review how your data is used.","consent.terms.data":"During verification, Sekyro AI collects photos of your identity document, a short selfie video, a selfie photo, and your national identification number (NNI).","consent.terms.processing":"This data is used only to verify your identity: your face is compared with the photo on your document, and your NNI is checked against the civil registry. Some steps may be examined by an authorized human reviewer.","consent.terms.sharing":"The organization that requested this verification is informed of its outcome.","consent.terms.retention":"Your data is stored encrypted and kept only as long as the law requires. To exercise your data-protection rights, contact the organization that requested this verification.","otp.sendTitle":"Verify your phone number","otp.sendDescription":"We'll send you a one-time code to confirm this number is yours","otp.prefilledNotice":"We'll send a verification code to your registered phone number.","otp.phoneLabel":"Phone number","otp.phoneHelper":"We'll send a one-time code to this number","otp.phonePlaceholder":"+222 36 00 00 00","otp.send":"Send code","otp.channelSms":"SMS","otp.channelWhatsapp":"WhatsApp","otp.verifyTitle":"Enter the verification code","otp.verifyDescription":"Type the 6-digit code we sent you to finish verifying your number","otp.sentTo":"We sent a 6-digit code to {number} via {channel}","otp.codeLabel":"Verification code","otp.codeHelper":"Enter the 6-digit code we sent you","otp.verify":"Verify code","otp.resend":"Resend code","otp.resendIn":"Resend code in {seconds}s","otp.expiresIn":"Code expires in {time}","otp.expired":"That code has expired — resend a new one","otp.reason_otp_mismatch":"That code was incorrect — check it and enter it again","otp.reason_otp_expired":"That code has expired — resend a new code to continue","otp.reason_otp_send_failed":"We couldn't send the code — try again in a moment","otp.chooseChannel":"How should we send your code?","otp.sendBy":"Send code by {channel}","otp.resendBy":"Resend by {channel}","otp.reason_otp_channel_unavailable":"That channel isn't available — choose another way to get your code","otp.reason_otp_destination_not_allowed":"We can't send codes to numbers from this country — enter another number","otp.reason_otp_destination_unknown":"We couldn't recognise this number — check it and enter it again with the country code","otp.reason_otp_rate_limited":"Too many codes requested — wait a moment, then try again","session.steps.population.title":"Enter your national ID number","session.steps.population.description":"Your 10-digit NNI is checked against the civil registry","population.label":"National ID (NNI)","population.helper":"10-digit national identification number, exactly as printed on your ID","population.placeholder":"3501234567","population.submit":"Verify my number","population.invalid":"Enter the 10-digit NNI printed on your national ID","population.reason_registry_unavailable":"The civil registry is temporarily unreachable — your number was not checked. Try again in a moment","population.reason_nni_not_found":"This number was not found in the civil registry — check that it matches your ID exactly","population.reason_nni_invalid":"This is not a valid NNI — check the 10 digits printed on your national ID","population.bound.description":"The requester already provided your national ID number — confirm to check it against the civil registry","population.bound.confirm":"Confirm and continue","population.reason_nni_not_found_or_document":"We couldn't find this number. Check it, or use your document instead.","population.useDocument":"Use my document instead","population.fromDocument.title":"Checking the civil registry","population.fromDocument.description":"We're checking the national number from your document against the civil registry","population.fromDocument.continue":"Continue","session.steps.doc.titleRecto":"Photograph the front of your ID document","session.steps.doc.titleVerso":"Photograph the back of your ID document","session.steps.doc.description":"Use good lighting and keep the whole card inside the frame","doc.pickTitle":"Which document will you use?","doc.pickDescription":"Choose the identity document you have with you — you will scan it with your camera","doc.pickLabel":"Document type","doc.startScan":"Start scanning","doc.titlePassport":"Scan your passport data page","doc.reason_side_missing":"One side is saved — now photograph the remaining side of the document","doc.reason_unreadable":"We could not read the document — retake the photo with the whole card sharp and inside the frame","doc.process_failed":"We could not process this photo — take a new one and try again","doc.uploading":"Uploading your document…","doc.cameraBlocked":"We need your camera to scan the document — camera access is blocked or unavailable","doc.cameraBlockedHint":"Allow camera access for this site in your browser settings, then try again","doc.retryCamera":"Try the camera again","doc.holdUpright":"Fit the document inside the frame — it captures by itself. For a sharper photo, turn your phone sideways","dcv2.sensing":"Looking for the document — fit it inside the frame","dcv2.too_far":"Bring the document closer so it fills the frame","dcv2.too_close":"Move back a little — keep the whole document in the frame","dcv2.edge_clipped":"Fit the whole document inside the frame — keep the edges visible","dcv2.wrong_shape":"That doesn't look right — lay the document flat, straight toward the camera","dcv2.tilted":"Hold the phone flat above the document — too much angle","dcv2.too_dark":"Find a brighter spot — light the document","dcv2.too_bright":"Too much light — tilt the document away from the glare","dcv2.blurry":"Hold your phone steady — the image is blurry","dcv2.focus_far":"Too close to focus — move the phone a little farther","dcv2.glare":"Light is reflecting off the document — tilt it slightly","dcv2.hold_still":"Perfect — hold still","dcv2.processing":"Capturing…","dcv2.side_captured":"Side captured — flip the document to the back","dcv2.captured":"Captured","session.processing.title":"Your checks are being processed","session.processing.description":"This usually takes a few seconds — the result will appear here","handoff.title":"Continue on your phone","session.result.approved.title":"Your identity is verified","session.result.approved.description":"You are done — you can close this page","session.result.review.title":"Your verification is under review","session.result.review.description":"The result will be sent to the organization that gave you this link — you don't need to do anything else.","session.result.rejected.title":"Your identity could not be verified","session.result.rejected.description":"Contact the organization that sent you this link if you believe this is a mistake","session.result.expired.title":"This verification session has expired","session.result.expired.description":"Request a new link from the organization that sent it, then start again","session.result.detailsMismatch":"The details don't match the information {org} has. Contact {org}.","session.result.deviceVelocity":"This device can't be used for another verification right now. Contact {org}.","result.referenceLabel":"Reference code","common.loading":"Loading your verification session","common.refresh":"Refresh status","common.noAttemptsLeft":"No attempts left","session.steps.portrait.title":"Take your ID photo","session.steps.portrait.description":"Look straight at the camera with a neutral expression, in front of a plain, light wall","portrait.coach.no_face":"Place your face inside the oval","portrait.coach.multiple_faces":"Make sure no one else is in the picture","portrait.coach.center":"Center your face in the oval","portrait.coach.too_close":"Move back a little","portrait.coach.pose":"Look straight at the camera","portrait.coach.eyes":"Open your eyes a little more","portrait.coach.mouth":"Close your mouth, neutral expression","portrait.coach.glare":"Tilt your glasses or remove them","portrait.coach.lighting":"Face a window or a lamp","portrait.coach.lighting_side":"Avoid light from one side","portrait.coach.background":"Stand in front of a plain, light wall","portrait.coach.resolution":"Come a little closer","portrait.coach.hold_still":"Hold still","portrait.coach.hold":"Perfect — hold still","portrait.criteria.face":"Face in the oval","portrait.criteria.framing":"Centered","portrait.criteria.pose":"Looking straight","portrait.criteria.eyes":"Eyes open","portrait.criteria.mouth":"Neutral expression","portrait.criteria.glare":"No glare","portrait.criteria.lighting":"Even light","portrait.criteria.background":"Plain background","portrait.criteria.resolution":"Close enough","portrait.criteria.sharpness":"Steady","portrait.report.pose":"Head position","portrait.report.eyes":"Eyes","portrait.report.mouth":"Expression","portrait.report.occlusion":"Face uncovered","portrait.report.glare":"Glasses glare","portrait.report.lighting":"Lighting","portrait.report.background":"Background","portrait.report.resolution":"Distance","portrait.checksLabel":"Photo checks","portrait.met":"done","portrait.notMet":"not yet","portrait.starting":"Starting the camera…","portrait.taken":"Photo taken","portrait.uploading":"Sending your photo…","portrait.checking":"Checking your photo…","portrait.retryTitle":"Let's take your photo again","portrait.reportTitle":"What to fix","portrait.retake":"Take the photo again","portrait.uploadFailed":"We couldn't send your photo. Check your connection, then try again.","portrait.sendAgain":"Send the photo again","portrait.matching":"Comparing your photo with your identity document…","portrait.reviewTitle":"We'll review your photo","portrait.reviewDescription":"A member of our team will check your photo. You can continue.","portrait.cameraBlocked":"We need your camera to take your ID photo — camera access is blocked or unavailable","portrait.cameraBlockedHint":"Allow camera access for this site in your browser settings, then try again","portrait.retryCamera":"Try the camera again","reasons.icao_pose":"Look straight at the camera","reasons.icao_eyes":"Open your eyes a little more","reasons.icao_mouth":"Close your mouth and keep a neutral expression","reasons.icao_occlusion":"Remove anything covering your face, and tilt or remove your glasses","reasons.icao_lighting":"Face a window or a lamp, and avoid light from one side","reasons.icao_background":"Stand in front of a plain, light wall","reasons.icao_resolution":"Come a little closer to the camera","reasons.portrait_not_from_liveness":"The photo must be of the same person who did the face check. Take it again yourself","method.national_eid":"Verify with {provider}","method.national_eidGeneric":"Verify with your national eID","consent.short":"By continuing, you agree to the {terms}.","consent.termsLink":"terms","session.progressLabel":"Verification progress","section.contact":"Verify your contact","section.identity":"Verify your identity","section.live_photo":"Take a live photo","handoff.copied":"Link copied — open it on your phone","needsApp.title":"This verification needs a phone app","needsApp.description":"{org} asks to read your document's chip. Open {org}'s app on a phone with NFC to continue.","needsApp.descriptionNoOrg":"This verification reads your document's chip. Open the app on a phone with NFC to continue.","population.recheck.title":"Check your national number","population.recheck.description":"Your face didn't match the record for this number. Check the number and enter it again.","otp.phoneInvalid":"Enter your phone number with the country code, for example +222 36 00 00 00","otp.codeInvalid":"Enter the 6-digit code","doc.countryTitle":"Which country issued your document?","doc.countryLabel":"Issuing country","doc.countrySearch":"Search for a country","doc.noCountryMatch":"No country matches your search","doc.type.carte_identite":"Identity card","doc.type.residence_permit":"Residence permit","doc.type.passport":"Passport","doc.showSide":"Show one side of the card","doc.showPage":"Show the photo page","doc.flip":"Turn the card over","doc.sameFace":"Same side · turn the card over","doc.reaskRecto":"Show the front again","doc.reread":"We couldn't read this side · hold it steady in good light","doc.photoTaken":"Photo taken","doc.frontCaptured":"Front captured","doc.backCaptured":"Back captured","doc.pageCaptured":"Page captured","doc.progressFront":"Front","doc.progressBack":"Back","doc.progressPage":"Photo page","doc.shutter":"Take the photo","doc.torchOn":"Turn on the light","doc.torchOff":"Turn off the light","result.platform_unsupported":"This verification needs a phone app.","unsupported.title":"Update required","unsupported.description":"This step needs a newer version of this page. Contact {org}.","shell.subtitle":"Identity verification","shell.verifiedBy":"Verified by Sekyro AI","doc.sub.carte_identite":"Front and back","doc.sub.residence_permit":"Front and back","doc.sub.passport":"The page with your photo","native.close":"Close","native.face.introTitle":"Now let's check your face","native.face.introLead":"One capture, no special movement: just look at the screen.","native.doc.holdIt":"Keep your document within reach.","native.doc.changeCountry":"Change country","native.result.approved":"Your verification is complete. You can go back to {org}.","native.result.review":"The result will be sent to {org}. There's nothing else you need to do.","native.result.rejected":"Contact {org} if you think this is a mistake.","native.result.expired":"Start again from {org} to get a new session.","native.result.copied":"Copied","native.result.back":"Back to {org}"};var p={"session.title":"Vérifiez votre identité","session.requestedBy":"{orgName} vous demande de vérifier votre identité","returning.requestedBy":"{orgName} vous demande de confirmer qu'il s'agit bien de vous","consent.notice":"En poursuivant la vérification d'identité, vous consentez au traitement de vos données personnelles et biométriques afin de vérifier votre identité.","consent.details":"En savoir plus","consent.terms.intro":"Sekyro AI vérifie votre identité pour le compte de l'organisme qui vous a envoyé ce lien. Avant de commencer, consultez la façon dont vos données sont utilisées.","consent.terms.data":"Pendant la vérification, Sekyro AI recueille les photos de votre pièce d'identité, une courte vidéo selfie, une photo selfie et votre numéro national d'identification (NNI).","consent.terms.processing":"Ces données servent uniquement à vérifier votre identité : votre visage est comparé à la photo de votre document et votre NNI est vérifié auprès du registre d'état civil. Certaines étapes peuvent être examinées par un examinateur humain habilité.","consent.terms.sharing":"L'organisme qui a demandé cette vérification est informé de son résultat.","consent.terms.retention":"Vos données sont stockées chiffrées et conservées uniquement pendant la durée exigée par la loi. Pour exercer vos droits en matière de protection des données, contactez l'organisme qui a demandé cette vérification.","otp.sendTitle":"Vérifiez votre numéro de téléphone","otp.sendDescription":"Nous vous enverrons un code à usage unique pour confirmer que ce numéro vous appartient","otp.prefilledNotice":"Nous enverrons un code de vérification à votre numéro de téléphone enregistré.","otp.phoneLabel":"Numéro de téléphone","otp.phoneHelper":"Nous enverrons un code à usage unique à ce numéro","otp.phonePlaceholder":"+222 36 00 00 00","otp.send":"Envoyer le code","otp.channelSms":"SMS","otp.channelWhatsapp":"WhatsApp","otp.verifyTitle":"Saisissez le code de vérification","otp.verifyDescription":"Saisissez le code à 6 chiffres que nous vous avons envoyé pour finaliser la vérification de votre numéro","otp.sentTo":"Nous avons envoyé un code à 6 chiffres au {number} par {channel}","otp.codeLabel":"Code de vérification","otp.codeHelper":"Saisissez le code à 6 chiffres que nous vous avons envoyé","otp.verify":"Vérifier le code","otp.resend":"Renvoyer le code","otp.resendIn":"Renvoyer le code dans {seconds} s","otp.expiresIn":"Le code expire dans {time}","otp.expired":"Ce code a expiré — renvoyez-en un nouveau","otp.reason_otp_mismatch":"Ce code est incorrect — vérifiez-le et saisissez-le à nouveau","otp.reason_otp_expired":"Ce code a expiré — renvoyez un nouveau code pour continuer","otp.reason_otp_send_failed":"Nous n'avons pas pu envoyer le code — réessayez dans un instant","otp.chooseChannel":"Comment souhaitez-vous recevoir votre code ?","otp.sendBy":"Envoyer le code par {channel}","otp.resendBy":"Renvoyer par {channel}","otp.reason_otp_channel_unavailable":"Ce moyen d'envoi n'est pas disponible — choisissez une autre façon de recevoir votre code","otp.reason_otp_destination_not_allowed":"Nous ne pouvons pas envoyer de code aux numéros de ce pays — saisissez un autre numéro","otp.reason_otp_destination_unknown":"Nous n'avons pas reconnu ce numéro — vérifiez-le et saisissez-le à nouveau avec l'indicatif du pays","otp.reason_otp_rate_limited":"Trop de codes demandés — patientez un instant, puis réessayez","session.steps.population.title":"Saisissez votre numéro national d'identification","session.steps.population.description":"Votre NNI à 10 chiffres est vérifié auprès du registre d'état civil","population.label":"Numéro national d'identification (NNI)","population.helper":"Numéro national d'identification à 10 chiffres, tel qu'imprimé sur votre pièce","population.placeholder":"3501234567","population.submit":"Vérifier mon numéro","population.invalid":"Saisissez les 10 chiffres du NNI imprimé sur votre pièce d'identité","population.reason_registry_unavailable":"Le registre d'état civil est temporairement inaccessible — votre numéro n'a pas été vérifié. Réessayez dans un instant","population.reason_nni_not_found":"Ce numéro est introuvable dans le registre d'état civil — vérifiez qu'il correspond exactement à votre pièce","population.reason_nni_invalid":"Ce numéro n'est pas un NNI valide — vérifiez les 10 chiffres imprimés sur votre pièce d'identité","population.bound.description":"L'organisme demandeur a déjà fourni votre numéro national d'identification — confirmez pour le vérifier auprès de l'état civil","population.bound.confirm":"Confirmer et continuer","population.reason_nni_not_found_or_document":"Nous n'avons pas trouvé ce numéro. Vérifiez-le, ou utilisez plutôt votre document.","population.useDocument":"Utiliser plutôt mon document","population.fromDocument.title":"Vérification auprès du registre civil","population.fromDocument.description":"Nous vérifions le numéro national lu sur votre document auprès du registre civil","population.fromDocument.continue":"Continuer","session.steps.doc.titleRecto":"Photographiez le recto de votre pièce d'identité","session.steps.doc.titleVerso":"Photographiez le verso de votre pièce d'identité","session.steps.doc.description":"Utilisez un bon éclairage et gardez la carte entière dans le cadre","doc.pickTitle":"Quel document allez-vous utiliser ?","doc.pickDescription":"Choisissez la pièce d'identité en votre possession — vous la scannerez avec votre caméra","doc.pickLabel":"Type de document","doc.startScan":"Commencer le scan","doc.titlePassport":"Scannez la page de données de votre passeport","doc.reason_side_missing":"Une face est enregistrée — photographiez maintenant l'autre face du document","doc.reason_unreadable":"Nous n'avons pas pu lire le document — reprenez la photo avec la carte entière, nette et dans le cadre","doc.process_failed":"Nous n'avons pas pu traiter cette photo — prenez-en une nouvelle et réessayez","doc.uploading":"Envoi de votre document…","doc.cameraBlocked":"Nous avons besoin de votre caméra pour scanner le document — l'accès est bloqué ou indisponible","doc.cameraBlockedHint":"Autorisez l'accès à la caméra pour ce site dans les réglages du navigateur, puis réessayez","doc.retryCamera":"Réessayer la caméra","doc.holdUpright":"Placez le document dans le cadre — la capture est automatique. Pour une photo plus nette, tournez votre téléphone à l'horizontale","dcv2.sensing":"Recherche du document — placez-le dans le cadre","dcv2.too_far":"Rapprochez le document pour qu'il remplisse le cadre","dcv2.too_close":"Reculez un peu — gardez tout le document dans le cadre","dcv2.edge_clipped":"Placez tout le document dans le cadre — gardez les bords visibles","dcv2.wrong_shape":"Cela ne semble pas correct — posez le document à plat, face à la caméra","dcv2.tilted":"Tenez le téléphone à plat au-dessus du document — trop d'angle","dcv2.too_dark":"Trouvez un endroit plus lumineux — éclairez le document","dcv2.too_bright":"Trop de lumière — inclinez le document pour éviter les reflets","dcv2.blurry":"Tenez votre téléphone immobile — l'image est floue","dcv2.focus_far":"Trop près pour la mise au point — éloignez un peu le téléphone","dcv2.glare":"La lumière se reflète sur le document — inclinez-le légèrement","dcv2.hold_still":"Parfait — ne bougez plus","dcv2.processing":"Capture…","dcv2.side_captured":"Face capturée — retournez le document","dcv2.captured":"Capturé","session.processing.title":"Vos vérifications sont en cours de traitement","session.processing.description":"Cela prend généralement quelques secondes — le résultat s'affichera ici","handoff.title":"Continuez sur votre téléphone","session.result.approved.title":"Votre identité est vérifiée","session.result.approved.description":"C'est terminé — vous pouvez fermer cette page","session.result.review.title":"Votre vérification est en cours d'examen","session.result.review.description":"Le résultat sera transmis à l'organisation qui vous a envoyé ce lien — vous n'avez rien d'autre à faire.","session.result.rejected.title":"Votre identité n'a pas pu être vérifiée","session.result.rejected.description":"Contactez l'organisme qui vous a envoyé ce lien si vous pensez qu'il s'agit d'une erreur","session.result.expired.title":"Cette session de vérification a expiré","session.result.expired.description":"Demandez un nouveau lien à l'organisme qui l'a envoyé, puis recommencez","session.result.detailsMismatch":"Ces informations ne correspondent pas à celles dont dispose {org}. Contactez {org}.","session.result.deviceVelocity":"Cet appareil ne peut pas servir à une autre vérification pour le moment. Contactez {org}.","result.referenceLabel":"Code de référence","common.loading":"Chargement de votre session de vérification","common.refresh":"Actualiser le statut","common.noAttemptsLeft":"Plus aucune tentative","session.steps.portrait.title":"Prenez votre photo d’identité","session.steps.portrait.description":"Regardez la caméra bien en face, l’expression neutre, devant un mur uni et clair","portrait.coach.no_face":"Placez votre visage dans l'ovale","portrait.coach.multiple_faces":"Assurez-vous d'être seul sur la photo","portrait.coach.center":"Centrez votre visage dans l'ovale","portrait.coach.too_close":"Reculez un peu","portrait.coach.pose":"Regardez droit vers la caméra","portrait.coach.eyes":"Ouvrez un peu plus les yeux","portrait.coach.mouth":"Fermez la bouche, expression neutre","portrait.coach.glare":"Inclinez vos lunettes ou retirez-les","portrait.coach.lighting":"Placez-vous face à une fenêtre ou une lampe","portrait.coach.lighting_side":"Évitez la lumière venant d'un seul côté","portrait.coach.background":"Placez-vous devant un mur uni et clair","portrait.coach.resolution":"Rapprochez-vous un peu","portrait.coach.hold_still":"Ne bougez plus","portrait.coach.hold":"Parfait — ne bougez plus","portrait.criteria.face":"Visage dans l'ovale","portrait.criteria.framing":"Centré","portrait.criteria.pose":"Regard droit","portrait.criteria.eyes":"Yeux ouverts","portrait.criteria.mouth":"Expression neutre","portrait.criteria.glare":"Sans reflet","portrait.criteria.lighting":"Lumière uniforme","portrait.criteria.background":"Fond uni","portrait.criteria.resolution":"Assez proche","portrait.criteria.sharpness":"Stable","portrait.report.pose":"Position de la tête","portrait.report.eyes":"Yeux","portrait.report.mouth":"Expression","portrait.report.occlusion":"Visage dégagé","portrait.report.glare":"Reflets des lunettes","portrait.report.lighting":"Éclairage","portrait.report.background":"Arrière-plan","portrait.report.resolution":"Distance","portrait.checksLabel":"Contrôles de la photo","portrait.met":"validé","portrait.notMet":"pas encore","portrait.starting":"Démarrage de la caméra…","portrait.taken":"Photo prise","portrait.uploading":"Envoi de votre photo…","portrait.checking":"Vérification de votre photo…","portrait.retryTitle":"Reprenons votre photo","portrait.reportTitle":"À corriger","portrait.retake":"Reprendre la photo","portrait.uploadFailed":"Nous n'avons pas pu envoyer votre photo. Vérifiez votre connexion, puis réessayez.","portrait.sendAgain":"Renvoyer la photo","portrait.matching":"Comparaison de votre photo avec votre pièce d'identité…","portrait.reviewTitle":"Nous allons vérifier votre photo","portrait.reviewDescription":"Un membre de notre équipe vérifiera votre photo. Vous pouvez continuer.","portrait.cameraBlocked":"Nous avons besoin de votre caméra pour prendre votre photo d'identité — l'accès à la caméra est bloqué ou indisponible","portrait.cameraBlockedHint":"Autorisez l'accès à la caméra pour ce site dans les réglages du navigateur, puis réessayez","portrait.retryCamera":"Réessayer la caméra","reasons.icao_pose":"Regardez la caméra bien en face","reasons.icao_eyes":"Ouvrez un peu plus les yeux","reasons.icao_mouth":"Fermez la bouche et gardez une expression neutre","reasons.icao_occlusion":"Retirez ce qui couvre votre visage, et inclinez ou retirez vos lunettes","reasons.icao_lighting":"Placez-vous face à une fenêtre ou une lampe, sans lumière d’un seul côté","reasons.icao_background":"Placez-vous devant un mur uni et clair","reasons.icao_resolution":"Rapprochez-vous un peu de la caméra","reasons.portrait_not_from_liveness":"La photo doit être celle de la personne qui a fait le contrôle du visage. Reprenez-la vous-même","method.national_eid":"Vérifier avec {provider}","method.national_eidGeneric":"Vérifier avec votre eID national","consent.short":"En continuant, vous acceptez les {terms}.","consent.termsLink":"conditions","session.progressLabel":"Progression de la vérification","section.contact":"Vérifiez votre contact","section.identity":"Vérifiez votre identité","section.live_photo":"Prenez une photo en direct","handoff.copied":"Lien copié — ouvrez-le sur votre téléphone","needsApp.title":"Cette vérification nécessite une application mobile","needsApp.description":"{org} demande de lire la puce de votre document. Ouvrez l'application de {org} sur un téléphone avec NFC pour continuer.","needsApp.descriptionNoOrg":"Cette vérification lit la puce de votre document. Ouvrez l'application sur un téléphone avec NFC pour continuer.","population.recheck.title":"Vérifiez votre numéro national","population.recheck.description":"Votre visage ne correspond pas au dossier de ce numéro. Vérifiez le numéro et saisissez-le à nouveau.","otp.phoneInvalid":"Saisissez votre numéro avec l'indicatif du pays, par exemple +222 36 00 00 00","otp.codeInvalid":"Saisissez le code à 6 chiffres","doc.countryTitle":"Quel pays a délivré votre document ?","doc.countryLabel":"Pays de délivrance","doc.countrySearch":"Rechercher un pays","doc.noCountryMatch":"Aucun pays ne correspond à votre recherche","doc.type.carte_identite":"Carte d'identité","doc.type.residence_permit":"Titre de séjour","doc.type.passport":"Passeport","doc.showSide":"Montrez une face de la carte","doc.showPage":"Montrez la page avec la photo","doc.flip":"Retournez la carte","doc.sameFace":"Même face · retournez la carte","doc.reaskRecto":"Remontrez le recto","doc.reread":"Lecture impossible · tenez la carte stable, bien éclairée","doc.photoTaken":"Photo prise","doc.frontCaptured":"Recto capturé","doc.backCaptured":"Verso capturé","doc.pageCaptured":"Page capturée","doc.progressFront":"Recto","doc.progressBack":"Verso","doc.progressPage":"Page photo","doc.shutter":"Prendre la photo","doc.torchOn":"Allumer la lampe","doc.torchOff":"Éteindre la lampe","result.platform_unsupported":"Cette vérification nécessite une application mobile.","unsupported.title":"Mise à jour requise","unsupported.description":"Cette étape nécessite une version plus récente de cette page. Contactez {org}.","shell.subtitle":"Vérification d'identité","shell.verifiedBy":"Vérifié par Sekyro AI","doc.sub.carte_identite":"Recto et verso","doc.sub.residence_permit":"Recto et verso","doc.sub.passport":"La page avec votre photo","native.close":"Fermer","native.face.introTitle":"Vérifions maintenant votre visage","native.face.introLead":"Une seule prise, sans geste particulier : regardez simplement l'écran.","native.doc.holdIt":"Gardez votre document à portée de main.","native.doc.changeCountry":"Changer de pays","native.result.approved":"Votre vérification est terminée. Vous pouvez retourner à {org}.","native.result.review":"Le résultat sera transmis à {org}. Vous n'avez rien d'autre à faire.","native.result.rejected":"Contactez {org} si vous pensez qu'il s'agit d'une erreur.","native.result.expired":"Recommencez depuis {org} pour obtenir une nouvelle session.","native.result.copied":"Copiée","native.result.back":"Revenir à {org}"};import{createContext as h,useContext as m,useMemo as d}from"react";import{jsx as y}from"react/jsx-runtime";var v={en:c,fr:p,ar:s};function g(t,e){return e===void 0?t:t.replace(/\{(\w+)\}/g,(o,r)=>Object.hasOwn(e,r)?String(e[r]):o)}i(g,"formatTemplate");function f(t,e){let o={...a(t),...v[t]};if(e!==void 0)for(let r of Object.keys(e)){let n=e[r];typeof n=="string"&&(o[r]=n)}return o}i(f,"resolveSekyroStrings");var l=h(null);function u(t,e){let o=f(t,e);return{locale:t,strings:o,t:i((r,n)=>g(o[r]??"",n),"t")}}i(u,"build");function x({locale:t,strings:e,children:o}){let r=d(()=>u(t,e),[t,e]);return y(l.Provider,{value:r,children:o})}i(x,"StepI18nProvider");function N(t,e){let o=m(l);return d(()=>o!==null&&t===void 0&&e===void 0?o:u(t??o?.locale??"en",e),[o,t,e])}i(N,"useStepI18n");export{s as a,c as b,p as c,g as d,f as e,x as f,N as g};
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{a as Ht,b as Ft,c as N}from"./chunk-65JA6YKG.js";import{a as n,b as T,f as Tt,g as Kt,h as Ot,i as Ut,j as Gt,k as D,l as $e}from"./chunk-4RUZQW5T.js";import{useId as tr}from"react";import{Fragment as er,jsx as _,jsxs as W}from"react/jsx-runtime";function z({className:e,children:t}){return _("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}n(z,"Svg");var st="M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z";function Bt(e){return W(z,{...e,children:[_("circle",{cx:"12",cy:"12",r:"4"}),_("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}n(Bt,"SunIcon");function Dt(e){return W(z,{...e,children:[_("circle",{cx:"12",cy:"12",r:"9"}),_("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}n(Dt,"FaceUncoveredIcon");function $t(e){return W(z,{...e,children:[_("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),_("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),_("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}n($t,"PhoneEyeLevelIcon");function qt(e){return W(z,{...e,children:[_("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),_("circle",{cx:"12",cy:"12",r:"2.8"})]})}n(qt,"LookStraightIcon");function jt(e){return W(z,{...e,children:[_("path",{d:st}),_("path",{d:"M9 13l2 2 4-4"})]})}n(jt,"CameraCheckIcon");function Wt(e){return W(z,{...e,children:[_("path",{d:st}),_("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}n(Wt,"CameraAskIcon");function zt(e){return W(z,{...e,children:[_("path",{d:st}),_("path",{d:"M3 3l18 18"})]})}n(zt,"CameraBlockedIcon");function me({off:e,className:t}){return W(z,{...t!==void 0?{className:t}:{},children:[_("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?_("path",{d:"M4 4l16 16"}):W(er,{children:[_("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),_("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}n(me,"SpeakerIcon");function Yt(e){return _(z,{...e,children:_("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}n(Yt,"CheckIcon");function Zt(e){return W(z,{className:e.className??"sekyro-spinner",children:[_("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),_("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}n(Zt,"SpinnerIcon");import{jsx as re,jsxs as Xt}from"react/jsx-runtime";var qe=["light","uncover","eyeLevel","straight"],nr={light:{key:"capture.tips.light",icon:n(()=>re(Bt,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:n(()=>re(Dt,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:n(()=>re($t,{}),"icon")},straight:{key:"capture.tips.straight",icon:n(()=>re(qt,{}),"icon")}};function Qt({tips:e}){let t=N(),s=tr();return e.length===0?null:Xt("section",{className:"sekyro-tips","aria-labelledby":s,"data-testid":"sekyro-tips",children:[re("p",{className:"sekyro-tips__title",id:s,children:t("capture.tips.title")}),re("ul",{className:"sekyro-tips__list",children:e.map(o=>{let r=typeof o=="string"?nr[o]:void 0,i=typeof o=="string"?o:o.id,c=r!==void 0?r.icon():typeof o=="string"?void 0:o.icon,u=r!==void 0?t(r.key):typeof o=="string"?o:o.text;return Xt("li",{className:"sekyro-tips__item",children:[c!=null?re("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:c}):null,re("span",{children:u})]},i)})})]})}n(Qt,"TipList");var je=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","capture.tips.summary"];function ce(e){return e!==null&&je.includes(e)}n(ce,"isVoiceKey");import{useCallback as Z,useEffect as le,useLayoutEffect as ir,useMemo as ar,useRef as he,useState as Le}from"react";var rr=n((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function ge(e,t,s){let o;try{if(typeof e=="function")o=e(t,s);else{let r=e[s];o=r!=null&&rr(r,t)?r[t]:null}}catch{return null}return typeof o=="string"&&o!==""?o:null}n(ge,"resolveClip");var or="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",tn={ar:"ar-SA",fr:"fr-FR",en:"en-US"};function Y(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}n(Y,"synth");function sr(){return Y()!==null&&typeof SpeechSynthesisUtterance=="function"}n(sr,"speechAvailable");function Jt(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}n(Jt,"baseLang");function nn(e,t){let s=n(r=>r.replace(/_/g,"-").toLowerCase(),"norm"),o=Jt(t);return e.find(r=>s(r.lang)===s(t))??e.find(r=>Jt(r.lang)===o)}n(nn,"pickVoice");function rn(e){if(!sr())return!1;let t=[];try{t=Y()?.getVoices()??[]}catch{return!0}return t.length===0||nn(t,e)!==void 0}n(rn,"speechUsable");function on(e){let t=Y();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}n(on,"subscribeVoices");function xe(e){try{let t=typeof location<"u"?location.href:"http://localhost/",s=new URL(e,t);return`clip:${s.origin}${s.pathname}`}catch{return`clip:${e}`}}n(xe,"clipIdentity");function en(e){e.pause(),e.removeAttribute("src"),e.load()}n(en,"release");function sn(){let e=null,t=null,s=0,o=null,r=[],i=new Map,c=n(()=>{r=Y()?.getVoices()??[]},"loadVoices"),u=!1,p=n(()=>{let l=Y();u||l===null||(u=!0,c(),l.addEventListener?.("voiceschanged",c))},"bindVoices"),V=n(()=>(e??(e=new Audio),e),"element"),m=n((l,g,h)=>{let C=Y();if(C!==null&&l!==""&&typeof SpeechSynthesisUtterance=="function"){p();let R=nn(r,g);if(r.length===0||R!==void 0){C.cancel();let y=new SpeechSynthesisUtterance(l);y.lang=g,R!==void 0&&(y.voice=R),y.rate=.95,h!==void 0&&(y.onend=y.onerror=h),C.speak(y);return}}h?.()},"speak"),b=n(()=>{s+=1,o=null,e!==null&&(e.pause(),e.currentTime=0),Y()?.cancel()},"stop"),f=n(l=>{for(let g of l){let h=xe(g);if(i.has(h))continue;let C=new Audio;C.preload="auto",C.src=g,i.set(h,C)}},"warmClips");return{say(l){let g=l.url!==null?xe(l.url):`tts:${l.lang}:${l.text}`;if(g===o)return;o=g,s+=1;let h=s,C=l.onEnd,R=C!==void 0?()=>{h===s&&C()}:void 0;if(Y()?.cancel(),l.url!==null){let y=V();y.pause(),y.muted=!1,y.src=l.url,y.currentTime=0,y.onended=R??null,y.play()?.catch(S=>{h===s&&S?.name!=="AbortError"&&(l.speech?m(l.text,l.lang,R):R?.())});return}l.speech?m(l.text,l.lang,R):R?.()},unlock({lang:l,speech:g,prefetch:h}){let C=V();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let S=Uint8Array.from(atob(or),x=>x.charCodeAt(0));t=URL.createObjectURL(new Blob([S],{type:"audio/wav"}))}let R=C.paused===!1&&t!==null&&C.src!==t;t!==null&&!R&&(C.muted=!0,C.onended=null,C.src=t,C.play()?.catch(()=>{}));let y=Y();if(g&&y!==null&&typeof SpeechSynthesisUtterance=="function"){p();let S=new SpeechSynthesisUtterance(" ");S.volume=0,S.lang=l,y.speak(S)}f(h??[])},prefetch:f,stop:b,dispose(){b(),u&&Y()?.removeEventListener?.("voiceschanged",c),u=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&en(e),e=null;for(let l of i.values())en(l);i.clear()}}}n(sn,"createVoicePlayer");var an="sekyro.voiceGuidance";function cn(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}n(cn,"readVoicePreference");function ln(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}n(ln,"writeVoicePreference");var we="capture.tips.summary",cr=typeof window<"u"?ir:le,lr=Object.freeze({});function it(e,t){let s=new Set,o=[];for(let r of je){let i=r===we?null:ge(e,r,t);i===null||s.has(xe(i))||(s.add(xe(i)),o.push(i))}return o}n(it,"resolvedClipUrls");function at({locale:e,defaultClips:t,options:s}){let o=s===!1,r=o?{}:s??{},i=r.storageKey===void 0?an:r.storageKey,[c,u]=Le(r.defaultEnabled??!0),p=he(c),[V,m]=Le(!1),[b,f]=Le("none"),[l,g]=Le(!1),h=he(!1),[C,R]=Le(0),y=he(null),S=Z(()=>(y.current??(y.current=sn()),y.current),[]),x=tn[e],K=r.speechFallback,v=K===void 0||K===!0?!0:K===!1?!1:K.includes(e),M=r.clips??t??lr,F=he(!1),O=he(M);cr(()=>{O.current=M,p.current=c}),le(()=>{if(o||i===null)return;let d=cn(i);d!==null&&(p.current=d,u(d))},[o,i]),le(()=>{if(!(o||!v))return on(()=>R(d=>d+1))},[o,v]);let a=r.clips;le(()=>{if(o)return;let d=v&&rn(x);m(it(M,e).length>0||d),f(a!==void 0&&ge(a,we,e)!==null?"partner":ge(M,we,e)!==null||d?"default":"none")},[o,M,a,e,v,x,C]),le(()=>{if(o||!c||!F.current)return;let d=it(M,e);d.length>0&&S().prefetch(d)},[o,c,M,e,S]),le(()=>()=>{y.current?.dispose(),y.current=null,F.current=!1},[]);let A=Z(d=>{o||(F.current=!0,S().unlock({lang:x,speech:v,...d?{prefetch:it(O.current,e)}:{}}))},[o,S,x,v,e]),w=Z(()=>A(p.current),[A]),H=Z(()=>{h.current=!1,g(!1)},[]),E=Z(()=>{H(),y.current?.stop()},[H]),oe=Z(()=>{h.current&&E()},[E]),U=Z((d,q)=>{if(o)return;if(h.current){E();return}let ee=S();ee.stop(),h.current=!0,g(!0);let Ke=q?.clip===!1?null:ge(O.current,we,e);ee.say({url:Ke,text:d,lang:x,speech:v,onEnd:H})},[o,E,S,e,x,v,H]),P=Z(d=>{o||(d?A(!0):E(),i!==null&&ln(i,d),p.current=d,u(d))},[o,A,E,i]),k=Z(()=>P(!p.current),[P]),se=Z((d,q)=>{if(o||!c)return;h.current&&H();let ee=ge(O.current,d,e);S().say({url:ee,text:q,lang:x,speech:v})},[o,c,e,S,x,v,H]);return ar(()=>({supported:!o&&V,enabled:!o&&c,setEnabled:P,toggle:k,unlock:w,speakKey:se,stop:E,summary:o?"none":b,summaryPlaying:l,toggleSummary:U,stopSummary:oe}),[o,V,c,P,k,w,se,E,b,l,U,oe])}n(at,"useVoiceGuidance");function ct(e,t,s,o){let{speakKey:r,stop:i,enabled:c}=e,u=he(!1);le(()=>{if(!o||!c){u.current&&i(),u.current=!1;return}u.current=!0,ce(t)&&t!==we&&s!==""&&r(t,s)},[o,c,t,s,r,i])}n(ct,"useSpeakGuidance");import{isValidElement as qr,useCallback as Xe,useContext as jr,useEffect as ue,useMemo as be,useRef as de,useState as $n}from"react";import{jsx as Ee,jsxs as un}from"react/jsx-runtime";var ur=Array.from({length:56},(e,t)=>{let s=t/56*2*Math.PI-Math.PI/2,o=Math.cos(s),r=Math.sin(s);return{id:`tick-${t}`,frac:t/55,x1:150+108*o,y1:150+108*r,x2:150+138*o,y2:150+138*r,style:{transitionDelay:`${t*6}ms`}}});function dr(e,t,s,o){return s?"var(--sekyro-color-success)":e?o?"color-mix(in srgb, var(--sekyro-color-warning) 75%, transparent)":t<.33?"color-mix(in srgb, var(--sekyro-color-brand) 55%, transparent)":t<.66?"color-mix(in srgb, var(--sekyro-color-brand) 80%, transparent)":"var(--sekyro-color-brand)":"color-mix(in srgb, var(--sekyro-color-surface) 32%, transparent)"}n(dr,"tickColor");var pr="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function dn({progress:e,phase:t,draining:s=!1}){let o=Math.min(1,Math.max(0,e)),r=Math.round(o*56),i=t==="checking",c=t==="recording",u=t==="frozen",p=i||u,V=i||c||u,m=t==="locked"||V,b=s&&!m;return un("svg",{"aria-hidden":"true",viewBox:"0 0 300 300",preserveAspectRatio:"xMidYMid meet",className:"sekyro-stage__arc","data-testid":"sekyro-capture-arc","data-phase":t,"data-filled":r,"data-recording":c?"":void 0,"data-draining":b?"":void 0,children:[Ee("path",{fillRule:"evenodd",d:pr,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":p?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),un("g",{className:t==="locked"?"sekyro-capture-settle":void 0,children:[Ee("g",{className:p?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:ur.map((f,l)=>Ee("line",{x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,stroke:dr(l<r,f.frac,m,b),strokeWidth:3,strokeLinecap:"round",style:f.style,className:"sekyro-arc__tick"},f.id))}),Ee("g",{className:t==="seeking"?"sekyro-capture-breathe":void 0,children:Ee("circle",{cx:150,cy:150,r:100,fill:"none",stroke:m?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:m?3.5:2.5,className:V?"sekyro-arc__guide sekyro-arc__guide--spin sekyro-capture-ring-spin":"sekyro-arc__guide sekyro-capture-fade-in","data-testid":"sekyro-capture-guide"})})]})]})}n(dn,"CaptureArc");import{jsx as G,jsxs as Ne}from"react/jsx-runtime";function pn({videoRef:e,guidanceText:t,guidanceHint:s,guidanceKey:o,progress:r,phase:i,draining:c=!1,stillUrl:u,showChecking:p,onSwitchCamera:V,canSwitchCamera:m,voicePrompt:b,overlay:f,reduceMotion:l=!1}){let g=N(),h=i==="checking",R=h||i==="frozen",y=R&&p?g("capture.checking"):t,S=b?.(s,y,o);return Ne("div",{className:l?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[G("video",{ref:e,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),u!==null&&R?G("img",{src:u,alt:g("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,G(dn,{progress:r,phase:i,draining:c}),f?.(e),S!=null&&!R?G("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:S}):null,m?G(T,{kind:"chip",onClick:V,"aria-label":g("capture.switchCamera"),className:"sekyro-stage__corner-end","data-testid":"sekyro-switch-camera",children:G(fr,{})}):null,h&&p?Ne("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[G(yr,{}),g("capture.cameraOff")]}):null,Ne("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[G("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:y},y),R&&p?G("span",{className:"sekyro-stage__guidance-hint",children:g("capture.checkingHint")}):null]})]})}n(pn,"CaptureStage");function fr(){return Ne("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[G("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),G("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),G("path",{d:"M8.6 13.4a3.5 3.5 0 0 0 6.1 1.4M8.6 13.4h2.1m-2.1 0v2.1"})]})}n(fr,"FlipCameraIcon");function yr(){return Ne("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon sekyro-icon--sm",children:[G("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),G("path",{d:"M3 3l18 18"})]})}n(yr,"CameraOffIcon");import{useEffect as mr,useRef as gr}from"react";import{jsx as ve,jsxs as lt}from"react/jsx-runtime";function fn({showCoaching:e,attemptsText:t,showRetake:s,onRetake:o}){let r=N(),i=gr(null);return mr(()=>{s&&i.current?.focus()},[s]),!e&&!s?null:lt("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?lt("div",{className:"sekyro-stack sekyro-stack--1",children:[ve("p",{className:"sekyro-text-body",children:r("capture.retryCoaching.title")}),lt("ul",{className:"sekyro-coaching",children:[ve("li",{children:r("capture.retryCoaching.light")}),ve("li",{children:r("capture.retryCoaching.eyeLevel")}),ve("li",{children:r("capture.retryCoaching.head")})]}),t!==null?ve("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:t}):null]}):null,s?ve(T,{ref:i,className:"sekyro-btn--start",onClick:o,children:r("capture.recordAgain")}):null]})}n(fn,"CapturedPanel");function We(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}n(We,"isDevBuild");import{createContext as hr}from"react";var yn=hr(null);import{useCallback as kn,useEffect as Cn,useRef as ke}from"react";import{useId as vr}from"react";import{jsx as ze,jsxs as ut}from"react/jsx-runtime";var kr=["user","environment"];function mn({value:e,onChange:t}){let s=N(),o=vr();return ut("fieldset",{className:"sekyro-segmented","data-testid":"sekyro-facing",children:[ze("legend",{className:"sekyro-segmented__legend",children:s("capture.cameraLabel")}),ze("div",{className:"sekyro-segmented__options",children:kr.map(r=>ut("label",{className:"sekyro-segmented__option",children:[ze("input",{type:"radio",className:"sekyro-segmented__input",name:o,value:r,checked:e===r,onChange:()=>t(r)}),ut("span",{className:"sekyro-segmented__face",children:[ze("span",{className:"sekyro-segmented__dot","aria-hidden":"true"}),s(`capture.facing.${r}`)]})]},r))})]})}n(mn,"FacingPicker");import{useEffect as Cr,useState as br}from"react";import{jsx as Me,jsxs as Sr}from"react/jsx-runtime";function gn({state:e}){let t=N(),[s,o]=br(!1);Cr(()=>{e!=="unknown"&&o(!0)},[e]);let r=e==="granted"?Me(jt,{}):e==="denied"?Me(zt,{}):Me(Wt,{});return Sr("div",{role:s?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[Me("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:r}),Me("span",{children:t(`capture.permission.${e}`)})]})}n(gn,"PermissionRow");import{jsx as Ye,jsxs as hn}from"react/jsx-runtime";function vn({voice:e}){let t=N();if(!e.supported)return null;let s=e.enabled;return hn("button",{type:"button",role:"switch","aria-checked":s,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:()=>e.toggle(),children:[hn("span",{className:"sekyro-switch__label",children:[Ye(me,{off:!s}),t("capture.voiceGuidance")]}),Ye("span",{className:"sekyro-switch__track","aria-hidden":"true",children:Ye("span",{className:"sekyro-switch__thumb",children:s?Ye(Yt,{className:"sekyro-switch__check"}):null})})]})}n(vn,"VoiceSwitch");import{Fragment as Rr,jsx as $,jsxs as Ae}from"react/jsx-runtime";function bn({assets:e,onRetryAssets:t,permission:s,canChooseFacing:o,facing:r,onFacingChange:i,voice:c,tips:u,summary:p,startLabel:V,startDisabled:m,onStart:b}){let f=N(),l=ke(p?.stop);l.current=p?.stop,Cn(()=>()=>l.current?.(),[]);let g=ke(null),h=ke(null),C=ke(null),R=ke(e),y=ke(!1);Cn(()=>{let F=R.current;if(R.current=e,F===e)return;let O=y.current;e!=="loading"&&(y.current=!1),Vr(g.current)&&(e==="failed"?C.current?.focus():O&&h.current?.focus())},[e]);let S=kn(()=>{y.current=!0,t()},[t]),x=e==="loading",K=x||m,v=kn(()=>{K||(l.current?.(),b())},[K,b]),M;return e==="failed"?M=Ae(D,{tone:"danger",testId:"sekyro-assets-error",children:[$("p",{className:"sekyro-text-body",children:f("fcv2.err.models")}),$(T,{kind:"ghost",ref:C,className:"sekyro-btn--start",onClick:S,"data-testid":"sekyro-assets-retry",children:f("common.retry")})]}):M=Ae("div",{className:"sekyro-stack sekyro-stack--1",children:[$(T,{ref:h,full:!0,"data-testid":"sekyro-start","aria-disabled":K?"true":void 0,"aria-busy":x?"true":void 0,onClick:v,children:x?Ae(Rr,{children:[$(Zt,{}),f("capture.preparing.title")]}):V??f("capture.start")}),x?$("p",{className:"sekyro-text-muted",children:f("capture.preparing.hint")}):null]}),Ae("div",{ref:g,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[u!==!1?$(Qt,{tips:u}):null,p!==void 0?Ae(T,{kind:"ghost",className:"sekyro-btn--start",onClick:p.toggle,"data-testid":"sekyro-tips-listen",children:[$(me,{off:!1}),f(p.playing?"capture.tips.stop":"capture.tips.listen")]}):null,$(gn,{state:s}),o?$(mn,{value:r,onChange:i}):null,$(vn,{voice:c}),$("p",{className:"sekyro-text-muted",children:f("capture.securityNote")}),M,$("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?f("capture.preparing.title"):e==="ready"?f("capture.ready"):""})]})}n(bn,"PreCaptureScreen");function Vr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}n(Vr,"focusIsOurs");import{useId as _r}from"react";import{jsx as Ce,jsxs as Sn}from"react/jsx-runtime";function Vn({choice:e,busy:t,failed:s,focus:o,eidLabel:r,onSelect:i}){let c=N(),u=_r(),p=$e(),V=e.options.filter(m=>m!=="document_chip"&&(m!=="national_eid"||r!==void 0));return Sn("section",{className:"sekyro-stack sekyro-stack--4","aria-labelledby":u,"data-testid":"sekyro-method",children:[Sn("div",{className:"sekyro-stack sekyro-stack--1",children:[Ce("h2",{id:u,className:"sekyro-text-body",children:c("method.title")}),Ce("p",{className:"sekyro-text-muted",children:c("method.description")})]}),s?Ce(D,{tone:"danger",children:Ce("span",{children:c("errors.network_error")})}):null,Ce("div",{className:"sekyro-stack sekyro-stack--3",children:V.map((m,b)=>Ce(T,{ref:b===0&&o?p:void 0,kind:b===0?"primary":"ghost",full:!0,disabled:t,"aria-busy":t||void 0,onClick:()=>i(m),children:m==="national_eid"?r:c(`method.${m}`)},m))})]})}n(Vn,"MethodScreen");import{hasMultipleCameras as Ir,subscribeCameraPermission as xr}from"@sekyro/web";import{useEffect as Rn,useState as _n}from"react";function In(){let[e,t]=_n({state:"unknown",settled:!1}),[s,o]=_n(!1);return Rn(()=>xr(r=>t({state:r,settled:!0})),[]),Rn(()=>{let r=!0;return Ir().then(i=>{r&&o(i)}),()=>{r=!1}},[]),{permission:e.state,permissionSettled:e.settled,canChooseFacing:s}}n(In,"useCameraStatus");import{useEffect as xn,useState as Ln}from"react";function wn(e){return Nn(e,"mobileRequired")}n(wn,"useMobileRequired");function En(e){return Nn(e,"returning").required}n(En,"useReturning");function Nn(e,t){let[s,o]=Ln({required:!1,settled:e===void 0});return xn(()=>{let r=e?.[t];if(e===void 0||typeof r!="function"){o({required:!1,settled:!0});return}let i=!0;return o({required:!1,settled:!1}),Promise.resolve().then(()=>r.call(e)).then(c=>{i&&o({required:c===!0,settled:!0})},()=>{i&&o({required:!1,settled:!0})}),()=>{i=!1}},[e,t]),s}n(Nn,"useFlag");function Mn(e){let[t,s]=Ln(!1);return xn(()=>{if(s(!1),e===void 0)return;let o=e.on("busy",()=>s(!0)),r=e.on("result",()=>s(!1));return()=>{o(),r()}},[e]),t}n(Mn,"useBusy");import{getLivenessAssetsStatus as Lr,preloadLivenessAssets as wr,subscribeLivenessAssets as Er}from"@sekyro/web";import{useCallback as dt,useEffect as An,useRef as Pn,useState as Nr,useSyncExternalStore as Mr}from"react";var Ar=n(()=>"idle","serverSnapshot");function Tn(e){return wr(e!==void 0?{assetBaseUrl:e}:{})}n(Tn,"preload");function Kn(e,t=!0){let s=Mr(dt(b=>Er(b,e),[e]),()=>Lr(e),Ar),[o,r]=Nr(null),i=Pn(!1),c=dt(()=>{Tn(e).then(b=>{i.current&&b==="idle"&&r({base:e})})},[e]);An(()=>(i.current=!0,c(),()=>{i.current=!1}),[c]);let u=Pn(null);An(()=>{if(s!=="idle"){u.current={base:e};return}!t||u.current===null||u.current.base!==e||(u.current=null,c())},[s,e,c,t]);let p=dt(()=>{Tn(e)},[e]);return{gate:o!==null&&o.base===e&&s==="idle"||s==="ready"?"ready":s==="failed"?"failed":"loading",retry:p}}n(Kn,"useLivenessAssets");import{createLivenessCapture as Pr}from"@sekyro/web";import{useCallback as pt,useEffect as Tr,useRef as Pe,useState as J}from"react";var On={progress:0,hint:null,faceDetected:!1};function Un(e){let{videoRef:t,assetBaseUrl:s}=e,r=Pe(e.verification).current,i=Pe(!1);e.verification!==r&&!i.current&&We()&&(i.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: the `verification` prop changed identity after mount. The first instance stays bound (the camera is not rebuilt); create the verification once (useMemo / useState / outside render) instead of on every render."));let c=Pe(null),[u,p]=J("idle"),[V,m]=J(On),[b,f]=J(!1),[l,g]=J(!1),[h,C]=J(null),[R,y]=J(!1),[S,x]=J(null),[K,v]=J(null),[M,F]=J(null),O=Pe(null),a=Pe(e);a.current=e,Tr(()=>{let E=t.current;if(E===null)return;let oe={video:E,...s!==void 0?{assetBaseUrl:s}:{}},U=r!==void 0?r.liveness(oe):Pr(oe);c.current=U;let P=[U.on("state",k=>{k==="starting"&&(x(null),v(null),m(On),g(!1),f(!1),C(null),O.current=null),p(k),a.current.onStateChange?.(k)}),U.on("gate",k=>{let se=O.current;O.current=k.progress,f(se!==null&&k.progress<se-.001&&k.progress>0&&k.progress<1),k.progress>=1&&g(!0),m(k)}),U.on("frozen",({previewDataUrl:k})=>C(k)),U.on("profile",({animations:k})=>y(k==="reduced")),U.on("captured",k=>{x(k),F(null),a.current.onCaptured?.(k)}),U.on("error",k=>{v(k),a.current.onError?.(k)}),r?.on("result",k=>{F(k),a.current.onResult?.(k)})];return()=>{for(let k of P)k?.();c.current=null,U.destroy()}},[r,t,s]);let A=pt(E=>{c.current?.start(E)},[]),w=pt(()=>{c.current?.retry()},[]),H=pt(()=>{g(!1),f(!1),C(null),O.current=null,c.current?.switchCamera()},[]);return{state:u,gate:V,draining:b,gateLocked:l,frozenPreview:h,reduceMotion:R,artifacts:S,error:K,result:M,start:A,retry:w,switchCamera:H}}n(Un,"useLivenessHandle");import{useCallback as Kr,useEffect as Or,useState as Ze}from"react";var Ur=new Set(["national_number"]);function Gn(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(s=>Ur.has(s));return t.length>0?{...e,options:t}:null}n(Gn,"pending");function Hn(e){let[t,s]=Ze(null),[o,r]=Ze(e===void 0),[i,c]=Ze(!1),[u,p]=Ze(!1);Or(()=>{if(s(null),e===void 0){r(!0);return}let f=!0,l=e.methodChoice;typeof l=="function"?(r(!1),Promise.resolve().then(()=>l.call(e)).then(h=>{f&&s(Gn(h))},()=>{}).finally(()=>{f&&r(!0)})):r(!0);let g=e.on("method",h=>s(Gn(h)));return()=>{f=!1,g()}},[e]);let V=Kr(async f=>{if(e===void 0)return!1;c(!0),p(!1);try{return await e.selectMethod(f),s(null),!0}catch{return p(!0),!1}finally{c(!1)}},[e]),m=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:m==="national_number"&&!u?m:null,settled:o,busy:i,failed:u,select:V}}n(Hn,"useMethodChoice");import{useEffect as Gr,useMemo as Hr,useState as Fr}from"react";var Br=["ar","fr","en"];function Dr(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}n(Dr,"isClipUrl");function $r(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let s={};for(let o of Br){let r=t[o];if(!(typeof r!="object"||r===null))for(let[i,c]of Object.entries(r))!ce(i)||!Dr(c)||((s[o]??(s[o]={}))[i]=c)}return Object.keys(s).length>0?s:null}n($r,"toVoiceClipMap");function Fn(e){let[t,s]=Fr(null);Gr(()=>{if(s(null),e===void 0)return;let r=!0,i=n(u=>{if(!r)return;let p=typeof u=="object"&&u!==null&&typeof u.setId=="string"?u:null;s(V=>V?.setId===p?.setId?V:p)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(i,()=>i(null))}catch{i(null)}let c=e.on("view",u=>i(u.voice));return()=>{r=!1,c()}},[e]);let o=Hr(()=>t!==null?$r(t):null,[t]);return e===void 0?null:o}n(Fn,"useServerVoiceClips");import{jsx as Bn}from"react/jsx-runtime";function Dn({voice:e}){let t=N();return Bn(T,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:()=>e.toggle(),children:Bn(me,{off:!e.enabled,className:"sekyro-icon"})})}n(Dn,"VoiceChip");import{Fragment as Jr,jsx as I,jsxs as Te}from"react/jsx-runtime";var Wr=800;function zr(e){return e===void 0||e!==!1&&e.length===qe.length&&qe.every(t=>e.includes(t))}n(zr,"isDefaultTips");function Yr(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}n(Yr,"carriesActivation");function Zr(e){return typeof e=="object"&&e!==null&&!qr(e)&&"tone"in e&&"text"in e}n(Zr,"isNoticeObject");function Xr(e){return e==="starting"||e==="gating"||e==="recording"}n(Xr,"isCapturing");function Qr(e){return e==="captured"||e==="uploading"||e==="checking"}n(Qr,"isPostCapture");function _i({verification:e,locale:t,dir:s,strings:o,slots:r,autoStart:i=!1,notice:c,startDisabled:u=!1,startLabel:p,tips:V,tipsSummary:m,coach:b,defaultFacing:f,voice:l,onGuidance:g,onCaptured:h,onResult:C,onError:R,onStateChange:y,assetBaseUrl:S,className:x}){let K=be(()=>Ht(t,o),[t,o]),v=be(()=>L=>K[L]??"",[K]),M=s??(t==="ar"?"rtl":"ltr"),F=de(null),O=jr(yn),a=Un({verification:e,videoRef:F,assetBaseUrl:S,onCaptured:h,onResult:C,onError:R,onStateChange:y}),A=Kn(S,a.state==="idle"&&a.error===null),w=Hn(e),H=w.choice!==null,E=wn(e),oe=En(e),U=Mn(e),P=In(),k=l!==!1&&l?.clips===void 0,se=Fn(k?e:void 0),d=at({locale:t,defaultClips:se,options:l}),[q,ee]=$n(f??"user"),Ke=de(null),Oe=de(!1),ft=de(d.unlock);ft.current=d.unlock,ue(()=>{let L=Ke.current;if(L===null)return;let ae=["pointerup","touchend","click","keydown"],ne=n(()=>{for(let Ie of ae)L.removeEventListener(Ie,ye,!0)},"disarm");function ye(Ie){if(Oe.current){ne();return}Yr(Ie)&&(Oe.current=!0,ne(),ft.current())}n(ye,"onGesture");for(let Ie of ae)L.addEventListener(Ie,ye,{capture:!0,passive:!0});return ne},[]);let yt=Xe(()=>{Oe.current||(Oe.current=!0,d.unlock()),a.start({facing:q})},[d.unlock,a.start,q]),mt=Xe(()=>a.start({facing:q}),[a.start,q]),Ue=de(!1),Se=a.state==="idle"&&a.error===null,gt=!H&&!E.required&&(i===!0||i==="when-permitted"&&P.permission==="granted"),ht=gt&&w.settled&&E.settled,qn=i==="when-permitted"&&!P.permissionSettled&&!Ue.current,vt=gt&&Se&&!Ue.current,Qe=(qn||vt)&&A.gate==="ready"?"loading":A.gate;ue(()=>{!ht||!Se||A.gate!=="ready"||Ue.current||(Ue.current=!0,mt())},[ht,Se,A.gate,mt]);let jn=Se&&!H&&!E.required&&!(vt&&A.gate==="ready"),Wn=Xe(()=>{ee(L=>L==="user"?"environment":"user"),a.switchCamera()},[a.switchCamera]),Ge=be(()=>a.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(a.artifacts.keyframe):null,[a.artifacts]);ue(()=>{if(Ge!==null)return()=>URL.revokeObjectURL(Ge)},[Ge]);let kt=a.frozenPreview??Ge,pe=e!==void 0,B=Xr(a.state),te=Qr(a.state),He=B||te,j=a.result,Ct=a.state==="done"&&j!==null,bt=a.state==="recording"&&a.frozenPreview!==null,Je=O!==null,Ve=te||bt,St=te?"checking":bt?"frozen":a.state==="recording"?"recording":a.gateLocked||a.gate.progress>=1?"locked":a.gate.faceDetected?"aligning":"seeking",Fe=B?a.gate.hint:null,Be=a.state==="starting"?"capture.preparing.title":Fe===null?null:Fe==="center"&&!a.gate.faceDetected?"fcv3.no_face":Tt(Fe),[zn,Vt]=$n(null);ue(()=>{if(Be!=="fcv3.no_face"){Vt(Be);return}if(!B)return;let L=setTimeout(()=>Vt(Be),Wr);return()=>clearTimeout(L)},[Be,B]);let et=B&&typeof b=="string"&&b!=="",ie=B&&!et?zn:null,tt=et?b:ie===null?"":v(ie);ct(d,ie,tt,B);let Rt=de(g);Rt.current=g,ue(()=>{if(ce(ie))try{Rt.current?.(ie)}catch(L){console.error("[@sekyro/react] onGuidance threw:",L)}},[ie]);let Re=be(()=>({supported:d.supported,enabled:d.enabled,setEnabled:d.setEnabled,toggle:d.toggle}),[d.supported,d.enabled,d.setEnabled,d.toggle]),nt=r?.voicePrompt,_t=nt!==void 0,It=l===void 0,xt=de(!1);ue(()=>{!_t||!It||xt.current||!We()||(xt.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: `slots.voicePrompt` is set and `voice` is undefined, so the component speaks the guidance itself. If your slot plays audio, pass voice={false} or the person hears every hint twice; pass voice={{}} to keep the built-in voice and silence this warning."))},[_t,It]);let Yn=nt!==void 0?(L,ae,ne)=>nt(L,ae,ne,Re):d.supported?()=>I(Dn,{voice:Re}):void 0,{summary:rt,summaryPlaying:Lt,toggleSummary:wt,stopSummary:Et}=d,De=m!==void 0&&m!=="",Nt=De?m:v("capture.tips.summary"),Mt=De?rt!=="none":rt==="partner"||rt==="default"&&zr(V),At=be(()=>Mt?{playing:Lt,toggle:n(()=>wt(Nt,{clip:!De}),"toggle"),stop:Et}:void 0,[Mt,Lt,wt,Nt,Et,De]),Zn=be(()=>({assets:Qe,retryAssets:A.retry,permission:P.permission,facing:q,setFacing:ee,canChooseFacing:P.canChooseFacing,voice:Re}),[Qe,A.retry,P.permission,P.canChooseFacing,q,Re]),Xn=Zr(c)?I(D,{tone:c.tone,testId:"sekyro-host-notice",children:I("span",{children:c.text})}):c??null,X=j!==null&&j.status==="retry"?j:null,Q=Ct&&j.status==="unavailable"&&!H&&j.reason!=="portrait_required"?j:null,_e=Ct&&(j.status==="approved"||j.status==="rejected"||j.status==="review")?j:null,fe=n((L,ae)=>{if(L===void 0)return null;if(L==="device_cooldown"){let ye=Ut(t,ae);if(ye!==null)return v(ye.key).replace("{time}",ye.time)}let ne=Ot(L);return ne===null?null:v(ne)},"reasonText"),Qn=Q!==null&&Q.reason!==void 0&&Q.reason!=="nni_unbound"&&Q.reason!=="method_required"&&Q.reason!=="mobile_required"&&!(Q.reason==="no_recorder"&&a.artifacts?.degraded==="NO_RECORDER"),Pt=$e(),Jn=H&&w.auto===null&&!B&&!te&&a.error===null,ot=Xe(async L=>{await w.select(L)&&a.state==="done"&&a.retry()},[w.select,a.state,a.retry]);return ue(()=>{w.auto!==null&&!w.busy&&!B&&!te&&ot(w.auto)},[w.auto,w.busy,B,te,ot]),I(Ft,{value:v,children:Te("div",{ref:Ke,className:x===void 0?"sekyro-capture":`sekyro-capture ${x}`,dir:M,lang:t,"data-testid":"sekyro-liveness-capture","data-state":a.state,children:[r?.header,X!==null&&fe(X.reason)!==null&&!(Je&&He)?I(D,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:I("span",{children:fe(X.reason)})}):null,U&&te&&!Je?I(D,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:I("span",{children:v("capture.busy")})}):null,E.required&&Se?I(D,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:I("span",{children:v("reasons.mobile_required")})}):null,a.error!==null?r?.errorPanel!==void 0?r.errorPanel(a.error,a.retry):Te(D,{tone:"danger",testId:"sekyro-error-notice",children:[I("span",{children:v(Kt(a.error.kind))}),a.error.retryable?I(T,{ref:Pt,kind:"ghost",className:"sekyro-btn--start",onClick:a.retry,children:v("common.retry")}):null]}):null,Q!==null?Te(D,{tone:"danger",testId:"sekyro-unavailable-notice",children:[I("span",{children:fe(Q.reason)??v(Q.reason===void 0?"errors.session_expired":"errors.network_error")}),Qn?I(T,{ref:Pt,kind:"ghost",className:"sekyro-btn--start",onClick:a.retry,children:v("capture.recordAgain")}):null]}):null,_e!==null&&fe(_e.reason)!==null?I(D,{tone:_e.status==="rejected"?"danger":"info",testId:"sekyro-result-notice",children:I("span",{children:fe(_e.reason,_e.retryAfter)})}):null,I("div",{className:He?void 0:"sekyro-hidden","data-capture-live":He?"":void 0,children:Je?O({videoRef:F,guidance:Ve&&pe?v("capture.checking"):tt,coached:et&&!(Ve&&pe),note:Ve?pe?v(U?"capture.busy":"capture.checkingHint"):null:X!==null?fe(X.reason):null,settled:Ve&&pe,progress:a.gate.progress,phase:St,still:Ve?kt:null,live:He}):I(pn,{videoRef:F,guidanceText:tt,guidanceHint:Fe,guidanceKey:ie,progress:a.gate.progress,phase:St,draining:a.draining,stillUrl:kt,showChecking:pe,onSwitchCamera:Wn,canSwitchCamera:B&&a.state!=="recording",voicePrompt:Yn,overlay:r?.stageOverlay,reduceMotion:a.reduceMotion})}),Jn&&w.choice!==null?I(Vn,{choice:w.choice,busy:w.busy,failed:w.failed,focus:a.state==="done",onSelect:L=>{ot(L)}}):null,jn?Te(Jr,{children:[oe&&r?.header===void 0?Te("div",{className:"sekyro-stack sekyro-stack--1",children:[I("h2",{className:"sekyro-text-body",children:v("returning.title")}),I("p",{className:"sekyro-text-muted",children:v("returning.description")})]}):null,Xn,r?.intro!==void 0?r.intro(yt,Zn):I(bn,{assets:Qe,onRetryAssets:A.retry,permission:P.permission,canChooseFacing:P.canChooseFacing,facing:q,onFacingChange:ee,voice:Re,tips:V??qe,...At!==void 0?{summary:At}:{},...p!==void 0?{startLabel:p}:{},startDisabled:u,onStart:yt})]}):null,I(fn,{showCoaching:X!==null,attemptsText:X?.attemptsRemaining!==void 0?Gt(K,t,X.attemptsRemaining):null,showRetake:X!==null&&!B&&!te||!pe&&a.state==="captured",onRetake:a.retry}),r?.footer]})})}n(_i,"LivenessCapture");export{yn as a,qe as b,Vn as c,je as d,Wr as e,_i as f};
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{g as p}from"./chunk-BJJZ4MO5.js";import{a as t}from"./chunk-Q232JYNO.js";import{a as k,b as f}from"./chunk-63NUMQST.js";import{a as n,b as l}from"./chunk-4RUZQW5T.js";import{useId as y}from"react";import{Fragment as g,jsx as e,jsxs as s}from"react/jsx-runtime";function d(){let r=`sekyro-face-light-${y().replace(/[^A-Za-z0-9_-]/g,"")}`;return s("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[e("defs",{children:e("mask",{id:r,children:e("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),e("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),e("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),e("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),e("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${r})`})]})}n(d,"FaceMark");var u={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function x({start:r,context:o,tips:c,tipsTitle:m}){let{t:a}=p();return s("section",{className:"sekyro-step",children:[e(d,{}),e(k,{title:a("native.face.introTitle"),lead:a("native.face.introLead")}),m!==void 0?e("p",{className:"sekyro-section-label",children:m}):null,e("ul",{className:"sekyro-tiprows",children:c!==void 0?c.map(i=>s("li",{children:[e(t,{name:u[i.id]??"face"}),i.text]},i.id)):s(g,{children:[s("li",{children:[e(t,{name:"light"}),a("capture.tips.light")]}),s("li",{children:[e(t,{name:"jGlasses"}),a("capture.tips.uncover")]}),s("li",{children:[e(t,{name:"smartphone"}),a("capture.tips.eyeLevel")]})]})}),o.assets==="failed"?e(l,{kind:"ghost",onClick:o.retryAssets,children:a("common.refresh")}):null,e(f,{children:s(l,{full:!0,disabled:o.assets!=="ready","aria-busy":o.assets==="loading"||void 0,onClick:r,children:[e(t,{name:"camera"}),a("capture.start")]})})]})}n(x,"FaceIntro");export{x as a};